[FFmpeg-cvslog] x86: sbrdsp: implement SSE2 qmf_pre_shuffle
Christophe Gisquet
git at videolan.org
Wed Apr 10 02:43:40 CEST 2013
ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Tue Apr 9 22:54:25 2013 +0000| [2383068cbfac11aedd2f133b2d00b0c1cb58b5f9] | committer: Michael Niedermayer
x86: sbrdsp: implement SSE2 qmf_pre_shuffle
>From 253 to 51 cycles on Arrandale and Win64.
44 cycles on SandyBridge.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2383068cbfac11aedd2f133b2d00b0c1cb58b5f9
---
libavcodec/x86/sbrdsp.asm | 30 ++++++++++++++++++++++++++++++
libavcodec/x86/sbrdsp_init.c | 2 ++
2 files changed, 32 insertions(+)
diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index 273e950..ecc9c71 100644
--- a/libavcodec/x86/sbrdsp.asm
+++ b/libavcodec/x86/sbrdsp.asm
@@ -284,3 +284,33 @@ SBR_QMF_DEINT_BFLY
INIT_XMM sse2
SBR_QMF_DEINT_BFLY
+
+INIT_XMM sse2
+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]
+
+ pxor m2, m6
+ pxor m0, m6
+ pshufd m2, m2, q0123
+ pshufd m0, m0, q0123
+ SBUTTERFLY dq, 2, 3, 5
+ SBUTTERFLY dq, 0, 1, 4
+ mova [r2q + 2*r3q + 0*mmsize], m2
+ mova [r2q + 2*r3q + 1*mmsize], m3
+ mova [r2q + 2*r3q + 2*mmsize], m0
+ mova [r2q + 2*r3q + 3*mmsize], m1
+ add r1q, 2*mmsize
+ sub r3q, 2*mmsize
+ jge .loop
+ mova m2, [zq]
+ movq [r2q], m2
+ REP_RET
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 8cc37dd..f97479e 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -36,6 +36,7 @@ void ff_sbr_neg_odd_64_sse(float *z);
void ff_sbr_qmf_post_shuffle_sse(float W[32][2], const float *z);
void ff_sbr_qmf_deint_bfly_sse(float *v, const float *src0, const float *src1);
void ff_sbr_qmf_deint_bfly_sse2(float *v, const float *src0, const float *src1);
+void ff_sbr_qmf_pre_shuffle_sse2(float *z);
av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
{
@@ -53,5 +54,6 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
if (EXTERNAL_SSE2(mm_flags)) {
s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_sse2;
+ s->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_sse2;
}
}
More information about the ffmpeg-cvslog
mailing list