aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/yuv2rgb.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-03-17 21:07:18 +1100
committerPeter Ross <pross@xvid.org>2011-03-26 13:24:32 +1100
commit3e2523db20dfc11e76f0fedf6499ade3a7f7304d (patch)
tree5cb2b3165f45d5af7d86e3323d40ce5a925e42ec /libswscale/yuv2rgb.c
parent27ef7b1bcd0577e3f5bdfc524b42b0548567be20 (diff)
downloadffmpeg-3e2523db20dfc11e76f0fedf6499ade3a7f7304d.tar.gz
libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementation
Diffstat (limited to 'libswscale/yuv2rgb.c')
-rw-r--r--libswscale/yuv2rgb.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 77d3d399da..f8365ef567 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -99,6 +99,16 @@ const int *sws_getCoefficients(int colorspace)
dst[12*i+ 8] = dst[12*i+ 9] = g[Y]; \
dst[12*i+10] = dst[12*i+11] = b[Y];
+#define PUTBGR48(dst,src,i) \
+ Y = src[2*i]; \
+ dst[12*i+ 0] = dst[12*i+ 1] = b[Y]; \
+ dst[12*i+ 2] = dst[12*i+ 3] = g[Y]; \
+ dst[12*i+ 4] = dst[12*i+ 5] = r[Y]; \
+ Y = src[2*i+1]; \
+ dst[12*i+ 6] = dst[12*i+ 7] = b[Y]; \
+ dst[12*i+ 8] = dst[12*i+ 9] = g[Y]; \
+ dst[12*i+10] = dst[12*i+11] = r[Y];
+
#define YUV2RGBFUNC(func_name, dst_type, alpha) \
static int func_name(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, \
int srcSliceH, uint8_t* dst[], int dstStride[]) \
@@ -175,6 +185,32 @@ ENDYUV2RGBLINE(48)
PUTRGB48(dst_1,py_1,1);
ENDYUV2RGBFUNC()
+YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0)
+ LOADCHROMA(0);
+ PUTBGR48(dst_1,py_1,0);
+ PUTBGR48(dst_2,py_2,0);
+
+ LOADCHROMA(1);
+ PUTBGR48(dst_2,py_2,1);
+ PUTBGR48(dst_1,py_1,1);
+
+ LOADCHROMA(2);
+ PUTBGR48(dst_1,py_1,2);
+ PUTBGR48(dst_2,py_2,2);
+
+ LOADCHROMA(3);
+ PUTBGR48(dst_2,py_2,3);
+ PUTBGR48(dst_1,py_1,3);
+ENDYUV2RGBLINE(48)
+ LOADCHROMA(0);
+ PUTBGR48(dst_1,py_1,0);
+ PUTBGR48(dst_2,py_2,0);
+
+ LOADCHROMA(1);
+ PUTBGR48(dst_2,py_2,1);
+ PUTBGR48(dst_1,py_1,1);
+ENDYUV2RGBFUNC()
+
YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0)
LOADCHROMA(0);
PUTRGB(dst_1,py_1,0);
@@ -568,6 +604,8 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found from %s to %s.\n", sws_format_name(c->srcFormat), sws_format_name(c->dstFormat));
switch (c->dstFormat) {
+ case PIX_FMT_BGR48BE:
+ case PIX_FMT_BGR48LE: return yuv2rgb_c_bgr48;
case PIX_FMT_RGB48BE:
case PIX_FMT_RGB48LE: return yuv2rgb_c_48;
case PIX_FMT_ARGB: