Closed bitsgalore closed 4 years ago
Went the easy route and did this (also fixes previously erroneous calculation of levels in the qcc validation function):
https://github.com/openpreserve/jpylyzer/commit/85d9221f78399cead22030789e0d26ef82e3734e
Note that there is NO cross-check with info from any of the COD/COC markers. Created a separate issue for this here https://github.com/openpreserve/jpylyzer/issues/134
Current code in qcd and qcc functions:
There are several problems here:
levels is calculated from rewritten form of Eq A-4, but then that same equation is used to do the lqcdConsistencyCheck (the outcome of which is totally meaningless as a result).
levels is now undefined if qStyle is 1UPDATE: not a problem because in this case mu and epsilon can be determined by reading a fixed-length chunk of 2 bytesAccording to the standard, "number_decomposition_levels is defined in the COD and COC marker segments", so we must really use those numbers. BUT in that case things get a bit complicated because we must take into account the precedence order of the main header and tile part header level COD and COC markers! So for a main header-level we would need to check for (in order of increasing precedence):
And for a tile-part level QCD/QCC:
Which gets a bit complicated.
First step would be to pass levels to the validate_qcd/validate_qcc functions as an argument. Value must be establishes outside those functions.
To get around this complexity, another option is to use the rewritten equations to calculate levels (as is done now), and remove lqcdConsistencyCheck/lqccConsistencyCheck.