Skip to content

Commit f711967

Browse files
committed
Differentiating between severe and less severe Parameter B violations
1 parent 93be708 commit f711967

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/main/java/com/netflix/imflibrary/st2067_2/Application2E2021.java

+20-4
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ public Application2E2021(@Nonnull IMFCompositionPlaylistType imfCompositionPlayl
272272
}
273273
}
274274

275+
/* Validate codestream parameters against constraints listed in SMPTE ST 2067-21:2023 Annex I */
276+
275277
private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDescriptor,
276278
IMFErrorLogger logger) {
277279
boolean isValid = true;
@@ -501,7 +503,7 @@ private static boolean validateHT(CompositionImageEssenceDescriptorModel imageDe
501503
break;
502504
}
503505

504-
/* magbp */
506+
/* magbp - calculation according to ITU-T T.814 */
505507

506508

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

516518
int codestreamB = (p.cap.ccap[0] & 0b11111) + 8;
517-
if (codestreamB > maxB) {
519+
520+
/*
521+
* NOTE: The Parameter B constraints in ST 2067-21:2023 are arguably too narrow, and existing implementations do violate them under certain circumstances.
522+
* Since practical issues are not expected from software decoders for Parameter B values <= 24, we only raise WARNING for spec violations below that threshold.
523+
*
524+
* TODO: This should be revisited as more implementations become available.
525+
*/
526+
527+
if (codestreamB > 24) {
528+
logger.addError(
529+
IMFErrorLogger.IMFErrors.ErrorCodes.APPLICATION_COMPOSITION_ERROR,
530+
IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
531+
"APP2.HT: Parameter B has exceeded its limit to an extend that decoder issues are to be expected");
532+
isValid = false;
533+
} else if (codestreamB > maxB) {
518534
logger.addError(
519535
IMFErrorLogger.IMFErrors.ErrorCodes.APPLICATION_COMPOSITION_ERROR,
520-
IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
536+
IMFErrorLogger.IMFErrors.ErrorLevels.WARNING,
521537
"APP2.HT: Parameter B has exceeded its limits");
522-
isValid = false;
538+
isValid = true;
523539
}
524540

525541
return isValid;

0 commit comments

Comments
 (0)