103 const float *in1,
const float *in2,
104 const float *window,
int len)
107 for (i = 0; i <
len; i++)
108 out[i] = in2[i] * window[i] + in1[i] * (1.0 - window[i]);
120 else if (ret != nb_samples) {
127 if (celt_size != nb_samples) {
147 s->
out[0] += nb_samples;
148 s->
out[1] += nb_samples;
149 s->
out_size -= nb_samples *
sizeof(float);
156 static const float delay[16] = { 0.0 };
172 "Error feeding initial silence to the resampler.\n");
210 int redundancy_size, redundancy_pos;
211 int ret, i, consumed;
259 redundancy_size = size - (consumed + 7) / 8;
260 size -= redundancy_size;
266 if (redundancy_pos) {
276 float *out_tmp[2] = { s->
out[0], s->
out[1] };
279 int celt_output_samples = samples;
289 out_tmp[i] += delay_samples;
291 celt_output_samples -= delay_samples;
294 "Spurious CELT delay samples present.\n");
313 void *delaybuf[2] = { s->
celt_output[0] + celt_output_samples,
319 celt_output_samples);
337 if (!redundancy_pos) {
345 s->
out[i] + samples - 120 + delayed_samples,
356 s->
out[i] + 120 + delayed_samples,
369 int output_samples = 0;
370 int flush_needed = 0;
376 int64_t cur_samplerate;
384 if (!buf && !flush_needed)
428 output_samples += samples;
431 s->
out[j] += samples;
432 s->
out_size -= samples *
sizeof(
float);
439 return output_samples;
443 int *got_frame_ptr,
AVPacket *avpkt)
448 int buf_size = avpkt->
size;
449 int coded_samples = 0;
450 int decoded_samples = 0;
479 for (i = 0; i < avctx->
channels; i++) {
500 "Mismatching coded sample count in substream %d.\n", i);
511 if (decoded_samples && ret != decoded_samples) {
513 "in a multi-channel stream\n");
516 decoded_samples =
ret;
521 for (i = 0; i < avctx->
channels; i++) {
541 *got_frame_ptr = !!decoded_samples;