Changeset dde06ad
- Timestamp:
- Jul 13, 2006, 3:42:23 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:
- 9c54265
- Parents:
- c84300e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hist.c
rc84300e rdde06ad 36 36 }; 37 37 38 39 /******************************************************** 40 * Object Memory Allocation 38 /** 39 * Object creation/deletion calls 41 40 */ 42 43 static aubio_hist_t * aubio_hist_malloc(uint_t channels, uint_t nelems); 44 static void aubio_hist_free(aubio_hist_t * s); 45 46 aubio_hist_t * aubio_hist_malloc(uint_t channels, uint_t nelems) { 41 aubio_hist_t * new_aubio_hist (smpl_t ilow, smpl_t ihig, uint_t nelems, uint_t channels){ 42 aubio_hist_t * s = AUBIO_NEW(aubio_hist_t); 43 smpl_t step = (ihig-ilow)/(smpl_t)(nelems); 44 smpl_t accum = step; 47 45 uint_t i; 48 aubio_hist_t * s = AUBIO_NEW(aubio_hist_t);49 46 s->channels = channels; 50 47 s->nelems = nelems; 51 52 48 s->hist = AUBIO_ARRAY(smpl_t*, channels); 53 49 for (i=0; i< s->channels; i++) { … … 55 51 } 56 52 s->cent = AUBIO_ARRAY(smpl_t, nelems); 57 return s;58 }59 60 void aubio_hist_free(aubio_hist_t * s) {61 AUBIO_FREE(s);62 }63 64 /***65 * Object creation/deletion calls66 */67 aubio_hist_t * new_aubio_hist (smpl_t ilow, smpl_t ihig, uint_t nelems, uint_t channels){68 smpl_t step = (ihig-ilow)/(smpl_t)(nelems);69 smpl_t accum = step;70 uint_t i;71 aubio_hist_t * s = aubio_hist_malloc(channels, nelems);72 53 73 54 /* use scale to map ilow/ihig -> 0/nelems */ … … 82 63 83 64 void del_aubio_hist(aubio_hist_t *s) { 84 aubio_hist_free(s); 65 uint_t i; 66 for (i=0; i< s->channels; i++) { 67 AUBIO_FREE(s->hist[i]); 68 } 69 AUBIO_FREE(s->hist); 70 AUBIO_FREE(s->cent); 71 del_aubio_scale(s->scaler); 72 AUBIO_FREE(s); 85 73 } 86 74
Note: See TracChangeset
for help on using the changeset viewer.