OSDN Git Service

RIO-7292: New ARM macros in build make system.
authorPacketVideo CM <engbuild@pv.com>
Thu, 15 Apr 2010 20:34:30 +0000 (13:34 -0700)
committerPacketVideo CM <engbuild@pv.com>
Thu, 15 Apr 2010 20:34:30 +0000 (13:34 -0700)
Change-Id: Ibd4364b06be8af26b53db7e437ee706db459d259

191 files changed:
Config.mk
baselibs/gen_data_structures/Android.mk
baselibs/media_data_structures/Android.mk
baselibs/pv_mime_utils/Android.mk
baselibs/thread_messaging/Android.mk
baselibs/threadsafe_callback_ao/Android.mk
codecs_v2/audio/aac/dec/Android.mk
codecs_v2/audio/aac/dec/src/calc_sbr_synfilterbank.cpp
codecs_v2/audio/aac/dec/src/esc_iquant_scaling.cpp
codecs_v2/audio/aac/dec/src/fxp_mul32.h
codecs_v2/audio/aac/dec/src/fxp_mul32_arm_gcc.h
codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v4_gcc.h
codecs_v2/audio/aac/dec/src/pv_normalize.cpp
codecs_v2/audio/aac/dec/src/pv_normalize.h
codecs_v2/audio/aac/dec/src/trans4m_freq_2_time_fxp.cpp
codecs_v2/audio/aac/dec/src/unpack_idx.cpp
codecs_v2/audio/aac/dec/util/getactualaacconfig/Android.mk
codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk
codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h
codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h
codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp
codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp
codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk
codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk
codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk
codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp
codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h
codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h
codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h
codecs_v2/audio/gsm_amr/common/dec/Android.mk
codecs_v2/audio/mp3/dec/Android.mk
codecs_v2/audio/mp3/dec/build/make/g++_arm.mk
codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op.h
codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op_arm_gcc.h
codecs_v2/audio/mp3/dec/src/pvmp3_dct_16.cpp
codecs_v2/audio/mp3/dec/src/pvmp3_dct_9.cpp
codecs_v2/audio/mp3/dec/src/pvmp3_mdct_18.cpp
codecs_v2/audio/mp3/dec/src/pvmp3_normalize.cpp
codecs_v2/audio/mp3/dec/src/pvmp3_normalize.h
codecs_v2/audio/mp3/dec/src/pvmp3_polyphase_filter_window.cpp
codecs_v2/audio/mp3/dec/src/pvmp3_polyphase_filter_window.h
codecs_v2/omx/omx_aac/Android.mk
codecs_v2/omx/omx_amr/Android.mk
codecs_v2/omx/omx_amrenc/Android.mk
codecs_v2/omx/omx_amrenc/src/amr_enc.cpp
codecs_v2/omx/omx_baseclass/Android.mk
codecs_v2/omx/omx_common/Android.mk
codecs_v2/omx/omx_h264/Android.mk
codecs_v2/omx/omx_h264enc/Android.mk
codecs_v2/omx/omx_m4v/Android.mk
codecs_v2/omx/omx_m4venc/Android.mk
codecs_v2/omx/omx_mastercore/Android.mk
codecs_v2/omx/omx_mp3/Android.mk
codecs_v2/omx/omx_proxy/Android.mk
codecs_v2/omx/omx_queue/Android.mk
codecs_v2/omx/omx_sharedlibrary/interface/Android.mk
codecs_v2/utilities/colorconvert/Android.mk
codecs_v2/utilities/colorconvert/src/cczoomrotation16.cpp
codecs_v2/utilities/m4v_config_parser/Android.mk
codecs_v2/utilities/pv_config_parser/Android.mk
codecs_v2/video/avc_h264/common/Android.mk
codecs_v2/video/avc_h264/dec/Android.mk
codecs_v2/video/avc_h264/dec/src/vlc.cpp
codecs_v2/video/avc_h264/enc/Android.mk
codecs_v2/video/avc_h264/enc/src/sad_halfpel_inline.h
codecs_v2/video/avc_h264/enc/src/sad_inline.h
codecs_v2/video/avc_h264/enc/src/sad_mb_offset.h
codecs_v2/video/m4v_h263/dec/Android.mk
codecs_v2/video/m4v_h263/enc/Android.mk
codecs_v2/video/m4v_h263/enc/src/dct.cpp
codecs_v2/video/m4v_h263/enc/src/dct_inline.h
codecs_v2/video/m4v_h263/enc/src/fastquant_inline.h
codecs_v2/video/m4v_h263/enc/src/sad_halfpel_inline.h
codecs_v2/video/m4v_h263/enc/src/sad_inline.h
codecs_v2/video/m4v_h263/enc/src/sad_mb_offset.h
codecs_v2/video/m4v_h263/enc/src/vlc_encode_inline.h
engines/2way/Android.mk
engines/2way/sample_app/pv2waysample/Android.mk
engines/2way/src/pv_2way_sdkinfo.h
engines/adapters/player/framemetadatautility/Android.mk
engines/author/Android.mk
engines/author/src/pv_author_sdkinfo.h
engines/common/Android.mk
engines/player/Android.mk
engines/player/src/pv_player_sdkinfo.h
engines/pvme/Android.mk
fileformats/avi/parser/Android.mk
fileformats/common/parser/Android.mk
fileformats/id3parcom/Android.mk
fileformats/mp3/parser/Android.mk
fileformats/mp4/composer/Android.mk
fileformats/mp4/parser/Android.mk
fileformats/mp4/parser/utils/mp4recognizer/Android.mk
fileformats/pvx/parser/Android.mk
fileformats/rawaac/parser/Android.mk
fileformats/rawgsmamr/parser/Android.mk
fileformats/scsp/Android.mk
fileformats/wav/parser/Android.mk
modules/cpm_oma1_passthru/Android.mk
modules/linux_download/core/Android.mk
modules/linux_download/node_registry/Android.mk
modules/linux_mp4/core/Android.mk
modules/linux_mp4/node_registry/Android.mk
modules/linux_rtsp/core/Android.mk
modules/linux_rtsp/node_registry/Android.mk
modules/linux_rtsp/smplugins/tunneling/core/Android.mk
modules/linux_rtsp/smplugins/tunneling/registry/Android.mk
modules/linux_rtsp/smplugins/unicast/core/Android.mk
modules/linux_rtsp/smplugins/unicast/registry/Android.mk
nodes/common/Android.mk
nodes/pvaacffparsernode/Android.mk
nodes/pvamrffparsernode/Android.mk
nodes/pvclientserversocketnode/Android.mk
nodes/pvcommsionode/Android.mk
nodes/pvdownloadmanagernode/Android.mk
nodes/pvfileoutputnode/Android.mk
nodes/pvmediainputnode/Android.mk
nodes/pvmediaoutputnode/Android.mk
nodes/pvmp3ffparsernode/Android.mk
nodes/pvmp4ffcomposernode/Android.mk
nodes/pvmp4ffparsernode/Android.mk
nodes/pvomxaudiodecnode/Android.mk
nodes/pvomxbasedecnode/Android.mk
nodes/pvomxencnode/Android.mk
nodes/pvomxvideodecnode/Android.mk
nodes/pvprotocolenginenode/base/Android.mk
nodes/pvprotocolenginenode/download_protocols/common/Android.mk
nodes/pvprotocolenginenode/download_protocols/progressive_download/Android.mk
nodes/pvprotocolenginenode/download_protocols/progressive_streaming/Android.mk
nodes/pvprotocolenginenode/download_protocols/shoutcast/Android.mk
nodes/pvprotocolenginenode/protocol_common/Android.mk
nodes/pvsocketnode/Android.mk
nodes/pvwavffparsernode/Android.mk
nodes/streaming/jitterbuffernode/Android.mk
nodes/streaming/jitterbuffernode/jitterbuffer/common/Android.mk
nodes/streaming/jitterbuffernode/jitterbuffer/rtp/Android.mk
nodes/streaming/streamingmanager/Android.mk
nodes/streaming/streamingmanager/plugins/common/Android.mk
nodes/streaming/streamingmanager/plugins/rtsptunicast/Android.mk
nodes/streaming/streamingmanager/plugins/rtspunicast/Android.mk
oscl/oscl/osclbase/Android.mk
oscl/oscl/osclbase/src/oscl_base_macros.h
oscl/oscl/osclerror/Android.mk
oscl/oscl/osclio/Android.mk
oscl/oscl/oscllib/Android.mk
oscl/oscl/osclmemory/Android.mk
oscl/oscl/osclproc/Android.mk
oscl/oscl/osclregcli/Android.mk
oscl/oscl/osclregserv/Android.mk
oscl/oscl/osclutil/Android.mk
oscl/pvlogger/Android.mk
oscl/unit_test/Android.mk
protocols/http_parcom/Android.mk
protocols/rtp/Android.mk
protocols/rtp_payload_parser/Android.mk
protocols/rtp_payload_parser/util/build/Android.mk
protocols/rtsp_client_engine/Android.mk
protocols/rtsp_parcom/Android.mk
protocols/sdp/common/Android.mk
protocols/sdp/parser/Android.mk
protocols/systems/3g-324m_pvterminal/Android.mk
protocols/systems/common/Android.mk
protocols/systems/tools/general/Android.mk
pvmi/content_policy_manager/Android.mk
pvmi/content_policy_manager/plugins/common/Android.mk
pvmi/content_policy_manager/plugins/oma1/passthru/Android.mk
pvmi/media_io/pvmi_mio_avi_wav_fileinput/Android.mk
pvmi/media_io/pvmi_mio_fileinput/Android.mk
pvmi/media_io/pvmio_comm_loopback/Android.mk
pvmi/media_io/pvmiofileoutput/Android.mk
pvmi/pvmf/Android.mk
pvmi/recognizer/Android.mk
pvmi/recognizer/plugins/pvaacffrecognizer/Android.mk
pvmi/recognizer/plugins/pvamrffrecognizer/Android.mk
pvmi/recognizer/plugins/pvmp3ffrecognizer/Android.mk
pvmi/recognizer/plugins/pvmp4ffrecognizer/Android.mk
pvmi/recognizer/plugins/pvplsffrecognizer/Android.mk
pvmi/recognizer/plugins/pvwavffrecognizer/Android.mk
tools_v2/build/make/clear.mk
tools_v2/build/make/library.mk
tools_v2/build/make/linux.mk

index 11cc02a..6908a40 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -21,10 +21,33 @@ ifneq ($(strip $(EXTERNAL_OPENCORE_CONFIG_ONCE)),true)
     PV_CFLAGS += -Werror
   endif
   ifeq ($(TARGET_ARCH),arm)
-    ifeq ($(TARGET_ARCH_VERSION),armv4t)
-      PV_CFLAGS += -DPV_ARM_GCC_V4
+      PV_CFLAGS += -DPV_COMPILER=1
+    ifeq ($(TARGET_ARCH_VERSION),armv7)
+      GLOBAL_CPU_ARCH_VERSION :=7
+    else ifeq ($(TARGET_ARCH_VERSION),armv7-a)
+      GLOBAL_CPU_ARCH_VERSION :=7
+    else ifeq ($(TARGET_ARCH_VERSION),armv7-r)
+      GLOBAL_CPU_ARCH_VERSION :=7
+    else ifeq ($(TARGET_ARCH_VERSION),armv7-m)
+      GLOBAL_CPU_ARCH_VERSION :=7
+    else ifeq ($(TARGET_ARCH_VERSION),armv6)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv6j)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv6t2)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv6z)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv6zk)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv6-m)
+      GLOBAL_CPU_ARCH_VERSION :=6
+    else ifeq ($(TARGET_ARCH_VERSION),armv5e)
+      GLOBAL_CPU_ARCH_VERSION :=5
+    else ifeq ($(TARGET_ARCH_VERSION),armv5te)
+      GLOBAL_CPU_ARCH_VERSION :=5
     else
-      PV_CFLAGS += -DPV_ARM_GCC_V5
+      GLOBAL_CPU_ARCH_VERSION :=5
     endif
   endif
 
index cdbed19..668397a 100644 (file)
@@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvgendatastruct
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 76280aa..b0a23ac 100644 (file)
@@ -12,7 +12,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmediadatastruct
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4331e44..8e08b6e 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmimeutils
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 3605667..25b932d 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvthreadmessaging
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 19d04c1..e405669 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libthreadsafe_callback_ao
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 3588d7b..3768930 100644 (file)
@@ -150,7 +150,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_aac_dec
 
-LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index cfb0a9c..cfe3fa8 100644 (file)
@@ -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.
@@ -82,6 +82,7 @@ Copyright (c) ISO/IEC 2002.
 #include    "fxp_mul32.h"
 #include    "aac_mem_funcs.h"
 
+
 /*----------------------------------------------------------------------------
 ; MACROS
 ; Define module specific macros here
@@ -93,53 +94,7 @@ Copyright (c) ISO/IEC 2002.
 ; Include all pre-processor statements here. Include conditional
 ; compile variables also.
 ----------------------------------------------------------------------------*/
-
-
-#if defined (PV_ARM_V5)
-
-
-__inline Int16 sat1(Int32 y)
-{
-    __asm
-    {
-        qdadd y, y, y
-        mov y, y, asr #16
-    }
-
-    return((Int16)y);
-}
-
-#define saturate2( a, b, c, d)      *c = sat1( a);   \
-                                    *d = sat1( b);   \
-                                    c += 2;         \
-                                    d -= 2;
-
-
-#elif defined (PV_ARM_V4)
-
-
-__inline Int16 sat(Int32 y)
-{
-    Int32 x;
-    Int32 z = 31; /* rvct compiler problem */
-    __asm
-    {
-        sub y, y, y, asr 2
-        mov y, y, asr N
-        mov x, y, asr #15
-        teq x, y, asr z
-        eorne  y, INT16_MAX, y, asr #31
-    }
-
-    return((Int16)y);
-}
-
-#define saturate2( a, b, c, d)      *c = sat( a);   \
-                                    *d = sat( b);   \
-                                    c += 2;         \
-                                    d -= 2;
-
-#elif defined(PV_ARM_GCC_V5)
+#if   ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))
 
 __inline Int16 sat(Int32 y)
 {
@@ -163,15 +118,6 @@ __inline Int16 sat(Int32 y)
                                     d -= 2;
 
 
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-#include "armintr.h"
-
-#define saturate2( a, b, c, d)      *c = _DAddSatInt( a, a)>>16;   \
-                                    *d = _DAddSatInt( b, b)>>16;   \
-                                    c += 2;         \
-                                    d -= 2;
-
 #else
 
 
index 7095669..d418af8 100644 (file)
@@ -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.
  *  abs(x) ^ (1/3) is multiplied by the signed input value.
  */
 
-
-
-#if ( defined(_ARM) || defined(_ARM_V4))
-
-/*
- *  Absolute value for 16 bit-numbers
- */
-__inline Int32 abs2(Int32 x)
-{
-    Int32 z;
-    /*
-        z = x - (x<0);
-        x = z ^ sign(z)
-     */
-    __asm
-    {
-        sub  z, x, x, lsr #31
-        eor  x, z, z, asr #31
-    }
-    return (x);
-}
-
-
-#define pv_abs(x)   abs2(x)
-
-
-#elif (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
-
+#if   ((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC))
 /*
  *  Absolute value for 16 bit-numbers
  */
@@ -421,38 +394,7 @@ void esc_iquant_scaling(
     Int32   mult_high;
 
 
-#if ( defined(_ARM) || defined(_ARM_V4))
-
-    {
-        Int32   *temp;
-        Int32   R12, R11, R10, R9;
-
-        deltaOneThird = sizeof(Int32) * sfbWidth;
-        temp = coef;
-
-        // from standard library call for __rt_memset
-        __asm
-        {
-            MOV     R12, #0x0
-            MOV     R11, #0x0
-            MOV     R10, #0x0
-            MOV     R9, #0x0
-            SUBS    deltaOneThird, deltaOneThird, #0x20
-loop:
-            STMCSIA temp!, {R12, R11, R10, R9}
-            STMCSIA temp!, {R12, R11, R10, R9}
-            SUBCSS  deltaOneThird, deltaOneThird, #0x20
-            BCS     loop
-
-            MOVS    deltaOneThird, deltaOneThird, LSL #28
-            STMCSIA temp!, {R12, R11, R10, R9}
-            STMMIIA temp!, {R12, R11}
-        }
-    }
-
-#else
     pv_memset(coef, 0, sizeof(Int32) * sfbWidth);
-#endif
 
     if (maxInput > 0)
     {
index 94611c8..fc9b2d9 100644 (file)
@@ -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.
 
 ------------------------------------------------------------------------------
 */
-
 #ifndef FXP_MUL32
 #define FXP_MUL32
 
-#if   defined(PV_ARM_V5)
-
-#include "fxp_mul32_arm_v5.h"
-
-#elif defined(PV_ARM_V4)
-
-#include "fxp_mul32_arm_v4.h"
-
-#elif defined(PV_ARM_MSC_EVC_V4)
-
-#include "fxp_mul32_c_msc_evc.h"
-
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-#include "fxp_mul32_c_msc_evc_armv5.h"
-
-#elif defined(PV_ARM_GCC_V5)
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
+#if   ((PV_COMPILER == EPV_ARM_GNUC) && (PV_CPU_ARCH_VERSION >=5))
 #include "fxp_mul32_arm_gcc.h"
 
-#elif defined(PV_ARM_GCC_V4)
-
-#include "fxp_mul32_arm_v4_gcc.h"
-
-#else
+#else/*#else for PV__PROCESSOR__PENTIUM*/
 
 #ifndef C_EQUIVALENT
 #define C_EQUIVALENT
-#endif
+#endif/*#endif for C_EQUIVALENT*/
 
 #include "fxp_mul32_c_equivalent.h"
 
-#endif
-
+#endif/*#endif for PV__PROCESSOR__PENTIUM*/
 
 #endif   /*  FXP_MUL32  */
-
index 463f0f8..cc63c33 100644 (file)
@@ -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.
@@ -28,7 +28,6 @@
 #ifndef FXP_MUL32_ARM_GCC
 #define FXP_MUL32_ARM_GCC
 
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -38,9 +37,6 @@ extern "C"
 #include "pv_audio_type_defs.h"
 
 
-#if (defined (PV_ARM_GCC_V4) || defined(PV_ARM_GCC_V5)) /* ARM GNU COMPILER  */
-
-
 
 #define preload_cache( a)
 
@@ -530,8 +526,6 @@ extern "C"
         return (result64_hi);
     }
 
-#endif
-
 
 #ifdef __cplusplus
 }
index 55dd195..ce748ff 100644 (file)
@@ -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.
@@ -39,10 +39,6 @@ extern "C"
 
 #include "pv_audio_type_defs.h"
 
-
-#if defined (PV_ARM_GCC_V4) /* ARM_V4 GNU COMPILER  */
-
-
 #define preload_cache( a)
 
 
@@ -612,7 +608,6 @@ extern "C"
         return (result64_hi);
     }
 
