History

lavc/audiodsp: drop R-V F vector_clipf

This is now firmly slower than C. SiFive-U74 (cycles): audiodsp.vector_clipf_c: 31.2 audiodsp.vector_clipf_rvf: 39.5

Rémi Denis-Courmont committed 2 years ago

Commit 2f083fd1 parent c48213b3 files · +1 −58Browse files

Unified · Split

3 files
  1. libavcodec/riscv/Makefile +0 −1
  2. libavcodec/riscv/audiodsp_init.c +1 −7
  3. libavcodec/riscv/audiodsp_rvf.S +0 −50
libavcodec/riscv/Makefile+0−1
@@ -9,7 +9,6 @@ RVVB-OBJS-$(CONFIG_AC3DSP) += riscv/ac3dsp_rvvb.o · 8 unmodified lines
9OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o9OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o
10RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o10RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o
11OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o11OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o
12RV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvf.o
13RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o12RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
14OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_init.o13OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_init.o
15RVV-OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_rvv.o14RVV-OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_rvv.o
libavcodec/riscv/audiodsp_init.c+1−7
@@ -24,8 +24,6 @@ · 23 unmodified lines
24#include "libavutil/cpu.h"24#include "libavutil/cpu.h"
25#include "libavcodec/audiodsp.h"25#include "libavcodec/audiodsp.h"
26 26
27void ff_vector_clipf_rvf(float *dst, const float *src, int len, float min, float max);
28
29int32_t ff_scalarproduct_int16_rvv(const int16_t *v1, const int16_t *v2, int len);27int32_t ff_scalarproduct_int16_rvv(const int16_t *v1, const int16_t *v2, int len);
30void ff_vector_clip_int32_rvv(int32_t *dst, const int32_t *src, int32_t min,28void ff_vector_clip_int32_rvv(int32_t *dst, const int32_t *src, int32_t min,
31 int32_t max, unsigned int len);29 int32_t max, unsigned int len);
@@ -33,12 +31,9 @@ void ff_vector_clipf_rvv(float *dst, const float *src, int len, float min, float · 1 unmodified line
33 31
34av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)32av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)
35{33{
36#if HAVE_RV34#if HAVE_RVV
37 int flags = av_get_cpu_flags();35 int flags = av_get_cpu_flags();
38 36
39 if (flags & AV_CPU_FLAG_RVF)
40 c->vector_clipf = ff_vector_clipf_rvf;
41#if HAVE_RVV
42 if (flags & AV_CPU_FLAG_RVB_ADDR) {37 if (flags & AV_CPU_FLAG_RVB_ADDR) {
43 if (flags & AV_CPU_FLAG_RVV_I32) {38 if (flags & AV_CPU_FLAG_RVV_I32) {
44 c->scalarproduct_int16 = ff_scalarproduct_int16_rvv;39 c->scalarproduct_int16 = ff_scalarproduct_int16_rvv;
@@ -48,5 +43,4 @@ av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) · 3 unmodified lines
48 c->vector_clipf = ff_vector_clipf_rvv;43 c->vector_clipf = ff_vector_clipf_rvv;
49 }44 }
50#endif45#endif
51#endif
52}46}
libavcodec/riscv/audiodsp_rvf.S+0−50
@@ -1,50 +0,0 @@
1/*
2 * Copyright © 2022 Rémi Denis-Courmont.
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "libavutil/riscv/asm.S"
22
23func ff_vector_clipf_rvf, f
24 lpad 0
25NOHWF fmv.w.x fa0, a3
26NOHWF fmv.w.x fa1, a4
271:
28 flw ft0, (a1)
29 flw ft1, 4(a1)
30 fmax.s ft0, ft0, fa0
31 flw ft2, 8(a1)
32 fmax.s ft1, ft1, fa0
33 flw ft3, 12(a1)
34 fmax.s ft2, ft2, fa0
35 addi a2, a2, -4
36 fmax.s ft3, ft3, fa0
37 addi a1, a1, 16
38 fmin.s ft0, ft0, fa1
39 fmin.s ft1, ft1, fa1
40 fsw ft0, (a0)
41 fmin.s ft2, ft2, fa1
42 fsw ft1, 4(a0)
43 fmin.s ft3, ft3, fa1
44 fsw ft2, 8(a0)
45 fsw ft3, 12(a0)
46 addi a0, a0, 16
47 bnez a2, 1b
48
49 ret
50endfunc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t