From patchwork Sun Oct 2 21:14:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38524 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp962826pzh; Sun, 2 Oct 2022 14:15:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AY8F7/sWxOcqIalfQo4C1W8c3opDUyjLCKro3HkjYhrCVUmC5IjH5QrEQibZU6mY2Dd63 X-Received: by 2002:a17:906:5a4d:b0:76f:bb35:48f4 with SMTP id my13-20020a1709065a4d00b0076fbb3548f4mr12752624ejc.686.1664745308124; Sun, 02 Oct 2022 14:15: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 p13-20020a50c94d000000b004537a3c4982si6144814edh.601.2022.10.02.14.15.07; Sun, 02 Oct 2022 14:15: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=ToJoOUfn; 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 E24EC68BBEC; Mon, 3 Oct 2022 00:15:03 +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-oln040092075104.outbound.protection.outlook.com [40.92.75.104]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7EEBC68B8EF for ; Mon, 3 Oct 2022 00:14:56 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LeYyuJHvhBdMeHRv99P0vtiBbe08Mf7tqPEbqDnowaXosGcTS6yqJDvXgSnUjwysn7KK1EnNrh90vkNNXoQ2P3z18QYwe1cMlixWdeG7K4mH8vhcoTRREF/OTWhI+wwsmx/r5mnjVh5Nrq1nFHYqrWlzCkyHQVeQN4W13qfM8f+1iHbS3xMKvfzcbNp64p3zXsHfJVfoWy/w9kCCkzQfRY2k1F6zGjjqQ+xOU8QrDj7YEt3MzqzMkUFmNt1vA02yrSjq8sNBoSwXqqxOAmnjRTRKtIQMJUYEBePCW2gx4yjOmPt+FO+KT3uoY1lGVVN2+RF0t4Rcf/Fj8LJ5c4Kqpw== 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=sC/ExZeZ9hvIagCIpKhhcYOpLzQKDYOP3BEBWXVwZts=; b=W3TbrSbtTmQV5/rVEBXXCFpchZGkTa/8wao0BO7O1nRakmu72d2uliDWlB2WrX6ZgRZ36O8OcfhGHRRcUR65MZdRVfRj79zlORmV7TeXBmiZCtPvgFDyXftOQ3Jx6OB5c38wQJAum6eYs7wd1KMSV10LygNGNpxF+nKYxpe4Iaiq61amji0EZKMbVthxgDoIxYTXUSUib380Gxu5M6O7k0cnbMsEQojqp2aNMJVVGOn2wTXsmh+J+lJILoRQWD7If4C784trSF2P6zX8RDo3zm5pyNa/qXM9mO1ThdwBXhs6JLNk3KNNT5xRG35iCeMIGzBapXsVFN2XIppJsCx7LA== 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=sC/ExZeZ9hvIagCIpKhhcYOpLzQKDYOP3BEBWXVwZts=; b=ToJoOUfnCcAJkMSf3mRHOIOqDc5Hrsx78qZCdj62krWBNUPoDxp0Sdf6zSlzWsEIOwXUVWSz6Tyhcu53MbsHf6KT7fcQLMDDDVy11i/jHjCvM66Km7mtuF941ZiuVdDdqAevh2Jy2JIiH1nW2tFgrKn9WVsgDa5anzvJCXgk/QcgdmFrwWQ9DBvDaENSJNXSfI357xkxbARJqTpeh3BhMXMCjz9lVBcqxLbXJl6bqeS84YLf/ev/l2HPUEEBPjAv3DiC37yupKQGAoDXoVoUTuQ85u7pLSk4DaT0Hg9MSXIi0zG/4bhwJvnvc4wSpavLdv/cuBewrCHx1RMM/DyczA== 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:14:54 +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:14:54 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:14:49 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [qRYoFttaW/2lwKHsVkjbJ4yYokb+bUubK4LSVfCTzkw=] X-ClientProxiedBy: ZR0P278CA0158.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::17) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221002211454.959331-1-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: dd7b331f-a98f-4a47-d781-08daa4bb26e9 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKxdH4z3LBD+O14MgppChh7AAiSmzIHFVfwLA6uOQZXWvBDGNx+6AS/0MtwrNVoVhM0Kv3JZvQ5ZgTdVzfkkaNXbK+7NI9TyfPj4lBUW7ZW97qW3Ew+CxbeUynHdAHZRYVnbWjtZZycacGMy73GwCfVzswZK3jr6Dq54PQs4K/DVV6nd5oWx8DR3HAN6vv8sRnwWwficQwhJxnt8NuxFHCsfjzOO/g/u6EoG3dGeG7FM4eASHWn//RNCTE8QhFPvlXeM3RZzBJzNII0xHMAUV2ZX5kmGf26ER1KWiI7OyEne4MKaeIsgRtsXQPMzpUvhhQu5ut4/YBuI0Y2KSoiYBHL2B8HmDjxJGPgE5NYA3+r/wnWLdNVDu2tHQOZyK4Y27tybXL6E0lus013xqxzigETdE16BE9G+OzmxdDti/1aDrKad0TLb29aThgvfteHZgcvfZMtYSFPsstc8s5ihuQ/pExQgJV/ft/NxVQY86s7gaW/ERFUuWGhxCRUJZqu8XY2phdxGLlYZAbcnloj5RHM2CS9zi1N1sCyr6wvaEErhqjBaR0GFocbl3R7G8Pfmeq5CnVAwmM8oMTbSPGPCOHpGB921d+n7DMqlOAm/Cb/FekI/MRIpSdpqJnRcHD5Hmzl+lBxF1oIjh0iD17B3WS0rPYHe2/dUMSANGKUjyeylzgqVe3g8iEFnw9H7V0gMW2ZBXEIIOMdAJuSVtWZFqXxyDV/X7wMycpQ= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info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id: dd7b331f-a98f-4a47-d781-08daa4bb26e9 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:14:54.7075 (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 1/6] fate/vcodec: Add speedhq tests 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: USy9bUImer+a The vsynth3 tests are disabled, because the encoder produces garbage. Signed-off-by: Andreas Rheinhardt --- tests/fate/vcodec.mak | 9 ++++++++- tests/ref/vsynth/vsynth1-speedhq-420p | 4 ++++ tests/ref/vsynth/vsynth1-speedhq-422p | 4 ++++ tests/ref/vsynth/vsynth1-speedhq-444p | 4 ++++ tests/ref/vsynth/vsynth2-speedhq-420p | 4 ++++ tests/ref/vsynth/vsynth2-speedhq-422p | 4 ++++ tests/ref/vsynth/vsynth2-speedhq-444p | 4 ++++ tests/ref/vsynth/vsynth_lena-speedhq-420p | 4 ++++ tests/ref/vsynth/vsynth_lena-speedhq-422p | 4 ++++ tests/ref/vsynth/vsynth_lena-speedhq-444p | 4 ++++ 10 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/ref/vsynth/vsynth1-speedhq-420p create mode 100644 tests/ref/vsynth/vsynth1-speedhq-422p create mode 100644 tests/ref/vsynth/vsynth1-speedhq-444p create mode 100644 tests/ref/vsynth/vsynth2-speedhq-420p create mode 100644 tests/ref/vsynth/vsynth2-speedhq-422p create mode 100644 tests/ref/vsynth/vsynth2-speedhq-444p create mode 100644 tests/ref/vsynth/vsynth_lena-speedhq-420p create mode 100644 tests/ref/vsynth/vsynth_lena-speedhq-422p create mode 100644 tests/ref/vsynth/vsynth_lena-speedhq-444p diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak index 8ca17950ea..1a47fc8bf6 100644 --- a/tests/fate/vcodec.mak +++ b/tests/fate/vcodec.mak @@ -413,6 +413,12 @@ FATE_VCODEC-$(call ENCDEC, SNOW, AVI) += snow-ll fate-vsynth%-snow-ll: ENCOPTS = -qscale .001 -pred 1 \ -flags +mv4+qpel +FATE_VCODEC-$(call ENCDEC, SPEEDHQ, AVI) += speedhq-420p +FATE_VCODEC_SCALE-$(call ENCDEC, SPEEDHQ, AVI) += speedhq-422p speedhq-444p +fate-vsynth%-speedhq-420p: ENCOPTS = -pix_fmt yuv420p -b 600k +fate-vsynth%-speedhq-422p: ENCOPTS = -pix_fmt yuv422p -noise_reduction 1000 +fate-vsynth%-speedhq-444p: ENCOPTS = -pix_fmt yuv444p + FATE_VCODEC_SCALE-$(call ENCDEC, SVQ1, MOV) += svq1 fate-vsynth%-svq1: ENCOPTS = -qscale 3 -pix_fmt yuv410p fate-vsynth%-svq1: FMT = mov @@ -466,7 +472,8 @@ RESIZE_OFF = dnxhd-720p dnxhd-720p-rd dnxhd-720p-10bit dnxhd-1080i \ vc2-444p vc2-444p10 vc2-444p12 vc2-thaar vc2-t5_3 # Incorrect parameters - usually size or color format restrictions INC_PAR_OFF = cinepak h261 h261-trellis h263 h263p h263-obmc msvideo1 \ - roqvideo rv10 rv20 y41p qtrlegray + roqvideo rv10 rv20 speedhq-420p speedhq-422p speedhq-444p \ + y41p qtrlegray VSYNTH3_OFF = $(RESIZE_OFF) $(INC_PAR_OFF) FATE_VCODEC3 = $(filter-out $(VSYNTH3_OFF),$(FATE_VCODEC)) diff --git a/tests/ref/vsynth/vsynth1-speedhq-420p b/tests/ref/vsynth/vsynth1-speedhq-420p new file mode 100644 index 0000000000..cd44ef662b --- /dev/null +++ b/tests/ref/vsynth/vsynth1-speedhq-420p @@ -0,0 +1,4 @@ +f905e05eabc8be20438d416722c34ed7 *tests/data/fate/vsynth1-speedhq-420p.avi +919156 tests/data/fate/vsynth1-speedhq-420p.avi +31e9b07d5e8ce0c8b7749e53fba05b1c *tests/data/fate/vsynth1-speedhq-420p.out.rawvideo +stddev: 14.06 PSNR: 25.17 MAXDIFF: 145 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth1-speedhq-422p b/tests/ref/vsynth/vsynth1-speedhq-422p new file mode 100644 index 0000000000..adb7aa389f --- /dev/null +++ b/tests/ref/vsynth/vsynth1-speedhq-422p @@ -0,0 +1,4 @@ +8f094b75b93b641c214bfaf743e584ad *tests/data/fate/vsynth1-speedhq-422p.avi +1028244 tests/data/fate/vsynth1-speedhq-422p.avi +967315914486c7ea979e4ce9ada04a6c *tests/data/fate/vsynth1-speedhq-422p.out.rawvideo +stddev: 13.86 PSNR: 25.29 MAXDIFF: 148 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth1-speedhq-444p b/tests/ref/vsynth/vsynth1-speedhq-444p new file mode 100644 index 0000000000..8c7abca7f2 --- /dev/null +++ b/tests/ref/vsynth/vsynth1-speedhq-444p @@ -0,0 +1,4 @@ +5008149f0dd3d05d05f8f0f9100d39ec *tests/data/fate/vsynth1-speedhq-444p.avi +1347864 tests/data/fate/vsynth1-speedhq-444p.avi +23c5db6ca2bdbc52e402cd72ad2fff27 *tests/data/fate/vsynth1-speedhq-444p.out.rawvideo +stddev: 12.84 PSNR: 25.95 MAXDIFF: 145 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-speedhq-420p b/tests/ref/vsynth/vsynth2-speedhq-420p new file mode 100644 index 0000000000..6f7d4a2a2e --- /dev/null +++ b/tests/ref/vsynth/vsynth2-speedhq-420p @@ -0,0 +1,4 @@ +41795a070c6a13727cd1de7c65abd121 *tests/data/fate/vsynth2-speedhq-420p.avi +570618 tests/data/fate/vsynth2-speedhq-420p.avi +9f76f7f523a1b1efa99e55ebc874b58d *tests/data/fate/vsynth2-speedhq-420p.out.rawvideo +stddev: 8.67 PSNR: 29.37 MAXDIFF: 142 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-speedhq-422p b/tests/ref/vsynth/vsynth2-speedhq-422p new file mode 100644 index 0000000000..551047b6ba --- /dev/null +++ b/tests/ref/vsynth/vsynth2-speedhq-422p @@ -0,0 +1,4 @@ +36bfdfdaecbf2938358137a598841377 *tests/data/fate/vsynth2-speedhq-422p.avi +622790 tests/data/fate/vsynth2-speedhq-422p.avi +3858c3c1524385150b2cff31cdb72e09 *tests/data/fate/vsynth2-speedhq-422p.out.rawvideo +stddev: 8.62 PSNR: 29.42 MAXDIFF: 142 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-speedhq-444p b/tests/ref/vsynth/vsynth2-speedhq-444p new file mode 100644 index 0000000000..0730ee93db --- /dev/null +++ b/tests/ref/vsynth/vsynth2-speedhq-444p @@ -0,0 +1,4 @@ +62e4caac219e2d79d0c7a8b34b66d4ae *tests/data/fate/vsynth2-speedhq-444p.avi +813586 tests/data/fate/vsynth2-speedhq-444p.avi +c3fe2a70c17979dbf08100aba9c05934 *tests/data/fate/vsynth2-speedhq-444p.out.rawvideo +stddev: 8.35 PSNR: 29.69 MAXDIFF: 142 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth_lena-speedhq-420p b/tests/ref/vsynth/vsynth_lena-speedhq-420p new file mode 100644 index 0000000000..c00b091b28 --- /dev/null +++ b/tests/ref/vsynth/vsynth_lena-speedhq-420p @@ -0,0 +1,4 @@ +0669a27deca78e92b998aa5b616f87f2 *tests/data/fate/vsynth_lena-speedhq-420p.avi +487888 tests/data/fate/vsynth_lena-speedhq-420p.avi +4dc98e7ffb7c1ade85cf6bed75ee9a68 *tests/data/fate/vsynth_lena-speedhq-420p.out.rawvideo +stddev: 7.48 PSNR: 30.64 MAXDIFF: 125 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth_lena-speedhq-422p b/tests/ref/vsynth/vsynth_lena-speedhq-422p new file mode 100644 index 0000000000..5ea8b40011 --- /dev/null +++ b/tests/ref/vsynth/vsynth_lena-speedhq-422p @@ -0,0 +1,4 @@ +40a9b249daf3cf5ab3fc99a874907c20 *tests/data/fate/vsynth_lena-speedhq-422p.avi +536206 tests/data/fate/vsynth_lena-speedhq-422p.avi +d48a61d173005609e5e06b0027c98a0e *tests/data/fate/vsynth_lena-speedhq-422p.out.rawvideo +stddev: 7.48 PSNR: 30.65 MAXDIFF: 138 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth_lena-speedhq-444p b/tests/ref/vsynth/vsynth_lena-speedhq-444p new file mode 100644 index 0000000000..0772d0982f --- /dev/null +++ b/tests/ref/vsynth/vsynth_lena-speedhq-444p @@ -0,0 +1,4 @@ +ce099dfae05cd224ef94c89476176a1c *tests/data/fate/vsynth_lena-speedhq-444p.avi +702980 tests/data/fate/vsynth_lena-speedhq-444p.avi +e2661cb41d9f59cd1a62b49b3a058e74 *tests/data/fate/vsynth_lena-speedhq-444p.out.rawvideo +stddev: 7.23 PSNR: 30.94 MAXDIFF: 125 bytes: 7603200/ 7603200 From patchwork Sun Oct 2 21:18:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38525 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp963901pzh; Sun, 2 Oct 2022 14:18:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72A+PIYEQTi0z2mdBgNP4c6yVUyCMWGI48yVih+vAXQfeGn22P1Lgqn1+WomYvVFZC9VEU X-Received: by 2002:a17:907:7204:b0:783:ce92:d75e with SMTP id dr4-20020a170907720400b00783ce92d75emr12840084ejc.682.1664745507031; Sun, 02 Oct 2022 14:18:27 -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 2-20020a170906318200b00783ac0b4d32si5833649ejy.941.2022.10.02.14.18.26; Sun, 02 Oct 2022 14:18:27 -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=Xidsl7K5; 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 5B26F68BC02; Mon, 3 Oct 2022 00:18:24 +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-oln040092075028.outbound.protection.outlook.com [40.92.75.28]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B200468B2A8 for ; Mon, 3 Oct 2022 00:18:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVTBeZTeqWr4mbPIqVgEI64wvJiz0sil8m40MxqIpSmR4oVCpGPvyKeR05FKfy+wvCQ3J914fD+uBkEYB2IbeDSPDhIWl3NEDiS2yICY2/l5UOvxVrMst394xkKZni9mWfhce3yVZfu+Pfa81ffDREFK/zVolUzvjtPP5R0Epahpu0PJL1wzSgR2l2tZFBcKhaXVmiGQwnkZf5vscUhL+MipbkhObo0EGTr+ej1z2QIKOgENgTthgHyu/+qDfW7RjqbdZ9h9EBP3iwL3vfLs91PMKEMn7uQdHR6W4ojvPVJWiLYN8/G/aHMCbhIS9KsU1+ILwX48yRQmyRjUZyObBw== 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=VDjoc6AK6OFy4PgJtB+oxtsMEpbCnnnrSdcYmqUVnM8=; b=RWmuU4IpWlK0wjuCPpZXmh3NoUL2VDgsXC4coTRDwT5IbfTeT5QUdB8b5mHt7zBr49zXKeQ3zP5InwKBEFy5R5+7m/zpmIegvquVZPBmvFdWmkb7YwluYJTmiA7a54waQYXZl1sqwfWEEgUrNqNBFewj1UkJ0KMMymhETc0fYpwhXq6IZchn9zp/H/5R+mgGKVaX3UiRfYfUM/ddYZx0kNOGJbld6Q47AQ/PLGx3bgd6pd1KICVyG4rAa39hWPAsUWDfMBXqhc978Zea2BxrL6DJNvHx68F+OrmN2cG4hsIOUph/aJ8l35P9J0Ug2GfK1OaKXrxIEnd4u41FfPQ8Jw== 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=VDjoc6AK6OFy4PgJtB+oxtsMEpbCnnnrSdcYmqUVnM8=; b=Xidsl7K5ntdn4sL6tohxhPEai2OAdj94czNjCDEqrq9uaumEkHBxbUO0Mbni/NlUC/lnQ8yfL9jQtGRfhvKW9wg4uVgwu/QMJv8yMkZtkhG8k1zTEquOWnoyP1g3swP1NzoNkUHDwFvRQU8N7oHMYZbvzcxNftXwSIecxqaTn2XkLlNLjB+QroVDqLDtcgTHSiTzXXogeGKJxQum6szf8NEjjeANO9hakZ53GG7GS8xIFRpk8FJ9RXsYuMKAYxkugszqEFpwssBB6VF2UBLg23qar71X8Fi6YLCEZ/yu9cmFvDri2ARWajJOFdspdO3WVaUC2DjlE5cm5uBxmrfXWw== 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:16 +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:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:18:11 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [4H0IptBO0xYTO3/8ihvsCqoMfbQuGgT2CC2HxXB7Ee8=] 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-1-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: c7f12f7c-dcb4-44ed-1330-08daa4bb9ee2 X-MS-Exchange-SLBl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hefQImg1joHHvm6E+wkTRya5CtPN9p23gMYaQDWJ5P3+PtHh1+bqalKvI6QkFDxf0E3ERmcAHa2HWxmvREVuOAO/fwYSDYE0VvMvHMi8X2oXdBU8+kYZ0brh3HEg5r+TOh9bAXWorxxjTCpsXuGb01IxrCXfjscMY2RAzaAQ28LA3HLRGIBFHb7hEsMncB51z/SIqHZgoeZ+IMtl8mQXsM6NcemSA1K8rB9eURP5PrfeYEgm7c2Qhu0BJ9YWdZth3rRgTbpCJsRCWUv+3OYmuRVJ01BpeaMU85SPEddAiEawIHTE5CNXNpDQeITzlEwj+f7fchdfxiEWV+QABBdjmfNEjPFFnD+S/9cKXVOb7xBN58l3JW6OJfemVKq8CKo6pS2gyYbbQMhWjlWWSmpIqt/RyVZFsb9htSItLz56Z9adITKTvRSyGx1kWU/5lD4V+oPHmKUFKD5t535mEvKbJmpeS4uA/SOt1KUnvb1QmCQQhVtfdr4Owdr7Gb3imuPyTs7vav8eImXPyERDM3fYXJd8De3cN5KjHhxoL4btxAvFFmxX+8zq4Uvhn9oLFlLy5w+6K+OXFpmxiy2a/WPjYZspYy4EP5sMXxq3dgvQ0EjcNWyXZ8/x7J7cStmoTk2cTIsE4upeE0hTy7YRsNvR8o2dDpn80OM3LfjXBGSCrq3MlOVHw3PZszFR+qecJ08rDO0P7eJ6ZK6U/tDFGa2C1OY82NfrgA0Pz7tL8D/XORGrirM/eQhfR3/U2+V/rShWoJTbbaMjI5emxLrjeVKA= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7f12f7c-dcb4-44ed-1330-08daa4bb9ee2 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:15.9521 (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 2/6] avcodec/mpegvideo_enc: Move SpeedHQ check to speedhqenc.c 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: Xe/t7ViGXKYX Also set this only once and not for every frame. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 3 --- libavcodec/speedhqenc.c | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 0b398c56ab..3af0c1c0f3 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -3753,9 +3753,6 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1); s->qscale = 8; } - } else if (s->out_format == FMT_SPEEDHQ) { - s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg2_dc_scale_table[3]; } //FIXME var duplication diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 747ed679bd..b92af2775e 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -36,6 +36,7 @@ #include "mpeg12data.h" #include "mpeg12enc.h" #include "mpegvideo.h" +#include "mpegvideodata.h" #include "mpegvideoenc.h" #include "speedhqenc.h" @@ -111,6 +112,9 @@ av_cold int ff_speedhq_encode_init(MpegEncContext *s) s->intra_chroma_ac_vlc_length = s->intra_chroma_ac_vlc_last_length = uni_speedhq_ac_vlc_len; + s->y_dc_scale_table = + s->c_dc_scale_table = ff_mpeg2_dc_scale_table[3]; + switch (s->avctx->pix_fmt) { case AV_PIX_FMT_YUV420P: s->avctx->codec_tag = MKTAG('S','H','Q','0'); 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/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MhDIGYgbye6N4NaXbNy0asouZF9OvQlx7sa5yt2cE589oOWXAodaaU9DFYtPVFU+O/yfl71sBfyJJGkpp0Y= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-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) { From patchwork Sun Oct 2 21:18:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38527 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp963984pzh; Sun, 2 Oct 2022 14:18:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5O8d3stQs5OwYedceWYsTJ1LLd+P6Q1gwFh9SCnxyYem5Uw6EioIj/LCLd8Q7FD1FnJfNj X-Received: by 2002:a05:6402:5162:b0:457:6ef2:df3 with SMTP id d2-20020a056402516200b004576ef20df3mr16138770ede.128.1664745521914; Sun, 02 Oct 2022 14:18: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 dm8-20020a05640222c800b00458b08cebdesi4008731edb.324.2022.10.02.14.18.41; Sun, 02 Oct 2022 14:18: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="CaN/vzJZ"; 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 58EFD68BC13; Mon, 3 Oct 2022 00:18:34 +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 C768B68BBC7 for ; Mon, 3 Oct 2022 00:18:28 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7FnHdCF0A+cKNCQrf8UlIRbNQ5KsExdsqbyf+l3ILogboJaQHOSIQOJqreVrYacboLqKiu+FZxJxgcRJbqI8vCf7mZFUAA6xVoAwAafkAp+gvPZEOnKO+YrxrF4w5V1CcFwIpLspFqhOsEqjSHhC8dhdofh1diG0cvHvCk+cyBxgout1EM2BEBcgkL0peD0DDeZDrg7/FJ3qgRoYMnYhWpgNo5ev4Nuj8UmdnOUpyvkX9qtCOZXE0wgHoTjYT1TRpgcOfYXWEPEhQhajNfmkTha8WaHFbpcL+8XMb6w/kkDkiYPGIjSH8DS3qKL0kbAmpP216/i2KdjGkzlXjArsw== 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=3KslDEf5lg4+VOGo2gCELHh4Iob9CAA4hATPVXsk4NA=; b=LZmegtxgKZ/6UZiBGw71S0Uz1FGV+v/un4rpomsmtavFqUYd9zgtSwDhePvXofK8gRlIuQPixQ7iUJTDNR64jU0KXiEMjqD8KTVVCdVOrICjUIVFAs7XJU6YS8gU6n01kBoX5kpU1CLKWMCAP/LhMLD2b8ejZRJHxXLQFQPa+S9m4STXmI7VsK3kldy0yRErOkOKOTrlhi+341qaVAc7dCen8+dC4wm2TTMW+6d/lPa7Qhfd/9XYdK1pxnSM3muDsoGW6S4iDnlpjq9b5UkpoeEMvMM9pzMfawn7gcMOecYP2FQTIidHb12EK9+FJuLSX/5eCU7zV+Cc5fk09lU5Bg== 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=3KslDEf5lg4+VOGo2gCELHh4Iob9CAA4hATPVXsk4NA=; b=CaN/vzJZG3UhddlFi8u/FkoFADjQQBQ4DJv6pMrzGTDHnGt8l6p0GkhblFgpdJLUgvOJlG/McfUsBTFLC7rF93jObxW8ZyaV2FBTzp6zSSJaLa5E0QbyrE2mYYPsPZ47KmaM9xih7XdQoAG3vyotAtcj/bTe9YJO1pTVYFluV01aqPOsouZJBJ8QUXlbOXOs9AN+7XwB9MNu0hhSBbYXh/ZB7N1yNF03qjjmnN8lJz8mabCOitQHRFugk9f7ZUK4A4B6VQ818uKxUqou5WC8YG9L+BVb/XvFkcpC5uM6ZiCbCe32iPuF2N1AJynexU5XiP3Up9ek+1FzHzm2XJk/Uw== 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:23 +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:23 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:18:13 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [ku+HYi/DodjKNjAShBaUV6Ki/dcEtDDiKchCflfdsT8=] 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-3-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: b143edab-1235-49bb-ad1c-08daa4bba385 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmq9S+lyC0Rq4VBpsdMYmcOktbIn1qoMd3Nq33ViCgb/evCtrlbryXCRTaiOw1xGua0r87AiMZSBdcI90wN4Z0T3pfeHrkJHgqiQAbm0w2MAprZQxOChiujJzOl/FAPFiAFUxQvWk6GRr8d3HNAQpeYafw+pp0WxHIRyCLD/8TwRCUMx7CUdwtLloCco7r5IwDOK9zcQIkRfiWhd4GG02FiMgwefwop5AFlXVM31Vpz4hPNaYbt1FZcTiVpmTxmCS4eU5oZlgNqweAMgcOtFa7t44qvZIVu2LZKkIYviKXpIoHAeiBjDaFMgnZaW9jdoJHjcBujns9IfUPCBD4nMGDkJr5WQSgFSl1EO3LPNoolN8w3XOJ4NANiXlb9NeEy9UPLwK5k+2jl4ImMA40l0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s4Nc8CDpJbYGrBLL5CGF3rdrmgPIkB83p1b+uQ67j3teyfHQmsCnPJoXRwBMGAk/B4Q/+9VKaauh+ITcrMNPrXc6Ok9Pj9kjAs0lO0bto6/JUscqe7ToNCWaGxdvmpYmM+Joih0SqLcXb0yV+iQxH+xL2qigkQULstQc+7QRfoJsVNckej04tggUv0hmI5+h0auC3xUcq2h9ChPweP4VBeBQF7JqwgFojT+Dgd2L7eY+cJPoEqM8E+aw57J5cNFKK0DIt/5xw4brMkHWuNOAQyZffetOB4LsHJHBBsOV093E7ceAUV6l6gClXzu9mjug= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b143edab-1235-49bb-ad1c-08daa4bba385 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:23.7676 (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 4/6] avcodec/mpegvideo_enc: Move H.261 size check to h261enc.c 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: rVs6PCvz41D4 Signed-off-by: Andreas Rheinhardt --- libavcodec/h261enc.c | 11 ++++++++++- libavcodec/h261enc.h | 2 +- libavcodec/mpegvideo_enc.c | 11 +++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index b868827160..7aa548c39d 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -382,11 +382,18 @@ static av_cold void h261_encode_init_static(void) init_uni_h261_rl_tab(&ff_h261_rl_tcoeff, uni_h261_rl_len); } -av_cold void ff_h261_encode_init(MpegEncContext *s) +av_cold int ff_h261_encode_init(MpegEncContext *s) { H261EncContext *const h = (H261EncContext*)s; static AVOnce init_static_once = AV_ONCE_INIT; + if (ff_h261_get_picture_format(s->width, s->height) < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "The specified picture size of %dx%d is not valid for the " + "H.261 codec.\nValid sizes are 176x144, 352x288\n", + s->width, s->height); + return AVERROR(EINVAL); + } s->private_ctx = &h->common; s->min_qcoeff = -127; @@ -398,6 +405,8 @@ av_cold void ff_h261_encode_init(MpegEncContext *s) s->intra_ac_vlc_length = s->inter_ac_vlc_length = uni_h261_rl_len; s->intra_ac_vlc_last_length = s->inter_ac_vlc_last_length = uni_h261_rl_len + 128*64; ff_thread_once(&init_static_once, h261_encode_init_static); + + return 0; } const FFCodec ff_h261_encoder = { diff --git a/libavcodec/h261enc.h b/libavcodec/h261enc.h index 0a01858be5..088cd9f4e0 100644 --- a/libavcodec/h261enc.h +++ b/libavcodec/h261enc.h @@ -35,6 +35,6 @@ void ff_h261_reorder_mb_index(MpegEncContext *s); void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y); void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number); -void ff_h261_encode_init(MpegEncContext *s); +int ff_h261_encode_init(MpegEncContext *s); #endif diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index e7e2e60a9a..8d74f9e978 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -682,14 +682,9 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_H261: if (!CONFIG_H261_ENCODER) return AVERROR_ENCODER_NOT_FOUND; - if (ff_h261_get_picture_format(s->width, s->height) < 0) { - av_log(avctx, AV_LOG_ERROR, - "The specified picture size of %dx%d is not valid for the " - "H.261 codec.\nValid sizes are 176x144, 352x288\n", - s->width, s->height); - return AVERROR(EINVAL); - } - ff_h261_encode_init(s); + ret = ff_h261_encode_init(s); + if (ret < 0) + return ret; s->out_format = FMT_H261; avctx->delay = 0; s->low_delay = 1; From patchwork Sun Oct 2 21:18:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38528 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp964020pzh; Sun, 2 Oct 2022 14:18:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43QMdOkMrr35Iz4ShaTJe4rCtmMoHYwczOGi0jc81y30iqTw0ZJEKm5b2nqE8R7LsGQfjS X-Received: by 2002:a17:907:2d8b:b0:781:c864:fffd with SMTP id gt11-20020a1709072d8b00b00781c864fffdmr12727579ejc.681.1664745529685; Sun, 02 Oct 2022 14:18:49 -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 cr19-20020a170906d55300b0078333d9f17bsi7264120ejc.819.2022.10.02.14.18.49; Sun, 02 Oct 2022 14:18:49 -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=f479aAiJ; 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 4DA9968BBC7; Mon, 3 Oct 2022 00:18:40 +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 E055B68BA2B for ; Mon, 3 Oct 2022 00:18:33 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CBfFbnlV2zhHmpPp5VJkgJwFkV+3ZAWY5yHO1kertAygLC8BUM2tAIkcOj4HwX8Lc3aRG07KdTntDMlKjwsJS7MXbObWePdbuoWdMpz9ty/Fs3zlJwq94hU6H5vhsXmNjGy3o//2XW3CO7IZWpWE0EeFJuOriRpbp5huE/SEGNHHsw2BQoNor1QyiYwCI638p1W2fLBLQ1zk7CUMzCFKi4/Epx8WS4kvhMXFGIlEPhR1GNphOuIoO1eDCzMjWEnGXhyaVqsVat9JhhAN3Kkb82zR8c1O8fiRwuB230EBOw0kajM1f0Xqy3hlWBFqXuOAf7DexNkALMajzEGoU9NoLQ== 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=9zdSPYfydJd4d9vMlNPGbcRrhwDV/GxKLEj5F0ObqpA=; b=Ljw+a0Xg+DMpaZK5rej8b5IpnQMYIIFNl8rDXzmm7JVWRH1cvMKTN9YpEFXqu9oWnZZ96hAhjBh2WAHyXCSyhYiljlSanLXiXbwqh5UF+JOwS7/v5Cny2RhrhSnW+5OCmEJs12AfH0Aw9b00xUUPmPxdD6ieZK8Fc/fxloU74ZwJ71BPpHT5KWwcYuTXpVkeSwMDOM0Prku9TKCQwiLD8snq9tIecVavE3onRh4CWvJ/7E82e62Y/TvO5UriMaDpbArvyoYpnrGVS6cfQqtbSO/60shIOczcM/Enqp/Bt/IX/MndhJWqSOznkp/VaPmSKkQRsl55kLQzw/hyQHS64g== 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=9zdSPYfydJd4d9vMlNPGbcRrhwDV/GxKLEj5F0ObqpA=; b=f479aAiJLa2tBPUzzD7HqoMkBil8NJ2TzUEcQe7IOFIFPe7sCG1O078bJqPa1902sui5HmcVuCLunAn7c9lMf3qX6OT6dQfo1LGo7V7x+Qpm9ldV4xZA7Bm+zSeq+2ci8vll+vGtVzw/j3GaJYyVX/OAbdnHux9L39SOtGmfreA9lcnufU1BcHX4QOzKxBX33hQZxOG68HTUZ3zlu43Qelk0AH6vtag3WKfBQV1KV2J1UaFCL+X+TtsLmSsMp/s9ZeXIe0o0Ki5Atu/cf5tL6339pKAgh3Qvzv+3iSKnw5kExNl2zC3Henyd0MvWUQMmaMyMR9J57btgZj6A0sAURQ== 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:24 +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:24 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:18:14 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [lxhVcZqduOu2B+pNfrUVXGWR2v16/zXAx6KJtzTYhn0=] 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-4-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: 4234aaaf-5c5a-4348-80a1-08daa4bba431 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmq9S+lyC0Rq4VBpsdMYmcOkqsHEA97O2r7mXHp7+itzaFGsOyfDnVPa3PmyiDJPjIq5RmfcYRqkHFHaVuYlSZXDkZ9kGcMS5EgKkkpGqz22XCpPiPijhv7MU4rg4zkacXDi4vtvCe9n5zBCdwRqx/JA4qSYG5E2grhq/BQ7qygk9KdlJxMX/GlIPoCGkRthUSN2AMR4CmiqSYh7YNSdoI9jvSnJ0Tjs5vS6tofo9wsMiNXpEJC0X8e2P/NYAUb0qjvucCpeAryRK0voOCuK4HEeUrzGcbjl2uetctn9KF5rURXbDnoByGYT4InnHY0PVV2Rdo68HXDcNZnT8XESt/C25v+TAOaF/zgmZLDlvsPER6uAf4s2DCxr8QwQPGhMqttSoR+kNS0rm+bkwaxOC964CkCEdIovm7m/AutHEbq4cuJrJAubNpq/Cza95YBY9Wny+axnv29jeiBssOgb2jSIxR5ItcK1/0Py/cDSlbrLemoSX/GVE//dsyMhlYUZ+JVEiJ/1lsm4PF3mLqIIq2+JLGKO3O0Bp7kQAOgiGc/rireT0NHOYA577IJ/5uFCn4+U6tX18wBXXalIz7jd8hYPcLELVdG04XMSTmiKajvLyWej6t4hZYBZW4TmKqsNS1gkQ033ddkoOzyZml7zcDUnEcqfk5IJ2uiIzXv1rjJlVCb9QK9XAKPKKC5i3AhzP9x4PYICJWwBXLBSc1yTW8IlUADSNAZac2TQEKzxfIPiftBwFfsVI2hAeV85DHFg9QY= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8VerVHvfg3vjRYZiwiY22kCxNBnrAX0iD0g9P/uV6Gb6bGx4JkNRlkoELmMjUTtCjrsIktDK5uSrGW/zmprlNFh7sDdEfKHqfBftr/gr0H/7KgUfgNG2YkjM1jEZv8z7gbzS4AnWekOsY1yl4oq1yNl6dwNgBaogKWinkpSedL5QzRGkcivfcO2RVg6llsVrielYRMlFeeDxsMMHpUtSHh4yfXdkdvfQQLZ9kXI11t91tobhJOdRrPau7QMSpvHnXBYJrjmjBDc5u7k3321V8ohxs6FXUyx2E7Q/XL4BmGsUN2igiMKgH23/awZgB9TlhlWvrVywZRgdzW2vM7iMnHe9iHi+RhVnJSU2j2S4TSbCeB/qjizq1SH/VxfeL8uXXyUOXqNsd6Twq6ycTwzMSWTEfI0Q218Pl0jAwoPwvkVY7By0YXdefblQgYZHmuNfqER1iprZ05wMP0FlNlzkuibSAJ19OBIh/VdV2BA+B8dRFLa2no1N95K990X45+LUDJNEOiBasTujQ+yxf75BFGGX5ndUJ99oKiXDDDLITlSEaHUDmKs0QRavriBq1Nw+dTTCn7zjDsl6VA4GBc9rP2lPDg9PQvsvHhGtllViOzdcCqm+B7JZPlaJ2WzhOYNXJWiid3XnOP0pqjpSykyU5IwNqodl6XQHakW/vyEFVkVcqKZhceqT69kNYqBzycF X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GqJZCoK+9lVxkmPe0sYmdOlB+SCV7Uaw9W9RkkPYKptk9k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RyGXFfucnMlG/+X4BY9Kc9z9M8Vl2i+69vYwfuZGNhzhqiOkSm2dwru1p7wlgnaCu5aGAwBLEf+ilB1LaRUBvPYt+uteX21L0OSnN4jot1F1v0rCIvRC2AE/mWsMVkFbNKzexVgzXuVumfcIyXpTbwTVUO2EyU5g1ojzaTqjNmLRLt+PEQS/RYLnIh85vbkbCosQG5PTclZzisSmemMpUY X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4234aaaf-5c5a-4348-80a1-08daa4bba431 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:24.8612 (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 5/6] avcodec/h261enc: Store the H.261 format value 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: ZjH1WJkxETUw Signed-off-by: Andreas Rheinhardt --- libavcodec/h261enc.c | 39 +++++++++++++++------------------------ libavcodec/h261enc.h | 1 - 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 7aa548c39d..e8ea357cbb 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -46,25 +46,16 @@ typedef struct H261EncContext { H261Context common; int gob_number; + enum { + H261_QCIF = 0, + H261_CIF = 1, + } format; } H261EncContext; -int ff_h261_get_picture_format(int width, int height) -{ - // QCIF - if (width == 176 && height == 144) - return 0; - // CIF - else if (width == 352 && height == 288) - return 1; - // ERROR - else - return AVERROR(EINVAL); -} - void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number) { H261EncContext *const h = (H261EncContext *)s; - int format, temp_ref; + int temp_ref; align_put_bits(&s->pb); @@ -81,18 +72,13 @@ void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number) put_bits(&s->pb, 1, 0); /* camera off */ put_bits(&s->pb, 1, s->pict_type == AV_PICTURE_TYPE_I); /* freeze picture release on/off */ - format = ff_h261_get_picture_format(s->width, s->height); - - put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */ + put_bits(&s->pb, 1, h->format); /* 0 == QCIF, 1 == CIF */ put_bits(&s->pb, 1, 1); /* still image mode */ put_bits(&s->pb, 1, 1); /* reserved */ put_bits(&s->pb, 1, 0); /* no PEI */ - if (format == 0) - h->gob_number = -1; - else - h->gob_number = 0; + h->gob_number = h->format - 1; s->mb_skip_run = 0; } @@ -102,7 +88,7 @@ void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number) static void h261_encode_gob_header(MpegEncContext *s, int mb_line) { H261EncContext *const h = (H261EncContext *)s; - if (ff_h261_get_picture_format(s->width, s->height) == 0) { + if (h->format == H261_QCIF) { h->gob_number += 2; // QCIF } else { h->gob_number++; // CIF @@ -118,6 +104,7 @@ static void h261_encode_gob_header(MpegEncContext *s, int mb_line) void ff_h261_reorder_mb_index(MpegEncContext *s) { + const H261EncContext *const h = (H261EncContext*)s; int index = s->mb_x + s->mb_y * s->mb_width; if (index % 11 == 0) { @@ -129,7 +116,7 @@ void ff_h261_reorder_mb_index(MpegEncContext *s) /* for CIF the GOB's are fragmented in the middle of a scanline * that's why we need to adjust the x and y index of the macroblocks */ - if (ff_h261_get_picture_format(s->width, s->height) == 1) { // CIF + if (h->format == H261_CIF) { s->mb_x = index % 11; index /= 11; s->mb_y = index % 3; @@ -387,7 +374,11 @@ av_cold int ff_h261_encode_init(MpegEncContext *s) H261EncContext *const h = (H261EncContext*)s; static AVOnce init_static_once = AV_ONCE_INIT; - if (ff_h261_get_picture_format(s->width, s->height) < 0) { + if (s->width == 176 && s->height == 144) { + h->format = H261_QCIF; + } else if (s->width == 352 && s->height == 288) { + h->format = H261_CIF; + } else { av_log(s->avctx, AV_LOG_ERROR, "The specified picture size of %dx%d is not valid for the " "H.261 codec.\nValid sizes are 176x144, 352x288\n", diff --git a/libavcodec/h261enc.h b/libavcodec/h261enc.h index 088cd9f4e0..102e994494 100644 --- a/libavcodec/h261enc.h +++ b/libavcodec/h261enc.h @@ -30,7 +30,6 @@ #include "mpegvideo.h" -int ff_h261_get_picture_format(int width, int height); void ff_h261_reorder_mb_index(MpegEncContext *s); void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y); From patchwork Sun Oct 2 21:18:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38529 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp964058pzh; Sun, 2 Oct 2022 14:18:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NgeCh8l8BAaYydJ93ruvu9chQ8SJAhPeAw3JiYiUUPFtVHTbi8a34HY0QhTiwVjRU/kxS X-Received: by 2002:a05:6402:4511:b0:43b:a182:8a0a with SMTP id ez17-20020a056402451100b0043ba1828a0amr16248229edb.410.1664745537794; Sun, 02 Oct 2022 14:18:57 -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 ev13-20020a056402540d00b00458ef3ccd2asi1505651edb.299.2022.10.02.14.18.57; Sun, 02 Oct 2022 14:18:57 -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=CyGNRAcs; 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 5C7EA68BC21; Mon, 3 Oct 2022 00:18:46 +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 051EE68BBD5 for ; Mon, 3 Oct 2022 00:18:39 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mmy8YuVCO29ZEayJVoqqli9UclmsjREXR7YTj6mI+PTvXYs5/UU1VFbuF4PNqvAVyV+E34lf+LAOiGcH7U6HuoAzwvmU6wgzMdm85HZCOVI4ihacOedovEIebhi+XjX6YlXD2UorrLyzWeJHgav482ThELaN9asNAj/XnJLXV6duQR6lDx/7KHWauZtVKlR9m86O8xlzy/EvXLfvf9HVy7thEKX5ZqWZ5nNooZAAxLPqtU2Rpsqi9yYLCvkT7/HrZLPJImA7zabWNOxOLj6oXVb8PmTvhECYfyqd27IrxL5+MXImtTy94u8groGFZaVCm5SeFCrs9+iS3zb+A+KlTA== 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=dHPybXiAly7hVe0XFXaQc/xlWp00Uqa/isJUK4Ltsa4=; b=mfkq35h6cntk9fhfkvYXCmrQdU+swKLo1x1bCsmklCzeZZSEx23BKNmbkSIIjrxKa0zS7xoXA1/AwpMpPMCz/XhTD23zlIDJ+vCG4+ZN051DSrmdEeetEScoTDT8WH1b/H3+51XAP/0zorJTsGXj8mxX5sCuj2q+p7+l6nkWHNRdnqOrd1rh1WKtg3pYg6mIyjkQXyPXvMt4G9vXVVdrRompSvTpgoYrNrCW0kpkIHnFjw2HnIrtS8SVjtje9qGMewMFiv4635FIVwn83LGo3o7F51wkOByod2iHcfQmzm4d74WB2sEfaM3EgvQahci5coZwp6pfw7ZbM4SgRLogaA== 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=dHPybXiAly7hVe0XFXaQc/xlWp00Uqa/isJUK4Ltsa4=; b=CyGNRAcsFFLoWEhgekV1NGkmLYN1Ur4bTtxX6u4fYcGSZBbiawvMmXeLdgfez3Buqj44MCSw9ReQdk9yuXe0T9rjgAykdiPk6ygxh68ZdLrcFtLfRC/1xEGVTL5o4EuaPZ7hqfckh6L3bIyYCyxIKHXeE7xG/vQt1SMPeQv2eCKxl+BAstGstB+8QegJuZfaWh20dejxwZ4qWEVx+4GzmTbVjP1RqDiBeraG7d+SPJ+DuvLHK0Bet6ImdkCCwgOfzv/OABdFjx0AEb0XD1lFOrWiqfOHancFnBWl2mKdarigmPVpgzDRkoU7t455FNcDkgazwrgMiEFuQLrv3Iz2Dg== 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:26 +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:25 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Oct 2022 23:18:15 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [E3JBXP2Wdl/KxIcI7K0IbdGECNSeNQ1oeJpd1S/ubFY=] 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-5-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: 05012465-885b-4174-0a5e-08daa4bba4cf X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmq9S+lyC0Rq4VBpsdMYmcOkCzPxyfReIouUax32FMHUi/ib4i04qZZ65/VN/Z6WJoL2JDWzGnd8f/dK0e5QX48GIWLwAu+8HH5ZoQKxweVqat+7VkwJD8r2wYJldx/Zm8PopDn1ncJ48V6LGoeLTsF5oAb5fEBy4I+K//NYAX0a0WBgkZsqCYevJjJe/iLtLhPtvpRuOBCLB7Ah11BS14DBNPdHBNtwOX4nGDJaYqkElH1ykR6FwUs3+7kpOk5iYQ1BT+GGgzg5P9bsvD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IkeQRk9n5JTVfHb1fq64LMZg/0nVAtVkLNrQ/jQIzE4biZa8HxrefyoZu9s9yn5wuLePLTjVLt7W1iSIak7qApLOUJxonBNFof98Pwm0gLJ704YwAwl/L5dNF4yzHjndq3hUpBCFY6Ow0SCL/xCUlngeZsOMlXYp9DWjyGVXjBUluUTvPbmhXOjgg8AraVE7Je2WE9YZGmaa8iL1RW/SnBF0YC8cNBW3GaRDzch44wATOmG4cCgZk4rzVb0psiAXi8NLOfm1wCTzgKyKh51ePlq5TQLntQtEH54Ou57SixGETSCw2Uk+HL7fYezdP5P2tLEn+kA2GO7/Vt6/98woPau5KZ2tfdu7Tcm1SwA4a32mh1Shn87G7ISrPXv3jNI0ZaUe2Q1ikiLuATaHfuZcgFBt2T/QWKYiTj/QC7FkUa3TsjvzQPU5yCUTKHl6aYuDj7SJasnrpkEpSYtuClQfvUV8mBf0= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05012465-885b-4174-0a5e-08daa4bba4cf 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:25.8936 (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 6/6] avcodec/mpegvideo_enc: Call ff_mpeg1_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: OajySOOh0mgH 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. Doing so allows to remove a check lateron. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 8d74f9e978..f0fe35d7a3 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -647,17 +647,17 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) s->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1; switch (avctx->codec->id) { - case AV_CODEC_ID_MPEG1VIDEO: - s->out_format = FMT_MPEG1; - s->low_delay = !!(avctx->flags & AV_CODEC_FLAG_LOW_DELAY); - avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); - break; +#if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER case AV_CODEC_ID_MPEG2VIDEO: + s->rtp_mode = 1; + /* fallthrough */ + case AV_CODEC_ID_MPEG1VIDEO: s->out_format = FMT_MPEG1; s->low_delay = !!(avctx->flags & AV_CODEC_FLAG_LOW_DELAY); avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); - s->rtp_mode = 1; + ff_mpeg1_encode_init(s); break; +#endif #if CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_AMV: @@ -895,10 +895,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_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) { + if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) { ff_h263_encode_init(s); if (CONFIG_MSMPEG4ENC && s->msmpeg4_version) ff_msmpeg4_encode_init(s);