From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 482084F7F5 for ; Mon, 23 Jun 2025 13:42:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 2A0C268E2A2; Mon, 23 Jun 2025 16:39:34 +0300 (EEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E054D68CD15 for ; Mon, 23 Jun 2025 16:39:27 +0300 (EEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-235ef62066eso55902105ad.3 for ; Mon, 23 Jun 2025 06:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750685966; x=1751290766; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=iYQRasZiLVbywQvd2FkdNquTFelUReIndpzNgTU2MX0=; b=dCyrJ4kPZTk3YrC8lXrBCJzdoJO33ubYj/6PsPjxDMJlHktLnl/ioqcp96DQWvxV+B /+jQX9+8MtISwPoiX5b4AnMUg/yfo56vYevjdqTZGhyZ14ai82F6aMKIY5rqAnyJPxqG qNeBbQtiymUPSDQB8y7l+U/iDiRp66vbNryPC44261isHUbowsq34VKx2m7aOWAjCHbE EOZyrfwupi2iakvrWRMcFh3EAun6kzhcZYEk8FizvY/3eFLG5hadC+WlSCJEo7pL9uuB WfYn6qTxoPEGX86hNfuCsdk+VWHR8hZp96K3VTnCeBSuKQ3q3Gjd6Ob7qFzNFX31eMO8 8zhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750685966; x=1751290766; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iYQRasZiLVbywQvd2FkdNquTFelUReIndpzNgTU2MX0=; b=ev0E4OIFBCa0dTUsIjWM4CkBOryuPI/Aa4Ahw5LFO1Ig7KgvwRjfsCvY1MfFvCk8kn v5LuuI2y1Wsu4dlzXlx/a2yNf99CcDSiF8Ve6NTO01zgRenVBKsgSXCpzATefEgLDyXL Tj3gTzoGKsyyIds9dxhmasAOv7fxjVADD/0ZSXUrSk+Dm9k8d+DZ9+QPZfLbn+4JTz5p 9urZHt/8TcsWDgrgrCsMb2ZzOtr4FJllgqCdpODF7EpjkiErMIime251hqxdtzy1PmdV fd9fDNpKB/M0UiBjGnVFYaXQKQVmr/vS7ZtPY3VncunKiYXHGv35UMKa3q8dHIDkGhu1 Ry9A== X-Gm-Message-State: AOJu0YxpiMrd8IDYHktCljlT6IoRyQl49ezmNi/sovfGDW7T9nwRG0M5 9peMMX7Jr4mRi94zmmKXMjV21Ecrw/Y8goViZugyY097m6HjRF2vtSfY1tNVBQ== X-Gm-Gg: ASbGncuO9sIqWALwu/JPYrLzQe9Sw8DM9vZYK7ho8y1AnIW62HI25t9moxIdK+S+rgw dOyJkp0W2EG3q09JsF0MpGIJp3K9bP1v59EDHyfDid4HzlotnnjEg8YxIubBkVljEG0fCgBGT/b QtOwRkh71ArZf8JcEZ8N8yN8wpfEWP758PANCV1GvdaYgwP1JRvHtG/XtbxriHlJfe/IYF5IXaJ QkC6LKUH4yq24Z2P1M9Dk2zxJL25X53Zw0v5tDPdHhw4aALqyMUGdP/Ks0UHxj87Hp9EDSZ4DNw mOXrlJOMhXQV6UYgWafQN7C56jVH2e9ufiE3YcwV1J9VyZT5DhcAVXEuUxDJQf9NsjE27rWXOtc hU3MFVrW1EuK1STLF X-Google-Smtp-Source: AGHT+IH9mb9VZ21hR74Z1Mb86Xh7c2mx5s/QNJvOXRzm22QNtQNoZ0RaxWFMJ3arOcuU3265Uyi0jQ== X-Received: by 2002:a17:902:dace:b0:234:ed31:fc99 with SMTP id d9443c01a7336-237d9777ab4mr192226695ad.21.1750685966164; Mon, 23 Jun 2025 06:39:26 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-237d874589esm83232995ad.249.2025.06.23.06.39.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2025 06:39:25 -0700 (PDT) From: Andreas Rheinhardt X-Google-Original-From: Andreas Rheinhardt Message-Id: In-Reply-To: References: Date: Mon, 23 Jun 2025 13:36:27 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 27/48] avcodec/h263dec: Remove redundant block parameter from decode_mb 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Andreas Rheinhardt With the exception of mpeg4_decode_studio_mb(), all decode_mb functions implicitly presumed that the block provided as argument coincides with MpegEncContext.block (they zeroed the latter and then used the former to decode the block); mpeg4_decode_studio_mb() meanwhile did not use the provided block at all (it uses blocks of int32_t). So remove said parameter. Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 2 +- libavcodec/h263dec.h | 5 ++--- libavcodec/ituh263dec.c | 8 ++++---- libavcodec/mpeg4videodec.c | 12 ++++++------ libavcodec/msmpeg4dec.c | 8 ++++---- libavcodec/rv10.c | 2 +- libavcodec/wmv2dec.c | 6 +++--- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 22bcf40681..5a5a91e675 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -256,7 +256,7 @@ static int decode_slice(H263DecContext *const h) get_bits_count(&h->c.gb), show_bits(&h->c.gb, 24)); ff_tlog(NULL, "Decoding MB at %dx%d\n", h->c.mb_x, h->c.mb_y); - ret = h->decode_mb(h, h->c.block); + ret = h->decode_mb(h); if (h->c.h263_pred || h->c.h263_aic) { int mb_xy = h->c.mb_y * h->c.mb_stride + h->c.mb_x; diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h index 0600e0bcb0..f414da16b1 100644 --- a/libavcodec/h263dec.h +++ b/libavcodec/h263dec.h @@ -46,7 +46,7 @@ extern VLCElem ff_h263_mv_vlc[]; typedef struct H263DecContext { MPVContext c; - int (*decode_mb)(struct H263DecContext *h, int16_t block[6][64]); + int (*decode_mb)(struct H263DecContext *h); } H263DecContext; int ff_h263_decode_motion(H263DecContext *const h, int pred, int f_code); @@ -64,8 +64,7 @@ int ff_h263_decode_mba(H263DecContext *const h); void ff_h263_show_pict_info(H263DecContext *const h, int h263_plus); int ff_intel_h263_decode_picture_header(H263DecContext *const h); -int ff_h263_decode_mb(H263DecContext *const h, - int16_t block[6][64]); +int ff_h263_decode_mb(H263DecContext *const h); int ff_h263_resync(H263DecContext *const h); diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index d37ebaeb0b..25a0781024 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -776,7 +776,7 @@ static int set_direct_mv(MpegEncContext *s) } } -int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) +int ff_h263_decode_mb(H263DecContext *const h) { int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; int16_t *mot_val; @@ -947,7 +947,7 @@ int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) //FIXME UMV if (HAS_FORWARD_MV(mb_type)) { - int16_t *mot_val= ff_h263_pred_motion(&h->c, 0, 0, &pred_x, &pred_y); + int16_t *mot_val = ff_h263_pred_motion(&h->c, 0, 0, &pred_x, &pred_y); h->c.mv_dir = MV_DIR_FORWARD; if (h->c.umvplus) @@ -974,7 +974,7 @@ int ff_h263_decode_mb(H263DecContext *const h, int16_t block[6][64]) } if (HAS_BACKWARD_MV(mb_type)) { - int16_t *mot_val= ff_h263_pred_motion(&h->c, 0, 1, &pred_x, &pred_y); + int16_t *mot_val = ff_h263_pred_motion(&h->c, 0, 1, &pred_x, &pred_y); h->c.mv_dir |= MV_DIR_BACKWARD; if (h->c.umvplus) @@ -1051,7 +1051,7 @@ intra: /* decode each block */ for (i = 0; i < 6; i++) { - if (h263_decode_block(h, block[i], i, cbp&32) < 0) + if (h263_decode_block(h, h->c.block[i], i, cbp&32) < 0) return -1; cbp+=cbp; } diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index e3503b1aca..b2f675b9bc 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1651,7 +1651,7 @@ not_coded: * decode partition C of one MB. * @return <0 if an error occurred */ -static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6][64]) +static int mpeg4_decode_partitioned_mb(H263DecContext *const h) { Mpeg4DecContext *const ctx = h263_to_mpeg4(h); const int xy = h->c.mb_x + h->c.mb_y * h->c.mb_stride; @@ -1711,7 +1711,7 @@ static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6] h->c.bdsp.clear_blocks(h->c.block[0]); /* decode each block */ for (i = 0; i < 6; i++) { - if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, h->c.mb_intra, + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, h->c.mb_intra, use_intra_dc_vlc, ctx->rvlc) < 0) { av_log(h->c.avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", @@ -1738,7 +1738,7 @@ static int mpeg4_decode_partitioned_mb(H263DecContext *const h, int16_t block[6] } } -static int mpeg4_decode_mb(H263DecContext *const h, int16_t block[6][64]) +static int mpeg4_decode_mb(H263DecContext *const h) { Mpeg4DecContext *const ctx = h263_to_mpeg4(h); int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; @@ -2076,7 +2076,7 @@ intra: h->c.bdsp.clear_blocks(h->c.block[0]); /* decode each block */ for (i = 0; i < 6; i++) { - if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, 1, use_intra_dc_vlc, 0) < 0) return AVERROR_INVALIDDATA; cbp += cbp; @@ -2086,7 +2086,7 @@ intra: /* decode each block */ for (i = 0; i < 6; i++) { - if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 0, 0, 0) < 0) + if (mpeg4_decode_block(ctx, h->c.block[i], i, cbp & 32, 0, 0, 0) < 0) return AVERROR_INVALIDDATA; cbp += cbp; } @@ -2353,7 +2353,7 @@ static int mpeg4_decode_dpcm_macroblock(Mpeg4DecContext *const ctx, return 0; } -static int mpeg4_decode_studio_mb(H263DecContext *const h, int16_t block_[12][64]) +static int mpeg4_decode_studio_mb(H263DecContext *const h) { Mpeg4DecContext *const ctx = h263_to_mpeg4(h); int i; diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 0cb14d5762..9d6fddf89a 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -106,7 +106,7 @@ static int msmpeg4v2_decode_motion(H263DecContext *const h, int pred, int f_code return val; } -static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) +static int msmpeg4v12_decode_mb(H263DecContext *const h) { MSMP4DecContext *const ms = mpv_to_msmpeg4(h); int cbp, code, i; @@ -203,7 +203,7 @@ static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) h->c.bdsp.clear_blocks(h->c.block[0]); for (i = 0; i < 6; i++) { - if (ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) + if (ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) { av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", h->c.mb_x, h->c.mb_y, i); @@ -213,7 +213,7 @@ static int msmpeg4v12_decode_mb(H263DecContext *const h, int16_t block[6][64]) return 0; } -static int msmpeg4v34_decode_mb(H263DecContext *const h, int16_t block[6][64]) +static int msmpeg4v34_decode_mb(H263DecContext *const h) { MSMP4DecContext *const ms = mpv_to_msmpeg4(h); int cbp, code, i; @@ -294,7 +294,7 @@ static int msmpeg4v34_decode_mb(H263DecContext *const h, int16_t block[6][64]) h->c.bdsp.clear_blocks(h->c.block[0]); for (i = 0; i < 6; i++) { - if (ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) + if (ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) { av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", h->c.mb_x, h->c.mb_y, i); diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 0a245e90a3..e6e3c4adc0 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -488,7 +488,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, h->c.mv_dir = MV_DIR_FORWARD; h->c.mv_type = MV_TYPE_16X16; - ret = ff_h263_decode_mb(h, h->c.block); + ret = ff_h263_decode_mb(h); // Repeat the slice end check from ff_h263_decode_mb with our active // bitstream size diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index c7b000ec7a..e0f0826159 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -442,7 +442,7 @@ static inline int wmv2_decode_inter_block(WMV2DecContext *w, int16_t *block, } } -static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) +static int wmv2_decode_mb(H263DecContext *const h) { /* The following is only allowed because this decoder * does not use slice threading. */ @@ -522,7 +522,7 @@ static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) h->c.mv[0][0][1] = my; for (i = 0; i < 6; i++) { - if ((ret = wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1)) < 0) { + if ((ret = wmv2_decode_inter_block(w, h->c.block[i], i, (cbp >> (5 - i)) & 1)) < 0) { av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", h->c.mb_x, h->c.mb_y, i); @@ -549,7 +549,7 @@ static int wmv2_decode_mb(H263DecContext *const h, int16_t block[6][64]) h->c.bdsp.clear_blocks(h->c.block[0]); for (i = 0; i < 6; i++) { - ret = ff_msmpeg4_decode_block(ms, block[i], i, (cbp >> (5 - i)) & 1, NULL); + ret = ff_msmpeg4_decode_block(ms, h->c.block[i], i, (cbp >> (5 - i)) & 1, NULL); if (ret < 0) { av_log(h->c.avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".