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

Unified Diff: silk/mips/sigproc_fix_mipsr1.h

Issue 882843002: Update to opus-HEAD-66611f1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/opus.git@master
Patch Set: Add the contents of Makefile.mips back. Created 5 years, 11 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 | « silk/mips/macros_mipsr1.h ('k') | silk/quant_LTP_gains.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: silk/mips/sigproc_fix_mipsr1.h
diff --git a/silk/lin2log.c b/silk/mips/sigproc_fix_mipsr1.h
similarity index 73%
copy from silk/lin2log.c
copy to silk/mips/sigproc_fix_mipsr1.h
index d4fe515321f0d5b76d6d314ccff4d16f93f91838..3b0a6953656d97318f3aa83ebba9f208be1bd88b 100644
--- a/silk/lin2log.c
+++ b/silk/mips/sigproc_fix_mipsr1.h
@@ -25,22 +25,41 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifndef SILK_SIGPROC_FIX_MIPSR1_H
+#define SILK_SIGPROC_FIX_MIPSR1_H
+
+#ifdef __cplusplus
+extern "C"
+{
#endif
-#include "SigProc_FIX.h"
-/* Approximation of 128 * log2() (very close inverse of silk_log2lin()) */
-/* Convert input to a log scale */
-opus_int32 silk_lin2log(
- const opus_int32 inLin /* I input in linear scale */
-)
+#undef silk_SAT16
+static inline short int silk_SAT16(int a)
+{
+ int c;
+ c = __builtin_mips_shll_s_w(a, 16);
+ c = c>>16;
+
+ return c;
+}
+
+#undef silk_LSHIFT_SAT32
+static inline int silk_LSHIFT_SAT32(int a, int shift)
{
- opus_int32 lz, frac_Q7;
+ int r;
+
+ r = __builtin_mips_shll_s_w(a, shift);
- silk_CLZ_FRAC( inLin, &lz, &frac_Q7 );
+ return r;
+}
+
+#undef silk_RSHIFT_ROUND
+static inline int silk_RSHIFT_ROUND(int a, int shift)
+{
+ int r;
- /* Piece-wise parabolic approximation */
- return silk_LSHIFT( 31 - lz, 7 ) + silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), 179 );
+ r = __builtin_mips_shra_r_w(a, shift);
+ return r;
}
+#endif /* SILK_SIGPROC_FIX_MIPSR1_H */
« no previous file with comments | « silk/mips/macros_mipsr1.h ('k') | silk/quant_LTP_gains.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698