diff motion-test.c @ 9199:ea0e5e9a520f libavcodec

Replace random() usage in test programs by av_lfg_*().
author diego
date Fri, 20 Mar 2009 11:48:27 +0000
parents e9d9d946f213
children b225f51903af
line wrap: on
line diff
--- a/motion-test.c	Fri Mar 20 11:43:58 2009 +0000
+++ b/motion-test.c	Fri Mar 20 11:48:27 2009 +0000
@@ -30,10 +30,10 @@
 #include <unistd.h>
 
 #include "dsputil.h"
+#include "libavutil/lfg.h"
 
 #undef exit
 #undef printf
-#undef random
 
 #define WIDTH 64
 #define HEIGHT 64
@@ -44,9 +44,12 @@
 void fill_random(uint8_t *tab, int size)
 {
     int i;
+    AVLFG prn;
+
+    av_lfg_init(&prn, 1);
     for(i=0;i<size;i++) {
 #if 1
-        tab[i] = random() % 256;
+        tab[i] = av_lfg_get(&prn) % 256;
 #else
         tab[i] = i;
 #endif
@@ -142,7 +145,7 @@
     ctx = avcodec_alloc_context();
     ctx->dsp_mask = FF_MM_FORCE;
     dsputil_init(&cctx, ctx);
-    for (c = 0; c < 2; c++) {
+    for (c = 0; c < 1; c++) {
         int x;
         ctx->dsp_mask = FF_MM_FORCE | flags[c];
         dsputil_init(&mmxctx, ctx);