@@ -25,6 +25,7 @@
#include "libavutil/riscv/cpu.h"
#include "libavcodec/h263dsp.h"
+void ff_h263_dct_unquantize_rvv(int16_t *, size_t start, size_t end, int, int);
void ff_h263_h_loop_filter_rvv(uint8_t *src, int stride, int q);
void ff_h263_v_loop_filter_rvv(uint8_t *src, int stride, int q);
@@ -33,9 +34,14 @@ av_cold void ff_h263dsp_init_riscv(H263DSPContext *c)
#if HAVE_RVV
int flags = av_get_cpu_flags();
- if ((flags & AV_CPU_FLAG_RVV_I32) && ff_rv_vlen_least(128)) {
- c->h263_h_loop_filter = ff_h263_h_loop_filter_rvv;
- c->h263_v_loop_filter = ff_h263_v_loop_filter_rvv;
+ if (flags & AV_CPU_FLAG_RVV_I32) {
+ if (flags & AV_CPU_FLAG_RVB_ADDR)
+ c->h263_dct_unquantize = ff_h263_dct_unquantize_rvv;
+
+ if (ff_rv_vlen_least(128)) {
+ c->h263_h_loop_filter = ff_h263_h_loop_filter_rvv;
+ c->h263_v_loop_filter = ff_h263_v_loop_filter_rvv;
+ }
}
#endif
}
@@ -20,6 +20,28 @@
#include "libavutil/riscv/asm.S"
+func ff_h263_dct_unquantize_rvv, zve32x
+ sub a2, a2, a1
+ sh1add a0, a1, a0
+ addi a2, a2, 1
+1:
+ vsetvli t0, a2, e16, m4, ta, mu
+ vle16.v v8, (a0)
+ sub a2, a2, t0
+ vmv.v.x v24, a4
+ vmslt.vi v0, v8, 0
+ vneg.v v24, v24, v0.t
+ vmsne.vi v0, v8, 0
+ vwmul.vx v16, v8, a3
+ vwadd.wv v16, v16, v24, v0.t
+ vncvt.x.x.w v8, v16
+ vse16.v v8, (a0)
+ sh1add a0, t0, a0
+ bnez a2, 1b
+
+ ret
+endfunc
+
.option push
.option norelax
func ff_h263_h_loop_filter_rvv, zve32x