In the aligned case, the existing RVI assembler is actually much faster. In the unaligned case, there is nothing much to gain over C.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -36,8 +36,6 @@ void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels, · 35 unmodified lines | ||
| 36 | 36 | ptrdiff_t stride); |
| 37 | 37 | void ff_get_pixels_unaligned_8_rvv(int16_t *block, const uint8_t *pixels, |
| 38 | 38 | ptrdiff_t stride); |
| 39 | −void ff_get_pixels_unaligned_16_rvv(int16_t *block, const uint8_t *pixels, | |
| 40 | − ptrdiff_t stride); | |
| 41 | 39 | void ff_diff_pixels_rvv(int16_t *block, const uint8_t *s1, |
| 42 | 40 | const uint8_t *s2, ptrdiff_t stride); |
| 43 | 41 | void ff_diff_pixels_unaligned_rvv(int16_t *block, const uint8_t *s1, |
| @@ -58,10 +56,7 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, · 14 unmodified lines | ||
| 58 | 56 | |
| 59 | 57 | #if HAVE_RVV |
| 60 | 58 | if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) { |
| 61 | − if (high_bit_depth) { | |
| 62 | − c->get_pixels = ff_get_pixels_unaligned_16_rvv; | |
| 63 | − c->get_pixels_unaligned = ff_get_pixels_unaligned_16_rvv; | |
| 64 | − } else { | |
| 59 | + if (!high_bit_depth) { | |
| 65 | 60 | c->get_pixels = ff_get_pixels_unaligned_8_rvv; |
| 66 | 61 | c->get_pixels_unaligned = ff_get_pixels_unaligned_8_rvv; |
| 67 | 62 | } |
| @@ -45,13 +45,6 @@ func ff_get_pixels_unaligned_8_rvv, zve32x · 44 unmodified lines | ||
| 45 | 45 | ret |
| 46 | 46 | endfunc |
| 47 | 47 | |
| 48 | −func ff_get_pixels_unaligned_16_rvv, zve32x | |
| 49 | − vsetivli zero, 8, e16, m1, ta, ma | |
| 50 | − vlsseg8e16.v v0, (a1), a2 | |
| 51 | − vsseg8e16.v v0, (a0) | |
| 52 | − ret | |
| 53 | −endfunc | |
| 54 | − | |
| 55 | 48 | func ff_diff_pixels_rvv, zve64x |
| 56 | 49 | vsetivli zero, 8, e8, mf2, ta, ma |
| 57 | 50 | li t0, 8 * 8 |