[FFmpeg-cvslog] swscale: Merge a hunk from qatar that seems to have been forgotten or lost.

Michael Niedermayer git at videolan.org
Wed Mar 21 15:52:18 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Mar 21 15:14:42 2012 +0100| [87a72b9122e49f209c89fc83af2d51f5cdf44ce2] | committer: Michael Niedermayer

swscale: Merge a hunk from qatar that seems to have been forgotten or lost.

Author of the code from qatar is Ronald S. Bultje
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87a72b9122e49f209c89fc83af2d51f5cdf44ce2
---

 libswscale/utils.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 7e8285d..bea2cfc 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -859,15 +859,30 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
     getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat);
     getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
 
-    // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
+
     if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
         if (dstW&1) {
             av_log(c, AV_LOG_DEBUG, "Forcing full internal H chroma due to odd output size\n");
             flags |= SWS_FULL_CHR_H_INT;
             c->flags = flags;
-        } else
-            c->chrDstHSubSample = 1;
+        }
+    }
+    // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
+    if (flags & SWS_FULL_CHR_H_INT &&
+        isAnyRGB(dstFormat)       &&
+        dstFormat != PIX_FMT_RGBA &&
+        dstFormat != PIX_FMT_ARGB &&
+        dstFormat != PIX_FMT_BGRA &&
+        dstFormat != PIX_FMT_ABGR &&
+        dstFormat != PIX_FMT_RGB24 &&
+        dstFormat != PIX_FMT_BGR24) {
+        av_log(c, AV_LOG_WARNING,
+               "full chroma interpolation for destination format '%s' not yet implemented\n",
+               sws_format_name(dstFormat));
+        flags &= ~SWS_FULL_CHR_H_INT;
+        c->flags = flags;
     }
+    if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
 
     // drop some chroma lines if the user wants it
     c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;



More information about the ffmpeg-cvslog mailing list