lavfi/tonemap_vaapi: By default use bt709 for output frame

By default don't use the color properties from input frame as output
frame properties when performing HDR to SDR conversion

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
Haihao Xiang 2024-03-18 16:12:44 +08:00
parent 1b5ca2e631
commit 3172a6722e
2 changed files with 7 additions and 4 deletions

View File

@ -27853,7 +27853,7 @@ Default is nv12.
@item primaries, p
Set the output color primaries.
Default is same as input.
Default is bt709.
@item transfer, t
Set the output transfer characteristics.
@ -27863,7 +27863,7 @@ Default is bt709.
@item matrix, m
Set the output colorspace matrix.
Default is same as input.
Default is bt709.
@end table

View File

@ -278,13 +278,16 @@ static int tonemap_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
if (err < 0)
goto fail;
/* Use BT709 by default for HDR to SDR output frame */
output_frame->color_primaries = AVCOL_PRI_BT709;
output_frame->color_trc = AVCOL_TRC_BT709;
output_frame->colorspace = AVCOL_SPC_BT709;
if (ctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
output_frame->color_primaries = ctx->color_primaries;
if (ctx->color_transfer != AVCOL_TRC_UNSPECIFIED)
output_frame->color_trc = ctx->color_transfer;
else
output_frame->color_trc = AVCOL_TRC_BT709;
if (ctx->color_matrix != AVCOL_SPC_UNSPECIFIED)
output_frame->colorspace = ctx->color_matrix;