Changeset 633400d for src/cvec.c
- Timestamp:
- Dec 5, 2018, 10:34:39 PM (5 years ago)
- Branches:
- feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- 283a619a
- Parents:
- 5b46bc3 (diff), f19db54 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.c
r5b46bc3 r633400d 86 86 return; 87 87 } 88 #ifdef HAVE_MEMCPY_HACKS 88 #if defined(HAVE_INTEL_IPP) 89 aubio_ippsCopy(s->phas, t->phas, (int)s->length); 90 aubio_ippsCopy(s->norm, t->norm, (int)s->length); 91 #elif defined(HAVE_MEMCPY_HACKS) 89 92 memcpy(t->norm, s->norm, t->length * sizeof(smpl_t)); 90 93 memcpy(t->phas, s->phas, t->length * sizeof(smpl_t)); 91 #else /* HAVE_MEMCPY_HACKS */94 #else 92 95 uint_t j; 93 96 for (j=0; j< t->length; j++) { … … 95 98 t->phas[j] = s->phas[j]; 96 99 } 97 #endif /* HAVE_MEMCPY_HACKS */100 #endif 98 101 } 99 102 100 void cvec_norm_set_all (cvec_t *s, smpl_t val) { 103 void cvec_norm_set_all(cvec_t *s, smpl_t val) { 104 #if defined(HAVE_INTEL_IPP) 105 aubio_ippsSet(val, s->norm, (int)s->length); 106 #else 101 107 uint_t j; 102 108 for (j=0; j< s->length; j++) { 103 109 s->norm[j] = val; 104 110 } 111 #endif 105 112 } 106 113 107 114 void cvec_norm_zeros(cvec_t *s) { 108 #ifdef HAVE_MEMCPY_HACKS 115 #if defined(HAVE_INTEL_IPP) 116 aubio_ippsZero(s->norm, (int)s->length); 117 #elif defined(HAVE_MEMCPY_HACKS) 109 118 memset(s->norm, 0, s->length * sizeof(smpl_t)); 110 #else /* HAVE_MEMCPY_HACKS */119 #else 111 120 cvec_norm_set_all (s, 0.); 112 #endif /* HAVE_MEMCPY_HACKS */121 #endif 113 122 } 114 123 … … 118 127 119 128 void cvec_phas_set_all (cvec_t *s, smpl_t val) { 129 #if defined(HAVE_INTEL_IPP) 130 aubio_ippsSet(val, s->phas, (int)s->length); 131 #else 120 132 uint_t j; 121 133 for (j=0; j< s->length; j++) { 122 134 s->phas[j] = val; 123 135 } 136 #endif 124 137 } 125 138 126 139 void cvec_phas_zeros(cvec_t *s) { 127 #ifdef HAVE_MEMCPY_HACKS 140 #if defined(HAVE_INTEL_IPP) 141 aubio_ippsZero(s->phas, (int)s->length); 142 #elif defined(HAVE_MEMCPY_HACKS) 128 143 memset(s->phas, 0, s->length * sizeof(smpl_t)); 129 144 #else … … 140 155 cvec_phas_zeros(s); 141 156 } 157 158 void cvec_logmag(cvec_t *s, smpl_t lambda) { 159 #if defined(HAVE_INTEL_IPP) 160 aubio_ippsMulC(s->norm, lambda, s->norm, (int)s->length); 161 aubio_ippsAddC(s->norm, 1.0, s->norm, (int)s->length); 162 aubio_ippsLn(s->norm, s->norm, (int)s->length); 163 #else 164 uint_t j; 165 for (j=0; j< s->length; j++) { 166 s->norm[j] = LOG(lambda * s->norm[j] + 1); 167 } 168 #endif 169 }
Note: See TracChangeset
for help on using the changeset viewer.