From patchwork Thu Oct 20 17:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38860 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp291242pzb; Thu, 20 Oct 2022 10:24:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4eYaVoaDtF/pBfKRhCFsP4cBetC1Jh1BYnD/X8J4POqZR9Le0vaA8Ay/x709Y9CnR9lEx9 X-Received: by 2002:a17:907:6d03:b0:782:abba:936c with SMTP id sa3-20020a1709076d0300b00782abba936cmr11929588ejc.758.1666286697448; Thu, 20 Oct 2022 10:24: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 g5-20020a50d5c5000000b00457f31c1a10si15494953edj.584.2022.10.20.10.24.56; Thu, 20 Oct 2022 10:24: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=PTkpIHdV; 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 6190368BD67; Thu, 20 Oct 2022 20:24:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2018.outbound.protection.outlook.com [40.92.90.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DF0268BD67 for ; Thu, 20 Oct 2022 20:24:46 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M6uuz5IfWEDcqjoTajFwpn56CYpqm3yYveCkrf28o0+wGhRVOH64SEzg2kdsP5BID0bb65wbFq+oFQ3yfByEDcZTEg8TVx2FT/y4rr5EX5xLXHhCDKr8ajwZOuEuFyeWciMdmgW7IkF/RYDwPxRIrF2cO4/5YnkPx4Ci3E0b1ewYLHEjEFOzqE9MU75JfMqYWCcSBQNsyzU1RGG38r5ZeXNcKKm2nJM1/IaXIfbe/PKweq2S2SHA0bVYhE2FRHh+GHoEk/G9ceHga/W5ziffucXg4NmUuyZRRkuap8dsmBvGVSsLlR+9AGM44p5+x/JHuvVe5uO/D7LM3pcTDlevqQ== 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=decWP5J3aTxtaMc4A/qY6Urb2d1NnIEgaLzpzCVcE+w=; b=igdANwqb1QPuSFQUzr6tjeqKkpqiHzjMSBqSZ+4oz1jIxLDG5q6XJBmKE9lZeIwJV+GfkdOsPWevBCPLawne3DVyB6ahFuWC3PuvaCiZbqQ/aqnYle1gR84E6/ZpCwA6lnPO6X9pq561mpq8M2kSpkMEL8Vd2W+Jx8Ve92GQpDl94vkYZqwizVJZj2UBDWT9FCSZpGgn3Nuak/KmufjfuECFe05MLcK4Yo0gry34xpYkSpH0nxIW0QIQ/C7CUvPRbexuxY4DKzCYvy7H7zxb0jWWJvemUZsNOq34g6HUP3GiI0IhpmAnFanY63G6SnDqcKHwWIMRXxDBZwU6m2BvQA== 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=decWP5J3aTxtaMc4A/qY6Urb2d1NnIEgaLzpzCVcE+w=; b=PTkpIHdVwxNfssudOgh6YBEjAU3abtC5S5z96THdwnRWJstNDJXlf/Rq7J7wIUUUbeQXYg8Lmug52LSYLYhrgldwXFxnPwbHRDiO/6N28ApBX+gZQ8TfEGMpbzSl6wbTZReC8ekpELh/Alp+wbOn99CMmHGNXEt68hq3iS2nfvdQAC5z10hfqFh2GLP0aX/KQFhqpR6aIjr3njB+DbvbpTefcpF5SKnUQAX3qZbtnU2f+Bx91j6+PbHvqe2RlWcV3k49+Dek/TOrpBj2I9F6DYOvUUIqF+2a2HM/QDL7dR7PY+Th+oCbilWapsXGq2MDDpQApXlsntBmBz03zHKc3Q== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS4P250MB0893.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:588::20) 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 17:24:45 +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 17:24:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Oct 2022 19:24:36 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [EIzL+Og97tvn1HwM+tkwVpi/aspXAKay] X-ClientProxiedBy: FR0P281CA0146.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:96::20) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221020172436.2562731-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS4P250MB0893:EE_ X-MS-Office365-Filtering-Correlation-Id: 99cda896-130c-418a-d125-08dab2bffaf3 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3kEq9VXjGDAypV0hhYP5br03QWYT1bvE2KpRMqvOOU1DUgK5W8KMZSWrUsSJH3Spi1N64qcswkOFUcJqJnYPFnOtc+P9oxufEaJr31J12BElU0OM9W6FXNg91edNHb/t5Ass8E+4GZrI7uoiIQgHo3HTRaASYZ5dlyCTqsoO1382lu9CqddvO+43cpUNeU8iTIMw8Dzr1o1UIzou+CSE1iTWrtbJvt7o3l1y6NlWk+w3AFBtOCiTAk1F8XCYB8LOxUPy0UBCvLd5Nyfwm453v7iWlN50lalgbXwU+cDzxWShU6J28foRJPxgV49e5M/Zi1w74pLExXfNanwVMAZuUr2thiErXwJWG5pro8FcFMLoUtSdZczXNylXA0wlQd3rvKX3qOm9Wj79WPuBdP+Lae2Uzrf5FUL2qa9/Q9V712QZM3tOFllDFCb7dCNzgFZC+s6L2+nSp9ISYNKA7e1t+NVACm4Ilfny/Pn6loBg3wlobqGGxpe6wQeOeXSjdJaye8ScVrRd1Y8N8v/T5iRzg9Kr1/r2NDBjk3sXw9Ie2QzldjlfsDZO9I6jdW9DClcLgLMjsTDgc7Zd4YqzllnxEA7hS/mRIyMGkxpR+VCQhVX+1i8freVfloCSshVJwSPZiPZUvIe1aNjp63GsE4f30GYKE6nSstzHrVWeY9I2StybQpqZGma/W6M09VwUKR0pyiUb4+rvmUnEXW64Nz461Y1rvzU29tp5Cr4v78V1pNUbU3nUHjWqzU4oCxFIjQLhGWYnqPVDAZiOb1ZZQ1bifcL X-Microsoft-Antispam: BCL:0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change-CrossTenant-Network-Message-Id: 99cda896-130c-418a-d125-08dab2bffaf3 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 17:24:44.8408 (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: AS4P250MB0893 Subject: [FFmpeg-devel] [PATCH 24/24] avcodec/mpegvideo: Don't use ScanTable where unnecessary 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: 2brFZIqpTEcV For the intra_[hv]_scantables, only ScanTable.permutated is used, so one only needs to keep that. Signed-off-by: Andreas Rheinhardt --- libavcodec/ituh263dec.c | 4 ++-- libavcodec/mpeg4videodec.c | 28 ++++++++++++++++++---------- libavcodec/mpeg4videoenc.c | 4 ++-- libavcodec/mpegvideo.c | 6 ++++-- libavcodec/mpegvideo.h | 4 ++-- libavcodec/msmpeg4.c | 6 ++++-- libavcodec/msmpeg4dec.c | 4 ++-- libavcodec/wmv2.c | 8 ++++---- 8 files changed, 38 insertions(+), 26 deletions(-) diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 200de8527e..2655d026cd 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -544,9 +544,9 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block, i = 0; if (s->ac_pred) { if (s->h263_aic_dir) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->intra_h_scantable; /* top */ } } else if (s->mb_intra) { /* DC coef */ diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index c4f268c534..6fbf4e4220 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1327,9 +1327,9 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, } if (s->ac_pred) { if (dc_pred_dir == 0) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->intra_h_scantable; /* top */ } else { scan_table = s->intra_scantable.permutated; } @@ -3258,13 +3258,17 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, if (s->alternate_scan) { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } else { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } /* Skip at this point when only parsing since the remaining @@ -3432,13 +3436,17 @@ static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) if (s->alternate_scan) { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } else { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } mpeg4_load_default_matrices(s); diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 8e6e35b927..bf499a2206 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -175,7 +175,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], ac_val1[i + 8] = level; } } - st[n] = s->intra_h_scantable.permutated; + st[n] = s->intra_h_scantable; } else { const int xy = s->mb_x - 1 + s->mb_y * s->mb_stride; /* left prediction */ @@ -197,7 +197,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], ac_val1[i + 8] = block[n][s->idsp.idct_permutation[i]]; } } - st[n] = s->intra_v_scantable.permutated; + st[n] = s->intra_v_scantable; } for (i = 63; i > 0; i--) // FIXME optimize diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 4326f7f9a5..cdcf06fe85 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -357,8 +357,10 @@ av_cold void ff_mpv_idct_init(MpegEncContext *s) ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); } - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } static int init_duplicate_context(MpegEncContext *s) diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 6adf724dac..7ba9af3923 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -82,8 +82,8 @@ typedef struct MpegEncContext { * offsets used in ASM. */ ScanTable intra_scantable; - ScanTable intra_h_scantable; - ScanTable intra_v_scantable; + uint8_t intra_h_scantable[64]; + uint8_t intra_v_scantable[64]; struct AVCodecContext *avctx; /* The following pointer is intended for codecs sharing code diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 455436e9c4..a0725c44fa 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -150,9 +150,11 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s) if(s->msmpeg4_version>=4){ ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_wmv1_scantable[2]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_wmv1_scantable[3]); ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]); + ff_permute_scantable(s->intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_wmv1_scantable[3], + s->idsp.idct_permutation); } //Note the default tables are set in common_init in mpegvideo.c diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 05a7ed4db6..098fc55d2b 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -687,9 +687,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, } if (s->ac_pred) { if (dc_pred_dir == 0) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->intra_h_scantable; /* top */ } else { scan_table = s->intra_scantable.permutated; } diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 07a5d14f90..9772035b5b 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -36,12 +36,12 @@ av_cold void ff_wmv2_common_init(MpegEncContext *s) w->wdsp.idct_perm); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, - ff_wmv1_scantable[2]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, - ff_wmv1_scantable[3]); ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]); + ff_permute_scantable(s->intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->intra_v_scantable, ff_wmv1_scantable[3], + s->idsp.idct_permutation); s->idsp.idct_put = w->wdsp.idct_put; s->idsp.idct_add = w->wdsp.idct_add; s->idsp.idct = NULL;