Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Issue 2304123002: Cleaned up and revised the handling of resampling and bandsplitting in APM and (Closed)

Created:
4 years, 3 months ago by peah-webrtc
Modified:
4 years, 3 months ago
Reviewers:
the sun, hlundin-webrtc
CC:
webrtc-reviews_webrtc.org, Andrew MacDonald, tterriberry_mozilla.com, audio-team_agora.io, kwiberg-webrtc, minyue-webrtc, aluebs-webrtc, bjornv1, henrika_webrtc
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

The audio processing module (APM) relies on two for functionalities doing sample-rate conversions: -The implicit resampling done in the AudioBuffer CopyTo, CopyFrom, InterleaveTo and DeinterleaveFrom methods. -The multi-band splitting scheme. The selection of rates in these have been difficult and complicated, partly due to that the APM API which allows for activating the APM submodules without notifying the APM. This CL adds functionality that for each capture frame polls all submodules for whether they are active or not and compares this against a cached result. Furthermore, new functionality is added that based on the results of the comparison do a reinitialization of the APM. This has several advantages -The code deciding on whether to analysis and synthesis is needed for the bandsplitting can be much simplified and centralized. -The selection of the processing rate can be done such as to avoid the implicit resampling that was in some cases unnecessarily done. -The optimization for whether an output copy is needed that was done to improve performance due to the implicit resampling is no longer needed, which simplifies the code and makes it less error-prone in the sense that is no longer neccessary to keep track of whether any module has changed the signal. Finally, it should be noted that the polling of the state for all the submodules was done previously as well, but in a less obvious and distributed manner. BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297 Committed: https://crrev.com/2ace3f94064e4d1980483d9ea3b0da8537aee540 Cr-Commit-Position: refs/heads/master@{#14175}

Patch Set 1 #

Patch Set 2 : Typo correction #

Total comments: 20

Patch Set 3 : Changes in response to reviewer comments #

Total comments: 21

Patch Set 4 : Changes in response to reviewer comments #

Patch Set 5 : Re-added conditional copy to the output buffer as not doing it caused implicit downmixing #

Patch Set 6 : Created new test reference binaries for the unit tests in audio_processing_unittest.cc #

Patch Set 7 : Avoided compiler warning by adding unreachable return statement #

Patch Set 8 : Updated the test that required that no initialization should be done if APM is called with the defa… #

Messages

