Bug 814693 - Allow webrtc to build on more architectures. r=jesup
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 01 Dec 2012 09:55:48 +0100
changeset 115029 ea3ca2b1bd7f5cdb0701993bf6cb43007d13a6b1
parent 115028 391f2a5983688033b2793674e845dc944ec40377
child 115030 c8f9d0908bc8c15e7bb9a47ad58f7d8bf68b8b11
push id19117
push usermh@glandium.org
push dateWed, 05 Dec 2012 08:27:52 +0000
treeherdermozilla-inbound@96995cdf0682 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs814693
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 814693 - Allow webrtc to build on more architectures. r=jesup
media/webrtc/trunk/src/modules/audio_coding/codecs/pcm16b/pcm16b.c
media/webrtc/trunk/src/typedefs.h
--- a/media/webrtc/trunk/src/modules/audio_coding/codecs/pcm16b/pcm16b.c
+++ b/media/webrtc/trunk/src/modules/audio_coding/codecs/pcm16b/pcm16b.c
@@ -10,32 +10,28 @@
 
 
 #include "pcm16b.h"
 
 #include <stdlib.h>
 
 #include "typedefs.h"
 
-#ifdef WEBRTC_BIG_ENDIAN
-#include "signal_processing_library.h"
-#endif
-
 #define HIGHEND 0xFF00
 #define LOWEND    0xFF
 
 
 
 /* Encoder with WebRtc_Word16 Output */
 WebRtc_Word16 WebRtcPcm16b_EncodeW16(WebRtc_Word16 *speechIn16b,
                                      WebRtc_Word16 len,
                                      WebRtc_Word16 *speechOut16b)
 {
 #ifdef WEBRTC_BIG_ENDIAN
-    WEBRTC_SPL_MEMCPY_W16(speechOut16b, speechIn16b, len);
+    memcpy(speechOut16b, speechIn16b, len * sizeof(WebRtc_Word16));
 #else
     int i;
     for (i=0;i<len;i++) {
         speechOut16b[i]=(((WebRtc_UWord16)speechIn16b[i])>>8)|((((WebRtc_UWord16)speechIn16b[i])<<8)&0xFF00);
     }
 #endif
     return(len<<1);
 }
@@ -64,17 +60,17 @@ WebRtc_Word16 WebRtcPcm16b_Encode(WebRtc
 /* Decoder with WebRtc_Word16 Input instead of char when the WebRtc_Word16 Encoder is used */
 WebRtc_Word16 WebRtcPcm16b_DecodeW16(void *inst,
                                      WebRtc_Word16 *speechIn16b,
                                      WebRtc_Word16 len,
                                      WebRtc_Word16 *speechOut16b,
                                      WebRtc_Word16* speechType)
 {
 #ifdef WEBRTC_BIG_ENDIAN
-    WEBRTC_SPL_MEMCPY_W8(speechOut16b, speechIn16b, ((len*sizeof(WebRtc_Word16)+1)>>1));
+    memcpy(speechOut16b, speechIn16b, ((len*sizeof(WebRtc_Word16)+1)>>1));
 #else
     int i;
     int samples=len>>1;
 
     for (i=0;i<samples;i++) {
         speechOut16b[i]=(((WebRtc_UWord16)speechIn16b[i])>>8)|(((WebRtc_UWord16)(speechIn16b[i]&0xFF))<<8);
     }
 #endif
--- a/media/webrtc/trunk/src/typedefs.h
+++ b/media/webrtc/trunk/src/typedefs.h
@@ -52,16 +52,80 @@
 //#define WEBRTC_ARCH_ARMEL
 #define WEBRTC_ARCH_32_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN
 #define WEBRTC_LITTLE_ENDIAN
 #elif defined(__MIPSEL__)
 #define WEBRTC_ARCH_32_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN
 #define WEBRTC_LITTLE_ENDIAN
+#elif defined(__powerpc64__)
+#define WEBRTC_ARCH_PPC64 1
+#define WEBRTC_ARCH_64_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__ppc__) || defined(__powerpc__)
+#define WEBRTC_ARCH_PPC 1
+#define WEBRTC_ARCH_32_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__sparc64__)
+#define WEBRTC_ARCH_SPARC 1
+#define WEBRTC_ARCH_64_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__sparc__)
+#define WEBRTC_ARCH_SPARC 1
+#define WEBRTC_ARCH_32_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__mips__)
+#define WEBRTC_ARCH_MIPS 1
+#if defined(_ABI64) && _MIPS_SIM == _ABI64
+#define WEBRTC_ARCH_64_BITS 1
+#else
+#define WEBRTC_ARCH_32_BITS 1
+#endif
+#if defined(__MIPSEB__)
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#else
+#define WEBRTC_ARCH_LITTLE_ENDIAN
+#define WEBRTC_LITTLE_ENDIAN
+#endif
+#elif defined(__hppa__)
+#define WEBRTC_ARCH_HPPA 1
+#define WEBRTC_ARCH_32_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__ia64__)
+#define WEBRTC_ARCH_IA64 1
+#define WEBRTC_ARCH_64_BITS 1
+#define WEBRTC_ARCH_LITTLE_ENDIAN
+#define WEBRTC_LITTLE_ENDIAN
+#elif defined(__s390x__)
+#define WEBRTC_ARCH_S390X 1
+#define WEBRTC_ARCH_64_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__s390__)
+#define WEBRTC_ARCH_S390 1
+#define WEBRTC_ARCH_32_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
+#elif defined(__alpha__)
+#define WEBRTC_ARCH_ALPHA 1
+#define WEBRTC_ARCH_64_BITS 1
+#define WEBRTC_ARCH_LITTLE_ENDIAN
+#define WEBRTC_LITTLE_ENDIAN
+#elif defined(__avr32__)
+#define WEBRTC_ARCH_AVR32 1
+#define WEBRTC_ARCH_32_BITS 1
+#define WEBRTC_ARCH_BIG_ENDIAN
+#define WEBRTC_BIG_ENDIAN
 #else
 #error Please add support for your architecture in typedefs.h
 #endif
 
 #if defined(__SSE2__) || defined(_MSC_VER)
 #define WEBRTC_USE_SSE2
 #endif