[FFmpeg-devel] [PATCH 2/2] lavc/startcode: add R-V V startcode_find_candidate
Rémi Denis-Courmont
remi at remlab.net
Sun May 12 13:56:19 EEST 2024
Le sunnuntaina 12. toukokuuta 2024, 13.55.14 EEST Rémi Denis-Courmont a écrit
:
> ---
> libavcodec/riscv/Makefile | 1 +
> libavcodec/riscv/h264dsp_init.c | 3 +++
> libavcodec/riscv/startcode_rvv.S | 44 ++++++++++++++++++++++++++++++++
> libavcodec/riscv/vc1dsp_init.c | 16 +++++++-----
> 4 files changed, 58 insertions(+), 6 deletions(-)
> create mode 100644 libavcodec/riscv/startcode_rvv.S
>
> diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
> index 319ea6427b..1b52d60dbf 100644
> --- a/libavcodec/riscv/Makefile
> +++ b/libavcodec/riscv/Makefile
> @@ -53,6 +53,7 @@ RVV-OBJS-$(CONFIG_RV34DSP) += riscv/rv34dsp_rvv.o
> OBJS-$(CONFIG_RV40_DECODER) += riscv/rv40dsp_init.o
> RVV-OBJS-$(CONFIG_RV40_DECODER) += riscv/rv40dsp_rvv.o
> RV-OBJS-$(CONFIG_STARTCODE) += riscv/startcode_rvb.o
> +RVV-OBJS-$(CONFIG_STARTCODE) += riscv/startcode_rvv.o
> OBJS-$(CONFIG_SVQ1_ENCODER) += riscv/svqenc_init.o
> RVV-OBJS-$(CONFIG_SVQ1_ENCODER) += riscv/svqenc_rvv.o
> OBJS-$(CONFIG_TAK_DECODER) += riscv/takdsp_init.o
> diff --git a/libavcodec/riscv/h264dsp_init.c
> b/libavcodec/riscv/h264dsp_init.c index 60c84734cd..d5984f1805 100644
> --- a/libavcodec/riscv/h264dsp_init.c
> +++ b/libavcodec/riscv/h264dsp_init.c
> @@ -27,6 +27,7 @@
> #include "libavcodec/h264dsp.h"
>
> extern int ff_startcode_find_candidate_rvb(const uint8_t *, int);
> +extern int ff_startcode_find_candidate_rvv(const uint8_t *, int);
>
> av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp, const int
> bit_depth, const int chroma_format_idc)
> @@ -36,5 +37,7 @@ av_cold void ff_h264dsp_init_riscv(H264DSPContext *dsp,
> const int bit_depth,
>
> if (flags & AV_CPU_FLAG_RVB_BASIC)
> dsp->startcode_find_candidate = ff_startcode_find_candidate_rvb;
> + if (flags & AV_CPU_FLAG_RVV_I32)
> + dsp->startcode_find_candidate = ff_startcode_find_candidate_rvv;
> #endif
Missing HAVE_RVV test to be added locally.
--
レミ・デニ-クールモン
http://www.remlab.net/
More information about the ffmpeg-devel
mailing list