From: "Rémi Denis-Courmont" <remi@remlab.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 2/2] lavc/flacdsp: R-V V decorrelate_ms packed Date: Mon, 13 Nov 2023 22:00:33 +0200 Message-ID: <20231113200033.21708-2-remi@remlab.net> (raw) In-Reply-To: <20231113200033.21708-1-remi@remlab.net> flac_decorrelate_ms_16_c: 585.5 flac_decorrelate_ms_16_rvv_i32: 263.0 flac_decorrelate_ms_32_c: 584.7 flac_decorrelate_ms_32_rvv_i32: 250.0 --- libavcodec/riscv/flacdsp_init.c | 6 ++++ libavcodec/riscv/flacdsp_rvv.S | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/libavcodec/riscv/flacdsp_init.c b/libavcodec/riscv/flacdsp_init.c index a3415d6d55..0e7be25d98 100644 --- a/libavcodec/riscv/flacdsp_init.c +++ b/libavcodec/riscv/flacdsp_init.c @@ -28,10 +28,14 @@ void ff_flac_decorrelate_ls_16_rvv(uint8_t **out, int32_t **in, int channels, int len, int shift); void ff_flac_decorrelate_rs_16_rvv(uint8_t **out, int32_t **in, int channels, int len, int shift); +void ff_flac_decorrelate_ms_16_rvv(uint8_t **out, int32_t **in, + int channels, int len, int shift); void ff_flac_decorrelate_ls_32_rvv(uint8_t **out, int32_t **in, int channels, int len, int shift); void ff_flac_decorrelate_rs_32_rvv(uint8_t **out, int32_t **in, int channels, int len, int shift); +void ff_flac_decorrelate_ms_32_rvv(uint8_t **out, int32_t **in, + int channels, int len, int shift); av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, int channels) @@ -44,10 +48,12 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, case AV_SAMPLE_FMT_S16: c->decorrelate[1] = ff_flac_decorrelate_ls_16_rvv; c->decorrelate[2] = ff_flac_decorrelate_rs_16_rvv; + c->decorrelate[3] = ff_flac_decorrelate_ms_16_rvv; break; case AV_SAMPLE_FMT_S32: c->decorrelate[1] = ff_flac_decorrelate_ls_32_rvv; c->decorrelate[2] = ff_flac_decorrelate_rs_32_rvv; + c->decorrelate[3] = ff_flac_decorrelate_ms_32_rvv; break; } } diff --git a/libavcodec/riscv/flacdsp_rvv.S b/libavcodec/riscv/flacdsp_rvv.S index c70ad8fcb0..616565ed7e 100644 --- a/libavcodec/riscv/flacdsp_rvv.S +++ b/libavcodec/riscv/flacdsp_rvv.S @@ -69,6 +69,32 @@ func ff_flac_decorrelate_rs_16_rvv, zve32x ret endfunc +func ff_flac_decorrelate_ms_16_rvv, zve32x + ld a0, (a0) + ld a2, 8(a1) + ld a1, (a1) +1: + vsetvli t0, a3, e32, m8, ta, ma + vle32.v v8, (a2) + sub a3, a3, t0 + vle32.v v0, (a1) + sh2add a1, t0, a1 + vsra.vi v16, v8, 1 + sh2add a2, t0, a2 + vsub.vv v24, v0, v16 + vadd.vv v16, v24, v8 + vsll.vx v8, v24, a4 + vsll.vx v0, v16, a4 + vsetvli zero, zero, e16, m4, ta, ma + vncvt.x.x.w v0, v0 + vncvt.x.x.w v4, v8 + vsseg2e16.v v0, (a0) + sh2add a0, t0, a0 + bnez a3, 1b + + ret +endfunc + func ff_flac_decorrelate_ls_32_rvv, zve32x ld a0, (a0) ld a2, 8(a1) @@ -110,4 +136,27 @@ func ff_flac_decorrelate_rs_32_rvv, zve32x ret endfunc + +func ff_flac_decorrelate_ms_32_rvv, zve32x + ld a0, (a0) + ld a2, 8(a1) + ld a1, (a1) +1: + vsetvli t0, a3, e32, m4, ta, ma + vle32.v v4, (a2) + sub a3, a3, t0 + vle32.v v0, (a1) + sh2add a1, t0, a1 + vsra.vi v8, v4, 1 + sh2add a2, t0, a2 + vsub.vv v12, v0, v8 + vadd.vv v8, v12, v4 + vsll.vx v4, v12, a4 + vsll.vx v0, v8, a4 + vsseg2e32.v v0, (a0) + sh3add a0, t0, a0 + bnez a3, 1b + + ret +endfunc #endif -- 2.42.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".
prev parent reply other threads:[~2023-11-13 20:00 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-13 20:00 [FFmpeg-devel] [PATCH 1/2] lavc/flacdsp: R-V V packed decorrelate_{l, r}s Rémi Denis-Courmont 2023-11-13 20:00 ` Rémi Denis-Courmont [this message]
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=20231113200033.21708-2-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