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 578ED47947 for ; Wed, 27 Sep 2023 19:08:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3604068CAF6; Wed, 27 Sep 2023 22:08:03 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6980B68CA33 for ; Wed, 27 Sep 2023 22:07:57 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B00A1240002 for ; Wed, 27 Sep 2023 19:07:56 +0000 (UTC) Date: Wed, 27 Sep 2023 21:07:55 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230927190755.GS3543730@pb2> References: <20230927135617.33952-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 In-Reply-To: <20230927135617.33952-1-ffmpeg@haasn.xyz> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavc/h274: fix PRNG definition 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 Content-Type: multipart/mixed; boundary="===============1990391338844137783==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1990391338844137783== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Vy6UCbb9EK60RK4A" Content-Disposition: inline --Vy6UCbb9EK60RK4A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 27, 2023 at 03:56:15PM +0200, Niklas Haas wrote: > From: Niklas Haas >=20 > The spec specifies x^31 + x^3 + 1 as the polynomial, but the diagram in > Figure 1-1 omits the +1 offset. The initial implementation was based on > the diagram, but this is wrong (produces subtly incorrect results). > --- > libavcodec/h274.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/libavcodec/h274.c b/libavcodec/h274.c > index a69f9411429..fc111cdb50d 100644 > --- a/libavcodec/h274.c > +++ b/libavcodec/h274.c > @@ -38,7 +38,7 @@ static void prng_shift(uint32_t *state) > { > // Primitive polynomial x^31 + x^3 + 1 (modulo 2) > uint32_t x =3D *state; > - uint8_t feedback =3D (x >> 2) ^ (x >> 30); > + uint8_t feedback =3D 1u ^ (x >> 2) ^ (x >> 30); > *state =3D (x << 1) | (feedback & 1u); where can i find the text describing this that you refer to ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart than the original author, trying to rewrite it will not make it better. --Vy6UCbb9EK60RK4A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZRR9iAAKCRBhHseHBAsP q6LkAKCDzBSfuHYNu7SkZaywKcpyuTPETgCglbeuNO+cuuGiz6w/PbCC88/muSM= =JNHc -----END PGP SIGNATURE----- --Vy6UCbb9EK60RK4A-- --===============1990391338844137783== 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". --===============1990391338844137783==--