summaryrefslogtreecommitdiff
path: root/libavcodec/motion-test.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/motion-test.c
parentc7594e0764d9d41ec4fb6b14deacd3cc6eafc4b3 (diff)
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/motion-test.c')
-rw-r--r--libavcodec/motion-test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c
index 38f59946a8..90f0a2e1bc 100644
--- a/libavcodec/motion-test.c
+++ b/libavcodec/motion-test.c
@@ -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 @@ uint8_t img2[WIDTH * HEIGHT];
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 @@ int main(int argc, char **argv)
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);