diff options
author | Cédric Schieli <cschieli@gmail.com> | 2009-02-27 22:13:55 +0000 |
---|---|---|
committer | Cédric Schieli <cschieli@gmail.com> | 2009-02-27 22:13:55 +0000 |
commit | 2c8973425540ba9b71d95d67ba678233737a92a4 (patch) | |
tree | d89f4dddd2476e6d5cd674db1e772cac2f5d615b | |
parent | 03831f462e8e70eae80fcef71961161995f3c3b8 (diff) | |
download | ffmpeg-2c8973425540ba9b71d95d67ba678233737a92a4.tar.gz |
Use YUV420P code path for YUVA420P where appropriate
Originally committed as revision 28746 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r-- | libswscale/swscale.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 2982857209..1fe421e0d6 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2327,12 +2327,12 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat))) { /* yv12_to_nv12 */ - if (srcFormat == PIX_FMT_YUV420P && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) + if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) { c->swScale= PlanarToNV12Wrapper; } /* yuv2bgr */ - if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P) && (isBGR(dstFormat) || isRGB(dstFormat)) + if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && (isBGR(dstFormat) || isRGB(dstFormat)) && !(flags & SWS_ACCURATE_RND) && !(dstH&1)) { c->swScale= sws_yuv2rgb_get_func_ptr(c); @@ -2383,7 +2383,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d /* LQ converters if -sws 0 or -sws 4*/ if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)){ /* yv12_to_yuy2 */ - if (srcFormat == PIX_FMT_YUV420P) + if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) { if (dstFormat == PIX_FMT_YUYV422) c->swScale= PlanarToYuy2Wrapper; @@ -2406,6 +2406,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d /* simple copy */ if ( srcFormat == dstFormat + || (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) || (isPlanarYUV(srcFormat) && isGray(dstFormat)) || (isPlanarYUV(dstFormat) && isGray(srcFormat))) { |