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/Hh5f4HAcuXxeovkJDhq+V/jk0BlI75vtC2qUwlDTzO7kiT1T4ANJZ79byuX0YlF5AGdw039d5MOY1pBWqo/BN5JgqP68/1zXbFWewiTbemAMJWCF4Y/k1Be4eKXo+sZ1yTqSLRwWhzS4xVO6LOr/PSWP7GLJC369znkDgB9qT3i6LZ7jQiuFnXpJANnkCmK0lb+ve8oSmjD1oZuIxmLaYFW3xSgBHEenjdnBdPozU8n+gteTa+t7I+KFXnHYDJJxJP0b/G6XYQF+lFcZjtbOWBNxONVgSBDSsTxbXFpDwv2agrod15832sBWuD7KRBSVjGlkZmJAiLtoJ26d2opXezdpJiy1QtD6NN2mg1yZZLozAoI4xWBTxYoidzvXXsKWc3wkguL+RjGooS5y5uNla5gb7v5rfTn9TLKoIaz3r0MuGWQVbHdvq6BU0417yhMvJxVjlAmh6rhPRFJa8VPtdA4rs3XmzVO+bHBncU05vV9un0EHTl4hTCCJ+IoKlidZxO+tR2IVyaycYGm+fBP256eznv98bnl8yCD+6vBcjG9cweVJpuRQ/R3oSp8QGAcDDYgafqmBLmfEi36jiSwGljD/FDUlf4gLdliLmV/CA22sGmUL3R4ME7sfBwetkldIWq/ukfqwAMY0ZuD842XnffW9yJRvbDkAROehaJPen5w6iqpYjbATRAuZk2xbqML4UmsvmeNKMNCxga0P22MGILg2v0/vzivxe5z0Ui029gpKLpP1oc= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message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OZI3yWnPEkSQfA5ilE8Q0luTXAtB0OyQwRwwOrp/bAd5IhT2lh/EjMBV5u5LQ1QSBTWJq0J2r5q1Yk57cVE/S1iRPW91xFB1zSo0r8gVWGqbW90VIrte46wWJbFA6EPxXQAJKop6PS80quBBxlHabu4p8l9SbYX7YbzW76lRnml7o6nwn9VxrE7HS9aQfpxm4YKjDw3afirwZqLD/LJOqHtWwyxiUzfEi5RfvticFM0Zp8tlityTbenptYtLzwLbd2zarSzwboFMFLx+bp6AZfMvUH4eyp4nhLZOw0QAaHvbW9GxW9LNM6HcJnswZjChon+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)