dsputil_arm.c File Reference

#include "libavcodec/dsputil.h"

Go to the source code of this file.

Functions

void dsputil_init_iwmmxt (DSPContext *c, AVCodecContext *avctx)
void ff_float_init_arm_vfp (DSPContext *c, AVCodecContext *avctx)
void j_rev_dct_ARM (DCTELEM *data)
void simple_idct_ARM (DCTELEM *data)
void simple_idct_armv5te (DCTELEM *data)
void simple_idct_put_armv5te (uint8_t *dest, int line_size, DCTELEM *data)
void simple_idct_add_armv5te (uint8_t *dest, int line_size, DCTELEM *data)
void ff_simple_idct_armv6 (DCTELEM *data)
void ff_simple_idct_put_armv6 (uint8_t *dest, int line_size, DCTELEM *data)
void ff_simple_idct_add_armv6 (uint8_t *dest, int line_size, DCTELEM *data)
void put_pixels8_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_pixels8_x2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_pixels8_y2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_pixels8_xy2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_no_rnd_pixels8_x2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_no_rnd_pixels8_y2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_no_rnd_pixels8_xy2_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
void put_pixels16_arm (uint8_t *block, const uint8_t *pixels, int line_size, int h)
static void add_pixels_clamped_ARM (short *block, unsigned char *dest, int line_size)
static void j_rev_dct_ARM_put (uint8_t *dest, int line_size, DCTELEM *block)
static void j_rev_dct_ARM_add (uint8_t *dest, int line_size, DCTELEM *block)
static void simple_idct_ARM_put (uint8_t *dest, int line_size, DCTELEM *block)
static void simple_idct_ARM_add (uint8_t *dest, int line_size, DCTELEM *block)
int mm_support (void)
void dsputil_init_armv4l (DSPContext *c, AVCodecContext *avctx)

Variables

static void(*) ff_put_pixels_clamped (const DCTELEM *block, uint8_t *pixels, int line_size)
static void(*) ff_add_pixels_clamped (const DCTELEM *block, uint8_t *pixels, int line_size)


Function Documentation

static void add_pixels_clamped_ARM ( short *  block,
unsigned char *  dest,
int  line_size 
) [static]

Definition at line 67 of file dsputil_arm.c.

00068 {
00069     asm volatile (
00070                   "mov r10, #8 \n\t"
00071 
00072                   "1: \n\t"
00073 
00074                   /* load dest */
00075                   "ldr r4, [%1] \n\t"
00076                   /* block[0] and block[1]*/
00077                   "ldrsh r5, [%0] \n\t"
00078                   "ldrsh r7, [%0, #2] \n\t"
00079                   "and r6, r4, #0xFF \n\t"
00080                   "and r8, r4, #0xFF00 \n\t"
00081                   "add r6, r5, r6 \n\t"
00082                   "add r8, r7, r8, lsr #8 \n\t"
00083                   "mvn r5, r5 \n\t"
00084                   "mvn r7, r7 \n\t"
00085                   "tst r6, #0x100 \n\t"
00086                   "movne r6, r5, lsr #24 \n\t"
00087                   "tst r8, #0x100 \n\t"
00088                   "movne r8, r7, lsr #24 \n\t"
00089                   "mov r9, r6 \n\t"
00090                   "ldrsh r5, [%0, #4] \n\t" /* moved form [A] */
00091                   "orr r9, r9, r8, lsl #8 \n\t"
00092                   /* block[2] and block[3] */
00093                   /* [A] */
00094                   "ldrsh r7, [%0, #6] \n\t"
00095                   "and r6, r4, #0xFF0000 \n\t"
00096                   "and r8, r4, #0xFF000000 \n\t"
00097                   "add r6, r5, r6, lsr #16 \n\t"
00098                   "add r8, r7, r8, lsr #24 \n\t"
00099                   "mvn r5, r5 \n\t"
00100                   "mvn r7, r7 \n\t"
00101                   "tst r6, #0x100 \n\t"
00102                   "movne r6, r5, lsr #24 \n\t"
00103                   "tst r8, #0x100 \n\t"
00104                   "movne r8, r7, lsr #24 \n\t"
00105                   "orr r9, r9, r6, lsl #16 \n\t"
00106                   "ldr r4, [%1, #4] \n\t"       /* moved form [B] */
00107                   "orr r9, r9, r8, lsl #24 \n\t"
00108                   /* store dest */
00109                   "ldrsh r5, [%0, #8] \n\t" /* moved form [C] */
00110                   "str r9, [%1] \n\t"
00111 
00112                   /* load dest */
00113                   /* [B] */
00114                   /* block[4] and block[5] */
00115                   /* [C] */
00116                   "ldrsh r7, [%0, #10] \n\t"
00117                   "and r6, r4, #0xFF \n\t"
00118                   "and r8, r4, #0xFF00 \n\t"
00119                   "add r6, r5, r6 \n\t"
00120                   "add r8, r7, r8, lsr #8 \n\t"
00121                   "mvn r5, r5 \n\t"
00122                   "mvn r7, r7 \n\t"
00123                   "tst r6, #0x100 \n\t"
00124                   "movne r6, r5, lsr #24 \n\t"
00125                   "tst r8, #0x100 \n\t"
00126                   "movne r8, r7, lsr #24 \n\t"
00127                   "mov r9, r6 \n\t"
00128                   "ldrsh r5, [%0, #12] \n\t" /* moved from [D] */
00129                   "orr r9, r9, r8, lsl #8 \n\t"
00130                   /* block[6] and block[7] */
00131                   /* [D] */
00132                   "ldrsh r7, [%0, #14] \n\t"
00133                   "and r6, r4, #0xFF0000 \n\t"
00134                   "and r8, r4, #0xFF000000 \n\t"
00135                   "add r6, r5, r6, lsr #16 \n\t"
00136                   "add r8, r7, r8, lsr #24 \n\t"
00137                   "mvn r5, r5 \n\t"
00138                   "mvn r7, r7 \n\t"
00139                   "tst r6, #0x100 \n\t"
00140                   "movne r6, r5, lsr #24 \n\t"
00141                   "tst r8, #0x100 \n\t"
00142                   "movne r8, r7, lsr #24 \n\t"
00143                   "orr r9, r9, r6, lsl #16 \n\t"
00144                   "add %0, %0, #16 \n\t" /* moved from [E] */
00145                   "orr r9, r9, r8, lsl #24 \n\t"
00146                   "subs r10, r10, #1 \n\t" /* moved from [F] */
00147                   /* store dest */
00148                   "str r9, [%1, #4] \n\t"
00149 
00150                   /* [E] */
00151                   /* [F] */
00152                   "add %1, %1, %2 \n\t"
00153                   "bne 1b \n\t"
00154                   : "+r"(block),
00155                     "+r"(dest)
00156                   : "r"(line_size)
00157                   : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "cc", "memory" );
00158 }

void dsputil_init_armv4l ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 211 of file dsputil_arm.c.

References c, dsputil_init_iwmmxt(), ff_add_pixels_clamped, ff_float_init_arm_vfp(), FF_IDCT_ARM, FF_IDCT_AUTO, FF_IDCT_IPP, FF_IDCT_SIMPLEARM, FF_IDCT_SIMPLEARMV5TE, FF_IDCT_SIMPLEARMV6, FF_LIBMPEG2_IDCT_PERM, FF_NO_IDCT_PERM, ff_put_pixels_clamped, ff_simple_idct_add_armv6(), ff_simple_idct_armv6(), ff_simple_idct_put_armv6(), AVCodecContext::idct_algo, j_rev_dct_ARM(), j_rev_dct_ARM_add(), j_rev_dct_ARM_put(), AVCodecContext::lowres, put_no_rnd_pixels8_x2_arm(), put_no_rnd_pixels8_xy2_arm(), put_no_rnd_pixels8_y2_arm(), put_pixels16_arm(), put_pixels8_arm(), put_pixels8_x2_arm(), put_pixels8_xy2_arm(), put_pixels8_y2_arm(), simple_idct_add_armv5te(), simple_idct_ARM(), simple_idct_ARM_add(), simple_idct_ARM_put(), simple_idct_armv5te(), and simple_idct_put_armv5te().

