forked from FFmpeg/FFmpeg
lavc/ac3dsp: R-V V min_exponents
T-Head C908: ac3_exponent_min_reuse0_c: 7.5 ac3_exponent_min_reuse0_rvv_i32: 7.5 ac3_exponent_min_reuse1_c: 1820.7 ac3_exponent_min_reuse1_rvv_i32: 102.5 ac3_exponent_min_reuse2_c: 3088.5 ac3_exponent_min_reuse2_rvv_i32: 138.7 ac3_exponent_min_reuse3_c: 5073.7 ac3_exponent_min_reuse3_rvv_i32: 174.7 ac3_exponent_min_reuse4_c: 4624.2 ac3_exponent_min_reuse4_rvv_i32: 204.2 ac3_exponent_min_reuse5_c: 5138.7 ac3_exponent_min_reuse5_rvv_i32: 238.0
This commit is contained in:
parent
5e7180864f
commit
38f67a32b3
2 changed files with 26 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "libavutil/cpu.h"
|
||||
#include "libavcodec/ac3dsp.h"
|
||||
|
||||
void ff_ac3_exponent_min_rvv(uint8_t *exp, int, int);
|
||||
void ff_extract_exponents_rvb(uint8_t *exp, int32_t *coef, int nb_coefs);
|
||||
void ff_float_to_fixed24_rvv(int32_t *dst, const float *src, size_t len);
|
||||
void ff_sum_square_butterfly_int32_rvv(int64_t *, const int32_t *,
|
||||
|
@ -38,6 +39,9 @@ av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c)
|
|||
#if HAVE_RV
|
||||
int flags = av_get_cpu_flags();
|
||||
|
||||
if (flags & AV_CPU_FLAG_RVV_I32)
|
||||
c->ac3_exponent_min = ff_ac3_exponent_min_rvv;
|
||||
|
||||
if (flags & AV_CPU_FLAG_RVB_ADDR) {
|
||||
if (flags & AV_CPU_FLAG_RVB_BASIC)
|
||||
c->extract_exponents = ff_extract_exponents_rvb;
|
||||
|
|
|
@ -21,6 +21,28 @@
|
|||
#include "config.h"
|
||||
#include "libavutil/riscv/asm.S"
|
||||
|
||||
func ff_ac3_exponent_min_rvv, zve32x
|
||||
beqz a1, 3f
|
||||
1:
|
||||
vsetvli t2, a2, e8, m8, ta, ma
|
||||
vle8.v v8, (a0)
|
||||
addi t0, a0, 256
|
||||
sub a2, a2, t2
|
||||
mv t1, a1
|
||||
2:
|
||||
vle8.v v16, (t0)
|
||||
addi t1, t1, -1
|
||||
vminu.vv v8, v8, v16
|
||||
addi t0, t0, 256
|
||||
bnez t1, 2b
|
||||
|
||||
vse8.v v8, (a0)
|
||||
add a0, a0, t2
|
||||
bnez a2, 1b
|
||||
3:
|
||||
ret
|
||||
endfunc
|
||||
|
||||
func ff_float_to_fixed24_rvv, zve32f
|
||||
li t1, 1 << 24
|
||||
fcvt.s.w f0, t1
|
||||
|
|
Loading…
Add table
Reference in a new issue