Changeset 5d10ac1 for src/cvec.c


Ignore:
Timestamp:
Dec 17, 2013, 5:11:35 PM (10 years ago)
Author:
Paul Brossier <piem@piem.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:
c34336e
Parents:
b0ab6ef
Message:

src/cvec.h: clean up cvec api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.c

    rb0ab6ef r5d10ac1  
    3939}
    4040
    41 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position) {
     41void cvec_norm_set_sample (cvec_t *s, smpl_t data, uint_t position) {
    4242  s->norm[position] = data;
    4343}
    44 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position) {
     44
     45void cvec_phas_set_sample (cvec_t *s, smpl_t data, uint_t position) {
    4546  s->phas[position] = data;
    4647}
    47 smpl_t cvec_read_norm(cvec_t *s, uint_t position) {
     48
     49smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position) {
    4850  return s->norm[position];
    4951}
    50 smpl_t cvec_read_phas(cvec_t *s, uint_t position) {
     52
     53smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position) {
    5154  return s->phas[position];
    5255}
    53 smpl_t * cvec_get_norm(cvec_t *s) {
     56
     57smpl_t * cvec_norm_get_data (cvec_t *s) {
    5458  return s->norm;
    5559}
    56 smpl_t * cvec_get_phas(cvec_t *s) {
     60
     61smpl_t * cvec_phas_get_data (cvec_t *s) {
    5762  return s->phas;
    5863}
     
    9297}
    9398
    94 void cvec_set_all_norm(cvec_t *s, smpl_t val) {
     99void cvec_norm_set_all (cvec_t *s, smpl_t val) {
    95100  uint_t j;
    96101  for (j=0; j< s->length; j++) {
     
    99104}
    100105
    101 void cvec_zeros_norm(cvec_t *s) {
     106void cvec_norm_zeros(cvec_t *s) {
    102107#if HAVE_MEMCPY_HACKS
    103108  memset(s->norm, 0, s->length * sizeof(smpl_t));
    104109#else
    105   cvec_set_all_norm(s, 0.);
     110  cvec_norm_set_all (s, 0.);
    106111#endif
    107112}
    108113
    109 void cvec_ones_norm(cvec_t *s) {
    110   cvec_set_all_norm(s, 1.);
     114void cvec_norm_ones(cvec_t *s) {
     115  cvec_norm_set_all (s, 1.);
    111116}
    112117
    113 void cvec_set_all_phas(cvec_t *s, smpl_t val) {
     118void cvec_phas_set_all (cvec_t *s, smpl_t val) {
    114119  uint_t j;
    115120  for (j=0; j< s->length; j++) {
     
    118123}
    119124
    120 void cvec_zeros_phas(cvec_t *s) {
     125void cvec_phas_zeros(cvec_t *s) {
    121126#if HAVE_MEMCPY_HACKS
    122127  memset(s->phas, 0, s->length * sizeof(smpl_t));
    123128#else
    124   cvec_set_all_phas(s, 0.);
     129  cvec_phas_set_all (s, 0.);
    125130#endif
    126131}
    127132
    128 void cvec_ones_phas(cvec_t *s) {
    129   cvec_set_all_phas(s, 1.);
     133void cvec_phas_ones(cvec_t *s) {
     134  cvec_phas_set_all (s, 1.);
    130135}
    131136
    132137void 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);
    135140}
Note: See TracChangeset for help on using the changeset viewer.