From patchwork Tue Feb 1 13:06:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 34010 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2c4e:0:0:0:0 with SMTP id x14csp607519iov; Tue, 1 Feb 2022 05:16:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKbtk80og2ClpE3jxrz/NDgNHZcezARRpBVTk/qhme7TrMaKgSsFqf6/9kw95qAOwmkbeb X-Received: by 2002:a05:6402:754:: with SMTP id p20mr25032062edy.291.1643721360562; Tue, 01 Feb 2022 05:16:00 -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 13si8882251ejr.618.2022.02.01.05.15.59; Tue, 01 Feb 2022 05:16:00 -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=HHPVZxv1; 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 6011F68B3CF; Tue, 1 Feb 2022 15:08:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075035.outbound.protection.outlook.com [40.92.75.35]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B5E2468B353 for ; Tue, 1 Feb 2022 15:08:39 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ev6I5q6zkVDTn0STyCeu88lQXFT5kHxM5D3dtx0PpZMiwHSbn0/aynntsTjwzO78/DSCMY9DTgBuCFlp1hqUhB2QtXgSrVUJIVglJGWzRkZY/z6o2p9LDq+3vvCmNbFpAlNxu+s8nnxzkcDdG0kVMrVMPjf/xhO6SSx2n1VmFSspEkfizQPtPON8sOWS6G9LU2cFRTtLLSHVdd8GcThMReTtpeGLiomUc3vkfP2gKG9xZc+cWUjphjKICG3MCbxCEdHqti0EfGoh6zH3WCj91NRgFAeG8h19rUnqsVpRSRnyR9a2I6XbLuRSJ3rTCntII/RR2S1SNHJ6+56GocqzCQ== 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=a6A9IqX1LhCsHysY0aMLumbuczHQZRPmz8B9EbdQJDE=; b=cVwrlWxoEwWjvjLES1CXSZgkYgyaFbjWN0bbskP80XoG5cQnJfCPGkkqInb+bV6RGTkQhfs3pn3nT/4iaocAVgozaLRQPk/L+zXY7pJyV3L2roehJyleTVXw798/0Rw6zhOpbLWAhhM1HZ94CtU8vaZ3Ej0gDToKPvxHC4+NJIMuQ0CM/tkFHnC0lb+Wd20iryL7bDbMffIzQLVFKHjzvt4TvLzDBeI2ET30xmtfD1Sn2TfLpV/Gkjz5HOPstz4wYK6pLyEBsZFCpSI1TRv/cmwLfMhmPho7sVzDbqe2/iaQBn0yysQ4VMZCrivy87FJ1ri1ezshpslonwmsplct3Q== 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=a6A9IqX1LhCsHysY0aMLumbuczHQZRPmz8B9EbdQJDE=; b=HHPVZxv1AL7x8j4+jJGQsxIxc7DHZ4NqdxmrVLoOJLPgmBHjK8EOGqRaRtuTOBtSJFfiqXr7NxuGJyDvMiy1uKZCvILxWIgQxdg02KuYcgK42i4yWEVLt1ayqtJKqmrRnwVfyY5mPFseolhpyubp48WT+RHGujSHIOCtwGKlHiWZD80OJJ1USTfdvLhX3zGV9cVFqqkZQ581GSTqesfTpfRpAhiAWhM21BawCmidQhGgDiWraFcuJxA2srF9G4n4zwqOt+7KOosfg6AnBXFqIJNfldRAAE/C3mcxT1PTZGuA2e64TsjMi6ILqr1dwZKjAyO84Pu+74G6GgHGjR7mVA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by HE1PR0301MB2330.eurprd03.prod.outlook.com (2603:10a6:3:73::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22; Tue, 1 Feb 2022 13:08:34 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ac56:2ff4:d304:ab22%6]) with mapi id 15.20.4951.011; Tue, 1 Feb 2022 13:08:34 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Feb 2022 14:06:34 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [k5CwntXExK43su9U/6mxj1Rj9JbbhI3M] X-ClientProxiedBy: AM6P195CA0092.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::33) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220201130706.1420875-36-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5fe88fb-39ec-4d88-bea3-08d9e583e310 X-MS-TrafficTypeDiagnostic: HE1PR0301MB2330:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oufkSKkjpTPmckM+yNfEPby4tvjuCcedIrAO2McEsRrYbkdYaWtDYqheeJf35TqoqE+YR7agpW5TYmpAcNjf+T2xDB2hUmON6ec9UP228cGEq5sJlcK4vXP+otaI4LeFdbVIc/aEYTgyH/rnw9IwH5xQk3kP6s/O2b/2zqupGqKo1TbbLlthKByuYnJcQMx3G5liybUDCXM0E7FkwC7dcYm/whE11iq7LPUuUbowTe1Q9Pd3bMlI8keBXyl1glVI53+WfrP8bUcn+JFH9nURLZOpvMKrVp0u8HyscjHCIY2bclGetpMsvePTbc5h0/TCQacAb9xdQR3cFBgiwCQ7Y9BK7cwUgrnaoMby5xa0j2LabA1kbbuc4zvO8Q4jkwAqDeENsI6Tn003+8ZQBRlHAVpg7Vssn6I58YYUCn98xShD/8Qpzbjegy3lkBKD3dTnCGfOUuGhE5QQZWDSAjlQ59PwllDgh1zqQjwlsFdu4VCS4ZIuAJ2TO/LiiVbQ6r+Bbc7VreFWeIfvnIYGplX4h808n+0YaBOwR5jpm33kNIoKA/ZQDgm9z9QUAh4+yogw X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nDKXWldLhf+5bcHgaej+8dzL8THCSeFcznz1StmZIF4ZwJ2/L3xwdba+6/6XjotS2q1AN0hoKrTt/fXS8B8baTtl4IxEEIfEkqbo60iavxG263UAzsmpaUNF/sCLQ1nkKFM+h8IonsBqCIGUz0T+r9t5MhGewtRUlVqlAfKAUD700no2XisdeZ2OWtmrzVYn+bm7aaNF90Y73sEjv+tFL0xXrObDVpSzKfp53Cad1kSM8rCUqWeqS4OI2Qw+u82NH3O5cMnNTZ/mwKS4Vq0h7Bymo09AmGMH/HCFaz05Rd5l8AJBCK5FMRd5+anl2fdzoZXRMxtRwbOhsRi7RwuktZOjCsl3RUJVY6LvTku1yoWUC2/DgvwzzbPOMBv4aJDGpcjlTrGEqz7frrmY7W/TRV+xD+bDzDhQ/4uC+p7aavpndlYFgDZfIlijEAj6Fd0hK9m5qfOlmsXDd3qiC1hY71V9pW5sJcjJ7aixroL1o+vzoH+aVmr0WtthS5x66FuHK1xSRLJ2ISUnccracOG7TDpY++Oj2CeYdoCefJ3KStqkcStF03L6TTk/AxH0AmF6wYOjwI8TJDT2jDmUg/XcOLw9JaOuMs8EPRrQm5fQUE9k4V/KVKNxFFmhWfE0iW8ntrNafXCpHTqjudAegu5ug3vYa8UY08yxfrdTmfup6z8idLQBRhMpdlmaWoY/p14iUIGxgEmK+KpBow/LdzTnv27q0yqnFivJAlIw2K4RdJZUuREyIY1psN4s0B9saOiMl8STW4LYcohFllL9SwQI+tyGNwLpvtttU2YkPWwC5gGMoF5xj2wfTBK+vyZyiCBsbGK4rTdHinLCHxwyu3XFVlz4iDatBn+nbu9smL5SZPR5EsQdmp4mEergl5m0GNbJ4wbiDyEb/Iycp40ySHdce0taeyQrUq/23SoXmKUpeX5+SmcWMKlYV7IfiqPiuzdUo4oQu6/YWFNy5dgTtOO0dA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5fe88fb-39ec-4d88-bea3-08d9e583e310 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2022 13:08:06.3575 (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: HE1PR0301MB2330 Subject: [FFmpeg-devel] [PATCH v2 37/69] avcodec/mpegvideo: Remove write-only [fb]_code 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: mZD9mat99F4R Signed-off-by: Andreas Rheinhardt --- libavcodec/ituh263enc.c | 1 - libavcodec/mpeg12enc.c | 5 ----- libavcodec/mpeg4videoenc.c | 8 -------- libavcodec/mpegvideo.h | 2 -- libavcodec/mpegvideo_enc.c | 8 -------- 5 files changed, 24 deletions(-) diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 97173bfdc6..56f9f91d19 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -682,7 +682,6 @@ void ff_h263_encode_mb(MPVEncContext *s, if(interleaved_stats){ if (!s->mb_intra) { s->p_tex_bits+= get_bits_diff(s); - s->f_count++; }else{ s->i_tex_bits+= get_bits_diff(s); s->i_count++; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 4b878b2f90..a0cbd5d8de 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -942,7 +942,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s, put_sbits(&s->pb, 2, cbp); } } - s->f_count++; } else { if (s->mv_type == MV_TYPE_16X16) { if (cbp) { // With coded bloc pattern @@ -973,7 +972,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s, s->last_mv[0][1][0] = s->mv[0][0][0]; s->last_mv[0][0][1] = s->last_mv[0][1][1] = s->mv[0][0][1]; - s->f_count++; } if (s->mv_dir & MV_DIR_BACKWARD) { mpeg1_encode_motion(s, @@ -986,7 +984,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s, s->last_mv[1][1][0] = s->mv[1][0][0]; s->last_mv[1][0][1] = s->last_mv[1][1][1] = s->mv[1][0][1]; - s->b_count++; } } else { av_assert2(s->mv_type == MV_TYPE_FIELD); @@ -1019,7 +1016,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s, s->last_mv[0][i][0] = s->mv[0][i][0]; s->last_mv[0][i][1] = s->mv[0][i][1] * 2; } - s->f_count++; } if (s->mv_dir & MV_DIR_BACKWARD) { for (i = 0; i < 2; i++) { @@ -1033,7 +1029,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s, s->last_mv[1][i][0] = s->mv[1][i][0]; s->last_mv[1][i][1] = s->mv[1][i][1] * 2; } - s->b_count++; } } s->mv_bits += get_bits_diff(s); diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index c7b0b3ec02..a8c94c9d28 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -565,8 +565,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], if (!mb_type) { av_assert2(s->mv_dir & MV_DIRECT); ff_h263_encode_motion_vector(s, motion_x, motion_y, 1); - s->b_count++; - s->f_count++; } else { av_assert2(mb_type > 0 && mb_type < 4); if (s->mv_type != MV_TYPE_FIELD) { @@ -579,7 +577,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], s->last_mv[0][1][0] = s->mv[0][0][0]; s->last_mv[0][0][1] = s->last_mv[0][1][1] = s->mv[0][0][1]; - s->f_count++; } if (s->mv_dir & MV_DIR_BACKWARD) { ff_h263_encode_motion_vector(s, @@ -590,7 +587,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], s->last_mv[1][1][0] = s->mv[1][0][0]; s->last_mv[1][0][1] = s->last_mv[1][1][1] = s->mv[1][0][1]; - s->b_count++; } } else { if (s->mv_dir & MV_DIR_FORWARD) { @@ -610,7 +606,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], s->last_mv[0][i][0] = s->mv[0][i][0]; s->last_mv[0][i][1] = s->mv[0][i][1] * 2; } - s->f_count++; } if (s->mv_dir & MV_DIR_BACKWARD) { for (i = 0; i < 2; i++) { @@ -621,7 +616,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], s->last_mv[1][i][0] = s->mv[1][i][0]; s->last_mv[1][i][1] = s->mv[1][i][1] * 2; } - s->b_count++; } } } @@ -797,8 +791,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64], if (interleaved_stats) s->p_tex_bits += get_bits_diff(s); - - s->f_count++; } } else { int cbp; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 06bb704dc2..757c514a6d 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -302,8 +302,6 @@ typedef struct MPVContext { int i_tex_bits; int p_tex_bits; int i_count; - int f_count; - int b_count; int skip_count; int misc_bits; ///< cbp, mb_type int last_bits; ///< temp var used for calculating the above vars diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 7bce5c54ca..c537ce8c19 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -2447,8 +2447,6 @@ static inline void copy_context_before_encode(MPVEncContext *d, d->i_tex_bits= s->i_tex_bits; d->p_tex_bits= s->p_tex_bits; d->i_count= s->i_count; - d->f_count= s->f_count; - d->b_count= s->b_count; d->skip_count= s->skip_count; d->misc_bits= s->misc_bits; d->last_bits= 0; @@ -2478,8 +2476,6 @@ static inline void copy_context_after_encode(MPVEncContext *d, d->i_tex_bits= s->i_tex_bits; d->p_tex_bits= s->p_tex_bits; d->i_count= s->i_count; - d->f_count= s->f_count; - d->b_count= s->b_count; d->skip_count= s->skip_count; d->misc_bits= s->misc_bits; @@ -2787,8 +2783,6 @@ static int encode_thread(AVCodecContext *c, void *arg){ s->i_tex_bits=0; s->p_tex_bits=0; s->i_count=0; - s->f_count=0; - s->b_count=0; s->skip_count=0; for(i=0; i<3; i++){ @@ -3420,8 +3414,6 @@ static void merge_context_after_encode(MPVEncContext *dst, MPVEncContext *src) MERGE(i_tex_bits); MERGE(p_tex_bits); MERGE(i_count); - MERGE(f_count); - MERGE(b_count); MERGE(skip_count); MERGE(misc_bits); MERGE(current_picture.encoding_error[0]);