From patchwork Sun Oct 2 21:18: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: 38526 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp963941pzh; Sun, 2 Oct 2022 14:18:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68dDm3/BGEnGK33zA/yUmdbyJe++VTeFZbaKCyl31cpf2Wm2DW4MudI+uK7RnnpW6HIoEm X-Received: by 2002:aa7:db07:0:b0:458:f6e5:ab71 with SMTP id t7-20020aa7db07000000b00458f6e5ab71mr2582508eds.330.1664745514238; Sun, 02 Oct 2022 14:18: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 go8-20020a1709070d8800b00783c42d2da1si7388202ejc.425.2022.10.02.14.18.33; Sun, 02 Oct 2022 14:18: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=AZRRY7PS; 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 5B3A168B2A8; Mon, 3 Oct 2022 00:18:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075047.outbound.protection.outlook.com [40.92.75.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AB0AD68B2A8 for ; Mon, 3 Oct 2022 00:18:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qk4/5qJ8Rq+8ksgC8AHeybzJAw2KGV9wyfoPhQZphW3W9OB9CO83Y7GIKoT9sga0L/caGivBpY+v6VKdGvYimlJgDCAQTmoOkDFnLgspi6qW2IscnJcG1NwYJLYNH+Jcx/JdX3mpG6bmUWm/dSixNxHV88aV3jjaXlJXgf8rDqesXKW6J1SBbwptiLqBWxKT9lAH25MlQyox4YIJtqZNGz98pOyepxXf9FQ2VaD7Ty+EIpEWrzIYCkIm7ot1AiSwr0nqeYdllsTLeMcvYcibvGNGFs9TMXl+Sq93wkK7QuTjbdLs/7B++9VJjwUe9LqEohyqV1mtXas2huHb3TWobg== 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=Y/Wz/+Koxwdju4gLDJbEy9dO5Rg7JhZ2IKE1OSZfW+0=; b=lnkJHnTNy3lPcyU+ZrMn/o5w9DoB/O95ajZkJwPtjtHf86CoUWrFv60cBJlaF/1JOhuTqEBKMAWKmCtwdl4wLD3jJ/AOt8+qjKK1GQ0ZKq/RkIAeZWzf8h/F6sO+DCP40a3IwgFDGaQtQnfwkh0gQ9cthbIyDMQO3Mc6M15fDFkaAllNxdPN3IzpRHVI1lAZS8YaknoXWYka9GDlwm5mJNf+ACf/pwQZxXRGhrTLkw8pXzAhzLBqEcV12XB8D8R7JUEok0iH/XvmFda08Aa7jgMqtX/Yio0N+/C0uc/E0Mspa9o+y3YWX6I8kc6e3GtRA0Igh+kgNIOwkaM9+6MF9Q== 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=Y/Wz/+Koxwdju4gLDJbEy9dO5Rg7JhZ2IKE1OSZfW+0=; b=AZRRY7PS9PuJAxaUKbXJsP4qKmm358IbCzSZG0oLMoVobpulia8ylYZOMQKhwkXIzG/0WG5la4nQ83kqp12h27K+jc1gESjH9PWWG9tynPDrlp6amo3u2eWrFnYt4uvF7e8+KhIKzIL+Z35a+S7oV0d6iKnrx0pbEAdQHaId4KedlFeY2j34KO64cj3gwTd8JCnydCihNMLdF08lLh6NiCg8b0+am3fP3hcrNQQu9fOkTp7iymgbmBFMyh73Dk++fz2DpzfsUkdjJG5qf1BNqZISa1oHgbl5wvVNDOHJyWXfw21TdhfwDwUATzyzJGUyh9Wzb24YQUWvwckbs3Um2g== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PR3P250MB0290.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Sun, 2 Oct 2022 21:18:22 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5676.023; Sun, 2 Oct 2022 21:18:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:18:12 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [oRXr8+A8qG2li7CviyiA5djjNm9KaLi4hQ8vT4ViSZ4=] X-ClientProxiedBy: ZR0P278CA0180.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002211815.959423-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PR3P250MB0290:EE_ X-MS-Office365-Filtering-Correlation-Id: 600fb58d-1e6c-4639-e8c0-08daa4bba2de X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmq9S+lyC0Rq4VBpsdMYmcOkXc64fLoHJs3cs9hXByJ0BlEIhjv94WrFpNuzdYV8jIY434x2qKsxrL7DTrKlNK2uFydIcEnBGe30jjOKNSDSeuzMUYRDQ5vK4d9xRclXA5oaJkHG3pUjcjtwb4zjTNN95RXDfWM75hN5R5nfmQ0CKGdLOfKvUV3YjjtSa+8VdqZ1UT40M66+3Z3euYpXLdoJn/I7RDkzPy6mOT9sGjIhji/QbtWnSmLz9dmmAO2kUy0eFDgaZ+ojbvfk/IXfwdIWhP6vMomtq2HaHByjD7AVCWSTa47eYHBhORrD/iyV6Oc/HheTLJhVRE66yBggg2+FRFfSx7D1SAm3JT9i8Cnx2goLLAYhDy/O+bLZPNTO50jxVSBw0IhQOFfoOMhr7D5og495Kwnov7qETIp2aJ5kp6NdPB3cs2FJsWFEbKNZGZIYb6ceQswjqyTwaur8apOK1q33kTrUjEHvyxZLdrF/+dtt+dZgYaw5/osZFomhJxm24pw69IEzu1WvsIaRaD7B7LOdbtUmF8ytUNxZvUoljV7KOi+PlL+6+S+uGhVcU0g6YoriSoO2h+QF1chyCOCnsg3vEDBi16qS7X77sxM8BPBq2p5CcAr44yvFQ4tewLrrm4wYBmSjFAt/zE9v3TR1sP/4pNJc5fWOl/onfcvdxZBSO9DBXz4aeEdWb+ydUrLMHc8hNtB3kmJqxMbyLbRSv47hT74OFCvn+IeV+W/Cdq2uSBL1BzH46AE1VM7+g8M= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k3bHMfhzy3sruzk1BUsk0GQzrs46bsAqfP8U+7aM87d/2KJtFQ2I32A2PRPF/qbqXRI7V62WK2wTjnPYayZ4d1yySZLMTWxMOMcaLljzh9rizTNJZhzTP0HILQDpXKPHFcbrXu/9ifLIzmDDPhGyfEgV6wNsdBdcw4Bcph8kRtXY0vdh0PXYQxIxC1BWPgUOguA4afsWnJHRnTD2ARsBjNnlh2wjxtJ4kz4+wxrPvQwgNSkRUiRYTdI/pUepEkJBj89ewYIMckk1LJjLpbBO6Pg6t7vRhpxKW5LD0srLeBLz70uGj3z71AdWX/WNQBtLSi2ELkxYelSMpwVaDqFwnrHmihjVYizPtMIcvY12K/INSXMcCDE/pom30OlVP9FvTZy523bqJ5ioX3UPBXL7vo+a6Iw8EYf3RxN2kyu9WtXPGkjsddOgmh9W02OetD/w1Ybnyk5Y3Vb6+8VQ5dRaewKVm2gx38+3bC9EfzrsIvd0FeRsHrgB0uxs9LEbIPLjpMPtR/oHstK3zU+xe7j89F714/n2FtrBwNsvwOFNArJoCvpHhD8fokXo0rdJAQS+6Gr0j2ADHYxhdtmevLf9IoxLU0zZVh+4/3FROWEMPstvq1D4RIMLHIMCfAJfMZR5x6FrDD+z99VyXpRj/pCnmWWuNbNAB8b7chTDeH0futZCpQICD304O8YcUmPEMAVg X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LBMH+FsvJpKtw/li2oRjbLmXQ1+9G+LIRotHxOTTv2GVU0nrY6WwMyDYdwobXQWRG+60G9clkYkkqG/1W8TfGuVajeISy0i4AKraEn4zsKyw3FuXcqQ4+jiTwdTMYfXGoy/VxP6mHQfp7p6g0OHpPEKwFJc/E9HyAD9KK5402h7lzyjSbAIp8Ja4vMI1m5PWVs2zb8VaMf5N+kIiczlY1zDyyp5ILQ1KaTkKCylk1fyIqOoOGAbsvZuqzKMS6cCw+fHM4Gq59NSj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-Network-Message-Id: 600fb58d-1e6c-4639-e8c0-08daa4bba2de X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2022 21:18:22.6422 (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: PR3P250MB0290 Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/mpegvideo_enc: Call ff_h261_encode_init() earlier 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: GNgqBD7CMTS0 It does not require anything that is being set between the new position where it is called and the old position where it used to be called; and nothing that it sets gets overwritten between these two positions. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 3af0c1c0f3..e7e2e60a9a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -689,6 +689,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) s->width, s->height); return AVERROR(EINVAL); } + ff_h261_encode_init(s); s->out_format = FMT_H261; avctx->delay = 0; s->low_delay = 1; @@ -899,9 +900,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) ff_set_cmp(&s->mecc, s->mecc.ildct_cmp, avctx->ildct_cmp); ff_set_cmp(&s->mecc, s->mecc.frame_skip_cmp, s->frame_skip_cmp); - if (CONFIG_H261_ENCODER && s->out_format == FMT_H261) { - ff_h261_encode_init(s); - } else if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) + if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) && s->out_format == FMT_MPEG1) { ff_mpeg1_encode_init(s); } else if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) {