From patchwork Thu Oct 20 08:45:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38845 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp45911pzb; Thu, 20 Oct 2022 01:47:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FnQWCv72vCskJZRTS4PpwYekjrnkoak13T7nJhDIGvxZP311O7fBagw+5TkjGzljcN2P/ X-Received: by 2002:a05:6402:3806:b0:450:bad8:8cd5 with SMTP id es6-20020a056402380600b00450bad88cd5mr11544734edb.305.1666255641275; Thu, 20 Oct 2022 01:47:21 -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 a19-20020a50e713000000b00458d23f9fd5si15452219edn.242.2022.10.20.01.47.13; Thu, 20 Oct 2022 01:47:21 -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=bftWBYED; 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 D62DF68BE09; Thu, 20 Oct 2022 11:46:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2108.outbound.protection.outlook.com [40.92.91.108]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2EEB68BE09 for ; Thu, 20 Oct 2022 11:46:38 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QRLeSxT89CH0Z/O958OseP321iSg8jv8Q15BB/W/sfQBOFSZTKccutlLkVmaa1oyYDrkNTFmTLbrYkR55QQXTaYIcxY0sT06IQ/Iay+uMq9dpFVfSXlpr362E3sRNzFQ5zHFgKjZbUGVuK6AkbM4SmwaABZ2YuWxwFfnuj9xAUxBfKNxXXLHFYTWnM9GvPGhpftSywwEIOeoNp4mN4JuvYXwU2bKVLCiwWGEvxsaJrtvCwL7LVU4rbn4F5e/T3YiQlX4g6xKZfmpZoft6TXHlwZs0Wv9ZrwMrxALQUqR7jC5PGHSuyiUxeMD4X3SWKWkclhmqR0K1XMgHm/LrG3SHw== 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=ny/FAQjDXFpLYeP4XLeboDrN39DBqzBc9Qbvil464Sg=; b=neUni3GNPtpOF9jYQgQNVQXP7+/QgerpT3ow/oZXRswEGBB+BRUEuIDBz8bjJ2XuYmBx7mv7df8y3PlpZh/RyIQKdFd0ZxwpBmyEK3BAMs8TqG6EbCf/R8ztTKnoUtOIfhptOt89G/WkUGBNV9Ksfm3FoO54SKydQxlUOtDkCr+rPyqTzyUvzkauB7if+GmnCm0EYH1AY2M0+3ZTY0ax1SeJvG5WERVrBENGQoQ6UzPGABO1fSNHobyok1PHdUFDh1y1BYeMO9AycCNSi2sYtwGNuQKwO/lzz06GLoqK451OxiKBi4cAGg/QX0gbLMHVbO5y9VWtSIRcoHZDTwxeOw== 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=ny/FAQjDXFpLYeP4XLeboDrN39DBqzBc9Qbvil464Sg=; b=bftWBYEDLevafySym880q6qf9eDg+U0lgv2mV1VdLQLJcCOut5/oJzUTBkA+gIRmWlZaGiKZd9sW//6H3dw63N1+HFxPdbatN0ll5wnLMix+hiV8pb2exJMX+lUI6/ZyC9df08FqAC6+KFbygFZKqNP1hy8a406yRzrcm+rpjfuBm8X0XoChIT2UJ7KvG/RwDt2FK2RjO59C2Lwg/cJXjWpT1IRxe7qgdiAd/uK+FLbLf+xanq4eOJxiH0b5VmnxXKvXFWXNDettymNjBL7NyJEf6dPfAJhP3mz+nYdYjeI3DUeg3Fn5F0u2tqSN6oaLXOFnvPeBarCleNtPvAEHqA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by GV2P250MB0825.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:aa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Thu, 20 Oct 2022 08:46:37 +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; Thu, 20 Oct 2022 08:46:36 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Oct 2022 10:45:29 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [yNzhvhTL6jTnLml0xEPsxlQE20cP/qdngxqYgOSQy4s=] X-ClientProxiedBy: AS9PR06CA0774.eurprd06.prod.outlook.com (2603:10a6:20b:484::29) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221020084540.2378553-10-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|GV2P250MB0825:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a5c5def-f9ab-4f7e-3470-08dab2779932 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3kEq9VXjGDAyurdVkDmkI7qdHGHEp8DOZCOfXoYhzbe/eBxPBp3TfYbp41QF+Rmaadsa0W4v+rVvhFQ0JINa6lCUIHOKQyoSdjk2Ew6tEBSLvBVzABFiBVeHCkZ5Ri6aEepdhHTsI81zFAWSyrdQRsazjXWqs/cGs0ynEPyH9tEF04q1FD/6tP7zRxmtkxVA8Aj0JP3IANS0Ia44M2f4UvtgFDEjCOApLjPMPCT25W9QSqaMIXorz5chaZ//eTtJg1/8IILzOxxItDInfkcqIEIdBAzbiwb+VKb4scgzpAOpqW18/oiMbhlCMkbzDEbbRtFZfVcNYJvI1EHU7TIBH8WT61UgUIXhoRytugpLUzFo5lBEU7z/LqmlWKHXNVRCw/D7kitEYoZ4VjY7YwLxpiOf9s8sJcVVRNNRToIKzc01LhUbPRQ8zLDCTXyLZctjVeChhNnGTrfyWvMMCmACycx4P6XyFajZbACFQ+wBpW0G5grFKH2m+ZNs82TqBzaBjbKLxV6WVmG2FHVklpsoMutYJ+BvnBmwW1X7QhhdWhA6Gyj5/Q6NdEhqECSHCTPA+DXA+1akgDyOvhgmzGU/XV69SUckYK57VzAdmIfMHnPltFIcToPmRjw0YNRKNwHFSQfamEBwmRpiQCfYp4euX8IKTky5zXLV07gsBwgT0o9voUi1YE94hGWa6klAs+2kojZ49tuyPQucPxM9+DEGqiIXkiEdf5XgQT+oiUGQPUS/umkzPIFRNLoIppMY2Ftoi/Y1IW337G6tihPyCWejHka X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IShaLY2DGi0jrKn1TFhjJz6wsFhTdbmf1ER1BTKef5cVTmIefb49PtI+NaLpGXGb1zWRKXWifftjl2dP09EvEvLdAI7teq3hKktDK2rz2eVjjVO/EMT3A65LRKntaLFs1UpDoFU9abViAssnQ1dT1uKc91+q6Wv5GV7F49PhJPTHvsL45Q7VDfRJvpV/tmZpBUmZFblknDUUfws7f/ymFnu13Coxg+TJlHKZEzkemXKskorvJYtbfFjoDgoWibHIQqldFjZ7YYL2OOY0cqt2bjx3AH29flE8wpkTFk1LheHO4e4PHAs6HHV14ndX688Om7/d9afHkoDyrj4bT2EM9aW6XI6pfNaX3rQiOZk7MSldv+wE5b14E0BP1tu4odnXKqC52nXwmwbfkE+Yn3Zv/R4sAZ+jjAnI92eoBo+opL1pVwXLlc1/JhX8D1JbEL7s6LtL6pFjA/K0dFOIiK33NZ0pqmZtHNYg+QhS5CRx841XR0HP5FDRDCpYzxzdxtkeqGmqtlC2SOUq1tnXGM4Ake4kuybIn/YWoHuwHPdm4LEYhzeQk+Uc8Ln8otG3cn6bkJfBSyxLlUZBLAcReLqN3YkbipGUGXAZSHJhy0qhgkoGJxyBNudYavsFqEBeXwCjBAq+zywZUeYdYEovljFRw+JWnUZ2SZ4H/reb8fwnRkY7zD5CRSFEgfLYF//9nuQG X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4A0pso5tS3PyZ/wz3sx/E8X92e7bqBJ2AMbKqAZTnMuH4mC04+5KT04NqrN1xMMBLaZnTKREj3otrGnE3MTl5VG/154mNPSfL+9+kKyPI6fyM52mLpeejUsYen8tQG+9ijgS1cDB1lDm8BzSBlmfCQWdkFBf29jgoqV8QsdPGBGlB/kBJAIJzNto7LTAMA6MpPzTcMjvmZJzYJhVKNgTqqOfu7MoxkILgF4x36VkeiOguvnQl+sIQMoB7eZm7JcFriAhdH0Y50oSpxiPsdTppDjhDLKJtd+meqHwzlZGoBlNWSY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-Id: 1a5c5def-f9ab-4f7e-3470-08dab2779932 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 08:46:36.9134 (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: GV2P250MB0825 Subject: [FFmpeg-devel] [PATCH 11/22] avcodec/cavs: Only keep what is needed from IDCTDSP-API 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: W5tWFcKJklgu Namely ScanTable.permutated. The rest of the IDCTDSP-API is unused as cavs has its own idct. Signed-off-by: Andreas Rheinhardt --- libavcodec/cavs.c | 7 +++---- libavcodec/cavs.h | 9 ++++++--- libavcodec/cavsdec.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 6d54e8eae5..9658e691d7 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -792,15 +792,14 @@ int ff_cavs_init_top_lines(AVSContext *h) av_cold int ff_cavs_init(AVCodecContext *avctx) { AVSContext *h = avctx->priv_data; + uint8_t permutation[64]; ff_blockdsp_init(&h->bdsp); ff_h264chroma_init(&h->h264chroma, 8); - ff_idctdsp_init(&h->idsp, avctx); ff_videodsp_init(&h->vdsp, 8); ff_cavsdsp_init(&h->cdsp); - ff_init_scantable_permutation(h->idsp.idct_permutation, - h->cdsp.idct_perm); - ff_init_scantable(h->idsp.idct_permutation, &h->scantable, ff_zigzag_direct); + ff_init_scantable_permutation(permutation, h->cdsp.idct_perm); + ff_permute_scantable(h->scantable, ff_zigzag_direct, permutation); h->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_YUV420P; diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h index cbc163fb4d..0852096b66 100644 --- a/libavcodec/cavs.h +++ b/libavcodec/cavs.h @@ -22,12 +22,16 @@ #ifndef AVCODEC_CAVS_H #define AVCODEC_CAVS_H +#include +#include + +#include "libavutil/frame.h" #include "libavutil/mem_internal.h" +#include "avcodec.h" #include "cavsdsp.h" #include "blockdsp.h" #include "h264chroma.h" -#include "idctdsp.h" #include "get_bits.h" #include "videodsp.h" @@ -166,7 +170,6 @@ typedef struct AVSContext { AVCodecContext *avctx; BlockDSPContext bdsp; H264ChromaContext h264chroma; - IDCTDSPContext idsp; VideoDSPContext vdsp; CAVSDSPContext cdsp; GetBitContext gb; @@ -220,7 +223,7 @@ typedef struct AVSContext { int qp_fixed; int pic_qp_fixed; int cbp; - ScanTable scantable; + uint8_t scantable[64]; /** intra prediction is done with un-deblocked samples they are saved here before deblocking the MB */ diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 3e8be65968..11197455e6 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -521,7 +521,7 @@ static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf, { int round = 1 << (shift - 1); int pos = -1; - const uint8_t *scantab = h->scantable.permutated; + const uint8_t *scantab = h->scantable; /* inverse scan and dequantization */ while (--coeff_num >= 0) {