diff options
author | Christophe Gisquet <christophe.gisquet@free.fr> | 2007-12-21 23:11:22 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2007-12-21 23:11:22 +0000 |
commit | 9fa35729039c1ccc3bc6ee9a10d3c613d88434cb (patch) | |
tree | 04fcf7aca57f53e9ac97c559bcd2f1f83caf13d1 /libavcodec/i386/dsputil_h264_template_mmx.c | |
parent | 82ed1ca75dac2714b090d590c8d35a3cf2fc4ad2 (diff) | |
download | ffmpeg-9fa35729039c1ccc3bc6ee9a10d3c613d88434cb.tar.gz |
add MMX version for put_no_rnd_h264_chroma_mc8_c, used in VC-1 decoding.
patch by Christophe GISQUET %christophe P gisquet A free P fr%
original thread:
date: Nov 25, 2007 12:35 AM
subject: Re: [FFmpeg-devel] MMX version for put_no_rnd_h264_chroma_mc8_c
Originally committed as revision 11298 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/i386/dsputil_h264_template_mmx.c')
-rw-r--r-- | libavcodec/i386/dsputil_h264_template_mmx.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/i386/dsputil_h264_template_mmx.c b/libavcodec/i386/dsputil_h264_template_mmx.c index e3da92fc19..a66f51e6b9 100644 --- a/libavcodec/i386/dsputil_h264_template_mmx.c +++ b/libavcodec/i386/dsputil_h264_template_mmx.c @@ -25,8 +25,10 @@ * H264_CHROMA_OP must be defined to empty for put and pavgb/pavgusb for avg * H264_CHROMA_MC8_MV0 must be defined to a (put|avg)_pixels8 function */ -static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y) +static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y, int rnd) { + DECLARE_ALIGNED_8(static const uint64_t, ff_pw_28) = 0x001C001C001C001CULL; + const uint64_t *rnd_reg; DECLARE_ALIGNED_8(uint64_t, AA); DECLARE_ALIGNED_8(uint64_t, DD); int i; @@ -44,16 +46,17 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1* /* 1 dimensional filter only */ const int dxy = x ? 1 : stride; + rnd_reg = rnd ? &ff_pw_4 : &ff_pw_3; + asm volatile( "movd %0, %%mm5\n\t" "movq %1, %%mm4\n\t" + "movq %2, %%mm6\n\t" /* mm6 = rnd */ "punpcklwd %%mm5, %%mm5\n\t" "punpckldq %%mm5, %%mm5\n\t" /* mm5 = B = x */ - "movq %%mm4, %%mm6\n\t" "pxor %%mm7, %%mm7\n\t" "psubw %%mm5, %%mm4\n\t" /* mm4 = A = 8-x */ - "psrlw $1, %%mm6\n\t" /* mm6 = 4 */ - :: "rm"(x+y), "m"(ff_pw_8)); + :: "rm"(x+y), "m"(ff_pw_8), "m"(*rnd_reg)); for(i=0; i<h; i++) { asm volatile( @@ -95,6 +98,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1* } /* general case, bilinear */ + rnd_reg = rnd ? &ff_pw_32 : &ff_pw_28; asm volatile("movd %2, %%mm4\n\t" "movd %3, %%mm6\n\t" "punpcklwd %%mm4, %%mm4\n\t" @@ -177,7 +181,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1* "packuswb %%mm3, %%mm2\n\t" H264_CHROMA_OP(%0, %%mm2) "movq %%mm2, %0\n\t" - : "=m" (dst[0]) : "m" (ff_pw_32)); + : "=m" (dst[0]) : "m" (*rnd_reg)); dst+= stride; } } |