summaryrefslogtreecommitdiffstats
path: root/libswscale/x86
diff options
context:
space:
mode:
authorKevin Coyle <kcoyle@netflix.com>2015-07-03 11:16:42 -0700
committerMichael Niedermayer <michaelni@gmx.at>2015-07-04 00:03:45 +0200
commit126271138803fdb1eb6059f4f71c88254ae2a20b (patch)
tree14a775bf3efdf35e20d2b198ed5bf22738e71625 /libswscale/x86
parent8255b14c685f6404293a5167569efddceaa32fd3 (diff)
downloadffmpeg-streaming-126271138803fdb1eb6059f4f71c88254ae2a20b.zip
ffmpeg-streaming-126271138803fdb1eb6059f4f71c88254ae2a20b.tar.gz
YUV->BGR32 MMX support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/x86')
-rw-r--r--libswscale/x86/swscale_template.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 36a606c..bbda6d0 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -399,6 +399,35 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
}
}
+static void RENAME(yuv2bgr32_X)(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc,
+ int chrFilterSize, const int16_t **alpSrc,
+ uint8_t *dest, int dstW, int dstY)
+{
+ x86_reg dummy=0;
+ x86_reg dstW_reg = dstW;
+ x86_reg uv_off = c->uv_offx2;
+
+ if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
+ YSCALEYUV2PACKEDX
+ YSCALEYUV2RGBX
+ YSCALEYUV2PACKEDX_YA(ALP_MMX_FILTER_OFFSET, %%mm0, %%mm3, %%mm6, %%mm1, %%mm7)
+ "psraw $3, %%mm1 \n\t"
+ "psraw $3, %%mm7 \n\t"
+ "packuswb %%mm7, %%mm1 \n\t"
+ WRITEBGR32(%4, "%5", %%REGa, %%mm5, %%mm4, %%mm2, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
+ YSCALEYUV2PACKEDX_END
+ } else {
+ YSCALEYUV2PACKEDX
+ YSCALEYUV2RGBX
+ "pcmpeqd %%mm7, %%mm7 \n\t"
+ WRITEBGR32(%4, "%5", %%REGa, %%mm5, %%mm4, %%mm2, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ YSCALEYUV2PACKEDX_END
+ }
+}
+
#define REAL_WRITERGB16(dst, dstw, index) \
"pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\
"pand "MANGLE(bFC)", %%mm4 \n\t" /* G */\
@@ -1491,6 +1520,7 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
+ case AV_PIX_FMT_BGR32: c->yuv2packedX = RENAME(yuv2bgr32_X); break;
#if HAVE_6REGS
case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
#endif
OpenPOWER on IntegriCloud