From patchwork Fri Oct 21 20:13:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38900 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp957609pzb; Fri, 21 Oct 2022 13:16:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6jiRCOCZaD1BEsSCPumh+fo6DwDzeW1mCyJUNJ3w3G3uDPA/NQBsu//aw1K5+kYSTnBbLJ X-Received: by 2002:a17:907:761b:b0:78d:4990:3f3e with SMTP id jx27-20020a170907761b00b0078d49903f3emr16792377ejc.228.1666383397417; Fri, 21 Oct 2022 13:16:37 -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 d8-20020a50ea88000000b0045ad02bb8fbsi18238808edo.290.2022.10.21.13.16.36; Fri, 21 Oct 2022 13:16:37 -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=DRy8lKNc; 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 AB50368BF80; Fri, 21 Oct 2022 23:14:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2027.outbound.protection.outlook.com [40.92.50.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E07E768BF57 for ; Fri, 21 Oct 2022 23:14:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5edB5CWaz8L5d3yuECf3d4QRqafGjITR2jjhrzxWgHqgtn4NKk27bAg6HvYIIxjameOX5o2O4KndfWb7RmLPM/Ino6zBI9/dQOHcrT9A+olRq4V97E61I9G38u0gc4wHM1XXccBqqJG2cWmL134Hcx1ormyFJMumVnoqOOeBUTBNNxulS9Qg2nPbvvjGoAsv0m2ZQbqpGK3xA2UNESRXfMhzwYJGL4gyktFWWIL84JBw7vGwx8/bOZp9zOvVxo3slXW7Gur+A1X0U/HWR4QYKe5src3+TBsu8pOWeFIqaNLV++eVXZ2d165e45LZd239XVtfza5W73a4AoPjI10Ug== 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=s8tDgYSTREMfvzgn8do4jmdRJ8JYeHaDrZBLbTD1aZU=; b=Ax/6XtLCiv2CWOE+7OuWAKL46UqAq/UA1ZGnZavuP1XEtMovioSDMXHl8EaOoDJuTBUippXfxOHT+DVlqIfKmHVL+dcvN77/NyXfOvFrMfd55HElfnQ8R/lV6zfeks4n2YpiIzvy4U0vFvE2QlQ/ZBG4ggSlZpQ4hbBh3BJCff7GJiUygqE+zNpCGYA2crmlph11ZS9zc7FGqZakUtCfDDfSOGw7Wpfk9WBp4SGDg1Y1JbwnGiZneLSF5GMk6gsqY1VfN7pBdBjbc8MuSIxN7IQ01VwwZu7Pi1AJGnL8KcaGjEYUsZpwELliQva+NRwJDAFQc5CuqXzK6IqDjS8FIA== 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=s8tDgYSTREMfvzgn8do4jmdRJ8JYeHaDrZBLbTD1aZU=; b=DRy8lKNcbNOfYS+sr+Qi94puppZ9XGbSrsgMR5cRhhZo3VVX/Hna43ixXre6ITff4iZZMuxJKvB8Pkn3WAXhGDGgovA6Vp3No2s4qh/IPH+p2L2GgFlc0N/TyIfE2CK4SPs1hqZgTMv/qc6uprfWOE4PdYkVZEa/01v9lT5oKYFyzvw1jxW1BK2lTGqxk5B2n0S4yHpNQuH0E+c0qD1pBxdgDy+XPH0E89SHUE2HRXw1sRh7o7f5VoS69Xe5CzFt3r7w2pljO1IsgC/sTC/dHusEfQxKNyJzYIUucIjdfsh7kwsrQ+fOjmtOEgE2ntXCKxBHA3DJCLaZAW+BSZPJhg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DB4P250MB1007.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:3f1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Fri, 21 Oct 2022 20:14:06 +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:14:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 21 Oct 2022 22:13:00 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [N7TLgILRRqYZkRO+xVd+yot3GpRGZb4csIc7xxGQIDY=] 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-23-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DB4P250MB1007:EE_ X-MS-Office365-Filtering-Correlation-Id: 62176ebe-5795-4008-8ac2-08dab3a0ce12 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3nnHDnbJ910YUAai4EXr732Wb0a09SbiM5hXY/DS4xK26rdh/xvz4Dsid4Xqrq7wEXmIZrjh0X/rElxTg9OW0X+KoVBLTBgjgtDH5c5E3gvJsndL78Gu8ythANqnZzNoA0VN9/XIfIuggu+G4jLk/Y26j2kWq5yzhFjNLd11aTkDiqpencXONxHISjLIhgId446hTZzPkCAd9IlAtLRnmw+gyGKsGyUoVJW41Suu2W9PnuvjC0Qsv+hmmzD44djIJ3GZpGLBdqQkLgC1vyNum4Uf2sBNXC8OvttlXKi6sXY8LSBFWnFJ8zdnFjTehSI98D31sVyEiTnJeKou3nq9B1aOeGXPymyiPmm3rGD6Vn38bxX8H656VnUa+IXVlSl4u+/W5NN2WZdMU0ZDMjfvD2wc/YCj6hf8WT5NyVLqAVk24sDlZU9N/vAHU9RdU11eJ35uI2HdUuAL02XpqnoPUyjC8nDD61k0rhGNbSMbxCqw4fSGaza2/GAzrl2Caj/EHEQoEyqABqytGuEF6Ai4dKNw1OaLPL9Qzc+3dFECS3IULeO7iony4Etpa7rn9GQX278L8xW+/0bPenThdHnzNHulCqTXpgp+gDA7GEPNowiAPz/5jfYxMWOqas96MTq0P7feWy9/CTEeeP8XPeoiqvlJhvGq1tmdLtOEuKXINYGxKSMnUB0OuQDOPLDZRfzc5h6ORzRp65RGhQIDauOly75wnLvhyYBpz/03Z0n/l7HxRbDLdMZFzU7CsQqJ2fv7YDj+1hPeJ8Ugum98FIydoz1 X-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-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62176ebe-5795-4008-8ac2-08dab3a0ce12 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:14:06.1681 (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: DB4P250MB1007 Subject: [FFmpeg-devel] [PATCH v2 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: S14a+jG/9snX 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..2164cd7346 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->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_intra_h_scantable; /* top */ } } else if (s->mb_intra) { /* DC coef */ diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index c4f268c534..4ab558b46f 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->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_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->permutated_intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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->permutated_intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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..77f960a262 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->permutated_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->permutated_intra_v_scantable; } for (i = 63; i > 0; i--) // FIXME optimize diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 4326f7f9a5..c436dc8001 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->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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..ccec0dd75f 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 permutated_intra_h_scantable[64]; + uint8_t permutated_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..3f5dc23130 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->permutated_intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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..8e12e1aab2 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->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_intra_h_scantable; /* top */ } else { scan_table = s->intra_scantable.permutated; } diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 07a5d14f90..543784c813 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->permutated_intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_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;