From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id F09A746059 for ; Tue, 1 Aug 2023 14:20:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 86AD168C50F; Tue, 1 Aug 2023 17:20:56 +0300 (EEST) Received: from out-64.mta0.migadu.com (out-64.mta0.migadu.com [91.218.175.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D053B68B9FF for ; Tue, 1 Aug 2023 17:20:49 +0300 (EEST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcheng.me; s=key1; t=1690899649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=AaSqi9CYvrRbjcK25IYWEnHPvSk3T1A1rVBSqT4vnIU=; b=JEvS7kGwPc9oIgDXldy809oFs0MoWHWYMdUL7YxfVuWzwDj1DO9gtwSnu588V7nZTKxAi6 bCD5iD1lXCi0SkG7VZtsLoo2gESZKjxBtk17VyXaHNIbvECrxuSpD6log/bjRxgSIqYbBJ vURzHRf4AZSCdPisiMXa8ZKRx0IsmcRS0w+2x2dxMbVc2vffd9vfpzEcxA+kBLSnJh/Hlg E/FQjw8ySh5edMX0vyhMi8wBHKitnBzQT7fwQ5f9Sgx+T5M07VGSgXt53vBsFkBF6lUyCt s0OOwRwQywAW5FlIvddkqswCqkvIk1VE1th2c68xVylh2byjvwiysIz3ik2UJw== From: Benjamin Cheng To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Aug 2023 10:20:34 -0400 Message-ID: <20230801142034.3341-1-ben@bcheng.me> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Subject: [FFmpeg-devel] [PATCH v3] vulkan_h264: fill correct ScalingList8x8 entries X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Benjamin Cheng Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The Vulkan spec wants ScalingList8x8 as defined by ITU spec, which is in a different order from how ffmpeg parses it. v2: generalize for 444 case v3: fix whitespace --- libavcodec/vulkan_h264.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c index 84bcef7933..20e03dd26a 100644 --- a/libavcodec/vulkan_h264.c +++ b/libavcodec/vulkan_h264.c @@ -43,6 +43,8 @@ typedef struct H264VulkanDecodePicture { VkVideoDecodeH264PictureInfoKHR h264_pic_info; } H264VulkanDecodePicture; +const static int h264_scaling_list8_order[] = { 0, 3, 1, 4, 2, 5 }; + static int vk_h264_fill_pict(AVCodecContext *avctx, H264Picture **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ @@ -147,7 +149,7 @@ static void set_sps(const SPS *sps, STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**sps->scaling_matrix4)); for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_matrix8[i], + memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_matrix8[h264_scaling_list8_order[i]], STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**sps->scaling_matrix8)); *vksps_vui_header = (StdVideoH264HrdParameters) { @@ -252,7 +254,7 @@ static void set_pps(const PPS *pps, const SPS *sps, STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**pps->scaling_matrix4)); for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_matrix8[i], + memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_matrix8[h264_scaling_list8_order[i]], STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**pps->scaling_matrix8)); *vkpps = (StdVideoH264PictureParameterSet) { -- 2.41.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".