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

Issue 2584493002: Added first layer of the echo canceller 3 functionality (Closed)

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

Description

Added first layer of the echo canceller 3 functionality. This CL adds the first layer of the echo canceller 3. All of the code is as it should, apart from block_processor.* which only contains placeholder functionality. (Upcoming CLs will add proper functionality into those files.) BUG=webrtc:6018 Review-Url: https://codereview.webrtc.org/2584493002 Cr-Commit-Position: refs/heads/master@{#15861} Committed: https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30

Patch Set 1 #

Patch Set 2 : Restricted the AnalyzeRender access, added ability to add external reporting of echo failure, and o… #

Total comments: 166

Patch Set 3 : Changes in response to reviewer comments #

Total comments: 146

Patch Set 4 : Changes in response to reviewer comments #

Patch Set 5 : Minor changes #

Total comments: 66

Patch Set 6 : Changes in response to reviewer comments #

Patch Set 7 : Added more crash tests #

Total comments: 34

Patch Set 8 : Changes in response to reviewer comments #

Patch Set 9 : Added checks and unittests for null pointer parameters #

Patch Set 10 : Rebase #

Patch Set 11 : Changed biquad filter coefficients to be float #

Patch Set 12 : Corrected array declaration that caused a build error on Windows #

Patch Set 13 : Added missing comment #

