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

Issue 1228843002: Update audio code to use size_t more correctly, (Closed)

Created:
5 years, 5 months ago by Peter Kasting
Modified:
5 years, 4 months ago
CC:
hlundin-webrtc, kwiberg-webrtc, tlegrand-webrtc, tterriberry_mozilla.com, webrtc-reviews_webrtc.org
Base URL:
https://chromium.googlesource.com/external/webrtc@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Update audio code to use size_t more correctly, webrtc/modules/audio_coding/neteq/ portion. This is a piece of https://codereview.webrtc.org/1230503003 , split out to a separate change to make reviewing easier. BUG=chromium:81439 TEST=none

Patch Set 1 #

Patch Set 2 : Resync #

Total comments: 62

Patch Set 3 : Review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+716 lines, -699 lines) Patch
M webrtc/modules/audio_coding/neteq/accelerate.h View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/accelerate.cc View 1 2 2 chunks +5 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_impl.h View 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc View 1 12 chunks +33 lines, -45 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/background_noise.h View 3 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/background_noise.cc View 4 chunks +6 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/buffer_level_filter.h View 2 chunks +4 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/buffer_level_filter.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/comfort_noise.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic.h View 1 2 7 chunks +13 lines, -13 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic.cc View 1 2 7 chunks +11 lines, -10 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic_fax.h View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic_fax.cc View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic_normal.h View 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/decision_logic_normal.cc View 1 2 4 chunks +7 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/delay_manager.h View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/delay_manager.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/dsp_helper.h View 1 2 3 chunks +8 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/dsp_helper.cc View 1 2 5 chunks +18 lines, -19 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/dtmf_tone_generator.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/dtmf_tone_generator.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/dtmf_tone_generator_unittest.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/expand.h View 3 chunks +7 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/expand.cc View 1 2 25 chunks +57 lines, -53 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/interface/neteq.h View 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/merge.h View 1 2 2 chunks +15 lines, -15 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/merge.cc View 1 2 15 chunks +53 lines, -54 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_buffer_level_filter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_delay_manager.h View 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_dtmf_tone_generator.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h View 2 chunks +3 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc View 6 chunks +8 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl.h View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl.cc View 1 2 34 chunks +69 lines, -67 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc View 19 chunks +33 lines, -25 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc View 5 chunks +8 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_unittest.cc View 24 chunks +34 lines, -34 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/normal.cc View 1 2 7 chunks +11 lines, -11 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/packet_buffer.h View 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/packet_buffer.cc View 1 2 3 chunks +8 lines, -8 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc View 11 chunks +14 lines, -14 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/post_decode_vad.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/post_decode_vad.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/preemptive_expand.h View 4 chunks +9 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/preemptive_expand.cc View 1 2 5 chunks +8 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/random_vector.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/statistics_calculator.h View 3 chunks +19 lines, -19 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/statistics_calculator.cc View 1 2 6 chunks +15 lines, -14 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/RTPencode.cc View 1 27 chunks +92 lines, -89 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc View 4 chunks +9 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/time_stretch.h View 1 2 6 chunks +11 lines, -11 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/time_stretch.cc View 1 2 7 chunks +12 lines, -11 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/time_stretch_unittest.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/constant_pcm_packet_source.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h View 2 chunks +5 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc View 3 chunks +6 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc View 1 2 5 chunks +7 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/resample_input_audio_file.cc View 1 chunk +4 lines, -7 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
Peter Kasting
https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc File webrtc/modules/audio_coding/neteq/background_noise.cc (right): https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc#newcode25 webrtc/modules/audio_coding/neteq/background_noise.cc:25: const size_t BackgroundNoise::kMaxLpcOrder; Changing the type of this from ...
5 years, 5 months ago (2015-07-23 19:37:05 UTC) #2
Peter Kasting
Changing reviewer to turaj in hopes of finding someone who is not on vacation to ...
5 years, 4 months ago (2015-07-27 23:43:21 UTC) #5
Peter Kasting
Changing reviewers again; Tina or Henrik, could one of you review?
5 years, 4 months ago (2015-08-07 22:01:31 UTC) #7
hlundin-webrtc
Thanks for fixing up the code! I mainly have two comments on this CL, but ...
5 years, 4 months ago (2015-08-10 11:30:02 UTC) #8
Peter Kasting
Thanks for the detailed review! https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc File webrtc/modules/audio_coding/neteq/background_noise.cc (right): https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc#newcode253 webrtc/modules/audio_coding/neteq/background_noise.cc:253: parameters.scale = static_cast<int16_t>(WebRtcSpl_SqrtFloor(residual_energy)); On ...
5 years, 4 months ago (2015-08-17 22:49:47 UTC) #9
hlundin-webrtc
Thanks, Peter. LGTM. https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc File webrtc/modules/audio_coding/neteq/background_noise.cc (right): https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc#newcode253 webrtc/modules/audio_coding/neteq/background_noise.cc:253: parameters.scale = static_cast<int16_t>(WebRtcSpl_SqrtFloor(residual_energy)); On 2015/08/17 22:49:46, ...
5 years, 4 months ago (2015-08-18 07:19:19 UTC) #10
Peter Kasting
https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc File webrtc/modules/audio_coding/neteq/background_noise.cc (right): https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_coding/neteq/background_noise.cc#newcode253 webrtc/modules/audio_coding/neteq/background_noise.cc:253: parameters.scale = static_cast<int16_t>(WebRtcSpl_SqrtFloor(residual_energy)); On 2015/08/18 07:19:18, hlundin-webrtc wrote: > ...
5 years, 4 months ago (2015-08-18 20:32:08 UTC) #11
hlundin-webrtc
5 years, 4 months ago (2015-08-19 07:36:45 UTC) #12
https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_codi...
File webrtc/modules/audio_coding/neteq/background_noise.cc (right):

https://codereview.webrtc.org/1228843002/diff/20001/webrtc/modules/audio_codi...
webrtc/modules/audio_coding/neteq/background_noise.cc:253: parameters.scale =
static_cast<int16_t>(WebRtcSpl_SqrtFloor(residual_energy));
On 2015/08/18 20:32:07, Peter Kasting wrote:
> On 2015/08/18 07:19:18, hlundin-webrtc wrote:
> > On 2015/08/17 22:49:46, Peter Kasting wrote:
> > > On 2015/08/10 11:30:00, hlundin-webrtc wrote:
> > > > rtc::checked_cast
> > > 
> > > This shouldn't be necessary, since by definition the square root of a
32-bit
> > > quantity must fit in 16 bits.
> > > 
> > > If you would like, I could make this clearer by (separately) changing the
> > > signature of WebRtcSpl_SqrtFloor() to return an int16_t.  It looks like we
> > have
> > > many places in the code which already unconditionally cast this return
value
> > to
> > > int16_t, so this would enable removing all those casts.
> > 
> > That seems like a good idea, if you don't mind.
> 
> Actually, I don't think this is safe after all.  The results fit in 16 bits,
but
> that's 16 value bits, not 15 bits + a sign bit.
> 
> The explicit cast I'm adding here doesn't actually change the function of the
> code -- it just removes an "implicit cast" warning -- and we seem to get this
> wrong in numerous other places.  Rather than just fix this location, I've
filed
> a bug about this general pattern:
> https://code.google.com/p/webrtc/issues/detail?id=4924
> 
> I'd appreciate it if you could triage this bug.

I saw the bug and will triage it. Thanks for investigating!

Powered by Google App Engine
This is Rietveld 408576698