From d2e5c5694e6dae078a104e7f5d05c87ed8286ea4 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Mon, 19 Jun 2017 15:23:59 -0700 Subject: sigProcLib: Replace dynamically allocated resampling buffers Instead use object allocated STL vectors. This simplifies code, removes the need to explicitly release buffers, and fixes a memory leak in destructor deallocation. Also, remove simplified init and release sub-calls. Maintain partition filter allocation using memalign() for SIMD alignment requirements. Change-Id: Ie836982794c10fb1b6334e40592d44b200454846 --- Transceiver52M/Resampler.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Transceiver52M/Resampler.h') diff --git a/Transceiver52M/Resampler.h b/Transceiver52M/Resampler.h index c9f9787..caffc08 100644 --- a/Transceiver52M/Resampler.h +++ b/Transceiver52M/Resampler.h @@ -20,6 +20,9 @@ #ifndef _RESAMPLER_H_ #define _RESAMPLER_H_ +#include +#include + class Resampler { public: /* Constructor for rational sample rate conversion @@ -63,14 +66,11 @@ private: size_t p; size_t q; size_t filt_len; - size_t *in_index; - size_t *out_path; - - float **partitions; + std::vector in_index; + std::vector out_path; + std::vector *> partitions; - bool initFilters(float bw); - void releaseFilters(); - void computePath(); + void initFilters(float bw); }; #endif /* _RESAMPLER_H_ */ -- cgit v1.2.3