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+uRVf9KJAcETYWRFBZiBcgFpXQ21AtT5EfCIQOtfwSIM9dYufxuck3zW7v3iQbVL4rw0MQ7Hod1ITqhulpbzJN3Cx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nOS1q75U9hbk0Al+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;