aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/snow.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/snow.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/snow.c')
-rw-r--r--libavcodec/snow.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index d7f2d7a36e..42cec6b99b 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -4689,7 +4689,8 @@ AVCodec snow_encoder = {
#undef malloc
#undef free
#undef printf
-#undef random
+
+#include "libavutil/lfg.h"
int main(void){
int width=256;
@@ -4699,10 +4700,13 @@ int main(void){
int i;
s.spatial_decomposition_count=6;
s.spatial_decomposition_type=1;
+ AVLFG prn;
+
+ av_lfg_init(&prn, 1);
printf("testing 5/3 DWT\n");
for(i=0; i<width*height; i++)
- buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
+ buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345;
ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
@@ -4713,7 +4717,7 @@ int main(void){
printf("testing 9/7 DWT\n");
s.spatial_decomposition_type=0;
for(i=0; i<width*height; i++)
- buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
+ buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345;
ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);