History

lavc/jpeg2000dsp: R-V V rct_int

jpeg2000_rct_int_c: 2592.2 jpeg2000_rct_int_rvv_i32: 1154.2

Rémi Denis-Courmont committed 3 years ago

Commit 28840cf1 parent 73dea2b2 files · +29 −2Browse files

Unified · Split

2 files
  1. libavcodec/riscv/jpeg2000dsp_init.c +6 −2
  2. libavcodec/riscv/jpeg2000dsp_rvv.S +23 −0
libavcodec/riscv/jpeg2000dsp_init.c+6−2
@@ -24,13 +24,17 @@ · 23 unmodified lines
24#include "libavcodec/jpeg2000dsp.h"24#include "libavcodec/jpeg2000dsp.h"
25 25
26void ff_ict_float_rvv(void *src0, void *src1, void *src2, int csize);26void ff_ict_float_rvv(void *src0, void *src1, void *src2, int csize);
27void ff_rct_int_rvv(void *src0, void *src1, void *src2, int csize);
27 28
28av_cold void ff_jpeg2000dsp_init_riscv(Jpeg2000DSPContext *c)29av_cold void ff_jpeg2000dsp_init_riscv(Jpeg2000DSPContext *c)
29{30{
30#if HAVE_RVV31#if HAVE_RVV
31 int flags = av_get_cpu_flags();32 int flags = av_get_cpu_flags();
32 33
33 if ((flags & AV_CPU_FLAG_RVV_F32) && (flags & AV_CPU_FLAG_RVB_ADDR))34 if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
34 c->mct_decode[FF_DWT97] = ff_ict_float_rvv;35 if (flags & AV_CPU_FLAG_RVV_F32)
36 c->mct_decode[FF_DWT97] = ff_ict_float_rvv;
37 c->mct_decode[FF_DWT53] = ff_rct_int_rvv;
38 }
35#endif39#endif
36}40}
libavcodec/riscv/jpeg2000dsp_rvv.S+23−0
@@ -47,3 +47,26 @@ func ff_ict_float_rvv, zve32f · 46 unmodified lines
47 47
48 ret48 ret
49endfunc49endfunc
50
51func ff_rct_int_rvv, zve32x
521:
53 vsetvli t0, a3, e32, m8, ta, ma
54 vle32.v v16, (a1)
55 sub a3, a3, t0
56 vle32.v v24, (a2)
57 vle32.v v8, (a0)
58 vadd.vv v0, v16, v24
59 vsra.vi v0, v0, 2
60 vsub.vv v0, v8, v0
61 vadd.vv v8, v0, v24
62 vadd.vv v24, v0, v16
63 vse32.v v8, (a0)
64 sh2add a0, t0, a0
65 vse32.v v0, (a1)
66 sh2add a1, t0, a1
67 vse32.v v24, (a2)
68 sh2add a2, t0, a2
69 bnez a3, 1b
70
71 ret
72endfunc

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