Message ID | GV1P250MB073765981E8834358C8D1F0D8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | 25b9ff2780fdf1fbce914aeb68e77699d47147b6 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a18:b0:15d:8365:d4b8 with SMTP id e24csp2210423pzh; Tue, 26 Sep 2023 15:21:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHa6X9WNp2bkF1iPck6Ua3p7Ovw1qKgvnERC29hyddhLOyq5u8km6mVAKjoo6QaKUdvEd2v X-Received: by 2002:a17:907:7891:b0:9ae:6d0:84ee with SMTP id ku17-20020a170907789100b009ae06d084eemr54858ejc.28.1695766890760; Tue, 26 Sep 2023 15:21:30 -0700 (PDT) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h11-20020a170906590b00b009a1a734e015si13147032ejq.1016.2023.09.26.15.21.30; Tue, 26 Sep 2023 15:21: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=h4UaQvfr; 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 C4C8868CB29; Wed, 27 Sep 2023 01:19:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2102.outbound.protection.outlook.com [40.92.89.102]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B14868CA6F for <ffmpeg-devel@ffmpeg.org>; Wed, 27 Sep 2023 01:19:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YF4BIfBpxtNkOO1Ot/0ZAlfA0oemK5Wv+K22Mz1YVLA0N0FCJTyMV5dMze/u16wC0H+O+ssu884UNzds/YSqmrGlDJuootkQV++aQ+7rlmKo4FcN3IObZLWM8ARWJrpVtOXVRutzww9ahIf04ftyjY7PlVIQMJPqfraQrp4nsU0AVKQjdBpi3GcQ0zaz+MLc3A35tSuUlbzGOpapQPn/0unZPow3X9oEL0k39VJ3U7svge+21ObyKFhZOfiTGuPO1IaenoC+TVcnG7XvQ4oEmzKrFp/gTvmzoFv7uzza0fONj3D5hQMQQZW+sbcfuZ2lxT1W9BzfdsO5XV0KWsgZpQ== 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=Q7XnqIkJbQH0vShnCGmStnQgoDuX3IPFadWTrYF8Kok=; b=eSgyjxpdDptl7o/XRSzTi9FlM5InBdBb4APWqnspVNiFdi0gh+lRCFHtrCa5P92BH9c4mdSwgDGpYXU5Mzo0ydp6jWhJ8JowCdcgDVBEvIi+Qix/uBmf14QNXuQro4IJ6aQ+bO8hsE83mm6QBiS/+KvcgRUS/iVvJR41gfMJdvJtcQRBDhb2eoPXbnSJcXxF28s0TzZeb/87/ug8l24j3w8dKBx3h4qh7NQ26yH/j75iJAFfC+1Bosyderv4B0OjPygjtHMsqdCH7067sAMxfv/tDjasqG7HKaQSKC/XfvNP6kcX0semcL+9QVvCHcHJcf9/5ElnKCzARtLB7XzLmg== 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=Q7XnqIkJbQH0vShnCGmStnQgoDuX3IPFadWTrYF8Kok=; b=h4UaQvfrVVPpUfs73PXNncFgH02b9YQIt9oIeaJgPSWFTWoDwF4cUTFabzPnqtdGtXiTwY9tJsvht8TfTR7pQAQd+Fz8olUB35TEVPtt9RR6D8orOLF97EDNPBYGdH03WCR/lCA/AvT7RyJYaGIPf3E4hxRsaWXxihQfHk7kPVoUwvLWpMqJXPoBn4SjEk6ZXYbcijFFmFwIQp66Y20PbHywI2mq99RzR4hXl+gAaA5lW3EH2PPgg9gAOdbTkXftqILIylA4WXbmZClYsuKhPiS34NmLBb4NMEACpgTKKK4SVd3hFM+k+FsQTdBT2zTe0LPFkTGAzeNqjGyDr6p3BA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0393.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 26 Sep 2023 22:19:22 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a%3]) with mapi id 15.20.6813.027; Tue, 26 Sep 2023 22:19:22 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Sep 2023 00:17:06 +0200 Message-ID: <GV1P250MB073765981E8834358C8D1F0D8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.34.1 In-Reply-To: <GV1P250MB073754E215A199E7219CC13A8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> References: <GV1P250MB073754E215A199E7219CC13A8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> X-TMN: [lecfOfoZ/ESEyBdvjpHt7A86Yw/StKXw] X-ClientProxiedBy: FR3P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20230926221732.3711507-34-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0393:EE_ X-MS-Office365-Filtering-Correlation-Id: ca643b0a-1c02-4e56-bcc2-08dbbedea24c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pIb+eS5nOYpDa+dBWEZS6Jllb/U3MLuTiSg847SVa2DT3TyMLx50wY8IgVc1q1Wtb+fGO5b1KqBdXNKOkT9poiRwfv8kp3+S4ARpB5ZXq5KW8vFDy9IDQ8goDK2/uxNq3HMgSVEwBj5u2ZhSPi+Xn+c7y0zV8+bNW1v4+izoYeOjWhNaT0I7CZTnI2nIdBLki4PPejMCseTpZxbSHZCmUl9GzsTd5Bj/Ee29ierAIIM5mLLs9KFcIAbCqd0vzrQhPT/iBjimfOBP/ENimw10+V+ymkAZj52V7Qbo+zwHFfFwP7p/uGIhi6CvIzodcbHg8cC1NnMC0VFkPYor3ob8Js3gEMVnMI7G0soTOcZBaNol41tx1Wdd8P28XCNtwuceNojltdFFxlzHMOEh/v5ruUeApIdjRZPk9Hmj3ZjXJ0oyqczK1uuqcI0ku6JN3l7MFQF/z/IGPHi5Wy0M4b6ViLNbPZgBGC6Yid6ooc4m9PA/kS8sOlLb1naphgZZ78LoiJ2OY7jNpoQIKHRTW+9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Ymavo3kzbtIiiUryQ0X0mIewy+9me2mgt6rvgpciK/Q1uoI/4EoQR3YmSUxADXFuSpdO4ID0oEJbO3jMa44i2KpJKVgeBYw81Z214IPRLLd0pg3FcnarxAkaeQ6RBR4iY9pVaOYbcPrErb6EiLujamtMA55O/3ENWW/ESS/QgvLm8Ysg4mh9VE0dDODAZUPyS8IJTdT7faKF7VvC/XMmd2ShMyfiBwJvYbI1y2cISwHDR5g30avmwUspIVfPZ9jGAjljRvD8jrUniWmFgvF+YkLWaBVC265t3XpFBWKlNQbuAmTpYiSGlz+XoAyfE9BP85qs3tFPTkEvvtMn7l4eLV7WlIiAWT/gQ8PqyEczF7W/7tlr2tKsRi6lLLm3ScT X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca643b0a-1c02-4e56-bcc2-08dbbedea24c X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 22:19:22.0173 (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: AS8P250MB0393 Subject: [FFmpeg-devel] [PATCH 35/61] avcodec/4xm: Avoid unnecessary VLC structures X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: Iu6AxGQFo8LQ |
Series |
[FFmpeg-devel,01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC
|
expand
|
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index c3e3a45df5..158b37a38b 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -125,7 +125,7 @@ static const uint8_t dequant_table[64] = { 20, 35, 34, 32, 31, 22, 15, 8, }; -static VLC block_type_vlc[2][4]; +static VLCElem block_type_vlc[2][4][32]; typedef struct CFrameBuffer { @@ -250,17 +250,15 @@ static void idct(int16_t block[64]) static av_cold void init_vlcs(void) { - static VLCElem table[2][4][32]; int i, j; for (i = 0; i < 2; i++) { for (j = 0; j < 4; j++) { - block_type_vlc[i][j].table = table[i][j]; - block_type_vlc[i][j].table_allocated = 32; - vlc_init(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, - &block_type_tab[i][j][0][1], 2, 1, - &block_type_tab[i][j][0][0], 2, 1, - VLC_INIT_USE_STATIC); + ff_vlc_init_table_sparse(block_type_vlc[i][j], FF_ARRAY_ELEMS(block_type_vlc[i][j]), + BLOCK_TYPE_VLC_BITS, 7, + &block_type_tab[i][j][0][1], 2, 1, + &block_type_tab[i][j][0][0], 2, 1, + NULL, 0, 0, 0); } } } @@ -357,7 +355,7 @@ static int decode_p_block(FourXContext *f, uint16_t *dst, const uint16_t *src, if (get_bits_left(&f->gb) < 1) return AVERROR_INVALIDDATA; h = 1 << log2h; - code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > 1)][index].table, + code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > 1)][index], BLOCK_TYPE_VLC_BITS, 1); av_assert0(code >= 0 && code <= 6);
Everything besides VLC.table is basically write-only and even VLC.table can be removed by accessing the underlying table directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/4xm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)