From patchwork Thu Dec 23 09:13:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32854 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp7105387iog; Thu, 23 Dec 2021 01:14:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIZK7VlQ4WZ/nL1CdsrFNwFfiOfHdOmg5VGUaJN8NKdhwfnO476TSpiteIwnNlfx6a0EfU X-Received: by 2002:a05:6402:d05:: with SMTP id eb5mr1311361edb.360.1640250841035; Thu, 23 Dec 2021 01:14:01 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dn1si1899311ejc.651.2021.12.23.01.14.00; Thu, 23 Dec 2021 01:14:01 -0800 (PST) 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=GGEpf7yg; 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 9D8AE68B153; Thu, 23 Dec 2021 11:13:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071067.outbound.protection.outlook.com [40.92.71.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1CDC568B0D7 for ; Thu, 23 Dec 2021 11:13:50 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xe6Jg+OTXjREJpoNxC1YIeAuoajUcaoaS8UUwx0HGHAEnipMc9K8Pbnm7z5IPMvx3RanfHW+n3NInFmJLIjgOhkCMgv1L4BrWu6Bu8kaRHZ88GnWeH0wntX79nDeHSxp1wgGSWhPzhcdW7rei2pHGNFyCFGLinqPxGjov12eLn961yB7jY4Zoeud6z+yYfSv3fRi4mfgRktyxao0ugGJzqK6LTJdsVNS5X/jc1ITU1UNS5aR+O7apbVDWafY4YDDaljD/zZrkGsC7IH6z0oqKlZ4ELZ+6my3safBqYhTTehAUoj3oEfb1R8h2kUpIH1GI6C4j5rUISVNd1OFjlXTNA== 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=5YhfnvcJQzkTco5d6B559bq2mp+MphB+eAxP9BRpP1w=; b=m9L1dokBgwgpG0O0798FCvu1zF1Zh+T5tKI5PAbedwo9irEE/Rnkg6WbDLeBy3r2UHItmtTuT1hZuVOfFFztiPCS67mDJjRx/g/Ke1Ns+1YLJjP2779eBxB1EBI8pq9lOPf6n1pPFevK0QyMHLyIh6xRgMveMhjYvStdqtDPn14JwPP4E/+Uv/P/+8wkR0X7TpYAbxO1lOb9zJL4q+bozeOT/9a1jDQsNgvrPapyMPy0tPWNEXr7ItR08PjWrlFU4B169Uw9ysg2ACNIpuEo9hk6OkVtO3yWJUKxspPaSsuLGL4G+IKwzW9sDrN/sK4x1WMzEfGLsy3lDjljGtc9iQ== 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=5YhfnvcJQzkTco5d6B559bq2mp+MphB+eAxP9BRpP1w=; b=GGEpf7ygjHOpj5jhgY4Ewp3D1TiF3fc6lZooUOkRUkcZSqHYzIqfgtQLGve+5X6PKTV+KBVI0JUEFvb9xpJ0Dz2avS5oMH3grkaOfBy6zQi4NbKUmObSwgbylG+MTCNcQF7XQ66W1w5WoBCUYRPMqmQswbcls647NP1K3lDgsffmurvl++Y+nuDy/veUEreypbCAyp+rMudmMDioU3KpWnwkYf6KdbWPzPA4v1IsaDAW+p2qOExkHz+dQwd+IjEIqI0y+zSaEYaFIOpexq02+JY4v6KsXpfvofMcTlpmz9q3RCERDLQWaT3DD8y1M1naBK0g9cBaX3X4aQzAP9AKRA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5701.eurprd03.prod.outlook.com (2603:10a6:20b:f6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 23 Dec 2021 09:13:48 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%5]) with mapi id 15.20.4823.019; Thu, 23 Dec 2021 09:13:48 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Dec 2021 10:13:25 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [Jx1wxb08zqsEQ9Mdjdq7XhHbR1JCGAOv] X-ClientProxiedBy: AM4P190CA0016.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::26) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211223091340.1450013-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7163214d-6553-4592-e82b-08d9c5f48707 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiR3EehW4kxQzdNcP2D/mG1J5pW7JZ4oxCTTAlZT5AIFCIj1UXkKa4/bLBoUYXJT34emeMHb+HZA2wqKvNBwsTJRaWf6iEEVJHa7H26wYptywP1eR5uague5cIEFbCYlgGzjG/Z3838PdevC3DL+Iy6OiNw+pbY24KtV2FU68D3a8JCtLRlGMD0m2IL2htTFPsSWN19Ab3pzVQgsecrqCzCDqG/CQko11XFi2AWIAOCsAm2KUSwhXCd9cTEwcMrPvQWBTxDLjF3/XsS3XtnELkwPt49cTjX37N8iAjmyQSjtCjraF3QwQL2DSLaUOnS8w8CAfrjP5OAw5ajWtn8l6ArlIwpVELZWmXbZbBSDYfY7U6C8ln2QzK0DMjC/zR7rNj55nLKcNWajLkqbZzLjEGn8p65/UseBGUOcdnw2khQYb5keMPZmkVWSPgxH0aNZtmQ6znmQgSgrZeZIOR5qaJJpO/j2lOLv6YQMh5jnheD22eii+ng0GgRpExEP0rRmQ4m1xXmo8yHalIey8fO1XdgygpEfr33FzygveVIU9cwONq7yEMslEvjkVCNNbJqSrNx4AKdgSj8D0Z9p0XBm+AfVgYK0AEtkIofFM6Us5Y1jATkFSLMZa/9wjLZ9wrKmlaymPyd51grqdl6LRQx1cJdvMceEPJAbdxzdiwBmYvH+MMu7+sNbxfSpmGV2BMGa1xF7QgeE+pFfuoxgm6e3J5QF8rgOrWOTNQVY2uSTmlJFBxoGQMJkyTieTQGZGeMzFCY= X-MS-TrafficTypeDiagnostic: AM6PR03MB5701:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vaw+eWPHMfzP0MQZLYf64uD0eMeE1csd13JXd5KGckwih5kCbbwxBj2D9dszuZJJTVI5e1p153eMqCoflH50cgu0oYe6j/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KTSps8ajwiIFAcJ7qgjqb/rRhFeckCPbESRx5Mk71dT85VjXVXLOENlo23RO0he0ALspsHxqJm2gGPCOr5YN79cXM8q4A0JwDicadBDAhT1gljnstCdMQdL8tkj1xVls+vaPg1L1x/UbSRvSG831x4XyHl2vWWJebGqkqtr/VbO0HVIfkN59OpESMP1TmWllasvdR1QjA5+xxmY+FxfNNiYVFkr74uOx8DkDQdOpRnOyH6iHB6nx9ktI3xfll3/H+UVhx3e0BrbN7PVUAQkAHiDvxW6Ipply2k56W6s1baBqL8vi5arvudLFRvygJiuK05wTnJM8r00m609DJTINGJGkKJppxhVrCwZnsdfYyEzeRf1PQ5Ef5KrRlA3zCB/jMMY6gxhQjvZ43HZwv4y7Il8D5SRNO9pYthzSziM/cPjJq8iYfa8uH4VYwjO7LXbv5E5A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7163214d-6553-4592-e82b-08d9c5f48707 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2021 09:13:48.2144 (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: AM6PR03MB5701 Subject: [FFmpeg-devel] [PATCH 15/30] avcodec/speedhqenc: Inline constants 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: n2cNICubN1Z3 Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhqenc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 8f8b791164..967774931c 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -213,8 +213,9 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) 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])); } else { - /* escape seems to be pretty rare <5% so I do not optimize it */ - put_bits_le(&s->pb, ff_rl_speedhq.table_vlc[121][1], ff_rl_speedhq.table_vlc[121][0]); + /* escape seems to be pretty rare <5% so I do not optimize it; + * the values correspond to ff_rl_speedhq.table_vlc[121] */ + put_bits_le(&s->pb, 6, 32); /* escape: only clip in this case */ put_bits_le(&s->pb, 6, run); put_bits_le(&s->pb, 12, level + 2048); @@ -222,8 +223,8 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) last_non_zero = i; } } - /* end of block */ - put_bits_le(&s->pb, ff_rl_speedhq.table_vlc[122][1], ff_rl_speedhq.table_vlc[122][0]); + /* end of block; the values correspond to ff_rl_speedhq.table_vlc[122] */ + put_bits_le(&s->pb, 4, 6); } void ff_speedhq_encode_mb(MpegEncContext *s, int16_t block[12][64])