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

Ron Wright logiconcepts819 at gmail.com
Sun Mar 31 18:57:11 CEST 2013


I am not saying that I disagree with the idea to convert all
double-precision function calls and literals to their single-precision
equivalents.  In fact, in my local copy, I have already changed the
equalizer code (including the code in the equalizer_presets.h file) to
address the issue, and now I'm ready for the next step, which is to
send a patch that includes these additional changes.  I guess my
concern is for the equalizer code, so I have likely answered my own
question.

On Sat, Mar 30, 2013 at 9:02 AM, Ron Wright <logiconcepts819 at gmail.com> wrote:
> 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/
>
>



More information about the vlc-devel mailing list