Commit d57c737a authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Luca Barbato

jpeg2000: Simplify jpeg2000_decode_packets()

Raise PATCHWELCOME error in case of non-implemented progression order.
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
Signed-off-by: 's avatarNicolas Bertrand <nicoinattendu@gmail.com>
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent 09d5929f
...@@ -722,13 +722,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, ...@@ -722,13 +722,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{ {
int layno, reslevelno, compno, precno, ok_reslevel, ret; int ret = 0;
uint8_t prog_order = tile->codsty[0].prog_order; int layno, reslevelno, compno, precno, ok_reslevel;
uint16_t x; int x, y;
uint16_t y;
s->bit_index = 8; s->bit_index = 8;
switch (prog_order) { switch (tile->codsty[0].prog_order) {
case JPEG2000_PGOD_LRCP: case JPEG2000_PGOD_LRCP:
for (layno = 0; layno < tile->codsty[0].nlayers; layno++) { for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
ok_reslevel = 1; ok_reslevel = 1;
...@@ -802,6 +801,21 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile ...@@ -802,6 +801,21 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
} }
break; 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: default:
break; break;
} }
...@@ -809,7 +823,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile ...@@ -809,7 +823,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
/* EOC marker reached */ /* EOC marker reached */
bytestream2_skip(&s->g, 2); bytestream2_skip(&s->g, 2);
return 0; return ret;
} }
/* TIER-1 routines */ /* TIER-1 routines */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment