From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 3/8] x86/flacdsp: add a SSE4 version of lpc16 Date: Sun, 12 May 2024 13:06:52 -0300 Message-ID: <20240512160657.2733-1-jamrial@gmail.com> (raw) In-Reply-To: <20240511194656.1576-1-jamrial@gmail.com> flac_lpc_16_13_c: 2841.3 flac_lpc_16_13_sse4: 2151.8 flac_lpc_16_16_c: 3382.8 flac_lpc_16_16_sse4: 2228.3 flac_lpc_16_29_c: 5800.3 flac_lpc_16_29_sse4: 3727.3 flac_lpc_16_32_c: 5972.8 flac_lpc_16_32_sse4: 4052.3 Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/x86/flacdsp.asm | 13 +++++++------ libavcodec/x86/flacdsp_init.c | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavcodec/x86/flacdsp.asm b/libavcodec/x86/flacdsp.asm index 4b2fd65435..f38eb7db76 100644 --- a/libavcodec/x86/flacdsp.asm +++ b/libavcodec/x86/flacdsp.asm @@ -38,9 +38,9 @@ SECTION .text %endif %endmacro -%macro LPC_32 1 +%macro LPC_32 3 INIT_XMM %1 -cglobal flac_lpc_32, 5,6,5, decoded, coeffs, pred_order, qlevel, len, j +cglobal flac_lpc_%2, 5,6,5, decoded, coeffs, pred_order, qlevel, len, j sub lend, pred_orderd jle .ret movsxdifnidn pred_orderq, pred_orderd @@ -67,14 +67,14 @@ ALIGN 16 jl .loop_order .end_order: PMACSDQL m2, m0, m1, m2, m0 - psrlq m2, m4 + %3 m2, m4 movd m0, [decodedq] paddd m0, m2 movd [decodedq], m0 sub lend, 2 jl .ret PMACSDQL m3, m1, m0, m3, m1 - psrlq m3, m4 + %3 m3, m4 movd m1, [decodedq+4] paddd m1, m3 movd [decodedq+4], m1 @@ -83,10 +83,11 @@ ALIGN 16 RET %endmacro +LPC_32 sse4, 16, psrad +LPC_32 sse4, 32, psrlq %if HAVE_XOP_EXTERNAL -LPC_32 xop +LPC_32 xop, 32, psrlq %endif -LPC_32 sse4 ;---------------------------------------------------------------------------------- ;void ff_flac_decorrelate_[lrm]s_16_sse2(uint8_t **out, int32_t **in, int channels, diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c index 87daed7005..dee4bf88fc 100644 --- a/libavcodec/x86/flacdsp_init.c +++ b/libavcodec/x86/flacdsp_init.c @@ -23,6 +23,8 @@ #include "libavutil/x86/cpu.h" #include "config.h" +void ff_flac_lpc_16_sse4(int32_t *samples, const int coeffs[32], int order, + int qlevel, int len); void ff_flac_lpc_32_sse4(int32_t *samples, const int coeffs[32], int order, int qlevel, int len); void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order, @@ -93,6 +95,7 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int } } if (EXTERNAL_SSE4(cpu_flags)) { + c->lpc16 = ff_flac_lpc_16_sse4; c->lpc32 = ff_flac_lpc_32_sse4; } if (EXTERNAL_AVX(cpu_flags)) { -- 2.45.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".
next prev parent reply other threads:[~2024-05-12 16:07 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-11 19:46 [FFmpeg-devel] [PATCH 1/2] checkasm/flacdsp: run lpc benchmarks with an unmodified buffer James Almer 2024-05-11 19:46 ` [FFmpeg-devel] [PATCH 2/2] checkasm/flacdsp: sanitize lpc arguments James Almer 2024-05-11 20:31 ` [FFmpeg-devel] [PATCH 2/2 v2] " James Almer 2024-05-12 16:06 ` James Almer [this message] 2024-05-12 16:06 ` [FFmpeg-devel] [PATCH 4/8] avcodec/flacdsp: split off wasted bit handling into dsp functions James Almer 2024-05-12 16:15 ` Andreas Rheinhardt 2024-05-12 16:44 ` James Almer 2024-05-12 16:06 ` [FFmpeg-devel] [PATCH 5/8] checkasm/flacdsp: add a test for wasted32 James Almer 2024-05-12 16:38 ` Rémi Denis-Courmont 2024-05-12 16:42 ` [FFmpeg-devel] [PATCH 5/8 v2] " James Almer 2024-05-12 16:06 ` [FFmpeg-devel] [PATCH 6/8] x86/flacdsp: add a SSE2 version of wasted32 James Almer 2024-05-12 18:51 ` [FFmpeg-devel] [PATCH 6/8 v2] " James Almer 2024-05-12 20:22 ` Lynne via ffmpeg-devel 2024-05-12 16:06 ` [FFmpeg-devel] [PATCH 7/8] checkasm/flacdsp: add a test for wasted33 James Almer 2024-05-12 16:06 ` [FFmpeg-devel] [PATCH 8/8] x86/flacdsp: add SSE4 and AVX2 versions of wasted33 James Almer 2024-05-12 18:53 ` [FFmpeg-devel] [PATCH 8/8 v2] x86/flacdsp: add an SSE4 version " James Almer 2024-05-12 20:36 ` [FFmpeg-devel] [PATCH 09/10] avcodec/flacdsp: split off lpc33 into a dsp function James Almer 2024-05-12 20:36 ` [FFmpeg-devel] [PATCH 10/10] checkasm/flacdsp: add a test for lpc33 James Almer
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=20240512160657.2733-1-jamrial@gmail.com \ --to=jamrial@gmail.com \ --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