Skip to content

Commit

Permalink
opj_j2k_setup_encoder(): set numgbits = 1 for Cinema2K
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 13, 2024
1 parent 362ec6c commit 40707fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -8310,7 +8310,14 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
tccp->qmfbid = parameters->irreversible ? 0 : 1;
tccp->qntsty = parameters->irreversible ? J2K_CCP_QNTSTY_SEQNT :
J2K_CCP_QNTSTY_NOQNT;
tccp->numgbits = 2;

if (OPJ_IS_CINEMA(parameters->rsiz) &&
parameters->rsiz == OPJ_PROFILE_CINEMA_2K) {
/* From https://github.com/uclouvain/openjpeg/issues/1340 */
tccp->numgbits = 1;
} else {
tccp->numgbits = 2;
}

if ((OPJ_INT32)i == parameters->roi_compno) {
tccp->roishift = parameters->roi_shift;
Expand Down

0 comments on commit 40707fd

Please sign in to comment.