-#endif
 
 #ifdef __cplusplus
 }
index cc9e7db..19aa5c3 100644 (file)
@@ -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.
@@ -50,10 +50,10 @@ Returns
 /*----------------------------------------------------------------------------
 ; INCLUDES
 ----------------------------------------------------------------------------*/
-
 #include "pv_audio_type_defs.h"
 #include "pv_normalize.h"
 
+
 /*----------------------------------------------------------------------------
 ; MACROS
 ; Define module specific macros here
@@ -90,11 +90,8 @@ 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 */
-
-
 #else
 
 Int pv_normalize(Int32 x)
@@ -158,3 +155,5 @@ Int pv_normalize(Int32 x)
 
 #endif
 
+
+
index 3ce6c3e..ad03948 100644 (file)
@@ -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.
 ; DEFINES AND SIMPLE TYPEDEF'S
 ----------------------------------------------------------------------------*/
 
-#if defined(PV_ARM_V5)
-
-__inline Int pv_normalize(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 Int pv_normalize(Int32 x)
 {
@@ -85,9 +71,8 @@ __inline Int pv_normalize(Int32 x)
 extern "C"
 {
 #endif
-
+    /*C Equivalent code*/
     Int pv_normalize(Int32 x);
-
 #ifdef __cplusplus
 }
 #endif
@@ -95,5 +80,4 @@ extern "C"
 #endif
 
 
-
 #endif  /* PV_NORMALIZE_H */
index f29ade9..1bfbb9b 100644 (file)
@@ -313,7 +313,6 @@ OUT          ==============================================================
 
 #include "fxp_mul32.h"
 
-
 /*----------------------------------------------------------------------------
 ; MACROS
 ; limit(x) saturates any number that exceeds a 16-bit representation into a
@@ -323,34 +322,6 @@ OUT          ==============================================================
 #define  ROUNDING_SCALED     (ROUNDING<<(16 - SCALING))
 
 
-#if defined(PV_ARM_V5)
-
-
-__inline Int16 sat(Int32 y)
-{
-    Int32 x;
-    Int32 z;
-    __asm
-    {
-        mov x, ROUNDING_SCALED
-        mov y, y, lsl #(15-SCALING)
-        qdadd z, x, y
-        mov y, z, lsr #16
-    }
-    return((Int16)y);
-}
-
-#define  limiter( y, x)   y = sat(x);
-
-
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-
-#define  limiter( y, x)       z = x<< (15-SCALING); \
-                              y = _DAddSatInt( ROUNDING_SCALED, z)>>16;
-
-
-#else
 
 #define  limiter( y, x)   z = ((x + ROUNDING )>>SCALING); \
                           if ((z>>15) != (z>>31))         \
@@ -359,7 +330,6 @@ __inline Int16 sat(Int32 y)
                           } \
                           y = (Int16)(z);
 
-#endif
 
 
 /*----------------------------------------------------------------------------
@@ -418,7 +388,7 @@ void trans4m_freq_2_time_fxp_1(
 
     Int  i;
     Int  wnd;
-#if !(defined(PV_ARM_V5))
+#if !((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))
     Int32 z;
 #endif
 
@@ -1422,7 +1392,7 @@ void trans4m_freq_2_time_fxp_2(
 
     Int  i;
     Int  wnd;
-#if !(defined(PV_ARM_V5))
+#if !((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))
     Int32 z;
 #endif
     Int16 *pFreqInfo;
index 0c83384..d4672e0 100644 (file)
 #define LOWER_5_BITS_MASK 0x1F
 
 
-#if ( defined(PV_ARM_V5) || defined(PV_ARM_V4))
-
-__inline Int32 abs1(Int32 x)
-{
-    Int32 z;
-    /*
-        z = x - (x<0);
-        x = z ^ sign(z)
-     */
-    __asm
-    {
-        sub  z, x, x, lsr #31
-        eor  x, z, z, asr #31
-    }
-    return (x);
-}
-
-#define pv_abs(x)   abs1(x)
-
-
-#else
 
 #define pv_abs(x)   ((x) > 0)? (x) : (-x)
 
-#endif
 
 
 
@@ -232,27 +210,27 @@ __inline Int32 abs1(Int32 x)
 ---------------------------------------------------------------------------*/
 
 const Int div_mod[18] =   /*   mod   index  Q-format */
-{
-    /* ----------------------- */
-    0xCC,                 /* |      |  0  |          */
-    0xCC,                 /* |      |  1  |          */
-    0xCC,                 /* |      |  2  |          */
-    2731,                 /* |  3   |  3  |   13     */
-    0xCC,                 /* |      |  4  |          */
-    0xCC,                 /* |      |  5  |          */
-    0xCC,                 /* |      |  6  |          */
-    0xCC,                 /* |      |  7  |          */
-    1025,                 /* |  8   |  8  |   13     */
-    911,                 /* |  9   |  9  |   13     */
-    0xCC,                 /* |      | 10  |          */
-    0xCC,                 /* |      | 11  |          */
-    0xCC,                 /* |      | 12  |          */
-    631,                 /* |  13  | 13  |   13     */
-    0xCC,                 /* |      | 14  |          */
-    0xCC,                 /* |      | 15  |          */
-    0xCC,                 /* |      | 16  |          */
-    482,                 /* |  17  | 17  |   13     */
-};
+    {
+        /* ----------------------- */
+        0xCC,                 /* |      |  0  |          */
+        0xCC,                 /* |      |  1  |          */
+        0xCC,                 /* |      |  2  |          */
+        2731,                 /* |  3   |  3  |   13     */
+        0xCC,                 /* |      |  4  |          */
+        0xCC,                 /* |      |  5  |          */
+        0xCC,                 /* |      |  6  |          */
+        0xCC,                 /* |      |  7  |          */
+        1025,                 /* |  8   |  8  |   13     */
+        911,                 /* |  9   |  9  |   13     */
+        0xCC,                 /* |      | 10  |          */
+        0xCC,                 /* |      | 11  |          */
+        0xCC,                 /* |      | 12  |          */
+        631,                 /* |  13  | 13  |   13     */
+        0xCC,                 /* |      | 14  |          */
+        0xCC,                 /* |      | 15  |          */
+        0xCC,                 /* |      | 16  |          */
+        482,                 /* |  17  | 17  |   13     */
+    };
 
 /*----------------------------------------------------------------------------
 ; EXTERNAL FUNCTION REFERENCES
index 67b39b8..ad23acb 100644 (file)
@@ -20,7 +20,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libgetactualaacconfig
 
-LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index d978dbe..24b23ca 100644 (file)
@@ -56,7 +56,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_amr_nb_common_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index d38f953..fd66e9a 100644 (file)
@@ -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
index 8fceb9d..ac72c31 100644 (file)
@@ -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;
index 865f043..f672428 100644 (file)
@@ -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)
     {
index b1a51ba..86c5735 100644 (file)
@@ -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)
     {
index 2aaea47..33fedb1 100644 (file)
@@ -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)
     {
index a9b0732..88d86ca 100644 (file)
@@ -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)
     {
index f2cb7cf..8df43c9 100644 (file)
@@ -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;
index 33ade51..b7b39ed 100644 (file)
@@ -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;
index eac2004..c89a94e 100644 (file)
@@ -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)
     {
index faea591..861f866 100644 (file)
@@ -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,28 +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)
     {
@@ -124,8 +105,11 @@ extern "C"
         }
         return (var_out);
     }
+#else/*#else for ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))*/
+    /* C EQUIVALENT */
+    OSCL_IMPORT_REF Word16 norm_l(Word32 L_var1);
 
-#endif
+#endif/*#endif for ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))*/
     /*----------------------------------------------------------------------------
     ; END
     ----------------------------------------------------------------------------*/
@@ -134,5 +118,3 @@ extern "C"
 #endif
 
 #endif
-
-
index 955903a..adb2cc6 100644 (file)
@@ -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,30 +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)
     {
@@ -126,8 +105,10 @@ extern "C"
         }
         return (var_out);
     }
-
-#endif
+#else/*#else for ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))*/
+    /*C EQUIVALENT */
+    OSCL_IMPORT_REF Word16 norm_s(Word16 var1);
+#endif/*#endif for ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_RVCT))*/
     /*----------------------------------------------------------------------------
     ; END
     ----------------------------------------------------------------------------*/
@@ -136,5 +117,3 @@ extern "C"
 #endif
 
 #endif
-
-
index ee4d732..3cf16d5 100644 (file)
@@ -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 $"
 
index e690246..dc4ca72 100644 (file)
@@ -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)
 {
     /*----------------------------------------------------------------------------
index 892d06e..4fdc6d2 100644 (file)
@@ -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)
 {
index 48ecacb..77f4ae9 100644 (file)
@@ -42,7 +42,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvdecoder_gsmamr
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index a40eaf3..fcc0514 100644 (file)
@@ -67,7 +67,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvencoder_gsmamr
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 21d9ddb..6868d9c 100644 (file)
@@ -46,7 +46,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvamrwbdecoder
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 25dcf13..bdca939 100644 (file)
@@ -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 */
 
 
index 7c5fe22..73ccb71 100644 (file)
@@ -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)
index b2302e4..86f70b3 100644 (file)
@@ -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.
@@ -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"
 
index de3baba..c2c9f36 100644 (file)
@@ -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
 }
index 3ba1c63..ed3616e 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index f618e40..8e929fb 100644 (file)
@@ -33,18 +33,10 @@ LOCAL_SRC_FILES := \
        src/pvmp3_dct_9.cpp \
        src/pvmp3_dct_16.cpp
 
-ifeq ($(TARGET_ARCH),arm)
-LOCAL_SRC_FILES += \
-       src/asm/pvmp3_polyphase_filter_window_gcc.s \
-       src/asm/pvmp3_mdct_18_gcc.s \
-       src/asm/pvmp3_dct_9_gcc.s \
-       src/asm/pvmp3_dct_16_gcc.s
-endif
-
 
 LOCAL_MODULE := libpvmp3
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 9c1614e..659e507 100644 (file)
@@ -1,5 +1,16 @@
 # Additional assembly files for linux-arm
+ifeq ($(GLOBAL_CPU_ARCH_VERSION),4)
+    ASM_INCLUSION:=1
+else ifeq ($(GLOBAL_CPU_ARCH_VERSION),5)
+    ASM_INCLUSION:=1
+else ifeq ($(GLOBAL_CPU_ARCH_VERSION),6)
+    ASM_INCLUSION:=1
+else
+    ASM_INCLUSION:=0
+endif
+ifneq ($(ASM_INCLUSION),0)
 SRCS+=  asm/pvmp3_polyphase_filter_window_gcc.s \
         asm/pvmp3_mdct_18_gcc.s \
         asm/pvmp3_dct_9_gcc.s \
-        asm/pvmp3_dct_16_gcc.s 
+        asm/pvmp3_dct_16_gcc.s
+endif
index 558699b..227e05a 100644 (file)
@@ -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.
@@ -44,18 +44,10 @@ extern "C"
 #endif
 
 
-#if (defined(PV_ARM_V5)||defined(PV_ARM_V4))
-
-#include "pv_mp3dec_fxd_op_arm.h"
-
-#elif (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
+#if   ((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC))
 
 #include "pv_mp3dec_fxd_op_arm_gcc.h"
 
-#elif (defined(PV_ARM_MSC_EVC_V5)||defined(PV_ARM_MSC_EVC_V4))
-
-#include "pv_mp3dec_fxd_op_msc_evc.h"
-
 #else
 
 #ifndef C_EQUIVALENT
index c60b91b..d0fe06a 100644 (file)
@@ -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.
@@ -43,7 +43,6 @@ extern "C"
 #include "pvmp3_audio_type_defs.h"
 
 
-#if (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
 
 #define Qfmt_31(a)   (int32)(a*0x7FFFFFFF + (a>=0?0.5F:-0.5F))
 
@@ -235,7 +234,6 @@ extern "C"
     }
 
 
-#endif
 
 #ifdef __cplusplus
 }
index 61742d3..a6e6525 100644 (file)
@@ -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.
@@ -81,8 +81,9 @@ Input
 
 ------------------------------------------------------------------------------
 */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#if ( !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) )
+#if !((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC))
 /*----------------------------------------------------------------------------
 ; INCLUDES
 ----------------------------------------------------------------------------*/
index 4e26e8e..dff8ffe 100644 (file)
@@ -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,8 +49,9 @@ Returns
 
 ------------------------------------------------------------------------------
 */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#if ( !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) && !defined(PV_ARM_V5) && !defined(PV_ARM_V4) )
+#if !((PV_CPU_ARCH_VERSION >=4) && ((PV_COMPILER == EPV_ARM_GNUC)|| (PV_COMPILER == EPV_ARM_RVCT)))
 /*----------------------------------------------------------------------------
 ; INCLUDES
 ----------------------------------------------------------------------------*/
index 48452d5..31e7a57 100644 (file)
@@ -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.
@@ -54,8 +54,9 @@ Returns
 
 ------------------------------------------------------------------------------
 */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#if ( !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) && !defined(PV_ARM_V5) && !defined(PV_ARM_V4) )
+#if !((PV_CPU_ARCH_VERSION >=4) && ((PV_COMPILER == EPV_ARM_GNUC)|| (PV_COMPILER == EPV_ARM_RVCT)))
 /*----------------------------------------------------------------------------
 ; INCLUDES
 ----------------------------------------------------------------------------*/
index 1011e2f..fdf1427 100644 (file)
@@ -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.
@@ -95,8 +95,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 */
index 6e89c09..b19634e 100644 (file)
@@ -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.
 /*----------------------------------------------------------------------------
 ; DEFINES AND SIMPLE TYPEDEF'S
 ----------------------------------------------------------------------------*/
-
-#if defined(PV_ARM_V5)
-
-__inline int32 pvmp3_normalize(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 int32 pvmp3_normalize(int32 x)
 {
index bbd6a89..a9f3ce3 100644 (file)
@@ -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.
@@ -57,8 +57,9 @@ Input
 
 ------------------------------------------------------------------------------
 */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#if ( !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) && !defined(PV_ARM_V5) && !defined(PV_ARM_V4) )
+#if !((PV_CPU_ARCH_VERSION >=4) && ((PV_COMPILER == EPV_ARM_GNUC)|| (PV_COMPILER == EPV_ARM_RVCT)))
 /*----------------------------------------------------------------------------
 ; INCLUDES
 ----------------------------------------------------------------------------*/
index a0eab5f..3e68746 100644 (file)
@@ -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.
@@ -41,6 +41,7 @@
 #include "pvmp3_audio_type_defs.h"
 #include "s_tmp3dec_chan.h"
 
+
 /*----------------------------------------------------------------------------
 ; MACROS
 ; Define module specific macros here
@@ -80,23 +81,6 @@ extern "C"
 #endif
 
 
-#if (defined(PV_ARM_V5)||defined(PV_ARM_V4))
-
-
-    __inline int16 saturate16(int32 sample)
-    {
-        int32 a;
-        int32 b = 31;
-        __asm
-        {
-            mov   a, sample, asr#15
-            teq a, sample, asr b
-            eorne sample, MAX_16BITS_INT, sample, asr#31
-        }
-        return sample ;
-    }
-
-#else
 
     inline int16 saturate16(int32 sample)
     {
@@ -108,7 +92,6 @@ extern "C"
         return sample;
 
     }
-#endif
 
 
     void pvmp3_polyphase_filter_window(int32 *synth_buffer,
index 05ab864..a9ca496 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_aac_component_lib
 
-LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4cf25b4..f647f84 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_amr_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index a3abe26..a44201a 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_amrenc_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4775098..c40005f 100644 (file)
@@ -223,6 +223,9 @@ OMX_BOOL OmxAmrEncoder::AmrEncodeFrame(OMX_U8*    aOutputBuffer,
     StreamInput.iStopTime     = StreamInput.iStartTime + AMR_FRAME_LENGTH_IN_TIMESTAMP * InputFrameNum;
 //    iNextStartTime            = StreamInput.iStopTime; // for the next encoding, not necessary
 
+#if PROFILING_ON
+    OMX_U32 Start = OsclTickCount::TickCount();
+#endif
     // Do encoding at one time for multiple frame input
     if (ipGsmEncoder->Encode(StreamInput, StreamOutput) < 0 || StreamOutput.iNumSampleFrames != InputFrameNum)
     {
index f425860..8481b56 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_baseclass_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 69d4e58..81d7e8e 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_common_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 7fbbfa8..50365bb 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_avc_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e986c14..5e0ba45 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_avcenc_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index cb73345..9c03cdb 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_m4v_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4145f44..624fc8c 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_m4venc_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index ec60cec..ad680a7 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_mastercore_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 34389b8..6a40760 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_mp3_component_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 24cce53..643d603 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvomx_proxy_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index f5ee53c..30c5009 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libomx_queue_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 265ab76..e2ce0ad 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_omx_interface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e378af9..c13847e 100644 (file)
@@ -15,7 +15,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libcolorconvert
 
-LOCAL_CFLAGS := -DFALSE=false  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DFALSE=false -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 7aa9351..afd6c04 100644 (file)
@@ -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.
@@ -21,6 +21,7 @@
 
 
 
+
 #define pvcc_abs(x) ((x)>0? (x): -(x))
 
 #define DITHER_ON
index a43318b..25fa07a 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libm4v_config
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 6acd195..ad81bf2 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_config_parser
 
-LOCAL_CFLAGS := -DWMA_AUDIO_SUPPORTED -DWMA_VOICE_SUPPORTED  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DWMA_AUDIO_SUPPORTED -DWMA_VOICE_SUPPORTED -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 7c17782..6db0ec0 100644 (file)
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_avc_common_lib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index cff68f4..f69b726 100644 (file)
@@ -17,7 +17,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvavcdecoder
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index f531249..6717d69 100644 (file)
@@ -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.
  */
 #include "avcdec_lib.h"
 #include "avcdec_bitstream.h"
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
 //#define PV_ARM_V5
-#ifdef PV_ARM_V5
-#define PV_CLZ(A,B) __asm{CLZ (A),(B)}  \
-    A -= 16;
-#else
 #define PV_CLZ(A,B) while (((B) & 0x8000) == 0) {(B) <<=1; A++;}
-#endif
 
 
 #define PV_NO_CLZ
index 733f8be..bf134c4 100644 (file)
@@ -23,7 +23,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvavch264enc
 
-LOCAL_CFLAGS := -D__arm__ -DYUV_INPUT -DRGB24_INPUT -DRGB12_INPUT -DYUV420SEMIPLANAR_INPUT  $(PV_CFLAGS)
+LOCAL_CFLAGS := -D__arm__ -DYUV_INPUT -DRGB24_INPUT -DRGB12_INPUT -DYUV420SEMIPLANAR_INPUT -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 0916b27..5e3d223 100644 (file)
@@ -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.
 #ifndef _SAD_HALFPEL_INLINE_H_
 #define _SAD_HALFPEL_INLINE_H_
 
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_GNUC)) /* ARM GNU COMPILER  */
 
     __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        tmp = (tmp2 >> 1) - tmp;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
