diff options
-rw-r--r-- | libswscale/x86/rgb2rgb_template.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index a10f268009..b56e15cf36 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -1434,7 +1434,9 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid dst+= dstStride; for (y=1; y<srcHeight; y++) { - const x86_reg mmxSize= srcWidth&~15; + x86_reg mmxSize= srcWidth&~15; + + if (mmxSize) { __asm__ volatile( "mov %4, %%"REG_a" \n\t" "movq "MANGLE(mmx_ff)", %%mm0 \n\t" @@ -1481,6 +1483,11 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid NAMED_CONSTRAINTS_ADD(mmx_ff) : "%"REG_a ); + } else { + mmxSize = 1; + dst[0] = (src[0] * 3 + src[srcStride]) >> 2; + dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2; + } for (x=mmxSize-1; x<srcWidth-1; x++) { dst[2*x +1]= (3*src[x+0] + src[x+srcStride+1])>>2; |