lavc/ac3dsp: R-V Zbb ac3_exponent_min

SiFive U74:
ac3_exponent_min_reuse0_c:       10.0
ac3_exponent_min_reuse0_rvb_b:    8.0
ac3_exponent_min_reuse1_c:     2924.7
ac3_exponent_min_reuse1_rvb_b: 1803.0
ac3_exponent_min_reuse2_c:     5043.0
ac3_exponent_min_reuse2_rvb_b: 2827.5
ac3_exponent_min_reuse3_c:     7028.7
ac3_exponent_min_reuse3_rvb_b: 3872.0
ac3_exponent_min_reuse4_c:     8824.2
ac3_exponent_min_reuse4_rvb_b: 5122.2
ac3_exponent_min_reuse5_c:    10487.5
ac3_exponent_min_reuse5_rvb_b: 6412.2
release/7.1
Rémi Denis-Courmont 9 months ago
parent 95d1052fba
commit 9e77188cba
  1. 3
      libavcodec/riscv/ac3dsp_init.c
  2. 21
      libavcodec/riscv/ac3dsp_rvb.S

@ -26,6 +26,7 @@
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavcodec/ac3dsp.h" #include "libavcodec/ac3dsp.h"
void ff_ac3_exponent_min_rvb(uint8_t *exp, int, int);
void ff_ac3_exponent_min_rvv(uint8_t *exp, int, int); 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_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_float_to_fixed24_rvv(int32_t *dst, const float *src, size_t len);
@ -39,6 +40,8 @@ av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c)
#if HAVE_RV #if HAVE_RV
int flags = av_get_cpu_flags(); int flags = av_get_cpu_flags();
if (flags & AV_CPU_FLAG_RVB_BASIC)
c->ac3_exponent_min = ff_ac3_exponent_min_rvb;
if (flags & AV_CPU_FLAG_RVV_I32) if (flags & AV_CPU_FLAG_RVV_I32)
c->ac3_exponent_min = ff_ac3_exponent_min_rvv; c->ac3_exponent_min = ff_ac3_exponent_min_rvv;

@ -21,6 +21,27 @@
#include "config.h" #include "config.h"
#include "libavutil/riscv/asm.S" #include "libavutil/riscv/asm.S"
func ff_ac3_exponent_min_rvb, zbb
beqz a1, 3f
1:
addi a2, a2, -1
lb t3, (a0)
addi t0, a0, 256
mv t1, a1
2:
lb t4, (t0)
addi t1, t1, -1
addi t0, t0, 256
minu t3, t3, t4
bnez t1, 2b
sb t3, (a0)
addi a0, a0, 1
bnez a2, 1b
3:
ret
endfunc
func ff_extract_exponents_rvb, zbb func ff_extract_exponents_rvb, zbb
1: 1:
lw t0, (a1) lw t0, (a1)

Loading…
Cancel
Save