-
-        return sad;
-    }
-
-    __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        tmp = (tmp >> 2) - tmp2;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
-
-        return sad;
-    }
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-    __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        __asm
-        {
-            rsbs    tmp, tmp, tmp2, asr #1 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
+__asm__ volatile("rsbs  %1, %1, %2, asr #1\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad), "=r"(tmp): "r"(tmp2));
 
         return sad;
     }
 
     __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        __asm
-        {
-            rsbs    tmp, tmp2, tmp, asr #2 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
+__asm__ volatile("rsbs  %1, %2, %1, asr #2\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad), "=r"(tmp): "r"(tmp2));
 
         return sad;
     }
-
-#elif defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
-
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
     __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-__asm__ volatile("rsbs  %1, %1, %2, asr #1\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad), "=r"(tmp): "r"(tmp2));
+        tmp = (tmp2 >> 1) - tmp;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
 
         return sad;
     }
 
     __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-__asm__ volatile("rsbs  %1, %2, %1, asr #2\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad), "=r"(tmp): "r"(tmp2));
+        tmp = (tmp >> 2) - tmp2;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
 
         return sad;
     }
 
-#endif
+#endif/*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
 
 #ifdef __cplusplus
 }
index 0f4c122..57045a1 100644 (file)
@@ -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.
 #ifndef _SAD_INLINE_H_
 #define _SAD_INLINE_H_
 
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_GNUC)) /* ARM GNU COMPILER  */
 
     __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        tmp = tmp - tmp2;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
-
+__asm__ volatile("rsbs  %1, %1, %2\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad): "r"(tmp), "r"(tmp2));
         return sad;
     }
 
@@ -38,26 +37,25 @@ extern "C"
     {
         int32 x7;
 
-        x7 = src2 ^ src1;       /* check odd/even combination */
-        if ((uint32)src2 >= (uint32)src1)
-        {
-            src1 = src2 - src1;     /* subs */
-        }
-        else
-        {
-            src1 = src1 - src2;
-        }
-        x7 = x7 ^ src1;     /* only odd bytes need to add carry */
-        x7 = mask & ((uint32)x7 >> 1);
-        x7 = (x7 << 8) - x7;
-        src1 = src1 + (x7 >> 7); /* add 0xFF to the negative byte, add back carry */
-        src1 = src1 ^(x7 >> 7);   /* take absolute value of negative byte */
+__asm__ volatile("EOR  %1, %2, %0\n\tSUBS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tAND  %1, %3, %1, lsr #1\n\tORRCC  %1, %1, #0x80000000\n\tRSB  %1, %1, %1, lsl #8\n\tADD  %0, %0, %1, asr #7\n\tEOR  %0, %0, %1, asr #7": "=r"(src1), "=&r"(x7): "r"(src2), "r"(mask));
+
+        return src1;
+    }
+
+    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
+    {
+        int32 x7;
+
+__asm__ volatile("EOR  %1, %2, %0\n\tADDS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tANDS  %1, %3, %1, rrx\n\tRSB  %1, %1, %1, lsl #8\n\tSUB  %0, %0, %1, asr #7\n\tEOR   %0, %0, %1, asr #7": "=r"(src1), "=&r"(x7): "r"(src2), "r"(mask));
 
         return src1;
     }
 
+#define sum_accumulate  __asm__ volatile("SBC  %0, %0, %1\n\tBIC   %1, %4, %1\n\tADD   %2, %2, %1, lsr #8\n\tSBC   %0, %0, %3\n\tBIC   %3, %4, %3\n\tADD   %2, %2, %3, lsr #8": "=&r" (x5), "=&r" (x10), "=&r" (x4), "=&r" (x11): "r" (x6));
+
 #define NUMBER 3
 #define SHIFT 24
+#define INC_X8 0x08000001
 
 #include "sad_mb_offset.h"
 
@@ -65,12 +63,16 @@ extern "C"
 #define NUMBER 2
 #undef SHIFT
 #define SHIFT 16
+#undef INC_X8
+#define INC_X8 0x10000001
 #include "sad_mb_offset.h"
 
 #undef NUMBER
 #define NUMBER 1
 #undef SHIFT
 #define SHIFT 8
+#undef INC_X8
+#define INC_X8 0x08000001
 #include "sad_mb_offset.h"
 
 
@@ -79,6 +81,7 @@ extern "C"
         int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
         x9 = 0x80808080; /* const. */
+        x4 = x5 = 0;
 
         x8 = (uint32)ref & 0x3;
         if (x8 == 3)
@@ -88,22 +91,16 @@ extern "C"
         if (x8 == 1)
             goto SadMBOffset1;
 
-//  x5 = (x4<<8)-x4; /* x5 = x4*255; */
-        x4 = x5 = 0;
-
-        x6 = 0xFFFF00FF;
-
-        ref -= lx;
-        blk -= 16;
-
         x8 = 16;
+///
+__asm__ volatile("MVN  %0, #0xFF00": "=r"(x6));
 
 LOOP_SAD0:
         /****** process 8 pixels ******/
-        x10 = *((uint32*)(ref += lx));
-        x11 = *((uint32*)(ref + 4));
-        x12 = *((uint32*)(blk += 16));
-        x14 = *((uint32*)(blk + 4));
+        x11 = *((int32*)(ref + 12));
+        x10 = *((int32*)(ref + 8));
+        x14 = *((int32*)(blk + 12));
+        x12 = *((int32*)(blk + 8));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -111,18 +108,19 @@ LOOP_SAD0:
         /* process x12 & x10 */
         x10 = sad_4pixel(x10, x12, x9);
 
-        x5 = x5 + x10; /* accumulate low bytes */
+        x5 = x5 + x10;  /* accumulate low bytes */
         x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
         x5 = x5 + x11;  /* accumulate low bytes */
         x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
         x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
         /****** process 8 pixels ******/
-        x10 = *((uint32*)(ref + 8));
-        x11 = *((uint32*)(ref + 12));
-        x12 = *((uint32*)(blk + 8));
-        x14 = *((uint32*)(blk + 12));
+        x11 = *((int32*)(ref + 4));
+__asm__ volatile("LDR  %0, [%1], %2": "=&r"(x10), "=r"(ref): "r"(lx));
+        //x10 = *((int32*)ref); ref+=lx;
+        x14 = *((int32*)(blk + 4));
+__asm__ volatile("LDR  %0, [%1], #16": "=&r"(x12), "=r"(blk));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -142,7 +140,9 @@ LOOP_SAD0:
         x10 = x10 + x4;     /* add with high bytes */
         x10 = x10 + (x10 << 16); /* add with lower half word */
 
