[FFmpeg-devel] [PATCH 2/2] doc/utils/eval: clarify meaning of random* seed value
Michael Koch
astroelectronic at t-online.de
Wed Jan 3 13:20:12 EET 2024
> Possible address trac issue:
> http://trac.ffmpeg.org/ticket/10763
I don't like the random generator as it is, because the first two random numbers
are very close to zero, as can be shown with this command line:
ffmpeg -loglevel repeat -f lavfi -i nullsrc=size=1x1,format=gray -vf
"geq=lum='print(random(0));print(random(0));print(random(0));print(random(0))'"
-frames 1 -y out.png 0.000000 0.000091 0.285346 0.929202 This behaviour
can be improved by inizializing the generator with a large number as
seed value. I'm not sure if it's a good idea to share the same variables
for ld() and st() (as double) and random() (as unsigned int). Wouldn't
it be better to use separate variables for random()? Michael
More information about the ffmpeg-devel
mailing list