From 05a1c224261763116e77376adc51fe471d43f003 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Mon, 4 Jan 2016 11:00:17 -0800 Subject: [PATCH] More tweaks to pass buffers by reference. 144 bytes less code! --- firmware/baseband/dsp_demodulate.cpp | 8 ++++---- firmware/baseband/dsp_demodulate.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/baseband/dsp_demodulate.cpp b/firmware/baseband/dsp_demodulate.cpp index bc11e990c..42f04b01c 100644 --- a/firmware/baseband/dsp_demodulate.cpp +++ b/firmware/baseband/dsp_demodulate.cpp @@ -31,8 +31,8 @@ namespace dsp { namespace demodulate { buffer_s16_t AM::execute( - buffer_c16_t src, - buffer_s16_t dst + const buffer_c16_t& src, + const buffer_s16_t& dst ) { /* Intermediate maximum value: 46341 (when input is -32768,-32768). */ /* Normalized to maximum 32767 for int16_t representation. */ @@ -78,8 +78,8 @@ static inline float angle_precise(const complex32_t t) { } buffer_s16_t FM::execute( - buffer_c16_t src, - buffer_s16_t dst + const buffer_c16_t& src, + const buffer_s16_t& dst ) { auto z = z_; diff --git a/firmware/baseband/dsp_demodulate.hpp b/firmware/baseband/dsp_demodulate.hpp index 6e84fb8b3..0f1d4bf84 100644 --- a/firmware/baseband/dsp_demodulate.hpp +++ b/firmware/baseband/dsp_demodulate.hpp @@ -30,16 +30,16 @@ namespace demodulate { class AM { public: buffer_s16_t execute( - buffer_c16_t src, - buffer_s16_t dst + const buffer_c16_t& src, + const buffer_s16_t& dst ); }; class FM { public: buffer_s16_t execute( - buffer_c16_t src, - buffer_s16_t dst + const buffer_c16_t& src, + const buffer_s16_t& dst ); void configure(const float sampling_rate, const float deviation_hz) {