From 326ea58650f588d609a8b9940285f79aa145af6a Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 4 Feb 2025 18:50:51 +0100 Subject: [PATCH] frontends/vdpau: Set H264 chroma_format_idc We don't get the actual value from VDPAU, so hardcode to 4:2:0. Cc: mesa-stable Reviewed-by: Ruijing Dong Part-of: (cherry picked from commit c28702c35a5815dfe97dc661d671f80cb970f62d) --- .pick_status.json | 2 +- src/gallium/frontends/vdpau/decode.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 488cb834cb3..599d9c0a58d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -194,7 +194,7 @@ "description": "frontends/vdpau: Set H264 chroma_format_idc", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/vdpau/decode.c b/src/gallium/frontends/vdpau/decode.c index 0f63bf8b699..dab27c04833 100644 --- a/src/gallium/frontends/vdpau/decode.c +++ b/src/gallium/frontends/vdpau/decode.c @@ -41,6 +41,7 @@ #define AV1_PRIMARY_REF_NONE AV1_REFS_PER_FRAME #define AV1_SUPERRES_DENOM_MIN 9 #define AV1_SUPERRES_NUM 8 +#define H264_CHROMA_FORMAT_IDC_420 1 /** * Create a VdpDecoder. @@ -362,6 +363,7 @@ vlVdpDecoderRenderH264(struct pipe_h264_picture_desc *picture, VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding H264\n"); + picture->pps->sps->chroma_format_idc = H264_CHROMA_FORMAT_IDC_420; picture->pps->sps->mb_adaptive_frame_field_flag = picture_info->mb_adaptive_frame_field_flag; picture->pps->sps->frame_mbs_only_flag = picture_info->frame_mbs_only_flag; picture->pps->sps->log2_max_frame_num_minus4 = picture_info->log2_max_frame_num_minus4;