diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2015-08-05 16:30:55 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2015-08-05 17:27:28 +0900 |
commit | 57eb34e9d791a94afaa8307fdbd538a66e01080e (patch) | |
tree | d3532a4ee6e938e9a153e1c9e1ed1b571e7e48b2 /opencore/codecs_v2 | |
parent | 72a792824e352ad4084c3729154a444f57b7b8bb (diff) | |
download | opencore-amr-57eb34e9d791a94afaa8307fdbd538a66e01080e.tar.gz opencore-amr-57eb34e9d791a94afaa8307fdbd538a66e01080e.tar.bz2 opencore-amr-57eb34e9d791a94afaa8307fdbd538a66e01080e.zip |
Version update 1.2.0 -> 1.3.0 (fix crash on 64bit)tizen_3.0.m2.a1_tv_releasetizen_3.0.m2.a1_mobile_releasetizen_3.0.m1_tv_releasetizen_3.0.m1_mobile_releasesubmit/tizen_unified/20170308.100415submit/tizen_ivi/20160217.000006submit/tizen_ivi/20160217.000000submit/tizen_common/20151026.085049submit/tizen_common/20151023.083358submit/tizen_3.0_wearable/20161015.000004submit/tizen_3.0_tv/20161015.000004submit/tizen_3.0_mobile/20161015.000005submit/tizen_3.0_ivi/20161010.000005submit/tizen_3.0_common/20161104.104000submit/tizen_3.0.m2/20170104.093754submit/tizen/20150805.084143accepted/tizen/wearable/20150805.103244accepted/tizen/unified/20170309.040230accepted/tizen/tv/20150805.103220accepted/tizen/mobile/20150805.103211accepted/tizen/ivi/20160218.025231accepted/tizen/3.0/wearable/20161015.083554accepted/tizen/3.0/tv/20161016.005243accepted/tizen/3.0/mobile/20161015.033933accepted/tizen/3.0/ivi/20161011.055336accepted/tizen/3.0/common/20161114.111409accepted/tizen/3.0.m2/wearable/20170105.025349accepted/tizen/3.0.m2/tv/20170105.025253accepted/tizen/3.0.m2/mobile/20170105.025145tizen_3.0_tvtizen_3.0.m2tizen_3.0.m1_tvtizen_3.0.m1_mobiletizen_3.0accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_3.0_wearableaccepted/tizen_3.0_tvaccepted/tizen_3.0_mobileaccepted/tizen_3.0_iviaccepted/tizen_3.0_commonaccepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobile
Change-Id: Ide07602a8064b14e88d8842c777d5f68db71d644
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Diffstat (limited to 'opencore/codecs_v2')
39 files changed, 126 insertions, 526 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 := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk index e096ff8..21d9ddb 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk @@ -47,7 +47,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libpvamrwbdecoder LOCAL_CFLAGS := $(PV_CFLAGS) - LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp index dbcf2f3..e353f31 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.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. @@ -265,11 +265,7 @@ void Isp_Az( } /* a[NC] = 0.5*f1[NC]*(1.0 + isp[M-1]); */ - - t0 = (int32)(((int64)f1[nc] * isp[m - 1]) >> 16) << 1; - - t0 = add_int32(f1[nc], t0); /* from Q23 to Q12 and * 0.5 */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp index 25dcf13..bdca939 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.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. @@ -104,9 +104,7 @@ Returns ; FUNCTION CODE ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) -#elif defined(PV_ARM_GCC_V5) - +#if ((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_RVCT) || (PV_COMPILER == EPV_ARM_GNUC))) /* function is inlined in header file */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h index 7c5fe22..73ccb71 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.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. @@ -48,7 +48,6 @@ terms listed above has been obtained from the copyright holder. ----------------------------------------------------------------------------*/ #include "pv_amr_wb_type_defs.h" - /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here @@ -62,21 +61,7 @@ terms listed above has been obtained from the copyright holder. ; DEFINES AND SIMPLE TYPEDEF'S ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) - -__inline int16 normalize_amr_wb(int32 x) -{ - int32 y; - __asm - { - clz y, x; - sub y, y, #1 - } - return (y); -} - - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) __inline int16 normalize_amr_wb(int32 x) diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h index 7b9e900..86f70b3 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_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. @@ -75,7 +75,7 @@ terms listed above has been obtained from the copyright holder. range : 0x8000 <= var_out <= 0x7fff. ----------------------------------------------------------------------------*/ -static inline int16 negate_int16(int16 var1) +static inline int16 negate_int16(int16 var1) { return (((var1 == MIN_16) ? MAX_16 : -var1)); } @@ -105,7 +105,7 @@ static inline int16 negate_int16(int16 var1) range : 0x8000 <= var_out <= 0x7fff. ----------------------------------------------------------------------------*/ -static inline int16 shl_int16(int16 var1, int16 var2) +static inline int16 shl_int16(int16 var1, int16 var2) { int16 var_out; @@ -149,7 +149,7 @@ static inline int16 shl_int16(int16 var1, int16 var2) ----------------------------------------------------------------------------*/ -static inline int32 shl_int32(int32 L_var1, int16 var2) +static inline int32 shl_int32(int32 L_var1, int16 var2) { int32 L_var_out; @@ -193,7 +193,7 @@ static inline int32 shl_int32(int32 L_var1, int16 var2) ----------------------------------------------------------------------------*/ -static inline int32 shr_int32(int32 L_var1, int16 var2) +static inline int32 shr_int32(int32 L_var1, int16 var2) { int32 L_var_out; @@ -220,11 +220,7 @@ static inline int32 shr_int32(int32 L_var1, int16 var2) -#if defined(PV_ARM_V5) - -#include "pvamrwbdecoder_basic_op_armv5.h" - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) #include "pvamrwbdecoder_basic_op_gcc_armv5.h" diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h index 7a34d89..8b9faaa 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.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. @@ -522,7 +522,6 @@ extern "C" static inline int32 fxp_mul32_by_16b(int32 L_var1, const int32 L_var2) { - int32 L_mul = (int32)(((int64)L_var1 * (L_var2 << 16)) >> 32); return L_mul; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h index de3baba..c2c9f36 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.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. @@ -42,14 +42,13 @@ terms listed above has been obtained from the copyright holder. #ifndef PVAMRWBDECODER_BASIC_OP_GCC_ARMV5_H #define PVAMRWBDECODER_BASIC_OP_GCC_ARMV5_H + #ifdef __cplusplus extern "C" { #endif -#if (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4)) - static inline int16 sub_int16(int16 var1, int16 var2) { register int32 L_var_out; @@ -300,7 +299,6 @@ extern "C" #define fxp_mul32_by_16b( a, b) fxp_mul32_by_16( a, b) -#endif #ifdef __cplusplus } diff --git a/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk index 2acf59e..3ba1c63 100644 --- a/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk @@ -9,7 +9,6 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := $(PV_CFLAGS) -LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h b/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h index d3e41f8..2d9b9df 100644 --- a/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h +++ b/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h @@ -188,6 +188,7 @@ typedef struct tPVAmrDecoderExternal class CDecoder_AMRInterface { public: + virtual ~CDecoder_AMRInterface() {}; OSCL_IMPORT_REF virtual int32 StartL(tPVAmrDecoderExternal * pExt, bool aAllocateInputBuffer = false, bool aAllocateOutputBuffer = false) = 0; |