Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
e43463ff by Rémi Denis-Courmont at 2022-02-04T10:33:09+00:00
deinterlace: move X86 hack under X86 predicate

- - - - -
d1bb5e9a by Rémi Denis-Courmont at 2022-02-04T10:33:09+00:00
deinterlace: pass -D flags via CPPFLAGS

- - - - -
45fe2cb8 by Rémi Denis-Courmont at 2022-02-04T10:33:09+00:00
deinterlace: add RV-V merge functions

- - - - -


4 changed files:

- modules/video_filter/Makefile.am
- modules/video_filter/deinterlace/deinterlace.c
- modules/video_filter/deinterlace/merge.h
- + modules/video_filter/deinterlace/merge_rvv.S


Changes:

=====================================
modules/video_filter/Makefile.am
=====================================
@@ -172,22 +172,28 @@ libdeinterlace_plugin_la_SOURCES = \
        video_filter/deinterlace/yadif.h \
        video_filter/deinterlace/algo_phosphor.c 
video_filter/deinterlace/algo_phosphor.h \
        video_filter/deinterlace/algo_ivtc.c 
video_filter/deinterlace/algo_ivtc.h
-# inline ASM doesn't build with -O0
-libdeinterlace_plugin_la_CFLAGS = $(AM_CFLAGS) -O2
+libdeinterlace_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
+libdeinterlace_plugin_la_CFLAGS = $(AM_CFLAGS)
 if HAVE_X86ASM
 libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/yadif_x86.asm
+# inline ASM doesn't build with -O0
+libdeinterlace_plugin_la_CFLAGS += -O2
 endif
 if HAVE_NEON
 libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_arm.S
-libdeinterlace_plugin_la_CFLAGS += -DCAN_COMPILE_ARM
+libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_ARM
 endif
 if HAVE_ARM64
 libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_arm64.S
-libdeinterlace_plugin_la_CFLAGS += -DCAN_COMPILE_ARM64
+libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_ARM64
 endif
 if HAVE_SVE
 libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_sve.S
-libdeinterlace_plugin_la_CFLAGS += -DCAN_COMPILE_SVE
+libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_SVE
+endif
+if HAVE_RVV
+libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_rvv.S
+libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_RVV
 endif
 libdeinterlace_plugin_la_LIBADD = libdeinterlace_common.la
 video_filter_LTLIBRARIES += libdeinterlace_plugin.la


=====================================
modules/video_filter/deinterlace/deinterlace.c
=====================================
@@ -578,6 +578,11 @@ notsupp:
     if( vlc_CPU_ARM_NEON() )
         p_sys->pf_merge = pixel_size == 1 ? merge8_arm64_neon : 
merge16_arm64_neon;
     else
+#endif
+#if defined(CAN_COMPILE_RVV)
+    if( vlc_CPU_RV_V() )
+        p_sys->pf_merge = pixel_size == 1 ? merge8_rvv : merge16_rvv;
+    else
 #endif
     {
         p_sys->pf_merge = pixel_size == 1 ? Merge8BitGeneric : 
Merge16BitGeneric;


=====================================
modules/video_filter/deinterlace/merge.h
=====================================
@@ -159,6 +159,9 @@ void merge16_arm64_neon (void *, const void *, const void 
*, size_t);
 void merge8_arm_sve(void *, const void *, const void *, size_t);
 void merge16_arm_sve(void *, const void *, const void *, size_t);
 
+void merge8_rvv(void *, const void *, const void *, size_t);
+void merge16_rvv(void *, const void *, const void *, size_t);
+
 /*****************************************************************************
  * EndMerge routines
  *****************************************************************************/


=====================================
modules/video_filter/deinterlace/merge_rvv.S
=====================================
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * merge_rvv.S: RISC-V Vector mean
+ ******************************************************************************
+ * Copyright (C) 2022 Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+       .option arch, +v
+       .text
+       .align  2
+
+       .globl  merge8_rvv
+       .type   merge8_rvv, %function
+merge8_rvv:
+       csrwi   vxrm, 0
+1:     vsetvli t0, a3, e8, m8, ta, ma
+       vle8.v  v16, (a1)
+       add     a1, a1, t0
+       vle8.v  v24, (a2)
+       add     a2, a2, t0
+       vaaddu.vv       v16, v16, v24
+       sub     a3, a3, t0
+       vse8.v  v16, (a0)
+       add     a0, a0, t0
+       bnez    a3, 1b
+       ret
+
+       .globl  merge16_rvv
+       .type   merge16_rvv, %function
+merge16_rvv:
+       csrwi   vxrm, 0
+       srli    a3, a3, 1
+1:     vsetvli t0, a3, e16, m8, ta, ma
+       slli    t1, t0, 1
+       vle16.v v16, (a1)
+       add     a1, a1, t1
+       vle16.v v24, (a2)
+       add     a2, a2, t1
+       vaaddu.vv       v16, v16, v24
+       sub     a3, a3, t0
+       vse16.v v16, (a0)
+       add     a0, a0, t1
+       bnez    a3, 1b
+       ret
+



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/499303f97f3cfd2b339fc9207c341a8d76c7bac2...45fe2cb83087a5cf7aa50dd38e1fe5446137f5d0

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/499303f97f3cfd2b339fc9207c341a8d76c7bac2...45fe2cb83087a5cf7aa50dd38e1fe5446137f5d0
You're receiving this email because of your account on code.videolan.org.


_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to