Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Aug 7, 2024
1 parent a72eda7 commit 5aa405e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
16 changes: 0 additions & 16 deletions pyroomacoustics/libroom_src/rir_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,7 @@ void threaded_fractional_delay_impl(
// relase the GIL from here on
py::gil_scoped_release release;

for (size_t idx = 0; idx < n_times; idx++) {
// LUT interpolation
T x_off_frac = (1. - tim_acc(idx)) * lut_gran_f;
T lut_gran_off = std::floor(x_off_frac);
T x_off = (x_off_frac - lut_gran_off);

int lut_pos = int(lut_gran_off);
for (size_t k = 0; k < fdl; lut_pos += lut_gran, k++)
out_acc(idx, k) =
hann[k] *
(sinc_lut[lut_pos] +
x_off * (sinc_lut[lut_pos + 1] - sinc_lut[lut_pos]));
}

// build the RIR
/*
ThreadPool pool(num_threads);
std::vector<std::future<void>> results;
for (size_t t_idx = 0; t_idx < num_threads; t_idx++) {
Expand All @@ -366,7 +351,6 @@ void threaded_fractional_delay_impl(
}

for (auto &&result : results) result.get();
*/
}

void fractional_delay(py::buffer out, const py::buffer time, size_t lut_gran,
Expand Down
2 changes: 0 additions & 2 deletions pyroomacoustics/libroom_src/rir_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ void delay_sum(const py::buffer irs, const py::buffer delays, py::buffer output,
void fractional_delay(py::buffer out, const py::buffer time, size_t lut_gran,
size_t num_threads);

#include "rir_builder.cpp"

#endif // __RIR_BUILDER_HPP__
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __str__(self):
ext_modules = [
Extension(
"pyroomacoustics.libroom",
[os.path.join(libroom_src_dir, f) for f in ["libroom.cpp"]],
[os.path.join(libroom_src_dir, f) for f in ["libroom.cpp", "rir_builder.cpp"]],
depends=libroom_files,
include_dirs=[
".",
Expand Down

0 comments on commit 5aa405e

Please sign in to comment.