ffmpeg/libswresample
Ganesh Ajjanagadde b87ca4bf25 swresample/resample: speed up upsampling by precomputing sines
When upsampling, factor is set to 1 and sines need to be evaluated only
once for each phase, and the complexity should not depend on the number
of filter taps. This does the desired precomputation, yielding
significant speedups. Hard guarantees on the gain are not possible, but gains
themselves are obvious and are illustrated below.

Sample benchmark (x86-64, Haswell, GNU/Linux)
test: fate-swr-resample-dblp-2626-44100
old:
29161085 decicycles in build_filter (loop 1000),     256 runs,      0 skips
28821467 decicycles in build_filter (loop 1000),     512 runs,      0 skips
28668201 decicycles in build_filter (loop 1000),    1000 runs,     24 skips

new:
14351936 decicycles in build_filter (loop 1000),     256 runs,      0 skips
14306652 decicycles in build_filter (loop 1000),     512 runs,      0 skips
14299923 decicycles in build_filter (loop 1000),    1000 runs,     24 skips

Note that this does not statically allocate the sin lookup table. This
may be done for the default 1024 phases, yielding a 512*8 = 4kB array
which should be small enough.
This should yield a small improvement. Nevertheless, this is separate from
this patch, is more ambiguous due to the binary increase, and requires a
lut to be generated offline.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-09 18:41:03 -05:00
..
aarch64
arm
x86 x86/audio_convert: fix clobbering of xmm registers 2015-10-01 22:40:50 -03:00
audioconvert.c
audioconvert.h
dither_template.c
dither.c
libswresample.v
log2_tab.c
Makefile
noise_shaping_data.c
options.c swresample: allow double precision beta value for the Kaiser window 2015-11-08 21:11:07 -05:00
rematrix_template.c
rematrix.c swresample: slightly nicer debug output for auto matrix 2015-10-15 20:16:13 +02:00
resample_dsp.c
resample_template.c
resample.c swresample/resample: speed up upsampling by precomputing sines 2015-11-09 18:41:03 -05:00
resample.h swresample: allow double precision beta value for the Kaiser window 2015-11-08 21:11:07 -05:00
soxr_resample.c swresample: allow double precision beta value for the Kaiser window 2015-11-08 21:11:07 -05:00
swresample_frame.c
swresample_internal.h swresample: allow double precision beta value for the Kaiser window 2015-11-08 21:11:07 -05:00
swresample-test.c all: add const-correctness to qsort comparators 2015-10-25 10:07:20 -04:00
swresample.c
swresample.h doc/resampler, swresample/options: use proper capitalization 2015-10-10 20:49:54 +02:00
swresampleres.rc
version.h swresample: allow double precision beta value for the Kaiser window 2015-11-08 21:11:07 -05:00