Changeset 9935735
- Timestamp:
- Jul 12, 2006, 6:26:59 PM (18 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- bb20f87
- Parents:
- 8f70a18
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fft.c
r8f70a18 r9935735 47 47 }; 48 48 49 static aubio_fft_t * aubio_fft_alloc(uint_t size); 50 static void aubio_fft_free(aubio_fft_t *s); 51 52 static aubio_fft_t * aubio_fft_alloc(uint_t size) { 49 aubio_fft_t * new_aubio_fft(uint_t size) { 53 50 aubio_fft_t * s = AUBIO_NEW(aubio_fft_t); 54 51 /* allocate memory */ … … 56 53 s->out = AUBIO_ARRAY(real_t,size); 57 54 s->specdata = (fft_data_t*)fftw_malloc(sizeof(fft_data_t)*size); 58 return s;59 }60 61 static void aubio_fft_free(aubio_fft_t * s) {62 /* destroy data */63 fftw_destroy_plan(s->pfw);64 fftw_destroy_plan(s->pbw);65 if (s->specdata) fftw_free(s->specdata);66 if (s->out) AUBIO_FREE(s->out);67 if (s->in ) AUBIO_FREE(s->in );68 }69 70 aubio_fft_t * new_aubio_fft(uint_t size) {71 aubio_fft_t * s =(aubio_fft_t *)aubio_fft_alloc(size);72 55 /* create plans */ 73 56 s->pfw = fftw_plan_dft_r2c_1d(size, s->in, s->specdata, FFTW_ESTIMATE); … … 77 60 78 61 void del_aubio_fft(aubio_fft_t * s) { 79 aubio_fft_free(s); 80 AUBIO_FREE(s); 62 /* destroy data */ 63 fftw_destroy_plan(s->pfw); 64 fftw_destroy_plan(s->pbw); 65 fftw_free(s->specdata); 66 AUBIO_FREE(s->out); 67 AUBIO_FREE(s->in ); 68 AUBIO_FREE(s); 81 69 } 82 70 … … 162 150 AUBIO_FREE(fft->spec[i]); 163 151 AUBIO_FREE(fft->spec); 164 aubio_fft_free(fft->fft);152 del_aubio_fft(fft->fft); 165 153 AUBIO_FREE(fft); 166 154 }
Note: See TracChangeset
for help on using the changeset viewer.