aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cabac.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2009-03-20 11:48:27 +0000
committerDiego Biurrun <diego@biurrun.de>2009-03-20 11:48:27 +0000
commit294eaa26437edf29d866b0bf63d7de57515a0f95 (patch)
tree605c390daa352a0400dae8422e65af9487f122c4 /libavcodec/cabac.c
parentc7594e0764d9d41ec4fb6b14deacd3cc6eafc4b3 (diff)
downloadffmpeg-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/cabac.c')
-rw-r--r--libavcodec/cabac.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index c2a7f8a1e5..c3b3429764 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -179,9 +179,9 @@ void ff_init_cabac_states(CABACContext *c){
}
#ifdef TEST
-#undef random
#define SIZE 10240
+#include "libavutil/lfg.h"
#include "avcodec.h"
#include "cabac.h"
@@ -191,12 +191,14 @@ int main(void){
uint8_t r[9*SIZE];
int i;
uint8_t state[10]= {0};
+ AVLFG prn;
+ av_lfg_init(&prn, 1);
ff_init_cabac_encoder(&c, b, SIZE);
ff_init_cabac_states(&c);
for(i=0; i<SIZE; i++){
- r[i]= random()%7;
+ r[i] = av_lfg_get(&prn) % 7;
}
for(i=0; i<SIZE; i++){