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

Issue 1227163003: 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/codecs/isac/fix/ 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: 17

Patch Set 3 : Review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -177 lines) Patch
M webrtc/modules/audio_coding/codecs/isac/fix/interface/audio_encoder_isacfix.h View 1 3 chunks +6 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h View 1 2 11 chunks +19 lines, -19 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c View 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/codec.h View 3 chunks +5 lines, -5 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/decode_bwe.c View 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c View 1 5 chunks +12 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c View 1 2 17 chunks +50 lines, -48 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/lattice.c View 1 6 chunks +9 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/lattice_c.c View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/lattice_mips.c View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c View 5 chunks +9 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_armv6.S View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_mips.c View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc View 1 12 chunks +29 lines, -26 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/fix/test/test_iSACfixfloat.c View 1 10 chunks +28 lines, -18 lines 0 comments Download

Messages

Total messages: 15 (6 generated)
Peter Kasting
5 years, 5 months ago (2015-07-23 19:27:19 UTC) #2
Peter Kasting
Changing reviewer to minyue in hopes of finding someone who is not on vacation to ...
5 years, 4 months ago (2015-07-27 23:43:44 UTC) #5
Peter Kasting
Ping
5 years, 4 months ago (2015-08-07 22:01:42 UTC) #6
minyue-webrtc
https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h File webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h (right): https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h#newcode194 webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h:194: * - packet_size : size of the packet. could ...
5 years, 4 months ago (2015-08-12 16:08:08 UTC) #7
Peter Kasting
Please try to refrain from asking me to fix unrelated style and comment issues while ...
5 years, 4 months ago (2015-08-14 22:32:26 UTC) #8
hlundin-webrtc
https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h File webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h (right): https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h#newcode182 webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h:182: size_t stretchLag; On 2015/08/14 22:32:26, Peter Kasting wrote: > ...
5 years, 4 months ago (2015-08-17 08:13:22 UTC) #10
Peter Kasting
https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h File webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h (right): https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h#newcode182 webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h:182: size_t stretchLag; On 2015/08/17 08:13:21, hlundin-webrtc wrote: > On ...
5 years, 4 months ago (2015-08-17 08:23:53 UTC) #12
minyue-webrtc
On 2015/08/17 08:23:53, Peter Kasting wrote: > https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h > File webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h (right): > > https://codereview.chromium.org/1227163003/diff/20001/webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h#newcode182 ...
5 years, 4 months ago (2015-08-17 15:46:57 UTC) #13
hlundin-webrtc
5 years, 4 months ago (2015-08-18 09:03:16 UTC) #15
I'm fine with this change, too.
LGTM.

Thanks for your efforts, Peter!

https://codereview.webrtc.org/1227163003/diff/20001/webrtc/modules/audio_codi...
File webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h (right):

https://codereview.webrtc.org/1227163003/diff/20001/webrtc/modules/audio_codi...
webrtc/modules/audio_coding/codecs/isac/fix/source/structs.h:182: size_t
stretchLag;
On 2015/08/17 08:23:53, Peter Kasting wrote:
> On 2015/08/17 08:13:21, hlundin-webrtc wrote:
> > On 2015/08/14 22:32:26, Peter Kasting wrote:
> > > On 2015/08/12 16:08:08, minyue-webrtc wrote:
> > > > I am not sure if Lag is a count. What unit does it have?
> > > 
> > > From reading caller code, I believe it's a sample count.
> > > 
> > > > Can it be negative
> > > > (non-causal)? 
> > > 
> > > It better not, or the existing code is broken, since in many places it
> indexes
> > > arrays by this value.
> > 
> > I agree with Minyue, Even though I believe it is always a positive value,
you
> > will be introducing new inconsistencies if you change this. strechLag is
often
> > given its value from another int16_t variable (lastPitchLag_Q7), which may
> > ripple even further.
> > 
> > Also, I recall that some of the signal processing code in WebRTC was written
> > with negative indexing. So just because it is used to index arrays doesn't
> > necessarily mean it is non-negative.
> 
> There are a number of lag-related variables I've changed to be size_t.  I
don't
> think changing this back in isolation makes sense, nor does trying to change
all
> these (as they interact with a variety of other variables that are also now
> size_t).  And at the core I don't think such a change makes sense
semantically;
> in the cases I've changed these, I believe these _should_ be size_t, as they
are
> e.g. sample counts.
> 
> I intentionally didn't change lastPitchLag_Q7 as its units are not precisely
> "sample counts" (due to shifting), and changing it turned out to introduce
more
> problems.  However, I did check its uses.  We only read its value in one
place,
> and I cast back to size_t appropriately at that spot.
> 
> Regarding negative indexing, there is at least one place where I caught that
and
> accommodated it, but its use should be very rare, and it isn't happening here
as
> some code does things like indexing stack-allocated buffers (so a negative
index
> is clearly wrong by inspection).
> 
> I tried multiple solutions and thought through this quite a bit while
> constructing this part of the change set, and I stand by it.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698