aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-30 17:03:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-30 18:38:04 +0200
commit941a8efae2ac166840bc8ec2a1534289b6714957 (patch)
tree08c1c7ab64b9b7e4031e23f7e869ee01788ed9a3
parent9ccc9f30f7b66fce2995b8701c2b0e82f6700390 (diff)
downloadffmpeg-941a8efae2ac166840bc8ec2a1534289b6714957.tar.gz
j2k:decode_tile() pass picture as argument
Reduce diff to jpeg2000dec Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/j2kdec.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index b052674b3a..041d20219b 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -924,7 +924,9 @@ static void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
}
}
-static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
+static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
+ AVFrame *picture)
+)
{
int compno, reslevelno, bandno;
int x, y;
@@ -991,7 +993,7 @@ static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
int32_t *i_datap = comp->i_data;
y = tile->comp[compno].coord[1][0] - s->image_offset_y;
- line = s->picture->data[0] + y * s->picture->linesize[0];
+ line = picture->data[0] + y * picture->linesize[0];
for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y += s->cdy[compno]) {
uint8_t *dst;
@@ -1011,7 +1013,7 @@ static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
i_datap++;
dst += s->ncomponents;
}
- line += s->picture->linesize[0];
+ line += picture->linesize[0];
}
}
} else {
@@ -1022,7 +1024,7 @@ static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
uint16_t *linel;
y = tile->comp[compno].coord[1][0] - s->image_offset_y;
- linel = (uint16_t*)s->picture->data[0] + y * (s->picture->linesize[0] >> 1);
+ linel = (uint16_t*)picture->data[0] + y * (picture->linesize[0] >> 1);
for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y += s->cdy[compno]) {
uint16_t *dst;
@@ -1042,7 +1044,7 @@ static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
i_datap++;
dst += s->ncomponents;
}
- linel += s->picture->linesize[0]>>1;
+ linel += picture->linesize[0]>>1;
}
}
}
@@ -1216,7 +1218,7 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
goto err_out;
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++)
- if (ret = decode_tile(s, s->tile + tileno))
+ if (ret = decode_tile(s, s->tile + tileno, s->picture))
goto err_out;
jpeg2000_dec_cleanup(s);