]> git.sesse.net Git - ffmpeg/commitdiff
swscale: Fix packed rgb check for planarRgbToRgbWrapper.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 12:26:50 +0000 (13:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 12:28:22 +0000 (13:28 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/swscale_unscaled.c

index b5d3e76f1c22ddb0cc8feef1b0dcec9a5b2e6ef9..90603c2280538e83bb48dd89ef0e26924ea04298 100644 (file)
@@ -694,7 +694,15 @@ void ff_get_unscaled_swscale(SwsContext *c)
         && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
         c->swScale= rgbToRgbWrapper;
 
-    if (isAnyRGB(srcFormat) && isPlanar(srcFormat) && isAnyRGB(dstFormat) && !isPlanar(dstFormat))
+#define isByteRGB(f) (\
+        f == PIX_FMT_RGB32   ||\
+        f == PIX_FMT_RGB32_1 ||\
+        f == PIX_FMT_RGB24   ||\
+        f == PIX_FMT_BGR32   ||\
+        f == PIX_FMT_BGR32_1 ||\
+        f == PIX_FMT_BGR24)
+
+    if (isAnyRGB(srcFormat) && isPlanar(srcFormat) && isByteRGB(dstFormat))
         c->swScale= planarRgbToRgbWrapper;
 
     if ((usePal(srcFormat) && (