diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-07-03 18:04:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-07-03 18:08:01 +0200 |
commit | d554715f673d670194b8a4449d9260f1a47a07ae (patch) | |
tree | 0b98c1db3dce4cdf130c7ad2c541714099f0dd48 | |
parent | 9f4f5787046dd1430ebb5b58e49af32e304852af (diff) | |
download | ffmpeg-d554715f673d670194b8a4449d9260f1a47a07ae.tar.gz |
avcodec/jpeg2000dec: Fix decoding of subsampled multi tile images
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/jpeg2000dec.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 5690dfde5d..6e60c0afbb 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1702,13 +1702,13 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1); - y = tile->comp[compno].coord[1][0] - s->image_offset_y; - line = picture->data[plane] + y / s->cdy[compno] * picture->linesize[plane]; + y = tile->comp[compno].coord[1][0] - s->image_offset_y / s->cdy[compno]; + line = picture->data[plane] + y * picture->linesize[plane]; for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y ++) { uint8_t *dst; - x = tile->comp[compno].coord[0][0] - s->image_offset_x; - dst = line + x / s->cdx[compno] * pixelsize + compno*!planar; + x = tile->comp[compno].coord[0][0] - s->image_offset_x / s->cdx[compno]; + dst = line + x * pixelsize + compno*!planar; if (codsty->transform == FF_DWT97) { for (; x < w; x ++) { @@ -1751,13 +1751,13 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, if (planar) plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1); - y = tile->comp[compno].coord[1][0] - s->image_offset_y; - linel = (uint16_t *)picture->data[plane] + y / s->cdy[compno] * (picture->linesize[plane] >> 1); + y = tile->comp[compno].coord[1][0] - s->image_offset_y / s->cdy[compno]; + linel = (uint16_t *)picture->data[plane] + y * (picture->linesize[plane] >> 1); for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y ++) { uint16_t *dst; - x = tile->comp[compno].coord[0][0] - s->image_offset_x; - dst = linel + (x / s->cdx[compno] * pixelsize + compno*!planar); + x = tile->comp[compno].coord[0][0] - s->image_offset_x / s->cdx[compno]; + dst = linel + (x * pixelsize + compno*!planar); if (codsty->transform == FF_DWT97) { for (; x < w; x ++) { int val = lrintf(*datap) + (1 << (cbps - 1)); |