aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2013-04-04 19:45:52 +0000
committerMichael Niedermayer <michaelni@gmx.at>2013-04-05 16:42:12 +0200
commit37a9708391ae1fc202f090f24039b242f308c303 (patch)
tree2025e80546c6302ca6f536ffebcbcaf6e0c9abff
parent0b467a6e83bd4926382c8a2fe1a12b9128f3b037 (diff)
downloadffmpeg-37a9708391ae1fc202f090f24039b242f308c303.tar.gz
x86: sbrdsp: implement SSE neg_odd_64
Timing on Arrandale: C SSE Win32: 57 44 Win64: 47 38 Unrolling and not storing mask both save some cycles. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/x86/sbrdsp.asm22
-rw-r--r--libavcodec/x86/sbrdsp_init.c2
2 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index 1b7f3a8646..999e5af79e 100644
--- a/libavcodec/x86/sbrdsp.asm
+++ b/libavcodec/x86/sbrdsp.asm
@@ -24,6 +24,7 @@
SECTION_RODATA
; mask equivalent for multiply by -1.0 1.0
ps_mask times 2 dd 1<<31, 0
+ps_mask2 times 2 dd 0, 1<<31
ps_neg times 4 dd 1<<31
SECTION_TEXT
@@ -220,3 +221,24 @@ cglobal sbr_qmf_post_shuffle, 2,3,4,W,z
cmp zq, r2q
jl .loop
REP_RET
+
+INIT_XMM sse
+cglobal sbr_neg_odd_64, 1,2,4,z
+ lea r1q, [zq+256]
+.loop:
+ mova m0, [zq+ 0]
+ mova m1, [zq+16]
+ mova m2, [zq+32]
+ mova m3, [zq+48]
+ xorps m0, [ps_mask2]
+ xorps m1, [ps_mask2]
+ xorps m2, [ps_mask2]
+ xorps m3, [ps_mask2]
+ mova [zq+ 0], m0
+ mova [zq+16], m1
+ mova [zq+32], m2
+ mova [zq+48], m3
+ add zq, 64
+ cmp zq, r1q
+ jne .loop
+ REP_RET
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 27fade133f..d8d6ae73e8 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -33,6 +33,7 @@ void ff_sbr_hf_gen_sse(float (*X_high)[2], const float (*X_low)[2],
const float alpha0[2], const float alpha1[2],
float bw, int start, int end);
void ff_sbr_qmf_post_shuffle_sse(float W[32][2], const float *z);
+void ff_sbr_neg_odd_64_sse(float *z);
av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
{
@@ -44,5 +45,6 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
s->hf_g_filt = ff_sbr_hf_g_filt_sse;
s->hf_gen = ff_sbr_hf_gen_sse;
s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_sse;
+ s->neg_odd_64 = ff_sbr_neg_odd_64_sse;
}
}