Skip to content

Commit

Permalink
Differentiating between severe and less severe Parameter B violations
Browse files Browse the repository at this point in the history
  • Loading branch information
fschleich committed Aug 14, 2024
1 parent 93be708 commit f711967
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public Application2E2021(@Nonnull IMFCompositionPlaylistType imfCompositionPlayl
}
}

/* Validate codestream parameters against constraints listed in SMPTE ST 2067-21:2023 Annex I */

private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDescriptor,
IMFErrorLogger logger) {
boolean isValid = true;
Expand Down Expand Up @@ -501,7 +503,7 @@ private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDe
break;
}

/* magbp */
/* magbp - calculation according to ITU-T T.814 */


int maxB = p.csiz[0].ssiz + 2;
Expand All @@ -514,12 +516,26 @@ private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDe
}

int codestreamB = (p.cap.ccap[0] & 0b11111) + 8;
if (codestreamB > maxB) {

/*
* NOTE: The Parameter B constraints in ST 2067-21:2023 are arguably too narrow, and existing implementations do violate them under certain circumstances.
* Since practical issues are not expected from software decoders for Parameter B values <= 24, we only raise WARNING for spec violations below that threshold.
*
* TODO: This should be revisited as more implementations become available.
*/

if (codestreamB > 24) {
logger.addError(
IMFErrorLogger.IMFErrors.ErrorCodes.APPLICATION_COMPOSITION_ERROR,
IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
"APP2.HT: Parameter B has exceeded its limit to an extend that decoder issues are to be expected");
isValid = false;
} else if (codestreamB > maxB) {
logger.addError(
IMFErrorLogger.IMFErrors.ErrorCodes.APPLICATION_COMPOSITION_ERROR,
IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
IMFErrorLogger.IMFErrors.ErrorLevels.WARNING,
"APP2.HT: Parameter B has exceeded its limits");
isValid = false;
isValid = true;
}

return isValid;
Expand Down

0 comments on commit f711967

Please sign in to comment.