diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2009-03-18 17:12:44 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-03-18 17:12:44 +0000 |
commit | 9a034dde8bee77f71dd8b80f58a0d1c452bcc15d (patch) | |
tree | 563bbe7f97b72b1d5f6803a0bb4767673bb56b44 /libswscale | |
parent | d0ce212a7ae2e98e5d9c04a5d38896c1993f50f1 (diff) | |
download | ffmpeg-9a034dde8bee77f71dd8b80f58a0d1c452bcc15d.tar.gz |
swscale-example: use LFG instead of random()
Originally committed as revision 28993 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale-example.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 87b9ba027d..993d8db900 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -26,6 +26,7 @@ #undef HAVE_AV_CONFIG_H #include "libavutil/avutil.h" +#include "libavutil/lfg.h" #include "swscale.h" #include "swscale_internal.h" @@ -194,12 +195,15 @@ int main(int argc, char **argv){ int stride[3]={W, W, W}; int x, y; struct SwsContext *sws; + AVLFG rand; sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUV420P, 2, NULL, NULL, NULL); + av_lfg_init(&rand, 1); + for (y=0; y<H; y++){ for (x=0; x<W*4; x++){ - rgb_data[ x + y*4*W]= random(); + rgb_data[ x + y*4*W]= av_lfg_get(&rand); } } sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride); |