|
|
|
@ -1031,7 +1031,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_ |
|
|
|
|
case PIX_FMT_RGB32: |
|
|
|
|
YSCALEYUV2PACKEDX_ACCURATE |
|
|
|
|
YSCALEYUV2RGBX |
|
|
|
|
"pxor %%mm7, %%mm7 \n\t" |
|
|
|
|
"pcmpeqd %%mm7, %%mm7 \n\t" |
|
|
|
|
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) |
|
|
|
|
|
|
|
|
|
YSCALEYUV2PACKEDX_END |
|
|
|
@ -1097,7 +1097,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_ |
|
|
|
|
case PIX_FMT_RGB32: |
|
|
|
|
YSCALEYUV2PACKEDX |
|
|
|
|
YSCALEYUV2RGBX |
|
|
|
|
"pxor %%mm7, %%mm7 \n\t" |
|
|
|
|
"pcmpeqd %%mm7, %%mm7 \n\t" |
|
|
|
|
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) |
|
|
|
|
YSCALEYUV2PACKEDX_END |
|
|
|
|
return; |
|
|
|
@ -1196,7 +1196,7 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t * |
|
|
|
|
"mov %4, %%"REG_b" \n\t" |
|
|
|
|
"push %%"REG_BP" \n\t" |
|
|
|
|
YSCALEYUV2RGB(%%REGBP, %5) |
|
|
|
|
"pxor %%mm7, %%mm7 \n\t" |
|
|
|
|
"pcmpeqd %%mm7, %%mm7 \n\t" |
|
|
|
|
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) |
|
|
|
|
"pop %%"REG_BP" \n\t" |
|
|
|
|
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
|
|
|
@ -1312,7 +1312,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * |
|
|
|
|
"mov %4, %%"REG_b" \n\t" |
|
|
|
|
"push %%"REG_BP" \n\t" |
|
|
|
|
YSCALEYUV2RGB1(%%REGBP, %5) |
|
|
|
|
"pxor %%mm7, %%mm7 \n\t" |
|
|
|
|
"pcmpeqd %%mm7, %%mm7 \n\t" |
|
|
|
|
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) |
|
|
|
|
"pop %%"REG_BP" \n\t" |
|
|
|
|
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
|
|
|
@ -1405,7 +1405,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * |
|
|
|
|
"mov %4, %%"REG_b" \n\t" |
|
|
|
|
"push %%"REG_BP" \n\t" |
|
|
|
|
YSCALEYUV2RGB1b(%%REGBP, %5) |
|
|
|
|
"pxor %%mm7, %%mm7 \n\t" |
|
|
|
|
"pcmpeqd %%mm7, %%mm7 \n\t" |
|
|
|
|
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) |
|
|
|
|
"pop %%"REG_BP" \n\t" |
|
|
|
|
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
|
|
|
@ -1642,7 +1642,7 @@ BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY |
|
|
|
|
BGR2Y(uint16_t, rgb16ToY, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RY , GY<<5, BY<<11, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY , GY<<5, BY<<10, RGB2YUV_SHIFT+7) |
|
|
|
|
|
|
|
|
|
#define BGR2UV(type, name, shr, shg, shb, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S)\ |
|
|
|
|
#define BGR2UV(type, name, shr, shg, shb, maska, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S)\ |
|
|
|
|
static inline void RENAME(name)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width, uint32_t *unused)\
|
|
|
|
|
{\
|
|
|
|
|
int i;\
|
|
|
|
@ -1663,9 +1663,10 @@ static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t * |
|
|
|
|
{\
|
|
|
|
|
int pix0= ((type*)src)[2*i+0];\
|
|
|
|
|
int pix1= ((type*)src)[2*i+1];\
|
|
|
|
|
int g= (pix0&maskg)+(pix1&maskg);\
|
|
|
|
|
int g= (pix0&(maskg|maska))+(pix1&(maskg|maska));\
|
|
|
|
|
int b= ((pix0+pix1-g)&(maskb|(2*maskb)))>>shb;\
|
|
|
|
|
int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\
|
|
|
|
|
g&= maskg|(2*maskg);\
|
|
|
|
|
\
|
|
|
|
|
g>>=shg;\
|
|
|
|
|
\
|
|
|
|
@ -1674,12 +1675,12 @@ static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t * |
|
|
|
|
}\
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BGR2UV(uint32_t, bgr32ToUV,16, 0, 0, 0xFF0000, 0xFF00, 0x00FF, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint32_t, rgb32ToUV, 0, 0,16, 0x00FF, 0xFF00, 0xFF0000, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, bgr16ToUV, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RU<<11, GU<<5, BU , RV<<11, GV<<5, BV , RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU , RV<<10, GV<<5, BV , RGB2YUV_SHIFT+7) |
|
|
|
|
BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7) |
|
|
|
|
BGR2UV(uint32_t, bgr32ToUV,16, 0, 0, 0xFF000000, 0xFF0000, 0xFF00, 0x00FF, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint32_t, rgb32ToUV, 0, 0,16, 0xFF000000, 0x00FF, 0xFF00, 0xFF0000, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, bgr16ToUV, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RU<<11, GU<<5, BU , RV<<11, GV<<5, BV , RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU , RV<<10, GV<<5, BV , RGB2YUV_SHIFT+7) |
|
|
|
|
BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8) |
|
|
|
|
BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7) |
|
|
|
|
|
|
|
|
|
#if HAVE_MMX |
|
|
|
|
static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width, int srcFormat) |
|
|
|
|