[FFmpeg-devel] [PATCH 05/10] avfilter/avf_showcqt: use hypot()

Ganesh Ajjanagadde gajjanag at mit.edu
Wed Dec 2 01:15:21 CET 2015


On Mon, Nov 30, 2015 at 11:15 PM, Muhammad Faiz <mfcc64 at gmail.com> wrote:
> On Sun, Nov 22, 2015 at 9:05 AM, Ganesh Ajjanagadde
> <gajjanagadde at gmail.com> wrote:
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>>  libavfilter/avf_showcqt.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
>> index d6e2928..cd90c88 100644
>> --- a/libavfilter/avf_showcqt.c
>> +++ b/libavfilter/avf_showcqt.c
>> @@ -170,7 +170,7 @@ static double a_weighting(void *p, double f)
>>  static double b_weighting(void *p, double f)
>>  {
>>      double ret = 12200.0*12200.0 * (f*f*f);
>> -    ret /= (f*f + 20.6*20.6) * (f*f + 12200.0*12200.0) * sqrt(f*f + 158.5*158.5);
>> +    ret /= (f*f + 20.6*20.6) * (f*f + 12200.0*12200.0) * hypot(f, 158.5);
>>      return ret;
>>  }
>>
>
> I prefer sqrt in this code, because extra precision and range is not required.

I assume by this you don't consider this a readability improvement
either. Since you are the maintainer ultimately, patch dropped.
Thanks.

>
> Thank's.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list