[FFmpeg-cvslog] jpeg2000: Simplify jpeg2000_decode_packets()

Michael Niedermayer git at videolan.org
Wed Jul 3 16:32:32 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jul  1 10:01:31 2013 +0200| [d57c737ac30cf079a342fa649fd4888c2d059dd9] | committer: Luca Barbato

jpeg2000: Simplify jpeg2000_decode_packets()

Raise PATCHWELCOME error in case of non-implemented progression order.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
Signed-off-by: Nicolas Bertrand <nicoinattendu at gmail.com>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavcodec/jpeg2000dec.c |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 172314f..6e78083 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -722,13 +722,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
 
 static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
 {
-    int layno, reslevelno, compno, precno, ok_reslevel, ret;
-    uint8_t prog_order = tile->codsty[0].prog_order;
-    uint16_t x;
-    uint16_t y;
+    int ret = 0;
+    int layno, reslevelno, compno, precno, ok_reslevel;
+    int x, y;
 
     s->bit_index = 8;
-    switch (prog_order) {
+    switch (tile->codsty[0].prog_order) {
     case JPEG2000_PGOD_LRCP:
         for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
             ok_reslevel = 1;
@@ -802,6 +801,21 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
         }
         break;
 
+    case JPEG2000_PGOD_RLCP:
+        avpriv_request_sample(s->avctx, "Progression order RLCP");
+        ret = AVERROR_PATCHWELCOME;
+        break;
+
+    case JPEG2000_PGOD_RPCL:
+        avpriv_request_sample(s->avctx, "Progression order RPCL");
+        ret = AVERROR_PATCHWELCOME;
+        break;
+
+    case JPEG2000_PGOD_PCRL:
+        avpriv_request_sample(s->avctx, "Progression order PCRL");
+        ret = AVERROR_PATCHWELCOME;
+        break;
+
     default:
         break;
     }
@@ -809,7 +823,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
     /* EOC marker reached */
     bytestream2_skip(&s->g, 2);
 
-    return 0;
+    return ret;
 }
 
 /* TIER-1 routines */



More information about the ffmpeg-cvslog mailing list