From patchwork Tue Jul 23 18:48:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 50716 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a742:0:b0:482:c625:d099 with SMTP id f2csp2815102vqm; Tue, 23 Jul 2024 11:48:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVm+X0qA/Fk9DMLTf+JK5XIbi6l7XlqYjEQwf+bsG+s1wkqTTwhico9d50G3EQmJDL2AKvURpiSASDK4CC+Hrk++ckRJuRLTfBoxA== X-Google-Smtp-Source: AGHT+IEe//Icpt6OPTsKydoyAK8OSGwtTm4soeKY6c6u7FFuXJQZkiAjbiR71QEIF7zr3ifsj/BG X-Received: by 2002:a2e:2e09:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f02b741b1cmr5124521fa.24.1721760526409; Tue, 23 Jul 2024 11:48:46 -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 4fb4d7f45d1cf-5a30ce93beesi5799767a12.690.2024.07.23.11.48.45; Tue, 23 Jul 2024 11:48:46 -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=iwJgjpZH; 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E252A68C8B6; Tue, 23 Jul 2024 21:48:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazolkn19011027.outbound.protection.outlook.com [52.103.43.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0477D68C8B6 for ; Tue, 23 Jul 2024 21:48:36 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eYmTuGcDklAmbBeA4odnIKe5aRV7ET2JEkvGcQgcRObfr1d1ZM4ThvLCiHYHeHKx9jAPqFcn65v4yaDHSkJRmXEm8PnJcD5TupEM2jQdpiGFyZlF0KH+2c7aoRM0kTTfF6cDEUESq0BdlkM/IR/NSLeDA9o6CXplXfUSYcFbx9kt2RjyUz+G5OvaziF2/uJ9l7Hv2KgjZ+0R0aBWRLiSJDSHExbIX8ujBNB0CIYIyDsqq40LEhl9d91WUA1ScISQQV5ryhPVMbhcGUoM0+luUYwUkvTJO2d8iAGenfPTI3SzI3RadJEGDia6vaWa0SIm1dR7yFHmTQUC9HWordie2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6/pz2H7o7vhaDBvMWmW9Rsu5+c/PYwXdlwMZoIGL8tQ=; b=nzBa5eBHsmpDM+Bf4nItm4sZeFcj4uHBdUv3TWKnsHpvC4OSTMn/Q530eBXqIUjayU8mX8J2eBjjDZQ8XJFPWEtKdsOYyC1eorMmbU8nbCrnaSa+AoUuHFYGItRz3TW73zKcc5TtfrJzREmWf4YpXP/2dd5jPSGHUub/lbZFL+YahM0+QOoBGTHAkjp6LTAxLNKbal4e5370bfiwSVM2AEx+JFAisN0k/0ku6syRMOmkYFVwHB7MprqJCJ+Ih7Q9tLELLZQxImT6VxDNODH0e0KsPC4gKlWANxvVEOwg6JwPNQBY/DmWihLOBsfNdMaUL496nosZQbQSZNW120XELQ== 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=6/pz2H7o7vhaDBvMWmW9Rsu5+c/PYwXdlwMZoIGL8tQ=; b=iwJgjpZHEE0m90EZN4z/wd8XgV9BWs46f1qt9zwP+4tVDpg+k0bUXNfCJJpl60Z4u+/bkdnO4h+2wgUa3lZEdFtNy5PbQckG40rLFEDZ75jC0x4Sbkx/wPg9Ny+virZG8lhKXey6mCaTOlTkDP3KLuYbnMM5fED9dElXUiZaoLD1ijmz0j5ILTYdcZbm/OmPIit+eKp8nG3yx5nupoFxviqBI8OHE1vWj+KsY4Q5Sw8S+zTAb+uXgpBSv6OC2/rIwpmod/NSAuNWL0TDADv6YvoO4HiluJXpH/jQC3mzhJ/XaVTNXmlX3ggBfFxc7MftwgKpECjvFAYvEKIP/OKuGA== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by OS3P286MB2213.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:198::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17; Tue, 23 Jul 2024 18:48:29 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9%6]) with mapi id 15.20.7784.017; Tue, 23 Jul 2024 18:48:29 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jul 2024 02:48:06 +0800 Message-ID: X-Mailer: git-send-email 2.44.0.windows.1 X-TMN: [h96omim4LV7rZkg/icXNpDBU+6Txcr70] X-ClientProxiedBy: TY2PR01CA0011.jpnprd01.prod.outlook.com (2603:1096:404:a::23) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240723184808.1764-1-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|OS3P286MB2213:EE_ X-MS-Office365-Filtering-Correlation-Id: 20ef924a-49e5-48de-b64a-08dcab480adf X-Microsoft-Antispam: BCL:0; ARA:14566002|8060799006|19110799003|461199028|440099028|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: Rsk5uOvw4+SVxFFy+bXypf5Z64VC7oLhQj2TlyGPTK8R/FJqMZHuzeZVrzZZNg91k42Z5VYjlr95H0dZWgyRNj/06HF4Rpcr1eyQEXte0pTUzfV2wJfOhQAg4ok+RzSODxiMdusKlFuDQAbSnCYkR7XwEwOfIQ/qUIK6bJ2+sJegr3jG2ZPycWsEFzSH/DMdxRz7QOSLhjEWlvhg/M/6Vyf6ndQ47bYRRG46nWyYzsdBwjhzezP7TybCsvmcaODEZOkpFuRtGliwNVzu0WhlV6vxr7ns428O86dIu6firQhu77ZdzmfsFcFIggr/y9k57ITEwcWUPxtfodqefsyT/naMgDVRodkDvFeOQJXzhZZKn3u4nPtno4C4tr3RXefAmP1ArgYoi7NZNvxVPqaSLykvKyG7PIVe9L0blVV5tu7Z2Mw/DyMeEcN/MTFuXDgc2SjS+agIg9Rd/AAO+sDaXldjMTGZecAGa2dMj/HisoaYXtebBtIAyJhs6wO+z5PjxDbeW9eLA2t1bAJEii9F9jMIqqKRUHzmJmr2T1vkeN/7UJDq9O36xekgGu6vyKlyVlMifqaR4jyUu4S7GcYeUFCNSZ7I3N/OajNdUk87ibcUcDTwYm6NPkHZQYZDdt4BCwpKaS+pW/pClC6uLWcvCPyBrMa547l0lSIhYMJ3Bxzs8FSp2oQURpVitUSby7cC X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3D5EtZhRvK33AGIU51aisv2Ww+5e2vz5tSNeNMADMFxJcUxWuF9BvCzNVkWuDBg5dOX9r2aVFIpc3WKkiJz9OuFYJPY0XrdxkGWv6Ho2IavmTkbQeW37RUb+hPP9mP6hLo2Do95kf0FoWMDJ4dNCKiRBTbOUezZ85RvZa8G6SRlZaCS2hE+kQLrn7piAJE1ch4ZVpIl8WN9tsJ81rTZzwdzziXwMmbvvdPGGyPG/OadLcfBBy0WO0IPa12r80HuqJDxNlxTm5Mp8vX7wgVtr9n+p+Tz4a2dJIxke+p+nRXYrXCZv1ziORpqYNbwqvT0PavBUopaUDWoouzIBQ4q+wGE104qeg4GBCLvEnHBSWNAgg1qsPZhPGbQgaS/yRovlnavaBkhCF5h/ORvjYVZ0RO+OKvZyasECG7Oqnt5CqgVX8O9kdXtfo75veg/zGV6sqrNUhMAyscPUpqX6QlLSeQPdYaGmhDCWJcQ0tsMh0m9TZB/UHnlfsvA4oxVKF6p+B576/bZ2yu+IAgHchfMdMZJu1VhqU6eATux4FY/x9XSe8qr56/8vc0ePc9lTu8EsM96FCmj+eGE7xM5ti1Bb2l5RxXbdm0MDDvww+/5swFxU3klntRKxK8rPPrtbXYe5GrRo2hQGqDaNESQUmlMQna+1mIjGz7wD7hl4TNWo3Ki8lpFwK2v/zJQTuiN1B2wcAAJO2CGH7eYGfb5LjQ71UD6EYyX1HCsUqRo3lgveq8BreT5pFH2J3sr/3tDFxqJmM979hZHORSKg3tsV0Usbnba2jNtT1lerxvAzxxUxXY3tPaJNhX4BMTbsQH4YO+Yn38/OvoW2Xwm5A3MX2yIqLjqJtrsCh6yt0bc5Jp/3KFOK/YC2ELVQi4RyWxCcdb9fNK7a/WALgGcxzHPnFM9kK+mhcDBxmdJs7C6XatKCIfmvRodf84A1KoKo6v5j1onL/4rYYotSMhDIVU36lR04Kpy06LkfWhgUCr2FARJCIOtEVA4wQR8UjQDyTNgnrV1HCswwISHQOdrl/QKWRshve/Ewa+EKgpZS82m+D5eOJur+f25hmdrMQDbDrDQhspxDkPz/nfu2754rQVRG8dDk5Ax8rQ+rqW0VLDqFFOcENhwBzT7UuHLspuD/w2mn9+qh8MzyrEgrLzXY0AicHsuOByNyFwMgeb945Kf1FL8cvXqPg7efWZxKlndsBLgQz8TD9i31PcBeLN1Kbb9+fem5sj2a6OM+B6AmqDDE7XYcVYk= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20ef924a-49e5-48de-b64a-08dcab480adf X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 18:48:29.0484 (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: OS3P286MB2213 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/vvc_parser: move avctx->has_b_frames initialization to dec 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: /uOhCZK7IIpf From: Wu Jianhua From Jun Zhao : > Should we relocate this to the decoder? Other codecs typically set this > parameter in the decoder. Signed-off-by: Wu Jianhua --- libavcodec/vvc/dec.c | 1 + libavcodec/vvc_parser.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index d04f68e4cf..6e225d278a 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -748,6 +748,7 @@ static void export_frame_params(VVCContext *s, const VVCFrameContext *fc) c->coded_height = pps->height; c->width = pps->width - ((pps->r->pps_conf_win_left_offset + pps->r->pps_conf_win_right_offset) << sps->hshift[CHROMA]); c->height = pps->height - ((pps->r->pps_conf_win_top_offset + pps->r->pps_conf_win_bottom_offset) << sps->vshift[CHROMA]); + c->has_b_frames = sps->r->sps_dpb_params.dpb_max_num_reorder_pics[sps->r->sps_max_sublayers_minus1]; } static int frame_setup(VVCFrameContext *fc, VVCContext *s) diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c index 5373875aae..8d32d66573 100644 --- a/libavcodec/vvc_parser.c +++ b/libavcodec/vvc_parser.c @@ -185,9 +185,6 @@ static void set_parser_ctx(AVCodecParserContext *s, AVCodecContext *avctx, avctx->color_range = sps->vui.vui_full_range_flag ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; - avctx->has_b_frames = - sps->sps_dpb_params.dpb_max_num_reorder_pics[sps->sps_max_sublayers_minus1]; - if (sps->sps_ptl_dpb_hrd_params_present_flag && sps->sps_timing_hrd_params_present_flag) { uint32_t num = sps->sps_general_timing_hrd_parameters.num_units_in_tick; From patchwork Tue Jul 23 18:48:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 50717 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a742:0:b0:482:c625:d099 with SMTP id f2csp2815300vqm; Tue, 23 Jul 2024 11:49:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW85cMaJtWsVeSPWCUY22zSNKNLr7E/ZGg1qAZBO/txDfr6pKcDsIdG7dg7LGm0XIdC1QwkgFxLSaH5WhtxOReNuOjC1X1CaXwAyw== X-Google-Smtp-Source: AGHT+IEjAUjho+SBAbg3cGwCGCadktOYM/hjQNP9ezHjmW0UbaB9q2URsggCHlVFhMF/X1numxUd X-Received: by 2002:a05:6402:3584:b0:59c:31fd:266b with SMTP id 4fb4d7f45d1cf-5a3f08931a3mr9881733a12.28.1721760554440; Tue, 23 Jul 2024 11:49:14 -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 4fb4d7f45d1cf-5a309fffd10si3540449a12.30.2024.07.23.11.49.14; Tue, 23 Jul 2024 11:49:14 -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=RBhUErfY; 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1DDA268D361; Tue, 23 Jul 2024 21:49:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazolkn19011039.outbound.protection.outlook.com [52.103.43.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E4A968C5B1 for ; Tue, 23 Jul 2024 21:49:04 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oZTGuVBjo0hrpdfVwfqvsKDIpmxyab/DwpweRTAuNX3KRQpiwDQtp7CKQ5/NQ2wUmuvsJi0Y2czK6nQ+GHMqko0SA0qAtplH6JYG0fTII/U3s6f+VbMA5ug0UJgoa9ObfE004KD7hrBd0yU6Pb0lMqrDLqX7WKNN+Qd7uslnQGEk1C7lcX18STS0KpCmGyYeAdyFu532s+5VwpdYo8IFn7VPG5MbaqO2J6haGVDvpgkUNwZ7DM8fW7snrbaxiZabCxlkFR0CweFomMWFwsqKr5Iv3nfoC1VLscgcYFF+K02L6tXDNUTcwgk/dWwdqVQjXPhIMeVAdTnsJQVe0ae1gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oFrg4nYD5hV67fUvdQQs2U0QWLmMvWF22Lt8ejSruQ0=; b=TMj6OhBUlAAyzwXQzTT6X1Vt4piQTcpwq5CX8hSIK6rplFlQvVmBZ1CnTnd5Yw6cYalzth6KrWZX4aItwA40gmmRIaNjcUZ7v3jJ6KcFIbjAr0hDO9zLNRWfLAdMMRzBs3n5ilLbhR776YDVAofIyjw/ePwSTPhs1esvupNNIEuDkfhJSx9ffSCEv3iqxucchINPGAisetDwFWXutc76OBygGnhMMOrxyJc8vHP5t/Sjip8wAB/y6zbyarr60fLZb0hajFX5Cf2V01y2lBgFhCkLV0xcKqWLm1HxxViSIxZBr/LHlmjd9Cfu43Df36Wa//5zyR6UjYccu6hZCPbrBg== 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=oFrg4nYD5hV67fUvdQQs2U0QWLmMvWF22Lt8ejSruQ0=; b=RBhUErfYag3W1jdPF5ykBC2oUm4OFIG5eXg5pl6+MmhPuH2+qwwOlDtE1GMAx+REgZmGLPtryoS4AuHxARF3jfWq3vbQ5bW/q3NpXxzafuADYsuwcTVxSlHU3ocQ5AZOBdtaRKtcm9oIQonAWnlrQmlZFI3+hvMf8pcp4p3DrOianl3qQAge3mcgYezA5Ejjowj6LvcAE0Zoth4GFrZVvN71pWspqghv7X4m7AEP1udNFcOlL7q2NhDedbp8SD3NipDpE7Ncu/XbCbP2pAZM9uajFxyiPPOpEbs1XsAVIfgVnQ98qULzcigyyq715tC3ND7vOgmYf/51LRSp5g47Sw== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by OS3P286MB2213.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:198::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17; Tue, 23 Jul 2024 18:48:32 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9%6]) with mapi id 15.20.7784.017; Tue, 23 Jul 2024 18:48:32 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jul 2024 02:48:07 +0800 Message-ID: X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20240723184808.1764-1-toqsxw@outlook.com> References: <20240723184808.1764-1-toqsxw@outlook.com> X-TMN: [KgMzNb+d+ULX6rFlQ7ECroE9Jfw3z44o] X-ClientProxiedBy: TY2PR01CA0011.jpnprd01.prod.outlook.com (2603:1096:404:a::23) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240723184808.1764-2-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|OS3P286MB2213:EE_ X-MS-Office365-Filtering-Correlation-Id: ae2819e3-2eea-4fc2-d936-08dcab480b52 X-Microsoft-Antispam: BCL:0; ARA:14566002|8060799006|19110799003|461199028|1602099012|440099028|4302099013|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: rmmqaEPW10MKE5vHWPWnxaDjIakz2x2gx+Sydsm1FK7gTsVtZ0AcYL2lUKdQl/jaDVsgjSdc8m2FEA/Bpm1VkmFwQPoG/LYL5PBeGooYk64IpwJU36XQRQ4DHqi/OgbJ6mtgk6IAReh1yGnTDr8kdoNZAGv4mEra/4eoDYZGeQxQlHwCO94bZRgg7N3fy+cKOzvcN22gcL6xAGfToVMH8Tw3bDCfwVknhWY6bbE/6oRcl1sMlGrC5fw8hBowp/etf1gcHOcVfp5hak04YdvkODXlkhyHyO5xWXjxrJ/KmUGzjZIKjVvnaualuFK3N0WDtnYA9ndUpWF9I7m7o9+Pis7A+BuysKB65Elb9qX/uBxtBeEVJadQVUSdxzWuN4LK7G+5JsNYaUHW5t0NhON14K2wmRfs5XnNlyr4zewgmcT4EjrD90xCPT7si0lWUbzr3KF+OwEfoN2Dg3vMrHqIgB0ge29AUVMkCiubs4TTl03T1F+kVq+uRVf9KJAcETYWRFBZiBcgFpXQ21AtT5EfCIQOtfwSIM9dYufxuck3zW7v3iQbVL4rw0MQ7Hod1ITqhulpbzJN3CxKC/oyLR5Y7eBqJiZi6mXuCMJY3D4KMmlQNXQk8a2qDy0W6u10Z9gAJmWUPeRMEdX7dOPz+ENAmRUl+EXOAIDsF/q2dRwBDq6VKzcrQ9jsexapTnSJLwRicEqvMJx1lbivPlF0YN2YlcHvEpbAYR44wTFSk1n9coVLX9ExP0fEhjg800Na0HMoljscqpCCaL/pArsMXJLwvA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eUnBFQH7KtHYfudT7FUluxUEkir8O/CcWsVtq+XNcFGrxFAdbXtxadD7Ow+GQBlskDg7x/RoHaiY2tomJOfN3W2ytecopwCPICX6ynikZ517Gqka4BMLedvn+EDIXa2d1+ABN0gchZgllqV3hNAjhG4fdVLp7dzv110ICOtpgeyaY50O55qeqENqEdAqZxBo2MCUKXz59/spUPxx9SqCvJVwqHNGykEFTx1pSpOMEUiaYM+7yAf00uvqAk4gJSE3lFO+LBTntT6VXTIElr4ORdAoEWsEUaY5+DK+rgjVPxL6281M29LOesSjjXT9QfdKpw4/GdhHpoYYjsI7Wi2GI6s/Lk/LgTDyua4fp//bBaOvO4tqrB7p/xrh9bl+vMFl6lAtsyhdtsF3WaUVBBhrC2/Bvwxjq90KfXYUFvpGepo0McAWMSBSKYi9lljzvNn04W+oG8G/SZ+SDBsC7uV8n3Vb9jsxs/NSiB1W7Y4f35Oh6puIoln1qAdoeoNxWbB9CXfnoVCX/H8u8YTeOpxtpx4uIUMHLMHJ8e2dDvdY/CMh35BkbpphBKOEovU7E8rWT9xlRAI+UJ9IjH+/BrSbWfthTUCFTPtAzVKvd1/5HYBNXrXEIN5CF5lOrR+h1IvRSbOP70di9NfCmAW+8hJVHUW6oLk5WT7tjZBZQnQXwDaCUur94M8LB3kF/aBJyFAIJLDYI5m7YwE9cZGogOVdwtrc0SZjVb4AwRCiUNiJVeO3A+lTLnuQXoweJjoil+RMqPcyc4Koo9Xk8egDf8iKM1Sw4DYInu8JZXBh5hIpWlDFMnOS1q75U9hbk0Al+VLBHd+f0CR6klYw2iwYu8c0DRmire5DGuVTuaimIQM752qnfvzR1vtszWzb1Wtps2sXPMDJF/ZjwSyl3UHdYV+LwVJEYnrFNSRIdviGrKJhc1dOq/kRMRxWDf4sKKhfYP3WWyySemBNFxSLuAW7MT5RnlnaZXhfxEEI0JfLqLj3h+Nfjmj7Ez/Q9ZVn1Jlv/TvUr3wQTS26Xffu2RQqCc6d5H4ot57YyxbK3P8qXyrMY1HveFQMeHR0OBp1nNVNFmaneWQkw/wGwHRb0tMr0VLlG+7C0y42F99fiApZU+8rips6GIcIcW07wcxmU87/EAd+yhcq5Ut543Ur/5rwxI84CLKCJnP6fPXgaGpKywGzUTio8i/QiN7D05x40ItMUAVxFxYd/tLtnmaEmV6I4FhKBIDQVzQa4rfK6Zg5kMYYjBw= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae2819e3-2eea-4fc2-d936-08dcab480b52 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 18:48:30.2209 (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: OS3P286MB2213 Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/vvc/cabac: remove vvc_refill2 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: haEaP+es2UcJ From: Wu Jianhua See https://github.com/ffvvc/FFmpeg/issues/178 Signed-off-by: Wu Jianhua --- libavcodec/vvc/cabac.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/libavcodec/vvc/cabac.c b/libavcodec/vvc/cabac.c index 0d45eec751..c9b6f9bf3e 100644 --- a/libavcodec/vvc/cabac.c +++ b/libavcodec/vvc/cabac.c @@ -856,32 +856,6 @@ int ff_vvc_cabac_init(VVCLocalContext *lc, return ret; } -//fixme -static void vvc_refill2(CABACContext* c) { - int i; - unsigned x; -#if !HAVE_FAST_CLZ - x = c->low ^ (c->low - 1); - i = 7 - ff_h264_norm_shift[x >> (CABAC_BITS - 1)]; -#else - i = ff_ctz(c->low) - CABAC_BITS; -#endif - - x = -CABAC_MASK; - -#if CABAC_BITS == 16 - x += (c->bytestream[0] << 9) + (c->bytestream[1] << 1); -#else - x += c->bytestream[0] << 1; -#endif - - c->low += x << i; -#if !UNCHECKED_BITSTREAM_READER - if (c->bytestream < c->bytestream_end) -#endif - c->bytestream += CABAC_BITS / 8; -} - static int inline vvc_get_cabac(CABACContext *c, VVCCabacState* base, const int ctx) { VVCCabacState *s = base + ctx; @@ -904,7 +878,7 @@ static int inline vvc_get_cabac(CABACContext *c, VVCCabacState* base, const int c->low <<= lps_mask; if (!(c->low & CABAC_MASK)) - vvc_refill2(c); + refill2(c); s->state[0] = s->state[0] - (s->state[0] >> s->shift[0]) + (1023 * bit >> s->shift[0]); s->state[1] = s->state[1] - (s->state[1] >> s->shift[1]) + (16383 * bit >> s->shift[1]); return bit; From patchwork Tue Jul 23 18:48:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 50718 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a742:0:b0:482:c625:d099 with SMTP id f2csp2815348vqm; Tue, 23 Jul 2024 11:49:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVKj7GVvyMfNoW44ilXedFWgzb8UxzVBARtcMsEI/iB3VCZKWU2w4k97tHF0COt6UeWh+uoNlDP+tQZOnogh29FO96jiccdv6uEYA== X-Google-Smtp-Source: AGHT+IGEBrGx4nuuznJb17tIvZwUW0tQh01AzFhfHr5vXtin0IxTE0haL5aAQKFREm6emOwJWB9c X-Received: by 2002:a17:907:80c:b0:a77:c7d8:7b4c with SMTP id a640c23a62f3a-a7a9424e5a6mr330857466b.11.1721760562859; Tue, 23 Jul 2024 11:49:22 -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 a640c23a62f3a-a7a3c993975si557385866b.1007.2024.07.23.11.49.22; Tue, 23 Jul 2024 11:49:22 -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=YneX+fyB; 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 76A5B68D28D; Tue, 23 Jul 2024 21:49:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazolkn19011039.outbound.protection.outlook.com [52.103.43.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D02D68D28D for ; Tue, 23 Jul 2024 21:49:10 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O+TQeqNdEkVy6YuL399kPfFRbCE0hGQtxt4H+ES5lH8WcRyBv6zW1+9AyPf9TSFvgvqyhcEKw6e8/It3ibisamphPLK2rcbi6zz4p/qik5/Yv0SzO1DxO3UJi4VrZUYx8khSd0U8scL1nUKhZW6jmjfkLTDCYlA/tlISlkrtjfDk9ZAlBeyhsS1M2zfB2wrmWTtZ1s6oElR7z4KZ6X8w9kNZW++bsXz0AnF8/1x1c1unwgUtN39e//KNSjBJ8q6A92ffeBL3AKdeYtzpfw0YUqYu17tOzH86KN/yuQO6RQcg2QK1qYDzqHPkbSIwz4xWakF/aDvNk4jLxdjwnLwz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fg12NvwEoHiVYf1I9fRWyD+0XbEy+BP5bL4noUsbshI=; b=wzQJYugWnYTzYYByJHXOl7RsQ04PpVGcYsQ/zT5yrkd4OD5npnkFvKke0qxyQnDXyvnMBblvHyB7pEupDvsfF0eo/oQonodbsNEoyRCvyk4O91aTMYlAuzwoakpT3oJEcqg9mL6q+LQ1qQxKFad7WEgJtKUrwNTGfvWfIuUY0mjztVeddN28aqqaCMwSNV8L2QklLrbCYCaJYU1XYe6iTKg4077fMMn5JaSMSjZp3/v3DZgcmNchDDO7M88x+zLQF8iItPg1201XRXVmFRUEf6bpj/I9Bq7c7gDdHDfLm304uBu4IfbGWvpagrl8OjezyQ0I9mILfrQs/IjgkGlmCg== 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=fg12NvwEoHiVYf1I9fRWyD+0XbEy+BP5bL4noUsbshI=; b=YneX+fyBwU5xVXNKFA3HBiHLIOT8LkAfhJsaevxgTFCvdp4E62Kyp2hu+pVCAc/tyYnNYe1re/F1uUkZRlrRInhiJHL7GbJJEtev2175/awfwmdSAqt04z7QXlUPk6OcgiKhK/Hs3DaiggN4X0SZABtKt4zLzfKwaRn1cDVh3mYyG1j7szMpivksmzeGdu1DjyfBOAT6V52Oy8VyySWqxicq7mW6T/ei1FCM8KQVWrjxz8jjKRG4sBnT8XeO3qy9lR3a3Cy/0y6R4682ATR0zjwVXsfY35OJgzFcq674mtCLaK0tTzP9fnZ/wHY8K4rkzN6rnmbYDXE0nFW3HbI46Q== Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) by OS3P286MB2213.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:198::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17; Tue, 23 Jul 2024 18:49:01 +0000 Received: from OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9]) by OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM ([fe80::451b:2fa4:87f7:14a9%6]) with mapi id 15.20.7784.017; Tue, 23 Jul 2024 18:49:01 +0000 From: toqsxw@outlook.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jul 2024 02:48:08 +0800 Message-ID: X-Mailer: git-send-email 2.44.0.windows.1 In-Reply-To: <20240723184808.1764-1-toqsxw@outlook.com> References: <20240723184808.1764-1-toqsxw@outlook.com> X-TMN: [SSlVcmCKQWD/CleigXq1XzEUhH8YJVTm] X-ClientProxiedBy: TY2PR01CA0011.jpnprd01.prod.outlook.com (2603:1096:404:a::23) To OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:186::5) X-Microsoft-Original-Message-ID: <20240723184808.1764-3-toqsxw@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB2173:EE_|OS3P286MB2213:EE_ X-MS-Office365-Filtering-Correlation-Id: 134cfef7-1a58-44fd-c384-08dcab480c04 X-Microsoft-Antispam: BCL:0; ARA:14566002|8060799006|19110799003|461199028|1602099012|440099028|4302099013|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: +CMeBKAX2wQ11643vOGG0qKfSL+ebzn10ifeStzilScNIFSiCUkAG9HjpRVdFyEp9XqTJvoL6Ma2di4PedTt8osobw19sPM5SczGCLQNR+6vutCCNWNxVT87JthM9CPL0NKfzLit6x6n36Z/6Yx4lk/Qh2F2WtJjN+yYiJZ4m1a2Z2xPRQEVAEyjKo4DzvET8nx5apSsZi41EO36BAhHZe7E/PIiCWb5Q5Fplzn3YWApRTxnCMBKbxtYPYsSTtYMXqH+I/ypQZD/51lApO0V9mXCYOCpfL87Ux+aXr8Q6fj0YBp/qBvfTohJzIKbouG8Q4JTQGCIUFEonNR4jm9A72f7v92QS9awakjwWszrZpX4Nfp4gDzDT//QD+pZRnoj7tYG/6t1yZJ0k48FByPlXbEZ3Po6eY4WU6bxY5xTivMsHxNuWs2IleyO1Axou87TQeuaFaHWb22LoiSGW8svZ/X/RWUGTyzZdw3T8mIqK4G1S3Q/xJuq+iPDT4QkXBa8aztKnlieN00WrtlAZO2rTH3HmftKHy3cso+ln94Go4DM5qLxms2+F5daz3fDkv8q7FtZ+PPWQPeVxCsMccoNwtMlawygxMqa5ThgI+gdjr3Ng+v6HB3yZ044mYMSZEmLmq0c5TNZ3ZnBZ7C/uuXzbNLqhmFSZdy9D1WJat2ptjX/7B0SimUr2nR2Y58r78sJKcTgnFxP5FRFVu8LhtHyecvWDTiuaiA+DAqr9Dv/pmUYDm2qOOmgMAIoJvcxnAr3TRnYqYd8SGHOWz5U/lj3nHKTvcwBmbL4gyHPae26auc= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mJS2GC8tXTM3+2aRaCuKVUAatiZvOaakqdreCa4wWTSHjegPNvObkT7vx+YbogPInycwa+iUOdd6C/S6ezPrplOH94kycyDPGFbMd/SlvLPgag/RHolAP8OuI8aGDoo/tPbZkS0+SrTFAEXapiaErYV1litowett4fynrXTrAeNg392vureoybthUB3x0IsDXpMeqRNObn1kwVyl2pDwT2BPHn1QBF61gK81zVgwuEb8FifWyje3flkdV8nKYRqnf2SioyJzX22qxfAUqkfEkUa3G34S49ZkyArHAhIhzusmgmMHCBF1yPZEFsj2O+wY+f7ruHBalftJaZbqPIC3At8ovYuWzx+fIzXbwD1PsDQ7BfptroKvdm/j3eBSQnv3xbSDCgHywNFXgHcAJl34pRqH3Cq8CPAYOz1wTXI0xNQEPoDXxrIBqW/GsPG9ldnkWMeXQ0uHcmMGQ84fbv8eV9+DnBeooiych4kN43ZP+1rgnj4qaoXaN/PBWn+QzBVx0unogIbWvTizZeAN8s8fsBo2ZTIRHxwA8YS/gnEM/omIeMuJXpiKsMTkoBOaiQDerZ0fdAYJXpRBBMMtdxXrzF5c35zRsJEGMANBdPOl7ujgw041pVHbq4pltkMdFB/eduKG2waKZnf4htQRJEqd966AFVU81ZK83+ZC7qbOuBim0mTV6203NIIhc+7bN8AWbCy5UZd9RFhSU+kVn658v+O+IBJYflezAtnvW7Ch3iX5ha51QDjG6atnS9E1TifpKRdeDE/Vm/WcAdvMwPbPk9+SbKIsKXqiymspnRq6VtJ/7XkzaSXyuKbrgYbwZ+3UlLwnbyRoILmxTvwKiXSKQ6aS70WzNlgMbdRxWAglQ12wf9y3DlExxVhgwlUXMOq2HPjKnI4lIoP+eM5VzK5eJXd9GAmzidq4PR+G7JVtM+W35HBcGwn2v/oNSyHSM5AQL1/Rolz2XZaxtrDPxwiC123bR7aYser+6WzxMXmzWFxPYcFgFP7cB76smEDcH0TZoO36Ttwq+WsFwfH24VDx5higoZ35q3wlDZI6X7yTGQxnGrMiGS73BOe0Wj1wavpE5AkB1YCqrAd+WvJY6z7AS7oTHt27YKd08wP2pUNOA+Ib/fIBo16I9iwjOZbgfgH8MR9K6P4due/iUh7aFgDLD1QCp1y7Av9C8o/edJVY26mwd1VsnHq4acYRYClWWumDELBX6LVYcnbe3tgtavdaRIjKYnCSHG3xyZNvHwNQ/OE= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 134cfef7-1a58-44fd-c384-08dcab480c04 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 18:48:30.9641 (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: OS3P286MB2213 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/vvc/dsp: prefix TxType and TxSize with VVC 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: Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: izsMAgdvxmlR From: Wu Jianhua See https://github.com/ffvvc/FFmpeg/issues/180 Signed-off-by: Wu Jianhua --- libavcodec/vvc/dsp.h | 28 ++++++++++++++-------------- libavcodec/vvc/dsp_template.c | 2 +- libavcodec/vvc/intra.c | 26 +++++++++++++------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/libavcodec/vvc/dsp.h b/libavcodec/vvc/dsp.h index 1f14096c41..662092fafc 100644 --- a/libavcodec/vvc/dsp.h +++ b/libavcodec/vvc/dsp.h @@ -27,21 +27,21 @@ #include #include -enum TxType { - DCT2, - DST7, - DCT8, - N_TX_TYPE, +enum VVCTxType { + VVC_DCT2, + VVC_DST7, + VVC_DCT8, + VVC_N_TX_TYPE, }; -enum TxSize { - TX_SIZE_2, - TX_SIZE_4, - TX_SIZE_8, - TX_SIZE_16, - TX_SIZE_32, - TX_SIZE_64, - N_TX_SIZE, +enum VVCTxSize { + VVC_TX_SIZE_2, + VVC_TX_SIZE_4, + VVC_TX_SIZE_8, + VVC_TX_SIZE_16, + VVC_TX_SIZE_32, + VVC_TX_SIZE_64, + VVC_N_TX_SIZE, }; typedef struct VVCInterDSPContext { @@ -127,7 +127,7 @@ typedef struct VVCItxDSPContext { void (*add_residual_joint)(uint8_t *dst, const int *res, int width, int height, ptrdiff_t stride, int c_sign, int shift); void (*pred_residual_joint)(int *buf, int width, int height, int c_sign, int shift); - void (*itx[N_TX_TYPE][N_TX_SIZE])(int *coeffs, ptrdiff_t step, size_t nz); + void (*itx[VVC_N_TX_TYPE][VVC_N_TX_SIZE])(int *coeffs, ptrdiff_t step, size_t nz); void (*transform_bdpcm)(int *coeffs, int width, int height, int vertical, int log2_transform_range); } VVCItxDSPContext; diff --git a/libavcodec/vvc/dsp_template.c b/libavcodec/vvc/dsp_template.c index 8130abbccf..1aa1e027bd 100644 --- a/libavcodec/vvc/dsp_template.c +++ b/libavcodec/vvc/dsp_template.c @@ -97,7 +97,7 @@ static void FUNC(transform_bdpcm)(int *coeffs, const int width, const int height static void FUNC(ff_vvc_itx_dsp_init)(VVCItxDSPContext *const itx) { #define VVC_ITX(TYPE, type, s) \ - itx->itx[TYPE][TX_SIZE_##s] = ff_vvc_inv_##type##_##s; \ + itx->itx[VVC_##TYPE][VVC_##TX_SIZE_##s] = ff_vvc_inv_##type##_##s; \ #define VVC_ITX_COMMON(TYPE, type) \ VVC_ITX(TYPE, type, 4); \ diff --git a/libavcodec/vvc/intra.c b/libavcodec/vvc/intra.c index f77a012f09..73dca6dc85 100644 --- a/libavcodec/vvc/intra.c +++ b/libavcodec/vvc/intra.c @@ -128,15 +128,15 @@ static void ilfnst_transform(const VVCLocalContext *lc, TransformBlock *tb) } //part of 8.7.4 Transformation process for scaled transform coefficients -static void derive_transform_type(const VVCFrameContext *fc, const VVCLocalContext *lc, const TransformBlock *tb, enum TxType *trh, enum TxType *trv) +static void derive_transform_type(const VVCFrameContext *fc, const VVCLocalContext *lc, const TransformBlock *tb, enum VVCTxType *trh, enum VVCTxType *trv) { const CodingUnit *cu = lc->cu; - static const enum TxType mts_to_trh[] = {DCT2, DST7, DCT8, DST7, DCT8}; - static const enum TxType mts_to_trv[] = {DCT2, DST7, DST7, DCT8, DCT8}; + static const enum VVCTxType mts_to_trh[] = { VVC_DCT2, VVC_DST7, VVC_DCT8, VVC_DST7, VVC_DCT8 }; + static const enum VVCTxType mts_to_trv[] = { VVC_DCT2, VVC_DST7, VVC_DST7, VVC_DCT8, VVC_DCT8 }; const VVCSPS *sps = fc->ps.sps; int implicit_mts_enabled = 0; if (tb->c_idx || (cu->isp_split_type != ISP_NO_SPLIT && cu->lfnst_idx)) { - *trh = *trv = DCT2; + *trh = *trv = VVC_DCT2; return; } @@ -152,11 +152,11 @@ static void derive_transform_type(const VVCFrameContext *fc, const VVCLocalConte const int w = tb->tb_width; const int h = tb->tb_height; if (cu->sbt_flag) { - *trh = (cu->sbt_horizontal_flag || cu->sbt_pos_flag) ? DST7 : DCT8; - *trv = (!cu->sbt_horizontal_flag || cu->sbt_pos_flag) ? DST7 : DCT8; + *trh = (cu->sbt_horizontal_flag || cu->sbt_pos_flag) ? VVC_DST7 : VVC_DCT8; + *trv = (!cu->sbt_horizontal_flag || cu->sbt_pos_flag) ? VVC_DST7 : VVC_DCT8; } else { - *trh = (w >= 4 && w <= 16) ? DST7 : DCT2; - *trv = (h >= 4 && h <= 16) ? DST7 : DCT2; + *trh = (w >= 4 && w <= 16) ? VVC_DST7 : VVC_DCT2; + *trv = (h >= 4 && h <= 16) ? VVC_DST7 : VVC_DCT2; } return; } @@ -447,7 +447,7 @@ static void dequant(const VVCLocalContext *lc, const TransformUnit *tu, Transfor //transmatrix[0][0] #define DCT_A 64 -static void itx_2d(const VVCFrameContext *fc, TransformBlock *tb, const enum TxType trh, const enum TxType trv) +static void itx_2d(const VVCFrameContext *fc, TransformBlock *tb, const enum VVCTxType trh, const enum VVCTxType trv) { const VVCSPS *sps = fc->ps.sps; const int w = tb->tb_width; @@ -456,7 +456,7 @@ static void itx_2d(const VVCFrameContext *fc, TransformBlock *tb, const enum TxT const size_t nzh = tb->max_scan_y + 1; const int shift[] = { 7, 5 + sps->log2_transform_range - sps->bit_depth }; - if (w == h && nzw == 1 && nzh == 1 && trh == DCT2 && trv == DCT2) { + if (w == h && nzw == 1 && nzh == 1 && trh == VVC_DCT2 && trv == VVC_DCT2) { const int add[] = { 1 << (shift[0] - 1), 1 << (shift[1] - 1) }; const int t = (tb->coeffs[0] * DCT_A + add[0]) >> shift[0]; const int dc = (t * DCT_A + add[1]) >> shift[1]; @@ -476,7 +476,7 @@ static void itx_2d(const VVCFrameContext *fc, TransformBlock *tb, const enum TxT scale(tb->coeffs, tb->coeffs, w, h, shift[1]); } -static void itx_1d(const VVCFrameContext *fc, TransformBlock *tb, const enum TxType trh, const enum TxType trv) +static void itx_1d(const VVCFrameContext *fc, TransformBlock *tb, const enum VVCTxType trh, const enum VVCTxType trv) { const VVCSPS *sps = fc->ps.sps; const int w = tb->tb_width; @@ -484,7 +484,7 @@ static void itx_1d(const VVCFrameContext *fc, TransformBlock *tb, const enum TxT const size_t nzw = tb->max_scan_x + 1; const size_t nzh = tb->max_scan_y + 1; - if ((w > 1 && nzw == 1 && trh == DCT2) || (h > 1 && nzh == 1 && trv == DCT2)) { + if ((w > 1 && nzw == 1 && trh == VVC_DCT2) || (h > 1 && nzh == 1 && trv == VVC_DCT2)) { const int shift = 6 + sps->log2_transform_range - sps->bit_depth; const int add = 1 << (shift - 1); const int dc = (tb->coeffs[0] * DCT_A + add) >> shift; @@ -542,7 +542,7 @@ static void itransform(VVCLocalContext *lc, TransformUnit *tu, const int tu_idx, transform_bdpcm(tb, lc, cu); dequant(lc, tu, tb); if (!tb->ts) { - enum TxType trh, trv; + enum VVCTxType trh, trv; if (cu->apply_lfnst_flag[c_idx]) ilfnst_transform(lc, tb);