From patchwork Thu May 11 23:12:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 41588 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp4983395pzb; Thu, 11 May 2023 16:13:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5icjLbuU8R+8mvV1uiCcH3H36XHT3esct6TnGreDcpOIOP1MxB/aNO5YqlNAnl9zMnB9zJ X-Received: by 2002:a17:907:70d:b0:948:eed:b4e0 with SMTP id xb13-20020a170907070d00b009480eedb4e0mr21149289ejb.61.1683846784391; Thu, 11 May 2023 16:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683846784; cv=none; d=google.com; s=arc-20160816; b=qDrB+A2Ka0Tc+2XZeG7eIb2tpvyBYQn1WnEPQ5U2SR23dUkURRb36YLmllv5lo3nXJ XOXq4Q0wGBitPC6cmPsqbcHlTI8wB5cAb90KCo8T+11F3aTMj/nYw5TIL7vTvzIHWN1R x8qsTxtEm/7B13PBiPeannov/ruAAZs6FBy7kFChlt8igV4z9ZwdfwIfajRPVnhuRhBs k+OGJPUH1BtK83ngL8vUFA8HMsVIJShoibVOZ9S9L/qsgdSdQsEJKkwmHlIgcgJWl42j M+vrmLSNIqAfMiRNoyy7QPBo4RyRMElaMbCo80GMqXZYZSfA0n0ksZXcfzMtfei3civq x9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=Gt19S9p1xK9a5itiq6tff1euxK+S2v/mwripTJmQIj8=; b=gjwIzWx1+ek5EMckvJa4zmW0tymLCNR8PcdEcpRK8I+ZmKbS0IkphM6mqPqCg4WIIQ vfA7VFBPnC2xQPoIgiv0taaBSCSxybO3a7p1ywpFqacSfCyqYiwe6wBPs3PWbgT5ejsQ Jw/5CiE6mQQsmacB4uY/YvcNhy05GFiKwByyINpOIkV/tix1jOmgHDnXXQpXHAxdLAN5 rDMPRdHdqw1Wjnl3fMcPH5ap3qLN1eYikhtlvFlK+53mRV84QsbIQTlW45+JB1/6YkZc xa7TRtckbryWFJJwQQHrXbRcliQMGY3awr+/zXqEeqiA8ZNUCC/uR3e1F1WaKmgOtNJ9 /nFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=QlKIvq6w; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e21-20020a170906375500b0096176dedf7bsi6452405ejc.436.2023.05.11.16.12.59; Thu, 11 May 2023 16:13:04 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=QlKIvq6w; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A872668C100; Fri, 12 May 2023 02:12:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4385E68BF20 for ; Fri, 12 May 2023 02:12:49 +0300 (EEST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-195c61067beso5877968fac.1 for ; Thu, 11 May 2023 16:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683846767; x=1686438767; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=M2vJNKHxo8FoxXITpMIN77pGezkqmLYKWN2GV2l4d/U=; b=QlKIvq6w/N+mfhgBbKFOvEoZKdc9G3lT1/jzAbhhBUA+nJqWpimRWs1XOEbklGi/qL 6D0cXALanotQ9+pay/t1a2eNMDpFuCKEHtP3+dAUnWYiXnTPaNEWVsSr9zrmOWQIQc7A Q7o1ZAup5wEd3TN2/1pnLmDj68XpdrWFPJk1/hBjVJWznku9bOP/KH/Kp6nNjVc9isNM 0EgMyG93sHeEp/wj276DgHFFftXBvDRrBSAAoXQqOcCthiMgn1lmeAZm5gDQ74ZwuGsr 76TubLlCeY5QsVBdb2eLDfJ4E7bybs1CZ4Qx1GwFMDV3ZWA3HKnfk95qJd0AsOfDHZIP ZUTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683846767; x=1686438767; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M2vJNKHxo8FoxXITpMIN77pGezkqmLYKWN2GV2l4d/U=; b=EcHtIc9Ry9uCtwgHKXiQzOQ3kv72SyyzLB/8m1ioVOYocYEF36qLPEc7AhZpI1zG7z JQrDrwXNhxmaOonorGH7O6IVhBFbdFaZPN3/oNJmG+2aEqn4AKN7VmvrqdIIOlrGgQL7 zFVT8dsxtqGkknH1vz2YdkKJht41R3S3wO6TvZk8EvUGqWQfREylwNC2puRMXKX/LuYh LIPAVozAj74fU7X51wJPYepiDFwbdlnIuhEYcVGkJFNeolr5NgZzdDJ3GAhwo8yqsYO7 rqL4TzM4iQtB3LWl/BeAT8b3h91YaQLr5I9XGh45YclGncX40fwsQHYiN+SqWoVYft/r T1Ow== X-Gm-Message-State: AC+VfDwm/jeyjNKmlo+WC08yZcx6VMz7H7FWdnybpiYETkM6GwY95TNs zhXH+p0J7zbGGwx7fGgDgA5EdBn0xz0= X-Received: by 2002:a05:6870:7301:b0:188:a59:e46d with SMTP id q1-20020a056870730100b001880a59e46dmr11457646oal.0.1683846766940; Thu, 11 May 2023 16:12:46 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id zf10-20020a0568716a8a00b001728669a604sm8528376oab.5.2023.05.11.16.12.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 16:12:46 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 11 May 2023 20:12:29 -0300 Message-Id: <20230511231230.15668-1-jamrial@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avutil/mathematics: add missing constants X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: yd9K5ABQE7B2 Including float variants for all of them. Signed-off-by: James Almer --- libavutil/mathematics.h | 51 +++++++++++++++++++++++++++++++++++++++++ libavutil/version.h | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index e4aff1e973..3e7b52eed6 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -36,30 +36,81 @@ #ifndef M_E #define M_E 2.7182818284590452354 /* e */ #endif +#ifndef M_Ef +#define M_Ef 2.7182818284590452354f /* e */ +#endif #ifndef M_LN2 #define M_LN2 0.69314718055994530942 /* log_e 2 */ #endif +#ifndef M_LN2f +#define M_LN2f 0.69314718055994530942f /* log_e 2 */ +#endif #ifndef M_LN10 #define M_LN10 2.30258509299404568402 /* log_e 10 */ #endif +#ifndef M_LN10f +#define M_LN10f 2.30258509299404568402f /* log_e 10 */ +#endif #ifndef M_LOG2_10 #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ #endif +#ifndef M_LOG2_10f +#define M_LOG2_10f 3.32192809488736234787f /* log_2 10 */ +#endif #ifndef M_PHI #define M_PHI 1.61803398874989484820 /* phi / golden ratio */ #endif +#ifndef M_PHIf +#define M_PHIf 1.61803398874989484820f /* phi / golden ratio */ +#endif #ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ #endif +#ifndef M_PIf +#define M_PIf 3.14159265358979323846f /* pi */ +#endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 /* pi/2 */ #endif +#ifndef M_PI_2f +#define M_PI_2f 1.57079632679489661923f /* pi/2 */ +#endif +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* pi/4 */ +#endif +#ifndef M_PI_4f +#define M_PI_4f 0.78539816339744830962f /* pi/4 */ +#endif +#ifndef M_1_PI +#define M_1_PI 0.31830988618379067154 /* 1/pi */ +#endif +#ifndef M_1_PIf +#define M_1_PIf 0.31830988618379067154f /* 1/pi */ +#endif +#ifndef M_2_PI +#define M_2_PI 0.63661977236758134308 /* 2/pi */ +#endif +#ifndef M_2_PIf +#define M_2_PIf 0.63661977236758134308f /* 2/pi */ +#endif +#ifndef M_2_SQRTPI +#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ +#endif +#ifndef M_2_SQRTPIf +#define M_2_SQRTPIf 1.12837916709551257390f /* 2/sqrt(pi) */ +#endif #ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif +#ifndef M_SQRT1_2f +#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */ +#endif #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #endif +#ifndef M_SQRT2f +#define M_SQRT2f 1.41421356237309504880f /* sqrt(2) */ +#endif #ifndef NAN #define NAN av_int2float(0x7fc00000) #endif diff --git a/libavutil/version.h b/libavutil/version.h index 341bcbf188..a4177aa137 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 7 +#define LIBAVUTIL_VERSION_MINOR 8 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ From patchwork Thu May 11 23:12:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 41589 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp4983621pzb; Thu, 11 May 2023 16:13:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ZC5pHCvDhzIQTaYex/f77D4nIaVoxG85zipd9xLhomm3ZAa0qJmvwFVLor+yp9I/+Fp5v X-Received: by 2002:a17:907:3ea8:b0:953:37d9:282f with SMTP id hs40-20020a1709073ea800b0095337d9282fmr19455737ejc.38.1683846809861; Thu, 11 May 2023 16:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683846809; cv=none; d=google.com; s=arc-20160816; b=doi/9ZYLwn+W4hxStAxG2rdiwxVa8PvnT8AEzblQUmAbnrMIVWzDoajpgx0n74qrEQ 0pdtUz5vb0ZRpUBSq7AdziYGQD91/iNxZD2qM2JWFKZHfIuJafiKNXyJg36b4bh3t1sN WNPhJvbdvGCefCyNxeFDFkcjJpFaeVM8kxl939NpIqBHHrPeyDl3cWanLiL6Cs4qHxgz SHprK8+2J8GGvlkdrVEFMMpQpEw9zDJnFEoYyVAwpZ8UrYkypGjS7Sme6uuGxEufGDid 3jS8glixLbF7kzc194KZCNLo1DJwTuOS29Euiu7jvqVz+tsPA92OqpP1WfF+mKxQ+nyT v5dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=pT1oq9wF7VYiHbH6HJIeNVAFjcwf2hHDoiIB0YS9Ksc=; b=c5wjOGcq2Gh4RdI2yVQpnJPux0UKyxrzrnsYri4pxDFXHpHt6eQR9FlflEjQ9GYOnU XyPyHWYdDmI5nldfO9tt4fPrbDC3nNxp3x0Y9pDoekncirBGvsM0RVyOMCas5wQKYoOY mGL2ZxY8+czUIZFBs3ewOr6+4G/y5cJyF5YEUmsGIUShqEpEDZ7GZ9fOfx05/yz6jmY7 33VyXZeuT1vEvt/G2xjfo9dZrvS5v/antsyzmQ2O+WTHEJ5ffs/c1wvUOXA6Iwe7DHup oBPL2b4fNOX6sO/kdsVwCLcQim63pjE3MHQqUgdvj35SRkt4KOlvvyVhsLIk971ynXjb eQDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b="Y0p4/gN8"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gy23-20020a170906f25700b00965ffff0f28si6567427ejb.805.2023.05.11.16.13.08; Thu, 11 May 2023 16:13: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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b="Y0p4/gN8"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B02AC68C163; Fri, 12 May 2023 02:12:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6EC6D68C100 for ; Fri, 12 May 2023 02:12:50 +0300 (EEST) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-18f4a6d2822so54090148fac.1 for ; Thu, 11 May 2023 16:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683846768; x=1686438768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TF5cPyKaLX0Aj15lRFTXWkQLBHc00sT4yivCoNRU+Rw=; b=Y0p4/gN8UiaSDdRrYijecmV82W9O4SXoeMPVTvnjQQWj6IH/4YFnawbyub0uQQhHvl JdYPcwupc9160AjVoRW3InwdyE+ZiLuA/Ds0UdAHFKFnQhDceXK1orF0vNDoLfYmURDS CgW6ClrhMpx4QHU9vzXXjPPaMFmEx6z8QTwhNt/xXuhRJhrn5chBmqyWxgla1Y20RQzI +C5vvY2fuPNup8OWrN0JYHz4OgDrB8f8IstbJhIA4TRIuw2z/O5OJjjWMWTO4d2uZAyM izeukwebv3yf5NIRawnxpVukD7D3U1VWuDx9yrcEwPH+TmETxmW5qBRPdVPKcb9Xcgvb jkUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683846768; x=1686438768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TF5cPyKaLX0Aj15lRFTXWkQLBHc00sT4yivCoNRU+Rw=; b=KXkLI+EbgAvhDsnbnNhEOHwNVWg6TsLwoDNjYoNe/9oons+/xtp0dHOOjV1ZlYhSdP Du3N2ZtjArw78MR/ZfwiWDMspS6PCoSR7YBkxUY3h2MkABExYyOn5b2FHK9svK/roPBG WpoDnqJ4GUzeq7n8CLv9HagCfXva50KYN9Wg8fMJ0/TDAZrMMk/Vp4fmn2WfkWUETEeq bAQIQTSimJDwue2WToQBpFa9MsK7b4+PJJbHRRI1+Ac8igMIZJPotTilRLBcyqBtjzqO Z2uE4rP0CjWz9bI5zlkWmEteQkravkQTS0T4oV6CICeSEB+lU6IrbvZ4IQEPbFGA9qdw vqyA== X-Gm-Message-State: AC+VfDxJMygW/j2jBP4QLctvI4fmxE/t9l7tGERZN40YtYAy5bVzoYVQ D7BXzPUMKmKmWhsHvnal/u7EDZF4/cY= X-Received: by 2002:a54:478e:0:b0:38e:d57:1979 with SMTP id o14-20020a54478e000000b0038e0d571979mr6430781oic.23.1683846768195; Thu, 11 May 2023 16:12:48 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id zf10-20020a0568716a8a00b001728669a604sm8528376oab.5.2023.05.11.16.12.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 16:12:47 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 11 May 2023 20:12:30 -0300 Message-Id: <20230511231230.15668-2-jamrial@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230511231230.15668-1-jamrial@gmail.com> References: <20230511231230.15668-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/af_surround: replace double constants with float variants X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: E9gaaAsPiE3p This is cleaner than the approach in d1ded7310a. Signed-off-by: James Almer --- libavfilter/af_surround.c | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c index bcc89053a4..4edd838101 100644 --- a/libavfilter/af_surround.c +++ b/libavfilter/af_surround.c @@ -330,16 +330,16 @@ static void angle_transform(float *x, float *y, float angle) if (angle == 90.f) return; - reference = angle * (float)M_PI / 180.f; + reference = angle * M_PIf / 180.f; r = hypotf(*x, *y); a = atan2f(*x, *y); r /= r_distance(a); - if (fabsf(a) <= (float)M_PI_4) - a *= reference / (float)M_PI_2; + if (fabsf(a) <= M_PI_4f) + a *= reference / M_PI_2f; else - a = (float)M_PI + (-2.f * (float)M_PI + reference) * ((float)M_PI - fabsf(a)) * FFDIFFSIGN(a, 0.f) / (3.f * (float)M_PI_2); + a = M_PIf + (-2.f * M_PIf + reference) * (M_PIf - fabsf(a)) * FFDIFFSIGN(a, 0.f) / (3.f * M_PI_2f); r *= r_distance(a); @@ -366,16 +366,16 @@ static void focus_transform(float *x, float *y, float focus) static void stereo_position(float a, float p, float *x, float *y) { av_assert2(a >= -1.f && a <= 1.f); - av_assert2(p >= 0.f && p <= (float)M_PI); - *x = av_clipf(a+a*fmaxf(0.f, p*p-(float)M_PI_2), -1.f, 1.f); - *y = av_clipf(cosf(a*(float)M_PI_2+(float)M_PI)*cosf((float)M_PI_2-p/(float)M_PI)*(float)M_LN10+1.f, -1.f, 1.f); + av_assert2(p >= 0.f && p <= M_PIf); + *x = av_clipf(a+a*fmaxf(0.f, p*p-M_PI_2f), -1.f, 1.f); + *y = av_clipf(cosf(a*M_PI_2f+M_PIf)*cosf(M_PI_2f-p/M_PIf)*M_LN10f+1.f, -1.f, 1.f); } static inline void get_lfe(int output_lfe, int n, float lowcut, float highcut, float *lfe_mag, float c_mag, float *mag_total, int lfe_mode) { if (output_lfe && n < highcut) { - *lfe_mag = n < lowcut ? 1.f : .5f*(1.f+cosf((float)M_PI*(lowcut-n)/(lowcut-highcut))); + *lfe_mag = n < lowcut ? 1.f : .5f*(1.f+cosf(M_PIf*(lowcut-n)/(lowcut-highcut))); *lfe_mag *= c_mag; if (lfe_mode) *mag_total -= *lfe_mag; @@ -777,8 +777,8 @@ static void filter_stereo(AVFilterContext *ctx) mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; mag_dif = (l_mag - r_mag) / mag_sum; - if (phase_dif > (float)M_PI) - phase_dif = 2.f * (float)M_PI - phase_dif; + if (phase_dif > M_PIf) + phase_dif = 2.f * M_PIf - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); angle_transform(&x, &y, angle); @@ -832,8 +832,8 @@ static void filter_2_1(AVFilterContext *ctx) mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; mag_dif = (l_mag - r_mag) / mag_sum; - if (phase_dif > (float)M_PI) - phase_dif = 2.f * (float)M_PI - phase_dif; + if (phase_dif > M_PIf) + phase_dif = 2.f * M_PIf - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); angle_transform(&x, &y, angle); @@ -889,8 +889,8 @@ static void filter_surround(AVFilterContext *ctx) mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; mag_dif = (l_mag - r_mag) / mag_sum; - if (phase_dif > (float)M_PI) - phase_dif = 2.f * (float)M_PI - phase_dif; + if (phase_dif > M_PIf) + phase_dif = 2.f * M_PIf - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); angle_transform(&x, &y, angle); @@ -946,11 +946,11 @@ static void filter_5_0_side(AVFilterContext *ctx) float xl, yl; float xr, yr; - if (phase_difl > (float)M_PI) - phase_difl = 2.f * (float)M_PI - phase_difl; + if (phase_difl > M_PIf) + phase_difl = 2.f * M_PIf - phase_difl; - if (phase_difr > (float)M_PI) - phase_difr = 2.f * (float)M_PI - phase_difr; + if (phase_difr > M_PIf) + phase_difr = 2.f * M_PIf - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr); @@ -1005,11 +1005,11 @@ static void filter_5_1_side(AVFilterContext *ctx) float xl, yl; float xr, yr; - if (phase_difl > (float)M_PI) - phase_difl = 2.f * (float)M_PI - phase_difl; + if (phase_difl > M_PIf) + phase_difl = 2.f * M_PIf - phase_difl; - if (phase_difr > (float)M_PI) - phase_difr = 2.f * (float)M_PI - phase_difr; + if (phase_difr > M_PIf) + phase_difr = 2.f * M_PIf - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr); @@ -1064,11 +1064,11 @@ static void filter_5_1_back(AVFilterContext *ctx) float xl, yl; float xr, yr; - if (phase_difl > (float)M_PI) - phase_difl = 2.f * (float)M_PI - phase_difl; + if (phase_difl > M_PIf) + phase_difl = 2.f * M_PIf - phase_difl; - if (phase_difr > (float)M_PI) - phase_difr = 2.f * (float)M_PI - phase_difr; + if (phase_difr > M_PIf) + phase_difr = 2.f * M_PIf - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr);