projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28c066e
)
src/io/source_sndfile.c: clarify some variables names
author
Paul Brossier
<piem@piem.org>
Tue, 26 Aug 2014 03:24:09 +0000
(22:24 -0500)
committer
Paul Brossier
<piem@piem.org>
Tue, 26 Aug 2014 03:24:09 +0000
(22:24 -0500)
src/io/source_sndfile.c
patch
|
blob
|
history
diff --git
a/src/io/source_sndfile.c
b/src/io/source_sndfile.c
index
6cc54f7
..
ae18b7d
100644
(file)
--- a/
src/io/source_sndfile.c
+++ b/
src/io/source_sndfile.c
@@
-151,27
+151,27
@@
beach:
void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uint_t * read){
uint_t i,j, input_channels = s->input_channels;
void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uint_t * read){
uint_t i,j, input_channels = s->input_channels;
- /*
do actual reading
*/
+ /*
read from file into scratch_data
*/
sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
- smpl_t *data;
-
+ /* where to store de-interleaved data */
+ smpl_t *ptr_data;
#ifdef HAVE_SAMPLERATE
if (s->ratio != 1) {
#ifdef HAVE_SAMPLERATE
if (s->ratio != 1) {
- data = s->input_data->data;
+
ptr_
data = s->input_data->data;
} else
#endif /* HAVE_SAMPLERATE */
{
} else
#endif /* HAVE_SAMPLERATE */
{
- data = read_data->data;
+
ptr_
data = read_data->data;
}
/* de-interleaving and down-mixing data */
for (j = 0; j < read_samples / input_channels; j++) {
}
/* de-interleaving and down-mixing data */
for (j = 0; j < read_samples / input_channels; j++) {
- data[j] = 0;
+
ptr_
data[j] = 0;
for (i = 0; i < input_channels; i++) {
for (i = 0; i < input_channels; i++) {
- data[j] += s->scratch_data[input_channels*j+i];
+
ptr_
data[j] += s->scratch_data[input_channels*j+i];
}
}
- data[j] /= (smpl_t)input_channels;
+
ptr_
data[j] /= (smpl_t)input_channels;
}
#ifdef HAVE_SAMPLERATE
}
#ifdef HAVE_SAMPLERATE
@@
-195,17
+195,17
@@
void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat
/* do actual reading */
sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
/* do actual reading */
sf_count_t read_samples = sf_read_float (s->handle, s->scratch_data, s->scratch_size);
- smpl_t **data;
-
+ /* where to store de-interleaved data */
+ smpl_t **ptr_data;
#ifdef HAVE_SAMPLERATE
if (s->ratio != 1) {
AUBIO_ERR("source_sndfile: no multi channel resampling yet");
return;
#ifdef HAVE_SAMPLERATE
if (s->ratio != 1) {
AUBIO_ERR("source_sndfile: no multi channel resampling yet");
return;
- //data = s->input_data->data;
+ //
ptr_
data = s->input_data->data;
} else
#endif /* HAVE_SAMPLERATE */
{
} else
#endif /* HAVE_SAMPLERATE */
{
- data = read_data->data;
+
ptr_
data = read_data->data;
}
if (read_data->height < input_channels) {
}
if (read_data->height < input_channels) {
@@
-213,7
+213,7
@@
void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat
// channels of the file, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < read_data->height; i++) {
// channels of the file, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < read_data->height; i++) {
- data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
+
ptr_
data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
}
}
} else {
}
}
} else {
@@
-221,7
+221,7
@@
void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat
// channel from the file to the destination matrix, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < input_channels; i++) {
// channel from the file to the destination matrix, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = 0; i < input_channels; i++) {
- data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
+
ptr_
data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i];
}
}
}
}
}
}
@@
-231,7
+231,7
@@
void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat
// of the file to each additional channels, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = input_channels; i < read_data->height; i++) {
// of the file to each additional channels, de-interleaving data
for (j = 0; j < read_samples / input_channels; j++) {
for (i = input_channels; i < read_data->height; i++) {
- data[i][j] = (smpl_t)s->scratch_data[j * input_channels + (input_channels - 1)];
+
ptr_
data[i][j] = (smpl_t)s->scratch_data[j * input_channels + (input_channels - 1)];
}
}
}
}
}
}