24class [[gnu::hot]] ImpulseResponseProcessor {
25 constexpr static size_t IR_SIZE = 26;
26 constexpr static size_t IR_BUFFER_SIZE = (IR_SIZE - 1);
28 constexpr static std::array<int32_t, IR_SIZE> ir = {
29 -3203916, 8857848, 24813136, 41537808, 35217472, 15195632, -27538592, -61984128, 1944654848,
30 1813580928, 438462784, 101125088, 6042048, -22429488, -46218864, -56638560, -64785312, -52108528,
31 -37256992, -11863856, 1390352, 14663296, 12784464, 14254800, 5690912, 4490736,
35 ImpulseResponseProcessor() =
default;
38 output.l = buffer_[0].l + multiply_32x32_rshift32_rounded(input.l, ir[0]);
39 output.r = buffer_[0].r + multiply_32x32_rshift32_rounded(input.r, ir[0]);
41 for (int32_t i = 1; i < IR_BUFFER_SIZE; i++) {
42 buffer_[i - 1].l = buffer_[i].l + multiply_32x32_rshift32_rounded(input.l, ir[i]);
43 buffer_[i - 1].r = buffer_[i].r + multiply_32x32_rshift32_rounded(input.r, ir[i]);
46 buffer_[IR_BUFFER_SIZE - 1].l = multiply_32x32_rshift32_rounded(input.l, ir[IR_BUFFER_SIZE]);
47 buffer_[IR_BUFFER_SIZE - 1].r = multiply_32x32_rshift32_rounded(input.r, ir[IR_BUFFER_SIZE]);
51 std::array<StereoSample, IR_BUFFER_SIZE> buffer_;