Skip to content

Commit

Permalink
Clean-up MAGB check
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed Jun 25, 2024
1 parent e5feb62 commit 1fdf591
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,18 @@ private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDe

/* magbp */

int b = p.csiz[0].ssiz + 2;

int maxB = p.csiz[0].ssiz + 2;
if (isReversibleFilter) {
b += 2 + p.cod.multiComponentTransform;
maxB += 2 + p.cod.multiComponentTransform;
if (p.cod.numDecompLevels > 5)
b += 1;
} else {
if (p.cod.multiComponentTransform == 1 && p.csiz[0].ssiz > 9)
b += 1;
maxB += 1;
} else if (p.cod.multiComponentTransform == 1 && p.csiz[0].ssiz > 9) {
maxB += 1;
}

if (((p.cap.ccap[0] & 0b11111) + 8) > b) {
int codestreamB = (p.cap.ccap[0] & 0b11111) + 8;
if (codestreamB > maxB) {
logger.addError(
IMFErrorLogger.IMFErrors.ErrorCodes.APPLICATION_COMPOSITION_ERROR,
IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
Expand Down

0 comments on commit 1fdf591

Please sign in to comment.