summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_mpeg2.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2020-11-02 22:46:49 +0000
committerMark Thompson <sw@jkqxz.net>2020-11-03 20:36:44 +0000
commit755203c2d270e1334987b462f80151eb88e30121 (patch)
tree7daf4c585b6b3b1a3996142eab12631db5406d92 /libavcodec/vaapi_encode_mpeg2.c
parent486817e1aedda759bd21287b462ee0bb6e100949 (diff)
downloadffmpeg-755203c2d270e1334987b462f80151eb88e30121.tar.gz
vaapi_encode_mpeg2: Fix setting colour properties
Follow the same pattern as the previous commits for H.264 and H.265. Reviewed-By: Jan Ekström <jeebjp@gmail.com> Tested-By: Xu, Yefeng <yefengx.xu@intel.com>
Diffstat (limited to 'libavcodec/vaapi_encode_mpeg2.c')
-rw-r--r--libavcodec/vaapi_encode_mpeg2.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index b8f1c06d0f..df2c62b8e7 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -292,17 +292,16 @@ static int vaapi_encode_mpeg2_init_sequence_params(AVCodecContext *avctx)
priv->sequence_display_extension.extension_start_code_identifier =
MPEG2_EXTENSION_SEQUENCE_DISPLAY;
+ // Unspecified video format, from table 6-6.
sde->video_format = 5;
- if (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
+
+ sde->colour_primaries = avctx->color_primaries;
+ sde->transfer_characteristics = avctx->color_trc;
+ sde->matrix_coefficients = avctx->colorspace;
+ sde->colour_description =
+ avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
- avctx->colorspace != AVCOL_SPC_UNSPECIFIED) {
- sde->colour_description = 1;
- sde->colour_primaries = avctx->color_primaries;
- sde->transfer_characteristics = avctx->color_trc;
- sde->matrix_coefficients = avctx->colorspace;
- } else {
- sde->colour_description = 0;
- }
+ avctx->colorspace != AVCOL_SPC_UNSPECIFIED;
sde->display_horizontal_size = avctx->width;
sde->display_vertical_size = avctx->height;