From: "Rémi Denis-Courmont" <remi@remlab.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] lavc/ac3dsp: R-V Zbb ac3_exponent_min Date: Fri, 3 May 2024 21:08:00 +0300 Message-ID: <20240503180800.49703-1-remi@remlab.net> (raw) SiFive U74: ac3_exponent_min_reuse0_c: 10.0 ac3_exponent_min_reuse0_rvb_b: 8.0 ac3_exponent_min_reuse1_c: 2924.7 ac3_exponent_min_reuse1_rvb_b: 1803.0 ac3_exponent_min_reuse2_c: 5043.0 ac3_exponent_min_reuse2_rvb_b: 2827.5 ac3_exponent_min_reuse3_c: 7028.7 ac3_exponent_min_reuse3_rvb_b: 3872.0 ac3_exponent_min_reuse4_c: 8824.2 ac3_exponent_min_reuse4_rvb_b: 5122.2 ac3_exponent_min_reuse5_c: 10487.5 ac3_exponent_min_reuse5_rvb_b: 6412.2 --- libavcodec/riscv/ac3dsp_init.c | 3 +++ libavcodec/riscv/ac3dsp_rvb.S | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libavcodec/riscv/ac3dsp_init.c b/libavcodec/riscv/ac3dsp_init.c index c7c375273d..8cfa69055a 100644 --- a/libavcodec/riscv/ac3dsp_init.c +++ b/libavcodec/riscv/ac3dsp_init.c @@ -26,6 +26,7 @@ #include "libavutil/cpu.h" #include "libavcodec/ac3dsp.h" +void ff_ac3_exponent_min_rvb(uint8_t *exp, int, int); void ff_ac3_exponent_min_rvv(uint8_t *exp, int, int); void ff_extract_exponents_rvb(uint8_t *exp, int32_t *coef, int nb_coefs); void ff_float_to_fixed24_rvv(int32_t *dst, const float *src, size_t len); @@ -39,6 +40,8 @@ av_cold void ff_ac3dsp_init_riscv(AC3DSPContext *c) #if HAVE_RV int flags = av_get_cpu_flags(); + if (flags & AV_CPU_FLAG_RVB_BASIC) + c->ac3_exponent_min = ff_ac3_exponent_min_rvb; if (flags & AV_CPU_FLAG_RVV_I32) c->ac3_exponent_min = ff_ac3_exponent_min_rvv; diff --git a/libavcodec/riscv/ac3dsp_rvb.S b/libavcodec/riscv/ac3dsp_rvb.S index 48f8bb101e..0ca56466e1 100644 --- a/libavcodec/riscv/ac3dsp_rvb.S +++ b/libavcodec/riscv/ac3dsp_rvb.S @@ -21,6 +21,27 @@ #include "config.h" #include "libavutil/riscv/asm.S" +func ff_ac3_exponent_min_rvb, zbb + beqz a1, 3f +1: + addi a2, a2, -1 + lb t3, (a0) + addi t0, a0, 256 + mv t1, a1 +2: + lb t4, (t0) + addi t1, t1, -1 + addi t0, t0, 256 + minu t3, t3, t4 + bnez t1, 2b + + sb t3, (a0) + addi a0, a0, 1 + bnez a2, 1b +3: + ret +endfunc + func ff_extract_exponents_rvb, zbb 1: lw t0, (a1) -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2024-05-03 18:08 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240503180800.49703-1-remi@remlab.net \ --to=remi@remlab.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git