Patch Set 14 : Disabled the BlockProcessor DEATH tests due to false alarms on the trybots #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2524 lines, -15 lines) Patch
M webrtc/modules/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M webrtc/modules/audio_processing/BUILD.gn View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/aec3_constants.h View 1 2 3 4 5 1 chunk +52 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_framer.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_framer.cc View 1 2 3 4 5 6 7 8 1 chunk +59 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_framer_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +261 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_processor.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_processor.cc View 1 2 3 4 5 6 7 8 1 chunk +73 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/block_processor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +143 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h View 1 2 3 4 1 chunk +58 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc View 1 2 3 1 chunk +58 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/cascaded_biquad_filter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +98 lines, -0 lines 0 comments Download
M webrtc/modules/audio_processing/aec3/echo_canceller3.h View 1 2 3 4 3 chunks +89 lines, -4 lines 0 comments Download
M webrtc/modules/audio_processing/aec3/echo_canceller3.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +312 lines, -11 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +717 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/frame_blocker.h View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/frame_blocker.cc View 1 2 3 4 5 6 7 8 1 chunk +72 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/frame_blocker_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +341 lines, -0 lines 0 comments Download
A webrtc/modules/audio_processing/aec3/mock/mock_block_processor.h View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (6 generated)
peah-webrtc
Next CL in the AEC3 CL series: PTAL Thanks!
4 years ago (2016-12-15 10:43:33 UTC) #3
peah-webrtc
Hi, I came up with a new patch. Sorry about that! (it improves the code ...
4 years ago (2016-12-16 06:59:46 UTC) #4
hlundin-webrtc
On 2016/12/16 06:59:46, peah-webrtc wrote: > Hi, > I came up with a new patch. ...
4 years ago (2016-12-16 09:12:16 UTC) #5
hlundin-webrtc
Nice! But I have a few comments... https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/aec3_constants.h File webrtc/modules/audio_processing/aec3/aec3_constants.h (right): https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/aec3_constants.h#newcode16 webrtc/modules/audio_processing/aec3/aec3_constants.h:16: // TODO(peah): ...
4 years ago (2016-12-16 10:04:48 UTC) #6
aleloi
Some comments. I've not checked the biquad_filter.* and echo_canceller3.* yet. https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/aec3_constants.h File webrtc/modules/audio_processing/aec3/aec3_constants.h (right): https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/aec3_constants.h#newcode33 ...
4 years ago (2016-12-16 15:04:32 UTC) #7
ivoc
I will have a closer look at echo_canceller3.cc later. https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/block_processor.cc File webrtc/modules/audio_processing/aec3/block_processor.cc (right): https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/block_processor.cc#newcode22 webrtc/modules/audio_processing/aec3/block_processor.cc:22: ...
4 years ago (2016-12-19 11:30:22 UTC) #8
peah-webrtc
Thanks for the great feedback!!! I have made some quite major changes in the code ...
4 years ago (2016-12-20 10:10:26 UTC) #9
hlundin-webrtc
Much improved. I'm still missing unit tests for BlockFramer, BlockProcessor, CascadedBiquadFilter, and FrameBlocker. https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc File ...
4 years ago (2016-12-20 15:10:36 UTC) #10
aleloi
New batch of comments... It looks good! I've only got the unit tests left now. ...
4 years ago (2016-12-20 15:55:36 UTC) #11
aleloi
A few more comments... LG! https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/block_framer.cc File webrtc/modules/audio_processing/aec3/block_framer.cc (right): https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/block_framer.cc#newcode46 webrtc/modules/audio_processing/aec3/block_framer.cc:46: std::copy(buffer_[i].begin(), buffer_[i].end(), sub_frame[i].begin()); On ...
4 years ago (2016-12-21 10:07:45 UTC) #12
hlundin-webrtc
https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/block_framer.cc File webrtc/modules/audio_processing/aec3/block_framer.cc (right): https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/block_framer.cc#newcode46 webrtc/modules/audio_processing/aec3/block_framer.cc:46: std::copy(buffer_[i].begin(), buffer_[i].end(), sub_frame[i].begin()); On 2016/12/21 10:07:45, aleloi wrote: > ...
4 years ago (2016-12-21 10:14:19 UTC) #13
ivoc
I will look at the unittests later. https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc File webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc (right): https://codereview.webrtc.org/2584493002/diff/20001/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc#newcode37 webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.cc:37: biquad_state.a[0] = ...
4 years ago (2016-12-21 13:04:05 UTC) #14
ivoc
https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc File webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc (right): https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc#newcode251 webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc:251: class BlockProcessorTransparentCapture : public BlockProcessor { Is it me ...
4 years ago (2016-12-21 14:52:14 UTC) #15
peah-webrtc
Thanks for the reviews and the awesome comments!!! I have created another patch with changes ...
4 years ago (2016-12-21 23:13:53 UTC) #16
peah-webrtc
I found some further things that merited changes, so I added another patch with those.
4 years ago (2016-12-22 07:34:29 UTC) #17
hlundin-webrtc
Getting close now. Mostly minor comments. https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc File webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc (right): https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc#newcode287 webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc:287: const size_t num_bands ...
4 years ago (2016-12-22 10:23:57 UTC) #18
ivoc
https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3.cc File webrtc/modules/audio_processing/aec3/echo_canceller3.cc (right): https://codereview.webrtc.org/2584493002/diff/40001/webrtc/modules/audio_processing/aec3/echo_canceller3.cc#newcode260 webrtc/modules/audio_processing/aec3/echo_canceller3.cc:260: render_highpass_filter.reset(nullptr); On 2016/12/21 23:13:51, peah-webrtc wrote: > On 2016/12/21 ...
4 years ago (2016-12-22 13:38:13 UTC) #19
hlundin-webrtc
https://codereview.webrtc.org/2584493002/diff/80001/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter_unittest.cc File webrtc/modules/audio_processing/aec3/cascaded_biquad_filter_unittest.cc (right): https://codereview.webrtc.org/2584493002/diff/80001/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter_unittest.cc#newcode50 webrtc/modules/audio_processing/aec3/cascaded_biquad_filter_unittest.cc:50: for (float v : values) { On 2016/12/22 13:38:13, ...
4 years ago (2016-12-22 13:51:30 UTC) #20
peah-webrtc
Thanks again for a great review! I've addressed all the comments. I think, however, that ...
4 years ago (2016-12-22 16:40:04 UTC) #21
ivoc
https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_processing/aec3/block_processor.cc File webrtc/modules/audio_processing/aec3/block_processor.cc (right): https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_processing/aec3/block_processor.cc#newcode44 webrtc/modules/audio_processing/aec3/block_processor.cc:44: instance_count_ = rtc::AtomicOps::Increment(&instance_count_); If I understand correctly this is ...
3 years, 12 months ago (2016-12-23 10:32:33 UTC) #22
hlundin-webrtc
I didn't read the new death tests very carefully, but it seems good. I don't ...
3 years, 12 months ago (2016-12-23 13:38:12 UTC) #23
aleloi
lgtm with suggestion. https://codereview.webrtc.org/2584493002/diff/80001/webrtc/modules/audio_processing/aec3/block_framer.cc File webrtc/modules/audio_processing/aec3/block_framer.cc (right): https://codereview.webrtc.org/2584493002/diff/80001/webrtc/modules/audio_processing/aec3/block_framer.cc#newcode52 webrtc/modules/audio_processing/aec3/block_framer.cc:52: buffer_[i].resize(0); On 2016/12/22 16:40:03, peah-webrtc wrote: ...
3 years, 12 months ago (2016-12-23 14:28:38 UTC) #24
peah-webrtc
Thanks again for the reviews and comments. I have uploaded a new patch with the ...
3 years, 11 months ago (2017-01-02 08:45:11 UTC) #25
peah-webrtc
Hi again, I added two new patch-sets to fix build issues on Windows: a) Change ...
3 years, 11 months ago (2017-01-02 09:54:04 UTC) #26
ivoc
Nice work! LGTM, see one small nit below. https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc File webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc (right): https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc#newcode510 webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc:510: const ...
3 years, 11 months ago (2017-01-02 10:17:11 UTC) #27
peah-webrtc
Thanks for a great review effort (and for the Christmas LGTMs) ! The codes is ...
3 years, 11 months ago (2017-01-02 10:25:26 UTC) #28
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/2584493002/240001
3 years, 11 months ago (2017-01-02 10:26:09 UTC) #31
commit-bot: I haz the power
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30
3 years, 11 months ago (2017-01-02 11:13:44 UTC) #34
terelius
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.webrtc.org/2603293002/ by terelius@webrtc.org. ...
3 years, 11 months ago (2017-01-02 21:44:29 UTC) #35
aleloi
3 years, 11 months ago (2017-01-09 13:49:29 UTC) #36
Message was sent while issue was closed.
https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_pro...
File webrtc/modules/audio_processing/aec3/block_framer.cc (right):

