diff options
author | Zdenek Kabelac <kabi@informatics.muni.cz> | 2003-02-10 09:35:32 +0000 |
---|---|---|
committer | Zdenek Kabelac <kabi@informatics.muni.cz> | 2003-02-10 09:35:32 +0000 |
commit | 5c91a6755b6412c918e20ff4735ca30f38a12569 (patch) | |
tree | 054521cdfc6d752e89883ef3fcfc05d6c31fd94c /libavcodec/i386 | |
parent | cd66005ddaebba2d6cb3b4eae75f70ae2446b204 (diff) | |
download | ffmpeg-5c91a6755b6412c918e20ff4735ca30f38a12569.tar.gz |
* static,const,compiler warning cleanup
Originally committed as revision 1567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/i386')
-rw-r--r-- | libavcodec/i386/dsputil_mmx.c | 68 | ||||
-rw-r--r-- | libavcodec/i386/motion_est_mmx.c | 77 |
2 files changed, 67 insertions, 78 deletions
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c index 857f1d3985..6b18ba0152 100644 --- a/libavcodec/i386/dsputil_mmx.c +++ b/libavcodec/i386/dsputil_mmx.c @@ -23,30 +23,7 @@ int mm_flags; /* multimedia extension flags */ /* FIXME use them in static form */ -int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); - -int pix_abs16x16_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs16x16_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); - -int pix_abs8x8_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); - -int pix_abs8x8_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); -int pix_abs8x8_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); - -int sad16x16_mmx(void *s, UINT8 *blk1, UINT8 *blk2, int lx); -int sad8x8_mmx(void *s, UINT8 *blk1, UINT8 *blk2, int lx); -int sad16x16_mmx2(void *s, UINT8 *blk1, UINT8 *blk2, int lx); -int sad8x8_mmx2(void *s, UINT8 *blk1, UINT8 *blk2, int lx); +void dsputil_init_pix_mmx(DSPContext* c, unsigned mask); /* pixel operations */ static const uint64_t mm_bone __attribute__ ((aligned(8))) = 0x0101010101010101ULL; @@ -777,7 +754,7 @@ WARPER88_1616(hadamard8_diff_mmx, hadamard8_diff16_mmx) OP(%%mm5, out, %%mm7, d) #define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMX2, OP_3DNOW)\ -void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ +static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ uint64_t temp;\ \ asm volatile(\ @@ -944,7 +921,7 @@ static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, i }\ }\ \ -void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ +static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ uint64_t temp;\ \ asm volatile(\ @@ -1121,7 +1098,7 @@ static void OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, );\ }\ \ -void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ +static void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ uint64_t temp[9*4];\ uint64_t *temp_ptr= temp;\ int count= 9;\ @@ -1460,15 +1437,6 @@ void dsputil_init_mmx(DSPContext* c, unsigned mask) c->clear_blocks = clear_blocks_mmx; c->pix_sum = pix_sum16_mmx; - c->pix_abs16x16 = pix_abs16x16_mmx; - c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; - c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; - c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; - c->pix_abs8x8 = pix_abs8x8_mmx; - c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; - c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; - c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; - c->put_pixels_tab[0][0] = put_pixels16_mmx; c->put_pixels_tab[0][1] = put_pixels16_x2_mmx; c->put_pixels_tab[0][2] = put_pixels16_y2_mmx; @@ -1515,26 +1483,10 @@ void dsputil_init_mmx(DSPContext* c, unsigned mask) c->hadamard8_diff[0]= hadamard8_diff16_mmx; c->hadamard8_diff[1]= hadamard8_diff_mmx; - c->sad[0]= sad16x16_mmx; - c->sad[1]= sad8x8_mmx; - c->pix_norm1 = pix_norm1_mmx; c->sse[0] = sse16_mmx; if (mm_flags & MM_MMXEXT) { - c->pix_abs16x16 = pix_abs16x16_mmx2; - c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx2; - c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx2; - c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx2; - - c->pix_abs8x8 = pix_abs8x8_mmx2; - c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx2; - c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx2; - c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx2; - - c->sad[0]= sad16x16_mmx2; - c->sad[1]= sad8x8_mmx2; - c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2; c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2; c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2; @@ -1644,7 +1596,7 @@ void dsputil_init_mmx(DSPContext* c, unsigned mask) SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_3dnow) } } - + dsputil_init_pix_mmx(c, mask); #if 0 // for speed testing get_pixels = just_return; @@ -1694,14 +1646,6 @@ void dsputil_set_bit_exact_mmx(DSPContext* c, unsigned mask) c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx; c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx; c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx; - - if (mm_flags & MM_MMXEXT) { - c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; - c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; - c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; - c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; - c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; - c->pix_abs8x8_xy2= pix_abs8x8_xy2_mmx; - } } + dsputil_set_bit_exact_pix_mmx(c, mask); } diff --git a/libavcodec/i386/motion_est_mmx.c b/libavcodec/i386/motion_est_mmx.c index fa85db67b6..ec4f3ba633 100644 --- a/libavcodec/i386/motion_est_mmx.c +++ b/libavcodec/i386/motion_est_mmx.c @@ -20,6 +20,9 @@ */ #include "../dsputil.h" +void dsputil_init_pix_mmx(DSPContext* c, unsigned mask); +void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask); + static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={ 0x0000000000000000, 0x0001000100010001, @@ -118,7 +121,7 @@ static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h) asm volatile( ".balign 16 \n\t" "movq "MANGLE(bone)", %%mm5 \n\t" - "1: \n\t" + "1: \n\t" "movq (%1, %%eax), %%mm0 \n\t" "movq (%2, %%eax), %%mm2 \n\t" "movq 1(%1, %%eax), %%mm1 \n\t" @@ -165,7 +168,7 @@ static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int strid "punpckhbw %%mm7, %%mm3 \n\t" "paddw %%mm0, %%mm1 \n\t" "paddw %%mm2, %%mm3 \n\t" - "movq (%3, %%eax), %%mm4 \n\t" + "movq (%3, %%eax), %%mm4 \n\t" "movq (%3, %%eax), %%mm2 \n\t" "paddw %%mm5, %%mm1 \n\t" "paddw %%mm5, %%mm3 \n\t" @@ -215,8 +218,8 @@ static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h) "punpckhbw %%mm7, %%mm4 \n\t" "paddw %%mm3, %%mm2 \n\t" "paddw %%mm4, %%mm1 \n\t" - "movq (%3, %%eax), %%mm3 \n\t" - "movq (%3, %%eax), %%mm4 \n\t" + "movq (%3, %%eax), %%mm3 \n\t" + "movq (%3, %%eax), %%mm4 \n\t" "paddw %%mm5, %%mm2 \n\t" "paddw %%mm5, %%mm1 \n\t" "psrlw $2, %%mm2 \n\t" @@ -237,7 +240,7 @@ static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h) ); } -static inline int sum_mmx() +static inline int sum_mmx(void) { int ret; asm volatile( @@ -253,7 +256,7 @@ static inline int sum_mmx() return ret&0xFFFF; } -static inline int sum_mmx2() +static inline int sum_mmx2(void) { int ret; asm volatile( @@ -265,7 +268,7 @@ static inline int sum_mmx2() #define PIX_SAD(suf)\ -int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t":);\ @@ -274,7 +277,7 @@ int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ \ return sum_ ## suf();\ }\ -int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ +static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t":);\ @@ -284,7 +287,7 @@ int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ return sum_ ## suf();\ }\ \ -int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -297,7 +300,7 @@ int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ return sum_ ## suf();\ }\ \ -int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -310,7 +313,7 @@ int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ return sum_ ## suf();\ }\ \ -int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -323,7 +326,7 @@ int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ return sum_ ## suf();\ }\ \ -int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t":);\ @@ -333,7 +336,7 @@ int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ \ return sum_ ## suf();\ }\ -int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ +static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t":);\ @@ -343,7 +346,7 @@ int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\ \ return sum_ ## suf();\ }\ -int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -356,7 +359,7 @@ int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ \ return sum_ ## suf();\ }\ -int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -369,7 +372,7 @@ int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ \ return sum_ ## suf();\ }\ -int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ +static int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ {\ asm volatile("pxor %%mm7, %%mm7 \n\t"\ "pxor %%mm6, %%mm6 \n\t"\ @@ -385,3 +388,45 @@ int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\ PIX_SAD(mmx) PIX_SAD(mmx2) + +void dsputil_init_pix_mmx(DSPContext* c, unsigned mask) +{ + if (mm_flags & MM_MMX) { + c->pix_abs16x16 = pix_abs16x16_mmx; + c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; + c->pix_abs8x8 = pix_abs8x8_mmx; + c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; + c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; + c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; + + c->sad[0]= sad16x16_mmx; + c->sad[1]= sad8x8_mmx; + } + if (mm_flags & MM_MMXEXT) { + c->pix_abs16x16 = pix_abs16x16_mmx2; + c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx2; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx2; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx2; + c->pix_abs8x8 = pix_abs8x8_mmx2; + c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx2; + c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx2; + c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx2; + + c->sad[0]= sad16x16_mmx2; + c->sad[1]= sad8x8_mmx2; + } +} + +void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask) +{ + if (mm_flags & MM_MMXEXT) { + c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; + c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; + c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; + c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; + } +} |