Re: [FFmpeg-devel] [PATCH 06/11] avfilter/af_volumedetect: use log10 instead of hardcoded constant

2015-12-01 Thread Ganesh Ajjanagadde
On Sat, Oct 31, 2015 at 6:12 PM, Ganesh Ajjanagadde
 wrote:
> On Sat, Oct 31, 2015 at 6:02 PM, Mark Harris  wrote:
>> On Wed, Oct 28, 2015 at 9:20 PM, Ganesh Ajjanagadde
>>  wrote:
>>> This is likely more precise and conveys the intent better.
>>>
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>>  libavfilter/af_volumedetect.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
>>> index 01f24ba..ad5fef3 100644
>>> --- a/libavfilter/af_volumedetect.c
>>> +++ b/libavfilter/af_volumedetect.c
>>> @@ -78,7 +78,7 @@ static inline double logdb(uint64_t v)
>>>  double d = v / (double)(0x8000 * 0x8000);
>>>  if (!v)
>>>  return MAX_DB;
>>> -return log(d) * -4.3429448190325182765112891891660508229; /* 
>>> -10/log(10) */
>>> +return log10(d) * 10;
>>
>> Wouldn't this reverse the sign of the result?
>
> Missed the sign, of course you are right. Thanks. I dropped this stuff
> on my end due to the whole log episode, and don't mind if it gets
> included or not. Will leave it to the maintainer to decide.

pushed, thanks.

>
>>
>>>  }
>>>
>>>  static void print_stats(AVFilterContext *ctx)
>>> --
>>> 2.6.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] avfilter/af_volumedetect: use log10 instead of hardcoded constant

2015-10-31 Thread Mark Harris
On Wed, Oct 28, 2015 at 9:20 PM, Ganesh Ajjanagadde
 wrote:
> This is likely more precise and conveys the intent better.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/af_volumedetect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
> index 01f24ba..ad5fef3 100644
> --- a/libavfilter/af_volumedetect.c
> +++ b/libavfilter/af_volumedetect.c
> @@ -78,7 +78,7 @@ static inline double logdb(uint64_t v)
>  double d = v / (double)(0x8000 * 0x8000);
>  if (!v)
>  return MAX_DB;
> -return log(d) * -4.3429448190325182765112891891660508229; /* -10/log(10) 
> */
> +return log10(d) * 10;

Wouldn't this reverse the sign of the result?

>  }
>
>  static void print_stats(AVFilterContext *ctx)
> --
> 2.6.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] avfilter/af_volumedetect: use log10 instead of hardcoded constant

2015-10-31 Thread Ganesh Ajjanagadde
On Sat, Oct 31, 2015 at 6:02 PM, Mark Harris  wrote:
> On Wed, Oct 28, 2015 at 9:20 PM, Ganesh Ajjanagadde
>  wrote:
>> This is likely more precise and conveys the intent better.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavfilter/af_volumedetect.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
>> index 01f24ba..ad5fef3 100644
>> --- a/libavfilter/af_volumedetect.c
>> +++ b/libavfilter/af_volumedetect.c
>> @@ -78,7 +78,7 @@ static inline double logdb(uint64_t v)
>>  double d = v / (double)(0x8000 * 0x8000);
>>  if (!v)
>>  return MAX_DB;
>> -return log(d) * -4.3429448190325182765112891891660508229; /* 
>> -10/log(10) */
>> +return log10(d) * 10;
>
> Wouldn't this reverse the sign of the result?

Missed the sign, of course you are right. Thanks. I dropped this stuff
on my end due to the whole log episode, and don't mind if it gets
included or not. Will leave it to the maintainer to decide.

>
>>  }
>>
>>  static void print_stats(AVFilterContext *ctx)
>> --
>> 2.6.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel