mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-11-01 00:00:54 +00:00
Replace random() usage in test programs by av_lfg_*().
Originally committed as revision 18070 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
c7594e0764
commit
294eaa2643
9 changed files with 64 additions and 36 deletions
|
|
@ -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++){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue