diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-27 22:55:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-28 00:30:06 +0200 |
commit | 8cf57efdd7846cce9467e68f6c16abf6d9b4fea2 (patch) | |
tree | aa0b0cae7dd8d7e685e59919b4dbc20247df71f1 /libavcodec/jpeg2000dec.c | |
parent | 840ee5e1a1a5aa9ea69bae1063c670bb95198015 (diff) | |
download | ffmpeg-8cf57efdd7846cce9467e68f6c16abf6d9b4fea2.tar.gz |
j2k/jpeg2000: merge lowres code
This also fixes lowres use with ffplay
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 68312a083e..3b0bf65ca9 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -543,12 +543,10 @@ static int init_tile(Jpeg2000DecoderContext *s, int tileno) comp->coord_o[1][0] = FFMAX(tiley * s->tile_height + s->tile_offset_y, s->image_offset_y); comp->coord_o[1][1] = FFMIN((tiley + 1) * s->tile_height + s->tile_offset_y, s->height); - // FIXME: add a dcinema profile check ? - // value is guaranteed by profile (orig=0, 1 tile) - comp->coord[0][0] = 0; - comp->coord[0][1] = s->avctx->width; - comp->coord[1][0] = 0; - comp->coord[1][1] = s->avctx->height; + comp->coord[0][0] = ff_jpeg2000_ceildivpow2(comp->coord_o[0][0], s->reduction_factor); + comp->coord[0][1] = ff_jpeg2000_ceildivpow2(comp->coord_o[0][1], s->reduction_factor); + comp->coord[1][0] = ff_jpeg2000_ceildivpow2(comp->coord_o[1][0], s->reduction_factor); + comp->coord[1][1] = ff_jpeg2000_ceildivpow2(comp->coord_o[1][1], s->reduction_factor); if (ret = ff_jpeg2000_init_component(comp, codsty, qntsty, s->cbps[compno], s->cdx[compno], @@ -1369,5 +1367,6 @@ AVCodec ff_jpeg2000_decoder = { .pix_fmts = (enum AVPixelFormat[]) { AV_PIX_FMT_XYZ12, AV_PIX_FMT_GRAY8, -1 }, + .max_lowres = 5, .profiles = NULL_IF_CONFIG_SMALL(profiles) }; |