From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id D2A254EAB7
	for <ffmpegdev@gitmailbox.com>; Mon, 12 May 2025 22:19:47 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F220687CA1;
	Tue, 13 May 2025 01:19:42 +0300 (EEST)
Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net
 [217.70.183.196])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3B18687C55
 for <ffmpeg-devel@ffmpeg.org>; Tue, 13 May 2025 01:19:35 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 334FC43349
 for <ffmpeg-devel@ffmpeg.org>; Mon, 12 May 2025 22:19:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1747088375;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=lUrmGt9NpSYt/jxdHib/+M0kklOzZ6NTYnN6EeizMh0=;
 b=QX6g1igpZ54ZPt2OWbFfZSWoVu2NbV/QTa3rlVJ3hRFTUszHYfCOM5QP8HF/c4spFEpKOP
 7p8H+VC9InbT1lcCRboe5N9Of7YjoOeFSUDxm2EXZGA9wvJ2gDDwHiQHTOLtHXQtPFaT7B
 1EvfarvVpdoseL+0FT1mG4dbg6OJ3kNc+6JCr3mZxSlUOAGf/PbYKwcvnXPLeOBFqafBfu
 m7nOJS33N2sBlw1x/xBxIzzCYDA/PHaiUgkeXwoNjnwYn1mKhYi7HBCRA0RDaTn4Aeeyvw
 3yof6+CUd7p7kXqx67oynQ20UdD3rtpmJ8y2xe7NlfDVi2sncFV9ck/uoPlvow==
Date: Tue, 13 May 2025 00:19:34 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250512221934.GB29660@pb2>
References: <9220e0fb-3fdb-46a5-8319-76e1aa613a29@visionular.com>
MIME-Version: 1.0
In-Reply-To: <9220e0fb-3fdb-46a5-8319-76e1aa613a29@visionular.com>
X-GND-State: clean
X-GND-Score: -90
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftddvgeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculddutddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeffledtfeevfeffheeuuefhtdejieelueeftdeitdfgheetgefffeefteekffdthfenucffohhmrghinhepfhhfmhhpvghgrdhorhhgnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/h264_mb: Fix buffer stride for
 arm
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============2428483981430455371=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250512221934.GB29660@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============2428483981430455371==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="JyUo+2rKuw1VKSUr"
Content-Disposition: inline


--JyUo+2rKuw1VKSUr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 21, 2025 at 08:37:55PM +0800, Bin Peng wrote:
>=20
>=20
> On 2025/4/16 8:24, Michael Niedermayer wrote:
> > On Tue, Apr 08, 2025 at 07:22:32PM +0800, Bin Peng wrote:
> >> When decoding a bitstream with weighted-bipred enabled,
> >> the results on ARM and x86 platforms may differ.
> >>
> >> The reason for the inconsistency is that the value of
> >> STRIDE_ALIGN differs between platforms. And STRIDE_ALIGN
> >> is set to the buffer stride of temporary buffers for U
> >> and V components in mc_part_weighted.
> >>
> >> If the buffer stride is 32 or 64 (as on x86 platforms),
> >> the U and V pixels can be interleaved row by row without
> >> overlapping, resulting in correct output.
> >> However, on ARM platforms where the stride is 16,
> >> the V component will overwrite part of the U component's pixels,
> >> leading to incorrect predicted pixels.
> >>
> >> The bug can be reproduced by the following bitstream.
> >>
> >> https://trac.ffmpeg.org/attachment/ticket/11357/inter_weighted_bipred2=
=2E264
> >>
> >> And the ref/fate file is also added in this patch.
> >>
> >> Fixes: ticket 11357
> >> Signed-off-by: Bin Peng <pengbin@visionular.com>
> >> ---
> >>  libavcodec/utils.c                            |  4 ++-
> >=20
> >>  .../h264-conformance-weighted_bipred2.264     | 31 +++++++++++++++++++
> >=20
> > is this supposed to be a fate test ?
> > if so theres something missing also the file extension is a bit mislead=
ing
>=20
> Yes, sorry for the file extension, It should has no extension.
>=20
> I guess we don't need this fate test after you merged your better fix.
>=20
> > and tests covering more cases is always welcome
> >=20
> >=20
> >>  2 files changed, 34 insertions(+), 1 deletion(-)
> >>  create mode 100644 tests/ref/fate/h264-conformance-weighted_bipred2.2=
64
> >>
> >> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> >> index 90867ed6b1..5d15f5c8fa 100644
> >> --- a/libavcodec/utils.c
> >> +++ b/libavcodec/utils.c
> >> @@ -144,6 +144,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, =
int *width, int *height,
> >>      int i;
> >>      int w_align =3D 1;
> >>      int h_align =3D 1;
> >> +    int stride_align =3D STRIDE_ALIGN;
> >>      AVPixFmtDescriptor const *desc =3D av_pix_fmt_desc_get(s->pix_fmt=
);
> >> =20
> >>      if (desc) {
> >> @@ -339,13 +340,14 @@ void avcodec_align_dimensions2(AVCodecContext *s=
, int *width, int *height,
> >>          // increasing witdth ensure that the temporary area is large =
enough,
> >>          // the next rounded up width is 32
> >>          *width =3D FFMAX(*width, 32);
> >> +        stride_align =3D FFMAX(stride_align, 32);
> >=20
> > does the following fix this too ?
>=20
> Yes, I checked your change on my local test, it also fix this issue, and =
your fix is better.

will apply

thx

[...]
--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Homeopathy is like voting while filling the ballot out with transparent ink.
Sometimes the outcome one wanted occurs. Rarely its worse than filling out
a ballot properly.

--JyUo+2rKuw1VKSUr
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaCJz7AAKCRBhHseHBAsP
qyjBAJ45k1CUOTG5r3Yzbwlj3QkfgMqBUgCfYU27LepLYWL5JmH6W4H2dLJtJ8s=
=9Rm5
-----END PGP SIGNATURE-----

--JyUo+2rKuw1VKSUr--

--===============2428483981430455371==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
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".

--===============2428483981430455371==--