diff mbox series

[FFmpeg-devel] lavc/sbrdsp: add support for 256-bit vectors

Message ID 20240525190955.96364-1-remi@remlab.net
State Accepted
Commit 06fc919aadd18f5cfb4e5c60fe31bc4dbccede77
Headers show
Series [FFmpeg-devel] lavc/sbrdsp: add support for 256-bit vectors | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Rémi Denis-Courmont May 25, 2024, 7:09 p.m. UTC
hf_apply_noise_0_c: 35.7
hf_apply_noise_0_rvv_f32: 9.5
hf_apply_noise_1_c: 38.5
hf_apply_noise_1_rvv_f32: 10.0
hf_apply_noise_2_c: 35.5
hf_apply_noise_2_rvv_f32: 9.7
hf_apply_noise_3_c: 38.5
hf_apply_noise_3_rvv_f32: 10.0

Maybe extending the noise table manually is not such great idea, but I
not quite sure how to deal with that otherwise? Allocating the table
dynamically is possible but would require an ELF destructor to clean up.
---
 libavcodec/riscv/sbrdsp_init.c | 2 +-
 libavcodec/sbrdsp_template.c   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/riscv/sbrdsp_init.c b/libavcodec/riscv/sbrdsp_init.c
index 6c17b12ae0..562c75e6b4 100644
--- a/libavcodec/riscv/sbrdsp_init.c
+++ b/libavcodec/riscv/sbrdsp_init.c
@@ -52,7 +52,7 @@  av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c)
             c->sum_square = ff_sbr_sum_square_rvv;
             c->hf_gen = ff_sbr_hf_gen_rvv;
             c->hf_g_filt = ff_sbr_hf_g_filt_rvv;
-            if (ff_get_rv_vlenb() <= 16) {
+            if (ff_get_rv_vlenb() <= 32) {
                 c->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_rvv;
                 c->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_rvv;
                 if (flags & AV_CPU_FLAG_RVB_BASIC) {
diff --git a/libavcodec/sbrdsp_template.c b/libavcodec/sbrdsp_template.c
index 0f731ba50d..9a94af8670 100644
--- a/libavcodec/sbrdsp_template.c
+++ b/libavcodec/sbrdsp_template.c
@@ -376,5 +376,13 @@  const attribute_visibility_hidden DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sb
 {Q31(-0.99867974711855f), Q31(-0.88147068645358f)}, {Q31(-0.95531076805040f), Q31( 0.90908757154593f)},
 {Q31(-0.45725933317144f), Q31(-0.56716323646760f)}, {Q31(-0.72929675029275f), Q31(-0.98008272727324f)},
 {Q31( 0.75622801399036f), Q31( 0.20950329995549f)}, {Q31( 0.07069442601050f), Q31(-0.78247898470706f)},
+{Q31( 0.74496252926055f), Q31(-0.91169004445807f)}, {Q31(-0.96440182703856f), Q31(-0.94739918296622f)},
+{Q31( 0.30424629369539f), Q31(-0.49438267012479f)}, {Q31( 0.66565033746925f), Q31( 0.64652935542491f)},
+{Q31( 0.91697008020594f), Q31( 0.17514097332009f)}, {Q31(-0.70774918760427f), Q31( 0.52548653416543f)},
+{Q31(-0.70051415345560f), Q31(-0.45340028808763f)}, {Q31(-0.99496513054797f), Q31(-0.90071908066973f)},
+{Q31( 0.98164490790123f), Q31(-0.77463155528697f)}, {Q31(-0.54671580548181f), Q31(-0.02570928536004f)},
+{Q31(-0.01689629065389f), Q31( 0.00287506445732f)}, {Q31(-0.86110349531986f), Q31( 0.42548583726477f)},
+{Q31(-0.98892980586032f), Q31(-0.87881132267556f)}, {Q31( 0.51756627678691f), Q31( 0.66926784710139f)},
+{Q31(-0.99635026409640f), Q31(-0.58107730574765f)}, {Q31(-0.99969370862163f), Q31( 0.98369989360250f)},
 #endif
 };