summaryrefslogtreecommitdiff
path: root/libavcodec/j2kenc.c
diff options
context:
space:
mode:
authorGautam Ramakrishnan <gautamramk@gmail.com>2020-08-28 00:15:36 +0530
committerMichael Niedermayer <michael@niedermayer.cc>2020-08-30 16:18:37 +0200
commit341064d68a134e2fb3dd35f8f5b50c6df8506c10 (patch)
tree767b9687e77cf50e243c16ce6be016b9a88e5b95 /libavcodec/j2kenc.c
parentf0e33119e4fa1cf1705c16affa5daa6f0b487b48 (diff)
libavcodec/jpeg2000: fix tag tree reset
The implementation of the tag tree did not set the correct reset value for the encoder. This lead to inefficent tag tree being encoded. This patch fixes the implementation of the ff_tag_tree_zero() function. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/j2kenc.c')
-rw-r--r--libavcodec/j2kenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 8b9f6464af..4cefe6d7fb 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -802,8 +802,8 @@ static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, in
Jpeg2000Prec *prec = band->prec + precno;
int nb_cblks = prec->nb_codeblocks_height * prec->nb_codeblocks_width;
int pos;
- 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, 99);
+ ff_tag_tree_zero(prec->cblkincl, prec->nb_codeblocks_width, prec->nb_codeblocks_height, 99);
for (pos = 0; pos < nb_cblks; pos++) {
Jpeg2000Cblk *cblk = &prec->cblk[pos];
prec->zerobits[pos].val = expn[bandno] + numgbits - 1 - cblk->nonzerobits;