diff options
Diffstat (limited to 'libswscale/yuv2rgb_template.c')
-rw-r--r-- | libswscale/yuv2rgb_template.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/libswscale/yuv2rgb_template.c b/libswscale/yuv2rgb_template.c index 1f8e225baa..e8b6ff30cf 100644 --- a/libswscale/yuv2rgb_template.c +++ b/libswscale/yuv2rgb_template.c @@ -31,7 +31,7 @@ #undef SFENCE #ifdef HAVE_3DNOW -/* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */ +/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ #define EMMS "femms" #else #define EMMS "emms" @@ -133,8 +133,8 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr h_size= (c->dstW+7)&~7; if(h_size*2 > FFABS(dstStride[0])) h_size-=8; - asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); - //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], + __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); + //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], //srcStride[0],srcStride[1],srcStride[2],dstStride[0]); for (y= 0; y<srcSliceH; y++ ) { uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; @@ -143,13 +143,12 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr uint8_t *pv = src[2] + (y>>1)*srcStride[2]; long index= -h_size/2; - b5Dither= ff_dither8[y&1]; - g6Dither= ff_dither4[y&1]; - g5Dither= ff_dither8[y&1]; - r5Dither= ff_dither8[(y+1)&1]; + c->blueDither= ff_dither8[y&1]; + c->greenDither= ff_dither4[y&1]; + c->redDither= ff_dither8[(y+1)&1]; /* This MMX assembly code deals with a SINGLE scan line at a time, * it converts 8 pixels in each iteration. */ - asm volatile ( + __asm__ volatile ( /* load data for start of next scan line */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ @@ -165,9 +164,9 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr YUV2RGB #ifdef DITHER1XBPP - "paddusb "MANGLE(b5Dither)", %%mm0;" - "paddusb "MANGLE(g6Dither)", %%mm2;" - "paddusb "MANGLE(r5Dither)", %%mm1;" + "paddusb "BLUE_DITHER"(%4), %%mm0;" + "paddusb "GREEN_DITHER"(%4), %%mm2;" + "paddusb "RED_DITHER"(%4), %%mm1;" #endif /* mask unneeded bits off */ "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */ @@ -211,7 +210,7 @@ YUV2RGB ); } - asm volatile (EMMS); + __asm__ volatile (EMMS); return srcSliceH; } @@ -228,8 +227,8 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr h_size= (c->dstW+7)&~7; if(h_size*2 > FFABS(dstStride[0])) h_size-=8; - asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); - //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], + __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); + //printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0], //srcStride[0],srcStride[1],srcStride[2],dstStride[0]); for (y= 0; y<srcSliceH; y++ ) { uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; @@ -238,13 +237,12 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr uint8_t *pv = src[2] + (y>>1)*srcStride[2]; long index= -h_size/2; - b5Dither= ff_dither8[y&1]; - g6Dither= ff_dither4[y&1]; - g5Dither= ff_dither8[y&1]; - r5Dither= ff_dither8[(y+1)&1]; + c->blueDither= ff_dither8[y&1]; + c->greenDither= ff_dither8[y&1]; + c->redDither= ff_dither8[(y+1)&1]; /* This MMX assembly code deals with a SINGLE scan line at a time, * it converts 8 pixels in each iteration. */ - asm volatile ( + __asm__ volatile ( /* load data for start of next scan line */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ @@ -254,9 +252,9 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr YUV2RGB #ifdef DITHER1XBPP - "paddusb "MANGLE(b5Dither)", %%mm0 \n\t" - "paddusb "MANGLE(g5Dither)", %%mm2 \n\t" - "paddusb "MANGLE(r5Dither)", %%mm1 \n\t" + "paddusb "BLUE_DITHER"(%4), %%mm0 \n\t" + "paddusb "GREEN_DITHER"(%4), %%mm2 \n\t" + "paddusb "RED_DITHER"(%4), %%mm1 \n\t" #endif /* mask unneeded bits off */ @@ -301,7 +299,7 @@ YUV2RGB ); } - asm volatile (EMMS); + __asm__ volatile (EMMS); return srcSliceH; } @@ -317,7 +315,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr h_size= (c->dstW+7)&~7; if(h_size*3 > FFABS(dstStride[0])) h_size-=8; - asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); + __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); for (y= 0; y<srcSliceH; y++ ) { uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; @@ -328,7 +326,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr /* This MMX assembly code deals with a SINGLE scan line at a time, * it converts 8 pixels in each iteration. */ - asm volatile ( + __asm__ volatile ( /* load data for start of next scan line */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ @@ -447,7 +445,7 @@ YUV2RGB ); } - asm volatile (EMMS); + __asm__ volatile (EMMS); return srcSliceH; } @@ -463,7 +461,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr h_size= (c->dstW+7)&~7; if(h_size*4 > FFABS(dstStride[0])) h_size-=8; - asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); + __asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ ); for (y= 0; y<srcSliceH; y++ ) { uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0]; @@ -474,7 +472,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr /* This MMX assembly code deals with a SINGLE scan line at a time, * it converts 8 pixels in each iteration. */ - asm volatile ( + __asm__ volatile ( /* load data for start of next scan line */ "movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */ "movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ @@ -533,6 +531,6 @@ YUV2RGB ); } - asm volatile (EMMS); + __asm__ volatile (EMMS); return srcSliceH; } |