Skip to content
Snippets Groups Projects
Commit 45fe2cb8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Hugo Beauzée-Luyssen
Browse files

deinterlace: add RV-V merge functions

parent d1bb5e9a
No related branches found
No related tags found
1 merge request!1322deinterlace: RISC-V Vector Extension
Pipeline #186939 passed with stage
in 18 minutes and 43 seconds
......@@ -191,6 +191,10 @@ if HAVE_SVE
libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_sve.S
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
......
......@@ -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;
......
......@@ -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
*****************************************************************************/
......
/******************************************************************************
* 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment