135 av_dlog(avr,
"remap channels during in_copy\n");
138 av_dlog(avr,
"remap channels during in_convert\n");
141 av_dlog(avr,
"remap channels during out_convert\n");
144 av_dlog(avr,
"remap channels during out_copy\n");
193 "resample_out_buffer");
303 av_dlog(avr,
"[FIFO] add %s to out_fifo\n", converted->
name);
313 av_dlog(avr,
"[FIFO] read from out_fifo to output\n");
314 av_dlog(avr,
"[end conversion]\n");
318 }
else if (converted) {
321 av_dlog(avr,
"[copy] %s to output\n", converted->
name);
328 av_dlog(avr,
"[end conversion]\n");
331 av_dlog(avr,
"[end conversion]\n");
336 uint8_t **output,
int out_plane_size,
337 int out_samples,
uint8_t **input,
338 int in_plane_size,
int in_samples)
343 int ret, direct_output;
362 av_dlog(avr,
"[start conversion]\n");
382 current_buffer = &input_buffer;
388 av_dlog(avr,
"[copy] %s to output\n", current_buffer->
name);
394 current_buffer = &output_buffer;
396 (!direct_output || out_samples < in_samples)) {
400 av_dlog(avr,
"[copy] %s to out_buffer\n", current_buffer->
name);
414 av_dlog(avr,
"[convert] %s to in_buffer\n", current_buffer->
name);
420 av_dlog(avr,
"[copy] %s to in_buffer\n", current_buffer->
name);
429 av_dlog(avr,
"[downmix] in_buffer\n");
441 current_buffer = NULL;
448 resample_out = &output_buffer;
451 av_dlog(avr,
"[resample] %s to %s\n",
452 current_buffer ? current_buffer->
name :
"null",
461 av_dlog(avr,
"[end conversion]\n");
465 current_buffer = resample_out;
469 av_dlog(avr,
"[upmix] %s\n", current_buffer->
name);
476 if (current_buffer == &output_buffer) {
477 av_dlog(avr,
"[end conversion]\n");
482 if (direct_output && out_samples >= current_buffer->
nb_samples) {
484 av_dlog(avr,
"[convert] %s to output\n", current_buffer->
name);
489 av_dlog(avr,
"[end conversion]\n");
496 av_dlog(avr,
"[convert] %s to out_buffer\n", current_buffer->
name);
512 int in_channels, out_channels, i, o;
531 for (o = 0; o < out_channels; o++)
532 for (i = 0; i < in_channels; i++)
533 matrix[o * stride + i] = avr->
mix_matrix[o * in_channels + i];
541 int in_channels, out_channels, i, o;
562 for (o = 0; o < out_channels; o++)
563 for (i = 0; i < in_channels; i++)
564 avr->
mix_matrix[o * in_channels + i] = matrix[o * stride + i];
570 const int *channel_map)
573 int in_channels, ch, i;
581 memset(info, 0,
sizeof(*info));
584 for (ch = 0; ch < in_channels; ch++) {
585 if (channel_map[ch] >= in_channels) {
589 if (channel_map[ch] < 0) {
593 }
else if (info->
input_map[channel_map[ch]] >= 0) {
606 for (ch = 0, i = 0; ch < in_channels && i < in_channels; ch++, i++) {
607 while (ch < in_channels && info->input_map[ch] >= 0)
609 while (i < in_channels && info->channel_map[i] >= 0)
611 if (ch >= in_channels || i >= in_channels)
638 if (samples > INT_MAX)
658 #define LICENSE_PREFIX "libavresample license: "
664 return FFMPEG_CONFIGURATION;