lavc/pixblockdsp: RISC-V diff_pixels & diff_pixels_unaligned

pull/388/head
Rémi Denis-Courmont 2 years ago committed by Lynne
parent ebee25855a
commit d31013166a
  1. 4
      libavcodec/riscv/pixblockdsp_init.c
  2. 16
      libavcodec/riscv/pixblockdsp_rvv.S

@ -36,6 +36,8 @@ void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels,
ptrdiff_t stride); ptrdiff_t stride);
void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels, void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels,
ptrdiff_t stride); ptrdiff_t stride);
void ff_diff_pixels_rvv(int16_t *block, const uint8_t *s1, const uint8_t *s2,
ptrdiff_t stride);
av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
AVCodecContext *avctx, AVCodecContext *avctx,
@ -56,6 +58,8 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_16_rvv; c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_16_rvv;
else else
c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv; c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv;
c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_rvv;
} }
#endif #endif
} }

@ -42,3 +42,19 @@ func ff_get_pixels_16_rvv, zve32x
vsseg8e16.v v0, (a0) vsseg8e16.v v0, (a0)
ret ret
endfunc endfunc
func ff_diff_pixels_rvv, zve32x
vsetivli zero, 8, e8, mf2, ta, ma
vlsseg8e8.v v16, (a1), a3
vlsseg8e8.v v24, (a2), a3
vwsubu.vv v8, v16, v24
vwsubu.vv v9, v17, v25
vwsubu.vv v10, v18, v26
vwsubu.vv v11, v19, v27
vwsubu.vv v12, v20, v28
vwsubu.vv v13, v21, v29
vwsubu.vv v14, v22, v30
vwsubu.vv v15, v23, v31
vsseg8e16.v v8, (a0)
ret
endfunc

Loading…
Cancel
Save