130 av_dlog(avr,
"remap channels during in_copy\n");
133 av_dlog(avr,
"remap channels during in_convert\n");
136 av_dlog(avr,
"remap channels during out_convert\n");
139 av_dlog(avr,
"remap channels during out_copy\n");
188 "resample_out_buffer");
298 av_dlog(avr,
"[FIFO] add %s to out_fifo\n", converted->
name);
308 av_dlog(avr,
"[FIFO] read from out_fifo to output\n");
309 av_dlog(avr,
"[end conversion]\n");
313 }
else if (converted) {
316 av_dlog(avr,
"[copy] %s to output\n", converted->
name);
323 av_dlog(avr,
"[end conversion]\n");
326 av_dlog(avr,
"[end conversion]\n");
331 uint8_t **output,
int out_plane_size,
332 int out_samples,
uint8_t **input,
333 int in_plane_size,
int in_samples)
338 int ret, direct_output;
357 av_dlog(avr,
"[start conversion]\n");
377 current_buffer = &input_buffer;
383 av_dlog(avr,
"[copy] %s to output\n", current_buffer->
name);
389 current_buffer = &output_buffer;
391 (!direct_output || out_samples < in_samples)) {
395 av_dlog(avr,
"[copy] %s to out_buffer\n", current_buffer->
name);
409 av_dlog(avr,
"[convert] %s to in_buffer\n", current_buffer->
name);
415 av_dlog(avr,
"[copy] %s to in_buffer\n", current_buffer->
name);
424 av_dlog(avr,
"[downmix] in_buffer\n");
436 current_buffer = NULL;
443 resample_out = &output_buffer;
446 av_dlog(avr,
"[resample] %s to %s\n",
447 current_buffer ? current_buffer->
name :
"null",
456 av_dlog(avr,
"[end conversion]\n");
460 current_buffer = resample_out;
464 av_dlog(avr,
"[upmix] %s\n", current_buffer->
name);
471 if (current_buffer == &output_buffer) {
472 av_dlog(avr,
"[end conversion]\n");
477 if (direct_output && out_samples >= current_buffer->
nb_samples) {
479 av_dlog(avr,
"[convert] %s to output\n", current_buffer->
name);
484 av_dlog(avr,
"[end conversion]\n");
491 av_dlog(avr,
"[convert] %s to out_buffer\n", current_buffer->
name);
553 uint8_t **out_data = NULL, **in_data = NULL;
554 int out_linesize = 0, in_linesize = 0;
555 int out_nb_samples = 0, in_nb_samples = 0;
571 in_data, in_linesize,
589 int samples = out->
linesize[0] / bytes_per_sample;
595 return samples / channels;
636 int in_channels, out_channels, i, o;
655 for (o = 0; o < out_channels; o++)
656 for (i = 0; i < in_channels; i++)
657 matrix[o * stride + i] = avr->
mix_matrix[o * in_channels + i];
665 int in_channels, out_channels, i, o;
686 for (o = 0; o < out_channels; o++)
687 for (i = 0; i < in_channels; i++)
688 avr->
mix_matrix[o * in_channels + i] = matrix[o * stride + i];
694 const int *channel_map)
697 int in_channels, ch, i;
705 memset(info, 0,
sizeof(*info));
708 for (ch = 0; ch < in_channels; ch++) {
709 if (channel_map[ch] >= in_channels) {
713 if (channel_map[ch] < 0) {
717 }
else if (info->
input_map[channel_map[ch]] >= 0) {
730 for (ch = 0, i = 0; ch < in_channels && i < in_channels; ch++, i++) {
731 while (ch < in_channels && info->input_map[ch] >= 0)
733 while (i < in_channels && info->channel_map[i] >= 0)
735 if (ch >= in_channels || i >= in_channels)
762 if (samples > INT_MAX)
782 #define LICENSE_PREFIX "libavresample license: "
788 return FFMPEG_CONFIGURATION;