[x264-devel] [PATCHv2 2/2] arm: x264_plane_copy_swap_neon

Yu Xiaolei dreifachstein at gmail.com
Thu May 22 15:07:15 CEST 2014


---
  common/arm/mc-a.S | 23 +++++++++++++++++++++++
  common/arm/mc-c.c |  3 +++
  2 files changed, 26 insertions(+)

diff --git a/common/arm/mc-a.S b/common/arm/mc-a.S
index 330b852..f2305b8 100644
--- a/common/arm/mc-a.S
+++ b/common/arm/mc-a.S
@@ -1597,6 +1597,29 @@ blocki:
      pop             {r4-r7, pc}
  .endfunc
  
+function x264_plane_copy_swap_neon
+    push            {r4-r5, lr}
+    ldrd            r4, r5, [sp, #12]
+    add             lr,  r4,  #15
+    bic             lr,  lr,  #15
+    sub             r1,  r1,  lr, lsl #1
+    sub             r3,  r3,  lr, lsl #1
+1:
+    vld2.8          {q0, q1}, [r2]!
+    subs            lr,  lr,  #16
+    vswp            q0, q1
+    vst2.8          {q0, q1}, [r0]!
+    bgt             1b
+
+    subs            r5,  r5,  #1
+    add             r0,  r0,  r1
+    add             r2,  r2,  r3
+    mov             lr,  r4
+    bgt             1b
+
+    pop             {r4-r5, pc}
+.endfunc
+
  function x264_store_interleave_chroma_neon
      push            {lr}
      ldr             lr,  [sp, #4]
diff --git a/common/arm/mc-c.c b/common/arm/mc-c.c
index 3805e73..73623c0 100644
--- a/common/arm/mc-c.c
+++ b/common/arm/mc-c.c
@@ -57,6 +57,8 @@ void x264_plane_copy_deinterleave_rgb_neon( pixel *dsta, intptr_t i_dsta,
  void x264_plane_copy_interleave_neon( pixel *dst,  intptr_t i_dst,
                                        pixel *srcu, intptr_t i_srcu,
                                        pixel *srcv, intptr_t i_srcv, int w, int h );
+void x264_plane_copy_swap_neon( pixel *dst, intptr_t i_dst,
+                                pixel *src, intptr_t i_src, int w, int h);
  
  void x264_store_interleave_chroma_neon( pixel *dst, intptr_t i_dst, pixel *srcu, pixel *srcv, int height );
  void x264_load_deinterleave_chroma_fdec_neon( pixel *dst, pixel *src, intptr_t i_src, int height );
@@ -243,6 +245,7 @@ void x264_mc_init_arm( int cpu, x264_mc_functions_t *pf )
      pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_neon;
      pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_neon;
      pf->plane_copy_interleave = x264_plane_copy_interleave_neon;
+    pf->plane_copy_swap = x264_plane_copy_swap_neon;
  
      pf->store_interleave_chroma = x264_store_interleave_chroma_neon;
      pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_neon;
-- 
2.0.0.rc2




More information about the x264-devel mailing list