diff mbox

[FFmpeg-devel,1/3] lavfi/dynaudnorm: rename pow2 to pow_2

Message ID 20170326185359.5182-2-u@pkh.me
State Accepted
Commit 8f9edf89d5d4a90eed4a798175e97e07a885ab79
Headers show

Commit Message

Clément Bœsch March 26, 2017, 6:53 p.m. UTC
This conflict with the DJGPP libc which includes a pow2 function¹

We can not make DJGPP posix only to avoid the conflict due to the lack
of posix_memalign.

[1]: http://www.delorie.com/djgpp/doc/libc-2.02/libc_536.html
---
 libavfilter/af_dynaudnorm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Nicolas George March 26, 2017, 6:56 p.m. UTC | #1
Le sextidi 6 germinal, an CCXXV, Clement Boesch a écrit :
> This conflict with the DJGPP libc which includes a pow2 function¹
> 
> We can not make DJGPP posix only to avoid the conflict due to the lack
> of posix_memalign.

"cannot", I think.

Regards,
Clément Bœsch March 27, 2017, 7:57 p.m. UTC | #2
On Sun, Mar 26, 2017 at 08:56:49PM +0200, Nicolas George wrote:
> Le sextidi 6 germinal, an CCXXV, Clement Boesch a écrit :
> > This conflict with the DJGPP libc which includes a pow2 function¹
> > 
> > We can not make DJGPP posix only to avoid the conflict due to the lack
> > of posix_memalign.
> 
> "cannot", I think.
> 

Updated description with the following:

  We cannot make DJGPP POSIX only (using -D_POSIX_SOURCE) to avoid this
  kind of symbols conflicts due to the lack of both posix_memalign and
  memalign (DJGPP non standard function) in that POSIX mode. We currently
  rely on memalign for aligned heap allocation.
Paul B Mahol March 27, 2017, 8:20 p.m. UTC | #3
On 3/27/17, Clement Boesch <u@pkh.me> wrote:
> On Sun, Mar 26, 2017 at 08:56:49PM +0200, Nicolas George wrote:
>> Le sextidi 6 germinal, an CCXXV, Clement Boesch a ecrit :
>> > This conflict with the DJGPP libc which includes a pow2 function^1
>> >
>> > We can not make DJGPP posix only to avoid the conflict due to the lack
>> > of posix_memalign.
>>
>> "cannot", I think.
>>
>
> Updated description with the following:
>
>   We cannot make DJGPP POSIX only (using -D_POSIX_SOURCE) to avoid this
>   kind of symbols conflicts due to the lack of both posix_memalign and
>   memalign (DJGPP non standard function) in that POSIX mode. We currently
>   rely on memalign for aligned heap allocation.
>

ok
diff mbox

Patch

diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index ddbef26ab5..aa5b28e647 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -341,7 +341,7 @@  static inline double fade(double prev, double next, int pos,
     return fade_factors[0][pos] * prev + fade_factors[1][pos] * next;
 }
 
-static inline double pow2(const double value)
+static inline double pow_2(const double value)
 {
     return value * value;
 }
@@ -384,7 +384,7 @@  static double compute_frame_rms(AVFrame *frame, int channel)
             const double *data_ptr = (double *)frame->extended_data[c];
 
             for (i = 0; i < frame->nb_samples; i++) {
-                rms_value += pow2(data_ptr[i]);
+                rms_value += pow_2(data_ptr[i]);
             }
         }
 
@@ -392,7 +392,7 @@  static double compute_frame_rms(AVFrame *frame, int channel)
     } else {
         const double *data_ptr = (double *)frame->extended_data[channel];
         for (i = 0; i < frame->nb_samples; i++) {
-            rms_value += pow2(data_ptr[i]);
+            rms_value += pow_2(data_ptr[i]);
         }
 
         rms_value /= frame->nb_samples;
@@ -545,7 +545,7 @@  static double compute_frame_std_dev(DynamicAudioNormalizerContext *s,
             const double *data_ptr = (double *)frame->extended_data[c];
 
             for (i = 0; i < frame->nb_samples; i++) {
-                variance += pow2(data_ptr[i]);  // Assume that MEAN is *zero*
+                variance += pow_2(data_ptr[i]);  // Assume that MEAN is *zero*
             }
         }
         variance /= (s->channels * frame->nb_samples) - 1;
@@ -553,7 +553,7 @@  static double compute_frame_std_dev(DynamicAudioNormalizerContext *s,
         const double *data_ptr = (double *)frame->extended_data[channel];
 
         for (i = 0; i < frame->nb_samples; i++) {
-            variance += pow2(data_ptr[i]);      // Assume that MEAN is *zero*
+            variance += pow_2(data_ptr[i]);      // Assume that MEAN is *zero*
         }
         variance /= frame->nb_samples - 1;
     }