diff options
author | Android Chromium Automerger <chromium-automerger@android> | 2014-10-15 17:08:46 +0000 |
---|---|---|
committer | Android Chromium Automerger <chromium-automerger@android> | 2014-10-15 17:08:46 +0000 |
commit | 8e8d12cec3e465894a47d4325c69a138da72d2a9 (patch) | |
tree | d595bd241574e65c58e41aa3edd81fc24be9e2a5 /common_audio | |
parent | c7266552448a93132e75d0c08eb847a8e9735065 (diff) | |
parent | 7da30673d742075b52c63bb96b78f2c35cc93991 (diff) | |
download | webrtc-8e8d12cec3e465894a47d4325c69a138da72d2a9.tar.gz |
Merge third_party/webrtc from https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git at 7da30673d742075b52c63bb96b78f2c35cc93991
This commit was generated by merge_from_chromium.py.
Change-Id: I6ae37fb65fc9bcff451322ab8e1f52b667dc5d10
Diffstat (limited to 'common_audio')
-rw-r--r-- | common_audio/BUILD.gn | 25 | ||||
-rw-r--r-- | common_audio/common_audio.gyp | 8 | ||||
-rw-r--r-- | common_audio/signal_processing/include/signal_processing_library.h | 2 | ||||
-rw-r--r-- | common_audio/signal_processing/refl_coef_to_lpc.c | 4 | ||||
-rw-r--r-- | common_audio/signal_processing/signal_processing_unittest.cc | 2 | ||||
-rw-r--r-- | common_audio/signal_processing/spl_sqrt.c | 12 | ||||
-rw-r--r-- | common_audio/vad/vad_core.c | 6 |
7 files changed, 24 insertions, 35 deletions
diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn index 36740e87..9091c42a 100644 --- a/common_audio/BUILD.gn +++ b/common_audio/BUILD.gn @@ -90,21 +90,16 @@ source_set("common_audio") { deps = [ "../system_wrappers" ] - # TODO(ajm): Enable when GN support for openmax_dl is added. - # See: crbug.com/419206 - # Not needed immediately, since nothing built by GN depends on these bits. - # TODO(ajm): Workaround until openmax_dl has non-Android ARM support. - # See: crbug.com/415393 - #if (cpu_arch != "arm" or (cpu_arch == "arm" and is_android)) { - # 'sources' += [ - # 'lapped_transform.cc', - # 'lapped_transform.h', - # 'real_fourier.cc', - # 'real_fourier.h', - # ] - # - # deps += [ "//third_party/openmax_dl/dl" ] - #} + if (rtc_use_openmax_dl) { + sources += [ + "lapped_transform.cc", + "lapped_transform.h", + "real_fourier.cc", + "real_fourier.h", + ] + + deps += [ "//third_party/openmax_dl/dl" ] + } if (cpu_arch == "arm") { sources += [ diff --git a/common_audio/common_audio.gyp b/common_audio/common_audio.gyp index 4581f588..9378f729 100644 --- a/common_audio/common_audio.gyp +++ b/common_audio/common_audio.gyp @@ -102,9 +102,7 @@ 'window_generator.h', ], 'conditions': [ - # TODO(ajm): Workaround until openmax_dl has non-Android ARM support. - # See: crbug.com/415393 - ['target_arch!="arm" or (target_arch=="arm" and OS=="android")', { + ['rtc_use_openmax_dl==1', { 'sources': [ 'lapped_transform.cc', 'lapped_transform.h', @@ -247,9 +245,7 @@ 'window_generator_unittest.cc', ], 'conditions': [ - # TODO(ajm): Workaround until openmax_dl has non-Android ARM - # support. See: crbug.com/415393 - ['target_arch!="arm" or (target_arch=="arm" and OS=="android")', { + ['rtc_use_openmax_dl==1', { 'sources': [ 'lapped_transform_unittest.cc', 'real_fourier_unittest.cc', diff --git a/common_audio/signal_processing/include/signal_processing_library.h b/common_audio/signal_processing/include/signal_processing_library.h index ba306ed3..ad95386f 100644 --- a/common_audio/signal_processing/include/signal_processing_library.h +++ b/common_audio/signal_processing/include/signal_processing_library.h @@ -89,8 +89,6 @@ // Shifting with negative numbers not allowed // We cannot do casting here due to signed/unsigned problem -#define WEBRTC_SPL_RSHIFT_W16(x, c) ((x) >> (c)) -#define WEBRTC_SPL_LSHIFT_W16(x, c) ((x) << (c)) #define WEBRTC_SPL_RSHIFT_W32(x, c) ((x) >> (c)) #define WEBRTC_SPL_LSHIFT_W32(x, c) ((x) << (c)) diff --git a/common_audio/signal_processing/refl_coef_to_lpc.c b/common_audio/signal_processing/refl_coef_to_lpc.c index 3d81778c..17055c9c 100644 --- a/common_audio/signal_processing/refl_coef_to_lpc.c +++ b/common_audio/signal_processing/refl_coef_to_lpc.c @@ -27,7 +27,7 @@ void WebRtcSpl_ReflCoefToLpc(const int16_t *k, int use_order, int16_t *a) kptr = k; *a = 4096; // i.e., (Word16_MAX >> 3)+1. *any = *a; - a[1] = WEBRTC_SPL_RSHIFT_W16((*k), 3); + a[1] = *k >> 3; for (m = 1; m < use_order; m++) { @@ -38,7 +38,7 @@ void WebRtcSpl_ReflCoefToLpc(const int16_t *k, int use_order, int16_t *a) anyptr = any; anyptr++; - any[m + 1] = WEBRTC_SPL_RSHIFT_W16((*kptr), 3); + any[m + 1] = *kptr >> 3; for (i = 0; i < m; i++) { *anyptr = (*aptr) diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc index d5cc5f07..09518a9d 100644 --- a/common_audio/signal_processing/signal_processing_unittest.cc +++ b/common_audio/signal_processing/signal_processing_unittest.cc @@ -66,8 +66,6 @@ TEST_F(SplTest, MacroTest) { // Shifting with negative numbers not allowed // We cannot do casting here due to signed/unsigned problem - EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W16(a, 1)); - EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W16(a, 1)); EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W32(a, 1)); EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W32(a, 1)); diff --git a/common_audio/signal_processing/spl_sqrt.c b/common_audio/signal_processing/spl_sqrt.c index d4f808ca..fff73c03 100644 --- a/common_audio/signal_processing/spl_sqrt.c +++ b/common_audio/signal_processing/spl_sqrt.c @@ -17,6 +17,8 @@ #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" +#include <assert.h> + int32_t WebRtcSpl_SqrtLocal(int32_t in); int32_t WebRtcSpl_SqrtLocal(int32_t in) @@ -154,15 +156,15 @@ int32_t WebRtcSpl_Sqrt(int32_t value) x_norm = (int16_t)WEBRTC_SPL_RSHIFT_W32(A, 16); // x_norm = AH - nshift = WEBRTC_SPL_RSHIFT_W16(sh, 1); // nshift = sh>>1 - nshift = -nshift; // Negate the power for later de-normalization + nshift = (sh / 2); + assert(nshift >= 0); A = (int32_t)WEBRTC_SPL_LSHIFT_W32((int32_t)x_norm, 16); A = WEBRTC_SPL_ABS_W32(A); // A = abs(x_norm<<16) A = WebRtcSpl_SqrtLocal(A); // A = sqrt(A) - if ((-2 * nshift) == sh) - { // Even shift value case + if (2 * nshift == sh) { + // Even shift value case t16 = (int16_t)WEBRTC_SPL_RSHIFT_W32(A, 16); // t16 = AH @@ -178,7 +180,7 @@ int32_t WebRtcSpl_Sqrt(int32_t value) } A = A & ((int32_t)0x0000ffff); - A = (int32_t)WEBRTC_SPL_SHIFT_W32(A, nshift); // De-normalize the result + A >>= nshift; // De-normalize the result. return A; } diff --git a/common_audio/vad/vad_core.c b/common_audio/vad/vad_core.c index 98da6eaf..6ebe65d8 100644 --- a/common_audio/vad/vad_core.c +++ b/common_audio/vad/vad_core.c @@ -639,10 +639,10 @@ int WebRtcVad_CalcVad32khz(VadInstT* inst, const int16_t* speech_frame, // Downsample signal 32->16->8 before doing VAD WebRtcVad_Downsampling(speech_frame, speechWB, &(inst->downsampling_filter_states[2]), frame_length); - len = WEBRTC_SPL_RSHIFT_W16(frame_length, 1); + len = frame_length / 2; WebRtcVad_Downsampling(speechWB, speechNB, inst->downsampling_filter_states, len); - len = WEBRTC_SPL_RSHIFT_W16(len, 1); + len /= 2; // Do VAD on an 8 kHz signal vad = WebRtcVad_CalcVad8khz(inst, speechNB, len); @@ -660,7 +660,7 @@ int WebRtcVad_CalcVad16khz(VadInstT* inst, const int16_t* speech_frame, WebRtcVad_Downsampling(speech_frame, speechNB, inst->downsampling_filter_states, frame_length); - len = WEBRTC_SPL_RSHIFT_W16(frame_length, 1); + len = frame_length / 2; vad = WebRtcVad_CalcVad8khz(inst, speechNB, len); return vad; |