@@ -97,7 +97,7 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int bit_depth,
const bool zvl128b = ff_rv_vlen_least(128);
if (bit_depth == 8) {
- if (zvl128b)
+ if (zvl128b && (flags & AV_CPU_FLAG_RVB))
dsp->weight_h264_pixels_tab[0] =
ff_h264_weight_funcs_8_rvv[0].weight;
if (flags & AV_CPU_FLAG_RVV_I64)
@@ -29,7 +29,7 @@
#include "libavutil/riscv/asm.S"
.macro h264_weight depth, w, b=
-func ff_h264_weight_pixels\w\()_\depth\()_rvv, zve64x
+func ff_h264_weight_pixels\w\()_\depth\()_rvv, zve64x, b
lpad 0
csrwi vxrm, 0
sll a5, a5, a3
@@ -37,16 +37,24 @@ func ff_h264_weight_pixels\w\()_\depth\()_rvv, zve64x
li a6, \w
1:
vsetvli zero, a6, e16, m2, ta, ma
+ add t0, a0, a1
vle8.v v8, (a0)
- addi a2, a2, -1
+ addi a2, a2, -2
+ vle8.v v9, (t0)
vzext.vf2 v24, v8
+ vzext.vf2 v26, v9
vmul.vx v16, v24, a4
+ vmul.vx v18, v26, a4
vsadd.vx v16, v16, a5
- vmax.vx v16, v16, zero
- vsetvli zero, zero, e8, m1, ta, ma
+ vsadd.vx v18, v18, a5
+ vmax.vx v16, v16, zero
+ vmax.vx v18, v18, zero
+ vsetvli zero, zero, e8, m1, ta, ma
vnclipu.wx v8, v16, a3
+ vnclipu.wx v9, v18, a3
vse8.v v8, (a0)
- add a0, a0, a1
+ vse8.v v9, (t0)
+ sh1add a0, a1, a0
.else
1:
vsetvli t1, a2, e\b, m2, ta, ma