diff options
author | Rémi Denis-Courmont <remi@remlab.net> | 2022-09-26 17:52:28 +0300 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-09-27 13:19:52 +0200 |
commit | a6c10d05fe26dcfb5920fa4ce8ea8f74bf5f82dc (patch) | |
tree | 68e1885ac4e3494760ed79dbc836e5f15b83b384 /libavutil/riscv/float_dsp_init.c | |
parent | 39357cad37e865b723c7a97adc27d4a6b4388008 (diff) | |
download | ffmpeg-a6c10d05fe26dcfb5920fa4ce8ea8f74bf5f82dc.tar.gz |
lavu/floatdsp: RISC-V V vector_fmul_scalar
This is based on existing code from the VLC git tree with two minor
changes to account for the different function prototypes.
Diffstat (limited to 'libavutil/riscv/float_dsp_init.c')
-rw-r--r-- | libavutil/riscv/float_dsp_init.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c new file mode 100644 index 0000000000..f4299049b0 --- /dev/null +++ b/libavutil/riscv/float_dsp_init.c @@ -0,0 +1,39 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/float_dsp.h" + +void ff_vector_fmul_scalar_rvv(float *dst, const float *src, float mul, + int len); + +av_cold void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_F32) + fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_rvv; +#endif +} |