aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-26 21:51:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-26 22:00:29 +0200
commitb75c0a72ed3bb5fab0a0b66ede94f6de887db585 (patch)
tree7abc5c1be3f744899068194ca212802f7e7a089c
parentc56ba5c270642ac9334fa743955f2954672f773d (diff)
downloadffmpeg-b75c0a72ed3bb5fab0a0b66ede94f6de887db585.tar.gz
avcodec/jpeg2000dec: Fix tp_index for POC
Fixes Ticket2586 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/jpeg2000dec.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 1a15bf821d..fdacf57929 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1033,12 +1033,11 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
int RSpoc, int CSpoc,
int LYEpoc, int REpoc, int CEpoc,
- int Ppoc)
+ int Ppoc, int *tp_index)
{
int ret = 0;
int layno, reslevelno, compno, precno, ok_reslevel;
int x, y;
- int tp_index = 0;
int step_x, step_y;
switch (Ppoc) {
@@ -1056,7 +1055,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
reslevelno;
ok_reslevel = 1;
for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -1082,7 +1081,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
reslevelno;
ok_reslevel = 1;
for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -1142,7 +1141,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
}
for (layno = 0; layno < LYEpoc; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index, codsty, rlevel,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index, codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
qntsty->nguardbits)) < 0)
@@ -1213,7 +1212,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
}
for (layno = 0; layno < LYEpoc; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -1280,7 +1279,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
}
for (layno = 0; layno < LYEpoc; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index, codsty, rlevel,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index, codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
qntsty->nguardbits)) < 0)
@@ -1302,6 +1301,7 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
int ret, i;
+ int tp_index = 0;
s->bit_index = 8;
if (tile->poc.nb_poc) {
@@ -1310,7 +1310,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
ret = jpeg2000_decode_packets_po_iteration(s, tile,
e->RSpoc, e->CSpoc,
e->LYEpoc, e->REpoc, e->CEpoc,
- e->Ppoc
+ e->Ppoc, &tp_index
);
if (ret < 0)
return ret;
@@ -1321,7 +1321,8 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
tile->codsty[0].nlayers,
33,
s->ncomponents,
- tile->codsty[0].prog_order
+ tile->codsty[0].prog_order,
+ &tp_index
);
}
/* EOC marker reached */