56 if (
step >= 1.0f)
return false;
125 if (
xf == 0.0f)
return y[0];
126 if (
xf == 1.0f)
return y[1];
130 return y[x] +
dx * (y[x + 1] - y[x]);
153 float ym1py1 = y[x] + y[x + 2];
154 float c0 = 1.0f / 6.0f *
ym1py1 + 2.0f / 3.0f * y[x + 1];
155 float c1 = 1.0f / 2.0f * (y[x + 2] - y[x]);
156 float c2 = 1.0f / 2.0f *
ym1py1 - y[x + 1];
158 1.0f / 2.0f * (y[x + 1] - y[x + 2]) + 1.0f / 6.0f * (y[x + 3] - y[x]);
183 float c1 = y[x + 2] - 1.0f / 3.0f * y[x] - 1.0f / 2.0f * y[x + 1] -
184 1.0f / 6.0f * y[x + 3];
185 float c2 = 1.0f / 2.0f * (y[x] + y[x + 2]) - y[x + 1];
187 1.0f / 6.0f * (y[x + 3] - y[x]) + 1.0f / 2.0f * (y[x + 1] - y[x + 2]);
212 float c1 = 1.0f / 2.0f * (y[x + 2] - y[x]);
213 float c2 = y[x] - 5.0f / 2.0f * y[x + 1] + 2.0f * y[x + 2] -
214 1.0f / 2.0f * y[x + 3];
216 1.0f / 2.0f * (y[x + 3] - y[x]) + 3.0f / 2.0f * (y[x + 1] - y[x + 2]);
240 float y1mym1 = y[x + 2] - y[x];
241 float c0 = 1.0f / 2.0f * y[x + 1] + 1.0f / 4.0f * (y[x] + y[x + 2]);
243 float c2 = 1.0f / 4.0f * (y[x + 3] - y[x + 1] -
y1mym1);
254template <
class TInterpolator>
290 LOGE(
"Invalid channel index: %d", channel);
329template <
class TInterpolator>
440 LOGD(
"ResampleStreamT::write: %d", (
int)len);
489 template <
typename T>
492 if (p_out ==
nullptr)
return 0;
501 T* data = (
T*)buffer;
502 float frame[channels];
503 size_t frames =
bytes / (
sizeof(
T) * channels);
505 for (
size_t i = 0; i < frames; ++i) {
507 for (
int ch = 0;
ch < channels; ++
ch) {
508 frame[
ch] =
static_cast<float>(data[i * channels +
ch]);
515 float result[channels];
519 for (
int ch = 0;
ch < channels; ++
ch) {
520 resultT[
ch] = NumberConverter::clipT<T>(result[
ch]);
#define TRACEE()
Definition AudioLoggerIDF.h:34
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30