From patchwork Tue Sep 13 11:28:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37884 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp625233pzh; Tue, 13 Sep 2022 04:29:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6t2pC7cN9S8j6MvSagYweEm5LvC8UKKcXVNQWJpo6aiHEzdU0ulpgLzWkPC+4W13hCd2/g X-Received: by 2002:a05:6402:5246:b0:452:76a7:934d with SMTP id t6-20020a056402524600b0045276a7934dmr1225781edd.137.1663068549147; Tue, 13 Sep 2022 04:29:09 -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 sd42-20020a1709076e2a00b0077ff5540458si1301331ejc.68.2022.09.13.04.29.08; Tue, 13 Sep 2022 04:29:09 -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=L7NXZ8xk; 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 3871E68BB0B; Tue, 13 Sep 2022 14:29:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073104.outbound.protection.outlook.com [40.92.73.104]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20CB268BA2C for ; Tue, 13 Sep 2022 14:28:57 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7A40cjYs6PbKSY/FFS7AkWbZbL85OQUgBMhRKYpcrxtT9B0L1IrJ6cWREmFdYpS4wU9QhRgMX9rNcbp7d5vFMFwRa3DAbtrdIdBhCW5TDrVa6UKeWlGukAhXo/+rIdBLnA4fEgPJW8UVXiv29OXCxwo0OJSJnIjKSlLBgTA4cK9F4ULyvXKNF1jCYWOcRaJFEWI17vJhkbmVzQiUYawst8T1q4Kq8zrAZRaeBPqLW0i+KMQcml57XX0jYbujuTNxZkgrty5TrJzpMCPYCt2nmeMfvffRkb7ad8mNylIKtlLM1WVd7jAiyp9ju99vN71DwlwIdDh4MTuMFvutjMjnA== 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=+DD9qAmZjv6UDj7e9qJIO1BUrVc1BRolwORkPpRX8zI=; b=RhkquNq0xz5bpD9nmalVOXBVqQ3mi4SaKdcn3071K1jDBGY/WcTjkhqqHGxqebcGNnrrVBl3PoR2pnyOLb5QxTj/fySr0qbWA3Ak5QDv/E8o1i7cpkg48Cq8iKFZ7VCz53QEwCvz/OH5tKoAzwdSxDAhCmM7y3o80ShGMWl/gW0QZVF0EPPEcQGQbf0MWPU604r291bF3KEJrPCFzVROk8exkEtAh+90NyhGBOxF7qjNYlzcMivTDnv2yZoDoscACt2W40zPaI+Hh0qEKOFcYmfqb4FxE+/vjdD1Ohv6+M0G62/LHVldu9bL9DTX/PeMo2V6mJhzKGJMSIkT08wmCQ== 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=+DD9qAmZjv6UDj7e9qJIO1BUrVc1BRolwORkPpRX8zI=; b=L7NXZ8xknAaamqPDyIiKjqu/uvOyCVf4UcGufpeK+ORl9Iu+vJURKQrEWTvk03vXfLIwWLwww19r+JPUzGwUUjZA+tlDsE4AK5m9V6o7jyPMS5Wj7DZMTw2fJI27VbjVzXkA4kRcTmJIJ+hs1nkWHKDnA3jRXUhISHVsKBP3Tg+s+PA/TjSkvrpBrL2QNDoGKUao0utE4bRHrQRQaecS5X3+kNJwBYxZp7JMD1QqSvv8ADgw/ybpvXRtIbLZyYvpxChfHKesBJzDMf4KR72iyhpnnmzxNNep7R1avL+E53O8TbKuB8TldVqAFqs76anmzkG5oWnJ9BEgGITO2PtuNw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AM8P250MB0169.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:320::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:28:53 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:28:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:28:39 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [piZ9Zifv63irJEekktaRb0SJIpnGCehluuOLdxOOktw=] X-ClientProxiedBy: AM6PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:20b:92::28) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913112851.451779-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AM8P250MB0169:EE_ X-MS-Office365-Filtering-Correlation-Id: 70206961-7566-4e09-4e25-08da957b238f X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HA4BuUdAYpf0Bp9tS8dRzhpDQsbtYRTrtL03cAgngmSA8j3WvY2dph++d7xfCjmXiLVIs0jJxFS0nyH4fyMeG3s3DPgkHt0FxBblw28uj0bCO25rp0QRSX4C6ONnnKIcLb5RIdjgLAk3YnYP6VSovV9uV8+7xZrtXStV4hnqFEpUnsvXiGG/XUAq6AhazBIkbHdZ8x9KJvHoWuWjqG+A4mQNJqw7Txa2J9zKaNYvxs14eKEfFv0sB8VajMv8sl44kBNPq0Am3Rq0OfoCDnb3+UVw4sJ3JHZI1lNFMKB3EpJzXS4jtArCnFz8BamM7IYqeKD5RnOhmmhszS7tLxe3yLsMW3iYvVm9y1ojxFCrCpO0rtTnW5xP/usTLD1uxjox7eN/fFP+VpP1P14b425N0c0JEXUN2j9yjhX0JJX65H6GS/Zf3paPckkHuIVU0iwu0vKZQQHnNPmWC5e0SvRqgaMgS3HKB1jvCel5NXoeAteZfl/JTpVRGwBiQb1J7dK6pSQ4X13PWjG2zmogZ9vtVaYNFOvQlmpgeA3/jMv5qCgH8Ku8ZJCQhgQWWRZsVrF5SXNUwVDShi0hercmpAYunEopxWsdaRmVUHl+iFW9XzNBK9NxiiQxGFWBhFZ4EnzBpKEjveYBuOxL/7eaKfHjY82xoLvxKaIx9CguDI2yG/CcZ6uQ6ym2Nx6s3EvYNcSxxvAi55felcLEQPo+VO2pC+ONTv06KazikIVn9wVgXtNFU= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-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F5PzfOyw2dnTDHgTuxXsVOdlbioqoXXkdZyRlSpoA5NlBewaQyzKuyNp8EJ/HgH22769RU51YsJY5l86MSsRRiFuEcH5aVsFkgY23C7zaDRULfmM39CMzoUV63/Nd+wEjVZE+zrIE79OXqrr8xqTbKQoqVPtBtV8tIqX7B4MAO8vau8bmzDzRkIXvex5UswxkAlxfZcLXNiOMo3HJiOsHj1ChCsKdnSQFw7rkmKroWTkNecm9O3t6+rSTkTuCXTlDGxv7VlsHQbzOT5h6XyLvR2YHFYupY3pWn9wICZc7cOkc7xCm+F51mAYfUi/VFCbfCcgOBpXtcY7DbEBuAQFJXv1eVhxgzcB+BLj7Lo16OiisP5dQb6+9vLayjH3AbN3GDB/uo4MswBONUTpi9Y/h+6E9ZHZmbHjt8PQs0j9bQn1G/lE6PpwaYBDacgu3teNz+VAm4n25yOAzkfPTyu+2S/uJtENNcUq3Di4mcL4z/Phty6hTphw28ckzQKxAWK5ZNjWySsEFXLP++gM694V6a4rBYRaL4Iz8G/QrDXr/dvV6sTaOdN0MXdJRd621rB06vIn83oCHfpYolMGXaWv/HU7fUP4b5BHXxODz/ooazY25fGmS0idDzpgAZ6IR4ZD7/iTLcLF0yXUHkN0sOJSG4JMvWtLRoRw9j2eoIn0MBp/adbdXQzgg5ajSHnE9flms2QkYtRi9VzyTR1B/KzpT9RjA9ODHAuJpnCfbKUaVttreaHijXZfKZ/yJRaa8XVHSmaySrbzgKqbj/hqkKoTMRYW+HT8FFGO+D3qa9+6kZQVpIoQIUWPwpNWXZskW6v3wxVbQeSs/4aEgIh4UMZzQObsTIA0yecEGkRrgkolfO+hi7oNUYjlTiHDSBG2VDqC4qChkJepaQzcgh4GX74yxhGllhcctrOvbK2H7fNr+nBFXk6L9HXHvDmmiNqSFfLKwxv+gQk/MDtEfD7WQoGOJCrloPhCpDG X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70206961-7566-4e09-4e25-08da957b238f X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:28:53.8956 (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: AM8P250MB0169 Subject: [FFmpeg-devel] [PATCH 01/13] avcodec/dolby_e_parser: Remove unnecessary headers 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: ggfEy8LsVtJb Possible since 81d070dd09ce154d635414fd07d80a591266b421. Signed-off-by: Andreas Rheinhardt --- libavcodec/dolby_e_parser.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/dolby_e_parser.c b/libavcodec/dolby_e_parser.c index 9f54627356..d2566e5446 100644 --- a/libavcodec/dolby_e_parser.c +++ b/libavcodec/dolby_e_parser.c @@ -21,8 +21,6 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "dolby_e.h" -#include "get_bits.h" -#include "put_bits.h" typedef struct DBEParseContext { DBEContext dectx; From patchwork Tue Sep 13 11:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37885 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp627760pzh; Tue, 13 Sep 2022 04:33:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ump/NZVPzPZR9V+oXn1aYN5jGhTXUoW+33ZIJCoAudgkCPMjPV884VGpQ4UQIdqsaEwsL X-Received: by 2002:a17:907:744:b0:741:36b9:d2cc with SMTP id xc4-20020a170907074400b0074136b9d2ccmr21096902ejb.613.1663068804613; Tue, 13 Sep 2022 04:33:24 -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 n14-20020a05640205ce00b0044efa9938d5si9850818edx.583.2022.09.13.04.33.24; Tue, 13 Sep 2022 04:33:24 -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=q6LS+k2C; 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 98E4D68BB15; Tue, 13 Sep 2022 14:33:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2070.outbound.protection.outlook.com [40.92.90.70]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B578168B96F for ; Tue, 13 Sep 2022 14:33:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ThRguuvmh/II/Y5PodfKNtIbRdRh+YrdmVxlTekPx7FOumW40KhLzDpTGR6w4pFF7hMrKZuayJ/AKeNLvCwhisCKJyv02mPtctyMqOGyd0pcR4iQ06ph355AOOTjESFnyxSO3GH8d0NeAY1/K/7G5N5IEBrTnymvgLxxvyTZphjxDghQEhWY2tbtKNWNMkRlQF2/qijOOTZpQmWVd41xckBLXiB3ctiBXEdvTLDem81Bd7I6+YKQWdkJ5F1wnD+qTYdpabVw+0EOEuOO3n4O4672iLKwEX15x/pDTaUinCKfa4O6Rh547TOx44GT1ZYQ0rwygjive400xw5SN0ikPQ== 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=SC34W5l1Dyly4g+IDEAnc2jdACxrQnNsN07QZbf8UoI=; b=TuUTqhZTOoEuay+N9/WJ+e5gwXTXr7ZyX80xVevN3Wy/FN2GhAyjRWiYmRlq1lKlDb1qjlSQxJXMaW4Bge80dR0wPhMZbGuGXZdKCcmaqhUzUB9h5TcZ7UeZebk/U3+02M9H51oRWXwunZ06UU9FmGDcjEbcpXRT9g8EFTSVRJxDv6pmC7MXU7V92b3yy8pbg7nmwGwn9XoRdTIGORMUkzV2Gw3o0RLh1n/1ma6gSQH0MwH9YudNevdmCvohhrCPb3tmhsY90eiel4NBfrUDnG3KDKOldbJu8zSz8CBRrMwYfUiK4vVp/pz8HeNGyXJSnN61ux5BL5xF7Zfw+QqBaQ== 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=SC34W5l1Dyly4g+IDEAnc2jdACxrQnNsN07QZbf8UoI=; b=q6LS+k2Cj1t8ZP8cQYaDaz3wD5tCW2WyEsUDnYsnUhRZWaCF1ZcXaaUvEvXflE8gXVnAFzWHIlnoni2CQrKefb+u3hmbli5mU1mlmFU85x5Ja2Im+q4pr1hOqr1yulf/JS/LWU0Ef++OAeCKf2xT52JGfxf2UrSG1TevL5VUdA1qVVTZDPkt5spFwcCyxHKs2AtEJnkpQmC2ig9Tc4jPegAxa2O7HUDE3eqx7aKcOkl1XuprdhCNYR8+Y8R1sGUR3DLGVlEY75m2PZoD1rUWhfHnTuJUDYHfKMf5/ECSsqnZQBWQvJY5P+LRpnL7qXHk97mqLXuOmGUbyPvPTHdBFQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:13 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:13 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:32:59 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [w+xsffThKJl7pjt+H1tvu4JGI9ss2vDwG8jg6yNjZAc=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: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GZxpQ9/xTpxd7ihzwxnrtvRSeNTgTcxpvhJuj860qLq9sMPYQ0WK9z92WkL2rfUNVG9SaOC5duWQoTMd6V4LWKt6IvPyTyieeqfmo1ESxhJH1sI3B0nQl064A/MQXnxR4Zed7AnCpFjy3O6MGjJhnAqdJMHw9IJgtjL0CoONhsqw+8LvGM9c1Auhpbve6sYTZrGOdtFaY0RiIqnyk/bkCJwVO+qh3/igBMEt7h1qoMg6lBA1D+jNLAv/foY1gsStdv1HM9XNTiyzwqMhmSFL+aDK4BIGNrTpSD75HEXeaq9pGLCrDwzCufEij/3mUETynLmS39aFpKrcjrtH8MDI0oaCtnIt6jthO//SYB584cOSTQeKWWvMebXKJFVgp0/xmGcikoCUweEZ43MA2R/rxU2KUScj2qqySEMcr36pezuI4ovZd1DxtBMJSykdOdidlpXzTmDWFpuaio/aC74quk/KXtLAN8EpzjrKo+NUb3B8HcQkNvFHphhKAUpsk7KQH6qpqdz9Z8x/7jOksTnQ3JYSUT7hOurHPMTEI9iyCF5nIu4EMN2g/vMmcNvTDXpbcMvd93b4DIiI7KiGnaVw6PuZhrbkiMF6TnFgoUtvoObSPnJEzxDDNGccTPrsLsz5BQHlN8H1GUs9ywETnluiErt+AvNzyH8LcNyDGNJ5L2ezyhgGeMqsPGhJZ6fmrRPJbelEQthcPOp9cEriYtLG/7F0XyfS4vbSIhxdakNytnk1Gc4va1A X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 186ae907-96b2-4a82-a15f-08da957bbe28 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:13.2383 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 02/13] avcodec/dcahuff: Remove unused define 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: hWL8UAD65Xi5 In reality, the bit allocation VLCs do not use the same number of bits at all. Signed-off-by: Andreas Rheinhardt --- libavcodec/dcahuff.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 8d5541f9d0..d1b64798ab 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -44,7 +44,6 @@ static const uint8_t tmode_bits[TMODE_COUNT][4] = { { 2, 2, 2, 2 } }; -#define BITALLOC_12_VLC_BITS 9 static const uint8_t bitalloc_12_vlc_bits[DCA_BITALLOC_12_COUNT] = { 9, 7, 7, 9, 9 }; From patchwork Tue Sep 13 11:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37886 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp627827pzh; Tue, 13 Sep 2022 04:33:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR64LmRKHh/s92ELKrwCn1zX5iLkh7K987NRhXx0QDLBxBirN0G61osEjnzwSbBjqXeyKON2 X-Received: by 2002:a05:6402:440f:b0:435:2e63:aca9 with SMTP id y15-20020a056402440f00b004352e63aca9mr25410189eda.162.1663068813865; Tue, 13 Sep 2022 04:33:33 -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 rq6-20020a17090788c600b0077afe48c781si6026937ejc.537.2022.09.13.04.33.33; Tue, 13 Sep 2022 04:33:33 -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=tgBUDLIR; 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 BE8C468B96F; Tue, 13 Sep 2022 14:33:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2070.outbound.protection.outlook.com [40.92.90.70]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D468668B96F for ; Tue, 13 Sep 2022 14:33:19 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lp5hXSHFSq2FrZ0Suw0te606dlPqOjxPGzyPkJ+4Cp6AVuA2hMUtIlMojXTYmcxa0Ti3XTIBfSihU8aYToJoe0ON/z8l6j/JqSVNanoq69fuEmOUOrxtM2gIzA/DbXUBjA/mo8aytQMUT+w0nNtLmShHKv1qjNtBfca1HmDH/75GfcQBVwc749ieXoN8aHnbl6OVgSUpGOW2lghYP59XIs+cHEgmwRhqGI945bRAnwCz81n+VYkMmFH83cQLQki+6ytgBWe+TcWls1Yz1xSaA9gpf7mOb+7kc3EkQTSRR6M7ftczHRPhE7KBludGAU9AGx30miief80gDcKs6qpcoA== 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=ckQFmkHE+n5MrEpVCEiWze4NLChHIi8jpdv1yPSAHIs=; b=H+fJ7tWMd/sbUu+57JEgjInuusZnkzOb4ua59BOkzK6PR7GAS+MZlDauKj6ktQMnTAqRKqiyfJTxbQzlh0JesWidY9r/TQMIcrHzcSVOW5aoirzdimbA/Kmm7UbCVTh7/a7jc6oFKQ8cnhXOA2XDB/nquCCHmIe30sSLTbGkwbAXO5ktZfOhvZ8gwcicONsD6OymmK8VuOfsHDedcJ+GhzBUTXY074VdRX8DL0OkPjTNmZ2e7JyJtDLSX3e/PcEz78p2gAPcwMwCAwyiOxYwo9XgHPau1K6BqKOwfb8Slld879d5FrgqH0BZ6ciX9nbQCEpMlJjXlHbWKTU9El0uXw== 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=ckQFmkHE+n5MrEpVCEiWze4NLChHIi8jpdv1yPSAHIs=; b=tgBUDLIRv62K/o9VCRmtdVsSBhHphJJM88scUwOHExEGrIpYLlL9CDr7l+K4ZeV8jAnNEF4yEzlISsYUQximY5bMA+NxzRSOVO/tFHGRVHPCsJrUkoP1TkIAS3aMGorVyjHJ34orTdy65AKeEHbJswYK0rIkzyFbOFCjFoxmaGGWfusTpS3u9lIxlT7zNMSSYGavI+7in6YGRkYK26WD0GlFc7lPtcFXNzdbVVwWnhvU13pPvO2GEC5GiosEOukMUXBFyO2uStSw1RxAV90nYYADV8Ok+duvnTwU0UrL2FnckfVnALbu/mVc3Nm7zRvLtEXGnZ3qD7ku86FJEdBfgw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:14 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:00 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [tmAu8kW8F6PlsCvaybUnDtCSAfsYX93A7CAO+M9tBWw=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: d6d85235-63f0-4f50-5b0b-08da957bbee0 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAvNJADN4LE2TlPGZjHeTBHsGBVXNFAezEUeeKM27ElpCVX5K7t4F6LO2c2U1Zeqr66p5HcdPRk7gqxbTQjBha6KEVhi+y9yyceiLbeL58GIm1QjAFg1CFcVPbIaaYMJe+w4bzRT2eOIzwL5H7Sg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kVwQvxYAZoad1KShnXhrjqOMbvX0v3MbjdFaKbut2KP4RyYmvYbR1jITedf8CLn3hMBKBZpdu2fdMDxgtF3Sm6ZXNZ5zI2frfwXo1lYSjgfq/bnHocGd8nE2gBYKiGF4v0Pr08fLjnFvzXTIvt5LrQ5l2PHGX69lsbDDcx/c7SGqyqqexpFM/hmG2TjqgBqUSj9Qr5DLKK4yzWxKrJDpGS3ouRk5iV+zNAWbYKRTZAfeqdPcbvCmi3WJO1QkC2sCmA2tIf/CjfXTGido1NKDwJFHQhnj8pZFSTrmHUifz297fQANXcHGtyQU1diHV1Q8MYT/PjxBmbEoiNfRn9UuCUwtkymW97CAJudielZ1EFjQsZ0tCpQ0ImrnhYMV7dt60KB1gwo31ZbpSu96mbXyJU3cLN3imYmaiyIvL1b44QkSH+dUwM+mpnARxd6YRwwPXlNEO7tIZYMwE6kbKb4+uT9J02rxxVBVmYjjXVn+DdMlgvQtEG2s6Ao/CbA0E7GvTT9WDZfBKxbiy6tGWf6RfFSp4oAlLm3hEb7Dr6 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6d85235-63f0-4f50-5b0b-08da957bbee0 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:14.4267 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 03/13] avcodec/dcahuff: Avoid redundant offset 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: ctmh6Yk00cMp Signed-off-by: Andreas Rheinhardt --- libavcodec/dcahuff.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index d1b64798ab..9b809cc415 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -1232,17 +1232,6 @@ static const uint8_t rsd_bitvals[18] = { 6, 4, }; -static const uint16_t vlc_offs[80] = { - 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364, - 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508, - 5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564, - 7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240, - 12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264, - 18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622, 24200, 24748, 25276, - 25792, 26306, 26826, 26890, 26954, 27468, 27500, 28038, 28554, 29086, 29630, - 30150, 30214 -}; - DCAVLC ff_dca_vlc_bit_allocation; DCAVLC ff_dca_vlc_transition_mode; DCAVLC ff_dca_vlc_scale_factor; @@ -1264,14 +1253,15 @@ VLC ff_dca_vlc_rsd; av_cold void ff_dca_init_vlcs(void) { static VLCElem dca_table[30214]; - int i, j, k = 0; + unsigned offset = 0; + int i, j; #define DCA_INIT_VLC(vlc, a, b, c, d) \ do { \ - vlc.table = &dca_table[vlc_offs[k]]; \ - vlc.table_allocated = vlc_offs[k + 1] - vlc_offs[k]; \ - init_vlc(&vlc, a, b, c, 1, 1, d, 2, 2, INIT_VLC_USE_NEW_STATIC); \ - k++; \ + vlc.table = &dca_table[offset]; \ + vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ + init_vlc(&vlc, a, b, c, 1, 1, d, 2, 2, INIT_VLC_STATIC_OVERLONG); \ + offset += vlc.table_size; \ } while (0) ff_dca_vlc_bit_allocation.offset = 1; @@ -1302,14 +1292,14 @@ av_cold void ff_dca_init_vlcs(void) #define LBR_INIT_VLC(vlc, tab, nb_bits) \ do { \ - vlc.table = &dca_table[vlc_offs[k]]; \ - vlc.table_allocated = vlc_offs[k + 1] - vlc_offs[k]; \ + vlc.table = &dca_table[offset]; \ + vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ ff_init_vlc_sparse(&vlc, nb_bits, FF_ARRAY_ELEMS(tab##_codes), \ &tab##_bitvals[0], 2, 1, \ tab##_codes, 2, 2, \ &tab##_bitvals[1], 2, 1, \ - INIT_VLC_LE | INIT_VLC_USE_NEW_STATIC); \ - k++; \ + INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG); \ + offset += vlc.table_size; \ } while (0) LBR_INIT_VLC(ff_dca_vlc_tnl_grp[0], tnl_grp_0, 9); From patchwork Tue Sep 13 11:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37887 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp627921pzh; Tue, 13 Sep 2022 04:33:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yQuWWagjGUX+jNS+aooNg2T6eJYLQ1qTF8B2Vo0y5V9j0moO+mcatrOueVJiKoj+FfjSx X-Received: by 2002:a05:6402:3904:b0:451:f01c:9217 with SMTP id fe4-20020a056402390400b00451f01c9217mr5864359edb.78.1663068824139; Tue, 13 Sep 2022 04:33:44 -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 oz31-20020a1709077d9f00b0077c80ffcffesi1602752ejc.726.2022.09.13.04.33.43; Tue, 13 Sep 2022 04:33:44 -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=RgdybnvA; 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 C280168BB3E; Tue, 13 Sep 2022 14:33:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2070.outbound.protection.outlook.com [40.92.90.70]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABB7E68BB1D for ; Tue, 13 Sep 2022 14:33:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATZDevDTcmWC7EA+yz1OpceqHidNqopO8QeLenpWn79aX8kH2w+Fb9lQaUPg5YNmcxlbmoyv2bzbg6LWyMUFf4HeRUHNbvOYFVXUDJTatQeee9WCRHRVrdzJ1ANkN7shompbEWwjnEZ/kdbM8TmQcNc40WJgJil+yaRJdetci6pJhoBBXEqpNCJlppyBAXBvXnl8p6a+21HqtJgQW9bTQoXX/5wvUofqsdsz9FVyLx3AJVCMb/6ZqYwFz0l5plxFgDx7R8+xZACnk+xjKwPuTtVYjMMSVlFjzl+OpUPxybe/bT9GO41UCSz0l6LLGqzfuQwt4XEqNdxTyOxq+2M6NQ== 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=rgxV+eOSAIKgKGSD6cdxCm9aa8ph4KrL0L5NeBKm6EM=; b=FRZco8WkYaeoVna+tHE+7Al2h6B96Tj5UlKcBynksb8AemxZc2VFvbiThGvFm38sAgOnobJTA6JH2bxaEPe+WqUk7FIhPc7lh076zTraCT1rwNMi339/YpzeBc6oM7Fmzeo4GD+dZguy04QGWbwtqZlXAKnExHwep3eElNbmWnllSmfpuyE7I21QdXZJgOPOUiK39Y5IZcO3RdbZy3NhEpvLF/XbeB70GHDlg+LWhN4Hrpk3AB+oT3mTLc9+rZzB2wXNlqj2SZGX/pRZ86FRjjsl9R/Vi5+smRJehwQhMrr9/b3L+GmBhL8AXPKR2/1aKJhZCVB8Ec+DcOBViDqvag== 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=rgxV+eOSAIKgKGSD6cdxCm9aa8ph4KrL0L5NeBKm6EM=; b=RgdybnvAb9a5UcE+J3KVkJD4QPRJsEIK9aUBsfW+5PBb4zj+H8BsigL6iOJ+61DUZAgA7WufnTfHLTo9DRpKJ0VhR10sZsT3e/O5FK0AGEGvcBuk8mzhQ0Tr056JMnUnK6+vwDg5cJXMC+p4MEkZlHqd6PfPPWTBNf+pVd6AcqtFy+UjvLw4o1wSDi+PPjixnJxlPo+jUul59pCH3x5wnjDycj3k9JWg7w+uxx82trjO4nOazdDALHtYSmkH6USN2O3hqsuLSbFok6JSK3opLkp48kwFC5L8q5F5RDjJUg+LRlnZQsWnWIki8mtMONWrnh9fdBVTBJCpR7cIj4HLtw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:15 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:01 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [9ltJKnUwACkbUNNM9aWPcTOoZGPhpv8G4a5y7xtse90=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: e8ad811b-0dc4-4cfa-9a53-08da957bbf89 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAz/P/TdZaTMcnUti32fSQL0TE+UH0KN9ytTORtixHvKayLctxmdKOCvy3rNYpzP88ww5PK0wD3aqjc7g7qHKPCevZbSmOoXSTa/IAVyLb2P+FdckSlFNFahovXPSWV3pvhUMpdOlhOtc5V13UU5y5y6UrF2zDO8+j2QIQNmvajpKNWym8Ut+hmL6C8h8IcuoS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yOc9K33T/Pz/9ozsJ7I6T7FKe6ezARpP82i8XYXZ4DUqwhyeRzQ8Cer93ersJnQR1Fu7Xqc4EG98hasRR10d8SlsdzwtZ3FrWYrM1qcw0MiOc8u/9KcadsM5YA+fND+RvGXKFi4ImGbjR1msAGaZL5KUXOYnhPWN109qwt/X5/5/WrYsJviYqDc3Ysp/IlicY/lSTy3JIIrajm8XiVp5TVFQd3iPi2DZZ6kUCXZ5dDHHUsGQyd9aHCjZsOJpUU9ayGIPlWozJysNUZbz3MS3fW3wjXe6g9w+Yb1m6qR3gSIGeh+lOcxCy+IL6XNQKFP2DSQLisTFN+88k1zhyX1g4F/ARerv+lo1wM3A+oSEGKUtUOGxmlIegz2tVsfLnj50J/I2kgkm3k6T4juAU499PxKISyrkhKZZDA/LOPO33ghUxmC8q3W/Z8rP1LKiR9qAlPVJ0WJN6BCEIbV72gxRJtEFzoIiBFD5LdB/aOGp1wEVNi3hCVuznRlvyVGFMi0b1Nghy7 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8ad811b-0dc4-4cfa-9a53-08da957bbf89 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:15.5203 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 04/13] avcodec/dca_core, dcahuff: Don't use DCAVLC unnecessarily 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: mR/ToEaSvD0r The ff_dca_vlc_transition_mode VLCs don't use an offset at all, so just use ordinary VLCs for them. Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 3 ++- libavcodec/dcahuff.c | 8 +++----- libavcodec/dcahuff.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index bbf36ea678..499afc8204 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -456,7 +456,8 @@ static int parse_subframe_header(DCACoreDecoder *s, int sf, int sel = s->transition_mode_sel[ch]; for (band = 0; band < s->subband_vq_start[ch]; band++) if (s->bit_allocation[ch][band]) - s->transition_mode[sf][ch][band] = dca_get_vlc(&s->gb, &ff_dca_vlc_transition_mode, sel); + s->transition_mode[sf][ch][band] = get_vlc2(&s->gb, ff_dca_vlc_transition_mode[sel].table, + ff_dca_vlc_transition_mode[sel].bits,1); } } diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 9b809cc415..49fb06eeb4 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -1233,7 +1233,7 @@ static const uint8_t rsd_bitvals[18] = { }; DCAVLC ff_dca_vlc_bit_allocation; -DCAVLC ff_dca_vlc_transition_mode; +VLC ff_dca_vlc_transition_mode[4]; DCAVLC ff_dca_vlc_scale_factor; DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; @@ -1276,10 +1276,8 @@ av_cold void ff_dca_init_vlcs(void) DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, scales_bits[i], scales_codes[i]); - ff_dca_vlc_transition_mode.offset = 0; - ff_dca_vlc_transition_mode.max_depth = 1; - for (i = 0; i < 4; i++) - DCA_INIT_VLC(ff_dca_vlc_transition_mode.vlc[i], tmode_vlc_bits[i], 4, + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) + DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], tmode_vlc_bits[i], 4, tmode_bits[i], tmode_codes[i]); for (i = 0; i < DCA_CODE_BOOKS; i++) { diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index c0e04b725a..87e1fd1cea 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -40,7 +40,7 @@ typedef struct DCAVLC { } DCAVLC; extern DCAVLC ff_dca_vlc_bit_allocation; -extern DCAVLC ff_dca_vlc_transition_mode; +extern VLC ff_dca_vlc_transition_mode[4]; extern DCAVLC ff_dca_vlc_scale_factor; extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; From patchwork Tue Sep 13 11:33:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37888 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628017pzh; Tue, 13 Sep 2022 04:33:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4z2LGNzzY5bTeGrkj2b21Le9HHsgFTSnAUtM8TA17Mi0mIVWlEurRvbeuE3yMT9T6cXZRB X-Received: by 2002:a17:907:968c:b0:77c:c5c7:26b7 with SMTP id hd12-20020a170907968c00b0077cc5c726b7mr7527335ejc.171.1663068834131; Tue, 13 Sep 2022 04:33:54 -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 q17-20020aa7da91000000b0044d9f1406b7si7769871eds.157.2022.09.13.04.33.53; Tue, 13 Sep 2022 04:33:54 -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=USwAMSDe; 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 C17E568BB5E; Tue, 13 Sep 2022 14:33:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0BE7268BB3C for ; Tue, 13 Sep 2022 14:33:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KzBkRzKqpQ7TWbkGt/EzP3hNRdS81KmiAr14a1pJZQMd6gwutbRblHjv3QU0pie4TIkCdimNIL1Uu+CU1ANISRIBQY1tKse8i5KzmnBasx7vyvSNZVU9beRXB3sYPwCtezOOSq/7D2tzemJCA6nflaB1mK/Wzp4pMUrUe2gfU28uUmEld6P2ekmmm44Doa2Tcx0gzTq4O/ZfqGj79BYRcUcjlznUk6NdamimIvbkOEpBglyu9uBj0yUJGeAnlIjxptG2/NvbXhzkJdZkazMYVaOhDogrnsqweQm6LGtYumVM7Eu+2OXNnWP8fW0XcO12qCfvP/h14PU7XRppkzXcHA== 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=LdpJ91eCiOnNB37+KWXFiweUR82BKy3UJDumMMqepDM=; b=VZlT1Qqpkkyy3PuZt9QR7afCF/4RYCmkCZLSTyhsfdO+DTC7Vg4YmUEBy/qtoohZD8aZGXuAE4ffQaPCTtgdpJjT1G4Z8wUHTMJ6JgprOE5xKsrGndSdvyCXuvwu8TcalqDN/tJGK7PdEOX5AGVRawNJzpFmOBmVsbr3n0QNt0JwsLbQq8Aw/lF0CE+51WfVTi+9GIHPUERUgCvbd43oJAmDLzUCEOkmCkyhJ+m2PUsbHvo4JLk7gYgaleZS9TZSeplph12OF5Ysow8PlRD8O8YPpysZwAIjdkEtlr2K5SOPNzfWV2hG/Phl7TJtR/hhmj/z7oKdkQTCYVdObBpW5w== 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=LdpJ91eCiOnNB37+KWXFiweUR82BKy3UJDumMMqepDM=; b=USwAMSDeWLc5eVYeyzMHG4YfOCOwHJh0joY/OUOtunZmdqScUR0eKITmyft+PtdeV0teXGB6Ybjyq9S9YVzK45c1f4oCiT2ACkMeVUhSz9Gbz1P908qk+IZbQyxuYx+bfNKGW/3VhGi2ElS/iSuHVX9KRGa/z3pt1SAkMmTiUJTDzdglI39E6Tk8J2LVggcoi36tcHjMM+lLHYobslpZhCdf2/tLHczzBOscsN/exxpCUEa/ij7q5vgC+IJB4i/RllP82is1e1n4l1ItjiY53xCiZQlTejH6/BA1bUSL9ObGYhBBEzUrPwpeHr4y8Fy1ZZHZ1wwFFIW3iE52BwNueQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:20 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:02 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [djQztqHbWrGvQcVhgrohkBbyuEQtvlQmoZL+lvWmQiM=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: bb6f21d3-b0d6-457d-7b5c-08da957bc2b4 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAwybIMDUr2GjUJyQKiKktUVV77axRLzfygfQ9jnlx4BTPEjWrErS9S6MvKvqfJ9FFp/CGU7C1JslPqKiePdsnM5gUdy2E5m90uBbapOX9qYfqibnHuV3llWCbQBpsZIryf13QxSnZGSTGXb6oQ/iIzBMAPMQF6unBMRkyNxJo/sJrlVRCM4qnQtZGxkg5J+Y8syzmTUM8TBJ1jnZUcUY4AejT2789D3wL6BpN8d0Jv0JBujesYEbdZnfjvRcNqai63MWVDdrsLGP2I5TNZjrasL/GdIu2LHYwXx63nb4ec1UBlKgKf4QKURQ6uRAkIUzn1Vo0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ruiC68Smhcc9e05KR4+px8P/ylKmR+2fCSuCkLtoQjzdZKLewO0ThLh8cJlAnhSB/IKvA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pK0adZf2GfEUfk9gcARmILfwHtliPEmFXOtL87MAHSMh2dvefefMiJZttAX9gezxa7KTCcoQ42kYlU3EMIMAqnnPfNt2qxOzV2YZRTBc2+aQrFjA/oMTylaUR7Vp7pCLsfxlYW2qcSELolgsKDxxFw63EqiqhqVk5rv6+Ka5S2ymeO5MDpaB9B8PkdrYbI3j/q4zDUr0J4XubqjzgPrbkm/PpQFQVVqWj7LCcwQXrzuT4bPkkr1aB7+8buL+lOjTiNNqVGgZRkV0pFFNxUX+vfpyUYL8jQkqPysto+KFRM4H6KPayNFV1fJ2zLu6r06UEG8vpHQffWe3eLg9yQRT/S3hTwm7Fb8wVzEuiIjzhwACCqrQHN8wUlVpznTBQw89lBHQVQWJEO2plb79YL5+89TN+/zo9J0m1jGOjEY0nBs98h8PwJV0noIPvJNK822rfcleGaxOhZvotwbB8THeNsHu93OKSJTR/MRqNItWrGvmfWIbD+AHaJA09uO9h9J9A1pRtnFBxLPNSg6e77tqTq/i9b1F2qVDj36Iur216/GP9TokzX9Vt+5HaA1VktS0ZBysQx0CmdDtF4Mi0j4/2/XfAeDhk4bEuauel7ja7KCYQR276eDNg7BwkEIWqi4irXP7BANZTn6GA4+r99GL805ewoIcyzWRdP9dIH6CBUFMCyPc/ftCe7QVAcUs7a+kyGA6L8sh6oUxeMileBiOJojUJfHpGxTLuUdxOomWtvCZu2yQyv5XDS0VmbwjpegHKXq67WmCOLWiK9Aqbu5Xc/911RItHynusUmxGzAiuD+Pst8HgiCEhwxc9edzRj6dp8ecnhov0p17JendE0q5qcdGVJFhTct2Qqs+OmoooN+SF+aSw8JbAp69WHbziAWzkG2zGwhIkKB+nIjTVxb23mmhDrln3Rdgn83hQVkF0fCEA5udSu757xDvYpif0Efe6p+HwlCZaAPHNst0hyYTOuEgKqx28Cv5iKUojI7kEvxvKx/+LF4BP8T7puI4aqDl4VYworkjIdV8WmjnZ9ZG2ranUklCsvNkqfR9jlfi/mQxmSLH5asUaH7Q+IyjVaEiLNE363Gy8dF0rNXg/XhlSsY8rTn1SD8aT/243WuGO2LiPjcXNJ/OqnF+gFDWQwjRCzFlIsLuOduxLqB4aM9miLSVP36RwVPAHnjX55G2AchKJk5MbO1B/DMLZKswhN9+dl2ISdDc2LL8ehwn0u8WoxHZ3RaJEm9ecC376fIx5nWmqFhJuiG2uTjphywLO6bH1Iy9vYWYYBmX+mCBFZXixggJiQKFol8nuCoZaONBemf8wKGlQnSLTQ/82GKHv+vC X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb6f21d3-b0d6-457d-7b5c-08da957bc2b4 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:20.8189 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 05/13] avcodec/dcahuff: Always use three bits for transition mode VLCs 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: +u2PDR3HEtkR It increases the size of one VLC from two to three bits, thereby requiring four more VLCEntries (16 bytes .bss), but it allows to inline the number of bits used when reading them. Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 2 +- libavcodec/dcahuff.c | 5 ++--- libavcodec/dcahuff.h | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index 499afc8204..069d428fff 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -457,7 +457,7 @@ static int parse_subframe_header(DCACoreDecoder *s, int sf, for (band = 0; band < s->subband_vq_start[ch]; band++) if (s->bit_allocation[ch][band]) s->transition_mode[sf][ch][band] = get_vlc2(&s->gb, ff_dca_vlc_transition_mode[sel].table, - ff_dca_vlc_transition_mode[sel].bits,1); + DCA_TMODE_VLC_BITS, 1); } } diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 49fb06eeb4..842b1401dd 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -29,7 +29,6 @@ #include "put_bits.h" #define TMODE_COUNT 4 -static const uint8_t tmode_vlc_bits[TMODE_COUNT] = { 3, 3, 3, 2 }; static const uint16_t tmode_codes[TMODE_COUNT][4] = { { 0x0000, 0x0002, 0x0006, 0x0007 }, { 0x0002, 0x0006, 0x0007, 0x0000 }, @@ -1252,7 +1251,7 @@ VLC ff_dca_vlc_rsd; av_cold void ff_dca_init_vlcs(void) { - static VLCElem dca_table[30214]; + static VLCElem dca_table[30218]; unsigned offset = 0; int i, j; @@ -1277,7 +1276,7 @@ av_cold void ff_dca_init_vlcs(void) scales_bits[i], scales_codes[i]); for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) - DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], tmode_vlc_bits[i], 4, + DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4, tmode_bits[i], tmode_codes[i]); for (i = 0; i < DCA_CODE_BOOKS; i++) { diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index 87e1fd1cea..1f13b6f443 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -40,6 +40,7 @@ typedef struct DCAVLC { } DCAVLC; extern DCAVLC ff_dca_vlc_bit_allocation; +#define DCA_TMODE_VLC_BITS 3 extern VLC ff_dca_vlc_transition_mode[4]; extern DCAVLC ff_dca_vlc_scale_factor; extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; From patchwork Tue Sep 13 11:33:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37896 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628691pzh; Tue, 13 Sep 2022 04:35:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4VLPVasNYvkYltdx9AnQbKhjwTEa/atSqTTcPxaDbXD9Zfcy7rDShrGL1VfrYnsSDwnE81 X-Received: by 2002:a17:907:a07a:b0:77c:f98e:ab8c with SMTP id ia26-20020a170907a07a00b0077cf98eab8cmr7457167ejc.69.1663068912443; Tue, 13 Sep 2022 04:35:12 -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 y16-20020a056402359000b004518397040fsi7138774edc.352.2022.09.13.04.35.11; Tue, 13 Sep 2022 04:35:12 -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=u53244CH; 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 47D9468B613; Tue, 13 Sep 2022 14:33:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2070.outbound.protection.outlook.com [40.92.90.70]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D033268BB61 for ; Tue, 13 Sep 2022 14:33:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FS5gBGXI/Ps8G9Ke3jILRCvLvWHg4AGRaBDvoRlQQw+LZru6es7jdjmei/kXNUAciqpcxruxJ1vZO23uciePFC35Z8mFz/VefSuDfV9k0CPNI9z97eWHeaDQNVOv5kGMES6kaIobSqCzMqHH3vQM3jVp/WfWAlJZqnDnmrOpSBQNCH7/AqT3j8X3r78YU//CnpxjYPVAltLu+qV/SZ8cS7Rsf7dgdCpuPZ/a/Mm7ksmJxMkJZ8cRXKaNQl+ANtOukEcjNdJmLFs3UpNwiPXqOl/uUX4C1erjw4zjJCkihKazfr2t/OQ/OyZBvma6BFWrDU9LyS0t8nrKYeE1trKBWQ== 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=ygzqTfQ6ymNFI0X6EdPwGtLbdSpxzMjAQkOo8BF99UM=; b=oGGE+htqX1/9frwxKZFp1YuHecW7epA5Ll5dyZJ/gkY+UJ62eRRzp0C9FC7yMmeR0XcsUX/sl3LkJXT8fuZ8wJM0/HTSgd3LxPVNiHL5TOf4gVUZUsSJzCg0yK7AeO8gheMavtLId77pBL/4hlzM1VmxSjNELc4Wy1xeySOBaKsOV20m6QiFQURr8cbZyeE2W7AjUQBpyEA1yaPec8SKRu8fBDlNlHwwplNxtkduQBS2kUUmefPWBN2KxX8gWyW97v1CrVLySHCkA2JwYE9OyCdWGlZIXg6FcVe2B7PCgpUXbyW+qAjA5Xbo7a0fvTIFSWV5tb/QQaqkCgZTmnmIgQ== 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=ygzqTfQ6ymNFI0X6EdPwGtLbdSpxzMjAQkOo8BF99UM=; b=u53244CHZ1pvHNYCqRYZFiONbLqwjuLHb0HplN1bDMDGt0gg+LwENyjFFpRp13GFLHgQ5q58XGzo3ibWDheRHjYe7W4KT84/c5WTO92OfJl6LWCyGyLw4zDdh7j1JvYRFhFe6ji1GDYpTfY+UQlh7BbMRH9KQzdXzerUIasUErBIbeJ/6v9r+U5aWS03onAkOHNlXhFeMgHfDDaIaHQIq1UNlvSilds0IhVkNdFmGEeniE7j7+mvUdz3isRe5L5fqCD4xp66y5Vut2G1WNAN5NDPDai0dWKzrXoLsaBIjg41yJEtV+KOrRSBwp4RBbeLSTNav/diX63+qVVRAEd/Tg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:22 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:03 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [xKEyed8ChV2O0yCyj6EUkxiyl9i+hCGSMR6eqbf9kWU=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: 04d7c22a-2386-486d-b4db-08da957bc369 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HA+IfOM4EgStqkarTjq6qqSYBx2tlUR93BAhYYy49PnzfKVdh5WBVVx9wqELF0iZykmaRnfyi8y3H6XXVSZ8VfxtOUR4hc7KfNYMA1W3O7L5FWv2XRx9/z3ptwd9qOz7F0fI3suenvg5dklFTPFFgbyxtX8V2cRMMSQmWVXqv3jH+f2LtkiSZzK19fkDTTNaWYro2YwlpshEivpzwtwmI1NiNjQl9i9Ka86ppsGZcTse99y/UvBqcjDQlYTW/JSg4Jv7UF7yvOOZLfrE3DFcG4A2EV1jaW/bc3ljzBMyE4mHMFgKZvYtFQ3SwXFD990tHwk0rxlHd7loFXiswC3Vq9KGW+XGTdxzI5s3vhDOXgYDePvjHfCLzSZ9ePADxaw17x+uclUn6STCRwBt2zoi75oi+II6l/miznRvp9kU8CXUtyPO3vxUR9gGyFyYKrRH4ou6dLFpQZR9c+82oTHc+0vUMbBaAXgS6ARdB7hBUKD2sO+f+kck0skqJzlGBK/duWBc6Rc28QSpjSKzcPix/fZmO/j02Qdep8b7X6rou5wxJx8ixNDLpbtAZAZAzJ7RCNgaQuDyOk41v/sZTKTVF77EvF5bMy7SgCRmo3xjM58MeTA1Q7zzu50sbYzq3pTiCne+b2zwCfHBDjLglXqrMmByBBPHFhmRHY+acQlVfAze5iSWCbCK3n+GI8rojaldhvoEcBzpHL/BBffyLmME4wbeg0nDvcIUHH4vETiHN1uO4= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +37Oe6TOzwsVYxneVYeM3oxPkx6FM4kULLXBjmDMuSkNZ4pOa6Je4FO05j4cav5Nk4bL4xvhvn5k2XicKC+F4K8TJyL11B5ExpMjWAJmqvSH+WlTnauh55/5xA3xNPmunbPYxHXHokbOKtsz/N9S7ZMGX9Oemcc7kQQTj+L3FUbpXdxv+/LyTQxlSHiJk2JrfCTpVIYM1I2vbZJ26KDCOC8FrSPr/ag+SfNjCq6NSKVaCaHnnKD8XkdfC11R3u0Iubpnrfx9dVKb8TC032ke2FUsmwpWybTaVYdwRcQbUpoEFwKLwQyA/FRG+kqGIY8jwEVCFPQJs99plv1atFXPIIjK8wkf3Ce7LhWsCujgGTirfSyzDF9ZPq9j1Jw4gAMNPnpbz85305XJWhV9i8kODdHOrS7VHeLvq1tZd8+HoXNy20GFm2jYLK3pV+4uBLOO4RJX6XOYRpQJlF0706yzQ/MRD4tO2HFiBFzjVC0RadjVqqmKQUZoT+PZ3d9zGIEN0AQTqUdN2zjQ/iYp1KSwsI1ZuATDo91NF/Gt+BkwICSBEBskQROGK/IwCQr03RUolAcngQFdj6/SMbGmY/o39SNDd9gr1HCSfMcvXD05LhdyayuT+qi+/6SH8/bSx0JAx6gULosKN3zXWGNxMpw/EA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IH5CXyHv8KA9MQsoXE992Dn+A2pDErrckm3OcyGs1GJelEDMp8+2a2GrEW+bIHFNrQDPn04v1mG0qkggX0PoQRgt4az+aA5gUX/pVoDA2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s+XnuDKTMyIZOnKdzM3hVdrPducBWLBhTetMObhmWmeOJ9pjsg/b3OiENpFciLbIX+fPnJ/Tz2HV6pXQaNXXPJ3jMcZdPVxdEs8kz8c2XK12METBAXbaVNK6k+235HpBMvdUG6+TOrz+h1XKPatrKve X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04d7c22a-2386-486d-b4db-08da957bc369 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:22.0534 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 06/13] avcodec/dcaenc: Create encoder-adapted tables 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: YZ6jMnLYwXs3 Up until now, the encoder used the same tables that the decoder uses to create its VLCs. These have the downside of requiring the encoder to offset the tables at runtime as well as having to read from separate tables for the length as well as the code of the symbol to encode. The former are uint8_t, the latter uint16_t, so using a joint table would require padding, but this doesn't matter when these tables are generated at runtime, because they live in the .bss segment. Also move these init functions as well as the functions that actually use them to dcaenc.c, because they are encoder-specific. This also allows to remove an inclusion of PutBitContext from dcahuff.h (and indirectly from all dca-decoder files). Signed-off-by: Andreas Rheinhardt --- libavcodec/dcaenc.c | 82 ++++++++++++++++++++++++++++++++++++++++---- libavcodec/dcahuff.c | 64 ++++++---------------------------- libavcodec/dcahuff.h | 16 ++++++--- 3 files changed, 96 insertions(+), 66 deletions(-) diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index d02602761b..4a02aa9d46 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -29,6 +29,7 @@ #include "libavutil/ffmath.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" #include "dca.h" @@ -159,8 +160,41 @@ static void subband_bufer_free(DCAEncContext *c) } } +static uint16_t bitalloc_12_table[DCA_BITALLOC_12_COUNT][12 + 1][2]; + +static uint16_t bitalloc_table[DCA_NUM_BITALLOC_CODES][2]; +static const uint16_t (*bitalloc_tables[DCA_CODE_BOOKS][8])[2]; + +static av_cold void create_enc_table(uint16_t dst[][2], unsigned count, + const uint8_t len[], const uint16_t codes[]) +{ + for (unsigned i = 0; i < count; i++) { + dst[i][0] = codes[i]; + dst[i][1] = len[i]; + } +} + +static av_cold void dcaenc_init_static_tables(void) +{ + uint16_t (*bitalloc_dst)[2] = bitalloc_table; + + for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { + for (unsigned j = 0; ff_dca_bitalloc_codes[i][j]; j++) { + create_enc_table(bitalloc_dst, ff_dca_bitalloc_sizes[i], + ff_dca_bitalloc_bits[i][j], ff_dca_bitalloc_codes[i][j]); + bitalloc_tables[i][j] = bitalloc_dst - ff_dca_bitalloc_offsets[i]; + bitalloc_dst += ff_dca_bitalloc_sizes[i]; + } + } + + for (unsigned i = 0; i < DCA_BITALLOC_12_COUNT; i++) + create_enc_table(&bitalloc_12_table[i][1], 12, + ff_dca_bitalloc_12_bits[i], ff_dca_bitalloc_12_codes[i]); +} + static int encode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; DCAEncContext *c = avctx->priv_data; AVChannelLayout layout = avctx->ch_layout; int i, j, k, min_frame_bits; @@ -307,6 +341,7 @@ static int encode_init(AVCodecContext *avctx) c->band_spectrum_tab[1][j] = (int32_t)(200 * log10(accum)); } + ff_thread_once(&init_static_once, dcaenc_init_static_tables); return 0; } @@ -400,6 +435,39 @@ static void lfe_downsample(DCAEncContext *c, const int32_t *input) } } +static uint32_t dca_vlc_calc_alloc_bits(const int values[], uint8_t n, uint8_t sel) +{ + uint32_t sum = 0; + for (unsigned i = 0; i < n; i++) + sum += bitalloc_12_table[sel][values[i]][1]; + return sum; +} + +static void dca_vlc_enc_alloc(PutBitContext *pb, const int values[], + uint8_t n, uint8_t sel) +{ + for (unsigned i = 0; i < n; i++) + put_bits(pb, bitalloc_12_table[sel][values[i]][1], + bitalloc_12_table[sel][values[i]][0]); +} + +static uint32_t dca_vlc_calc_quant_bits(const int values[], uint8_t n, + uint8_t sel, uint8_t table) +{ + uint32_t sum = 0; + for (unsigned i = 0; i < n; i++) + sum += bitalloc_tables[table][sel][values[i]][1]; + return sum; +} + +static void dca_vlc_enc_quant(PutBitContext *pb, const int values[], + uint8_t n, uint8_t sel, uint8_t table) +{ + for (unsigned i = 0; i < n; i++) + put_bits(pb, bitalloc_tables[table][sel][values[i]][1], + bitalloc_tables[table][sel][values[i]][0]); +} + static int32_t get_cb(DCAEncContext *c, int32_t in) { int i, res = 0; @@ -695,8 +763,8 @@ static void accumulate_huff_bit_consumption(int abits, int32_t *quantized, { uint8_t sel, id = abits - 1; for (sel = 0; sel < ff_dca_quant_index_group_size[id]; sel++) - result[sel] += ff_dca_vlc_calc_quant_bits(quantized, SUBBAND_SAMPLES, - sel, id); + result[sel] += dca_vlc_calc_quant_bits(quantized, SUBBAND_SAMPLES, + sel, id); } static uint32_t set_best_code(uint32_t vlc_bits[DCA_CODE_BOOKS][7], @@ -757,7 +825,7 @@ static uint32_t set_best_abits_code(int abits[DCAENC_SUBBANDS], int bands, } for (i = 0; i < DCA_BITALLOC_12_COUNT; i++) { - t = ff_dca_vlc_calc_alloc_bits(abits, bands, i); + t = dca_vlc_calc_alloc_bits(abits, bands, i); if (t < best_bits) { best_bits = t; best_sel = i; @@ -1081,8 +1149,8 @@ static void put_subframe_samples(DCAEncContext *c, int ss, int band, int ch) sel = c->quant_index_sel[ch][c->abits[ch][band] - 1]; // Huffman codes if (sel < ff_dca_quant_index_group_size[c->abits[ch][band] - 1]) { - ff_dca_vlc_enc_quant(&c->pb, &c->quantized[ch][band][ss * 8], 8, - sel, c->abits[ch][band] - 1); + dca_vlc_enc_quant(&c->pb, &c->quantized[ch][band][ss * 8], 8, + sel, c->abits[ch][band] - 1); return; } @@ -1135,8 +1203,8 @@ static void put_subframe(DCAEncContext *c, int subframe) put_bits(&c->pb, 5, c->abits[ch][band]); } } else { - ff_dca_vlc_enc_alloc(&c->pb, c->abits[ch], DCAENC_SUBBANDS, - c->bit_allocation_sel[ch]); + dca_vlc_enc_alloc(&c->pb, c->abits[ch], DCAENC_SUBBANDS, + c->bit_allocation_sel[ch]); } } diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 842b1401dd..d17b49a089 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -22,11 +22,9 @@ #include -#include "libavutil/avassert.h" #include "libavutil/macros.h" #include "dcahuff.h" -#include "put_bits.h" #define TMODE_COUNT 4 static const uint16_t tmode_codes[TMODE_COUNT][4] = { @@ -47,7 +45,7 @@ static const uint8_t bitalloc_12_vlc_bits[DCA_BITALLOC_12_COUNT] = { 9, 7, 7, 9, 9 }; -static const uint16_t bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12] = { +const uint16_t ff_dca_bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12] = { { 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE, 0x01FB, 0x01FA, 0x01F9, 0x01F8, }, { 0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038, @@ -60,7 +58,7 @@ static const uint16_t bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12] = { 0x0079, 0x0078, 0x00FB, 0x00FA, } }; -static const uint8_t bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12] = { +const uint8_t ff_dca_bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12] = { { 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 9, 9 }, { 1, 2, 3, 5, 5, 6, 7, 7, 7, 7, 7, 7 }, { 2, 3, 3, 3, 3, 4, 4, 4, 5, 6, 7, 7 }, @@ -980,11 +978,11 @@ static const uint8_t bitalloc_129_bits_g[129] = { 13, }; -static const uint8_t bitalloc_sizes[DCA_CODE_BOOKS] = { +const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 }; -static const int8_t bitalloc_offsets[DCA_CODE_BOOKS] = { +const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS] = { -1, -2, -3, -4, -6, -8, -12, -16, -32, -64 }; @@ -1001,7 +999,7 @@ static const uint8_t bitalloc_maxbits[DCA_CODE_BOOKS][7] = { { 9, 9, 9, 9, 9, 9, 9 } }; -static const uint16_t *const bitalloc_codes[DCA_CODE_BOOKS][8] = { +const uint16_t *const ff_dca_bitalloc_codes[DCA_CODE_BOOKS][8] = { { bitalloc_3_codes, NULL }, { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL }, { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL }, @@ -1019,7 +1017,7 @@ static const uint16_t *const bitalloc_codes[DCA_CODE_BOOKS][8] = { bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL } }; -static const uint8_t *const bitalloc_bits[DCA_CODE_BOOKS][8] = { +const uint8_t *const ff_dca_bitalloc_bits[DCA_CODE_BOOKS][8] = { { bitalloc_3_bits, NULL }, { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL }, { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL }, @@ -1267,7 +1265,7 @@ av_cold void ff_dca_init_vlcs(void) ff_dca_vlc_bit_allocation.max_depth = 2; for (i = 0; i < 5; i++) DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, - bitalloc_12_bits[i], bitalloc_12_codes[i]); + ff_dca_bitalloc_12_bits[i], ff_dca_bitalloc_12_codes[i]); ff_dca_vlc_scale_factor.offset = -64; ff_dca_vlc_scale_factor.max_depth = 2; @@ -1280,11 +1278,11 @@ av_cold void ff_dca_init_vlcs(void) tmode_bits[i], tmode_codes[i]); for (i = 0; i < DCA_CODE_BOOKS; i++) { - ff_dca_vlc_quant_index[i].offset = bitalloc_offsets[i]; + ff_dca_vlc_quant_index[i].offset = ff_dca_bitalloc_offsets[i]; ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); - for (j = 0; bitalloc_codes[i][j]; j++) + for (j = 0; ff_dca_bitalloc_codes[i][j]; j++) DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], - bitalloc_sizes[i], bitalloc_bits[i][j], bitalloc_codes[i][j]); + ff_dca_bitalloc_sizes[i], ff_dca_bitalloc_bits[i][j], ff_dca_bitalloc_codes[i][j]); } #define LBR_INIT_VLC(vlc, tab, nb_bits) \ @@ -1316,45 +1314,3 @@ av_cold void ff_dca_init_vlcs(void) LBR_INIT_VLC(ff_dca_vlc_grid_3, grid_3, 9); LBR_INIT_VLC(ff_dca_vlc_rsd, rsd, 6); } - -uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t table) -{ - uint8_t i, id; - uint32_t sum = 0; - for (i = 0; i < n; i++) { - id = values[i] - bitalloc_offsets[table]; - av_assert0(id < bitalloc_sizes[table]); - sum += bitalloc_bits[table][sel][id]; - } - return sum; -} - -void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t table) -{ - uint8_t i, id; - for (i = 0; i < n; i++) { - id = values[i] - bitalloc_offsets[table]; - av_assert0(id < bitalloc_sizes[table]); - put_bits(pb, bitalloc_bits[table][sel][id], bitalloc_codes[table][sel][id]); - } -} - -uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel) -{ - uint8_t i, id; - uint32_t sum = 0; - for (i = 0; i < n; i++) { - id = values[i] - 1; - sum += bitalloc_12_bits[sel][id]; - } - return sum; -} - -void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel) -{ - uint8_t i, id; - for (i = 0; i < n; i++) { - id = values[i] - 1; - put_bits(pb, bitalloc_12_bits[sel][id], bitalloc_12_codes[sel][id]); - } -} diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index 1f13b6f443..68974d9965 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -27,11 +27,13 @@ #include "libavutil/attributes.h" -#include "put_bits.h" #include "vlc.h" #define DCA_CODE_BOOKS 10 #define DCA_BITALLOC_12_COUNT 5 +#define DCA_NUM_BITALLOC_CODES (1 * 3 + \ + 3 * (5 + 7 + 9 + 13) \ + + 7 * (17 + 25 + 33 + 65 + 129)) typedef struct DCAVLC { int offset; ///< Code values offset @@ -58,10 +60,14 @@ extern VLC ff_dca_vlc_grid_2; extern VLC ff_dca_vlc_grid_3; extern VLC ff_dca_vlc_rsd; +extern const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS]; +extern const uint16_t *const ff_dca_bitalloc_codes[DCA_CODE_BOOKS][8]; +extern const uint8_t *const ff_dca_bitalloc_bits[DCA_CODE_BOOKS][8]; + +extern const uint8_t ff_dca_bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12]; +extern const uint16_t ff_dca_bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12]; + av_cold void ff_dca_init_vlcs(void); -uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t abits); -void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t abits); -uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel); -void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel); #endif /* AVCODEC_DCAHUFF_H */ From patchwork Tue Sep 13 11:33:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37890 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628189pzh; Tue, 13 Sep 2022 04:34:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4KevUJQ3nKX3aW0Llhl3fKMYyOMihKhvElDIVs9t+WGqMxK/hpeDCqJTyl67DYz1yn4gDN X-Received: by 2002:a17:907:70b:b0:740:ef93:2ffb with SMTP id xb11-20020a170907070b00b00740ef932ffbmr21111599ejb.93.1663068854783; Tue, 13 Sep 2022 04:34:14 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z8-20020a05640240c800b004526ddc4e9asi1263337edb.478.2022.09.13.04.34.14; Tue, 13 Sep 2022 04:34:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=sXYl2t3o; 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 F2BBA68BB5B; Tue, 13 Sep 2022 14:33:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 455D668BB44 for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cStf69n81tNu0yF5UkzAMy9Pmpjlqo8XikJ5NiyeS/Ajo2RQkWDcPFVNVaVVIZXRn9UWKNd397eRmpLGYeF9xwdFKhKrtewCMW0MGMGG1XAHwCoYJsha7tGncmBfpsDQnbSsyjfM99MgRVDDQF9voBB2bKpP9gjhKgNomyeguioqjk2reMuJFOSn1VvDCHlOf5LQ2660BxomUy9WEtQjqdLSRKwfoW448MBYRfwWQK+4PIkvWLZG1BXuRqy+aZ02FaeyAebiZGd5ILxMYcXbB9yNNDj3/1XIRIhE7vA3biGxqGqV0RFQtGR9e0oI4EqWeRg+HHTA2wn8qyAZMgl/cA== 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=7YRgR3BAH1UElcwchZo2bZ5d/MlCksbaWx0xeL92fgA=; b=iiUaXTS2Xzwc8GXfzlyPrZU2I//w6i3jV4jWOSWS0fPx2GZZeiaegVUE6ElrTn6/NWq8/mczKw+ZLOva9Rl6RpJ0VfEdnLcgzuazlxLNci+VDzAh60gEsr3qFXnFw5wzV+c3wS7KYshg4lNkG4Fha9jg/yM2NiDX7/6NZaSxZ4sCoksd7+RErpgUTM341zuzFn6WIph+1BkP200agot6RJuaFjdaPusgNrUg1CdI9Se5OkTl83vX0DK881mVjf8CJjxyoNLoACNszuQIsUMg2qL8RniRw3aAFhnwZBDU6GBdWi+kYYV1JVG7u9K1eESg3cmvhnLNCfPT5RgkfE0bDg== 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=7YRgR3BAH1UElcwchZo2bZ5d/MlCksbaWx0xeL92fgA=; b=sXYl2t3ouHgBVjwOZLF66eLoLEOBQN3V5PoQZKx/0gQ7DuXNvMqgsfIQV/wFUfAj2UQaYxebbO2dsUusi3nhN7wIidoOI0UktOQI9gv8ZZuxkAdvPhl/nXOrzSsp3P7AFi8fYmozsLSiCM0m2OzuvMLSD70w9taZcayw7JZsz5V5qDHzMxtNibP19+2CgbPd8EOqmPNJn5BfRgU2venFd8DlGSUC+EugOO08HFBsZg6O4GH69v5B9rg/3BUmtt78/E2w7KnRiXPVHTlifHVw0OfcbW5DV9CrBOoZ8g8+nYfEH5/emZDpIM82QLVlgavlbunFNQoiQtnLWUHgfoeu9w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:23 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:23 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:04 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [6NZ03cnZ3iJeOiYCpvUTUFenNW3g7GFzIDW+YhhzBI0=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: cef52f1f-647a-4ec4-91c6-08da957bc410 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HACFVOM+WplWFcD401SMwizPcOyiXYy/Fd9GW6NZfVaMRYU4s5IDshAGy1Or5U+A0nH9bFnPKcVo6yJ8PkmdcpfOFqNBqboju3/APaAWePs4KgrwJ3e5RGjPYGNzeRXY35kqIK4hC3zDyHydwbztYd4cerSb8s657BdMHg9GQtUEncUJkeO/IFz/XBJtoRpnlw7EdhOuiZkMib8oNsuP54hAXpOPhqmXbLRWIPECpUxaTwOgdNc5sh9OffkEWIVI/ZvBBfzzAqMpgHWboHx2aiXCkz9Q8PZrpSAuCvetL6HDrj77hECwHNGt9HcczWyZUkqJQkPD3wjHHuVjfd7kQ1byJM5IBolC1zDtA/TSTFuub1yHo80ZgyHTWQWPNN5BhJgCsymRFi8MYcTSOfF+uR009vvZJjXNtOtt707+fi1XjTILtubPu3+tCfdOtefmdXR5QmpKWDOHbhfU+IlirM2YIgneF/lK7LXY8407ypx30GrsZGrawcfyFbBsOoS/srGnF6Jag71IFJb8EUyBCpXtNxXJydQQF9baLOUUXV86WL/BZlo20K6s69QaDC0p53N3eP4QnL7a7Lg2nQDBEz5j/rVikKKWsckPfUqhr7KGaIca5dQ/H2JduCVoJ8nigNhLYaZs5pc3PkO/4y8+6oMsiRMwkj8aHcKu/Kmf5jDddPptZk98q7IhzseJRtPeL+3iUdwNBAMN5x8p83aLsZp5+1oqnTlBLw42uG/D2ke78= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FzjyjrLxZQ8iVgDF6CAmPGLkqbMcHmG0lqr7IMjOLQDCT8rgSy2WP+Wi/QphJY/+OHyFVmxtvwNbOhfWE0sX4a+c+gmTZnadVthpxn8LkBqANuSN8iRL7e3N9zVQKneaAoM/3jzBJsqPWrmZcAa+xAO97JS9YY8h1lumX3UyGNMxaKTBFtujK34pORvIRLpOltQHQl/UEmFeVSf2jMgFb0xq7d+5JtKwzyeS4QrKOoClkzzVIbqMN525TkE4+sP7D8WW4SGj4LTmkGxaayHxSkWN8s1jHjRYSznQeKE9lPU94p0kU4i+63n3cgXJohVqfuYhbq3vJ23xeprc8yWp2YwXcSDZ7jTgtqW8EBIyZAUdfYKgBvO371th6tJbxkhQqQD5v8eKbJnjF3wDimX3Gmf5kTdReTO9nPbXVbmK6pKMqsiK/ebSdQGjE4XceK+jRS6vigeDKerysHD1FL4286C+UoYPnzwxeyKtFoRdbmeNJovzWqt3k8k7Yhx37shW/7Z9rwozpRpFDWy4a0nnETWmKQVjW+hLcXS8wxbNWjdo8AESLx75mmbh+CxS50/W8einnvtUhb+EIWKoV9S7HOK6uaBS5kSdrF9SgUQNkLISpm5LTJPKoIMIqr+HaLeZlbSdWIZkHON6TLTpFTJ8ZQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +2T27RJLqMYcTcK8lcPE/OaNSZ/+2bkaSoYg9HBIKSvsnzZF+qvmQG37R6I67t17XYvp7XoH7tnkQblvPur3C4r6jtgxSztyw+KVlL+iS6+iDPbc3tAefMbJQRlQYsQJyhSuN3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SgRE1+UkBF6LlYRvQ1ON5+N6WusDxFOTt+w4LsrJEorblSr0OzyNEUvGM2jtxGUk68L3KHmU1OX+IRV1lhO8Jc5PEBc+0045GJTmUjNRMIejlTos73AfxpS7KPdYaEdOv X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cef52f1f-647a-4ec4-91c6-08da957bc410 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:23.2719 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 07/13] avcodec/dcahuff: Combine tables, 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: ZkNmriSrjoWn Up until now, initializing the dca VLC tables uses ff_init_vlc_sparse() with length tables of type uint8_t and code tables of type uint16_t (except for the LBR tables, which uses length and symbols of type uint8_t; these tables are interleaved). In case of the quant index codebooks these arrays were accessed via tables of pointers to the individual tables. This commit changes this: First, we switch to ff_init_vlc_from_lengths() to replace the uint16_t code tables by uint8_t symbol tables (this necessitates ordering the tables from left-to-right in the tree first). These symbol tables are interleaved with the length tables. Furthermore, these tables are combined in order to remove the table of pointers to individual tables, thereby avoiding relocations (for x64 elf systems this amounts to 96*24B = 2304B saved in .rela.dyn) and saving 1280B from .data.rel.ro (for 64bit systems). Meanwhile the savings in .rodata amount to 2709 + 2 * 334 = 3377B. Due to padding the actual savings are higher: The ELF x64 ABI requires objects >= 16B to be padded to 16B and lots of the tables have 2^n + 1 elements of these were from replacing uint16_t codes with uint8_t symbols; the rest was due to the fact that combining the tables eliminated padding (the ELF x64 ABI requires objects >= 16B to be padded to 16B and lots of the tables have 2^n + 1 elements)). Taking this into account gives savings of 4548B. (GCC by default uses an even higher alignment (controlled by -malign-data); for it the savings are 5748B.) These changes also necessitated to modify the init code for the encoder tables. Signed-off-by: Andreas Rheinhardt --- A part of me wants to move the whole LBR tables (including its init code) to dca_lbr.c. libavcodec/dcaenc.c | 22 +- libavcodec/dcahuff.c | 1963 ++++++++++++++++-------------------------- libavcodec/dcahuff.h | 6 +- 3 files changed, 766 insertions(+), 1225 deletions(-) diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index 4a02aa9d46..d0de6d3eee 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -166,30 +166,38 @@ static uint16_t bitalloc_table[DCA_NUM_BITALLOC_CODES][2]; static const uint16_t (*bitalloc_tables[DCA_CODE_BOOKS][8])[2]; static av_cold void create_enc_table(uint16_t dst[][2], unsigned count, - const uint8_t len[], const uint16_t codes[]) + const uint8_t (**src_tablep)[2]) { + const uint8_t (*src_table)[2] = *src_tablep; + uint16_t code = 0; + for (unsigned i = 0; i < count; i++) { - dst[i][0] = codes[i]; - dst[i][1] = len[i]; + unsigned dst_idx = src_table[i][0]; + + dst[dst_idx][0] = code >> (16 - src_table[i][1]); + dst[dst_idx][1] = src_table[i][1]; + + code += 1 << (16 - src_table[i][1]); } + *src_tablep += count; } static av_cold void dcaenc_init_static_tables(void) { uint16_t (*bitalloc_dst)[2] = bitalloc_table; + const uint8_t (*src_table)[2] = ff_dca_vlc_src_tables; for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { - for (unsigned j = 0; ff_dca_bitalloc_codes[i][j]; j++) { + for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) { create_enc_table(bitalloc_dst, ff_dca_bitalloc_sizes[i], - ff_dca_bitalloc_bits[i][j], ff_dca_bitalloc_codes[i][j]); + &src_table); bitalloc_tables[i][j] = bitalloc_dst - ff_dca_bitalloc_offsets[i]; bitalloc_dst += ff_dca_bitalloc_sizes[i]; } } for (unsigned i = 0; i < DCA_BITALLOC_12_COUNT; i++) - create_enc_table(&bitalloc_12_table[i][1], 12, - ff_dca_bitalloc_12_bits[i], ff_dca_bitalloc_12_codes[i]); + create_enc_table(&bitalloc_12_table[i][1], 12, &src_table); } static int encode_init(AVCodecContext *avctx) diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index d17b49a089..ee4d4bcd6d 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -24,959 +24,15 @@ #include "libavutil/macros.h" +#include "dcadata.h" #include "dcahuff.h" -#define TMODE_COUNT 4 -static const uint16_t tmode_codes[TMODE_COUNT][4] = { - { 0x0000, 0x0002, 0x0006, 0x0007 }, - { 0x0002, 0x0006, 0x0007, 0x0000 }, - { 0x0006, 0x0007, 0x0000, 0x0002 }, - { 0x0000, 0x0001, 0x0002, 0x0003 } -}; - -static const uint8_t tmode_bits[TMODE_COUNT][4] = { - { 1, 2, 3, 3 }, - { 2, 3, 3, 1 }, - { 3, 3, 1, 2 }, - { 2, 2, 2, 2 } -}; - static const uint8_t bitalloc_12_vlc_bits[DCA_BITALLOC_12_COUNT] = { 9, 7, 7, 9, 9 }; -const uint16_t ff_dca_bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12] = { - { 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE, - 0x01FB, 0x01FA, 0x01F9, 0x01F8, }, - { 0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038, - 0x0037, 0x0036, 0x0035, 0x0034, }, - { 0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000D, 0x000C, 0x0006, - 0x000F, 0x001D, 0x0039, 0x0038, }, - { 0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, - 0x007E, 0x00FE, 0x01FF, 0x01FE, }, - { 0x0001, 0x0000, 0x0002, 0x0006, 0x000E, 0x003F, 0x003D, 0x007C, - 0x0079, 0x0078, 0x00FB, 0x00FA, } -}; - -const uint8_t ff_dca_bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12] = { - { 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 9, 9 }, - { 1, 2, 3, 5, 5, 6, 7, 7, 7, 7, 7, 7 }, - { 2, 3, 3, 3, 3, 4, 4, 4, 5, 6, 7, 7 }, - { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10 }, - { 1, 2, 3, 4, 5, 7, 7, 8, 8, 8, 9, 9 } -}; - -#define SCALES_COUNT 5 #define SCALES_VLC_BITS 9 -static const uint16_t scales_codes[SCALES_COUNT][129] = { - { 0x3AB0, 0x3AB2, 0x3AB4, 0x3AB6, 0x3AB8, 0x3ABA, 0x3ABC, 0x3ABE, - 0x3AC0, 0x3AC2, 0x3AC4, 0x3AC6, 0x3AC8, 0x3ACA, 0x3ACC, 0x3ACE, - 0x3AD0, 0x3AD2, 0x3AD4, 0x3AD6, 0x3AD8, 0x3ADA, 0x3ADC, 0x3ADE, - 0x3AE0, 0x3AE2, 0x3AE4, 0x3AE6, 0x3AE8, 0x3AEA, 0x3AEC, 0x3AEE, - 0x3AF0, 0x3AF2, 0x3AF4, 0x3AF6, 0x3AF8, 0x3AFA, 0x3AFC, 0x3AFE, - 0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054A, 0x054C, 0x054E, - 0x0558, 0x055E, 0x02AD, 0x0154, 0x0754, 0x03A8, 0x0056, 0x0028, - 0x00E8, 0x004A, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005, - 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x004B, - 0x00E9, 0x0029, 0x0057, 0x03A9, 0x0755, 0x0155, 0x02AE, 0x055F, - 0x0559, 0x054F, 0x054D, 0x054B, 0x0549, 0x0547, 0x0545, 0x0543, - 0x0541, 0x3AFF, 0x3AFD, 0x3AFB, 0x3AF9, 0x3AF7, 0x3AF5, 0x3AF3, - 0x3AF1, 0x3AEF, 0x3AED, 0x3AEB, 0x3AE9, 0x3AE7, 0x3AE5, 0x3AE3, - 0x3AE1, 0x3ADF, 0x3ADD, 0x3ADB, 0x3AD9, 0x3AD7, 0x3AD5, 0x3AD3, - 0x3AD1, 0x3ACF, 0x3ACD, 0x3ACB, 0x3AC9, 0x3AC7, 0x3AC5, 0x3AC3, - 0x3AC1, 0x3ABF, 0x3ABD, 0x3ABB, 0x3AB9, 0x3AB7, 0x3AB5, 0x3AB3, - 0x3AB1, }, - { 0x0F60, 0x0F62, 0x0F64, 0x0F66, 0x0F68, 0x0F6A, 0x0F6C, 0x0F6E, - 0x0F70, 0x0F72, 0x0F74, 0x0F76, 0x0F78, 0x0F7A, 0x0F7C, 0x0F7E, - 0x0F80, 0x0F82, 0x0F84, 0x0F86, 0x0F88, 0x0F8A, 0x0F8C, 0x0F8E, - 0x0F90, 0x0F92, 0x0F94, 0x0F96, 0x0F98, 0x0F9A, 0x0F9C, 0x0F9E, - 0x0FA0, 0x0FA2, 0x0FA4, 0x0FA6, 0x0FA8, 0x0FAA, 0x0FAC, 0x0FAE, - 0x0FB0, 0x0FB2, 0x0FB4, 0x0FB6, 0x0FB8, 0x0FBA, 0x0FBC, 0x0FBE, - 0x07A0, 0x07A2, 0x03D2, 0x01EA, 0x00FC, 0x007F, 0x001C, 0x000C, - 0x0004, 0x0034, 0x0010, 0x001B, 0x0009, 0x000B, 0x000E, 0x0001, - 0x0003, 0x0002, 0x000F, 0x000C, 0x000A, 0x0000, 0x0011, 0x0035, - 0x0005, 0x000D, 0x001D, 0x003C, 0x00FD, 0x01EB, 0x03D3, 0x07A3, - 0x07A1, 0x0FBF, 0x0FBD, 0x0FBB, 0x0FB9, 0x0FB7, 0x0FB5, 0x0FB3, - 0x0FB1, 0x0FAF, 0x0FAD, 0x0FAB, 0x0FA9, 0x0FA7, 0x0FA5, 0x0FA3, - 0x0FA1, 0x0F9F, 0x0F9D, 0x0F9B, 0x0F99, 0x0F97, 0x0F95, 0x0F93, - 0x0F91, 0x0F8F, 0x0F8D, 0x0F8B, 0x0F89, 0x0F87, 0x0F85, 0x0F83, - 0x0F81, 0x0F7F, 0x0F7D, 0x0F7B, 0x0F79, 0x0F77, 0x0F75, 0x0F73, - 0x0F71, 0x0F6F, 0x0F6D, 0x0F6B, 0x0F69, 0x0F67, 0x0F65, 0x0F63, - 0x0F61, }, - { 0x51D0, 0x51D2, 0x51D4, 0x51D6, 0x51D8, 0x51DA, 0x51DC, 0x51DE, - 0x51E0, 0x51E2, 0x51E4, 0x51E6, 0x51E8, 0x51EA, 0x51EC, 0x51EE, - 0x51F0, 0x51F2, 0x51F4, 0x51F6, 0x51F8, 0x51FA, 0x51FC, 0x51FE, - 0x70C0, 0x70C2, 0x70C4, 0x70C6, 0x70C8, 0x70CA, 0x70CC, 0x70CE, - 0x70EC, 0x10EA, 0x3868, 0x3877, 0x0876, 0x1C35, 0x0434, 0x0A34, - 0x0E1B, 0x021B, 0x051B, 0x070F, 0x010F, 0x0380, 0x0080, 0x0140, - 0x01C1, 0x0041, 0x00A1, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012, - 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000, - 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B, - 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A2, 0x0042, - 0x01C2, 0x0141, 0x0081, 0x0381, 0x028C, 0x010C, 0x051C, 0x021C, - 0x0E1C, 0x0A35, 0x0435, 0x1C3A, 0x0877, 0x0874, 0x3869, 0x10EB, - 0x70ED, 0x70CF, 0x70CD, 0x70CB, 0x70C9, 0x70C7, 0x70C5, 0x70C3, - 0x70C1, 0x51FF, 0x51FD, 0x51FB, 0x51F9, 0x51F7, 0x51F5, 0x51F3, - 0x51F1, 0x51EF, 0x51ED, 0x51EB, 0x51E9, 0x51E7, 0x51E5, 0x51E3, - 0x51E1, 0x51DF, 0x51DD, 0x51DB, 0x51D9, 0x51D7, 0x51D5, 0x51D3, - 0x51D1, }, - { 0x6F64, 0x6F66, 0x6F68, 0x6F6A, 0x6F6C, 0x6F6E, 0x6F70, 0x6F72, - 0x6F74, 0x6F76, 0x6F78, 0x6F7A, 0x6F7C, 0x6F7E, 0x6F80, 0x6F82, - 0x6F84, 0x6F86, 0x6F88, 0x6F8A, 0x6F8C, 0x6F8E, 0x6F90, 0x6F92, - 0x6F94, 0x6F96, 0x6F98, 0x6F9A, 0x6F9C, 0x6F9E, 0x6FA0, 0x6FA2, - 0x6FA4, 0x6FA6, 0x6FA8, 0x6FAA, 0x6FAC, 0x6FAE, 0x6FB0, 0x6FB2, - 0x6FB4, 0x6FB6, 0x17B4, 0x37DC, 0x0BDB, 0x1BEF, 0x05EE, 0x0DF8, - 0x02F8, 0x06FD, 0x017D, 0x037F, 0x00BF, 0x0040, 0x00C0, 0x0021, - 0x0061, 0x0011, 0x0031, 0x0009, 0x0019, 0x0006, 0x000E, 0x0004, - 0x0000, 0x0005, 0x000F, 0x0007, 0x001A, 0x000A, 0x0036, 0x0016, - 0x006E, 0x002E, 0x00C1, 0x0041, 0x01BC, 0x00BC, 0x037A, 0x017A, - 0x02F9, 0x0DF9, 0x05EF, 0x05EC, 0x1BD8, 0x37DD, 0x17B5, 0x6FB7, - 0x6FB5, 0x6FB3, 0x6FB1, 0x6FAF, 0x6FAD, 0x6FAB, 0x6FA9, 0x6FA7, - 0x6FA5, 0x6FA3, 0x6FA1, 0x6F9F, 0x6F9D, 0x6F9B, 0x6F99, 0x6F97, - 0x6F95, 0x6F93, 0x6F91, 0x6F8F, 0x6F8D, 0x6F8B, 0x6F89, 0x6F87, - 0x6F85, 0x6F83, 0x6F81, 0x6F7F, 0x6F7D, 0x6F7B, 0x6F79, 0x6F77, - 0x6F75, 0x6F73, 0x6F71, 0x6F6F, 0x6F6D, 0x6F6B, 0x6F69, 0x6F67, - 0x6F65, }, - { 0xDF54, 0xDF56, 0xDFC8, 0xDFCA, 0xDFCC, 0xDFCE, 0xDFD0, 0xDFD2, - 0xDFD4, 0xDFD6, 0xDFD8, 0xDFDA, 0xDFDC, 0xDFDE, 0xDFE0, 0xDFE2, - 0x0FE8, 0x2FEA, 0x6FA8, 0x6FF6, 0x07F5, 0x07F7, 0x37D2, 0x37F9, - 0x03F8, 0x0BF8, 0x0BFB, 0x1BEB, 0x01FA, 0x05FA, 0x09FA, 0x0DFA, - 0x0DFF, 0x00FF, 0x02FF, 0x06FB, 0x007C, 0x017C, 0x027C, 0x027F, - 0x003C, 0x00BC, 0x013C, 0x01BC, 0x001C, 0x005C, 0x009C, 0x00DC, - 0x000C, 0x002C, 0x004C, 0x006C, 0x0004, 0x0014, 0x0024, 0x0034, - 0x0000, 0x0008, 0x0010, 0x0018, 0x001E, 0x0002, 0x0006, 0x000A, - 0x000E, 0x000B, 0x0007, 0x0003, 0x001F, 0x0019, 0x0011, 0x0009, - 0x0001, 0x0035, 0x0025, 0x0015, 0x0005, 0x006D, 0x004D, 0x002D, - 0x000D, 0x00DD, 0x009D, 0x005D, 0x001D, 0x01BD, 0x013D, 0x00BD, - 0x003D, 0x037C, 0x027D, 0x017D, 0x007D, 0x06FC, 0x04FC, 0x02FC, - 0x00FC, 0x0DFB, 0x09FB, 0x05FB, 0x01FB, 0x1BF8, 0x1BE8, 0x0BF9, - 0x03F9, 0x37FA, 0x37D3, 0x17F4, 0x07F6, 0x6FF7, 0x6FA9, 0x2FEB, - 0x0FE9, 0xDFE3, 0xDFE1, 0xDFDF, 0xDFDD, 0xDFDB, 0xDFD9, 0xDFD7, - 0xDFD5, 0xDFD3, 0xDFD1, 0xDFCF, 0xDFCD, 0xDFCB, 0xDFC9, 0xDF57, - 0xDF55, } -}; - -static const uint8_t scales_bits[SCALES_COUNT][129] = { - { 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 12, 11, 11, 10, 9, 8, - 8, 7, 6, 6, 5, 4, 4, 3, - 2, 3, 3, 4, 5, 5, 6, 7, - 8, 8, 9, 10, 11, 11, 12, 13, - 13, 13, 13, 13, 13, 13, 13, 13, - 13, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 14, 14, 13, 12, 11, 10, 8, 7, - 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 4, 5, 6, - 6, 7, 8, 9, 11, 12, 13, 14, - 14, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 14, 14, 14, 13, 13, 12, 12, - 12, 11, 11, 11, 10, 10, 9, 9, - 9, 8, 8, 8, 7, 7, 7, 6, - 6, 6, 5, 5, 5, 4, 4, 3, - 3, 3, 4, 4, 5, 5, 5, 6, - 6, 6, 7, 7, 7, 8, 8, 8, - 9, 9, 9, 10, 10, 10, 11, 11, - 12, 12, 12, 13, 13, 13, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 14, 14, 13, 13, 12, 12, - 11, 11, 10, 10, 9, 8, 8, 7, - 7, 6, 6, 5, 5, 4, 4, 3, - 2, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, - 11, 12, 12, 12, 13, 14, 14, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 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, - 16, 16, 16, 16, 16, 16, 16, 16, - 15, 15, 15, 15, 14, 14, 14, 14, - 13, 13, 13, 13, 12, 12, 12, 12, - 12, 11, 11, 11, 10, 10, 10, 10, - 9, 9, 9, 9, 8, 8, 8, 8, - 7, 7, 7, 7, 6, 6, 6, 6, - 5, 5, 5, 5, 5, 4, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, - 5, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 10, 11, 11, 11, - 11, 12, 12, 12, 12, 13, 13, 13, - 13, 14, 14, 14, 14, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, - } -}; - -static const uint16_t bitalloc_3_codes[3] = { - 0x0003, 0x0000, 0x0002, -}; - -static const uint8_t bitalloc_3_bits[3] = { - 2, 1, 2, -}; - -static const uint16_t bitalloc_5_codes_a[5] = { - 0x000F, 0x0006, 0x0000, 0x0002, 0x000E, -}; - -static const uint16_t bitalloc_5_codes_b[5] = { - 0x0007, 0x0001, 0x0002, 0x0000, 0x0006, -}; - -static const uint16_t bitalloc_5_codes_c[5] = { - 0x0007, 0x0005, 0x0000, 0x0004, 0x0006, -}; - -static const uint8_t bitalloc_5_bits_a[5] = { - 4, 3, 1, 2, 4, -}; - -static const uint8_t bitalloc_5_bits_b[5] = { - 3, 2, 2, 2, 3, -}; - -static const uint8_t bitalloc_5_bits_c[5] = { - 3, 3, 1, 3, 3, -}; - -static const uint16_t bitalloc_7_codes_a[7] = { - 0x001E, 0x000E, 0x0005, 0x0000, 0x0006, 0x0004, 0x001F, -}; - -static const uint16_t bitalloc_7_codes_b[7] = { - 0x0014, 0x000B, 0x0000, 0x0003, 0x0001, 0x0004, 0x0015, -}; - -static const uint16_t bitalloc_7_codes_c[7] = { - 0x0000, 0x0002, 0x0001, 0x0003, 0x0002, 0x0003, 0x0001, -}; - -static const uint8_t bitalloc_7_bits_a[7] = { - 5, 4, 3, 1, 3, 3, 5, -}; - -static const uint8_t bitalloc_7_bits_b[7] = { - 5, 4, 2, 2, 2, 3, 5, -}; - -static const uint8_t bitalloc_7_bits_c[7] = { - 4, 4, 2, 2, 2, 4, 4, -}; - -static const uint16_t bitalloc_9_codes_a[9] = { - 0x0030, 0x0019, 0x0009, 0x0005, 0x0000, 0x0007, 0x000D, 0x0008, - 0x0031, -}; - -static const uint16_t bitalloc_9_codes_b[9] = { - 0x0018, 0x001A, 0x0002, 0x0007, 0x0002, 0x0000, 0x0003, 0x001B, - 0x0019, -}; - -static const uint16_t bitalloc_9_codes_c[9] = { - 0x001C, 0x000F, 0x0002, 0x0007, 0x0002, 0x0000, 0x0006, 0x0006, - 0x001D, -}; - -static const uint8_t bitalloc_9_bits_a[9] = { - 6, 5, 4, 3, 1, 3, 4, 4, 6, -}; - -static const uint8_t bitalloc_9_bits_b[9] = { - 5, 5, 3, 3, 2, 2, 3, 5, 5, -}; - -static const uint8_t bitalloc_9_bits_c[9] = { - 6, 5, 3, 3, 2, 2, 3, 4, 6, -}; - -static const uint16_t bitalloc_13_codes_a[13] = { - 0x0070, 0x002E, 0x0039, 0x001D, 0x000C, 0x000F, 0x0000, 0x0004, - 0x000D, 0x000A, 0x0016, 0x002F, 0x0071, -}; - -static const uint16_t bitalloc_13_codes_b[13] = { - 0x0038, 0x0010, 0x001D, 0x0007, 0x000F, 0x0005, 0x0000, 0x0006, - 0x0002, 0x0009, 0x0006, 0x0011, 0x0039, -}; - -static const uint16_t bitalloc_13_codes_c[13] = { - 0x0004, 0x001A, 0x0003, 0x000E, 0x0000, 0x0003, 0x0005, 0x0004, - 0x0002, 0x000F, 0x000C, 0x001B, 0x0005, -}; - -static const uint8_t bitalloc_13_bits_a[13] = { - 7, 6, 6, 5, 4, 4, 1, 3, 4, 4, 5, 6, 7, -}; - -static const uint8_t bitalloc_13_bits_b[13] = { - 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 4, 5, 6, -}; - -static const uint8_t bitalloc_13_bits_c[13] = { - 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5, -}; - -static const uint16_t bitalloc_17_codes_a[17] = { - 0x0154, 0x00AB, 0x002B, 0x000B, 0x0003, 0x000A, 0x0001, 0x0006, - 0x0001, 0x0007, 0x0004, 0x000B, 0x0000, 0x0004, 0x0014, 0x0054, - 0x0155, -}; - -static const uint16_t bitalloc_17_codes_b[17] = { - 0x007C, 0x003F, 0x0019, 0x000D, 0x001C, 0x0008, 0x000F, 0x0005, - 0x0000, 0x0006, 0x0002, 0x0009, 0x001D, 0x000E, 0x001E, 0x0018, - 0x007D, -}; - -static const uint16_t bitalloc_17_codes_c[17] = { - 0x002C, 0x0017, 0x0005, 0x001C, 0x0003, 0x000A, 0x000F, 0x0003, - 0x0006, 0x0004, 0x0000, 0x000B, 0x0004, 0x001D, 0x000A, 0x0004, - 0x002D, -}; - -static const uint16_t bitalloc_17_codes_d[17] = { - 0x0100, 0x0102, 0x0082, 0x0042, 0x0022, 0x0012, 0x000A, 0x0006, - 0x0000, 0x0007, 0x000B, 0x0013, 0x0023, 0x0043, 0x0083, 0x0103, - 0x0101, -}; - -static const uint16_t bitalloc_17_codes_e[17] = { - 0x00E8, 0x00F6, 0x0075, 0x0034, 0x003B, 0x001B, 0x001F, 0x0004, - 0x0000, 0x0005, 0x000C, 0x001C, 0x003C, 0x0035, 0x007A, 0x00F7, - 0x00E9, -}; - -static const uint16_t bitalloc_17_codes_f[17] = { - 0x0004, 0x0003, 0x001E, 0x0001, 0x0001, 0x000E, 0x0001, 0x0004, - 0x0006, 0x0005, 0x0002, 0x000F, 0x0006, 0x000E, 0x001F, 0x0000, - 0x0005, -}; - -static const uint16_t bitalloc_17_codes_g[17] = { - 0x0060, 0x007E, 0x0031, 0x0019, 0x000D, 0x0004, 0x0000, 0x0006, - 0x0002, 0x0007, 0x0001, 0x0005, 0x000E, 0x001E, 0x003E, 0x007F, - 0x0061, -}; - -static const uint8_t bitalloc_17_bits_a[17] = { - 12, 11, 9, 7, 5, 4, 3, 3, 2, 3, 3, 4, 4, 6, 8, 10, - 12, -}; - -static const uint8_t bitalloc_17_bits_b[17] = { - 8, 7, 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 5, 5, 6, 6, - 8, -}; - -static const uint8_t bitalloc_17_bits_c[17] = { - 7, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 5, 5, - 7, -}; - -static const uint8_t bitalloc_17_bits_d[17] = { - 9, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 8, 9, - 9, -}; - -static const uint8_t bitalloc_17_bits_e[17] = { - 8, 8, 7, 6, 6, 5, 5, 3, 1, 3, 4, 5, 6, 6, 7, 8, - 8, -}; - -static const uint8_t bitalloc_17_bits_f[17] = { - 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6, - 8, -}; - -static const uint8_t bitalloc_17_bits_g[17] = { - 8, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, 5, 6, 7, 8, - 8, -}; - -static const uint16_t bitalloc_25_codes_a[25] = { - 0x2854, 0x142B, 0x050B, 0x0143, 0x00A2, 0x0052, 0x002E, 0x0015, - 0x0004, 0x000E, 0x0000, 0x0003, 0x0006, 0x0004, 0x0001, 0x000F, - 0x0005, 0x0016, 0x002F, 0x0053, 0x00A3, 0x00A0, 0x0284, 0x0A14, - 0x2855, -}; - -static const uint16_t bitalloc_25_codes_b[25] = { - 0x001C, 0x000F, 0x0005, 0x0000, 0x0030, 0x0036, 0x000E, 0x0019, - 0x0001, 0x0008, 0x000E, 0x0001, 0x0005, 0x0002, 0x000F, 0x0009, - 0x0006, 0x001A, 0x000F, 0x0037, 0x0031, 0x0001, 0x0006, 0x0004, - 0x001D, -}; - -static const uint16_t bitalloc_25_codes_c[25] = { - 0x004C, 0x0027, 0x006D, 0x0028, 0x0037, 0x000E, 0x0015, 0x0000, - 0x0005, 0x0008, 0x000B, 0x000E, 0x0001, 0x000F, 0x000C, 0x0009, - 0x0006, 0x0001, 0x001A, 0x000F, 0x0008, 0x0029, 0x0012, 0x006C, - 0x004D, -}; - -static const uint16_t bitalloc_25_codes_d[25] = { - 0x0780, 0x0782, 0x03C2, 0x01E2, 0x00FE, 0x0079, 0x003D, 0x001C, - 0x000C, 0x0004, 0x0000, 0x0006, 0x0002, 0x0007, 0x0001, 0x0005, - 0x000D, 0x001D, 0x003E, 0x007E, 0x00FF, 0x01E3, 0x03C3, 0x0783, - 0x0781, -}; - -static const uint16_t bitalloc_25_codes_e[25] = { - 0x003C, 0x0092, 0x0018, 0x001F, 0x004E, 0x000D, 0x0025, 0x0004, - 0x0010, 0x0000, 0x000A, 0x0002, 0x0003, 0x0003, 0x000B, 0x0001, - 0x0011, 0x0005, 0x0026, 0x000E, 0x004F, 0x0048, 0x0019, 0x0093, - 0x003D, -}; - -static const uint16_t bitalloc_25_codes_f[25] = { - 0x0324, 0x0193, 0x00CE, 0x0065, 0x0024, 0x000C, 0x0013, 0x0004, - 0x0007, 0x000A, 0x000D, 0x000F, 0x0001, 0x0000, 0x000E, 0x000B, - 0x0008, 0x0005, 0x0018, 0x000D, 0x0025, 0x0066, 0x00CF, 0x00C8, - 0x0325, -}; - -static const uint16_t bitalloc_25_codes_g[25] = { - 0x03A8, 0x03AE, 0x01D5, 0x0094, 0x0014, 0x004B, 0x000B, 0x003B, - 0x0013, 0x0003, 0x000F, 0x0005, 0x0001, 0x0006, 0x0000, 0x0008, - 0x001C, 0x0004, 0x0024, 0x0074, 0x0015, 0x0095, 0x01D6, 0x03AF, - 0x03A9, -}; - -static const uint8_t bitalloc_25_bits_a[25] = { - 14, 13, 11, 9, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, - 4, 5, 6, 7, 8, 8, 10, 12, 14, -}; - -static const uint8_t bitalloc_25_bits_b[25] = { - 9, 8, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 4, 4, - 4, 5, 5, 6, 6, 6, 7, 7, 9, -}; - -static const uint8_t bitalloc_25_bits_c[25] = { - 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 4, 4, 3, 4, 4, 4, - 4, 4, 5, 5, 5, 6, 6, 7, 8, -}; - -static const uint8_t bitalloc_25_bits_d[25] = { - 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 12, -}; - -static const uint8_t bitalloc_25_bits_e[25] = { - 8, 8, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 2, 3, 4, 4, - 5, 5, 6, 6, 7, 7, 7, 8, 8, -}; - -static const uint8_t bitalloc_25_bits_f[25] = { - 10, 9, 8, 7, 6, 5, 5, 4, 4, 4, 4, 4, 3, 3, 4, 4, - 4, 4, 5, 5, 6, 7, 8, 8, 10, -}; - -static const uint8_t bitalloc_25_bits_g[25] = { - 10, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 3, 3, 4, - 5, 5, 6, 7, 7, 8, 9, 10, 10, -}; - -static const uint16_t bitalloc_33_codes_a[33] = { - 0x1580, 0x1582, 0x0AC2, 0x0562, 0x02B2, 0x015E, 0x00AD, 0x0054, - 0x001C, 0x003C, 0x000F, 0x001F, 0x0008, 0x000B, 0x000D, 0x0000, - 0x0002, 0x0001, 0x000E, 0x000C, 0x0009, 0x0006, 0x0014, 0x003D, - 0x001D, 0x0055, 0x00AE, 0x015F, 0x02B3, 0x0563, 0x0AC3, 0x1583, - 0x1581, -}; - -static const uint16_t bitalloc_33_codes_b[33] = { - 0x030C, 0x0187, 0x006D, 0x0028, 0x0037, 0x0066, 0x0015, 0x0031, - 0x0000, 0x000B, 0x0012, 0x001A, 0x0001, 0x0007, 0x000A, 0x000E, - 0x0001, 0x000F, 0x000B, 0x0008, 0x0004, 0x001B, 0x0013, 0x000C, - 0x0001, 0x0032, 0x001A, 0x0067, 0x0060, 0x0029, 0x00C2, 0x006C, - 0x030D, -}; - -static const uint16_t bitalloc_33_codes_c[33] = { - 0x00CC, 0x0067, 0x0005, 0x0070, 0x0003, 0x001A, 0x0039, 0x003F, - 0x000A, 0x0012, 0x0018, 0x001D, 0x0001, 0x0003, 0x0007, 0x000A, - 0x000D, 0x000B, 0x0008, 0x0004, 0x0002, 0x001E, 0x0019, 0x0013, - 0x000B, 0x0000, 0x003E, 0x001B, 0x0018, 0x0071, 0x0032, 0x0004, - 0x00CD, -}; - -static const uint16_t bitalloc_33_codes_d[33] = { - 0x3AF8, 0x3AFA, 0x1D7E, 0x0EBC, 0x075C, 0x03AC, 0x01D4, 0x0094, - 0x0014, 0x004B, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005, - 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x0074, - 0x0015, 0x0095, 0x01D5, 0x03AD, 0x075D, 0x0EBD, 0x1D7F, 0x3AFB, - 0x3AF9, -}; - -static const uint16_t bitalloc_33_codes_e[33] = { - 0x01C8, 0x01E6, 0x0064, 0x00E2, 0x00E5, 0x0030, 0x0033, 0x0073, - 0x007A, 0x001A, 0x003A, 0x0002, 0x001A, 0x001F, 0x0007, 0x0001, - 0x0002, 0x0002, 0x000C, 0x0000, 0x001B, 0x0003, 0x003B, 0x001B, - 0x007B, 0x0078, 0x0070, 0x0031, 0x00F2, 0x00E3, 0x0065, 0x01E7, - 0x01C9, -}; - -static const uint16_t bitalloc_33_codes_f[33] = { - 0x0724, 0x0393, 0x01CE, 0x00E5, 0x002C, 0x0008, 0x0017, 0x003E, - 0x0005, 0x0014, 0x001D, 0x0000, 0x0003, 0x0006, 0x0008, 0x000B, - 0x000D, 0x000C, 0x0009, 0x0007, 0x0004, 0x0001, 0x001E, 0x0015, - 0x000A, 0x003F, 0x0038, 0x0009, 0x002D, 0x00E6, 0x01CF, 0x01C8, - 0x0725, -}; - -static const uint16_t bitalloc_33_codes_g[33] = { - 0x0284, 0x0042, 0x0140, 0x0143, 0x003E, 0x00BE, 0x0011, 0x0051, - 0x0009, 0x0029, 0x0005, 0x0015, 0x0000, 0x0008, 0x000E, 0x0002, - 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0016, 0x0006, 0x002E, - 0x000E, 0x005E, 0x001E, 0x00BF, 0x003F, 0x0020, 0x0141, 0x0043, - 0x0285, -}; - -static const uint8_t bitalloc_33_bits_a[33] = { - 13, 13, 12, 11, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, - 13, -}; - -static const uint8_t bitalloc_33_bits_b[33] = { - 10, 9, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, - 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, - 10, -}; - -static const uint8_t bitalloc_33_bits_c[33] = { - 9, 8, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, - 9, -}; - -static const uint8_t bitalloc_33_bits_d[33] = { - 14, 14, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, - 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, - 14, -}; - -static const uint8_t bitalloc_33_bits_e[33] = { - 9, 9, 8, 8, 8, 7, 7, 7, 7, 6, 6, 5, 5, 5, 4, 3, - 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, - 9, -}; - -static const uint8_t bitalloc_33_bits_f[33] = { - 11, 10, 9, 8, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, - 11, -}; - -static const uint8_t bitalloc_33_bits_g[33] = { - 10, 9, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, - 10, -}; - -static const uint16_t bitalloc_65_codes_a[65] = { - 0x9E5C, 0x9E5E, 0x4F2C, 0x2794, 0x13C4, 0x1E44, 0x09E3, 0x0F23, - 0x04F3, 0x0792, 0x027E, 0x03CE, 0x013D, 0x01E5, 0x009C, 0x00CC, - 0x0040, 0x0058, 0x0067, 0x001E, 0x0021, 0x002D, 0x003D, 0x0007, - 0x0011, 0x0014, 0x0017, 0x001A, 0x001C, 0x001F, 0x0001, 0x0004, - 0x0006, 0x0005, 0x0002, 0x0000, 0x001D, 0x001B, 0x0018, 0x0015, - 0x0012, 0x000E, 0x0006, 0x0032, 0x0026, 0x001F, 0x0078, 0x0059, - 0x0041, 0x00CD, 0x009D, 0x01E6, 0x013E, 0x03CF, 0x027F, 0x0793, - 0x0790, 0x04F0, 0x09E4, 0x1E45, 0x13C5, 0x2795, 0x4F2D, 0x9E5F, - 0x9E5D, -}; - -static const uint16_t bitalloc_65_codes_b[65] = { - 0x0A8C, 0x0547, 0x01B5, 0x0008, 0x00DB, 0x0152, 0x0005, 0x000B, - 0x008E, 0x00AE, 0x00E4, 0x0003, 0x0037, 0x0039, 0x0055, 0x006C, - 0x0073, 0x0003, 0x0015, 0x001D, 0x0028, 0x0030, 0x0037, 0x003E, - 0x0006, 0x000B, 0x000F, 0x0012, 0x0016, 0x0019, 0x001D, 0x0001, - 0x0004, 0x0002, 0x001E, 0x001A, 0x0017, 0x0013, 0x0010, 0x000C, - 0x0007, 0x003F, 0x0038, 0x0031, 0x0029, 0x0022, 0x001A, 0x0014, - 0x0000, 0x006D, 0x0056, 0x0046, 0x0038, 0x0004, 0x00E5, 0x00AF, - 0x008F, 0x006C, 0x000A, 0x0153, 0x0150, 0x0009, 0x02A2, 0x01B4, - 0x0A8D, -}; - -static const uint16_t bitalloc_65_codes_c[65] = { - 0x045C, 0x022F, 0x03F5, 0x01BC, 0x01FB, 0x0059, 0x00D0, 0x00DF, - 0x000A, 0x002D, 0x002F, 0x0052, 0x0069, 0x0078, 0x007F, 0x000A, - 0x0010, 0x001C, 0x0023, 0x002A, 0x0035, 0x003A, 0x003D, 0x0000, - 0x0003, 0x0006, 0x0009, 0x000C, 0x000F, 0x0012, 0x0016, 0x0018, - 0x001C, 0x0019, 0x0017, 0x0013, 0x0010, 0x000D, 0x000A, 0x0007, - 0x0004, 0x0001, 0x003E, 0x003B, 0x0036, 0x002B, 0x0028, 0x001D, - 0x0011, 0x000B, 0x0004, 0x0079, 0x006E, 0x0053, 0x0044, 0x002E, - 0x000B, 0x00FC, 0x00D1, 0x008A, 0x0058, 0x01BD, 0x0116, 0x03F4, - 0x045D, -}; - -static const uint16_t bitalloc_65_codes_d[65] = { - 0x70B0, 0x70B2, 0x70B4, 0x2852, 0x385B, 0x142E, 0x1C2E, 0x0A15, - 0x0E14, 0x0214, 0x0704, 0x0104, 0x010B, 0x0383, 0x0083, 0x0143, - 0x01C3, 0x0043, 0x00A2, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012, - 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000, - 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B, - 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A3, 0x00A0, - 0x0040, 0x01C0, 0x0084, 0x0384, 0x0284, 0x0105, 0x0705, 0x0215, - 0x0E15, 0x0A16, 0x1C2F, 0x142F, 0x1428, 0x2853, 0x70B5, 0x70B3, - 0x70B1, -}; - -static const uint16_t bitalloc_65_codes_e[65] = { - 0x032C, 0x0332, 0x0378, 0x037E, 0x008C, 0x014A, 0x0188, 0x0197, - 0x019E, 0x01BD, 0x0044, 0x0047, 0x00AA, 0x00C5, 0x00CD, 0x00DC, - 0x001C, 0x002C, 0x0053, 0x0063, 0x0068, 0x0008, 0x000F, 0x0017, - 0x002B, 0x0035, 0x0005, 0x0009, 0x0016, 0x001C, 0x0006, 0x000F, - 0x0004, 0x0000, 0x0007, 0x001D, 0x0017, 0x000A, 0x0006, 0x0036, - 0x0030, 0x0028, 0x0010, 0x0009, 0x0069, 0x0064, 0x0054, 0x002D, - 0x001D, 0x00DD, 0x00CE, 0x00CA, 0x00AB, 0x00A4, 0x0045, 0x01BE, - 0x019F, 0x0198, 0x0189, 0x014B, 0x008D, 0x037F, 0x0379, 0x0333, - 0x032D, -}; - -static const uint16_t bitalloc_65_codes_f[65] = { - 0x0FE0, 0x0FE2, 0x0FE8, 0x0FEA, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2, - 0x0FF4, 0x2FF2, 0x07F2, 0x07FB, 0x03F6, 0x0BFA, 0x0BFD, 0x01FF, - 0x05FF, 0x02FC, 0x007C, 0x017C, 0x003C, 0x00BC, 0x001C, 0x005C, - 0x000C, 0x002C, 0x0004, 0x0014, 0x0000, 0x0008, 0x000E, 0x0002, - 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0015, 0x0005, 0x002D, - 0x000D, 0x005D, 0x001D, 0x00BD, 0x003D, 0x017D, 0x007D, 0x02FD, - 0x00FC, 0x05FC, 0x01FA, 0x0BFB, 0x03F7, 0x17F8, 0x07F3, 0x2FF3, - 0x0FF5, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x0FEB, 0x0FE9, 0x0FE3, - 0x0FE1, -}; - -static const uint16_t bitalloc_65_codes_g[65] = { - 0x010C, 0x038A, 0x0608, 0x0786, 0x0084, 0x0087, 0x0302, 0x0305, - 0x0040, 0x00E0, 0x00E3, 0x0183, 0x001E, 0x005E, 0x009E, 0x00DE, - 0x00F1, 0x0011, 0x0039, 0x0061, 0x0079, 0x0009, 0x001D, 0x0031, - 0x003D, 0x0005, 0x000F, 0x0019, 0x001F, 0x0003, 0x0006, 0x000A, - 0x000E, 0x000B, 0x0008, 0x0004, 0x0000, 0x001A, 0x0012, 0x000A, - 0x0002, 0x0036, 0x0026, 0x0016, 0x0006, 0x006E, 0x004E, 0x002E, - 0x000E, 0x00DF, 0x009F, 0x005F, 0x001F, 0x01E0, 0x0180, 0x00E1, - 0x0041, 0x03C2, 0x0303, 0x01C4, 0x0085, 0x0787, 0x0609, 0x038B, - 0x010D, -}; - -static const uint8_t bitalloc_65_bits_a[65] = { - 16, 16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, - 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, - 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 15, 16, - 16, -}; - -static const uint8_t bitalloc_65_bits_b[65] = { - 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, - 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 12, -}; - -static const uint8_t bitalloc_65_bits_c[65] = { - 11, 10, 10, 9, 9, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, - 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, - 11, -}; - -static const uint8_t bitalloc_65_bits_d[65] = { - 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 10, 9, 9, - 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 3, - 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, - 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15, - 15, -}; - -static const uint8_t bitalloc_65_bits_e[65] = { - 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, - 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, - 3, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, - 10, -}; - -static const uint8_t bitalloc_65_bits_f[65] = { - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11, - 11, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, -}; - -static const uint8_t bitalloc_65_bits_g[65] = { - 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, - 11, -}; - -static const uint16_t bitalloc_129_codes_a[129] = { - 0x0660, 0x0666, 0x06EC, 0x0722, 0x0760, 0x076E, 0x004C, 0x004E, - 0x00F4, 0x010A, 0x0148, 0x0156, 0x01D4, 0x01F2, 0x0331, 0x0370, - 0x0377, 0x0396, 0x03B1, 0x0024, 0x0064, 0x007B, 0x008A, 0x00A5, - 0x00D4, 0x00EB, 0x00FA, 0x019A, 0x01B9, 0x01C9, 0x01D9, 0x0010, - 0x0030, 0x0033, 0x0043, 0x0053, 0x006B, 0x007A, 0x00CA, 0x00D2, - 0x00DE, 0x00E6, 0x00F6, 0x000E, 0x001F, 0x0023, 0x002B, 0x003B, - 0x003F, 0x0067, 0x0070, 0x0077, 0x0005, 0x000D, 0x0012, 0x001B, - 0x002C, 0x0035, 0x003A, 0x0004, 0x000B, 0x0017, 0x001F, 0x0009, - 0x0008, 0x000A, 0x0000, 0x0018, 0x000C, 0x0005, 0x003C, 0x0036, - 0x002D, 0x001C, 0x0013, 0x000E, 0x0006, 0x007A, 0x0071, 0x0068, - 0x0064, 0x003C, 0x0034, 0x0028, 0x0020, 0x000F, 0x00F7, 0x00E7, - 0x00DF, 0x00D3, 0x00CB, 0x007B, 0x0074, 0x0054, 0x0044, 0x003C, - 0x0031, 0x0011, 0x01DA, 0x01CA, 0x01BA, 0x019B, 0x00FB, 0x00F8, - 0x00D5, 0x00AA, 0x008B, 0x0084, 0x0065, 0x0025, 0x03B6, 0x0397, - 0x0390, 0x0371, 0x0332, 0x01F3, 0x01D5, 0x0157, 0x0149, 0x010B, - 0x00F5, 0x004F, 0x004D, 0x076F, 0x0761, 0x0723, 0x06ED, 0x0667, - 0x0661, -}; - -static const uint16_t bitalloc_129_codes_b[129] = { - 0x29DC, 0x14EF, 0x0455, 0x0E9C, 0x022B, 0x0489, 0x0740, 0x074F, - 0x0172, 0x0245, 0x0247, 0x030A, 0x03A1, 0x001C, 0x008B, 0x00D6, - 0x010C, 0x0148, 0x014F, 0x0186, 0x01D1, 0x0008, 0x000F, 0x0046, - 0x005D, 0x0078, 0x0087, 0x0096, 0x00A5, 0x00BC, 0x00D8, 0x00DE, - 0x00F6, 0x0005, 0x0014, 0x0024, 0x002F, 0x003A, 0x003D, 0x0049, - 0x0050, 0x0058, 0x005F, 0x0066, 0x006D, 0x0075, 0x007C, 0x0004, - 0x000B, 0x0013, 0x0018, 0x001B, 0x001F, 0x0022, 0x0026, 0x002A, - 0x002D, 0x0031, 0x0034, 0x0038, 0x003B, 0x003F, 0x0003, 0x0006, - 0x000A, 0x0007, 0x0004, 0x0000, 0x003C, 0x0039, 0x0035, 0x0032, - 0x002E, 0x002B, 0x0027, 0x0023, 0x0020, 0x001C, 0x0019, 0x0016, - 0x0010, 0x0005, 0x007D, 0x007A, 0x006E, 0x0067, 0x0060, 0x0059, - 0x0051, 0x004A, 0x0042, 0x003B, 0x0034, 0x0025, 0x0015, 0x0006, - 0x00F7, 0x00DF, 0x00D9, 0x00BD, 0x00A6, 0x0097, 0x0090, 0x0079, - 0x006A, 0x0047, 0x0044, 0x0009, 0x01D2, 0x0187, 0x0184, 0x0149, - 0x010D, 0x00D7, 0x00B8, 0x001D, 0x03A6, 0x030B, 0x029C, 0x0246, - 0x0173, 0x0114, 0x0741, 0x053A, 0x0488, 0x0E9D, 0x0A76, 0x0454, - 0x29DD, -}; - -static const uint16_t bitalloc_129_codes_c[129] = { - 0x0E5C, 0x072F, 0x001D, 0x0724, 0x000F, 0x010D, 0x0324, 0x0393, - 0x03E9, 0x0080, 0x0087, 0x00FA, 0x0164, 0x0193, 0x01DE, 0x01F5, - 0x0010, 0x002A, 0x0041, 0x0064, 0x0073, 0x008E, 0x00A4, 0x00B3, - 0x00D6, 0x00E5, 0x00F4, 0x00FB, 0x0002, 0x0009, 0x0013, 0x001E, - 0x0026, 0x002C, 0x0033, 0x003F, 0x0041, 0x004C, 0x0053, 0x005E, - 0x0065, 0x0070, 0x0073, 0x0078, 0x007B, 0x007E, 0x0002, 0x0005, - 0x0007, 0x000B, 0x000D, 0x0011, 0x0014, 0x0017, 0x001A, 0x001D, - 0x0021, 0x0024, 0x0027, 0x002A, 0x002D, 0x0030, 0x0033, 0x0036, - 0x003A, 0x0037, 0x0034, 0x0031, 0x002E, 0x002B, 0x0028, 0x0025, - 0x0022, 0x001E, 0x001B, 0x0018, 0x0015, 0x0012, 0x000E, 0x000C, - 0x0008, 0x0006, 0x0003, 0x007F, 0x007C, 0x0079, 0x0076, 0x0071, - 0x006A, 0x005F, 0x0058, 0x004D, 0x0046, 0x0040, 0x0038, 0x002D, - 0x0027, 0x001F, 0x0014, 0x0012, 0x0003, 0x0000, 0x00F5, 0x00EE, - 0x00D7, 0x00C8, 0x00A5, 0x008F, 0x007C, 0x0065, 0x0042, 0x002B, - 0x0011, 0x0002, 0x01DF, 0x01C8, 0x0165, 0x00FB, 0x00E4, 0x0081, - 0x0006, 0x03E8, 0x0325, 0x01CA, 0x010C, 0x0725, 0x0396, 0x001C, - 0x0E5D, -}; - -static const uint16_t bitalloc_129_codes_d[129] = { - 0xA598, 0xA59A, 0xA59C, 0xA59E, 0xC598, 0xE586, 0x3ACC, 0x52CA, - 0x62CD, 0x0D48, 0x1D67, 0x2978, 0x3167, 0x3966, 0x06A5, 0x0EBC, - 0x14BD, 0x1CB1, 0x0350, 0x0353, 0x075F, 0x0A5F, 0x0C5E, 0x0E5E, - 0x01AE, 0x03AD, 0x052D, 0x062D, 0x072D, 0x00D5, 0x01D4, 0x0294, - 0x0314, 0x0394, 0x0014, 0x0094, 0x0114, 0x0174, 0x01B4, 0x01F4, - 0x000B, 0x004B, 0x008B, 0x00BB, 0x00DB, 0x00FB, 0x001B, 0x003B, - 0x0053, 0x0063, 0x0073, 0x0003, 0x0013, 0x0023, 0x002F, 0x0037, - 0x003F, 0x0007, 0x000F, 0x0015, 0x0019, 0x001D, 0x0001, 0x0005, - 0x0009, 0x0006, 0x0002, 0x001E, 0x001A, 0x0016, 0x0010, 0x0008, - 0x0000, 0x0038, 0x0030, 0x0028, 0x001C, 0x000C, 0x007C, 0x006C, - 0x005C, 0x0044, 0x0024, 0x0004, 0x00E4, 0x00C4, 0x00A4, 0x0074, - 0x0034, 0x01F5, 0x01B5, 0x0175, 0x0115, 0x0095, 0x0015, 0x0395, - 0x0315, 0x0295, 0x01D5, 0x00D6, 0x072E, 0x062E, 0x052E, 0x03AE, - 0x01AF, 0x0E5F, 0x0C5F, 0x0C58, 0x0A58, 0x0758, 0x0351, 0x1CB2, - 0x18B2, 0x0EBD, 0x0EB2, 0x3967, 0x3960, 0x2979, 0x2964, 0x0D49, - 0x72C2, 0x52CB, 0x3ACD, 0xE587, 0xC599, 0xA59F, 0xA59D, 0xA59B, - 0xA599, -}; - -static const uint16_t bitalloc_129_codes_e[129] = { - 0xA13C, 0xC720, 0xA13F, 0xA13E, 0xA13D, 0xE722, 0x5090, 0x6393, - 0x7392, 0x2849, 0x31CE, 0x39CE, 0x1425, 0x18E5, 0x1CE5, 0x0844, - 0x0A1C, 0x0C7C, 0x036C, 0x0423, 0x050F, 0x063F, 0x01B7, 0x0216, - 0x0285, 0x031D, 0x039D, 0x0109, 0x0140, 0x0180, 0x01C8, 0x01CF, - 0x007A, 0x008A, 0x00A2, 0x00C1, 0x00E5, 0x0014, 0x0037, 0x0043, - 0x004E, 0x0056, 0x0061, 0x006C, 0x007C, 0x000B, 0x001C, 0x001F, - 0x0023, 0x0025, 0x0029, 0x002C, 0x002E, 0x0032, 0x0034, 0x0037, - 0x003A, 0x003C, 0x003F, 0x0001, 0x0003, 0x0006, 0x0008, 0x000A, - 0x000C, 0x000B, 0x0009, 0x0007, 0x0004, 0x0002, 0x0000, 0x003D, - 0x003B, 0x0038, 0x0035, 0x0033, 0x002F, 0x002D, 0x002A, 0x0026, - 0x0024, 0x0020, 0x001D, 0x001A, 0x007D, 0x006D, 0x0062, 0x0057, - 0x004F, 0x0044, 0x003C, 0x0015, 0x00E6, 0x00C6, 0x00A3, 0x008B, - 0x007B, 0x006C, 0x01C9, 0x0181, 0x0141, 0x010A, 0x00DA, 0x031E, - 0x0286, 0x0217, 0x0210, 0x0738, 0x0638, 0x0508, 0x036D, 0x0C7D, - 0x0A1D, 0x0845, 0x1CE6, 0x18E6, 0x1426, 0x39CF, 0x31CF, 0x284E, - 0x7393, 0x7390, 0x5091, 0xE723, 0xC724, 0xC725, 0xC722, 0xC723, - 0xC721, -}; - -static const uint16_t bitalloc_129_codes_f[129] = { - 0x762C, 0x3B17, 0x1555, 0x0608, 0x0AAB, 0x0FF2, 0x0305, 0x0307, - 0x0763, 0x0046, 0x010C, 0x01BC, 0x02AB, 0x03B6, 0x03FD, 0x0080, - 0x0087, 0x00DF, 0x0156, 0x01D9, 0x01F8, 0x01FF, 0x002A, 0x0041, - 0x0061, 0x0094, 0x00D4, 0x00EA, 0x00F2, 0x00FD, 0x0009, 0x000B, - 0x001A, 0x0026, 0x0031, 0x0040, 0x004B, 0x006B, 0x0073, 0x0077, - 0x007A, 0x007C, 0x0000, 0x0002, 0x0006, 0x0008, 0x000B, 0x000E, - 0x0011, 0x0014, 0x0016, 0x0019, 0x001C, 0x001E, 0x0021, 0x0023, - 0x0026, 0x0028, 0x002B, 0x002D, 0x002F, 0x0031, 0x0033, 0x0036, - 0x0038, 0x0037, 0x0034, 0x0032, 0x0030, 0x002E, 0x002C, 0x0029, - 0x0027, 0x0024, 0x0022, 0x001F, 0x001D, 0x001A, 0x0017, 0x0015, - 0x0012, 0x000F, 0x000C, 0x0009, 0x0007, 0x0003, 0x0001, 0x007D, - 0x007B, 0x0078, 0x0074, 0x0072, 0x0054, 0x0041, 0x0036, 0x0027, - 0x001B, 0x0014, 0x000A, 0x00FE, 0x00F3, 0x00EB, 0x00D5, 0x0095, - 0x006E, 0x0042, 0x002B, 0x0010, 0x01F9, 0x01DA, 0x0157, 0x0154, - 0x00C0, 0x0081, 0x0022, 0x03B7, 0x03B0, 0x01BD, 0x010D, 0x0047, - 0x07F8, 0x0554, 0x0306, 0x0FF3, 0x0EC4, 0x0609, 0x1D8A, 0x1554, - 0x762D, -}; - -static const uint16_t bitalloc_129_codes_g[129] = { - 0x1E20, 0x1E5E, 0x031C, 0x051A, 0x0718, 0x0916, 0x0B14, 0x0D12, - 0x0F11, 0x0090, 0x018F, 0x028E, 0x038D, 0x048C, 0x058B, 0x068A, - 0x0789, 0x0049, 0x00C8, 0x0148, 0x01C7, 0x0247, 0x02C6, 0x0346, - 0x03C5, 0x0025, 0x0065, 0x00A5, 0x00E4, 0x0124, 0x0164, 0x01A4, - 0x01E3, 0x0013, 0x0033, 0x0053, 0x0073, 0x0093, 0x00B3, 0x00D3, - 0x00F3, 0x000A, 0x001A, 0x002A, 0x003A, 0x004A, 0x005A, 0x006A, - 0x007A, 0x0006, 0x000E, 0x0016, 0x001E, 0x0026, 0x002E, 0x0036, - 0x003E, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, - 0x0000, 0x001D, 0x0019, 0x0015, 0x0011, 0x000D, 0x0009, 0x0005, - 0x003F, 0x0037, 0x002F, 0x0027, 0x001F, 0x0017, 0x000F, 0x0007, - 0x007B, 0x006B, 0x005B, 0x004B, 0x003B, 0x002B, 0x001B, 0x000B, - 0x0008, 0x00F0, 0x00D0, 0x00B0, 0x0090, 0x0070, 0x0050, 0x0030, - 0x01E4, 0x01A5, 0x0165, 0x0125, 0x00E5, 0x00E2, 0x00A2, 0x0062, - 0x03CA, 0x0347, 0x02C7, 0x02C4, 0x0244, 0x0149, 0x00C9, 0x00C6, - 0x0796, 0x068B, 0x0688, 0x048D, 0x048A, 0x028F, 0x028C, 0x0091, - 0x0F2E, 0x0D13, 0x0B15, 0x0917, 0x0719, 0x051B, 0x031D, 0x1E5F, - 0x1E21, -}; - -static const uint8_t bitalloc_129_bits_a[129] = { - 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, - 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 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, 11, 11, 11, 11, 11, - 11, -}; - -static const uint8_t bitalloc_129_bits_b[129] = { - 14, 13, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, - 14, -}; - -static const uint8_t bitalloc_129_bits_c[129] = { - 13, 12, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, - 13, -}; - -static const uint8_t bitalloc_129_bits_d[129] = { - 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, - 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10, - 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, - 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, - 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, - 16, -}; - -static const uint8_t bitalloc_129_bits_e[129] = { - 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, - 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, - 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, - 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, - 16, -}; - -static const uint8_t bitalloc_129_bits_f[129] = { - 15, 14, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9, - 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 15, -}; - -static const uint8_t bitalloc_129_bits_g[129] = { - 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, - 11, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, - 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, - 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, - 13, -}; +static const uint8_t tnl_grp_sizes[] = { 37, 34, 31, 28, 23 }; const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 @@ -999,234 +55,717 @@ static const uint8_t bitalloc_maxbits[DCA_CODE_BOOKS][7] = { { 9, 9, 9, 9, 9, 9, 9 } }; -const uint16_t *const ff_dca_bitalloc_codes[DCA_CODE_BOOKS][8] = { - { bitalloc_3_codes, NULL }, - { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL }, - { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL }, - { bitalloc_9_codes_a, bitalloc_9_codes_b, bitalloc_9_codes_c, NULL }, - { bitalloc_13_codes_a, bitalloc_13_codes_b, bitalloc_13_codes_c, NULL }, - { bitalloc_17_codes_a, bitalloc_17_codes_b, bitalloc_17_codes_c, bitalloc_17_codes_d, - bitalloc_17_codes_e, bitalloc_17_codes_f, bitalloc_17_codes_g, NULL }, - { bitalloc_25_codes_a, bitalloc_25_codes_b, bitalloc_25_codes_c, bitalloc_25_codes_d, - bitalloc_25_codes_e, bitalloc_25_codes_f, bitalloc_25_codes_g, NULL }, - { bitalloc_33_codes_a, bitalloc_33_codes_b, bitalloc_33_codes_c, bitalloc_33_codes_d, - bitalloc_33_codes_e, bitalloc_33_codes_f, bitalloc_33_codes_g, NULL }, - { bitalloc_65_codes_a, bitalloc_65_codes_b, bitalloc_65_codes_c, bitalloc_65_codes_d, - bitalloc_65_codes_e, bitalloc_65_codes_f, bitalloc_65_codes_g, NULL }, - { bitalloc_129_codes_a, bitalloc_129_codes_b, bitalloc_129_codes_c, bitalloc_129_codes_d, - bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL } -}; - -const uint8_t *const ff_dca_bitalloc_bits[DCA_CODE_BOOKS][8] = { - { bitalloc_3_bits, NULL }, - { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL }, - { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL }, - { bitalloc_9_bits_a, bitalloc_9_bits_b, bitalloc_9_bits_c, NULL }, - { bitalloc_13_bits_a, bitalloc_13_bits_b, bitalloc_13_bits_c, NULL }, - { bitalloc_17_bits_a, bitalloc_17_bits_b, bitalloc_17_bits_c, bitalloc_17_bits_d, - bitalloc_17_bits_e, bitalloc_17_bits_f, bitalloc_17_bits_g, NULL }, - { bitalloc_25_bits_a, bitalloc_25_bits_b, bitalloc_25_bits_c, bitalloc_25_bits_d, - bitalloc_25_bits_e, bitalloc_25_bits_f, bitalloc_25_bits_g, NULL }, - { bitalloc_33_bits_a, bitalloc_33_bits_b, bitalloc_33_bits_c, bitalloc_33_bits_d, - bitalloc_33_bits_e, bitalloc_33_bits_f, bitalloc_33_bits_g, NULL }, - { bitalloc_65_bits_a, bitalloc_65_bits_b, bitalloc_65_bits_c, bitalloc_65_bits_d, - bitalloc_65_bits_e, bitalloc_65_bits_f, bitalloc_65_bits_g, NULL }, - { bitalloc_129_bits_a, bitalloc_129_bits_b, bitalloc_129_bits_c, bitalloc_129_bits_d, - bitalloc_129_bits_e, bitalloc_129_bits_f, bitalloc_129_bits_g, NULL } -}; - -static const uint16_t tnl_grp_0_codes[37] = { - 0x0000, 0x0003, 0x0004, 0x0007, 0x0001, 0x0009, 0x000a, 0x000d, - 0x000e, 0x0006, 0x0012, 0x0005, 0x0015, 0x0016, 0x0022, 0x0025, - 0x0035, 0x0076, 0x0002, 0x0042, 0x00b6, 0x0036, 0x00c2, 0x0136, - 0x0182, 0x01c2, 0x03c2, 0x0482, 0x0682, 0x0082, 0x0882, 0x0a82, - 0x0282, 0x2282, 0x3282, 0x1282, 0x5282, -}; - -static const uint16_t tnl_grp_1_codes[34] = { - 0x0001, 0x0003, 0x0006, 0x0000, 0x0002, 0x0004, 0x0005, 0x0007, - 0x0008, 0x000f, 0x001a, 0x001c, 0x001d, 0x000a, 0x002c, 0x002d, - 0x000d, 0x002a, 0x004c, 0x004d, 0x006a, 0x008c, 0x00cd, 0x00ea, - 0x000c, 0x010c, 0x01ea, 0x020c, 0x030c, 0x07ea, 0x0bea, 0x03ea, - 0x13ea, 0x33ea, -}; - -static const uint16_t tnl_grp_2_codes[31] = { - 0x0001, 0x0003, 0x0006, 0x0007, 0x0004, 0x0008, 0x000c, 0x0010, - 0x0012, 0x001a, 0x0022, 0x0000, 0x000a, 0x0020, 0x0040, 0x004a, - 0x006a, 0x0002, 0x002a, 0x0042, 0x0082, 0x00aa, 0x00e0, 0x0060, - 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0f60, 0x0760, 0x1760, -}; - -static const uint16_t tnl_grp_3_codes[28] = { - 0x0001, 0x0006, 0x0008, 0x0014, 0x001c, 0x0000, 0x0002, 0x0004, - 0x000a, 0x000c, 0x0010, 0x0012, 0x001a, 0x0020, 0x002a, 0x002c, - 0x0032, 0x003a, 0x0022, 0x0030, 0x0062, 0x0064, 0x0070, 0x0024, - 0x00a4, 0x01a4, 0x03a4, 0x07a4, -}; - -static const uint16_t tnl_grp_4_codes[23] = { - 0x0001, 0x0000, 0x000a, 0x0006, 0x0012, 0x001e, 0x0022, 0x002e, - 0x0036, 0x003e, 0x0002, 0x0016, 0x0032, 0x004e, 0x0056, 0x000e, - 0x0042, 0x0072, 0x00c2, 0x00f2, 0x008e, 0x018e, 0x038e, -}; - -static const uint16_t tnl_scf_codes[20] = { - 0x0000, 0x0001, 0x0002, 0x0005, 0x0006, 0x0007, 0x000b, 0x000c, - 0x0013, 0x0014, 0x0003, 0x0004, 0x0023, 0x0064, 0x00a4, 0x0024, - 0x0124, 0x0324, 0x0724, 0x0f24, -}; - -static const uint16_t damp_codes[7] = { - 0x0001, 0x0000, 0x0002, 0x0006, 0x000e, 0x001e, 0x003e, -}; - -static const uint16_t dph_codes[9] = { - 0x0000, 0x0002, 0x0003, 0x0001, 0x0009, 0x000d, 0x0005, 0x0015, - 0x0035, -}; - -static const uint16_t fst_rsd_amp_codes[24] = { - 0x0003, 0x0005, 0x0006, 0x0007, 0x0000, 0x0001, 0x0002, 0x0008, - 0x0009, 0x000a, 0x0014, 0x0004, 0x001a, 0x001c, 0x0024, 0x002c, - 0x003a, 0x000c, 0x003c, 0x004c, 0x00fc, 0x007c, 0x017c, 0x037c, -}; - -static const uint16_t rsd_apprx_codes[6] = { - 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, -}; - -static const uint16_t rsd_amp_codes[33] = { - 0x0001, 0x0000, 0x0002, 0x0003, 0x0004, 0x000e, 0x000f, 0x0016, - 0x0007, 0x0027, 0x0037, 0x0026, 0x0066, 0x0006, 0x0017, 0x0046, - 0x0097, 0x00d7, 0x0086, 0x00c6, 0x01c6, 0x0157, 0x0186, 0x0257, - 0x0357, 0x0057, 0x0786, 0x0386, 0x0b86, 0x0457, 0x0c57, 0x1457, - 0x1c57, -}; - -static const uint16_t avg_g3_codes[18] = { - 0x0001, 0x0002, 0x0003, 0x0000, 0x000c, 0x0014, 0x0018, 0x0004, - 0x0008, 0x0028, 0x0068, 0x0024, 0x00a4, 0x00e4, 0x0164, 0x0064, - 0x0264, 0x0664, -}; - -static const uint16_t st_grid_codes[22] = { - 0x0001, 0x0002, 0x0000, 0x0004, 0x0008, 0x001c, 0x004c, 0x006c, - 0x000c, 0x002c, 0x008c, 0x00ac, 0x012c, 0x018c, 0x01ac, 0x038c, - 0x03ac, 0x032c, 0x072c, 0x0f2c, 0x172c, 0x1f2c, -}; - -static const uint16_t grid_2_codes[20] = { - 0x0000, 0x0002, 0x0003, 0x0001, 0x0005, 0x000d, 0x003d, 0x005d, - 0x009d, 0x011d, 0x001d, 0x061d, 0x041d, 0x0c1d, 0x0a1d, 0x121d, - 0x021d, 0x1a1d, 0x221d, 0x3a1d, -}; - -static const uint16_t grid_3_codes[13] = { - 0x0001, 0x0002, 0x0000, 0x0004, 0x000c, 0x001c, 0x007c, 0x003c, - 0x01bc, 0x00bc, 0x06bc, 0x02bc, 0x0abc, -}; - -static const uint16_t rsd_codes[9] = { - 0x0001, 0x0003, 0x0000, 0x0002, 0x0006, 0x0004, 0x000c, 0x001c, - 0x003c, -}; - -static const uint8_t tnl_grp_0_bitvals[74] = { - 3, 5, 3, 9, 3, 4, 3, 6, 4, 10, 4, 13, 4, 7, 4, 11, - 4, 8, 5, 12, 5, 14, 6, 15, 6, 18, 6, 1, 6, 17, 6, 16, - 6, 21, 7, 20, 8, 19, 8, 22, 8, 25, 9, 26, 9, 23, 9, 3, - 9, 24, 10, 29, 10, 27, 11, 28, 11, 30, 12, 33, 12, 31, 12, 32, - 14, 34, 14, 37, 14, 36, 15, 35, 15, 0, -}; - -static const uint8_t tnl_grp_1_bitvals[68] = { - 3, 9, 3, 6, 3, 5, 4, 4, 4, 8, 4, 10, 4, 1, 4, 11, - 4, 7, 4, 13, 5, 12, 5, 14, 5, 17, 6, 16, 6, 15, 6, 18, - 7, 20, 7, 19, 7, 21, 8, 25, 8, 23, 8, 22, 8, 24, 9, 26, - 10, 3, 10, 29, 10, 30, 10, 27, 10, 28, 11, 31, 12, 32, 13, 33, - 14, 34, 14, 0, -}; - -static const uint8_t tnl_grp_2_bitvals[62] = { - 2, 1, 3, 6, 3, 5, 3, 7, 4, 9, 4, 8, 4, 4, 5, 10, - 5, 11, 5, 13, 6, 12, 7, 14, 7, 16, 7, 15, 7, 17, 7, 18, - 7, 19, 8, 22, 8, 20, 8, 21, 8, 3, 8, 24, 8, 25, 9, 23, - 9, 26, 9, 27, 10, 28, 11, 29, 12, 31, 13, 30, 13, 0, -}; - -static const uint8_t tnl_grp_3_bitvals[56] = { - 1, 1, 3, 6, 4, 5, 5, 9, 5, 4, 6, 8, 6, 14, 6, 10, - 6, 21, 6, 13, 6, 7, 6, 3, 6, 16, 6, 2, 6, 18, 6, 17, - 6, 11, 6, 15, 7, 19, 7, 23, 7, 24, 7, 22, 7, 12, 8, 20, - 9, 25, 10, 26, 11, 27, 11, 0, -}; - -static const uint8_t tnl_grp_4_bitvals[46] = { - 1, 1, 2, 2, 4, 4, 5, 5, 6, 6, 6, 8, 6, 3, 6, 19, - 6, 20, 6, 9, 7, 7, 7, 11, 7, 13, 7, 17, 7, 10, 8, 12, - 8, 15, 8, 14, 8, 21, 8, 18, 9, 16, 10, 22, 10, 0, -}; - -static const uint8_t tnl_scf_bitvals[40] = { - 3, 3, 3, 1, 3, 2, 3, 5, 3, 4, 3, 6, 4, 8, 4, 7, - 5, 10, 5, 9, 6, 12, 6, 11, 6, 13, 7, 14, 8, 15, 9, 16, - 10, 17, 11, 18, 12, 19, 12, 0, -}; - -static const uint8_t damp_bitvals[14] = { - 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 0, -}; - -static const uint8_t dph_bitvals[18] = { - 2, 2, 2, 1, 2, 8, 4, 3, 4, 7, 4, 4, 5, 6, 6, 5, - 6, 0, -}; - -static const uint8_t fst_rsd_amp_bitvals[48] = { - 3, 13, 3, 15, 3, 16, 3, 14, 4, 12, 4, 10, 4, 11, 4, 17, - 4, 18, 5, 19, 5, 9, 6, 1, 6, 7, 6, 6, 6, 8, 6, 5, - 6, 4, 7, 20, 7, 2, 7, 3, 8, 21, 9, 22, 10, 23, 10, 0, -}; - -static const uint8_t rsd_apprx_bitvals[12] = { - 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 0, -}; - -static const uint8_t rsd_amp_bitvals[66] = { - 2, 3, 3, 2, 3, 5, 3, 4, 3, 1, 4, 7, 4, 6, 5, 9, - 6, 8, 6, 11, 6, 10, 7, 12, 7, 13, 8, 14, 8, 18, 8, 16, - 8, 15, 8, 22, 9, 20, 9, 24, 9, 17, 10, 28, 10, 26, 10, 21, - 10, 23, 11, 30, 11, 19, 12, 25, 12, 32, 13, 36, 13, 29, 13, 34, - 13, 0, -}; - -static const uint8_t avg_g3_bitvals[36] = { - 2, 15, 2, 16, 2, 17, 4, 14, 4, 18, 5, 12, 5, 13, 6, 10, - 6, 11, 7, 19, 7, 9, 8, 20, 8, 8, 8, 7, 9, 21, 10, 6, - 11, 23, 11, 0, -}; - -static const uint8_t st_grid_bitvals[44] = { - 1, 6, 2, 1, 4, 4, 4, 8, 4, 3, 5, 10, 7, 12, 7, 5, - 8, 14, 9, 16, 9, 7, 9, 18, 10, 11, 10, 9, 10, 20, 10, 22, - 10, 2, 11, 13, 13, 17, 13, 24, 13, 15, 13, 0, -}; - -static const uint8_t grid_2_bitvals[40] = { - 2, 3, 2, 2, 2, 1, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 8, 9, 9, 10, 11, 11, 11, 12, 12, 13, 12, 17, 13, 15, 13, 18, - 14, 19, 14, 16, 14, 14, 14, 0, -}; - -static const uint8_t grid_3_bitvals[26] = { - 1, 17, 2, 16, 3, 18, 4, 15, 5, 19, 6, 14, 7, 20, 8, 13, - 9, 21, 10, 12, 11, 22, 12, 11, 12, 0, -}; - -static const uint8_t rsd_bitvals[18] = { - 2, 2, 2, 3, 3, 1, 3, 4, 3, 0, 4, 5, 5, 6, 6, 7, - 6, 4, +const uint8_t ff_dca_vlc_src_tables[][2] = { + /* bitalloc_3 - 3 entries */ + { 1, 1 }, { 2, 2 }, { 0, 2 }, + /* bitalloc_5_a - 5 entries */ + { 2, 1 }, { 3, 2 }, { 1, 3 }, { 4, 4 }, { 0, 4 }, + /* bitalloc_5_b - 5 entries */ + { 3, 2 }, { 1, 2 }, { 2, 2 }, { 4, 3 }, { 0, 3 }, + /* bitalloc_5_c - 5 entries */ + { 2, 1 }, { 3, 3 }, { 1, 3 }, { 4, 3 }, { 0, 3 }, + /* bitalloc_7_a - 7 entries */ + { 3, 1 }, { 5, 3 }, { 2, 3 }, { 4, 3 }, { 1, 4 }, + { 0, 5 }, { 6, 5 }, + /* bitalloc_7_b - 7 entries */ + { 2, 2 }, { 4, 2 }, { 5, 3 }, { 0, 5 }, { 6, 5 }, + { 1, 4 }, { 3, 2 }, + /* bitalloc_7_c - 7 entries */ + { 0, 4 }, { 6, 4 }, { 1, 4 }, { 5, 4 }, { 2, 2 }, + { 4, 2 }, { 3, 2 }, + /* bitalloc_9_a - 9 entries */ + { 4, 1 }, { 7, 4 }, { 2, 4 }, { 3, 3 }, { 0, 6 }, + { 8, 6 }, { 1, 5 }, { 6, 4 }, { 5, 3 }, + /* bitalloc_9_b - 9 entries */ + { 5, 2 }, { 2, 3 }, { 6, 3 }, { 4, 2 }, { 0, 5 }, + { 8, 5 }, { 1, 5 }, { 7, 5 }, { 3, 3 }, + /* bitalloc_9_c - 9 entries */ + { 5, 2 }, { 2, 3 }, { 7, 4 }, { 0, 6 }, { 8, 6 }, + { 1, 5 }, { 4, 2 }, { 6, 3 }, { 3, 3 }, + /* bitalloc_13_a - 13 entries */ + { 6, 1 }, { 7, 3 }, { 9, 4 }, { 10, 5 }, { 1, 6 }, + { 11, 6 }, { 4, 4 }, { 8, 4 }, { 0, 7 }, { 12, 7 }, + { 2, 6 }, { 3, 5 }, { 5, 4 }, + /* bitalloc_13_b - 13 entries */ + { 6, 2 }, { 8, 3 }, { 10, 4 }, { 3, 4 }, { 1, 5 }, + { 11, 5 }, { 9, 4 }, { 5, 3 }, { 7, 3 }, { 0, 6 }, + { 12, 6 }, { 2, 5 }, { 4, 4 }, + /* bitalloc_13_c - 13 entries */ + { 4, 3 }, { 0, 5 }, { 12, 5 }, { 2, 4 }, { 8, 3 }, + { 5, 3 }, { 7, 3 }, { 6, 3 }, { 10, 4 }, { 1, 5 }, + { 11, 5 }, { 3, 4 }, { 9, 4 }, + /* bitalloc_17_a - 17 entries */ + { 12, 4 }, { 13, 6 }, { 14, 8 }, { 15, 10 }, { 0, 12 }, + { 16, 12 }, { 1, 11 }, { 2, 9 }, { 3, 7 }, { 4, 5 }, + { 6, 3 }, { 8, 2 }, { 10, 3 }, { 5, 4 }, { 11, 4 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_17_b - 17 entries */ + { 8, 2 }, { 10, 3 }, { 15, 6 }, { 2, 6 }, { 3, 5 }, + { 13, 5 }, { 14, 6 }, { 0, 8 }, { 16, 8 }, { 1, 7 }, + { 5, 4 }, { 11, 4 }, { 7, 3 }, { 9, 3 }, { 4, 5 }, + { 12, 5 }, { 6, 4 }, + /* bitalloc_17_c - 17 entries */ + { 10, 3 }, { 15, 5 }, { 2, 5 }, { 4, 4 }, { 12, 4 }, + { 14, 5 }, { 0, 7 }, { 16, 7 }, { 1, 6 }, { 7, 3 }, + { 9, 3 }, { 5, 4 }, { 11, 4 }, { 8, 3 }, { 3, 5 }, + { 13, 5 }, { 6, 4 }, + /* bitalloc_17_d - 17 entries */ + { 8, 1 }, { 0, 9 }, { 16, 9 }, { 1, 9 }, { 15, 9 }, + { 2, 8 }, { 14, 8 }, { 3, 7 }, { 13, 7 }, { 4, 6 }, + { 12, 6 }, { 5, 5 }, { 11, 5 }, { 6, 4 }, { 10, 4 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_17_e - 17 entries */ + { 8, 1 }, { 7, 3 }, { 9, 3 }, { 10, 4 }, { 3, 6 }, + { 13, 6 }, { 5, 5 }, { 11, 5 }, { 0, 8 }, { 16, 8 }, + { 2, 7 }, { 4, 6 }, { 12, 6 }, { 14, 7 }, { 1, 8 }, + { 15, 8 }, { 6, 5 }, + /* bitalloc_17_f - 17 entries */ + { 15, 6 }, { 0, 8 }, { 16, 8 }, { 1, 7 }, { 3, 5 }, + { 4, 4 }, { 6, 3 }, { 10, 3 }, { 12, 4 }, { 13, 5 }, + { 2, 6 }, { 14, 6 }, { 7, 3 }, { 9, 3 }, { 8, 3 }, + { 5, 4 }, { 11, 4 }, + /* bitalloc_17_g - 17 entries */ + { 6, 3 }, { 10, 3 }, { 5, 4 }, { 11, 4 }, { 0, 8 }, + { 16, 8 }, { 2, 7 }, { 3, 6 }, { 4, 5 }, { 12, 5 }, + { 13, 6 }, { 14, 7 }, { 1, 8 }, { 15, 8 }, { 8, 2 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_25_a - 25 entries */ + { 10, 3 }, { 14, 3 }, { 8, 4 }, { 16, 4 }, { 11, 3 }, + { 13, 3 }, { 21, 8 }, { 22, 10 }, { 23, 12 }, { 0, 14 }, + { 24, 14 }, { 1, 13 }, { 2, 11 }, { 3, 9 }, { 4, 8 }, + { 20, 8 }, { 5, 7 }, { 19, 7 }, { 7, 5 }, { 17, 5 }, + { 6, 6 }, { 18, 6 }, { 12, 3 }, { 9, 4 }, { 15, 4 }, + /* bitalloc_25_b - 25 entries */ + { 3, 6 }, { 21, 6 }, { 23, 7 }, { 2, 7 }, { 22, 7 }, + { 0, 9 }, { 24, 9 }, { 1, 8 }, { 8, 4 }, { 11, 3 }, + { 13, 3 }, { 16, 4 }, { 6, 5 }, { 18, 5 }, { 9, 4 }, + { 15, 4 }, { 12, 3 }, { 4, 6 }, { 20, 6 }, { 7, 5 }, + { 17, 5 }, { 5, 6 }, { 19, 6 }, { 10, 4 }, { 14, 4 }, + /* bitalloc_25_c - 25 entries */ + { 7, 4 }, { 17, 4 }, { 12, 3 }, { 20, 5 }, { 22, 6 }, + { 0, 8 }, { 24, 8 }, { 1, 7 }, { 8, 4 }, { 16, 4 }, + { 5, 5 }, { 19, 5 }, { 9, 4 }, { 15, 4 }, { 3, 6 }, + { 21, 6 }, { 6, 5 }, { 10, 4 }, { 14, 4 }, { 18, 5 }, + { 23, 7 }, { 2, 7 }, { 4, 6 }, { 11, 4 }, { 13, 4 }, + /* bitalloc_25_d - 25 entries */ + { 10, 3 }, { 14, 3 }, { 9, 4 }, { 15, 4 }, { 8, 5 }, + { 16, 5 }, { 7, 6 }, { 17, 6 }, { 0, 12 }, { 24, 12 }, + { 1, 12 }, { 23, 12 }, { 2, 11 }, { 22, 11 }, { 3, 10 }, + { 21, 10 }, { 5, 8 }, { 6, 7 }, { 18, 7 }, { 19, 8 }, + { 4, 9 }, { 20, 9 }, { 12, 2 }, { 11, 3 }, { 13, 3 }, + /* bitalloc_25_e - 25 entries */ + { 9, 4 }, { 15, 4 }, { 7, 5 }, { 17, 5 }, { 2, 7 }, + { 22, 7 }, { 5, 6 }, { 19, 6 }, { 0, 8 }, { 24, 8 }, + { 3, 7 }, { 11, 3 }, { 13, 3 }, { 8, 5 }, { 16, 5 }, + { 21, 7 }, { 1, 8 }, { 23, 8 }, { 6, 6 }, { 18, 6 }, + { 4, 7 }, { 20, 7 }, { 10, 4 }, { 14, 4 }, { 12, 2 }, + /* bitalloc_25_f - 25 entries */ + { 13, 3 }, { 12, 3 }, { 7, 4 }, { 17, 4 }, { 5, 5 }, + { 19, 5 }, { 8, 4 }, { 16, 4 }, { 4, 6 }, { 20, 6 }, + { 6, 5 }, { 9, 4 }, { 15, 4 }, { 18, 5 }, { 23, 8 }, + { 0, 10 }, { 24, 10 }, { 1, 9 }, { 3, 7 }, { 21, 7 }, + { 2, 8 }, { 22, 8 }, { 10, 4 }, { 14, 4 }, { 11, 4 }, + /* bitalloc_25_g - 25 entries */ + { 14, 3 }, { 17, 5 }, { 4, 7 }, { 20, 7 }, { 6, 6 }, + { 9, 4 }, { 12, 2 }, { 15, 4 }, { 18, 6 }, { 3, 8 }, + { 21, 8 }, { 5, 7 }, { 8, 5 }, { 11, 3 }, { 13, 3 }, + { 16, 5 }, { 19, 7 }, { 0, 10 }, { 24, 10 }, { 2, 9 }, + { 22, 9 }, { 1, 10 }, { 23, 10 }, { 7, 6 }, { 10, 4 }, + /* bitalloc_33_a - 33 entries */ + { 15, 3 }, { 17, 3 }, { 16, 3 }, { 21, 4 }, { 8, 6 }, + { 24, 6 }, { 10, 5 }, { 12, 4 }, { 20, 4 }, { 22, 5 }, + { 7, 7 }, { 25, 7 }, { 0, 13 }, { 32, 13 }, { 1, 13 }, + { 31, 13 }, { 2, 12 }, { 30, 12 }, { 3, 11 }, { 29, 11 }, + { 4, 10 }, { 28, 10 }, { 6, 8 }, { 26, 8 }, { 5, 9 }, + { 27, 9 }, { 13, 4 }, { 19, 4 }, { 14, 4 }, { 18, 4 }, + { 9, 6 }, { 23, 6 }, { 11, 5 }, + /* bitalloc_33_b - 33 entries */ + { 8, 5 }, { 24, 5 }, { 12, 4 }, { 16, 3 }, { 20, 4 }, + { 3, 7 }, { 29, 7 }, { 6, 6 }, { 9, 5 }, { 23, 5 }, + { 26, 6 }, { 31, 8 }, { 2, 8 }, { 4, 7 }, { 13, 4 }, + { 19, 4 }, { 10, 5 }, { 22, 5 }, { 14, 4 }, { 18, 4 }, + { 28, 7 }, { 30, 8 }, { 0, 10 }, { 32, 10 }, { 1, 9 }, + { 7, 6 }, { 25, 6 }, { 5, 7 }, { 27, 7 }, { 11, 5 }, + { 21, 5 }, { 15, 4 }, { 17, 4 }, + /* bitalloc_33_c - 33 entries */ + { 25, 5 }, { 31, 7 }, { 2, 7 }, { 4, 6 }, { 12, 4 }, + { 20, 4 }, { 13, 4 }, { 19, 4 }, { 8, 5 }, { 24, 5 }, + { 28, 6 }, { 30, 7 }, { 0, 9 }, { 32, 9 }, { 1, 8 }, + { 5, 6 }, { 27, 6 }, { 14, 4 }, { 18, 4 }, { 9, 5 }, + { 23, 5 }, { 15, 4 }, { 17, 4 }, { 10, 5 }, { 22, 5 }, + { 16, 4 }, { 3, 7 }, { 29, 7 }, { 6, 6 }, { 11, 5 }, + { 21, 5 }, { 26, 6 }, { 7, 6 }, + /* bitalloc_33_d - 33 entries */ + { 18, 3 }, { 21, 5 }, { 8, 7 }, { 24, 7 }, { 10, 6 }, + { 13, 4 }, { 16, 2 }, { 19, 4 }, { 22, 6 }, { 7, 8 }, + { 25, 8 }, { 9, 7 }, { 12, 5 }, { 15, 3 }, { 17, 3 }, + { 20, 5 }, { 23, 7 }, { 6, 9 }, { 26, 9 }, { 5, 10 }, + { 27, 10 }, { 4, 11 }, { 28, 11 }, { 3, 12 }, { 29, 12 }, + { 0, 14 }, { 32, 14 }, { 1, 14 }, { 31, 14 }, { 2, 13 }, + { 30, 13 }, { 11, 6 }, { 14, 4 }, + /* bitalloc_33_e - 33 entries */ + { 19, 4 }, { 11, 5 }, { 21, 5 }, { 15, 3 }, { 17, 3 }, + { 5, 7 }, { 27, 7 }, { 2, 8 }, { 30, 8 }, { 6, 7 }, + { 9, 6 }, { 23, 6 }, { 14, 4 }, { 16, 2 }, { 18, 4 }, + { 12, 5 }, { 20, 5 }, { 26, 7 }, { 3, 8 }, { 29, 8 }, + { 0, 9 }, { 32, 9 }, { 4, 8 }, { 7, 7 }, { 10, 6 }, + { 22, 6 }, { 25, 7 }, { 28, 8 }, { 1, 9 }, { 31, 9 }, + { 8, 7 }, { 24, 7 }, { 13, 5 }, + /* bitalloc_33_f - 33 entries */ + { 11, 4 }, { 21, 4 }, { 5, 6 }, { 27, 6 }, { 8, 5 }, + { 12, 4 }, { 20, 4 }, { 24, 5 }, { 4, 7 }, { 28, 7 }, + { 6, 6 }, { 13, 4 }, { 19, 4 }, { 14, 4 }, { 18, 4 }, + { 9, 5 }, { 23, 5 }, { 15, 4 }, { 17, 4 }, { 16, 4 }, + { 26, 6 }, { 31, 9 }, { 0, 11 }, { 32, 11 }, { 1, 10 }, + { 3, 8 }, { 29, 8 }, { 2, 9 }, { 30, 9 }, { 10, 5 }, + { 22, 5 }, { 7, 6 }, { 25, 6 }, + /* bitalloc_33_g - 33 entries */ + { 12, 4 }, { 20, 4 }, { 29, 8 }, { 1, 9 }, { 31, 9 }, + { 6, 7 }, { 8, 6 }, { 10, 5 }, { 22, 5 }, { 24, 6 }, + { 26, 7 }, { 4, 8 }, { 28, 8 }, { 15, 3 }, { 17, 3 }, + { 13, 4 }, { 19, 4 }, { 2, 9 }, { 30, 9 }, { 0, 10 }, + { 32, 10 }, { 3, 9 }, { 7, 7 }, { 9, 6 }, { 11, 5 }, + { 21, 5 }, { 23, 6 }, { 25, 7 }, { 5, 8 }, { 27, 8 }, + { 16, 3 }, { 14, 4 }, { 18, 4 }, + /* bitalloc_65_a - 65 entries */ + { 35, 4 }, { 30, 4 }, { 34, 4 }, { 42, 5 }, { 23, 5 }, + { 31, 4 }, { 33, 4 }, { 32, 4 }, { 41, 5 }, { 19, 6 }, + { 45, 6 }, { 16, 7 }, { 48, 7 }, { 20, 6 }, { 24, 5 }, + { 40, 5 }, { 44, 6 }, { 14, 8 }, { 50, 8 }, { 57, 11 }, + { 4, 13 }, { 60, 13 }, { 6, 12 }, { 58, 12 }, { 3, 14 }, + { 61, 14 }, { 2, 15 }, { 62, 15 }, { 0, 16 }, { 64, 16 }, + { 1, 16 }, { 63, 16 }, { 8, 11 }, { 12, 9 }, { 52, 9 }, + { 10, 10 }, { 54, 10 }, { 25, 5 }, { 39, 5 }, { 17, 7 }, + { 47, 7 }, { 21, 6 }, { 26, 5 }, { 38, 5 }, { 43, 6 }, + { 15, 8 }, { 49, 8 }, { 18, 7 }, { 27, 5 }, { 37, 5 }, + { 28, 5 }, { 36, 5 }, { 46, 7 }, { 56, 11 }, { 5, 13 }, + { 59, 13 }, { 7, 12 }, { 9, 11 }, { 55, 11 }, { 13, 9 }, + { 51, 9 }, { 11, 10 }, { 53, 10 }, { 22, 6 }, { 29, 5 }, + /* bitalloc_65_b - 65 entries */ + { 48, 6 }, { 3, 9 }, { 61, 9 }, { 6, 8 }, { 11, 7 }, + { 53, 7 }, { 58, 8 }, { 7, 8 }, { 17, 6 }, { 31, 4 }, + { 33, 4 }, { 24, 5 }, { 40, 5 }, { 32, 4 }, { 47, 6 }, + { 18, 6 }, { 25, 5 }, { 39, 5 }, { 46, 6 }, { 57, 8 }, + { 63, 10 }, { 2, 10 }, { 4, 9 }, { 12, 7 }, { 52, 7 }, + { 13, 7 }, { 19, 6 }, { 26, 5 }, { 38, 5 }, { 45, 6 }, + { 51, 7 }, { 8, 8 }, { 56, 8 }, { 27, 5 }, { 37, 5 }, + { 20, 6 }, { 44, 6 }, { 60, 9 }, { 62, 10 }, { 0, 12 }, + { 64, 12 }, { 1, 11 }, { 5, 9 }, { 59, 9 }, { 14, 7 }, + { 50, 7 }, { 9, 8 }, { 55, 8 }, { 28, 5 }, { 36, 5 }, + { 21, 6 }, { 43, 6 }, { 29, 5 }, { 35, 5 }, { 15, 7 }, + { 49, 7 }, { 22, 6 }, { 42, 6 }, { 10, 8 }, { 54, 8 }, + { 16, 7 }, { 30, 5 }, { 34, 5 }, { 23, 6 }, { 41, 6 }, + /* bitalloc_65_c - 65 entries */ + { 23, 5 }, { 41, 5 }, { 50, 6 }, { 8, 7 }, { 56, 7 }, + { 24, 5 }, { 40, 5 }, { 15, 6 }, { 49, 6 }, { 25, 5 }, + { 39, 5 }, { 16, 6 }, { 48, 6 }, { 26, 5 }, { 38, 5 }, + { 60, 8 }, { 5, 8 }, { 9, 7 }, { 55, 7 }, { 10, 7 }, + { 27, 5 }, { 37, 5 }, { 17, 6 }, { 47, 6 }, { 28, 5 }, + { 36, 5 }, { 54, 7 }, { 59, 8 }, { 62, 9 }, { 0, 11 }, + { 64, 11 }, { 1, 10 }, { 18, 6 }, { 29, 5 }, { 35, 5 }, + { 46, 6 }, { 11, 7 }, { 53, 7 }, { 19, 6 }, { 45, 6 }, + { 30, 5 }, { 34, 5 }, { 31, 5 }, { 33, 5 }, { 6, 8 }, + { 58, 8 }, { 12, 7 }, { 20, 6 }, { 44, 6 }, { 52, 7 }, + { 3, 9 }, { 61, 9 }, { 7, 8 }, { 32, 5 }, { 21, 6 }, + { 43, 6 }, { 13, 7 }, { 51, 7 }, { 22, 6 }, { 42, 6 }, + { 57, 8 }, { 63, 10 }, { 2, 10 }, { 4, 9 }, { 14, 7 }, + /* bitalloc_65_d - 65 entries */ + { 31, 3 }, { 33, 3 }, { 48, 8 }, { 11, 10 }, { 53, 10 }, + { 14, 9 }, { 50, 9 }, { 9, 11 }, { 55, 11 }, { 12, 10 }, + { 17, 8 }, { 20, 7 }, { 44, 7 }, { 23, 6 }, { 41, 6 }, + { 26, 5 }, { 38, 5 }, { 29, 4 }, { 35, 4 }, { 32, 3 }, + { 47, 8 }, { 52, 10 }, { 60, 13 }, { 3, 14 }, { 61, 14 }, + { 7, 12 }, { 57, 12 }, { 5, 13 }, { 59, 13 }, { 15, 9 }, + { 18, 8 }, { 46, 8 }, { 21, 7 }, { 43, 7 }, { 24, 6 }, + { 40, 6 }, { 27, 5 }, { 37, 5 }, { 30, 4 }, { 34, 4 }, + { 49, 9 }, { 10, 11 }, { 54, 11 }, { 13, 10 }, { 51, 10 }, + { 8, 12 }, { 56, 12 }, { 0, 15 }, { 64, 15 }, { 1, 15 }, + { 63, 15 }, { 2, 15 }, { 62, 15 }, { 4, 14 }, { 6, 13 }, + { 58, 13 }, { 16, 9 }, { 19, 8 }, { 45, 8 }, { 22, 7 }, + { 42, 7 }, { 25, 6 }, { 39, 6 }, { 28, 5 }, { 36, 5 }, + /* bitalloc_65_e - 65 entries */ + { 33, 3 }, { 21, 6 }, { 43, 6 }, { 26, 5 }, { 38, 5 }, + { 16, 7 }, { 48, 7 }, { 22, 6 }, { 42, 6 }, { 10, 8 }, + { 54, 8 }, { 4, 9 }, { 60, 9 }, { 11, 8 }, { 27, 5 }, + { 37, 5 }, { 17, 7 }, { 47, 7 }, { 23, 6 }, { 30, 4 }, + { 34, 4 }, { 32, 3 }, { 41, 6 }, { 53, 8 }, { 5, 9 }, + { 59, 9 }, { 18, 7 }, { 46, 7 }, { 12, 8 }, { 52, 8 }, + { 24, 6 }, { 28, 5 }, { 36, 5 }, { 40, 6 }, { 6, 9 }, + { 58, 9 }, { 13, 8 }, { 19, 7 }, { 45, 7 }, { 51, 8 }, + { 0, 10 }, { 64, 10 }, { 7, 9 }, { 57, 9 }, { 1, 10 }, + { 63, 10 }, { 14, 8 }, { 50, 8 }, { 8, 9 }, { 56, 9 }, + { 20, 7 }, { 44, 7 }, { 25, 6 }, { 39, 6 }, { 15, 8 }, + { 49, 8 }, { 2, 10 }, { 62, 10 }, { 9, 9 }, { 55, 9 }, + { 3, 10 }, { 61, 10 }, { 29, 5 }, { 35, 5 }, { 31, 4 }, + /* bitalloc_65_f - 65 entries */ + { 28, 4 }, { 36, 4 }, { 26, 5 }, { 38, 5 }, { 24, 6 }, + { 40, 6 }, { 22, 7 }, { 42, 7 }, { 20, 8 }, { 44, 8 }, + { 18, 9 }, { 46, 9 }, { 48, 10 }, { 50, 11 }, { 12, 12 }, + { 52, 12 }, { 0, 14 }, { 64, 14 }, { 1, 14 }, { 63, 14 }, + { 10, 13 }, { 54, 13 }, { 2, 14 }, { 62, 14 }, { 3, 14 }, + { 61, 14 }, { 4, 14 }, { 60, 14 }, { 5, 14 }, { 59, 14 }, + { 6, 14 }, { 58, 14 }, { 7, 14 }, { 57, 14 }, { 8, 14 }, + { 56, 14 }, { 11, 13 }, { 15, 11 }, { 31, 3 }, { 33, 3 }, + { 29, 4 }, { 35, 4 }, { 27, 5 }, { 37, 5 }, { 25, 6 }, + { 39, 6 }, { 23, 7 }, { 41, 7 }, { 21, 8 }, { 43, 8 }, + { 19, 9 }, { 45, 9 }, { 17, 10 }, { 47, 10 }, { 49, 11 }, + { 13, 12 }, { 51, 12 }, { 53, 13 }, { 9, 14 }, { 55, 14 }, + { 14, 12 }, { 16, 11 }, { 32, 3 }, { 30, 4 }, { 34, 4 }, + /* bitalloc_65_g - 65 entries */ + { 36, 4 }, { 40, 5 }, { 44, 6 }, { 48, 7 }, { 12, 8 }, + { 52, 8 }, { 8, 9 }, { 56, 9 }, { 4, 10 }, { 60, 10 }, + { 0, 11 }, { 64, 11 }, { 5, 10 }, { 17, 7 }, { 21, 6 }, + { 25, 5 }, { 29, 4 }, { 35, 4 }, { 39, 5 }, { 43, 6 }, + { 47, 7 }, { 13, 8 }, { 51, 8 }, { 30, 4 }, { 9, 9 }, + { 55, 9 }, { 59, 10 }, { 1, 11 }, { 63, 11 }, { 10, 9 }, + { 18, 7 }, { 22, 6 }, { 26, 5 }, { 34, 4 }, { 38, 5 }, + { 42, 6 }, { 46, 7 }, { 14, 8 }, { 50, 8 }, { 31, 4 }, + { 33, 4 }, { 54, 9 }, { 6, 10 }, { 58, 10 }, { 2, 11 }, + { 62, 11 }, { 7, 10 }, { 11, 9 }, { 19, 7 }, { 23, 6 }, + { 27, 5 }, { 37, 5 }, { 41, 6 }, { 45, 7 }, { 15, 8 }, + { 49, 8 }, { 32, 4 }, { 53, 9 }, { 57, 10 }, { 3, 11 }, + { 61, 11 }, { 16, 8 }, { 20, 7 }, { 24, 6 }, { 28, 5 }, + /* bitalloc_129_a - 129 entries */ + { 66, 4 }, { 31, 8 }, { 97, 8 }, { 19, 9 }, { 109, 9 }, + { 6, 10 }, { 122, 10 }, { 7, 10 }, { 121, 10 }, { 52, 6 }, + { 76, 6 }, { 43, 7 }, { 85, 7 }, { 59, 5 }, { 69, 5 }, + { 32, 8 }, { 96, 8 }, { 20, 9 }, { 108, 9 }, { 33, 8 }, + { 53, 6 }, { 75, 6 }, { 95, 8 }, { 8, 10 }, { 120, 10 }, + { 21, 9 }, { 44, 7 }, { 84, 7 }, { 107, 9 }, { 9, 10 }, + { 119, 10 }, { 34, 8 }, { 94, 8 }, { 22, 9 }, { 106, 9 }, + { 45, 7 }, { 54, 6 }, { 74, 6 }, { 83, 7 }, { 10, 10 }, + { 118, 10 }, { 23, 9 }, { 35, 8 }, { 93, 8 }, { 105, 9 }, + { 11, 10 }, { 117, 10 }, { 46, 7 }, { 60, 5 }, { 68, 5 }, + { 82, 7 }, { 24, 9 }, { 104, 9 }, { 36, 8 }, { 55, 6 }, + { 73, 6 }, { 92, 8 }, { 12, 10 }, { 116, 10 }, { 25, 9 }, + { 47, 7 }, { 81, 7 }, { 37, 8 }, { 91, 8 }, { 103, 9 }, + { 13, 10 }, { 115, 10 }, { 26, 9 }, { 102, 9 }, { 48, 7 }, + { 64, 4 }, { 63, 4 }, { 65, 4 }, { 56, 6 }, { 72, 6 }, + { 61, 5 }, { 67, 5 }, { 80, 7 }, { 38, 8 }, { 90, 8 }, + { 0, 11 }, { 128, 11 }, { 14, 10 }, { 114, 10 }, { 1, 11 }, + { 127, 11 }, { 27, 9 }, { 101, 9 }, { 49, 7 }, { 79, 7 }, + { 39, 8 }, { 89, 8 }, { 57, 6 }, { 71, 6 }, { 15, 10 }, + { 113, 10 }, { 28, 9 }, { 100, 9 }, { 2, 11 }, { 126, 11 }, + { 16, 10 }, { 40, 8 }, { 88, 8 }, { 50, 7 }, { 78, 7 }, + { 112, 10 }, { 3, 11 }, { 125, 11 }, { 29, 9 }, { 99, 9 }, + { 17, 10 }, { 111, 10 }, { 41, 8 }, { 87, 8 }, { 58, 6 }, + { 4, 11 }, { 124, 11 }, { 18, 10 }, { 30, 9 }, { 98, 9 }, + { 110, 10 }, { 5, 11 }, { 123, 11 }, { 51, 7 }, { 70, 6 }, + { 77, 7 }, { 42, 8 }, { 86, 8 }, { 62, 5 }, + /* bitalloc_129_b - 129 entries */ + { 67, 5 }, { 21, 8 }, { 107, 8 }, { 33, 7 }, { 95, 7 }, + { 13, 9 }, { 115, 9 }, { 22, 8 }, { 47, 6 }, { 81, 6 }, + { 62, 5 }, { 66, 5 }, { 34, 7 }, { 94, 7 }, { 48, 6 }, + { 63, 5 }, { 65, 5 }, { 80, 6 }, { 106, 8 }, { 121, 10 }, + { 127, 12 }, { 2, 12 }, { 4, 11 }, { 14, 9 }, { 23, 8 }, + { 105, 8 }, { 35, 7 }, { 93, 7 }, { 49, 6 }, { 64, 5 }, + { 79, 6 }, { 114, 9 }, { 8, 10 }, { 120, 10 }, { 24, 8 }, + { 36, 7 }, { 50, 6 }, { 78, 6 }, { 92, 7 }, { 104, 8 }, + { 15, 9 }, { 113, 9 }, { 51, 6 }, { 77, 6 }, { 37, 7 }, + { 91, 7 }, { 25, 8 }, { 103, 8 }, { 38, 7 }, { 52, 6 }, + { 76, 6 }, { 90, 7 }, { 16, 9 }, { 112, 9 }, { 26, 8 }, + { 53, 6 }, { 75, 6 }, { 102, 8 }, { 124, 11 }, { 5, 11 }, + { 9, 10 }, { 119, 10 }, { 10, 10 }, { 39, 7 }, { 89, 7 }, + { 27, 8 }, { 101, 8 }, { 54, 6 }, { 74, 6 }, { 40, 7 }, + { 88, 7 }, { 17, 9 }, { 111, 9 }, { 28, 8 }, { 100, 8 }, + { 118, 10 }, { 123, 11 }, { 126, 12 }, { 0, 14 }, { 128, 14 }, + { 1, 13 }, { 18, 9 }, { 55, 6 }, { 73, 6 }, { 41, 7 }, + { 87, 7 }, { 56, 6 }, { 72, 6 }, { 29, 8 }, { 99, 8 }, + { 42, 7 }, { 86, 7 }, { 110, 9 }, { 11, 10 }, { 117, 10 }, + { 19, 9 }, { 109, 9 }, { 57, 6 }, { 71, 6 }, { 43, 7 }, + { 85, 7 }, { 58, 6 }, { 70, 6 }, { 30, 8 }, { 98, 8 }, + { 44, 7 }, { 84, 7 }, { 31, 8 }, { 97, 8 }, { 59, 6 }, + { 69, 6 }, { 6, 11 }, { 122, 11 }, { 12, 10 }, { 20, 9 }, + { 108, 9 }, { 116, 10 }, { 3, 12 }, { 125, 12 }, { 7, 11 }, + { 45, 7 }, { 60, 6 }, { 68, 6 }, { 83, 7 }, { 32, 8 }, + { 96, 8 }, { 46, 7 }, { 82, 7 }, { 61, 6 }, + /* bitalloc_129_c - 129 entries */ + { 101, 7 }, { 113, 8 }, { 120, 9 }, { 127, 11 }, { 2, 11 }, + { 4, 10 }, { 28, 7 }, { 100, 7 }, { 46, 6 }, { 82, 6 }, + { 16, 8 }, { 112, 8 }, { 29, 7 }, { 47, 6 }, { 81, 6 }, + { 48, 6 }, { 80, 6 }, { 99, 7 }, { 30, 7 }, { 98, 7 }, + { 17, 8 }, { 111, 8 }, { 49, 6 }, { 79, 6 }, { 50, 6 }, + { 78, 6 }, { 31, 7 }, { 97, 7 }, { 9, 9 }, { 119, 9 }, + { 18, 8 }, { 110, 8 }, { 124, 10 }, { 5, 10 }, { 10, 9 }, + { 51, 6 }, { 77, 6 }, { 32, 7 }, { 96, 7 }, { 52, 6 }, + { 76, 6 }, { 33, 7 }, { 95, 7 }, { 53, 6 }, { 75, 6 }, + { 19, 8 }, { 109, 8 }, { 34, 7 }, { 54, 6 }, { 74, 6 }, + { 94, 7 }, { 118, 9 }, { 123, 10 }, { 126, 11 }, { 0, 13 }, + { 128, 13 }, { 1, 12 }, { 20, 8 }, { 55, 6 }, { 73, 6 }, + { 108, 8 }, { 11, 9 }, { 117, 9 }, { 35, 7 }, { 93, 7 }, + { 36, 7 }, { 56, 6 }, { 72, 6 }, { 92, 7 }, { 21, 8 }, + { 107, 8 }, { 57, 6 }, { 71, 6 }, { 37, 7 }, { 91, 7 }, + { 58, 6 }, { 70, 6 }, { 22, 8 }, { 106, 8 }, { 38, 7 }, + { 59, 6 }, { 69, 6 }, { 90, 7 }, { 12, 9 }, { 116, 9 }, + { 23, 8 }, { 60, 6 }, { 68, 6 }, { 39, 7 }, { 89, 7 }, + { 61, 6 }, { 67, 6 }, { 105, 8 }, { 6, 10 }, { 122, 10 }, + { 13, 9 }, { 40, 7 }, { 62, 6 }, { 66, 6 }, { 88, 7 }, + { 24, 8 }, { 104, 8 }, { 63, 6 }, { 65, 6 }, { 41, 7 }, + { 87, 7 }, { 115, 9 }, { 3, 11 }, { 125, 11 }, { 7, 10 }, + { 25, 8 }, { 42, 7 }, { 64, 6 }, { 86, 7 }, { 103, 8 }, + { 14, 9 }, { 114, 9 }, { 43, 7 }, { 85, 7 }, { 26, 8 }, + { 102, 8 }, { 44, 7 }, { 84, 7 }, { 121, 10 }, { 8, 10 }, + { 15, 9 }, { 27, 8 }, { 45, 7 }, { 83, 7 }, + /* bitalloc_129_d - 129 entries */ + { 72, 5 }, { 83, 7 }, { 34, 9 }, { 94, 9 }, { 40, 8 }, + { 51, 6 }, { 62, 4 }, { 66, 4 }, { 77, 6 }, { 88, 8 }, + { 18, 12 }, { 110, 12 }, { 9, 14 }, { 119, 14 }, { 14, 13 }, + { 19, 12 }, { 29, 10 }, { 99, 10 }, { 24, 11 }, { 104, 11 }, + { 46, 7 }, { 57, 5 }, { 71, 5 }, { 82, 7 }, { 35, 9 }, + { 93, 9 }, { 41, 8 }, { 52, 6 }, { 63, 4 }, { 65, 4 }, + { 76, 6 }, { 87, 8 }, { 30, 10 }, { 98, 10 }, { 109, 12 }, + { 114, 13 }, { 6, 15 }, { 122, 15 }, { 10, 14 }, { 25, 11 }, + { 103, 11 }, { 15, 13 }, { 113, 13 }, { 20, 12 }, { 47, 7 }, + { 58, 5 }, { 70, 5 }, { 81, 7 }, { 36, 9 }, { 92, 9 }, + { 42, 8 }, { 53, 6 }, { 64, 4 }, { 75, 6 }, { 86, 8 }, + { 31, 10 }, { 97, 10 }, { 108, 12 }, { 118, 14 }, { 7, 15 }, + { 121, 15 }, { 0, 16 }, { 128, 16 }, { 1, 16 }, { 127, 16 }, + { 2, 16 }, { 126, 16 }, { 3, 16 }, { 125, 16 }, { 26, 11 }, + { 102, 11 }, { 11, 14 }, { 117, 14 }, { 16, 13 }, { 21, 12 }, + { 48, 7 }, { 59, 5 }, { 69, 5 }, { 80, 7 }, { 37, 9 }, + { 91, 9 }, { 43, 8 }, { 54, 6 }, { 74, 6 }, { 85, 8 }, + { 32, 10 }, { 96, 10 }, { 107, 12 }, { 112, 13 }, { 4, 16 }, + { 124, 16 }, { 8, 15 }, { 12, 14 }, { 27, 11 }, { 101, 11 }, + { 22, 12 }, { 106, 12 }, { 49, 7 }, { 60, 5 }, { 68, 5 }, + { 79, 7 }, { 38, 9 }, { 90, 9 }, { 44, 8 }, { 55, 6 }, + { 73, 6 }, { 84, 8 }, { 33, 10 }, { 95, 10 }, { 116, 14 }, + { 120, 15 }, { 5, 16 }, { 123, 16 }, { 17, 13 }, { 111, 13 }, + { 13, 14 }, { 115, 14 }, { 28, 11 }, { 100, 11 }, { 23, 12 }, + { 105, 12 }, { 50, 7 }, { 61, 5 }, { 67, 5 }, { 78, 7 }, + { 39, 9 }, { 89, 9 }, { 45, 8 }, { 56, 6 }, + /* bitalloc_129_e - 129 entries */ + { 70, 5 }, { 59, 5 }, { 69, 5 }, { 60, 5 }, { 68, 5 }, + { 37, 7 }, { 91, 7 }, { 45, 6 }, { 61, 5 }, { 67, 5 }, + { 62, 5 }, { 66, 5 }, { 63, 5 }, { 65, 5 }, { 64, 5 }, + { 83, 6 }, { 97, 8 }, { 102, 9 }, { 18, 11 }, { 110, 11 }, + { 22, 10 }, { 38, 7 }, { 46, 6 }, { 82, 6 }, { 90, 7 }, + { 32, 8 }, { 96, 8 }, { 47, 6 }, { 81, 6 }, { 106, 10 }, + { 15, 12 }, { 113, 12 }, { 19, 11 }, { 27, 9 }, { 101, 9 }, + { 23, 10 }, { 105, 10 }, { 39, 7 }, { 89, 7 }, { 33, 8 }, + { 95, 8 }, { 48, 6 }, { 80, 6 }, { 49, 6 }, { 79, 6 }, + { 40, 7 }, { 88, 7 }, { 28, 9 }, { 100, 9 }, { 109, 11 }, + { 6, 15 }, { 122, 15 }, { 9, 14 }, { 12, 13 }, { 116, 13 }, + { 119, 14 }, { 0, 16 }, { 4, 16 }, { 3, 16 }, { 2, 16 }, + { 24, 10 }, { 104, 10 }, { 16, 12 }, { 112, 12 }, { 20, 11 }, + { 34, 8 }, { 94, 8 }, { 50, 6 }, { 78, 6 }, { 41, 7 }, + { 87, 7 }, { 51, 6 }, { 77, 6 }, { 52, 6 }, { 76, 6 }, + { 29, 9 }, { 99, 9 }, { 35, 8 }, { 42, 7 }, { 86, 7 }, + { 93, 8 }, { 108, 11 }, { 1, 16 }, { 128, 16 }, { 126, 16 }, + { 127, 16 }, { 124, 16 }, { 125, 16 }, { 7, 15 }, { 13, 13 }, + { 115, 13 }, { 10, 14 }, { 118, 14 }, { 25, 10 }, { 103, 10 }, + { 17, 12 }, { 111, 12 }, { 21, 11 }, { 53, 6 }, { 75, 6 }, + { 54, 6 }, { 74, 6 }, { 43, 7 }, { 85, 7 }, { 55, 6 }, + { 73, 6 }, { 30, 9 }, { 98, 9 }, { 36, 8 }, { 92, 8 }, + { 107, 11 }, { 121, 15 }, { 5, 16 }, { 123, 16 }, { 8, 15 }, + { 120, 15 }, { 14, 13 }, { 114, 13 }, { 11, 14 }, { 117, 14 }, + { 26, 10 }, { 31, 9 }, { 56, 6 }, { 72, 6 }, { 57, 6 }, + { 71, 6 }, { 44, 7 }, { 84, 7 }, { 58, 6 }, + /* bitalloc_129_f - 129 entries */ + { 42, 6 }, { 86, 6 }, { 43, 6 }, { 85, 6 }, { 107, 8 }, + { 114, 9 }, { 9, 10 }, { 119, 10 }, { 30, 7 }, { 98, 7 }, + { 31, 7 }, { 44, 6 }, { 84, 6 }, { 45, 6 }, { 83, 6 }, + { 97, 7 }, { 22, 8 }, { 106, 8 }, { 46, 6 }, { 82, 6 }, + { 32, 7 }, { 96, 7 }, { 47, 6 }, { 81, 6 }, { 15, 9 }, + { 113, 9 }, { 23, 8 }, { 105, 8 }, { 10, 10 }, { 118, 10 }, + { 16, 9 }, { 48, 6 }, { 80, 6 }, { 33, 7 }, { 95, 7 }, + { 49, 6 }, { 79, 6 }, { 50, 6 }, { 78, 6 }, { 112, 9 }, + { 3, 12 }, { 125, 12 }, { 6, 11 }, { 122, 11 }, { 7, 11 }, + { 24, 8 }, { 34, 7 }, { 51, 6 }, { 77, 6 }, { 94, 7 }, + { 104, 8 }, { 11, 10 }, { 117, 10 }, { 17, 9 }, { 52, 6 }, + { 76, 6 }, { 53, 6 }, { 75, 6 }, { 35, 7 }, { 93, 7 }, + { 54, 6 }, { 74, 6 }, { 55, 6 }, { 73, 6 }, { 25, 8 }, + { 103, 8 }, { 36, 7 }, { 56, 6 }, { 72, 6 }, { 57, 6 }, + { 71, 6 }, { 92, 7 }, { 111, 9 }, { 121, 11 }, { 127, 13 }, + { 2, 13 }, { 4, 12 }, { 12, 10 }, { 18, 9 }, { 110, 9 }, + { 58, 6 }, { 70, 6 }, { 59, 6 }, { 69, 6 }, { 60, 6 }, + { 68, 6 }, { 61, 6 }, { 67, 6 }, { 62, 6 }, { 66, 6 }, + { 26, 8 }, { 102, 8 }, { 37, 7 }, { 63, 6 }, { 65, 6 }, + { 64, 6 }, { 91, 7 }, { 38, 7 }, { 90, 7 }, { 27, 8 }, + { 101, 8 }, { 116, 10 }, { 124, 12 }, { 126, 13 }, { 0, 15 }, + { 128, 15 }, { 1, 14 }, { 8, 11 }, { 19, 9 }, { 109, 9 }, + { 13, 10 }, { 115, 10 }, { 39, 7 }, { 89, 7 }, { 28, 8 }, + { 100, 8 }, { 40, 7 }, { 88, 7 }, { 41, 7 }, { 87, 7 }, + { 20, 9 }, { 108, 9 }, { 29, 8 }, { 99, 8 }, { 120, 11 }, + { 5, 12 }, { 123, 12 }, { 14, 10 }, { 21, 9 }, + /* bitalloc_129_g - 129 entries */ + { 64, 4 }, { 88, 7 }, { 9, 11 }, { 119, 11 }, { 17, 10 }, + { 25, 9 }, { 33, 8 }, { 41, 7 }, { 87, 7 }, { 49, 6 }, + { 79, 6 }, { 57, 5 }, { 71, 5 }, { 95, 8 }, { 103, 9 }, + { 111, 10 }, { 2, 12 }, { 126, 12 }, { 10, 11 }, { 18, 10 }, + { 110, 10 }, { 26, 9 }, { 34, 8 }, { 42, 7 }, { 86, 7 }, + { 50, 6 }, { 78, 6 }, { 58, 5 }, { 70, 5 }, { 94, 8 }, + { 102, 9 }, { 118, 11 }, { 3, 12 }, { 125, 12 }, { 11, 11 }, + { 117, 11 }, { 19, 10 }, { 109, 10 }, { 27, 9 }, { 35, 8 }, + { 43, 7 }, { 85, 7 }, { 51, 6 }, { 77, 6 }, { 59, 5 }, + { 69, 5 }, { 93, 8 }, { 101, 9 }, { 4, 12 }, { 124, 12 }, + { 12, 11 }, { 20, 10 }, { 28, 9 }, { 100, 9 }, { 36, 8 }, + { 44, 7 }, { 84, 7 }, { 52, 6 }, { 76, 6 }, { 60, 5 }, + { 68, 5 }, { 92, 8 }, { 108, 10 }, { 116, 11 }, { 5, 12 }, + { 123, 12 }, { 13, 11 }, { 115, 11 }, { 21, 10 }, { 29, 9 }, + { 99, 9 }, { 37, 8 }, { 45, 7 }, { 83, 7 }, { 53, 6 }, + { 75, 6 }, { 61, 5 }, { 67, 5 }, { 91, 8 }, { 107, 10 }, + { 6, 12 }, { 122, 12 }, { 14, 11 }, { 22, 10 }, { 106, 10 }, + { 30, 9 }, { 98, 9 }, { 38, 8 }, { 46, 7 }, { 82, 7 }, + { 54, 6 }, { 74, 6 }, { 62, 5 }, { 66, 5 }, { 90, 8 }, + { 114, 11 }, { 7, 12 }, { 121, 12 }, { 15, 11 }, { 113, 11 }, + { 23, 10 }, { 105, 10 }, { 31, 9 }, { 97, 9 }, { 39, 8 }, + { 47, 7 }, { 81, 7 }, { 55, 6 }, { 73, 6 }, { 63, 5 }, + { 65, 5 }, { 89, 8 }, { 0, 13 }, { 128, 13 }, { 8, 12 }, + { 16, 11 }, { 24, 10 }, { 32, 9 }, { 96, 9 }, { 104, 10 }, + { 112, 11 }, { 120, 12 }, { 1, 13 }, { 127, 13 }, { 40, 8 }, + { 48, 7 }, { 80, 7 }, { 56, 6 }, { 72, 6 }, + /* bit_alloc_12[0] - 12 entries */ + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, + { 5, 6 }, { 11, 9 }, { 10, 9 }, { 9, 9 }, { 8, 9 }, + { 7, 8 }, { 6, 8 }, + /* bit_alloc_12[1] - 12 entries */ + { 1, 2 }, { 2, 3 }, { 4, 5 }, { 11, 7 }, { 10, 7 }, + { 9, 7 }, { 8, 7 }, { 7, 7 }, { 6, 7 }, { 5, 6 }, + { 3, 5 }, { 0, 1 }, + /* bit_alloc_12[2] - 12 entries */ + { 0, 2 }, { 4, 3 }, { 7, 4 }, { 11, 7 }, { 10, 7 }, + { 9, 6 }, { 8, 5 }, { 3, 3 }, { 2, 3 }, { 6, 4 }, + { 5, 4 }, { 1, 3 }, + /* bit_alloc_12[3] - 12 entries */ + { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, + { 7, 7 }, { 8, 8 }, { 9, 9 }, { 11, 10 }, { 10, 10 }, + { 1, 2 }, { 0, 2 }, + /* bit_alloc_12[4] - 12 entries */ + { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, { 9, 8 }, + { 8, 8 }, { 6, 7 }, { 7, 8 }, { 11, 9 }, { 10, 9 }, + { 5, 7 }, { 0, 1 }, + /* scale_factor[0] - 129 entries */ + { 66, 3 }, { 69, 5 }, { 55, 8 }, { 73, 8 }, { 40, 13 }, + { 88, 13 }, { 41, 13 }, { 87, 13 }, { 42, 13 }, { 86, 13 }, + { 43, 13 }, { 85, 13 }, { 44, 13 }, { 84, 13 }, { 45, 13 }, + { 83, 13 }, { 46, 13 }, { 82, 13 }, { 47, 13 }, { 81, 13 }, + { 51, 11 }, { 77, 11 }, { 48, 13 }, { 80, 13 }, { 50, 12 }, + { 78, 12 }, { 49, 13 }, { 79, 13 }, { 54, 9 }, { 74, 9 }, + { 58, 6 }, { 61, 4 }, { 64, 2 }, { 67, 4 }, { 70, 6 }, + { 57, 7 }, { 71, 7 }, { 60, 5 }, { 63, 3 }, { 65, 3 }, + { 68, 5 }, { 56, 8 }, { 72, 8 }, { 53, 10 }, { 75, 10 }, + { 52, 11 }, { 76, 11 }, { 0, 14 }, { 128, 14 }, { 1, 14 }, + { 127, 14 }, { 2, 14 }, { 126, 14 }, { 3, 14 }, { 125, 14 }, + { 4, 14 }, { 124, 14 }, { 5, 14 }, { 123, 14 }, { 6, 14 }, + { 122, 14 }, { 7, 14 }, { 121, 14 }, { 8, 14 }, { 120, 14 }, + { 9, 14 }, { 119, 14 }, { 10, 14 }, { 118, 14 }, { 11, 14 }, + { 117, 14 }, { 12, 14 }, { 116, 14 }, { 13, 14 }, { 115, 14 }, + { 14, 14 }, { 114, 14 }, { 15, 14 }, { 113, 14 }, { 16, 14 }, + { 112, 14 }, { 17, 14 }, { 111, 14 }, { 18, 14 }, { 110, 14 }, + { 19, 14 }, { 109, 14 }, { 20, 14 }, { 108, 14 }, { 21, 14 }, + { 107, 14 }, { 22, 14 }, { 106, 14 }, { 23, 14 }, { 105, 14 }, + { 24, 14 }, { 104, 14 }, { 25, 14 }, { 103, 14 }, { 26, 14 }, + { 102, 14 }, { 27, 14 }, { 101, 14 }, { 28, 14 }, { 100, 14 }, + { 29, 14 }, { 99, 14 }, { 30, 14 }, { 98, 14 }, { 31, 14 }, + { 97, 14 }, { 32, 14 }, { 96, 14 }, { 33, 14 }, { 95, 14 }, + { 34, 14 }, { 94, 14 }, { 35, 14 }, { 93, 14 }, { 36, 14 }, + { 92, 14 }, { 37, 14 }, { 91, 14 }, { 38, 14 }, { 90, 14 }, + { 39, 14 }, { 89, 14 }, { 59, 6 }, { 62, 4 }, + /* scale_factor[1] - 129 entries */ + { 69, 4 }, { 56, 6 }, { 72, 6 }, { 55, 7 }, { 73, 7 }, + { 54, 8 }, { 74, 8 }, { 75, 9 }, { 48, 14 }, { 80, 14 }, + { 49, 14 }, { 79, 14 }, { 50, 13 }, { 78, 13 }, { 51, 12 }, + { 77, 12 }, { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, + { 2, 15 }, { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, + { 124, 15 }, { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, + { 7, 15 }, { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, + { 119, 15 }, { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, + { 12, 15 }, { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, + { 114, 15 }, { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, + { 17, 15 }, { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, + { 109, 15 }, { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, + { 22, 15 }, { 106, 15 }, { 23, 15 }, { 105, 15 }, { 24, 15 }, + { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, { 102, 15 }, + { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, { 29, 15 }, + { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, { 97, 15 }, + { 32, 15 }, { 96, 15 }, { 33, 15 }, { 95, 15 }, { 34, 15 }, + { 94, 15 }, { 35, 15 }, { 93, 15 }, { 36, 15 }, { 92, 15 }, + { 37, 15 }, { 91, 15 }, { 38, 15 }, { 90, 15 }, { 39, 15 }, + { 89, 15 }, { 40, 15 }, { 88, 15 }, { 41, 15 }, { 87, 15 }, + { 42, 15 }, { 86, 15 }, { 43, 15 }, { 85, 15 }, { 44, 15 }, + { 84, 15 }, { 45, 15 }, { 83, 15 }, { 46, 15 }, { 82, 15 }, + { 47, 15 }, { 81, 15 }, { 52, 11 }, { 76, 11 }, { 53, 10 }, + { 63, 3 }, { 65, 3 }, { 64, 3 }, { 58, 5 }, { 70, 5 }, + { 60, 4 }, { 68, 4 }, { 61, 4 }, { 67, 4 }, { 57, 6 }, + { 71, 6 }, { 59, 5 }, { 62, 4 }, { 66, 4 }, + /* scale_factor[2] - 129 entries */ + { 63, 3 }, { 65, 3 }, { 46, 9 }, { 82, 9 }, { 49, 8 }, + { 79, 8 }, { 85, 10 }, { 38, 12 }, { 90, 12 }, { 41, 11 }, + { 87, 11 }, { 93, 13 }, { 33, 14 }, { 95, 14 }, { 36, 13 }, + { 92, 13 }, { 44, 10 }, { 52, 7 }, { 76, 7 }, { 55, 6 }, + { 73, 6 }, { 58, 5 }, { 70, 5 }, { 61, 4 }, { 67, 4 }, + { 64, 3 }, { 47, 9 }, { 81, 9 }, { 50, 8 }, { 78, 8 }, + { 84, 10 }, { 39, 12 }, { 89, 12 }, { 42, 11 }, { 86, 11 }, + { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, { 2, 15 }, + { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, { 124, 15 }, + { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, { 7, 15 }, + { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, { 119, 15 }, + { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, { 12, 15 }, + { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, { 114, 15 }, + { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, { 17, 15 }, + { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, { 109, 15 }, + { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, { 22, 15 }, + { 106, 15 }, { 23, 15 }, { 105, 15 }, { 53, 7 }, { 75, 7 }, + { 56, 6 }, { 72, 6 }, { 59, 5 }, { 69, 5 }, { 62, 4 }, + { 66, 4 }, { 45, 10 }, { 83, 10 }, { 48, 9 }, { 80, 9 }, + { 24, 15 }, { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, + { 102, 15 }, { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, + { 29, 15 }, { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, + { 97, 15 }, { 34, 14 }, { 94, 14 }, { 37, 13 }, { 40, 12 }, + { 88, 12 }, { 91, 13 }, { 32, 15 }, { 96, 15 }, { 35, 14 }, + { 43, 11 }, { 51, 8 }, { 77, 8 }, { 54, 7 }, { 74, 7 }, + { 57, 6 }, { 71, 6 }, { 60, 5 }, { 68, 5 }, + /* scale_factor[3] - 129 entries */ + { 64, 2 }, { 53, 8 }, { 75, 8 }, { 55, 7 }, { 57, 6 }, + { 59, 5 }, { 69, 5 }, { 71, 6 }, { 73, 7 }, { 77, 9 }, + { 79, 10 }, { 83, 12 }, { 42, 14 }, { 86, 14 }, { 44, 13 }, + { 46, 12 }, { 82, 12 }, { 48, 11 }, { 80, 11 }, { 50, 10 }, + { 52, 9 }, { 61, 4 }, { 67, 4 }, { 63, 3 }, { 65, 3 }, + { 54, 8 }, { 74, 8 }, { 56, 7 }, { 58, 6 }, { 60, 5 }, + { 68, 5 }, { 70, 6 }, { 72, 7 }, { 76, 9 }, { 78, 10 }, + { 84, 13 }, { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, + { 2, 15 }, { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, + { 124, 15 }, { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, + { 7, 15 }, { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, + { 119, 15 }, { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, + { 12, 15 }, { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, + { 114, 15 }, { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, + { 17, 15 }, { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, + { 109, 15 }, { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, + { 22, 15 }, { 106, 15 }, { 23, 15 }, { 105, 15 }, { 24, 15 }, + { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, { 102, 15 }, + { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, { 29, 15 }, + { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, { 97, 15 }, + { 32, 15 }, { 96, 15 }, { 33, 15 }, { 95, 15 }, { 34, 15 }, + { 94, 15 }, { 35, 15 }, { 93, 15 }, { 36, 15 }, { 92, 15 }, + { 37, 15 }, { 91, 15 }, { 38, 15 }, { 90, 15 }, { 39, 15 }, + { 89, 15 }, { 40, 15 }, { 88, 15 }, { 41, 15 }, { 87, 15 }, + { 43, 14 }, { 85, 14 }, { 45, 13 }, { 47, 12 }, { 81, 12 }, + { 49, 11 }, { 51, 10 }, { 62, 4 }, { 66, 4 }, + /* scale_factor[4] - 129 entries */ + { 56, 5 }, { 72, 5 }, { 52, 6 }, { 76, 6 }, { 48, 7 }, + { 80, 7 }, { 44, 8 }, { 84, 8 }, { 40, 9 }, { 88, 9 }, + { 36, 10 }, { 92, 10 }, { 96, 11 }, { 28, 12 }, { 100, 12 }, + { 24, 13 }, { 104, 13 }, { 16, 15 }, { 112, 15 }, { 20, 14 }, + { 108, 14 }, { 21, 14 }, { 33, 11 }, { 61, 4 }, { 67, 4 }, + { 57, 5 }, { 71, 5 }, { 53, 6 }, { 75, 6 }, { 49, 7 }, + { 79, 7 }, { 45, 8 }, { 83, 8 }, { 41, 9 }, { 87, 9 }, + { 37, 10 }, { 91, 10 }, { 95, 11 }, { 29, 12 }, { 99, 12 }, + { 25, 13 }, { 103, 13 }, { 107, 14 }, { 17, 15 }, { 111, 15 }, + { 26, 13 }, { 34, 11 }, { 62, 4 }, { 66, 4 }, { 58, 5 }, + { 70, 5 }, { 54, 6 }, { 74, 6 }, { 50, 7 }, { 78, 7 }, + { 46, 8 }, { 82, 8 }, { 42, 9 }, { 86, 9 }, { 38, 10 }, + { 90, 10 }, { 94, 11 }, { 30, 12 }, { 98, 12 }, { 39, 10 }, + { 63, 4 }, { 65, 4 }, { 59, 5 }, { 69, 5 }, { 55, 6 }, + { 73, 6 }, { 51, 7 }, { 77, 7 }, { 47, 8 }, { 81, 8 }, + { 43, 9 }, { 85, 9 }, { 89, 10 }, { 102, 13 }, { 22, 14 }, + { 106, 14 }, { 18, 15 }, { 110, 15 }, { 0, 16 }, { 128, 16 }, + { 1, 16 }, { 127, 16 }, { 27, 13 }, { 35, 11 }, { 93, 11 }, + { 31, 12 }, { 97, 12 }, { 101, 13 }, { 2, 16 }, { 126, 16 }, + { 3, 16 }, { 125, 16 }, { 4, 16 }, { 124, 16 }, { 5, 16 }, + { 123, 16 }, { 6, 16 }, { 122, 16 }, { 7, 16 }, { 121, 16 }, + { 8, 16 }, { 120, 16 }, { 9, 16 }, { 119, 16 }, { 10, 16 }, + { 118, 16 }, { 11, 16 }, { 117, 16 }, { 12, 16 }, { 116, 16 }, + { 13, 16 }, { 115, 16 }, { 14, 16 }, { 114, 16 }, { 15, 16 }, + { 113, 16 }, { 23, 14 }, { 105, 14 }, { 19, 15 }, { 109, 15 }, + { 32, 12 }, { 64, 4 }, { 60, 5 }, { 68, 5 }, + /* transition_mode[0] - 4 entries */ + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, + /* transition_mode[1] - 4 entries */ + { 3, 1 }, { 0, 2 }, { 1, 3 }, { 2, 3 }, + /* transition_mode[2] - 4 entries */ + { 2, 1 }, { 3, 2 }, { 0, 3 }, { 1, 3 }, + /* transition_mode[3] - 4 entries */ + { 0, 2 }, { 1, 2 }, { 2, 2 }, { 3, 2 }, + /* tnl_group[0] - 37 entries */ + { 5, 3 }, { 4, 3 }, { 19, 8 }, { 33, 12 }, { 31, 12 }, + { 28, 11 }, { 34, 14 }, { 37, 14 }, { 35, 15 }, { 0, 15 }, + { 36, 14 }, { 32, 12 }, { 30, 11 }, { 24, 9 }, { 22, 8 }, + { 23, 9 }, { 29, 10 }, { 27, 10 }, { 17, 6 }, { 14, 5 }, + { 7, 4 }, { 12, 5 }, { 1, 6 }, { 26, 9 }, { 3, 9 }, + { 25, 8 }, { 20, 7 }, { 8, 4 }, { 10, 4 }, { 13, 4 }, + { 15, 6 }, { 16, 6 }, { 18, 6 }, { 21, 6 }, { 11, 4 }, + { 9, 3 }, { 6, 3 }, + /* tnl_group[1] - 34 entries */ + { 4, 4 }, { 7, 4 }, { 10, 4 }, { 3, 10 }, { 27, 10 }, + { 29, 10 }, { 28, 10 }, { 22, 8 }, { 21, 7 }, { 15, 6 }, + { 14, 5 }, { 8, 4 }, { 16, 6 }, { 19, 7 }, { 23, 8 }, + { 26, 9 }, { 30, 10 }, { 33, 13 }, { 34, 14 }, { 0, 14 }, + { 32, 12 }, { 31, 11 }, { 12, 5 }, { 5, 3 }, { 9, 3 }, + { 1, 4 }, { 20, 7 }, { 25, 8 }, { 24, 8 }, { 18, 6 }, + { 17, 5 }, { 6, 3 }, { 11, 4 }, { 13, 4 }, + /* tnl_group[2] - 31 entries */ + { 14, 7 }, { 17, 7 }, { 15, 7 }, { 23, 9 }, { 28, 10 }, + { 29, 11 }, { 30, 13 }, { 0, 13 }, { 31, 12 }, { 25, 8 }, + { 10, 5 }, { 8, 4 }, { 9, 4 }, { 4, 4 }, { 22, 8 }, + { 3, 8 }, { 21, 8 }, { 26, 9 }, { 27, 9 }, { 12, 6 }, + { 11, 5 }, { 16, 7 }, { 18, 7 }, { 20, 8 }, { 24, 8 }, + { 19, 7 }, { 13, 5 }, { 5, 3 }, { 1, 2 }, { 6, 3 }, + { 7, 3 }, + /* tnl_group[3] - 28 entries */ + { 8, 6 }, { 2, 6 }, { 7, 6 }, { 23, 7 }, { 12, 7 }, + { 5, 4 }, { 10, 6 }, { 20, 8 }, { 25, 9 }, { 26, 10 }, + { 27, 11 }, { 0, 11 }, { 22, 7 }, { 9, 5 }, { 13, 6 }, + { 17, 6 }, { 4, 5 }, { 14, 6 }, { 19, 7 }, { 24, 7 }, + { 3, 6 }, { 11, 6 }, { 21, 6 }, { 18, 6 }, { 16, 6 }, + { 15, 6 }, { 6, 3 }, { 1, 1 }, + /* tnl_group[4] - 23 entries */ + { 2, 2 }, { 7, 7 }, { 15, 8 }, { 21, 8 }, { 3, 6 }, + { 6, 6 }, { 13, 7 }, { 14, 8 }, { 18, 8 }, { 4, 4 }, + { 5, 5 }, { 11, 7 }, { 10, 7 }, { 20, 6 }, { 12, 8 }, + { 16, 9 }, { 22, 10 }, { 0, 10 }, { 17, 7 }, { 19, 6 }, + { 8, 6 }, { 9, 6 }, { 1, 1 }, + /* tnl_scf - 20 entries */ + { 3, 3 }, { 11, 6 }, { 16, 9 }, { 17, 10 }, { 18, 11 }, + { 19, 12 }, { 0, 12 }, { 15, 8 }, { 14, 7 }, { 9, 5 }, + { 7, 4 }, { 2, 3 }, { 4, 3 }, { 1, 3 }, { 5, 3 }, + { 12, 6 }, { 13, 6 }, { 10, 5 }, { 8, 4 }, { 6, 3 }, + /* damp - 7 entries */ + { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, + { 0, 6 }, { 1, 1 }, + /* dph - 9 entries */ + { 2, 2 }, { 1, 2 }, { 3, 4 }, { 7, 4 }, { 6, 5 }, + { 5, 6 }, { 0, 6 }, { 4, 4 }, { 8, 2 }, + /* fst_rsd_amp - 24 entries */ + { 12, 4 }, { 17, 4 }, { 1, 6 }, { 8, 6 }, { 9, 5 }, + { 20, 7 }, { 3, 7 }, { 5, 6 }, { 6, 6 }, { 2, 7 }, + { 22, 9 }, { 23, 10 }, { 0, 10 }, { 21, 8 }, { 11, 4 }, + { 19, 5 }, { 7, 6 }, { 4, 6 }, { 16, 3 }, { 10, 4 }, + { 18, 4 }, { 15, 3 }, { 13, 3 }, { 14, 3 }, + /* rsd_apprx - 6 entries */ + { 1, 1 }, { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, + { 0, 5 }, + /* rsd_amp - 33 entries */ + { 2, 3 }, { 1, 3 }, { 5, 3 }, { 14, 8 }, { 20, 9 }, + { 26, 10 }, { 25, 12 }, { 32, 12 }, { 19, 11 }, { 16, 8 }, + { 24, 9 }, { 17, 9 }, { 12, 7 }, { 13, 7 }, { 9, 5 }, + { 7, 4 }, { 3, 2 }, { 4, 3 }, { 8, 6 }, { 11, 6 }, + { 18, 8 }, { 15, 8 }, { 30, 11 }, { 36, 13 }, { 34, 13 }, + { 29, 13 }, { 0, 13 }, { 21, 10 }, { 28, 10 }, { 23, 10 }, + { 22, 8 }, { 10, 6 }, { 6, 4 }, + /* avg_g3 - 18 entries */ + { 14, 4 }, { 11, 6 }, { 19, 7 }, { 9, 7 }, { 13, 5 }, + { 10, 6 }, { 20, 8 }, { 8, 8 }, { 6, 10 }, { 23, 11 }, + { 0, 11 }, { 21, 9 }, { 7, 8 }, { 12, 5 }, { 18, 4 }, + { 16, 2 }, { 15, 2 }, { 17, 2 }, + /* st_grid - 22 entries */ + { 4, 4 }, { 3, 4 }, { 8, 4 }, { 14, 8 }, { 7, 9 }, + { 9, 10 }, { 22, 10 }, { 12, 7 }, { 16, 9 }, { 11, 10 }, + { 13, 11 }, { 17, 13 }, { 15, 13 }, { 24, 13 }, { 0, 13 }, + { 18, 9 }, { 20, 10 }, { 2, 10 }, { 5, 7 }, { 10, 5 }, + { 1, 2 }, { 6, 1 }, + /* grid_2 - 20 entries */ + { 3, 2 }, { 2, 2 }, { 4, 3 }, { 5, 4 }, { 6, 5 }, + { 11, 11 }, { 13, 12 }, { 17, 12 }, { 19, 14 }, { 14, 14 }, + { 18, 13 }, { 15, 13 }, { 16, 14 }, { 0, 14 }, { 12, 11 }, + { 10, 9 }, { 9, 8 }, { 8, 7 }, { 7, 6 }, { 1, 2 }, + /* grid_3 - 13 entries */ + { 18, 3 }, { 15, 4 }, { 19, 5 }, { 14, 6 }, { 13, 8 }, + { 12, 10 }, { 11, 12 }, { 0, 12 }, { 22, 11 }, { 21, 9 }, + { 20, 7 }, { 16, 2 }, { 17, 1 }, + /* rsd - 9 entries */ + { 1, 3 }, { 5, 4 }, { 6, 5 }, { 7, 6 }, { 4, 6 }, + { 4, 3 }, { 0, 3 }, { 2, 2 }, { 3, 2 }, }; DCAVLC ff_dca_vlc_bit_allocation; @@ -1250,67 +789,65 @@ VLC ff_dca_vlc_rsd; av_cold void ff_dca_init_vlcs(void) { static VLCElem dca_table[30218]; + const uint8_t (*src_table)[2] = ff_dca_vlc_src_tables; unsigned offset = 0; - int i, j; + int i; -#define DCA_INIT_VLC(vlc, a, b, c, d) \ +#define DCA_INIT_VLC(vlc, nb_bits, nb_codes) \ do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - init_vlc(&vlc, a, b, c, 1, 1, d, 2, 2, INIT_VLC_STATIC_OVERLONG); \ + ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + &src_table[0][0], 2, 1, \ + 0, INIT_VLC_STATIC_OVERLONG, NULL); \ offset += vlc.table_size; \ + src_table += nb_codes; \ } while (0) + for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { + ff_dca_vlc_quant_index[i].offset = ff_dca_bitalloc_offsets[i]; + ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); + for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) + DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], + ff_dca_bitalloc_sizes[i]); + } + ff_dca_vlc_bit_allocation.offset = 1; ff_dca_vlc_bit_allocation.max_depth = 2; for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, - ff_dca_bitalloc_12_bits[i], ff_dca_bitalloc_12_codes[i]); + DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12); ff_dca_vlc_scale_factor.offset = -64; ff_dca_vlc_scale_factor.max_depth = 2; for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, - scales_bits[i], scales_codes[i]); + DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129); for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) - DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4, - tmode_bits[i], tmode_codes[i]); - - for (i = 0; i < DCA_CODE_BOOKS; i++) { - ff_dca_vlc_quant_index[i].offset = ff_dca_bitalloc_offsets[i]; - ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); - for (j = 0; ff_dca_bitalloc_codes[i][j]; j++) - DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], - ff_dca_bitalloc_sizes[i], ff_dca_bitalloc_bits[i][j], ff_dca_bitalloc_codes[i][j]); - } + DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4); -#define LBR_INIT_VLC(vlc, tab, nb_bits) \ +#define LBR_INIT_VLC(vlc, nb_bits, nb_codes) \ do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_sparse(&vlc, nb_bits, FF_ARRAY_ELEMS(tab##_codes), \ - &tab##_bitvals[0], 2, 1, \ - tab##_codes, 2, 2, \ - &tab##_bitvals[1], 2, 1, \ - INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG); \ + ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + &src_table[0][0], 2, 1, 0, \ + INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ + NULL); \ offset += vlc.table_size; \ + src_table += nb_codes; \ } while (0) - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[0], tnl_grp_0, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[1], tnl_grp_1, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[2], tnl_grp_2, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[3], tnl_grp_3, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[4], tnl_grp_4, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_scf, tnl_scf, 9); - LBR_INIT_VLC(ff_dca_vlc_damp, damp, 6); - LBR_INIT_VLC(ff_dca_vlc_dph, dph, 6); - LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, fst_rsd_amp, 9); - LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, rsd_apprx, 5); - LBR_INIT_VLC(ff_dca_vlc_rsd_amp, rsd_amp, 9); - LBR_INIT_VLC(ff_dca_vlc_avg_g3, avg_g3, 9); - LBR_INIT_VLC(ff_dca_vlc_st_grid, st_grid, 9); - LBR_INIT_VLC(ff_dca_vlc_grid_2, grid_2, 9); - LBR_INIT_VLC(ff_dca_vlc_grid_3, grid_3, 9); - LBR_INIT_VLC(ff_dca_vlc_rsd, rsd, 6); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_tnl_grp); i++) + LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], 9, tnl_grp_sizes[i]); + LBR_INIT_VLC(ff_dca_vlc_tnl_scf, 9, 20); + LBR_INIT_VLC(ff_dca_vlc_damp, 6, 7); + LBR_INIT_VLC(ff_dca_vlc_dph, 6, 9); + LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, 9, 24); + LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, 5, 6); + LBR_INIT_VLC(ff_dca_vlc_rsd_amp, 9, 33); + LBR_INIT_VLC(ff_dca_vlc_avg_g3, 9, 18); + LBR_INIT_VLC(ff_dca_vlc_st_grid, 9, 22); + LBR_INIT_VLC(ff_dca_vlc_grid_2, 9, 20); + LBR_INIT_VLC(ff_dca_vlc_grid_3, 9, 13); + LBR_INIT_VLC(ff_dca_vlc_rsd, 6, 9); } diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index 68974d9965..c0bdce5998 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -62,11 +62,7 @@ extern VLC ff_dca_vlc_rsd; extern const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS]; extern const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS]; -extern const uint16_t *const ff_dca_bitalloc_codes[DCA_CODE_BOOKS][8]; -extern const uint8_t *const ff_dca_bitalloc_bits[DCA_CODE_BOOKS][8]; - -extern const uint8_t ff_dca_bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12]; -extern const uint16_t ff_dca_bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12]; +extern const uint8_t ff_dca_vlc_src_tables[][2]; av_cold void ff_dca_init_vlcs(void); From patchwork Tue Sep 13 11:33:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37889 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628105pzh; Tue, 13 Sep 2022 04:34:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR44caE/PH3nKBhqbs43hrsu26CfNAkKLK5iKPswsmG/jX8u2druw13dklFYfp8DdF8SdHJ9 X-Received: by 2002:a05:6402:a43:b0:44e:cf0a:5e82 with SMTP id bt3-20020a0564020a4300b0044ecf0a5e82mr24948462edb.118.1663068844277; Tue, 13 Sep 2022 04:34:04 -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 et9-20020a056402378900b004520b2492a1si2681621edb.528.2022.09.13.04.34.02; Tue, 13 Sep 2022 04:34:04 -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=r7zPMvGc; 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 D130D68BB3C; Tue, 13 Sep 2022 14:33:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 31DF468BB3C for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gZ43VbLyhvr2u914ZT0kC/iEXB4DYc2aF6TENkFP7orFSxn9TuEU/Crbur/U0CLuOCP2qRi0bfpgfvtWOfiuQyHbMKfjXaK/CWaDyqHplLPlj9pbHQbuGVLWUmvd6C8qc1Spiig8eUTC8/YSb5vUzSae3LKdEAqnz0yqGi2tZlpFIcmI7IBV1ATzLj1Fn9OVk0cOXgpahi+rMYlq8nEZqdOVfIz4dExaWb5KMz3pZUJm9HuNFzPDUAJNl8GRzJSFgpgPqwm2KEwiO4DxPpLZjN5dzKrvPp1K1dpA45eQL76F+qb0SgmXrtier3yAF04ZbLP0w/U5fp4ditlKn8S0Mw== 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=KdktDvD9P2b0VFYuia6qYCwITPuG8R0zdos6FWF5sv4=; b=LFY0m98lB4p8QwfSqus6n1SovxKWI5ZJqzT6YyR+Wi5GMyxmSU1ZadE65niRmmIq+UKSfy8pPAEIFBtKPyrrSrW390yrpeBFqfmsTmiyeUn596a+obItMAtmOfugLadDSnNuB/bj2afd4adj+yqQW/N0Kao//k+Zc9HIjZ+yBJA+pzceCW8j3Oy0PKZPd+Xkzb1UmdNo3z6nM9MIXyQStKR1009rb1gMmBxAyqzHx6W3ZuRASfm2y0/guMA8qKmiTtQtywVuoRXtVv5xEFOQFHCZbzDadCbtu9Oh6P7aUW8ylG1hgTX8VTnclwzzHK0hqh74jn5POJEHGVpYWHsiiQ== 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=KdktDvD9P2b0VFYuia6qYCwITPuG8R0zdos6FWF5sv4=; b=r7zPMvGc7GLCxGK4xDT3YHP7br5t97zRuTMFRMJd/4BRJxVk9t4It2tE9KmCx6xiicVE/0QH2v55PTuLJoGCI5+cHxfsrBQoEmq8KDRlfL1UyPOkxil5w4AjVlq3QoZyLaf+HDYsiPsy/hMDraOGdLTCc3nLHw6o1MjEYzsjw3i3KOFlmKrKoFl9K9r5wd+Gtl5+g8fFiCBO+JYYuGlmjd2qFowjlVlFvPEEdOUcS5Eh7bvs528+Mnnj6KNotWKPidu2dGMWsvdcrJB6ZvXLkivTegypljcXEi8GY5+qbyYIPlSDIZD1411QkLnndmAIWMmRmlLzCAcmn0AYY33xEw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:25 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:25 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:05 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [bhhcCv4W/lnMprBhj4MIaJxF/J5+xcRTON0SBJw/7xE=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: 9864f805-d59b-48ec-200a-08da957bc57b X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKy7YnLMs5Csile4q0ca2x3wyG9zlL+WOLYMWStPN+IP/vfJJ/DpkIUkgR/jcSjOpJQ6Ac/Br2rJjiwAq3E6BegzP+CUGCN6lJUrE+E0lHuJ6DFnXd+eFlSypoflMzRARzOJdOK1ep/KuwMVMEyKDHtf3Gm0b+8vzrOrCyO/w3LZamOgNfoz4M1MPIW3SbirSujlzZ33umH61v97IJz23Dh1cYTAdEfDQYPKIlhmDJlc7J2Hx+BhSs3bGaME707ejEXd8JYXGqxgE7yRsGUbhDfqnLKIsjVzop0LrP66k12zXdJ6lkDFa1q1J7/R0Q6alRrUVPunovXmxJtCrbaUN4pUmQYnk99uLWQgv8NvyA2LBMbd1E336NAhG4nv1dYSfoTWvEvpAyPjpCD9GiTCW4JjkSyNYIKHEhSn86z/cCWEX/AVC5vQhdqztu+Q80q4arP5fUgCUZ2GltBdAE+pp50Wlk76ewZC1iPDJyfREv2pflEc+4lIcl+1ZdsIjcB4THzbjMoBnyK+kmI1SUvMDmAyQBv16pBZJDUJcUCJgZX4/3Abtmw7Kfzy74fJjjqs584k45bw1qUMeYccAClGikx4AyKjZbDP8BUAJC0RgxwYj38kypGND384reKT/Y0/DFuDQNJKUsNtTYq4QwNyXg1jekM7BeyszAQsNsySkG03ykYKrH0UTZAIjRlDIV9FSQzq6UQaPDEAy6wXK4EGkeEv+RETWaVGdQU= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yBp84XO5SAN0l63ZbTw/s5pzu2e+BPgxzLuKXbL5HIGw2RxiTd2tgccGNZnuuA+6K1vU1O2GA49id41gU09Wv0P/lPDb0iFC/PTxHUoEbxY/680lwppOWEvAZKqvacECkMAJ2CDiBeUC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y7bn2V9adxHzAbmoNjM0W5EeZnwbde6CwftjbnD8o9ucbQLB8fBlV3SCXtho8abqYJFLRAbXF8i2s3rB9FRANA19S6LD+9MVEWs56swqnzw+EO5VSNC0Z1gk/SShyvmDsShe3Cp9jCM+BIgQHkaIZpLB/tMv7vnY2PS9dfK5snyBq9u7MKMuwhG3LUbz5Aiw5m+3eH2W8x+F1nd+uEB3wSYCi0G18R51/Xb7C83j5WjvY5Hj67MuOLVBRio7Ga4sQr/6G1nDmH5HuUf1aKzAKZUZf+pDFiZk0RrZP9sjbZ33hKe6XAukFTghOEcIiXbhzIhNr4ne0v66tkz23avNGbGJtu+GEoJJYl3KcjAnHoRMNkL0sA9xHYP4PO35tJaeQcxCUI1ovDD+Sxx0ZIjgcIlM7P/uUdb3f4f5GRUZQbZD0hafrIbkrW9k6l2ucN5AbEEjsZcolDjxBqCMTKL+I0KFhCpbkzk8zh5IXXZlbCnyq5L3fvf6kqftjR+SGjzf5YsOP11PG3T64jOcmAWT8QOd1g68O9uS0YpAABX7tpyQslD02a7XFnDX4253cmQYjJ9QhaUfuFJBwfqZp7xRfXxFbKNMhuQwvhYBk111I50wj1F/AsXoLabu3eIU3CFpyF1AIsPjhd3lIt6or1/+AEGP9rJwhItbNRmFgp2D9Ckm/vDkf1easXvdhpESX8ZbKtAXW/4LXawTB1O6C7hqVOp7NknMfMArDtzaHUqoLi7pCcxP2ETigG2sr48ayds3MsVdAoH26LfFkYE7Z9k2tWX6pUaY1syyHaAeYJit+xYLCxVkG6lQVhuuoCm6fZpidClDNsH030DPeNuA5xsYM X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9864f805-d59b-48ec-200a-08da957bc57b X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:25.6648 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 08/13] avcodec/dcahuff, dca_core, dca_lbr: Apply offset during 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: HreD55bJQ9XM Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 2 +- libavcodec/dca_lbr.c | 4 ++-- libavcodec/dcahuff.c | 45 ++++++++++++++++++++----------------------- libavcodec/dcahuff.h | 1 - 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index 069d428fff..96787fe95d 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -69,7 +69,7 @@ static const uint8_t block_code_nbits[7] = { static int dca_get_vlc(GetBitContext *s, DCAVLC *v, int i) { - return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, v->max_depth) + v->offset; + return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, v->max_depth); } static void get_array(GetBitContext *s, int32_t *array, int size, int n) diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index 5343bcde8a..579bd9c469 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -263,8 +263,8 @@ static int parse_lfe_chunk(DCALbrDecoder *s, LBRChunk *chunk) static inline int parse_vlc(GetBitContext *s, VLC *vlc, int max_depth) { int v = get_vlc2(s, vlc->table, vlc->bits, max_depth); - if (v > 0) - return v - 1; + if (v >= 0) + return v; // Rare value return get_bits(s, get_bits(s, 3) + 1); } diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index ee4d4bcd6d..7a5b054dd5 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -793,44 +793,41 @@ av_cold void ff_dca_init_vlcs(void) unsigned offset = 0; int i; -#define DCA_INIT_VLC(vlc, nb_bits, nb_codes) \ +#define DCA_INIT_VLC(vlc, nb_bits, nb_codes, entry_offset) \ do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ - &src_table[0][0], 2, 1, \ - 0, INIT_VLC_STATIC_OVERLONG, NULL); \ + &src_table[0][0], 2, 1, entry_offset, \ + INIT_VLC_STATIC_OVERLONG, NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ } while (0) for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { - ff_dca_vlc_quant_index[i].offset = ff_dca_bitalloc_offsets[i]; ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], - ff_dca_bitalloc_sizes[i]); + ff_dca_bitalloc_sizes[i], ff_dca_bitalloc_offsets[i]); } - ff_dca_vlc_bit_allocation.offset = 1; ff_dca_vlc_bit_allocation.max_depth = 2; for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12); + DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, 1); - ff_dca_vlc_scale_factor.offset = -64; ff_dca_vlc_scale_factor.max_depth = 2; for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129); + DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, -64); for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) - DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4); + DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4, 0); -#define LBR_INIT_VLC(vlc, nb_bits, nb_codes) \ +#define LBR_INIT_VLC(vlc, nb_bits, nb_codes, entry_offset) \ do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ - &src_table[0][0], 2, 1, 0, \ + &src_table[0][0], 2, 1, entry_offset, \ INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ NULL); \ offset += vlc.table_size; \ @@ -838,16 +835,16 @@ av_cold void ff_dca_init_vlcs(void) } while (0) for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_tnl_grp); i++) - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], 9, tnl_grp_sizes[i]); - LBR_INIT_VLC(ff_dca_vlc_tnl_scf, 9, 20); - LBR_INIT_VLC(ff_dca_vlc_damp, 6, 7); - LBR_INIT_VLC(ff_dca_vlc_dph, 6, 9); - LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, 9, 24); - LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, 5, 6); - LBR_INIT_VLC(ff_dca_vlc_rsd_amp, 9, 33); - LBR_INIT_VLC(ff_dca_vlc_avg_g3, 9, 18); - LBR_INIT_VLC(ff_dca_vlc_st_grid, 9, 22); - LBR_INIT_VLC(ff_dca_vlc_grid_2, 9, 20); - LBR_INIT_VLC(ff_dca_vlc_grid_3, 9, 13); - LBR_INIT_VLC(ff_dca_vlc_rsd, 6, 9); + LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], 9, tnl_grp_sizes[i], -1); + LBR_INIT_VLC(ff_dca_vlc_tnl_scf, 9, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_damp, 6, 7, -1); + LBR_INIT_VLC(ff_dca_vlc_dph, 6, 9, -1); + LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, 9, 24, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, 5, 6, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_amp, 9, 33, -1); + LBR_INIT_VLC(ff_dca_vlc_avg_g3, 9, 18, -1); + LBR_INIT_VLC(ff_dca_vlc_st_grid, 9, 22, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_2, 9, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_3, 9, 13, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd, 6, 9, 0); } diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index c0bdce5998..a50d49d6dd 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -36,7 +36,6 @@ + 7 * (17 + 25 + 33 + 65 + 129)) typedef struct DCAVLC { - int offset; ///< Code values offset int max_depth; ///< Parameter for get_vlc2() VLC vlc[7]; ///< Actual codes } DCAVLC; From patchwork Tue Sep 13 11:33:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37891 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628282pzh; Tue, 13 Sep 2022 04:34:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6iQN5dx00gipa0rsdfbDdJu7v6ghwY33W2fkCYfOzz8op22vt5QQSfnxLOZ4vuQ8d7lcX8 X-Received: by 2002:a05:6402:5ca:b0:445:c80a:3c2 with SMTP id n10-20020a05640205ca00b00445c80a03c2mr25747599edx.247.1663068866154; Tue, 13 Sep 2022 04:34: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 gs37-20020a1709072d2500b0073beb58e98dsi11593726ejc.276.2022.09.13.04.34.25; Tue, 13 Sep 2022 04:34: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=erRuejks; 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 E5B0668B9B4; Tue, 13 Sep 2022 14:33:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6887768BB3C for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjdPRoH7gnxti5vA9uqRPELzqPm6kgmzI+3mt+G/+ZneOqkkV4hRp//VBGMdJx/2W3SVnf+ksUd67DqrADqU6ELtcbfqPRPkiOIbyc7wIxhbq7BP1cf0P9w8WmOJUBzVIWB9JoLFz2l3TpU2WuZ8VelELADz4nbZloW21SBKKiSklg7kTRHPwLdOIeu6wPK5BlQh7+l2kahmxFubTLV87gGSg1E6WAtY0ExuesROYx/NsXE4cvft35RVcr6qOS79PZM0xn3YRLFkUdioPaucPrThWayK50eGF4po65uVJzcVEN3V/aIOMf3Vc/Eu5OW/KkIK0hVvfAa233mj2yljHA== 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=scrtERpf/Nq2RBDgrcyLpAwbLh0rhycF0lQJm5VhWDs=; b=K2wv2Lb38BskntMh8RHqiLZWgCvqPAW01RyImMGhl5rMcXpJpBy9aOBHk3Oyv222xjrnhWpggWdOJYH0Qa6eQYlnL5dLKdWTrT4D3O6DKAF00KSHaR7Zpl4iKi+hqFeYVZm3CS2avetYPzuQ9Y+Uf/8c4nQSnrM50uwhc/YcUJanvAQY5RtKfuoYjf7Kjun2gdo+31t/UkodElxyklz8CRILbUOVwZ/E2l1+o86cSwURKRjdzkroAZKL3RXinS9MEx/tBKvcRPQurys7iDr6mkX+vcPQcwSAC7EWWRAejUBqce7M7EtYwHjXB6S3azD2sRw/ieoN0U8sm7axRCyGJg== 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=scrtERpf/Nq2RBDgrcyLpAwbLh0rhycF0lQJm5VhWDs=; b=erRuejksLi4kSZ7wVWPmOvKFWZD2DyBJzQLuSQUaA0mreM54cOO4LJjI+TopM09C+Kl+/Vo0GDheqj0B4Bn0SSuLxl+y4RcGU4FhgUNDyFm6+80fpGpyXNPGyePJaD1+iDZhPi8dH4FxeSym/MUIa69G+m/KU2iQmkWhob1zPPePsj3/+dnOxPHdd8MDCv+haiRpxfjMDDCtghhhnEZsVLvBMrIJW5e7eqiiaeZMuDOjYfk18JvJr47TeL8w5E0HxJpvS9vi4TwDg/3RYtE9EU0pWctMcnf9TiX+N1kolUgxqYlWe1jA4aWkArjdBs7pQBGYoiU78LlhMUpnSvxJcA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:27 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:27 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:06 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [+oNjBZIcDOza7Tx0mvDwFBNQvpaN6BaSW7o8sNH/x/A=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: 5378387b-c7c1-437b-3a6a-08da957bc662 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAwXLVZjdtb8NY6wd54xJBoHIpUlL5t8+XdqgON/tLewWGdqcqMgsGT7+vWmhPYxQJHpv1IdkxqK3M1FbeWkmQraEFAxxMRG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blNPtVBPjMY47pfJRPUf+9IpdwwgRnPu5mMOwKX4VFicoaSldE/oURTeEt1d/mlGGI5FVF7F5KTbZcYhOh+yxiH6Pd1gRu05aumUhdJtoDoCemhqFqid1F4sRDAhy1XrJOeQZCqHgJmI8liHNWWDxp+V3Oqp7jvoS8cvmWJ8INvhzqFgqdSehUIFj62gcGdkVt4DAg3spJbKV1qQk85qAroB1KlVtf2k+vhhFLsHBPNLApAX5hYaeL57c3wbdauoBBJ0F6TIv+/nKTozsd4wQR+2oUyOw8Jw4QmnhZBgEmuGxAFCk6vus/3jMHTuTgXUHlvSvtb4+uDJTtggvBUfHMDwg/vpQw6i2G5YbK283mZfUK4PSxApXuJLs4hjyJ7S/dL93BE/OnPbVxybY5m2giyHuXuDGPZVpRlzb/cdWYim3sHBpLVD3ZI5NI3Hv/qsOfXJJyq9yeEnu/x7arSvbYUz1Q6HQgY932hahMxfyb71irz4gVlUiM/zmoQ6JpheB0cx0Wu0WU0IeaUFqsy6daqo8F70oJf2KdQNsitsCxyIFI1zuSJuHpA/V2bvjeO9P0SxGQ/ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5378387b-c7c1-437b-3a6a-08da957bc662 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:26.9906 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 09/13] avcodec/dca_core: Inline number of bits of scale factor VLCs 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: 7E7qttI2KWe9 Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 6 ++++-- libavcodec/dcahuff.c | 7 +++---- libavcodec/dcahuff.h | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index 96787fe95d..7dff6633df 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -362,7 +362,8 @@ static inline int parse_scale(DCACoreDecoder *s, int *scale_index, int sel) // If Huffman code was used, the difference of scales was encoded if (sel < 5) - *scale_index += dca_get_vlc(&s->gb, &ff_dca_vlc_scale_factor, sel); + *scale_index += get_vlc2(&s->gb, ff_dca_vlc_scale_factor[sel].table, + DCA_SCALES_VLC_BITS, 2); else *scale_index = get_bits(&s->gb, sel + 1); @@ -381,7 +382,8 @@ static inline int parse_joint_scale(DCACoreDecoder *s, int sel) // Absolute value was encoded even when Huffman code was used if (sel < 5) - scale_index = dca_get_vlc(&s->gb, &ff_dca_vlc_scale_factor, sel); + scale_index = get_vlc2(&s->gb, ff_dca_vlc_scale_factor[sel].table, + DCA_SCALES_VLC_BITS, 2); else scale_index = get_bits(&s->gb, sel + 1); diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 7a5b054dd5..a7518aded8 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -770,7 +770,7 @@ const uint8_t ff_dca_vlc_src_tables[][2] = { DCAVLC ff_dca_vlc_bit_allocation; VLC ff_dca_vlc_transition_mode[4]; -DCAVLC ff_dca_vlc_scale_factor; +VLC ff_dca_vlc_scale_factor[5]; DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; VLC ff_dca_vlc_tnl_grp[5]; @@ -815,9 +815,8 @@ av_cold void ff_dca_init_vlcs(void) for (i = 0; i < 5; i++) DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, 1); - ff_dca_vlc_scale_factor.max_depth = 2; - for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, -64); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_scale_factor); i++) + DCA_INIT_VLC(ff_dca_vlc_scale_factor[i], DCA_SCALES_VLC_BITS, 129, -64); for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4, 0); diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index a50d49d6dd..8663f8ba12 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -43,7 +43,8 @@ typedef struct DCAVLC { extern DCAVLC ff_dca_vlc_bit_allocation; #define DCA_TMODE_VLC_BITS 3 extern VLC ff_dca_vlc_transition_mode[4]; -extern DCAVLC ff_dca_vlc_scale_factor; +#define DCA_SCALES_VLC_BITS 9 +extern VLC ff_dca_vlc_scale_factor[5]; extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; extern VLC ff_dca_vlc_tnl_grp[5]; From patchwork Tue Sep 13 11:33:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37892 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628353pzh; Tue, 13 Sep 2022 04:34:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rRPV/pQWGYCDFwGTxvm/+rnrAeSZ3eEnFSI+1r+FRovRFCk2vYELQlUV7Px4PM8CHtPSl X-Received: by 2002:a17:907:728d:b0:77e:1942:f772 with SMTP id dt13-20020a170907728d00b0077e1942f772mr5679486ejc.222.1663068875612; Tue, 13 Sep 2022 04:34:35 -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 he40-20020a1709073da800b0077edef76646si4003994ejc.366.2022.09.13.04.34.35; Tue, 13 Sep 2022 04:34:35 -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=HDXZOgfq; 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 EDC7968BB6B; Tue, 13 Sep 2022 14:33:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C23E68BB44 for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvFI/ZJfEcB2OlqPtcuFV0IpgTL/qU5zW3jFoJvE2+WmQbA3ha+8QVBGHWb768/QbfRqx5JTOu3ItaEE8Qzt3reRpuuWmPt1mzhHSDaQsj9rUGOa8sTicNO6oGjBFLrGhoYCNHyZ3ol0g5l9eEE7xQNJGgf09AZWiJcAk+I8mgxPvBMNM4u+8saTAHmisdTRauGR2WmLUorOXGDZIZQt+et0YSLxHZuEJe7Z57mz7z9HTuGT/i6QNhOx/1rYy796ucwfTAG/bAeGHcA5vhyH1M3kqcZe+FYJtqkNzSX0AAMnxiZZBY1dds2EineZUvrZBAuQ6OZXPU9vb2SGK7vNBw== 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=Nd1F4dd539yEvaQ6LwT9yC4U6l3v94zwyqX/FIvmD8o=; b=kq9cCDc5PRFRWoCoHXhKYkgYaZsWHVDWXg1wfa0/xH87nD7u0iA6OXHLm0UUIS3aGVBoPeTLC4ijiuwY1mEPkE1yGIHjKuQ/ZuB5Tuh7gsAfqPpw7CLRVDEt3E8wa3HX8sGKOanCcsd2JFGDKcyIuy4cumusDSm4PF/CAYDE/ChfXvq9nZwqet0a/g8OasUa/9RDV4yjKIweLdvPokYoGA1RTwDssbLq/BFekqkCqC+uYj4YhBOqSHRr+k7zOju+ba9jS4t/nF+WG2f62zqZyRc99OR10HPV2DINmqNJw6unns2P3tQNIpJtT7+0GWQ4nvThHO0fR+gCoPhtWB9iXQ== 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=Nd1F4dd539yEvaQ6LwT9yC4U6l3v94zwyqX/FIvmD8o=; b=HDXZOgfqlm40RIwS8Wb7QqbWFBzCLNhXD3VVdXEiBPugcop6L66gzdkmBSX+y67KA+AeqH6lJoc8HAhwBwHLYkxS/T7yfIs/uaepIr2TbPpyOWBNBwDDsjEPZCBPIuj9V1MP9nnXwHijsu/Tawuj5ZY+JVIhTyRD+YIc4VOIxRkcO4gLMwerDdjD8A5TMUNGb/MoI4OhXXsCUaRpitRkulk2YIr7SPiqLnp88MCRgCIykhhhRiziJDHf7zRvVoyD69wnc6aYYk+IP/VrBvY8Cf02uGyry1PxnP713IZ4e7CBZhouZyWfuBvlIj8zez2Y3OHXqM5K7MHn65fBu2yamg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:28 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:28 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:07 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [v1aFtOSdDACmgtAylD9IW3HUhqySZSSZ0BMiaozpwpQ=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: d1810809-1c41-4d91-e528-08da957bc706 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh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6HcJnswZjChon+equ4ZSnx3baJYVN0abHo/HFfm1uf2n2GLpFCR663KiQOezAkooT/rwa04JONhWVPnfJPesb0ufoaw+RF/w9x3LZ6JdZvgltrg6WmZB2RkBGsGWLILU4mKrzAfad4mVT6/EIij0yaD5Op+jCHcnuiJgq1sw0WpTp42NSZzudgqzy0jElAMTC8VeFmlcSE61gVKDtOvinKG3ITEIlzSAN5UR4fKnp95eTctzKez6dntAYbEhDSHJxqUiczoUaQt+mdOohFXSFpfJEO0FvYjQd7sz4O0quvH6/SJhp4KHGMUYQ9ZWQXj4t+SAXmAbRwLEimLxzOlTIWMeZdXFUFQ41XQuPbkMpx6ySm3hxep+5GNbs25pCmIaLC0A3VXiUIZ7u7CZhJ8RXO81aqIE1NKTlxPzvw2V0aky3suP2+94Ncj2PxVxpMrVnBXWCibno4fsOZ9yxJ3hxP/1zqJ7vpc20rSWJbkJkICY9FiIEuAqrxJcdvGr+34sP1mb6ipqm5kw1Br3zD2i5UUXXBZFiKovhNUSGctGikw29De3h85yJRGs+58tZttSTbICJZxArvmcZI01DOLsNuq15M9wNlj6was4+jJcRxv5YXTfwGQHF/F8RRkJQeGnyGfmu2ZRwhvVofJqPbTntdBOulflzoM7i4Hba/z X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1810809-1c41-4d91-e528-08da957bc706 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:28.1323 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 10/13] avcodec/dca_core: Don't use too big max_depth in get_vlc2() 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: dAeF1RYMny7h Most of the VLCs used here have a max_depth of two; some have a max_depth of one. Therefore one can just use two and avoid the runtime check for whether one should perform another round of LUT lookup in case the first read did not read a complete codeword. Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index 7dff6633df..7b23a40df4 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -69,7 +69,7 @@ static const uint8_t block_code_nbits[7] = { static int dca_get_vlc(GetBitContext *s, DCAVLC *v, int i) { - return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, v->max_depth); + return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, 2); } static void get_array(GetBitContext *s, int32_t *array, int size, int n) From patchwork Tue Sep 13 11:33:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37893 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628458pzh; Tue, 13 Sep 2022 04:34:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR4amoKN8Ma/iXXN6PxQYwBYs20tlvfCKvhiJ/8/JVc/iej3tgSNgVhIdO3vtCLePwhRg6as X-Received: by 2002:a17:906:7304:b0:6ff:a76:5b09 with SMTP id di4-20020a170906730400b006ff0a765b09mr21318160ejc.193.1663068885276; Tue, 13 Sep 2022 04:34:45 -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 x19-20020a170906711300b007801a197a1bsi126248ejj.449.2022.09.13.04.34.44; Tue, 13 Sep 2022 04:34:45 -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="U3TM/Lq5"; 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 1F3EF68BB45; Tue, 13 Sep 2022 14:33:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F67E68BB3C for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OHlQtG2MBqeFZ/TGeftfYkWlwhHl5AxUA/gCZGA+I0FeKD2OlZrF6R0nmFhtghGfFGdO2JS7k0pxP5hHGfEEs/g/dGbUO/XEdPNSmdkfWitkic2rGbgf+hqvvnwVM8t7B2tFrdN1lut+xVzoyP29sdN3NpmFVjUDyzc1s4ih5jRK5G7gc2jz289jBIYla2PqA5wbY6lOf/aAZH/3HDs4bpnNjGP0SBVs8iaIaZNQIzgMoKu9bWB9EaUaTdgjkND1eIrK0Hu4bRIM/yGjlklkhVyN6TzkSnfX3gBumaWtZVD/jNWMa9R5pXhcPtYKwfjgirNWxvPZ9rlHF1RooDe5Xw== 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=Yc6xf7ztaQhKW+6ZRNHX6nLqbX67BdBpjJY4Iwf7V7A=; b=erINAeYj52/EQXiZ6RsXCBjE1dXYe+UnvezfZejzu++F/0NhZlHcmWmLgrJ3Lvc4ANzbRHuvj2AImeattquqrX748b5o3eG1vW0ve6931KYhwRQeQxpWDqnvLtXw91F94E+9xVvVuteHt0HMWe6YqpNtkZ7x0amS/SLc+deuYHx0DrxpKd8/dJk/Epbuc2znCTPxmmwtDFtOp/uwTgT/wnZrRuCQ/2iXafVcDPUWZjELJ8Enim3HU0alS8wMCW+59wQfwCk082HsOpAP2fw7fLGCKyt5hmY0qGY0xELY3Pyioe3yHajeM7YoCIAxwFCxdIbxUpov3zXLn3Wrya4w9g== 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=Yc6xf7ztaQhKW+6ZRNHX6nLqbX67BdBpjJY4Iwf7V7A=; b=U3TM/Lq51nH8hrBQncqi/+2Q1UNc5hUtEvvL+rhx2bMCKO4fr0/cw5ISCAzwtQug8f4gkFV1w51v7Ed3jSw6iw0IJqt0U7syFpp+tucV4WuWhOqeSreJ93+pEm7UUeeglhP5u4vT3Qm2EN3OGc0QjhTpiyV3wEzDSp/aZW1OVYWJDYU0r17NlW4FNmtFeVBiYYmn2YRG7WhcHzgabp8QNyKfsr/WkEX7MJCvD6THjvzroTKJKFredDT06ZyXczaFMT7dUcXLkbRB1/Glk5BrpwHMdxtEP4rxHiobeoHfaCoTFIcdYMmS+bgzWtevPLG3MfCbsWS5LQsHJXlXfJl58w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:29 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:29 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:08 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [k7eRGqhbmEpGNMW3QgrI3Opyri7+t4twkX6g1HUJawE=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-10-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: 445ff778-02fd-4599-f7f3-08da957bc79d X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKy7YnLMs5Csile4q0ca2x3w9F8yamsprfBG20LD1f3HOxu7oxu1z7hkLaII65ouYV/FyKcovssQ0vVj1eaygPSSjhvhPsfDY2yZQ7aLIt7K9RGfxIeohl6tjL3FtzsT/KoFojx6Do24M9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D8lUrWyBm5cPWyyns9dd1yPDHdmv6k8fmDJL/fAb73XgE159AhY++Ei6QtmT7QqHLF7GO+Bamt6S1tTzp5tBxviwbI4Z9PyJE3IkFZuo+/dXIbNdwx+gk7dsycQ0zeEzsvOY3c+HySR3qpLWIC2eaATyZBwx7aLn/ct1/Sqo0VBen5XIUZu3H+d/NJ2hhuR07Odn4T+n7Xmq8AyAYisf+bxfdyPKhX7nbbr2Wpu94elIYr5PVLkCcbeM5mJ45KnGe5fADPwGI9Dhiqd+hojnecuU2nJhxC+IyCQkLzbp7FEuv0nuhSk7Kvt4MNsRM//p9fTrgf8M7Xcpom9c1xQ8brnQLHodOgPQWzsiZ+2XKl5h58moW/GbybvieSnm6DDqeNQ4wBOq3jUzn8ZK9RpFtLkfhI/FibtxCL5yswFCgcNd+BbonEFYqhgPlXwirluSZnjlNbqyeQFcn+NWsq+DGGXuVuQ30He1RFl+1NRc2WtohwjpTWKvg3WjHjt1us1DUt1A7HipkACnQMB8dDuw2UQG0+a7cL2rekNPxG X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 445ff778-02fd-4599-f7f3-08da957bc79d X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:29.0599 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 11/13] avcodec/dcahuff: Replace DCAVLC by ordinary VLCs 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: NqTP7E3rDic2 This is possible now that the offsets are already applied when creating the VLC. Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_core.c | 10 +++++----- libavcodec/dcahuff.c | 13 +++++-------- libavcodec/dcahuff.h | 9 ++------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index 7b23a40df4..c204e41cb7 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -67,9 +67,9 @@ static const uint8_t block_code_nbits[7] = { 7, 10, 12, 13, 15, 17, 19 }; -static int dca_get_vlc(GetBitContext *s, DCAVLC *v, int i) +static int dca_get_vlc(GetBitContext *s, const VLC *vlc) { - return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, 2); + return get_vlc2(s, vlc->table, vlc->bits, 2); } static void get_array(GetBitContext *s, int32_t *array, int size, int n) @@ -435,7 +435,7 @@ static int parse_subframe_header(DCACoreDecoder *s, int sf, int abits; if (sel < 5) - abits = dca_get_vlc(&s->gb, &ff_dca_vlc_bit_allocation, sel); + abits = dca_get_vlc(&s->gb, &ff_dca_vlc_bit_allocation[sel]); else abits = get_bits(&s->gb, sel - 1); @@ -570,7 +570,7 @@ static inline int parse_huffman_codes(DCACoreDecoder *s, int32_t *audio, int abi // Extract Huffman codes from the bit stream for (i = 0; i < DCA_SUBBAND_SAMPLES; i++) - audio[i] = dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[abits - 1], sel); + audio[i] = dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[abits - 1][sel]); return 1; } @@ -1340,7 +1340,7 @@ static int parse_x96_subframe_header(DCACoreDecoder *s, int xch_base) for (band = s->x96_subband_start; band < s->nsubbands[ch]; band++) { // If Huffman code was used, the difference of abits was encoded if (sel < 7) - abits += dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[5 + 2 * s->x96_high_res], sel); + abits += dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[5 + 2 * s->x96_high_res][sel]); else abits = get_bits(&s->gb, 3 + s->x96_high_res); diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index a7518aded8..937a87ee05 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -768,10 +768,10 @@ const uint8_t ff_dca_vlc_src_tables[][2] = { { 4, 3 }, { 0, 3 }, { 2, 2 }, { 3, 2 }, }; -DCAVLC ff_dca_vlc_bit_allocation; +VLC ff_dca_vlc_bit_allocation[5]; VLC ff_dca_vlc_transition_mode[4]; VLC ff_dca_vlc_scale_factor[5]; -DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; +VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; VLC ff_dca_vlc_tnl_grp[5]; VLC ff_dca_vlc_tnl_scf; @@ -791,7 +791,6 @@ av_cold void ff_dca_init_vlcs(void) static VLCElem dca_table[30218]; const uint8_t (*src_table)[2] = ff_dca_vlc_src_tables; unsigned offset = 0; - int i; #define DCA_INIT_VLC(vlc, nb_bits, nb_codes, entry_offset) \ do { \ @@ -805,15 +804,13 @@ av_cold void ff_dca_init_vlcs(void) } while (0) for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { - ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) - DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], + DCA_INIT_VLC(ff_dca_vlc_quant_index[i][j], bitalloc_maxbits[i][j], ff_dca_bitalloc_sizes[i], ff_dca_bitalloc_offsets[i]); } - ff_dca_vlc_bit_allocation.max_depth = 2; - for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, 1); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_bit_allocation); i++) + DCA_INIT_VLC(ff_dca_vlc_bit_allocation[i], bitalloc_12_vlc_bits[i], 12, 1); for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_scale_factor); i++) DCA_INIT_VLC(ff_dca_vlc_scale_factor[i], DCA_SCALES_VLC_BITS, 129, -64); diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index 8663f8ba12..eaae234479 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -35,17 +35,12 @@ 3 * (5 + 7 + 9 + 13) \ + 7 * (17 + 25 + 33 + 65 + 129)) -typedef struct DCAVLC { - int max_depth; ///< Parameter for get_vlc2() - VLC vlc[7]; ///< Actual codes -} DCAVLC; - -extern DCAVLC ff_dca_vlc_bit_allocation; +extern VLC ff_dca_vlc_bit_allocation[5]; #define DCA_TMODE_VLC_BITS 3 extern VLC ff_dca_vlc_transition_mode[4]; #define DCA_SCALES_VLC_BITS 9 extern VLC ff_dca_vlc_scale_factor[5]; -extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; +extern VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; extern VLC ff_dca_vlc_tnl_grp[5]; extern VLC ff_dca_vlc_tnl_scf; From patchwork Tue Sep 13 11:33:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37894 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628535pzh; Tue, 13 Sep 2022 04:34:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7sGoJYoBbfm6w+SZBg3kQhq32uWoH4Q/OMeysovlDQ2SwiubwsCyCpl/2qlYtolyWXqfPi X-Received: by 2002:aa7:d392:0:b0:44e:67f2:c79c with SMTP id x18-20020aa7d392000000b0044e67f2c79cmr24954015edq.278.1663068893564; Tue, 13 Sep 2022 04:34:53 -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 l11-20020aa7c3cb000000b004475c9ad046si8348617edr.620.2022.09.13.04.34.53; Tue, 13 Sep 2022 04:34:53 -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=Xk10ZJqN; 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 5597168BB52; Tue, 13 Sep 2022 14:33:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A2FD768BB44 for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZbZa2GcUi2yjmWWo/AObP67+qNU5cBDk5Fqi6B0fIFQ11MaqgKUPYJws52/o0kAfJQckg8NbYhfsYaq33J5EssZXPU2J98eRVQNTyXVJNrSM/bd3eKtMHvLTZKjoBz6A2il8AYlppZxmj14lbsbxMEApTA6kM0p9YELozDP+wNzpX1U9dzxnJ2thG90cCQJHTl8aGfnqd47IX8KWSxlFQDXvo5zl4fAtzUZzBPB2Woq/T2QVmq5kK01KeukK2PrtGjJlKaBVYhyinVaGilzFe4OnalVUlERLBiIySjISFfVxqN6p61qU0Kx1LIKDyYSH6FTiso/Zu2I/8dIlqwHfkA== 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=9ET+MZqU209+L/LaL/LcObBnu9if9OudptyLq7KTHOs=; b=kHhhZk/7DgaKCg4ny2bLWQSwf2PUHdRskMZh2yWsYKmSj0gzWwajLFyHJC6OieoongroD5dZMYZ/i1FGRB/q1iPqRwMCUrqs7uFDI0wPH+agTHHZay5DsfsNcIyYMSmYvUjLMY6JKGZQSNlZHbi2KCjlbOumyYQlLcxk+m1xxkp2ZVQ74o62Ivl8GKQPpjcGeYOgshsFL+e/kRQxxh325nsZS5B5/d2rRlsvVDjCRe3jRIYfYdz7HDSnWBDSiLCSyWZNVpwvrxON5T7znTgBUHjucsOuGoXUQjWa+G29HWTXauKsIWpTVoBEFbKAy97/R4GQqntuYpwvKEXfjhteEg== 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=9ET+MZqU209+L/LaL/LcObBnu9if9OudptyLq7KTHOs=; b=Xk10ZJqNShCIrW718SZp8+I4iHRejGKYT6bKgcksdhq4emHiiH1YULSOBl9N7aLUJ6XeNw8fSpKPYU2E3j8q568feZWrYI5AOUffEUT9dRdQ23CkRHkr2kzQwFZ1O9SxA6KBHizswWQ2soyt9cTKakjvVbR9n3zJ9SZ4yr0A6tc+XWy610pXiyJj2Sn6v+5jMm5Nqotx0bxYbC/OPg/disH6Me+f2ttWml5i3zL1HUDt1U23dRrMTtyYiNFXxft+T4JmJIz5HkWi4Mnk6cJex+xhD6jULer6IXnLFQJ4Bs5F8KGjBLf8xalZuLIiz/fYuqRi5CgCvMreUshUlyfJfw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:30 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:30 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:09 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [EJoPlSfde6U6SSMIdvkIq13ql80TX3vPnJRbOsEgD8c=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-11-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: b475553c-b301-4c12-a4f8-08da957bc842 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAM74fmlrjaO0+lFo3h1oLkMK/X4iutEE/FLNOKF2mjvIPaxRvwddTmLjm5pW2dhA8RM129/XevH32H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NM7KHJ9gNPmEwdZKcoQjLDfIGO3xYDHsQakJgosRg7RtbJSuHZrww3S4OQVgNmEMT5tlLXQ6sq++ql2zCzPi26fqilzG1X9h9ksp68eEit9adeesVSQ/x0OOpEeNOs51ENRXtNJ0IzGNbPJvZ4hjzT47otlIEgFaQw1ukrRMXLQPiUHl0d4qxMom9e7FnJ1+eK2BFKPvMlfAEqtCl9UvgQ/gpnqEPzEKEy60hCodyPUwhZFPHDjFg1Qe9lFepI7MOqIfW02KA4IXvmcHCa60VjDwpMQnlBBbgzujB2ZcEBFb2GZXs5QOYLDR+gP29pBL0QlISOgLscGK4LEN9W/90qZmMxf4cVenX9uQYr7D/xBeihExzIIaWwZLSc71lMnKWy1y8F9J3bRvmlCMcnpY9JekEs5tAgxPmAmJHY48GT09/EbKgIy0dxEfKjaVtCMHKKZl6CXK2ESITx4xB8OfBufTuwzXVur/CUESrehIt/M94J0EFoD8P7nqWNXC7ZlrGXixJ9vS0PzGgto9liQBJWt0AHcRbblk0Rbo78sAZeiWVRFViGHD96YwvBopJ//VwJGmDpPeHZ1peT2bIv/Yaf7TOVpE4qeZ6mPRzp1zaE0Fu X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b475553c-b301-4c12-a4f8-08da957bc842 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:30.1703 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 12/13] avcodec/dca_lbr: Hardcode lpc table to save space 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: dx2WHoX4MRoP The code to initialize it takes more space (in .text) than the table to be initialized (namely 86B vs 64B for GCC 11.2 with -O3 in an av_cold function), so hardcode the table. Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_lbr.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index 579bd9c469..9a0eb62f06 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -119,7 +119,17 @@ static const uint16_t channel_layouts[7] = { }; static float cos_tab[256]; -static float lpc_tab[16]; +static const float lpc_tab[16] = { + /* lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))) */ + -0.995734176295034521871191178905, -0.961825643172819070408796290732, + -0.895163291355062322067016499754, -0.798017227280239503332805112796, + -0.673695643646557211712691912426, -0.526432162877355800244607799141, + -0.361241666187152948744714596184, -0.183749517816570331574408839621, + 0.0, 0.207911690817759337101742284405, + 0.406736643075800207753985990341, 0.587785252292473129168705954639, + 0.743144825477394235014697048974, 0.866025403784438646763723170753, + 0.951056516295153572116439333379, 0.994521895368273336922691944981 +}; av_cold void ff_dca_lbr_init_tables(void) { @@ -127,9 +137,6 @@ av_cold void ff_dca_lbr_init_tables(void) for (i = 0; i < 256; i++) cos_tab[i] = cos(M_PI * i / 128); - - for (i = 0; i < 16; i++) - lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))); } static int parse_lfe_24(DCALbrDecoder *s) From patchwork Tue Sep 13 11:33:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 37895 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp628608pzh; Tue, 13 Sep 2022 04:35:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7idzLshq6eO/j7xgASo4kT0PLsolGwfxlmASk9jJawhZ7ADRpcNrDid0HCaKumnTsRjrv1 X-Received: by 2002:a17:906:9c82:b0:6e1:2c94:1616 with SMTP id fj2-20020a1709069c8200b006e12c941616mr21701549ejc.64.1663068902445; Tue, 13 Sep 2022 04:35:02 -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 hd19-20020a170907969300b0076fa013dde4si10488831ejc.266.2022.09.13.04.35.02; Tue, 13 Sep 2022 04:35:02 -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=Hd91DKM4; 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 4162E68BB78; Tue, 13 Sep 2022 14:33:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067064.outbound.protection.outlook.com [40.92.67.64]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B6B5B68BB3C for ; Tue, 13 Sep 2022 14:33:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MAGJID4DNeQu4kOwVnlpVtwYhAwKFZXwFCc0XPnfPbnY5CfsCgdrR4CwhNeFV6tNohHAYB7W/BRSDwEYUPQYJlw6Vo1CisDZw3EzyWPmGKL825pfRWTylBUAgmbBbHFWcnuOtCFA78CoczkitYQ/wr4XXs7dd8Crw+FbJ4888Hi4vHt4fpfIy+7oUZR/T39C4PudILH2Fe3oSdANPriuPlmjoB8h2uRT9Az9JmvhLBUdWjUFkxhvRmEoKJvDDlQ1VeemQ+DDmvVJPN6nQ8S0LN2OC14fiEp0fC3+GnExcfWV6I6amg+/UWEzQiyVAPR4K45O++lWqN73j6MoKZpiEQ== 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=IPRem+ZBMqUz/O+WlYKoD1HuZUkYlDqMOxN3DfN/y6g=; b=AXnVaky/9tVta+8CHazpQ+mvlpkR1vMThisH4hwa2mpk/Y8Hc565pi3UGckFMsfpaycvgE3XSodLnOEiK9IIpbbRITs+RMTzskFdbaWGSUd6LADFLD91PiuQnaX8D2LMJkmzyeMngr0zEoxCZTow8b5hfyYqQpGyfyxHFYoPiLtkd76r0Nw9FlwCoDUdqkf2kQqCzolB7H7+X4SYjvMGpEbyt3JV8kjSPYHpf+qTO/ADBRaR+p6JMmSQXTOuHGOZigqV8Vkp91YRbFrnKkDVgREAsQv5e/kMlCFS/k3tEg+ndwU3pQB6EYxQ06AlXkNr+Q+aQkIlGhDN5h6l7iADXw== 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=IPRem+ZBMqUz/O+WlYKoD1HuZUkYlDqMOxN3DfN/y6g=; b=Hd91DKM4H1+QDi1gRQrPKaZdHGtoXom297cLW1JfoXi8zPv2POsu8tQG9N1NvHyA7T+luJAo1cc8JAC4TyeJRI3iBQvC0HdyY5nOpqMFuay0V6r9aiohLHAsgzoN+STP9DbWIqDiiNEoTkS7eHy/ImfAZKMrPuWXxMRqCkKgzLF/Fkk755qcoh1yoFKtzGKU+om9/m26NYGisXC/GDpW6OFqQpprN46z/7pxFyEXYrIzTsrJZt9p4UKv6b1aagjmOH3lmJjI68tjCEmasgLjPaG7nBzQISDtgR5EOZuBVS7/J2ChcUjS9yGe245rBlBINqXrqzm2Qu3HEW4Rk4zKFA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0072.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:374::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 11:33:31 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::51a4:ed23:ea45:dfeb%7]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 11:33:31 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Sep 2022 13:33:10 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [DtefW2K53v+U8EzihgB7TZICTbfMIBoHi330t6ulJpo=] X-ClientProxiedBy: AS9PR06CA0296.eurprd06.prod.outlook.com (2603:10a6:20b:45a::16) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220913113310.451876-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0072:EE_ X-MS-Office365-Filtering-Correlation-Id: 67e3babc-866a-4c41-6c24-08da957bc8dd X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpEumVcsW5Tnf3Q/Hh5f4HAoDV2G9dxVdQZuBk7aLrKQ5oVRK+JRxGsQdCynhRVU2u8ZzSmnmhPIvAjNW0qCgSlPfXFCeRM5/O/canzjI0M9p6shyK6BG+5QVGW5y/v3YOTStCJpjzDGsn9LwpKJA42dE4FTDIl9IoZydSwbbRCvI+O9H07iFn6u1jmlcYBfDy4skDQKYEUtNzoloZjJ0qLbNTVVRtg8omw8ewgt10NPFIndyYapiq7ve5Ld10eG/eDaBZ0UWQqrQBr4E7szvF/rfbI7tw2YOdrBR8HcyYGWBd9CtklZ/13hn4RdmLRHAf7qutPF5cSYZlmnVdmUVyuZm3UqehQVKilQurzm6RdfcHgyzpafATOPxb3nEgL/F06epcGvMIMF+06TpXNj/0rgy6wiW6ig5Q46E+pQfhmp6Fmfnks/0SOXymOY2jigLtV/l6HZrhCtwV+l1j+QOFm3c3wc8bIKbED75NYukAVJwLDJHhLxj/lL0ag36YKq1/AoxyWx6Yy8XNiv3ZWGUzSUdDTTjfAvtD/dSi3Ov9fcfJALnEsuj1eEjHtX6IQkA0HYJF8Tlx734sJH1tbrRt0ywUx7P2G7ArgS20Zsdx5lE8NKEAgkImc7IZnFZ+MtKWwEI9fRuQKYAZJCMoiAOaz5k1dY3SApD1mLpG4pt5zGM71SD7N8chKwtIDKXPbTYBu6nGL9sChYzdKVrvMjluJabcjYVCS8a6SDu1Q8zaxZkIHrBAYXgC32nvg1F00H0w= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: md+Qaap5IlBjjoju9XVhcZ0/z1e0jjEn2j8yNYddVfCMvhq9/At/p0co9+3dJqdklCgd9UT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wq0uXmaI4cYun3aJ+otqVb5i/m6Xt+zQbrUT2Eyv2IbsFcDqPiPzgvOYKMJWbiEBDhM5+dJpdqZLWSj7sKISB0CpeSXChrp6JKo/tVLVZdFdO8YgS4z/scUgz6HwqzjfZqkYTU5p4UaIlKGYnKjLZ9cgQ5nXNiqUgeVE8VHKqi9Nan6aJdY6AFipPIip0zu9KnVVN7cZXT0eoyN5cedXl2W6z9xoz+Su3sc0E9IiKLotsmPFxXVC/TUH0FrL/H5GVHdV5g17gbVcQWDedH+BmQ0owEGKlRYp7ckIK4Ehy7X1R+l49VvLH27naxOebmjtTicGUcd4t0Xwk9YZ+SopQBTZ1RPFLphOyua4WIzne6Cb60bnb32VTlFJh9CsZ0XE4CKCGaHaPkksLPTSnRG7HKndLpbUxpgNvXn7ReH43kBkA5cpEv7IBRa01/lwsC67XbuYkqhQpjVQ2Rx/dZa14WiPc7rDu3deGRt/1HfyVrTcb2JN9sCK4Zs6sUZZS/eXgi22/DNpJdRt8mwG9riR6p6g1yMkWwOsqWlNW2p+WUTOnrp6Ehyi95D6BDxydUnSun97mdVH6zt1/wzdmEzY3DwWNIyaxRYha1JtDAhUKhayjL1NwzaF1D4hDHaA2aakFz9wMsLsSkivdMSpYZMfYp4nkQNgmsHYZS1WgutDgCZlDM6AKxUwwRjB1yh+unITTfgoZHAbtiSsLeuAuOX8LWORWePOzi9KLvumC1ZNYqp4UVSrjyekhuag6gkR0ydxCbN+8O4WvTRD17FnLGYZVflFNTeFovFcNmO84vnccPqGnkPXtthP2XKE1mrQfecUizcAhQwSFRzToD/o7t4Gbqnqy7f6i0rLcUqOyom7Ot4CEd8LWH8rov9qIgVn18DCi+560R+NVRRAm0L9zouilLdsJ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67e3babc-866a-4c41-6c24-08da957bc8dd X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 11:33:31.1861 (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: AS8P250MB0072 Subject: [FFmpeg-devel] [PATCH 13/13] avcodec/dca_lbr: Inline nb_bits for VLCs 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: LIZwfQTtcSUx Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_lbr.c | 31 ++++++++++++++++--------------- libavcodec/dcahuff.c | 24 ++++++++++++------------ libavcodec/dcahuff.h | 11 +++++++++++ 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index 9a0eb62f06..73bc16d275 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -267,9 +267,10 @@ static int parse_lfe_chunk(DCALbrDecoder *s, LBRChunk *chunk) return AVERROR_INVALIDDATA; } -static inline int parse_vlc(GetBitContext *s, VLC *vlc, int max_depth) +static inline int parse_vlc(GetBitContext *s, const VLC *vlc, + int nb_bits, int max_depth) { - int v = get_vlc2(s, vlc->table, vlc->bits, max_depth); + int v = get_vlc2(s, vlc->table, nb_bits, max_depth); if (v >= 0) return v; // Rare value @@ -296,7 +297,7 @@ static int parse_tonal(DCALbrDecoder *s, int group) return AVERROR_INVALIDDATA; } - diff = parse_vlc(&s->gb, &ff_dca_vlc_tnl_grp[group], 2); + diff = parse_vlc(&s->gb, &ff_dca_vlc_tnl_grp[group], DCA_TNL_GRP_VLC_BITS, 2); if (diff >= FF_ARRAY_ELEMS(ff_dca_fst_amp)) { av_log(s->avctx, AV_LOG_ERROR, "Invalid tonal frequency diff\n"); return AVERROR_INVALIDDATA; @@ -314,7 +315,7 @@ static int parse_tonal(DCALbrDecoder *s, int group) // Main channel main_ch = get_bitsz(&s->gb, ch_nbits); - main_amp = parse_vlc(&s->gb, &ff_dca_vlc_tnl_scf, 2) + main_amp = parse_vlc(&s->gb, &ff_dca_vlc_tnl_scf, DCA_TNL_SCF_VLC_BITS, 2) + s->tonal_scf[ff_dca_freq_to_sb[freq >> (7 - group)]] + s->limited_range - 2; amp[main_ch] = main_amp < AMP_MAX ? main_amp : 0; @@ -325,8 +326,8 @@ static int parse_tonal(DCALbrDecoder *s, int group) if (ch == main_ch) continue; if (get_bits1(&s->gb)) { - amp[ch] = amp[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_damp, 1); - phs[ch] = phs[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_dph, 1); + amp[ch] = amp[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_damp, DCA_DAMP_VLC_BITS, 1); + phs[ch] = phs[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_dph, DCA_DPH_VLC_BITS, 1); } else { amp[ch] = 0; phs[ch] = 0; @@ -430,7 +431,7 @@ static int parse_scale_factors(DCALbrDecoder *s, uint8_t *scf) return 0; // Initial scale factor - prev = parse_vlc(&s->gb, &ff_dca_vlc_fst_rsd_amp, 2); + prev = parse_vlc(&s->gb, &ff_dca_vlc_fst_rsd_amp, DCA_FST_RSD_VLC_BITS, 2); for (sf = 0; sf < 7; sf += dist) { scf[sf] = prev; // Store previous value @@ -439,7 +440,7 @@ static int parse_scale_factors(DCALbrDecoder *s, uint8_t *scf) return 0; // Interpolation distance - dist = parse_vlc(&s->gb, &ff_dca_vlc_rsd_apprx, 1) + 1; + dist = parse_vlc(&s->gb, &ff_dca_vlc_rsd_apprx, DCA_RSD_APPRX_VLC_BITS, 1) + 1; if (dist > 7 - sf) { av_log(s->avctx, AV_LOG_ERROR, "Invalid scale factor distance\n"); return AVERROR_INVALIDDATA; @@ -449,7 +450,7 @@ static int parse_scale_factors(DCALbrDecoder *s, uint8_t *scf) return 0; // Final interpolation point - next = parse_vlc(&s->gb, &ff_dca_vlc_rsd_amp, 2); + next = parse_vlc(&s->gb, &ff_dca_vlc_rsd_amp, DCA_RSD_AMP_VLC_BITS, 2); if (next & 1) next = prev + ((next + 1) >> 1); @@ -493,7 +494,7 @@ static int parse_scale_factors(DCALbrDecoder *s, uint8_t *scf) static int parse_st_code(GetBitContext *s, int min_v) { - unsigned int v = parse_vlc(s, &ff_dca_vlc_st_grid, 2) + min_v; + unsigned int v = parse_vlc(s, &ff_dca_vlc_st_grid, DCA_ST_GRID_VLC_BITS, 2) + min_v; if (v & 1) v = 16 + (v >> 1); @@ -534,10 +535,10 @@ static int parse_grid_1_chunk(DCALbrDecoder *s, LBRChunk *chunk, int ch1, int ch // Average values for third grid for (sb = 0; sb < s->nsubbands - 4; sb++) { - s->grid_3_avg[ch1][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch1][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; if (ch1 != ch2) { if (sb + 4 < s->min_mono_subband) - s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; else s->grid_3_avg[ch2][sb] = s->grid_3_avg[ch1][sb]; } @@ -592,7 +593,7 @@ static int parse_grid_1_sec_ch(DCALbrDecoder *s, int ch2) if (sb + 4 >= s->min_mono_subband) { if (ensure_bits(&s->gb, 20)) return 0; - s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; } } @@ -613,7 +614,7 @@ static void parse_grid_3(DCALbrDecoder *s, int ch1, int ch2, int sb, int flag) for (i = 0; i < 8; i++) { if (ensure_bits(&s->gb, 20)) return; - s->grid_3_scf[ch][sb][i] = parse_vlc(&s->gb, &ff_dca_vlc_grid_3, 2) - 16; + s->grid_3_scf[ch][sb][i] = parse_vlc(&s->gb, &ff_dca_vlc_grid_3, DCA_GRID_VLC_BITS, 2) - 16; } // Flag scale factors for this subband parsed @@ -896,7 +897,7 @@ static int parse_grid_2(DCALbrDecoder *s, int ch1, int ch2, for (j = 0; j < 8; j++) { if (ensure_bits(&s->gb, 20)) break; - g2_scf[j] = parse_vlc(&s->gb, &ff_dca_vlc_grid_2, 2); + g2_scf[j] = parse_vlc(&s->gb, &ff_dca_vlc_grid_2, DCA_GRID_VLC_BITS, 2); } } else { memset(g2_scf, 0, 8); diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 937a87ee05..af3a6e5326 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -831,16 +831,16 @@ av_cold void ff_dca_init_vlcs(void) } while (0) for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_tnl_grp); i++) - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], 9, tnl_grp_sizes[i], -1); - LBR_INIT_VLC(ff_dca_vlc_tnl_scf, 9, 20, -1); - LBR_INIT_VLC(ff_dca_vlc_damp, 6, 7, -1); - LBR_INIT_VLC(ff_dca_vlc_dph, 6, 9, -1); - LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, 9, 24, -1); - LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, 5, 6, -1); - LBR_INIT_VLC(ff_dca_vlc_rsd_amp, 9, 33, -1); - LBR_INIT_VLC(ff_dca_vlc_avg_g3, 9, 18, -1); - LBR_INIT_VLC(ff_dca_vlc_st_grid, 9, 22, -1); - LBR_INIT_VLC(ff_dca_vlc_grid_2, 9, 20, -1); - LBR_INIT_VLC(ff_dca_vlc_grid_3, 9, 13, -1); - LBR_INIT_VLC(ff_dca_vlc_rsd, 6, 9, 0); + LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], DCA_TNL_GRP_VLC_BITS, tnl_grp_sizes[i], -1); + LBR_INIT_VLC(ff_dca_vlc_tnl_scf, DCA_TNL_SCF_VLC_BITS, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_damp, DCA_DAMP_VLC_BITS, 7, -1); + LBR_INIT_VLC(ff_dca_vlc_dph, DCA_DPH_VLC_BITS, 9, -1); + LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, DCA_FST_RSD_VLC_BITS, 24, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, DCA_RSD_APPRX_VLC_BITS, 6, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_amp, DCA_RSD_AMP_VLC_BITS, 33, -1); + LBR_INIT_VLC(ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 18, -1); + LBR_INIT_VLC(ff_dca_vlc_st_grid, DCA_ST_GRID_VLC_BITS, 22, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_2, DCA_GRID_VLC_BITS, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_3, DCA_GRID_VLC_BITS, 13, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd, DCA_RSD_VLC_BITS, 9, 0); } diff --git a/libavcodec/dcahuff.h b/libavcodec/dcahuff.h index eaae234479..fdfe7e922a 100644 --- a/libavcodec/dcahuff.h +++ b/libavcodec/dcahuff.h @@ -42,17 +42,28 @@ extern VLC ff_dca_vlc_transition_mode[4]; extern VLC ff_dca_vlc_scale_factor[5]; extern VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; +#define DCA_TNL_GRP_VLC_BITS 9 extern VLC ff_dca_vlc_tnl_grp[5]; +#define DCA_TNL_SCF_VLC_BITS 9 extern VLC ff_dca_vlc_tnl_scf; +#define DCA_DAMP_VLC_BITS 6 extern VLC ff_dca_vlc_damp; +#define DCA_DPH_VLC_BITS 6 extern VLC ff_dca_vlc_dph; +#define DCA_FST_RSD_VLC_BITS 9 extern VLC ff_dca_vlc_fst_rsd_amp; +#define DCA_RSD_APPRX_VLC_BITS 5 extern VLC ff_dca_vlc_rsd_apprx; +#define DCA_RSD_AMP_VLC_BITS 9 extern VLC ff_dca_vlc_rsd_amp; +#define DCA_AVG_G3_VLC_BITS 9 extern VLC ff_dca_vlc_avg_g3; +#define DCA_ST_GRID_VLC_BITS 9 extern VLC ff_dca_vlc_st_grid; +#define DCA_GRID_VLC_BITS 9 extern VLC ff_dca_vlc_grid_2; extern VLC ff_dca_vlc_grid_3; +#define DCA_RSD_VLC_BITS 6 extern VLC ff_dca_vlc_rsd; extern const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS];