1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-18 03:19:31 +02:00
FFmpeg/libavcodec/riscv
Rémi Denis-Courmont 910d281b21 lavc/h263dsp: R-V V {h,v}_loop_filter
Since the horizontal and vertical filters are identical except for a
transposition, this uses a common subprocedure with an ad-hoc ABI.
To preserve return-address stack prediction, a link register has to be
used (c.f. the "Control Transfer Instructions" from the
RISC-V ISA Manual). The alternate/temporary link register T0 is used
here, so that the normal RA is preserved (something Arm cannot do!).

To load the strength value based on `qscale`, the shortest possible
and PIC-compatible sequence is used: AUIPC; ADD; LBU. The classic
LLA; ADD; LBU sequence would add one more instruction since LLA is a
convenience alias for AUIPC; ADDI. To ensure that this trick works,
relocation relaxation is disabled.

To implement the two signed divisions by a power of two toward zero:
 (x / (1 << SHIFT))
the code relies on the small range of integers involved, computing:
 (x + (x >> (16 - SHIFT))) >> SHIFT
rather than the more general:
 (x + ((x >> (16 - 1)) & ((1 << SHIFT) - 1))) >> SHIFT
Thus one ANDI instruction is avoided.

T-Head C908:
h263dsp.h_loop_filter_c:       228.2
h263dsp.h_loop_filter_rvv_i32: 144.0
h263dsp.v_loop_filter_c:       242.7
h263dsp.v_loop_filter_rvv_i32: 114.0
(C is probably worse in real use due to less predictible branches.)
2024-05-22 19:15:39 +03:00
..
aacencdsp_init.c
aacencdsp_rvv.S
aacpsdsp_init.c
aacpsdsp_rvv.S lavc/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
ac3dsp_init.c lavc/ac3dsp: add R-V Zvbb extract_exponents 2024-05-11 11:38:49 +03:00
ac3dsp_rvb.S lavc/ac3dsp: R-V Zbb ac3_exponent_min 2024-05-06 22:10:16 +03:00
ac3dsp_rvv.S lavc/ac3dsp: R-V V min_exponents 2024-05-04 10:17:11 +03:00
ac3dsp_rvvb.S lavc/ac3dsp: add R-V Zvbb extract_exponents 2024-05-11 11:38:49 +03:00
alacdsp_init.c
alacdsp_rvv.S
audiodsp_init.c
audiodsp_rvf.S
audiodsp_rvv.S
blockdsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
blockdsp_rvv.S lavc/blockdsp: R-V V fill_block 2024-05-03 17:49:23 +03:00
bswapdsp_init.c
bswapdsp_rvb.S
bswapdsp_rvv.S
exrdsp_init.c
exrdsp_rvv.S
flacdsp_init.c lavc/flacdsp: optimise RVV vector type for lpc32 2024-05-19 18:37:33 +03:00
flacdsp_rvv.S lavc/flacdsp: optimise RVV vector type for lpc32 2024-05-19 18:37:33 +03:00
fmtconvert_init.c
fmtconvert_rvv.S
g722dsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
g722dsp_rvv.S
h263dsp_init.c lavc/h263dsp: R-V V {h,v}_loop_filter 2024-05-22 19:15:39 +03:00
h263dsp_rvv.S lavc/h263dsp: R-V V {h,v}_loop_filter 2024-05-22 19:15:39 +03:00
h264_chroma_init_riscv.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
h264_mc_chroma.S
h264dsp_init.c lavc/startcode: add R-V V startcode_find_candidate 2024-05-19 10:03:49 +03:00
huffyuvdsp_init.c lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32 2024-05-19 18:37:33 +03:00
huffyuvdsp_rvv.S lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32 2024-05-19 18:37:33 +03:00
idctdsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
idctdsp_rvv.S
jpeg2000dsp_init.c
jpeg2000dsp_rvv.S
llauddsp_init.c
llauddsp_rvv.S
llviddsp_init.c
llviddsp_rvv.S
llvidencdsp_init.c
llvidencdsp_rvv.S
lpc_init.c
lpc_rvv.S
Makefile lavc/h263dsp: R-V V {h,v}_loop_filter 2024-05-22 19:15:39 +03:00
me_cmp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
me_cmp_rvv.S
opusdsp_init.c
opusdsp_rvv.S lavc/riscv: explicitly require Zbb for MIN 2024-05-10 18:59:06 +03:00
pixblockdsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
pixblockdsp_rvi.S
pixblockdsp_rvv.S
rv34dsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
rv34dsp_rvv.S
rv40dsp_init.c lavc/riscv: use ff_rv_vlen_least() 2024-05-13 18:36:07 +03:00
rv40dsp_rvv.S lavc/rv40dsp: R-V V chroma_mc 2024-05-03 18:00:53 +03:00
sbrdsp_init.c Revert "lavc/sbrdsp: R-V V neg_odd_64" 2024-05-21 21:26:39 +03:00
sbrdsp_rvv.S Revert "lavc/sbrdsp: R-V V neg_odd_64" 2024-05-21 21:26:39 +03:00
startcode_rvb.S lavc/startcode: add R-V Zbb startcode_find_candidate 2024-05-19 10:03:49 +03:00
startcode_rvv.S lavc/startcode: add R-V V startcode_find_candidate 2024-05-19 10:03:49 +03:00
svqenc_init.c
svqenc_rvv.S
takdsp_init.c
takdsp_rvv.S
utvideodsp_init.c
utvideodsp_rvv.S
vc1dsp_init.c lavc/vc1dsp: R-V V vc1_unescape_buffer 2024-05-21 21:16:30 +03:00
vc1dsp_rvi.S lavc/vc1dsp: R-V V mspel_pixels 2024-05-16 17:08:18 +03:00
vc1dsp_rvv.S lavc/vc1dsp: R-V V vc1_unescape_buffer 2024-05-21 21:16:30 +03:00
vorbisdsp_init.c
vorbisdsp_rvv.S
vp8dsp_init.c lavc/vp8dsp: restrict RVI optimisations 2024-05-14 19:50:00 +03:00
vp8dsp_rvi.S lavc/vp8dsp: R-V put_vp8_pixels 2024-05-10 18:41:13 +03:00
vp8dsp_rvv.S lavc/vp8dsp: fix .irp use with LLVM as 2024-05-19 10:03:49 +03:00
vp8dsp.h lavc/vp8dsp: R-V put_vp8_pixels 2024-05-10 18:41:13 +03:00
vp9_intra_rvi.S lavc/vp9dsp: R-V ipred vert 2024-05-15 19:52:25 +03:00
vp9_intra_rvv.S lavc/vp9_intra: fix another .irp use with LLVM as 2024-05-19 10:22:46 +03:00
vp9_mc_rvi.S lavc/vp9dsp: R-V mc copy 2024-05-15 19:52:28 +03:00
vp9_mc_rvv.S lavc/vp9dsp: R-V V mc avg 2024-05-21 21:28:14 +03:00
vp9dsp_init.c lavc/vp9dsp: R-V V mc avg 2024-05-21 21:28:14 +03:00
vp9dsp.h lavc/vp9dsp: R-V V ipred tm 2024-05-17 18:12:11 +03:00