From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- media/libopus/celt/x86/pitch_sse.h | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'media/libopus/celt/x86/pitch_sse.h') diff --git a/media/libopus/celt/x86/pitch_sse.h b/media/libopus/celt/x86/pitch_sse.h index 964aef50db..127581f3e1 100644 --- a/media/libopus/celt/x86/pitch_sse.h +++ b/media/libopus/celt/x86/pitch_sse.h @@ -131,12 +131,6 @@ extern opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])( #if defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT) -#define OVERRIDE_DUAL_INNER_PROD -#define OVERRIDE_COMB_FILTER_CONST - -#undef dual_inner_prod -#undef comb_filter_const - void dual_inner_prod_sse(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02, @@ -154,13 +148,17 @@ void comb_filter_const_sse(opus_val32 *y, #if defined(OPUS_X86_PRESUME_SSE) +#define OVERRIDE_DUAL_INNER_PROD +#define OVERRIDE_COMB_FILTER_CONST # define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) \ ((void)(arch),dual_inner_prod_sse(x, y01, y02, N, xy1, xy2)) # define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \ ((void)(arch),comb_filter_const_sse(y, x, T, N, g10, g11, g12)) -#else +#elif defined(OPUS_HAVE_RTCD) +#define OVERRIDE_DUAL_INNER_PROD +#define OVERRIDE_COMB_FILTER_CONST extern void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])( const opus_val16 *x, const opus_val16 *y01, @@ -187,6 +185,32 @@ extern void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])( #define NON_STATIC_COMB_FILTER_CONST_C #endif -#endif + +void celt_pitch_xcorr_avx2(const float *_x, const float *_y, float *xcorr, int len, int max_pitch, int arch); + +#if defined(OPUS_X86_PRESUME_AVX2) + +#define OVERRIDE_PITCH_XCORR +# define celt_pitch_xcorr celt_pitch_xcorr_avx2 + +#elif defined(OPUS_HAVE_RTCD) && defined(OPUS_X86_MAY_HAVE_AVX2) + +#define OVERRIDE_PITCH_XCORR +extern void (*const PITCH_XCORR_IMPL[OPUS_ARCHMASK + 1])( + const float *_x, + const float *_y, + float *xcorr, + int len, + int max_pitch, + int arch + ); + +#define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \ + ((*PITCH_XCORR_IMPL[(arch) & OPUS_ARCHMASK])(_x, _y, xcorr, len, max_pitch, arch)) + + +#endif /* OPUS_X86_PRESUME_AVX2 && !OPUS_HAVE_RTCD */ + +#endif /* OPUS_X86_MAY_HAVE_SSE && !FIXED_POINT */ #endif -- cgit v1.2.3