T-Head C908: flac_wasted_32_c: 949.0 flac_wasted_32_rvv_i32: 278.7
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -31,6 +31,7 @@ void ff_flac_lpc32_rvv(int32_t *decoded, const int coeffs[32], · 30 unmodified lines | ||
| 31 | 31 | int pred_order, int qlevel, int len); |
| 32 | 32 | void ff_flac_lpc32_rvv_simple(int32_t *decoded, const int coeffs[32], |
| 33 | 33 | int pred_order, int qlevel, int len); |
| 34 | +void ff_flac_wasted32_rvv(int32_t *, int shift, int len); | |
| 34 | 35 | void ff_flac_decorrelate_indep2_16_rvv(uint8_t **out, int32_t **in, |
| 35 | 36 | int channels, int len, int shift); |
| 36 | 37 | void ff_flac_decorrelate_indep4_16_rvv(uint8_t **out, int32_t **in, |
| @@ -79,7 +80,11 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 42 unmodified lines | ||
| 79 | 80 | else |
| 80 | 81 | c->lpc32 = ff_flac_lpc32_rvv; |
| 81 | 82 | } |
| 83 | +# endif | |
| 84 | + | |
| 85 | + c->wasted32 = ff_flac_wasted32_rvv; | |
| 82 | 86 | |
| 87 | +# if (__riscv_xlen >= 64) | |
| 83 | 88 | switch (fmt) { |
| 84 | 89 | case AV_SAMPLE_FMT_S16: |
| 85 | 90 | switch (channels) { |
| @@ -119,8 +124,8 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 33 unmodified lines | ||
| 119 | 124 | c->decorrelate[2] = ff_flac_decorrelate_rs_32_rvv; |
| 120 | 125 | c->decorrelate[3] = ff_flac_decorrelate_ms_32_rvv; |
| 121 | 126 | break; |
| 122 | −# endif | |
| 123 | 127 | } |
| 128 | +# endif | |
| 124 | 129 | } |
| 125 | 130 | #endif |
| 126 | 131 | } |
| @@ -100,7 +100,22 @@ func ff_flac_lpc32_rvv_simple, zve64x · 99 unmodified lines | ||
| 100 | 100 | |
| 101 | 101 | ret |
| 102 | 102 | endfunc |
| 103 | +#endif | |
| 104 | + | |
| 105 | +func ff_flac_wasted32_rvv, zve32x | |
| 106 | +1: | |
| 107 | + vsetvli t0, a2, e32, m8, ta, ma | |
| 108 | + vle32.v v8, (a0) | |
| 109 | + sub a2, a2, t0 | |
| 110 | + vsll.vx v8, v8, a1 | |
| 111 | + vse32.v v8, (a0) | |
| 112 | + sh2add a0, t0, a0 | |
| 113 | + bnez a2, 1b | |
| 103 | 114 | |
| 115 | + ret | |
| 116 | +endfunc | |
| 117 | + | |
| 118 | +#if (__riscv_xlen == 64) | |
| 104 | 119 | func ff_flac_decorrelate_indep2_16_rvv, zve32x |
| 105 | 120 | ld a0, (a0) |
| 106 | 121 | ld a2, 8(a1) |