Skip to content
Snippets Groups Projects
Commit cd840656 authored by Jai Menon's avatar Jai Menon
Browse files

Add lowres support to the libopenjpeg wrapper.

Fixes issue 1097.

Originally committed as revision 18955 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d9554516
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, ...@@ -89,6 +89,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
} }
opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL); opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL);
ctx->dec_params.cp_reduce = avctx->lowres;
// Tie decoder with decoding parameters // Tie decoder with decoding parameters
opj_setup_decoder(dec, &ctx->dec_params); opj_setup_decoder(dec, &ctx->dec_params);
stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size); stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
...@@ -106,8 +107,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, ...@@ -106,8 +107,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
opj_destroy_decompress(dec); opj_destroy_decompress(dec);
return -1; return -1;
} }
width = image->comps[0].w; width = image->comps[0].w << avctx->lowres;
height = image->comps[0].h; height = image->comps[0].h << avctx->lowres;
if(avcodec_check_dimensions(avctx, width, height) < 0) { if(avcodec_check_dimensions(avctx, width, height) < 0) {
av_log(avctx, AV_LOG_ERROR, "%dx%d dimension invalid.\n", width, height); av_log(avctx, AV_LOG_ERROR, "%dx%d dimension invalid.\n", width, height);
goto done; goto done;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment