According to the doxygen documentation (http://www.openjpeg.org/doxygen/structopj__image__comp.html), the opj_image_comp structure contains two fields that are confusing me:
- prec: precision
- bpp: image depth in bits
Based on just this info, I would assume that an image with 8 bit pixels (0-255) would have a bpp=8. But when I decompressed some stock 8-bit mono .j2k files, I was finding that prec=8 and bpp=0.
So, what exactly do prec and bpp contain?
I am using OpenJPEG v2.3 if that has any impact on the answer.
Thanks much.
I managed to find additional info with more digging.
The prec field contains the number of bits used to encode the image. This corresponds to the lower 7 bits of the Ssiz field in the Image and Tile Size (SIZ) marker segment.
I have not figured out what the bpp field in the OpenJPEG struct opj_image_comp_t actually contains.