Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: third_party/opus/src/celt/fixed_c5x.h

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/opus/src/celt/dump_modes/dump_modes_arm_ne10.c ('k') | third_party/opus/src/celt/fixed_c6x.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/opus/src/celt/fixed_c5x.h
diff --git a/third_party/opus/src/celt/arm/fft_arm.h b/third_party/opus/src/celt/fixed_c5x.h
similarity index 52%
copy from third_party/opus/src/celt/arm/fft_arm.h
copy to third_party/opus/src/celt/fixed_c5x.h
index 0cb55d8e22d2b87e69c0e55806da49e58a58dfd4..ea95a998c3c3f879e10ccd72eff200d1cece9720 100644
--- a/third_party/opus/src/celt/arm/fft_arm.h
+++ b/third_party/opus/src/celt/fixed_c5x.h
@@ -1,10 +1,8 @@
-/* Copyright (c) 2015 Xiph.Org Foundation
- Written by Viswanath Puttagunta */
+/* Copyright (C) 2003 Jean-Marc Valin */
/**
- @file fft_arm.h
- @brief ARM Neon Intrinsic optimizations for fft using NE10 library
- */
-
+ @file fixed_c5x.h
+ @brief Fixed-point operations for the TI C5x DSP family
+*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -30,43 +28,52 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef FIXED_C5X_H
+#define FIXED_C5X_H
-#if !defined(FFT_ARM_H)
-#define FFT_ARM_H
+#include "dsplib.h"
-#include "config.h"
-#include "kiss_fft.h"
+#undef IMUL32
+static OPUS_INLINE long IMUL32(long i, long j)
+{
+ long ac0, ac1;
+ ac0 = _lmpy(i>>16,j);
+ ac1 = ac0 + _lmpy(i,j>>16);
+ return _lmpyu(i,j) + (ac1<<16);
+}
-#if defined(HAVE_ARM_NE10)
+#undef MAX16
+#define MAX16(a,b) _max(a,b)
-int opus_fft_alloc_arm_neon(kiss_fft_state *st);
-void opus_fft_free_arm_neon(kiss_fft_state *st);
+#undef MIN16
+#define MIN16(a,b) _min(a,b)
-void opus_fft_neon(const kiss_fft_state *st,
- const kiss_fft_cpx *fin,
- kiss_fft_cpx *fout);
+#undef MAX32
+#define MAX32(a,b) _lmax(a,b)
-void opus_ifft_neon(const kiss_fft_state *st,
- const kiss_fft_cpx *fin,
- kiss_fft_cpx *fout);
+#undef MIN32
+#define MIN32(a,b) _lmin(a,b)
-#if !defined(OPUS_HAVE_RTCD)
-#define OVERRIDE_OPUS_FFT (1)
+#undef VSHR32
+#define VSHR32(a, shift) _lshl(a,-(shift))
-#define opus_fft_alloc_arch(_st, arch) \
- ((void)(arch), opus_fft_alloc_arm_neon(_st))
+#undef MULT16_16_Q15
+#define MULT16_16_Q15(a,b) (_smpy(a,b))
-#define opus_fft_free_arch(_st, arch) \
- ((void)(arch), opus_fft_free_arm_neon(_st))
+#undef MULT16_16SU
+#define MULT16_16SU(a,b) _lmpysu(a,b)
-#define opus_fft(_st, _fin, _fout, arch) \
- ((void)(arch), opus_fft_neon(_st, _fin, _fout))
+#undef MULT_16_16
+#define MULT_16_16(a,b) _lmpy(a,b)
-#define opus_ifft(_st, _fin, _fout, arch) \
- ((void)(arch), opus_ifft_neon(_st, _fin, _fout))
+/* FIXME: This is technically incorrect and is bound to cause problems. Is there any cleaner solution? */
+#undef MULT16_32_Q15
+#define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),(b)),15))
-#endif /* OPUS_HAVE_RTCD */
+#define celt_ilog2(x) (30 - _lnorm(x))
+#define OVERRIDE_CELT_ILOG2
-#endif /* HAVE_ARM_NE10 */
+#define celt_maxabs16(x, len) MAX32(EXTEND32(maxval((DATA *)x, len)),-EXTEND32(minval((DATA *)x, len)))
+#define OVERRIDE_CELT_MAXABS16
-#endif
+#endif /* FIXED_C5X_H */
« no previous file with comments | « third_party/opus/src/celt/dump_modes/dump_modes_arm_ne10.c ('k') | third_party/opus/src/celt/fixed_c6x.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698