diff options
author | RĂ©mi Denis-Courmont <remi@remlab.net> | 2022-09-27 23:04:27 +0300 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-09-28 11:46:11 +0200 |
commit | d31013166ac3727ae7c7ebbb756e1e5800bc2b40 (patch) | |
tree | 7d21022dff108027c9146f9355a3c58a0e5dd486 /libavcodec | |
parent | ebee25855a453de56ff3bd06e666d07b26fa15b2 (diff) | |
download | ffmpeg-d31013166ac3727ae7c7ebbb756e1e5800bc2b40.tar.gz |
lavc/pixblockdsp: RISC-V diff_pixels & diff_pixels_unaligned
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/riscv/pixblockdsp_init.c | 4 | ||||
-rw-r--r-- | libavcodec/riscv/pixblockdsp_rvv.S | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/riscv/pixblockdsp_init.c b/libavcodec/riscv/pixblockdsp_init.c index bbda381c12..aa39a8a665 100644 --- a/libavcodec/riscv/pixblockdsp_init.c +++ b/libavcodec/riscv/pixblockdsp_init.c @@ -36,6 +36,8 @@ void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels, ptrdiff_t stride); void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels, 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, 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; else c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv; + + c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_rvv; } #endif } diff --git a/libavcodec/riscv/pixblockdsp_rvv.S b/libavcodec/riscv/pixblockdsp_rvv.S index 3392b4b2eb..c125408523 100644 --- a/libavcodec/riscv/pixblockdsp_rvv.S +++ b/libavcodec/riscv/pixblockdsp_rvv.S @@ -42,3 +42,19 @@ func ff_get_pixels_16_rvv, zve32x vsseg8e16.v v0, (a0) ret 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 |