[FFmpeg-cvslog] swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context

Michael Niedermayer git at videolan.org
Mon Aug 31 02:02:23 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Aug 31 00:34:55 2015 +0200| [1acd6311a100859f3ef4119790da9d5cb5546979] | committer: Michael Niedermayer

swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libswscale/utils.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 53f68db..4664de4 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -855,6 +855,12 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
     if (need_reinit && (c->srcBpc == 8 || !isYUV(c->srcFormat)))
         ff_sws_init_range_convert(c);
 
+    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
+    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
+
+    if (c->cascaded_context[0])
+        return sws_setColorspaceDetails(c->cascaded_context[0],inv_table, srcRange,table, dstRange, brightness,  contrast, saturation);
+
     if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) {
         if (!c->cascaded_context[0] &&
             memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) &&
@@ -923,9 +929,6 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
         return -1;
     }
 
-    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
-    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
-
     if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {
         ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
                                  contrast, saturation);



More information about the ffmpeg-cvslog mailing list