[vlc-devel] [PATCH] equalizer: Optimize calculations of alpha, beta, and gamma constants

Ron Wright logiconcepts819 at gmail.com
Sat Mar 30 15:02:26 CET 2013


Before I submit a patch with this change, I have a question.  I see that
pow in the EqzConvertdB, PresetCallback, and PreampCallback functions is
used instead of powf, but I didn't make these parts of the code.  Also, the
double-precision version of real-valued literals has been used throughout
the code long before I submitted my very first patch to the equalizer
module a year ago.  Wouldn't it be wise to change these as well?  I could
imagine that this would potentially lead to a snowball effect where I (or
someone else) would have to go through the entire VLC code and change the
double-precision versions of functions and literals used in assignments to
single-precision variables and function arguments to their respective
single-precision versions.

Regards,

Ron Wright


On Sat, Mar 30, 2013 at 5:14 AM, Rémi Denis-Courmont <remi at remlab.net>wrote:

> Le vendredi 29 mars 2013 00:58:47, Ronald Wright a écrit :
> > It is easy to see that the computation of the alpha constant is slightly
> > inefficient, as the root value can be close to 1 for the lower
> frequencies,
> > which would result in significant roundoff error if this value is
> > subtracted from 1.  In this patch, the computation of the alpha, beta,
> and
> > gamma constants has been simplified and refactored.
>
> TBH I don't have a pencil and a paper to double check the maths right now.
> Just wondering though, shouldn't sinf(), cosf() and .5f be used instead?
> (That
> could be a separate patch anyway.)
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130330/e070e0a2/attachment.html>


More information about the vlc-devel mailing list