diff --git a/benchmarks/DataSetAggregation_benchmark.cpp b/benchmarks/DataSetAggregation_benchmark.cpp index 43837704..103a1f4f 100644 --- a/benchmarks/DataSetAggregation_benchmark.cpp +++ b/benchmarks/DataSetAggregation_benchmark.cpp @@ -25,7 +25,7 @@ static void DatasetAggregation_MeanOverDataset(benchmark::State &st) { for (auto _ : st) { aare::NDArray res = - aare::block_mean(file_path, 220, 10, 16); + aare::block_mean(file_path, 220, 100, 16); benchmark::DoNotOptimize(res); } diff --git a/include/aare/DataSetAggregation.hpp b/include/aare/DataSetAggregation.hpp index 6a4403d3..60207e8b 100644 --- a/include/aare/DataSetAggregation.hpp +++ b/include/aare/DataSetAggregation.hpp @@ -70,16 +70,13 @@ block_mean(const std::filesystem::path &path, const size_t num_samples, std::fill(sum.begin(), sum.end(), 0.0); - const FRAME_TYPE *src = - frames.data(); // using the pointer seems to be much faster than - // using the NDArray - for (size_t f = 0; f < mean_over_num_frames; ++f) { - const size_t f_off = f * rows * cols; + // const size_t f_off = f * rows * cols; for (size_t r = 0; r < rows; ++r) { - const size_t off = f_off + r * cols; + // const size_t off = f_off + r * cols; for (size_t c = 0; c < cols; ++c) { - sum[r * cols + c] += static_cast(src[off + c]); + sum[r * cols + c] += static_cast(frames( + f, r, c)); // static_cast(src[off + c]); } } }