kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit be4f1881851275d946fdcd97c0caa51036976706
parent ff2dc299f546b2eef43b80d5323195bb3cc5bbb4
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date:   Wed, 20 Jul 2016 14:05:13 +0300

Code formatting

Diffstat:
Minclude/kfr/all.hpp | 10+++++-----
Minclude/kfr/dft/conv.hpp | 2+-
Minclude/kfr/dsp/biquad.hpp | 4++--
Minclude/kfr/dsp/fir.hpp | 5++---
Dsyntax-check.py | 28----------------------------
Mtests/dft_test.cpp | 2+-
Mtests/vec_test.cpp | 2+-
7 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/include/kfr/all.hpp b/include/kfr/all.hpp @@ -20,10 +20,9 @@ * disclosing the source code of your own applications. * See http://www.kfrlib.com for details. */ - - #include "cometa/string.hpp" -#include "version.hpp" +#include "cometa/string.hpp" + #include "base/abs.hpp" #include "base/asin_acos.hpp" #include "base/atan.hpp" @@ -50,14 +49,15 @@ #include "base/types.hpp" #include "base/univector.hpp" #include "base/vec.hpp" +#include "dispatch/cpuid.hpp" +#include "dispatch/runtimedispatch.hpp" #include "expressions/basic.hpp" #include "expressions/conversion.hpp" #include "expressions/generators.hpp" #include "expressions/operators.hpp" #include "expressions/pointer.hpp" #include "expressions/reduce.hpp" -#include "dispatch/cpuid.hpp" -#include "dispatch/runtimedispatch.hpp" +#include "version.hpp" #include "misc/compiletime.hpp" #include "misc/random.hpp" diff --git a/include/kfr/dft/conv.hpp b/include/kfr/dft/conv.hpp @@ -53,7 +53,7 @@ KFR_INTRIN univector<T> convolve(const univector<T, Tag1>& src1, const univector plan.execute(src2padded, src2padded, temp); src1padded = src1padded * src2padded; plan.execute(src1padded, src1padded, temp, true); - return typed<T>( real(src1padded), src1.size() + src2.size() - 1 ) / T(size); + return typed<T>(real(src1padded), src1.size() + src2.size() - 1) / T(size); } } #pragma clang diagnostic pop diff --git a/include/kfr/dsp/biquad.hpp b/include/kfr/dsp/biquad.hpp @@ -331,8 +331,8 @@ public: } template <typename T, typename E1> -KFR_INLINE internal::in_biquad<>::expression_biquads<1, T, internal::arg<E1>> biquad(const biquad_params<T>& bq, - E1&& e1) +KFR_INLINE internal::in_biquad<>::expression_biquads<1, T, internal::arg<E1>> biquad( + const biquad_params<T>& bq, E1&& e1) { const biquad_params<T> bqs[1] = { bq }; return internal::in_biquad<>::expression_biquads<1, T, internal::arg<E1>>(bqs, std::forward<E1>(e1)); diff --git a/include/kfr/dsp/fir.hpp b/include/kfr/dsp/fir.hpp @@ -163,9 +163,8 @@ public: vec<T, N> in = cast<T>(this->argument_first(index, x)); vec<T, N> out = in * taps[0]; - cfor(csize<1>, csize<tapcount>, [&](auto I) { - out = out + concat_and_slice<tapcount - 1 - I, N>(delayline, in) * taps[I]; - }); + cfor(csize<1>, csize<tapcount>, + [&](auto I) { out = out + concat_and_slice<tapcount - 1 - I, N>(delayline, in) * taps[I]; }); delayline = concat_and_slice<N, tapcount - 1>(delayline, in); return cast<U>(out); diff --git a/syntax-check.py b/syntax-check.py @@ -1,28 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import fnmatch -import subprocess -import os -import sys - -path = os.path.dirname(os.path.realpath(__file__)) - -filenames = [] -for root, dirnames, files in os.walk(os.path.join(path, 'include')): - for filename in fnmatch.filter(files, '*.hpp'): - filenames.append(os.path.join(root, filename)) - - -target = "" -if sys.platform.startswith('win32'): - target = "--target=x86_64-w64-windows-gnu" - -fails = 0 -for filename in filenames: - print(filename, '...') - c = subprocess.call(["clang", "-fsyntax-only", filename, "-std=c++14", "-I"+os.path.join(path, "include"), "-Wno-pragma-once-outside-header", target]) - if c != 0: - fails+=1 - -exit(fails) diff --git a/tests/dft_test.cpp b/tests/dft_test.cpp @@ -4,7 +4,7 @@ * See LICENSE.txt for details */ - // library_version() +// library_version() #include <kfr/version.hpp> #include <tuple> diff --git a/tests/vec_test.cpp b/tests/vec_test.cpp @@ -78,7 +78,7 @@ TEST(vec_tovec) TEST(vec_zerovector) { CHECK(zerovector<f32, 3>() == f32x3{ 0, 0, 0 }); - //CHECK(zerovector<i16, 3>() == i16x3{ 0, 0, 0 }); // clang 3.9 (trunk) crashes here + // CHECK(zerovector<i16, 3>() == i16x3{ 0, 0, 0 }); // clang 3.9 (trunk) crashes here CHECK(zerovector(f64x8{}) == f64x8{ 0, 0, 0, 0, 0, 0, 0, 0 }); }