193 Commits

Author SHA1 Message Date
peah
81b9291dfd The FFT functionality in aec_rdft* is based on legacy C
code which is not thread-safe in the sense that the
rdft_init method can only be run in a single-threaded.

Currently, inside WebRTC multiple instances of the audio-
processing module are set up which means that the init
method may be run concurrently.

In order to avoid having to protect the init method with
a lock to ensure single-threaded behavior that, this CL
places the FFT functionality inside a class so that there
is no global component of the FFT functionality.

Note that:
1) The nonstandard header for the ooura_fft.cc was copied
   from the aec_rdft.cc header, and augmented with a
   description of the changes introduced in this CL.
2) The clang warnings for the ooura_fft_sse2.cc,
   ooura_fft_neon.cc and ooura_fft_mips.cc were not
   addressed as this code was kept as it was before this CL
3) Clang-format was run on all files apart from
   ooura_fft_mips.cc (as that would change the format of
   the inline assempbly code).

Adding bypass of presubmit to avoid code style and header errors caused by the fact that files with legacy code are being renamed.

NOPRESUBMIT=true

BUG=chromium:638583

Review-Url: https://codereview.webrtc.org/2348213002
Cr-Commit-Position: refs/heads/master@{#14554}
2016-10-06 13:46:27 +00:00
peah
6d3a1f922d Removed unused state variable in the AEC
BUG=webrtc:5298

Review-Url: https://codereview.webrtc.org/2364773003
Cr-Commit-Position: refs/heads/master@{#14486}
2016-10-04 06:25:26 +00:00
kwiberg
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
kwiberg
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
kwiberg
9e2be5f292 webrtc/modules/audio_processing: Use RTC_DCHECK() instead of assert()
Review-Url: https://codereview.webrtc.org/2320053003
Cr-Commit-Position: refs/heads/master@{#14211}
2016-09-14 12:23:29 +00:00
peah
a421ddd60e The buffering of the farend signal is refactored in this CL.
The former buffering scheme was overly complicated and
complex as.
-It buffered twice as many data points as needed.
-It used the ring_buffer C functionality directly inside the
 delay adjustment functionality which makes that
functionality very hard to read.

In order to overcome these problems this CL does
-Change the buffering to buffer only the amount of samples
 needed.
-Wrap the ring_buffer C functionality in a wrapper class
 with methods that are more descriptive in what they do
 to affect the AEC delay.

Additional notes:
-Some minor other name changes/code changes were also
 introduced.
-The ringbuffer C functionality should be removed, but now
 is not the time to do it as the rest of the code is very
 adapted to the wrapping behavior of the ringbuffer. It is
 better to simplify the surrounding code before doing that.

The changes have been tested to be bitexact.

This CL is chained to the CL https://codereview.webrtc.org/2321483002/
and will be followed by another CL.

BUG=webrtc:5298, webrtc:6018

Review-Url: https://codereview.webrtc.org/2319693003
Cr-Commit-Position: refs/heads/master@{#14188}
2016-09-12 18:27:20 +00:00
peah
8e56521143 The output signal of the AEC needs to be buffered as the
internal block size of the AEC differ from the frame
size in the AEC output.

Before this CL, this buffering was done using ringbuffers
as well as secondary internal AEC buffers that were stored
on the state. The internal buffers were redundant, and the
ringbuffers were so short that the benefit of using
ringbuffers were lost.

This CL addresses the above issues by replacing the
ringbuffers by linear buffers. This has the main advantage
of cleaner code but it should significantly less
computational complex.

Furthermore, as the complexity of the function where the
conversion to external and internal AEC frame sizes is done
increased significantly with the changes in this CL, the
CL also include refactoring the near-end buffer handling
to increase readability and reduce code repetition.

After the changes in this CL it is very clear that the
former buffering of the output was incorrectly done for
the first frames. This CL corrects that but in doing that
it breaks the bitexactness with the former code.
The bitexactness is, however, only broken for the first
1000 samples and it has been verified that for a test suite
the CL maintains bitexactness in the AEC output
after the first 1000 samples.

This CL is chained to the CL https://codereview.webrtc.org/2311833002/ and will be
followed by more CLs that refactor the other buffers
inside the AEC.

BUG=webrtc:5298, webrtc:6018

Review-Url: https://codereview.webrtc.org/2321483002
Cr-Commit-Position: refs/heads/master@{#14184}
2016-09-12 11:49:50 +00:00
peah
906f403088 This CL refactors the buffering of the incoming near-end signal inside
the AEC. This solves the following issues:
-Even though the buffering was previously done using ringbuffers, those
  were inefficiently used which caused a lot of hidden memcopys.
-The ringbuffers wasted a lot of space in the AEC state as they were too
  long.
-The lowest and two upper bands were decoupled in the buffering, which
  required extra code to handle.
-On top of the ringbuffers there was a second linear buffer that was
  stored in the state which caused even more data to be stored on the
  state.
-The incoming nearend frames were passed to the functions in the form
  of buffers on the state, which made the code harder to read as it was
  not immediately clear where the nearend signal was used, and when it
  was modified.

The CL addresses this by replacing all the buffers by two linear buffers:
-One buffer before the AEC processing for producing nearend
  blocks of size 64 that can be processed by the AEC.
-One inside the AEC processing that buffers the current
  nearend block until the next block is processed.

The changes have been tested to be bitexact.
This CL will be followed by several other CLs, that refactor the other
buffers in the AEC.

BUG=webrtc:5298, webrtc:6018

Review-Url: https://codereview.webrtc.org/2311833002
Cr-Commit-Position: refs/heads/master@{#14141}
2016-09-08 16:49:50 +00:00
kwiberg
83ffe453ec Fix Chromium clang plugin warnings
NOTRY=true
BUG=webrtc:163

Review-Url: https://codereview.webrtc.org/2288153002
Cr-Commit-Position: refs/heads/master@{#13964}
2016-08-29 21:46:14 +00:00
minyuel
e01000b9a4 Fixing a comment on AEC divergence metric.
BUG=
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/2102603002 .

Cr-Commit-Position: refs/heads/master@{#13297}
2016-06-27 15:06:22 +00:00
peah
351da09467 Remove header files for the AEC and the APM test program that are no longer used.
BUG=

Review-Url: https://codereview.webrtc.org/2078313002
Cr-Commit-Position: refs/heads/master@{#13227}
2016-06-20 21:33:05 +00:00
peah
946f36ef39 Added diagnostic AEC debug logpoints for the purpose
of simplifying offline AEC issue analysis.

BUG=

Review-Url: https://codereview.webrtc.org/2016143003
Cr-Commit-Position: refs/heads/master@{#12967}
2016-05-31 09:25:24 +00:00
henrik.lundin
83e8286c6b AEC: Add UMA logging of buffer re-alignment
This change adds a UMA log that will be written to when a non-zero delay
correction is done in the AEC. The number of elements moved (positive or
negative) will be logged to
"WebRTC.Audio.AecDelayAdjustmentAgnosticValue" or
"WebRTC.Audio.AecDelayAdjustmentSystemValue", depending on whether
delay-agnostic AEC is used or not, respectively.

BUG=webrtc:5903

Review-Url: https://codereview.webrtc.org/1991723002
Cr-Commit-Position: refs/heads/master@{#12795}
2016-05-18 12:43:05 +00:00
pasko
e305d956c0 Remove runtime NEON detection
Chrome does not detect NEON instruction set at runtime in WebRTC code starting
with M50, which is now in Stable. Remove support for runtime detection for
simplicity.

The only remaining piece of Chrome that will continue to depend on runtime
detection is /net, where devices with _broken_ neon support are also detected,
and it is not configurable via GYP/GN.

BUG=522035
NOPRESUBMIT=true

Review-Url: https://codereview.webrtc.org/1955413003
Cr-Commit-Position: refs/heads/master@{#12778}
2016-05-17 17:56:48 +00:00
peah
5df729489f Refactored the comfort noise generation code in the AEC.
This CL will be followed with other CLs that break apart
the application of the comfort noise from the comfort
noise generation.

The changes in the CL are very close to bitexaxt. The
bitinexactness is caused by differences in numerical
behavior when bundling the spectral band power and the
noise scaling based on the NLP gain.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1958933002
Cr-Commit-Position: refs/heads/master@{#12713}
2016-05-13 07:13:57 +00:00
peah
9bbf89bca1 Moved the AEC echo suppression gain computation code to
a separate method.

This CL will be followed by other CLs that simplify this method and break out the state specific to this computation
into a separate substate.

The changes are bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1963493003
Cr-Commit-Position: refs/heads/master@{#12712}
2016-05-13 06:08:11 +00:00
peah
e687f7816c Moved the functionality in aec_core_internal.h into other
files.

The purpose of this CL is to simplify upcoming AEC algorithm
changes.

The changes should be bitexact.

The presubmit was bypassed due to a presubmit complaint
about usage of short instead of int16_t which will be
addressed in upcoming CLs.

BUG=webrtc:5298, webrtc:5201

NOPRESUBMIT=true

Review-Url: https://codereview.webrtc.org/1949803004
Cr-Commit-Position: refs/heads/master@{#12662}
2016-05-09 10:57:40 +00:00
peah
e69c37bc96 Separated the functionalities in the OverdriveAndSuppress
method in the AEC into two methods.

This CL is step towards simplifying the AEC code, making it
more modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1943753002
Cr-Commit-Position: refs/heads/master@{#12656}
2016-05-08 10:47:23 +00:00
peah
23868b64bc Broke apart the functionalities in the SubbandCoherence
method in the AEC.

This CL is step towards simplifying the AEC code, making it
more modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1943193002
Cr-Commit-Position: refs/heads/master@{#12655}
2016-05-08 08:50:24 +00:00
peah
6c9b65ab38 Made the method PartitionDelay independent of the AEC state.
This CL is step towards simplifying the AEC code, making it more
modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1936203002
Cr-Commit-Position: refs/heads/master@{#12654}
2016-05-08 00:47:11 +00:00
peah
779e97e493 Removed the MIPS optimized code for the comfort noise generation in
theAEC. The reason for this is that this optimized method hinders any
refactoring of the code. In particular, it is not possible to separate
the application of the echo suppressor gain from the gain computation
and the comfort noise generation as all of these are partly included
in this method.

This CL is step towards simplifying the AEC code, making it more
modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1942853002
Cr-Commit-Position: refs/heads/master@{#12653}
2016-05-07 23:36:09 +00:00
peah
8d13c4fe1a Changed the AEC SubbandCoherence function to not use the full AEC state
This CL is step towards simplifying the AEC code, making it more modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1936173002
Cr-Commit-Position: refs/heads/master@{#12652}
2016-05-07 22:03:55 +00:00
peah
44c8a373a5 Removed the file echo_cancellation_internal.h and moved
the file content to echo_cancellation.h.

The purpose of this CL is to simplify upcoming AEC algorithm
changes.

The changes should be bitexact.

BUG=webrtc:5298, webrtc:5201

Review-Url: https://codereview.webrtc.org/1947743004
Cr-Commit-Position: refs/heads/master@{#12638}
2016-05-05 20:34:35 +00:00
peah
3f08dc656d Introduced the new APM data logging functionality into the AEC echo_cancellation.* API layer.
BUG=webrtc:5298

Review-Url: https://codereview.webrtc.org/1952593002
Cr-Commit-Position: refs/heads/master@{#12635}
2016-05-05 10:04:05 +00:00
minyue
3815655541 Change aggregation window of aecDivergentFilterFraction to 1 second.
BUG=

Review-Url: https://codereview.webrtc.org/1942183002
Cr-Commit-Position: refs/heads/master@{#12617}
2016-05-03 21:42:50 +00:00
peah
7dd7ab5c51 Changed the name of the variable overdriveSm and removed the
state as an input to OverdriveAndSuppress in the AEC.

This CL is step towards simplifying the AEC code, making it more
modifiable and modular.

The changes should be bitexact.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1939723002
Cr-Commit-Position: refs/heads/master@{#12616}
2016-05-03 21:08:17 +00:00
peah
b46083ed63 This CL introduces a new data logging functionality
to use for the APM. It allows simple and rapid
additions of exploratory data logpoints to use
during bug investigations and module performance
analysis.
The new data logging functionality is also in this CL
used to replace the existing data logging functionality
present in the AEC.

Additional information:
As there was an issue with that the build flag for
activating this feature was not present in all
compilation units that included the feature additional
changes were needed. A summary of the changes are
-The build files were modified to ensure that the
 logging build flag always is set to either 0 or 1
 for compilation units that include the feature.
-Build-time checks in the appropriate places were added
 to ensure that the above is fulfilled.
-The build object was added dynamically to the AEC state
 as a pointer to ensure that the size of that state is not
 dependent on whether the logging build flag is set or not.
-The constructor of the AEC class needed to be modified in
 order to construct the logging object. For this a destructor
 was also needed.
-An unused method without any declaration was removed in
 order to avoid any issues with the logging flag being set to
 0 or 1.

This CL will be immediately followed with an upcoming CL
that replaces the logging in echo_cancellation.cc with the
new functionality which will ensure that the  logging flag
is only used in one place within WebRTC, which in turn will
fully ensure that all compilation units that uses the feature
also have the flag properly set.

BUG=webrtc:5201, webrtc:5298

Review-Url: https://codereview.webrtc.org/1877713002
Cr-Commit-Position: refs/heads/master@{#12607}
2016-05-03 14:01:27 +00:00
kwiberg
4485ffb58d #include "webrtc/base/constructormagic.h" where appropriate
Any file that uses the RTC_DISALLOW_* macros should #include
"webrtc/base/constructormagic.h", but a shocking number of them don't.
This causes trouble when we try to wean files off of #including
scoped_ptr.h, since a bunch of files get their constructormagic macros
only from there.

Rather than fixing these errors one by one as they turn up, this CL
simply ensures that every file in the WebRTC tree that uses the
RTC_DISALLOW_* macros #includes "webrtc/base/constructormagic.h".

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1917043005

Cr-Commit-Position: refs/heads/master@{#12509}
2016-04-26 15:14:48 +00:00
minyue
2b6707826e Cleaning up AEC metrics.
Current implementation of AEC metrics does not read nicely. It messes up between a noise-removed calculation and a raw calculation.

I tried to clean it up, in which, I stick to the raw calculation since the noise-removed version can show some problem when the noise is overestimated.

BUG=

Review URL: https://codereview.webrtc.org/1581183005

Cr-Commit-Position: refs/heads/master@{#12455}
2016-04-21 09:07:17 +00:00
peah
594a877f2d Cleaned up the EchoSuppression method in the AEC so that it
does not have to use the aec state as an input.

Furthermore, the debug dump output of e_fft was removed as
it is not really used in any analysis scripts.

BUG=webrtc:5298

Review URL: https://codereview.webrtc.org/1883293003

Cr-Commit-Position: refs/heads/master@{#12387}
2016-04-16 11:04:04 +00:00
peah
0332c2db39 Added support in the AEC for refined filter adaptation.
The following algorithmic functionality was added:
-Add support for an exact regressor power to be computed
 which avoids the issue with the updating of the filter
 sometimes being unstable.
-Lowered the fixed step size of the adaptive filter to 0.05
 which significantly reduces the sensitivity of the
 adaptive filter to near-end noise, nonlinearities,
 doubletalk and the unmodelled echo path tail. It also
 reduces the tracking speed of the adaptive filter but the
 chosen value proved to give a sufficient tradeoff for the
 requirements on the adaptive filter.

To allow the new functionality to be selectively applied the following was done:
-A new Config was added for selectively activating the functionality.
-Functionality was added in the audioprocessing  and echocancellationimpl classes
 for passing the activation of the functionality down to the AEC algorithms.

To make the code for the introduction of the functionality clean,
the following refactoring was done:
-The selection of the step size was moved to a single place.
-The constant for the step size of the adaptive filter in extended filter mode was
 made local.
-The state variable storing the step-size was renamed to a more describing name.

When the new functionality is not activated, the changes
have been tested for bitexactness on Linux.

TBR=minyue@webrtc.org
BUG=webrtc:5778, webrtc:5777

Review URL: https://codereview.webrtc.org/1887003002

Cr-Commit-Position: refs/heads/master@{#12384}
2016-04-15 18:23:36 +00:00
peah
21a395ddf7 Moved the aec_rdft*.c files to be build using C++
BUG=webrtc:5298
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1881153003

Cr-Commit-Position: refs/heads/master@{#12346}
2016-04-13 14:53:57 +00:00
peah
bdb7af692f Changed the delay estimator to be built using C++
BUG=webrtc:5724
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1878613002

Cr-Commit-Position: refs/heads/master@{#12336}
2016-04-12 21:47:46 +00:00
minyue
5045337133 Pulling AEC divergent filter fraction.
BUG=

Review URL: https://codereview.webrtc.org/1862393002

Cr-Commit-Position: refs/heads/master@{#12279}
2016-04-07 13:36:49 +00:00
minyue
e10fc3fb2d Adding fraction of filter divergence in AEC metrics.
With the current AEC algorithm, the divergence of the echo cancelling linear filter is a strong signal of non-transparency. During double talk, it can result in a ducking artifacts.

In this CL, a metric that tells the fraction of filter divergence is added. This can measure the severity of non-transparency.

BUG=

Review URL: https://codereview.webrtc.org/1739993003

Cr-Commit-Position: refs/heads/master@{#12276}
2016-04-07 09:57:00 +00:00
peah
fc3ef3e5c1 Removed unused code and simplified the code for the AEC metrics
BUG=

Review URL: https://codereview.webrtc.org/1842003003

Cr-Commit-Position: refs/heads/master@{#12258}
2016-04-06 09:28:32 +00:00
peah
faed4ab24b Revert of Moved ring-buffer related files from common_audio to audio_processing" (patchset #2 id:20001 of https://codereview.webrtc.org/1858123003/ )
Reason for revert:
Because of down-stream dependencies, this CL needs to be reverted.

The dependencies will be resolved and then the CL will be relanded.

Original issue's description:
> Revert "Revert of Moved ring-buffer related files from common_audio to audio_processing (patchset #8 id:150001 of https://codereview.webrtc.org/1846903004/ )"
>
> This reverts commit c54aad6ae07fe2a44a65be403386bd7d7d865e5b.
>
> BUG=webrtc:5724
> NOPRESUBMIT=true
>
> Committed: https://crrev.com/8864fe5e08f8d8711612526dee9a812adfcd3be1
> Cr-Commit-Position: refs/heads/master@{#12247}

TBR=henrik.lundin@webrtc.org,ivoc@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5724

Review URL: https://codereview.webrtc.org/1855393004

Cr-Commit-Position: refs/heads/master@{#12248}
2016-04-05 21:57:55 +00:00
peah
8864fe5e08 Revert "Revert of Moved ring-buffer related files from common_audio to audio_processing (patchset #8 id:150001 of https://codereview.webrtc.org/1846903004/ )"
This reverts commit c54aad6ae07fe2a44a65be403386bd7d7d865e5b.

BUG=webrtc:5724
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1858123003

Cr-Commit-Position: refs/heads/master@{#12247}
2016-04-05 21:42:51 +00:00
peah
c54aad6ae0 Revert of Moved ring-buffer related files from common_audio to audio_processing (patchset #8 id:150001 of https://codereview.webrtc.org/1846903004/ )
Reason for revert:
This CL caused a google3 breakage due to dependencies in Google3.

I will fix that, and reland.

Original issue's description:
> Moved ring-buffer related files from common_audio to audio_processing
>
> BUG=webrtc:5724
> NOPRESUBMIT=true
>
> Committed: https://crrev.com/711ccc8d96490f58cc3d7fd9207c19d4d881d4dc
> Cr-Commit-Position: refs/heads/master@{#12227}

TBR=ivoc@webrtc.org,henrik.lundin@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5724

Review URL: https://codereview.webrtc.org/1856323002

Cr-Commit-Position: refs/heads/master@{#12232}
2016-04-05 07:02:35 +00:00
peah
6c393244b0 Revert of Moved the ringbuffer to be built using C++ (patchset #2 id:20001 of https://codereview.webrtc.org/1851873003/ )
Reason for revert:
This CL is dependent on the  CL https://codereview.webrtc.org/1846903004/ which caused a google3 breakage due to dependencies in Google3.

I will fix that, and reland this CL.

Original issue's description:
> Moved the ringbuffer to be built using C++
>
> BUG=webrtc:5724
>
> Committed: https://crrev.com/677e5774eaf287fa02f75fd5c8ad3f9ded9ed9c4
> Cr-Commit-Position: refs/heads/master@{#12230}

TBR=ivoc@webrtc.org,henrik.lundin@webrtc.org,kwiberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5724

Review URL: https://codereview.webrtc.org/1858873003

Cr-Commit-Position: refs/heads/master@{#12231}
2016-04-05 07:00:50 +00:00
peah
677e5774ea Moved the ringbuffer to be built using C++
BUG=webrtc:5724

Review URL: https://codereview.webrtc.org/1851873003

Cr-Commit-Position: refs/heads/master@{#12230}
2016-04-05 06:58:21 +00:00
peah
711ccc8d96 Moved ring-buffer related files from common_audio to audio_processing
BUG=webrtc:5724
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1846903004

Cr-Commit-Position: refs/heads/master@{#12227}
2016-04-05 05:57:48 +00:00
minyue
84db6fa7f5 Adding BlockMeanCalculator for AEC.
This will improve the readability of AEC code.

BUG=

Review URL: https://codereview.webrtc.org/1805633006

Cr-Commit-Position: refs/heads/master@{#12123}
2016-03-24 21:36:33 +00:00
minyue
6a85d3450c Fixing UpdateLevel function in AEC.
From an earlier CL, we start to feed UpdateLevel() with power instead of energy. I found that UpdateLevel() is still taking the input as energy and normalize it. This CL fixes this.

The earlier CL is
https://codereview.webrtc.org/1542573002/

BUG=

Review URL: https://codereview.webrtc.org/1810773003

Cr-Commit-Position: refs/heads/master@{#12084}
2016-03-22 09:15:01 +00:00
peah
6ebc4d3f7d Changed name for the upcoming AEC from NextGenerationAec to AEC3.
BUG=webrtc:5201

Review URL: https://codereview.webrtc.org/1763703002

Cr-Commit-Position: refs/heads/master@{#11895}
2016-03-08 00:59:43 +00:00
peah
50e21bd40b This CL introduces namespaces in the aec c++ files
(the ones that were recently moved from c)

There are many files changed but most changes just
consist of adding namespaces.

In aec_common.h an C++-specific #ifdef needed to be added as
that file is both included from C and C++. I could see no
way around that but please let me know if there is a better
way around that.

BUG=webrtc:5201

Review URL: https://codereview.webrtc.org/1766663002

Cr-Commit-Position: refs/heads/master@{#11883}
2016-03-05 16:39:30 +00:00
peah
88950cfbf9 Moved the file aec_resampler.c to be built using C++.
The steps involved were:
1) Change file name to .cc from .c.
2) Update the build files accordingly.
3) Remove the extern header file inclusion.
4) Change the casts in aec_resampler.cc to static_cast
   and reinterpret_cast.

The changes are bitexact.

The CL will be followed with another CL where a proper (webrtc) namespace is introduced. The reason for not having it in this CL is that this was missed in the corresponding
CL that did the above for aec_core.c, ..., and if the
namespaces in all the aec_core -related files can be changed
at the same time that will simplify things.

BUG=webrtc:5201

Review URL: https://codereview.webrtc.org/1754223004

Cr-Commit-Position: refs/heads/master@{#11867}
2016-03-04 08:12:43 +00:00
minyue
7b19b08c18 Reland "Calculating ERLE in AEC more properly."
The original CL (https://codereview.webrtc.org/1644133002/) had an error in the unittest and did not get landed. This CL is to reland it,

BUG=

Review URL: https://codereview.webrtc.org/1743223002

Cr-Commit-Position: refs/heads/master@{#11844}
2016-03-02 14:56:56 +00:00
minyuel
c9bbbe454f Revert "Calculating ERLE in AEC more properly."
This reverts commit 944744b25c76810e576516d2f676b1d9105e302f.

NOTRY=True
TBR=peah@webrtc.org,kjellander@webrtc.org

Review URL: https://codereview.webrtc.org/1747883002 .

Cr-Commit-Position: refs/heads/master@{#11817}
2016-02-29 14:20:54 +00:00
minyuel
944744b25c Calculating ERLE in AEC more properly.
The audio level of the AEC's output level was calculated before overlapping add, and therefore, a compensation was needed. The compensation is multiplying the level by 2 since, before overlapping add, the level is roughly halved due to windowing.

This had to be that way because the level was calculated in frequency domain and the signal after overlapping add has only its time domain representation.

The level calculation has been updated to work on time domain signal and therefore the problem is not there any longer.

This CL is to put the calculation of the AEC output level after overlapping add and remove the compensation.

BUG=
R=peah@webrtc.org

Review URL: https://codereview.webrtc.org/1644133002 .

Cr-Commit-Position: refs/heads/master@{#11810}
2016-02-29 12:09:07 +00:00