/* * Brickworks * * Copyright (C) 2023 Orastron Srl unipersonale * * Brickworks is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * Brickworks is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Brickworks. If not, see . * * File author: Stefano D'Angelo */ #ifndef BWPP_BD_REDUCE_H #define BWPP_BD_REDUCE_H #include #include namespace Brickworks { /*! api {{{ * ##### Brickworks::BDReduce * ```>>> */ template class BDReduce { public: BDReduce(); void reset(); void process( std::array x, std::array y, int nSamples); void setBitDepth(char value); /*! <<<... * } * ``` * }}} */ /*** Implementation ***/ /* WARNING: This part of the file is not part of the public API. Its content may * change at any time in future versions. Please, do not use it directly. */ private: bw_bd_reduce_coeffs coeffs; }; template inline BDReduce::BDReduce() { bw_bd_reduce_init(&coeffs); } template inline void BDReduce::reset() { bw_bd_reduce_reset_coeffs(&coeffs); } template inline void BDReduce::process( std::array x, std::array y, int nSamples) { bw_bd_reduce_process_multi(&coeffs, x.data(), y.data(), N_CHANNELS, nSamples); } template inline void BDReduce::setBitDepth(char value) { bw_bd_reduce_set_bit_depth(&coeffs, value); } } #endif