Commit 799b0625bb for ffmpeg
commit 799b0625bbf2f7b8d363db4cd782a45ed3348f9b
Author: Kacper Michajłow <kasper93@gmail.com>
Date: Wed Sep 30 19:18:25 2026 +0200
avfilter/vaapi_vpp: assume untagged input is sited like the output
VA-API leaves the meaning of an unknown chroma siting to the driver, so an
untagged input with a tagged output was converted from the driver's own
default. Take the input location from the output instead, so that nothing
is converted.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c
index cb855cc281..1676820061 100644
--- a/libavfilter/vaapi_vpp.c
+++ b/libavfilter/vaapi_vpp.c
@@ -463,10 +463,6 @@ static int vaapi_vpp_colour_properties(AVFilterContext *avctx,
.chroma_sample_location = input_frame->chroma_location,
};
- vaapi_vpp_fill_colour_properties(avctx, &input_props,
- caps.input_color_standards,
- caps.num_input_color_standards);
-
output_props = (VAAPIColourProperties) {
.colorspace = vaapi_vpp_frame_is_rgb(output_frame)
? AVCOL_SPC_RGB : output_frame->colorspace,
@@ -475,6 +471,14 @@ static int vaapi_vpp_colour_properties(AVFilterContext *avctx,
.color_range = output_frame->color_range,
.chroma_sample_location = output_frame->chroma_location,
};
+
+ // Input without a chroma location is assumed to be sited like the output.
+ if (input_props.chroma_sample_location == AVCHROMA_LOC_UNSPECIFIED)
+ input_props.chroma_sample_location = output_props.chroma_sample_location;
+
+ vaapi_vpp_fill_colour_properties(avctx, &input_props,
+ caps.input_color_standards,
+ caps.num_input_color_standards);
vaapi_vpp_fill_colour_properties(avctx, &output_props,
caps.output_color_standards,
caps.num_output_color_standards);