[FFmpeg-cvslog] x86: sbrdsp: Implement SSE qmf_post_shuffle

Christophe Gisquet git at videolan.org
Mon Jan 7 01:54:41 CET 2013


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Sun Nov 25 07:55:28 2012 +0100| [4f50646697606df39317b93c2a427603b77636ee] | committer: Diego Biurrun

x86: sbrdsp: Implement SSE qmf_post_shuffle

255 to 174 cycles on Arrandale / Win64. Unrolling yields no gain.

Signed-off-by: Diego Biurrun <diego at biurrun.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f50646697606df39317b93c2a427603b77636ee
---

 libavcodec/x86/sbrdsp.asm    |   20 ++++++++++++++++++++
 libavcodec/x86/sbrdsp_init.c |    2 ++
 2 files changed, 22 insertions(+)

diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index 063c24f..ae84490 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_neg          times 4 dd 1<<31
 
 SECTION_TEXT
 
@@ -203,3 +204,22 @@ cglobal sbr_sum64x5, 1,2,4,z
     cmp     zq, r1q
     jne  .loop
     REP_RET
+
+INIT_XMM sse
+cglobal sbr_qmf_post_shuffle, 2,3,4,W,z
+    lea              r2q, [zq + (64-4)*4]
+    mova              m3, [ps_neg]
+.loop:
+    mova              m1, [zq]
+    xorps             m0, m3, [r2q]
+    shufps            m0, m0, m0, q0123
+    unpcklps          m2, m0, m1
+    unpckhps          m0, m0, m1
+    mova       [Wq +  0], m2
+    mova       [Wq + 16], m0
+    add               Wq, 32
+    sub              r2q, 16
+    add               zq, 16
+    cmp               zq, r2q
+    jl             .loop
+    REP_RET
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 264b455..747817b 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -31,6 +31,7 @@ void ff_sbr_hf_g_filt_sse(float (*Y)[2], const float (*X_high)[40][2],
 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_sbrdsp_init_x86(SBRDSPContext *s)
 {
@@ -41,5 +42,6 @@ void ff_sbrdsp_init_x86(SBRDSPContext *s)
         s->sum64x5    = ff_sbr_sum64x5_sse;
         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;
     }
 }



More information about the ffmpeg-cvslog mailing list