aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2023-06-08 10:33:15 +1000
committerLynne <dev@lynne.ee>2023-06-08 02:42:02 +0200
commit2c4b6976d5b57dec938dba481fe5d3b93eb24f1e (patch)
tree5fd4b8a14d400c027abe9c1571388a53d8b2084b
parentbfd50906287d335598c92c34d0a963ce436efd1b (diff)
downloadffmpeg-2c4b6976d5b57dec938dba481fe5d3b93eb24f1e.tar.gz
vulkan/hevc: fix 32x32 scaling list indexing
This fixes another problem in the hevc scaling lists and aligns the code with what other hwaccels do.
-rw-r--r--libavcodec/vulkan_hevc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index dcf7e75bc5..5ddfd0daf3 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -231,14 +231,14 @@ static void set_sps(const HEVCSPS *sps, int sps_idx,
STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList16x16));
for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++)
- memcpy(vksps_scaling->ScalingList32x32[i], sps->scaling_list.sl[3][i],
+ memcpy(vksps_scaling->ScalingList32x32[i], sps->scaling_list.sl[3][i * 3],
STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList32x32));
memcpy(vksps_scaling->ScalingListDCCoef16x16, sps->scaling_list.sl_dc[0],
STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksps_scaling->ScalingListDCCoef16x16));
- memcpy(vksps_scaling->ScalingListDCCoef32x32, sps->scaling_list.sl_dc[1],
- STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS * sizeof(*vksps_scaling->ScalingListDCCoef32x32));
+ for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++)
+ vksps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3];
*vksps_vui_header = (StdVideoH265HrdParameters) {
.flags = (StdVideoH265HrdFlags) {
@@ -477,14 +477,14 @@ static void set_pps(const HEVCPPS *pps, const HEVCSPS *sps,
STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList16x16));
for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++)
- memcpy(vkpps_scaling->ScalingList32x32[i], pps->scaling_list.sl[3][i],
+ memcpy(vkpps_scaling->ScalingList32x32[i], pps->scaling_list.sl[3][i * 3],
STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList32x32));
memcpy(vkpps_scaling->ScalingListDCCoef16x16, pps->scaling_list.sl_dc[0],
STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vkpps_scaling->ScalingListDCCoef16x16));
- memcpy(vkpps_scaling->ScalingListDCCoef32x32, pps->scaling_list.sl_dc[1],
- STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS * sizeof(*vkpps_scaling->ScalingListDCCoef32x32));
+ for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++)
+ vkpps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3];
*vkpps = (StdVideoH265PictureParameterSet) {
.flags = (StdVideoH265PpsFlags) {