739 Commits

Author SHA1 Message Date
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
aluebs
4896aaa9e4 Limit the maximum and minimum gain the IntelligibilityEnhancer can apply
Although the algorithm should generate the optimal gains, these limits are in place so that it doesn't go bananas in extreme noise situations or if there are some errors on the noise estimate. The limits were chosen as the extreme values from recordings with -3dB SNR, which is the minimum where the POLQA metric increases when processed.

Review-Url: https://codereview.webrtc.org/1925933002
Cr-Commit-Position: refs/heads/master@{#12550}
2016-04-28 23:09:03 +00:00
aluebs
11d4a42ce5 Compensate for the compression gain in the IntelligibilityEnhancer
The render signal that reaches the IE is already normalized and compressed by an AGC on the far-end capture processing. Because the noise estimation is done before the AGC compression, we need to compensate for this gain in the IE to be able to compare these 2 powers.

Review-Url: https://codereview.webrtc.org/1913603002
Cr-Commit-Position: refs/heads/master@{#12549}
2016-04-28 21:58:38 +00:00
kwiberg
84be511ac0 Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/
(This is a re-land of https://codereview.webrtc.org/1921233002, which
got reverted for breaking Chromium.)

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12522}
2016-04-27 08:20:08 +00:00
terelius
52d4e6bf5e Revert of Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/ (patchset #1 id:40001 of https://codereview.webrtc.org/1921233002/ )
Reason for revert:
Fails on Chromium FYI bots.

https://build.chromium.org/p/chromium.webrtc.fyi/builders/Linux%20Builder/builds/5392/

Original issue's description:
> Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/
>
> BUG=webrtc:5520
>
> Committed: https://crrev.com/2c27a062ee46258abe9facc2cceee74f09bf6a99
> Cr-Commit-Position: refs/heads/master@{#12511}

TBR=tommi@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:5520

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

Cr-Commit-Position: refs/heads/master@{#12513}
2016-04-26 16:32:09 +00:00
kwiberg
2c27a062ee Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/
BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12511}
2016-04-26 15:38:03 +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
kjellander@webrtc.org
c23bf2e54d Disable failing modules_unittests for UBSan.
BUG=webrtc:5820
TBR=pbos@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12482}
2016-04-25 04:43:20 +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
aluebs
eb3603bd5e Don't always downsample to 16kHz in the reverse stream in APM
The first approach landed here: https://codereview.webrtc.org/1773173002
But it was partially reverted, because it affected the AEC performance, here: https://codereview.webrtc.org/1867483003/
The main difference of this approach is that it doesn't use the 3-band splitting filter in the reverse stream, which seems to be the culprit of the AEC regression.
Also, the 2-band splitting filter has been used for the 32kHz case for a long time without any problem, and this is expanded in the CL to cover the 48kHz case as well.

BUG=webrtc:5725
TBR=tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12451}
2016-04-20 22:28:01 +00:00
ivoc
3bc9566f5a Prevents a segfault in the noise suppression code on ARMv7 with NEON instructions and Mips platforms.
Integer wraparound when casting from int32 to int16 can cause invalid array indices to be accessed.
Fix for wraparound issue.

BUG=webrtc:5781

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

Cr-Commit-Position: refs/heads/master@{#12449}
2016-04-20 15:25:28 +00:00
peah
f3669661bd Removed the issue with the leading semicolon in the audio
processing module experiment description that was present
when AEC3 was not activated and when RefinedAdaptiveFilter
was activated.

BUG=webrtc:5778, webrtc:5777

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

Cr-Commit-Position: refs/heads/master@{#12424}
2016-04-19 10:40:15 +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
7789fe7ab1 Added a protobuf field for the audio processing module to store the status of temporary experimental features that
are active in the module and its submodules.

BUG=webrtc:5778, webrtc:5777

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

Cr-Commit-Position: refs/heads/master@{#12371}
2016-04-15 08:19:47 +00:00
aluebs
2fae89ed0d Disable Intelligibility Enhancer for high SNRs
Review URL: https://codereview.webrtc.org/1878133002

Cr-Commit-Position: refs/heads/master@{#12352}
2016-04-13 18:24:11 +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
3eeb2e89b3 Moved the audioprocessing unittest to the audio_processing folder
where the other audioprocessing unittests are located.

BUG=webrtc:5298

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

Cr-Commit-Position: refs/heads/master@{#12343}
2016-04-13 11:10:09 +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
peah
b97526ed65 Corrected include of C++ header file in AECM that was done using external inclusion
BUG=

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

Cr-Commit-Position: refs/heads/master@{#12327}
2016-04-12 08:20:47 +00:00
peah
c7bdf8a729 Added storing of the reverse output rate and number of channels in APM protobuf recordings.
Support for reading the newly added fields will be added in a another CL.

BUG=webrtc:5759, webrtc:5724

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

Cr-Commit-Position: refs/heads/master@{#12316}
2016-04-11 14:05:56 +00:00
peah
2704512f7b What was done was
-changed filenames to *.cc
-fixed issues with implicit casts causing build errors.

All other CL warnings were ignored as the original
code is not changed, merely moved.

BUG=webrtc:5724
NOPRESUBMIT=true

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

Cr-Commit-Position: refs/heads/master@{#12307}
2016-04-11 05:38:19 +00:00
peah
423d236a54 As the ClosestNativeRate method returns the closest native
rate that is higher than the specified rate, and not
the closest native rate the need for a name change has been
raised. This CL addresses that.

BUG=webrtc:5298

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

Cr-Commit-Position: refs/heads/master@{#12302}
2016-04-09 23:06:59 +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
dc2242d351 Added a query function for whether submodules are enabled
that can be called from the render side without making APM
singlethreaded.

This CL is addressing the problems with high render-side
call duration that were triggered by the CL
https://codereview.webrtc.org/1844583003

BUG=webrtc:5736

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

Cr-Commit-Position: refs/heads/master@{#12266}
2016-04-06 16:31:07 +00:00
peah
0bf612b3ec This CL is partially reverting the effects that
were added in https://codereview.webrtc.org/1773173002.

The reason for the revert is that for some scenarios
that CL causes problems in the coherence estimate used
in the AEC, which in turn causes echo leakage.

The reason for not reverting the actual CL is that
it would cause subsequent CLs to be reverted as well.
Therefore the choice was made to in this CK
instead revert the effects of that CL.

With the changes in this CL, the behavior is bitexact
to what it was before the CL mentioned above.

TBR=aluebs@webrtc.org

BUG=webrtc:5725

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

Cr-Commit-Position: refs/heads/master@{#12259}
2016-04-06 09:47:52 +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
Alejandro Luebs
2a5609de14 Increase kHasVoiceCountNear by one in audio_processing_unittest
I added more test cases here: https://codereview.webrtc.org/1862553002/
But one of these cases failed on Android64 Tests.
I am increasing a tolerance by 1 to make this test pass.

TBRing this, since the bot is red and it is a small fix.

TBR=peah@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12250}
2016-04-06 01:16:59 +00:00
Alejandro Luebs
40cbec5415 Fix the number of frames used when interleaving in AudioBuffer::InterleaveTo()
R=henrik.lundin@webrtc.org, peah@webrtc.org
TBR=tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12249}
2016-04-06 00:29:29 +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
aluebs
853c840801 Re-enable NoiseSuppressionBitExactnessTest
they were disabled here: https://codereview.webrtc.org/1821443003/

BUG=webrtc:5728

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

Cr-Commit-Position: refs/heads/master@{#12245}
2016-04-05 17:03:42 +00:00
minyue
9705bb81d6 Fixing an error in DebugDumpTest.
A recent change in DebugDumpTest introduced an error

https://codereview.webrtc.org/1810463002/

The file was not fully scanned.

This CL fixes it.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#12236}
2016-04-05 11:39:20 +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
simon.hosie
de81ea8524 Keep reads within buffer in AnalysisUpdateNeon().
BUG=webrtc:5631

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

Cr-Commit-Position: refs/heads/master@{#12228}
2016-04-05 06:15:44 +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
aluebs
bfedbf9eae Make naming of APM perf test consistent
BUG=599953

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

Cr-Commit-Position: refs/heads/master@{#12225}
2016-04-04 23:53:42 +00:00
Alejandro Luebs
2d66cf9d8d Tweak kDecayRate in the IntelligibilityEnhancer
This makes the addaptation of the IntelligibilityEnhancer slower, which makes it take more time to kick in or when the background noise changes drastically. But on the other hand, it reduces the risk of clipping and makes the changing in coloring less noticeable.

R=henrik.lundin@webrtc.org, peah@webrtc.org, turaj@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12202}
2016-04-01 20:59:44 +00:00
Alejandro Luebs
3b14996046 Fix normalization of noise estimate in NoiseSuppressor
R=henrik.lundin@webrtc.org, peah@webrtc.org, turaj@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12201}
2016-04-01 20:54:47 +00:00
brucedawson
d81dc49c5b Fix C4434 warning about 32-bit shift assigned to 64-bits
VS 2015 has a new or louder warning about 32-bit shifts that are then
assigned to a 64-bit target. This type of code triggers it:

int64_t size = 1 << shift_amount;

Because the '1' being shifted is a 32-bit int the result of the shift
will be a 32-bit result, so assigning it to a 64-bit variable is just
misleading.

In this case the code that triggers it is this:

  size_t window_size = static_cast<size_t>(1 << shift_amount);

The destination is a size_t so the warning only shows up on 64-bit
builds and doesn't indicate a real bug. It's curious that the code
had a cast already - presumably to suppress some other warning - but
the cast is not in the ideal place and doesn't avoid this new warning.
Moving the cast allows shift_amount to be log2(size_t) and allows
enabling C4334 in Chromium.

BUG=593448

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

Cr-Commit-Position: refs/heads/master@{#12199}
2016-04-01 17:16:21 +00:00
Alejandro Luebs
63a2c13d6d Only split into bands when the reverse stream is analyzed in the APM
BUG=596079
R=henrik.lundin@webrtc.org, peah@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12187}
2016-04-01 01:04:47 +00:00
kwiberg
4a206a96c1 Remove webrtc::ScopedVector
We can (and should) use std::vector<std::unique_ptr<T>> instead.
Because it's standard, and because it's safer since callers have to
manually wrap elements in std::unique_ptr before inserting them and
manually unwrap them after inserting them.

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

Cr-Commit-Position: refs/heads/master@{#12182}
2016-03-31 17:24:31 +00:00
peah
9846651cc4 Changed the names of some of the bitexactness unittests to
be similar to the other file names of the tests.

(Also removed a redundant blank line in the highpass filter unittest
file).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#12171}
2016-03-30 22:34:01 +00:00
peah
51fbdd6ada Changed tests to be DISABLED on non-supported platforms rather than not to build at all.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#12170}
2016-03-30 21:58:42 +00:00
aluebs
fc737e5442 Fix division by zero in NonlinearBeamformer
BUG=webrtc:5703

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

Cr-Commit-Position: refs/heads/master@{#12163}
2016-03-30 16:37:47 +00:00