summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-01 23:53:45 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-01 23:53:48 +0200
commit483e66f667015c18949581a8e551a0d00494745b (patch)
treeecce8d0d1d23cd45fa173a607ece93cfa6579728
parent077065dcaaf276e5b4a87e6525f4ed7d48714ddd (diff)
Remove _sum member variable.
-rw-r--r--src/leqm_nrt.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/leqm_nrt.cc b/src/leqm_nrt.cc
index eb2ee3c..ff6dde5 100644
--- a/src/leqm_nrt.cc
+++ b/src/leqm_nrt.cc
@@ -58,10 +58,9 @@ class Worker
{
public:
Worker(std::vector<double> buffer, int nsamples, int nch, std::vector<double> const& ir, Sum* sum, std::vector<double> chconf)
- : _sum(sum)
- , _chconf(chconf)
+ : _chconf(chconf)
{
- _thread = std::thread(std::bind(&Worker::process, this, buffer, nsamples, nch, ir));
+ _thread = std::thread(std::bind(&Worker::process, this, buffer, nsamples, nch, ir, sum));
}
Worker(Worker& other) = delete;
@@ -80,7 +79,7 @@ public:
private:
- void process(std::vector<double>& buffer, int nsamples, int nch, std::vector<double> const& ir)
+ void process(std::vector<double>& buffer, int nsamples, int nch, std::vector<double> const& ir, Sum* sum)
{
auto accumulate_ch = [](std::vector<double>& ch_accumulator, std::vector<double> const& input_channel, int nsamples) {
for (auto i = 0; i < nsamples; i++) {
@@ -134,10 +133,9 @@ private:
accumulate_ch(ch_sum_accumulator_conv, rectify(convolved_buffer), frames);
}
- _sum->sum_samples(ch_sum_accumulator_norm, ch_sum_accumulator_conv, frames);
+ sum->sum_samples(ch_sum_accumulator_norm, ch_sum_accumulator_conv, frames);
}
- Sum* _sum;
std::vector<double> _chconf;
std::thread _thread;