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

Issue 1814723003: Added a bitexactness test for the intelligibility enhancer in the audio processing module (Closed)

Created:
4 years, 9 months ago by peah-webrtc
Modified:
4 years, 8 months ago
CC:
webrtc-reviews_webrtc.org, Andrew MacDonald, tterriberry_mozilla.com, audio-team_agora.io, kwiberg-webrtc, minyue-webrtc, the sun, bjornv1
Base URL:
https://chromium.googlesource.com/external/webrtc.git@BeamformerBitExactness_CL
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Added a bitexactness test for the intelligibility enhancer in the audio processing module BUG=webrtc:5242 Committed: https://crrev.com/4b0c74172ed0a1bb40dc25535da53dee4c4767f2 Cr-Commit-Position: refs/heads/master@{#12129}

Patch Set 1 : #

Total comments: 68

Patch Set 2 : Changes in response to reviewer comments #

Total comments: 2

Patch Set 3 : Moved the bitexactness test code for the intelligibility enhancer #

Patch Set 4 : Corrected to use the number of frames for the capture buffer instead of for the render buffer #

Patch Set 5 : Disabled all the bitexactness tests until the code has reached a less intense development phase #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -0 lines) Patch
M webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc View 1 2 3 4 3 chunks +160 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (5 generated)
peah-webrtc
Hi, I've been setting up bitexactness tests for all the APM submodules. This test is ...
4 years, 9 months ago (2016-03-18 07:49:37 UTC) #3
hlundin-webrtc
The unit test should sit in the same folder as the class it tests. Moving ...
4 years, 9 months ago (2016-03-18 08:47:43 UTC) #4
aluebs-webrtc
I am not sure how useful these kind of tests are, since they don't capture ...
4 years, 9 months ago (2016-03-18 23:26:42 UTC) #5
peah-webrtc
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc (right): https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode23 webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:23: const int kNumFramesToProcess = 1000; On 2016/03/18 23:26:40, aluebs-webrtc ...
4 years, 9 months ago (2016-03-21 11:54:51 UTC) #6
aluebs-webrtc
Thank you for separating the moving into its own patch. https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc (right): https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode26 ...
4 years, 9 months ago (2016-03-22 11:53:29 UTC) #7
peah-webrtc
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc (right): https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode26 webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:26: void ProcessOneFrame(int sample_rate_hz, On 2016/03/22 11:53:29, aluebs-webrtc wrote: > ...
4 years, 9 months ago (2016-03-23 22:09:34 UTC) #8
peah-webrtc
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc (right): https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode86 webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:86: ReadFloatSamplesFromStereoFile(samples_per_channel, num_channels, On 2016/03/22 11:53:28, aluebs-webrtc wrote: > On ...
4 years, 9 months ago (2016-03-23 22:13:54 UTC) #9
aluebs-webrtc
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc (right): https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode111 webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:111: EXPECT_TRUE(test::BitExactFrame(render_config.num_frames(), On 2016/03/23 22:09:34, peah-webrtc wrote: > On 2016/03/22 ...
4 years, 9 months ago (2016-03-24 11:18:40 UTC) #10
peah-webrtc
On 2016/03/24 11:18:40, aluebs-webrtc wrote: > https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc > File webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc > (right): > > https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc#newcode111 ...
4 years, 9 months ago (2016-03-24 11:30:49 UTC) #11
peah-webrtc
4 years, 9 months ago (2016-03-24 11:30:59 UTC) #12
aluebs-webrtc
On 2016/03/24 11:30:49, peah-webrtc wrote: > On 2016/03/24 11:18:40, aluebs-webrtc wrote: > > > https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc ...
4 years, 8 months ago (2016-03-28 22:45:36 UTC) #13
peah-webrtc
On 2016/03/28 22:45:36, aluebs-webrtc wrote: > On 2016/03/24 11:30:49, peah-webrtc wrote: > > On 2016/03/24 ...
4 years, 8 months ago (2016-03-29 05:15:58 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1814723003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1814723003/120001
4 years, 8 months ago (2016-03-29 05:41:02 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:120001)
4 years, 8 months ago (2016-03-29 06:43:54 UTC) #18
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/4b0c74172ed0a1bb40dc25535da53dee4c4767f2 Cr-Commit-Position: refs/heads/master@{#12129}
4 years, 8 months ago (2016-03-29 06:44:02 UTC) #20
aluebs-webrtc
On 2016/03/29 05:15:58, peah-webrtc wrote: > On 2016/03/28 22:45:36, aluebs-webrtc wrote: > > On 2016/03/24 ...
4 years, 8 months ago (2016-03-29 15:01:33 UTC) #21
hlundin-webrtc
On 2016/03/29 15:01:33, aluebs-webrtc wrote: > On 2016/03/29 05:15:58, peah-webrtc wrote: > > On 2016/03/28 ...
4 years, 8 months ago (2016-03-29 19:58:45 UTC) #22
The Sun (google.com)
On 2016/03/29 19:58:45, hlundin-webrtc wrote: > On 2016/03/29 15:01:33, aluebs-webrtc wrote: > > On 2016/03/29 ...
4 years, 8 months ago (2016-03-30 08:00:34 UTC) #23
aluebs-webrtc
4 years, 8 months ago (2016-03-30 22:47:23 UTC) #24
Message was sent while issue was closed.
On 2016/03/30 08:00:34, solenberg wrote:
> On 2016/03/29 19:58:45, hlundin-webrtc wrote:
> > On 2016/03/29 15:01:33, aluebs-webrtc wrote:
> > > On 2016/03/29 05:15:58, peah-webrtc wrote:
> > > > On 2016/03/28 22:45:36, aluebs-webrtc wrote:
> > > > > On 2016/03/24 11:30:49, peah-webrtc wrote:
> > > > > > On 2016/03/24 11:18:40, aluebs-webrtc wrote:
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_proc...
> > > > > > > File
> > > webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc
> > > > > > > (right):
> > > > > > > 
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_proc...
> > > > > > >
> > > webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:111:
> > > > > > > EXPECT_TRUE(test::BitExactFrame(render_config.num_frames(),
> > > > > > > On 2016/03/23 22:09:34, peah-webrtc wrote:
> > > > > > > > On 2016/03/22 11:53:29, aluebs-webrtc wrote:
> > > > > > > > > On 2016/03/21 11:54:49, peah-webrtc wrote:
> > > > > > > > > > On 2016/03/18 23:26:40, aluebs-webrtc wrote:
> > > > > > > > > > > If it receives a tolerance it is not a bit-exact test. I
> think
> > > > this
> > > > > > > should
> > > > > > > > > be
> > > > > > > > > > > renamed to something that reflects the real test that is
> done.
> > > > > > > > > > 
> > > > > > > > > > Good point! 
> > > > > > > > > > What about VectorDifferenceBounded and that kTolerance is
> > renamed
> > > to
> > > > > > > > > > kVectorItemBound?
> > > > > > > > > > I'll wait with that change until we have agreed on a name as
> > that
> > > > will
> > > > > > > > affect
> > > > > > > > > > other files as well. It should for sure be part of this CL
but
> I
> > > > don't
> > > > > > > want
> > > > > > > > to
> > > > > > > > > > create a patch for it until we have a good name.
> > > > > > > > > 
> > > > > > > > > I think your suggestion sounds much more intuitive of what it
> > > actually
> > > > > > does.
> > > > > > > > But
> > > > > > > > > if it touches many other files, it might be a better idea to
do
> it
> > > in
> > > > > > > another
> > > > > > > > > CL.
> > > > > > > > Great! Then I'll do that in another CL.
> > > > > > > > Done.
> > > > > > > 
> > > > > > > Acknowledged.
> > > > > > > 
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
https://codereview.webrtc.org/1814723003/diff/20001/webrtc/modules/audio_proc...
> > > > > > >
> > > webrtc/modules/audio_processing/intelligibility_enhancer_unittest.cc:118:
> > > > > > > TEST(IntelligibilityEnhancerBitExactnessTest, Mono8kHz) {
> > > > > > > On 2016/03/23 22:09:34, peah-webrtc wrote:
> > > > > > > > On 2016/03/22 11:53:29, aluebs-webrtc wrote:
> > > > > > > > > On 2016/03/21 11:54:49, peah-webrtc wrote:
> > > > > > > > > > On 2016/03/18 23:26:41, aluebs-webrtc wrote:
> > > > > > > > > > > This test would be a lot simpler if we use TEST_P and
> > > > > > > > > INSTANTIATE_TEST_CASE_P.
> > > > > > > > > > 
> > > > > > > > > > Very likely, but I could not come up with a good way to in
an
> > > > explicit
> > > > > > > > manner
> > > > > > > > > > combine the testvectors with the input parameters in
> > > > > > > > INSTANTIATE_TEST_CASE_P.
> > > > > > > > > Do
> > > > > > > > > > you have any suggestion on how to achieve that?
> > > > > > > > > 
> > > > > > > > > How about having a method that returns a reference vector from
a
> > > > sample
> > > > > > rate
> > > > > > > > and
> > > > > > > > > a number of channels? In that way you can only instantiate an
> the
> > > > tests
> > > > > > > using
> > > > > > > > > these 2 parameters and then get the reference from them.
> > > > > > > > 
> > > > > > > > As I wrote in the CL for the bitexactness test for the
beamformer
> I
> > > > think
> > > > > > that
> > > > > > > > is a good suggestion and most likely it would produce more
> > > > > > > > compact code. One drawback is, however, that it is not possible
to
> > > > disable
> > > > > > > > tests. The way the tests are set up in this test is how the
> > reviewers
> > > of
> > > > > the
> > > > > > > > first of the submodule bitexactness tests preferred it to be.
And
> > even
> > > > > > though
> > > > > > > it
> > > > > > > > is a bit verbose, I like that it is very explicit. 
> > > > > > > 
> > > > > > > As I wrote in the other CL, TEST_P would be exactly as verbose,
> since
> > > you
> > > > > need
> > > > > > > to instantiate each test case manually, but it avoids repeated
code.
> > And
> > > > to
> > > > > > > disable tests, you can always comment out that specific instance.
> Did
> > > the
> > > > > > > original reviewers evaluate TEST_P, because they might prefer this
> > > > approach
> > > > > > and
> > > > > > > then it would be great to port all tests to this one.
> > > > > > Yes, the initial version of the bitexactness test for the highpass
> > filter
> > > > > > (https://codereview.webrtc.org/1510493004) was using TEST_P and
> > > > > > INSTANTIATE_TEST_CASE_P.
> > > > > > The argument against that was that normal tests was easier to
> understand
> > > and
> > > > > > maintain which I agree with. Furthermore, I think it is more
explicit
> to
> > > > > disable
> > > > > > test in the GTEST manner rather than commenting them out. I think
that
> > it
> > > > > makes
> > > > > > sense to have the bitexactness tests for all the APM submodules done
> in
> > > the
> > > > > same
> > > > > > way.
> > > > > 
> > > > > I don't see any comments of the reviewers before the patch you removed
> the
> > > > > TEST_P, but I trust you had an offline discussion with them. I agree
> that
> > > all
> > > > > submodule-tests should be consistent, but I personally think that if
> there
> > > is
> > > > a
> > > > > nice feature to make tests parametric, why not use it. If everybody
> agrees
> > > on
> > > > > not using TEST_P, I will not oppose to that.
> > > > > So it lgtm, given that all these tests are disabled before landing,
> since
> > > the
> > > > > IntelligibilityEnhancer is still under development and  this test is
> more
> > > > > annoying than helpful right now. Also, let's discuss offline if we can
> > > change
> > > > > these bitexactness tests for something more useful and intuitive.
> > > > > Please add me as a reviewer to the rename of the bitexactness test.
> > > > 
> > > > Thanks. The comment is there with the timestamp 2015-12-10 08:53:49 UTC.
> > > > 
> > > > Regarding the rename, you mean the BitExactFrame function, right? I will
> add
> > > you
> > > > to that CL as a reviewer.
> > > 
> > > There I saw the comment, I was looking at the comments on patches
> themselves.
> > > Thank you for pointing that out.
> > > Yes, I do meant the test::BitExactFrame function, as we agreed.
> > 
> > Just sharing my 2 cents on the TEST_P discussion, after the fact. I think
> > TEST_Ps are nice since they render less code duplication. But, the test
cases
> > get weird (automatically generated) names, which make them unintuitive to
> > filter. I tend to not use TEST_P for the latter reason.
> 
> Duplication isn't necessarily the same thing as complexity.
> 
> If you want parametric tests, just make a little function and call that from
> test cases you define. There will be very little duplicated code (a few lines
> per test case) and is easy for anyone to read, with no requirement to be
> familiar with intricate macros and templates of the test framework. You can
> decide on sensible names too, and don't need to jump through any hoops to
create
> the parameter sets.

I think creating the parameters set is fairly simple and I find the TEST_P to be
more intuitive to read than manual tests cases, where it is hard to find the
case you are looking for. And I understand the naming issue, but I think it is
not so terrible and could be annotated with a comment. But I still think TEST_P
is a great tool to use, specially to avoid repeating cases or forgetting to
change the parameters from one case to the other because of copying and pasting
the code (that would have happened with the 3-mic-geometry case if I wouldn't
have caught that on reviewing). In general, I find that having all cases added
manually is hard to review and navigate and bug-prone in general. But as I said,
if everybody agrees on not using TEST_P, I will not oppose to it.

Powered by Google App Engine
This is Rietveld 408576698