summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorcehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-18 23:02:32 +0000
committercehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-18 23:02:32 +0000
commite3e6f842584d582150221f16089283b7e39e7eb5 (patch)
tree742e0d199e789697073711f916c7a8c7f7d84425 /libswscale
parent3f8efed4d98c1846ff65a04645795d1698845f42 (diff)
downloadmpv-e3e6f842584d582150221f16089283b7e39e7eb5.tar.bz2
mpv-e3e6f842584d582150221f16089283b7e39e7eb5.tar.xz
Extend the generic path of the yuv2rgb converter with support for rgb444
output format. Patch by Janusz Krzysztofik, jkrzyszt A tis D icnet D pl git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30934 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c19
-rw-r--r--libswscale/utils.c7
2 files changed, 24 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 3c278d571b..de6eec6a2d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -39,7 +39,7 @@
/*
tested special converters (most are tested actually, but I did not write it down ...)
- YV12 -> BGR16
+ YV12 -> BGR12/BGR16
YV12 -> YV12
BGR15 -> BGR16
BGR16 -> BGR16
@@ -805,6 +805,23 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc
}\
}\
break;\
+ case PIX_FMT_RGB444BE:\
+ case PIX_FMT_RGB444LE:\
+ case PIX_FMT_BGR444BE:\
+ case PIX_FMT_BGR444LE:\
+ {\
+ const int dr1= dither_4x4_16[y&3 ][0];\
+ const int dg1= dither_4x4_16[y&3 ][1];\
+ const int db1= dither_4x4_16[(y&3)^3][0];\
+ const int dr2= dither_4x4_16[y&3 ][1];\
+ const int dg2= dither_4x4_16[y&3 ][0];\
+ const int db2= dither_4x4_16[(y&3)^3][1];\
+ func(uint16_t,0)\
+ ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\
+ ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\
+ }\
+ }\
+ break;\
case PIX_FMT_RGB8:\
case PIX_FMT_BGR8:\
{\
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 5409980eb1..91c89c02b0 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1115,7 +1115,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
av_log(c, AV_LOG_INFO, "from %s to %s%s ",
sws_format_name(srcFormat),
#ifdef DITHER1XBPP
- dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? "dithered " : "",
+ dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ||
+ dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE ||
+ dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ? "dithered " : "",
#else
"",
#endif
@@ -1184,6 +1186,9 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR16 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
else if (dstFormat==PIX_FMT_BGR555)
av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR15 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
+ else if (dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE ||
+ dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE)
+ av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR12 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
av_log(c, AV_LOG_VERBOSE, "%dx%d -> %dx%d\n", srcW, srcH, dstW, dstH);
av_log(c, AV_LOG_DEBUG, "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",