https://codereview.webrtc.org/2584493002/diff/120001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/aec3/block_framer.cc:21: buffer_(num_bands_,
std::vector<float>(kBlockSize, 0.f)) {}
On 2017/01/02 08:45:10, peah-webrtc wrote:
> On 2016/12/23 14:28:38, aleloi wrote:
> > Suggestion: initialize the buffer with 16 zeroes and possibly reserve space
> for
> > 64. That would introduce less delay, and the calling scheme will still work.
> That does not seem to work.
> I think the reason is the way that BlockFramer is used together with
> FrameBlocker.
> 
> For each frame that FrameBlocker receives, BlockFramer should output exactly
one
> frame (otherwise there is a gap in the stream). This means for insteance that
> for a framelength of 80 samples (the same thing happens for 160 sample frame
> lengths)
> Frame #1
> FrameBlocker input size: 80
> FrameBlocker output num blocks: 1
> FrameBlocker buffer size (after frame being received): 16
> BlockFramer input num blocks: 1
> FrameBlocker output size: 80
> FrameBlocker buffer size (before frame is produced): x
> FrameBlocker buffer size (after frame is produced): x-16
> 
> Frame #2
> FrameBlocker input size: 80
> FrameBlocker output num blocks: 1
> FrameBlocker buffer size (after frame being received): 32
> BlockFramer input num blocks: 1
> FrameBlocker output size: 80
> FrameBlocker buffer size (before frame is produced): x-16
> FrameBlocker buffer size (after frame is produced): x-32
> 
> Frame #3
> FrameBlocker input size: 80
> FrameBlocker output num blocks: 1
> FrameBlocker buffer size (after frame being received): 48
> BlockFramer input num blocks: 1
> FrameBlocker output size: 80
> FrameBlocker buffer size (before frame is produced): x-32
> FrameBlocker buffer size (after frame is produced): x-48
> 
> Frame #4
> FrameBlocker input size: 80
> FrameBlocker output num blocks: 2
> FrameBlocker buffer size (after frame being received): 0
> BlockFramer input num blocks: 2
> FrameBlocker output size: 80
> FrameBlocker buffer size (before frame is produced): x-48
> FrameBlocker buffer size (after frame is produced but before block 2 is
> received): x-64
> FrameBlocker buffer size (after frame is produced and after block 2 is
> received): x
> 
> 
> In order to ensure that the BlockFramer buffer size does not go below 0, the
> initial buffer size x must be chosen sufficiently large. The example above I
> think shows that x at least needs to be 64 for that to be the case.
> 
> Currently, the case when more 2 blocks are received by BlockFramer when one
> single frame is produced is handled in such a way that the extra block is
> received via a separate method call (InsertBlock). If we would bundle that
call
> with the extraction of the frame (in InsertBlockAndExtractSubFrame) that would
> allow for the buffer size to be reduced to 48. This would, however, have the
> consequence that an extra block would (for performance reasons) need to be
> cached on the EchoCanceller3 state so in total that would result in an
increase
> of 48 samples in state memory footprint. Furthermore, that reduction to a
buffer
> size of 48 would not correspond to a lower signal delay. Therefore, I think it
> is better to use an initial (and maximum) buffer size of 64 inside
BlockFramer.
> 
> Sorry about the long explanation, but I needed to convince myself as well that
> my reasoning was correct. 
> 
> To summarize, in order to maintain a continuous output stream I think an
initial
> buffer size of 64 is needed. It is possible to jump-start it by filling it
with
> true output samples, but at some time during the first frames, depending on
how
> this is done, there will anyway be a lack of samples when the output frame is
to
> be produced. Those samples will need to be filled by zeros as it is not
possible
> to wait with producing the frame. And that insertion of zeros will again
revert
> the delay  reduction achieved by the jump-start.
> 
> WDYT? Does this make sense?
> 
> 
> 
> 

Ok, I see. Sorry for the delay.

Powered by Google App Engine
This is Rietveld 408576698