summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-11 17:22:36 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-11 17:22:36 +0100
commit6d8b47e4dfb4c00dae56e5ca275b70b16b40a7a8 (patch)
tree16630ec41ed652caf63e5a67e015ef388254f82b /src
parent6daa16d2893d0c0d9cd8433f3a03f76c76f031de (diff)
Check frame sizes correctly in both J2K and MPEG2 cases.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc70
1 files changed, 39 insertions, 31 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 458883d5..59e28e0f 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -562,45 +562,53 @@ verify_main_picture_asset(Context& context, shared_ptr<const ReelPictureAsset> r
verify_picture_details(context, reel_asset, file, start_frame);
}
- /* Only flat/scope allowed by Bv2.1 */
- if (
- asset->size() != Size(2048, 858) &&
- asset->size() != Size(1998, 1080) &&
- asset->size() != Size(4096, 1716) &&
- asset->size() != Size(3996, 2160)) {
- context.bv21_error(VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS, String::compose("%1x%2", asset->size().width, asset->size().height), file);
- }
-
- /* Only 24, 25, 48fps allowed for 2K */
- if (
- (asset->size() == Size(2048, 858) || asset->size() == Size(1998, 1080)) &&
- (asset->edit_rate() != Fraction(24, 1) && asset->edit_rate() != Fraction(25, 1) && asset->edit_rate() != Fraction(48, 1))
- ) {
- context.bv21_error(
- VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
- file
- );
- }
+ if (reel_asset->j2k_asset()) {
+ /* Only flat/scope allowed by Bv2.1 */
+ if (
+ asset->size() != Size(2048, 858) &&
+ asset->size() != Size(1998, 1080) &&
+ asset->size() != Size(4096, 1716) &&
+ asset->size() != Size(3996, 2160)) {
+ context.bv21_error(VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS, String::compose("%1x%2", asset->size().width, asset->size().height), file);
+ }
- if (asset->size() == Size(4096, 1716) || asset->size() == Size(3996, 2160)) {
- /* Only 24fps allowed for 4K */
- if (asset->edit_rate() != Fraction(24, 1)) {
+ /* Only 24, 25, 48fps allowed for 2K */
+ if (
+ (asset->size() == Size(2048, 858) || asset->size() == Size(1998, 1080)) &&
+ (asset->edit_rate() != Fraction(24, 1) && asset->edit_rate() != Fraction(25, 1) && asset->edit_rate() != Fraction(48, 1))
+ ) {
context.bv21_error(
- VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K,
+ VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K,
String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
file
);
}
- /* Only 2D allowed for 4K */
- if (dynamic_pointer_cast<const StereoJ2KPictureAsset>(asset)) {
- context.bv21_error(
- VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
- file
- );
+ if (asset->size() == Size(4096, 1716) || asset->size() == Size(3996, 2160)) {
+ /* Only 24fps allowed for 4K */
+ if (asset->edit_rate() != Fraction(24, 1)) {
+ context.bv21_error(
+ VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K,
+ String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
+ file
+ );
+ }
+
+ /* Only 2D allowed for 4K */
+ if (dynamic_pointer_cast<const StereoJ2KPictureAsset>(asset)) {
+ context.bv21_error(
+ VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D,
+ String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
+ file
+ );
+
+ }
+ }
+ }
+ if (reel_asset->mpeg2_asset()) {
+ if (asset->size() != Size(1920, 1080)) {
+ context.error(VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS, String::compose("%1x%2", asset->size().width, asset->size().height), file);
}
}
}