1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  x86: lavr: fix stack allocation for 7 and 8 channel downmixing on x86-32
  lavr: fix the decision for writing directly to the output buffer
  parisc: work around bug in gcc 4.3 and later

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-18 13:35:11 +01:00
commit 0c79a3d9cb
3 changed files with 22 additions and 5 deletions

8
configure vendored
View File

@ -3414,6 +3414,14 @@ elif enabled mips; then
enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" && enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"' check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
elif enabled parisc; then
if enabled gcc; then
case $($cc -dumpversion) in
4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
esac
fi
elif enabled ppc; then elif enabled ppc; then
enable local_aligned_8 local_aligned_16 enable local_aligned_8 local_aligned_16

View File

@ -254,7 +254,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
AudioData input_buffer; AudioData input_buffer;
AudioData output_buffer; AudioData output_buffer;
AudioData *current_buffer; AudioData *current_buffer;
int ret; int ret, direct_output;
/* reset internal buffers */ /* reset internal buffers */
if (avr->in_buffer) { if (avr->in_buffer) {
@ -276,6 +276,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
av_dlog(avr, "[start conversion]\n"); av_dlog(avr, "[start conversion]\n");
/* initialize output_buffer with output data */ /* initialize output_buffer with output data */
direct_output = output && av_audio_fifo_size(avr->out_fifo) == 0;
if (output) { if (output) {
ret = ff_audio_data_init(&output_buffer, output, out_plane_size, ret = ff_audio_data_init(&output_buffer, output, out_plane_size,
avr->out_channels, out_samples, avr->out_channels, out_samples,
@ -295,7 +296,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
current_buffer = &input_buffer; current_buffer = &input_buffer;
if (avr->upmix_needed && !avr->in_convert_needed && !avr->resample_needed && if (avr->upmix_needed && !avr->in_convert_needed && !avr->resample_needed &&
!avr->out_convert_needed && output && out_samples >= in_samples) { !avr->out_convert_needed && direct_output && out_samples >= in_samples) {
/* in some rare cases we can copy input to output and upmix /* in some rare cases we can copy input to output and upmix
directly in the output buffer */ directly in the output buffer */
av_dlog(avr, "[copy] %s to output\n", current_buffer->name); av_dlog(avr, "[copy] %s to output\n", current_buffer->name);
@ -343,7 +344,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
AudioData *resample_out; AudioData *resample_out;
int consumed = 0; int consumed = 0;
if (!avr->out_convert_needed && output && out_samples > 0) if (!avr->out_convert_needed && direct_output && out_samples > 0)
resample_out = &output_buffer; resample_out = &output_buffer;
else else
resample_out = avr->resample_out_buffer; resample_out = avr->resample_out_buffer;
@ -377,7 +378,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
} }
if (avr->out_convert_needed) { if (avr->out_convert_needed) {
if (output && out_samples >= current_buffer->nb_samples) { if (direct_output && out_samples >= current_buffer->nb_samples) {
/* convert directly to output */ /* convert directly to output */
av_dlog(avr, "[convert] %s to output\n", current_buffer->name); av_dlog(avr, "[convert] %s to output\n", current_buffer->name);
ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer, ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer,

View File

@ -278,7 +278,15 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s
and rsp, ~(mmsize-1) and rsp, ~(mmsize-1)
sub rsp, matrix_elements_stack * mmsize sub rsp, matrix_elements_stack * mmsize
%else %else
%assign pad matrix_elements_stack * mmsize + (mmsize - gprsize) - (stack_offset & (mmsize - gprsize)) %assign matrix_stack_size matrix_elements_stack * mmsize
%assign pad matrix_stack_size + (mmsize - gprsize) - (stack_offset & (mmsize - gprsize))
; on x86-32 for 7 and 8 channels we need more stack space for src pointers
%if ARCH_X86_32 && in_channels >= 7
%assign pad pad + 0x10
%define src5m [rsp+matrix_stack_size+0]
%define src6m [rsp+matrix_stack_size+4]
%define src7m [rsp+matrix_stack_size+8]
%endif
SUB rsp, pad SUB rsp, pad
%endif %endif
%endif %endif