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 23D0645B7A for ; Sun, 22 Oct 2023 18:01:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C12B68C9D3; Sun, 22 Oct 2023 21:01:56 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1542868BDD0 for ; Sun, 22 Oct 2023 21:01:49 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 686B9FF80A for ; Sun, 22 Oct 2023 18:01:48 +0000 (UTC) Date: Sun, 22 Oct 2023 20:01:47 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231022180147.GX3543730@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] MULTI VLC decoding boost 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="===============7960470393524473848==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7960470393524473848== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VOMry75tMa4iAEP5" Content-Disposition: inline --VOMry75tMa4iAEP5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 28, 2023 at 07:36:17PM +0200, Paul B Mahol wrote: > Patches attached. >=20 > Thanks for kurosu for pointing unmerged branches. >=20 [...] > +static void add_level(VLC_MULTI_ELEM *table, const int nb_elems, > + const int num, const int numbits, > + const VLCcode *buf, > + uint32_t curcode, int curlen, > + int curlimit, int curlevel, > + const int minlen, const int max, > + unsigned* levelcnt, VLC_MULTI_ELEM *info) > +{ > + if (nb_elems > 256 && curlevel > 2) > + return; // No room this and > + for (int i =3D num-1; i > max; i--) { > + for (int j =3D 0; j < 2; j++) { > + int newlimit, sym; > + int t =3D j ? i-1 : i; > + int l =3D buf[t].bits; > + uint32_t code; > + > + sym =3D buf[t].symbol; > + if (l > curlimit) > + return; > + code =3D curcode + (buf[t].code >> curlen); > + newlimit =3D curlimit - l; > + l +=3D curlen; > + if (nb_elems>256) AV_WN16(info->val+2*curlevel, sym); > + else info->val[curlevel] =3D sym&0xFF; > + > + if (curlevel) { // let's not add single entries > + uint32_t val =3D code >> (32 - numbits); > + uint32_t nb =3D val + (1U << (numbits - l)); > + info->len =3D l; > + info->num =3D curlevel+1; > + for (; val < nb; val++) > + AV_COPY64(table+val, info); > + levelcnt[curlevel-1]++; > + } > + > + if (curlevel+1 < VLC_MULTI_MAX_SYMBOLS && newlimit >=3D minl= en) { this are 2 checks doing the same thing for 8 and 16 bit what mess is this ? for 8bit we have VLC_MULTI_MAX_SYMBOLS space (6) in the array so we skip be= yond that for 16bit we have VLC_MULTI_MAX_SYMBOLS/2 space which is 3 and the skip ins= tead is inside add_level() above with hardcoded litteral number (nb_elems > 256 is a check for if its 8 or 16bit) why is such totally hacked up code pushed with standing objections and no review ? yes, ill fix this one but i have the feeling this code has more surprises > + add_level(table, nb_elems, num, numbits, buf, > + code, l, newlimit, curlevel+1, > + minlen, max, levelcnt, info); > + } > + } > + } > +} [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship: All citizens are under surveillance, all their steps and actions recorded, for the politicians to enforce control. Democracy: All politicians are under surveillance, all their steps and actions recorded, for the citizens to enforce control. --VOMry75tMa4iAEP5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZTVjiAAKCRBhHseHBAsP q51qAJ9UZqLKO4+mLoAD3IiozocuIHscHgCdH9D9OCtXIxT+qT+3l5Cu9k0X6QA= =3Fah -----END PGP SIGNATURE----- --VOMry75tMa4iAEP5-- --===============7960470393524473848== 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". --===============7960470393524473848==--