Created
May 6, 2016 17:03
-
-
Save roxlu/585d3e4a15044352b1b762a5d91f6a7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if 0 | |
/* takes ~0.038ms */ | |
for (size_t k = 0; k < convert_from.nchannels; ++k) { | |
std::vector<double>& prepared_data = channel_data[k]; | |
for (size_t i = 0; i < nframes; i++) { | |
prepared_data[i] = src_ptr[k + (i * convert_from.nchannels)]; | |
} | |
} | |
#else | |
/* takes 0.0025 ms*/ | |
if (2 == resamplers.size()) { | |
double* prepared_data = &channel_data[0][0]; | |
for (size_t i = 0; i < nframes; ++i) { | |
prepared_data[i] = src_ptr[i * 2]; | |
} | |
prepared_data = &channel_data[1][0]; | |
for (size_t i = 0; i < nframes; ++i) { | |
prepared_data[i] = src_ptr[(i * 2) + 1]; | |
} | |
} | |
else { | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment