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

madshi madshi at gmail.com
Sat Jan 5 12:00:32 CET 2013

2013/1/5 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> 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.
> In addition, doing division/modulo by a value that is not
> a power of 2 will introduce some bias. It might not be
> relevant, but it should be analyzed to make sure it truly
> isn't.

Well, my knowledge about random numbers is kinda limited. Maybe someone
with more knowledge in that area can improve my patch? In any case, with my
patch applied the frequency response of the AC3 decoder is clearly better
than without it, so the patch seems to work reasonably well as it is...

Best regards, Mathias.

More information about the ffmpeg-devel mailing list