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

Issue 1868143002: Convert CNG into C++ and remove it from AudioDecoder (Closed)

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

Description

Convert CNG into C++ and remove it from AudioDecoder Broke out CNG from AudioDecoder as they didn't really share an interface. Converted the CNG code to C++, to make initialization and resource handling easier. This includes several changes to the behavior, favoring RTC_CHECKs over returning error codes. Committed: https://crrev.com/97ba30eedf99e84de33200b7546d5d578fe358e6 Cr-Commit-Position: refs/heads/master@{#12491}

Patch Set 1 #

Total comments: 16

Patch Set 2 : Converted WebRtcCng to C++ #

Total comments: 74

Patch Set 3 : Addressed issues from comments. #

Total comments: 15

Patch Set 4 : Separated Encode tests, added GTEST_HAS_DEATH_TEST check, fixed comments. #

Total comments: 2

Patch Set 5 : CheckedDivExact #

Patch Set 6 : Fixed a few show-stopping (albeit small) compiler complaints #

Total comments: 4

Patch Set 7 : Disabled CNG death tests on android. Nulled CNG_encoder[k] in RTPencode.cc upon delete. #

Total comments: 2

Patch Set 8 : Enlarged the buffer in UpdateSidErroneous, changed constants to typed enum. #

Patch Set 9 : Rebase #

Total comments: 2

Patch Set 10 : Implicit conversion to ArrayView in TestSidErroneous #

Unified diffs Side-by-side diffs Delta from patch set Stats (+757 lines, -1264 lines) Patch
M webrtc/modules/audio_coding/BUILD.gn View 1 1 chunk +1 line, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/audio_decoder.h View 2 chunks +0 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/audio_decoder.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.h View 1 2 3 4 5 6 7 8 2 chunks +1 line, -6 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc View 1 2 3 4 5 6 7 8 4 chunks +26 lines, -42 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/cng.gypi View 1 1 chunk +1 line, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/cng_helpfuns.h View 1 2 1 chunk +0 lines, -25 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/cng_helpfuns.c View 1 2 1 chunk +0 lines, -48 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +111 lines, -218 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h View 1 2 3 1 chunk +79 lines, -143 lines 0 comments Download
D webrtc/modules/audio_coding/codecs/cng/webrtc_cng.c View 1 1 chunk +0 lines, -603 lines 0 comments Download
A webrtc/modules/audio_coding/codecs/cng/webrtc_cng.cc View 1 2 1 chunk +442 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_impl.h View 1 2 chunks +0 lines, -33 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc View 1 3 chunks +1 line, -39 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/comfort_noise.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/comfort_noise.cc View 1 2 3 4 5 3 chunks +14 lines, -23 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decoder_database.h View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decoder_database.cc View 1 2 3 4 5 6 7 8 7 chunks +31 lines, -22 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl.cc View 1 2 6 chunks +17 lines, -10 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/normal.cc View 1 2 chunks +2 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/payload_splitter.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/RTPencode.cc View 1 2 3 4 5 6 7 chunks +19 lines, -22 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (11 generated)
ossu
Please take a look at this suggested change. As part of making audio decoders (and ...
4 years, 8 months ago (2016-04-08 11:39:31 UTC) #3
the sun
Moving myself to CC: line - I think there are enough reviewers already, who know ...
4 years, 8 months ago (2016-04-08 15:20:35 UTC) #4
kwiberg-webrtc
This looks like a good idea. And I'm guessing we can make the AudioDecoder interface ...
4 years, 8 months ago (2016-04-09 07:34:50 UTC) #5
ossu
https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc File webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc (right): https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc#newcode194 webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc:194: RTC_CHECK(false && "CNG should not be created like this ...
4 years, 8 months ago (2016-04-11 08:31:10 UTC) #6
ossu
Speaking of which: is there any reason to keep the WebRtcCng in straight C? It ...
4 years, 8 months ago (2016-04-11 10:46:12 UTC) #7
hlundin-webrtc
Nice change! Just a few comments from me. https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc File webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc (right): https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc#newcode194 webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc:194: RTC_CHECK(false ...
4 years, 8 months ago (2016-04-11 11:33:00 UTC) #9
hlundin-webrtc
On 2016/04/11 10:46:12, ossu wrote: > Speaking of which: is there any reason to keep ...
4 years, 8 months ago (2016-04-11 11:35:24 UTC) #10
kwiberg-webrtc
https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc File webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc (right): https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc#newcode194 webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc:194: RTC_CHECK(false && "CNG should not be created like this ...
4 years, 8 months ago (2016-04-11 12:42:57 UTC) #11
ossu
https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc File webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc (right): https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc#newcode194 webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc:194: RTC_CHECK(false && "CNG should not be created like this ...
4 years, 8 months ago (2016-04-11 12:59:58 UTC) #12
kwiberg-webrtc
https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc File webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc (right): https://codereview.webrtc.org/1868143002/diff/1/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc#newcode194 webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc:194: RTC_CHECK(false && "CNG should not be created like this ...
4 years, 8 months ago (2016-04-11 13:28:26 UTC) #13
ossu
I've converted the CNG code to C++, at least structurally. I've tried to keep the ...
4 years, 8 months ago (2016-04-12 08:48:50 UTC) #14
kwiberg-webrtc
(I haven't reviewed the actual code yet.) On 2016/04/12 08:48:50, ossu wrote: > Neither the ...
4 years, 8 months ago (2016-04-12 09:30:26 UTC) #15
kwiberg-webrtc
https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc File webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc#newcode180 webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc:180: num_cng_coefficients_)); A small utility function in an anonymous namespace ...
4 years, 8 months ago (2016-04-12 13:35:31 UTC) #16
ossu
https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc File webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc#newcode180 webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc:180: num_cng_coefficients_)); On 2016/04/12 13:35:30, kwiberg-webrtc wrote: > A small ...
4 years, 8 months ago (2016-04-12 13:54:50 UTC) #17
ossu
https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc File webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc#newcode180 webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc:180: num_cng_coefficients_)); On 2016/04/12 13:35:30, kwiberg-webrtc wrote: > A small ...
4 years, 8 months ago (2016-04-12 13:54:50 UTC) #18
hlundin-webrtc
https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc File webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc#newcode228 webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc:228: RTC_CHECK_GE(encoded_bytes_tmp, 0); On 2016/04/12 13:54:49, ossu wrote: > On ...
4 years, 8 months ago (2016-04-13 07:05:24 UTC) #19
hlundin-webrtc
4 years, 8 months ago (2016-04-13 07:05:25 UTC) #20
ossu
https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode41 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:41: std::unique_ptr<ComfortNoiseEncoder> cng_encoder_; On 2016/04/13 07:05:23, hlundin-webrtc wrote: > Does ...
4 years, 8 months ago (2016-04-13 11:57:07 UTC) #21
ossu
Updated the code based on your comments. Just one last question. https://codereview.webrtc.org/1868143002/diff/40001/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h File webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h (right): ...
4 years, 8 months ago (2016-04-14 08:56:30 UTC) #22
kwiberg-webrtc
lgtm, but see comments https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc File webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc (right): https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc#newcode228 webrtc/modules/audio_coding/codecs/cng/audio_encoder_cng.cc:228: RTC_CHECK_GE(encoded_bytes_tmp, 0); On 2016/04/13 07:05:23, ...
4 years, 8 months ago (2016-04-14 09:42:48 UTC) #23
hlundin-webrtc
LGTM, but I'd like you to consolidate one of the tests. https://codereview.webrtc.org/1868143002/diff/20001/webrtc/modules/audio_coding/codecs/cng/webrtc_cng.cc File webrtc/modules/audio_coding/codecs/cng/webrtc_cng.cc (right): ...
4 years, 8 months ago (2016-04-14 15:20:51 UTC) #24
ossu
Addressed your comments and updated the CR description. https://codereview.webrtc.org/1868143002/diff/40001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/40001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode55 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:55: TEST_F(CngTest, ...
4 years, 8 months ago (2016-04-15 11:56:10 UTC) #27
hlundin-webrtc
LGTM with one nit. https://codereview.webrtc.org/1868143002/diff/60001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/60001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode57 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:57: const size_t num_samples_10ms = sample_rate_hz ...
4 years, 8 months ago (2016-04-15 12:29:54 UTC) #28
ossu
https://codereview.webrtc.org/1868143002/diff/60001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/60001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode57 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:57: const size_t num_samples_10ms = sample_rate_hz / 100; On 2016/04/15 ...
4 years, 8 months ago (2016-04-15 13:05:20 UTC) #29
ossu
Fixed a few compilation issues that were caught by the trybots. The only interesting of ...
4 years, 8 months ago (2016-04-19 09:48:40 UTC) #30
ossu
https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/neteq/test/RTPencode.cc File webrtc/modules/audio_coding/neteq/test/RTPencode.cc (right): https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/neteq/test/RTPencode.cc#newcode1454 webrtc/modules/audio_coding/neteq/test/RTPencode.cc:1454: delete CNG_encoder[k]; I should probably null CNG_encoder[k] here as ...
4 years, 8 months ago (2016-04-19 09:50:26 UTC) #31
kwiberg-webrtc
https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode167 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:167: cng_decoder.UpdateSid( On 2016/04/19 09:48:40, ossu wrote: > ASAN explodes ...
4 years, 8 months ago (2016-04-19 11:14:30 UTC) #32
kwiberg-webrtc
On 2016/04/19 09:48:40, ossu wrote: > Fixed a few compilation issues that were caught by ...
4 years, 8 months ago (2016-04-19 11:18:57 UTC) #33
ossu
On 2016/04/19 11:18:57, kwiberg-webrtc wrote: > On 2016/04/19 09:48:40, ossu wrote: > > Fixed a ...
4 years, 8 months ago (2016-04-19 12:09:15 UTC) #34
kwiberg-webrtc
On 2016/04/19 12:09:15, ossu wrote: > Do we have something that properly checks for this? ...
4 years, 8 months ago (2016-04-19 12:15:31 UTC) #35
ossu
https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode167 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:167: cng_decoder.UpdateSid( On 2016/04/19 11:14:30, kwiberg-webrtc wrote: > On 2016/04/19 ...
4 years, 8 months ago (2016-04-19 12:21:52 UTC) #36
kwiberg-webrtc
On 2016/04/19 12:21:52, ossu wrote: > https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc > File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): > > https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode167 > ...
4 years, 8 months ago (2016-04-20 13:42:32 UTC) #37
ossu
On 2016/04/20 13:42:32, kwiberg-webrtc wrote: > On 2016/04/19 12:21:52, ossu wrote: > > > https://codereview.webrtc.org/1868143002/diff/100001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc ...
4 years, 8 months ago (2016-04-20 14:14:17 UTC) #38
ossu
Fixed the two remaining issues: UpdateSidErroneous and the sometimes unused constant in the cng unittests. ...
4 years, 8 months ago (2016-04-22 13:54:57 UTC) #39
hlundin-webrtc
Still LGTM. https://codereview.webrtc.org/1868143002/diff/160001/webrtc/modules/audio_coding/neteq/decoder_database.cc File webrtc/modules/audio_coding/neteq/decoder_database.cc (right): https://codereview.webrtc.org/1868143002/diff/160001/webrtc/modules/audio_coding/neteq/decoder_database.cc#newcode23 webrtc/modules/audio_coding/neteq/decoder_database.cc:23: : active_decoder_type_(-1), active_cng_decoder_type_(-1) { I just realized ...
4 years, 8 months ago (2016-04-25 10:29:30 UTC) #40
kwiberg-webrtc
Still lgtm. https://codereview.webrtc.org/1868143002/diff/160001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): https://codereview.webrtc.org/1868143002/diff/160001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc#newcode173 webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc:173: rtc::ArrayView<const uint8_t>(sid_data.data(), kCNGNumParamsTooHigh + 1)); Now that ...
4 years, 8 months ago (2016-04-25 11:35:12 UTC) #41
ossu
On 2016/04/25 11:35:12, kwiberg-webrtc wrote: > Still lgtm. > > https://codereview.webrtc.org/1868143002/diff/160001/webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc > File webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc (right): ...
4 years, 8 months ago (2016-04-25 11:56:52 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868143002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868143002/180001
4 years, 7 months ago (2016-04-25 12:43:50 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL)
4 years, 7 months ago (2016-04-25 13:57:26 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868143002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868143002/180001
4 years, 7 months ago (2016-04-25 14:45:58 UTC) #49
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 7 months ago (2016-04-25 14:56:03 UTC) #51
commit-bot: I haz the power
4 years, 7 months ago (2016-04-25 14:56:11 UTC) #53
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/97ba30eedf99e84de33200b7546d5d578fe358e6
Cr-Commit-Position: refs/heads/master@{#12491}

Powered by Google App Engine
This is Rietveld 408576698