From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 22B5F4D318
	for <ffmpegdev@gitmailbox.com>; Wed, 16 Apr 2025 21:25:00 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8731D689EA6;
	Thu, 17 Apr 2025 00:24:56 +0300 (EEST)
Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net
 [217.70.183.200])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3911F687D66
 for <ffmpeg-devel@ffmpeg.org>; Thu, 17 Apr 2025 00:24:50 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 732964316E
 for <ffmpeg-devel@ffmpeg.org>; Wed, 16 Apr 2025 21:24:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1744838689;
 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=0tFHonbWgQCkxpowO0AeCrFynjmetyTR8Y5fw4cgKjE=;
 b=DCy7a02mjyJQzbgvhJvxFIdk3iL4u6C13hTCvn8vdYuYncQkom62lnaZggnnHAiI4ZWC02
 AIL+cPCAIb44Yg++BRwzHlu4XGYUd90rpiWRzxLy4YnbvJgmNZ9KunGBcZJxTKnaH0lRAb
 Nvbl5jicS3UGnFjUB2/Q7SXQzy792nxTqLxRGPFxp0O+oftk3wgApl1tUhEn4zkwE4w1oe
 Fz8KYbaxEKQSj/8VZvsc6U86WmstjqvPcyTj/lqOoIFOWEZZ2suDC7EKDdUN+WvlYMTyaS
 TCu0nds/qF74uvCfT0kdIRPg0IIqPJdOkdo/yC71r+d3uTRqufFQC1tP+olZ7w==
Date: Wed, 16 Apr 2025 23:24:48 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250416212448.GN4991@pb2>
References: <pull.64.ffstaging.FFmpeg.1744470718.ffmpegagent@gmail.com>
 <b73334be1412100028fa04680a6f964beca85cbb.1744470718.git.ffmpegagent@gmail.com>
MIME-Version: 1.0
In-Reply-To: <b73334be1412100028fa04680a6f964beca85cbb.1744470718.git.ffmpegagent@gmail.com>
X-GND-State: clean
X-GND-Score: -70
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdejgeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutil/dict2: Add AVDictionary2 with
 hash-based lookup
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============9166276350283715244=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250416212448.GN4991@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============9166276350283715244==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="VLBvDZycMVYSbYCJ"
Content-Disposition: inline


--VLBvDZycMVYSbYCJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi

i like AI and ill reply with more comments about this elsewhere
but as i looked at the code, i had to reply here

[...]

> +/* Get a dictionary entry */
> +AVDictionaryEntry2 *av_dict2_get(const AVDictionary2 *m, const char *key,
> +                               const AVDictionaryEntry2 *prev, int flags=
) {
> +    unsigned int hash;
> +    int table_idx;
> +    DictEntry *entry;
> +   =20
> +    static AVDictionaryEntry2 de;  // Return value - holds pointers to i=
nternal data
> +   =20
> +    if (!m || !key)
> +        return NULL;
> +

> +    if (prev)
> +        return NULL;  // 'prev' functionality not implemented

not implemented ?


> +       =20
> +    // Get hash index

> +    hash =3D dict_hash(key, m->flags & AV_DICT2_MATCH_CASE);

case sensitivity is supported by having the set funtiom insert with the
case sensitivity that the get function later will use ?


> +    table_idx =3D hash % m->table_size;
> +   =20
> +    // Search in chain
> +    for (entry =3D m->entries[table_idx]; entry; entry =3D entry->next) {
> +        if ((m->flags & AV_DICT2_MATCH_CASE ?=20
> +             !strcmp(entry->key, key) :=20
> +             !av_strcasecmp(entry->key, key))) {
> +           =20
> +            // Found match
> +            de.key =3D entry->key;
> +            de.value =3D entry->value;
> +            return &de;

tasty globals for thread saftey

thx

[...]
--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.

--VLBvDZycMVYSbYCJ
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaAAgGgAKCRBhHseHBAsP
qw7IAJ99zuULWqfVbfQYoB4QPb+I9QXDCQCaA/eli6qcMXiRHUlkTbTMubn/ozw=
=u1ye
-----END PGP SIGNATURE-----

--VLBvDZycMVYSbYCJ--

--===============9166276350283715244==
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".

--===============9166276350283715244==--