From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A13634B82F for ; Fri, 30 May 2025 19:23:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 308A268DE22; Fri, 30 May 2025 22:23:09 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id C5E8568DDCC for ; Fri, 30 May 2025 22:23:02 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 30D2F43A69 for ; Fri, 30 May 2025 19:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1748632982; 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=0OxYGbi4bfGvZmahR8oz1RNg14/oIODuOftTO8bZ++U=; b=JajFwzGbv7nxMlkIGVn2p03b6xCm2JECgJ28+uL8uI9ghDDNHteLTvKtIl7j+dpqMpgFaF xgq+dVcU6L1PjMMMwsUxV63Er4kaz0YgkYHlIGmScHkXUrKShpK9J/Em96m2dV5Gh7eUXR ATgdWPBby2lsvVWfgagHMrYVRQdRmKpCfrdSgX3nb/QX3K4UQa5Acv6fhlU5wED5ky8Jpn +P23lcfzENCjOpAzWtJ/mBZQwx9/dQI0wWkcvfPR2svr2wNxxhbbqMDrAriI1T6FtKbhLz h04jvnEEjcPODkKy9VTgtMokXG7fuhXKE0NzCzWY/Sqg/b7ZAPTm34BNMZ3FDw== Date: Fri, 30 May 2025 21:23:01 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250530192301.GJ29660@pb2> References: <20250425160509.54880-1-emma@emma.gg> MIME-Version: 1.0 In-Reply-To: <20250425160509.54880-1-emma@emma.gg> X-GND-State: clean X-GND-Score: -93 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgddvleekgeculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeffffevhfehvdduhfegleefgfeviedvgfevgeefgffgheekgfdufeetiedvleefleenucffohhmrghinhepuhifrghtvghrlhhoohdrtggrnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v5 1/3] lavc/hashtable: create generic robin hood hash table 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="===============6853912363988522961==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6853912363988522961== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jlzMyYUOO8BCbMOc" Content-Disposition: inline --jlzMyYUOO8BCbMOc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 26, 2025 at 01:05:07AM +0900, Emma Worley wrote: > Adds a generic hash table with the DXV encoder as an initial use case. >=20 > Signed-off-by: Emma Worley > --- > libavcodec/Makefile | 2 + > libavcodec/hashtable.c | 214 +++++++++++++++++++++++++++++++++++ > libavcodec/hashtable.h | 91 +++++++++++++++ > libavcodec/tests/hashtable.c | 110 ++++++++++++++++++ > 4 files changed, 417 insertions(+) > create mode 100644 libavcodec/hashtable.c > create mode 100644 libavcodec/hashtable.h > create mode 100644 libavcodec/tests/hashtable.c [...] > diff --git a/libavcodec/hashtable.h b/libavcodec/hashtable.h > new file mode 100644 > index 0000000000..a26eb30cec > --- /dev/null > +++ b/libavcodec/hashtable.h > @@ -0,0 +1,91 @@ > +/* > + * Generic hashtable > + * Copyright (C) 2024 Connor Worley > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1= 301 USA > + */ > + > +#ifndef AVCODEC_HASHTABLE_H > +#define AVCODEC_HASHTABLE_H > + > +#include > + > +/* Implements a hash table using Robin Hood open addressing. > + * See: https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf > + */ > + > +typedef struct FFHashtableContext FFHashtableContext; > + > +/** > + * Create a fixed-sized Robin Hood hash table. > + * > + * @param ctx context to allocate and initialize > + * @param key_size size of key type in bytes > + * @param val_size size of value type in bytes > + * @param max_entries maximum number of key-value pairs to store > + * > + * @return zero on success, nonzero on error > + */ > +int ff_hashtable_alloc(struct FFHashtableContext **ctx, size_t key_size,= size_t val_size, size_t max_entries); I think this API should clarify how the hash of a object and object equality is defined. One can guess that from just a size and pointer that would be defined on a bytewise compare and hash() of the bytes. But this should be spelled out explicitly thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus --jlzMyYUOO8BCbMOc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaDoFlQAKCRBhHseHBAsP qwsZAJ99IIfW4LrwE4CBaX5tm3j2Lo4+BQCbBCmZ5IoEE+QowC5tcE7qwKyHIN8= =3pJ/ -----END PGP SIGNATURE----- --jlzMyYUOO8BCbMOc-- --===============6853912363988522961== 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". --===============6853912363988522961==--