[FFmpeg-devel] [PATCH] ac3dec: fix non-optimal dithering of zero bit mantissas

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jan 5 12:28:08 CET 2013

On Sat, Jan 05, 2013 at 12:10:11PM +0100, Nicolas George wrote:
> Le sextidi 16 nivôse, an CCXXI, Reimar Döffinger a écrit :
> > Not sure about lfg (though IMHO it should be replaced by lcg anyway to
> > not needlessly waste CPU time) but usually the lower bits contain more
> > "randomness". Thus you should generally be using some kind of modulo
> > operation instead of a division.
> It does not happen frequently, but in that particular case you are
> absolutely wrong.

Yes, I'll have to claim a broken brain.
I stated it completely opposite to what's correct.
See also the NOTES section of e.g. "man rand".
Just forget I said anything.

> The math is absolutely trivial: arithmetic modulo k is a reduction of
> arithmetic modulo n if k is a divisor of n; therefore, the m lower bits of a
> 32-bits LFG is just a m-bits LFG, with at most 2^m period.

I think I get the idea, but I'm horrible at mathematical terms in
English, I only ever learned that stuff with the German terms and a
bit of French, and they translate really horribly I think...

More information about the ffmpeg-devel mailing list