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

Michael Niedermayer michaelni at gmx.at
Sun May 12 04:00:36 CEST 2013


On Sun, May 12, 2013 at 12:34:29AM +0200, Reimar Döffinger wrote:
> On Sat, May 11, 2013 at 09:21:22PM +0200, Michael Niedermayer wrote:
> > 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)
> 
> For me, the variant I sent is a bit faster still.
> However the big part was using local variables (20%) this gave about
> another 10%.

> But note that the final version runs at 5.7 GB/s for me, I think it
> is kind of pointless to optimize further.

agree, though with hyperthreading less load on one thread can speed
up the other and there might be a tiny reduction in heat & power use
so the 30% speed up wasnt wasted time ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- 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/20130512/e61c2bf0/attachment.asc>


More information about the ffmpeg-devel mailing list