13
0

NO-OP: clang format

This commit is contained in:
Robin Gareus 2022-11-03 00:27:34 +01:00
parent edc19e2b7d
commit 2b0e6ec476
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -18,12 +18,12 @@
*/
#include <algorithm>
#include <stdlib.h>
#include <cmath>
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
#include <stdlib.h>
#include "ardour/dB.h"
#include "ardour/buffer.h"
#include "ardour/dB.h"
#include "ardour/dsp_filter.h"
#include "ardour/runtime_functions.h"
@ -41,21 +41,24 @@
using namespace ARDOUR::DSP;
void
ARDOUR::DSP::memset (float *data, const float val, const uint32_t n_samples) {
ARDOUR::DSP::memset (float* data, const float val, const uint32_t n_samples)
{
for (uint32_t i = 0; i < n_samples; ++i) {
data[i] = val;
}
}
void
ARDOUR::DSP::mmult (float *data, float *mult, const uint32_t n_samples) {
ARDOUR::DSP::mmult (float* data, float* mult, const uint32_t n_samples)
{
for (uint32_t i = 0; i < n_samples; ++i) {
data[i] *= mult[i];
}
}
float
ARDOUR::DSP::log_meter (float power) {
ARDOUR::DSP::log_meter (float power)
{
// compare to libs/ardour/log_meter.h
static const float lower_db = -192.f;
static const float upper_db = 0.f;
@ -64,13 +67,17 @@ ARDOUR::DSP::log_meter (float power) {
}
float
ARDOUR::DSP::log_meter_coeff (float coeff) {
if (coeff <= 0) return 0;
ARDOUR::DSP::log_meter_coeff (float coeff)
{
if (coeff <= 0) {
return 0;
}
return log_meter (fast_coefficient_to_dB (coeff));
}
void
ARDOUR::DSP::peaks (const float *data, float &min, float &max, uint32_t n_samples) {
ARDOUR::DSP::peaks (const float* data, float& min, float& max, uint32_t n_samples)
{
ARDOUR::find_peaks (data, n_samples, &min, &max);
}
@ -126,8 +133,11 @@ LowPass::proc (float *data, const uint32_t n_samples)
z = data[i];
}
_z = z;
if (!isfinite_local (_z)) { _z = 0; }
else if (!boost::math::isnormal (_z)) { _z = 0; }
if (!isfinite_local (_z)) {
_z = 0;
} else if (!boost::math::isnormal (_z)) {
_z = 0;
}
}
void
@ -180,10 +190,16 @@ Biquad::run (float *data, const uint32_t n_samples)
data[i] = z;
}
if (!isfinite_local (_z1)) { _z1 = 0; }
else if (!boost::math::isnormal (_z1)) { _z1 = 0; }
if (!isfinite_local (_z2)) { _z2 = 0; }
else if (!boost::math::isnormal (_z2)) { _z2 = 0; }
if (!isfinite_local (_z1)) {
_z1 = 0;
} else if (!boost::math::isnormal (_z1)) {
_z1 = 0;
}
if (!isfinite_local (_z2)) {
_z2 = 0;
} else if (!boost::math::isnormal (_z2)) {
_z2 = 0;
}
}
void
@ -238,9 +254,15 @@ Biquad::calc_vicanek (const double W0, double& A0, double& A1, double& A2, doubl
void
Biquad::compute (Type type, double freq, double Q, double gain)
{
if (Q <= .001) { Q = 0.001; }
if (freq <= 1.) { freq = 1.; }
if (freq >= 0.4998 * _rate) { freq = 0.4998 * _rate; }
if (Q <= .001) {
Q = 0.001;
}
if (freq <= 1.) {
freq = 1.;
}
if (freq >= 0.4998 * _rate) {
freq = 0.4998 * _rate;
}
/* Compute biquad filter settings.
* Based on 'Cookbook formulae for audio EQ biquad filter coefficents'
@ -434,11 +456,12 @@ Biquad::dB_at_freq (float freq) const
#define SQUARE(x) ((x) * (x))
float rv = 20.f * log10f (sqrtf ((SQUARE (a) + SQUARE (b)) * (SQUARE (c) + SQUARE (d))) / (SQUARE (c) + SQUARE (d)));
if (!isfinite_local (rv)) { rv = 0; }
if (!isfinite_local (rv)) {
rv = 0;
}
return std::min (120.f, std::max (-120.f, rv));
}
Glib::Threads::Mutex FFTSpectrum::fft_planner_lock;
FFTSpectrum::FFTSpectrum (uint32_t window_size, double rate)
@ -528,7 +551,8 @@ FFTSpectrum::execute ()
}
float
FFTSpectrum::power_at_bin (const uint32_t b, const float norm) const {
FFTSpectrum::power_at_bin (const uint32_t b, const float norm) const
{
assert (b < _fft_data_size);
const float a = _fft_power[b] * norm;
return a > 1e-12 ? 10.0 * fast_log10 (a) : -INFINITY;
@ -542,7 +566,8 @@ Generator::Generator ()
}
void
Generator::set_type (Generator::Type t) {
Generator::set_type (Generator::Type t)
{
_type = t;
_b0 = _b1 = _b2 = _b3 = _b4 = _b5 = _b6 = 0;
_pass = false;