Referenced by dsputil_init().

00212 {
00213     int idct_algo= avctx->idct_algo;
00214 
00215     ff_put_pixels_clamped = c->put_pixels_clamped;
00216     ff_add_pixels_clamped = c->add_pixels_clamped;
00217 
00218     if (avctx->lowres == 0) {
00219         if(idct_algo == FF_IDCT_AUTO){
00220 #if defined(HAVE_IPP)
00221             idct_algo = FF_IDCT_IPP;
00222 #elif defined(HAVE_ARMV6)
00223             idct_algo = FF_IDCT_SIMPLEARMV6;
00224 #elif defined(HAVE_ARMV5TE)
00225             idct_algo = FF_IDCT_SIMPLEARMV5TE;
00226 #else
00227             idct_algo = FF_IDCT_ARM;
00228 #endif
00229         }
00230 
00231         if(idct_algo==FF_IDCT_ARM){
00232             c->idct_put= j_rev_dct_ARM_put;
00233             c->idct_add= j_rev_dct_ARM_add;
00234             c->idct    = j_rev_dct_ARM;
00235             c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
00236         } else if (idct_algo==FF_IDCT_SIMPLEARM){
00237             c->idct_put= simple_idct_ARM_put;
00238             c->idct_add= simple_idct_ARM_add;
00239             c->idct    = simple_idct_ARM;
00240             c->idct_permutation_type= FF_NO_IDCT_PERM;
00241 #ifdef HAVE_ARMV6
00242         } else if (idct_algo==FF_IDCT_SIMPLEARMV6){
00243             c->idct_put= ff_simple_idct_put_armv6;
00244             c->idct_add= ff_simple_idct_add_armv6;
00245             c->idct    = ff_simple_idct_armv6;
00246             c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
00247 #endif
00248 #ifdef HAVE_ARMV5TE
00249         } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){
00250             c->idct_put= simple_idct_put_armv5te;
00251             c->idct_add= simple_idct_add_armv5te;
00252             c->idct    = simple_idct_armv5te;
00253             c->idct_permutation_type = FF_NO_IDCT_PERM;
00254 #endif
00255 #ifdef HAVE_IPP
00256         } else if (idct_algo==FF_IDCT_IPP){
00257             c->idct_put= simple_idct_ipp_put;
00258             c->idct_add= simple_idct_ipp_add;
00259             c->idct    = simple_idct_ipp;
00260             c->idct_permutation_type= FF_NO_IDCT_PERM;
00261 #endif
00262         }
00263     }
00264 
00265     c->put_pixels_tab[0][0] = put_pixels16_arm;
00266     c->put_pixels_tab[0][1] = put_pixels16_x2_arm; //OK!
00267     c->put_pixels_tab[0][2] = put_pixels16_y2_arm; //OK!
00268     c->put_pixels_tab[0][3] = put_pixels16_xy2_arm;
00269     c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm;
00270     c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_arm; // OK
00271     c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_arm; //OK
00272     c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_arm;
00273     c->put_pixels_tab[1][0] = put_pixels8_arm; //OK
00274     c->put_pixels_tab[1][1] = put_pixels8_x2_arm; //OK
00275     c->put_pixels_tab[1][2] = put_pixels8_y2_arm;
00276     c->put_pixels_tab[1][3] = put_pixels8_xy2_arm;
00277     c->put_no_rnd_pixels_tab[1][0] = put_pixels8_arm;//OK
00278     c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_arm; //OK
00279     c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
00280     c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;
00281 
00282 #ifdef HAVE_IWMMXT
00283     dsputil_init_iwmmxt(c, avctx);
00284 #endif
00285 #ifdef HAVE_ARMVFP
00286     ff_float_init_arm_vfp(c, avctx);
00287 #endif
00288 }

void dsputil_init_iwmmxt ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 155 of file dsputil_iwmmxt.c.

References add_pixels_clamped_iwmmxt(), c, clear_blocks_iwmmxt(), AVCodecContext::dsp_mask, FF_MM_FORCE, mm_flags, put_no_rnd_pixels8_y2_iwmmxt(), and put_pixels8_y2_iwmmxt().

Referenced by dsputil_init_armv4l().

00156 {
00157     if (avctx->dsp_mask) {
00158         if (avctx->dsp_mask & FF_MM_FORCE)
00159             mm_flags |= (avctx->dsp_mask & 0xffff);
00160         else
00161             mm_flags &= ~(avctx->dsp_mask & 0xffff);
00162     }
00163 
00164     if (!(mm_flags & MM_IWMMXT)) return;
00165 
00166     c->add_pixels_clamped = add_pixels_clamped_iwmmxt;
00167 
00168     c->clear_blocks = clear_blocks_iwmmxt;
00169 
00170     c->put_pixels_tab[0][0] = put_pixels16_iwmmxt;
00171     c->put_pixels_tab[0][1] = put_pixels16_x2_iwmmxt;
00172     c->put_pixels_tab[0][2] = put_pixels16_y2_iwmmxt;
00173     c->put_pixels_tab[0][3] = put_pixels16_xy2_iwmmxt;
00174     c->put_no_rnd_pixels_tab[0][0] = put_pixels16_iwmmxt;
00175     c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_iwmmxt;
00176     c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_iwmmxt;
00177     c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_iwmmxt;
00178 
00179     c->put_pixels_tab[1][0] = put_pixels8_iwmmxt;
00180     c->put_pixels_tab[1][1] = put_pixels8_x2_iwmmxt;
00181     c->put_pixels_tab[1][2] = put_pixels8_y2_iwmmxt;
00182     c->put_pixels_tab[1][3] = put_pixels8_xy2_iwmmxt;
00183     c->put_no_rnd_pixels_tab[1][0] = put_pixels8_iwmmxt;
00184     c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_iwmmxt;
00185     c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_iwmmxt;
00186     c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_iwmmxt;
00187 
00188     c->avg_pixels_tab[0][0] = avg_pixels16_iwmmxt;
00189     c->avg_pixels_tab[0][1] = avg_pixels16_x2_iwmmxt;
00190     c->avg_pixels_tab[0][2] = avg_pixels16_y2_iwmmxt;
00191     c->avg_pixels_tab[0][3] = avg_pixels16_xy2_iwmmxt;
00192     c->avg_no_rnd_pixels_tab[0][0] = avg_pixels16_iwmmxt;
00193     c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_iwmmxt;
00194     c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_iwmmxt;
00195     c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_iwmmxt;
00196 
00197     c->avg_pixels_tab[1][0] = avg_pixels8_iwmmxt;
00198     c->avg_pixels_tab[1][1] = avg_pixels8_x2_iwmmxt;
00199     c->avg_pixels_tab[1][2] = avg_pixels8_y2_iwmmxt;
00200     c->avg_pixels_tab[1][3] = avg_pixels8_xy2_iwmmxt;
00201     c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels8_iwmmxt;
00202     c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_iwmmxt;
00203     c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_iwmmxt;
00204     c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_iwmmxt;
00205 }

void ff_float_init_arm_vfp ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 201 of file float_arm_vfp.c.

References c, vector_fmul_reverse_vfp(), and vector_fmul_vfp().

Referenced by dsputil_init_armv4l().

00202 {
00203     c->vector_fmul = vector_fmul_vfp;
00204     c->vector_fmul_reverse = vector_fmul_reverse_vfp;
00205 #ifdef HAVE_ARMV6
00206     c->float_to_int16 = float_to_int16_vfp;
00207 #endif
00208 }

void ff_simple_idct_add_armv6 ( uint8_t *  dest,
int  line_size,
DCTELEM data 
)

Referenced by dsputil_init_armv4l().

