Changeset 9935735


Ignore:
Timestamp:
Jul 12, 2006, 6:26:59 PM (18 years ago)
Author:
Paul Brossier <piem@altern.org>
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
Message:

update fft deletion function
update fft deletion function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/fft.c

    r8f70a18 r9935735  
    4747};
    4848
    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) {
     49aubio_fft_t * new_aubio_fft(uint_t size) {
    5350        aubio_fft_t * s = AUBIO_NEW(aubio_fft_t);
    5451        /* allocate memory */
     
    5653        s->out      = AUBIO_ARRAY(real_t,size);
    5754        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);
    7255        /* create plans */
    7356        s->pfw = fftw_plan_dft_r2c_1d(size, s->in,  s->specdata, FFTW_ESTIMATE);
     
    7760
    7861void 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);
    8169}
    8270
     
    162150                AUBIO_FREE(fft->spec[i]);
    163151        AUBIO_FREE(fft->spec);
    164         aubio_fft_free(fft->fft);
     152        del_aubio_fft(fft->fft);
    165153        AUBIO_FREE(fft);       
    166154}
Note: See TracChangeset for help on using the changeset viewer.