From patchwork Sun Mar 26 18:53:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 3106 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp922830vsy; Sun, 26 Mar 2017 11:54:29 -0700 (PDT) X-Received: by 10.223.128.231 with SMTP id 94mr18386034wrl.20.1490554469912; Sun, 26 Mar 2017 11:54:29 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k83si11387463wma.39.2017.03.26.11.54.29; Sun, 26 Mar 2017 11:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4BB3B6882B9; Sun, 26 Mar 2017 21:53:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from golem.pkh.me (LStLambert-657-1-117-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EBEE0688291 for ; Sun, 26 Mar 2017 21:53:45 +0300 (EEST) Received: from localhost (golem.pkh.me [local]) by golem.pkh.me (OpenSMTPD) with ESMTPA id 24e32b84; Sun, 26 Mar 2017 18:54:01 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 26 Mar 2017 20:53:58 +0200 Message-Id: <20170326185359.5182-3-u@pkh.me> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170326185359.5182-1-u@pkh.me> References: <20170326185359.5182-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] lavfi/psnr: rename pow2 to pow_2 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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/vf_psnr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c index af9397123b..1201b2cd7c 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; }