void ff_simple_idct_armv6 ( DCTELEM data  ) 

Referenced by dsputil_init_armv4l().

void ff_simple_idct_put_armv6 ( uint8_t *  dest,
int  line_size,
DCTELEM data 
)

Referenced by dsputil_init_armv4l().

void j_rev_dct_ARM ( DCTELEM data  ) 

Referenced by dsputil_init_armv4l(), j_rev_dct_ARM_add(), and j_rev_dct_ARM_put().

static void j_rev_dct_ARM_add ( uint8_t *  dest,
int  line_size,
DCTELEM block 
) [static]

Definition at line 167 of file dsputil_arm.c.

References ff_add_pixels_clamped, and j_rev_dct_ARM().

Referenced by dsputil_init_armv4l().

00168 {
00169     j_rev_dct_ARM (block);
00170     ff_add_pixels_clamped(block, dest, line_size);
00171 }

static void j_rev_dct_ARM_put ( uint8_t *  dest,
int  line_size,
DCTELEM block 
) [static]

Definition at line 162 of file dsputil_arm.c.

References ff_put_pixels_clamped, and j_rev_dct_ARM().

Referenced by dsputil_init_armv4l().

00163 {
00164     j_rev_dct_ARM (block);
00165     ff_put_pixels_clamped(block, dest, line_size);
00166 }

int mm_support ( void   ) 

Definition at line 206 of file dsputil_arm.c.

00207 {
00208     return ENABLE_IWMMXT * MM_IWMMXT;
00209 }

void put_no_rnd_pixels8_x2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_no_rnd_pixels8_xy2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_no_rnd_pixels8_y2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_pixels16_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_pixels8_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_pixels8_x2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_pixels8_xy2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void put_pixels8_y2_arm ( uint8_t *  block,
const uint8_t *  pixels,
int  line_size,
int  h 
)

Referenced by dsputil_init_armv4l().

void simple_idct_add_armv5te ( uint8_t *  dest,
int  line_size,
DCTELEM data 
)

Referenced by dsputil_init_armv4l().

void simple_idct_ARM ( DCTELEM data  ) 

Referenced by dsputil_init_armv4l(), simple_idct_ARM_add(), and simple_idct_ARM_put().

static void simple_idct_ARM_add ( uint8_t *  dest,
int  line_size,
DCTELEM block 
) [static]

Definition at line 177 of file dsputil_arm.c.

References ff_add_pixels_clamped, and simple_idct_ARM().

Referenced by dsputil_init_armv4l().

00178 {
00179     simple_idct_ARM (block);
00180     ff_add_pixels_clamped(block, dest, line_size);
00181 }

static void simple_idct_ARM_put ( uint8_t *  dest,
int  line_size,
DCTELEM block 
) [static]

Definition at line 172 of file dsputil_arm.c.

References ff_put_pixels_clamped, and simple_idct_ARM().

Referenced by dsputil_init_armv4l().

00173 {
00174     simple_idct_ARM (block);
00175     ff_put_pixels_clamped(block, dest, line_size);
00176 }

void simple_idct_armv5te ( DCTELEM data  ) 

Referenced by dsputil_init_armv4l().

void simple_idct_put_armv5te ( uint8_t *  dest,
int  line_size,
DCTELEM data 
)

Referenced by dsputil_init_armv4l().


Variable Documentation

void(*) ff_add_pixels_clamped(const DCTELEM *block, uint8_t *pixels, int line_size) [static]

Definition at line 47 of file dsputil_arm.c.

Referenced by dsputil_init_armv4l(), j_rev_dct_ARM_add(), and simple_idct_ARM_add().

void(*) ff_put_pixels_clamped(const DCTELEM *block, uint8_t *pixels, int line_size) [static]

Definition at line 46 of file dsputil_arm.c.

Referenced by dsputil_init_armv4l(), j_rev_dct_ARM_put(), and simple_idct_ARM_put().


Generated on Fri Jan 9 14:44:55 2009 for libextractor by  doxygen 1.5.1