[FFmpeg-cvslog] lavfi/psnr: rename pow2 to pow_2

Clément Bœsch git at videolan.org
Wed Mar 29 15:55:05 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Mar 26 20:43:11 2017 +0200| [4ea8f57548f36b0104bc372b2a6d3d4eaae0ce70] | committer: Clément Bœsch

lavfi/psnr: rename pow2 to pow_2

This conflict with the DJGPP libc which includes a pow2 function¹

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.

[1]: http://www.delorie.com/djgpp/doc/libc-2.02/libc_536.html

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ea8f57548f36b0104bc372b2a6d3d4eaae0ce70
---

 libavfilter/vf_psnr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index af93971..1201b2c 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -70,14 +70,14 @@ static const AVOption psnr_options[] = {
 
 AVFILTER_DEFINE_CLASS(psnr);
 
-static inline unsigned pow2(unsigned base)
+static inline unsigned pow_2(unsigned base)
 {
     return base*base;
 }
 
 static inline double get_psnr(double mse, uint64_t nb_frames, int max)
 {
-    return 10.0 * log10(pow2(max) / (mse / nb_frames));
+    return 10.0 * log10(pow_2(max) / (mse / nb_frames));
 }
 
 static uint64_t sse_line_8bit(const uint8_t *main_line,  const uint8_t *ref_line, int outw)
@@ -86,7 +86,7 @@ static uint64_t sse_line_8bit(const uint8_t *main_line,  const uint8_t *ref_line
     unsigned m2 = 0;
 
     for (j = 0; j < outw; j++)
-        m2 += pow2(main_line[j] - ref_line[j]);
+        m2 += pow_2(main_line[j] - ref_line[j]);
 
     return m2;
 }
@@ -99,7 +99,7 @@ static uint64_t sse_line_16bit(const uint8_t *_main_line, const uint8_t *_ref_li
     const uint16_t *ref_line = (const uint16_t *) _ref_line;
 
     for (j = 0; j < outw; j++)
-        m2 += pow2(main_line[j] - ref_line[j]);
+        m2 += pow_2(main_line[j] - ref_line[j]);
 
     return m2;
 }



More information about the ffmpeg-cvslog mailing list