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>
release/7.1
Haihao Xiang 10 months ago
parent 1b5ca2e631
commit 3172a6722e
  1. 4
      doc/filters.texi
  2. 7
      libavfilter/vf_tonemap_vaapi.c

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

@ -278,13 +278,16 @@ static int tonemap_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
if (err < 0) if (err < 0)
goto fail; 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) if (ctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
output_frame->color_primaries = ctx->color_primaries; output_frame->color_primaries = ctx->color_primaries;
if (ctx->color_transfer != AVCOL_TRC_UNSPECIFIED) if (ctx->color_transfer != AVCOL_TRC_UNSPECIFIED)
output_frame->color_trc = ctx->color_transfer; output_frame->color_trc = ctx->color_transfer;
else
output_frame->color_trc = AVCOL_TRC_BT709;
if (ctx->color_matrix != AVCOL_SPC_UNSPECIFIED) if (ctx->color_matrix != AVCOL_SPC_UNSPECIFIED)
output_frame->colorspace = ctx->color_matrix; output_frame->colorspace = ctx->color_matrix;

Loading…
Cancel
Save