summaryrefslogtreecommitdiffstats
path: root/postproc
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:43:31 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:43:31 +0000
commit7acf931299daaa7feaf35e7a89e8ee61c5a18383 (patch)
tree403539cf4c1bb19604b1df060f8a48dbb1b0044c /postproc
parentf023f5a3364ce55ee16582f4effe8d458bff659e (diff)
downloadmpv-7acf931299daaa7feaf35e7a89e8ee61c5a18383.tar.bz2
mpv-7acf931299daaa7feaf35e7a89e8ee61c5a18383.tar.xz
unscaled BGR24 -> YV12
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4624 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r--postproc/swscale.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c
index 5610b65dcd..bfe39af4cf 100644
--- a/postproc/swscale.c
+++ b/postproc/swscale.c
@@ -42,6 +42,7 @@ untested special converters
YUY2/BGR15/BGR16/BGR24/BGR32/RGB24/RGB32 -> same format
BGR24 -> BGR32 & RGB24 -> RGB32
BGR32 -> BGR24 & RGB32 -> RGB24
+ BGR24 -> YV12
*/
#include <inttypes.h>
@@ -1227,6 +1228,18 @@ static void bgr15to16Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int
}
}
+static void bgr24toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t* dst[], int dstStride[]){
+
+ rgb24toyv12(
+ src[0],
+ dst[0]+ srcSliceY *dstStride[0],
+ dst[1]+(srcSliceY>>1)*dstStride[1],
+ dst[2]+(srcSliceY>>1)*dstStride[2],
+ c->srcW, srcSliceH,
+ dstStride[0], dstStride[1], srcStride[0]);
+}
+
/* unscaled copy like stuff (assumes nearly identical formats) */
static void simpleCopy(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcSliceY,
@@ -1449,6 +1462,17 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
vo_format_name(srcFormat), vo_format_name(dstFormat));
return c;
}
+
+ /* bgr24toYV12 */
+ if(srcFormat==IMGFMT_BGR24 && dstFormat==IMGFMT_YV12)
+ {
+ c->swScale= bgr24toyv12Wrapper;
+
+ if(flags&SWS_PRINT_INFO)
+ printf("SwScaler: using unscaled %s -> %s special converter\n",
+ vo_format_name(srcFormat), vo_format_name(dstFormat));
+ return c;
+ }
}
if(cpuCaps.hasMMX2)