pcm/Normalizer: add method Reset()
This commit is contained in:
parent
f547a56b1d
commit
bc51bc2933
|
@ -24,6 +24,10 @@ public:
|
|||
NormalizeFilter &operator=(const NormalizeFilter &) = delete;
|
||||
|
||||
/* virtual methods from class Filter */
|
||||
void Reset() noexcept override {
|
||||
normalizer.Reset();
|
||||
}
|
||||
|
||||
std::span<const std::byte> FilterPCM(std::span<const std::byte> src) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -8,6 +8,16 @@
|
|||
#include "Traits.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <algorithm> // for std::fill_n()
|
||||
|
||||
void
|
||||
PcmNormalizer::Reset() noexcept
|
||||
{
|
||||
prev_gain = 0;
|
||||
pos = 0;
|
||||
std::fill_n(peaks, bufsz, 0);
|
||||
}
|
||||
|
||||
void
|
||||
PcmNormalizer::ProcessS16(int16_t *gcc_restrict dest,
|
||||
const std::span<const int16_t> src) noexcept
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
delete[] peaks;
|
||||
}
|
||||
|
||||
void Reset() noexcept;
|
||||
|
||||
//! Process 16-bit signed data
|
||||
void ProcessS16(int16_t *dest, std::span<const int16_t> src) noexcept;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue