tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fast_math.h (1175B)


      1 /*
      2 *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
      3 *
      4 *  Use of this source code is governed by a BSD-style license
      5 *  that can be found in the LICENSE file in the root of the source
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #ifndef MODULES_AUDIO_PROCESSING_NS_FAST_MATH_H_
     12 #define MODULES_AUDIO_PROCESSING_NS_FAST_MATH_H_
     13 
     14 #include "api/array_view.h"
     15 
     16 namespace webrtc {
     17 
     18 // Sqrt approximation.
     19 float SqrtFastApproximation(float f);
     20 
     21 // Log base conversion log(x) = log2(x)/log2(e).
     22 float LogApproximation(float x);
     23 void LogApproximation(ArrayView<const float> x, ArrayView<float> y);
     24 
     25 // 2^x approximation.
     26 float Pow2Approximation(float p);
     27 
     28 // x^p approximation.
     29 float PowApproximation(float x, float p);
     30 
     31 // e^x approximation.
     32 float ExpApproximation(float x);
     33 void ExpApproximation(ArrayView<const float> x, ArrayView<float> y);
     34 void ExpApproximationSignFlip(ArrayView<const float> x, ArrayView<float> y);
     35 }  // namespace webrtc
     36 
     37 #endif  // MODULES_AUDIO_PROCESSING_NS_FAST_MATH_H_