From b29992f5e5530993282d9abc87fc844ead5bfe58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Pint=C3=A9r?= Date: Thu, 26 Oct 2023 20:26:45 +0200 Subject: [PATCH] Obtain frame props before RGB->444 conversion as well (#354) --- avs_core/convert/convert_planar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/avs_core/convert/convert_planar.cpp b/avs_core/convert/convert_planar.cpp index d3e019830..9b0eb3e93 100644 --- a/avs_core/convert/convert_planar.cpp +++ b/avs_core/convert/convert_planar.cpp @@ -345,8 +345,12 @@ ConvertRGBToYUV444::ConvertRGBToYUV444(PClip src, const char *matrix_name, bool if (!vi.IsRGB()) env->ThrowError("ConvertRGBToYV24/YUV444: Only RGB data input accepted"); + // ChromaInPlacement parameter exists, (default none/-1) + input frame properties; 'left'-ish _ChromaLocation is allowed, checked later + auto frame0 = src->GetFrame(0, env); + const AVSMap* props = env->getFramePropsRO(frame0); + // input _ColorRange frame property can appear for RGB source (studio range limited rgb) - matrix_parse_merge_with_props(true /*in rgb*/, false /*out yuv*/, matrix_name, nullptr, theMatrix, theColorRange, theOutColorRange, env); + matrix_parse_merge_with_props(true /*in rgb*/, false /*out yuv*/, matrix_name, props, theMatrix, theColorRange, theOutColorRange, env); const int shift = 15; // internally 15 bits precision, still no overflow in calculations int bits_per_pixel = vi.BitsPerComponent();