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 2BBC9402AE for ; Tue, 1 Aug 2023 14:18:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2CEED68C4CF; Tue, 1 Aug 2023 17:18:45 +0300 (EEST) Received: from out-112.mta0.migadu.com (out-112.mta0.migadu.com [91.218.175.112]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1276068BCFB for ; Tue, 1 Aug 2023 17:18:39 +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=1690899518; 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=iKXFLPszuWQQJbPVCOmoZoPqyTBdmW5c1Qr3uvu+KRg=; b=ewTAJzcsi4ao4crWIaJ2KRZ8NQSG6LqpkqKp0rLR2xaca4S0qX0CKM/ElK0/OoWGWZ50cV nHf6FsudLgXVN46Igd4BY6jyIxCrH2oFYSLEhjFJCL99hC+mFQk/yYGt//zWAjvD6IvzGV POizc3+zOgym3ct3vKwsF8dPnjN/DMAgWejprT3idiWi4Ul4/KI797dVfW0t/KbRn9yE1b mKekMM5X5z5kjKXrzBo5rBAiY5OvPtGnA6ITTYkk3jdZ4R9QeTWdwKboJbM7A/PsSp9ycc Bv9VxlxhNeNLIySBYtpKcfQ6h4zbio1ed5xLKTJkr+yheQ7gNseXGACcBTe6sw== From: Benjamin Cheng To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Aug 2023 10:18:01 -0400 Message-ID: <20230801141801.2324-1-ben@bcheng.me> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Subject: [FFmpeg-devel] [PATCH v2] 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. --- libavcodec/vulkan_h264.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c index 84bcef7933..9d4ffa1f9d 100644 --- a/libavcodec/vulkan_h264.c +++ b/libavcodec/vulkan_h264.c @@ -43,6 +43,9 @@ 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,9 +150,9 @@ 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) { .cpb_cnt_minus1 = sps->cpb_cnt - 1, .bit_rate_scale = sps->bit_rate_scale, @@ -252,7 +255,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".