aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/mdct15_init.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-07-29 21:27:01 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-07-30 07:38:39 +0100
commit70eb77b34e9f08cd5e431921a2792f31e4b5265c (patch)
treedc163df43e5fa5c29176cc88a5ae261825c625af /libavcodec/x86/mdct15_init.c
parentb0c61209cd30f9ddf3356d5ded6df488f25d1bd5 (diff)
downloadffmpeg-70eb77b34e9f08cd5e431921a2792f31e4b5265c.tar.gz
mdct15: add inverse transform postrotation SIMD
2.5ms frames: Before (c): 2638 decicycles in postrotate, 2097040 runs, 112 skips After (sse3): 1467 decicycles in postrotate, 2097083 runs, 69 skips After (avx2): 1244 decicycles in postrotate, 2097085 runs, 67 skips 5ms frames: Before (c): 4987 decicycles in postrotate, 1048371 runs, 205 skips After (sse3): 2644 decicycles in postrotate, 1048509 runs, 67 skips After (avx2): 2031 decicycles in postrotate, 1048523 runs, 53 skips 10ms frames: Before (c): 9153 decicycles in postrotate, 523575 runs, 713 skips After (sse3): 5110 decicycles in postrotate, 523726 runs, 562 skips After (avx2): 3738 decicycles in postrotate, 524223 runs, 65 skips 20ms frames: Before (c): 17857 decicycles in postrotate, 261866 runs, 278 skips After (sse3): 10041 decicycles in postrotate, 261746 runs, 398 skips After (avx2): 7050 decicycles in postrotate, 262116 runs, 28 skips Improves total decoding performance for real world content by 9% with avx2. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/x86/mdct15_init.c')
-rw-r--r--libavcodec/x86/mdct15_init.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c
index ba3d94c2ec..45b91b7e21 100644
--- a/libavcodec/x86/mdct15_init.c
+++ b/libavcodec/x86/mdct15_init.c
@@ -25,6 +25,9 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/mdct15.h"
+void ff_mdct15_postreindex_sse3(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8);
+void ff_mdct15_postreindex_avx2(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8);
+
void ff_fft15_avx(FFTComplex *out, FFTComplex *in, FFTComplex *exptab, ptrdiff_t stride);
static void perm_twiddles(MDCT15Context *s)
@@ -85,11 +88,17 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s)
int adjust_twiddles = 0;
int cpu_flags = av_get_cpu_flags();
+ if (EXTERNAL_SSE3(cpu_flags))
+ s->postreindex = ff_mdct15_postreindex_sse3;
+
if (ARCH_X86_64 && EXTERNAL_AVX(cpu_flags)) {
s->fft15 = ff_fft15_avx;
adjust_twiddles = 1;
}
+ if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
+ s->postreindex = ff_mdct15_postreindex_avx2;
+
if (adjust_twiddles)
perm_twiddles(s);
}