From 75ca1a5f70956670e9e8af30fb5b92afa0cddadf Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Wed, 5 Apr 2006 04:13:41 +0000 Subject: [PATCH] gmc_mmx tweaks Originally committed as revision 5269 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/i386/dsputil_mmx.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c index c315e196eb..2bef197cea 100644 --- a/libavcodec/i386/dsputil_mmx.c +++ b/libavcodec/i386/dsputil_mmx.c @@ -2406,7 +2406,6 @@ static void just_return() { return; } static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height){ const int w = 8; - const int s = 1<>(16+shift); const int iy = oy>>(16+shift); const int oxs = ox>>4; @@ -2437,14 +2436,21 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int o return; } + src += ix + iy*stride; if( (unsigned)ix >= width-w || (unsigned)iy >= height-h ) { - ff_emulated_edge_mc(edge_buf, src+ix+iy*stride, stride, w+1, h+1, ix, iy, width, height); + ff_emulated_edge_mc(edge_buf, src, stride, w+1, h+1, ix, iy, width, height); src = edge_buf; } - else - src += ix + iy*stride; + + asm volatile( + "movd %0, %%mm6 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "punpcklwd %%mm6, %%mm6 \n\t" + "punpcklwd %%mm6, %%mm6 \n\t" + :: "r"(1<