-        if ((int)((uint32)x10 >> 16) <= dmin) /* compare with dmin */
+        /****************/
+
+        if (((uint32)x10 >> 16) <= (uint32)dmin) /* compare with dmin */
         {
             if (--x8)
             {
@@ -164,19 +164,14 @@ SadMBOffset2:
 SadMBOffset1:
 
         return sad_mb_offset1(ref, blk, lx, dmin);
-
     }
 
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
     __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        __asm
-        {
-            rsbs    tmp, tmp, tmp2 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
+        tmp = tmp - tmp2;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
 
         return sad;
     }
@@ -185,188 +180,26 @@ SadMBOffset1:
     {
         int32 x7;
 
-        __asm
-        {
-            EOR     x7, src2, src1;     /* check odd/even combination */
-            SUBS    src1, src2, src1;
-            EOR     x7, x7, src1;
-            AND     x7, mask, x7, lsr #1;
-            ORRCC   x7, x7, #0x80000000;
-            RSB     x7, x7, x7, lsl #8;
-            ADD     src1, src1, x7, asr #7;   /* add 0xFF to the negative byte, add back carry */
-            EOR     src1, src1, x7, asr #7;   /* take absolute value of negative byte */
-        }
-
-        return src1;
-    }
-
-    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
-    {
-        int32 x7;
-
-        __asm
-        {
-            EOR      x7, src2, src1;        /* check odd/even combination */
-            ADDS     src1, src2, src1;
-            EOR      x7, x7, src1;      /* only odd bytes need to add carry */
-            ANDS     x7, mask, x7, rrx;
-            RSB      x7, x7, x7, lsl #8;
-            SUB      src1, src1, x7, asr #7;  /* add 0xFF to the negative byte, add back carry */
-            EOR      src1, src1, x7, asr #7; /* take absolute value of negative byte */
-        }
-
-        return src1;
-    }
-
-#define sum_accumulate  __asm{      SBC      x5, x5, x10;  /* accumulate low bytes */ \
-        BIC      x10, x6, x10;   /* x10 & 0xFF00FF00 */ \
-        ADD      x4, x4, x10,lsr #8;   /* accumulate high bytes */ \
-        SBC      x5, x5, x11;    /* accumulate low bytes */ \
-        BIC      x11, x6, x11;   /* x11 & 0xFF00FF00 */ \
-        ADD      x4, x4, x11,lsr #8; } /* accumulate high bytes */
-
-
-#define NUMBER 3
-#define SHIFT 24
-#define INC_X8 0x08000001
-
-#include "sad_mb_offset.h"
-
-#undef NUMBER
-#define NUMBER 2
-#undef SHIFT
-#define SHIFT 16
-#undef INC_X8
-#define INC_X8 0x10000001
-#include "sad_mb_offset.h"
-
-#undef NUMBER
-#define NUMBER 1
-#undef SHIFT
-#define SHIFT 8
-#undef INC_X8
-#define INC_X8 0x08000001
-#include "sad_mb_offset.h"
-
-
-    __inline int32 simd_sad_mb(uint8 *ref, uint8 *blk, int dmin, int lx)
-    {
-        int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
-
-        x9 = 0x80808080; /* const. */
-        x4 = x5 = 0;
-
-        __asm
-        {
-            MOVS    x8, ref, lsl #31 ;
-            BHI     SadMBOffset3;
-            BCS     SadMBOffset2;
-            BMI     SadMBOffset1;
-
-            MVN     x6, #0xFF00;
-        }
-LOOP_SAD0:
-        /****** process 8 pixels ******/
-        x11 = *((int32*)(ref + 12));
-        x10 = *((int32*)(ref + 8));
-        x14 = *((int32*)(blk + 12));
-        x12 = *((int32*)(blk + 8));
-
-        /* process x11 & x14 */
-        x11 = sad_4pixel(x11, x14, x9);
-
-        /* process x12 & x10 */
-        x10 = sad_4pixel(x10, x12, x9);
-
-        x5 = x5 + x10;  /* accumulate low bytes */
-        x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
-        x5 = x5 + x11;  /* accumulate low bytes */
-        x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-        __asm
+        x7 = src2 ^ src1;       /* check odd/even combination */
+        if ((uint32)src2 >= (uint32)src1)
         {
-            /****** process 8 pixels ******/
-            LDR     x11, [ref, #4];
-            LDR     x10, [ref], lx ;
-            LDR     x14, [blk, #4];
-            LDR     x12, [blk], #16 ;
+            src1 = src2 - src1;     /* subs */
         }
-
-        /* process x11 & x14 */
-        x11 = sad_4pixel(x11, x14, x9);
-
-        /* process x12 & x10 */
-        x10 = sad_4pixel(x10, x12, x9);
-
-        x5 = x5 + x10;  /* accumulate low bytes */
-        x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
-        x5 = x5 + x11;  /* accumulate low bytes */
-        x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-        /****************/
-        x10 = x5 - (x4 << 8); /* extract low bytes */
-        x10 = x10 + x4;     /* add with high bytes */
-        x10 = x10 + (x10 << 16); /* add with lower half word */
-
-        __asm
+        else
         {
-            /****************/
-            RSBS    x11, dmin, x10, lsr #16;
-            ADDLSS  x8, x8, #0x10000001;
-            BLS     LOOP_SAD0;
+            src1 = src1 - src2;
         }
-
-        return ((uint32)x10 >> 16);
-
-SadMBOffset3:
-
-        return sad_mb_offset3(ref, blk, lx, dmin, x8);
-
-SadMBOffset2:
-
-        return sad_mb_offset2(ref, blk, lx, dmin, x8);
-
-SadMBOffset1:
-
-        return sad_mb_offset1(ref, blk, lx, dmin, x8);
-    }
-
-
-#elif defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
-
-    __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-__asm__ volatile("rsbs  %1, %1, %2\n\trsbmi %1, %1, #0\n\tadd  %0, %0, %1": "=r"(sad): "r"(tmp), "r"(tmp2));
-        return sad;
-    }
-
-    __inline int32 sad_4pixel(int32 src1, int32 src2, int32 mask)
-    {
-        int32 x7;
-
-__asm__ volatile("EOR  %1, %2, %0\n\tSUBS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tAND  %1, %3, %1, lsr #1\n\tORRCC  %1, %1, #0x80000000\n\tRSB  %1, %1, %1, lsl #8\n\tADD  %0, %0, %1, asr #7\n\tEOR  %0, %0, %1, asr #7": "=r"(src1), "=&r"(x7): "r"(src2), "r"(mask));
-
-        return src1;
-    }
-
-    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
-    {
-        int32 x7;
-
-__asm__ volatile("EOR  %1, %2, %0\n\tADDS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tANDS  %1, %3, %1, rrx\n\tRSB  %1, %1, %1, lsl #8\n\tSUB  %0, %0, %1, asr #7\n\tEOR   %0, %0, %1, asr #7": "=r"(src1), "=&r"(x7): "r"(src2), "r"(mask));
+        x7 = x7 ^ src1;     /* only odd bytes need to add carry */
+        x7 = mask & ((uint32)x7 >> 1);
+        x7 = (x7 << 8) - x7;
+        src1 = src1 + (x7 >> 7); /* add 0xFF to the negative byte, add back carry */
+        src1 = src1 ^(x7 >> 7);   /* take absolute value of negative byte */
 
         return src1;
     }
 
-#define sum_accumulate  __asm__ volatile("SBC  %0, %0, %1\n\tBIC   %1, %4, %1\n\tADD   %2, %2, %1, lsr #8\n\tSBC   %0, %0, %3\n\tBIC   %3, %4, %3\n\tADD   %2, %2, %3, lsr #8": "=&r" (x5), "=&r" (x10), "=&r" (x4), "=&r" (x11): "r" (x6));
-
 #define NUMBER 3
 #define SHIFT 24
-#define INC_X8 0x08000001
 
 #include "sad_mb_offset.h"
 
@@ -374,16 +207,12 @@ __asm__ volatile("EOR  %1, %2, %0\n\tADDS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tANDS
 #define NUMBER 2
 #undef SHIFT
 #define SHIFT 16
-#undef INC_X8
-#define INC_X8 0x10000001
 #include "sad_mb_offset.h"
 
 #undef NUMBER
 #define NUMBER 1
 #undef SHIFT
 #define SHIFT 8
-#undef INC_X8
-#define INC_X8 0x08000001
 #include "sad_mb_offset.h"
 
 
@@ -392,7 +221,6 @@ __asm__ volatile("EOR  %1, %2, %0\n\tADDS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tANDS
         int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
         x9 = 0x80808080; /* const. */
-        x4 = x5 = 0;
 
         x8 = (uint32)ref & 0x3;
         if (x8 == 3)
@@ -402,16 +230,22 @@ __asm__ volatile("EOR  %1, %2, %0\n\tADDS  %0, %2, %0\n\tEOR  %1, %1, %0\n\tANDS
         if (x8 == 1)
             goto SadMBOffset1;
 
+//  x5 = (x4<<8)-x4; /* x5 = x4*255; */
+        x4 = x5 = 0;
+
+        x6 = 0xFFFF00FF;
+
+        ref -= lx;
+        blk -= 16;
+
         x8 = 16;
-///
-__asm__ volatile("MVN  %0, #0xFF00": "=r"(x6));
 
 LOOP_SAD0:
         /****** process 8 pixels ******/
-        x11 = *((int32*)(ref + 12));
-        x10 = *((int32*)(ref + 8));
-        x14 = *((int32*)(blk + 12));
-        x12 = *((int32*)(blk + 8));
+        x10 = *((uint32*)(ref += lx));
+        x11 = *((uint32*)(ref + 4));
+        x12 = *((uint32*)(blk += 16));
+        x14 = *((uint32*)(blk + 4));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -419,19 +253,18 @@ LOOP_SAD0:
         /* process x12 & x10 */
         x10 = sad_4pixel(x10, x12, x9);
 
-        x5 = x5 + x10;  /* accumulate low bytes */
+        x5 = x5 + x10; /* accumulate low bytes */
         x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
+        x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
         x5 = x5 + x11;  /* accumulate low bytes */
         x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
         x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
         /****** process 8 pixels ******/
-        x11 = *((int32*)(ref + 4));
-__asm__ volatile("LDR  %0, [%1], %2": "=&r"(x10), "=r"(ref): "r"(lx));
-        //x10 = *((int32*)ref); ref+=lx;
-        x14 = *((int32*)(blk + 4));
-__asm__ volatile("LDR  %0, [%1], #16": "=&r"(x12), "=r"(blk));
+        x10 = *((uint32*)(ref + 8));
+        x11 = *((uint32*)(ref + 12));
+        x12 = *((uint32*)(blk + 8));
+        x14 = *((uint32*)(blk + 12));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -451,9 +284,7 @@ __asm__ volatile("LDR  %0, [%1], #16": "=&r"(x12), "=r"(blk));
         x10 = x10 + x4;     /* add with high bytes */
         x10 = x10 + (x10 << 16); /* add with lower half word */
 
-        /****************/
-
-        if (((uint32)x10 >> 16) <= dmin) /* compare with dmin */
+        if ((int)((uint32)x10 >> 16) <= dmin) /* compare with dmin */
         {
             if (--x8)
             {
@@ -475,10 +306,10 @@ SadMBOffset2:
 SadMBOffset1:
 
         return sad_mb_offset1(ref, blk, lx, dmin);
-    }
 
+    }
 
-#endif
+#endif/*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
 
 #ifdef __cplusplus
 }
index 1befe09..5aaa3d5 100644 (file)
@@ -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.
@@ -15,8 +15,9 @@
  * and limitations under the License.
  * -------------------------------------------------------------------
  */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_GNUC))
 
 #if (NUMBER==3)
 __inline int32 sad_mb_offset3(uint8 *ref, uint8 *blk, int lx, int dmin)
@@ -28,114 +29,12 @@ __inline int32 sad_mb_offset1(uint8 *ref, uint8 *blk, int lx, int dmin)
 {
     int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
-    //  x5 = (x4<<8) - x4;
-    x4 = x5 = 0;
-    x6 = 0xFFFF00FF;
-    x9 = 0x80808080; /* const. */
-    ref -= NUMBER; /* bic ref, ref, #3 */
-    ref -= lx;
-    blk -= 16;
-    x8 = 16;
-
-#if (NUMBER==3)
-LOOP_SAD3:
-#elif (NUMBER==2)
-LOOP_SAD2:
-#elif (NUMBER==1)
-LOOP_SAD1:
-#endif
-    /****** process 8 pixels ******/
-    x10 = *((uint32*)(ref += lx)); /* D C B A */
-    x11 = *((uint32*)(ref + 4));    /* H G F E */
-    x12 = *((uint32*)(ref + 8));    /* L K J I */
-
-    x10 = ((uint32)x10 >> SHIFT); /* 0 0 0 D */
-    x10 = x10 | (x11 << (32 - SHIFT));        /* G F E D */
-    x11 = ((uint32)x11 >> SHIFT); /* 0 0 0 H */
-    x11 = x11 | (x12 << (32 - SHIFT));        /* K J I H */
-
-    x12 = *((uint32*)(blk += 16));
-    x14 = *((uint32*)(blk + 4));
-
-    /* process x11 & x14 */
-    x11 = sad_4pixel(x11, x14, x9);
-
-    /* process x12 & x10 */
-    x10 = sad_4pixel(x10, x12, x9);
-
-    x5 = x5 + x10; /* accumulate low bytes */
-    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
-    x5 = x5 + x11;  /* accumulate low bytes */
-    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-    /****** process 8 pixels ******/
-    x10 = *((uint32*)(ref + 8)); /* D C B A */
-    x11 = *((uint32*)(ref + 12));   /* H G F E */
-    x12 = *((uint32*)(ref + 16));   /* L K J I */
-
-    x10 = ((uint32)x10 >> SHIFT); /* mvn x10, x10, lsr #24  = 0xFF 0xFF 0xFF ~D */
-    x10 = x10 | (x11 << (32 - SHIFT));        /* bic x10, x10, x11, lsl #8 = ~G ~F ~E ~D */
-    x11 = ((uint32)x11 >> SHIFT); /* 0xFF 0xFF 0xFF ~H */
-    x11 = x11 | (x12 << (32 - SHIFT));        /* ~K ~J ~I ~H */
-
-    x12 = *((uint32*)(blk + 8));
-    x14 = *((uint32*)(blk + 12));
-
-    /* process x11 & x14 */
-    x11 = sad_4pixel(x11, x14, x9);
-
-    /* process x12 & x10 */
-    x10 = sad_4pixel(x10, x12, x9);
-
-    x5 = x5 + x10; /* accumulate low bytes */
-    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
-    x5 = x5 + x11;  /* accumulate low bytes */
-    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-    /****************/
-    x10 = x5 - (x4 << 8); /* extract low bytes */
-    x10 = x10 + x4;     /* add with high bytes */
-    x10 = x10 + (x10 << 16); /* add with lower half word */
-
-    if ((int)((uint32)x10 >> 16) <= dmin) /* compare with dmin */
-    {
-        if (--x8)
-        {
-#if (NUMBER==3)
-            goto         LOOP_SAD3;
-#elif (NUMBER==2)
-            goto         LOOP_SAD2;
-#elif (NUMBER==1)
-            goto         LOOP_SAD1;
-#endif
-        }
-
-    }
-
-    return ((uint32)x10 >> 16);
-}
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-#if (NUMBER==3)
-__inline int32 sad_mb_offset3(uint8 *ref, uint8 *blk, int lx, int dmin, int32 x8)
-#elif (NUMBER==2)
-__inline int32 sad_mb_offset2(uint8 *ref, uint8 *blk, int lx, int dmin, int32 x8)
-#elif (NUMBER==1)
-__inline int32 sad_mb_offset1(uint8 *ref, uint8 *blk, int lx, int dmin, int32 x8)
-#endif
-{
-    int32 x4, x5, x6, x9, x10, x11, x12, x14;
-
     x9 = 0x80808080; /* const. */
     x4 = x5 = 0;
+    x8 = 16; //<<===========*******
+
+__asm__ volatile("MVN  %0, #0xFF0000": "=r"(x6));
 
-    __asm{
-        MVN      x6, #0xff0000;
 #if (NUMBER==3)
 LOOP_SAD3:
 #elif (NUMBER==2)
@@ -143,22 +42,22 @@ LOOP_SAD2:
 #elif (NUMBER==1)
 LOOP_SAD1:
 #endif
-        BIC      ref, ref, #3;
-    }
+__asm__ volatile("BIC  %0, %0, #3": "=r"(ref));
     /****** process 8 pixels ******/
     x11 = *((int32*)(ref + 12));
     x12 = *((int32*)(ref + 16));
     x10 = *((int32*)(ref + 8));
     x14 = *((int32*)(blk + 12));
 
-    __asm{
-        MVN      x10, x10, lsr #SHIFT;
-        BIC      x10, x10, x11, lsl #(32-SHIFT);
-        MVN      x11, x11, lsr #SHIFT;
-        BIC      x11, x11, x12, lsl #(32-SHIFT);
+#if (SHIFT==8)
+__asm__ volatile("MVN   %0, %0, lsr #8\n\tBIC   %0, %0, %1,lsl #24\n\tMVN   %1, %1,lsr #8\n\tBIC   %1, %1, %2,lsl #24": "=&r"(x10), "=&r"(x11): "r"(x12));
+#elif (SHIFT==16)
+__asm__ volatile("MVN   %0, %0, lsr #16\n\tBIC   %0, %0, %1,lsl #16\n\tMVN   %1, %1,lsr #16\n\tBIC   %1, %1, %2,lsl #16": "=&r"(x10), "=&r"(x11): "r"(x12));
+#elif (SHIFT==24)
+__asm__ volatile("MVN   %0, %0, lsr #24\n\tBIC   %0, %0, %1,lsl #8\n\tMVN   %1, %1,lsr #24\n\tBIC   %1, %1, %2,lsl #8": "=&r"(x10), "=&r"(x11): "r"(x12));
+#endif
 
-        LDR      x12, [blk, #8];
-    }
+    x12 = *((int32*)(blk + 8));
 
     /* process x11 & x14 */
     x11 = sad_4pixelN(x11, x14, x9);
@@ -168,20 +67,21 @@ LOOP_SAD1:
 
     sum_accumulate;
 
-    __asm{
-        /****** process 8 pixels ******/
-        LDR      x11, [ref, #4];
-        LDR      x12, [ref, #8];
-        LDR  x10, [ref], lx ;
-        LDR  x14, [blk, #4];
-
-        MVN      x10, x10, lsr #SHIFT;
-        BIC      x10, x10, x11, lsl #(32-SHIFT);
-        MVN      x11, x11, lsr #SHIFT;
-        BIC      x11, x11, x12, lsl #(32-SHIFT);
+    /****** process 8 pixels ******/
+    x11 = *((int32*)(ref + 4));
+    x12 = *((int32*)(ref + 8));
+    x10 = *((int32*)ref);
+    ref += lx;
+    x14 = *((int32*)(blk + 4));
 
-        LDR      x12, [blk], #16;
-    }
+#if (SHIFT==8)
+__asm__ volatile("MVN   %0, %0, lsr #8\n\tBIC   %0, %0, %1,lsl #24\n\tMVN   %1, %1,lsr #8\n\tBIC   %1, %1, %2,lsl #24": "=&r"(x10), "=&r"(x11): "r"(x12));
+#elif (SHIFT==16)
+__asm__ volatile("MVN   %0, %0, lsr #16\n\tBIC   %0, %0, %1,lsl #16\n\tMVN   %1, %1,lsr #16\n\tBIC   %1, %1, %2,lsl #16": "=&r"(x10), "=&r"(x11): "r"(x12));
+#elif (SHIFT==24)
+__asm__ volatile("MVN   %0, %0, lsr #24\n\tBIC   %0, %0, %1,lsl #8\n\tMVN   %1, %1,lsr #24\n\tBIC   %1, %1, %2,lsl #8": "=&r"(x10), "=&r"(x11): "r"(x12));
+#endif
+__asm__ volatile("LDR   %0, [%1], #16": "=&r"(x12), "=r"(blk));
 
     /* process x11 & x14 */
     x11 = sad_4pixelN(x11, x14, x9);
@@ -196,22 +96,25 @@ LOOP_SAD1:
     x10 = x10 + x4;     /* add with high bytes */
     x10 = x10 + (x10 << 16); /* add with lower half word */
 
-    __asm{
-        RSBS     x11, dmin, x10, lsr #16
-        ADDLSS   x8, x8, #INC_X8
+    if (((uint32)x10 >> 16) <= (uint32)dmin) /* compare with dmin */
+    {
+        if (--x8)
+        {
 #if (NUMBER==3)
-        BLS      LOOP_SAD3;
+            goto         LOOP_SAD3;
 #elif (NUMBER==2)
-BLS      LOOP_SAD2;
+            goto         LOOP_SAD2;
 #elif (NUMBER==1)
-BLS      LOOP_SAD1;
+            goto         LOOP_SAD1;
 #endif
+        }
+
     }
 
     return ((uint32)x10 >> 16);
 }
 
-#elif defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER  */
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
 
 #if (NUMBER==3)
 __inline int32 sad_mb_offset3(uint8 *ref, uint8 *blk, int lx, int dmin)
@@ -223,11 +126,14 @@ __inline int32 sad_mb_offset1(uint8 *ref, uint8 *blk, int lx, int dmin)
 {
     int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
-    x9 = 0x80808080; /* const. */
+    //  x5 = (x4<<8) - x4;
     x4 = x5 = 0;
-    x8 = 16; //<<===========*******
-
-__asm__ volatile("MVN  %0, #0xFF0000": "=r"(x6));
+    x6 = 0xFFFF00FF;
+    x9 = 0x80808080; /* const. */
+    ref -= NUMBER; /* bic ref, ref, #3 */
+    ref -= lx;
+    blk -= 16;
+    x8 = 16;
 
 #if (NUMBER==3)
 LOOP_SAD3:
@@ -236,60 +142,64 @@ LOOP_SAD2:
 #elif (NUMBER==1)
 LOOP_SAD1:
 #endif
-__asm__ volatile("BIC  %0, %0, #3": "=r"(ref));
     /****** process 8 pixels ******/
-    x11 = *((int32*)(ref + 12));
-    x12 = *((int32*)(ref + 16));
-    x10 = *((int32*)(ref + 8));
-    x14 = *((int32*)(blk + 12));
+    x10 = *((uint32*)(ref += lx)); /* D C B A */
+    x11 = *((uint32*)(ref + 4));    /* H G F E */
+    x12 = *((uint32*)(ref + 8));    /* L K J I */
 
-#if (SHIFT==8)
-__asm__ volatile("MVN   %0, %0, lsr #8\n\tBIC   %0, %0, %1,lsl #24\n\tMVN   %1, %1,lsr #8\n\tBIC   %1, %1, %2,lsl #24": "=&r"(x10), "=&r"(x11): "r"(x12));
-#elif (SHIFT==16)
-__asm__ volatile("MVN   %0, %0, lsr #16\n\tBIC   %0, %0, %1,lsl #16\n\tMVN   %1, %1,lsr #16\n\tBIC   %1, %1, %2,lsl #16": "=&r"(x10), "=&r"(x11): "r"(x12));
-#elif (SHIFT==24)
-__asm__ volatile("MVN   %0, %0, lsr #24\n\tBIC   %0, %0, %1,lsl #8\n\tMVN   %1, %1,lsr #24\n\tBIC   %1, %1, %2,lsl #8": "=&r"(x10), "=&r"(x11): "r"(x12));
-#endif
+    x10 = ((uint32)x10 >> SHIFT); /* 0 0 0 D */
+    x10 = x10 | (x11 << (32 - SHIFT));        /* G F E D */
+    x11 = ((uint32)x11 >> SHIFT); /* 0 0 0 H */
+    x11 = x11 | (x12 << (32 - SHIFT));        /* K J I H */
 
-    x12 = *((int32*)(blk + 8));
+    x12 = *((uint32*)(blk += 16));
+    x14 = *((uint32*)(blk + 4));
 
     /* process x11 & x14 */
-    x11 = sad_4pixelN(x11, x14, x9);
+    x11 = sad_4pixel(x11, x14, x9);
 
     /* process x12 & x10 */
-    x10 = sad_4pixelN(x10, x12, x9);
+    x10 = sad_4pixel(x10, x12, x9);
 
-    sum_accumulate;
+    x5 = x5 + x10; /* accumulate low bytes */
+    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+    x5 = x5 + x11;  /* accumulate low bytes */
+    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
     /****** process 8 pixels ******/
-    x11 = *((int32*)(ref + 4));
-    x12 = *((int32*)(ref + 8));
-    x10 = *((int32*)ref); ref += lx;
-    x14 = *((int32*)(blk + 4));
+    x10 = *((uint32*)(ref + 8)); /* D C B A */
+    x11 = *((uint32*)(ref + 12));   /* H G F E */
+    x12 = *((uint32*)(ref + 16));   /* L K J I */
 
-#if (SHIFT==8)
-__asm__ volatile("MVN   %0, %0, lsr #8\n\tBIC   %0, %0, %1,lsl #24\n\tMVN   %1, %1,lsr #8\n\tBIC   %1, %1, %2,lsl #24": "=&r"(x10), "=&r"(x11): "r"(x12));
-#elif (SHIFT==16)
-__asm__ volatile("MVN   %0, %0, lsr #16\n\tBIC   %0, %0, %1,lsl #16\n\tMVN   %1, %1,lsr #16\n\tBIC   %1, %1, %2,lsl #16": "=&r"(x10), "=&r"(x11): "r"(x12));
-#elif (SHIFT==24)
-__asm__ volatile("MVN   %0, %0, lsr #24\n\tBIC   %0, %0, %1,lsl #8\n\tMVN   %1, %1,lsr #24\n\tBIC   %1, %1, %2,lsl #8": "=&r"(x10), "=&r"(x11): "r"(x12));
-#endif
-__asm__ volatile("LDR   %0, [%1], #16": "=&r"(x12), "=r"(blk));
+    x10 = ((uint32)x10 >> SHIFT); /* mvn x10, x10, lsr #24  = 0xFF 0xFF 0xFF ~D */
+    x10 = x10 | (x11 << (32 - SHIFT));        /* bic x10, x10, x11, lsl #8 = ~G ~F ~E ~D */
+    x11 = ((uint32)x11 >> SHIFT); /* 0xFF 0xFF 0xFF ~H */
+    x11 = x11 | (x12 << (32 - SHIFT));        /* ~K ~J ~I ~H */
+
+    x12 = *((uint32*)(blk + 8));
+    x14 = *((uint32*)(blk + 12));
 
     /* process x11 & x14 */
-    x11 = sad_4pixelN(x11, x14, x9);
+    x11 = sad_4pixel(x11, x14, x9);
 
     /* process x12 & x10 */
-    x10 = sad_4pixelN(x10, x12, x9);
+    x10 = sad_4pixel(x10, x12, x9);
 
-    sum_accumulate;
+    x5 = x5 + x10; /* accumulate low bytes */
+    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+    x5 = x5 + x11;  /* accumulate low bytes */
+    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
     /****************/
     x10 = x5 - (x4 << 8); /* extract low bytes */
     x10 = x10 + x4;     /* add with high bytes */
     x10 = x10 + (x10 << 16); /* add with lower half word */
 
-    if (((uint32)x10 >> 16) <= (uint32)dmin) /* compare with dmin */
+    if ((int)((uint32)x10 >> 16) <= dmin) /* compare with dmin */
     {
         if (--x8)
         {
@@ -307,5 +217,6 @@ goto         LOOP_SAD1;
     return ((uint32)x10 >> 16);
 }
 
-#endif
+
+#endif/*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
 
index 115d0a3..0c9252a 100644 (file)
@@ -40,7 +40,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4decoder
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 18a096d..5227b8d 100644 (file)
@@ -24,7 +24,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvm4vencoder
 
-LOCAL_CFLAGS := -DBX_RC -DYUV_INPUT -DRGB12_INPUT -DRGB24_INPUT -DYUV420SEMIPLANAR_INPUT  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DBX_RC -DYUV_INPUT -DRGB12_INPUT -DRGB24_INPUT -DYUV420SEMIPLANAR_INPUT -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := 
index 083cbe2..63b3ae0 100644 (file)
@@ -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.
@@ -116,8 +116,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -211,8 +211,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -343,8 +343,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -425,8 +425,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -548,7 +548,7 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
+            k1 = mla724(k5, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             /*****************/
@@ -616,7 +616,7 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
+            k1 = mla724(k5, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             /*****************/
@@ -712,8 +712,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -807,8 +807,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -921,8 +921,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -1003,8 +1003,8 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
-            k0 = mla724(k12, k2, round);
+            k1 = mla724(k5, k12, round);
+            k0 = mla724(k2, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             k2 = k0 >> FDCT_SHIFT;
@@ -1108,7 +1108,7 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
+            k1 = mla724(k5, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             /*****************/
@@ -1176,7 +1176,7 @@ extern "C"
             /* MUL2C k2,k5,724,FDCT_SHIFT */
             /* k0, k1 become scratch */
             /* assume FAST MULTIPLY */
-            k1 = mla724(k12, k5, round);
+            k1 = mla724(k5, k12, round);
 
             k5 = k1 >> FDCT_SHIFT;
             /*****************/
index 1704c37..017b346 100644 (file)
@@ -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.
 #ifndef _DCT_INLINE_H_
 #define _DCT_INLINE_H_
 
-#if !defined(PV_ARM_GCC_V5)
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-#include "oscl_base_macros.h"
-
-__inline int32 mla724(int32 op1, int32 op2, int32 op3)
-{
-    int32 out;
-
-    OSCL_UNUSED_ARG(op1);
-
-    out = op2 * 724 + op3; /* op1 is not used here */
-
-    return out;
-}
-
-__inline int32 mla392(int32 k0, int32 k14, int32 round)
-{
-    int32 k1;
-
-    OSCL_UNUSED_ARG(k14);
-
-    k1 = k0 * 392 + round;
-
-    return k1;
-}
-
-__inline int32 mla554(int32 k4, int32 k12, int32 k1)
-{
-    int32 k0;
-
-    OSCL_UNUSED_ARG(k12);
-
-    k0 = k4 * 554 + k1;
-
-    return k0;
-}
-
-__inline int32 mla1338(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    OSCL_UNUSED_ARG(k14);
-
-    out = k6 * 1338 + k1;
-
-    return out;
-}
-
-__inline int32 mla946(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    OSCL_UNUSED_ARG(k14);
-
-    out = k6 * 946 + k1;
-
-    return out;
-}
-
-__inline int32 sum_abs(int32 k0, int32 k1, int32 k2, int32 k3,
-                       int32 k4, int32 k5, int32 k6, int32 k7)
-{
-    int32 carry, abs_sum;
-
-    carry = k0 >> 31;
-    abs_sum = (k0 ^ carry);
-    carry = k1 >> 31;
-    abs_sum += (k1 ^ carry) - carry;
-    carry = k2 >> 31;
-    abs_sum += (k2 ^ carry) - carry;
-    carry = k3 >> 31;
-    abs_sum += (k3 ^ carry) - carry;
-    carry = k4 >> 31;
-    abs_sum += (k4 ^ carry) - carry;
-    carry = k5 >> 31;
-    abs_sum += (k5 ^ carry) - carry;
-    carry = k6 >> 31;
-    abs_sum += (k6 ^ carry) - carry;
-    carry = k7 >> 31;
-    abs_sum += (k7 ^ carry) - carry;
-
-    return abs_sum;
-}
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-#if defined(__TARGET_ARCH_5TE)
-
-__inline int32 mla724(int32 op1, int32 op2, int32 op3)
-{
-    int32 out;
-
-    __asm
-    {
-        smlabb out, op1, op2, op3
-    }
-
-    return out;
-}
-
-__inline int32 mla392(int32 k0, int32 k14, int32 round)
-{
-    int32 k1;
-
-    __asm
-    {
-        smlabt k1, k0, k14, round
-    }
-
-    return k1;
-}
-
-__inline int32 mla554(int32 k4, int32 k12, int32 k1)
-{
-    int32 k0;
-
-    __asm
-    {
-        smlabt k0, k4, k12, k1
-    }
-
-    return k0;
-}
-
-__inline int32 mla1338(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    __asm
-    {
-        smlabb out, k6, k14, k1
-    }
-
-    return out;
-}
-
-__inline int32 mla946(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    __asm
-    {
-        smlabb out, k6, k14, k1
-    }
-
-    return out;
-}
-
-#else // not ARM5TE
-
-
-__inline int32 mla724(int32 op1, int32 op2, int32 op3)
-{
-    int32 out;
-
-    __asm
-    {
-        and out, op2, #0xFFFF
-        mla out, op1, out, op3
-    }
-
-    return out;
-}
-
-__inline int32 mla392(int32 k0, int32 k14, int32 round)
-{
-    int32 k1;
-
-    __asm
-    {
-        mov k1, k14, asr #16
-        mla k1, k0, k1, round
-    }
-
-    return k1;
-}
-
-__inline int32 mla554(int32 k4, int32 k12, int32 k1)
-{
-    int32 k0;
-
-    __asm
-    {
-        mov  k0, k12, asr #16
-        mla k0, k4, k0, k1
-    }
-
-    return k0;
-}
-
-__inline int32 mla1338(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    __asm
-    {
-        and out, k14, 0xFFFF
-        mla out, k6, out, k1
-    }
-
-    return out;
-}
-
-__inline int32 mla946(int32 k6, int32 k14, int32 k1)
-{
-    int32 out;
-
-    __asm
-    {
-        and out, k14, 0xFFFF
-        mla out, k6, out, k1
-    }
-
-    return out;
-}
-
-#endif
-
-__inline int32 sum_abs(int32 k0, int32 k1, int32 k2, int32 k3,
-                       int32 k4, int32 k5, int32 k6, int32 k7)
-{
-    int32 carry, abs_sum;
-    __asm
-    {
-        eor     carry, k0, k0, asr #31 ;
-        eors    abs_sum, k1, k1, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k2, k2, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k3, k3, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k4, k4, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k5, k5, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k6, k6, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-        eors    carry,  k7, k7, asr #31 ;
-        adc     abs_sum, abs_sum, carry ;
-    }
-
-    return abs_sum;
-}
-
-#elif defined(PV_ARM_GCC_V5)  /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* ARM GNU COMPILER  */
 
 __inline int32 mla724(int32 op1, int32 op2, int32 op3)
 {
@@ -389,9 +147,89 @@ __inline int32 sum_abs(int32 k0, int32 k1, int32 k2, int32 k3,
 
     return abs_sum;
 }
+#else/*#else for #if (PV_CPU_ARCH_VERSION>=4 && PV_COMPILER==EPV_ARM_RVCT) */
+/*C Equivalent code*/
+#include "oscl_base_macros.h"
 
-#endif // Diff. OS
+__inline int32 mla724(int32 op1, int32 op2, int32 op3)
+{
+    int32 out;
 
-#endif //_DCT_INLINE_H_
+    OSCL_UNUSED_ARG(op2);
+
+    out = op1 * 724 + op3; /* op2 is not used here */
+
+    return out;
+}
 
+__inline int32 mla392(int32 k0, int32 k14, int32 round)
+{
+    int32 k1;
+
+    OSCL_UNUSED_ARG(k14);
+
+    k1 = k0 * 392 + round;
 
+    return k1;
+}
+
+__inline int32 mla554(int32 k4, int32 k12, int32 k1)
+{
+    int32 k0;
+
+    OSCL_UNUSED_ARG(k12);
+
+    k0 = k4 * 554 + k1;
+
+    return k0;
+}
+
+__inline int32 mla1338(int32 k6, int32 k14, int32 k1)
+{
+    int32 out;
+
+    OSCL_UNUSED_ARG(k14);
+
+    out = k6 * 1338 + k1;
+
+    return out;
+}
+
+__inline int32 mla946(int32 k6, int32 k14, int32 k1)
+{
+    int32 out;
+
+    OSCL_UNUSED_ARG(k14);
+
+    out = k6 * 946 + k1;
+
+    return out;
+}
+
+__inline int32 sum_abs(int32 k0, int32 k1, int32 k2, int32 k3,
+                       int32 k4, int32 k5, int32 k6, int32 k7)
+{
+    int32 carry, abs_sum;
+
+    carry = k0 >> 31;
+    abs_sum = (k0 ^ carry);
+    carry = k1 >> 31;
+    abs_sum += (k1 ^ carry) - carry;
+    carry = k2 >> 31;
+    abs_sum += (k2 ^ carry) - carry;
+    carry = k3 >> 31;
+    abs_sum += (k3 ^ carry) - carry;
+    carry = k4 >> 31;
+    abs_sum += (k4 ^ carry) - carry;
+    carry = k5 >> 31;
+    abs_sum += (k5 ^ carry) - carry;
+    carry = k6 >> 31;
+    abs_sum += (k6 ^ carry) - carry;
+    carry = k7 >> 31;
+    abs_sum += (k7 ^ carry) - carry;
+
+    return abs_sum;
+}
+#endif /*#endif for (PV_CPU_ARCH_VERSION>=4 && PV_COMPILER==EPV_ARM_RVCT) */
+
+#endif //_DCT_INLINE_H_
index 3298f29..f9b244f 100644 (file)
@@ -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.
 #include "mp4def.h"
 #include "oscl_base_macros.h"
 
-#if !defined(PV_ARM_GCC_V5) /* ARM GNU COMPILER  */
 
-__inline int32 aan_scale(int32 q_value, int32 coeff, int32 round, int32 QPdiv2)
-{
-    q_value = coeff * q_value + round;
-    coeff = q_value >> 16;
-    if (coeff < 0)  coeff += QPdiv2;
-    else            coeff -= QPdiv2;
-
-    return coeff;
-}
-
-
-__inline int32 coeff_quant(int32 coeff, int32 q_scale, int32 shift)
-{
-    int32 q_value;
-
-    q_value = coeff * q_scale;      //q_value = -((-(coeff + QPdiv2)*q_scale)>>LSL);
-    q_value >>= shift;                  //q_value = (((coeff - QPdiv2)*q_scale)>>LSL );
-    q_value += ((UInt)q_value >> 31); /* add one if negative */
-
-    return q_value;
-}
-
-__inline int32  coeff_clip(int32 q_value, int32 ac_clip)
-{
-    int32 coeff = q_value + ac_clip;
-
-    if ((UInt)coeff > (UInt)(ac_clip << 1))
-        q_value = ac_clip ^(q_value >> 31);
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant(int32 q_value, int32 QPx2, int32 Addition, int32 tmp)
-{
-    int32 coeff;
-
-    OSCL_UNUSED_ARG(tmp);
-
-    if (q_value < 0)
-    {
-        coeff = q_value * QPx2 - Addition;
-        if (coeff < -2048)
-            coeff = -2048;
-    }
-    else
-    {
-        coeff = q_value * QPx2 + Addition;
-        if (coeff > 2047)
-            coeff = 2047;
-    }
-    return coeff;
-}
-
-__inline int32 smlabb(int32 q_value, int32 coeff, int32 round)
-{
-    q_value = coeff * q_value + round;
-
-    return q_value;
-}
-
-__inline int32 smulbb(int32 q_scale, int32 coeff)
-{
-    int32 q_value;
-
-    q_value = coeff * q_scale;
-
-    return q_value;
-}
-
-__inline int32 aan_dc_scale(int32 coeff, int32 QP)
-{
-
-    if (coeff < 0)  coeff += (QP >> 1);
-    else            coeff -= (QP >> 1);
-
-    return coeff;
-}
-
-__inline int32 clip_2047(int32 q_value, int32 tmp)
-{
-    OSCL_UNUSED_ARG(tmp);
-
-    if (q_value < -2048)
-    {
-        q_value = -2048;
-    }
-    else if (q_value > 2047)
-    {
-        q_value = 2047;
-    }
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant_mpeg(int32 q_value, int32 stepsize, int32 QP, int32 tmp)
-{
-    int32 coeff;
-
-    OSCL_UNUSED_ARG(tmp);
-
-    coeff = q_value << 1;
-    stepsize *= QP;
-    if (coeff > 0)
-    {
-        q_value = (coeff + 1) * stepsize;
-        q_value >>= 4;
-        if (q_value > 2047) q_value = 2047;
-    }
-    else
-    {
-        q_value = (coeff - 1) * stepsize;
-        q_value += 15;
-        q_value >>= 4;
-        if (q_value < -2048)    q_value = -2048;
-    }
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant_mpeg_intra(int32 q_value, int32 tmp)
-{
-    OSCL_UNUSED_ARG(tmp);
-
-    q_value <<= 1;
-    if (q_value > 0)
-    {
-        q_value >>= 4;
-        if (q_value > 2047) q_value = 2047;
-    }
-    else
-    {
-        q_value += 15;
-        q_value >>= 4;
-        if (q_value < -2048) q_value = -2048;
-    }
-
-    return q_value;
-}
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-#if defined(__TARGET_ARCH_5TE)
-
-__inline int32 aan_scale(int32 q_value, int32 coeff,
-                         int32 round, int32 QPdiv2)
-{
-    __asm
-    {
-        smlabb q_value, coeff, q_value, round
-        movs       coeff, q_value, asr #16
-        addle   coeff, coeff, QPdiv2
-        subgt   coeff, coeff, QPdiv2
-    }
-
-    return coeff;
-}
-
-__inline int32 coeff_quant(int32 coeff, int32 q_scale, int32 shift)
-{
-    int32 q_value;
-
-    __asm
-    {
-        smulbb  q_value, q_scale, coeff    /*mov    coeff, coeff, lsl #14*/
-        mov     coeff, q_value, asr shift   /*smull tmp, coeff, q_scale, coeff*/
-        add q_value, coeff, coeff, lsr #31
-    }
-
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant(int32 q_value, int32 QPx2, int32 Addition, int32 tmp)
-{
-    int32 coeff;
-
-    __asm
-    {
-        cmp     q_value, #0
-        smulbb  coeff, q_value, QPx2
-        sublt   coeff, coeff, Addition
-        addge   coeff, coeff, Addition
-        add     q_value, coeff, tmp
-        subs    q_value, q_value, #3840
-        subcss  q_value, q_value, #254
-        eorhi   coeff, tmp, coeff, asr #31
-    }
-
-    return coeff;
-}
-
-__inline int32 smlabb(int32 q_value, int32 coeff, int32 round)
-{
-    __asm
-    {
-        smlabb q_value, coeff, q_value, round
-    }
-
-    return q_value;
-}
-
-__inline int32 smulbb(int32 q_scale, int32 coeff)
-{
-    int32 q_value;
-
-    __asm
-    {
-        smulbb  q_value, q_scale, coeff
-    }
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant_mpeg(int32 q_value, int32 stepsize, int32 QP, int32 tmp)
-{
-    /* tmp must have value of 2047 */
-    int32 coeff;
-    __asm
-    {
-        movs    coeff, q_value, lsl #1
-        smulbb  stepsize, stepsize, QP
-        addgt   coeff, coeff, #1
-        sublt   coeff, coeff, #1
-        smulbb  q_value, coeff, stepsize
-        addlt   q_value, q_value, #15
-        mov     q_value, q_value, asr #4
-        add     coeff, q_value, tmp
-        subs    coeff, coeff, #0xf00
-        subcss  coeff, coeff, #0xfe
-        eorhi   q_value, tmp, q_value, asr #31
-    }
-
-    return q_value;
-}
-
-
-#else // not ARMV5TE
-
-__inline int32 aan_scale(int32 q_value, int32 coeff,
-                         int32 round, int32 QPdiv2)
-{
-    __asm
-    {
-        mla q_value, coeff, q_value, round
-        movs       coeff, q_value, asr #16
-        addle   coeff, coeff, QPdiv2
-        subgt   coeff, coeff, QPdiv2
-    }
-
-    return coeff;
-}
-
-__inline int32 coeff_quant(int32 coeff, int32 q_scale, int32 shift)
-{
-    int32 q_value;
-
-    __asm
-    {
-        mul q_value, q_scale, coeff    /*mov    coeff, coeff, lsl #14*/
-        mov     coeff, q_value, asr shift   /*smull tmp, coeff, q_scale, coeff*/
-        add q_value, coeff, coeff, lsr #31
-    }
-
-
-    return q_value;
-}
-
-
-__inline int32 coeff_dequant(int32 q_value, int32 QPx2, int32 Addition, int32 tmp)
-{
-    int32 coeff;
-
-    __asm
-    {
-        cmp     q_value, #0
-        mul coeff, q_value, QPx2
-        sublt   coeff, coeff, Addition
-        addge   coeff, coeff, Addition
-        add     q_value, coeff, tmp
-        subs    q_value, q_value, #3840
-        subcss  q_value, q_value, #254
-        eorhi   coeff, tmp, coeff, asr #31
-    }
-
-    return coeff;
-}
-
-__inline int32 smlabb(int32 q_value, int32 coeff, int32 round)
-{
-    __asm
-    {
-        mla q_value, coeff, q_value, round
-    }
-
-    return q_value;
-}
-
-__inline int32 smulbb(int32 q_scale, int32 coeff)
-{
-    int32 q_value;
-
-    __asm
-    {
-        mul q_value, q_scale, coeff
-    }
-
-    return q_value;
-}
-
-
-__inline int32 coeff_dequant_mpeg(int32 q_value, int32 stepsize, int32 QP, int32 tmp)
-{
-    /* tmp must have value of 2047 */
-    int32 coeff;
-    __asm
-    {
-        movs    coeff, q_value, lsl #1
-        mul  stepsize, stepsize, QP
-        addgt   coeff, coeff, #1
-        sublt   coeff, coeff, #1
-        mul q_value, coeff, stepsize
-        addlt   q_value, q_value, #15
-        mov     q_value, q_value, asr #4
-        add     coeff, q_value, tmp
-        subs    coeff, coeff, #0xf00
-        subcss  coeff, coeff, #0xfe
-        eorhi   q_value, tmp, q_value, asr #31
-    }
-
-    return q_value;
-}
-
-
-#endif
-
-__inline int32  coeff_clip(int32 q_value, int32 ac_clip)
-{
-    int32 coeff;
-
-    __asm
-    {
-        add     coeff, q_value, ac_clip
-        subs    coeff, coeff, ac_clip, lsl #1
-        eorhi   q_value, ac_clip, q_value, asr #31
-    }
-
-    return q_value;
-}
-
-__inline int32 aan_dc_scale(int32 coeff, int32 QP)
-{
-
-    __asm
-    {
-        cmp   coeff, #0
-        addle   coeff, coeff, QP, asr #1
-        subgt   coeff, coeff, QP, asr #1
-    }
-
-    return coeff;
-}
-
-__inline int32 clip_2047(int32 q_value, int32 tmp)
-{
-    /* tmp must have value of 2047 */
-    int32 coeff;
-
-    __asm
-    {
-        add     coeff, q_value, tmp
-        subs    coeff, coeff, #0xf00
-        subcss  coeff, coeff, #0xfe
-        eorhi   q_value, tmp, q_value, asr #31
-    }
-
-    return q_value;
-}
-
-__inline int32 coeff_dequant_mpeg_intra(int32 q_value, int32 tmp)
-{
-    int32 coeff;
-
-    __asm
-    {
-        movs    q_value, q_value, lsl #1
-        addlt   q_value, q_value, #15
-        mov     q_value, q_value, asr #4
-        add     coeff, q_value, tmp
-        subs    coeff, coeff, #0xf00
-        subcss  coeff, coeff, #0xfe
-        eorhi   q_value, tmp, q_value, asr #31
-    }
-
-    return q_value;
-}
-
-#elif (defined(PV_ARM_GCC_V5)) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* ARM GNU COMPILER  */
 
 __inline int32 aan_scale(int32 q_value, int32 coeff,
                          int32 round, int32 QPdiv2)
@@ -617,10 +220,146 @@ __inline int32 coeff_dequant_mpeg_intra(int32 q_value, int32 tmp)
     return out;
 }
 
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT)) */
+/*C Equivalent Code*/
+__inline int32 aan_scale(int32 q_value, int32 coeff, int32 round, int32 QPdiv2)
+{
+    q_value = coeff * q_value + round;
+    coeff = q_value >> 16;
+    if (coeff < 0)  coeff += QPdiv2;
+    else            coeff -= QPdiv2;
+
+    return coeff;
+}
 
-#endif // Platform
 
+__inline int32 coeff_quant(int32 coeff, int32 q_scale, int32 shift)
+{
+    int32 q_value;
 
-#endif //_FASTQUANT_INLINE_H_
+    q_value = coeff * q_scale;      //q_value = -((-(coeff + QPdiv2)*q_scale)>>LSL);
+    q_value >>= shift;                  //q_value = (((coeff - QPdiv2)*q_scale)>>LSL );
+    q_value += ((UInt)q_value >> 31); /* add one if negative */
+
+    return q_value;
+}
+
+__inline int32  coeff_clip(int32 q_value, int32 ac_clip)
+{
+    int32 coeff = q_value + ac_clip;
+
+    if ((UInt)coeff > (UInt)(ac_clip << 1))
+        q_value = ac_clip ^(q_value >> 31);
+
+    return q_value;
+}
+
+__inline int32 coeff_dequant(int32 q_value, int32 QPx2, int32 Addition, int32 tmp)
+{
+    int32 coeff;
+
+    OSCL_UNUSED_ARG(tmp);
+
+    if (q_value < 0)
+    {
+        coeff = q_value * QPx2 - Addition;
+        if (coeff < -2048)
+            coeff = -2048;
+    }
+    else
+    {
+        coeff = q_value * QPx2 + Addition;
+        if (coeff > 2047)
+            coeff = 2047;
+    }
+    return coeff;
+}
 
+__inline int32 smlabb(int32 q_value, int32 coeff, int32 round)
+{
+    q_value = coeff * q_value + round;
 
+    return q_value;
+}
+
+__inline int32 smulbb(int32 q_scale, int32 coeff)
+{
+    int32 q_value;
+
+    q_value = coeff * q_scale;
+
+    return q_value;
+}
+
+__inline int32 aan_dc_scale(int32 coeff, int32 QP)
+{
+
+    if (coeff < 0)  coeff += (QP >> 1);
+    else            coeff -= (QP >> 1);
+
+    return coeff;
+}
+
+__inline int32 clip_2047(int32 q_value, int32 tmp)
+{
+    OSCL_UNUSED_ARG(tmp);
+
+    if (q_value < -2048)
+    {
+        q_value = -2048;
+    }
+    else if (q_value > 2047)
+    {
+        q_value = 2047;
+    }
+
+    return q_value;
+}
+
+__inline int32 coeff_dequant_mpeg(int32 q_value, int32 stepsize, int32 QP, int32 tmp)
+{
+    int32 coeff;
+
+    OSCL_UNUSED_ARG(tmp);
+
+    coeff = q_value << 1;
+    stepsize *= QP;
+    if (coeff > 0)
+    {
+        q_value = (coeff + 1) * stepsize;
+        q_value >>= 4;
+        if (q_value > 2047) q_value = 2047;
+    }
+    else
+    {
+        q_value = (coeff - 1) * stepsize;
+        q_value += 15;
+        q_value >>= 4;
+        if (q_value < -2048)    q_value = -2048;
+    }
+
+    return q_value;
+}
+
+__inline int32 coeff_dequant_mpeg_intra(int32 q_value, int32 tmp)
+{
+    OSCL_UNUSED_ARG(tmp);
+
+    q_value <<= 1;
+    if (q_value > 0)
+    {
+        q_value >>= 4;
+        if (q_value > 2047) q_value = 2047;
+    }
+    else
+    {
+        q_value += 15;
+        q_value >>= 4;
+        if (q_value < -2048) q_value = -2048;
+    }
+
+    return q_value;
+}
+#endif /*#endif for((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
+
+#endif //_FASTQUANT_INLINE_H_
index f84f02c..1de6198 100644 (file)
@@ -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.
 #ifndef _SAD_HALFPEL_INLINE_H_
 #define _SAD_HALFPEL_INLINE_H_
 
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-#if !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) /* ARM GNU COMPILER  */
-
-    __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        tmp = (tmp2 >> 1) - tmp;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
-
-        return sad;
-    }
-
-    __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        tmp = (tmp >> 2) - tmp2;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
-
-        return sad;
-    }
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-    __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        __asm
-        {
-            rsbs    tmp, tmp, tmp2, asr #1 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
-
-        return sad;
-    }
-
-    __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        __asm
-        {
-            rsbs    tmp, tmp2, tmp, asr #2 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
-
-        return sad;
-    }
-
-#elif ( defined(PV_ARM_GCC_V5) || defined(PV_ARM_GCC_V4) ) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC)) /* ARM GNU COMPILER  */
 
 
     __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
@@ -118,7 +74,28 @@ extern "C"
     }
 
 
-#endif // Diff OS
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
+    /*C equivalent code*/
+    __inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
+    {
+        tmp = (tmp2 >> 1) - tmp;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
+
+        return sad;
+    }
+
+    __inline int32 INTERP2_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
+    {
+        tmp = (tmp >> 2) - tmp2;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
+
+        return sad;
+    }
+
+
+#endif /*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
 
 
 
index ba77dfd..2df1b82 100644 (file)
@@ -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.
 #ifndef _SAD_INLINE_H_
 #define _SAD_INLINE_H_
 
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-#if !defined(PV_ARM_GCC_V5) && !defined(PV_ARM_GCC_V4) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC))/* ARM GNU COMPILER  */
 
     __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        tmp = tmp - tmp2;
-        if (tmp > 0) sad += tmp;
-        else sad -= tmp;
+        register int32 out;
+        register int32 temp1;
+        register int32 ss = sad;
+        register int32 tt = tmp;
+        register int32 uu = tmp2;
 
-        return sad;
+        asm volatile("rsbs  %1, %4, %3\n\t"
+                     "rsbmi %1, %1, #0\n\t"
+                     "add   %0, %2, %1"
+             : "=&r"(out),
+                     "=&r"(temp1)
+                             : "r"(ss),
+                             "r"(tt),
+                             "r"(uu));
+        return out;
     }
 
     __inline int32 sad_4pixel(int32 src1, int32 src2, int32 mask)
-    {
-        int32 x7;
+{
+        register int32 out;
+        register int32 temp1;
+        register int32 s1 = src1;
+        register int32 s2 = src2;
+        register int32 mm = mask;
 
-        x7 = src2 ^ src1;       /* check odd/even combination */
-        if ((uint32)src2 >= (uint32)src1)
-        {
-            src1 = src2 - src1;     /* subs */
-        }
-        else
-        {
-            src1 = src1 - src2;
-        }
-        x7 = x7 ^ src1;     /* only odd bytes need to add carry */
-        x7 = mask & ((uint32)x7 >> 1);
-        x7 = (x7 << 8) - x7;
-        src1 = src1 + (x7 >> 7); /* add 0xFF to the negative byte, add back carry */
-        src1 = src1 ^(x7 >> 7);   /* take absolute value of negative byte */
+        asm volatile("eor   %0, %3, %2\n\t"
+                     "subs  %1, %3, %2\n\t"
+                     "eor   %0, %0, %1\n\t"
+                     "and   %0, %4, %0, lsr #1\n\t"
+                     "orrcc %0, %0, #0x80000000\n\t"
+                     "rsb   %0, %0, %0, lsl #8\n\t"
+                     "add   %1, %1, %0, asr #7\n\t"
+                     "eor   %1, %1, %0, asr #7"
+             : "=&r"(out),
+                     "=&r"(temp1)
+                             : "r"(s1),
+                             "r"(s2),
+                             "r"(mm));
 
-        return src1;
+        return temp1;
+    }
+
+    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
+{
+        register int32 out;
+        register int32 temp1;
+        register int32 s1 = src1;
+        register int32 s2 = src2;
+        register int32 mm = mask;
+
+        asm volatile("eor    %1, %3, %2\n\t"
+                     "adds   %0, %3, %2\n\t"
+                     "eor    %1, %1, %0\n\t"
+                     "ands   %1, %4, %1,rrx\n\t"
+                     "rsb    %1, %1, %1, lsl #8\n\t"
+                     "sub    %0, %0, %1, asr #7\n\t"
+                     "eor    %0, %0, %1, asr #7"
+             : "=&r"(out),
+                     "=&r"(temp1)
+                             : "r"(s1),
+                             "r"(s2),
+                             "r"(mm));
+
+        return (out);
     }
 
+#define sum_accumulate asm volatile("sbc  %0, %0, %1\n\t" \
+                                "bic  %1, %4, %1\n\t" \
+                                "add  %2, %2, %1, lsr #8\n\t" \
+                                "sbc  %0, %0, %3\n\t" \
+                                "bic  %3, %4, %3\n\t" \
+                                "add  %2, %2, %3, lsr #8" \
+                                :"+r"(x5), "+r"(x10), "+r"(x4), "+r"(x11) \
+                                :"r"(x6));
+
 #define NUMBER 3
 #define SHIFT 24
+#define INC_X8 0x08000001
 
 #include "sad_mb_offset.h"
 
@@ -70,20 +119,25 @@ extern "C"
 #define NUMBER 2
 #undef SHIFT
 #define SHIFT 16
+#undef INC_X8
+#define INC_X8 0x10000001
 #include "sad_mb_offset.h"
 
 #undef NUMBER
 #define NUMBER 1
 #undef SHIFT
 #define SHIFT 8
+#undef INC_X8
+#define INC_X8 0x08000001
 #include "sad_mb_offset.h"
 
 
     __inline int32 simd_sad_mb(UChar *ref, UChar *blk, Int dmin, Int lx)
-    {
+{
         int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
         x9 = 0x80808080; /* const. */
+        x4 = x5 = 0;
 
         x8 = (uint32)ref & 0x3;
         if (x8 == 3)
@@ -93,22 +147,14 @@ extern "C"
         if (x8 == 1)
             goto SadMBOffset1;
 
-//  x5 = (x4<<8)-x4; /* x5 = x4*255; */
-        x4 = x5 = 0;
-
-        x6 = 0xFFFF00FF;
-
-        ref -= lx;
-        blk -= 16;
-
-        x8 = 16;
+asm volatile("mvn %0, #0xFF00": "=r"(x6));
 
 LOOP_SAD0:
         /****** process 8 pixels ******/
-        x10 = *((uint32*)(ref += lx));
-        x11 = *((uint32*)(ref + 4));
-        x12 = *((uint32*)(blk += 16));
-        x14 = *((uint32*)(blk + 4));
+        x11 = *((int32*)(ref + 12));
+        x10 = *((int32*)(ref + 8));
+        x14 = *((int32*)(blk + 12));
+        x12 = *((int32*)(blk + 8));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -116,18 +162,19 @@ LOOP_SAD0:
         /* process x12 & x10 */
         x10 = sad_4pixel(x10, x12, x9);
 
-        x5 = x5 + x10; /* accumulate low bytes */
+        x5 = x5 + x10;  /* accumulate low bytes */
         x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
         x5 = x5 + x11;  /* accumulate low bytes */
         x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
         x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
-        /****** process 8 pixels ******/
-        x10 = *((uint32*)(ref + 8));
-        x11 = *((uint32*)(ref + 12));
-        x12 = *((uint32*)(blk + 8));
-        x14 = *((uint32*)(blk + 12));
+        asm volatile("ldr  %0, [%4, #4]\n\t"
+                     "ldr  %1, [%4], %6\n\t"
+                     "ldr  %2, [%5, #4]\n\t"
+                     "ldr  %3, [%5], #16"
+             : "=r"(x11), "=r"(x10), "=r"(x14), "=r"(x12), "+r"(ref), "+r"(blk)
+                             : "r"(lx));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -169,19 +216,16 @@ SadMBOffset2:
 SadMBOffset1:
 
         return sad_mb_offset1(ref, blk, lx, dmin);
-
     }
 
-#elif defined(__CC_ARM)  /* only work with arm v5 */
 
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
+    /*C Equaivalenc Code*/
     __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
     {
-        __asm
-        {
-            rsbs    tmp, tmp, tmp2 ;
-            rsbmi   tmp, tmp, #0 ;
-            add     sad, sad, tmp ;
-        }
+        tmp = tmp - tmp2;
+        if (tmp > 0) sad += tmp;
+        else sad -= tmp;
 
         return sad;
     }
@@ -190,50 +234,26 @@ SadMBOffset1:
     {
         int32 x7;
 
-        __asm
+        x7 = src2 ^ src1;       /* check odd/even combination */
+        if ((uint32)src2 >= (uint32)src1)
         {
-            EOR     x7, src2, src1;     /* check odd/even combination */
-            SUBS    src1, src2, src1;
-            EOR     x7, x7, src1;
-            AND     x7, mask, x7, lsr #1;
-            ORRCC   x7, x7, #0x80000000;
-            RSB     x7, x7, x7, lsl #8;
-            ADD     src1, src1, x7, asr #7;   /* add 0xFF to the negative byte, add back carry */
-            EOR     src1, src1, x7, asr #7;   /* take absolute value of negative byte */
+            src1 = src2 - src1;     /* subs */
         }
-
-        return src1;
-    }
-
-    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
-    {
-        int32 x7;
-
-        __asm
+        else
         {
-            EOR      x7, src2, src1;        /* check odd/even combination */
-            ADDS     src1, src2, src1;
-            EOR      x7, x7, src1;      /* only odd bytes need to add carry */
-            ANDS     x7, mask, x7, rrx;
-            RSB      x7, x7, x7, lsl #8;
-            SUB      src1, src1, x7, asr #7;  /* add 0xFF to the negative byte, add back carry */
-            EOR      src1, src1, x7, asr #7; /* take absolute value of negative byte */
+            src1 = src1 - src2;
         }
+        x7 = x7 ^ src1;     /* only odd bytes need to add carry */
+        x7 = mask & ((uint32)x7 >> 1);
+        x7 = (x7 << 8) - x7;
+        src1 = src1 + (x7 >> 7); /* add 0xFF to the negative byte, add back carry */
+        src1 = src1 ^(x7 >> 7);   /* take absolute value of negative byte */
 
         return src1;
     }
 
-#define sum_accumulate  __asm{      SBC      x5, x5, x10;  /* accumulate low bytes */ \
-        BIC      x10, x6, x10;   /* x10 & 0xFF00FF00 */ \
-        ADD      x4, x4, x10,lsr #8;   /* accumulate high bytes */ \
-        SBC      x5, x5, x11;    /* accumulate low bytes */ \
-        BIC      x11, x6, x11;   /* x11 & 0xFF00FF00 */ \
-        ADD      x4, x4, x11,lsr #8; } /* accumulate high bytes */
-
-
 #define NUMBER 3
 #define SHIFT 24
-#define INC_X8 0x08000001
 
 #include "sad_mb_offset.h"
 
@@ -241,16 +261,12 @@ SadMBOffset1:
 #define NUMBER 2
 #undef SHIFT
 #define SHIFT 16
-#undef INC_X8
-#define INC_X8 0x10000001
 #include "sad_mb_offset.h"
 
 #undef NUMBER
 #define NUMBER 1
 #undef SHIFT
 #define SHIFT 8
-#undef INC_X8
-#define INC_X8 0x08000001
 #include "sad_mb_offset.h"
 
 
@@ -259,196 +275,6 @@ SadMBOffset1:
         int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
 
         x9 = 0x80808080; /* const. */
-        x4 = x5 = 0;
-
-        __asm
-        {
-            MOVS    x8, ref, lsl #31 ;
-            BHI     SadMBOffset3;
-            BCS     SadMBOffset2;
-            BMI     SadMBOffset1;
-
-            MVN     x6, #0xFF00;
-        }
-LOOP_SAD0:
-        /****** process 8 pixels ******/
-        x11 = *((int32*)(ref + 12));
-        x10 = *((int32*)(ref + 8));
-        x14 = *((int32*)(blk + 12));
-        x12 = *((int32*)(blk + 8));
-
-        /* process x11 & x14 */
-        x11 = sad_4pixel(x11, x14, x9);
-
-        /* process x12 & x10 */
-        x10 = sad_4pixel(x10, x12, x9);
-
-        x5 = x5 + x10;  /* accumulate low bytes */
-        x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
-        x5 = x5 + x11;  /* accumulate low bytes */
-        x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-        __asm
-        {
-            /****** process 8 pixels ******/
-            LDR     x11, [ref, #4];
-            LDR     x10, [ref], lx ;
-            LDR     x14, [blk, #4];
-            LDR     x12, [blk], #16 ;
-        }
-
-        /* process x11 & x14 */
-        x11 = sad_4pixel(x11, x14, x9);
-
-        /* process x12 & x10 */
-        x10 = sad_4pixel(x10, x12, x9);
-
-        x5 = x5 + x10;  /* accumulate low bytes */
-        x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
-        x5 = x5 + x11;  /* accumulate low bytes */
-        x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
-
-        /****************/
-        x10 = x5 - (x4 << 8); /* extract low bytes */
-        x10 = x10 + x4;     /* add with high bytes */
-        x10 = x10 + (x10 << 16); /* add with lower half word */
-
-        __asm
-        {
-            /****************/
-            RSBS    x11, dmin, x10, lsr #16;
-            ADDLSS  x8, x8, #0x10000001;
-            BLS     LOOP_SAD0;
-        }
-
-        return ((uint32)x10 >> 16);
-
-SadMBOffset3:
-
-        return sad_mb_offset3(ref, blk, lx, dmin, x8);
-
-SadMBOffset2:
-
-        return sad_mb_offset2(ref, blk, lx, dmin, x8);
-
-SadMBOffset1:
-
-        return sad_mb_offset1(ref, blk, lx, dmin, x8);
-    }
-
-
-#elif ( defined(PV_ARM_GCC_V5) || defined(PV_ARM_GCC_V4) ) /* ARM GNU COMPILER  */
-
-    __inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
-    {
-        register int32 out;
-        register int32 temp1;
-        register int32 ss = sad;
-        register int32 tt = tmp;
-        register int32 uu = tmp2;
-
-        asm volatile("rsbs  %1, %4, %3\n\t"
-                     "rsbmi %1, %1, #0\n\t"
-                     "add   %0, %2, %1"
-             : "=&r"(out),
-                     "=&r"(temp1)
-                             : "r"(ss),
-                             "r"(tt),
-                             "r"(uu));
-        return out;
-    }
-
-    __inline int32 sad_4pixel(int32 src1, int32 src2, int32 mask)
-{
-        register int32 out;
-        register int32 temp1;
-        register int32 s1 = src1;
-        register int32 s2 = src2;
-        register int32 mm = mask;
-
-        asm volatile("eor   %0, %3, %2\n\t"
-                     "subs  %1, %3, %2\n\t"
-                     "eor   %0, %0, %1\n\t"
-                     "and   %0, %4, %0, lsr #1\n\t"
-                     "orrcc %0, %0, #0x80000000\n\t"
-                     "rsb   %0, %0, %0, lsl #8\n\t"
-                     "add   %1, %1, %0, asr #7\n\t"
-                     "eor   %1, %1, %0, asr #7"
-             : "=&r"(out),
-                     "=&r"(temp1)
-                             : "r"(s1),
-                             "r"(s2),
-                             "r"(mm));
-
-        return temp1;
-    }
-
-    __inline int32 sad_4pixelN(int32 src1, int32 src2, int32 mask)
-{
-        register int32 out;
-        register int32 temp1;
-        register int32 s1 = src1;
-        register int32 s2 = src2;
-        register int32 mm = mask;
-
-        asm volatile("eor    %1, %3, %2\n\t"
-                     "adds   %0, %3, %2\n\t"
-                     "eor    %1, %1, %0\n\t"
-                     "ands   %1, %4, %1,rrx\n\t"
-                     "rsb    %1, %1, %1, lsl #8\n\t"
-                     "sub    %0, %0, %1, asr #7\n\t"
-                     "eor    %0, %0, %1, asr #7"
-             : "=&r"(out),
-                     "=&r"(temp1)
-                             : "r"(s1),
-                             "r"(s2),
-                             "r"(mm));
-
-        return (out);
-    }
-
-#define sum_accumulate asm volatile("sbc  %0, %0, %1\n\t" \
-                                "bic  %1, %4, %1\n\t" \
-                                "add  %2, %2, %1, lsr #8\n\t" \
-                                "sbc  %0, %0, %3\n\t" \
-                                "bic  %3, %4, %3\n\t" \
-                                "add  %2, %2, %3, lsr #8" \
-                                :"+r"(x5), "+r"(x10), "+r"(x4), "+r"(x11) \
-                                :"r"(x6));
-
-#define NUMBER 3
-#define SHIFT 24
-#define INC_X8 0x08000001
-
-#include "sad_mb_offset.h"
-
-#undef NUMBER
-#define NUMBER 2
-#undef SHIFT
-#define SHIFT 16
-#undef INC_X8
-#define INC_X8 0x10000001
-#include "sad_mb_offset.h"
-
-#undef NUMBER
-#define NUMBER 1
-#undef SHIFT
-#define SHIFT 8
-#undef INC_X8
-#define INC_X8 0x08000001
-#include "sad_mb_offset.h"
-
-
-    __inline int32 simd_sad_mb(UChar *ref, UChar *blk, Int dmin, Int lx)
-{
-        int32 x4, x5, x6, x8, x9, x10, x11, x12, x14;
-
-        x9 = 0x80808080; /* const. */
-        x4 = x5 = 0;
 
         x8 = (uint32)ref & 0x3;
         if (x8 == 3)
@@ -458,14 +284,22 @@ SadMBOffset1:
         if (x8 == 1)
             goto SadMBOffset1;
 
-asm volatile("mvn %0, #0xFF00": "=r"(x6));
+//  x5 = (x4<<8)-x4; /* x5 = x4*255; */
+        x4 = x5 = 0;
+
+        x6 = 0xFFFF00FF;
+
+        ref -= lx;
+        blk -= 16;
+
+        x8 = 16;
 
 LOOP_SAD0:
         /****** process 8 pixels ******/
-        x11 = *((int32*)(ref + 12));
-        x10 = *((int32*)(ref + 8));
-        x14 = *((int32*)(blk + 12));
-        x12 = *((int32*)(blk + 8));
+        x10 = *((uint32*)(ref += lx));
+        x11 = *((uint32*)(ref + 4));
+        x12 = *((uint32*)(blk += 16));
+        x14 = *((uint32*)(blk + 4));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -473,19 +307,18 @@ LOOP_SAD0:
         /* process x12 & x10 */
         x10 = sad_4pixel(x10, x12, x9);
 
-        x5 = x5 + x10;  /* accumulate low bytes */
+        x5 = x5 + x10; /* accumulate low bytes */
         x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-        x4 = x4 + ((uint32)x10 >> 8); /* accumulate high bytes */
+        x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
         x5 = x5 + x11;  /* accumulate low bytes */
         x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
         x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
-        asm volatile("ldr  %0, [%4, #4]\n\t"
-                     "ldr  %1, [%4], %6\n\t"
-                     "ldr  %2, [%5, #4]\n\t"
-                     "ldr  %3, [%5], #16"
-             : "=r"(x11), "=r"(x10), "=r"(x14), "=r"(x12), "+r"(ref), "+r"(blk)
-                             : "r"(lx));
+        /****** process 8 pixels ******/
+        x10 = *((uint32*)(ref + 8));
+        x11 = *((uint32*)(ref + 12));
+        x12 = *((uint32*)(blk + 8));
+        x14 = *((uint32*)(blk + 12));
 
         /* process x11 & x14 */
         x11 = sad_4pixel(x11, x14, x9);
@@ -527,13 +360,12 @@ SadMBOffset2:
 SadMBOffset1:
 
         return sad_mb_offset1(ref, blk, lx, dmin);
-    }
 
-#endif // OS
+    }
+#endif /*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif // _SAD_INLINE_H_
-
index 4c7b929..b054e8d 100644 (file)
@@ -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.
 /*  Modified:                                                                   */
 /*********************************************************************************/
 
-#if !defined(PV_ARM_GCC_V4) && !defined(PV_ARM_GCC_V5) /* ARM GNU COMPILER  */
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
+
+/* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=4) && (PV_COMPILER == EPV_ARM_GNUC))/* ARM GNU COMPILER  */
 
 #if (NUMBER==3)
 __inline int32 sad_mb_offset3(UChar *ref, UChar *blk, Int lx, Int dmin)
@@ -39,7 +42,6 @@ __inline int32 sad_mb_offset1(UChar *ref, UChar *blk, Int lx, Int dmin)
     x9 = 0x80808080; /* const. */
     ref -= NUMBER; /* bic ref, ref, #3 */
     ref -= lx;
-    blk -= 16;
     x8 = 16;
 
 #if (NUMBER==3)
@@ -54,13 +56,16 @@ LOOP_SAD1:
     x11 = *((uint32*)(ref + 4));    /* H G F E */
     x12 = *((uint32*)(ref + 8));    /* L K J I */
 
-    x10 = ((uint32)x10 >> SHIFT); /* 0 0 0 D */
-    x10 = x10 | (x11 << (32 - SHIFT));        /* G F E D */
-    x11 = ((uint32)x11 >> SHIFT); /* 0 0 0 H */
-    x11 = x11 | (x12 << (32 - SHIFT));        /* K J I H */
-
-    x12 = *((uint32*)(blk += 16));
-    x14 = *((uint32*)(blk + 4));
+    int32 shift = SHIFT;
+    int32 shift2 = 32 - SHIFT;
+    asm volatile("ldr  %3, [%4, #4]\n\t"
+                 "mvn  %0, %0, lsr %5\n\t"
+                 "bic  %0, %0, %1, lsl %6\n\t"
+                 "mvn  %1, %1, lsr %5\n\t"
+                 "bic  %1, %1, %2, lsl %6\n\t"
+                 "ldr  %2, [%4, #8]"
+             : "+r"(x10), "+r"(x11), "+r"(x12), "=r"(x14)
+                         : "r"(blk), "r"(shift), "r"(shift2));
 
     /* process x11 & x14 */
     x11 = sad_4pixel(x11, x14, x9);
@@ -68,25 +73,21 @@ LOOP_SAD1:
     /* process x12 & x10 */
     x10 = sad_4pixel(x10, x12, x9);
 
-    x5 = x5 + x10; /* accumulate low bytes */
-    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
-    x5 = x5 + x11;  /* accumulate low bytes */
-    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
+    sum_accumulate;
 
     /****** process 8 pixels ******/
     x10 = *((uint32*)(ref + 8)); /* D C B A */
     x11 = *((uint32*)(ref + 12));   /* H G F E */
     x12 = *((uint32*)(ref + 16));   /* L K J I */
 
-    x10 = ((uint32)x10 >> SHIFT); /* mvn x10, x10, lsr #24  = 0xFF 0xFF 0xFF ~D */
-    x10 = x10 | (x11 << (32 - SHIFT));        /* bic x10, x10, x11, lsl #8 = ~G ~F ~E ~D */
-    x11 = ((uint32)x11 >> SHIFT); /* 0xFF 0xFF 0xFF ~H */
-    x11 = x11 | (x12 << (32 - SHIFT));        /* ~K ~J ~I ~H */
-
-    x12 = *((uint32*)(blk + 8));
-    x14 = *((uint32*)(blk + 12));
+    asm volatile("ldr  %3, [%4, #4]\n\t"
+                 "mvn  %0, %0, lsr %5\n\t"
+                 "bic  %0, %0, %1, lsl %6\n\t"
+                 "mvn  %1, %1, lsr %5\n\t"
+                 "bic  %1, %1, %2, lsl %6\n\t"
+                 "ldr  %2, [%4, #8]"
+             : "+r"(x10), "+r"(x11), "+r"(x12), "=r"(x14)
+                         : "r"(blk), "r"(shift), "r"(shift2));
 
     /* process x11 & x14 */
     x11 = sad_4pixel(x11, x14, x9);
@@ -94,12 +95,7 @@ LOOP_SAD1:
     /* process x12 & x10 */
     x10 = sad_4pixel(x10, x12, x9);
 
-    x5 = x5 + x10; /* accumulate low bytes */
-    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
-    x5 = x5 + x11;  /* accumulate low bytes */
-    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
-    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
+    sum_accumulate;
 
     /****************/
     x10 = x5 - (x4 << 8); /* extract low bytes */
@@ -124,101 +120,9 @@ LOOP_SAD1:
     return ((uint32)x10 >> 16);
 }
 
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-#if (NUMBER==3)
-__inline int32 sad_mb_offset3(UChar *ref, UChar *blk, Int lx, Int dmin, int32 x8)
-#elif (NUMBER==2)
-__inline int32 sad_mb_offset2(UChar *ref, UChar *blk, Int lx, Int dmin, int32 x8)
-#elif (NUMBER==1)
-__inline int32 sad_mb_offset1(UChar *ref, UChar *blk, Int lx, Int dmin, int32 x8)
-#endif
-{
-    int32 x4, x5, x6, x9, x10, x11, x12, x14;
-
-    x9 = 0x80808080; /* const. */
-    x4 = x5 = 0;
-
-    __asm{
-        MVN      x6, #0xff0000;
-        BIC      ref, ref, #3;
-
-#if (NUMBER==3)
-LOOP_SAD3:
-#elif (NUMBER==2)
-LOOP_SAD2:
-#elif (NUMBER==1)
-LOOP_SAD1:
-#endif
-    }
-    /****** process 8 pixels ******/
-    x11 = *((int32*)(ref + 12));
-    x12 = *((int32*)(ref + 16));
-    x10 = *((int32*)(ref + 8));
-    x14 = *((int32*)(blk + 12));
-
-    __asm{
-        MVN      x10, x10, lsr #SHIFT;
-        BIC      x10, x10, x11, lsl #(32-SHIFT);
-        MVN      x11, x11, lsr #SHIFT;
-        BIC      x11, x11, x12, lsl #(32-SHIFT);
-
-        LDR      x12, [blk, #8];
-    }
-
-    /* process x11 & x14 */
-    x11 = sad_4pixelN(x11, x14, x9);
-
-    /* process x12 & x10 */
-    x10 = sad_4pixelN(x10, x12, x9);
-
-    sum_accumulate;
-
-    __asm{
-        /****** process 8 pixels ******/
-        LDR      x11, [ref, #4];
-        LDR      x12, [ref, #8];
-        LDR  x10, [ref], lx ;
-        LDR  x14, [blk, #4];
-
-        MVN      x10, x10, lsr #SHIFT;
-        BIC      x10, x10, x11, lsl #(32-SHIFT);
-        MVN      x11, x11, lsr #SHIFT;
-        BIC      x11, x11, x12, lsl #(32-SHIFT);
-
-        LDR      x12, [blk], #16;
-    }
-
-    /* process x11 & x14 */
-    x11 = sad_4pixelN(x11, x14, x9);
-
-    /* process x12 & x10 */
-    x10 = sad_4pixelN(x10, x12, x9);
-
-    sum_accumulate;
-
-    /****************/
-    x10 = x5 - (x4 << 8); /* extract low bytes */
-    x10 = x10 + x4;     /* add with high bytes */
-    x10 = x10 + (x10 << 16); /* add with lower half word */
-
-    __asm{
-        RSBS     x11, dmin, x10, lsr #16
-        ADDLSS   x8, x8, #INC_X8
-#if (NUMBER==3)
-        BLS      LOOP_SAD3;
-#elif (NUMBER==2)
-BLS      LOOP_SAD2;
-#elif (NUMBER==1)
-BLS      LOOP_SAD1;
-#endif
-    }
-
-    return ((uint32)x10 >> 16);
-}
-
-#elif ( defined(PV_ARM_GCC_V5) || defined(PV_ARM_GCC_V4) ) /* ARM GNU COMPILER  */
 
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
+/*C Equivalent code*/
 #if (NUMBER==3)
 __inline int32 sad_mb_offset3(UChar *ref, UChar *blk, Int lx, Int dmin)
 #elif (NUMBER==2)
@@ -235,6 +139,7 @@ __inline int32 sad_mb_offset1(UChar *ref, UChar *blk, Int lx, Int dmin)
     x9 = 0x80808080; /* const. */
     ref -= NUMBER; /* bic ref, ref, #3 */
     ref -= lx;
+    blk -= 16;
     x8 = 16;
 
 #if (NUMBER==3)
@@ -249,16 +154,13 @@ LOOP_SAD1:
     x11 = *((uint32*)(ref + 4));    /* H G F E */
     x12 = *((uint32*)(ref + 8));    /* L K J I */
 
-    int32 shift = SHIFT;
-    int32 shift2 = 32 - SHIFT;
-    asm volatile("ldr  %3, [%4, #4]\n\t"
-                 "mvn  %0, %0, lsr %5\n\t"
-                 "bic  %0, %0, %1, lsl %6\n\t"
-                 "mvn  %1, %1, lsr %5\n\t"
-                 "bic  %1, %1, %2, lsl %6\n\t"
-                 "ldr  %2, [%4, #8]"
-             : "+r"(x10), "+r"(x11), "+r"(x12), "=r"(x14)
-                         : "r"(blk), "r"(shift), "r"(shift2));
+    x10 = ((uint32)x10 >> SHIFT); /* 0 0 0 D */
+    x10 = x10 | (x11 << (32 - SHIFT));        /* G F E D */
+    x11 = ((uint32)x11 >> SHIFT); /* 0 0 0 H */
+    x11 = x11 | (x12 << (32 - SHIFT));        /* K J I H */
+
+    x12 = *((uint32*)(blk += 16));
+    x14 = *((uint32*)(blk + 4));
 
     /* process x11 & x14 */
     x11 = sad_4pixel(x11, x14, x9);
@@ -266,21 +168,25 @@ LOOP_SAD1:
     /* process x12 & x10 */
     x10 = sad_4pixel(x10, x12, x9);
 
-    sum_accumulate;
+    x5 = x5 + x10; /* accumulate low bytes */
+    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+    x5 = x5 + x11;  /* accumulate low bytes */
+    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
     /****** process 8 pixels ******/
     x10 = *((uint32*)(ref + 8)); /* D C B A */
     x11 = *((uint32*)(ref + 12));   /* H G F E */
     x12 = *((uint32*)(ref + 16));   /* L K J I */
 
-    asm volatile("ldr  %3, [%4, #4]\n\t"
-                 "mvn  %0, %0, lsr %5\n\t"
-                 "bic  %0, %0, %1, lsl %6\n\t"
-                 "mvn  %1, %1, lsr %5\n\t"
-                 "bic  %1, %1, %2, lsl %6\n\t"
-                 "ldr  %2, [%4, #8]"
-             : "+r"(x10), "+r"(x11), "+r"(x12), "=r"(x14)
-                         : "r"(blk), "r"(shift), "r"(shift2));
+    x10 = ((uint32)x10 >> SHIFT); /* mvn x10, x10, lsr #24  = 0xFF 0xFF 0xFF ~D */
+    x10 = x10 | (x11 << (32 - SHIFT));        /* bic x10, x10, x11, lsl #8 = ~G ~F ~E ~D */
+    x11 = ((uint32)x11 >> SHIFT); /* 0xFF 0xFF 0xFF ~H */
+    x11 = x11 | (x12 << (32 - SHIFT));        /* ~K ~J ~I ~H */
+
+    x12 = *((uint32*)(blk + 8));
+    x14 = *((uint32*)(blk + 12));
 
     /* process x11 & x14 */
     x11 = sad_4pixel(x11, x14, x9);
@@ -288,7 +194,12 @@ LOOP_SAD1:
     /* process x12 & x10 */
     x10 = sad_4pixel(x10, x12, x9);
 
-    sum_accumulate;
+    x5 = x5 + x10; /* accumulate low bytes */
+    x10 = x10 & (x6 << 8); /* x10 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x10 >> 8);  /* accumulate high bytes */
+    x5 = x5 + x11;  /* accumulate low bytes */
+    x11 = x11 & (x6 << 8); /* x11 & 0xFF00FF00 */
+    x4 = x4 + ((uint32)x11 >> 8);  /* accumulate high bytes */
 
     /****************/
     x10 = x5 - (x4 << 8); /* extract low bytes */
@@ -312,6 +223,4 @@ goto         LOOP_SAD1;
 
     return ((uint32)x10 >> 16);
 }
-
-#endif
-
+#endif/*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
index 59d5e24..7b0304f 100644 (file)
@@ -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.
 #ifndef _VLC_ENCODE_INLINE_H_
 #define _VLC_ENCODE_INLINE_H_
 
-#if !defined(PV_ARM_GCC_V5)
+#include "oscl_base_macros.h"// has integer values of PV_COMPILER
 
-__inline  Int zero_run_search(UInt *bitmapzz, Short *dataBlock, RunLevelBlock *RLB, Int nc)
-{
-    Int idx, run, level, j;
-    UInt end, match;
-
-    idx = 0;
-    j   = 0;
-    run = 0;
-    match = 1 << 31;
-    if (nc > 32)
-        end = 1;
-    else
-        end = 1 << (32 - nc);
-
-    while (match >= end)
-    {
-        if ((match&bitmapzz[0]) == 0)
-        {
-            run++;
-            j++;
-            match >>= 1;
-        }
-        else
-        {
-            match >>= 1;
-            level = dataBlock[j];
-            dataBlock[j] = 0; /* reset output */
-            j++;
-            if (level < 0)
-            {
-                RLB->level[idx] = -level;
-                RLB->s[idx] = 1;
-                RLB->run[idx] = run;
-                run = 0;
-                idx++;
-            }
-            else
-            {
-                RLB->level[idx] = level;
-                RLB->s[idx] = 0;
-                RLB->run[idx] = run;
-                run = 0;
-                idx++;
-            }
-        }
-    }
-    nc -= 32;
-    if (nc > 0)
-    {
-        match = 1 << 31;
-        end = 1 << (32 - nc);
-        while (match >= end)
-        {
-            if ((match&bitmapzz[1]) == 0)
-            {
-                run++;
-                j++;
-                match >>= 1;
-            }
-            else
-            {
-                match >>= 1;
-                level = dataBlock[j];
-                dataBlock[j] = 0; /* reset output */
-                j++;
-                if (level < 0)
-                {
-                    RLB->level[idx] = -level;
-                    RLB->s[idx] = 1;
-                    RLB->run[idx] = run;
-                    run = 0;
-                    idx++;
-                }
-                else
-                {
-                    RLB->level[idx] = level;
-                    RLB->s[idx] = 0;
-                    RLB->run[idx] = run;
-                    run = 0;
-                    idx++;
-                }
-            }
-        }
-    }
-
-    return idx;
-}
-
-#elif defined(__CC_ARM)  /* only work with arm v5 */
-
-__inline  Int zero_run_search(UInt *bitmapzz, Short *dataBlock, RunLevelBlock *RLB, Int nc)
-{
-    OSCL_UNUSED_ARG(nc);
-    Int idx, run, level, j;
-    UInt end, match;
-    Int  zzorder;
-
-    idx = 0;
-    run = 0;
-    j   = -1;
-    __asm
-    {
-        ldr match, [bitmapzz]
-        clz run, match
-    }
-
-    zzorder = 0;
-
-    while (run < 32)
-    {
-        __asm
-        {
-            mov end, #0x80000000
-            mov end, end, lsr run   /* mask*/
-            bic match, match, end       /* remove it from bitmap */
-            mov run, run, lsl #1  /* 05/09/02 */
-            ldrsh level, [dataBlock, run] /*  load data */
-            strh zzorder, [dataBlock, run] /* reset output */
-            add j, j, #1
-            rsb run, j, run, lsr #1 /* delta run */
-            add j, j, run           /* current position */
-        }
-        if (level < 0)
-        {
-            RLB->level[idx] = -level;
-            RLB->s[idx] = 1;
-            RLB->run[idx] = run;
-            run = 0;
-            idx++;
-        }
-        else
-        {
-            RLB->level[idx] = level;
-            RLB->s[idx] = 0;
-            RLB->run[idx] = run;
-            run = 0;
-            idx++;
-        }
-        __asm
-        {
-            clz run, match
-        }
-    }
-    __asm
-    {
-        ldr match, [bitmapzz, #4]
-        clz run, match
-    }
-
-    while (run < 32)
-    {
-        __asm
-        {
-            mov end, #0x80000000
-            mov end, end, lsr run   /* mask*/
-            bic match, match, end       /* remove it from bitmap */
-            add run, run, #32       /* current position */
-            mov run, run, lsl #1    /* 09/02/05 */
-            ldrsh level, [dataBlock, run] /*  load data */
-            strh  zzorder, [dataBlock, run] /* reset output */
-            add j, j, #1
-            rsb run, j, run, lsr #1     /* delta run */
-            add j, j, run           /* current position */
-        }
-        if (level < 0)
-        {
-            RLB->level[idx] = -level;
-            RLB->s[idx] = 1;
-            RLB->run[idx] = run;
-            run = 0;
-            idx++;
-        }
-        else
-        {
-            RLB->level[idx] = level;
-            RLB->s[idx] = 0;
-            RLB->run[idx] = run;
-            run = 0;
-            idx++;
-        }
-        __asm
-        {
-            clz run, match
-        }
-    }
-
-    return idx;
-}
-
-#elif (defined(PV_ARM_GCC_V5) ) /* ARM GNU COMPILER  */
+#if   ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* ARM GNU COMPILER  */
 
 __inline Int m4v_enc_clz(UInt temp)
 {
@@ -309,7 +120,98 @@ __inline  Int zero_run_search(UInt *bitmapzz, Short *dataBlock, RunLevelBlock *R
     return idx;
 }
 
-#endif
+#else/*#else for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
+/*C Equivalent code*/
+__inline  Int zero_run_search(UInt *bitmapzz, Short *dataBlock, RunLevelBlock *RLB, Int nc)
+{
+    Int idx, run, level, j;
+    UInt end, match;
+
+    idx = 0;
+    j   = 0;
+    run = 0;
+    match = 1 << 31;
+    if (nc > 32)
+        end = 1;
+    else
+        end = 1 << (32 - nc);
+
+    while (match >= end)
+    {
+        if ((match&bitmapzz[0]) == 0)
+        {
+            run++;
+            j++;
+            match >>= 1;
+        }
+        else
+        {
+            match >>= 1;
+            level = dataBlock[j];
+            dataBlock[j] = 0; /* reset output */
+            j++;
+            if (level < 0)
+            {
+                RLB->level[idx] = -level;
+                RLB->s[idx] = 1;
+                RLB->run[idx] = run;
+                run = 0;
+                idx++;
+            }
+            else
+            {
+                RLB->level[idx] = level;
+                RLB->s[idx] = 0;
+                RLB->run[idx] = run;
+                run = 0;
+                idx++;
+            }
+        }
+    }
+    nc -= 32;
+    if (nc > 0)
+    {
+        match = 1 << 31;
+        end = 1 << (32 - nc);
+        while (match >= end)
+        {
+            if ((match&bitmapzz[1]) == 0)
+            {
+                run++;
+                j++;
+                match >>= 1;
+            }
+            else
+            {
+                match >>= 1;
+                level = dataBlock[j];
+                dataBlock[j] = 0; /* reset output */
+                j++;
+                if (level < 0)
+                {
+                    RLB->level[idx] = -level;
+                    RLB->s[idx] = 1;
+                    RLB->run[idx] = run;
+                    run = 0;
+                    idx++;
+                }
+                else
+                {
+                    RLB->level[idx] = level;
+                    RLB->s[idx] = 0;
+                    RLB->run[idx] = run;
+                    run = 0;
+                    idx++;
+                }
+            }
+        }
+    }
+
+    return idx;
+}
+
+
+#endif/*#endif for ((PV_CPU_ARCH_VERSION>=4) && (PV_COMPILER==EPV_ARM_RVCT))*/
 
 #endif // _VLC_ENCODE_INLINE_H_
 
index 0be75a6..f70dab0 100644 (file)
@@ -17,7 +17,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv2wayengine
 
-LOCAL_CFLAGS := -DSIP_VOIP_PROJECT=1 -DPV2WAY_USE_OMX  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DSIP_VOIP_PROJECT=1 -DPV2WAY_USE_OMX -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 72ecbff..67f1653 100644 (file)
@@ -25,7 +25,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv2waysample
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 2b8f24a..a1b7ec4 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "CORE_8.508.1.1"
-#define PV2WAY_ENGINE_SDKINFO_DATE 0x20100401
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1359188"
+#define PV2WAY_ENGINE_SDKINFO_DATE 0x20100405
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index ef6d2ca..f94129b 100644 (file)
@@ -12,7 +12,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvframemetadatautility
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 7d40f5a..e93f737 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvauthorengine
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 5cbf4e2..66af29c 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "CORE_8.508.1.1"
-#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20100401
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1359188"
+#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20100405
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index 526e29a..ab403d8 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0544424..8a6268f 100644 (file)
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvplayer_engine
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4131456..c6ac42d 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "CORE_8.508.1.1"
-#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100401
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1359188"
+#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100405
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
index 4e31268..581b91a 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmetadata_engine
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index a7100f4..66da6fe 100644 (file)
@@ -12,7 +12,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvavifileparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index bbf14f6..f35af19 100644 (file)
@@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvfileparserutils
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 044832d..c5bc1a4 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvid3parcom
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index cd75eaf..92b70d2 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp3ff
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6793bf1..47750d7 100644 (file)
@@ -84,7 +84,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4ffcomposer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index b5e46d3..885939e 100644 (file)
@@ -98,7 +98,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4ff
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 292ce47..6f4e4d2 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libmp4recognizer_utility
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 08ddb94..2b13dd8 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvpvxparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e32b5f5..20b873f 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvaacparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index eef46e2..46217fe 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvgsmamrparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 1992c52..0489d66 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libscsp
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 9da0cec..5d4aff3 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvwav
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 06d9a83..5f491e2 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvoma1passthruplugininterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index eca8247..3bc97bc 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvdownloadinterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 9eb7907..0eacb4d 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvdownloadreginterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6e6aa78..cebc9d2 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4interface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index f3fa1f3..a199a72 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4reginterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 138411c..6d1f874 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsminterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0d9423d..5501455 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsmreginterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 5ea19fc..a420cc7 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsmrtsptstreamingplugin
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 05e585d..5e4d197 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsmrtsptstreamingpluginreg
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d837066..abc27c2 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvrtspsmplugininterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index c1d6b4a..95ddc5f 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvrtspsmpluginreginterface
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 7555588..a3c3bc6 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index c227cbd..c1702aa 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvaacffparsernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 80dccdf..a0e7f69 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvamrffparsernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index eb87d0d..e07df94 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvclientserversocketnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4cb7596..4c44922 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvcommsionode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6b2de2f..3e70e89 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvdownloadmanagernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index dc38ca6..a973256 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvfileoutputnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6ed0e28..c5b99f6 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmediainputnode
 
-LOCAL_CFLAGS := -DTEXT_TRACK_DESC_INFO -D_TEST_AE_ERROR_HANDLING  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DTEXT_TRACK_DESC_INFO -D_TEST_AE_ERROR_HANDLING -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e83ab6d..755e2e5 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmediaoutputnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 05ddd0a..1d6287f 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp3ffparsernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e5a774e..5ac1ca0 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4ffcomposernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6f73a80..b22aa44 100644 (file)
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4ffparsernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index da9e867..0d62adc 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvomxaudiodecnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e549bd7..e56d0cc 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvomxbasedecnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e536ce9..c1ed0a2 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvomxencnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index db2a1fc..7200051 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvomxvideodecnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 8a6d1a2..3b39e28 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_base
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 283efac..f91503b 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_download_common
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0fd33ae..9d1c2a3 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_pdl
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 268ad62..83148d6 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_ps
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 382b227..fac33e1 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_shoutcast
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 67ae300..c9131f5 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libprotocolenginenode_common
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d1b3214..bebcad7 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsocketnode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e2e574f..ff91052 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvwavffparsernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 40fde68..8eb9750 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvjitterbuffernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0a47a82..d1548be 100644 (file)
@@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvjitterbuffer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index e31c313..4436fe0 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvjitterbufferrtp
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 8449753..cf76311 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvstreamingmanagernode
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 7f05c67..9a49424 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsmfspcommon
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d1874f3..7606850 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvrtsptunicaststreamingmanager
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0364a27..91fb859 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvrtspunicaststreamingmanager
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index adf3311..0e11b6a 100644 (file)
@@ -23,7 +23,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclbase
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 7902996..30fc868 100644 (file)
@@ -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.
 #endif
 
 
+/* The following macros enumerate the possible values of the build flag PV_COMPILER */
+
+#define EPV_ARM_GNUC  1 /* for GNU compiler */
+#define EPV_ARM_RVCT  2 /* for RVCT compiler from ARM */
+#define EPV_ARM_MSEVC 3 /* for MS Embedded VC compiler */
+
+/* PV_COMPILER value must be set to build command.
+   In addition, PV_CPU_ARCH_VERSION must be defined to take on an integer value that specifies the version of target
+   ARM architecture. */
+
+
 /*! @} */
 
 #endif  // OSCL_BASE_MACROS_H_INCLUDED
index 90c7fd0..9bd9914 100644 (file)
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclerror
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index ebde742..caf1f4d 100644 (file)
@@ -43,7 +43,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclio
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 469c209..90bb873 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := liboscllib
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 3926f4c..72c77b1 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclmemory
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 91077e6..1fdfbc1 100644 (file)
@@ -18,7 +18,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclproc
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index f216630..4a73de1 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclregcli
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index ea3f6a1..7c3eba5 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclregserv
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 99be62c..564759d 100644 (file)
@@ -19,7 +19,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libosclutil
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index c36e524..57fceff 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvlogger
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 051900f..987e065 100644 (file)
@@ -14,7 +14,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libunit_test
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d307bfe..d70262c 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_http_parcom
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 5e409ec..8e2d0e2 100644 (file)
@@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := librtprtcp
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 4f99d13..1106dd6 100644 (file)
@@ -20,7 +20,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := librtppayloadparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 3f884e4..2388062 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvlatmpayloadparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 2f6abec..d570111 100644 (file)
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvrtsp_cli_eng_node
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 58a04f5..3d859a3 100644 (file)
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv_rtsp_parcom
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 1d27a0d..c90d19d 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0b882ee..79b58a3 100644 (file)
@@ -22,7 +22,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvsdpparser
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index a0040c4..9b0de16 100644 (file)
@@ -62,7 +62,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpv324m
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 5a9a8dc..d769039 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 6883073..030c692 100644 (file)
@@ -15,7 +15,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvgeneraltools
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 9edff77..47e46f7 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libcpm
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 91a2bd2..d2a0ab5 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 44254c0..febdb47 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvoma1passthruplugin
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index dfa61ed..2e3a416 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmioaviwavfileinput
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index c393d71..8bfffff 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmiofileinput
 
-LOCAL_CFLAGS := -DTEXT_TRACK_DESC_INFO  $(PV_CFLAGS)
+LOCAL_CFLAGS := -DTEXT_TRACK_DESC_INFO -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 47f8690..6397c87 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmio_comm_loopback
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index a919931..9fe0e11 100644 (file)
@@ -7,7 +7,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmiofileoutput
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 5aeeea3..c4e02b0 100644 (file)
@@ -26,7 +26,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmf
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 0a16e3b..e54b3dc 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmfrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 99a705a..88e15c4 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvaacffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d45b57a..040d892 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvamrffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 43182f2..fdb2c47 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp3ffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index d2fc4d0..f4f1299 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvmp4ffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index eab0b83..b6bc634 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvplsffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index a772806..65c9006 100644 (file)
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libpvwavffrecognizer
 
-LOCAL_CFLAGS :=   $(PV_CFLAGS)
+LOCAL_CFLAGS := -DPV_CPU_ARCH_VERSION=0  $(PV_CFLAGS)
 
 
 LOCAL_STATIC_LIBRARIES := 
index 273507c..edffbc6 100644 (file)
@@ -36,4 +36,6 @@ RSC_SRC_ABS :=
 CAPABILITIES :=
 ARMCC_MACROS :=
 ARMCC_SRC_PATH :=
-ARMCC_SRC :=
\ No newline at end of file
+ARMCC_SRC :=
+LIB_CPU_ARCH_VERSION :=
+TARGET_ARMCC :=
index 10d84f4..2d1495d 100644 (file)
@@ -68,7 +68,7 @@ $(TARGET)_libmode ?= $(DEFAULT_LIBMODE)
 $(TARGET)_libtype ?= $(DEFAULT_LIBTYPE)
 
 $(TARGET)_asm_flags ?= $(DEFAULT_CPP_ASM_FLAGS)
-XCPPFLAGS += $($(TARGET)_asm_flags) 
+XCPPFLAGS += $($(TARGET)_asm_flags)
 
 # $(info target = $(TARGET), libtype = $($(TARGET)_libtype))
 
@@ -114,6 +114,23 @@ else
   XCPPFLAGS+=$(RELEASE_CPPFLAGS)
 endif
 
+#Checking the availability of CPU_ARCH_VESION at local.mk or toolset.mk
+ifeq ($(LIB_CPU_ARCH_VERSION),)
+  PV_CPU_ARCH_VERSION := $(GLOBAL_CPU_ARCH_VERSION)
+else
+  PV_CPU_ARCH_VERSION := $(LIB_CPU_ARCH_VERSION)
+endif
+XCPPFLAGS+= -D"PV_CPU_ARCH_VERSION=$(PV_CPU_ARCH_VERSION)"
+
+#Specify Target Architecture for Symbian Compiler 
+ifeq ($(PV_CPU_ARCH_VERSION),4) 
+  TARGET_ARMCC := OPTION ARMCC --cpu 5T
+else ifeq ($(PV_CPU_ARCH_VERSION),5) 
+  TARGET_ARMCC := OPTION ARMCC --cpu 5TE
+else ifeq ($(PV_CPU_ARCH_VERSION),6) 
+  TARGET_ARMCC := OPTION ARMCC --cpu 6
+endif
+
 ifneq ($(strip $(LOCAL_EXPORT_ALL_SYMBOLS)),true)
   XCXXFLAGS += $(HIDE_INTERNAL_SYMBOLS_FLAG)
   XCFLAGS += $(HIDE_INTERNAL_SYMBOLS_FLAG)
index 443f49b..0c8f2f1 100644 (file)
@@ -1,8 +1,10 @@
 XCPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
+CPPFLAGS += -DPV_COMPILER=1
+ifeq ($(GLOBAL_CPU_ARCH_VERSION), )
+GLOBAL_CPU_ARCH_VERSION :=0
+endif
 INSTALL := install
 INSTALL_OPTS := -c -D -m 444
-
 SED := sed
 MV := mv
 RM := rm -f