From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3E9754357C for ; Wed, 16 Nov 2022 13:20:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D877368BCBF; Wed, 16 Nov 2022 15:20:50 +0200 (EET) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D2B768BB72 for ; Wed, 16 Nov 2022 15:20:44 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id t25so43969741ejb.8 for ; Wed, 16 Nov 2022 05:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b5FuCP0DjoTQ+gp9/g/xpDVXHYDBYNxHjdvMJO5vMXw=; b=IovlZWWDziFDkXLE6GLPWEPofSyzlAeHOH+6NleeIRduS005vcxRv+E2p81AWBiwt/ jKCXLXptyGy1t+s9aaByYPYjdB/5vi++caAYNOG0g5uZmEr7IgX3R5/UFdC/2XIXfNG7 Gn8uKaXHUZwZNapOciVG21Uow0M6ApUF/8Jbp0U5gDjPH3DvvADBEMXsclVWvgL0gRjL ZWHS+bzHcJfXWvBIbKPN/ynrgcMSE4vtBDcWZ3z1gFmTnxmmE2kaqK9yC1UBxvnY/gaD lqCwTcrknKCYz4w9pf/lXv5xqPoYJtfo6/XrR0oMH1ca1fx9A64bo+wTe35vw8tegdzQ 11fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b5FuCP0DjoTQ+gp9/g/xpDVXHYDBYNxHjdvMJO5vMXw=; b=nKvwj+zwCk9YXCdyD0jjx/aq/qbBAZIAV9SVT519AGt7y7udCUu8Sr01iSp0HlgxfM S203U4uxN8bzkSsN3OM55jJ5Ui+OEHH4GMx2G7OgXlYVgsrIPr+bUe2G+BsA2ltPSa4/ 1C9mN1MbnPrTJnJ2x8KpewoYF9jRO6Pdaafmu3wtSNlJ8T8mUhCQu2EBc6sfCU64Mdq+ 5O1taLRvgFQGn1gEX86NTBnIlPBX1etu67lGmLQjh02meVHxO+8052QtO4FOMmS/Gy4g k4qPu2l7DZcCebqHRUQYF0+Y5kk26cghb8hztXW3XtMtTVyu9AspvgUKInT5URoLXps1 XG6Q== X-Gm-Message-State: ANoB5pnR5/QeQX7VldOITaUimsJBFJ04kN8whbTBQYjTI7T9cGYfHhMe RiEd1ezyEtdtCyV0e0iC0n/TxFrXncptK0gCfX0iIEd+ X-Google-Smtp-Source: AA0mqf6SOBFc2wCv5T5YzOewT3BQrJ3g+97WP58Fs4YOoIRPZfRTqqNc3uy9n/jQuJYv8fZaR8i90xGFkexuwutLDPA= X-Received: by 2002:a17:906:b2c7:b0:78d:260d:a6e4 with SMTP id cf7-20020a170906b2c700b0078d260da6e4mr17449448ejb.93.1668604843291; Wed, 16 Nov 2022 05:20:43 -0800 (PST) MIME-Version: 1.0 References: <20221116084412.2537585-1-hiroh@chromium.org> In-Reply-To: <20221116084412.2537585-1-hiroh@chromium.org> From: "Ronald S. Bultje" Date: Wed, 16 Nov 2022 08:20:32 -0500 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/vp8: Fix wrong vpx_rac_is_end() check 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: Hirokazu Honda 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: Hi, On Wed, Nov 16, 2022 at 3:44 AM Hirokazu Honda wrote: > The check of vpx_rac_is_end check(s) are added originally from > 1afd246960202917e244c844c534e9c1e3c323f5. It causes a regression > of some vp8 stream. b6b9ac5698c8f911841b469af77199153278c55c fixes > the regression by a sort of band-aid way. This fixes the wrongness > of the original commit. vpx_rac_is_end() should be called against > the bool decoder for the vp8 headr context, not one for each > coefficient. Reference is vp8_dixie_tokens_process_row() in token.c > in spec 20.16. > > Fixes: Ticket 8069 > Fixes: regression of 1afd246960202917e244c844c534e9c1e3c323f5. > Fixes: b6b9ac5698c8f911841b469af77199153278c55c > > Signed-off-by: Hirokazu Honda > --- > libavcodec/vp8.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c > index 67f36d8933..77f5a6b657 100644 > --- a/libavcodec/vp8.c > +++ b/libavcodec/vp8.c > @@ -2404,7 +2404,8 @@ static av_always_inline int > decode_mb_row_no_filter(AVCodecContext *avctx, void > int num_jobs = s->num_jobs; > const VP8Frame *prev_frame = s->prev_frame; > VP8Frame *curframe = s->curframe; > - VPXRangeCoder *c = &s->coeff_partition[mb_y & > (s->num_coeff_partitions - 1)]; > + VPXRangeCoder *coeff_c = &s->coeff_partition[mb_y & > (s->num_coeff_partitions - 1)]; > + > VP8Macroblock *mb; > uint8_t *dst[3] = { > curframe->tf.f->data[0] + 16 * mb_y * s->linesize, > @@ -2412,7 +2413,7 @@ static av_always_inline int > decode_mb_row_no_filter(AVCodecContext *avctx, void > curframe->tf.f->data[2] + 8 * mb_y * s->uvlinesize > }; > > - if (vpx_rac_is_end(c)) > + if (vpx_rac_is_end(&s->c)) > return AVERROR_INVALIDDATA; > > if (mb_y == 0) > @@ -2443,7 +2444,7 @@ static av_always_inline int > decode_mb_row_no_filter(AVCodecContext *avctx, void > td->mv_bounds.mv_max.x = ((s->mb_width - 1) << 6) + MARGIN; > > for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) { > - if (vpx_rac_is_end(c)) > + if (vpx_rac_is_end(&s->c)) > return AVERROR_INVALIDDATA; > // Wait for previous thread to read mb_x+2, and reach mb_y-1. > if (prev_td != td) { > @@ -2471,7 +2472,7 @@ static av_always_inline int > decode_mb_row_no_filter(AVCodecContext *avctx, void > prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_PREVIOUS); > > if (!mb->skip) > - decode_mb_coeffs(s, td, c, mb, s->top_nnz[mb_x], > td->left_nnz, is_vp7); > + decode_mb_coeffs(s, td, coeff_c, mb, s->top_nnz[mb_x], > td->left_nnz, is_vp7); > > if (mb->mode <= MODE_I4x4) > intra_predict(s, td, dst, mb, mb_x, mb_y, is_vp7); > -- > 2.38.1.431.g37b22c650d-goog > Thanks for the fix. So, you're transferring the truncation check from the per-slice coef buffer to the "main" mode/mv buffer. Shouldn't we check both? Or is one of them allowed to be truncated? (That seems unlikely, but that appears to be what you're suggesting here, otherwise there wouldn't be any artifacts.) If that *is* the case, this needs a comment somewhere, otherwise we'll forget this over time. Ronald _______________________________________________ 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".