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");
293 av_dlog(avr,
"[FIFO] add %s to out_fifo\n", converted->
name);
303 av_dlog(avr,
"[FIFO] read from out_fifo to output\n");
304 av_dlog(avr,
"[end conversion]\n");
308 }
else if (converted) {
311 av_dlog(avr,
"[copy] %s to output\n", converted->
name);
318 av_dlog(avr,
"[end conversion]\n");
321 av_dlog(avr,
"[end conversion]\n");
326 uint8_t **output,
int out_plane_size,
327 int out_samples,
uint8_t **input,
328 int in_plane_size,
int in_samples)
333 int ret, direct_output;
352 av_dlog(avr,
"[start conversion]\n");
372 current_buffer = &input_buffer;
378 av_dlog(avr,
"[copy] %s to output\n", current_buffer->
name);
384 current_buffer = &output_buffer;
386 (!direct_output || out_samples < in_samples)) {
390 av_dlog(avr,
"[copy] %s to out_buffer\n", current_buffer->
name);
404 av_dlog(avr,
"[convert] %s to in_buffer\n", current_buffer->
name);
410 av_dlog(avr,
"[copy] %s to in_buffer\n", current_buffer->
name);
419 av_dlog(avr,
"[downmix] in_buffer\n");
431 current_buffer = NULL;
438 resample_out = &output_buffer;
441 av_dlog(avr,
"[resample] %s to %s\n", current_buffer->
name,
450 av_dlog(avr,
"[end conversion]\n");
454 current_buffer = resample_out;
458 av_dlog(avr,
"[upmix] %s\n", current_buffer->
name);
465 if (current_buffer == &output_buffer) {
466 av_dlog(avr,
"[end conversion]\n");
471 if (direct_output && out_samples >= current_buffer->
nb_samples) {
473 av_dlog(avr,
"[convert] %s to output\n", current_buffer->
name);
478 av_dlog(avr,
"[end conversion]\n");
485 av_dlog(avr,
"[convert] %s to out_buffer\n", current_buffer->
name);
501 int in_channels, out_channels, i, o;
520 for (o = 0; o < out_channels; o++)
521 for (i = 0; i < in_channels; i++)
522 matrix[o * stride + i] = avr->
mix_matrix[o * in_channels + i];
530 int in_channels, out_channels, i, o;
551 for (o = 0; o < out_channels; o++)
552 for (i = 0; i < in_channels; i++)
553 avr->
mix_matrix[o * in_channels + i] = matrix[o * stride + i];
559 const int *channel_map)
562 int in_channels, ch, i;
570 memset(info, 0,
sizeof(*info));
573 for (ch = 0; ch < in_channels; ch++) {
574 if (channel_map[ch] >= in_channels) {
578 if (channel_map[ch] < 0) {
582 }
else if (info->
input_map[channel_map[ch]] >= 0) {
595 for (ch = 0, i = 0; ch < in_channels && i < in_channels; ch++, i++) {
596 while (ch < in_channels && info->input_map[ch] >= 0)
598 while (i < in_channels && info->channel_map[i] >= 0)
600 if (ch >= in_channels || i >= in_channels)
628 #define LICENSE_PREFIX "libavresample license: "
634 return FFMPEG_CONFIGURATION;