Changeset 5d10ac1 for src/cvec.c
- Timestamp:
- Dec 17, 2013, 5:11:35 PM (10 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:
- c34336e
- Parents:
- b0ab6ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.c
rb0ab6ef r5d10ac1 39 39 } 40 40 41 void cvec_ write_norm(cvec_t *s, smpl_t data, uint_t position) {41 void cvec_norm_set_sample (cvec_t *s, smpl_t data, uint_t position) { 42 42 s->norm[position] = data; 43 43 } 44 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position) { 44 45 void cvec_phas_set_sample (cvec_t *s, smpl_t data, uint_t position) { 45 46 s->phas[position] = data; 46 47 } 47 smpl_t cvec_read_norm(cvec_t *s, uint_t position) { 48 49 smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position) { 48 50 return s->norm[position]; 49 51 } 50 smpl_t cvec_read_phas(cvec_t *s, uint_t position) { 52 53 smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position) { 51 54 return s->phas[position]; 52 55 } 53 smpl_t * cvec_get_norm(cvec_t *s) { 56 57 smpl_t * cvec_norm_get_data (cvec_t *s) { 54 58 return s->norm; 55 59 } 56 smpl_t * cvec_get_phas(cvec_t *s) { 60 61 smpl_t * cvec_phas_get_data (cvec_t *s) { 57 62 return s->phas; 58 63 } … … 92 97 } 93 98 94 void cvec_ set_all_norm(cvec_t *s, smpl_t val) {99 void cvec_norm_set_all (cvec_t *s, smpl_t val) { 95 100 uint_t j; 96 101 for (j=0; j< s->length; j++) { … … 99 104 } 100 105 101 void cvec_ zeros_norm(cvec_t *s) {106 void cvec_norm_zeros(cvec_t *s) { 102 107 #if HAVE_MEMCPY_HACKS 103 108 memset(s->norm, 0, s->length * sizeof(smpl_t)); 104 109 #else 105 cvec_ set_all_norm(s, 0.);110 cvec_norm_set_all (s, 0.); 106 111 #endif 107 112 } 108 113 109 void cvec_ ones_norm(cvec_t *s) {110 cvec_ set_all_norm(s, 1.);114 void cvec_norm_ones(cvec_t *s) { 115 cvec_norm_set_all (s, 1.); 111 116 } 112 117 113 void cvec_ set_all_phas(cvec_t *s, smpl_t val) {118 void cvec_phas_set_all (cvec_t *s, smpl_t val) { 114 119 uint_t j; 115 120 for (j=0; j< s->length; j++) { … … 118 123 } 119 124 120 void cvec_ zeros_phas(cvec_t *s) {125 void cvec_phas_zeros(cvec_t *s) { 121 126 #if HAVE_MEMCPY_HACKS 122 127 memset(s->phas, 0, s->length * sizeof(smpl_t)); 123 128 #else 124 cvec_ set_all_phas(s, 0.);129 cvec_phas_set_all (s, 0.); 125 130 #endif 126 131 } 127 132 128 void cvec_ ones_phas(cvec_t *s) {129 cvec_ set_all_phas(s, 1.);133 void cvec_phas_ones(cvec_t *s) { 134 cvec_phas_set_all (s, 1.); 130 135 } 131 136 132 137 void cvec_zeros(cvec_t *s) { 133 cvec_ zeros_norm(s);134 cvec_ zeros_phas(s);138 cvec_norm_zeros(s); 139 cvec_phas_zeros(s); 135 140 }
Note: See TracChangeset
for help on using the changeset viewer.