Total messages: 44 (19 generated)
peah-webrtc
This CL needs more testing before landing, but I'm sending out to you so that ...
4 years, 3 months ago (2016-09-02 13:10:21 UTC) #7
the sun
https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode143 webrtc/modules/audio_processing/audio_processing_impl.cc:143: bool ts_enabled) { What's "ts"? (I could look it ...
4 years, 3 months ago (2016-09-02 20:11:34 UTC) #8
the sun
On 2016/09/02 20:11:34, the sun wrote: > https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc > File webrtc/modules/audio_processing/audio_processing_impl.cc (right): > > https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode143 ...
4 years, 3 months ago (2016-09-02 20:12:15 UTC) #9
hlundin-webrtc
On 2016/09/02 20:12:15, the sun wrote: > On 2016/09/02 20:11:34, the sun wrote: > > ...
4 years, 3 months ago (2016-09-06 09:22:33 UTC) #10
hlundin-webrtc
Nice. See comments inline. https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode110 webrtc/modules/audio_processing/audio_processing_impl.cc:110: RTC_DCHECK_LT(kMaxSplittingNativeProcessRateIndex, You should be able ...
4 years, 3 months ago (2016-09-06 10:41:32 UTC) #11
peah-webrtc
https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode110 webrtc/modules/audio_processing/audio_processing_impl.cc:110: RTC_DCHECK_LT(kMaxSplittingNativeProcessRateIndex, On 2016/09/06 10:41:32, hlundin-webrtc wrote: > You should ...
4 years, 3 months ago (2016-09-07 06:28:11 UTC) #13
hlundin-webrtc
lgtm https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode110 webrtc/modules/audio_processing/audio_processing_impl.cc:110: RTC_DCHECK_LT(kMaxSplittingNativeProcessRateIndex, On 2016/09/07 06:28:11, peah-webrtc wrote: > On ...
4 years, 3 months ago (2016-09-07 21:36:06 UTC) #14
the sun
I think this is an improvement, but did you consider changing the API instead to ...
4 years, 3 months ago (2016-09-08 08:10:15 UTC) #15
kwiberg-webrtc
https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode115 webrtc/modules/audio_processing/audio_processing_impl.cc:115: for (size_t k = 0; k <= uppermost_native_rate_index; ++k) ...
4 years, 3 months ago (2016-09-08 08:17:27 UTC) #17
peah-webrtc
On 2016/09/08 08:17:27, kwiberg-webrtc wrote: > https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc > File webrtc/modules/audio_processing/audio_processing_impl.cc (right): > > https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode115 > ...
4 years, 3 months ago (2016-09-08 08:35:06 UTC) #18
peah-webrtc
On 2016/09/08 08:35:06, peah-webrtc wrote: > On 2016/09/08 08:17:27, kwiberg-webrtc wrote: > > > https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc ...
4 years, 3 months ago (2016-09-08 08:37:31 UTC) #19
peah-webrtc
On 2016/09/08 08:10:15, the sun wrote: > I think this is an improvement, but did ...
4 years, 3 months ago (2016-09-08 08:40:23 UTC) #20
peah-webrtc
https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/20001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode110 webrtc/modules/audio_processing/audio_processing_impl.cc:110: RTC_DCHECK_LT(kMaxSplittingNativeProcessRateIndex, On 2016/09/07 21:36:05, hlundin-webrtc wrote: > On 2016/09/07 ...
4 years, 3 months ago (2016-09-08 08:44:04 UTC) #21
the sun
https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode104 webrtc/modules/audio_processing/audio_processing_impl.cc:104: int NativeProcessRateToUse(int minimum_rate, bool band_splitting_required) { On 2016/09/08 08:44:03, ...
4 years, 3 months ago (2016-09-08 09:20:48 UTC) #22
peah-webrtc
https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode104 webrtc/modules/audio_processing/audio_processing_impl.cc:104: int NativeProcessRateToUse(int minimum_rate, bool band_splitting_required) { On 2016/09/08 09:20:48, ...
4 years, 3 months ago (2016-09-08 18:57:50 UTC) #23
the sun
lgtm https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode104 webrtc/modules/audio_processing/audio_processing_impl.cc:104: int NativeProcessRateToUse(int minimum_rate, bool band_splitting_required) { On 2016/09/08 ...
4 years, 3 months ago (2016-09-08 20:36:38 UTC) #24
peah-webrtc
https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc File webrtc/modules/audio_processing/audio_processing_impl.cc (right): https://codereview.webrtc.org/2304123002/diff/60001/webrtc/modules/audio_processing/audio_processing_impl.cc#newcode104 webrtc/modules/audio_processing/audio_processing_impl.cc:104: int NativeProcessRateToUse(int minimum_rate, bool band_splitting_required) { On 2016/09/08 20:36:38, ...
4 years, 3 months ago (2016-09-10 07:52:38 UTC) #25
peah-webrtc
On 2016/09/10 07:53:50, peah-webrtc wrote: > mailto:peah@webrtc.org changed reviewers: > - mailto:kwiberg@webrtc.org Removed kwiberg@ as ...
4 years, 3 months ago (2016-09-10 07:55:01 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2304123002/120001
4 years, 3 months ago (2016-09-10 07:55:23 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: win_x64_dbg on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_x64_dbg/builds/1152)
4 years, 3 months ago (2016-09-10 07:58:13 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2304123002/140001
4 years, 3 months ago (2016-09-10 09:46:32 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: win_rel on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_rel/builds/17974)
4 years, 3 months ago (2016-09-10 09:53:40 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2304123002/160001
4 years, 3 months ago (2016-09-10 10:05:59 UTC) #40
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 3 months ago (2016-09-10 11:42:32 UTC) #42
commit-bot: I haz the power
4 years, 3 months ago (2016-09-10 11:42:45 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/2ace3f94064e4d1980483d9ea3b0da8537aee540
Cr-Commit-Position: refs/heads/master@{#14175}

Powered by Google App Engine
This is Rietveld 408576698