diff options
author | Diego Biurrun <diego@biurrun.de> | 2009-03-20 11:48:27 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2009-03-20 11:48:27 +0000 |
commit | 294eaa26437edf29d866b0bf63d7de57515a0f95 (patch) | |
tree | 605c390daa352a0400dae8422e65af9487f122c4 /libavcodec/rangecoder.c | |
parent | c7594e0764d9d41ec4fb6b14deacd3cc6eafc4b3 (diff) | |
download | ffmpeg-294eaa26437edf29d866b0bf63d7de57515a0f95.tar.gz |
Replace random() usage in test programs by av_lfg_*().
Originally committed as revision 18070 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rangecoder.c')
-rw-r--r-- | libavcodec/rangecoder.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/rangecoder.c b/libavcodec/rangecoder.c index 3c3220da27..c9848e8875 100644 --- a/libavcodec/rangecoder.c +++ b/libavcodec/rangecoder.c @@ -111,13 +111,18 @@ int ff_rac_terminate(RangeCoder *c){ #ifdef TEST #define SIZE 10240 -#undef random + +#include "libavutil/lfg.h" + int main(void){ RangeCoder c; uint8_t b[9*SIZE]; uint8_t r[9*SIZE]; int i; uint8_t state[10]= {0}; + AVLFG prn; + + av_lfg_init(&prn, 1); ff_init_range_encoder(&c, b, SIZE); ff_build_rac_states(&c, 0.05*(1LL<<32), 128+64+32+16); @@ -125,7 +130,7 @@ int main(void){ memset(state, 128, sizeof(state)); for(i=0; i<SIZE; i++){ - r[i]= random()%7; + r[i] = av_lfg_get(&prn) % 7; } for(i=0; i<SIZE; i++){ |