[FFmpeg-devel] [RFC] Lavfi test system

Måns Rullgård mans
Wed Mar 10 02:17:39 CET 2010


Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:

>> > Do you mean av_lfg_get()? Are you suggesting that I should use a C
>> > program (lfg_get.c) for generating such a sequence?
>> 
>> use this:
>> state= state*1664525+1013904223
>> 
>> and dont forget to use *24 >>32, do not use %24
>
> I came out wit this:
>
> lcg_get() { echo "($1 * 1664525 + 1013904223) % 2^32" | bc; }
>
> bc does not know shift operators.

No need for bc.  Use the shell arithmetic expansion $((expression)).
This knows all the standard C integer operators except ++ and --.

http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_06_04

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list