[FFmpeg-devel] [PATCH] Add 128 bit murmur3 hash function.

Michael Niedermayer michaelni at gmx.at
Sat May 11 21:21:22 CEST 2013


On Fri, May 10, 2013 at 08:05:18AM +0200, Reimar Döffinger wrote:
> On 10.05.2013, at 04:14, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> +{
> >> +    uint64_t k = get_k1(src);
> >> +    k ^= c->h1;
> >> +    k = ROT(k, 27);
> >> +    k += c->h2;
> >> +    k *= 5;
> >> +    k += 0x52dce729;
> >> +    c->h1 = k;
> >> +
> >> +    k = get_k2(src);
> >> +    k ^= c->h2;
> >> +    k = ROT(k, 31);
> >> +    k += c->h1;
> >> +    k *= 5;
> >> +    k += 0x38495ab5;
> >> +    c->h2 = k;
> >> +}
> > 
> > interleaving the operations a bit might improve performance
> 
> How?

what i had in mind was something like this:
(note, i dont know at all if its faster)

uint64_t k1 = get_k1(src);
uint64_t k2 = get_k2(src);

k1 ^= c->h1;
k2 ^= c->h2;

k1 = ROT(k1, 27);
k2 = ROT(k2, 31);

k1 += D;
k2 += C;

k1 += c->h2;
c->h1 = 5 * k1;

k2 += c->h1;
c->h2 = 5 * k2;

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130511/c7b72b32/attachment.asc>


More information about the ffmpeg-devel mailing list