From patchwork Sun Oct 23 19:34:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38918 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859178pzb; Sun, 23 Oct 2022 12:34:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM47sSb0XLkhGxQTGGp5v4tBcN92KM/ZtIrxj4NzbFdrTDk256DPBvOcbc/fh4RD0Qf+fzSk X-Received: by 2002:a17:907:7250:b0:791:9093:47f7 with SMTP id ds16-20020a170907725000b00791909347f7mr24632020ejc.278.1666553676009; Sun, 23 Oct 2022 12:34:36 -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 mc10-20020a170906eb4a00b00767e24156dbsi22647381ejb.256.2022.10.23.12.34.35; Sun, 23 Oct 2022 12:34:36 -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=SvQ1RmwR; 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 EE8E468BCA5; Sun, 23 Oct 2022 22:34:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2021.outbound.protection.outlook.com [40.92.89.21]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2BB3C68B4F7 for ; Sun, 23 Oct 2022 22:34:26 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HNpDDD0iv5Rp06GUWNNqLCOi2upvWr4J2ISi9ZEkWrg7W/X4zsrbNm2Wq7ZvlGXJXaErLG7popm1wAW2lf/eyCM+enuECK1r5eywSx3T4KsLmas4Apro5ZnNXO19dlQryCQh0hqG5R+YIOHmmFgtsUCwWLa2fpP8y4cmsItSTB7VOEwdnmN/wzqyFO9nzjVAs6NvDYZHnauJcDR2IhY1hqdpV59HlaxdliLsRXAjejWrOVM7/WlnXAvm51avwnAIwuMVcIHHCmLI5ysDwMR2LaIIIYTpuad4r6kNoDyIxFRRSLAouDxGxqu+AmRElwuVv8/uSIiUpfblsPQglMOt4A== 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=b7vYdOhZA+c0489rAvJuEDoWu8WZk0EZO+qsQ/WI9sk=; b=NvaxPaTKrh+pSXJmr+6zy/KDZJGqEY3o/14hrs36TW5WQg2q16T9hFiQ8hSitSvYdh1vVTJqfIqM1ccTN/WCDJ3G1ctjh17Mdyl8e0CHw146ctxZFMHMg39yfQJI3D8GFgs0K/9kSTeXSRqu4ijKhcmOgRZLpJCwnU7RND0onJMS00O1pnzPSbhn1WzJOJvYl3C3OW+usCkJqQtt08vQdNNY/MuIEZ5HAHR/t/x4Bi8ZRp/qSHyXDkod739YZ71Nigndy3lvirSSkSauVjeD2/sDDRi8yldqJ2pWpxVmkFs9+vxyB2nAexZxiqdc/Lm+4Mc3nVbJ98U9kAGNM4rZig== 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=b7vYdOhZA+c0489rAvJuEDoWu8WZk0EZO+qsQ/WI9sk=; b=SvQ1RmwRzraFDn11gYznVIvNqz9i8TMYUZcIhY3VhxShdRZjgHcZk9zksWwCBgD8Wo9QVEa68mERIpjny+F1xdmvv4Y/047xZ9v1skP8qC2N7mzaZ5hoqndkgTMU+Mk7A/XGg5SJxjXN+1r3yZ7B7U8JzZxBvdWHh5tOEl7lR6WYYrhDt4RpfH+Tm5isXV8C+kudqurH9FfluH6fj5rNKC/i4egovdmzDIR5M5ZQy89UreT8SPHr6/vaHry5r6chnVcpkWNuEiX/mxuLicu6c1hYJlyX5sVToqfTQNrSSnDJk69itUJtr37TUh7+5/gE1rcfFrs9Y7vXO/zlcWzIng== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:34:24 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:34:24 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:34:12 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [K0+hAkETkmu7fEdh5QrHqEKOfLg6q+gN41VkRTkt4bU=] X-ClientProxiedBy: FR0P281CA0108.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193428.673747-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 55d142ce-655b-432f-743c-08dab52d96eb X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWXMCgcuU90+Y/g0UZzHcVA8ZDzjvllmcces7LKKdfCV30hGo12m6tjh6SaW1fwYBDtaVqn0UdvYFW5u8/ngOhrfv5z2grTQjEjA0mNB7qtFPd86rQqiL0ZQDd4inVodM/Ox3hUKtncTuQJSB9oCQ2bpwfjGO0Y+4oHtQkoeLMtKvanGZdIXyuPXaDTUZHUCwZidll5El5bPCnGNVg8IxYBelrXZOUX/6U4nrcmJ7l/3iAMQWIz4fHX9Ff/nukyCQRnlRsqtNbMWYHKijpefckTC9wcgSEkptmNrnvF/KLvtZgzJrK/8RFEwrXtYrU1IFuQmU4DwylldvDVbeg8J9Ar47rz9xwdICW6q3zPwRIDcGKQoY6sJ7lfFypl+YBEwrAVEtIyNSONAo7ucEhCmdDAY6tfMavVvmeZcb1A1rkgKVpDcNy5Ls8P0lnFoSXKDKO1eaY3j9oUTQCJAG5ji+qFO/3WPNTT56NPe8oRYPATlh9K15bjKGwzkmBg0XFDBzff98sbY/Bax7XxZvwSqMyFZazKcH81ncdBQGGXyy47j+gUVbKLX7Rsa1aBh+WI4m2XoG0n3nj7YVsQ7TG4jDorp0n41Os7xpk24O6lUyr648FMkKZ3IhGKPZVIRf6xWi50UyUUwlx8u/VS0R7kUahVFi21p5I66ZLuHychWCMnthnnDNe7V8jygl20vgswYXzl1KYqOjck25V6UgoRau5PUAqa9AcTtgj93N9NgGfXmE= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antisp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41cE1SHqUS/dZVyHJ4OlkkGKDPb5gLSg0mvsS1oQmEG4oOSgckBFnYOA6bm5iESUsXO6GDvlItuUDlB/WbGBrBhttrb/N6rCuxhzeUimeAqLM5oYBTcHKMLDQNO8+1y2tuoL4HMhOI6/2vVhHilFJ82Vw8P66ZxpNFy9liTdgj6jdDlyvmInXes8KWPVx4mqvE5rmrW7Fs8pWN4n2FbNVZoX8qajnuwv5J0RWqzf4ds+cRI1mtMxyJpHpcp3TPuuJvVr4A3N7nFSHUZo5l17XCIlreAAw7bhRFF0x453lPTJvOqdoynx+tYuz+zYmqFpcLGtjW/9dHnxDkFsaWBXXesxbAQ2XPDOwDdec3QCxGrm97iSdKdPduYVqBTLJngFnPSNOa9pU40mq0FWbauo43nFD8klu0P60kFoS9qTfs0L+F82sYWFgII/4Yci3ADeRJprI2NkpTT0TJhb84H+MGIfSjjkGmsURVpJYBN5XkElkzZlxYVw3fccFSJrhUlTJEg9JKV1ISHrjNJWdFFoPL1E7TXiZsPnJtacwqnqB57e3+/tikDOoxoqg/80dKUSWKCdeqCCLyUywhOV9hHz+66y6ZZDEeLRCtE56CJIniHQJU3eD4HEcBMCuisJ4z75VEOVzff+Jh7nlv+YB6DaAIqRzkXSX+PrOIiiMRT3Wa9n8JeIs6QfHVdLrnWdKYhznfREYuLGq5pvgU3g1tMHggD4zSafO0VQka+ikzXXRmV7rGg+g2pmyz6x2OFgtL19oNoSQxcGin936G5D6VaOD/87Bd9dV9qhj0KWkzj8D1EN9xohJ4SJdTP0JgWabzM8nvtY44QvoQTneq08q0/91VF4uPGIhRuVxenSU9Q2G204f3QLdJAJFMab7zgQ5HFs9q2C3vDptjmkb4oaH7mQU45Aai8XffEVGdg63zJTRNQXSEEDESS1futS5CSZ66L8KLjlNFnn+K17hGgqW0cixkzAxcct17DB4RLwcLNoKx/mRQ6gNOqnxttz6tU0rHiF4= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55d142ce-655b-432f-743c-08dab52d96eb X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:34:23.9796 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 01/17] avcodec/mpeg12dec: Remove redundant function call 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: sIsEf+soMmyE Redundant since dcb29d37d4ffedc84e44df99f8d22ecf27e0f2cd. Signed-off-by: Andreas Rheinhardt --- It is of course only redundant if avctx->codec_tag is not allowed to change after avcodec_open2(); the corresponding option is not marked with the AV_OPT_FLAG_RUNTIME_PARAM and the above mentioned commit also relies on this, so I do, too. Btw: I wonder whether vcr2_init_sequence() should not simply be called during init. libavcodec/mpeg12dec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 56bf73df11..c942be158e 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2797,7 +2797,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, } #endif - s2->codec_tag = ff_toupper4(avctx->codec_tag); if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2") || s2->codec_tag == AV_RL32("BW10") )) From patchwork Sun Oct 23 19:35:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38919 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859719pzb; Sun, 23 Oct 2022 12:36:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qxxnY2ClcW/ejzc2VOP45Ru8e4eCVUpO58naVW9qIGxbKYpWC6645M/FCTfZG0kYDxsKC X-Received: by 2002:a17:907:2bd5:b0:76f:591c:466b with SMTP id gv21-20020a1709072bd500b0076f591c466bmr23292811ejc.504.1666553775391; Sun, 23 Oct 2022 12:36:15 -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 i5-20020a17090639c500b00781d302d5e9si21589757eje.166.2022.10.23.12.36.15; Sun, 23 Oct 2022 12:36:15 -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=FVaBXRqm; 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 2955368BCAE; Sun, 23 Oct 2022 22:36:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2080.outbound.protection.outlook.com [40.92.50.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3341468BBBC for ; Sun, 23 Oct 2022 22:36:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ln/Rd4ZW5u2bIuRm8tRoXWweBdNqFRqcrzybQshut0mnbCjgeAYYmriFqNhip3OxTXmoEGcEipCVk3S0nj3JbdTQpn9A0eJwBFzj6WLn8MxTli6CqkGOJ7Doc6fy4sy9koZrakZB/VMBD4+ypfq6jB4VXIf79hAl81B+jqdofOtd9wVlFG5KqR5DCLBXJU8+aoZhaYJapZBACpdik9UmGNKzTWWGB/RNirkiSDEyubAOohjmw+6GKfsV32a/Mfx1B9iVjigiCJGRvNU9clweH2hhbdhhSjI9159xFysWBoPi1ewIS83nHUY4hn6eNDirjtfe4LoLGBZ323ms0K3iXw== 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=xI7KSO+RAJcpKqlX7RWXixv8Clb7KAIoPuIaFsjalTs=; b=PVNF+VWmsJ6cNkMT1uYUoy5h0vJIyoIBra0dbO5lwBrZeJ6YAChCMgBBDUsNpS18Wszfe1tz6CoGKQaqoN4bX0CzoA8P/43R7gQohzFQS4hzxsunvOcql/9zyMMkTx74036rEj9KNdpTplgBp6TkPPWnLgwL3RCAPznvC4NLqmMe53Wk3MKxX/i7KgVlq9di+4fdUkS7WsIuccBEY+k3lucErMY6ZBF606gZCfBMQ/3bbd9D95F/Uw7UhOc4jlqChDDIrfhz0ZPIZTua9C7jS2nr/sJOn4OKiAqaQvBoDuxVfjHtIJlWKWUCemLgCvAMfYjqdcZMqQE2A5Rs8CazRg== 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=xI7KSO+RAJcpKqlX7RWXixv8Clb7KAIoPuIaFsjalTs=; b=FVaBXRqmmYz4yN0HP2XKPg0Vgigu6f4u5Tf5Tu4D3DKf+ctO9oz8FZOb/I8E6PomCtIyqj+zPg8WBGLvERB/6r5iC3rdnrVLfHTVqGYxdCW52Esw7qddcBl7Uk/x5onvVJuEYmiAyi+pLsn9wilTg8g7ojiop0KkNeMJlyTr06X4GFHwupZ0XJCVxEF8kcTj1bedFdFCS7NJtm4QITXyGuG5CsGqDVdJp1j1ZwDeGd/0mVpXtweEkxqtyqAd/+WUjzFDBs6UYsw947tQWG0Mv84cEM1aWWFKMBoukCpoihNtQxpanjYostHKpGgf5+NrQQwrBs//rKznI4pV1mmw7A== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:05 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:35:55 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [oI0twS3yhoATaNiOoprT1QJFakof/LAliph1prTmtzE=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 20844988-b79e-434b-bbee-08dab52dd36d X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNW2T3cUSQzMp2VmnVUesNnZabFqHxwdJq0dJd2UFzCkpF2ttd8DeQWzEpikuspurv0/X6S1e4t6vulhzyBt2wJZE6MR95ArdzYq5dFrMvvclAgJ6CVyquzPW3bDQEny+7pqObg/JoG1DfGHFN5zHiIzN3qb+Z3TA5FEOjYks7RV/nuF5tyC+DzVHKx4+m1sIGZezWG1/gEYwFr4dFCCKBEiRotvFzR7N9hdSJS0hegfMHbU6dVQdAb2kevWZSJcb6m/EBtV3J3LKEX36I1odNGLDEXFJ1HXT/nqjQwyuoZlUudfYr18BVg2f5iekfE5aUD/Zw0/wjTZ1Gd1pYB7sK8S54GdzK+DF3E3HNVh6JUrdbreoA9NFd3c+DjMWif3Q9qh6huF9MtRtIWpQE5f1TdIt7bFhJTFc1L/f8d0z8eadG2cqph1MaYjawtHzPcZeNYyfyr4AndEjNkKwI8d1ugWkFpNWj7hFEARr86L00xulnINdgMwFNFujR2448dm7OytUiPiviqWmLEcNevhtAmsffprWfDk4smSortyTjY5xArz3X0aOqvXelDMCfKZXGLQrjEmRJYMIeJEnkep3pNxdexZOPJUNfPzqE9gvYgXSk7n1UULump+ojACvEp2uR5Mm+kadekVrpH3SVv5YRQaBfsvwbE8hIU3xr5z6WjvL6r3Di+Y4iUxETS81ta9OClBmwDRaRDHcwrivuRVC06tdWx39yMyeD384aNDjqPIUI= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /iPTMInLlOyv0RTAafMn+2Jq5ijjYyf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C1SNOUt4+4RH0pcaJeOBi4j+7bbwr8KXvj7YzvQARzXNZrSSdBnHyPM3PulMY5Ftkn5pndD39XEGmctRUXnBfOXauVQmFIRs6mpsGJy7Z4yyaKugsZYPuaTZn+cdz5sf04ETyDaqzk2peB1vyNfJCYfIP2n2wc6uuePJzqiva+TEkK6wY2fOb3MfN6KxmjSt9fR8J5mhnvKQl+O6sUZ0VGiiVj12RkmnD/4DpepkwE4LHoFcLZd7MWMiKg1reidBAC0Abo+osvOWTvddMZ6QmT5HuB4JCkwaYZcyAL9h938ftOgd2vNWU9z6rEQgvv0YnqjIaybyGqyOPUV7poABNXZf+En24iQtPJCtduWeCGgBBFb5g5DiNz8VvwHJBX44RKPOK4WjrMT9B9CiBKlO2LrR4AZ96xgGvldNOf2NbM7F6Rn5Zs2igj62FRBHG72og7sAaXHu4x/v4NRQtJLig5cNXsuPdExBT0kiBUM42OlZ1sWDGJuA9/c1HPat2ZkD1jQ7URLjEHbaFetcF2WUaRR3CuFlJio0FiEkNWJz9BZkuBmFeViX1RQHud6W3l/PlAVxzf+8e/ShU1SJpwRmoIzfHGJzkhFF8KXJqUypbx78Y09DnwxRBwRcSMeJxFG35lEfgGAadIw17u0OopUoyEl8a4S0dr9PL3YSPzheOPx8bcnlXl995Rw30PIeg7MVkD4IFpx4eiMzuJq4jJYr8CtWBoj8G+NlPcfopTRYLTl5gEALOHFhZxLfRP7xlLCi08mKmTCjoKHFY+s5R5R56ad/mcLFZY6Zu5qQKsAywrDIem6ExYvo6O0HUExQJUv31e+SgDDjjCpGOVOm1QFjhtJUiEaMP+RvgIkDg6f3pEAQVXArYqUsfwV0GAEtdxqK99UlFmFV2UnMiYh+2Oi2dKvcm0R5JjQtvojrt9fI5Z51ZEypICLBENjjmasSsd8QDU81hI8JdonHRM52IAPLYiI/DE8cZcF87XaRh6eucuF X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20844988-b79e-434b-bbee-08dab52dd36d X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:05.4028 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 02/17] avformat/mux: Don't call ff_toupper4() 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: SmkvVgNu3WnZ Signed-off-by: Andreas Rheinhardt --- libavformat/mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 5d89458f82..a7517dae0a 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -148,6 +148,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) { const AVCodecTag *avctag; enum AVCodecID id = AV_CODEC_ID_NONE; + unsigned uppercase_tag = ff_toupper4(st->codecpar->codec_tag); int64_t tag = -1; /** @@ -159,7 +160,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) for (int n = 0; s->oformat->codec_tag[n]; n++) { avctag = s->oformat->codec_tag[n]; while (avctag->id != AV_CODEC_ID_NONE) { - if (ff_toupper4(avctag->tag) == ff_toupper4(st->codecpar->codec_tag)) { + if (ff_toupper4(avctag->tag) == uppercase_tag) { id = avctag->id; if (id == st->codecpar->codec_id) return 1; From patchwork Sun Oct 23 19:35:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38920 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859776pzb; Sun, 23 Oct 2022 12:36:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dANllVKB6d4Nl4ZKcRXx8y/Zf4VT5egsFPvrNBdHfWBe8cPdxhb02tEn+60GCdqiE6qWt X-Received: by 2002:a05:6402:2202:b0:461:8143:1177 with SMTP id cq2-20020a056402220200b0046181431177mr7502853edb.210.1666553783565; Sun, 23 Oct 2022 12:36:23 -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 l9-20020a1709061c4900b00787af558937si21253137ejg.313.2022.10.23.12.36.23; Sun, 23 Oct 2022 12:36:23 -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=txAWTmE9; 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 3392C68BCC8; Sun, 23 Oct 2022 22:36:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D759068BC9F for ; Sun, 23 Oct 2022 22:36:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzsver2aQHWh0DF5f6kvjIztXLEDSks8GN/B9nGCYlSWO33lhQka0Wbllml94xGfepRDHTPsv1SUhSXqqa/hNVUt4SW06OIH3ZmTQ7nULhuZFDlJACR3tgmvAnpW9+9ts3N3s0juuHjj4FlZe6KSJeIS/WtaIuaCJFA49kpFVHDJxQzRYmydlDO9/9gg4KNgV86QKj19m1U7/UHHuhMcO2M8M3EyEk3ObkV/wNM7XxZjI4K86AdbW6eCFr2wa9TSfG7X53ud1xlvGk0qr8gVxezXPK4UM/ubMjwRkVJ+ST5wsywEZQui7lGC3rnyNXNtDGFLGPyRWObxI7glpHcIiw== 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=yeOkF+fCJotPcD8B2OCpUOPmqrLmhVksTJCawc0ajUg=; b=fBwaTnfLD4xE6ihFm8Ds94mtcGbzoLdiETHb4uUojw8lVdimQKgbJQ0Issd6sZhybclsCKZK2OBSdRkxZZYLcxxfDo9uJ9YA9usPcEvqCqHZKEnNY1LRjjOL/5IG7WaYDY1o4pvzrynz6UNa21IrbcOFiNjsqZZAj9dyRm/DK5qF68KEVNrn9JAfv88975cERSW9Dc9pnJZKj8kv+huSQYyzUH2xIXEnGAc6SZWKNU2wQe/JppPRGF8h9N233Fl7tZKneoRoPabLcJFYn7G58hLEtBrUdpkliJBbthYGkT5GJMVymA77pdjRgxvayPGuZqDfbscwwR7JgcJxXSfLtA== 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=yeOkF+fCJotPcD8B2OCpUOPmqrLmhVksTJCawc0ajUg=; b=txAWTmE98+UOC1ImFZUBplAbEKj5LMOy1pomZEEPGoU0KbOToFbZwiNYB38JQBDc7UnIwU5jp2rOqnOXNbgOBtU/KLsl9NP7pWkXVidMJC7lPYRKQkl8FlF0g1APcO8DqnfwzKwZbyKlHRuXQcqjHdchDUgPWFONLm1yz5R+zpLwK15+7sA+OYWHqG4nENqHWYrPJzwz+fbuUMY32nF5J8nxryIb1/9g20HfrMx1O998z99SGM6pkdUOPACxNhxWt6MHgvWAaeNo562oVLMGFJ+XnZy+rWYDtryJijJ40ftBqah0rW3rJqJm9vSrLindgworx5or4Bugf4QpABj37g== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:12 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:35:56 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [WbkxGXY28EmfkHFhU4GDJVsF9GeyRQ1c8qn+GMNsnXg=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 426072f0-22f8-4c78-6df8-08dab52dd792 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWnLqzStyiMDq++03i1eY+xdX22ZpwVDXc3nfxQ43kFW6KO4j95IjpCajqc8r6NXPMBOKkALl5j3Hqg6ShGfJWGYHTlGrhadJRf/etnMFZwkLDLmxAeyLl/MDLc3eEFaxxhBSeLrsPihv1A6SaPqWGBZqVdSmRLlQ30lWCR3vIKETCILFFPe5VdGNCbve8cXS8UvI9r4X7oWxmLnBtSnDIA2LdtpwIuvXs3+CKlvbB6burjFO2ykeBaPO72ecAximEO7oLjov2OviPj8i3vIKhMAMu6lQv94/OegT/sQfcMWdGsaVLRUJpyMRfGQcTDYRyCP5lmBa78hQ0VQssMDXwWKgpY8dv0xfu9QIw/iw4kKg9s2eE8BJRA9KnCdHkBozbRu8IVY3ExHG+IILxb17jurDpZTIV4ytXFxG4htmyZjwgLOVGIgOi1Pg2x1GpCaXc1r2VhMXet1wRzKFxEZrBunCAleXiuDxx4FeyL98S8gSdbEGLIsPGm0geRc+KPy5myyWrd6BaJ6lupCzI4bmrVF6Xrgi1xJ/a1Xp2B2mpIYTJSjWClT8KqWX1tbjwXRlOHmfMM6VJx/lniO4LyuZCiFGq2Sko7bX+ujgHK/2sLz1F+CckpzOmiDsw5UvCNnXJ/L1h7iLbKz8LfOIt07/j4YF81isNDvvtFjRugcB5LWmW43KEyByVN4UM0Cigt3StQBMPPaq8g7vIDqLmJspN/C+6tvkR0m5amV74MZrlPGs= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rlQ3S62WYl9uJVWcHkhWWByrqi5eghQw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S9Biesf1KHPbfdHg4FPb4gFjuJCrU/X7N2gcJQkSrs4aGeM2K7tpqu3MymK+fcY+1PXgLXPLYhQVoQH/zqfnnOk9vNCo3kzJ4iCTtnL0tGAn5ue7vrAQgC0GlCv4eF8OopLZ/DRUQgGrqPaHjaz2hl6NQVxEAGecD4baPG/xLdCDpTHMZ3+wi3q13dVoyOMiPPKO0qr19b/1Ef5G+/HxWuAzDbtP5wfb4nlZgQTV8ykwsO9X3JOgr1URkzJAwbxy1/t/kdON7kFwstXH1vGAGGbq71SnLNKS2GHK5oBpgdmf4ESS0AuztNCiQax6wCDA8MvBmokzVdYi1Ndx6f940WY4UTGvyewLl43pxuQ8WIAcgMYFk+eSYlSX/8TNCd5RysdpKYrhUEEonelJYk35ucV9IopiQxbYSq6KuYLeCvfMxdwR8MyNz1CAZo8PvfJD9f+GWM+LbNT43Dsac0sfmVwM5nNL1h2jEh41Ua59o3ofAGDzb4BL0UwHZvmV5TCULMN/So4t4hXmDLcOOHPWfKYVNeEe2wILepHsPBQAiQms/ubW6yqK5ey5dFnHF9gR5uvnDWb7ygdi7EWDMr2RlCXdkgrx9VB3xrfA+MohRq0NEJ3jlwlOIxfbECctQJAAAZfknS8URlnIr7WfY5CQCEHtu9NWcvENItCYkkSUtv7bq5N5trj1QpXOFwDGa1cIJfPaesU+0VNSect+jFUbpCBaDsheXF2ytismtyaagIQi+MbSQy9c304wSSyR8nbEw5TmeGFFRJdRP/eBXQ3TT3fLmRi/l+UboelQ4nbQV4qo2vlz3RI/qebRt8Sdl6qxhrTn5I4a+hblMgpfBU4HpLS7KNtdNmhcotzO9PXd1d8zcGSRj75ZTfDS91cCR3c1wmSaa2TbO285NwUqzpMlSciwBMTI1+eJNuVedmc4rxZed4AlKVpF2apdLF2g7fvzHdZlHpg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 426072f0-22f8-4c78-6df8-08dab52dd792 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:12.3855 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 03/17] avformat/mux: Constify validate_codec_tag() 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: YrsTqvhombx6 Signed-off-by: Andreas Rheinhardt --- libavformat/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index a7517dae0a..37fe19358d 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -144,7 +144,7 @@ error: return ret; } -static int validate_codec_tag(AVFormatContext *s, AVStream *st) +static int validate_codec_tag(const AVFormatContext *s, const AVStream *st) { const AVCodecTag *avctag; enum AVCodecID id = AV_CODEC_ID_NONE; From patchwork Sun Oct 23 19:35:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38922 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859858pzb; Sun, 23 Oct 2022 12:36:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ekcqlctz3ppSVjMgQgwW19ixBs360h/gPG9JTh2ZL2+4+tIWxpRpT7OuxaG3h2WzKZtb9 X-Received: by 2002:aa7:c981:0:b0:461:522c:ce0d with SMTP id c1-20020aa7c981000000b00461522cce0dmr11796910edt.169.1666553802786; Sun, 23 Oct 2022 12:36:42 -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 u8-20020a056402064800b00458cdba7a90si21926494edx.471.2022.10.23.12.36.42; Sun, 23 Oct 2022 12:36:42 -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=nLhuPVPt; 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 6B27C68BCE7; Sun, 23 Oct 2022 22:36:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2056.outbound.protection.outlook.com [40.92.50.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D02E068BCBB for ; Sun, 23 Oct 2022 22:36:19 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTq5s/JOINfN6AmpwBI16Vt1FGNjHOoFUs/RN/vWzokqwZ/SLSfVpVyp5sr7gsWkEvpRkhRuwCj0dVrbMdOZY5YAb3aEYWKHy0BypJccMlpgR1AFVChfS5d793LpY7+A98wNTSEcGII37pNAffr+YmVCeYkoRpqcLNIcCDwTKlbKq53cMA/KyzsQyyt3j/6bh14Af7IOgyr09xKZkX9Ey3KdkEhcErZzikG8tHa492o2YZ3v9UDa/u9YuGKyXiE0Q+KrRIgBeWlC6EUlK8OSLjkKXgfgYWkCMoaQsBjg8fKSoM9Vq2Bf5GuOZGWCWEpYi2K5xh3I3sl6mdc+wj16TA== 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=SUbTclk6zDig59Klv6qBkX57JODK3gc1ZqxvwNQ9LsM=; b=ZjRBjLPNCoOQn90ivkCKQSP+2ROqwGH5pucorerv77kjLkqEVNg6//gz4apDHMK3hxI5voC9WgkiyEUzwRGut3SRG/4+pTQ9h1FLd+Z0ESirwVA1mpWg1wvEBGgxPxDSghEhOjl4nyDMHS+bZFz9lLBP9mBu/EXZSwXEYHtFfg1RNuVzcl55fgs+gKgctCWPkHDwU0rEr6KD+/3knn5yNGsHSBVKU/1EzHZmumNJYignFSwylUfNiGAE7wyjptTyNl7wQtaLBhXa9ErIHe7j2BYvGvueqfQDeehFGnSSa4gW9TPI/gbM/WJDOtK5wz8jlIsqDt4WGvABoBt2fubBcw== 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=SUbTclk6zDig59Klv6qBkX57JODK3gc1ZqxvwNQ9LsM=; b=nLhuPVPtckli9kLEY0//KKwYDXhm1aFfpdXUAJ9aCsahDlMSpnS62htmKTxXZ5obSRmT4ptFMJmqNDeJv76u1xdVkMxOoSVha65C3IxBZLq1huShLXArBfAHh5wbXT1Xh7S7L4Ne2Qx1b4NJixQ3QTTe31tTdK7FAm2/Psmd25oacncdFq7LN8gwNgD9m/5CJC+2sQmWchBEysSgIKvRQ9U/YX1BEM0uWx9JxCRwrk85Shr4qd0MFPOckiFz/AI94AVlb6EKYLerdtgHL8pYcurqa28vGi8A/hBBrqhk4thjDflzgdEcYF6UBJ2BIg+kHO2tXWrawAUsCgNR1C6w0w== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:13 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:13 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:35:57 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [u06z16Xb8VWVRs79mQBFQuzvHcth52LGkt8aWkUBQqE=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 33473d9f-81a8-4764-2b7c-08dab52dd84a X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH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TA1Z2DZds9TVaf7ygJvbcoYI96ojsYUGJY9L/zkiMWKSiutBTCpK3iuLt/5DnP8I2kCeSFH+d5JRn+Co5Nsxv+L7v5Ka2PoG77UBVQ97/bIJJz1M4N2cQIr/vpZ3d+Eg7KUPf2cQHtG+aq4TapR/1GmG6rW11zXV1g2ac9tYz9re2iPvcFEudRaH2cGzO6BfE6dSulpx97udoS9Vip5MTY5FaJpENaez/FMtBpDYmaddxJa1ULOSONZ7DfpSZxBiH5i0yOw6rvJ/YDZbVhnqPEtYqAS41e3eyaOfGp/Ulyjtpy+Xnbo+tOvuNPUsZTAJAMz0/PvvjbrPWIXrkz9vp+PmeCMr1wJe8Fk+E+zocY9dZ36OhdiACfBFnsRCTSrPFBTMhKScxbAA6NOtw/LFrYkNZrrqBwKhgrWlthaBhyp5FA2F/cBDecw4HGRjYhmIVVJ/Srjig26piU+4ILDJYF0aKceagpSU1U9NisRYX8SsDj2y7msgs1nG0GrHjW0eP/zpNEbS9lhIxzL3o+J9vCixdwJsU/slai9NvUvVkxdkX1g0lviPYW5Bv5O/nBm8UjeKlp7828SVayB2MSTFXjmUoIrs6sBt+5JwUKw3hcPJd95StdvnAsb3zN1zYVRKp7hktG6/BDZ6sGinWUvwoSfZ/PRPyF4iTqE0caS5FQ4rOsmb+/rVQnfNQwOm34gGePbdFlYguiCdzKUBHJeFr5Pdcli8oGPwJt2A= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33473d9f-81a8-4764-2b7c-08dab52dd84a X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:13.5115 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 04/17] avcodec/mpeg12: Avoid indirection when accessing rl_vlc 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: KSazjT5i/CKF Signed-off-by: Andreas Rheinhardt --- libavcodec/eamad.c | 3 +-- libavcodec/mdec.c | 3 +-- libavcodec/mpeg12.c | 19 +++++++++++-------- libavcodec/mpeg12dec.c | 28 ++++++++++++---------------- libavcodec/mpeg12vlc.h | 14 +++++++------- libavcodec/speedhqdec.c | 6 ++++-- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 2a5aac912d..20f347f0ab 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -134,7 +134,6 @@ static inline void idct_put(MadContext *t, AVFrame *frame, int16_t *block, static inline int decode_block_intra(MadContext *s, int16_t * block) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; const uint8_t *scantable = s->scantable.permutated; int16_t *quant_matrix = s->quant_matrix; @@ -148,7 +147,7 @@ static inline int decode_block_intra(MadContext *s, int16_t * block) /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index f27cf84122..7116b73b8e 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -63,7 +63,6 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) { int level, diff, i, j, run; int component; - RLTable *rl = &ff_rl_mpeg1; uint8_t * const scantable = a->scantable.permutated; const uint16_t *quant_matrix = a->quant_matrix; const int qscale = a->qscale; @@ -84,7 +83,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &a->gb); - GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &a->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index df6aba9d74..351ebf420f 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -63,7 +63,8 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -av_cold void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags) +av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], + unsigned static_size, int flags) { int i; VLCElem table[680] = { 0 }; @@ -94,9 +95,9 @@ av_cold void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags) level = rl->table_level[code]; } } - rl->rl_vlc[0][i].len = len; - rl->rl_vlc[0][i].level = level; - rl->rl_vlc[0][i].run = run; + rl_vlc[i].len = len; + rl_vlc[i].level = level; + rl_vlc[i].run = run; } } @@ -122,6 +123,9 @@ VLC ff_mb_ptype_vlc; VLC ff_mb_btype_vlc; VLC ff_mb_pat_vlc; +RL_VLC_ELEM ff_mpeg1_rl_vlc[680]; +RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; + static av_cold void mpeg12_init_vlcs(void) { INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, @@ -147,8 +151,8 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); - INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); - INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); + INIT_2D_VLC_RL(ff_rl_mpeg1, ff_mpeg1_rl_vlc, 0); + INIT_2D_VLC_RL(ff_rl_mpeg2, ff_mpeg2_rl_vlc, 0); } av_cold void ff_mpeg12_init_vlcs(void) @@ -231,7 +235,6 @@ int ff_mpeg1_decode_block_intra(GetBitContext *gb, int16_t *block, int index, int qscale) { int dc, diff, i = 0, component; - RLTable *rl = &ff_rl_mpeg1; /* DC coefficient */ component = index <= 3 ? 0 : index - 4 + 1; @@ -256,7 +259,7 @@ int ff_mpeg1_decode_block_intra(GetBitContext *gb, while (1) { int level, run, j; - GET_RL_VLC(level, run, re, gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index c942be158e..914516bbd9 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -152,7 +152,6 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix = s->inter_matrix; const int qscale = s->qscale; @@ -175,7 +174,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, } /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -241,7 +240,6 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const int qscale = s->qscale; @@ -264,7 +262,7 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -326,7 +324,6 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -358,7 +355,7 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -416,7 +413,6 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const int qscale = s->qscale; OPEN_READER(re, &s->gb); @@ -437,7 +433,7 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { i += run; @@ -489,7 +485,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, { int level, dc, diff, i, j, run; int component; - RLTable *rl; + const RL_VLC_ELEM *rl_vlc; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -512,16 +508,16 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, mismatch = block[0] ^ 1; i = 0; if (s->intra_vlc_format) - rl = &ff_rl_mpeg2; + rl_vlc = ff_mpeg2_rl_vlc; else - rl = &ff_rl_mpeg1; + rl_vlc = ff_mpeg1_rl_vlc; { OPEN_READER(re, &s->gb); /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { @@ -575,7 +571,7 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, { int level, dc, diff, i, j, run; int component; - RLTable *rl; + const RL_VLC_ELEM *rl_vlc; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -595,16 +591,16 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, block[0] = dc * (1 << (3 - s->intra_dc_precision)); i = 0; if (s->intra_vlc_format) - rl = &ff_rl_mpeg2; + rl_vlc = ff_mpeg2_rl_vlc; else - rl = &ff_rl_mpeg1; + rl_vlc = ff_mpeg1_rl_vlc; { OPEN_READER(re, &s->gb); /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); if (level >= 64 || i > 63) { diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 4fb19371f0..d0083f1124 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -50,17 +50,17 @@ extern VLC ff_mv_vlc; void ff_mpeg12_init_vlcs(void); -#define INIT_2D_VLC_RL(rl, static_size, flags)\ -{\ - static RL_VLC_ELEM rl_vlc_table[static_size];\ - rl.rl_vlc[0] = rl_vlc_table;\ - ff_init_2d_vlc_rl(&rl, static_size, flags);\ -} +#define INIT_2D_VLC_RL(rl, rl_vlc, flags)\ + ff_init_2d_vlc_rl(&rl, rl_vlc, FF_ARRAY_ELEMS(rl_vlc), flags) extern RLTable ff_rl_mpeg1; extern RLTable ff_rl_mpeg2; -void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags); +extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; +extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; + +void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], + unsigned static_size, int flags); void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index acca437bd5..7cb5ff03cc 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -77,6 +77,8 @@ static VLC dc_chroma_vlc_le; static VLC dc_alpha_run_vlc_le; static VLC dc_alpha_level_vlc_le; +static RL_VLC_ELEM speedhq_rl_vlc[674]; + static inline int decode_dc_le(GetBitContext *gb, int component) { int code, diff; @@ -154,7 +156,7 @@ static inline int decode_dct_block(const SHQContext *s, GetBitContext *gb, int l for ( ;; ) { int level, run; UPDATE_CACHE_LE(re, gb); - GET_RL_VLC(level, run, re, gb, ff_rl_speedhq.rl_vlc[0], + GET_RL_VLC(level, run, re, gb, speedhq_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; @@ -564,7 +566,7 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); - INIT_2D_VLC_RL(ff_rl_speedhq, 674, INIT_VLC_LE); + INIT_2D_VLC_RL(ff_rl_speedhq, speedhq_rl_vlc, INIT_VLC_LE); compute_alpha_vlcs(); } From patchwork Sun Oct 23 19:35:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38921 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859816pzb; Sun, 23 Oct 2022 12:36:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GQAgnDJX5V7jyirWKyUqAqvvCKBGTNTtBJ6CLUH1GoRo7/SQVKD8vN6EuZ8F7cfog58Yf X-Received: by 2002:a17:907:94c6:b0:796:f9ed:ceb3 with SMTP id dn6-20020a17090794c600b00796f9edceb3mr17429183ejc.197.1666553793065; Sun, 23 Oct 2022 12:36: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 nb3-20020a1709071c8300b007a7fc67c880si1107735ejc.71.2022.10.23.12.36.32; Sun, 23 Oct 2022 12:36: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=lm97euvr; 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 5B58468BCBB; Sun, 23 Oct 2022 22:36:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 116F168BCA4 for ; Sun, 23 Oct 2022 22:36:19 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7M/YABK5E2KB4Rq0nK7CSQm73pTlE4aC0DrNysBNTMmglg6giumnPtydT5SnkoWixMNyJNFvfCEsyM9KJxBQN9HGU4XmeWHHOU80bMVTYxTCmuloL3XU/roAoyQ0cAp1dsDJPpCheO5roQMvWQHDMb/W5V2vXVo3hmmZODTz/F2+il4PtfSBPx+To5yP12ytdwrULiBGC8NOQBs5xCxupDddUsWDIpgW33GTw9ULTOhrdil61kPizGQK0tMN21jSuCQU3C/TOFLC4CKoPbpwtS1oWL2GhOUma8RyYqLfjLfgG0EinzNXmtTCsJTI7EtngMJkIytmD4yofPMfHH5PQ== 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=AfUfaxdHq/PfQUWPp71PuLgSt2LfsawPj37R9S3a0nE=; b=G6oUKpBLKp/pAp/MuE3wLMMwoW1qlxPJlTd8IsJkbF2CzcnZt+5mdfWGpA0ni8RMjvdXnTCchOW/cEMjnusV2Od1m0BnnemgJnCmkueKqpsZq6pUlElk+Tx2ewH44Jxce7Hs+/Pd+girx5PPnBrxkFd9AJGyCUpP2KZph9Iu8Kvm//MEt8PGu7ZSkhZVz3s9BeRAmb2otkdVJfLiaEUQPOc4topLmwZL8uyEb/xHaudL3bIKSealHwUfY2F3XSnI1TeL8eYFWfkffIliIIiP1erQoNJwxm2kUsjY+8HECQpW/nPFemvXz23Cr8yjpXoV4VjH6ZHgShxPedIm7TdkvQ== 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=AfUfaxdHq/PfQUWPp71PuLgSt2LfsawPj37R9S3a0nE=; b=lm97euvrPSgdRsZTwq5fL0uP+9FB9hMS+sDQUNNCuwuezb11IoQ0BIQ2FynTN0LNgkEdrT4dSdmeVrlRDQJHoKawxm2P/YXdf8Mw/Eq+bZkrIw6yGllfiEU81vMW3mmFso4qM50LTFOJK0BMTmZEesYDXQFwBGZJkWcDUcMWrSM5qWSdItaNByJ2hUAyR6GBxPwCBsOYUkUCU3gz0qEV/6CdeEzCq2EiyvFRq4XAp2OK7PT6ii5ZOQ6iS7TqQz/HFrrHdQ84ORUVEdl2bWTWnvTCv80aXMvYaQPMIOleQHFOoZGrCHH10z8ntc12l0zw5ZvqubBqDx9UFNo6btdhhw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:14 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:35:58 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [EbGgNYBHA+di2zvnZtFepdaW3+TdtYk3Okkcj/lzip8=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 6584ceb0-f0a1-4b87-a11e-08dab52dd90d X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWuQRxhCEr/lRitinAQLkPPQP9WiNgrgow0G3W0sjVSsheRmky1F5nY50qkr1iirKlY9xWySuxn+w17a4FEDd6+7eF3fhGaxyOtjzC35X0m0RnB1Tkt0o02/gDg4s0/RkuUjJXmKJdDJx033ru5swColpcl/2PhV/KvbZaEdvgrIVaR2sMislL+nEZXF94xAP7cT2bCXwSd3Me9B7u4g7MIqmkiQIOXLC6V0irobe8Vdy7QLgrnhZTO63MX8aUEj02Hp9YBEfQsp+Q2GKcx1Bo6dWcmkWWXhxlVHouJtw+Dzc/VjSYmN30e0NYH5naadcKEBv2XEG4LiwbKrceL7LsqFE2IWHJ6uBYyK43R1SO3t4zlQJ9Ra3p34sBkkbIjwuCCmorq1JACC4eLqsQheNRa692dqJaLLXVjyjhloYpL2nk/hESR4oOnfBpO8QuY6awNMcKu25Ju/i0Xs9FGkcVmbfnbHnux/Od0MqWmvBI5k0XY67KL2vCd0v1Wa8C0sFwKR++vb4YrrAL/G/bapYqZT47uujMramJgQ7nHO8M+b4RjGZYRTY3En6OCu54T3H2VunUDadwDUWNzOAH5f6qTllrZ/5p4j4ACNu32w9F88dkYcMuWA/tB9HelXAS5LNQ5/P0FsB8dgvcNPlyEeVR3QH4KYTVxTAywWcdOfYSbzU671SEaKOeQwUfV6xTFhAE6Z076z597+A8HgHAflQsOgTujG+0n2kPEBSQ2fU23XE= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VKZsdufXBisLzzV9uGgwCHI7rwNf+wFspCj51gNFM3Q1MITbEh8Qmn9XNKew/ciqgcyc/a8EskpREFJMxjflY7ycCoUcytvO6onOyYXTuqd9BCGh8m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Q3gUjVoM8LbDBjkxRSpbyUISthHoGpQlEFTv2vDhNSJS03JBCwZYV3eDcRAcIEcCNE9uiYwL+kQ+JHMUgiRF0oqTtNKdA8LcgasepREIXnLOsGEvSH0OUJ0gyG/h/lvzAhacDcLqiat4ec0VyVneiFpRJCmFYEakctWK51nJFYGEz3DWDxIjgnoWJJXvh6MysLm7MnCmteh1dmLGCkiD/e/1RswtUGhjd2EVbGS2Fvf6djT7xEZSm6EvpwxrPCTlUIftB/4obSIrLAgFqg4OK/OdK/VC0gGSQyER83sYAoY76IOuUyKaal5Jy4KbHIUgJsflEGiBUMwLPFMA+f8i6fT4RtjpvD0iXbb+OXwfvPM7fowJ0zYCjEe1nSZOLmAs5sXceiw23onJDhwmE671LwXF/RE44JdXKiTn+NwyoO/T3vBby6rAnK/zzcKLBqo684OiwwvgVwheGfjiyAbmjMSmWQNEhIbuDY1da2zWVTcTymKSDPTNzlrnOAhxv54yBu9DAk98SFIHP39JAUxp018IV+DYCN2N9TNh55cVLQz+SPXhulIK3P8hjkuSEcwuQOUDqWQTiyrxZX9e259YeV7pW/gVX9L8xlovT7BIEBX+JuefGeMePg7deWQOc9UTQvPkDXRccyq80MQ0mJedl2lI1tG1dRPdWThsE3/wu75eGKax873JeonW4xbB8sIQmjeccVLdSFIwX6BPhJhSThpPXYQxT0dQr1DQjkmRYKIKu1JrWRrSREddjL+1LHs1VojMSdCYpV1cJKPn7am/ieT+z3BPA1OX6UbDIB/DIbklWlZZmSnmxQcr6T+/AuP77SWgGltSG+0UT8E4JVlMK39xXLhJ6slvXKJKV6YxX/KT+1RKrbDlGMtY+URo= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6584ceb0-f0a1-4b87-a11e-08dab52dd90d X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:14.7925 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 05/17] avcodec/mpeg12enc: Avoid unnecessary indirection 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: /1q8oh1Sq+6T Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12data.c | 8 ++++---- libavcodec/mpeg12enc.c | 4 ++-- libavcodec/mpeg12vlc.h | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index e301310b9f..398f70dd8a 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -64,7 +64,7 @@ const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12] = { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, }; -static const uint16_t mpeg1_vlc[113][2] = { +const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 }, { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 }, { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 }, @@ -97,7 +97,7 @@ static const uint16_t mpeg1_vlc[113][2] = { { 0x2, 2 }, /* EOB */ }; -static const uint16_t mpeg2_vlc[113][2] = { +const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, @@ -167,7 +167,7 @@ static const int8_t mpeg1_run[111] = { RLTable ff_rl_mpeg1 = { 111, 111, - mpeg1_vlc, + ff_mpeg1_vlc_table, mpeg1_run, mpeg1_level, }; @@ -175,7 +175,7 @@ RLTable ff_rl_mpeg1 = { RLTable ff_rl_mpeg2 = { 111, 111, - mpeg2_vlc, + ff_mpeg2_vlc_table, mpeg1_run, mpeg1_level, }; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index c3df924b64..5d991ac99e 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -709,7 +709,7 @@ static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n) { int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; int code, component; - const uint16_t (*table_vlc)[2] = ff_rl_mpeg1.table_vlc; + const uint16_t (*table_vlc)[2] = ff_mpeg1_vlc_table; last_index = s->block_last_index[n]; @@ -722,7 +722,7 @@ static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n) s->last_dc[component] = dc; i = 1; if (s->intra_vlc_format) - table_vlc = ff_rl_mpeg2.table_vlc; + table_vlc = ff_mpeg2_vlc_table; } else { /* encode the first coefficient: needs to be done here because * it is handled slightly differently */ diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index d0083f1124..c810697370 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -53,9 +53,14 @@ void ff_mpeg12_init_vlcs(void); #define INIT_2D_VLC_RL(rl, rl_vlc, flags)\ ff_init_2d_vlc_rl(&rl, rl_vlc, FF_ARRAY_ELEMS(rl_vlc), flags) +#define MPEG12_RL_NB_ELEMS 111 + extern RLTable ff_rl_mpeg1; extern RLTable ff_rl_mpeg2; +extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; +extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; + extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; From patchwork Sun Oct 23 19:35: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: 38923 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859901pzb; Sun, 23 Oct 2022 12:36:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6o1q8pnxzUl3wZWCBj+9F7LlMBJXqR1YaYS5I1eHPKfb6ViWBwJWn6Wslerlf5Z1ooZEl8 X-Received: by 2002:a05:6402:1906:b0:45d:db20:7709 with SMTP id e6-20020a056402190600b0045ddb207709mr26927807edz.406.1666553811856; Sun, 23 Oct 2022 12:36:51 -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 gm1-20020a1709073d0100b0073da19d0cdasi13637555ejc.973.2022.10.23.12.36.51; Sun, 23 Oct 2022 12:36:51 -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=guXFAbyG; 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 6986368BD19; Sun, 23 Oct 2022 22:36:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F6D668BCCE for ; Sun, 23 Oct 2022 22:36:24 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItB2LVa2tAjCIxfSItJiLHuxcy14OpHNkQWbj++4iI6KPHz615iQ0bk4RXasUWJKOTuzv+UtVQFSVde+6zHSc5HyEYJ/JkmusDJWIz4vHkHbIDgm+5eQCEqEfciGf04N6MfsML8wW54OWuem8zJ97zAz+pgR/N1JhfiKL4AVP/yRaE2P5lrIB4QL7aq3OWGvyUE4K4IxyYyW0gJBppezw9n4mDQQ1BudnX7TloRihWfLW/G6iL1ipZPK9VPwuNeT9gcg+qssCAH5NaqUiC+DNboVEVL7oakunnCc6kS8A1uuffQ3+a53iu0c9vC/yrZlizfC61+9CODcNquApjjadQ== 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=i0JSk8D6dwXokHOPvjqWTxhbCB2SoaSe8a7qIZTCsLs=; b=Iperll+3I94XYdmaVZC4HrSn94kwd0JML5kCzJ0TDaJCAShWM0ttckf4ZMArvuKAjPljsCOQk48Ce0UTr2u8VuqMJ7TXdpcpQ1QD2LIf8B0pDYkikgbOJkeaxLypYV4mQLTjDQd26m0P/WT1SnZwOvtw4/1T372iS3Vyz2d06cI8wvjAHD937qfrKVx53A0VjF9nhooFDsTYoUwDSgLiXnU+exKdOILul5aCqiiKZhRwQX1MBwy7BewGJ/8Zkivrd4kJtP2DQpWpkpQHubfD46cVydpm3oSKCB2h7FSdS/XSxZUBU81dZ9l5YzKT/9nRaOe1sbPxqPlVZnHsHE8iMg== 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=i0JSk8D6dwXokHOPvjqWTxhbCB2SoaSe8a7qIZTCsLs=; b=guXFAbyGCiD5CnMk/A7rZW3jXBm+wvWiG1CqnLbwS/6yt9CDhcEDf6mV7HpzjjDutM7iuQjerRpaGQSemyR5TMShuLf/GrByHj2C0NwctINO8YZmeKCli1J8HbMN1zJ3z2+vG3ZMtSg3UHQmxawDxeB0rUs7k96Ha3W4I/Ydf+/v5KccPX7b4YMVajC4yoLkUUTbMNG8nEXHu3O2SLYXyKFq+JEKEaLWhY5lf/a8bRERH1jWDRYV4b5NYhpplMIb8avcAcZ1JmG/gCNDFfeZ8QW9tqul84PJ2+kgwPiZZaSlx7k4lo84s3JEJoVkXGEfd8L4QLNpaUNh3qTHf58KUw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:15 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:35:59 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [Vu5H2cCV7TLYtFvqyPx0IcxCGTc2AzGVfi11vPic9iM=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 60e058f3-e896-4888-c3b5-08dab52dd9a8 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWuQRxhCEr/lRitinAQLkPPenG+QbZNnzCCgBZMAuTy2MSY9UAdpop3Xcf2DItg/TYXX88XgC03DJNUMXf5KICkra4sfgssBTOX2WbAVQkjyR/Q+cTwxsg5JbfFXgfHPntCGocRDMH3z41xVCwYcyTFec0pTpvjMTUZBFnj9t/bKWbojVdlowfomZ/j8TCcQGAa+PFmb+FlazBr2FtxAF7Xr7+ccpWGBWp9rTkSyhR7A+lIuFIbey1Q4ioBH2HxCXt17MmqQQ7T2z5vr4wHFYQUNkt1rZxWHq7+2gPgqVsVnNPhajb6TVv7sde8hJeT80MDqURYfIrpvEcxUU4n++VxaLs1w7RrvzHBOimTkg11Thy2gdaGDmnj0G5qMwvnv5maKDvnXdjbHQwpEBGtrgCSGCve+B1V6sgjfe89o8wxE3ujuqFY/VDhMX+6muRc2bzq8PUwm/EcwWZVPsvpcqFndfkzPUaaTzXoZEiiY3hQIdGStovmpIt5J/dXYzjcrjwYLjJUKPds18KckhAJZH45w5xr1JlhV+oG/HaJECWFTu8+iP3OFotczEE3FRYeXdai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IqtPGo05F9AnCB5mPRTP2l+vP0LDvJ4BV6RZqY8xU+c6nIcBwz8JcsjH6apflsvB/58X3DsjESJykL4I1ulAjvO8CZ6CfSY5L22cj2F424Vfdbp3FxLqNuHiy21ck96eyR0kVsB7htR6NHuLOt/wD7ECT+5iMKfPg0G0+ps= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60e058f3-e896-4888-c3b5-08dab52dd9a8 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:15.7780 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 06/17] avcodec/speedhqenc: Avoid unnecessary indirection 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: eZwe9h4fnkvM Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhq.c | 4 ++-- libavcodec/speedhq.h | 7 +++++++ libavcodec/speedhqenc.c | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index ee37573789..2d6e8ca949 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -24,7 +24,7 @@ #include "speedhq.h" /* AC codes: Very similar but not identical to MPEG-2. */ -static const uint16_t speedhq_vlc[123][2] = { +const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2] = { {0x0001, 2}, {0x0003, 3}, {0x000E, 4}, {0x0007, 5}, {0x0017, 5}, {0x0028, 6}, {0x0008, 6}, {0x006F, 7}, {0x001F, 7}, {0x00C4, 8}, {0x0044, 8}, {0x005F, 8}, @@ -101,7 +101,7 @@ static const uint8_t speedhq_run[121] = { RLTable ff_rl_speedhq = { 121, 121, - speedhq_vlc, + ff_speedhq_vlc_table, speedhq_run, speedhq_level, }; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 94879eda65..78f11ac6ab 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -21,9 +21,16 @@ #ifndef AVCODEC_SPEEDHQ_H #define AVCODEC_SPEEDHQ_H +#include #include "rl.h" #include "libavutil/attributes_internal.h" +#define SPEEDHQ_RL_NB_ELEMS 121 + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; + extern RLTable attribute_visibility_hidden ff_rl_speedhq; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_SPEEDHQ_H */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 6cf40aac2d..58b5e858a8 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -222,11 +222,11 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) if (alevel <= ff_rl_speedhq.max_level[0][run]) { code = ff_rl_speedhq.index_run[0][run] + alevel - 1; /* store the VLC & sign at once */ - put_bits_le(&s->pb, ff_rl_speedhq.table_vlc[code][1] + 1, - ff_rl_speedhq.table_vlc[code][0] + (sign << ff_rl_speedhq.table_vlc[code][1])); + put_bits_le(&s->pb, ff_speedhq_vlc_table[code][1] + 1, + ff_speedhq_vlc_table[code][0] | (sign << ff_speedhq_vlc_table[code][1])); } else { /* escape seems to be pretty rare <5% so I do not optimize it; - * the values correspond to ff_rl_speedhq.table_vlc[121] */ + * the values correspond to ff_speedhq_vlc_table[121] */ put_bits_le(&s->pb, 6, 32); /* escape: only clip in this case */ put_bits_le(&s->pb, 6, run); @@ -235,7 +235,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) last_non_zero = i; } } - /* end of block; the values correspond to ff_rl_speedhq.table_vlc[122] */ + /* end of block; the values correspond to ff_speedhq_vlc_table[122] */ put_bits_le(&s->pb, 4, 6); } From patchwork Sun Oct 23 19:36: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: 38926 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860043pzb; Sun, 23 Oct 2022 12:37:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JUCH7NWLEijTTjM/Pxse2EMi9rF8UagYezNxapbw9xyCRxgaVEDiGdBTkEuI46GyWPsHJ X-Received: by 2002:a17:907:2da6:b0:78d:3cf1:9132 with SMTP id gt38-20020a1709072da600b0078d3cf19132mr24553644ejc.299.1666553846126; Sun, 23 Oct 2022 12:37: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 d26-20020aa7d69a000000b0046157981475si5756794edr.474.2022.10.23.12.37.25; Sun, 23 Oct 2022 12:37: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="RDAsmY/v"; 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 A55E768BD48; Sun, 23 Oct 2022 22:36:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2056.outbound.protection.outlook.com [40.92.50.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14BD568BCDC for ; Sun, 23 Oct 2022 22:36:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=He5EJ45foErZCgQVzy4F57b589bgGrQliqCThFFzQ840/vTBx42GQ9Wtgyu37mZpTktTWl36UYTVj+TQtuHosKcswfZXErShfMrXU7zMQ1tHTFy5Ixywh/OYIml5nS702hzKbzXJGkIyqOt5La4djM5j60cWQBQ2eLPBkTY8rhd8EasYVt68NoJfV6sgsnrbPzaLhGxKmyFWrum64sUl4yIstZnZkzuf5JQErdlP19VXF8H2O0jblJ1vNRzl304xC3ycYMgEeWJHSClQQun5RwwxS4vExkiJwSeQBOoVhKyB9wlI0G8OPxUzQSoawZXgXzBbXduWFubTVXioqHOsWw== 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=09cWQOaxYoKKxtIQRbjahBXA7JoP5P1qFYGCvj1zXrs=; b=nW2PkNvR0juje+Oig5dZtywo+7GwpBmWY7WfgJgs90+xTopmOsZXWHt1SDYFhL0wZNV/XZSOi7K3fJ8jMogPGAdgmqPp1aKJwYsRCMI+bxaZudBSLVFVpTers1qPNjYznfFFlOALmYRX9SLx0QUkXFCPktku6yjZ/gUUmn5yf+zzJ5gONlFw256WK0LRRv8mwOyHLeW8zRfWv7Gn3JTf0su4X6qz3qU0qhUrT+ZovSLj+3OB8S8zykAQdMIE/1YpfvpS/g3LiPIOfYVk534QNFBNT7Hzayq53rMgfCfaH7mehHc1jhKp/5v1hzTSL2VQw3ewI+iWlq23TSRQDAuisg== 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=09cWQOaxYoKKxtIQRbjahBXA7JoP5P1qFYGCvj1zXrs=; b=RDAsmY/vjkbw846bRswBG5SMuBEHjVTHzcjoarIqpDrJ27yGDnr6bytDILFLI0B89/E+53s7F60ivnH/bxmGInDG1kpisGhK9GvuhUtZf4DmhvjDuFFASAZrIDDDiAPrKadiW99j+3PhLHdMCBibapThd+y7O22otinakajTAASk/RwmssTeYWI7QPA50nHxfgQtKpcqGy1XK7v+tyUAeNF5SBT9T7RuJhin6GVsCiLbvwLjurbMYZv/gdNwAxkXPlp9dnp1FOy6P/Obfr+nYhDqbyvDhYKZoCa1c6/RDT1KGawBiIb6HxO9oqTA5rn8rhZ84s3blDs534pwx4OUoA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:16 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:00 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [zhrt7Jsc1yZ/UL1lbCbFUuHlKVZBhUbaBBzYAD0BmTg=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: ff03901a-fd6c-4e7e-6314-08dab52dda3c X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNW5AUKDvh7lgh8dYE8WV2Jl0pFeoC+T+gskA3mB6SZL3YMPt8iU2Rsb10PRyt7eBe+Hp8pKO2L6/Y+kOr55mIEf8ADEEw88HJgnCKbzCulODjy35rDpW2w2+nIZx6/p4Ontws/Ov3GFHfolgqMJjcVcGyi0c0naqfRlPETjOs96SXDv5KCAGOYpZ2bXbASviCMLJ1WMPavBiuuvxmfkz7nTyYV6H5SRN98TIAND7jV9GurPP/dj14L8M3Zl0a/Q4H+6LxqoV+XATMaTvT57/TTQ5YgEdtjey0pdESDVSHEsWGef87mRy5zhj1xFrS5URhgypnxB2bToNirmknfeVzkUkEaT6/OvfjrUDNs9dGJ+vn/4CFlK3Kh7QMAfBHkOHZqe17l02PJh0qYlGtdGWxqjsgCsP1F8SBwOzSWRvvgcJdyFfTbaXXR3Vjxq7dJmazXKa3lHKjdOd5E0ANQtF/7Ib7HaiJSKn5OIh/JZV7psxqnsGIwCH/NBxPW//6xkKo6J53CmiV7JqAyQ8Qoqu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cbDqbRfON+2Svi8isrluZWlnWBIL5Arl2Tw2cQvFyAM1U7ds5X1S6xyfZC6BC19f/WdQ80JUKP18SiqTfmrLs3C3ZiyuXfCTImnyPQczHNETtl6gSsY53KwPrjxL+eMKyjv0uoo66XqJsV2UYwmKfu7ljOub/ezMzgbyaPsUAUtybwBkJ3v0dqfVHzb85w9orEgCG+QFW3Ntxv+rRBrTZTlZ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff03901a-fd6c-4e7e-6314-08dab52dda3c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:16.7767 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 07/17] avcodec/mpeg12enc: Pass tables explicitly in ff_mpeg1_init_uni_ac_vlc X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: c59byplBa5F2 This will allow to remove ff_rl_mpeg2 soon and remove all uses of RLTable in MPEG-1/2/SpeedHQ later. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12enc.c | 19 ++++++++++++------- libavcodec/mpeg12vlc.h | 3 ++- libavcodec/speedhqenc.c | 3 ++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 5d991ac99e..e0775d6b96 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -94,7 +94,10 @@ typedef struct MPEG12EncContext { #define A53_MAX_CC_COUNT 0x1f #endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ -av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len) +av_cold void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], + const uint8_t index_run[], + const uint16_t table_vlc[][2], + uint8_t uni_ac_vlc_len[]) { int i; @@ -107,16 +110,16 @@ av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len int len, code; int alevel = FFABS(level); - if (alevel > rl->max_level[0][run]) + if (alevel > max_level[run]) code = 111; /* rl->n */ else - code = rl->index_run[0][run] + alevel - 1; + code = index_run[run] + alevel - 1; if (code < 111) { /* rl->n */ /* length of VLC and sign */ - len = rl->table_vlc[code][1] + 1; + len = table_vlc[code][1] + 1; } else { - len = rl->table_vlc[111 /* rl->n */][1] + 6; + len = table_vlc[MPEG12_RL_NB_ELEMS][1] + 6; if (alevel < 128) len += 8; @@ -1078,8 +1081,10 @@ static av_cold void mpeg12_encode_init_static(void) ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]); ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]); - ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); - ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], + ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg2.max_level[0], ff_rl_mpeg2.index_run[0], + ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index c810697370..5a04834bee 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -67,6 +67,7 @@ extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], unsigned static_size, int flags); -void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); +void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], + const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); #endif /* AVCODEC_MPEG12VLC_H */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 58b5e858a8..44ee62b9c2 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -88,7 +88,8 @@ static av_cold void speedhq_init_static_data(void) speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } - ff_mpeg1_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(ff_rl_speedhq.max_level[0], ff_rl_speedhq.index_run[0], + ff_speedhq_vlc_table, uni_speedhq_ac_vlc_len); } av_cold int ff_speedhq_encode_init(MpegEncContext *s) From patchwork Sun Oct 23 19:36: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: 38924 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859933pzb; Sun, 23 Oct 2022 12:37:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4nBGaMKDGniFM9JLO+fPRZxODyK2vz7pLKmwxmLb/WXeqIsraNV6Y5qxG8wf1UmOZste+S X-Received: by 2002:a17:907:7f24:b0:78d:ee20:5c62 with SMTP id qf36-20020a1709077f2400b0078dee205c62mr24362024ejc.177.1666553820189; Sun, 23 Oct 2022 12:37:00 -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 wu13-20020a170906eecd00b0078db6f56d51si28059102ejb.808.2022.10.23.12.36.59; Sun, 23 Oct 2022 12:37:00 -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=LiCuVELe; 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 89ABB68BD06; Sun, 23 Oct 2022 22:36:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7EF6068BCCE for ; Sun, 23 Oct 2022 22:36:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUWK6xDwf1ukriyXF6ru6F9Fnd2XlfNjzXKwY3RK6nWshD64OaIeBw4Mh4/q9J5e+Rtbi5ZOoMEf2Xznq1WiPFYIEZMwOE+vlKfpXa8szrkMUfRSq3FDgW06yw9m3mlpBfsKf3Sba4rjdLEHPxdowGV9dihrXwuZ/Gwqtx5iNqnjGWpYIcbRCnI3xqVS3b94bwuPqzjIFm8tdw3L4TCs5abl79L7p28o7wVlCuUwiPrBiJzIbkRB6qG+rSYxu86IFXUEXIb+aM9bXJK0ZLnQxw6ga5M5EejIKZmClaNy9CB+OesylGTabvYw0iYHqUKRTeQfeZiYdWOvDkaDag8fng== 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=d29QLWeInvkzKYNyedrPN/Z9FwltDfY66SKZ8o242uU=; b=Nu2E9jXym759TVUcWhgJF/q9gWOdv8q6GxtbCrbCa7FqChjskr2Gt78m0090cc/DDc47F7opdOKoo4t825yGXA9H3fOabaEwbbLlLQ57cLVrfRqu33uGZYl3GGnSQB0lzEpPPl5EH+b8BbKa4S1GLWQMfSGPeiL0TjiXxOirP88jd/FduE3BdMicFUxTURTQOYB44YvhPGofE3OFHdP81DM0A6CtPmNbaaX4a9o/QYSvDTyZo4j0jmukXFGedNuhknb5dUr1Q0lKjqi6veI361BNhlKDRK7f7g9ate/NbLzF0Sm5uTsZwVRkpqgGTsoLXzIALfcOmFet+V77dCxHng== 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=d29QLWeInvkzKYNyedrPN/Z9FwltDfY66SKZ8o242uU=; b=LiCuVELeVXb0NWwDNWPitfdzsAV391HAC2rkuFqf/jMI+D6N6WTouo/z0+T3bW8WGxBLDLImxQbxgrzy7WzqbiJp73IO1I3kK7tSXxSyqFYErtqPPEYzUcAffFXGFtrJOgOkHhuCZvNdZa6AgsGLChaBxp4c/0Zhferzjsvhv8f/MiG4lzYbhYOxBiTYFP2oAsAlPeWm/pk4/z7C4CyzlWHsH5tm4gf10RKIgiWardUtApvr3dczzcETCuM0MUvIveDeg3rTfFNKRmHPAzxOqwu+Ld+TX1UDguj1lGxfneQQqpoZMxxECq1Gmdr781AqAsn94fBDKWMWQ5LZfb4ZgA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:17 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:17 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:01 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [eCz9gYPhRvfnkLMRr6tnykwk/VR1khvT4/9+45oRopk=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: fbc92ea0-61fd-4410-f97b-08dab52ddacd X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKwtuNlcRaDgURFx8jVPoKbRS+V2oO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oZD4pHZ2YB3Xg4xb9B4Mx/T1SDZLoy6Nr4r8vYE4dMO5YCz3S719Bh2pOS45h3IOfQP0qQp0edTOeTO/E/mMj4v7/Gt4I0p7LcVDuUvsl6hqFjsc1kdyZWEBs18OFoSTuSopvLboKI6u9UlGjs6tivZ9V7Bu7btyteneMWbBqDiOiQt/gr+sW6SsjBsw4uc7JPnVWcUNiEXwUusfmT54B1zQLNfjFw5YqSILaqgeOQa5xi3fGPwVBJhjuHHeongtsUED8u5FpPLpcBX71PlZuQ/CTquomihll5lynlb6s3F8283kgiyrUtvWl8L5r6HhRYMIlv4EAClXbxsO06v6BLhFLY+u7UsOs/tn0GIPb46zcPr44RKXIHcPMPWhpGtT7VDSH7fLPXCfUqPKj3NNBLFqXGZIUwmmy6a9/tCWJeFYWvwJbNoA8hObeYPUik463MYU1llqmlaEssehBUuXNGSTEN+BwNJifitLsK5BbF+lrL37HQc9m0ILTCrJawJsoMGhZJm7fE2dRurcSka45xbZQYMF6NNrFWKh3rcmBdnIj550j1XXMBu3Qo/iaLN2BhlsOqYQa/0RKaw+kBWLyXBVm17XbNRN4Xt+VP8ZxkwuPb1akeRU/WE68qNVD0Aaj6sdF5aIeI3kxmHDtl6xAwm2ciwAS/KO0V/sYibG/wfz8GwdcIibCjPXBSUwXJ5ia2f X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbc92ea0-61fd-4410-f97b-08dab52ddacd X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:17.7152 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 08/17] avcodec/mpeg12enc: Don't initialize ff_rl_mpeg2 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: d0Nln+GedYzX ff_rl_mpeg1 and ff_rl_mpeg2 differ only in RLTable.table_vlc, which ff_rl_init() does not use to initialize RLTable.max_level, RLTable.max_run and RLTable.index_run. This implies that these tables agree for ff_rl_mpeg1 and ff_rl_mpeg2; hence one can just use one of them and avoid calling ff_rl_init() ff_rl_mpeg2 alltogether. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12enc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index e0775d6b96..4d10b42bf2 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1076,14 +1076,13 @@ void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], static av_cold void mpeg12_encode_init_static(void) { - static uint8_t mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; + static uint8_t mpeg12_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; - ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]); - ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]); + ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store); ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); - ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg2.max_level[0], ff_rl_mpeg2.index_run[0], + ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ From patchwork Sun Oct 23 19:36: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: 38925 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1859965pzb; Sun, 23 Oct 2022 12:37:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nKoQIdK8Q+M9+UaPfPhDHcZ8TNtrB0Iir69SRQI8p0kbgJr7NeC4nij6qABzSu7FQdxQF X-Received: by 2002:a17:907:8690:b0:791:9f83:6872 with SMTP id qa16-20020a170907869000b007919f836872mr22911842ejc.386.1666553828435; Sun, 23 Oct 2022 12:37:08 -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 l18-20020a50c112000000b00459b3e9983esi24616330edf.113.2022.10.23.12.37.08; Sun, 23 Oct 2022 12:37:08 -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=dP6PTBrJ; 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 A2E4D68BD2D; Sun, 23 Oct 2022 22:36:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD70368BCF6 for ; Sun, 23 Oct 2022 22:36:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCAcjJRFqouPatimtHfvdUZ6RdUqJCqn5nNM1P3EUkmt5qTzqE1iakis6c4AgSgFwbO8YNxgDRf+CgNNjUPP6gcY95P7W0q8paIwEInXt8i8qLK+eLzqP45ppw2GOi3ACFgSMqme8Y1RyNr7p+AsXZgmCIJZBcoezIGH+HMreXRvZwx/bTsf1KpzPCGvcF+C1W+22t8KLinqKsrC+v2mcXkDF7698v8CLmuJKKpxMr5XP9grBRae8fHzp6IZt92aOtYBy2AVgvh8MoWVJHfE8Wto8CeBptFwjisGWRNQECD3JuHpJ89tBD819npAqBoQq4/zAHbYdLHDx6QZS+qxnQ== 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=qyvGGWi/g7SJZqeNmVm27Rr1QQVgNoryP1gpCE3zkVY=; b=AFqJtLcDy2i8IgO3U55sNu0K+d6lDXxYbmbZnhAtfgvwCF4L/Eab5eHaqKUe3Ud2EDnBrc1CJj9UBN/4qwU1EKz8CAclrGntGwCyhRbvkPC7GacReBcDCRb/PTnIugcxXLy93XLTqPsVz8H8QQJiXRMRkObsImzB+lueO5+yx2SnK5DjJsn3poKBUKXZmWvTgTeVRe6kEh6if1Mq2Dxtm6Iq8yXoAPTKVJkb+2u/SZ0emoSpF0dr+sMyRPSLUju6TxdYuf8hMqEuzFNcK+pTNNPTNqNrpiCTl5wvB0IsZwdTrYg5qKxnBq88dfNjehCwDMxOiGPBor56vvU6qIec9g== 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=qyvGGWi/g7SJZqeNmVm27Rr1QQVgNoryP1gpCE3zkVY=; b=dP6PTBrJK0SY1NH3P7cYtq4+twnJx4V2Wg3cp9uPM6gnG2r3Dq7LJnWJxe+VyxcCeEp5NaEPF0u+DdIg5W3OiGU9rsmXyLjR/6q87A1NQfFkw86O8f9XbjQLIJhTDk+9UC4VCAojrnMVAWjYQhnmpYZijTCNFmQJmPbobyuR/tUWct9ZNNqM1tHO3koJvrRlVGnUMLFhRVp91FWlaKv3FkHwhtIRwuQ5cjPumoQwZJx+S2msd71twjhByqKGvk9ywd4EJF/hhI60LjrxHJW3a95EqAuW+lSMQlhNXmwR28koKSH+RDP5TIv0w5gPr+P9kp89doYwIb086rDhSmckNw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:18 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:18 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:02 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [JHZ4WIWFBuKUGHNUKF0+Wtw1i1o2bBolFfRWMdHq99Y=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 2faef4f2-0f16-40f6-4d22-08dab52ddb6b X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWLdp293YXLPILQHc5y53W/tigsizWYkcVLxeNNJ+zEkMsc/6jHrLGZ56T8Vz0Jw2zrq/qXAtYZzRBthh2oQhcIqgYjv8PH6ZjLDITca+hsBpTkS0zD2miky7hRVWksNh9i7pz1OPtnGZ8skTW3YTHQ6FvCd8OZ1Pyav6xF9QNvysfh0rJJU2e8QM7mjS1mnnoVkXppjhTOC0B5hP1GmV0v5UbENpGoulFiu9Rgpe4x7DB7UenE1BADoj8yToa7a0af5BUyHqnnO66L61hkvjsx1WNa+XmhMYbctX0WTlXv40BXjKw7RYMvwGydxfPPyNJXsoKDLi4LOInSFlt9NkIrbvtkOAk1EIkc0jLUItK9JWfd4JoUOJkcL8KIeYJESmWNMFbFijVeW+KKk7m/jyfoNpMD6rSz0Mo3n/NQIG6G8REdhbPIw7abRsN1YDbwVW9HMZIVliEbezz5II0T58p8f5yLXyZPZBM1UpXi1bEyUNU9CfkBZLUno/lgc4JTtqATYgK4NHKu7sSPwjzrTwEYUGNy9rjjG3mBFaW5rjwuBqY5DdYB5cO85dnk7x99+pr+5EjkjPgDjgIP+DQESkYWkEUJRAN7i+o/17EFhy9j33ji3APkXtgZxaOAbxwWojqekNd6vfGmKEB/yuJv2OJpiMopmZkITNIR/T2QeThHUcFHtaZhrNEzSRblrum3O5ym11DnWpbY+VQWLP0OiOWASRO0/Y7OCZRXAgxzqgauAc= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oGKUuydDFbyBSsDisXqV8LQp5sCqvReUS7XX/8VVIY2Mscf27ne6C87vCv4mE/zJfd036XNrY6Ie/l0FoaYPZJi53vEdjTSYY/b0cnvvybYCOnlHiVTd+Eoi0vaob2nLXfiph1VsuZpJa/5ixuDJBRL9RoaxQpPpnUabQM/b6hgD5cQL9P6C6M3m85TlKtQbkY54jaaSY3sCwrVss6R3sutgtBdfz9M0D6mn4NMQY3/surR3jxEmRieXuBGOxqreUAYKm+kD0CQdocXAxxrFNEQkP8lW+2zOtmtWTWFHetQnLVBS5WidFA9iTfTyTZ7HpN0YyEiBmgNWW70LpTTts3nPYzFrlmstHN75jXAPovWdqd2w/Zqa0LVkFB/5kUwCgeFkWsLsufaavKxI65FzLmYqJF5WodW+Zzp43N7jyaWOg5b+E3euuQ78hzv9AYY32nYNob5+O1AJ0RJLvO275fsogwy6ZFnfz74rl2Vg8phFKH8czCUZ5NvFXtbkcGDxqOLa92HdfUBsnBgFQ2kJbqX8g+du7BT0rcWoscFrqs0C8y3gMRvDriBfdEm1qTqQt7Z9h3ICk8mVqTpW4rBTZkj5zeOJrQGOoS5M6FLbqd3lbKWbcVZQoz4B3YJMq1xtCd5+I/HuKueKYOlw0AApUi4+YEjOG6U+f3qsEu/UlWzcVEMFo+rlxzIGSdqMfTFX X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CLFKmfVtB7Uq9dd5MWyz+zqXH1l13ImOEc+SRBjQJePV+wQSTTZPzMIgFy9aSEsDsra3k3/Gxk+oa+62AxysNCDckJkfzSVa+eb7PRoiNRe4Nr3lj2IbDvyhVh1ZO56PxbaPHDaB7D6UTB+NrvIogczP04+vEkKZQnktpPJ7myHJObXFL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GjDFgXZRlcV/5J76lRHs5Nm4LKvwi7aVYh/X9i5PcZ/rEkKphoz45c67jdBVPM74famVpqsbj1AzNs14rJ8cxK6zwl8nR2ORS5MFk3SrKiiF/H X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2faef4f2-0f16-40f6-4d22-08dab52ddb6b X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:18.7463 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 09/17] avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl() 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: ex/1VGBzouGw This allows to exploit that ff_rl_mpeg1 and ff_rl_mpeg2 only differ in their VLC table. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12.c | 23 ++++++++++++++--------- libavcodec/mpeg12vlc.h | 8 +++----- libavcodec/speedhqdec.c | 4 +++- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 351ebf420f..282e473700 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -63,14 +63,15 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], - unsigned static_size, int flags) +av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags) { int i; VLCElem table[680] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, TEX_VLC_BITS, rl->n + 2, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); + init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -84,15 +85,15 @@ av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], run = 0; level = code; } else { - if (code == rl->n) { //esc + if (code == n) { //esc run = 65; level = 0; - } else if (code == rl->n+1) { //eob + } else if (code == n + 1) { //eob run = 0; level = 127; } else { - run = rl->table_run [code] + 1; - level = rl->table_level[code]; + run = table_run [code] + 1; + level = table_level[code]; } } rl_vlc[i].len = len; @@ -151,8 +152,12 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); - INIT_2D_VLC_RL(ff_rl_mpeg1, ff_mpeg1_rl_vlc, 0); - INIT_2D_VLC_RL(ff_rl_mpeg2, ff_mpeg2_rl_vlc, 0); + ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_rl_mpeg1.table_run, + ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + FF_ARRAY_ELEMS(ff_mpeg1_rl_vlc), 0); + ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_rl_mpeg1.table_run, + ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + FF_ARRAY_ELEMS(ff_mpeg2_rl_vlc), 0); } av_cold void ff_mpeg12_init_vlcs(void) diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 5a04834bee..dc7f0269bf 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -50,9 +50,6 @@ extern VLC ff_mv_vlc; void ff_mpeg12_init_vlcs(void); -#define INIT_2D_VLC_RL(rl, rl_vlc, flags)\ - ff_init_2d_vlc_rl(&rl, rl_vlc, FF_ARRAY_ELEMS(rl_vlc), flags) - #define MPEG12_RL_NB_ELEMS 111 extern RLTable ff_rl_mpeg1; @@ -64,8 +61,9 @@ extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; -void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], - unsigned static_size, int flags); +void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags); void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index 7cb5ff03cc..3a5b0eab05 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -566,7 +566,9 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); - INIT_2D_VLC_RL(ff_rl_speedhq, speedhq_rl_vlc, INIT_VLC_LE); + ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_rl_speedhq.table_run, + ff_rl_speedhq.table_level, ff_rl_speedhq.n, + FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); compute_alpha_vlcs(); } From patchwork Sun Oct 23 19:36: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: 38927 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860089pzb; Sun, 23 Oct 2022 12:37:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Fl3MdAv3Ew4jeQaHoZxH2F8cZQXPCM5QRx/bDt02mrItMf1bOFpmV9bhuYiwFAOgkxDTN X-Received: by 2002:a17:906:d54d:b0:78e:f130:7099 with SMTP id cr13-20020a170906d54d00b0078ef1307099mr25317401ejc.142.1666553854430; Sun, 23 Oct 2022 12:37:34 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v25-20020a50d099000000b0046194b2dd53si3334367edd.119.2022.10.23.12.37.33; Sun, 23 Oct 2022 12:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=O+5NB0qR; 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 AB6AC68BD4D; Sun, 23 Oct 2022 22:36:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2EDC368BD0F for ; Sun, 23 Oct 2022 22:36:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K69BaIjsKhY3pQuHeDgQ6nMfD7QWBwwDHaU8sCCfAq2EFAUzHmeAmfEpWjLQfQjclcRrnbP3dNJbDYgDw46hnrTyOg94waZYXWGzJeVNVc7lAM6yk4LZChlUj+yafh0vzUD/6fvuTqks6jlj2/tcZ1zl6ZdZ83gX09TsqQnzpkCn540cvGCb57Yo0B1gF5UK/qZS2oBbrzPd8Rflrh2QvShIV+xxjLH+ARGDeoGjWQF7VVtrvUxRmfWxuIBsXmF4yc7mY//XsmO9ShPWfXuH4Vgf0XsRM4JHA7DJiAtoSGN1CGhjWbkiKkiSNaswEj/pv7KIeFolZo4Vw1tsOlRfvw== 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=kN3ByPkTzfEIKrBSXozsx9lvJitaVhjl4p8dgozA3zw=; b=n/wSCkVwSNWq3HGy2V07XNVwe3IY9hD2mmnXuDvX7xz9v1DeYApVN19QSxaz2gMwJvbGIrBuuOHmLQf6Pl0I6ZQ3qhsSFSLKujf8aKgTOzfnEq54ujH/R2Ln4yYOadgebFlgDRann6UoVXcG0V5LEvKWl1FS5kZPjYrGQd4Ufa9X8LC+jt2UmSQV/pCzMzQlrOQMhSefP8DbnsvKuxQ0zSOQexBbAwKqjm3HYdamdcUH2tR19rBgr+O5yWcIWR2kkB5B+S2zIbq5HaOh6JleEJe36lziMZtCv77U5UFzMZSKFa/e8mYSQ3WMk5FHqdcnfRu/2wzITdv4Chbpoe9cdA== 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=kN3ByPkTzfEIKrBSXozsx9lvJitaVhjl4p8dgozA3zw=; b=O+5NB0qRDTYi0p2thVqWoeTVmWLo1DrZz8tLy1RQcIt8ytbiFi9ykiRE4CxjDvpcV+BOv/r7UfICc0uq4Su8jmv7KBGJinddlc9FoXZtMDH1ZcEOrup5zdlUmMOrFwonQubJXpKnJ7bC6bo1enbPMq+n7wOhZyGIqRVS69b9VFph5LdDLyiqGUfhkqYblXBsxIYoOx9fRl1w9Frpx0a9l1s7EXT2NRZ1ZQDsvD4esmeSjaqGQ97mVu1Ewlb2BM5q0HHDqkxg6qEOVeVmtcL4zatj9DyS0dXrGLcCQ/t7DqZMh6dk9MG4lLsweGUi9752OfcrrhjDGg248lRyZb2+ig== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:21 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:04 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [/+cDaFJOUGgxSJzecaZ1g0FP9mqa/uQGfxEjD489Y4Q=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-10-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: ded762a4-26ac-4d7b-3353-08dab52ddcb9 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNW9JxNd6wmOb9YnXpWN2e1nQjkfkn9RZICWwdAQTkh9OEvTz2LA/IQ54Jz7YDGWZQgxF/x0Hk0s5K0rsYY96wbfzZAyaozth7ySvSwag3VDa3MfAXiuFTUUKdXG6Ihhg4/ZAjGoqNl2YYO72atytor4axYaEjnS9QYgWNR84Z7J4GDdjgne7z8Ha2opdPcUgkeFKM5NgMDqZ5ELGXN+zDBaKr/Z9XH7rQ9Vw6DhKxandXCvlI/7sVU3DiXpX7CVeuPjCmGgxQs9DDHYElZe0kchm3zf6l57Hgp5W0NsuzWrJozY+SPkkI1wxv9TmDmLJwcM0ebgYnsAkP03MzsJCt2cB+DMXhYFhr7VPLt6YTUcGoiUf0MVSLn2JKtZOgrubcM+bj9I+uR2ToI67EDrJwyCL73Ez8YUj8rEYHaxaEx2cMe2EaAvHEprKF405JjUTdm/wKNHswkVGwfMeKojvKPgHIH0UYVSxxIMDUfuUlr5XDXCf/QiwMcreDRDEKYUM/eHi69jUtt4ap0+I+TsoSyA0MACgn+UYuqyatlfX+lSi46Vu2ihxo1fsDV+lbNdzzJ4IVd3ShizdSQNwP9d0sNtmBfqFBH3usWejiU9+2LEmNFx0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xuECmVglqCCRUhoOJukIX4WH+t96eMrh0ZDudL3UkS4ykJp3xWI3NsDSMiQTj4eKnDr/L2XjLNzgsSpvgTmDHDyNdG4bZHEhC4+Dezq7o4pxnFKRRg9Crq X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ded762a4-26ac-4d7b-3353-08dab52ddcb9 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:20.9345 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 11/17] avcodec/mpeg12: Use ff_rl_mpeg1.table_(run|level) directly 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: VFRz+2YpJH9P Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12.c | 8 ++++---- libavcodec/mpeg12data.c | 8 ++++---- libavcodec/mpeg12vlc.h | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 282e473700..b0e638bfcd 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -152,11 +152,11 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); - ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_rl_mpeg1.table_run, - ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, FF_ARRAY_ELEMS(ff_mpeg1_rl_vlc), 0); - ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_rl_mpeg1.table_run, - ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, FF_ARRAY_ELEMS(ff_mpeg2_rl_vlc), 0); } diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 5803999153..1e3410bf2f 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -130,7 +130,7 @@ const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { {0x06,4}, /* EOB */ }; -static const int8_t mpeg1_level[111] = { +const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -147,7 +147,7 @@ static const int8_t mpeg1_level[111] = { 1, 1, 1, 1, 1, 1, 1, }; -static const int8_t mpeg1_run[111] = { +const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -168,8 +168,8 @@ RLTable ff_rl_mpeg1 = { 111, 111, ff_mpeg1_vlc_table, - mpeg1_run, - mpeg1_level, + ff_mpeg12_run, + ff_mpeg12_level, }; const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 71027d468f..15275c5269 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -54,6 +54,9 @@ void ff_mpeg12_init_vlcs(void); extern RLTable ff_rl_mpeg1; +extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; +extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; + extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; From patchwork Sun Oct 23 19:36: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: 38928 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860137pzb; Sun, 23 Oct 2022 12:37:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6i4tEsh155Y3VoMtc1f6V9E5v9lg3z08R6gJzogwPajBy24lFksGRfcvMM/Oy4qRQdseXe X-Received: by 2002:aa7:c0cf:0:b0:45c:6a06:ea9a with SMTP id j15-20020aa7c0cf000000b0045c6a06ea9amr27205762edp.211.1666553861940; Sun, 23 Oct 2022 12:37:41 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y24-20020a50e618000000b0045c240cea74si22393698edm.296.2022.10.23.12.37.41; Sun, 23 Oct 2022 12:37:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=hzgJLRt6; 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 B12DB68BD4C; Sun, 23 Oct 2022 22:36:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2056.outbound.protection.outlook.com [40.92.50.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54C3C68BCDC for ; Sun, 23 Oct 2022 22:36:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4y5yBXuwmQ7cumL/5vOIVGHn3kOIwta9yBB9PWHdONN2dC+6ekhs+mCoFqeQLIoMyVLrhmOlupHaLO1cna+RdF00yjRnGmAx6N6BE7/3WjITwnKV0XSDbB0Ks8oDdjwVNQnfWQRv3VEcMWRNWP4yEbCS1uetP32yxdiHCndOFsUNtzRGok75VBQ/aFvxBliWCWkzrq2FYVC8RUcBVPT0Hr+s+hGqyokiTmzPGEGiI8gAQuGDYH3SNla3i949bkq7rIzCwZ4aJPVdRVEoWOUDqolOqhtAWJBdwS0h0fsM+a1Qi9gfbVsLXMTfh9cIIzcfiFQ9fW+naxAr2kJBogzmA== 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=QjZOOaN/db61eeLj4HLth0b/tJOyXwFgxXDX9w9D09Y=; b=oF+y44cDt1t2JZG+hIP1GMiZme9Xp9QgbNvkAkAiFum1uE9h4o+tqsvYYWCp0Ah2CkmUsxDAtHRa6WsmX/eyQnp/5J2bALEmNL8uKvkQUJNCidMDdfFbqtrwFu6vtxUfHzXW5WjVZu4Zb+A9gRFnB9cjnGohDXoRB+QP83B2/VmDrMnh40NCKD3vlGIS85ijSO+OjgUsu5q4vcsX0r/gftY4W44plwDskGzzNRvg0v5oEr16qjwmi14iybe59Wpl2zEnU+NZ7kgOMwn8H0Znsymshre7x6B0SVnL2eRDdQ7T9NKUlyrL3AQGIrNPEWgfO+3+P7lKHr/bKttChObSDg== 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=QjZOOaN/db61eeLj4HLth0b/tJOyXwFgxXDX9w9D09Y=; b=hzgJLRt6UYxAjsDGmlFpz0oClFoOPU5/S1fd9SZ/tGcdr+r1Hetw9L+p5jXbC0s7yPAtZ0p2Xbq1auNdwCJURzb+sBLvcinjykyQgfEiu02aKsad/qsvKNPaos2TifkrzWmAk+aOP+yNlz4J67HnsyhtauZYZCRqasCXI3Pap7EktCP036n/81oymvLVOYQFDtwmXj3lNCXrUoeOdOfNg5LqYf1HI3danGqiRM/M7vCQVEs75YyJFtyKndgxuhk6qFqw9ESuuEFX4Uja2L+CKjQ9labMGYYsx1QNsVXxC1vmPfuzqMinjgVoo5FnyyondXQbU5BkaHHPRkBFjKnBog== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:22 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:05 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [DRy9qRHBCLyrjwIEo+UGw8oX5Zwnr8ocgy87GqW3gyY=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-11-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 86354107-effc-4c85-148d-08dab52ddd78 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKwtuNlcRaDgURFx8jVPoKbRc63rI/AyzYHL9UyQ3jflt6w91vnbVsTBemiRCRahoHTNmD6Utgml/C0F9qaAi8lfwmPvP84QfBux3+LcJEpec9i89WOzkG/TvikKds1OBm+Twe+HgmDuct8GMeK9Hz2mPYNLGzd+J4Dp7wrjgzAnNH/ZLGhC3Og588TSGutTmEamyC8qGgX9phS6KZEbIRwYEfCjF2n3Ft07BOg0Tq8e+1FC12j7ESdiaI0KW2bhtbU7fgIW3xY9Znain4pHska0haP2xAQebr5wD/fw+QqrqGt7SBJubVfxYE+HdyyC/XAA1jazunILMzkjra2LR1Vnu0w93uu2Jf8HF3+Z8YbYiT+tiu+zQyn4imUcWTmH5t7rgHXXy3mB7Haqxq3N9LTaewT0Ar8uQlvKWW/I9Y6efV57XidaI9o7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jg+VbhDjgDuR+5m91DOWksHTxPsdZQquUYpV/k2uj7GgqUYl2CT6UJ6RClyzitHtF8aAC+R8ZW/CcAFd9HmmLp11viJVIMvahLPo9xxCYSIN/5c2P0+TkUPuyk4A/wzoUKUqvTBxS71JwXMJfEesiR2RUDuOP3UAELfBDtBVOtRsFhEXUKK1Idw2YItycf7Yp+uFA+W73uPLkLSJKMbrQkmofCRaFXjOWee1yAySsia2nJuEE3rmw0qo9a1Uwd2VVsBeeVN/awMaoCPYDmDz3sucq7MX0bEUCyR X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86354107-effc-4c85-148d-08dab52ddd78 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:22.2011 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 12/17] avcodec/speedhqdec: Use ff_rl_speedhq.table_(run|level) directly 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: 5yk0wyPAyScZ Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhq.c | 8 ++++---- libavcodec/speedhq.h | 2 ++ libavcodec/speedhqdec.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 2d6e8ca949..46ff0cfc53 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -60,7 +60,7 @@ const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2] = { {0x0006, 4} /* EOB */ }; -static const uint8_t speedhq_level[121] = { +const uint8_t ff_speedhq_level[121] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -79,7 +79,7 @@ static const uint8_t speedhq_level[121] = { 1, }; -static const uint8_t speedhq_run[121] = { +const uint8_t ff_speedhq_run[121] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -102,6 +102,6 @@ RLTable ff_rl_speedhq = { 121, 121, ff_speedhq_vlc_table, - speedhq_run, - speedhq_level, + ff_speedhq_run, + ff_speedhq_level, }; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 78f11ac6ab..8bc22ab0d7 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -28,6 +28,8 @@ #define SPEEDHQ_RL_NB_ELEMS 121 FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; +extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; extern RLTable attribute_visibility_hidden ff_rl_speedhq; diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index 3a5b0eab05..0c5942e677 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -566,8 +566,8 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); - ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_rl_speedhq.table_run, - ff_rl_speedhq.table_level, ff_rl_speedhq.n, + ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run, + ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS, FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); compute_alpha_vlcs(); From patchwork Sun Oct 23 19:36: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: 38929 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860192pzb; Sun, 23 Oct 2022 12:37:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lkY0lENDZu6Au/Wh00f/+lxPuo39xlRGQFUfEPEUSgkaupAnFH6y23bDwOdP2Hfe37kXy X-Received: by 2002:aa7:ca50:0:b0:461:9845:d9d2 with SMTP id j16-20020aa7ca50000000b004619845d9d2mr5396555edt.163.1666553870289; Sun, 23 Oct 2022 12:37:50 -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 sa28-20020a1709076d1c00b0078d42f9d0ddsi25501962ejc.477.2022.10.23.12.37.49; Sun, 23 Oct 2022 12:37:50 -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=uXjtvZOq; 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 A793168BD60; Sun, 23 Oct 2022 22:36:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E4A768BD0F for ; Sun, 23 Oct 2022 22:36:30 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aWo3A3QL1Gi3xC6Z3HyZ0Nw6Rvc9EWsDwBc2RHnycfJeIWTYHM2ZvBuDo5XspbnVQmAFP8VX8OjZ3kDJt+x1GooATWGExPd1H9hPgC65boXVJfasSoAI2ErlMPoMjLmOKe+HfcEdVsCuyELHfpYWF72EMTjzYkD0VXDf3UTjKRMHUJx84ST+d6XSO4eGR/h+E4mfGuZ769n8u97KCOjQTNWNoa8jdr+KDZ2wryIWr9jfY1U2KvrMGKsSA1ljpm4m1djB23m9N2FkAFxXGu8CDi5lXix8XWqNwFi750nP8nQvzoUcDMaQZgbSlTVGEYPDZ/S8yu+t1IDPjwnGNRlRvQ== 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=gSCaEFuskE/vYKEWszZu2YRSqg71Hi8+cu7vQcjLnFQ=; b=CcN+uZ8feg6uO41uD8Ut5yRlpYF5M9ujprQNnRxnL+eMvBilrXZgYYp3OrsTAHC9qszWXo6UXvWKhJILOOZyZ0JKRzre8vzuoYrGdXy0XMRz/LtePUt7eT3ZzVQT2PctOGYBVhgGfMEB2S54HguvSrz+33VDJ7mVYjodx1ytSP7DDm9dn9JZTbDHtvSdqmAl4Fw8bNOMHdmDoyz5lJkz+cSaRd+niQRlk3zmd4MzKRowjHF31lsDhiUUE/GBDb67NxuhswkT15lhm8a/pLsw+wMu0vGXV8Lot3RN/FZqYuon2jxwiUVyfjYo1z2ayUfRb6ecUGiYgl03LdxEtA8FDg== 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=gSCaEFuskE/vYKEWszZu2YRSqg71Hi8+cu7vQcjLnFQ=; b=uXjtvZOqgf+dKtoRshLcC3sViyNVITkiZggvc9NmVJf1+KXfsXx/JRxiUKCce09dpEar0RcHIXPjtqYW3kKWVSsj9lKmMtR6niUdxaAFBf3i4qHS6snYjzFh0uNM0wYTVv+mJTiwv/2tMrSbZusou3fBnVw+CkCPL48sjKH3uObD6TIaLuGXAFtAfhqtwXso0D9LdP2FSg1c1+EzM+XabMkm+iWOGTIZMp+wGqq6KOm2WS9Er9C1NzVJLdYXLABrUKAfpDzyqqXv0FcEM+J0r48xbBvO7q/2Su1C3UBaZEb7JSaaFXpzGDtdgx2Qi3j8TnGVNrpuAFopcinQW3FnQQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Sun, 23 Oct 2022 19:36:23 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:23 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:06 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [MQvb2F4sFNH6mCfQ6LRU9DM8Bz20neHv9wbo7Nm8LJk=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: e4ede7f6-4cfb-4702-5852-08dab52dde1a X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKwtuNlcRaDgURFx8jVPoKbRX2+VFtJ6Rhtxl9Bu+/VQMKwNebEkYNZCDURZuz1rs9Q68rToGyrQWxi/TMJD9hgPPmC1NWANB58LruIetCEUaIk2cGP9znVMG30bsPSQhCC9meKjyFIsO5jCYVMM+QADfo7d23LcYCsk/IquXYzDmXwpsSQf5CTYmLdGRQrhF1kZ9E2UrcPQ2Ngq541zg6CVPWOiBrIga5A5AKPCxlF6sh8ThDFt4G+IPwnNoxmMlfe20WBzupEY0BtwXOJphnvh2emtO8QIBzrTgETiOGILArhUkx3zO65mOYpK54EG5a/aeJqmTy/KSu8Wnvp+bfvgzWN8pBl704IyuM/bHMC6vjZ8h43WaQdxRXmqMNIs9WhzVmsGtubHmZsBE1TdkIfB2SDFHmIvV4VwSA/WPNbucxiF83M/XJXUWgFclcP5cMBGrD6+n1vG2rZuznoB10v72BLPpqPqa2g1IloeOELdyAV+68UNWTy7Akrd/QIw7ffy+nbIgNesCXC8fc1oMHKSVIFEuecOS6baDHX/fNlo67mrhyN93rzXDb+Lcgr7p0XNGmJe5x+uQaz8hwefRvLdCq0elPtdefzc3gqVihYLlGU9hmrNq/vZVU4wsUpmxTkQuRDlN7OC6WST8bjwIzEgYP8x/t5OcF8CxyXnoyUyFsFFqTK+Hj4G+0MSQAkgUKST0mRD8oSqgzhvPNpvGgmqF0PXmFJOLCc= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UHPXKytPCL6FsTr8i74VGpx3zt6lXS/wxAkDqwVR2mMN0NnZin4OAPbQFkKXmAi7Re22aBdJnosSVa9N7eE9uREAxhVPIBkeygBGn3qnY5+WZA6eg1tXqG0pYOt1AkyEh4slRnD3KGW+U1BIJykkFVwltVJcmXiJVO7hlMhEwDakv1ishuIkSw2FL40PXoT/m7egFihFYncVILr/BKGXwmMg5vlaej4RKw66Uhgz15nfhCwrY0/o33w/MyGlQNCvrczpsFyusfg0Bkj5RQXwa1eCHHnhiFZ2iqWAl4ojwdttVbWXo/+//wpuyijpOxW7JP1Oy372FXPhePdJXpiL4QBsa4j0QSoBg/bLh6Tt7wvrHanfwXxNNk4aTs2rPo1OQGp4JIC8WgzEjX0JB8SM5UV6XuHRSu/ju96v+ZOyYJgHjpnVD3b5/7IBWqNzhw3hnlr72r6cp0rKcwlKDGddz5VmwP8umLrshH25FypCv0D8dhMK0WWBDY9miUOO0SUcCzIlWpcoYCcr8jtEOWLeBEk/swy7voY1CHjC6KrmCR/IHwr7pTRwhUFmh9kd7Nrz64ICofG78KxXPKnvzLEYDY/X/sr7G3Cif5ipv6Vaznt96/kxTxvSajEdKeRM6kWK7p8nnGiy6uCSBkXKPppgRZGzFbPVi/66My8J6eKvnfAzz5S3LINXxaT+2vqb5KkJ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1jiFQsnS2N+DNxj8K8sKIxbCHvjErDeIPccRkCLmNV/vXo/dNKKmcuPR30SxENTLH8EQnSxgc+RxPQifDz8WHMPVV7UbpyKoVQHySXFrWLINWuylN/nO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wBmtNZhJj+xbX1URbzIxQXufR3b/YOGrVjc63eyhF6fCbb8wRPEHR4yfNL+MyXOEJBbXOtHMd/aW5F5CqSCWiQSg1IaJHVH4hV2NqolRgPpCYdE6zQ4WSzPMo2g25NFKjgqi2CRoPMvFdP2 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4ede7f6-4cfb-4702-5852-08dab52dde1a X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:23.2645 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 13/17] avcodec/rl: Add analogue for ff_rl_init() without RLTable 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: dT5XEok21N8O Signed-off-by: Andreas Rheinhardt --- libavcodec/rl.c | 17 +++++++++++++++++ libavcodec/rl.h | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/libavcodec/rl.c b/libavcodec/rl.c index 645a5362f7..3f8271d37e 100644 --- a/libavcodec/rl.c +++ b/libavcodec/rl.c @@ -24,6 +24,23 @@ #include "rl.h" +av_cold void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], + int n) +{ + memset(index_run, n, MAX_RUN + 1); + for (int i = 0; i < n; i++) { + int run = table_run[i]; + int level = table_level[i]; + if (index_run[run] == n) + index_run[run] = i; + if (level > max_level[run]) + max_level[run] = level; + } +} + av_cold void ff_rl_init(RLTable *rl, uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) { diff --git a/libavcodec/rl.h b/libavcodec/rl.h index 07e3da5003..4380fda272 100644 --- a/libavcodec/rl.h +++ b/libavcodec/rl.h @@ -48,6 +48,16 @@ typedef struct RLTable { RL_VLC_ELEM *rl_vlc[32]; ///< decoding only } RLTable; +/** + * Initialize max_level and index_run from table_run and table_level; + * this is equivalent to initializing RLTable.max_level[0] and + * RLTable.index_run[0] with ff_rl_init(). + */ +void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], int n); + /** * Initialize index_run, max_level and max_run from n, last, table_vlc, * table_run and table_level. From patchwork Sun Oct 23 19:36: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: 38930 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860248pzb; Sun, 23 Oct 2022 12:37:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tsZ9IdZg9qfEySs6tp15vmmWcUsqjcD6Lpl9IinNCSW5rQom/s5JMP9WImt8OFZk3z6JG X-Received: by 2002:a17:907:a05:b0:77b:b538:6476 with SMTP id bb5-20020a1709070a0500b0077bb5386476mr25006345ejc.324.1666553878429; Sun, 23 Oct 2022 12:37:58 -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 ne38-20020a1709077ba600b00788a70eed08si5860606ejc.610.2022.10.23.12.37.57; Sun, 23 Oct 2022 12:37:58 -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=OaYFpCcb; 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 927F468BD6A; Sun, 23 Oct 2022 22:36:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2086.outbound.protection.outlook.com [40.92.49.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9276568BD15 for ; Sun, 23 Oct 2022 22:36:26 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e1+3WveMFCZSEhYMX5kMTo00/0VTsPSJ602YldRV9+IBpTyV6IhZFU6ScDbyA9k2jrXXpiNYmD2kdsL/7FvDQpoGcXIOHX4ok4oKj6h0jQFqmMUETV6vWW7c3VK9+U+sYdp5wni+w6dNq4r1wDcbC0xbiLUkBrtFF80JHFTUjKmeion3qH/ZZ3OmoIz/eSOhrRXAkRnlEdB/RhI/toHzRvUXRj9n6eeKfjJ9KbYJE/eafHxkZ+uFeFvX5tqtweUNEBG2nrIn3j12WfJMfXqtwo+uUYY0/oNwyC9YFBQzIhgbjdns7qkwtPvmzbR1gyaCrDC1vOA/oUQ2pry1aiMg/g== 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=e+jVbuqiTeEAfdemNep+aOnr31ok5Q3nsThJfbCh3KU=; b=FSuq/R0NQYvfX5PLYJb7AuHAwe92oHJqzw8TSGLmFnOn9ICF8E9Ldu/gpfSrraPFXHRYb5sF3LFpH4yj1yzvCz9CvVIMWUXTiObI0iZe1MqNd3GLE9U5GFj2EjZoP2Mhv4aUnoiHmwTY/vsf5Phwk4Q8zEpyC0skoOPO+cvIj6atD8VDqT4IcRbFMHcNHlkRZQ48xVWZMNP53BnPW2tmZrfJMELu6jBcha4aSSFiZO8m4i3JCYuDg6i8OfZn4nadNiZxtouN5q5GucA4hV3+HBiuVKhaO3JEHGX72YPy9Of8Ij3kqsI13EmvaKXOBEtxh0vgxkI3o9tGOLyAtKaPDw== 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=e+jVbuqiTeEAfdemNep+aOnr31ok5Q3nsThJfbCh3KU=; b=OaYFpCcbbvhPgpUYV0yOrwhBKnzeXBGL9BA2wiN6V7O9QsahYEPd5KPnLSSZ+HcgGoef7ZfPblTraIEG6dDY5+aRpR1TIRkHUxaLXE3oWpujL0w6krLiMQcxGyCgPdC+tBfUWrvkIg58BCR+kw/gItIMnRnFJycmlQaOrU9s/j6IttlLUv3gxcQzc17l+TwbHQOkJ0ovCni74/yOrGp5BCjmjyXZFWJmo0vFdrv2VEzlp/hAMUjHTwWChY+14deCyglX7jtH0arCCEklVTSje81YaeRMu9azDDt+JuxML7wkgBRoV/RtQoBL77GRFRiWGneOUFG8QDsfJaunBKRzuw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0183.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:326::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 23 Oct 2022 19:36:24 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:24 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:07 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [ESfMy4vJjuDNO7SYlJIs226c+K5DHz44CjDhmEwtbj4=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-13-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0183:EE_ X-MS-Office365-Filtering-Correlation-Id: b3da7bf8-2943-4f3b-740c-08dab52ddebc X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNW0WFnR41Q+wgXTlwzjC7qvyoLPFJfBpRDCwDgFy/Gyqb+1+UFe/lDM+GZoDmbis1aWnRueyweyHSt4L744jTvdXvZEq6jYchhFQF3cqq8geckCvCMB4DFCdTrwFq1Se9c5ci1Zr676I4wCKvpajTaz3CpaW4qcamGy/a3KiqPyzoA8WqE+iN+cRe5dAdJa0HSbAg6alxtDxv4yod9Hh5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v/9KBUPGkGaCWhBOaLIvRWDcx084GMgVxfMlwZVwevDQ9chScvbzvcTGPirfdiQh0ikSf9dAzl4IH53DkOQTeyaWOwyhDqODKSKbXYfEX+LFbrOLLp5dJxW+5O1E/XkjYHma5oKZYdXDI4WvKdItjCKAONKTODDEOeCqhs86+s8z263O1Pb3wq96IoK6dh+5zn3ggZ8CCRZAhkyjpMnpLEvhlFZhQDhghXHsKfwrHgZTGWK2OhoBTo8HS1gT6S2jp77xNWLQ7a7Lzv8Hc1U8YpSluDM0BBq5NOJncngYZ/rT0jNIrKFiOy3/L3VMa9xUv1VvYUGZ+NEnRjOuBl+kc+c3vJdQMO10Xxomwi2Q2creUy3Q+nmjYpPGv6ePSEQ0gj14ETLDoloSEatxgErz1XVCVKKG0DqJboy4NWmP0WxH3FM2zoxZxXqcmdrik7vnhF0dnzYQKFPKP/8W2CP7MwysmS3COgH7phlEzczRfgagfqwTX4jwpGP1rutqzuSf8TKFGuPGzv X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3da7bf8-2943-4f3b-740c-08dab52ddebc X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:24.3436 (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: AM8P250MB0183 Subject: [FFmpeg-devel] [PATCH 14/17] avcodec/mpeg12enc: Don't initialize unused parts of RLTable 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: xfVGfZRZ0ahd ff_rl_init() initializes RLTable.(max_level|max_run|index_run); max_run is unused by the MPEG-1/2 encoders (as well as SpeedHQ). Furthermore, it initializes these things twice (for two passes), but the second half of this is never used. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12enc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 4d10b42bf2..2db1d93d0e 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -49,6 +49,7 @@ #include "mpegvideodata.h" #include "mpegvideoenc.h" #include "profiles.h" +#include "rl.h" #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER static const uint8_t svcd_scan_offset_placeholder[] = { @@ -62,6 +63,9 @@ static uint8_t fcode_tab[MAX_MV * 2 + 1]; static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2]; static uint8_t uni_mpeg2_ac_vlc_len[64 * 64 * 2]; +static uint8_t mpeg12_max_level[MAX_LEVEL + 1]; +static uint8_t mpeg12_index_run[MAX_RUN + 1]; + /* simple include everything table for dc, first byte is bits * number next 3 are code */ static uint32_t mpeg1_lum_dc_uni[512]; @@ -757,8 +761,8 @@ next_coef: MASK_ABS(sign, alevel); sign &= 1; - if (alevel <= ff_rl_mpeg1.max_level[0][run]) { - code = ff_rl_mpeg1.index_run[0][run] + alevel - 1; + if (alevel <= mpeg12_max_level[run]) { + code = mpeg12_index_run[run] + alevel - 1; /* store the VLC & sign at once */ put_bits(&s->pb, table_vlc[code][1] + 1, (table_vlc[code][0] << 1) + sign); @@ -1076,13 +1080,12 @@ void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], static av_cold void mpeg12_encode_init_static(void) { - static uint8_t mpeg12_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; - - ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store); + ff_rl_init_level_run(mpeg12_max_level, mpeg12_index_run, + ff_mpeg12_run, ff_mpeg12_level, MPEG12_RL_NB_ELEMS); - ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], + ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); - ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], + ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ From patchwork Sun Oct 23 19:36: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: 38931 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860299pzb; Sun, 23 Oct 2022 12:38:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77E4z3Syd+Aw3axCXv5o3lNbU+5hJ2XNA+ukIOplfO75yEKm4HiH26tcV4ruTrcjsZfuQA X-Received: by 2002:a17:906:9bca:b0:78d:bc5a:9137 with SMTP id de10-20020a1709069bca00b0078dbc5a9137mr25832566ejc.25.1666553887706; Sun, 23 Oct 2022 12:38:07 -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 qw20-20020a1709066a1400b0078dad5e8d65si22777037ejc.68.2022.10.23.12.38.06; Sun, 23 Oct 2022 12:38:07 -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=OxdYnNlF; 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 86FC568BD78; Sun, 23 Oct 2022 22:36:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2086.outbound.protection.outlook.com [40.92.49.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BC9F268BD15 for ; Sun, 23 Oct 2022 22:36:31 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+7y58MmXRKNfY1a6sV7/dQ+U6VKbMkAVqSMhX0YNwWYVp/bv+b8+QGbxbAxwIMPnIVngMVmAktsarnfVZdaRRNfs57dcCdOxSXNfLC63I9w7sa3HqeSRBNvpciI2nM4c6I1xljkDXHVrf/btKPUSWx0xs+KPhPNp0VhRxoUpIXQD5KlJVlfnEW7pxTPxEQK+jsbjX6WH04UYBPAmeDKSDHhuSwKF0uens0+TBRmr+WZkRqbdC8wvi2Jwd2UqFpsUmYV/T0FrCDeZcyRhktzzz0JQdVVDI67HtdBX3WgXPtn4mj8qOlmOTLlcwfNMjNdhYKn3UIcb6R7+SvMO5xAxA== 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=52CG2XJVeVw2dFV/GFj/o+8c7kH7zDc/xwEo5PXxGhw=; b=GBh4pr9WKguyTHAEw8hR8uIEzxitGyLySPBl9a79Qb84mhfP25Sd0xW+E0SfwXmhj/X01K9FuKRrawvFAVa+/RX+/Jy5TTV2NiMsg8Z/RmlTjy+VtzWDyx3SDx5Ww/E11u3HnvvWgyDPx593yUjd+dOHgkDquFcnCriIMaI//2YVFFPxzSccY/z3xoaweR7IOGFvq4RXZ2tOVfGcjy3HxuwJspsPSeWBbH8sURCqN0mz+u9COvPI93aUUvoGjejSkrqeef2+pTqBNlYJgHgqhKiBs/WbzRaE12BgXMoi9KoSz5vMYp179I+z/wHIo8IfRPP2AnHJCaC7BM0UdVJe2A== 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=52CG2XJVeVw2dFV/GFj/o+8c7kH7zDc/xwEo5PXxGhw=; b=OxdYnNlFe4JCaAP3ydfFgNdPTKO/pQgE4AL06vqozlebSApKwUvCiYN2ZYCcEMqxi8e/RpyHGWzhOjCSyAXfYI4dbPf7kOBesbENvmz49Ywe3Wgoc2xs7XZV6LMqmAE6ddtD0mF8ag8N3wG0Q0Bg8A++yVmda83rXgQiACFLUezwak886dSX/tJZhGnpbdhdg+jWaJfafGO7ort5LKruXEuwEiV1anzsyLL5siVrmCx1PODr2KwbyMKQASg5+xePpyJopfDBvthr9MsI5glouQr6yyNCfkdCmVvtYYDCNZ16ZZV+ORu1Tc0RTWmxx/J0uTEasZvEAHa6YN6jb+2kVA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0183.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:326::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 23 Oct 2022 19:36:25 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:25 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:08 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [EUDaI7Qu+4tJ/n7rdSNfosYZTfc9EaEnkekKQrcAKtw=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-14-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0183:EE_ X-MS-Office365-Filtering-Correlation-Id: 61982535-f57c-4ad3-8129-08dab52ddf5c X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKwtuNlcRaDgURFx8jVPoKbRQ8tdqtjxRumv5sVb/J1/vgKTtIQNJnxKjm5PNFfxLxrCMSBmsA9RxcWELzvkblK1q2VNyN4K8kXk3DLPwx2ypY9gUpSGUDEjErN90w404FjX+ckgPloLeJLoyBqQ9T2NmwRZiOdgrAiNINhxS9Tv6TBearzZIt3M/eMWQo2OSk9GQKLt1CsAaryVp97gUnb2/T5gYgfEHTvPWaNMcJqr3R7eT2vZ+DRYD518eEQ/ngA3R3gB0W9TaTuVZvFKZtv9nR6YcbA1LhVRSmvuRCNJ+bT6RidH4QVY0co8FyNr4wo4mdaNbR80cmpDCB/uqb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TIQY0ohowmPujYMBDFGqS648omTLczR+5iIWjdKmt0rm1nhb2C77ePlIsp608fXkVttBejBN9APtDhemo0n6+64htF8YOXb5tB34EMh1o6Y1pywsXUCwIeiWsRuInf7wTI6vxq37ibsUzI9lVXOUlsZqhiltKwnDi+TP+oS7CGdUE0oI0uXQFhi6CPBiVHhySejBnFyNrC9BfyCzpZS1HfyiVqDz+0hredzDiY1m2pesBBx7iR6j4Qbhk+KG3tREJahzkVHTgn3ujY4/CAMD9UXNXU25OqRLQgUTdRydYInobl+XWbvicPWhVK91npgW6Q5NqP23oTRZrC3zEy+kPvv9l4OTdgswR0FldGRXginA5hMaI2b7ltT/0jxAExYs7jtChnPGm5 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61982535-f57c-4ad3-8129-08dab52ddf5c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:25.3602 (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: AM8P250MB0183 Subject: [FFmpeg-devel] [PATCH 15/17] avcodec/mpeg12data: Remove ff_rl_mpeg1 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: Gi2QbiC+0R8F No longer used anywhere. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12.c | 1 + libavcodec/mpeg12data.c | 8 -------- libavcodec/mpeg12vlc.h | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index b0e638bfcd..5d5f39388f 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -37,6 +37,7 @@ #include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12dec.h" +#include "rl.h" #include "startcode.h" static const uint8_t table_mb_ptype[7][2] = { diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 1e3410bf2f..a55fa463a4 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -164,14 +164,6 @@ const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS] = { 25, 26, 27, 28, 29, 30, 31, }; -RLTable ff_rl_mpeg1 = { - 111, - 111, - ff_mpeg1_vlc_table, - ff_mpeg12_run, - ff_mpeg12_level, -}; - const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { {0x1, 1}, {0x3, 3}, diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 15275c5269..3ed35968f6 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -28,7 +28,6 @@ #ifndef AVCODEC_MPEG12VLC_H #define AVCODEC_MPEG12VLC_H -#include "rl.h" #include "vlc.h" #define DC_VLC_BITS 9 @@ -52,8 +51,6 @@ void ff_mpeg12_init_vlcs(void); #define MPEG12_RL_NB_ELEMS 111 -extern RLTable ff_rl_mpeg1; - extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; From patchwork Sun Oct 23 19:36: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: 38932 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860349pzb; Sun, 23 Oct 2022 12:38:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40aada7pN5uvvNBheXn2Cxl4LmLHjBT5Xju26Zs3g8L3ZzdQCGplu8zVnzfylf05RMMFHk X-Received: by 2002:a17:907:7606:b0:78e:61d:757e with SMTP id jx6-20020a170907760600b0078e061d757emr23201023ejc.690.1666553895899; Sun, 23 Oct 2022 12:38:15 -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 fj3-20020a1709069c8300b007919c624eadsi18111763ejc.522.2022.10.23.12.38.15; Sun, 23 Oct 2022 12:38:15 -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=oFPX0fRL; 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 7CE9568BD7D; Sun, 23 Oct 2022 22:36:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2086.outbound.protection.outlook.com [40.92.49.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D20D468BD21 for ; Sun, 23 Oct 2022 22:36:31 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tr7QfPO+nDxYVQm6QNmq0YcrxDKruoDUKZHBBpva3D48VhNX2RfGu8ExlVHNmwCXQUvHVHJEvHVVS/KdsT/6oea/9v73NFRARnj28+56jqhGWuI8S/AnzG6cXJ1dUERYf1I4Dastgwxx5+1GBQzXIKkK6g1an9CmoFrkzPjbmCFRx8MgrUOqm8WyNWNNaddjyITipVu9XF3GUAyxCmsnzx1/c6TY62ccJnT2gHlH19LqBzctDD4GkPHINad7xFo9XZTc+aJIqNxThVLGpdjFTvG0j/BUchLOhU/yl+a1MTR4FaxBeDrhd5bCAsu2b4qOBmvuA5cUuwsf0bURtB39Bw== 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=ziz7JgZeCQFl5s+QGmddl5xBlOgmFmlTvs0fdUHSNYk=; b=Elh7OL9rx1CGeb8sitr1QlxRgg7KtWXOEm8/vt4e2hSgaRgBU2wBQ7kmPr8cHVGItMvxrUmIjj4DP8sGxqqPZtkiuYidZWEkNWOWBsMPyIH/TsUwgATENOd5IVyceTM5xEvkpEg1ZYcHef9R8Kma1ggnRxlTL+NPYtHAlG7qqCxBLvQmvwacY9BiyO1CgTBXUG5YbJNIYsiZMrkC74GZpH0DDM/KIWQse19w/fIsqCkNK+z/R7TRNWPK3jwBjk7noxPkdvTAJxuasKVjksaX09LUdjy9cfVwVAt2S/tm/tnM4QYzSDIaCV2dwmc1qipJJLeiohPOkaUdgVl+RIYTvg== 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=ziz7JgZeCQFl5s+QGmddl5xBlOgmFmlTvs0fdUHSNYk=; b=oFPX0fRLTDSVy4vmJkxjOSSvFkJDD8GN1797BKHqIOQvmtCD5lVZWfl9xWV1J/6qtUVm6nGDgFAj/mSFAw2W8mL8qoDIR5+B7JVm80w2wlpcCkvZioETALu/Bllb3Ne7awv8R6diHcH5Oi/yIAGd1iGE3YzIzRa1Ldg7fMLm2lL1piK5PTaaSWYkE7ndQk11FYnBYjkLSUQl67CoqBOZ1Ucq8cumadKepXONlZilP0LGeH40+Os6yW9T5iBPSFTF+3CsSkaY9+pVlB899qgZyTKJ28QQToS5ctfvlUKgB3gFmqdn8YdTOP82pn07BNHz8nXDxWUDWoyZHBM80y6MmA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0183.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:326::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 23 Oct 2022 19:36:26 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:09 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [1UwHrSo0rKZlWl83QFyZ1RLUT/T+CNoR2GfmlbyDjZ8=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-15-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0183:EE_ X-MS-Office365-Filtering-Correlation-Id: 2da2f7be-cc81-4244-7f87-08dab52ddff2 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTvCD95yRBwuz22R5J7O19WuG+rH8KOHu0XoEQvX6pJ3vb16mdmPKAfSwwEeNKnAyz0nS86rvRtZKI/4HdvnJzEhQJQeNTiAPh9eK/iVz4GmPc/hHaRA1tzXRp+aE9UsUeqE1uBPfg6tmJ4y+syfIqF8iJH1aqShksC+hEzQ4ba9FNfEI/bhd44DdAouJuFUNsV2suHzzvNbJ82Uuuc6MmhEqwR3ZRwcJ/Y3dXG3a/O+KyMhVSAe9UFpMh8RlqI0a1gLTyCsVTbKHyt4qGdoMN+xnjvzsMXcylbvNUHDBmAmNq40qHAzMQ/71E6LNEzs8yTkwl2esexxMI1fKs8A+zgMxhf5J7539R7/QcFhwwDrUZrhNW9LHo4pCftpEVkHem3E1XOcMg1lzhS6bZ5JICVddSQGxVCyz4zz27JFLwKe4/ks3U4Duq6EtTtQ1W+3MUIXKAQzF77NMma0WhDGo/RwXiRzrTmyMkW7usfaKBEQPet0x6qFZOXr87yylgsoa3eHO6ijFXHmoq4gT39iOhQeH2oI6Y3GdSDL6l+NXzySpFVOtTRTnaq6/zl02BSidIWl0m6kj/cs5ejb6QIdn+RxEAb7/yxwso5pyRouskerq56BH7VEjFlkGcknueu1BjcA8VscMMZrxJW2jLHHzj+q3T/EcXGwNaWcHtK8C0QEDLHi4l/2oaW4jRjVrOH8q3aFlr9gp1L60wrlGMlp2mNQ/2cDkNFUvS96LSWT/R0qlr6bH/1Zo4WU= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NYWSZydmadi5twNuJ6h0EITZ40Yvu5uTgPuNPHWt8Vq8TymaQEccKS90zg/xR6QMZ3psdwnn8GBTPDUeFHaw+z9T8gltWkcVPcN72I4TMiACCZRO46moM9hOQT/44A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GNFI/ErD8myoz6Bw28hl8YrsIOH0sBNW/lMLT4gK6y+FtzcrdkF4XWyFqZRGChElvevZpOYOxM4m+Hc6ss2vFx3dXOebIcmwQ9ikkWbCAnIMpElLXHoB1ZxmC1MIBwqmtfMluJZ4h2oX+Jm9QRQPz+jJlt0shp6F7N4SOAzmAQi3mndyJ8I3mFFdzaueTHvMkcWxhmJeNI7V1BuwZrUdB3Q9RY9SKaBxiMIFwrYMcARozxSSmthT+7aXChXJFPBlmK11c1sGuOwNZmRBbRxx8DcOgjkG9CJtmBxLfatrQ9RjZPp9viQ1PkWucO7Vwc96bYYvOkw+QPcQhedT9549sk2/KGIXYfq0oO57dbCggsjNdjunT654BIytJN22C0LwFJl0l7wMrNRekPsJAnLFPM9RoUW5eZhfXfJPE0yy3600bhF+ljWz9g3xFcPXSOEhYSvgcaUs6KIwfIboelazX41fvlY4h1IXe1cy8gZ3zX4GlCmBeNJ0f8ULqBOnWWmjZlDbxJUHhjbLKZ+dr7QTErOTLC2nGMHc0ReOYIO+CJXrLFQxfVib4tw3nziAgAumcsJ7mroYF0t/8TDrbjI+4MBEiXPp29goxp8j8DucSFMHfn3hs8JGTWLTcAWvMUdR8LkvKfDIEA+dX/fssHmLDqMBJqUl/cuiSt5+1KVNYv3eRNQBcOWKAaUKCpstIWak806efpP64NccyC92T7UniWtI8NmMNCIlo9gb9weK6CcTejvjG4N/Wr/mLiY8KD1FfqaaHWXRELX+/rr7U5MUO/3NumNWeOwcm5ME4JiG+79Y6HLuhipTQZRVvrOgIvaQv/w6cdwSQSqqGMnVuupUvXnCGvPv8qeo5jqtyHHiNP2YFMumIo61J2Hcv66REdjAzSf X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2da2f7be-cc81-4244-7f87-08dab52ddff2 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:26.3588 (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: AM8P250MB0183 Subject: [FFmpeg-devel] [PATCH 16/17] avcodec/speedhqenc: Don't initialize unused parts of RLTable 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: zc1JQ+piWQ7r ff_rl_init() initializes RLTable.(max_level|max_run|index_run); max_run is unused by the SpeedHQ encoder (as well as MPEG-1/2). Furthermore, it initializes these things twice (for two passes), but the second half of this is never used. Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhqenc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 44ee62b9c2..65e66afae4 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -36,10 +36,12 @@ #include "mpegvideo.h" #include "mpegvideodata.h" #include "mpegvideoenc.h" +#include "rl.h" #include "speedhq.h" #include "speedhqenc.h" -static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; +static uint8_t speedhq_max_level[MAX_LEVEL + 1]; +static uint8_t speedhq_index_run[MAX_RUN + 1]; /* Exactly the same as MPEG-2, except little-endian. */ static const uint16_t mpeg12_vlc_dc_lum_code_reversed[12] = { @@ -64,7 +66,8 @@ typedef struct SpeedHQEncContext { static av_cold void speedhq_init_static_data(void) { - ff_rl_init(&ff_rl_speedhq, speedhq_static_rl_table_store); + ff_rl_init_level_run(speedhq_max_level, speedhq_index_run, + ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { @@ -88,7 +91,7 @@ static av_cold void speedhq_init_static_data(void) speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } - ff_mpeg1_init_uni_ac_vlc(ff_rl_speedhq.max_level[0], ff_rl_speedhq.index_run[0], + ff_mpeg1_init_uni_ac_vlc(speedhq_max_level, speedhq_index_run, ff_speedhq_vlc_table, uni_speedhq_ac_vlc_len); } @@ -220,8 +223,8 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) MASK_ABS(sign, alevel); sign &= 1; - if (alevel <= ff_rl_speedhq.max_level[0][run]) { - code = ff_rl_speedhq.index_run[0][run] + alevel - 1; + if (alevel <= speedhq_max_level[run]) { + code = speedhq_index_run[run] + alevel - 1; /* store the VLC & sign at once */ put_bits_le(&s->pb, ff_speedhq_vlc_table[code][1] + 1, ff_speedhq_vlc_table[code][0] | (sign << ff_speedhq_vlc_table[code][1])); From patchwork Sun Oct 23 19:36: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: 38933 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1860406pzb; Sun, 23 Oct 2022 12:38:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PtCVl0fvnfqfZnQZsTSRLE07pe6GdjEopP/sqStygdrDSd5hmKzZcM6+ctIz+NBZW6fVF X-Received: by 2002:a05:6402:190f:b0:461:bd53:27c4 with SMTP id e15-20020a056402190f00b00461bd5327c4mr2422786edz.75.1666553904759; Sun, 23 Oct 2022 12:38: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 m4-20020a1709062b8400b0073155abc1b8si22033087ejg.154.2022.10.23.12.38.24; Sun, 23 Oct 2022 12:38: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=F3SDrcuu; 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 14C9E68BD87; Sun, 23 Oct 2022 22:36:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2086.outbound.protection.outlook.com [40.92.49.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB8A068BD28 for ; Sun, 23 Oct 2022 22:36:31 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ED44rNONxT/kjoev/gwKc9OlKvPvhdVuBevT2kFEnnOy0CXSDNVpFNRrYLiKfQUiko3Ra95xoMeeRRsCi/C/52DnsrSNxFAvIa0AiPgitLpRitmklMVPsvWYb6BE0QmvRv0AGcbVCZVKJ8FJ44ifb7EpvijR0gTki2VQrcsAoGcpsAwm+HyQjzRbDoYsd+Y20KmZ3Y3ww5Mr0U8VxT9dY4wlLvFdJrbPJYJSxwg2nFsoygDZqufb6dy8DkP6UWB6iSyGwcZUSORpeDEChEbKfK9TsLBjdu+7aMyoegaVvOJcYpS7Mdnriub6PFDE0GwV1Mg0aVuuobSyJhEsO/Q/Ew== 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=2Xl1VPk0nTxII+hjEgys2S82JYnytk3EQWUIBVzONoA=; b=g2EL+kAPS207Z++FuvX+sVJFA5DtClRRz/71q0nXSekhWO0XIpOsqcs4DBpoAmOzDu0myt6cozUhnjYFzei88U684HFdamt7ATg/Lvf/ufZ0tLSIaYR/++P7u5Q52Mn/Bn8fyYRpZM3q0kPuYh/qq76F0NyEfVkTWyr/1MA7RWCQKmfkr7gK/m+bpS/yT8pXF9s/1YURf841yN1z5KiMP41g8zy9ftPBiKcJGI7noxaJVoQMyMe4LBEplqzDHevkfo8Nal6/3quFyA57EiHLB+cIazxa3Wv4V3NYh/PxoARnZWZyto6IX8DHQuBIl/LpUlpf0UdHFq0vGqNYywOSaw== 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=2Xl1VPk0nTxII+hjEgys2S82JYnytk3EQWUIBVzONoA=; b=F3SDrcuu2NlRPk9a/WcuuN/qQFZxFGN1wX/k8Omwl7dbwb9unv1iQjX3z1g8p0t3c0YwnlZpW/2jitccvNYS+Liyc1sMO/oujzg4c4vFFusw9cpZ4uN9H+mKXr4+xxyOB2d8SkSaS1S3En4Y4j9AQfxi4UZdxKrDSTJLEfgAfOomcocsUEVEwPSZXjLB1BAhPzZZ0w7WkLakTK5/gXZS/ls2BdrNqmpaoA9tRF/V6hz6ZzIv5JozmIr6oOO/Iqs9pYwBl69RiK/y8xYAA6TcAF8Zsc5BVP6gcwNtWklISICrMql4mwRqyu8KBiWg9r2uib58Ku+j/3971D/r2U34iw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0183.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:326::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 23 Oct 2022 19:36:27 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Sun, 23 Oct 2022 19:36:27 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Oct 2022 21:36:10 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [LhivqEgKst4CywhGIUIHdFZNWz1DK2fEUiwmA22uAyI=] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221023193610.674990-16-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0183:EE_ X-MS-Office365-Filtering-Correlation-Id: acaa6799-9627-4d2d-1215-08dab52de0c2 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqH3kRfXJefTqIxzT/YbMNWPYZoesYRWTNc6np/YUl9xxkVzGlZ1IlId2bS/R17NGTGJJKspqRswbBl9JrOF8IEh07zAmIpzT728YhA7oZyc52s9c73ZiTBCJ1I/uKM3pLBm3t4e5DREVFLB6WtQ2MQ+zc/l5N7voncr+IWjYxALiO60X48umhw8ifme10tlnJVrJDYmd2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N3ziTbbjqEcp9MLm2LSnqJFpPJXtDKqKnWSztGhRFQn/g56SlUBzU9jL1MmEshYL/FfeVUj+DIT/v0jTah6/L2bxt89lPVIG+jEKbMdDY/BSeRLjJT1wXVoFvMe1IhAr80T+FEq6i7CjPj0+RqeRLYhmLToBx0g+ZWszaxsK3h6sOdITVQ72a6zWLHmHc4F15dyWuy0cIe7SOTZzCTacWeMR101BPBgDpFVo3aZnfIOFXNY6vxYCz38tZ/D9jig2mJQrWwY5YErRt3QjX0spDpPcbsecHOrPYXK+sYVdvj7HbjOcGAlQwmnQtFfy1BcRzs/FZvqfiHDHGAr3zTKrmRXk4lxN7qij31KcHT/MlfrU7MSqqRF5pK9ad1vLKG9/xfk6Pf9+3r3Xa/zEQDx7Y3wH548ekHC+f3CPfHDKbIDOvxjM8c9uvd2JkPI78hvcHfygBKYnoLSS+4VYFPpWvtvAa5uNwPWK82WLixzbWsMddVS9WzK2un/o7zkpir6ObuseChpFfT5hgeQLcRSNDM= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: acaa6799-9627-4d2d-1215-08dab52de0c2 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 19:36:27.7035 (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: AM8P250MB0183 Subject: [FFmpeg-devel] [PATCH 17/17] avcodec/speedhq: Remove unused ff_rl_speedhq 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: nJRp1LNFB+Xb Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhq.c | 9 --------- libavcodec/speedhq.h | 3 --- libavcodec/speedhqdec.c | 1 - 3 files changed, 13 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 46ff0cfc53..eb7de03116 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -20,7 +20,6 @@ */ #include -#include "rl.h" #include "speedhq.h" /* AC codes: Very similar but not identical to MPEG-2. */ @@ -97,11 +96,3 @@ const uint8_t ff_speedhq_run[121] = { 23, 24, 25, 26, 27, 28, 29, 30, 31, }; - -RLTable ff_rl_speedhq = { - 121, - 121, - ff_speedhq_vlc_table, - ff_speedhq_run, - ff_speedhq_level, -}; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 8bc22ab0d7..c40991b8b5 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -22,7 +22,6 @@ #define AVCODEC_SPEEDHQ_H #include -#include "rl.h" #include "libavutil/attributes_internal.h" #define SPEEDHQ_RL_NB_ELEMS 121 @@ -31,8 +30,6 @@ FF_VISIBILITY_PUSH_HIDDEN extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; - -extern RLTable attribute_visibility_hidden ff_rl_speedhq; FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_SPEEDHQ_H */ diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index 0c5942e677..623fa340d5 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -39,7 +39,6 @@ #include "mathops.h" #include "mpeg12data.h" #include "mpeg12vlc.h" -#include "rl.h" #include "speedhq.h" #define MAX_INDEX (64 - 1)