Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: no member named 'numgbits' in 'opj_cparameters' while compiling #6

Closed
mart-jansink opened this issue Apr 25, 2021 · 5 comments
Closed

Comments

@mart-jansink
Copy link
Contributor

While trying to compile libdcp I'm getting the following error:

../src/j2k_transcode.cc:318:13: error: no member named 'numgbits' in 'opj_cparameters'
        parameters.numgbits = fourk ? 2 : 1;

This line was added in 9b1b653 but the only mention of numgbits in openjpeg.h is in the opj_tccp_info struct, at least in https://github.com/uclouvain/openjpeg/blob/0bda7188b7b545232a341f1d978b1e4feda46fc2/src/lib/openjp2/openjpeg.h#L922. Are you perhaps using a patched version of OpenJPEG, or am I missing something else?

@cth103
Copy link
Owner

cth103 commented Apr 26, 2021

Hi Mart, sorry, yes I am indeed using a patched OpenJPEG, I should have mentioned that. I put that OpenJPEG version here: https://github.com/cth103/openjpeg

It has a rather motley collection of patches but a1403c2e2e71c6252d97abf9ddca421ce925d456 is the one you need. Or I can modify libdcp to not require this change, if that would be easier for you?

The change was made because, as far as I can see, it's necessary for DCPs to comply with the SMPTE Bv2.1 guidelines.

@mart-jansink
Copy link
Contributor Author

Ah, that's perfect, thank you. I had pretty much guessed that you had modified it like this, and am fine running a patched version of OpenJPEG of course. I did encounter a few other issues while compiling, for which I'll make a small pull request.

Regarding Bv2.1, just out of curiosity: uclouvain/openjpeg#1340 mentions that there's also something to do with the cblk needing to be 32,32. Did you also implement that?

@cth103
Copy link
Owner

cth103 commented Apr 30, 2021

Right yes the 32x32 codeblock has been there for a while, and OpenJPEG allows you to set it (see dcp::compress_j2k, parameters.cblockw_init and cblockh_init) so that's OK without changes to OpenJPEG.

@jiapei100
Copy link

jiapei100 commented May 10, 2022

Hi, @cth103

Yeah.... Better to keep OpenJPEG as it is.... I built OpenJPEG manually as well. Lazy to give some further modification....
Any plan to update libdcp for NO modification upon current OpenJPEG-2.5.0 ???

For now, I just temporarily remove this line:

//	parameters.numgbits = fourk ? 2 : 1;

in file j2k_transcode.cc.

@cth103
Copy link
Owner

cth103 commented May 11, 2022

The openjpeg team merged a fix for this recently, so we could make it possible to built with openjpeg git again. I just need to get around to it. The version used with by dcpomatic.com builds also includes an old optimisation which I need to test (to see if it's still useful).

One more thing to consider is that we have been bitten in the past by a change in openjpeg breaking compatibility with cinema hardware so I'm a bit cautious with tracking their git too closely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants