changeset 9715:997d2de9cd84 libavcodec

Add lowres support to the libopenjpeg wrapper. Fixes issue 1097.
author jai_menon
date Tue, 26 May 2009 17:04:28 +0000
parents 5df11d49abb7
children d45e44454d13
files libopenjpeg.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libopenjpeg.c	Tue May 26 16:59:05 2009 +0000
+++ b/libopenjpeg.c	Tue May 26 17:04:28 2009 +0000
@@ -89,6 +89,7 @@
     }
     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 @@
         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;