From patchwork Sun Sep 4 21:54:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37654 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2273312pzh; Sun, 4 Sep 2022 14:54:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Hiifwg6HLz+aRie40iIsVMYzYdw2FsMnqT+ao8WXgAKg4OdElyfPDgcSN181wtkeyPcip X-Received: by 2002:a17:906:c14f:b0:741:8888:dca with SMTP id dp15-20020a170906c14f00b0074188880dcamr23675040ejc.245.1662328481968; Sun, 04 Sep 2022 14:54:41 -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 g7-20020a17090670c700b0073d615565fesi4645653ejk.494.2022.09.04.14.54.41; Sun, 04 Sep 2022 14:54:41 -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="E/dr8L1V"; 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 18E3C68B8C3; Mon, 5 Sep 2022 00:54:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069044.outbound.protection.outlook.com [40.92.69.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9C81468B545 for ; Mon, 5 Sep 2022 00:54:31 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iAUfD6Eylfi/l7+IQHI3faQefB4A4a0bLtYEEL8DZRh9I4psVfl3MEBtr7857HNhkjZZRuqbxhWa7BqPOU3TrisfvjVGXEDRniM9uagVEuX88XzOiloDIVm41cdT92srrxK0ttO1AupzRgHqXXt81vC2lWQP7OYl9ehiARI5WAq2kYc+y1ta4OWlJDK6K48MSePfqQXK1S+VjO6Uh47Vz+4EnOBMej2ulpiQLLurvJCi40MGKRiaMHawOeOsRs8U46o3EYW5jnnRg7VW9OvLUmgM3aYZpJpKVy/o87uuAC5HSNIIF+ZZBKktBL9cNcjveNprF2vF7OGXpNrxX7J1Gg== 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=Y+5d1dWYVD987flezXzraj8jgPRS6BFM6mZb9q5038w=; b=h8CJ9HNpHaFG7lY/h5UD/erGAwkkFMg7/xk5i5IBnb1kH+L7snB4/T9ZDay6T1oYPswLPrOFRkI6guVee4p5IBZDQmwpisVZlvJQv9U5PuGZT4MU6o/YP5F/cYgnMiQ0T43z9CdpR2AN2U34IeXSOTO3MxReEJB74Ue7GoY0Z1H5pcOzoZGidGIZaGyJq0TjJUL/gZoHqFpVKb73PoUt7RK6pR6m15Xq/ROyNn92qQg9NcyVmGU6dnQUytwRr4YSXr5D6TdDAFKE4d7odmyn60dsrrQ9Iacmj06IlkjseDP/FX7Of02FS7653FEroEeuyJ4BplQbBAtAi+wV/pw7Xg== 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=Y+5d1dWYVD987flezXzraj8jgPRS6BFM6mZb9q5038w=; b=E/dr8L1VyB561mu6iwLPoAPDuyAnttCgDULuuD71tFv2ymuWARN6ciONyIUGB4MmbKchBPsabRYC1+kZDHStIcU1fATNwpgByXaAZ+ppU5JIclZK8c0qhbuMGGEds0qCfZyWOFIwmqbukiEXxjVdEsTBWn6Ut91s0OFsW2UJna9YwWZWLhpMG/IrfhbXLG5ui2n+0GogvPKpvGuzEsValxTOrMtyqB57bVQIthQHXXM12TfbuunYpp0M8+yX7WyOYpSj6o0AenXaIJI8mFE6WoFl+3cO9yHdX3aBsJ2TweI3bmC9nWgONLS86Wzo/aMijXQKX88jpW9sB9NbOzyoHA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB0746.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.15; Sun, 4 Sep 2022 21:54:30 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:54:30 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:54:16 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [NgQMjht1g2nOGo4DVRjOLZj4M3NBwIz8na0JcKuSB0I=] X-ClientProxiedBy: ZR0P278CA0120.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::17) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215424.3671647-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 766dee67-49a4-4958-28e4-08da8ec00b20 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpOESH07gTfyFtwl3n8uZhuc/8THYfvUiJPnjZHXCzOj0aDbsU5wpKemw5cjNNY3u/H8yJg5vCHRRP8rmOzzKl9xNToiF3nTWMIDvNLqiEbG9hMA9lFPE/3eJU21p9VzByut2k7WxnMTNXmNHD0xNMsZ9oEvzbhk1SFRLCGP9GxZ5NYN70m5U0pVN7jwGtpqpwMCehBvXU/NwCV4nYDqwt79dhS8+6bVkfHE5sHDBf5So3MTTbEs5Qs8qKVPpheXy9RiiicfO77VWQ9awwwmxF7Yza7Mu3wUGvZ7Y0ErE+hMeWYM9Xoy+FZXOWtEWyke1GuE2evEKG0Em8oQyihbdnDPRThLi/AVy7GgXsXUM2UdGz3IXJSNOlwyZWLjQNrUaPEIMYk9nH5I25yvQw7PNiTQcbsmUcvErQkmctfGmnHNy5a5/Yq3UMB8uUAVXWD5+T5EyJ01Y2iUzIrGe9rQKtUowUaf9wVDjOf+TYHJxxfRlKVc0T5Qnfw+8JDi4jpNccZ3qSFHYrQTogIi29RgQ16/KSexzTpGDWMVR68zlXABXcBop4Ngrw8a8SDJ9gtubpOw4Umdba8W0WsAWg4g5amk0hwMtTMcUOP0hTUrT1r58XNG4xrjk4pSBZQls1VFv2kUlb9DDWMLp0yi2HfrGQwHMPgX68biglfuvYA5E39Xnf/AbIX8N1jEicXxMLazz5nDP7jXZ2HSD3abqTyaUOs+TOTsTmaGNlJa50Rd9A6mx6IbBAdvAS78UVDvHWghC4= X-MS-TrafficTypeDiagnostic: DU0P250MB0746:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G+d8/Z0ussBhE/mLD+Djok/yvcpXMoHuC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ez0O8sVWnl3OS5NNhw8z3WlJGnibWfNuxc7G+FxBrtE21U/qiLRvrzDwQ27V42wouuQJBNuDTobCsfjrYvcD3/iKYCO4d1pV1w3r2nvkHNNIUcA0BNrhvVOp8BUDpMnQnvGPFGiXrlv7CS7pR252GAZf1l7KTajxQ48oHVs1JXChaaPIbA890zQcXVLW8ApNx6ui6qi1RM9OuRbdEGgnBij+2jaoi6JmrZwpjNJMplXwMbfEPELxYNsAlCeHYuQCoxewiz+YhAap48g2W9C6NXMBi4N0b5ev0dyqGmmC9iDj3J0K1oL6q+S5buaJJ8LmqcG5suo+0W2Gcyg3WmVefLDPiK7gAbbkTFYDIgEIX2dNxCG23rAON9FUt5bkzkCPC42bBsRPdL4JS1ANicxIAzOtigKqaFb/29rklvpsty04+7BEtrcczQHW8NV9Xlil5Rg1IbQze7dLDiRKys482gsk87tOaDBqBcEK9iHG2MMecRX+u/ojhmXsqTz7nR1PCzV2qF/AOa1I5OtZObfLpQlip7kolByZ3CUd+Aw+uq3nJoyrdKoumFHcxXVeI8K9Ohnu6r6B1wn+x8WXrdUMe59SmbYY5uuspzt6eixrLivQpwVEgjgVefDAfvfuWMZ4uyyZJgnIBnGx8tYlbPP4TE21FAOE3Vap25sjYt3lvznN1fUPzhPBKIJdon21X5egb6Z5sTL0M7880fkv/gfjw8fGE/FnFBJ3pwwdJcOxif1V5PcDmBXraAFCzanzacS22NjjE8stnYZcRWYnvtfmrnUD9EXf8v2oSBhMZToazLyw8fK4v+fadhwQ2JZiwE+AdScKuqRbJh2WJgcYAF9EjYFgt3DQU9P3R7jUgLmVS5gv7pNutI4kIVZOxFzk5QghQDzhiNvVf6hvXmIVisgiFt4CC7VndCZmYkdsMdpdtKYA6RYjKBqeFwuhH X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 766dee67-49a4-4958-28e4-08da8ec00b20 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:54:30.0367 (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: DU0P250MB0746 Subject: [FFmpeg-devel] [PATCH 1/9] avcodec/dvdata: Order code table by codes 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: u8Ovc43Ukn9p Right now, it is nearly ordered by "left codes in the tree first"; the only exception is the escape value which has been put at the end. This commit moves it to the place it should have according to the above order. This is in preparation for further commits. Signed-off-by: Andreas Rheinhardt --- libavcodec/dv_tablegen.h | 2 +- libavcodec/dvdata.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libavcodec/dv_tablegen.h b/libavcodec/dv_tablegen.h index 941b5572be..0dcfffc140 100644 --- a/libavcodec/dv_tablegen.h +++ b/libavcodec/dv_tablegen.h @@ -51,7 +51,7 @@ static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; static av_cold void dv_vlc_map_tableinit(void) { int i, j; - for (i = 0; i < NB_DV_VLC - 1; i++) { + for (int i = 0; i < NB_DV_VLC; i++) { if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE) continue; #if CONFIG_SMALL diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c index 231569a328..1e48db591d 100644 --- a/libavcodec/dvdata.c +++ b/libavcodec/dvdata.c @@ -75,7 +75,7 @@ const uint8_t ff_dv_quant_offset[4] = { 6, 3, 0, 1 }; * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82. */ const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = { - 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, + 0x0000, 0x0002, 0x0006, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, @@ -126,11 +126,10 @@ const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = { 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef, 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, - 0x0006, }; const uint8_t ff_dv_vlc_len[NB_DV_VLC] = { - 2, 3, 4, 4, 4, 5, 5, 5, + 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -181,11 +180,10 @@ const uint8_t ff_dv_vlc_len[NB_DV_VLC] = { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 4, }; const uint8_t ff_dv_vlc_run[NB_DV_VLC] = { - 0, 0, 1, 0, 0, 2, 1, 0, + 0, 0, 127, 1, 0, 0, 2, 1, 0, 0, 3, 4, 0, 0, 5, 6, 2, 1, 1, 0, 0, 0, 7, 8, 9, 10, 3, 4, 2, 1, 1, 1, 0, @@ -236,11 +234,10 @@ const uint8_t ff_dv_vlc_run[NB_DV_VLC] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 127, }; const uint8_t ff_dv_vlc_level[NB_DV_VLC] = { - 1, 2, 1, 3, 4, 1, 2, 5, + 1, 2, 0, 1, 3, 4, 1, 2, 5, 6, 1, 1, 7, 8, 1, 1, 2, 3, 4, 9, 10, 11, 1, 1, 1, 1, 2, 2, 3, 5, 6, 7, 12, @@ -291,5 +288,4 @@ const uint8_t ff_dv_vlc_level[NB_DV_VLC] = { 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 0, }; From patchwork Sun Sep 4 21:58:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37655 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274557pzh; Sun, 4 Sep 2022 14:59:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5K0Wvugq9bp2rZwiI4pvJZtlQTztBplDH0J7qxmght4kTWTqxqpx1Z0ln8TBUi0ZCJ38Qs X-Received: by 2002:aa7:cc97:0:b0:445:afab:2634 with SMTP id p23-20020aa7cc97000000b00445afab2634mr42110053edt.54.1662328750356; Sun, 04 Sep 2022 14:59:10 -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 g11-20020a056402090b00b0044884549409si7889792edz.356.2022.09.04.14.59.10; Sun, 04 Sep 2022 14:59:10 -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=ggKFlKdZ; 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 67CD968B85C; Mon, 5 Sep 2022 00:59:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069046.outbound.protection.outlook.com [40.92.69.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4609068B864 for ; Mon, 5 Sep 2022 00:59:00 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XCHwmZ1+YzSQEDPhHCmsI5+NgeFhYdmEk0LTCbkui5GNnB54AKwm7VCjYxjING9BWxntbYgAy91sX9HxarN/jHJvgeZhp2wuJZTa/Mfq3jzdNbgSZp29+FJFhE1rGOSrceIJHAOHKSbPepj9Ssy12dUbNflCbgeJaQp0KKXG/+4ZH+HJI19EqlyAuHTm8h6gYWAtZAaZMD2JKDgdl4PV0gWsJtCjjkwMxSL/MoJxT3FW53jUwrxBDisxTsO7uMxl4DKnXcujS7dM+klu6XZBO+4UUfvm/fCeRaE4JHMhsT/g+G8yQdnmdBoeZ6fabG+yHDErP3/ht7aT3/GeRc5vpw== 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=bJ4btNdvlgoKrPhicAf3i7eKHNc8rMxOhNKNYqO1O0g=; b=Gz1PjNIBoq41wwn603GypKreQ976O1qwdaGwZVSYysr9JKOcSwlh8WyRIJkzyU1gzSvZnZqr1u9lcUsgUIVXSLGPfRGh88dll82/MIWEBxEAvM0/xPQHvlTNclEkzSQJ8Zs2x9c5AkB1L6zXQajnnoZAIK+ezE7fWJfofxdGHihOm5liVvqBqoY0v4yBvSJiZQTg9z3GfRqTXhAmutRErdls1joTFuEp0UtS0N21lZzw+jhYhyIQtSluYf0yxw2NpDKD4Zvj+FiH6GQWl7h/ERxHugumHJGNOzYA7EzbTd5JBYickBDCxrVq+aZhz43zo7MezRT0c/KzMdu7EbBpcQ== 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=bJ4btNdvlgoKrPhicAf3i7eKHNc8rMxOhNKNYqO1O0g=; b=ggKFlKdZdD+b+0TtSJE2HewclXQDjQpSAJgppBAZ1FsZUbSwK17/6knR19xR96pSsZJbOn2TAXj7OM+Jh6INFRw78Sugs03XYfGVZIoRmI0NnjUqzKhiSrIVDheoK3ayrq8Uw55o6P4NwYOnZBudlHe4Mzry2PeRcNjSVxTh1Yuk9GWtWjJa6+xIS/5X8x9s/00t2UYPISuhHlIghR6bQBBsFj6bambQbZD82fcVjnIrz8SLRLPUrWeD3FIjDLLARi+/XA5luh4Xpul17COP/DA0O98jhtoovS9LIGa8wUU4HmNwVGdRYhnW7l35mTEgIm0psIYx1KGYmjpDnFSPLg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB0746.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.15; Sun, 4 Sep 2022 21:58:59 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:58:59 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:44 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [EwNbIp06dBdZomTMl86F3vcmQrex2P5R6MiMPQjpDbs=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cabf6cd-7120-47e8-953a-08da8ec0ab73 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpOESH07gTfyFtwl3n8uZhu52FjHdiGs3SIvo1opaJReB7IK8y7GHMP2lHYYtM07om0bqt1ZkP5DoNLwtKnfpAXUh5YIHpbyyJtp+750YwebTm24li5dNko5MmhK3qcfk2zuN4NnbzUk6qdRMB+Wz+f3GnODVJ/Dj7uM9vz0bi1REfuQxgX+yLC6uXRpNjqEB30+RJJ6IcpdjQMJELYziIvpLmjFgf+cQqL2DETImSdyfXWWLkUEVVEcowOHm6cHTOJecVT3Sg0RiCNgrWc9R0+1zSzsD7plJLXax825y75Gm/aDWqGukd9yEEZNDrlqu9PrKPmzzS6fZWFMG+/p6ZJKMmf5NQV3QqQ2ntNFTTz1+qaRuRKe4u2P3Qigf8Eeeln+1KaIcI6k7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byYFHJ4krkyGD2oZU7n+AIinNF7QGi/rVay5Y7yMW3VuK4Qq3j70Sd2l+DxymJy7dMq71uXzGKCzHDJb21VdCj80rVQbn33KgrQnKUaiEjLmKhmnTSI5hACQ//UqTdccwO/U8oxhh9/UynCnfloJcjJ6Hf1JUKZytHXtKyAmQdyjq880UlJFbOwANbygvWgESYP+3cvzLnGAPtbj7Fq7NeZ/o6/BaKz/DzLy4TAwmZ74ZJ6nJwBV6NYZm9QeOiQg0IB4hFsZkFKPVaJU5ZlZhEDNpw8A0kYbk4bFy3XQlPyhMQcflC6kLKyEDJlSoPvCWWKnU/WrhauqAKawYimJyTL9mQQisbWP X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cabf6cd-7120-47e8-953a-08da8ec0ab73 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:58:58.9877 (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: DU0P250MB0746 Subject: [FFmpeg-devel] [PATCH 2/9] avcodec/dvdec: Use ff_init_vlc_from_lengths() 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: U0Yj5dxD1pt5 This is possible because the codes are already ordered from left to right in the tree. It avoids having to create the codes ourselves and will enable the codes table to be removed altogether once the encoder stops using it. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdec.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 3af3e82eab..8f68d2715d 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -137,7 +137,6 @@ static void dv_init_static(void) { VLCElem vlc_buf[FF_ARRAY_ELEMS(dv_rl_vlc)] = { 0 }; VLC dv_vlc = { .table = vlc_buf, .table_allocated = FF_ARRAY_ELEMS(vlc_buf) }; - uint16_t new_dv_vlc_bits[NB_DV_VLC * 2]; uint8_t new_dv_vlc_len[NB_DV_VLC * 2]; uint8_t new_dv_vlc_run[NB_DV_VLC * 2]; int16_t new_dv_vlc_level[NB_DV_VLC * 2]; @@ -145,17 +144,14 @@ static void dv_init_static(void) /* it's faster to include sign bit in a generic VLC parsing scheme */ for (i = 0, j = 0; i < NB_DV_VLC; i++, j++) { - new_dv_vlc_bits[j] = ff_dv_vlc_bits[i]; new_dv_vlc_len[j] = ff_dv_vlc_len[i]; new_dv_vlc_run[j] = ff_dv_vlc_run[i]; new_dv_vlc_level[j] = ff_dv_vlc_level[i]; if (ff_dv_vlc_level[i]) { - new_dv_vlc_bits[j] <<= 1; new_dv_vlc_len[j]++; j++; - new_dv_vlc_bits[j] = (ff_dv_vlc_bits[i] << 1) | 1; new_dv_vlc_len[j] = ff_dv_vlc_len[i] + 1; new_dv_vlc_run[j] = ff_dv_vlc_run[i]; new_dv_vlc_level[j] = -ff_dv_vlc_level[i]; @@ -164,8 +160,9 @@ static void dv_init_static(void) /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ - init_vlc(&dv_vlc, TEX_VLC_BITS, j, new_dv_vlc_len, - 1, 1, new_dv_vlc_bits, 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, + new_dv_vlc_len, 1, + NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); for (int i = 0; i < dv_vlc.table_size; i++) { From patchwork Sun Sep 4 21:58:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37656 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274622pzh; Sun, 4 Sep 2022 14:59:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7pTS2yLW3eBarYHgr0P2POnLeNKPs0DHHJF6BrZtTakfBUnvm3diNcXD4/p02Blfpp0srH X-Received: by 2002:a05:6402:2744:b0:448:8488:9857 with SMTP id z4-20020a056402274400b0044884889857mr26971039edd.324.1662328766114; Sun, 04 Sep 2022 14:59:26 -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 qw29-20020a1709066a1d00b0073d82c96367si6147300ejc.360.2022.09.04.14.59.25; Sun, 04 Sep 2022 14:59:26 -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=Q5TEMl0O; 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 6F46C68B96F; Mon, 5 Sep 2022 00:59:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069055.outbound.protection.outlook.com [40.92.69.55]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA80C68B898 for ; Mon, 5 Sep 2022 00:59:15 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bJ3N3S/R0SHGrevoBnrsRc1zC3es1gT4PX/4LC1efWjhWqrkmR1Sscee/NXf+21QWMUA8722KoYs5txXYV4EeZwYtD2VBdfynDPwhZEiXEQUt+5eqebZIJly/yN7uuy+IhJlQM4ku7i79Bn2ilCNQVBwScSl0JKDghASl89Q8mdZaV5O7UF1QtVgDLxCM7R5Wqg7g+efnL+NIlex+aGiFg5n22fMaKWTwwZSdxAUE/o9rKSlYpNShgaI/5g/TOT6mn/bG3yjm4QKNlpwm53Mcb4vzf9MehtIGZ7drpg6VFfe78YhWnXl0zjaHHZ0ARegWEHHzOGnTRqGXc62OnSeQA== 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=Fgyl1cUHiGTDC2OIn2iS8MimLlW4Zs7cvSqZCVYiig8=; b=CI0M01qPYBPaZTVLqVGCDXB5f+Sb/+UJCA8WE7xOVKoXzWyTK0Pi6VYpZBFT+QgDaJexn8apyfovhMpnCWOl5yUAWlWTtjYaUdOaMRLmeDDHocukhJDWCNCADbG6LodYztXvm0DbNBVjlTZK7A47iE42kRO0YmsYvIksivohRB8i0cX31ZgLJ37CG9poI2QlJQvdbCs/PtVaODl7j/+e1QOUZGcqntTa+7lFPJKsK065njdzm2iOXwIowFkwpKGSwUUU7zfEiXuhwi9hxmRtqoR/LSs4AsXNwSyX/0zGWn0umL0ltHAGjlt45hXjMyP5uLgp5KAdg0I93ByYKxEvnw== 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=Fgyl1cUHiGTDC2OIn2iS8MimLlW4Zs7cvSqZCVYiig8=; b=Q5TEMl0O4D/OlqIHFFmHt+lQxnoXdNZ78vC7mh1yVNY1Fh4buGBnT0chn6VpSAZoObefi9Jd5b5CQxyK5/mJzay1UQSgPoWT13Pj5NUXy0uUjJ4SKor0fjlBl9hAKluwxf/bZHj6+NCe5SUmceoMwqNEIG3wYMEZtNOzgH/WZ2P7RtB4vTLOM+KzkSDJ77e0j+C0gIYz7WF7D9pSGvkojk2JMJdzRKhdmNmkX8On5iPEbbyDFYsR3lgnRVAbmjN0VY01SaCyajd2xEM1azJEO6WDIBHzbhBIWlmQPaTBbT+zwKmsT0v1O0BX1QBuuZSvL5het9mfLeD3w+mtf+t1tA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB0746.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.15; Sun, 4 Sep 2022 21:59:14 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:59:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:45 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [nh9qpzB1F25/rbXVf3hHzuKoOImoiuCjcuILHAX5FXU=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd79305f-4647-4236-dab5-08da8ec0b4d2 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyWpuw8QwNKb6G2Lo6Ie5VppVUPywKuP7ZWeUrQpp0DW+VCDZaEcHeDK7GMzGCherIeD9vyNmN2x8xJujgpEdRjLFiYOai3knChlLlO1fmR5oz4T5FQlcWh0yv7fuq2eKosmee0j5vbUMgYDBB7PAHz8+nm7Etbrl0191jFRM+yF3uAf7XtqcAoL2AnYZ1z/XAb2VY+ua+rd9xAX0DXFg+Zu34YRVaZ+HD+MpR1Rn/6XXFxDAjNBJWmlWxuGAgj8v0g8VKyJcw3RwIu2D0uyfOQBTP0U9xPgXwl6LWSofWGqvxb7UvDgiKlHq/EuvtSwluXRenUtPZ1XBGrEYbffdjagCjpzcWiQ9M5J9xNkcCz2mrxCuBr595PGFujqqtpSKsWPF8M4z8WpcwjoxCxj4b7oEb/hROOtbQGn2ArEbkrsqpwBwkjux8i4UJsUya5102MfHZv+kCJzY1GnbypusyxfOmSedaXnM6KlqLx6IOlcA0LXxWeuY/LXb90HGDWZ5O7bQn8Z7zTkQqC7jV2+u96CtTR0BbMYLtcPsgGBgsthpBOQnASK1i2hOJz6aUSYsOaZNWuBQeqfZieOv8Ye8KoQr4QZR5SBSJ20GgmtkbA6bABFRK27657qAVQe39sa7yueJIL0atjv+49UUmhbubIBwSgf0YsaZh2qHbbjfl6EKbr+/J2Bq39nXzyJ70FuGvu6y8spu1XHRoFtlzJahEuzS1w+V90E5Q= X-MS-TrafficTypeDiagnostic: DU0P250MB0746:EE_ X-Microsoft-Antispam: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id: fd79305f-4647-4236-dab5-08da8ec0b4d2 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:59:14.7115 (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: DU0P250MB0746 Subject: [FFmpeg-devel] [PATCH 3/9] avcodec/dv_tablegen, dvdata: Remove ff_dv_vlc_bits 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: vA1YjA2zbUCa The codes can be easily calculated, so the table is unnecessary. Signed-off-by: Andreas Rheinhardt --- libavcodec/dv_tablegen.h | 5 +++- libavcodec/dvdata.c | 54 ---------------------------------------- libavcodec/dvdata.h | 1 - 3 files changed, 4 insertions(+), 56 deletions(-) diff --git a/libavcodec/dv_tablegen.h b/libavcodec/dv_tablegen.h index 0dcfffc140..7f0ab53fa7 100644 --- a/libavcodec/dv_tablegen.h +++ b/libavcodec/dv_tablegen.h @@ -50,8 +50,11 @@ static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; static av_cold void dv_vlc_map_tableinit(void) { + uint32_t code = 0; int i, j; for (int i = 0; i < NB_DV_VLC; i++) { + uint32_t cur_code = code >> (32 - ff_dv_vlc_len[i]); + code += 1U << (32 - ff_dv_vlc_len[i]); if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE) continue; #if CONFIG_SMALL @@ -63,7 +66,7 @@ static av_cold void dv_vlc_map_tableinit(void) continue; dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].vlc = - ff_dv_vlc_bits[i] << (!!ff_dv_vlc_level[i]); + cur_code << (!!ff_dv_vlc_level[i]); dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size = ff_dv_vlc_len[i] + (!!ff_dv_vlc_level[i]); } diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c index 1e48db591d..0cd10aed10 100644 --- a/libavcodec/dvdata.c +++ b/libavcodec/dvdata.c @@ -74,60 +74,6 @@ const uint8_t ff_dv_quant_offset[4] = { 6, 3, 0, 1 }; * between (run, level) and vlc is not 1-1. So you have to watch out for that * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82. */ -const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = { - 0x0000, 0x0002, 0x0006, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, - 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, - 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, - 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, - 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2, - 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea, - 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2, - 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1, - 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf, - 0x0fb0, 0x0fb1, 0x0fb2, 0x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 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7, - 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf, - 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7, - 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf, - 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7, - 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef, - 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, - 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, -}; - const uint8_t ff_dv_vlc_len[NB_DV_VLC] = { 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index e0ed043c47..ae104096ad 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -28,7 +28,6 @@ extern const uint8_t ff_dv_quant_offset[4]; #define NB_DV_VLC 409 -extern const uint16_t ff_dv_vlc_bits[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_len[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_run[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_level[NB_DV_VLC]; From patchwork Sun Sep 4 21:58:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37657 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274664pzh; Sun, 4 Sep 2022 14:59:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR507ZUoFdm/8hj+tP3kZMM7vR2V32JUSx5fpM0hUjbhClQZlENHlAlVfV0gsjp07ccreBMV X-Received: by 2002:a17:907:8687:b0:730:7c7b:b9ce with SMTP id qa7-20020a170907868700b007307c7bb9cemr33142467ejc.656.1662328774438; Sun, 04 Sep 2022 14:59:34 -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 v19-20020a056402349300b004480baa3a40si7497512edc.189.2022.09.04.14.59.34; Sun, 04 Sep 2022 14:59:34 -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=XfKWm9jN; 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 5DBC568B9B4; Mon, 5 Sep 2022 00:59:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2057.outbound.protection.outlook.com [40.92.58.57]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 23E6D68B9A3 for ; Mon, 5 Sep 2022 00:59:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKbjDAEXZNFkGUWKRs1KrZvd9RSx7ah4GDVeZLFSv8EAU10Z5bKieG6qBuizj7nArueXSWEf8ywMRtm3epoWzKRv9lE7ad2oSJG8udGB0pPLb48ggh/YLT8rmZiyuzd7KSO3HNnjySq2u5RfQkzY8DIR0gpppdD4GxlcE2sTjb6e9TI8X7ituHLg6HXH1y2WxhlO24MNdDM16nrKqNtmeKYtiP8uAASA+6rKEdli/5L5V4Yj9ElvIsNTnCjDCjNHz8lOUk0OPZKgLBeWHTrxUF9zsUVJenR9snqBGUzgaWzKqVy6NtjbUkArOw9XdPaTKiWs/LUQT5mlUhHcofiwQg== 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=CXsakQ4s0zKty+AX8nHWBTm8J+FavKvl+avpKBvvIKE=; b=cbU45UoskvtXVO22M29LaqnZsQXo+AQ5yGjblVuUInUfJxT59bFMHkIAziuyeMYCD8A8yg/lCC4MDiJ52CYbHTrKFTycP+omiBQX9SbW5TBc2eGuCpr75umUMZAkO0y83+VNA9yEMszyc3i7OU7ayAn3lNvg8h+wr+W8dQ9iq5NpicU31KcybgU3s/6R0uBWlquj3uf8Q9MAjNTsfulsM6wC5Gy4MdmSmsdJRe2r2yxhjdTU0WXzrCE4H2/LTUDsbBZ5jQFn9lRrgEIj/VUrvimI6GHnZ7QMJ+FErld4EGt9wt3oiued51o3tA0yM27jph3siENGwg59woBdCB6png== 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=CXsakQ4s0zKty+AX8nHWBTm8J+FavKvl+avpKBvvIKE=; b=XfKWm9jNnkgQSNPYRBamqsi5s8oRtHFNgCR+OBsQ4EAnvGYqeu24f7IQJ5D3UTtipSmbkmIJ5hli5BL9+HoSrlNAhBxH3dkbi/NFBe9w4vihXRDmLWz0depwKF9LIqA43Nbm5jNn6xL5bwjnbEdOTiFo8q+9yb84xaPa2X2sc8ftj9+Kpat4jSq+EQWUMKpcVBLoNkMWPghcW6yKqn+RHQhd+dCyVLpi4Ec+7WNNRwe4MZHYrWAJu9iiaIfD0zB29nH78MHJIE2FqAGN42+KAvLJnBN9A6ma+pSqU+Zs2HUQuMZAnP6EHUiw0DbK0eMydDG6Cj+QZOldVFCgYm8yPw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 21:59:26 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:59:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:46 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [ipFasPLs+XVgnU4lGUwISf1vulGB8zp6olRxBBdZljg=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1378b4c8-6a32-4899-1580-08da8ec0bbc4 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyWpuw8QwNKb6G2Lo6Ie5VpAgjp6ijoMnZuo4nHamEIO3hHlYuorNWc+bqA/4Vm71G3YyQ2ghvA89eUJ7hbWzV+KGOyXlb2K2RdpemI8z7Bl8Yp/+yMGV65A2/51ZSIdaBu0cVcBRLFz8FP1J+hr0je+W9mzunSMY4sFEye1KBdnxTxyGcQNkgVMvAvHWI2GOV3OrLy4gM3fgtHYsDT4pG6gsY5141e2DVmI07D1Z+pdFiPIAMJYo3ofjS0sQozfFgnR8ZII4mKVU+jX88vHwvCRd7xsdJWAbp971OnL1EgjGL4y/iu+n9+Q7a2wrHDe+5mPchN4x8zVkIBzHwnYHouoG+ghKiOJk6cNMB1RBOg2J6KqP35uAKZtAEohhwLo3kFySrgBF9pv941pdX7ULmi+WShbhK+dKaS2o2wBR8IlvT/55fZesRmGAFZfjCmLYLvWUnovBexyK0i4kkJRsLHq9TKf7th0Ki/EdFceoE3UdBzfHdAVosFHmabzxpfMuXgAME4YuoAh2PPgTie67+Z9/xBouh5aNXemA2o70wsYZfMnDxcY6Uml1u4mLMIGFG2xjI89LXWIiVuJjgWvffKEz3qXmKMgEmtqj7fZ7xF/6cB2yzHqtJkncHNdpcOLI+UlEYt/dFzcrH601vpQh6e3UFit4pWntQTrLc8siXrXZ/RrmjvkjsCh/MYjT35L15aLzy5uiqX2Mv4wL8Xtg9Bme2QosXYmgA= X-MS-TrafficTypeDiagnostic: AS8P250MB0235:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8nuD1jd+ENe245kyBM6wmQHJyq/0XPZrYoI5n2P3BvocP8MQoZ0W8N6sCfcWvhIA/WEkTA5CUlbXONklx3zxUNMDhtdQYn+uipok7XrUvRM4M8926iqUKSI9pRFWe9tuXWjWR/CjxRwUd87ZDFPVy7mpjjHEbrW+L5MT8D8it14p633KM7MaxepPrXM52Tbz7674jCb1vNfhqAqza1p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XQvpO6r9aW4M4UuWsCJMnmGq+aEqyb50S1W79xHVqPLD1bVq9DgY4f0/ECuDz3pgWLuFQFpdy6oGXq+5+2Ncb9AfFkiYwx2HISVuNyR53M3vtC1sKMYFFsrnQFJYAbV8UX2qsBAOumE4+h1nlEYBEJnURrF7NWNpOBOGzxpmR59T7KOWFe3CqqzqDGwS8nI/lZ3CD+KfbLPX/9OYo7g7AmgjDjeUq/2rGi1Wu5QmBDMS5M0VQ3/RLn3cFNlFyR21/K7gmL6zmk4H0b0w9S0Apd1SFqcNk6TyfdqVgrWhOFUhovtmL15hll3bYsOOv/eU36VYR1Cd0SCeufKNqsWYw8VOqOHpBQ3B0zzm0yN6YvOpeRX4cvUg5ef1KKYgOakLWP6JJUkyMEhpd4idmcJrzYqpDG06rUcbCjZodDoOJTo5mvf4/1TaopnH1hJ8Pw93DiapCEjszb4AaVSb8LqmmN/d5YmcgVOm+ijzICPz3QDmeQGrFSbRrKwJwnmmZUgBqRdxrwqV9hq4pC/Kfw2okVqnPt0HlRHRPmiNV1Kf/5iaIQhCcPmmKqv0sx3EipbuKOBn982bDzLV+71XLDz84C3jeoAz6VpgCXi54CoiqH25QSCLh2CCVF/oH0bCfqPfwj/wcZNsh58x35Ji19ucnQcMU4piVKipvway9MRju3otMRDS5/yp0PLVAnVkWgia2LnwcKiEa0f1ma2TXc8jWN0fYCBkxF3FlDo1Q0QlbNxlDeEp2jiShR3ve44+a/ggcAH X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1378b4c8-6a32-4899-1580-08da8ec0bbc4 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:59:26.3745 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 4/9] avcodec/dvdec: Mark dv_init_static() as av_cold 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: zTdO2J5TW6jX Forgotten in 6d484671ecb612c32cbda0fab65f961743aff5f8. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 8f68d2715d..3857ed1266 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -133,7 +133,7 @@ static const uint16_t dv_iweight_720_c[64] = { /* XXX: also include quantization */ static RL_VLC_ELEM dv_rl_vlc[1664]; -static void dv_init_static(void) +static av_cold void dv_init_static(void) { VLCElem vlc_buf[FF_ARRAY_ELEMS(dv_rl_vlc)] = { 0 }; VLC dv_vlc = { .table = vlc_buf, .table_allocated = FF_ARRAY_ELEMS(vlc_buf) }; From patchwork Sun Sep 4 21:58:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37658 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274714pzh; Sun, 4 Sep 2022 14:59:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cC/nvsbYOWWOCrhQU0mYjnGCG0rOh+78SYBq+GXM4UJxh5Ewm30HB/zmQGWAG5/R1ZUmx X-Received: by 2002:a17:907:2c78:b0:741:4b9b:8d40 with SMTP id ib24-20020a1709072c7800b007414b9b8d40mr26734697ejc.553.1662328783496; Sun, 04 Sep 2022 14:59:43 -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 hz6-20020a1709072ce600b0073d82226569si6312862ejc.414.2022.09.04.14.59.43; Sun, 04 Sep 2022 14:59:43 -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=uMlbSKrA; 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 5888A68B898; Mon, 5 Sep 2022 00:59:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2093.outbound.protection.outlook.com [40.92.58.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2BA568B9C0 for ; Mon, 5 Sep 2022 00:59:37 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7HYr+MxT8Vxv4cbMhzB/Z1FCl5s5PaVI9pVptVDoHFow2MzZbiHsud2nz2wjfxfyoKpdmY32pkhEPXTCCCqiF3RrXsng+t4WRD2IncTvWrVOdQjuIZf9+fj0ar/eLICATGWxQIVsAEITu+987XvMF0cRvT9naZ/4iq5e6ecJIVuvfkh3UsmBjT6Gi5nsTWfwUtpUEWtyFUejvsW+0a8OYHbfCwAIHIYFrWRp/iKVlk2UA2tgTZ3xVMrUcNjxZfCn4jB6z23SH4NkdCDK5vb3Gex15/huKj2AlV6RIwXMOkvquEq0/SnagAG3D9jTd3Grk+tid92vQIIa6Yx+fFsTw== 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=KgjpqGmDh4RAgnPXu+l80axMJde9fVBZBaX9dy+j4cg=; b=YFTfbY7LusaBZJy1MEaF/T8mTVewhCKg3b1V3blXfQFLlqL27SUwIAhr7UoqACvqiWgnxCzYYWIpndiC5XqMNeHR0bE4IT3O8wKEkm4EGzbZl3uR+XAM+y3rJX63bMlsTf6OwguBognNNb8ABoF/v5Ib4/OC2gYIOpxttQB75ww5vcD42wWNhY2F9wpLwLKnXH9wbmcmol0/OBbke20YF4QR27s5L/Z6p2jxmXzN041U6g6T9ApcNzC3SMg/t22kbjPByfHa6hWgYG5myZ4vlyIDYsPAm4+afk0/CrMelrs3B9aO/bSvgLTmHb2c4MX5VL4vU1LsXVWDEvOPzCK69g== 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=KgjpqGmDh4RAgnPXu+l80axMJde9fVBZBaX9dy+j4cg=; b=uMlbSKrAzdM4w250lr8XtLaCvYK4sYw1h23FCdwAInSlFWNk+agCfd7dY5mu41dfzjgt3lxFDXh0N6EA05PG2kUKhGF/CJsSk7xcr9+C2OiHcutmRdr0HDfuQlbdRvDVZd578bYfcyHuEhOo8zokRjsPmzdX7VQumsHtqHGxhBq3vjUb9M1QJg5jpUpXgP16h420OtjT5z+LBsRhiSzwl2MIIseVp/Ky3BRDtfnZqNKY47I0koMhi2B6UaOuWHy0h266krGFeBfxVS/2x2LaR/twzC+sYq/YlhG3/0hYK/ChQlBRGQhc+LR52Wuq6faYz0vz/DG1wkdNrbC4JJKmWg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 21:59:35 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:59:35 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:47 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [2RlYNZf+qXPFibOGfbIXyErRFzAKoiMQ6MuRl/svtjU=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f9f7aa7-7e80-4350-bbd9-08da8ec0c177 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyWpuw8QwNKb6G2Lo6Ie5Vp7oI7abGTDlUnryhYRN4e6DjstUalYMuP+4UMvN+TOREBSrMSLdqUQd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rExiv/Qumcx2a8rkRx5D9oyNqNfxGz8QlZ0c/BvpQXmOe9IAxKfURQvj0j70dhLjlHbvkxmXDkSKcGtZfAKVQXgUL1nXMOhhwh0SdHPeDkN+h/fuwhVByuXJoYslrwl13385ROAe/ZeEjymfCAZU9UbjKAaqDio75/Cdhl27O4qu+t9KTPSkgxRBoZjdUSweaR7bJ0buvFAmWZtjUwwhOu3RN5uA/+EL9nqh9OLJCycPnxIXiac3IoEhb53sdO9iH7rPVCeJuashSIOiiwsNCFq/QpNehv/UMO7n+d8n/Chta3Su6kbeEHEYDuUXsoeA65psSqD5JyKFwxOfbYadpwU6Ljf7FHE44Am0PHalVWy3b/I5Bv16+i8d3F/GPcCt2p+jIjISD5zxcbPYkYSSkSYobsOCyEaVx653yPPvFn6D2H8i5q5ahZGVjqGliF3EPWHfMd/8eKcoi2avsgw2wCtkCkyI7ATFgqyPeUygQTddhn14+LMQS7cbAJUvcMUK6MZvHN+dXo2fhKxuTmQZlGXSfu74S0shOWHM5o8tmy/Lg5e6ZDJurA/q1RMid+jxCa0zr6J18xCQoykCfItYwVAeiRDY1CCHczJl2yIZRc6JnfrAQwwgIoCFEBX9u X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f9f7aa7-7e80-4350-bbd9-08da8ec0c177 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:59:35.8779 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 5/9] avcodec/dvdec: Avoid stack buffers 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: GXu2x9kG0vZp Instead reuse the destination RL VLC as scratch space. This is possible, because the (implicit) codes here are already ordered from left-to-right in the tree and because the codelengths are increasing, which implies that mapping from VLC entries to the corresponding entries used to initialize the VLC is monotonically increasing. This means that one can reuse the right end of the destination RL VLC to store the tables used to initialize the VLC with. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdata.h | 2 ++ libavcodec/dvdec.c | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index ae104096ad..31191a8475 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -27,6 +27,8 @@ extern const uint8_t ff_dv_quant_shifts[22][4]; extern const uint8_t ff_dv_quant_offset[4]; #define NB_DV_VLC 409 +/* The number of entries with value zero in ff_dv_vlc_level. */ +#define NB_DV_ZERO_LEVEL_ENTRIES 72 extern const uint8_t ff_dv_vlc_len[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_run[NB_DV_VLC]; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 3857ed1266..32085a3ba6 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -137,31 +137,30 @@ static av_cold void dv_init_static(void) { VLCElem vlc_buf[FF_ARRAY_ELEMS(dv_rl_vlc)] = { 0 }; VLC dv_vlc = { .table = vlc_buf, .table_allocated = FF_ARRAY_ELEMS(vlc_buf) }; - uint8_t new_dv_vlc_len[NB_DV_VLC * 2]; - uint8_t new_dv_vlc_run[NB_DV_VLC * 2]; - int16_t new_dv_vlc_level[NB_DV_VLC * 2]; + const unsigned offset = FF_ARRAY_ELEMS(dv_rl_vlc) - (2 * NB_DV_VLC - NB_DV_ZERO_LEVEL_ENTRIES); + RL_VLC_ELEM *tmp = dv_rl_vlc + offset; int i, j; /* it's faster to include sign bit in a generic VLC parsing scheme */ for (i = 0, j = 0; i < NB_DV_VLC; i++, j++) { - new_dv_vlc_len[j] = ff_dv_vlc_len[i]; - new_dv_vlc_run[j] = ff_dv_vlc_run[i]; - new_dv_vlc_level[j] = ff_dv_vlc_level[i]; + tmp[j].len = ff_dv_vlc_len[i]; + tmp[j].run = ff_dv_vlc_run[i]; + tmp[j].level = ff_dv_vlc_level[i]; if (ff_dv_vlc_level[i]) { - new_dv_vlc_len[j]++; + tmp[j].len++; j++; - new_dv_vlc_len[j] = ff_dv_vlc_len[i] + 1; - new_dv_vlc_run[j] = ff_dv_vlc_run[i]; - new_dv_vlc_level[j] = -ff_dv_vlc_level[i]; + tmp[j].len = ff_dv_vlc_len[i] + 1; + tmp[j].run = ff_dv_vlc_run[i]; + tmp[j].level = -ff_dv_vlc_level[i]; } } /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, - new_dv_vlc_len, 1, + &tmp[0].len, sizeof(tmp[0]), NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); @@ -174,8 +173,9 @@ static av_cold void dv_init_static(void) run = 0; level = code; } else { - run = new_dv_vlc_run[code] + 1; - level = new_dv_vlc_level[code]; + av_assert1(i <= code + offset); + run = tmp[code].run + 1; + level = tmp[code].level; } dv_rl_vlc[i].len = len; dv_rl_vlc[i].level = level; From patchwork Sun Sep 4 21:58:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37659 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274869pzh; Sun, 4 Sep 2022 15:00:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/zevzDgatt+nbPfAf8Tsewiwea431a1AOZJmYQHGHAR2DK/k6wurJ3zHPuAXe/iYh2jLQ X-Received: by 2002:aa7:d315:0:b0:44e:6647:9dae with SMTP id p21-20020aa7d315000000b0044e66479daemr3768455edq.280.1662328813888; Sun, 04 Sep 2022 15:00:13 -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 ek10-20020a056402370a00b0044d7a93e44dsi3153927edb.579.2022.09.04.15.00.08; Sun, 04 Sep 2022 15:00:13 -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=R8OEPiAx; 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 7FE3668B85C; Mon, 5 Sep 2022 01:00:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2042.outbound.protection.outlook.com [40.92.58.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DE8B568B85C for ; Mon, 5 Sep 2022 00:59:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mar3BegXcX7ENP7F2lzSA/j3iJLY5Jt+g2cO834JaE/4hchf+O6XAsaRx24Tp9MbZg+As8t46yNFDVIZI5I6h2x7CFb/efiBHJWJ7A6NkTc1RIVwB5vdnx6iV2JLRUd4pq5kROBG2yBOGZpIIBWoBVS/7dZnpC+zLvrHdE9sAQOcKCiSs3N3b7aQkf9dlhpJR8okN93mm9hyLSNQSG1LFAheyFAQg+oaLUacEAXVlXl5IfuZ8XZ9oM62OqS+Ei+bK1CouLed17tihChDQsF5Z4xaWwxnp77gWHa38Vk0ljr6ElYnyKus2naNAYlD3Nu0OVYofPSWUSMmlM6NB+pljA== 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=teZ6Lt87ajJ3UZoARQXwJa2JurwD+f1eB0qXXmTqdWc=; b=HgTRbznrI6ILXVd1aDFNPsXrTB4gRtUmqTiip9eCATxW6owDy76wjol0cCESZTPZo/H1DmWqw7juCQ3cyY/S0nE/FpMGF11TA6R8h4ZKNb6UfS+bCWBTYVIea2darRnqA5sdYtzoZKLnnLxrwTC9jZPhRIIIRkB96bn5tNyAIyZqm3yTRcbtuDtuIkmLF1+2DIp4430qETECV8V7FxPXdFfCqY/Rot8YZCIVyPlISJk0YEAZXn/cvLvzTX6fR7ASYJmHrkAB749qrRghq80qP7rROzNjmZron+i3tFurZOQAbItvYQ3czpoi835jUICo0ZwiSr6ogO6zCDWqrOJ11g== 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=teZ6Lt87ajJ3UZoARQXwJa2JurwD+f1eB0qXXmTqdWc=; b=R8OEPiAx0klW4qoqWuDQYBtUrrTrZegfiu3rwJpFKjh99fgLTNd7IZbNvZdWUqMSKmiG77hWPq0wzKnVqlvrbdSB1u5VKr7Q9OPW1m8yonQlAp4tNWhk+GoTprE3zI6pyej/kdUnMrp9+/BEbOmsNCdMNtzNQFfpReqDQP38Lw9k7xjQIduCV6isqe/2w593evMFntPykQ4hU4IG/ZkDyodxSsIFzXz7XrCbEFXvuTPXpiyd88ZLhbHAI7PhqGYT/FMVBi6PKxPoBeA9cGN+VgIbbbaJye05KhGjOKIC3GsIgF4EhmNiErIM5ozKA7SSJfNWUF5zZJW+AYED3KRkfA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 21:59:58 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 21:59:58 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:48 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [xum+FOfvz+UsjegE/2awC/iGF9l+k68FHlqZnakY/n0=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b4b86a7-1fe6-4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udDST/YkMLPnBqlgmH5fkx4552cdHxN+nZ7W+IwnwiweH4Q93x3tocPIyFFkTkm5ktXfHrRped2fOeAozt775Dl+g3SVm9TTLFJjazZwRsPM8PUMddYPlkuQbf6tRsnYb6iEGeEhrO7o3F6jgbiq7ruSVfSZ3YRAW5vCq7ZXf5BLp4dqDrz5p2dOAN5jR0N1SuT42EUYs9imzxVFx6JqFJvlIKM5V+Cn5smojopyxHQn9Nqxs8DQ2JaJwHTGxZZfUkO2JFuA4D8Q0M36+YQtK+eRei6UZZ7cLbhsjMemDIhr8lr4utmjgdBC1r/h41LEJS0Gd36qsQKCDYRN25FyJAO6R87ID5Vc6ocpvxSaaU/I1R8YOc5u2ZWHx+jbuozMea7JN/77kvLHEi/70NJHb59r/uuRFhiSIg+HDjxusa08T0Ooi22z5dNAYZN4SZHghDIjryET9cFOWBXINaONwFhw6gUA9etNZBBZ6Jx6/kXnhyAWgxCUblICjanmsc9bR9l23DbCQaWoR2Xksrm8/1fTy4+B5xc0hwPSKXM2EUn1LAsn7CVa2xONRHXcd9gG+ZFgnZ12UhqOTTp6hH+SErWhHMiIlLu7W3iK7FvJMqeDA4Xg/vawbKxRaqLYUtOKtKh8Kjfg8gRjUjIXUlFTNThW5b9d28s+lsIJsVhnCzUMNWxGOqWTQHvqTwOOTqLdg4fuo7Vh6zoqEHfmCqn/AyW8FvmsanSEehKdnhH1xgLv+fmDmzpvCqV2TUDAA5SmJqAWzPO X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b4b86a7-1fe6-4127-bb03-08da8ec0cf09 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 21:59:58.6607 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 6/9] avcodec/wmavoice: Avoid code 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rsmHSvQ2Vb74 These codes are already ordered from left-to-right in the tree, so one can just use ff_init_vlc_static_from_lengths(). Signed-off-by: Andreas Rheinhardt --- libavcodec/wmavoice.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 8fa9db63ee..4438089e51 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -320,18 +320,10 @@ static av_cold void wmavoice_init_static_data(void) 10, 10, 10, 12, 12, 12, 14, 14, 14, 14 }; - static const uint16_t codes[] = { - 0x0000, 0x0001, 0x0002, // 00/01/10 - 0x000c, 0x000d, 0x000e, // 11+00/01/10 - 0x003c, 0x003d, 0x003e, // 1111+00/01/10 - 0x00fc, 0x00fd, 0x00fe, // 111111+00/01/10 - 0x03fc, 0x03fd, 0x03fe, // 11111111+00/01/10 - 0x0ffc, 0x0ffd, 0x0ffe, // 1111111111+00/01/10 - 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx - }; - INIT_VLC_STATIC(&frame_type_vlc, VLC_NBITS, sizeof(bits), - bits, 1, 1, codes, 2, 2, 132); + INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, + FF_ARRAY_ELEMS(bits), bits, + 1, NULL, 0, 0, 0, 0, 132); } static av_cold void wmavoice_flush(AVCodecContext *ctx) From patchwork Sun Sep 4 21:58:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37660 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274895pzh; Sun, 4 Sep 2022 15:00:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR58dxtxDTgOj+t2tSpWbB5Emr36KnqFE/CPIcQzx1ulcAmuVwGtlL4+qstfEZ3uoX8/bK2a X-Received: by 2002:a17:907:2d23:b0:730:acf0:4907 with SMTP id gs35-20020a1709072d2300b00730acf04907mr34556297ejc.700.1662328819338; Sun, 04 Sep 2022 15: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 n12-20020a05640205cc00b0043cfed4d661si7581802edx.358.2022.09.04.15.00.18; Sun, 04 Sep 2022 15: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=do+4gyVV; 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 78A0668B9DB; Mon, 5 Sep 2022 01:00:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2042.outbound.protection.outlook.com [40.92.58.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 22E5568B85C for ; Mon, 5 Sep 2022 01:00:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gObkI7X1bBJNkLvvgU0rZKgv0JTtFM/L1CgEl8ExDu4cGBY7gBkn+pcuh6XiXdt91nU4/scGtuvif0PqWRvqKxeceU8NihlNCx1NAV4En4i21jG+rJ6v+7piTGN5Q9j1j0kaN11fwh/V+yi/SA1tSkkvdsdluicKwXg3exqu/iscAcF2B/k2mnpOprK0UeQA4a0ZioptrMOPqw/NwdxuI9BzRiouRJRAvo1mmXQ2FIOOBqKYCjndAViS+SP/YGAmg4myx3+35ZjUZnrz45KR0YuqUox3d/9A1QjptVEeXx/ZN8g+yafsnAi0OV6qrBDl72GZYgi6KbqxBzermFEtkw== 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=2NnFhgCzZWcKLGRIL9PCaV0qno1wCVt5yvWTy52W+S8=; b=AnhXj5wVobm6Z2X1Wuupyh/v5ohQbbwQIureAJMkOjeZU9XV8MU/+8bFk3bG/PaUTs/oyUNQRVGLjfo3BsxgbOOM6x/sIgUjNG6thMt5NhSQi/wO47yqRoGQePYPxBEl4+BIoTEvTog1PKe53FtQRdd7IRXJG3WxgFl7LFFE94OUSEJ07J7mtmSN7jvHihiqXCboF6gKOAFwbcPTSMfaDovTI2KVq+jyzLLNK+wVR53kCa9UZrzBy5mg2ggIwUww6kF2bgHujN+pN/A2zX0QVkcVrIoRsEpslrgE6rwjtYUZNyFD4MqrXIHPjoGKs4oHgmOYuuwHYR+jV+sTJX1iEQ== 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=2NnFhgCzZWcKLGRIL9PCaV0qno1wCVt5yvWTy52W+S8=; b=do+4gyVVTdgp5NTknhGAlGVVm4ifRFVPpoXf4D5j4QUhAjsATCgZmWh2gzaguw0khaZAjbTCQ8gsJoxLeCykWdpAYl6A0TJb9g5jwEktoXvFJ2ADWsQu0vchXW6haFyixyPLCEocYnRRuIGO5F517ln1qJBpPJUvHs+b8tyjUQ8BG6B6q2B50MEBqQtTfM/fK1A2NnPJ7AiATee2I/lIZf6AOW7W6YI3grMH908RxL9d2fciU3+9ygAwOfGlESD5Av3YPdfTEgULEYr6bEpODRrAM2fHZJsejaI8LWgvYUo/2A0VwtPCzVJ1Kg+NmRDk/IyuUbB8i2VFYA7ow6lwPA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 22:00:00 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 22:00:00 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:49 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [k32ibJ7O+uXgCjczL+gPtaB1G5ahb9r40Wz3NH03R5E=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9534c73b-2fb0-4b44-8d93-08da8ec0d012 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpOESH07gTfyFtwl3n8uZhuACPGWuzWbHBKTWiDa/Z8C9yMsblbcPcqtDW/4Ql7YnP6zYLsLtuyXSOHghDKj4RJ7sjODmQLjOQl8r0fBycEc3wY/gSXExqLryYsCtgDykhVNbDReQrMj2rA6tCxYyJ6k0kDGv9yayy/mjNShIk9m7yBmnIKibp9U5ioZCW8B2RsqkWMb4FeRTdp8TTeg7kdEAR+3eXGlguZEAaVLnQD2+Kwxw++HGZkywKFEbLe+jF+WPT6H8m2vG5SYI/QuOtHuax3CHscqCwObfybMfNhLvV7UsZH6bXugJrd8JfhMxteRd/zIpMUrlfdEKPHKu6C1Pe+3lddB3lD720sMeObYpVI+3kTliNoczHkmMAeD6Q8+4XlV3fYZFKcMJ59sF0ElSCBMyhw7W9nKfDqmnSxOL8FI0JEB2efXTPBhyLeP/3t0N5HGs7z1bCN8NXCq9iYDZZLqa7BzGBshQcQm7nTmMhkeiAXlW46pZiph38dBzbVuq8vHhgSK9FwDL2rnct7mE+LRNDMT4XaLwX9O/NZt379rwUI+mKU9NVXNZq0jN7/vgdri6v36OrsdDzkeyEU8xZ4Zi8lRrlCR06mGyftXYWn/H29hWRKwwDAdjaJ5tztaQNbeOuIf4t4awVr2GTy34tfI6DZBSaHj3CcfixYrnLXD3FQhe1tibzc9YEcBqrKHHozEfTSPFexxXJQlWXIIHgjnI2aGoOgZUyB38zcPRcceyCpWFfuvstQttyaQWs= X-MS-TrafficTypeDiagnostic: AS8P250MB0235:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-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8ec0d012 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 22:00:00.4587 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 7/9] avcodec/wmaprodec: Use ff_init_vlc_from_lengths() instead of init_vlc 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: cnQzdKGzvvjJ It allows to replace tables of big codes (uint16_t and uint32_t) by tables of smaller symbols (mostly uint8_t). Signed-off-by: Andreas Rheinhardt --- libavcodec/wmaprodata.h | 551 ++++++++++++++++------------------------ libavcodec/wmaprodec.c | 42 +-- 2 files changed, 236 insertions(+), 357 deletions(-) diff --git a/libavcodec/wmaprodata.h b/libavcodec/wmaprodata.h index 53824799d5..3a30be40b5 100644 --- a/libavcodec/wmaprodata.h +++ b/libavcodec/wmaprodata.h @@ -48,42 +48,32 @@ static const uint16_t critical_freq[] = { */ #define HUFF_SCALE_SIZE 121 #define HUFF_SCALE_MAXBITS 19 -static const uint16_t scale_huffcodes[HUFF_SCALE_SIZE] = { - 0xE639, 0xE6C2, 0xE6C1, 0xE6C0, 0xE63F, 0xE63E, 0xE63D, 0xE63C, - 0xE63B, 0xE63A, 0xE638, 0xE637, 0xE636, 0xE635, 0xE634, 0xE632, - 0xE633, 0xE620, 0x737B, 0xE610, 0xE611, 0xE612, 0xE613, 0xE614, - 0xE615, 0xE616, 0xE617, 0xE618, 0xE619, 0xE61A, 0xE61B, 0xE61C, - 0xE61D, 0xE61E, 0xE61F, 0xE6C3, 0xE621, 0xE622, 0xE623, 0xE624, - 0xE625, 0xE626, 0xE627, 0xE628, 0xE629, 0xE62A, 0xE62B, 0xE62C, - 0xE62D, 0xE62E, 0xE62F, 0xE630, 0xE631, 0x1CDF, 0x0E60, 0x0399, - 0x00E7, 0x001D, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, - 0x0002, 0x0007, 0x0006, 0x000F, 0x0038, 0x0072, 0x039A, 0xE6C4, - 0xE6C5, 0xE6C6, 0xE6C7, 0xE6C8, 0xE6C9, 0xE6CA, 0xE6CB, 0xE6CC, - 0xE6CD, 0xE6CE, 0xE6CF, 0xE6D0, 0xE6D1, 0xE6D2, 0xE6D3, 0xE6D4, - 0xE6D5, 0xE6D6, 0xE6D7, 0xE6D8, 0xE6D9, 0xE6DA, 0xE6DB, 0xE6DC, - 0xE6DD, 0xE6DE, 0xE6DF, 0xE6E0, 0xE6E1, 0xE6E2, 0xE6E3, 0xE6E4, - 0xE6E5, 0xE6E6, 0xE6E7, 0xE6E8, 0xE6E9, 0xE6EA, 0xE6EB, 0xE6EC, - 0xE6ED, 0xE6EE, 0xE6EF, 0xE6F0, 0xE6F1, 0xE6F2, 0xE6F3, 0xE6F4, - 0xE6F5, -}; - -static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = { - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 18, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 16, 15, 13, - 11, 8, 5, 2, 1, 3, 5, 6, - 6, 7, 7, 7, 9, 10, 13, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, +static const uint8_t scale_table[HUFF_SCALE_SIZE][2] = { + { 58, 5 }, { 64, 6 }, { 66, 7 }, { 65, 7 }, { 62, 5 }, + { 63, 6 }, { 68, 9 }, { 69, 10 }, { 54, 15 }, { 19, 19 }, + { 20, 19 }, { 21, 19 }, { 22, 19 }, { 23, 19 }, { 24, 19 }, + { 25, 19 }, { 26, 19 }, { 27, 19 }, { 28, 19 }, { 29, 19 }, + { 30, 19 }, { 31, 19 }, { 32, 19 }, { 33, 19 }, { 34, 19 }, + { 17, 19 }, { 36, 19 }, { 37, 19 }, { 38, 19 }, { 39, 19 }, + { 40, 19 }, { 41, 19 }, { 42, 19 }, { 43, 19 }, { 44, 19 }, + { 45, 19 }, { 46, 19 }, { 47, 19 }, { 48, 19 }, { 49, 19 }, + { 50, 19 }, { 51, 19 }, { 52, 19 }, { 15, 19 }, { 16, 19 }, + { 14, 19 }, { 13, 19 }, { 12, 19 }, { 11, 19 }, { 10, 19 }, + { 0, 19 }, { 9, 19 }, { 8, 19 }, { 7, 19 }, { 6, 19 }, + { 5, 19 }, { 4, 19 }, { 55, 13 }, { 70, 13 }, { 3, 19 }, + { 2, 19 }, { 1, 19 }, { 35, 19 }, { 71, 19 }, { 72, 19 }, + { 73, 19 }, { 74, 19 }, { 75, 19 }, { 76, 19 }, { 77, 19 }, + { 78, 19 }, { 79, 19 }, { 80, 19 }, { 81, 19 }, { 82, 19 }, + { 83, 19 }, { 84, 19 }, { 85, 19 }, { 86, 19 }, { 87, 19 }, + { 88, 19 }, { 89, 19 }, { 90, 19 }, { 91, 19 }, { 92, 19 }, + { 93, 19 }, { 94, 19 }, { 95, 19 }, { 96, 19 }, { 97, 19 }, + { 98, 19 }, { 99, 19 }, { 100, 19 }, { 101, 19 }, { 102, 19 }, + { 103, 19 }, { 104, 19 }, { 105, 19 }, { 106, 19 }, { 107, 19 }, + { 108, 19 }, { 109, 19 }, { 110, 19 }, { 111, 19 }, { 112, 19 }, + { 113, 19 }, { 114, 19 }, { 115, 19 }, { 116, 19 }, { 117, 19 }, + { 118, 19 }, { 119, 19 }, { 120, 19 }, { 18, 18 }, { 53, 16 }, + { 56, 11 }, { 57, 8 }, { 67, 7 }, { 61, 3 }, { 59, 2 }, + { 60, 1 }, }; /** @} */ @@ -94,46 +84,31 @@ static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = { */ #define HUFF_SCALE_RL_SIZE 120 #define HUFF_SCALE_RL_MAXBITS 21 -static const uint32_t scale_rl_huffcodes[HUFF_SCALE_RL_SIZE] = { - 0x00010C, 0x000001, 0x10FE2A, 0x000003, 0x000003, 0x000001, 0x000013, - 0x000020, 0x000029, 0x000014, 0x000016, 0x000045, 0x000049, 0x00002F, - 0x000042, 0x00008E, 0x00008F, 0x000129, 0x000009, 0x00000D, 0x0004AC, - 0x00002C, 0x000561, 0x0002E6, 0x00087C, 0x0002E2, 0x00095C, 0x000018, - 0x000001, 0x000016, 0x000044, 0x00002A, 0x000007, 0x000159, 0x000143, - 0x000128, 0x00015A, 0x00012D, 0x00002B, 0x0000A0, 0x000142, 0x00012A, - 0x0002EF, 0x0004AF, 0x00087D, 0x004AE9, 0x0043F9, 0x000067, 0x000199, - 0x002B05, 0x001583, 0x0021FE, 0x10FE2C, 0x000004, 0x00002E, 0x00010D, - 0x00000A, 0x000244, 0x000017, 0x000245, 0x000011, 0x00010E, 0x00012C, - 0x00002A, 0x00002F, 0x000121, 0x000046, 0x00087E, 0x0000BA, 0x000032, - 0x0087F0, 0x0056DC, 0x0002EC, 0x0043FA, 0x002B6F, 0x004AE8, 0x0002B7, - 0x10FE2B, 0x000001, 0x000051, 0x000010, 0x0002EE, 0x000B9C, 0x002576, - 0x000198, 0x0056DD, 0x0000CD, 0x000AC0, 0x000170, 0x004AEF, 0x00002D, - 0x0004AD, 0x0021FF, 0x0005CF, 0x002B04, 0x10FE29, 0x10FE28, 0x0002ED, - 0x002E74, 0x021FC4, 0x004AEE, 0x010FE3, 0x087F17, 0x000000, 0x000097, - 0x0002E3, 0x000ADA, 0x002575, 0x00173B, 0x0043FB, 0x002E75, 0x10FE2D, - 0x0015B6, 0x00056C, 0x000057, 0x000123, 0x000120, 0x00021E, 0x000172, - 0x0002B1, -}; - -static const uint8_t scale_rl_huffbits[HUFF_SCALE_RL_SIZE] = { - 9, 2, 21, 2, 4, 5, 5, - 6, 6, 7, 7, 7, 7, 6, - 7, 8, 8, 9, 10, 10, 11, - 12, 11, 12, 12, 12, 12, 11, - 4, 5, 7, 8, 9, 9, 9, - 9, 9, 9, 8, 8, 9, 9, - 12, 11, 12, 15, 15, 13, 15, - 14, 13, 14, 21, 5, 6, 9, - 10, 10, 11, 10, 11, 9, 9, - 6, 8, 9, 7, 12, 10, 12, - 16, 15, 12, 15, 14, 15, 10, - 21, 6, 7, 11, 12, 14, 14, - 15, 15, 14, 12, 11, 15, 12, - 11, 14, 13, 14, 21, 21, 12, - 16, 18, 15, 17, 20, 7, 8, - 12, 12, 14, 15, 15, 16, 21, - 13, 11, 7, 9, 9, 10, 11, - 10, +static const uint8_t scale_rl_table[HUFF_SCALE_RL_SIZE][2] = { + { 103, 7 }, { 80, 11 }, { 60, 11 }, { 18, 10 }, { 56, 10 }, + { 21, 12 }, { 90, 12 }, { 58, 11 }, { 27, 11 }, { 69, 12 }, + { 84, 15 }, { 48, 15 }, { 86, 14 }, { 47, 13 }, { 19, 10 }, + { 32, 9 }, { 78, 6 }, { 5, 5 }, { 28, 4 }, { 53, 5 }, + { 9, 7 }, { 31, 8 }, { 38, 8 }, { 10, 7 }, { 88, 11 }, + { 25, 12 }, { 105, 12 }, { 118, 11 }, { 23, 12 }, { 82, 14 }, + { 98, 16 }, { 110, 16 }, { 108, 15 }, { 93, 13 }, { 68, 10 }, + { 72, 12 }, { 97, 12 }, { 81, 12 }, { 42, 12 }, { 64, 8 }, + { 4, 4 }, { 1, 2 }, { 7, 6 }, { 14, 7 }, { 0, 9 }, + { 55, 9 }, { 61, 9 }, { 117, 10 }, { 24, 12 }, { 44, 12 }, + { 67, 12 }, { 70, 16 }, { 99, 18 }, { 96, 21 }, { 95, 21 }, + { 2, 21 }, { 77, 21 }, { 52, 21 }, { 111, 21 }, { 102, 20 }, + { 101, 17 }, { 46, 15 }, { 73, 15 }, { 109, 15 }, { 51, 14 }, + { 92, 14 }, { 30, 7 }, { 11, 7 }, { 66, 7 }, { 15, 8 }, + { 16, 8 }, { 116, 9 }, { 65, 9 }, { 57, 10 }, { 59, 10 }, + { 115, 9 }, { 12, 7 }, { 35, 9 }, { 17, 9 }, { 41, 9 }, + { 20, 11 }, { 91, 11 }, { 26, 12 }, { 75, 15 }, { 45, 15 }, + { 107, 14 }, { 83, 14 }, { 100, 15 }, { 89, 15 }, { 43, 11 }, + { 62, 9 }, { 37, 9 }, { 104, 8 }, { 6, 5 }, { 39, 8 }, + { 40, 9 }, { 34, 9 }, { 79, 7 }, { 8, 6 }, { 63, 6 }, + { 87, 12 }, { 94, 14 }, { 49, 14 }, { 50, 13 }, { 22, 11 }, + { 119, 10 }, { 33, 9 }, { 36, 9 }, { 113, 11 }, { 106, 12 }, + { 112, 13 }, { 71, 15 }, { 85, 15 }, { 74, 14 }, { 76, 10 }, + { 114, 7 }, { 29, 5 }, { 54, 6 }, { 13, 6 }, { 3, 2 }, }; @@ -165,167 +140,99 @@ static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = { */ #define HUFF_COEF0_SIZE 272 #define HUFF_COEF0_MAXBITS 21 -static const uint32_t coef0_huffcodes[HUFF_COEF0_SIZE] = { - 0x00004A, 0x00002B, 0x000000, 0x000003, 0x000006, 0x000009, 0x00000F, - 0x000010, 0x000016, 0x000011, 0x000016, 0x000028, 0x00002F, 0x000026, - 0x000029, 0x000045, 0x000055, 0x00005D, 0x000042, 0x00004E, 0x000051, - 0x00005E, 0x00008D, 0x0000A8, 0x0000AD, 0x000080, 0x000096, 0x00009F, - 0x0000AA, 0x0000BE, 0x00011C, 0x000153, 0x000158, 0x000170, 0x000104, - 0x00010D, 0x000105, 0x000103, 0x00012F, 0x000177, 0x000175, 0x000157, - 0x000174, 0x000225, 0x00023B, 0x00020D, 0x00021F, 0x000281, 0x00027B, - 0x000282, 0x0002AC, 0x0002FD, 0x00044F, 0x000478, 0x00044D, 0x0002EC, - 0x00044E, 0x000564, 0x000409, 0x00040B, 0x000501, 0x000545, 0x0004F3, - 0x000541, 0x00043B, 0x0004F1, 0x0004F4, 0x0008FD, 0x000A94, 0x000811, - 0x000B88, 0x000B91, 0x000B93, 0x0008EA, 0x000899, 0x000B8A, 0x000972, - 0x0009E5, 0x000A8F, 0x000A84, 0x000A8E, 0x000A00, 0x000830, 0x0008E8, - 0x000B95, 0x000871, 0x00083A, 0x000814, 0x000873, 0x000BFE, 0x001728, - 0x001595, 0x001712, 0x00102A, 0x001021, 0x001729, 0x00152E, 0x0013C3, - 0x001721, 0x001597, 0x00151B, 0x0010F2, 0x001403, 0x001703, 0x001503, - 0x001708, 0x0013C1, 0x00170E, 0x00170C, 0x0010E1, 0x0011EA, 0x001020, - 0x001500, 0x0017FA, 0x001704, 0x001705, 0x0017F0, 0x0017FB, 0x0021E6, - 0x002B2D, 0x0020C6, 0x002B29, 0x002E4A, 0x0023AC, 0x001519, 0x0023F3, - 0x002B2C, 0x0021C0, 0x0017FE, 0x0023D7, 0x0017F9, 0x0012E7, 0x0013C0, - 0x002261, 0x0023D3, 0x002057, 0x002056, 0x0021D2, 0x0020C7, 0x0023D2, - 0x0020EC, 0x0044C0, 0x002FE2, 0x00475B, 0x002A03, 0x002FE3, 0x0021E2, - 0x0021D0, 0x002A31, 0x002E13, 0x002E05, 0x0047E5, 0x00000E, 0x000024, - 0x000088, 0x0000B9, 0x00010C, 0x000224, 0x0002B3, 0x000283, 0x0002ED, - 0x00047B, 0x00041E, 0x00043D, 0x0004F5, 0x0005FD, 0x000A92, 0x000B96, - 0x000838, 0x000971, 0x000B83, 0x000B80, 0x000BF9, 0x0011D3, 0x0011E8, - 0x0011D7, 0x001527, 0x0011F8, 0x001073, 0x0010F0, 0x0010E4, 0x0017F8, - 0x001062, 0x001402, 0x0017E3, 0x00151A, 0x001077, 0x00152B, 0x00170D, - 0x0021D3, 0x002E41, 0x0013C2, 0x000029, 0x0000A9, 0x00025D, 0x000419, - 0x000544, 0x000B8B, 0x0009E4, 0x0011D2, 0x001526, 0x001724, 0x0012E6, - 0x00150B, 0x0017FF, 0x002E26, 0x002E4B, 0x002B28, 0x0021E3, 0x002A14, - 0x00475A, 0x002E12, 0x000057, 0x00023E, 0x000A90, 0x000BF0, 0x001072, - 0x001502, 0x0023D6, 0x0020ED, 0x002A30, 0x0044C7, 0x00008C, 0x00047F, - 0x00152A, 0x002262, 0x002E04, 0x0000A1, 0x0005F9, 0x000173, 0x000875, - 0x000171, 0x00152D, 0x0002E3, 0x0017E2, 0x0002AD, 0x0021C1, 0x000479, - 0x0021E7, 0x00041F, 0x005C4E, 0x000543, 0x005C4F, 0x000A91, 0x00898D, - 0x000B97, 0x008746, 0x000970, 0x008745, 0x000B85, 0x00A856, 0x00152F, - 0x010E8E, 0x0010E5, 0x00A857, 0x00170F, 0x021D11, 0x002A58, 0x010E8F, - 0x002E40, 0x021D13, 0x002A59, 0x043A25, 0x002A02, 0x043A21, 0x0044C1, - 0x087448, 0x0047E4, 0x043A20, 0x00542A, 0x087449, 0x00898C, +static const uint8_t coef0_lens[HUFF_COEF0_SIZE] = { + 2, 9, 14, 14, 13, 12, 13, 14, 15, 15, 12, 10, 10, 10, 13, 14, 15, 15, 12, + 11, 13, 14, 14, 13, 15, 15, 14, 12, 12, 8, 10, 10, 15, 15, 14, 13, 14, 14, + 13, 15, 20, 20, 19, 21, 21, 20, 19, 17, 17, 18, 18, 15, 15, 13, 12, 14, 15, + 15, 14, 15, 15, 12, 11, 6, 7, 8, 9, 13, 13, 13, 14, 14, 11, 10, 7, 8, + 14, 14, 14, 14, 12, 13, 13, 12, 12, 12, 11, 9, 13, 14, 14, 12, 11, 11, 11, + 9, 8, 7, 14, 15, 15, 14, 14, 12, 13, 15, 16, 17, 17, 14, 12, 12, 12, 15, + 15, 14, 14, 14, 13, 13, 9, 9, 11, 11, 10, 7, 6, 13, 15, 15, 14, 14, 14, + 13, 14, 15, 15, 13, 14, 14, 14, 14, 10, 9, 10, 10, 11, 11, 10, 8, 9, 13, + 14, 14, 12, 11, 14, 15, 15, 13, 12, 14, 14, 14, 14, 13, 14, 14, 3, 5, 8, + 10, 10, 15, 15, 14, 14, 16, 16, 15, 12, 11, 11, 11, 7, 8, 8, 9, 12, 13, + 13, 12, 14, 15, 15, 13, 10, 11, 11, 13, 14, 14, 13, 14, 14, 11, 10, 13, 15, + 15, 14, 12, 11, 4, 6, 6, 8, 12, 12, 12, 13, 13, 12, 13, 13, 14, 14, 13, + 13, 13, 9, 7, 9, 11, 14, 14, 13, 14, 14, 13, 10, 8, 7, 5, 9, 12, 13, + 14, 15, 15, 12, 12, 10, 14, 14, 13, 12, 13, 14, 14, 12, 13, 13, 12, 12, 12, + 9, 7, 6, 3, 4, 4, }; -static const uint8_t coef0_huffbits[HUFF_COEF0_SIZE] = { - 8, 7, 2, 3, 3, 4, 4, - 5, 5, 6, 6, 6, 6, 7, - 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 13, - 12, 12, 12, 12, 12, 12, 13, - 13, 13, 13, 13, 13, 13, 12, - 12, 13, 13, 13, 13, 13, 13, - 13, 13, 14, 14, 13, 13, 14, - 13, 13, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 13, 14, - 14, 14, 14, 14, 14, 14, 15, - 14, 15, 14, 14, 14, 14, 14, - 14, 15, 14, 14, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 14, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 4, 7, - 8, 9, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 13, 14, - 15, 14, 14, 6, 9, 11, 12, - 12, 12, 13, 13, 13, 13, 14, - 14, 14, 14, 14, 14, 15, 15, - 15, 15, 7, 10, 12, 13, 14, - 14, 14, 15, 15, 15, 8, 11, - 13, 14, 15, 9, 12, 9, 13, - 10, 13, 10, 14, 11, 15, 11, - 15, 12, 15, 12, 15, 12, 16, - 12, 17, 13, 17, 13, 17, 13, - 18, 14, 17, 14, 19, 14, 18, - 14, 19, 14, 20, 15, 20, 15, - 21, 15, 20, 16, 21, 16, +static const uint16_t coef0_syms[HUFF_COEF0_SIZE] = { + 2, 25, 111, 94, 69, 58, 87, 93, 136, 135, 59, 37, 34, 36, 82, + 182, 120, 138, 195, 45, 168, 216, 178, 86, 140, 219, 186, 162, 239, 18, + 156, 35, 127, 236, 109, 85, 180, 253, 88, 147, 268, 264, 256, 266, 270, + 262, 260, 248, 246, 252, 258, 137, 189, 230, 64, 179, 146, 208, 101, 118, + 238, 163, 46, 9, 153, 0, 26, 247, 169, 76, 202, 131, 194, 38, 13, + 19, 132, 106, 191, 97, 65, 198, 77, 62, 66, 164, 48, 27, 81, 183, + 102, 60, 47, 49, 159, 227, 20, 14, 112, 263, 144, 217, 104, 63, 79, + 209, 269, 250, 254, 203, 241, 196, 61, 220, 148, 124, 185, 100, 80, 78, + 193, 28, 50, 235, 41, 1, 10, 171, 226, 150, 103, 114, 115, 170, 105, + 211, 149, 249, 108, 188, 107, 255, 231, 155, 42, 40, 55, 160, 39, 21, + 29, 215, 234, 184, 228, 51, 116, 142, 145, 172, 165, 181, 130, 113, 117, + 89, 128, 204, 3, 7, 154, 157, 43, 141, 265, 133, 225, 271, 244, 221, + 74, 54, 56, 52, 15, 222, 22, 30, 83, 199, 173, 73, 123, 210, 143, + 175, 44, 53, 237, 174, 139, 134, 110, 218, 129, 161, 213, 177, 267, 151, + 125, 67, 223, 5, 11, 192, 23, 214, 243, 166, 200, 176, 68, 224, 187, + 257, 261, 232, 96, 251, 31, 16, 32, 57, 207, 121, 91, 126, 119, 99, + 158, 24, 212, 8, 33, 70, 92, 205, 240, 242, 75, 197, 233, 259, 190, + 98, 71, 201, 122, 206, 72, 90, 95, 84, 167, 245, 229, 17, 12, 4, + 152, 6, }; #define HUFF_COEF1_SIZE 244 #define HUFF_COEF1_MAXBITS 22 -static const uint32_t coef1_huffcodes[HUFF_COEF1_SIZE] = { - 0x0001E2, 0x00007F, 0x000000, 0x000002, 0x000008, 0x00000E, 0x000019, - 0x00002F, 0x000037, 0x000060, 0x00006C, 0x000095, 0x0000C6, 0x0000F0, - 0x00012E, 0x000189, 0x0001A5, 0x0001F8, 0x000253, 0x00030A, 0x000344, - 0x00034D, 0x0003F2, 0x0004BD, 0x0005D7, 0x00062A, 0x00068B, 0x000693, - 0x000797, 0x00097D, 0x000BAB, 0x000C52, 0x000C5E, 0x000D21, 0x000D20, - 0x000F1A, 0x000FCE, 0x000FD1, 0x0012F1, 0x001759, 0x0018AC, 0x0018A7, - 0x0018BF, 0x001A2B, 0x001E52, 0x001E50, 0x001E31, 0x001FB8, 0x0025E6, - 0x0025E7, 0x002EB4, 0x002EB7, 0x003169, 0x00315B, 0x00317C, 0x00316C, - 0x0034CA, 0x00348D, 0x003F40, 0x003CA2, 0x003F76, 0x004BC3, 0x004BE5, - 0x003F73, 0x004BF8, 0x004BF9, 0x006131, 0x00628B, 0x006289, 0x0062DA, - 0x00628A, 0x0062D4, 0x006997, 0x0062B4, 0x006918, 0x00794D, 0x007E7B, - 0x007E87, 0x007EEA, 0x00794E, 0x00699D, 0x007967, 0x00699F, 0x0062DB, - 0x007E7A, 0x007EEB, 0x00BAC0, 0x0097C9, 0x00C537, 0x00C5AB, 0x00D233, - 0x00D338, 0x00BAC1, 0x00D23D, 0x012F91, 0x00D339, 0x00FDC8, 0x00D23C, - 0x00FDDC, 0x00FDC9, 0x00FDDD, 0x00D33C, 0x000003, 0x000016, 0x00003E, - 0x0000C3, 0x0001A1, 0x000347, 0x00062E, 0x000BAA, 0x000F2D, 0x001A2A, - 0x001E58, 0x00309B, 0x003CA3, 0x005D6A, 0x00629A, 0x006996, 0x00794F, - 0x007EE5, 0x00BAD7, 0x00C5AA, 0x00C5F4, 0x00FDDF, 0x00FDDE, 0x018A20, - 0x018A6D, 0x01A67B, 0x01A464, 0x025F21, 0x01F9E2, 0x01F9E3, 0x00000A, - 0x00003D, 0x000128, 0x0003C7, 0x000C24, 0x0018A3, 0x002EB1, 0x003CB2, - 0x00691F, 0x007E79, 0x000013, 0x0000BB, 0x00034E, 0x000D14, 0x0025FD, - 0x004BE7, 0x000024, 0x000188, 0x0007EF, 0x000035, 0x000308, 0x0012F2, - 0x00005C, 0x0003F6, 0x0025E0, 0x00006D, 0x000698, 0x000096, 0x000C25, - 0x0000C7, 0x000F1B, 0x0000F3, 0x0012FF, 0x000174, 0x001A66, 0x0001A0, - 0x003099, 0x0001E4, 0x00316B, 0x000252, 0x003F31, 0x00030B, 0x004BE6, - 0x000346, 0x0062FB, 0x00034F, 0x007966, 0x0003F5, 0x007E86, 0x0005D4, - 0x00C511, 0x00062C, 0x00C5F5, 0x000692, 0x00F299, 0x000795, 0x00F298, - 0x0007E9, 0x018A21, 0x00097E, 0x0175AD, 0x000C27, 0x01A67A, 0x000C57, - 0x02EB59, 0x000D22, 0x0314D9, 0x000F19, 0x03F3C2, 0x000FCD, 0x0348CB, - 0x0012F8, 0x04BE41, 0x0018A0, 0x03F3C1, 0x0018A1, 0x04BE40, 0x0018B7, - 0x0629B0, 0x001A64, 0x0D2329, 0x001E30, 0x03F3C3, 0x001F9F, 0x0BAD62, - 0x001F99, 0x0FCF00, 0x00309A, 0x0629B1, 0x002EB6, 0x175AC3, 0x00314C, - 0x069195, 0x003168, 0x0BAD63, 0x00348E, 0x175AC1, 0x003F30, 0x07E781, - 0x003F41, 0x0D2328, 0x003F42, 0x1F9E03, 0x004BC2, 0x175AC2, 0x003F74, - 0x175AC0, 0x005D61, 0x3F3C05, 0x006130, 0x3F3C04, 0x0062B5, -}; - -static const uint8_t coef1_huffbits[HUFF_COEF1_SIZE] = { - 9, 7, 2, 3, 4, 4, 5, - 6, 6, 7, 7, 8, 8, 8, - 9, 9, 9, 9, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, - 11, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 14, - 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 15, 15, - 14, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 16, 16, 16, 16, 16, - 16, 16, 16, 17, 16, 16, 16, - 16, 16, 16, 16, 3, 5, 6, - 8, 9, 10, 11, 12, 12, 13, - 13, 14, 14, 15, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 17, - 17, 17, 17, 18, 17, 17, 4, - 6, 9, 10, 12, 13, 14, 14, - 15, 15, 5, 8, 10, 12, 14, - 15, 6, 9, 11, 6, 10, 13, - 7, 10, 14, 7, 11, 8, 12, - 8, 12, 8, 13, 9, 13, 9, - 14, 9, 14, 10, 14, 10, 15, - 10, 15, 10, 15, 10, 15, 11, - 16, 11, 16, 11, 16, 11, 16, - 11, 17, 12, 17, 12, 17, 12, - 18, 12, 18, 12, 18, 12, 18, - 13, 19, 13, 18, 13, 19, 13, - 19, 13, 20, 13, 18, 13, 20, - 13, 20, 14, 19, 14, 21, 14, - 19, 14, 20, 14, 21, 14, 19, - 14, 20, 14, 21, 15, 21, 14, - 21, 15, 22, 15, 22, 15, +static const uint8_t coef1_table[HUFF_COEF1_SIZE][2] = { + { 2, 2 }, { 3, 3 }, { 102, 3 }, { 4, 4 }, { 148, 6 }, + { 134, 9 }, { 171, 10 }, { 18, 10 }, { 11, 8 }, { 159, 8 }, + { 14, 9 }, { 156, 14 }, { 235, 15 }, { 61, 15 }, { 38, 13 }, + { 153, 13 }, { 48, 14 }, { 49, 14 }, { 23, 11 }, { 203, 13 }, + { 208, 19 }, { 204, 19 }, { 129, 18 }, { 94, 17 }, { 87, 16 }, + { 62, 15 }, { 174, 15 }, { 147, 15 }, { 29, 12 }, { 191, 12 }, + { 64, 15 }, { 65, 15 }, { 146, 14 }, { 164, 13 }, { 142, 5 }, + { 132, 4 }, { 103, 5 }, { 154, 7 }, { 165, 9 }, { 181, 11 }, + { 109, 12 }, { 30, 12 }, { 86, 16 }, { 92, 16 }, { 239, 15 }, + { 138, 14 }, { 39, 13 }, { 50, 14 }, { 115, 15 }, { 238, 21 }, + { 228, 21 }, { 236, 21 }, { 222, 21 }, { 216, 20 }, { 226, 20 }, + { 196, 18 }, { 192, 17 }, { 120, 16 }, { 221, 14 }, { 51, 14 }, + { 24, 11 }, { 143, 8 }, { 7, 6 }, { 9, 7 }, { 152, 10 }, + { 136, 12 }, { 160, 12 }, { 241, 15 }, { 66, 15 }, { 168, 14 }, + { 219, 14 }, { 113, 14 }, { 193, 12 }, { 19, 10 }, { 173, 10 }, + { 105, 8 }, { 149, 9 }, { 15, 9 }, { 205, 13 }, { 207, 13 }, + { 125, 17 }, { 190, 17 }, { 182, 16 }, { 68, 15 }, { 70, 15 }, + { 67, 15 }, { 137, 13 }, { 31, 12 }, { 223, 14 }, { 116, 15 }, + { 210, 19 }, { 220, 19 }, { 198, 18 }, { 126, 17 }, { 88, 16 }, + { 41, 13 }, { 25, 11 }, { 40, 13 }, { 73, 15 }, { 243, 15 }, + { 53, 14 }, { 195, 12 }, { 183, 11 }, { 225, 14 }, { 52, 14 }, + { 71, 15 }, { 121, 16 }, { 89, 16 }, { 170, 14 }, { 55, 14 }, + { 69, 15 }, { 83, 15 }, { 209, 13 }, { 108, 11 }, { 32, 12 }, + { 54, 14 }, { 122, 16 }, { 184, 16 }, { 176, 15 }, { 42, 13 }, + { 12, 8 }, { 161, 8 }, { 6, 5 }, { 167, 9 }, { 106, 9 }, + { 20, 10 }, { 145, 12 }, { 111, 13 }, { 43, 13 }, { 26, 11 }, + { 175, 10 }, { 107, 10 }, { 34, 12 }, { 33, 12 }, { 197, 12 }, + { 74, 15 }, { 128, 17 }, { 232, 20 }, { 212, 20 }, { 224, 19 }, + { 202, 18 }, { 90, 16 }, { 57, 14 }, { 227, 14 }, { 97, 16 }, + { 93, 16 }, { 140, 15 }, { 185, 11 }, { 27, 11 }, { 16, 9 }, + { 158, 11 }, { 211, 13 }, { 56, 14 }, { 117, 15 }, { 72, 15 }, + { 166, 13 }, { 91, 16 }, { 95, 16 }, { 80, 15 }, { 101, 16 }, + { 194, 17 }, { 127, 17 }, { 82, 15 }, { 21, 10 }, { 144, 10 }, + { 177, 10 }, { 151, 6 }, { 10, 7 }, { 157, 7 }, { 8, 6 }, + { 5, 4 }, { 13, 8 }, { 0, 9 }, { 213, 13 }, { 46, 13 }, + { 199, 12 }, { 35, 12 }, { 162, 12 }, { 135, 10 }, { 169, 9 }, + { 45, 13 }, { 59, 14 }, { 114, 14 }, { 44, 13 }, { 188, 16 }, + { 186, 16 }, { 75, 15 }, { 79, 15 }, { 118, 15 }, { 187, 11 }, + { 112, 13 }, { 139, 14 }, { 178, 15 }, { 81, 15 }, { 110, 12 }, + { 28, 11 }, { 163, 8 }, { 133, 6 }, { 104, 6 }, { 17, 9 }, + { 22, 10 }, { 229, 14 }, { 172, 14 }, { 217, 13 }, { 201, 12 }, + { 36, 12 }, { 218, 20 }, { 242, 22 }, { 240, 22 }, { 234, 21 }, + { 230, 19 }, { 206, 18 }, { 200, 18 }, { 214, 18 }, { 130, 17 }, + { 131, 17 }, { 141, 15 }, { 84, 15 }, { 76, 15 }, { 215, 13 }, + { 58, 14 }, { 231, 14 }, { 233, 14 }, { 180, 15 }, { 77, 15 }, + { 37, 12 }, { 189, 11 }, { 179, 10 }, { 155, 10 }, { 47, 13 }, + { 96, 16 }, { 99, 16 }, { 119, 15 }, { 63, 14 }, { 237, 14 }, + { 78, 15 }, { 85, 15 }, { 60, 14 }, { 98, 16 }, { 100, 16 }, + { 124, 16 }, { 123, 16 }, { 150, 11 }, { 1, 7 }, }; @@ -418,122 +325,94 @@ static const float coef1_level[HUFF_COEF1_SIZE] = { */ #define HUFF_VEC4_SIZE 127 #define HUFF_VEC4_MAXBITS 14 -static const uint16_t vec4_huffcodes[HUFF_VEC4_SIZE] = { - 0x0019, 0x0027, 0x00F2, 0x03BA, 0x0930, 0x1267, 0x0031, 0x0030, - 0x0097, 0x0221, 0x058B, 0x0124, 0x00EB, 0x01D4, 0x03D8, 0x0584, - 0x0364, 0x045F, 0x0F66, 0x0931, 0x24CD, 0x002F, 0x0039, 0x00E8, - 0x02C3, 0x078A, 0x0037, 0x0029, 0x0084, 0x01B1, 0x00ED, 0x0086, - 0x00F9, 0x03AB, 0x01EB, 0x08BC, 0x011E, 0x00F3, 0x0220, 0x058A, - 0x00EC, 0x008E, 0x012B, 0x01EA, 0x0119, 0x04B0, 0x04B1, 0x03B8, - 0x0691, 0x0365, 0x01ED, 0x049A, 0x0EA9, 0x0EA8, 0x08BD, 0x24CC, - 0x0026, 0x0035, 0x00DB, 0x02C4, 0x07B2, 0x0038, 0x002B, 0x007F, - 0x01B3, 0x00F4, 0x0091, 0x0116, 0x03BB, 0x0215, 0x0932, 0x002D, - 0x002A, 0x008A, 0x01DE, 0x0028, 0x0020, 0x005C, 0x0090, 0x0068, - 0x01EE, 0x00E9, 0x008D, 0x012A, 0x0087, 0x005D, 0x0118, 0x0349, - 0x01EF, 0x01E3, 0x08B9, 0x00F0, 0x00D3, 0x0214, 0x049B, 0x00DA, - 0x0089, 0x0125, 0x0217, 0x012D, 0x0690, 0x0094, 0x007D, 0x011F, - 0x007E, 0x0059, 0x0127, 0x01A5, 0x0111, 0x00F8, 0x045D, 0x03B9, - 0x0259, 0x0580, 0x02C1, 0x01DF, 0x0585, 0x0216, 0x0163, 0x01B0, - 0x03C4, 0x08B8, 0x078B, 0x0755, 0x0581, 0x0F67, 0x0000, -}; - -static const uint8_t vec4_huffbits[HUFF_VEC4_SIZE] = { - 5, 6, 8, 10, 12, 13, 6, 6, - 8, 10, 11, 9, 8, 9, 10, 11, - 10, 11, 12, 12, 14, 6, 6, 8, - 10, 11, 6, 6, 8, 9, 8, 8, - 8, 10, 9, 12, 9, 8, 10, 11, - 8, 8, 9, 9, 9, 11, 11, 10, - 11, 10, 9, 11, 12, 12, 12, 14, - 6, 6, 8, 10, 11, 6, 6, 7, - 9, 8, 8, 9, 10, 10, 12, 6, - 6, 8, 9, 6, 6, 7, 8, 7, - 9, 8, 8, 9, 8, 7, 9, 10, - 9, 9, 12, 8, 8, 10, 11, 8, - 8, 9, 10, 9, 11, 8, 7, 9, - 7, 7, 9, 9, 9, 8, 11, 10, - 10, 11, 10, 9, 11, 10, 9, 9, - 10, 12, 11, 11, 11, 12, 1, +static const uint8_t vec4_table[HUFF_VEC4_SIZE][2] = { + { 126, 1 }, { 76, 6 }, { 28, 8 }, { 93, 10 }, { 69, 10 }, + { 117, 10 }, { 98, 10 }, { 31, 8 }, { 84, 8 }, { 38, 10 }, + { 9, 10 }, { 108, 9 }, { 96, 8 }, { 73, 8 }, { 67, 9 }, + { 121, 12 }, { 90, 12 }, { 110, 11 }, { 35, 12 }, { 54, 12 }, + { 17, 11 }, { 86, 9 }, { 44, 9 }, { 82, 8 }, { 41, 8 }, + { 36, 9 }, { 103, 9 }, { 78, 8 }, { 66, 8 }, { 11, 9 }, + { 97, 9 }, { 4, 12 }, { 19, 12 }, { 70, 12 }, { 55, 14 }, + { 20, 14 }, { 5, 13 }, { 51, 11 }, { 94, 11 }, { 106, 9 }, + { 101, 8 }, { 83, 9 }, { 42, 9 }, { 45, 11 }, { 46, 11 }, + { 112, 10 }, { 99, 9 }, { 8, 8 }, { 56, 6 }, { 1, 6 }, + { 75, 6 }, { 27, 6 }, { 72, 6 }, { 62, 6 }, { 113, 11 }, + { 124, 11 }, { 114, 10 }, { 15, 11 }, { 116, 11 }, { 24, 10 }, + { 59, 10 }, { 39, 11 }, { 10, 11 }, { 118, 9 }, { 105, 7 }, + { 71, 6 }, { 77, 7 }, { 85, 7 }, { 21, 6 }, { 7, 6 }, + { 6, 6 }, { 0, 5 }, { 79, 7 }, { 100, 11 }, { 48, 11 }, + { 87, 10 }, { 107, 9 }, { 92, 8 }, { 57, 6 }, { 119, 9 }, + { 29, 9 }, { 16, 10 }, { 49, 10 }, { 64, 9 }, { 95, 8 }, + { 58, 8 }, { 26, 6 }, { 61, 6 }, { 22, 6 }, { 23, 8 }, + { 81, 8 }, { 13, 9 }, { 53, 12 }, { 52, 12 }, { 123, 11 }, + { 33, 10 }, { 12, 8 }, { 40, 8 }, { 30, 8 }, { 47, 10 }, + { 111, 10 }, { 3, 10 }, { 68, 10 }, { 74, 9 }, { 115, 9 }, + { 91, 8 }, { 120, 10 }, { 25, 11 }, { 122, 11 }, { 89, 9 }, + { 2, 8 }, { 37, 8 }, { 65, 8 }, { 43, 9 }, { 34, 9 }, + { 14, 10 }, { 60, 11 }, { 18, 12 }, { 125, 12 }, { 50, 9 }, + { 80, 9 }, { 88, 9 }, { 109, 8 }, { 32, 8 }, { 102, 7 }, + { 104, 7 }, { 63, 7 }, }; #define HUFF_VEC2_SIZE 137 #define HUFF_VEC2_MAXBITS 12 -static const uint16_t vec2_huffcodes[HUFF_VEC2_SIZE] = { - 0x055, 0x01C, 0x01A, 0x02B, 0x028, 0x067, 0x08B, 0x039, - 0x170, 0x10D, 0x2A5, 0x047, 0x464, 0x697, 0x523, 0x8CB, - 0x01B, 0x00E, 0x000, 0x010, 0x012, 0x036, 0x048, 0x04C, - 0x0C2, 0x09B, 0x171, 0x03B, 0x224, 0x34A, 0x2D6, 0x019, - 0x00F, 0x002, 0x014, 0x017, 0x006, 0x05D, 0x054, 0x0C7, - 0x0B4, 0x192, 0x10E, 0x233, 0x043, 0x02C, 0x00F, 0x013, - 0x006, 0x02F, 0x02C, 0x068, 0x077, 0x0DF, 0x111, 0x1A4, - 0x16A, 0x2A4, 0x027, 0x011, 0x018, 0x02D, 0x00F, 0x04A, - 0x040, 0x097, 0x01F, 0x11B, 0x022, 0x16D, 0x066, 0x035, - 0x005, 0x02B, 0x049, 0x009, 0x075, 0x0CB, 0x0AA, 0x187, - 0x106, 0x08A, 0x047, 0x060, 0x06E, 0x01D, 0x074, 0x0C4, - 0x01E, 0x118, 0x1A7, 0x038, 0x042, 0x053, 0x076, 0x0A8, - 0x0CA, 0x082, 0x110, 0x18D, 0x12D, 0x0B9, 0x0C8, 0x0DE, - 0x01C, 0x0AB, 0x113, 0x18C, 0x10F, 0x09A, 0x0A5, 0x0B7, - 0x11A, 0x186, 0x1A6, 0x259, 0x153, 0x18A, 0x193, 0x020, - 0x10C, 0x046, 0x03A, 0x107, 0x149, 0x16C, 0x2D7, 0x225, - 0x258, 0x316, 0x696, 0x317, 0x042, 0x522, 0x290, 0x8CA, - 0x001, -}; - -static const uint8_t vec2_huffbits[HUFF_VEC2_SIZE] = { - 7, 6, 6, 6, 7, 7, 8, 9, - 9, 10, 10, 11, 11, 11, 12, 12, - 6, 4, 5, 5, 6, 6, 7, 8, - 8, 9, 9, 10, 10, 10, 11, 6, - 4, 5, 5, 6, 7, 7, 8, 8, - 9, 9, 10, 10, 11, 6, 5, 5, - 6, 6, 7, 7, 8, 8, 9, 9, - 10, 10, 7, 6, 6, 6, 7, 7, - 8, 8, 9, 9, 10, 10, 7, 6, - 7, 7, 7, 8, 8, 8, 9, 9, - 10, 8, 7, 7, 7, 8, 8, 8, - 9, 9, 9, 9, 8, 8, 8, 8, - 8, 9, 9, 9, 9, 8, 8, 8, - 9, 9, 9, 9, 10, 9, 9, 9, - 9, 9, 9, 10, 9, 9, 9, 10, - 10, 11, 10, 10, 10, 10, 11, 10, - 10, 10, 11, 10, 11, 12, 11, 12, - 3, +static const uint8_t vec2_table[HUFF_VEC2_SIZE][2] = { + { 18, 5 }, { 119, 10 }, { 132, 11 }, { 44, 11 }, { 68, 10 }, + { 121, 11 }, { 11, 11 }, { 75, 8 }, { 72, 7 }, { 36, 7 }, + { 104, 9 }, { 122, 10 }, { 27, 10 }, { 88, 9 }, { 66, 9 }, + { 33, 5 }, { 48, 6 }, { 91, 9 }, { 7, 9 }, { 85, 8 }, + { 62, 7 }, { 136, 3 }, { 64, 8 }, { 97, 9 }, { 80, 10 }, + { 123, 10 }, { 92, 8 }, { 120, 10 }, { 9, 10 }, { 42, 10 }, + { 108, 10 }, { 59, 6 }, { 20, 6 }, { 23, 8 }, { 109, 9 }, + { 25, 9 }, { 58, 7 }, { 4, 7 }, { 134, 11 }, { 133, 12 }, + { 14, 12 }, { 124, 10 }, { 110, 9 }, { 93, 8 }, { 38, 8 }, + { 78, 9 }, { 105, 9 }, { 73, 7 }, { 50, 7 }, { 40, 9 }, + { 56, 10 }, { 30, 11 }, { 126, 11 }, { 125, 10 }, { 69, 10 }, + { 111, 9 }, { 35, 6 }, { 60, 6 }, { 31, 6 }, { 2, 6 }, + { 16, 6 }, { 1, 6 }, { 86, 8 }, { 76, 8 }, { 94, 8 }, + { 52, 8 }, { 46, 5 }, { 19, 5 }, { 98, 9 }, { 54, 9 }, + { 28, 10 }, { 127, 10 }, { 106, 9 }, { 81, 8 }, { 6, 8 }, + { 89, 9 }, { 12, 11 }, { 135, 12 }, { 15, 12 }, { 43, 10 }, + { 112, 9 }, { 67, 9 }, { 82, 7 }, { 22, 7 }, { 74, 7 }, + { 63, 7 }, { 128, 10 }, { 115, 10 }, { 100, 9 }, { 65, 8 }, + { 47, 5 }, { 34, 5 }, { 95, 8 }, { 57, 10 }, { 10, 10 }, + { 116, 9 }, { 0, 7 }, { 3, 6 }, { 45, 6 }, { 61, 6 }, + { 8, 9 }, { 26, 9 }, { 101, 8 }, { 37, 7 }, { 49, 6 }, + { 83, 7 }, { 24, 8 }, { 113, 9 }, { 79, 9 }, { 87, 8 }, + { 117, 9 }, { 129, 10 }, { 131, 10 }, { 107, 9 }, { 99, 9 }, + { 39, 8 }, { 102, 8 }, { 41, 9 }, { 118, 9 }, { 96, 8 }, + { 77, 8 }, { 70, 7 }, { 5, 7 }, { 51, 7 }, { 55, 9 }, + { 29, 10 }, { 130, 11 }, { 13, 11 }, { 114, 9 }, { 90, 9 }, + { 71, 6 }, { 21, 6 }, { 84, 7 }, { 103, 8 }, { 53, 8 }, + { 17, 4 }, { 32, 4 }, }; #define HUFF_VEC1_SIZE 101 #define HUFF_VEC1_MAXBITS 11 -static const uint16_t vec1_huffcodes[HUFF_VEC1_SIZE] = { - 0x01A, 0x003, 0x017, 0x010, 0x00C, 0x009, 0x005, 0x000, - 0x00D, 0x00A, 0x009, 0x00C, 0x00F, 0x002, 0x004, 0x007, - 0x00B, 0x00F, 0x01C, 0x006, 0x010, 0x015, 0x01C, 0x022, - 0x03B, 0x00E, 0x019, 0x023, 0x034, 0x036, 0x03A, 0x047, - 0x008, 0x00A, 0x01E, 0x031, 0x037, 0x050, 0x053, 0x06B, - 0x06F, 0x08C, 0x0E8, 0x0EA, 0x0EB, 0x016, 0x03E, 0x03F, - 0x06C, 0x089, 0x08A, 0x0A3, 0x0A4, 0x0D4, 0x0DD, 0x0EC, - 0x0EE, 0x11A, 0x1D2, 0x024, 0x025, 0x02E, 0x027, 0x0C2, - 0x0C0, 0x0DA, 0x0DB, 0x111, 0x144, 0x116, 0x14A, 0x145, - 0x1B8, 0x1AB, 0x1DA, 0x1DE, 0x1DB, 0x1DF, 0x236, 0x237, - 0x3A6, 0x3A7, 0x04D, 0x04C, 0x05E, 0x05F, 0x183, 0x182, - 0x186, 0x221, 0x187, 0x220, 0x22E, 0x22F, 0x296, 0x354, - 0x297, 0x355, 0x372, 0x373, 0x016, -}; - -static const uint8_t vec1_huffbits[HUFF_VEC1_SIZE] = { - 7, 6, 5, 5, 5, 5, 5, 5, - 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 5, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 5, +static const uint8_t vec1_table[HUFF_VEC1_SIZE][2] = { + { 7, 5 }, { 32, 8 }, { 59, 10 }, { 60, 10 }, { 83, 11 }, + { 82, 11 }, { 62, 10 }, { 33, 8 }, { 45, 9 }, { 61, 10 }, + { 84, 11 }, { 85, 11 }, { 1, 6 }, { 13, 5 }, { 19, 6 }, + { 25, 7 }, { 34, 8 }, { 46, 9 }, { 47, 9 }, { 14, 5 }, + { 6, 5 }, { 64, 10 }, { 87, 11 }, { 86, 11 }, { 63, 10 }, + { 88, 11 }, { 90, 11 }, { 35, 8 }, { 26, 7 }, { 0, 7 }, + { 48, 9 }, { 65, 10 }, { 66, 10 }, { 36, 8 }, { 15, 5 }, + { 20, 6 }, { 91, 11 }, { 89, 11 }, { 67, 10 }, { 49, 9 }, + { 50, 9 }, { 69, 10 }, { 92, 11 }, { 93, 11 }, { 27, 7 }, + { 5, 5 }, { 37, 8 }, { 68, 10 }, { 71, 10 }, { 51, 9 }, + { 52, 9 }, { 70, 10 }, { 94, 11 }, { 96, 11 }, { 38, 8 }, + { 21, 6 }, { 16, 5 }, { 4, 5 }, { 28, 7 }, { 53, 9 }, + { 95, 11 }, { 97, 11 }, { 73, 10 }, { 39, 8 }, { 29, 7 }, + { 72, 10 }, { 98, 11 }, { 99, 11 }, { 54, 9 }, { 40, 8 }, + { 22, 6 }, { 30, 7 }, { 55, 9 }, { 74, 10 }, { 76, 10 }, + { 56, 9 }, { 75, 10 }, { 77, 10 }, { 17, 5 }, { 3, 5 }, + { 23, 6 }, { 41, 8 }, { 57, 9 }, { 78, 10 }, { 79, 10 }, + { 31, 7 }, { 10, 4 }, { 9, 4 }, { 100, 5 }, { 2, 5 }, + { 11, 4 }, { 8, 4 }, { 18, 5 }, { 42, 8 }, { 58, 9 }, + { 80, 10 }, { 81, 10 }, { 43, 8 }, { 44, 8 }, { 24, 6 }, + { 12, 4 }, }; diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 7cfd0c04be..1909ce2dad 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -318,27 +318,27 @@ static av_cold int get_rate(AVCodecContext *avctx) static av_cold void decode_init_static(void) { - INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, - scale_huffbits, 1, 1, - scale_huffcodes, 2, 2, 616); - INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, - scale_rl_huffbits, 1, 1, - scale_rl_huffcodes, 4, 4, 1406); - INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, - coef0_huffbits, 1, 1, - coef0_huffcodes, 4, 4, 2108); - INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, - coef1_huffbits, 1, 1, - coef1_huffcodes, 4, 4, 3912); - INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, - vec4_huffbits, 1, 1, - vec4_huffcodes, 2, 2, 604); - INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, - vec2_huffbits, 1, 1, - vec2_huffcodes, 2, 2, 562); - INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, - vec1_huffbits, 1, 1, - vec1_huffcodes, 2, 2, 562); + INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, + &scale_table[0][1], 2, + &scale_table[0][0], 2, 1, 0, 0, 616); + INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, + &scale_rl_table[0][1], 2, + &scale_rl_table[0][0], 2, 1, 0, 0, 1406); + INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, + coef0_lens, 1, + coef0_syms, 2, 2, 0, 0, 2108); + INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, + &coef1_table[0][1], 2, + &coef1_table[0][0], 2, 1, 0, 0, 3912); + INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, + &vec4_table[0][1], 2, + &vec4_table[0][0], 2, 1, 0, 0, 604); + INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, + &vec2_table[0][1], 2, + &vec2_table[0][0], 2, 1, 0, 0, 562); + INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, + &vec1_table[0][1], 2, + &vec1_table[0][0], 2, 1, 0, 0, 562); /** calculate sine values for the decorrelation matrix */ for (int i = 0; i < 33; i++) From patchwork Sun Sep 4 21:58:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37661 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2274961pzh; Sun, 4 Sep 2022 15:00:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vLg5qb/qK0gJTGhwNSXjOA2NlXoA4GXnuAmJMVP6I9nI4Dtp1TutwvK0Bh/ltksEMK8P8 X-Received: by 2002:a17:907:a0c6:b0:73d:bb3c:328b with SMTP id hw6-20020a170907a0c600b0073dbb3c328bmr32772366ejc.354.1662328828571; Sun, 04 Sep 2022 15: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 o21-20020a170906975500b0073d6e0416f9si6967933ejy.671.2022.09.04.15.00.28; Sun, 04 Sep 2022 15: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=JEfE9gzv; 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 7632968B9E6; Mon, 5 Sep 2022 01:00:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2042.outbound.protection.outlook.com [40.92.58.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5100B68B8C3 for ; Mon, 5 Sep 2022 01:00:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WaQddanoKYgC1j/edvvLXgtYK1Elkiqw4yhluX0AOrn/AK3pIUGjhqprn9Aw1hJzUJSU6CEg2Tp2eqsfjAGSwoiND0Hl2Q3ZsdKRZGMXA/95H/MZq78Wsi3B1s4KYUHCJqtROl5LwmWP301cDI/mPDcw01bPu5rRk4DiXQmaNy/dKJm1rTXfkwPsq7XAJJJkTRPOZ+GhqRU1yJ7T88XgD4LqoS5YRi6mBN714YRzrJY/f6jnBIZ1MX7xGYw/OiiPcTOFLN6G1sVnLhMwvRInJt/9UZDARtq6M06oh/giOt0lJaxs4zQZcR2mOc9ZhrLjdizhrsnYcwMU6DsN9sD2fA== 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=Zc3Q6lGjdV33WhC/llsyQ4q7Cs5XO2LAfBuMetQVkv0=; b=DJN4g1NGtmEVhPkjGwCI7LrFywE0qJHoA6aaAyhYj4opntqshNIOUWhTWE/BCI6dNNeIFvoknSZl3Bk5xeHEMDlsEe7BU9WAPYvWdCcnr7hbhg2dxPUjb8EQr2n1YTK7mvEakWV0/vXb5u12Vuay2SojDNuBF8zfh8/oyuUGx11k4AdwvilSQHacjqSff4D1C2HQodhj4/lVOOplpNU9z0KPfSXz2EyPZIW7JX2SsZepcwQAYWwOC30KiNe4N3tSYqjN9OCKjolWJ5aa2lh/Jea5+rwdMjnU80vo6mLOegm8yZneigHxked1pMBG7V2strmTx1d87My/UQoPnMNuoA== 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=Zc3Q6lGjdV33WhC/llsyQ4q7Cs5XO2LAfBuMetQVkv0=; b=JEfE9gzvzOuYbgsHQWbUYBg46IXnpD1ivV8M/rTaufROzIhfcIRry/xh1rj4tV1mY+eBvMCZl6zPfLdf7IDvKw/vHfqT+JSS2Ms8uNpWOTsZm5SSNBpunonPmDMIf3Q2LyHq3mtHiE7VYe4iZwYM0fC5ytNP+ocEfrznbhNr0HKdxhUU0PWZzxte3txgOpQh4AnzVfws/afm0JSTP0hXEDUUpSWhAPA7wSomqIjX6YCkT8TMvXGeaG8NqRwMyU+oAsNN9uo2rtu37l9HXBZu2YNXu7E829LRps/W338BM5vXak/XtGcdK7fSeLNJLJjGttskHiOWHyeoGUvYDHI7dw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 22:00:02 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 22:00:01 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:50 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [YtGftLedRHu4IbSvwMBjLDiENr0CJITOXoMlQCj1L8k=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 662bae62-df78-4cf1-4f64-08da8ec0d103 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpOESH07gTfyFtwl3n8uZhuc4hXAl/ISycNPAVE7a/iyc9nU4EFnyWhLiPtgFCK8hhh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feDwndtwShkILOtxbeMlDQRRL/Av0nxVIQ/2wTxODSiM6bN/R9/ubgRy9vqmtTQpVmMpNHUfB3TuFA8tgAqll17SGygzwwUPoaWa5tt8/zThsPvgbne6AUqLb+/XGphZg8QDEiWaN9eFaanMsOIsdMGkPPq6lupAp3ij9T5UUXva9llbHHIc6ewg2q5lzgX7BpTMR2rwtVW9pCHdVWuxtBNlCt8uIndpGAILFyyipfoFPTdJ1SWW6v1E6L/MkINhPhV8M5bXhRMJWK6BGCvhG4rnIv75ffLvFFQav5PEOOoNfBqTRC/5UXq4bNvO5J6NsJt7KpjAe3pNNehfnBjYrI2rDEdlgYARYpFkvyqSPqgxWmCpRJVX1c6q9HT8Ild0qeVkMxjcFOHPLhDjzObFHim0DSMxdnQdLaqctCyI/CdJ0nniOERm7Id4B2Cn6NM1lJBKb4MIuLepI77Y5evaBFb0vQEX2K5R5L4RVSn3/G1PJMj1qS9q03Dbv8Nf34w1+SUxwgNaoNP8SMCH5J3Nsulk6ZxkAzuBT2lEDe4YJjRa5Lfm3YlI7M8EA8OBfngdVLDAGhE116cuVN/DOPFU3WppN95a2E0fVcPiJifbhlzXgZDB2kw3/YpbfuiCLTXSN61Sl/QnLE6+KLpQCPuc9oA7dWzkcbb654t8XZJU X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 662bae62-df78-4cf1-4f64-08da8ec0d103 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 22:00:01.9741 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 8/9] avcodec/wmaprodec: Move applying offset to VLC creation 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: Pxvtkd1UuFF9 Signed-off-by: Andreas Rheinhardt --- libavcodec/wmaprodec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 1909ce2dad..698841dcaf 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -320,7 +320,7 @@ static av_cold void decode_init_static(void) { INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, &scale_table[0][1], 2, - &scale_table[0][0], 2, 1, 0, 0, 616); + &scale_table[0][0], 2, 1, -60, 0, 616); INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, &scale_rl_table[0][1], 2, &scale_rl_table[0][0], 2, 1, 0, 0, 1406); @@ -1056,7 +1056,7 @@ static int decode_scale_factors(WMAProDecodeCtx* s) s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1; val = 45 / s->channel[c].scale_factor_step; for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) { - val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH) - 60; + val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH); *sf = val; } } else { From patchwork Sun Sep 4 21:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37662 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2275041pzh; Sun, 4 Sep 2022 15:00:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR50DWaJg+/R2vrpbEc8UTwuT1mHLVCazgVEex7kxGXo/Ibb1ZsGirYwTfhzaJDKxFSuOMcA X-Received: by 2002:a17:907:9603:b0:742:9ed3:3af2 with SMTP id gb3-20020a170907960300b007429ed33af2mr17054160ejc.510.1662328838246; Sun, 04 Sep 2022 15:00:38 -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 t21-20020a170906269500b00741550f828bsi5596287ejc.919.2022.09.04.15.00.37; Sun, 04 Sep 2022 15:00:38 -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=qdt4Okit; 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 6183668B9F0; Mon, 5 Sep 2022 01:00:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2042.outbound.protection.outlook.com [40.92.58.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73CBA68B85C for ; Mon, 5 Sep 2022 01:00:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avCla36YUemyLxnitSrE/cMrWfg3mHqLWRe/JpQDkb7MLO93GXjsncIMHcJYSRKMgy+FOqVi/p9yB1Jd6ogYhygJrczTi7MxyjNbRE9lh+6aBG73QQ0/xpd7pxN7ykhzCzgf9Kp5++AwVh8iXLtf3cCp8Ozdu8rjZ2IxSYTJRm0m4Zp3C95aMyfkYyD5gB8z8Xpgw8u35h4GnSk+Vd45fLKkONbOILgexteV6yRGRb6WgWo2lvupXlrmZs9CrJUm5ICTA83ncjl8EOPwjnhGfDSauk9imAzKeFb1cPiKc8lp9SqfqplmgMSfG5b5jSAa+/Gm0DSxUdTUEtZAqH3VAw== 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=DrEGbXqaKgVmojTbVddLA53t69pD1emCbgQV7m+cBTM=; b=hdO29scK5+7k/BRkGHNjFJRRrjJ0rwE1eOUdN6jBzayXjYqpYCjRE6BoCzaglBBxuZtNmF3Q1zt7VAITkDyOB1QzD+nRjX79V50CEkbxEb7/x5WqwZQxowmIzFPM92qatiFBhh217rB4kVQWANPIAD+oRSCRSN+XFffwKFSDgDzduC6BGzX7PmULDIOM4YUzqF3Rq2nysZzo+bzS4uwPVfVqaKOqKV1FAD495DZzHS8jXcptV7s0mmMQZ4q3wRTfgMQtQwZMHiPlNpdcROpe22VXJXzkbs3GD5YZvRYROxvGqTTMV1Bxv+VcbxNvbmcdl5rqEkntTYk0YUnGxanXog== 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=DrEGbXqaKgVmojTbVddLA53t69pD1emCbgQV7m+cBTM=; b=qdt4OkitEMwfjpdjNprAvvVwNLoN/t03xmCqejQoR7WL4BzQLakUM0EdVukVCGWXQ2BkvvPeSQupyK2gG1I7WqjFARWy9MEFIIe8Y9rvgFUTXjy9Y7ps7g8QGmabOEkIeTDDXWEjdQ4XrHu6AsMA/E1f324CMqoo3x7Cb87na6WjKf48op/3R+NTtA6YVaZb439nBNklKAIwmu5hjO0RX7yoDR3Ouvt0S3/lGjjgS0j6v1+bK1C4U6e22dJdDKrQ2mSkdPO6QMBGEfS8j0Iircfca2R9Mp3cZlSTvJUBXbiUhQleMDgZ4dEKJpFuh4Jo/ZNqAGvM7nctnRwjEj9Jbw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0235.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Sun, 4 Sep 2022 22:00:03 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f85a:9a02:f8be:7c47%2]) with mapi id 15.20.5588.010; Sun, 4 Sep 2022 22:00:03 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 23:58:51 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [MHjohJAGRXiBQxT2/WMQgDEXX4mv4rdJTPH74ksy2xY=] X-ClientProxiedBy: ZR0P278CA0037.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::6) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20220904215851.4164981-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cee2465d-8d36-43c0-77be-08da8ec0d1b8 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpOESH07gTfyFtwl3n8uZhubFIPoIw3K2hrl3iD1ugtLm0lVFb/JaSJDLedGCO/98qGk5sHg5++RFvjTP+zx+7X+MD8FRMJk6LRKwNY29ISPmzBjfw5gPsckPNzMGyO8TFLUNIxmBHw8McTkvuYAdhuY0lpBpOUfQBpZi1ooLN8sQk5HsK1L6AufKkF5l5iOc+5cKw3Czo0X1a5egPZsx6JjHtc9E4zlBWGoAiKRB0jAluFxxvbagE1E8psfwn26435kldDTO4wTJXCWKkVhoUVjuvrOEKgVMyX+R7EycBDg24T2KcclACk/VNcUrYXwiud9pywkcYGXGiYg3up4gODBjBPT74kbaoJcv5GY31QyytIRw2pnEgaEuMEGfBAbnYYFPWOSMdzIwg4EnlQtcI8JMsr6BZVX/spPq4Ua2nlWURXC2zvafPRBDsyZu1IERTugn+0tt/Sb1PQ7GWH6Y7L3KrQkYwf6Y0qZrba6RBTTOO811DOfqRMpORRulg4ZT2YdAq1UT+31LPe1PVqNnuAWyh9TdArxpAYrb1SSQt4W/FRvv/nGjty3oHuAORB+WKtV+j1bcvL017t52naePLLPS9G7BeBGOCwquQaLmsLVp3snfwPi9fCCKP8zSKS5ofEotIbeRM+u0K0bTVgerPRy/dQPyuPpsFkIKyGXQdZkJn/o9rmpERfvk5wtZwH3XFVR6GdO5JJa/0YwmaqfAJF8RTS5jnJ5tDUbH4l3QHtbCA/6qkQWe1wNsa7AfxQ2yo= X-MS-TrafficTypeDiagnostic: AS8P250MB0235:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qIU6PH2ngYxq0r5FWOUYm75yMUmvxlWFMTSBBkuph617eMnLG6y4QUvIENFRMYd4RJOkYEPPdHH8y0nVPOyOBmpPMyWNL1609dBOlQsvE1p/6xRpCdy2krsAw+bdsjWumJA6xy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2xLDCPfXdqXZPVLyEqeKTknQoz1Qg4UrbfWSiNr9AVH45t0i3cLsu3GuOZpn6q0GeJIiYW7uhamMVzVQXGQWnXOa9qxiSFmjTvtY/Au4AUHfqQU1dahSl6uUKn8Sp7gFDTl1d30OfHU7NR8Zfv3KTLRkaETM4OzCQh/qJAqsDBov8gbsx5UCF8VEECG644IMIuBhtZLZHBdXlYa/z7qb6D8eV09cBK9feEiyz8fZ8ptiqqPoLw6DIH4Av6WJ5qgLno5DW55lkKGq7/5+VfZL8cQsoAIAyC8Raxnz+5dOCmH+Zyebf/HxHqJA8dOor6nsheuhMdMUyS+k90zwE+WqumV9tEPKAEUiLncn8Z5B62457I6J1diO7gUmw/8vNXs4RwR8utwzbsS9Xs2VY0xVnPPdyVDOdEn7/VE4HfA28Djr0Lv5bUrB2Cmd3K5n85W1tfJa6dhTb0DwkHti8KXSBoiSdgPie8DBxcuj/NgyO2CxnyHRpiiOuOgRScdFbbxUZwJ/7vQgBP2Ro1zBghpiDAK1hSCOSxZ/kdhv9JiguZ+PhUKeW5CDazhHLOknxEusUpC4t6CHoZf4Ihft32j8z8APfgfDehO4SHN8p7/woFrgw3ebqsRFlcBV5xmqn3MdhqUEd64mGcA/rW+Z7VLdm792MIXWS17jh0EjFlzCWEegNYXjpcUhGs39BOyinNoRaFmJxV0DSUe1WNtQiY61zc8LAHFG1Wh1fUOyaCUTgE/ZdGPL2pYbwvGzRgowdkIlPZcZjnERit0FBEmVogMccWYk+qYq294wi/t3hC8mP1exnHc2cxmfQb+5BzWt1hjbB5LdWbEb29a84ksNJxvv9 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cee2465d-8d36-43c0-77be-08da8ec0d1b8 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2022 22:00:03.2551 (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: AS8P250MB0235 Subject: [FFmpeg-devel] [PATCH 9/9] avcodec/wmaprodec: Use symbol table more efficiently 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: LasewwoZAXrf By using a symbol table one can already bake in applying a LUT on the return value of get_vlc2(). So change the symbol table for the vec2 and vec4 tables to avoid using the symbol_to_vec2/4 LUTs. Signed-off-by: Andreas Rheinhardt --- libavcodec/wmaprodata.h | 147 +++++++++++++++++----------------------- libavcodec/wmaprodec.c | 22 +++--- 2 files changed, 72 insertions(+), 97 deletions(-) diff --git a/libavcodec/wmaprodata.h b/libavcodec/wmaprodata.h index 3a30be40b5..057ce1d02d 100644 --- a/libavcodec/wmaprodata.h +++ b/libavcodec/wmaprodata.h @@ -325,67 +325,73 @@ static const float coef1_level[HUFF_COEF1_SIZE] = { */ #define HUFF_VEC4_SIZE 127 #define HUFF_VEC4_MAXBITS 14 -static const uint8_t vec4_table[HUFF_VEC4_SIZE][2] = { - { 126, 1 }, { 76, 6 }, { 28, 8 }, { 93, 10 }, { 69, 10 }, - { 117, 10 }, { 98, 10 }, { 31, 8 }, { 84, 8 }, { 38, 10 }, - { 9, 10 }, { 108, 9 }, { 96, 8 }, { 73, 8 }, { 67, 9 }, - { 121, 12 }, { 90, 12 }, { 110, 11 }, { 35, 12 }, { 54, 12 }, - { 17, 11 }, { 86, 9 }, { 44, 9 }, { 82, 8 }, { 41, 8 }, - { 36, 9 }, { 103, 9 }, { 78, 8 }, { 66, 8 }, { 11, 9 }, - { 97, 9 }, { 4, 12 }, { 19, 12 }, { 70, 12 }, { 55, 14 }, - { 20, 14 }, { 5, 13 }, { 51, 11 }, { 94, 11 }, { 106, 9 }, - { 101, 8 }, { 83, 9 }, { 42, 9 }, { 45, 11 }, { 46, 11 }, - { 112, 10 }, { 99, 9 }, { 8, 8 }, { 56, 6 }, { 1, 6 }, - { 75, 6 }, { 27, 6 }, { 72, 6 }, { 62, 6 }, { 113, 11 }, - { 124, 11 }, { 114, 10 }, { 15, 11 }, { 116, 11 }, { 24, 10 }, - { 59, 10 }, { 39, 11 }, { 10, 11 }, { 118, 9 }, { 105, 7 }, - { 71, 6 }, { 77, 7 }, { 85, 7 }, { 21, 6 }, { 7, 6 }, - { 6, 6 }, { 0, 5 }, { 79, 7 }, { 100, 11 }, { 48, 11 }, - { 87, 10 }, { 107, 9 }, { 92, 8 }, { 57, 6 }, { 119, 9 }, - { 29, 9 }, { 16, 10 }, { 49, 10 }, { 64, 9 }, { 95, 8 }, - { 58, 8 }, { 26, 6 }, { 61, 6 }, { 22, 6 }, { 23, 8 }, - { 81, 8 }, { 13, 9 }, { 53, 12 }, { 52, 12 }, { 123, 11 }, - { 33, 10 }, { 12, 8 }, { 40, 8 }, { 30, 8 }, { 47, 10 }, - { 111, 10 }, { 3, 10 }, { 68, 10 }, { 74, 9 }, { 115, 9 }, - { 91, 8 }, { 120, 10 }, { 25, 11 }, { 122, 11 }, { 89, 9 }, - { 2, 8 }, { 37, 8 }, { 65, 8 }, { 43, 9 }, { 34, 9 }, - { 14, 10 }, { 60, 11 }, { 18, 12 }, { 125, 12 }, { 50, 9 }, - { 80, 9 }, { 88, 9 }, { 109, 8 }, { 32, 8 }, { 102, 7 }, - { 104, 7 }, { 63, 7 }, +static const uint8_t vec4_lens[HUFF_VEC4_SIZE] = { + 1, 6, 8, 10, 10, 10, 10, 8, 8, 10, 10, 9, 8, 8, 9, 12, 12, 11, + 12, 12, 11, 9, 9, 8, 8, 9, 9, 8, 8, 9, 9, 12, 12, 12, 14, 14, + 13, 11, 11, 9, 8, 9, 9, 11, 11, 10, 9, 8, 6, 6, 6, 6, 6, 6, + 11, 11, 10, 11, 11, 10, 10, 11, 11, 9, 7, 6, 7, 7, 6, 6, 6, 5, + 7, 11, 11, 10, 9, 8, 6, 9, 9, 10, 10, 9, 8, 8, 6, 6, 6, 8, + 8, 9, 12, 12, 11, 10, 8, 8, 8, 10, 10, 10, 10, 9, 9, 8, 10, 11, + 11, 9, 8, 8, 8, 9, 9, 10, 11, 12, 12, 9, 9, 9, 8, 8, 7, 7, + 7, +}; + +/* The entry in the following table with symbol zero indicates + * that four further entries are coded explicitly; all other + * entries encode four numbers in the 0..15 range via + * the four nibbles of (symbol - 1). */ +static const uint16_t vec4_syms[HUFF_VEC4_SIZE] = { + 0, 4370, 275, 8195, 4146, 12545, 8225, 290, 4625, 515, + 20, 8706, 8210, 4355, 4131, 16385, 5121, 8961, 321, 1041, + 51, 4641, 546, 4610, 530, 513, 8451, 4385, 4130, 33, + 8211, 5, 66, 4161, 1281, 81, 6, 801, 8196, 8481, + 8449, 4611, 531, 561, 769, 12290, 8226, 19, 4097, 2, + 4369, 274, 4354, 4114, 12291, 16641, 12305, 49, 12321, 260, + 4100, 516, 21, 12546, 8466, 4353, 4371, 4626, 257, 18, + 17, 1, 4386, 8241, 771, 4865, 8705, 8194, 4098, 12561, + 276, 50, 785, 4116, 8209, 4099, 273, 4113, 258, 259, + 4609, 35, 1026, 1025, 16401, 305, 34, 529, 289, 770, + 12289, 4, 4145, 4356, 12306, 8193, 12801, 261, 16386, 4881, + 3, 514, 4129, 545, 306, 36, 4101, 65, 20481, 786, + 4401, 4866, 8721, 291, 8450, 8465, 4115, }; #define HUFF_VEC2_SIZE 137 #define HUFF_VEC2_MAXBITS 12 +/* The entry in the following table with symbol zero indicates + * that two further entries are coded explicitly; all other + * entries encode two numbers in the 0..15 range via + * (symbol - 1) & 0xF and (symbol - 1) >> 4. */ static const uint8_t vec2_table[HUFF_VEC2_SIZE][2] = { - { 18, 5 }, { 119, 10 }, { 132, 11 }, { 44, 11 }, { 68, 10 }, - { 121, 11 }, { 11, 11 }, { 75, 8 }, { 72, 7 }, { 36, 7 }, - { 104, 9 }, { 122, 10 }, { 27, 10 }, { 88, 9 }, { 66, 9 }, - { 33, 5 }, { 48, 6 }, { 91, 9 }, { 7, 9 }, { 85, 8 }, - { 62, 7 }, { 136, 3 }, { 64, 8 }, { 97, 9 }, { 80, 10 }, - { 123, 10 }, { 92, 8 }, { 120, 10 }, { 9, 10 }, { 42, 10 }, - { 108, 10 }, { 59, 6 }, { 20, 6 }, { 23, 8 }, { 109, 9 }, - { 25, 9 }, { 58, 7 }, { 4, 7 }, { 134, 11 }, { 133, 12 }, - { 14, 12 }, { 124, 10 }, { 110, 9 }, { 93, 8 }, { 38, 8 }, - { 78, 9 }, { 105, 9 }, { 73, 7 }, { 50, 7 }, { 40, 9 }, - { 56, 10 }, { 30, 11 }, { 126, 11 }, { 125, 10 }, { 69, 10 }, - { 111, 9 }, { 35, 6 }, { 60, 6 }, { 31, 6 }, { 2, 6 }, - { 16, 6 }, { 1, 6 }, { 86, 8 }, { 76, 8 }, { 94, 8 }, - { 52, 8 }, { 46, 5 }, { 19, 5 }, { 98, 9 }, { 54, 9 }, - { 28, 10 }, { 127, 10 }, { 106, 9 }, { 81, 8 }, { 6, 8 }, - { 89, 9 }, { 12, 11 }, { 135, 12 }, { 15, 12 }, { 43, 10 }, - { 112, 9 }, { 67, 9 }, { 82, 7 }, { 22, 7 }, { 74, 7 }, - { 63, 7 }, { 128, 10 }, { 115, 10 }, { 100, 9 }, { 65, 8 }, - { 47, 5 }, { 34, 5 }, { 95, 8 }, { 57, 10 }, { 10, 10 }, - { 116, 9 }, { 0, 7 }, { 3, 6 }, { 45, 6 }, { 61, 6 }, - { 8, 9 }, { 26, 9 }, { 101, 8 }, { 37, 7 }, { 49, 6 }, - { 83, 7 }, { 24, 8 }, { 113, 9 }, { 79, 9 }, { 87, 8 }, - { 117, 9 }, { 129, 10 }, { 131, 10 }, { 107, 9 }, { 99, 9 }, - { 39, 8 }, { 102, 8 }, { 41, 9 }, { 118, 9 }, { 96, 8 }, - { 77, 8 }, { 70, 7 }, { 5, 7 }, { 51, 7 }, { 55, 9 }, - { 29, 10 }, { 130, 11 }, { 13, 11 }, { 114, 9 }, { 90, 9 }, - { 71, 6 }, { 21, 6 }, { 84, 7 }, { 103, 8 }, { 53, 8 }, - { 17, 4 }, { 32, 4 }, + { 19, 5 }, { 165, 10 }, { 211, 11 }, { 46, 11 }, { 75, 10 }, + { 177, 11 }, { 12, 11 }, { 86, 8 }, { 83, 7 }, { 38, 7 }, + { 133, 9 }, { 178, 10 }, { 28, 10 }, { 104, 9 }, { 73, 9 }, + { 35, 5 }, { 52, 6 }, { 113, 9 }, { 8, 9 }, { 101, 8 }, + { 69, 7 }, { 0, 3 }, { 71, 8 }, { 119, 9 }, { 91, 10 }, + { 179, 10 }, { 114, 8 }, { 166, 10 }, { 10, 10 }, { 44, 10 }, + { 145, 10 }, { 66, 6 }, { 21, 6 }, { 24, 8 }, { 146, 9 }, + { 26, 9 }, { 65, 7 }, { 5, 7 }, { 226, 11 }, { 225, 12 }, + { 15, 12 }, { 180, 10 }, { 147, 9 }, { 115, 8 }, { 40, 8 }, + { 89, 9 }, { 134, 9 }, { 84, 7 }, { 54, 7 }, { 42, 9 }, + { 60, 10 }, { 31, 11 }, { 193, 11 }, { 181, 10 }, { 76, 10 }, + { 148, 9 }, { 37, 6 }, { 67, 6 }, { 33, 6 }, { 3, 6 }, + { 17, 6 }, { 2, 6 }, { 102, 8 }, { 87, 8 }, { 116, 8 }, + { 56, 8 }, { 50, 5 }, { 20, 5 }, { 120, 9 }, { 58, 9 }, + { 29, 10 }, { 194, 10 }, { 135, 9 }, { 97, 8 }, { 7, 8 }, + { 105, 9 }, { 13, 11 }, { 241, 12 }, { 16, 12 }, { 45, 10 }, + { 149, 9 }, { 74, 9 }, { 98, 7 }, { 23, 7 }, { 85, 7 }, + { 70, 7 }, { 195, 10 }, { 161, 10 }, { 129, 9 }, { 72, 8 }, + { 51, 5 }, { 36, 5 }, { 117, 8 }, { 61, 10 }, { 11, 10 }, + { 162, 9 }, { 1, 7 }, { 4, 6 }, { 49, 6 }, { 68, 6 }, + { 9, 9 }, { 27, 9 }, { 130, 8 }, { 39, 7 }, { 53, 6 }, + { 99, 7 }, { 25, 8 }, { 150, 9 }, { 90, 9 }, { 103, 8 }, + { 163, 9 }, { 196, 10 }, { 210, 10 }, { 136, 9 }, { 121, 9 }, + { 41, 8 }, { 131, 8 }, { 43, 9 }, { 164, 9 }, { 118, 8 }, + { 88, 8 }, { 81, 7 }, { 6, 7 }, { 55, 7 }, { 59, 9 }, + { 30, 10 }, { 209, 11 }, { 14, 11 }, { 151, 9 }, { 106, 9 }, + { 82, 6 }, { 22, 6 }, { 100, 7 }, { 132, 8 }, { 57, 8 }, + { 18, 4 }, { 34, 4 }, }; @@ -414,37 +420,6 @@ static const uint8_t vec1_table[HUFF_VEC1_SIZE][2] = { { 80, 10 }, { 81, 10 }, { 43, 8 }, { 44, 8 }, { 24, 6 }, { 12, 4 }, }; - - -static const uint16_t symbol_to_vec4[HUFF_VEC4_SIZE] = { - 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, - 20, 32, 33, 34, 35, 48, 49, 50, 64, 65, - 80, 256, 257, 258, 259, 260, 272, 273, 274, 275, - 288, 289, 290, 304, 305, 320, 512, 513, 514, 515, - 528, 529, 530, 544, 545, 560, 768, 769, 770, 784, - 785, 800, 1024, 1025, 1040, 1280, 4096, 4097, 4098, 4099, - 4100, 4112, 4113, 4114, 4115, 4128, 4129, 4130, 4144, 4145, - 4160, 4352, 4353, 4354, 4355, 4368, 4369, 4370, 4384, 4385, - 4400, 4608, 4609, 4610, 4624, 4625, 4640, 4864, 4865, 4880, - 5120, 8192, 8193, 8194, 8195, 8208, 8209, 8210, 8224, 8225, - 8240, 8448, 8449, 8450, 8464, 8465, 8480, 8704, 8705, 8720, - 8960, 12288, 12289, 12290, 12304, 12305, 12320, 12544, 12545, 12560, - 12800, 16384, 16385, 16400, 16640, 20480, 0, -}; - - -static const uint8_t symbol_to_vec2[HUFF_VEC2_SIZE] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 112, 113, 114, 115, 116, 117, 118, 119, 120, 128, 129, 130, 131, 132, - 133, 134, 135, 144, 145, 146, 147, 148, 149, 150, 160, 161, 162, 163, 164, - 165, 176, 177, 178, 179, 180, 192, 193, 194, 195, 208, 209, 210, 224, 225, - 240, 0, -}; /** @} */ diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 698841dcaf..701dfa955c 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -331,11 +331,11 @@ static av_cold void decode_init_static(void) &coef1_table[0][1], 2, &coef1_table[0][0], 2, 1, 0, 0, 3912); INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, - &vec4_table[0][1], 2, - &vec4_table[0][0], 2, 1, 0, 0, 604); + vec4_lens, 1, + vec4_syms, 2, 2, -1, 0, 604); INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, &vec2_table[0][1], 2, - &vec2_table[0][0], 2, 1, 0, 0, 562); + &vec2_table[0][0], 2, 1, -1, 0, 562); INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, &vec1_table[0][1], 2, &vec1_table[0][0], 2, 1, 0, 0, 562); @@ -957,10 +957,10 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c) idx = get_vlc2(&s->gb, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH); - if (idx == HUFF_VEC4_SIZE - 1) { + if ((int)idx < 0) { for (i = 0; i < 4; i += 2) { idx = get_vlc2(&s->gb, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH); - if (idx == HUFF_VEC2_SIZE - 1) { + if ((int)idx < 0) { uint32_t v0, v1; v0 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH); if (v0 == HUFF_VEC1_SIZE - 1) @@ -971,15 +971,15 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c) vals[i ] = av_float2int(v0); vals[i+1] = av_float2int(v1); } else { - vals[i] = fval_tab[symbol_to_vec2[idx] >> 4 ]; - vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF]; + vals[i] = fval_tab[idx >> 4 ]; + vals[i+1] = fval_tab[idx & 0xF]; } } } else { - vals[0] = fval_tab[ symbol_to_vec4[idx] >> 12 ]; - vals[1] = fval_tab[(symbol_to_vec4[idx] >> 8) & 0xF]; - vals[2] = fval_tab[(symbol_to_vec4[idx] >> 4) & 0xF]; - vals[3] = fval_tab[ symbol_to_vec4[idx] & 0xF]; + vals[0] = fval_tab[ idx >> 12 ]; + vals[1] = fval_tab[(idx >> 8) & 0xF]; + vals[2] = fval_tab[(idx >> 4) & 0xF]; + vals[3] = fval_tab[ idx & 0xF]; } /** decode sign */