Commit 4d764a17 authored by Arun Raghavan's avatar Arun Raghavan
Browse files

Update code to upstream revision r789

Very minor changes.
parent 693d686b
# Revision changelog (version - date, svn rev. from upstream that was merged) # Revision changelog (version - date, svn rev. from upstream that was merged)
# 0.1 - 19 Oct 2011, r767 # 0.1 - 21 Oct 2011, r789
AC_INIT([webrtc-audio-processing], [0.1]) AC_INIT([webrtc-audio-processing], [0.1])
AM_INIT_AUTOMAKE([tar-ustar]) AM_INIT_AUTOMAKE([tar-ustar])
......
...@@ -736,6 +736,7 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std) { ...@@ -736,6 +736,7 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std) {
int delay_values = 0; int delay_values = 0;
int num_delay_values = 0; int num_delay_values = 0;
int my_median = 0; int my_median = 0;
const int kMsPerBlock = (PART_LEN * 1000) / self->splitSampFreq;
float l1_norm = 0; float l1_norm = 0;
if (self == NULL) { if (self == NULL) {
...@@ -779,13 +780,13 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std) { ...@@ -779,13 +780,13 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std) {
break; break;
} }
} }
*median = my_median; *median = my_median * kMsPerBlock;
// Calculate the L1 norm, with median value as central moment // Calculate the L1 norm, with median value as central moment
for (i = 0; i < kMaxDelay; i++) { for (i = 0; i < kMaxDelay; i++) {
l1_norm += (float) (fabs(i - my_median) * self->aec->delay_histogram[i]); l1_norm += (float) (fabs(i - my_median) * self->aec->delay_histogram[i]);
} }
*std = (int) (l1_norm / (float) num_delay_values + 0.5f); *std = (int) (l1_norm / (float) num_delay_values + 0.5f) * kMsPerBlock;
// Reset histogram // Reset histogram
memset(self->aec->delay_histogram, 0, sizeof(self->aec->delay_histogram)); memset(self->aec->delay_histogram, 0, sizeof(self->aec->delay_histogram));
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
// - Do we really support PowerPC? Probably not. Remove WEBRTC_MAC_INTEL // - Do we really support PowerPC? Probably not. Remove WEBRTC_MAC_INTEL
// from build/common.gypi as well. // from build/common.gypi as well.
#if defined(WIN32) #if defined(WIN32)
// Windows & Windows Mobile // Windows & Windows Mobile.
#if !defined(WEBRTC_TARGET_PC) #if !defined(WEBRTC_TARGET_PC)
#define WEBRTC_TARGET_PC #define WEBRTC_TARGET_PC
#endif #endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
// Mac OS X // Mac OS X.
#if defined(__LITTLE_ENDIAN__ ) #if defined(__LITTLE_ENDIAN__ )
#if !defined(WEBRTC_TARGET_MAC_INTEL) #if !defined(WEBRTC_TARGET_MAC_INTEL)
#define WEBRTC_TARGET_MAC_INTEL #define WEBRTC_TARGET_MAC_INTEL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment