Commit 9c893921 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Implement progression order RLCP

This works with one of 2 RLCP samples i have, the other appears to also
use selective arithemtic coding bypass which may or may not be the reason why it does
not work

Sample: p0_16.j2k
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fb92f3ec
...@@ -860,7 +860,30 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile ...@@ -860,7 +860,30 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
s->bit_index = 8; s->bit_index = 8;
switch (tile->codsty[0].prog_order) { switch (tile->codsty[0].prog_order) {
case JPEG2000_PGOD_RLCP: case JPEG2000_PGOD_RLCP:
avpriv_request_sample(s->avctx, "Progression order RLCP"); av_log(s->avctx, AV_LOG_WARNING, "Progression order RLCP\n");
ok_reslevel = 1;
for (reslevelno = 0; ok_reslevel; reslevelno++) {
ok_reslevel = 0;
for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
if (reslevelno < codsty->nreslevels) {
Jpeg2000ResLevel *rlevel = tile->comp[compno].reslevel +
reslevelno;
ok_reslevel = 1;
for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
if ((ret = jpeg2000_decode_packet(s,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
qntsty->nguardbits)) < 0)
return ret;
}
}
}
}
break;
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++) {
......
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