mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 11:06:30 -04:00
Moved baseband temporary buffers back into class member variables.
Significant performance hit when declaring on stack. C++ wants to initialize std::array or even raw array with element constructors, was resulting in ~7% CPU utilization, for a buffer that was immediately written over anyway.
This commit is contained in:
parent
5547782f5a
commit
d9017530c6
10 changed files with 42 additions and 45 deletions
|
@ -28,12 +28,6 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
|||
return;
|
||||
}
|
||||
|
||||
std::array<complex16_t, 512> dst;
|
||||
const buffer_c16_t dst_buffer {
|
||||
dst.data(),
|
||||
dst.size()
|
||||
};
|
||||
|
||||
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
||||
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
||||
const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer);
|
||||
|
@ -42,11 +36,6 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
|||
feed_channel_stats(channel_out);
|
||||
channel_spectrum.feed(channel_out, channel_filter_pass_f, channel_filter_stop_f);
|
||||
|
||||
const buffer_s16_t work_audio_buffer {
|
||||
(int16_t*)dst.data(),
|
||||
sizeof(*dst.data()) * dst.size()
|
||||
};
|
||||
|
||||
auto audio = demod.execute(channel_out, work_audio_buffer);
|
||||
|
||||
audio_hpf.execute_in_place(audio);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue