On Tue, Aug 25, 2020 at 07:25:44PM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan <gautamr...@gmail.com>
> 
> The implementation of tag tree encoding was incorrect.
> However, this error was not visible as the current j2k
> encoder encodes only 1 layer.
> This patch fixes tag tree coding for JPEG2000 such tag
> tree coding would work for multi layer encoding.

[...]

> diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
> index 26e09fbe38..2e26bc5b00 100644
> --- a/libavcodec/jpeg2000.c
> +++ b/libavcodec/jpeg2000.c
> @@ -82,12 +82,13 @@ static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, 
> int h)
>      return res;
>  }
>  
> -void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h)
> +void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val)
>  {
>      int i, siz = ff_tag_tree_size(w, h);
>  
>      for (i = 0; i < siz; i++) {
> -        t[i].val = 0;
> +        t[i].val = val;
> +        t[i].temp_val = 0;
>          t[i].vis = 0;
>      }
>  }
> @@ -567,8 +568,8 @@ void ff_jpeg2000_reinit(Jpeg2000Component *comp, 
> Jpeg2000CodingStyle *codsty)
>              Jpeg2000Band *band = rlevel->band + bandno;
>              for(precno = 0; precno < rlevel->num_precincts_x * 
> rlevel->num_precincts_y; precno++) {
>                  Jpeg2000Prec *prec = band->prec + precno;
> -                ff_tag_tree_zero(prec->zerobits, prec->nb_codeblocks_width, 
> prec->nb_codeblocks_height);
> -                ff_tag_tree_zero(prec->cblkincl, prec->nb_codeblocks_width, 
> prec->nb_codeblocks_height);
> +                ff_tag_tree_zero(prec->zerobits, prec->nb_codeblocks_width, 
> prec->nb_codeblocks_height, 0);
> +                ff_tag_tree_zero(prec->cblkincl, prec->nb_codeblocks_width, 
> prec->nb_codeblocks_height, 0);

this looks a bit like a somewhat unlrelated bugfix thats spread over this and
the next patch 
if so, that should be moved into a seperate patch
the patches are already complex without an additional bugfix in them

thx

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

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to