Commit graph

10 commits

Author SHA1 Message Date
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Jesús de Vicente Peña
5eb5bb5007 AEC3: Using a more conservative frequency response representation of the tails.
Bug: webrtc:13173
Change-Id: Ic469f6226fe079c306cec6f941eeb70d6d9094f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231682
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34966}
2021-09-10 13:20:35 +00:00
Per Åhgren
8be669fd96 AEC3: Add support for multiple channels to the reverb modelling
This CL adds support for multiple channels in the reverb
modelling. As a side effect, it also partly adds multi-channel
supports for the sections of the code.

Beyond adding the multi-channel support, a bug is fixed as part of
this CL. Since the bug fix affects the bitexactness, as a safety
precaution the CL includes the ability to override the bugfix.

Apart from the contributions from the bugfix, the changes have
been verified to be bitexact for a large set of mono recordings.

Bug: webrtc:10913
Change-Id: I1f307b532be85ef4182f8db41384f44d40a25219
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156382
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29456}
2019-10-11 21:49:58 +00:00
Per Åhgren
ef5d5af3a0 AEC3: Increasing the accuracy of the detection for early reverb
This CL introduces an adaptive estimation of the early reverb
in the estimation for the room reverberation. The benefits of
this is that for room with long early reflections there is
a lower risk of underestimating the reverberation.

This CL is for a landing the code in
https://webrtc-review.googlesource.com/c/src/+/87420,
and the review of the code was done in that CL. The author of
code is devicentepena@webrtc.org

Bug: webrtc:9479, chromium:865397
Change-Id: Id6f57e2a684664aef96e8c502e66775f37da59da
Reviewed-on: https://webrtc-review.googlesource.com/91162
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24146}
2018-07-30 22:34:19 +00:00
Alessio Bazzica
9cb5d5f9de Reland "IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions"
This reverts commit d39ce8d45b.

Reason for revert: downstream project fix

Original change's description:
> Revert "IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions"
> 
> This reverts commit e90879097c.
> 
> Reason for revert: breaking downstream projects
> 
> Original change's description:
> > IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions
> > 
> > Fix the build with libstdc++ after 496cedfe5 ("AEC3: Reverberation model:
> > Changes on the decay estimation") by including the missing header:
> > 
> >     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In constructor ‘webrtc::ReverbModelEstimator::ReverbModelEstimator(const webrtc::EchoCanceller3Config&)’:
> >     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: error: ‘fabsf’ was not declared in this scope
> >            reverb_decay_(fabsf(config.ep_strength.default_len)),
> >                          ^~~~~
> >     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: note: suggested alternative: ‘labs’
> >            reverb_decay_(fabsf(config.ep_strength.default_len)),
> >                          ^~~~~
> >                          labs
> >     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In member function ‘void webrtc::ReverbModelEstimator::UpdateReverbDecay(const std::vector<float>&)’:
> >     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:206:15: error: ‘powf’ was not declared in this scope
> >            decay = powf(2.0f, -exp_candidate * kFftLengthBy2);
> >                    ^~~~
> > 
> > While here, also switch to the C++ versions of those functions: std::fabs()
> > and std::pow() respectively.
> > 
> > Spotted by Jose Dapena Paz <jose.dapena@lge.com>.
> > 
> > Bug: chromium:819294
> > Change-Id: Id803243be8dd17eac95c70a88a37ee2fe1505a5a
> > Reviewed-on: https://webrtc-review.googlesource.com/87421
> > Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23870}
> 
> TBR=gustaf@webrtc.org,alessiob@webrtc.org,raphael.kubo.da.costa@intel.com,devicentepena@webrtc.org
> 
> Change-Id: I22423a2d4201183f70ae084e0e21930367824f1c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:819294
> Reviewed-on: https://webrtc-review.googlesource.com/87401
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23871}

TBR=gustaf@webrtc.org,alessiob@webrtc.org,raphael.kubo.da.costa@intel.com,devicentepena@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:819294
Change-Id: I09e07d59961d3e2ecc617244287a821cb8b04578
Reviewed-on: https://webrtc-review.googlesource.com/87900
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23910}
2018-07-10 15:01:50 +00:00
Alessio Bazzica
d39ce8d45b Revert "IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions"
This reverts commit e90879097c.

Reason for revert: breaking downstream projects

Original change's description:
> IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions
> 
> Fix the build with libstdc++ after 496cedfe5 ("AEC3: Reverberation model:
> Changes on the decay estimation") by including the missing header:
> 
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In constructor ‘webrtc::ReverbModelEstimator::ReverbModelEstimator(const webrtc::EchoCanceller3Config&)’:
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: error: ‘fabsf’ was not declared in this scope
>            reverb_decay_(fabsf(config.ep_strength.default_len)),
>                          ^~~~~
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: note: suggested alternative: ‘labs’
>            reverb_decay_(fabsf(config.ep_strength.default_len)),
>                          ^~~~~
>                          labs
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In member function ‘void webrtc::ReverbModelEstimator::UpdateReverbDecay(const std::vector<float>&)’:
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:206:15: error: ‘powf’ was not declared in this scope
>            decay = powf(2.0f, -exp_candidate * kFftLengthBy2);
>                    ^~~~
> 
> While here, also switch to the C++ versions of those functions: std::fabs()
> and std::pow() respectively.
> 
> Spotted by Jose Dapena Paz <jose.dapena@lge.com>.
> 
> Bug: chromium:819294
> Change-Id: Id803243be8dd17eac95c70a88a37ee2fe1505a5a
> Reviewed-on: https://webrtc-review.googlesource.com/87421
> Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23870}

TBR=gustaf@webrtc.org,alessiob@webrtc.org,raphael.kubo.da.costa@intel.com,devicentepena@webrtc.org

Change-Id: I22423a2d4201183f70ae084e0e21930367824f1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:819294
Reviewed-on: https://webrtc-review.googlesource.com/87401
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23871}
2018-07-06 11:37:15 +00:00
Raphael Kubo da Costa
e90879097c IWYU: Add <cmath> for fabsf() and powf(), switch to C++ versions
Fix the build with libstdc++ after 496cedfe5 ("AEC3: Reverberation model:
Changes on the decay estimation") by including the missing header:

    ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In constructor ‘webrtc::ReverbModelEstimator::ReverbModelEstimator(const webrtc::EchoCanceller3Config&)’:
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: error: ‘fabsf’ was not declared in this scope
           reverb_decay_(fabsf(config.ep_strength.default_len)),
                         ^~~~~
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: note: suggested alternative: ‘labs’
           reverb_decay_(fabsf(config.ep_strength.default_len)),
                         ^~~~~
                         labs
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In member function ‘void webrtc::ReverbModelEstimator::UpdateReverbDecay(const std::vector<float>&)’:
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:206:15: error: ‘powf’ was not declared in this scope
           decay = powf(2.0f, -exp_candidate * kFftLengthBy2);
                   ^~~~

While here, also switch to the C++ versions of those functions: std::fabs()
and std::pow() respectively.

Spotted by Jose Dapena Paz <jose.dapena@lge.com>.

Bug: chromium:819294
Change-Id: Id803243be8dd17eac95c70a88a37ee2fe1505a5a
Reviewed-on: https://webrtc-review.googlesource.com/87421
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23870}
2018-07-06 11:03:41 +00:00
Alessio Bazzica
282dad1943 Revert "IWYU: Add <math.h> for fabsf() and powf()"
This reverts commit 7d47525e8b.

Reason for revert: breaking downstream projects

Original change's description:
> IWYU: Add <math.h> for fabsf() and powf()
> 
> Fix the build with libstdc++ after 496cedfe5 ("AEC3: Reverberation model:
> Changes on the decay estimation") by including the missing header:
> 
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In constructor ‘webrtc::ReverbModelEstimator::ReverbModelEstimator(const webrtc::EchoCanceller3Config&)’:
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: error: ‘fabsf’ was not declared in this scope
>            reverb_decay_(fabsf(config.ep_strength.default_len)),
>                          ^~~~~
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: note: suggested alternative: ‘labs’
>            reverb_decay_(fabsf(config.ep_strength.default_len)),
>                          ^~~~~
>                          labs
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In member function ‘void webrtc::ReverbModelEstimator::UpdateReverbDecay(const std::vector<float>&)’:
>     ../../modules/audio_processing/aec3/reverb_model_estimator.cc:206:15: error: ‘powf’ was not declared in this scope
>            decay = powf(2.0f, -exp_candidate * kFftLengthBy2);
>                    ^~~~
> 
> Spotted by Jose Dapena Paz <jose.dapena@lge.com>.
> 
> Bug: chromium:819294
> Change-Id: If992e5e473b9d4d0c1b3c1006c3816b7c4eee296
> Reviewed-on: https://webrtc-review.googlesource.com/87241
> Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
> Cr-Commit-Position: refs/heads/master@{#23863}

TBR=gustaf@webrtc.org,alessiob@webrtc.org,raphael.kubo.da.costa@intel.com,devicentepena@webrtc.org

Change-Id: I8adcec57d67de2efcbf0ebef0cdb700fcc21689a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:819294
Reviewed-on: https://webrtc-review.googlesource.com/87400
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23864}
2018-07-06 09:18:22 +00:00
Raphael Kubo da Costa
7d47525e8b IWYU: Add <math.h> for fabsf() and powf()
Fix the build with libstdc++ after 496cedfe5 ("AEC3: Reverberation model:
Changes on the decay estimation") by including the missing header:

    ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In constructor ‘webrtc::ReverbModelEstimator::ReverbModelEstimator(const webrtc::EchoCanceller3Config&)’:
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: error: ‘fabsf’ was not declared in this scope
           reverb_decay_(fabsf(config.ep_strength.default_len)),
                         ^~~~~
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:61:21: note: suggested alternative: ‘labs’
           reverb_decay_(fabsf(config.ep_strength.default_len)),
                         ^~~~~
                         labs
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc: In member function ‘void webrtc::ReverbModelEstimator::UpdateReverbDecay(const std::vector<float>&)’:
    ../../modules/audio_processing/aec3/reverb_model_estimator.cc:206:15: error: ‘powf’ was not declared in this scope
           decay = powf(2.0f, -exp_candidate * kFftLengthBy2);
                   ^~~~

Spotted by Jose Dapena Paz <jose.dapena@lge.com>.

Bug: chromium:819294
Change-Id: If992e5e473b9d4d0c1b3c1006c3816b7c4eee296
Reviewed-on: https://webrtc-review.googlesource.com/87241
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#23863}
2018-07-06 08:34:21 +00:00
Jesús de Vicente Peña
496cedfe56 AEC3: Reverberation model: Changes on the decay estimation.
In this CL we have introduced changes on the estimation of the decay involved in the exponential modeling of the reverberation. Specifically, the instantaneous ERLE has been tracked and used for adapting faster in the regions when the linear filter is performing well. Furthermore, the adaptation is just perform during render activity.


Change-Id: I974fd60e4e1a40a879660efaa24457ed940f77b4
Bug: webrtc:9479
Reviewed-on: https://webrtc-review.googlesource.com/86680
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23836}
2018-07-04 10:04:32 +00:00