From 94906337232779b613d0b510e3c8d5abf6f36784 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Wed, 22 Feb 2023 23:32:28 -0500 Subject: [PATCH] d3d12: Fix VP9 Decode - Checking 0xFF instead of 0x7F for invalid frame_ref[i].Index7Bits Fixes: c8e8ce8359ceb9161ac05cf48b15e2e6a298ebd6 ("d3d12: Add VP9 Decode support") Part-of: --- src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp | 4 ++-- src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp index 26638d4295a..816343828d6 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp @@ -310,7 +310,7 @@ d3d12_video_decoder_dxva_picparams_from_pipe_picparams_vp9( dxvaStructure.ref_frame_coded_width[i] = pipe_vp9->ref[i]->width; dxvaStructure.ref_frame_coded_height[i] = pipe_vp9->ref[i]->height; } else - dxvaStructure.ref_frame_map[i].bPicEntry = DXVA_VP9_INVALID_PICTURE_INDEX; + dxvaStructure.ref_frame_map[i].bPicEntry = DXVA_VP9_INVALID_PICTURE_ENTRY; } /* DXVA spec The enums and indices for ref_frame_sign_bias[] are defined */ @@ -319,7 +319,7 @@ d3d12_video_decoder_dxva_picparams_from_pipe_picparams_vp9( const uint8_t signbias_alt_index = 3; /* AssociatedFlag When Index7Bits does not contain an index to a valid uncompressed surface, the value shall be set to 127, to indicate that the index is invalid. */ - memset(&dxvaStructure.frame_refs[0], DXVA_VP9_INVALID_PICTURE_INDEX, sizeof(dxvaStructure.frame_refs)); + memset(&dxvaStructure.frame_refs[0], DXVA_VP9_INVALID_PICTURE_ENTRY, sizeof(dxvaStructure.frame_refs)); if (pipe_vp9->ref[pipe_vp9->picture_parameter.pic_fields.last_ref_frame]) { /* AssociatedFlag When Index7Bits does not contain an index to a valid uncompressed surface, the value shall be set to 127, to indicate that the index is invalid. */ diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h index 322daf7bd63..24aa032ef0b 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h @@ -27,7 +27,8 @@ #include "d3d12_video_types.h" -constexpr uint16_t DXVA_VP9_INVALID_PICTURE_INDEX = 0xFF; +constexpr uint16_t DXVA_VP9_INVALID_PICTURE_INDEX = 0x7F; +constexpr uint16_t DXVA_VP9_INVALID_PICTURE_ENTRY = 0xFF; #pragma pack(push, BeforeDXVApacking, 1)