From patchwork Sat May 11 20:51:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48785 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1706:b0:1af:cdee:28c5 with SMTP id nv6csp300383pzb; Sat, 11 May 2024 14:01:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9RtBdxgCf7xFlTFIkvMJrc7NRfuaS2UV59bladLi9QJ/WhDBDc9dDt8AQFO2F6ynZYl8J/lX7retQMqooe8XoWaGmZY33MWe5WA== X-Google-Smtp-Source: AGHT+IGO/NblmSV4/05wFDFeYU3GH+k3vR+5HU5OmeFjstKYUjbw9Y9bRj6ehmzHvZX1SCCuTOjs X-Received: by 2002:a50:d482:0:b0:56e:2b80:d87e with SMTP id 4fb4d7f45d1cf-5734d597b89mr5934741a12.2.1715461284762; Sat, 11 May 2024 14:01: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 4fb4d7f45d1cf-5733beacde2si3298228a12.139.2024.05.11.14.01.24; Sat, 11 May 2024 14:01: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=HzDEXOqg; 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 AA6E468D7EB; Sat, 11 May 2024 23:56:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2040.outbound.protection.outlook.com [40.92.90.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 26A4268D83E for ; Sat, 11 May 2024 23:56:06 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NXvk86qstMLZgjU35bGS2OudE5G0uOwFrjxWR+AGTYc2dE1aIo9SiP03DGWm6DNAUiNzrQpMrGLBE1QDeM1jAw5w4mdkchv+5UxdIOOQxnS9tbuN4SkcIFf768NeBM5j8A63H/0eF2LAqOvsLMdBNXkypISMTQj0JGFpanbfrPdmw9B7GesseMLmGhxYi3V3CnzTM1Zt04qpzcXPMs4VLwaq/wLS39Z8fMSEz6P88KgjG1omODwsmxJwtijn5Ti1g8N/cV0QwyGpQwIGtLzSOwx0d9ZrwnUXVdYsjqkXJVn4RzRHVKMTa1vpxOOmU6D+0tfAKQGMgd7dsYhI6/dbeA== 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=RlW1gxCee07aXann0RL5MVJPKN6BXCXWtvGEN6nLWqw=; b=KVR1HFF15hm05ugZXyzWq3W/SwFodC2wa1UmMHhpkAkvLRtyD2cWcVp+CQw1lh9eN8LB0gWozYmci37GynkUcRmlw5HyUP8+f0fe5VO1JyfZFX/jz+Ttrdp3SuIPsUg1HaPD777eS/9v5YSp07RDqY0kLT0HZgkLCAKn+I985Ici9rAfAVomCcBsxsUPyFb/05Ys7sFMblXVN9gaJp4JDV1YWOW6FHc3jMp4EQjkxpuCnT8tbV9cU68GJgfqtRmDEDULkvgHekJNqPWMBjajAq8Nc342NpTHP61+1FJW03TMeY1gTJ9dc0ioG33vD7axGdvvizoLIMv68VdFPlHguA== 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=RlW1gxCee07aXann0RL5MVJPKN6BXCXWtvGEN6nLWqw=; b=HzDEXOqgggOqm4DkJEJccSU2SOoe9nQaPsVKD8B3IcUD236grVOWEqB6H4vAK0B0Wgoy6WBuQooydoxjqVjRz6o986sGVV27w416C5DVkEsoUw3eZvmuVEhGpbjrRgKe4F/aKeC1ie2DMcLoB5EIwHg1foI11dON9SQgMjTdNZWvr259grCkvG4kCB66v/MUps9Nnf2W7t5k2PcFzJXJqshKUklSzUaHjszrfnP+HLKD8MPVlYjB+MPmbnZ3YkzWO0+WoFSRpigUlWcYOaNSkuKNtrqR2q7XbGWVgkqYacTwba0Zy8AKq4qNP4+oXezkgqBRn+uol72ipw90RU7yng== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0070.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Sat, 11 May 2024 20:56:05 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%7]) with mapi id 15.20.7544.052; Sat, 11 May 2024 20:56:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 11 May 2024 22:51:30 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [qIbzMnvyDMiUNwyP8LDDK5/clGe2vbT5gtIRst/Az9M=] X-ClientProxiedBy: ZR0P278CA0172.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240511205135.2411886-65-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0070:EE_ X-MS-Office365-Filtering-Correlation-Id: 80ae76f4-9e56-4e2c-f4f4-08dc71fcc650 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: wvD46gXoxjk7Ma0xSM9acJEbO0Bsn76ByZ+XTS+buyrZ582njM2HQdJyN6onfQ06tlAjafXX3XggtNsgdfPp3mJSRt37E5KcuFcivHMT7Vo+/F0NDOAfrpWtxqTn1Jicz6gJGHfIx+DEbJh4InBHrHHuNtUTl32L5jxiRqVoG2WVt8s6l81yPIYfvNOLLrqIign442TgM2p3d8j+FQ1nUDe3CXA8zbYQhrChsOE9jZUEdDTXKx/Ycjl7Em38n2yRw249iXSRgAWDe9icPhsUsa1+1BvUnN1nUotYGW2ubtJ/4oRA7tpIY/luRvO2tFT1eKQ+Cn6B53wc6+/OP16la6/4wAVsGC03A108ub4tIzPG/EBoSjZd2RNyO7ze6pxkUWbOSzCLZkpSNHc/w/9wvHUq2B3EIeASA8j/z+Z55n1DsIXOzrJ2AuZFnopITvcs7nVwzLrbyoIhTArHqPdYXxaVOEtbjk9HuOIMjriqgKv2TnAFJTYMKsGINtuh08IHcy5uiEjzB4FSFgLUx0nePq3p6KDyDfgx/8WdJptWDqyR41BM2xUlZuh1Gs0lvt0bH7tm8yPm1jrCVrDj31QWuoDP+Rp+NFdP8VyDfDnDechX7vilfu5WCtbeQh+1h4ms X-MS-Exchange-AntiSpam-MessageData-ChunkC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+/axr9wXHBp3OL6P4xtg5p4cVoRhmmNDDL/fmgHSne+9UuYBNBNDqHDWmfp1MZyAj5corH+Ou2O0K4+gHqw/rjEKARO7WDXuzIDj6L+SUao7e/eoCd8BsJ3LY10IPU8pfjF6ykPJ/W3PAmFPxqjuwuesDTSnXuhszV2cnCCjJZn5xsMDRdiKr7qocw6AWHTon6V1zYTA2nUaLQ6UiBqXX5TujPh8d9gR5lG8ATjD5503+hhdz9ludLPg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80ae76f4-9e56-4e2c-f4f4-08dc71fcc650 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2024 20:56:05.5182 (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: AS8P250MB0070 Subject: [FFmpeg-devel] [PATCH v2 66/71] avcodec/mpeg12dec: Don't initialize inter_scantable 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: JTDszvUvCIE/ MPEG-1/2 only needs one scantable and therefore all code already uses the intra one. So stop initializing the inter one altogether. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12dec.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 52f98986f6..55e3a31e95 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1256,13 +1256,10 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1) s->chroma_420_type = get_bits1(&s->gb); s->progressive_frame = get_bits1(&s->gb); - if (s->alternate_scan) { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - } else { - ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - } + // We only initialize intra_scantable, as both scantables always coincide + // and all code therefore only uses the intra one. + ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, + s->alternate_scan ? ff_alternate_vertical_scan : ff_zigzag_direct); /* composite display not parsed */ ff_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);