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
99 OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o
1010 RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o
1111 OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o
12−RV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvf.o
1312 RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
1413 OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_init.o
1514 RVV-OBJS-$(CONFIG_BLOCKDSP) += riscv/blockdsp_rvv.o
libavcodec/riscv/audiodsp_init.c+1−7
@@ -24,8 +24,6 @@ · 23 unmodified lines
2424 #include "libavutil/cpu.h"
2525 #include "libavcodec/audiodsp.h"
2626
27−void ff_vector_clipf_rvf(float *dst, const float *src, int len, float min, float max);
28−
2927 int32_t ff_scalarproduct_int16_rvv(const int16_t *v1, const int16_t *v2, int len);
3028 void ff_vector_clip_int32_rvv(int32_t *dst, const int32_t *src, int32_t min,
3129 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
3331
3432 av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)
3533 {
36−#if HAVE_RV
34+#if HAVE_RVV
3735 int flags = av_get_cpu_flags();
3836
39− if (flags & AV_CPU_FLAG_RVF)
40− c->vector_clipf = ff_vector_clipf_rvf;
41−#if HAVE_RVV
4237 if (flags & AV_CPU_FLAG_RVB_ADDR) {
4338 if (flags & AV_CPU_FLAG_RVV_I32) {
4439 c->scalarproduct_int16 = ff_scalarproduct_int16_rvv;
@@ -48,5 +43,4 @@ av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) · 3 unmodified lines
4843 c->vector_clipf = ff_vector_clipf_rvv;
4944 }
5045 #endif
51−#endif
5246 }
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−
23−func ff_vector_clipf_rvf, f
24− lpad 0
25−NOHWF fmv.w.x fa0, a3
26−NOHWF fmv.w.x fa1, a4
27−1:
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
50−endfunc

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