aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-11 21:10:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-11 21:38:10 +0200
commit9c8939216b1cd2ff768603f63a7c411753b94c65 (patch)
treeeee4dbbcbd039c7db52a212088a9f3d7b5b75df3
parentfb92f3ecb4d48a5612ee61aa39bd538cac9d08cf (diff)
downloadffmpeg-9c8939216b1cd2ff768603f63a7c411753b94c65.tar.gz
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/jpeg2000dec.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index d86aa25b4c..026b9302d3 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -860,7 +860,30 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
s->bit_index = 8;
switch (tile->codsty[0].prog_order) {
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:
for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {