[FFmpeg-cvslog] avcodec/jpeg2000dec: Handle format that has planes matching YUVA420P structure but seems not to be that

Michael Niedermayer git at videolan.org
Sun Jun 14 13:01:57 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 14 04:45:02 2015 +0200| [ad072a134fc02a1387107710acbdf29d21c8abc5] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Handle format that has planes matching YUVA420P structure but seems not to be that

Outputs something for p0_05.j2k

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/jpeg2000dec.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index a11033e..21cc67d 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -352,6 +352,24 @@ static int get_siz(Jpeg2000DecoderContext *s)
             break;
         }
     }
+
+    if (i == possible_fmts_nb) {
+        if (ncomponents == 4 &&
+            s->cdy[0] == 1 && s->cdx[0] == 1 &&
+            s->cdy[1] == 1 && s->cdx[1] == 1 &&
+            s->cdy[2] == s->cdy[3] && s->cdx[2] == s->cdx[3]) {
+            if (s->precision == 8 && s->cdy[2] == 2 && s->cdx[2] == 2 && !s->pal8) {
+                s->avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
+                s->cdef[0] = 0;
+                s->cdef[1] = 1;
+                s->cdef[2] = 2;
+                s->cdef[3] = 3;
+                i = 0;
+            }
+        }
+    }
+
+
     if (i == possible_fmts_nb) {
         av_log(s->avctx, AV_LOG_ERROR,
                "Unknown pix_fmt, profile: %d, colour_space: %d, "



More information about the ffmpeg-cvslog mailing list