mirror of https://github.com/drowe67/LPCNet.git
fix memory leak
parent
8182b73dac
commit
163a6499ea
|
|
@ -113,6 +113,7 @@ int codec2_pitch_est(CODEC2_PITCH *pitch, float Sn[], float *f0, float *voicing)
|
|||
|
||||
void codec2_pitch_destroy(CODEC2_PITCH *pitch)
|
||||
{
|
||||
free(pitch->fft_fwd_cfg);
|
||||
nlp_destroy(pitch->nlp_states);
|
||||
free(pitch->w);
|
||||
free(pitch);
|
||||
|
|
|
|||
|
|
@ -140,6 +140,10 @@ static void check_init() {
|
|||
common.init = 1;
|
||||
}
|
||||
|
||||
void freq_close() {
|
||||
opus_fft_free(common.kfft,0);
|
||||
}
|
||||
|
||||
void dct(float *out, const float *in) {
|
||||
int i;
|
||||
check_init();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#define NB_BANDS 18
|
||||
|
||||
void freq_close(void);
|
||||
void compute_band_energy(float *bandE, const kiss_fft_cpx *X);
|
||||
void compute_band_corr(float *bandE, const kiss_fft_cpx *X, const kiss_fft_cpx *P);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,8 @@ static DenoiseState *rnnoise_create() {
|
|||
}
|
||||
|
||||
static void rnnoise_destroy(DenoiseState *st) {
|
||||
free(st);
|
||||
freq_close();
|
||||
free(st);
|
||||
}
|
||||
|
||||
static short float2short(float x)
|
||||
|
|
|
|||
Loading…
Reference in New Issue