From patchwork Tue Aug 8 10:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43171 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2186834pzh; Tue, 8 Aug 2023 03:59:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZO8MuU8IL4VfwQCyvgQENGq2KBWV9SkspuhmgXHr4ghccr1V6jiNDGw7D1DZMH08EKRoT X-Received: by 2002:a17:907:2c42:b0:98e:2b01:ab97 with SMTP id hf2-20020a1709072c4200b0098e2b01ab97mr9082354ejc.68.1691492380350; Tue, 08 Aug 2023 03:59:40 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h8-20020a170906398800b00993690d17a2si7405186eje.5.2023.08.08.03.59.39; Tue, 08 Aug 2023 03:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=Xzg7X6AN; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 115FE68C7A4; Tue, 8 Aug 2023 13:59:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2092.outbound.protection.outlook.com [40.92.53.92]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFDDE68C778 for ; Tue, 8 Aug 2023 13:59:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UF+XFWHjHB6iOjoAmUKbk4SWwzNzhjBD/ywvuzoKUdFrIeQOG9cBwVqouMLA0pOE6JGs0lN/c3gU42ve/ADqqsHxs5yAF4v+R23dWlALPH9zzluN2hq85rRiQTYys9xQ3UKgDwwLjAsf/0l//aVtsBy9bJlFbpI3pKZIttg9D+foAPrLBa7VB7E7FESBkzI6U/iZgG4rupbt2fxSDc2q1v0uHTcwwemCiGwKORY/OiDy2ZBIzbhVgebM8sMHjZqHr7qPLBE310SwI4JaUPBt4TgFCIN90fo7UMa4Pzk7/aXM6L1ZO63CX8Xszj3FVIvqm/dSDTg54y9Q3RaAewG0Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JL20fwawyHQU5BLkYlUj7UBCkj8wnwB4Gh4Vs1Qkn40=; b=Dre2xG7StBul/xLxvNg/aQuLNmrwhrBB3YXrsFM2KwB9qb616ePGrbENgukG/w1vvVdVAmALimW7aKLFA+aeejHp376nvcV9U8biXWNvIB1ORMI1Ufmchew615hyPptrwNcn36QpAj9JbiQqbnJbKuLKXvYT47d4Zg6qzzCFRmnSbpG70D9sXSeQICk7s4v5K4R/0ndDTz08yLzWPmYIrKeBkN3/szWcIk7gxu7boELdYLBYWNtgHUo5e+aOpie+R3b2pXRfWTILoX/ZY3YhRes+8YgM7nNFc2yWWknLctPECUfOF5yXgppWskOCJ2S9Y7/9mP9KsDYqVD5lJI5beg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JL20fwawyHQU5BLkYlUj7UBCkj8wnwB4Gh4Vs1Qkn40=; b=Xzg7X6ANKAgjSWj89JCVE+c0ioV1sE5BZzHf9QdzY0OT/y0ZN5U4QJFY7Oj03pFdcRRcxEdCa7adrM6XLhmRdqlUYHjLAF44nThCYonRLae7dkSwX3T+gvpORJl4bmFZ3MY0zjK2Q3NGXzyKserUmvQ12OHQzRfs7dbpZQLRGEMFAaQOEgnb+RH+7pP2vnA2vOviu6diHlkloJt5OhtacshjMlh4jK/kYCbKi7qpIKjkPIMckUibqF/TlF6urg7lzhecrUueoVBXdK0JIBV+4/3B+t25F+R128ndbhEybGveLBgBVICkuPjGUFDKsFCrWjvC5/5VQm385NY9WY3IaA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:04 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:04 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:58:57 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [30By9rg4OIiFRZV+yz1wyweqJafFpgvS] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-2-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: ff06f20c-ba41-4ec6-7cf3-08db97fe7ade X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3+s4+qbIMf+4f5rwtOZg/0ko/upZj4t6gyqSumYUChIcY4qlZ2aFaKRCMfh6oJwq2ICbtGtZKLUD746gbEddYjaOq/+2hobnQua6FrDasRWX8P9eOjBIzpNAIpi0lm7wzKoQCJZjKeq6bdcYXFoWat5I5lZRKMCa+evjRjluwFtoksKXvMTp1QS/FPJkhlAyU+xZFwIeRCQOGFO+uy3JgFh18cczDwpZA3dZIx6uXwiDcn6/pWf1pQPs9QmQtd8OlUj7SjvaI0LthogARVN8I/1aPu+u4FQdojB+EemJ4s0OeDLS3QXpZ34K1kHM1vlhKvXyaOJNb9G49MIf6edlZGh6WNJEYXtWK85FALgu6fnVrxS/feWNPrJQq84Wo2J17Vi5YWhl4EYUfU84RmX2i2gTLS9TwBUDf2ur/Rq29EDXu7mBirAXSepz3kfR9tm/XN46f3uFtTTj7PcZGB6xOB/Bcs+HSjnV38+aqueTfooAvyokSFXME5DJHMNIUsJxDJ3/hgebgQ3e66yBExalfjfRBu49caMIgkd91R7xdYLSRUuMdx6kt6gGQMo+cxpFh0xwdPKN9dfDu/k23HICS8F+iAGqSmNFa9mHIFgFyaxXlBTY7ppV06L3YFeXNGKw X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5RIql0ex/1RHAb/Ndvt6tFvWRM8ZsDqnzRTMGjnXHg53YGUKR0GwZPT6U021zUX+ZXJs9A6eRqO4//eCtT/RxYbgeVLB7EpPVKQaB/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1jcZ2jOVi7f26llAPAxmX1IxSaBUVYf+u9Vkwl0M9Aa4hbYv9xNLBU63WBllMOj9I7UlB+6/6hju/tzFBgbb45MhL X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff06f20c-ba41-4ec6-7cf3-08db97fe7ade X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:04.4902 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 2/8] cbs_h266: fix inference for sh_alf_enabled_flag 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: B1JXB2LHia6E if pps_alf_info_in_ph_flag is true sh_alf_enabled_flag infered from ph Failed clip: LTRP_A_ERICSSON_3.bit --- libavcodec/cbs_h266_syntax_template.c | 81 ++++++++++++++++----------- 1 file changed, 47 insertions(+), 34 deletions(-) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 857882655b..801feedb4a 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3111,44 +3111,57 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (nal_unit_type == VVC_IDR_W_RADL || nal_unit_type == VVC_IDR_N_LP || nal_unit_type == VVC_CRA_NUT || nal_unit_type == VVC_GDR_NUT) flag(sh_no_output_of_prior_pics_flag); - if (sps->sps_alf_enabled_flag && !pps->pps_alf_info_in_ph_flag) { - flag(sh_alf_enabled_flag); - if (current->sh_alf_enabled_flag) { - ub(3, sh_num_alf_aps_ids_luma); - for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) - ubs(3, sh_alf_aps_id_luma[i], 1, i); - if (sps->sps_chroma_format_idc != 0) { - flag(sh_alf_cb_enabled_flag); - flag(sh_alf_cr_enabled_flag); - } else { + + if (sps->sps_alf_enabled_flag) { + if (!pps->pps_alf_info_in_ph_flag) { + flag(sh_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + ub(3, sh_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + ubs(3, sh_alf_aps_id_luma[i], 1, i); + + if (sps->sps_chroma_format_idc != 0) { + flag(sh_alf_cb_enabled_flag); + flag(sh_alf_cr_enabled_flag); + } + if (current->sh_alf_cb_enabled_flag || + current->sh_alf_cr_enabled_flag) { + ub(3, sh_alf_aps_id_chroma); + } + + if (sps->sps_ccalf_enabled_flag) { + flag(sh_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + ub(3, sh_alf_cc_cb_aps_id); + + flag(sh_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + ub(3, sh_alf_cc_cr_aps_id); + } + } + } else { + infer(sh_alf_enabled_flag, ph->ph_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + infer(sh_num_alf_aps_ids_luma, ph->ph_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + infer(sh_alf_aps_id_luma[i], ph->ph_alf_aps_id_luma[i]); + infer(sh_alf_cb_enabled_flag, ph->ph_alf_cb_enabled_flag); infer(sh_alf_cr_enabled_flag, ph->ph_alf_cr_enabled_flag); - } - if (current->sh_alf_cb_enabled_flag || - current->sh_alf_cr_enabled_flag) - ub(3, sh_alf_aps_id_chroma); - else - infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); - if (sps->sps_ccalf_enabled_flag) { - flag(sh_alf_cc_cb_enabled_flag); - if (current->sh_alf_cc_cb_enabled_flag) - ub(3, sh_alf_cc_cb_aps_id); - else - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - flag(sh_alf_cc_cr_enabled_flag); - if (current->sh_alf_cc_cr_enabled_flag) - ub(3, sh_alf_cc_cr_aps_id); - else - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); - } else { - infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); - infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + if (current->sh_alf_cb_enabled_flag ||current->sh_alf_cr_enabled_flag) + infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); + + if (sps->sps_ccalf_enabled_flag) { + infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); + + infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + } } } - } else { - infer(sh_alf_enabled_flag, 0); } if (current->sh_picture_header_in_slice_header_flag) { From patchwork Tue Aug 8 10:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43170 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2186756pzh; Tue, 8 Aug 2023 03:59:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErhS7FbDML9dIg/L/n4Q0EuEFwm86aPNdhTkqMpPVNEpalbpBOou0VjKSHkE+ua7csFz10 X-Received: by 2002:a17:907:2cd2:b0:991:b834:af83 with SMTP id hg18-20020a1709072cd200b00991b834af83mr9061305ejc.59.1691492370062; Tue, 08 Aug 2023 03:59:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ec2-20020a170906b6c200b00997e71d0377si7069689ejb.366.2023.08.08.03.59.29; Tue, 08 Aug 2023 03:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=WntAbrm2; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D4E7568C51E; Tue, 8 Aug 2023 13:59:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2062.outbound.protection.outlook.com [40.92.107.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3DCED68C778 for ; Tue, 8 Aug 2023 13:59:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RvuH8m65wF31/LEnmx7s4OrhCZjr765pBZID+LAuSBlG+X+MGdcpZZ1d5jc6mAUpiYXmebl0J7WXS59+RLbDE9zlfZIYUgUoAtoIpWf37cbQzrUbd07EirIrLDSV4RHcOL3429Oh9tS5UFvfnol/cdDdUUa5E6trXqlK4/WQ1IJEVMfY89yLi1CT1Xr5UWOY3HJnsNXv0oI3dAGf3fN8VI+4r3NVEyVtF6K4ZYKbRV/ZdoHCoe8Bw9BWhh6OBLo/yoMMBVeqFM+vTdfrXOou32WpiVBJZhEBWOpcL9Pxbg30BJtNkazw/0CWVDJxhqDZB/GCzgicnL2yRNQEqrRmXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ngMSIYpwg7pBpLqfKK2ZsahaXAsUWCIFlJG54lRqJZ4=; b=Dw0+2Bkbgjdqc5G9rSp1dPnNmONHXB1jnzbyZ4RiF9VnFzExoBg98VOEppBn3kt6KpBJHWeS8tSvO1rzJN9iEAA0SK/ODaAdvlifOH/b+rt7wcsDHW34IHJwiiIw4cWpDGDkEEm5gDM/+XZS/XyFUWKTnO0PrYiMcV0EQn0wkx628j3kaO2jgrBstbBQg2vMPTF8sB64SQlS47v6x1X0Svu1ayQ+IGpaORp8cn/WO45rRwTplw2jYs+TeEe/M6Kkr/lEDNeTdxhKL53Bk9WnkUUZcc7AYTZfmXKS1/c5QxYbfSfr1ZS81fV1GBvnQw1/9W1zrSCG0j8R+pc0LL3uGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ngMSIYpwg7pBpLqfKK2ZsahaXAsUWCIFlJG54lRqJZ4=; b=WntAbrm2HOOyM8pgvtucmWQ7ZFouKJMtY5JmW+8dtbSKMiq6cSrHfPU/5Wys6yaDJB4USAYWTJr/FLC+Ht0cjCujkvRrttEM5hZGZ3/0BKFopgEMHSfLNB8uhRin/06E2rRWRSLy/k4Iiu+mvHVol8t2lIxe0gK3BMuyJQ0Bz0Hb3h7GkKbCcLh8OWTHYTg+78+N7E1elbuylGydAkoQFCXU+qwCJG1FnBTmbJf7P7gbygF3S10kkaX8o6juiYaVYUNv8vbaNgvb08pmoRVV9P1P0S0v95EN2qx5CQvThg3F/tRuRiEGpS65TTlisHZnc8RMJ7KRFQmowVFQzurWNA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:05 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:05 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:58:58 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [7mGS0p2NNxB9GVux15bIibjTy7+mxzzd] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-3-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: e1bfb793-280c-4ef8-8e5e-08db97fe7b6d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lIfu+aqmjcUkxwqO6w6KjqVDlw/cyqjzErRQ4gd59Pfq+59s5GFWeYXYv1tpZfPkw98lmPS1BqCxQB1XhrUoilFdBSWkyQK+B5/FZT12/OzmD9NVgimF/YyEPnVkgIJYDVz8xUDSyj2hw30ZL7HIL0Z+KOJgSIrBDvZqgfkhn4FXZdBcIOGM9TDTruAxJyj95R7Lbvsh7C2GjK3AvHxC974xZ7KCfw1Ip0TZUXPs0fvslQTLclyBJUZUyyjbJmX1ohhrfqIdyBIHrAjyihPsLKx+xHeNwZNTZKzIuRifKhCvM9z2sJ2E6UTEdt3CWWejYd7FIsKXJ8Zg8xxYyCJ4MzwsOypY6GVhG6k8p72WFtzoazSq+iGOMeiBcagb4yf3BBglajSGn+vIs1vNep2L1k2EyGWmAasJqLnUu+hAEvFdJUQSJcd34O4qHfV5d32LQAnhMn2in/iIheUEXxspCJI3T3xHI0P9uhlOP4NiaYV55Dy5mf3BXuD6lTDWbSmgefV3LoYek6f96kSlE6rB+br3c1cJ1027V5JR9mBm27SKqk7JSZW9PP9xeMIQ+qcmRUmlYK1zkTLYNDcsKtIic1XcF+6WJ1C9lfZ2y6JGzRTD+OvwzWPZ+QBYA+KEEsSN X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C44LsgvDlcn+n3b9o3M2frrcxjcOnyavKfxftxX5JB805z7w0Zj04uKMUADRsplzKlfBe4YMqY4hqPSfxSncTKB74RSBCRX8kAv7aN+CIlqgu5TZfCN7Wg4GtkHc6MYOvf9rvtv/QCJJFIBF8PZkBg++Ot2Ylr/J28OILpfVyRIsb2ftm5Gou9gBtQnqrEbTWoB6++zqNqGnWRUsqx6sQ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-Network-Message-Id: e1bfb793-280c-4ef8-8e5e-08db97fe7b6d X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:05.3969 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 3/8] cbs_h266: fix inference for xh_deblocking_filter_disabled_flag 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: B9FW3hNQrACj if !ph_deblocking_params_present_flag is true, ph_deblocking_filter_disabled_flag infered from pps if !sh_deblocking_params_present_flag is true, sh_deblocking_filter_disabled_flag infered from ph Failed clips: ENT444MAINTIER_C_Sony_3.bit ENT444HIGHTIER_D_Sony_3.bit --- libavcodec/cbs_h266_syntax_template.c | 76 ++++++++++----------------- 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 801feedb4a..7277154c40 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -2938,20 +2938,14 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_sao_chroma_enabled_flag, 0); } - if (pps->pps_dbf_info_in_ph_flag) { + if (pps->pps_dbf_info_in_ph_flag) flag(ph_deblocking_params_present_flag); - if (current->ph_deblocking_params_present_flag) { - if (!pps->pps_deblocking_filter_disabled_flag) { - flag(ph_deblocking_filter_disabled_flag); - } else { - if (pps->pps_deblocking_filter_disabled_flag && - current->ph_deblocking_params_present_flag) { - infer(ph_deblocking_filter_disabled_flag, 0); - } else { - infer(ph_deblocking_filter_disabled_flag, - pps->pps_deblocking_filter_disabled_flag); - } - } + else + infer(ph_deblocking_params_present_flag, 0); + + if (current->ph_deblocking_params_present_flag) { + if (!pps->pps_deblocking_filter_disabled_flag) { + flag(ph_deblocking_filter_disabled_flag); if (!current->ph_deblocking_filter_disabled_flag) { se(ph_luma_beta_offset_div2, -12, 12); se(ph_luma_tc_offset_div2, -12, 12); @@ -2970,25 +2964,19 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_cr_tc_offset_div2, current->ph_luma_tc_offset_div2); } - } else { - infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); - infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); - infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); - infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); - infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); - } else { - infer(ph_cb_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cb_tc_offset_div2, - current->ph_luma_tc_offset_div2); - infer(ph_cr_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cr_tc_offset_div2, - current->ph_luma_tc_offset_div2); - } } + } else { + infer(ph_deblocking_filter_disabled_flag, 0); + } + } else { + infer(ph_deblocking_filter_disabled_flag, pps->pps_deblocking_filter_disabled_flag); + if (!current->ph_deblocking_filter_disabled_flag) { + infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); + infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); + infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); + infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); + infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); + infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); } } @@ -3321,9 +3309,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (!pps->pps_deblocking_filter_disabled_flag) flag(sh_deblocking_filter_disabled_flag); else - infer(sh_deblocking_filter_disabled_flag, - !(pps->pps_deblocking_filter_disabled_flag && - current->sh_deblocking_params_present_flag)); + infer(sh_deblocking_filter_disabled_flag, 0); if (!current->sh_deblocking_filter_disabled_flag) { se(sh_luma_beta_offset_div2, -12, 12); se(sh_luma_tc_offset_div2, -12, 12); @@ -3340,22 +3326,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_luma_beta_offset_div2); infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); } - } else { + } + } else { + infer(sh_deblocking_filter_disabled_flag, ph->ph_deblocking_filter_disabled_flag); + if (!current->sh_deblocking_filter_disabled_flag) { infer(sh_luma_beta_offset_div2, ph->ph_luma_beta_offset_div2); infer(sh_luma_tc_offset_div2, ph->ph_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); - infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); - infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); - infer(sh_cr_tc_offset_div2, ph->ph_cr_beta_offset_div2); - } else { - infer(sh_cb_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cb_tc_offset_div2, current->sh_luma_tc_offset_div2); - infer(sh_cr_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); - } + infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); + infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); + infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); + infer(sh_cr_tc_offset_div2, ph->ph_cr_tc_offset_div2); } } From patchwork Tue Aug 8 10:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43172 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2186892pzh; Tue, 8 Aug 2023 03:59:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE++Kl8mocYi5XwP00Ei9jIghG9dG/6j0C1kEsFHf6PExNcoFwkPUjzbuNzl+RvEW2YgP8K X-Received: by 2002:a17:906:18:b0:98d:76f8:217b with SMTP id 24-20020a170906001800b0098d76f8217bmr11521422eja.73.1691492388569; Tue, 08 Aug 2023 03:59:48 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p26-20020a1709061b5a00b00992dcae7002si7524727ejg.365.2023.08.08.03.59.48; Tue, 08 Aug 2023 03:59:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=HWBVyCfp; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 300E968C7AF; Tue, 8 Aug 2023 13:59:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2062.outbound.protection.outlook.com [40.92.107.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C5F3068C378 for ; Tue, 8 Aug 2023 13:59:19 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EdfnH0rzueFbm+FDsO0dKV1kJiQRJVJ/yR7Nor883uL2F4YEFGi1bhWs6zgoeInXYMuFfM9DTrEWhrjJUVe++3xMd4NHyZYNRePs6/pZ65TWF0dRImquh9cHA9vLNmNfbTX25srjVugCN0AkPPy2BkDhLROO+uBf6SKfjNFj0PW8KwNZ54lQoBd4P6QVFf3gP9cVCw6Dyv2pqUtmzH6sQrWh/AwwPr0B3IK8ORz1gST788XX1MPdjEwbvGy4ijXAUEd94mpodoa2uBpvvC54W5JQ0ln/QIthJnUOwaGxnVKN158KEBCcmZZJzGjmYWnHLxKrqHvyNik7YjmLGnAVrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ozUiXSTUnouR97ni7PfS/RK420LCvNrFEf4puOJiVj8=; b=iboM8Q5IW16ozilDVqvM5xxzMGlsBpLHhqWykhMquLm9L86LwwtjacswUUl/rvmqmrgpls2iBZw/C+OnJ1+V6isLcWPM0RPjqeAx8S/328GtCocDMAsEsC732ZGD5Hezz0TMvdO1XDw9hqyJbbPC07W/JfkEAo0yFXLbe+f/+qiOZM3+YT9ClL6cQV05gBj4dln1WXVZL+6J5SFB3k7lSvApsd7vvEDPLv0CjoD82ACaKOZf4chgkUVVRWWrRvaFdmVx34hnEE/4iI+aGtChHoNuBvBi54CXkR6MMOhE7l21K6Iv+7nEl/UBg3C5X11X/yruvLLBcof/HkC16RwTKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ozUiXSTUnouR97ni7PfS/RK420LCvNrFEf4puOJiVj8=; b=HWBVyCfpsiv8XpTEWYX9Yae1FHFkMbXO7Yd6B2/ajxGH1FJeGRhmNq79LGQfranubfXhc8jF1wknVQ7X9FxjU5/UiLSaA3Jn6JwLOG9A+cxJqGLQYoxN+2KGxz6NkXExp6Azi3yX9OhYrqYALrIhAHdXJSC0Dn4DmFMbXmvrtRVqh8q9z1rC7pTtTn+8Ept1kTOkI+2tslSFtmaQiPEWzCr+DgesRlZs8DdjptdCAyXxCWDufairLgoRhvZMlM2RIoDGcZ5eatHWmS0pyoRQMDZMI2l7dx6N7O/XPvKLYYKJ3udVkow3EOA/ufG+4SJDYohBrOQosm8KJZgrx1K0pg== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:06 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:06 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:58:59 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [4g0UwTS/3gMwVh71KElM/Kx9MhCB6//0] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-4-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: 750cb990-4a96-48f4-15f3-08db97fe7bf3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aFxGKfdfam0X8KqpueBt98dZ3ZM4EwUB+Nol7skbr/Z1N4/t4aqF4GKLB8nToH4hgWjxpXED3ISvwl2dY9nI/gDQJZVgFIbkpQf/tp2EyH3cT77Y5xIfB+PX+6mNKbpzRFyPG0wUxb7YGgyJhTXguIvI2Qyi8/CWjycCeinoh3hHaAs/m/1EYBPVB9YMScaJdyYIfyrM6f0/UJ/BBCyb7/TedrJtZrnmF7GrJqL5cYRX+utVVxcWAHvpTOm6/6Kc9U4RWdAcLE1ruLC9y/R1feOkYl7EyrvJzAqtE2FVJykJeLTXkudDXnHai7rObQrDO2z5iOXiiXsqGHaYfE4e0KJpDyxnvpT1YVvzDtWT9aFhMN4rA/lgq32c0iBsKp2EuFUmCpALI793lfXJEXUG1TJj/NnYOIGdfOH5FHITmzehFZDM60BqvaazKsW5R1kRuT+zWJ1kFl4Y0FHWk0YH9YbNFgrrg+pnRQorpk9ahpuUTg1GsD4aMGsyKtgbx++M9E2eIuFdF03L3nPV8rmP8OL+yLGrOcGoj8bybqhtEK+CS4yptuZDip0ZKO9QpGSTV55pJD83tUkFziedUFTllD6/PtToWxk/B+dNEBa1Rtg= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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Iiwa0B33ElAaw+mTnr2b7Ec4UEpxnqZrpNCr6DRtWKA73riCqJHAFr6k9dpDUe9WmmXb/5YqfPA7Rd6TPvO6c4tbsWAY5UJ756gpm8qAJlh820sx8h7kKB7TzAhwHBuaAvofo33Yj/sOY1jUi7AJKPp67BTxylLoswYs69z8xWUEsdZpMBaTQUopB4donO3PhswZ8FKSYATRazS97JvUxq7oZvwXsElY7EG8Ng97vD3GETPVPOvo0v/ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 750cb990-4a96-48f4-15f3-08db97fe7bf3 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:06.2740 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 4/8] cbs_h266: fix slice_height_in_ctus for single slice tile 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Ah8Xjdxx6lga Failed clips: TILE_E_Nokia_2.bit TILE_D_Nokia_2.bit LMCS_A_Dolby_3.bit --- libavcodec/cbs_h266_syntax_template.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 7277154c40..43b3346359 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -1984,6 +1984,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, 0, current->row_height_val[tile_y] - 1, 1, i); if (current->pps_num_exp_slices_in_tile[i] == 0) { num_slices_in_tile = 1; + current->slice_height_in_ctus[i] = current->row_height_val[tile_y]; slice_top_left_ctu_x[i] = ctu_x; slice_top_left_ctu_y[i] = ctu_y; } else { From patchwork Tue Aug 8 10:59:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43173 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2186993pzh; Tue, 8 Aug 2023 03:59:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGv/adQqQFF6Uv48b7fuBzhgdrESvh0gcA0J28X56HweBtz9n4d+hr/FuBZ/YCc5SWWn6fl X-Received: by 2002:aa7:c487:0:b0:523:47cf:5034 with SMTP id m7-20020aa7c487000000b0052347cf5034mr1256413edq.34.1691492397900; Tue, 08 Aug 2023 03:59:57 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a17-20020aa7cf11000000b005234011bb45si1484936edy.690.2023.08.08.03.59.57; Tue, 08 Aug 2023 03:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=a4FXnfkB; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1557968C7B0; Tue, 8 Aug 2023 13:59:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2092.outbound.protection.outlook.com [40.92.53.92]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57D0A68C7AC for ; Tue, 8 Aug 2023 13:59:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YiAaoO8JmcAtjRh9AHP/cTUk8Rjam/AlxSwQ09m3Gao/v/TY0jMfE8GW1BWsNa4VG56qzgghqucvGCROriwdf3sXf3EIdVBRNpet0pFw6P6WwnfHq/+nA5Lf7J4ThEMuAoW7Q2fwUkBZbLjRzFLdOcvXIVxekHcYZopjPheRHyXOdbB1KrPUcge4uh6INnDBarYTiORWFrceVATqIl8FDI/25kpwDc9mjiKPTaAFUfFTqXcOiS3WeMNhsj6XLhm5x477IacDpHe7KyzGkvH3uhloAmwR4vwKOJPAkIRZN9Dm2n8H0y941QA2H9LmVffGRp0QiGWmxDfyYb8UYtfXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dy1K5iYIF1t8AJinjUjqk+dGhen5tg+ld/s/YRj4PdI=; b=ke7HSXZ4lyE2NdsAxTQTT+HogvX6YslLoRVRXu90JWgfA1GlVerD4Zv2m5h4FEXaw/v0XwWbpFWLgiv3PerTkvHsh+z3WhA9+0vi2TqaMTXA9BT5NpFoWOevRxhvhfYGll6ef72CeSQ81NUinijaMih4geIyec1bchYQwhDQ0tTjmHH8rKW0HpcbslTAORb5EAyt2V1kD+bM+VE4K4A4lLbAzdJo9GRKBVJ17z5mCqTDxALmATUc6BcDOGFI5VOKZZ0oivT5ArPa9mrA3i1IrK31Xm0btzmIBYY4FUnL8TT2J46STZrBxU0AOauuNoUhP47El4VlUA2i5JePSTySxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dy1K5iYIF1t8AJinjUjqk+dGhen5tg+ld/s/YRj4PdI=; b=a4FXnfkBKE9gshtRPW8bDS/MKfEmmHGcxUZ9b3pB1rIyHYZZDDdPv/ns+dqpYExhgqNHtDM29kM4PQ19aEJkTN3r42zCk9KKMQdtcpM5laV5Ln4AUIPG9T0orVRZcorVCRQfIJAxGBCOFTyuRsYEz2QA4y1H6r6lyqyYkLUvy4C8QTDVkwHt9iFcsxLWSMD/5fZ2YrutBv2whMxn5U2TWUdiMyZS5lAeri+ahaLhxdolPyOEQS3Z7yKb9ySsae2/XrClHi3+veEZeti3F94krmPDht742PJhmkysfXx/DTfUDkv5ZPneWA9hqDdBsUSAcMiXOVSbM725j9fKPye1OA== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:07 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:07 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:59:00 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [fdn1x/BTsPnatfLNLSMZNHxnymd0yKen] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-5-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: e42453ed-e48e-4471-9dae-08db97fe7c78 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CNHaa1J3cQWiyDtxy1BrA75/z+t36TQDePoNmvZfX6uFwFewRRTeag6hIk/1Q21XBTWUr64xyRg9wmr9NC0+CFtzghBJPVnXMDzoyg45Krs2aV5oMywngKhxoGIr86a7SMDizeCI6OO+mec6/OHJ6y1tAEPX/fh2Mjrywk1hGgmo4uJoMEKqQl0xMB51FQt0/Uv4kQLAPbLvAPccLrwHvmBqsdDZw72GzI7Xy/mhf7ZetZx2ipV3yErt8dTbUwzTG7XNSBSMMP0U3dr1pJ1Djk/M7sXr/+gVCXuCl99TShq/uu9chwQ+XYfHCOPqJY+AekMXaRfyaWcnJHIN1MvyIZm82KFna//i/4lFC3oKHIrUK/AhTtZz2jVfhAKcxfFoaHa3IQN8c4UJVb6EnjUWdGtOvfQPpMLaYnMnkNIxt1chYsPXgfZjGVoWnHEkEU2GjN7dokK7i+I/zN6dNZIcEtTLIVn/MeGHNQTmEO5X1nQak6OWlSibw1C9BatdpCmo8D9Bls7dqp+TiNNJWbTw2sel0avsntFcoUWRFA1W6ibXZspQABbFOW1c/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OEtlm3yWtGuBBt0eTx/s09rGlxBAAom1MdV8mRhsbLt5RX9GT5xa3THRGPhZoy7xsB4EcIoSiCmNSnlEzf5z1Dq7M5s96TES5YgHreCX/z4xto6n2nwA6H6o56cob72FDPkoSPaFobmoUgQYWzoiEfJ2KqBwcAek8nr8k6lw+1tPMBlh7FOMzQZnLXGqSQbTWgUehufbhMXU0c3CMAtG/fG/ZMGDdw3GoI0kKaohJrSGxePIddyB68qnW5Ib9pMakUDDUEn6IWw8KDyRVlrB9uNDJ/IcpMxkdJre1OZX24jT+7NOzmuKwsuZwBEYr/XqP55G7JfsShjOj9xbooN90w3iBNPV X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e42453ed-e48e-4471-9dae-08db97fe7c78 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:07.1431 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 5/8] cbs_h266: H266RawSliceHeader, expose NumEntryPoints 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: osgRHE0eHi6L --- libavcodec/cbs_h266.h | 3 +++ libavcodec/cbs_h266_syntax_template.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 0196f46bc0..1d80c74feb 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -828,6 +828,9 @@ typedef struct H266RawSliceHeader { uint8_t sh_entry_offset_len_minus1; uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; + // derived values + uint32_t num_entry_points; ///< NumEntryPoints + } H266RawSliceHeader; typedef struct H266RawSlice { diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 43b3346359..d0d1ccadd2 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3374,8 +3374,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, for (i = 0; i < current->sh_slice_header_extension_length; i++) us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i); } + + current->num_entry_points = 0; if (sps->sps_entry_point_offsets_present_flag) { - int num_entry_points = 0; uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag; int height; if (pps->pps_rect_slice_flag) { @@ -3392,7 +3393,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, else height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; - num_entry_points = width_in_tiles * height; + current->num_entry_points = width_in_tiles * height; } else { int tile_idx; int tile_y; @@ -3402,18 +3403,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_num_tiles_in_slice_minus1; tile_idx++) { tile_y = tile_idx / pps->num_tile_rows; height = pps->row_height_val[tile_y]; - num_entry_points += (entropy_sync ? height : 1); + current->num_entry_points += (entropy_sync ? height : 1); } } - num_entry_points--; - if (num_entry_points > VVC_MAX_ENTRY_POINTS) { + current->num_entry_points--; + if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: " - "%" PRIu16 ".\n", num_entry_points); + "%" PRIu16 ".\n", current->num_entry_points); return AVERROR_PATCHWELCOME; } - if (num_entry_points > 0) { + if (current->num_entry_points > 0) { ue(sh_entry_offset_len_minus1, 0, 31); - for (i = 0; i < num_entry_points; i++) { + for (i = 0; i < current->num_entry_points; i++) { ubs(current->sh_entry_offset_len_minus1 + 1, sh_entry_point_offset_minus1[i], 1, i); } From patchwork Tue Aug 8 10:59:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43174 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2187131pzh; Tue, 8 Aug 2023 04:00:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7t/ZaA+7PloIjp95htsfr6fnktBBlB9qMzmM7UenZSWQkYzek4HSnYC3RljOUzpH3PH5r X-Received: by 2002:a17:907:270a:b0:992:b3a3:81f9 with SMTP id w10-20020a170907270a00b00992b3a381f9mr10114193ejk.71.1691492408918; Tue, 08 Aug 2023 04:00:08 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z1-20020a170906714100b009937e7c4e50si7138883ejj.546.2023.08.08.04.00.07; Tue, 08 Aug 2023 04:00:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=pAwYkZ3k; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F17CF68C7C5; Tue, 8 Aug 2023 13:59:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2062.outbound.protection.outlook.com [40.92.107.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A3D868C2BF for ; Tue, 8 Aug 2023 13:59:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMuRb8G1TVDPfdlkJIR1N2CSSLAIR6coeEdds7oIQneb4kEkVYEAYhJUF4thmD3IA7WS/Kx62sHTJEtkkgiteYG/IoKTwUy3eJpue7kVUnDvzoirb6H7nUwmrdN7qZC98qpS6hHEDOrwUE59CJ9/B33EHJpBVXLXDVfC4UQxokxrkzrLeSGMNULIYlC9jcYFUbGgrFsLf46ChWNOy9vArs1fQ915d5J0q/EEbVdc065ETcPN1BcciGHhRQOuUD62niV2iVx+Yj+D61iDhgjphbZ7A46EKRLTo6Zi9x77lnqWtimri4paKU2msL0FdjlXCzayxRj/I7v4s4FxcWY7eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QmL1qmWuRpmApOTlWTu7+OqC5FAPL/3nEB0sJsuHbcs=; b=JsH1m4WnmAXq8ErkcFjJzpPTdCPlir7ztyeXYQvQt9vADnEModh3YuqVq6TOnCbELAK7epV6YOSTfqARL7Eqak8JcYIlmJ6JAoBFLxhO5AUSj2137u0O+D2HviM7m8soIlc9op50WUg6yLZBDK9lXkm7LKMgq8tGRu6klcFIAhNh7Sp6HB6d9nUE6hcFT8TOhiBKsCY6T1/zrO6Dll3sYPh1hdXKyXcLJDhwcR5Utucg4v9agmAoGtXcaBy8LB6RGVSzsC+YNlqniSB5nd1ZkyFyFom6agoD+DxQLqpR0LAgPQWglSbZWaPbUR7m2525aTMVXK1lyEIlgByKKGn4uQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QmL1qmWuRpmApOTlWTu7+OqC5FAPL/3nEB0sJsuHbcs=; b=pAwYkZ3k836mOhq4W56L7/BhO9AZ40Nfu/yKHDCbZgCSuZU54jB1CHwmYhUZzqBYIxuJ+RHXPUcBEtpie2n40Z0+e9NciC0ijePkzNXHHGWBbZeodA9ThebdTUbzUeX5JV1mBppJGy02WIp5cE2pIyb+7wHLAFjLDbujD6Mdt4jIZdUno/WDWq5jtunQjf9dqbMT+w5GiRwYxCiiqUYJjr6M05vAY3B7K7iHQ6VH5TIVh9PPyZlx5gT3GW9IXtJmVcyjtWe1J/2e1QwvvqyFcO3pT3NFzuCF2OJpKZhecPhkc6qu4vOQ9EheMHU+zV05WduXQMRFU5qINqws1OmBGw== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:08 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:08 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:59:01 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [GaJK2eycDhRE9Q2AGdPzAJzTVXPXUrSj] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-6-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: 338a5500-2452-40e0-255e-08db97fe7cfe X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j8ANQCEG2DUESjXeENUAAzBULqJPeMETR9mtB4ucLoHgsGjpm5rGGg+vAkDIoQjrDZq/IPuDLNKv9HsxrNRiv/uKXQhPDaalQRepSOyKR52f4kXg01VO5UBWiHh1DrIqrvLv6oD7U5/6wG93REjtvrXrMBOTBWt96jZQM0vPhlCAvJY44qGNXGIFQ/GJZ6j1reztu7w5NlQA30n8v/cfzAWc96sPSyLUXMEbIRUURrG4ziH8E9PTvAi9qXlTHTLHoXE11965QI7Zilob8Hodz9HgtSGfFFpHMll5Uf2QRpTN/qJJwJWtYCEsG704p7xs4BGki6ruBZdX+LP1WQ1Ch/Cf7Ad5XPbKA910iaPX+/VnCD/HXYnfk6T1RFkOnp6tbWm+XKDnoY94E88SAUpYDzlUqJ2Z4WDZwDJI+liCGIfxVUW8L0BKrhdmSvqjIVhYQYsnS0lXNNCGk5aC3sAXXLJgF5fGO+IdQoNDYhB9YheGQp7t9OGGpOP3XJHZ1+f3i3KfXIq6cG4LvbWvv+iEqkadK6BNVGEapQ3AH3qzOCA7LNsVSlvi23bHev2zSaTMZVLEXb1un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iXZ8TunQAhFgmE6JktwIszh8ggJfwTRU9MGHnT7GrdcVpuTzZy8Jj29uxPeMQ7/zaCZCCE9smJYMr2++rr2GWbVl1tVH3opnzhyKMECjovsRd9CBoPI4kyoHxhtclnVmfPm7CXJw2a7ihMJ5SapzE1i2lIkl+ts+N0zgpBTL+c4YJh9KBu9VGzaOzmtcI9C6HG7GteH46Fbv7Y6EPBxKi/gejeLECItGGQahlHydTC/Y76oBErrIw7Oi6JzFL/u6R3NvOl0YUdPKVMiA6laesuo/BTrp/4K/9f6x5hXCtl9qjwQtDRFJn2i5OxRdxIdsiKjo3RmUZB X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338a5500-2452-40e0-255e-08db97fe7cfe X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:08.0514 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 6/8] cbs_h266: H266RawPredWeightTable, expose num_weights_l0 and num_weights_l1 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Hv+hf0bu1vL0 --- libavcodec/cbs_h266.h | 3 ++ libavcodec/cbs_h266_syntax_template.c | 43 +++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 1d80c74feb..87a2d02cfd 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -666,6 +666,9 @@ typedef struct H266RawPredWeightTable { int8_t luma_offset_l1[15]; int8_t delta_chroma_weight_l1[15][2]; int16_t delta_chroma_offset_l1[15][2]; + + uint8_t num_weights_l0; ///< NumWeightsL0 + uint8_t num_weights_l1; ///< NumWeightsL1 } H266RawPredWeightTable; typedef struct H266RawPictureHeader { diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index d0d1ccadd2..501c066faa 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -2507,7 +2507,6 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, H266RawPredWeightTable *current) { int err, i, j; - uint8_t num_weights_l0, num_weights_l1; ue(luma_log2_weight_denom, 0, 7); if (sps->sps_chroma_format_idc != 0) { se(delta_chroma_log2_weight_denom, @@ -2516,21 +2515,21 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(delta_chroma_log2_weight_denom, 0); } - if (pps->pps_wp_info_in_ph_flag) + if (pps->pps_wp_info_in_ph_flag) { ue(num_l0_weights, 0, FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries)); - else - infer(num_l0_weights, 0); - num_weights_l0 = pps->pps_wp_info_in_ph_flag ? - current->num_l0_weights : num_ref_idx_active[0]; - for (i = 0; i < num_weights_l0; i++) { + infer(num_weights_l0, current->num_l0_weights); + } else { + infer(num_weights_l0, num_ref_idx_active[0]); + } + for (i = 0; i < current->num_weights_l0; i++) { flags(luma_weight_l0_flag[i], 1, i); } if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l0; i++) + for (i = 0; i < current->num_weights_l0; i++) flags(chroma_weight_l0_flag[i], 1, i); } - for (i = 0; i < num_weights_l0; i++) { + for (i = 0; i < current->num_weights_l0; i++) { if (current->luma_weight_l0_flag[i]) { ses(delta_luma_weight_l0[i], -128, 127, 1, i); ses(luma_offset_l0[i], -128, 127, 1, i); @@ -2546,28 +2545,26 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } } - if (pps->pps_weighted_bipred_flag && pps->pps_wp_info_in_ph_flag && + if (pps->pps_weighted_bipred_flag && ref_lists->rpl_ref_list[1].num_ref_entries > 0) { - ue(num_l1_weights, 0, - FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); - } - if (!pps->pps_weighted_bipred_flag || - (pps->pps_wp_info_in_ph_flag && - ref_lists->rpl_ref_list[1].num_ref_entries == 0)) { - num_weights_l1 = 0; - } else if (pps->pps_wp_info_in_ph_flag) { - num_weights_l1 = current->num_l1_weights; + if (pps->pps_wp_info_in_ph_flag) { + ue(num_l1_weights, 0, + FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); + infer(num_weights_l1, current->num_l1_weights); + } else { + infer(num_weights_l1, num_ref_idx_active[1]); + } } else { - num_weights_l1 = num_ref_idx_active[1]; + infer(num_weights_l1, 0); } - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(luma_weight_l1_flag[i], 1, i); if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(chroma_weight_l1_flag[i], 1, i); } - for (i = 0; i < num_weights_l1; i++) { + for (i = 0; i < current->num_weights_l1; i++) { if (current->luma_weight_l1_flag[i]) { ses(delta_luma_weight_l1[i], -128, 127, 1, i); ses(luma_offset_l1[i], -128, 127, 1, i); From patchwork Tue Aug 8 10:59:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43175 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2187246pzh; Tue, 8 Aug 2023 04:00:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErsRiC+KMJb2w/QZDusJHcRO5RJBozArd+xXFYoXxpJDbiTkxThqORLXahSvARAYJRbsro X-Received: by 2002:a05:6512:3b21:b0:4fe:b04:dfac with SMTP id f33-20020a0565123b2100b004fe0b04dfacmr9894104lfv.0.1691492419077; Tue, 08 Aug 2023 04:00:19 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h25-20020a50ed99000000b00522e4d22117si7448823edr.76.2023.08.08.04.00.18; Tue, 08 Aug 2023 04:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=KRvb5j93; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D7D1C68C7B6; Tue, 8 Aug 2023 13:59:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2092.outbound.protection.outlook.com [40.92.53.92]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D405168C2BF for ; Tue, 8 Aug 2023 13:59:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iZZZhsHsX59c7//evDlozzSPOtZGgdMH00hLrVtHtRNJOjuxH6EKsk97CrQsbgJOrnbOAq+UPa+ck8j9IFoSTh+XlireKwMJeG4lTS9vEcmwUsReXZPM6ovoNHjeEnweVMktR5meS4o3aOJPyqN3eDuMgCGFtmkqRA1ip1mKIS60megh+WoFzdsgNcqqOClUgN3HNszVfup1Ya+g/TxttOnNQia5y8EU28qVG52q63o/GvwEj6cS9c92W3cdY430XBKcnap1+uKLqrD/GAGdbOOyTdCR2kJAqGxtpxUNDuq3IQagZilrZzeZxUAV0hKLkHrhmLIxFnwjyOrcFpkmTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vfn/cbZTXcVvR/Gl3KPirfhKv9plSEMPck6n5XvAoO8=; b=YqpJMBX0ccwOLliCCDCI3KyPSND4wJ/8kM6RzT0ysodih7lD8+WIllqoEDxg0NoBPbrrBVaEUBoqPU0vy0SkBR1TZlf7CBXAf8k/TMBOF++PrQUlm84YZsXPOri9J5j2EyCDsuRkNcmTm4cTlclWheYL+2sYpsbH9ETKSrN1rVnkmSnpCpP9Uthb2YKFy5rZorLdkpSJrLWYsZ0rNENURK518z74GhzZ75zIr2UZEHclVfQe0OIcs7OvdFh/FaT3K0EBWseZsNH3l6MC3PHOryGChQJrTJRqIjcUCbupgFjYInZg5+aCHP4bW6T9+RhXgmmJqNwSSZ+ssS1cyuKJGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vfn/cbZTXcVvR/Gl3KPirfhKv9plSEMPck6n5XvAoO8=; b=KRvb5j93SfshaV59YDb8OWrP35cUQWdgvIeZgzjrPt+B/qflmUqRPsf1swA3GhgmRw7VFa0y4VnIX00i8msL3HkPDYGmFf3LOb2vXZ+4OpdF6aRB645vNlZgoXPuwb93f98sQt8CCUsCy6VLwWEZTi8IGUHCIgeuB3wY1zDoi2z3qqvwzntr5D7SX21Uo8jIDdiOc4A1U/Qo3f0fHY3Fz5BmvFbnIt3wyldR1fx6gvqucp8umW+yyLSe0U0zcGodhjj/XvNfIJYYUdXAglDEcPF97P0MBtTyuPecZODyaQsN4jVAczc+EkIg0WBWBDYygn3R1+ummmkzgZzEyR04rw== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:09 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:09 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:59:02 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [+Xkf9HSdYUPx9vV5eQRxx967+zo9I6aT] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-7-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: ec27e52b-2e76-4858-71e7-08db97fe7d88 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FVNJ6ke+B8Q4Y6LFoCIkl9tNYH4ZdwJaQCUAqOLZVD9MuYTc5El18BcrK2CC6yosIElfcJz3pn7oU+/yR7KYxYhGDYmO7zCu7McMxgAJGUf/9qQ19ds+Cdl5nXZDmvOTPb/vUolTe+wOq4RGe5dYhp7J3ctFMyGFeWGADdq7XOPRyy3XUNCAHNmoe1mRjILk5iFj0LHMqR7S5jAg5zceyIkHu6iNpS7KKjxsiMP33giSKvImD/5P4nOEbKv7ayT7INn3IijQpRC6ldIQAb+cWFHQwrIIl7P+OAPgSutG2SwtMUPlmU1vZD/cwT1ueIENlm1L/EiNgINaLxxUlg+EoG6//ocMPtleUHzLLyfgp5HGHJJE+QksHuzLvRzenzQK11zh3JV8Jl6sf+uNcUfEzZBseV5ws84bG5zH/YJYgo1V06WQ1/2Sx1OD3Lg2y92jDk4mJ6epanFeTn5Fatzi/irbsXxoYUtx/9OB3NquKH1au7DIBSr2bbmUquu7oTGuQyVPo5G8/aSeYG3U8iPPC18PdldRyHTtIYV0LCm2hgxDdOQffDEiA6V7kpLCv+mot7Edn9QSsNLUeUlFEf5UyHkws/fv+YLEmitfru2EHcHA5syCpJNngGqhjKhmxplW X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IhR0ADVra7BHwtOwwYqGWpYRTHCQDu0LN+vCx3JrsJnDA2bbCinl6fOTXmgNpTkRjkzXYcPSrrCC9BhlB09Trp0SgfXXnap8ivmJsYTawFQabjbKGEF9j518OKRvXuzF7UblKTj6EoHi7KndsS5IW/jAV4UCXF3499ixRYZk3YhmB+omKPEv0bLelKIsKpCrggJoEuCP/LYJwuJ5lzwpTqZ1GGfrtrfCWLFcO6IllyDs/LXrbVG9/PZIMqM8wm1D9n6L0xmwmCScb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db97fe7d88 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:09.0637 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 7/8] cbs_h266: H266RawSliceHeader, expose NumRefIdxActive[] 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Nl1Wcm0cojWm --- libavcodec/cbs_h266.h | 1 + libavcodec/cbs_h266_syntax_template.c | 41 +++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 87a2d02cfd..3a6f6d96b5 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -833,6 +833,7 @@ typedef struct H266RawSliceHeader { // derived values uint32_t num_entry_points; ///< NumEntryPoints + uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] } H266RawSliceHeader; diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 501c066faa..b26d7c1a72 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3191,39 +3191,38 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(sh_num_ref_idx_active_override_flag, 1); } + + for (i = 0; i < 2; i++) { + if (current->sh_slice_type == VVC_SLICE_TYPE_B || + (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { + if (current->sh_num_ref_idx_active_override_flag) { + current->num_ref_idx_active[i] = current->sh_num_ref_idx_active_minus1[i] + 1; + } else { + current->num_ref_idx_active[i] = + FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, + pps->pps_num_ref_idx_default_active_minus1[i] + 1); + } + } else { + current->num_ref_idx_active[i] = 0; + } + } + if (current->sh_slice_type != VVC_SLICE_TYPE_I) { if (pps->pps_cabac_init_present_flag) flag(sh_cabac_init_flag); else infer(sh_cabac_init_flag, 0); if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { - uint8_t num_ref_idx_active[2]; - for (i = 0; i < 2; i++) { - if (current->sh_slice_type == VVC_SLICE_TYPE_B || - (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { - if (current->sh_num_ref_idx_active_override_flag) { - num_ref_idx_active[i] = - current->sh_num_ref_idx_active_minus1[i] + 1; - } else { - num_ref_idx_active[i] = - FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, - pps->pps_num_ref_idx_default_active_minus1[i] + 1); - } - } else { - num_ref_idx_active[i] = 0; - } - } - if (current->sh_slice_type == VVC_SLICE_TYPE_B) flag(sh_collocated_from_l0_flag); else infer(sh_collocated_from_l0_flag, 1); if ((current->sh_collocated_from_l0_flag && - num_ref_idx_active[0] > 1) || + current->num_ref_idx_active[0] > 1) || (!current->sh_collocated_from_l0_flag && - num_ref_idx_active[1] > 1)) { + current->num_ref_idx_active[1] > 1)) { unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1; - ue(sh_collocated_ref_idx, 0, num_ref_idx_active[idx] - 1); + ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1); } else { infer(sh_collocated_ref_idx, 0); } @@ -3233,7 +3232,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, (pps->pps_weighted_bipred_flag && current->sh_slice_type == VVC_SLICE_TYPE_B))) { CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, - num_ref_idx_active, + current->num_ref_idx_active, ¤t->sh_pred_weight_table)); } } From patchwork Tue Aug 8 10:59:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuo Mi X-Patchwork-Id: 43176 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9329:b0:130:ccc6:6c4b with SMTP id r41csp2187350pzh; Tue, 8 Aug 2023 04:00:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH746AhwZoA3pnwsDSXrC66WZ3k1EXTC7s6ze0w6LQDSH64G3QQP6yEZr9JqsxZwUv+B4aq X-Received: by 2002:aa7:c68e:0:b0:522:3149:1596 with SMTP id n14-20020aa7c68e000000b0052231491596mr9267862edq.13.1691492428374; Tue, 08 Aug 2023 04:00:28 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f24-20020a056402151800b005233fa16a39si1669246edw.123.2023.08.08.04.00.28; Tue, 08 Aug 2023 04:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=Bpe93LrB; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD16B68C7D0; Tue, 8 Aug 2023 13:59:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01olkn2062.outbound.protection.outlook.com [40.92.107.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3F3668C7B1 for ; Tue, 8 Aug 2023 13:59:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y82/DXhYDm6LNhw0fBSLByMGv1kE/PtaGvr5nm8iA+pIUD/oOYDI25A2/IfFOG4/S3iXaeMYXZZPubUAtlGr6gyEuGrEP9cyx4ujLKrMFacjdb3QVUX6/bMtXdbyheA5/0kZCiAVRYik0V0DZtgTFZXWX+EMGexWzzFDHRfDilO23Z6HzNrLtXqag7GIEBfsSGyLIqWh6VSOVPOP7LwyuuGNHuGREtQLFix6j5GF2ojjf/ZuYGq+/b67ZMd3+p3/q9pHiQLLKFxmpvNCdWHqtkgV2nvK445Gv0H8zjJmqfOfikpqwOhKxVNx38i97snCb8TCkp2mrqG7FYQSGJSC8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oBY8WidtNdbdek4hnA8YnJRNnKgh2OQGQf0iw0Z5AxQ=; b=Frm/QovA/+rAIwS6Oo6Yh3I/B+uazyT227D9xbKg09WLXVyr5UNVuPo2kXG5bi5X54dGH9yLw6Z9dc4t1Ar47XsSZBZLvF6lEL3u+EIlxYG76Y88EJ4rQWiP4NScYeRPn2cZcCwTlMpTEGXDIaOBY0uSsvT566dZENTR/WSo8XoR0+Y1X8V6cyxfJ1REZHi+OOj7gYilCJJt1SIme10sJzq/c5g9YiTCJoME43YWGVBDpyEn8HVv2SuDDaQ9NZ1CnnxUimBvjEj5hzET8B0Ain12WrQvV6K7JPStULIxskMLuc2Zh8PJ38vuidvgC53kP5ma7CM4WtZN/S7wwCuiBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oBY8WidtNdbdek4hnA8YnJRNnKgh2OQGQf0iw0Z5AxQ=; b=Bpe93LrB/30cvxPnIQjYtdzN3DaByoKdANTJJ60iL5RJ5+2nmbxmhTnmL2CQIC9pexvNeDDe0O90xayEexD5y8wDMh4f5wW90ZNlw31A9PDsHT7tMuhLK5njc98QWvh1un08/YZlE/xbDiwWpe3ymDIID0OMBBKOiSEdoSZkRmKe6N8cLs9eFx1QfjA3IrU03RhKKlrKP1i0DcbqHhTEzAfu2oXMFltMujQkOCKd+OJrrNkQf6J98iStkHhNtm4xCTw6TRFj3ovE8qcZ3yvDkMJdC30J8Xaa0CzwDc2x7EYXID8Yw1SndME1z7LBHzJU2XnbiVoI5m1PeDvSSOBPxg== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by SEZPR06MB5692.apcprd06.prod.outlook.com (2603:1096:101:ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 10:59:10 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::f1a4:bbff:7592:ee31%5]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:59:10 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Aug 2023 18:59:03 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230808105903.6667-1-nuomi2021@gmail.com> References: <20230808105903.6667-1-nuomi2021@gmail.com> X-TMN: [5MFUunxcy+Ywi35p/WTYeNBVrQ5mHe5+] X-ClientProxiedBy: TYCPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:405:1::34) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20230808105903.6667-8-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|SEZPR06MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: 16cb8e9c-5e42-4b2d-343c-08db97fe7e28 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lLit3EgHPrNq+HBPnfs9E896BQwAsUN9hBxA5VFIMNZeykcG6kSX3GkhCXkuCTYRKv89AWKmwJNn6AtPKl5RIBYj5ehT11T4QVPCuuUVnhxqXMwMWGK5V0hMTBjXe981DsNsbOOn8SAy52gyekGpGKb3iChXRefhgThienB2AuKctiOX7nCcinLSOKM5ppTbKH0TMMCT3QuT8VFbnq/ZnKmT2SVRkRrDxu0c7NBkZyVzj5IZsfqDQffu7GkHbZKHKME0f1zieieH8uwiLnGvpdOnJDwgg2RvUMBnqsmYt++oQxQUtUo5LdUeqSVx6O43L7ADhELZTHXvu8MJ9cC8cescZVrQAyS53oisT+Qef4y9+l55PFYm1+ZYJWwVFwZpGs/jRnYvrTqaHdLeva012+LeanU74OqEDrCXvlr3GoJENylm710+iDJt4nq8J5smUFVo2kHLjfmm0sJQZuCsiz8WN2CBhUedyQj+wfMnOkFI8Fc1oRtB1dJ8mj/RN4MDNd125P6mIrQxw9Oxu8AOyHPwHXn9I5I0XWKipOGTpuJGuIcX6K/D8CpJtcgBArGMsxYsuMe/Tit7VRaEfJPDsGsKCYyZSEEhql3tiqG4NwAUrD/S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ylyy4g8yHSFs/I8yn9MqDso0CrdsoB3s/SSCMZs4oFAoDEFxiLghwhSmPwR+lECNVmObqbZMZfySH/r1enWakMMygiDRDbm2bjbRk42rhbi7eXW6+WzhmHb8Zs8JKp4xQ6qpKm+z70D1lo5Ek6lPN/mc3kgO8Q0YJXn3oakB0LamdAnUeDazPeRFFnqewH10mY2s2kLkbKtYLTgt0zUNDd/3LQ73EhgIJLGl32IyDqCXRS/o+NSE/HSC34ynVj37D3134i1U02UE+4M X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16cb8e9c-5e42-4b2d-343c-08db97fe7e28 X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:59:10.0332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5692 Subject: [FFmpeg-devel] [PATCH v2 8/8] cbs_h266: slice_header, fix inference for pred_weight_table 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: Nuo Mi Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2LQyV/UUYlQu --- libavcodec/cbs_h266_syntax_template.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index b26d7c1a72..4075897b9a 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -3226,17 +3226,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(sh_collocated_ref_idx, 0); } - if (!pps->pps_wp_info_in_ph_flag && - ((pps->pps_weighted_pred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_P) || - (pps->pps_weighted_bipred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_B))) { - CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, - current->num_ref_idx_active, - ¤t->sh_pred_weight_table)); - } } - + if (!pps->pps_wp_info_in_ph_flag && + ((pps->pps_weighted_pred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_P) || + (pps->pps_weighted_bipred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_B))) { + CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, + current->num_ref_idx_active, + ¤t->sh_pred_weight_table)); + } } qp_bd_offset = 6 * sps->sps_bitdepth_minus8; if (!pps->pps_qp_delta_info_in_ph_flag)