From patchwork Wed Jan 31 09:27:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 45920 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:8786:b0:199:de12:6fa6 with SMTP id ph6csp2711500pzb; Wed, 31 Jan 2024 01:26:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDfmso2o8K0ddaMzjZjicf0ykQL1nSr0ZrJX4epSZ/Utha+K7O67KUdKDNtNLYKmoch7kP X-Received: by 2002:a17:907:994a:b0:a36:5b3c:be40 with SMTP id kl10-20020a170907994a00b00a365b3cbe40mr770822ejc.58.1706693197379; Wed, 31 Jan 2024 01:26:37 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b12-20020a170906038c00b00a36019d48f5si1865270eja.347.2024.01.31.01.26.22; Wed, 31 Jan 2024 01:26:37 -0800 (PST) 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=NdE0xekO; 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 7F0BD68D127; Wed, 31 Jan 2024 11:26:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2038.outbound.protection.outlook.com [40.92.58.38]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1115068C7E6 for ; Wed, 31 Jan 2024 11:26:12 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OeofNNzzdiP9Eps8qoDknhfwzPdwMH4CkFabemGZJkWQw+mj/sP6HHeyPQIHtwj7wlsL8YspckRXlFvVqUfE5/7uB4zlsAGUbaus3GNdxEqPuryvmy3NGNiK5rfUCGninJ0n2OsUT/f128K8C0kC5X1msrCp+8UT5KkPDnmXMooitqpXtj0qQacDA20SoF617AJi8mpwQR/ROoOYA4xtV54AJULE4LYKQTraGH3fMP8r8WN37R2GwgmryOua6+ASFXfz5CevwlgVlKKYGWFTyXL5qU+opQrBN6R/cnQrjUPv50TeVL7kR5xgN2nSMXm5mGNwiogz/bkwEgxU6dp5kA== 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=XD7TNHBRNHqPB9SBKfHd2vLyqR7AjgEnUpz/VDLiMPE=; b=ZCZg9zoYIFjedDGp29MKbV7S4C4hpwZKrA9e65iCQoQZGOhsTuPIsz3sZkN2VOuPtSeBByQuADjsM2MXlyWK4tQZsHVU88evEh3fbFAcC+RePhMU4F9dSTMVxqqdiYUuoxMO9tbZ3VXjyU7/Wnc+ugEGEPkK/JDStBWaanjdaQTEwtQOI0zfuh8RJNY/KiQF2oD1ig5hkz7ukJbPyr6ylRTUH3UIrWdfUiUOtgcUtxGKYdvR3QkqmZfOdvtPirqFI+cIlCjITnMFboO928R6g998gifVHM5B5vfy4NchRNRK1QpsCpD0Fs01zfXjQW7xSuKr/5TijULhj4KcC9RLvA== 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=XD7TNHBRNHqPB9SBKfHd2vLyqR7AjgEnUpz/VDLiMPE=; b=NdE0xekO+xcjUrcgebdKeob6uRpmAxv/ZR1R4JHX7q4HlDouOR/N31WxqTb/eJgcRWSjxNoGhaX0ZUrD9ulBasqnPB/46Y74jgbOw8E0G5DtlGj8CdJ0HjMUwWOXWaJTNn1pHdjff+jqAAwweFoSTFPWfo2X9Xi4VPj4EWaxvMbXUGXHzR8rE5wSjcB8z3T6izVJ+pCh6LDVViP0QK1CDBUy8hVjfreARPqBpLbOdGMFsrXh3EDILcpJxbSx8x1QoFrfiiegoj+O6H9qCNGedvxVu+JCY1QTT3Uh/LRWposbGg8xIx/RXdPIv4GZHpq42gIWLiAEVO/y8GMFAE1Ibg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0344.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:32b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 09:26:10 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7202.031; Wed, 31 Jan 2024 09:26:10 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 Jan 2024 10:27:54 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [87r3L3juwwqV0eJ5aKMlYTAnXDavF+dXUBEMK4ID+4E=] X-ClientProxiedBy: FR3P281CA0145.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240131092755.749210-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0344:EE_ X-MS-Office365-Filtering-Correlation-Id: 6734a10f-c3e0-425e-d030-08dc223ea8fb X-MS-Exchange-SLBlob-MailProps: 9IecXKUgicCdh7p5dSsaunIxzpUhwFBO7vh/VxcG83SqPyjlTkj5FRwF01gCsKuWGNNIz88IBoZ9OP+jqfDBk80DG72CAiyf4cuekdBkGxQhjZnEmoqhqmjUTcs9EGBqTXaJNGGvTTx19ixhZAwB4iduDFZVHWAX7G3csUm6/JpeBxQpEARuxqnGPw38GyFLKRv+dfzR9LZcv2QviXQwuwXhN92cErL8w7uixV32WNHDctwGbgMACCpBrxscSGPNwlJLRT6NX9KNh4EqRRWpUVTKmH6V2CU3bOUHesymExLJCY9OhUAhLv2w17J8ndRKS34O5zge+K97xyHGxSk5fatJ7YPHbT6XpaZBiZNom1Ro+p6Gr0sbVGE3Y4kEf5WjnJKSNYwcIE/wfxt0FaO1AoYqQhVcxH5xhTjJ5z60MCZgqEbflO1MXHnRovp/AfF+SVa/oJyrAzVjo0XNjvdmL209VekzBkphzckHZ0dvpWZalu+z3sSRzE0EIv8hDeXSWBZrahV8LQj7uifcvTCVnSVICh3TyDe9cZ3EakRtdWAD5eq0R2N/ltNtLSQH4o27C4pTT+G30FGlWCWCoO3Yiujw/q2z/zqQ5Wr/w6BA9TOI1fuCUS9QpM1u0/kt3auq+w5bnyXeWRXAWWClTR9puFS2Qvetl1wf3i42DpRAlL0rH4n8TxaUDW1l3fRAjnggm7GlDS8e5LMYBE6XIy7ABWpIls47Sk8g1hkj3hF3a8Lhot0SzRn3lA== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9XaDgHR87E6qygPPRrcMUQjRMsZ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heWHBBq48g3KjgBTLF0ibIY7cUsWrvZu6+Lpizt3HjgO5mgrIDnYTscJjeTy/xqG9jc1jqoT6HmzP0dOzgclffDOaG2cs603YZcu3t1opgYFz0tOGGIxwIg5PZSderzCsn4dsVjp1oozZXwOip1ACOwPJAk6NlwudftkkitwqX2wiIUEDgHQkJbpTNbmDvGSDmPHJy1bLMJZL9iig8bFLNEvxiX5OHY4/QzsAZDZWgyoM7EoZGdr59zoT40ICEqKi0ntlMg9ee3gkeDDzMMsvc+MiiwMgwZDJGKd6ChkMR+xYEb3UNzJiGVCwgr1p7O3ieztL4leWh1pwez14bJu1f+X3kZea7WbZwKvs26zihvZffLyAehWM9g7IN4GjDEcKMgGz9BYk+hUd30nRUs0Q5oGt12e5jbQop/vE6cY3gp8iysWkDp/kxW9xznP4XWec/MZ6eLqvEITUid5DaBJ9h0IBK80CEaLaTccL2TxBxJDdk3aZg7uzxk9fIFoTBz3NAxIdjuZTZJJRkX5JWGYZpGoW5574rYiYnSNCkElF5zAPv7fSHKtUVBu4/O1iSsgSen/gvjYER7TsK3m9a2tUuBbsP4Qm51tAYRHq1EV+AE/M+UIQbcfqkLHLQcduX8PHRpUSMde19eP6i/VevH9wYQs+ohoeqinJ4LA4IVnthXu3/+0s3JB+ETX1mRYHsySFeISLKj5ywk3Vf4eCVp8/LZf4YSoNSsyO+k7RmdLBO3RkqO2Ytn/0b/F+FOCDm1zBvLPHZey/hAmsK2WINhtx8N4sxfJUCOEzGUOfDde5P249ULpjYhFcuhPxgaBnQ/psU5y6xUdU8AvhBjESHOcn4aSvIorFIdFEAiswzpy/uZfuLHsHf0k X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6734a10f-c3e0-425e-d030-08dc223ea8fb X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 09:26:10.0384 (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: AM8P250MB0344 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/leaddec: Remove unnecessary VLC structures 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: gpSvm0w6aH5n One only needs the VLCElem[]. Signed-off-by: Andreas Rheinhardt --- libavcodec/leaddec.c | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/libavcodec/leaddec.c b/libavcodec/leaddec.c index 4e97479b03..489fe501b6 100644 --- a/libavcodec/leaddec.c +++ b/libavcodec/leaddec.c @@ -38,29 +38,29 @@ #define LUMA_AC_BITS 10 #define CHROMA_AC_BITS 10 -static VLC luma_dc_vlc; -static VLC chroma_dc_vlc; -static VLC luma_ac_vlc; -static VLC chroma_ac_vlc; +static VLCElem luma_dc_vlc[1 << LUMA_DC_BITS]; +static VLCElem chroma_dc_vlc[1 << CHROMA_DC_BITS]; +static VLCElem luma_ac_vlc[1160]; +static VLCElem chroma_ac_vlc[1160]; static av_cold void lead_init_static_data(void) { - VLC_INIT_STATIC_FROM_LENGTHS(&luma_dc_vlc, LUMA_DC_BITS, FF_ARRAY_ELEMS(luma_dc_len), - luma_dc_len, 1, - 0, 0, 0, - 0, 0, 1 << LUMA_DC_BITS); - VLC_INIT_STATIC_FROM_LENGTHS(&chroma_dc_vlc, CHROMA_DC_BITS, FF_ARRAY_ELEMS(chroma_dc_len), - chroma_dc_len, 1, - 0, 0, 0, - 0, 0, 1 << CHROMA_DC_BITS); - VLC_INIT_STATIC_FROM_LENGTHS(&luma_ac_vlc, LUMA_AC_BITS, FF_ARRAY_ELEMS(luma_ac_len), - luma_ac_len, 1, - ff_mjpeg_val_ac_luminance, 1, 1, - 0, 0, 1160); - VLC_INIT_STATIC_FROM_LENGTHS(&chroma_ac_vlc, CHROMA_AC_BITS, FF_ARRAY_ELEMS(chroma_ac_len), - chroma_ac_len, 1, - ff_mjpeg_val_ac_chrominance, 1, 1, - 0, 0, 1160); + VLC_INIT_STATIC_TABLE_FROM_LENGTHS(luma_dc_vlc, LUMA_DC_BITS, FF_ARRAY_ELEMS(luma_dc_len), + luma_dc_len, 1, + NULL, 0, 0, + 0, 0); + VLC_INIT_STATIC_TABLE_FROM_LENGTHS(chroma_dc_vlc, CHROMA_DC_BITS, FF_ARRAY_ELEMS(chroma_dc_len), + chroma_dc_len, 1, + NULL, 0, 0, + 0, 0); + VLC_INIT_STATIC_TABLE_FROM_LENGTHS(luma_ac_vlc, LUMA_AC_BITS, FF_ARRAY_ELEMS(luma_ac_len), + luma_ac_len, 1, + ff_mjpeg_val_ac_luminance, 1, 1, + 0, 0); + VLC_INIT_STATIC_TABLE_FROM_LENGTHS(chroma_ac_vlc, CHROMA_AC_BITS, FF_ARRAY_ELEMS(chroma_ac_len), + chroma_ac_len, 1, + ff_mjpeg_val_ac_chrominance, 1, 1, + 0, 0); } typedef struct LeadContext { @@ -199,9 +199,9 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame, for (int mb_x = 0; mb_x < avctx->width / 16; mb_x++) for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) { int luma_block = yuv20p_half ? 2 : 4; - const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc.table : chroma_dc_vlc.table; + const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc : chroma_dc_vlc; int dc_bits = b < luma_block ? LUMA_DC_BITS : CHROMA_DC_BITS; - const VLCElem * ac_vlc = b < luma_block ? luma_ac_vlc.table : chroma_ac_vlc.table; + const VLCElem * ac_vlc = b < luma_block ? luma_ac_vlc : chroma_ac_vlc; int ac_bits = b < luma_block ? LUMA_AC_BITS : CHROMA_AC_BITS; int plane = b < luma_block ? 0 : b - (yuv20p_half ? 1 : 3); int x, y; @@ -231,9 +231,9 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame, for (int j = 0; j < avctx->height / fields / 8; j++) for (int i = 0; i < avctx->width / 8; i++) for (int plane = 0; plane < 3; plane++) { - const VLCElem * dc_vlc = !plane ? luma_dc_vlc.table : chroma_dc_vlc.table; + const VLCElem * dc_vlc = !plane ? luma_dc_vlc : chroma_dc_vlc; int dc_bits = !plane ? LUMA_DC_BITS : CHROMA_DC_BITS; - const VLCElem * ac_vlc = !plane ? luma_ac_vlc.table : chroma_ac_vlc.table; + const VLCElem * ac_vlc = !plane ? luma_ac_vlc : chroma_ac_vlc; int ac_bits = !plane ? LUMA_AC_BITS : CHROMA_AC_BITS; ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits, From patchwork Wed Jan 31 09:31:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 45922 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:8786:b0:199:de12:6fa6 with SMTP id ph6csp2712511pzb; Wed, 31 Jan 2024 01:29:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBWXVkUCqcgMYW6tAuwdpl6cQS1Ejmqk/XIjkOZqPpi00Eih0AQWfnpTeKSGPuTdnYhI4u X-Received: by 2002:a17:906:4155:b0:a35:cd66:3e32 with SMTP id l21-20020a170906415500b00a35cd663e32mr676821ejk.35.1706693384173; Wed, 31 Jan 2024 01:29:44 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kq8-20020a170906abc800b00a35b2e36aa9si3106957ejb.560.2024.01.31.01.29.43; Wed, 31 Jan 2024 01:29:44 -0800 (PST) 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=ILTIw8Tz; 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 EE13768D13E; Wed, 31 Jan 2024 11:29:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2097.outbound.protection.outlook.com [40.92.50.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9ED3F68C92E for ; Wed, 31 Jan 2024 11:29:34 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Behzsv9XDCCpqN1m1uXR3legz2G0sSJdkgXvc5MfDTPwbBJsazBdn+Qra6L2z7jrNF3dn4LSHKmpKkbI41q0ArVE8FGEh9RwEeNfZ1Afl78N2sgGlJtvTOLlirs7vi1LbUvF4TWePAjQM0zdJr0h7OJOJQEhg3NP5vDqorVpcEWxgndPZmaF++iKoYDNqvKPDMHrXj1FyR3/iADBj1NP5HDFIq93lWV0O2viFCi7iZR9V3kgEmmug+JXuehYjwKMlzGenBROxBkxQxYBJenICAhvWwlF0Ome43XFX0lZsFi3RVqNC+c+VgvqnrNlqgacpjLRjpUdkMHI+Bornfu7nw== 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=8p9ZwfD1+eKrOnT9jzhwAhGILDYS5yP7n8BfhjvqW1A=; b=Ide7+cngxgj6CYUuvPE5hZktMSN2jgjzFk32aTG84HP0w8J1m9cUtMt997toxO6WWmntqe44fALkUhviVQZUmuVje6u+nErCQfQgm2e/LkB4a0YYFcQOyCLP3RC38Zm42qFDH+z5MXUS7ma4Lsww/RvJcPZu1kKir+voVuHsyDguMTdhU/PxlS4dQktKx3/SChirxgGU/737lqM/fUtkGFMhBp0whklN+bBTQmDsqFyEmNqJMExQNuVU/trnsfBN6LFB18UbBcXu/g83ZZK8hE62BOcms4cR59js5Vh5c4o/8c30d/FvP3ZP2AAlNIf8eHq//vT+dUc5oIOMau+xDw== 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=8p9ZwfD1+eKrOnT9jzhwAhGILDYS5yP7n8BfhjvqW1A=; b=ILTIw8TzmjIYihjjZ2Lr5xVwp7+zKRvNoLt82OA26qzE8qZzuTKyr6LgRFIuES2VVDu+mUPN7FQsS6xohWG0Kbl3RZXOK3YYBl6EYJ5Xumc/N2NJgugpW79hxUkjUpNU6BGgPJwLo+HYobu0Kys8icaea3rvLEeqGIlAJqH6XC5Co8escMrWHbSJO33W4ypincx65OH0uDvQiTz86TBwYdcH76NWOjBD++BProFR16sTTrfTABPIGsKScc7ciI/AE3FAiqtWNrCGLw8X3Ge24w5urG81KA2oDj1lzKHje0Htx+0tOK0eJiCC9Jn+YyZVpABxgOtJK3pkj306jMEDRQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0289.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 09:29:32 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7202.031; Wed, 31 Jan 2024 09:29:32 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 Jan 2024 10:31:18 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [qxo/UVAW2+LWC6Sn+mJzpC0JHluS4839p3SSzm0zz/4=] X-ClientProxiedBy: FR3P281CA0025.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::23) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240131093118.749243-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0289:EE_ X-MS-Office365-Filtering-Correlation-Id: 33d2e6c8-ecca-4acc-90de-08dc223f21ca X-MS-Exchange-SLBlob-MailProps: 9IecXKUgicCdh7p5dSsaunIxzpUhwFBOJbQ5dJr2EZHALTy/edbPnq81kgmjzbqtLgFOAucrp5y8WVUF/93xBcpGja42sc66zRfJITBNwZ6OuPx57Nxl3hIaOMydyqnA0fWrmaOyD+85apEKWR5i20S462nhKmcnx0DfMLbPR8a6LvomUDTocQmQx5LsDZmnQqvbLRsj60FZKYxbV7FTkxlk3tCKvI6aAb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qCUl2coCEgi+mauWSDf8+ImfNhKfgxx9eUxfwtLBIe0bMpORBOtSsj23rveBBPHAVJetZpONy8h8+EIut/u9FrMgHDbMWoogi2dD/bDHz9aebk2K5P1cwhNgCYuTeIDGkLta3C3iZ7NNSnder7suDf0wOSCc1r/N39FHfJ6+kruJooQ8d6jtARvcjF98DDniGTYwrzeJChDC2o4J89VExjZsAh31seHX2vkOGMSClN2vPgDkwtXG3qm3dFncD5vdqxVr5eg5qcH9zLjUFITt08Z4bG7EXpTCH/41tq9VVIRiq9VkbfxiKCDOMK+mFfHeEJnHYuoI3FdLY1XvukUv5U0EocDT0X7Z8RYhlG3Hx80bxi22IK6rCGZeaej6nFQT7Gu+BSD X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33d2e6c8-ecca-4acc-90de-08dc223f21ca X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 09:29:32.7048 (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: PR3P250MB0289 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/vlc: Remove unused macros 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: lZAd970br+6Z Signed-off-by: Andreas Rheinhardt --- 1. This has already been sent months ago, but I didn't apply it because Peter Ross has sent patches that make use of them and I did not want to force him to adapt. 2. I do not rule out that there might be scenarios in the future where creating a static VLC (and not only VLCElem[]) would be useful, but this zoo of macros is nevertheless too much. There should be only two macros: One with symbols (i.e. "sparse") and one without, both having options for flags. libavcodec/vlc.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h index 679666801a..0cc106c499 100644 --- a/libavcodec/vlc.h +++ b/libavcodec/vlc.h @@ -185,47 +185,6 @@ void ff_vlc_free(VLC *vlc); #define VLC_INIT_OUTPUT_LE 8 #define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE) -#define VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, flags, static_size) \ - do { \ - static VLCElem table[static_size]; \ - (vlc)->table = table; \ - (vlc)->table_allocated = static_size; \ - ff_vlc_init_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ - flags | VLC_INIT_USE_STATIC); \ - } while (0) - -#define VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, 0, static_size) - -#define VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, VLC_INIT_LE, static_size) - -#define VLC_INIT_CUSTOM_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ - VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - NULL, 0, 0, flags, static_size) - -#define VLC_INIT_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) - -#define VLC_INIT_LE_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) - -#define VLC_INIT_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ - symbols, symbols_wrap, symbols_size, \ - offset, flags, static_size) \ - do { \ - static VLCElem table[static_size]; \ - (vlc)->table = table; \ - (vlc)->table_allocated = static_size; \ - ff_vlc_init_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ - symbols, symbols_wrap, symbols_size, \ - offset, flags | VLC_INIT_USE_STATIC, \ - NULL); \ - } while (0) - /** * For static VLCs, the number of bits can often be hardcoded * at each get_vlc2() callsite. Then using a full VLC would be uneconomical,