aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libopenjpeg.c
diff options
context:
space:
mode:
authorJai Menon <jmenon86@gmail.com>2009-05-26 17:04:28 +0000
committerJai Menon <jmenon86@gmail.com>2009-05-26 17:04:28 +0000
commitcd840656c2bc4b8f6aae883085a0ec0a5e4785f9 (patch)
tree1c5dcffd20567b7686ca46e31c8f9c1840cf822c /libavcodec/libopenjpeg.c
parentd95545166cc522c448cc243bf154733ebab04b14 (diff)
downloadffmpeg-cd840656c2bc4b8f6aae883085a0ec0a5e4785f9.tar.gz
Add lowres support to the libopenjpeg wrapper.
Fixes issue 1097. Originally committed as revision 18955 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libopenjpeg.c')
-rw-r--r--libavcodec/libopenjpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/libopenjpeg.c b/libavcodec/libopenjpeg.c
index 2c30c3000a..075bf1ccfe 100644
--- a/libavcodec/libopenjpeg.c
+++ b/libavcodec/libopenjpeg.c
@@ -89,6 +89,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
}
opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL);
+ ctx->dec_params.cp_reduce = avctx->lowres;
// Tie decoder with decoding parameters
opj_setup_decoder(dec, &ctx->dec_params);
stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
@@ -106,8 +107,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
opj_destroy_decompress(dec);
return -1;
}
- width = image->comps[0].w;
- height = image->comps[0].h;
+ width = image->comps[0].w << avctx->lowres;
+ height = image->comps[0].h << avctx->lowres;
if(avcodec_check_dimensions(avctx, width, height) < 0) {
av_log(avctx, AV_LOG_ERROR, "%dx%d dimension invalid.\n", width, height);
goto done;