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+2LEmNFx0uE66pZcxH1QjhjJ9m/KCx8izXSmuY6G3cKAk3SuX6/aZJYfYRsYX/S0SN8H0KnhlGaGYLxMco7mZ9crzlGwpHnt+2wkWQBuIrwVAfVgalrbveeokOg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g9Crq 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];