From 40707fd50df4c87e8e952d9457b5a3b60035640d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 13 Nov 2024 16:26:02 +0100 Subject: [PATCH 1/2] opj_j2k_setup_encoder(): set numgbits = 1 for Cinema2K Fixes #1340 --- src/lib/openjp2/j2k.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index 1e6536aad..7dc389fa2 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -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; From e6497283140ec0b62274869a6b9bca6d2537229b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 13 Nov 2024 16:30:45 +0100 Subject: [PATCH 2/2] Rename knownfailures-macOS14.6-xcode15.4-arm64-Release-3rdP.txt to knownfailures-macOS14.7-xcode15.4-arm64-Release-3rdP.txt --- ...t => knownfailures-macOS14.7-xcode15.4-arm64-Release-3rdP.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/travis-ci/{knownfailures-macOS14.6-xcode15.4-arm64-Release-3rdP.txt => knownfailures-macOS14.7-xcode15.4-arm64-Release-3rdP.txt} (100%) diff --git a/tools/travis-ci/knownfailures-macOS14.6-xcode15.4-arm64-Release-3rdP.txt b/tools/travis-ci/knownfailures-macOS14.7-xcode15.4-arm64-Release-3rdP.txt similarity index 100% rename from tools/travis-ci/knownfailures-macOS14.6-xcode15.4-arm64-Release-3rdP.txt rename to tools/travis-ci/knownfailures-macOS14.7-xcode15.4-arm64-Release-3rdP.txt