summaryrefslogtreecommitdiff
path: root/opencore/codecs_v2/audio/gsm_amr/amr_nb
diff options
context:
space:
mode:
Diffstat (limited to 'opencore/codecs_v2/audio/gsm_amr/amr_nb')
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk1
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h7
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h70
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h24
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h19
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h18
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h22
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h23
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h22
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h40
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h40
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h23
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h31
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h34
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h3
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp171
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp4
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp4
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp4
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp8
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk1
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp6
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp2
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp5
-rw-r--r--opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk1
30 files changed, 111 insertions, 482 deletions
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk
index 550e5fe..d978dbe 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk
@@ -57,7 +57,6 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := libpv_amr_nb_common_lib
LOCAL_CFLAGS := $(PV_CFLAGS)
-
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES :=
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h
index d38f953..fd66e9a 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,10 +49,7 @@ terms listed above has been obtained from the copyright holder.
----------------------------------------------------------------------------*/
#include "basicop_malloc.h"
-#if defined(PV_ARM_V5)
-#include "basic_op_arm_v5.h"
-
-#elif defined(PV_ARM_GCC_V5)
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))
#include "basic_op_arm_gcc_v5.h"
#else
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h
index 1abc4fa..5752171 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h
@@ -112,7 +112,7 @@ extern "C"
L_sum = 32-bit sum of L_var1 and L_var2 (Word32)
*/
- __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow)
+ static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow)
{
register Word32 ra = L_var1;
register Word32 rb = L_var2;
@@ -120,7 +120,7 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("qadd %0, %1, %2"
+ __asm__ volatile("qadd %0, %1, %2"
: "=r"(result)
: "r"(ra), "r"(rb)
);
@@ -149,7 +149,7 @@ extern "C"
Returns:
L_diff = 32-bit difference of L_var1 and L_var2 (Word32)
*/
- __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow)
+ static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow)
{
register Word32 ra = L_var1;
register Word32 rb = L_var2;
@@ -157,7 +157,7 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("qsub %0, %1, %2"
+ __asm__ volatile("qsub %0, %1, %2"
: "=r"(result)
: "r"(ra), "r"(rb)
);
@@ -197,12 +197,12 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(result)
: "r"(rb), "r"(rc)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(rc)
: "r"(ra), "r"(result)
);
@@ -232,7 +232,7 @@ extern "C"
L_product = 32-bit product of L_var1 and L_var2 (Word32)
*/
- __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow)
+ static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow)
{
register Word32 ra = var1;
register Word32 rb = var2;
@@ -241,12 +241,12 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(product)
: "r"(ra), "r"(rb)
);
- asm volatile("qadd %0, %1, %2"
+ __asm__ volatile("qadd %0, %1, %2"
: "=r"(result)
: "r"(product), "r"(product)
);
@@ -277,7 +277,7 @@ extern "C"
Returns:
result = 32-bit result of L_var3 - (var1 * var2)
*/
- __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
+ static inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
{
register Word32 ra = L_var3;
register Word32 rb = var1;
@@ -287,12 +287,12 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(product)
: "r"(rb), "r"(rc)
);
- asm volatile("qdsub %0, %1, %2"
+ __asm__ volatile("qdsub %0, %1, %2"
: "=r"(result)
: "r"(ra), "r"(product)
);
@@ -338,44 +338,44 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(L_product)
: "r"(ra), "r"(rc)
);
- asm volatile("mov %0, #0"
+ __asm__ volatile("mov %0, #0"
: "=r"(result)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(L_sum)
: "r"(result), "r"(L_product)
);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(product32)
: "r"(ra), "r"(rd)
);
- asm volatile("mov %0, %1, ASR #15"
+ __asm__ volatile("mov %0, %1, ASR #15"
: "=r"(ra)
: "r"(product32)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(L_product)
: "r"(L_sum), "r"(ra)
);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(product32)
: "r"(rb), "r"(rc)
);
- asm volatile("mov %0, %1, ASR #15"
+ __asm__ volatile("mov %0, %1, ASR #15"
: "=r"(rb)
: "r"(product32)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(L_sum)
: "r"(L_product), "r"(rb)
);
@@ -417,29 +417,29 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(L_product)
: "r"(ra), "r"(rc)
);
- asm volatile("mov %0, #0"
+ __asm__ volatile("mov %0, #0"
: "=r"(result)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(L_product)
: "r"(result), "r"(L_product)
);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(result)
: "r"(rb), "r"(rc)
);
- asm volatile("mov %0, %1, ASR #15"
+ __asm__ volatile("mov %0, %1, ASR #15"
: "=r"(ra)
: "r"(result)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(result)
: "r"(L_product), "r"(ra)
);
@@ -468,7 +468,7 @@ extern "C"
Returns:
product = 16-bit limited product of var1 and var2 (Word16)
*/
- __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow)
+ static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow)
{
register Word32 ra = var1;
register Word32 rb = var2;
@@ -477,12 +477,12 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile(
+ __asm__ volatile(
"smulbb %0, %1, %2"
: "=r"(temp)
: "r"(ra), "r"(rb)
);
- asm volatile(
+ __asm__ volatile(
"qadd %0, %1, %2\n\t"
"mov %0, %0, asr #16"
: "=&r*i"(product)
@@ -492,33 +492,33 @@ extern "C"
return ((Word16) product);
}
- __inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3)
+ static inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3)
{
register Word32 ra = L_var1;
register Word32 rb = L_var2;
register Word32 rc = L_var3;
Word32 result;
- asm volatile("smlabb %0, %1, %2, %3"
+ __asm__ volatile("smlabb %0, %1, %2, %3"
: "=r"(result)
: "r"(ra), "r"(rb), "r"(rc)
);
return (result);
}
- __inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3)
+ static inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3)
{
register Word32 ra = L_var1;
register Word32 rb = L_var2;
register Word32 rc = L_var3;
Word32 result;
- asm volatile("rsb %0, %1, #0"
+ __asm__ volatile("rsb %0, %1, #0"
: "=r"(ra)
: "r"(ra)
);
- asm volatile("smlabb %0, %1, %2, %3"
+ __asm__ volatile("smlabb %0, %1, %2, %3"
: "=r"(result)
: "r"(ra), "r"(rb), "r"(rc)
);
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h
index eb91049..62072a5 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h
@@ -117,9 +117,9 @@ extern "C"
if ((L_var1 ^ L_var2) >= 0)
{
- if ((L_sum ^ L_var1) < 0)
+ if ((L_sum ^ L_var1) >> 31)
{
- L_sum = (L_var1 < 0) ? MIN_32 : MAX_32;
+ L_sum = (L_var1 >> 31) ? MIN_32 : MAX_32;
*pOverflow = 1;
}
}
@@ -155,11 +155,11 @@ extern "C"
L_diff = L_var1 - L_var2;
- if ((L_var1 ^ L_var2) < 0)
+ if ((L_var1 ^ L_var2) >> 31)
{
if ((L_diff ^ L_var1) & MIN_32)
{
- L_diff = (L_var1 < 0L) ? MIN_32 : MAX_32;
+ L_diff = (L_var1 >> 31) ? MIN_32 : MAX_32;
*pOverflow = 1;
}
}
@@ -202,9 +202,9 @@ extern "C"
/* Check if L_sum and L_var_3 share the same sign */
if ((L_var3 ^ result) > 0)
{
- if ((L_sum ^ L_var3) < 0)
+ if ((L_sum ^ L_var3) >> 31)
{
- L_sum = (L_var3 < 0) ? MIN_32 : MAX_32;
+ L_sum = (L_var3 >> 31) ? MIN_32 : MAX_32;
*pOverflow = 1;
}
}
@@ -342,9 +342,9 @@ extern "C"
if ((L_product ^ product32) > 0)
{
- if ((L_sum ^ L_product) < 0)
+ if ((L_sum ^ L_product) >> 31)
{
- L_sum = (L_product < 0) ? MIN_32 : MAX_32;
+ L_sum = (L_product >> 31) ? MIN_32 : MAX_32;
}
}
@@ -358,9 +358,9 @@ extern "C"
if ((L_product ^ product32) > 0)
{
- if ((L_sum ^ L_product) < 0)
+ if ((L_sum ^ L_product) >> 31)
{
- L_sum = (L_product < 0) ? MIN_32 : MAX_32;
+ L_sum = (L_product >> 31) ? MIN_32 : MAX_32;
}
}
return (L_sum);
@@ -413,9 +413,9 @@ extern "C"
if ((L_product ^ result) > 0)
{
- if ((L_sum ^ L_product) < 0)
+ if ((L_sum ^ L_product) >> 31)
{
- L_sum = (L_product < 0) ? MIN_32 : MAX_32;
+ L_sum = (L_product >> 31) ? MIN_32 : MAX_32;
*pOverflow = 1;
}
}
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h
index 8fceb9d..ac72c31 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,22 +87,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
-
- __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow)
- {
- Word32 result;
-
- OSCL_UNUSED_ARG(pOverflow);
- __asm
- {
- QADD result, L_var1, L_var2
- }
- return(result);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
-
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
__inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow)
{
register Word32 ra = L_var1;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h
index 865f043..f672428 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,21 +86,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
-
- __inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
- {
- Word32 result;
- Word32 L_sum;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm {SMULBB result, var1, var2}
- __asm {QDADD L_sum, L_var3, result}
- return (L_sum);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h
index b1a51ba..86c5735 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,25 +88,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
-
- __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
- {
- Word32 product;
- Word32 result;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm
- {
- SMULBB product, var1, var2
- QDSUB result, L_var3, product
- }
-
- return (result);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
__inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h
index 2aaea47..33fedb1 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,26 +87,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
-
- __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow)
- {
- Word32 result;
- Word32 product;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm
- {
- SMULBB product, var1, var2
- QADD result, product, product
- }
-
- return (result);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
__inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h
index a9b0732..88d86ca 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ terms listed above has been obtained from the copyright holder.
----------------------------------------------------------------------------*/
#include "basicop_malloc.h"
+
/*--------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
@@ -88,24 +89,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
-
- __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow)
- {
- Word32 result;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm
- {
- QSUB result, L_var1, L_var2
- }
-
- return(result);
-
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) /* Instructions for ARM-linux cross-compiler*/
__inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h
index f2cb7cf..8df43c9 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,47 +88,13 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
- __inline Word32 Mpy_32(Word16 L_var1_hi,
+ static inline Word32 Mpy_32(Word16 L_var1_hi,
Word16 L_var1_lo,
Word16 L_var2_hi,
Word16 L_var2_lo,
Flag *pOverflow)
-
- {
- /*----------------------------------------------------------------------------
- ; Define all local variables
- ----------------------------------------------------------------------------*/
- Word32 L_product;
- Word32 L_sum;
- Word32 product32;
-
- OSCL_UNUSED_ARG(pOverflow);
- /*----------------------------------------------------------------------------
- ; Function body here
- ----------------------------------------------------------------------------*/
- /* L_product = L_mult (L_var1_hi, L_var2_hi, pOverflow);*/
-
- __asm {SMULBB L_product, L_var1_hi, L_var2_hi}
- __asm {QDADD L_product, 0, L_product}
- __asm {SMULBB product32, L_var1_hi, L_var2_lo}
- product32 >>= 15;
- __asm {QDADD L_sum, L_product, product32}
- L_product = L_sum;
- __asm {SMULBB product32, L_var1_lo, L_var2_hi}
- product32 >>= 15;
- __asm {QDADD L_sum, L_product, product32}
- return (L_sum);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
-
- static inline Word32 Mpy_32(Word16 L_var1_hi,
- Word16 L_var1_lo,
- Word16 L_var2_hi,
- Word16 L_var2_lo,
- Flag *pOverflow)
{
register Word32 product32;
register Word32 L_sum;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h
index 33ade51..3a68e69 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,36 +88,14 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/
- __inline Word32 Mpy_32_16(Word16 L_var1_hi,
+ static inline Word32 Mpy_32_16(Word16 L_var1_hi,
Word16 L_var1_lo,
Word16 var2,
Flag *pOverflow)
{
- Word32 L_product;
- Word32 L_sum;
- Word32 result;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm {SMULBB L_product, L_var1_hi, var2}
- __asm {QDADD L_product, 0, L_product}
- __asm {SMULBB result, L_var1_lo, var2}
- result >>= 15;
- __asm {QDADD L_sum, L_product, result}
- return (L_sum);
- }
-
-#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/
-
- static inline Word32 Mpy_32_16(Word16 L_var1_hi,
- Word16 L_var1_lo,
- Word16 var2,
- Flag *pOverflow)
- {
-
register Word32 ra = L_var1_hi;
register Word32 rb = L_var1_lo;
register Word32 rc = var2;
@@ -125,29 +103,29 @@ extern "C"
OSCL_UNUSED_ARG(pOverflow);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(L_product)
: "r"(ra), "r"(rc)
);
- asm volatile("mov %0, #0"
+ __asm__ volatile("mov %0, #0"
: "=r"(result)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(L_product)
: "r"(result), "r"(L_product)
);
- asm volatile("smulbb %0, %1, %2"
+ __asm__ volatile("smulbb %0, %1, %2"
: "=r"(result)
: "r"(rb), "r"(rc)
);
- asm volatile("mov %0, %1, ASR #15"
+ __asm__ volatile("mov %0, %1, ASR #15"
: "=r"(ra)
: "r"(result)
);
- asm volatile("qdadd %0, %1, %2"
+ __asm__ volatile("qdadd %0, %1, %2"
: "=r"(result)
: "r"(L_product), "r"(ra)
);
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h
index eac2004..c89a94e 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,26 +85,7 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if defined(PV_ARM_V5)
-
- __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow)
- {
- Word32 product;
-
- OSCL_UNUSED_ARG(pOverflow);
-
- __asm
- {
- SMULBB product, var1, var2
- MOV product, product, ASR #15
- CMP product, 0x7FFF
- MOVGE product, 0x7FFF
- }
-
- return ((Word16) product);
- }
-
-#elif defined(PV_ARM_GCC_V5)
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))
__inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h
index faea591..288b6c7 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,29 +86,9 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) )
- /* C EQUIVALENT */
- OSCL_IMPORT_REF Word16 norm_l(Word32 L_var1);
-
-#elif defined(PV_ARM_V5)
-
- __inline Word16 norm_l(Word32 L_var1)
- {
- register Word32 var_out = 0;
-
- __asm
- {
- CMP L_var1, #0
- EORNE L_var1, L_var1, L_var1, LSL #1
- CLZNE var_out, L_var1
- }
-
- return ((Word16)var_out);
- }
-
-#elif defined(PV_ARM_GCC_V5)
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))
static inline Word16 norm_l(Word32 L_var1)
{
register Word32 var_out = 0;
@@ -116,7 +96,7 @@ extern "C"
if (L_var1)
{
ra ^= (ra << 1);
- asm volatile(
+ __asm__ volatile(
"clz %0, %1"
: "=r"(var_out)
: "r"(ra)
@@ -124,6 +104,9 @@ extern "C"
}
return (var_out);
}
+#else
+ /* C EQUIVALENT */
+ OSCL_IMPORT_REF Word16 norm_l(Word32 L_var1);
#endif
/*----------------------------------------------------------------------------
@@ -134,5 +117,3 @@ extern "C"
#endif
#endif
-
-
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h
index 955903a..7847f34 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,31 +86,9 @@ extern "C"
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/
-#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) )
- /* C EQUIVALENT */
-
- OSCL_IMPORT_REF Word16 norm_s(Word16 var1);
-
-#elif defined(PV_ARM_V5)
-
- __inline Word16 norm_s(Word16 var)
- {
- register Word32 var_out = 0;
- Word32 var1 = var << 16;
-
- __asm
- {
- CMP var1, #0
- EORNE var1, var1, var1, LSL #1
- CLZNE var_out, var1
- }
-
- return ((Word16)var_out);
- }
-
-#elif defined(PV_ARM_GCC_V5)
+#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))
static inline Word16 norm_s(Word16 var1)
{
register Word32 var_out = 0;
@@ -118,7 +96,7 @@ extern "C"
if (ra)
{
ra ^= (ra << 1);
- asm volatile(
+ __asm__ volatile(
"clz %0, %1"
: "=r"(var_out)
: "r"(ra)
@@ -126,7 +104,9 @@ extern "C"
}
return (var_out);
}
-
+#else
+ /*C EQUIVALENT */
+ OSCL_IMPORT_REF Word16 norm_s(Word16 var1);
#endif
/*----------------------------------------------------------------------------
; END
@@ -136,5 +116,3 @@ extern "C"
#endif
#endif
-
-
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h
index ee4d732..3cf16d5 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,6 +40,7 @@ terms listed above has been obtained from the copyright holder.
*
********************************************************************************
*/
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
#ifndef typedef_h
#define typedef_h "$Id $"
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp
index 8085ac2..0a1182b 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp
@@ -158,7 +158,7 @@ OSCL_EXPORT_REF Word16 add_16(Word16 var1, Word16 var2, Flag *pOverflow)
*pOverflow = 1;
sum = MAX_16;
}
- else if (sum < (Word32) 0xffff8000L)
+ else if (sum < (Word32) - 32768)
{
*pOverflow = 1;
sum = MIN_16;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp
index 6f6bf4d..7711ac9 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp
@@ -240,7 +240,7 @@ static Word16 Chebps(Word16 x,
t0 += (Word32) * (p_f) << 13;
- if ((UWord32)(t0 - 0xfe000000L) < (UWord32)0x03ffffffL)
+ if ((UWord32)(t0 + 33554432) < 67108863)
{
cheb = (Word16)(t0 >> 10);
}
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp
deleted file mode 100644
index 4893542..0000000
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/****************************************************************************************
-Portions of this file are derived from the following 3GPP standard:
-
- 3GPP TS 26.073
- ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
- Available from http://www.3gpp.org
-
-(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
-Permission to distribute, modify and use this file under the standard license
-terms listed above has been obtained from the copyright holder.
-****************************************************************************************/
-/*
-
- Filename: bytesused.cpp
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
- None
-
- Local Stores/Buffers/Pointers Needed:
- None
-
- Global Stores/Buffers/Pointers Needed:
- None
-
- Outputs:
- None
-
- Pointers and Buffers Modified:
- None
-
- Local Stores Modified:
- None
-
- Global Stores Modified:
- None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function creates a table called BytesUsed that holds the value that
- describes the number of bytes required to hold one frame worth of data in
- the WMF (non-IF2) frame format. Each table entry is the sum of the frame
- type byte and the number of bytes used up by the core speech data for each
- 3GPP frame type.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- None
-
-------------------------------------------------------------------------------
- REFERENCES
-
- [1] "AMR Speech Codec Frame Structure", 3GPP TS 26.101 version 4.1.0
- Release 4, June 2001, page 13.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "typedef.h"
-
-/*--------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
- /*----------------------------------------------------------------------------
- ; MACROS
- ; Define module specific macros here
- ----------------------------------------------------------------------------*/
-
-
- /*----------------------------------------------------------------------------
- ; DEFINES
- ; Include all pre-processor statements here. Include conditional
- ; compile variables also.
- ----------------------------------------------------------------------------*/
-
- /*----------------------------------------------------------------------------
- ; LOCAL FUNCTION DEFINITIONS
- ; Function Prototype declaration
- ----------------------------------------------------------------------------*/
-
-
- /*----------------------------------------------------------------------------
- ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
- ; Variable declaration - defined here and used outside this module
- ----------------------------------------------------------------------------*/
- const short BytesUsed[16] =
- {
- 13, /* 4.75 */
- 14, /* 5.15 */
- 16, /* 5.90 */
- 18, /* 6.70 */
- 20, /* 7.40 */
- 21, /* 7.95 */
- 27, /* 10.2 */
- 32, /* 12.2 */
- 6, /* GsmAmr comfort noise */
- 7, /* Gsm-Efr comfort noise */
- 6, /* IS-641 comfort noise */
- 6, /* Pdc-Efr comfort noise */
- 0, /* future use */
- 0, /* future use */
- 0, /* future use */
- 1 /* No transmission */
- };
- /*----------------------------------------------------------------------------
- ; EXTERNAL FUNCTION REFERENCES
- ; Declare functions defined elsewhere and referenced in this module
- ----------------------------------------------------------------------------*/
-
-
- /*----------------------------------------------------------------------------
- ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
- ; Declare variables used in this module but defined elsewhere
- ----------------------------------------------------------------------------*/
-
-
- /*--------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; Define all local variables
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; Function body here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; Return nothing or data or data pointer
-----------------------------------------------------------------------------*/
-
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp
index 9179fe4..71519e9 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp
@@ -479,7 +479,7 @@ OSCL_EXPORT_REF void gc_pred(
ener_code <<= 4;
- if (ener_code < 0) /* Check for saturation */
+ if ((ener_code >> 31)) /* Check for saturation */
{
ener_code = MAX_32;
}
@@ -648,7 +648,7 @@ OSCL_EXPORT_REF void gc_pred(
*pOverflow = 1;
L_tmp = MAX_32;
}
- else if (L_tmp < (Word32) 0xffe00000L)
+ else if (L_tmp < -2097152)
{
*pOverflow = 1;
L_tmp = MIN_32;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp
index 6ee82b2..003afc7 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp
@@ -173,7 +173,7 @@ OSCL_EXPORT_REF Word16 mult_r(Word16 var1, Word16 var2, Flag *pOverflow)
*pOverflow = 1;
L_product_arr = MAX_16;
}
- else if (L_product_arr < (Word32) 0xffff8000L)
+ else if (L_product_arr < (Word32) - 32768)
{
*pOverflow = 1;
L_product_arr = MIN_16;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp
index e690246..dc4ca72 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -152,7 +152,7 @@ Word16 norm_l (Word32 L_var1)
/*----------------------------------------------------------------------------
; FUNCTION CODE
----------------------------------------------------------------------------*/
-#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) )
+#if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT)))
OSCL_EXPORT_REF Word16 norm_l(register Word32 L_var1)
{
/*----------------------------------------------------------------------------
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp
index 892d06e..4fdc6d2 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -153,7 +153,7 @@ Word16 norm_s (Word16 var1)
/*----------------------------------------------------------------------------
; FUNCTION CODE
----------------------------------------------------------------------------*/
-#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) )
+#if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT)))
OSCL_EXPORT_REF Word16 norm_s(register Word16 var1)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp
index c0470b7..116a1b4 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp
@@ -83,6 +83,7 @@ extern "C"
/* table used in 'high' rates: MR67 MR74 */
+ extern const Word16 table_gain_highrates[];
const Word16 table_gain_highrates[VQ_SIZE_HIGHRATES*4] =
{
@@ -227,6 +228,7 @@ extern "C"
/* table used in 'low' rates: MR475, MR515, MR59 */
+ extern const Word16 table_gain_lowrates[];
const Word16 table_gain_lowrates[VQ_SIZE_LOWRATES*4] =
{
/*g_pit, g_fac, qua_ener_MR122, qua_ener */
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp
index ed9fccc..479c40e 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp
@@ -157,7 +157,7 @@ OSCL_EXPORT_REF Word16 sub(Word16 var1, Word16 var2, Flag *pOverflow)
/* to conserve MIPS, i.e., var_out = saturate (diff) */
- if ((UWord32)(diff - 0xFFFF8000L) > 0x000FFFF)
+ if ((UWord32)(diff + 32768) > 0x000FFFF)
{
if (diff > (Word32) 0x0007FFFL)
{
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp
index 221f4dc..e84ee66 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp
@@ -225,7 +225,7 @@ OSCL_EXPORT_REF void Syn_filt(
}
/* check for overflow on s1 */
- if ((UWord32)(s1 - 0xf8000000L) < 0x0fffffffL)
+ if ((UWord32)(s1 + 134217728) < 0x0fffffffL)
{
temp = (Word16)(s1 >> 12);
}
@@ -246,7 +246,7 @@ OSCL_EXPORT_REF void Syn_filt(
p_yy1 = yy;
/* check for overflow on s2 */
- if ((UWord32)(s2 - 0xf8000000L) < 0x0fffffffL)
+ if ((UWord32)(s2 + 134217728) < 0x0fffffffL)
{
temp = (Word16)(s2 >> 12);
}
@@ -283,7 +283,7 @@ OSCL_EXPORT_REF void Syn_filt(
s1 = amrnb_fxp_msu_16_by_16bb((Word32) * (p_a++), (Word32) * (p_yy1), s1);
}
- if ((UWord32)(s1 - 0xf8000000L) < 0x0fffffffL)
+ if ((UWord32)(s1 + 134217728) < 0x0fffffffL)
{
temp = (Word16)(s1 >> 12);
}
@@ -301,7 +301,7 @@ OSCL_EXPORT_REF void Syn_filt(
*(p_y++) = temp;
p_yy1 = p_y;
- if ((UWord32)(s2 - 0xf8000000L) < 0x0fffffffL)
+ if ((UWord32)(s2 + 134217728) < 0x0fffffffL)
{
*(p_y++) = (Word16)(s2 >> 12);
}
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk
index a3bd037..48ecacb 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk
@@ -43,7 +43,6 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := libpvdecoder_gsmamr
LOCAL_CFLAGS := $(PV_CFLAGS)
-
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES :=
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp
index c06c24a..9f5525d 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp
@@ -904,7 +904,7 @@ void agc2(
{
s = MAX_32;
}
- else if (s < (Word32) 0xFF000000L)
+ else if (s < (Word32) - 16777216)
{
s = MIN_32;
}
@@ -920,7 +920,7 @@ void agc2(
{
L_temp = MAX_32;
}
- else if (s < (Word32) 0xFFC00000L)
+ else if (s < (Word32) - 4194304)
{
L_temp = MIN_32;
}
@@ -940,7 +940,7 @@ void agc2(
{
sig_out[i] = MAX_16;
}
- else if (L_temp < (Word32) 0xF0000000L)
+ else if (L_temp < (Word32) - 268435456)
{
sig_out[i] = MIN_16;
}
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp
index 30631f4..22fe3b5 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp
@@ -625,7 +625,7 @@ void ph_disp(
*pOverflow = 1;
L_temp = MAX_32;
}
- else if (L_temp < (Word32) 0xe0000000L)
+ else if (L_temp < (Word32) - 536870912)
{
*pOverflow = 1;
L_temp = MIN_32;
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp
index 7bf5021..3e3f4e1 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp
@@ -1,5 +1,5 @@
/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
+ * Copyright (C) 1998-2010 PacketVideo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -296,7 +296,8 @@ void Post_Process(
L_tmp += ((Word32) st->x0) * c_b0;
L_tmp += ((Word32) st->x1) * c_b1;
L_tmp += ((Word32) x2) * c_b2;
- L_tmp <<= 3;
+
+ L_tmp = L_shl(L_tmp, 3, pOverflow);
/* Multiplication by two of output speech with saturation. */
diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk
index 100268e..a40eaf3 100644
--- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk
+++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk
@@ -68,7 +68,6 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := libpvencoder_gsmamr
LOCAL_CFLAGS := $(PV_CFLAGS)
-
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES :=