From patchwork Fri Oct 21 20:12: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: 38890 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp956583pzb; Fri, 21 Oct 2022 13:14:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64ADQ/UKqWt+jGfWnKl6FgD8WBsJp1rLYlUoPoNDa0zT8jdtWNaDE3baZT2deT9hUhvVP9 X-Received: by 2002:a05:6402:448c:b0:457:52eb:b57e with SMTP id er12-20020a056402448c00b0045752ebb57emr19385833edb.178.1666383298634; Fri, 21 Oct 2022 13:14:58 -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 sa19-20020a1709076d1300b0078dcdbe650fsi19185361ejc.443.2022.10.21.13.14.58; Fri, 21 Oct 2022 13:14:58 -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="PKneTOX/"; 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 E6BED68BF39; Fri, 21 Oct 2022 23:13:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073025.outbound.protection.outlook.com [40.92.73.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0517C68BF10 for ; Fri, 21 Oct 2022 23:13:47 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=et4P4nZ4kZVynJKstRNefrQa3GnO426CyGDkhHDow31D0EZ8M+6WOJ/Cg1NrymtmNDHjnFwhb2XK+m9lYk3yBst8sLm8+kLZLCFhh6KLmgL7CRvnQh3zZt3PbX5CltbgnlPburol51OHe7vVVIaSlMT2xtACRMWsjdOcdcQ3UKElbrHekAmWY1sEryyqGGbwc1iAR3EgAiE7+gpUUjGyR/hH3PMul1gEHyk3A5ELE2vwe0WVUEGS/ks0LgLAkn6e7DD2H4Mg4/WVnyqNlxHNviAF3Ab7xddrKHX/TqYdqCTm3/A5fhF0LmXUbkWbMu1zlVdzpzo6NxhUXPmnKtzOuA== 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=mM3H2+iwj897ugM4kMiqVnvwQNkqb367zBPFI4P5YDg=; b=IPjTcVGN4r7GG0QOBF4h2fe8/k4I8lICcPzqiprYVzjb8TKTN6WWirI45tmfaWCltz4C45h89zbk+tLVn7uB+LVwJe8WhpNOtAYnK84rHa+OznDsJHDeKMYbMsgwrAWDTR9ccnDE58L/0z1vof0swrHLhAIPR/VWbX0PVbJkxL+VBkNRQeW3MSkkxGAl10cYs8KMdi1T2loO0iyWE4A/TgNHWGsea4dGNn62lqp+czbcj06j+b8xJupGmadvHd31kH9HmivOMDt9tXOJTPd5yV4XqlaA0fqzYKMNQC38Nwkhy/cvCGDIxJyjFfku7gJXGJ/tgbVuB+0CU/1F+IvWcA== 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=mM3H2+iwj897ugM4kMiqVnvwQNkqb367zBPFI4P5YDg=; b=PKneTOX/zU7XXHQLKkIuYZjwusMmTtZ9OFXpP6BOXh0x8PvGgKVr1E1HbPsyveiX5TtJV5wA759tL8lqNwSJti7kO6Zkqho6z98ZI+NZVkxY/nXGPJzTqmrxs+gpu7SwzSF5pSGKoMsnQWAJmjmmS9sEpcSCoeJgAm8NHjKzrddQvdMnqr2bzNJeWUAfx9CwyhmHvIUPn/tWnT/RF7SHqiVQ6BrNPNPVov62oWStyzGcMSzcB7pW2vW9fCZ2p2XrHSFHiS7b4qfS8X1BUhfL6z1P6HkXRL40H8IWxBBfKawYOvY9edGEhmsglcL+egl0/0939Zw1xs5JB88mqo8W1w== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB0818.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Fri, 21 Oct 2022 20:13:46 +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; Fri, 21 Oct 2022 20:13:46 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 21 Oct 2022 22:12:49 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [pcqfdE1XrEue3BZEAhWaeMfguozQN9HKhhOd3kbVYNo=] X-ClientProxiedBy: AM5PR0101CA0027.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::40) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221021201300.3565913-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU0P250MB0818:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bc7bdf0-a7f7-47c1-aca4-08dab3a0c256 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKxlwt21SJ65rVaESusrU4PPVFiBlO/HSF9D+FtWZgRg5RVeRhWc5ZRNDLJULB1bocGAiU+Cln10JY5YpJ7Wz1pIdTSNGOoA8iKCPOl7yh+244vNB/DJcWHY2NORG27dorKIeIeDfsOu68fPAznrMMTe/4yPLq1iOEXUOi4vs9mFIFBwS8ECm1lu50iqq668pQGmKRV7tlHv4DW2uZWx57W+E4T0MQmkEJv9dsEpPB80egi+yPf0QnImF58DlI33mK862kU2eKRH9XNDm6at2T8d89k9qLFS9BCUFJsQqC8vzTJ1IXNHMpCjLbTQAG8+mdfzfG3UX6noKDVsr1bW2KiZdoZl9suZH9fSVn2T48/WtsXzOB12Q8e+vuBei+9ZLkMZm7sE5t2xT+OrQ4Rr8Ym2FBcA/+zbzoWulRTAdysbijKFUV4K4bsfoJp1W43CQ+Qpo7AjiNbNqJTbsbbS7bkUFQSGVhNTe/bYhtsWWxVexaLn87icRvxYj/rjJbVgqo75NrAEG+YIcUsueNAQMSUM3HJGQKrcMomCUX/LoGmh89cJ5zTGcY4jwF9Fk6zqvylZF/9r1UwtV9qbmo72l7kaGsfK5dm6k/LOd9wMKudQb5KGGUIb1SxZb1T7ZcZ3LnhnL5CNRM1+qyf3nM5ZiwMXU6Ne9niTG9sGN1Eavt3KyHSuIYfKR6ymugLMEitQ89sLMXv0e7eP83t1RZUXu1g05IY2Jbff50E= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VQgL/4YQN5oA0B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f7-47c1-aca4-08dab3a0c256 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 20:13:46.4664 (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: DU0P250MB0818 Subject: [FFmpeg-devel] [PATCH v2 13/24] avcodec/g2meet: Pre-permute quantization tables 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: +zAO3wEsnb4N Allows to avoid a permutation lateron. Signed-off-by: Andreas Rheinhardt --- libavcodec/g2meet.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 1973ed0741..761fd22fc3 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -59,22 +59,23 @@ enum Compression { COMPR_KEMPF_J_B, }; +/* These tables are already permuted according to ff_zigzag_direct */ static const uint8_t luma_quant[64] = { - 8, 6, 5, 8, 12, 20, 26, 31, - 6, 6, 7, 10, 13, 29, 30, 28, - 7, 7, 8, 12, 20, 29, 35, 28, - 7, 9, 11, 15, 26, 44, 40, 31, - 9, 11, 19, 28, 34, 55, 52, 39, - 12, 18, 28, 32, 41, 52, 57, 46, - 25, 32, 39, 44, 52, 61, 60, 51, - 36, 46, 48, 49, 56, 50, 52, 50 + 8, 6, 6, 7, 6, 5, 8, 7, + 7, 7, 9, 9, 8, 10, 12, 20, + 13, 12, 11, 11, 12, 25, 18, 19, + 15, 20, 29, 26, 31, 30, 29, 26, + 28, 28, 32, 36, 46, 39, 32, 34, + 44, 35, 28, 28, 40, 55, 41, 44, + 48, 49, 52, 52, 52, 31, 39, 57, + 61, 56, 50, 60, 46, 51, 52, 50, }; static const uint8_t chroma_quant[64] = { - 9, 9, 12, 24, 50, 50, 50, 50, - 9, 11, 13, 33, 50, 50, 50, 50, - 12, 13, 28, 50, 50, 50, 50, 50, - 24, 33, 50, 50, 50, 50, 50, 50, + 9, 9, 9, 12, 11, 12, 24, 13, + 13, 24, 50, 33, 28, 33, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, @@ -250,7 +251,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb, int nbits = val; val = get_xbits(gb, nbits); - val *= qmat[ff_zigzag_direct[pos]]; + val *= qmat[pos]; block[c->permutated_scantable[pos]] = val; } }