[FFmpeg-devel] [PATCH 1/9] SBR DSP x86: implement SSE qmf_pre_shuffle
Christophe Gisquet
christophe.gisquet at gmail.com
Thu Apr 4 21:45:45 CEST 2013
>From 253 to 70c on Arrandale and Win64.
---
libavcodec/x86/sbrdsp.asm | 33 +++++++++++++++++++++++++++++++++
libavcodec/x86/sbrdsp_init.c | 2 ++
2 files changed, 35 insertions(+)
diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index 1b7f3a8..2029b45 100644
--- a/libavcodec/x86/sbrdsp.asm
+++ b/libavcodec/x86/sbrdsp.asm
@@ -220,3 +220,36 @@ cglobal sbr_qmf_post_shuffle, 2,3,4,W,z
cmp zq, r2q
jl .loop
REP_RET
+
+INIT_XMM sse
+cglobal sbr_qmf_pre_shuffle, 1,4,7,z
+%define OFFSET (32*4-2*mmsize)
+ mov r3q, OFFSET
+ lea r1q, [zq + (32+1)*4]
+ lea r2q, [zq + 64*4]
+ mova m6, [ps_neg]
+.loop:
+ movu m0, [r1q]
+ movu m2, [r1q + mmsize]
+ movu m1, [zq + r3q + 4 + mmsize]
+ movu m3, [zq + r3q + 4]
+ xorps m2, m6
+ xorps m0, m6
+ shufps m2, m2, q0123
+ shufps m0, m0, q0123
+ mova m5, m2
+ mova m4, m0
+ unpcklps m2, m3
+ unpckhps m5, m3
+ unpcklps m0, m1
+ unpckhps m4, m1
+ mova [r2q + 2*r3q + 0*mmsize], m2
+ mova [r2q + 2*r3q + 1*mmsize], m5
+ mova [r2q + 2*r3q + 2*mmsize], m0
+ mova [r2q + 2*r3q + 3*mmsize], m4
+ add r1q, 2*mmsize
+ sub r3q, 2*mmsize
+ jge .loop
+ mova m2, [zq]
+ movlps [r2q], m2
+ REP_RET
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 27fade1..5f87cf4 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_qmf_pre_shuffle_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->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_sse;
}
}
--
1.8.0.msysgit.0
More information about the ffmpeg-devel
mailing list