105 const float *in1,
const float *in2,
106 const float *window,
int len)
109 for (i = 0; i <
len; i++)
110 out[i] = in2[i] * window[i] + in1[i] * (1.0 - window[i]);
122 else if (ret != nb_samples) {
129 if (celt_size != nb_samples) {
149 s->
out[0] += nb_samples;
150 s->
out[1] += nb_samples;
151 s->
out_size -= nb_samples *
sizeof(float);
158 static const float delay[16] = { 0.0 };
174 "Error feeding initial silence to the resampler.\n");
212 int redundancy_size, redundancy_pos;
213 int ret, i, consumed;
261 redundancy_size = size - (consumed + 7) / 8;
262 size -= redundancy_size;
268 if (redundancy_pos) {
278 float *out_tmp[2] = { s->
out[0], s->
out[1] };
281 int celt_output_samples = samples;
291 out_tmp[i] += delay_samples;
293 celt_output_samples -= delay_samples;
296 "Spurious CELT delay samples present.\n");
315 void *delaybuf[2] = { s->
celt_output[0] + celt_output_samples,
321 celt_output_samples);
339 if (!redundancy_pos) {
347 s->
out[i] + samples - 120 + delayed_samples,
358 s->
out[i] + 120 + delayed_samples,
371 int output_samples = 0;
372 int flush_needed = 0;
378 int64_t cur_samplerate;
386 if (!buf && !flush_needed)
430 output_samples += samples;
433 s->
out[j] += samples;
434 s->
out_size -= samples *
sizeof(
float);
438 s->
out[0] = s->
out[1] = NULL;
441 return output_samples;
445 int *got_frame_ptr,
AVPacket *avpkt)
450 int buf_size = avpkt->
size;
451 int coded_samples = 0;
452 int decoded_samples = 0;
483 for (i = 0; i < avctx->
channels; i++) {
509 if (decoded_samples && ret != decoded_samples) {
511 "in a multi-channel stream\n");
514 decoded_samples =
ret;
519 for (i = 0; i < avctx->
channels; i++) {
539 *got_frame_ptr = !!decoded_samples;