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);
554 int out_linesize = 0, in_linesize = 0;
555 int out_nb_samples = 0, in_nb_samples = 0;
571 in_data, in_linesize,
590 if (!bytes_per_sample)
593 samples = out->
linesize[0] / bytes_per_sample;
598 return samples / channels;
639 int in_channels, out_channels, i, o;
658 for (o = 0; o < out_channels; o++)
659 for (i = 0; i < in_channels; i++)
660 matrix[o * stride + i] = avr->
mix_matrix[o * in_channels + i];
668 int in_channels, out_channels, i, o;
689 for (o = 0; o < out_channels; o++)
690 for (i = 0; i < in_channels; i++)
691 avr->
mix_matrix[o * in_channels + i] = matrix[o * stride + i];
697 const int *channel_map)
700 int in_channels, ch, i;
708 memset(info, 0,
sizeof(*info));
711 for (ch = 0; ch < in_channels; ch++) {
712 if (channel_map[ch] >= in_channels) {
716 if (channel_map[ch] < 0) {
720 }
else if (info->
input_map[channel_map[ch]] >= 0) {
733 for (ch = 0, i = 0; ch < in_channels && i < in_channels; ch++, i++) {
734 while (ch < in_channels && info->input_map[ch] >= 0)
736 while (i < in_channels && info->channel_map[i] >= 0)
738 if (ch >= in_channels || i >= in_channels)
765 if (samples > INT_MAX)
785 #define LICENSE_PREFIX "libavresample license: "
791 return FFMPEG_CONFIGURATION;