aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-01-29 04:31:43 +0100
committerLynne <dev@lynne.ee>2024-04-27 11:12:07 +0200
commit134dba9544f4251ebf5fbbae72f2cddc390ac195 (patch)
treece38b2e35ed54bfba205061a518b02766a669fa2 /libavcodec/x86
parenta2cdb2f5be065a9da87391e2a5c0ae0051219bad (diff)
downloadffmpeg-134dba9544f4251ebf5fbbae72f2cddc390ac195.tar.gz
opusdsp: add ability to modify deemphasis constant
xHE-AAC relies on the same postfilter mechanism that Opus uses to improve clarity (albeit with a steeper deemphasis filter). The code to apply it is identical, it's still just a simple IIR low-pass filter. This commit makes it possible to use alternative constants.
Diffstat (limited to 'libavcodec/x86')
-rw-r--r--libavcodec/x86/opusdsp.asm9
-rw-r--r--libavcodec/x86/opusdsp_init.c2
2 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/x86/opusdsp.asm b/libavcodec/x86/opusdsp.asm
index 418cc16330..635f59f83c 100644
--- a/libavcodec/x86/opusdsp.asm
+++ b/libavcodec/x86/opusdsp.asm
@@ -22,16 +22,13 @@
SECTION_RODATA
- ; 0.85..^1 0.85..^2 0.85..^3 0.85..^4
-tab_st: dd 0x3f599a00, 0x3f38f671, 0x3f1d382a, 0x3f05a32f
-
SECTION .text
INIT_XMM fma3
%if UNIX64
-cglobal opus_deemphasis, 3, 3, 8, out, in, len
+cglobal opus_deemphasis, 4, 4, 8, out, in, weights, len
%else
-cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
+cglobal opus_deemphasis, 5, 5, 8, out, in, coeff, weights, len
%endif
%if ARCH_X86_32
VBROADCASTSS m0, coeffm
@@ -41,7 +38,7 @@ cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
shufps m0, m0, 0
%endif
- movaps m4, [tab_st]
+ movaps m4, [weightsq]
VBROADCASTSS m5, m4
shufps m6, m4, m4, q1111
shufps m7, m4, m4, q2222
diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..66d6839589 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -23,7 +23,7 @@
#include "libavcodec/opusdsp.h"
void ff_opus_postfilter_fma3(float *data, int period, float *gains, int len);
-float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len);
+float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, const float *weights, int len);
av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
{