[FFmpeg-devel] remove libavutil/random.[ch]
Michael Niedermayer
michaelni
Sat Mar 21 16:53:10 CET 2009
On Sat, Mar 21, 2009 at 03:01:29PM +0100, Diego Biurrun wrote:
> libavutil/random.[ch] are deprecated and no longer used anywhere within
> FFmpeg. I propose deleting them, libavutil is currently in an unstable
> state anyway.
i agree with droping it
also if someone distrusts the ALFG/MLFG/LCG then we can add:
George Marsaglias KISS99 (init from me and surely not ideal, sha1/md5
should be used)
typedef struct KISSState{
uint32_t z,w,jsr,jcong;
}KISSState;
static uint32_t get_random(KISSState *s){
s->z = (s->z>>16) + 36969*(s->z&0xFFFF);
s->w = (s->w>>16) + 18000*(s->w&0xFFFF);
s->jsr ^= s->jsr<<17;
s->jsr ^= s->jsr>>13;
s->jsr ^= s->jsr<< 5;
s->jcong= 1234567 + 69069*s->jcong;
return ((s->w + (s->z<<16)) ^ s->jcong) + s->jsr;
}
static void init_random(KISSState *s, uint32_t seed){
s->z = 362436069 ^ seed;
s->w = 521288629 ^ (987654321*seed);
s->jsr = 123456789 + seed;
s->jcong= 380116160 - 314159265*seed;
}
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090321/b8f12a50/attachment.pgp>
More information about the ffmpeg-devel
mailing list