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 5305C4780A for ; Mon, 23 Oct 2023 16:04:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D33A68CA28; Mon, 23 Oct 2023 19:04:25 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CBDD68C077 for ; Mon, 23 Oct 2023 19:04:18 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A0EA060006 for ; Mon, 23 Oct 2023 16:04:17 +0000 (UTC) Date: Mon, 23 Oct 2023 18:04:16 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231023160416.GY3543730@pb2> References: <20231022215113.3469-1-michael@niedermayer.cc> <20231022215113.3469-5-michael@niedermayer.cc> <7096e5b9-6a8e-4875-a3b6-32b2fe2dbb11@gmail.com> MIME-Version: 1.0 In-Reply-To: <7096e5b9-6a8e-4875-a3b6-32b2fe2dbb11@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 5/9] avcodec/vlc: Pass VLC_MULTI_ELEM directly not by pointer 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="===============0917557199565588877==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0917557199565588877== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PQ3YpS11RFYEtDOL" Content-Disposition: inline --PQ3YpS11RFYEtDOL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 23, 2023 at 02:10:35AM -0400, Leo Izen wrote: > On 10/22/23 17:51, Michael Niedermayer wrote: > > This makes the code more testable as uninitialized fields are 0 > > and not random values from the last call > >=20 > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/vlc.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > >=20 > > diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c > > index 9b7a42f79a3..4adec2da705 100644 > > --- a/libavcodec/vlc.c > > +++ b/libavcodec/vlc.c > > @@ -356,7 +356,7 @@ static void add_level(VLC_MULTI_ELEM *table, const = int is16bit, > > uint32_t curcode, int curlen, > > int curlimit, int curlevel, > > const int minlen, const int max, > > - unsigned* levelcnt, VLC_MULTI_ELEM *info) > > + unsigned* levelcnt, VLC_MULTI_ELEM info) >=20 >=20 > Is passing a struct by value advisable? Did you benchmark this? How does = it > compare to memset(info, 0, sizeof(*info))? The struct is 8 bytes, a pointer on 64bit arch is also 8byte I did not benchmark, I think this code doesnt run that many iterations (when its not buggy), I mean each iteration adds a entry to the table and the table will normally be designed to fit in cache and its only for initializing. do you still want me to bechmark this ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. --PQ3YpS11RFYEtDOL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZTaZfQAKCRBhHseHBAsP qwGlAJwPaPym94u5fmoYY47/l4rQGgrqqgCgkifmYNv1cm9AbYkl9wqkQ0UvY94= =Wpbn -----END PGP SIGNATURE----- --PQ3YpS11RFYEtDOL-- --===============0917557199565588877== 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". --===============0917557199565588877==--