diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-11-08 21:39:32 -0500 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-11-09 18:41:03 -0500 |
commit | b87ca4bf25a3b5a0cac76fb8b3a7ab3bc0fd9882 (patch) | |
tree | 603890d7017f2806d104a53698400722d6ec11dd /libavformat/aiffdec.c | |
parent | b02201efb531348406e48f9252bd39a6acebd2b7 (diff) | |
download | ffmpeg-b87ca4bf25a3b5a0cac76fb8b3a7ab3bc0fd9882.tar.gz |
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>
Diffstat (limited to 'libavformat/aiffdec.c')
0 files changed, 0 insertions, 0 deletions