Skip to content

Commit

Permalink
[jpegli] Fix assertion for refinement bits
Browse files Browse the repository at this point in the history
The num_refinement_bits is an upper bound for the allocation required.

For luma-only refinement this equality always holds. But when chroma refinement is involved, then some scans may not use up the entire allocation.
  • Loading branch information
Haixia Shi authored and szabadka committed Jul 29, 2024
1 parent c0dfce4 commit 403631c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jpegli/entropy_coding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void TokenizeJpeg(j_compress_ptr cinfo) {
new_refinement_bits += sti->num_nonzeros;
}
}
JXL_DASSERT(m->next_refinement_bit ==
JXL_DASSERT(m->next_refinement_bit <=
refinement_bits + num_refinement_bits);
num_refinement_bits += new_refinement_bits;
}
Expand Down

0 comments on commit 403631c

Please sign in to comment.