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 CF86F47EF4 for ; Tue, 31 Oct 2023 22:23:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C00268CD9B; Wed, 1 Nov 2023 00:23:05 +0200 (EET) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67B1C68CD1C for ; Wed, 1 Nov 2023 00:22:58 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id C2A77C0006 for ; Tue, 31 Oct 2023 22:22:57 +0000 (UTC) Date: Tue, 31 Oct 2023 23:22:57 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231031222257.GX3543730@pb2> References: <20231022215113.3469-1-michael@niedermayer.cc> <20231022215113.3469-5-michael@niedermayer.cc> <7096e5b9-6a8e-4875-a3b6-32b2fe2dbb11@gmail.com> <20231023160416.GY3543730@pb2> MIME-Version: 1.0 In-Reply-To: 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="===============6956482386772311455==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6956482386772311455== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OyfsUJKMStKcCjvc" Content-Disposition: inline --OyfsUJKMStKcCjvc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 24, 2023 at 05:54:37AM -0400, Leo Izen wrote: > On 10/23/23 12:04, Michael Niedermayer wrote: > > 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, co= nst 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 d= oes it > > > compare to memset(info, 0, sizeof(*info))? > >=20 > > The struct is 8 bytes, a pointer on 64bit arch is also 8byte > >=20 > > 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. > >=20 > > do you still want me to bechmark this ? > >=20 > > thx > >=20 >=20 > If the struct is only 8 bytes it's probably not necessary. will apply patches 3-5 thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras --OyfsUJKMStKcCjvc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZUF+QAAKCRBhHseHBAsP q2VhAJ42XkqOQzLJvGO29an32nOXdfW2QwCghfMdJoPFCGfUBBIZ6hIZN9LPFDk= =c3A2 -----END PGP SIGNATURE----- --OyfsUJKMStKcCjvc-- --===============6956482386772311455== 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". --===============6956482386772311455==--