[FFmpeg-devel] [PATCH] jpeg2000: use of lowres parameter from avcodec.h

Michael Niedermayer michaelni at gmx.at
Tue Apr 30 02:07:55 CEST 2013


On Mon, Apr 29, 2013 at 11:15:49AM +0200, Nicolas Bertrand wrote:
> Suppression of lowres decoder option as it no more needed.
> ---
>  libavcodec/jpeg2000dec.c |   21 +++++----------------
>  1 file changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> index 20e5c9c..c1bd772 100644
> --- a/libavcodec/jpeg2000dec.c
> +++ b/libavcodec/jpeg2000dec.c
> @@ -86,9 +86,6 @@ typedef struct Jpeg2000DecoderContext {
>      int16_t         curtileno;
>      Jpeg2000Tile    *tile;
>  
> -    /*options parameters*/
> -    int16_t         lowres;
> -    int16_t         reduction_factor;
>  } Jpeg2000DecoderContext;
>  
>  /* get_bits functions for JPEG2000 packet bitstream
> @@ -205,9 +202,9 @@ static int get_siz(Jpeg2000DecoderContext *s)
>  
>      /* compute image size with reduction factor */
>      s->avctx->width  = ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
> -                                               s->reduction_factor);
> +                                               s->avctx->lowres);
>      s->avctx->height = ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
> -                                               s->reduction_factor);
> +                                               s->avctx->lowres);
>  
>      switch (s->avctx->profile) {
>      case FF_PROFILE_JPEG2000_DCINEMA_2K:

> @@ -254,10 +251,10 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
>      c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1
>  
>      /* compute number of resolution levels to decode */
> -    if (c->nreslevels < s->reduction_factor)
> +    if (c->nreslevels < s->avctx->lowres)
>          c->nreslevels2decode = 1;

Possibly independant of this patch but
doesnt this make the variables inconsistent (and crash) ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130430/0e8cdc1a/attachment.asc>


More information about the ffmpeg-devel mailing list