Commit Graph

276 Commits

Author SHA1 Message Date
d6d27e7340 Update isolate.gypi to support Swarming + move .isolate files
This updates the isolate.gypi copies we have to maintain in our
code repo to Chromium's revision 310ea93.
The changes about generating .isolated.gen.json files are needed
to support running with Swarming (https://www.chromium.org/developers/testing/isolated-testing)

Since isolated testing is now using a new launch script
in tools: isolate_driver.py, that's added to our links
script.

In order to use isolate_driver.py, the .isolate files must be in the
same directory as the test_name_run target is defined, which meant
I had to move around some of the isolate files and targets below
webrtc/modules.

BUG=497757
R=maruel@chromium.org
TBR=henrik.lundin@webrtc.org, mflodman@webrtc.org, niklas.enbom@webrtc.org
TESTED=Clobbered trybots:
git cl try -c --bot=linux_compile_rel --bot=mac_compile_rel --bot=win_compile_rel --bot=android_compile_rel --bot=ios_rel -m tryserver.webrtc

Review URL: https://codereview.webrtc.org/1373513002 .

Cr-Commit-Position: refs/heads/master@{#10081}
2015-09-25 20:19:21 +00:00
5c389d3e09 Split webrtc/video into webrtc/{audio,call,video}.
Moves audio_receive_stream.{h,cc} into webrtc/audio, and common parts
into webrtc/call, splitting out audio/shared components with separate
OWNERS files.

BUG=webrtc:4690
R=solenberg@webrtc.org, tina.legrand@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://codereview.webrtc.org/1227923005 .

Cr-Commit-Position: refs/heads/master@{#10073}
2015-09-25 11:58:39 +00:00
3fd7be4cb1 Revert of Don't link with audio codecs that we don't use (patchset #4 id:60001 of https://codereview.webrtc.org/1349393003/ )
Reason for revert:
Breaking Chromium FYI bots.

Original issue's description:
> Don't link with audio codecs that we don't use
>
> We used to link with all audio codecs unconditionally (except Opus);
> this patch makes gyp and gn only link to the ones that are used.
>
> (This unfortunately fails to have a measurable impact on Chromium
> binary size, at least on x86_64 Linux; it turns out that iLBC and iSAC
> fix were already being excluded from Chromium by some other means
> (likely just the linker omitting compilation units with no incoming
> references).)
>
> BUG=webrtc:4557
>
> Committed: https://crrev.com/f66a9251424351ea6d631c54dd1feb64cc13d809
> Cr-Commit-Position: refs/heads/master@{#10046}

TBR=henrik.lundin@webrtc.org,tina.legrand@webrtc.org,kjellander@webrtc.org,kwiberg@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1368933002

Cr-Commit-Position: refs/heads/master@{#10069}
2015-09-25 08:36:11 +00:00
f66a925142 Don't link with audio codecs that we don't use
We used to link with all audio codecs unconditionally (except Opus);
this patch makes gyp and gn only link to the ones that are used.

(This unfortunately fails to have a measurable impact on Chromium
binary size, at least on x86_64 Linux; it turns out that iLBC and iSAC
fix were already being excluded from Chromium by some other means
(likely just the linker omitting compilation units with no incoming
references).)

BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1349393003

Cr-Commit-Position: refs/heads/master@{#10046}
2015-09-24 10:18:48 +00:00
6d92bf59f3 Returning correct duration estimate on Opus DTX packets.
Bug 4985 revealed two flaws
1. Opus duration estimate did not return correct length for DTX packets,

2. NetEq DoCodecInternalCng did not assign enough buffer.

P.S.
Generalizing problem 1, current NetEq decode function checks memory size by calling the duration estimate function. This is not ideal. A better way is to let codec's decode function to receive buffer size and return failure if it is not enough. This can be made in a separate CL.

BUG=webrtc:4985
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1334303005 .

Cr-Commit-Position: refs/heads/master@{#10031}
2015-09-23 13:20:56 +00:00
8967183bf7 Simple cleanups of AudioDecoder and AudioEncoder classes
* Make sure they're all final and don't allow copying or assignment.

  * Get rid of the single-channel PCM decoder classes.

  * Move some includes from .h to .cc files where possible.

BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1353803002

Cr-Commit-Position: refs/heads/master@{#10021}
2015-09-22 21:06:34 +00:00
7404368998 Move AudioDecoderIsac* to its own files
Currently, it's sitting in AudioEncoderIsac*'s files, which is less
than obvious. This CL puts the encoder and decoder in separate files
together with the C implementation; CLs are afoot to make it so for
the other built-in codecs as well.

BUG=webrtc:4557
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1339253003 .

Cr-Commit-Position: refs/heads/master@{#10018}
2015-09-22 17:31:52 +00:00
6faf5bebba Move AudioDecoderPcm* next to AudioEncoderPcm*
All AudioDecoder subclasses have historically lived in NetEq, but they
fit better with the codec they wrap.

BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1348613003

Cr-Commit-Position: refs/heads/master@{#10015}
2015-09-22 13:16:56 +00:00
11d583f414 Fix a bug in RtpFileSource related to RTCP packets in rtpdump files
According to http://www.cs.columbia.edu/irt/software/rtptools/#rtpdump,
RTCP packets are marked with plen==0. In this class, plen is mapped to
original_length, not length.

Review URL: https://codereview.webrtc.org/1356543002

Cr-Commit-Position: refs/heads/master@{#9981}
2015-09-18 08:28:14 +00:00
ada4c130ab Move AudioDecoderG722 next to AudioEncoderG722
All AudioDecoder subclasses have historically lived in NetEq, but they
fit better with the codec they wrap.

BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1346993002

Cr-Commit-Position: refs/heads/master@{#9966}
2015-09-17 10:12:38 +00:00
91d6edef35 Add RTC_ prefix to (D)CHECKs and related macros.
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.

Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.

BUG=chromium:468375
NOTRY=true

Review URL: https://codereview.webrtc.org/1335923002

Cr-Commit-Position: refs/heads/master@{#9964}
2015-09-17 07:24:51 +00:00
c0ac6cad00 Move AudioDecoderPcm16B next to AudioEncoderPcm16B
All AudioDecoder subclasses have historically lived in NetEq, but they
fit better with the codec they wrap.

BUG=webrtc:4557
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1348113002 .

Cr-Commit-Position: refs/heads/master@{#9963}
2015-09-17 05:47:55 +00:00
fff9f176f5 Move AudioDecoderIlbc next to AudioEncoderIlbc
All AudioDecoder subclasses have historically lived in NetEq, but they
fit better with the codec they wrap.

BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1348053002

Cr-Commit-Position: refs/heads/master@{#9961}
2015-09-17 04:26:39 +00:00
844a91081e Remove the preprocessor symbol WEBRTC_CODEC_PCM16 (it was always defined)
BUG=webrtc:4557

Review URL: https://codereview.webrtc.org/1336923002

Cr-Commit-Position: refs/heads/master@{#9955}
2015-09-16 16:42:26 +00:00
3c089d751e Add RTC_ prefix to contructormagic macros.
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.

* DISALLOW_ASSIGN -> RTC_DISALLOW_ASSIGN
* DISALLOW_COPY_AND_ASSIGN -> RTC_DISALLOW_COPY_AND_ASSIGN
* DISALLOW_IMPLICIT_CONSTRUCTORS -> RTC_DISALLOW_IMPLICIT_CONSTRUCTORS

Related CL: https://codereview.webrtc.org/1335923002/

BUG=chromium:468375
NOTRY=true

Review URL: https://codereview.webrtc.org/1345433002

Cr-Commit-Position: refs/heads/master@{#9953}
2015-09-16 12:37:52 +00:00
0b05879cd7 Move AudioDecoderOpus next to AudioEncoderOpus
All AudioDecoder subclasses have historically lived in NetEq, but they
fit better with the codec they wrap.

BUG=webrtc:4557
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1342933005 .

Cr-Commit-Position: refs/heads/master@{#9944}
2015-09-15 15:28:29 +00:00
caa5f4b3d2 Update to the neteq_rtpplay utility to support RtcEventLog input files.
This CL adds support for simulating neteq using stored RTP packets as well as calls to GetAudio from an RtcEventLog, using the stored timestamps.
The type of the input file is detected automatically.
BUG=webrtc:4741

Review URL: https://codereview.webrtc.org/1316903002

Cr-Commit-Position: refs/heads/master@{#9886}
2015-09-08 10:28:53 +00:00
05f71fcb61 NetEq: Fixing a corner case with depleted sync buffer
In some cases, the number of samples (per channel) in NetEq's sync
buffer could fall below the allowed minimum (5 samples for narrowband,
scaling for other rates). If the number of samples extracted from the
buffer was smaller than the desired number, an error is
returned. However, if the decoder returns fewer samples than expected,
it could happen that the sync buffer level falls under the minimum,
but enough samples are extracted. This triggered an assert. With this
change, the minimum level of the sync buffer is always enforced.

A test is implemented to trigger the problem. It made the assert fire
without this fix, but it now passes.

BUG=webrtc:4840
R=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1324453002 .

Cr-Commit-Position: refs/heads/master@{#9828}
2015-09-01 09:52:06 +00:00
3c4ef29140 NetEq: Allow negative shift in BackgroundNoise::SaveParameters
This change allows a shift factor to be negative.  This is the way it
was in the old (NetEq3) code; see
4d363ae305/webrtc/modules/audio_coding/neteq/bgn_update.c,
lines 183-188.

Some input signals can lead to negative shifts, and would then trigger
an assert. The assert is now removed.

BUG=webrtc:4840
R=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1315833003 .

Cr-Commit-Position: refs/heads/master@{#9816}
2015-08-31 08:18:45 +00:00
1380e266ff Convert some more things to size_t.
These changes stem from requests by Andrew on https://codereview.webrtc.org/1228823002/ to eliminate some "return -1"s and change to using asserts plus returning size_ts.  I then also converted the relevant connected bits.

This also cleans up a bunch of style issues, e.g. no spaces around operators.

BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, henrik.lundin@webrtc.org, niklas.enbom@webrtc.org

Review URL: https://codereview.webrtc.org/1305983003 .

Cr-Commit-Position: refs/heads/master@{#9813}
2015-08-29 00:31:15 +00:00
98f3cc54da NetEq: Removing two asserts
These asserts cover error cases that are also handled by the code
after the assert. Should not have both assert and error handling.

BUG=webrtc:4840

Review URL: https://codereview.webrtc.org/1321023002

Cr-Commit-Position: refs/heads/master@{#9804}
2015-08-28 08:12:26 +00:00
1e346b20c4 NetEq: Minor follow-up fix in StatisticsCalculator
This change follows the recommendation of a post-commit comment in
r9778:
https://codereview.webrtc.org/1296633002/diff/100001/webrtc/modules/audio_coding/neteq/statistics_calculator.cc#newcode198

TBR=pkasting@chromium.org

Review URL: https://codereview.webrtc.org/1319953002

Cr-Commit-Position: refs/heads/master@{#9803}
2015-08-27 20:41:10 +00:00
116c84e1b0 NetEq: Fixing a bug that caused rtc::checked_cast to trigger
This is a bug that was introduced in
https://codereview.webrtc.org/1230503003, where the variable "int
temp_bufsize" was changed to a size_t. If the packet buffer was
flushed while inserting a packet, temp_bufsize became negative, which
was tested later in an if-statement. Now, with size_t instead, it
would just become very large, and the if-statement would never see a
negative value. The effect was that the packet size in samples could
be updated with a very large positive number, causing an overflow
which triggered rtc::checked_cast in
StatisticsCalculator::GetNetworkStatistics, line 220.

Also adding a test to reproduce the crash. Without the fix, the test
results in the above mentioned checked_cast to trigger. With the fix,
everything works fine.

BUG=chromium:525260

Review URL: https://codereview.webrtc.org/1307893004

Cr-Commit-Position: refs/heads/master@{#9802}
2015-08-27 20:14:54 +00:00
9c3efd0052 Reland: Implement NetEq's CurrentDelay function
This was not implemented before. It returns the current total delay
(packet buffer and sync buffer) of NetEq. This is the same information
that was already available in
NetEqNetworkStatistics::current_buffer_size_ms, that can be obtained
through NetEq::NetworkStatistics(). But, since the current delay is a
key metric of NetEq, it is convenient to have it available in a
simpler way.

This is a re-landing of r9359,
https://webrtc-codereview.appspot.com/51149004, which was reverted in
r9360. The refactoring made in r9669 facilitated the relanding.

TBR=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1313873003

Cr-Commit-Position: refs/heads/master@{#9801}
2015-08-27 20:12:27 +00:00
4376648df0 AudioDecoder: Replace Init() with Reset()
The Init() method was previously used to initialize and reset
decoders, and returned an error code. The new Reset() method is used
for reset only; the constructor is now responsible for fully
initializing the AudioDecoder.

Reset() doesn't return an error code; it turned out that none of the
functions it ended up calling could actually fail, so this CL removes
their error return codes as well.

R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1319683002 .

Cr-Commit-Position: refs/heads/master@{#9798}
2015-08-27 13:22:21 +00:00
1bb8cf846d NetEq/ACM: Refactor how packet waiting times are calculated
With this change, the aggregates for packet waiting times are
calculated in NetEq's StatisticsCalculator insead of in
AcmReceiver. This simplifies things somewhat, and avoids having to
copy the raw data on polling.

R=ivoc@webrtc.org, minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1296633002 .

Cr-Commit-Position: refs/heads/master@{#9778}
2015-08-25 11:08:17 +00:00
dce40cf804 Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.

This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.

This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002

The change is being landed as TBR to all the folks who reviewed the above.

BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher

Review URL: https://codereview.webrtc.org/1230503003 .

Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 21:52:45 +00:00
608c3cfe77 iSAC: Make separate AudioEncoder and AudioDecoder objects
The only shared state is now the bandwidth estimation info.
This reduces the amount and complexity of the locking
substantially.

Review URL: https://codereview.webrtc.org/1208993010

Cr-Commit-Position: refs/heads/master@{#9762}
2015-08-24 09:03:28 +00:00
1f4ffe02fb NetEq: Implement two UMA stats for delay adaptation.
This CL adds calculation and logging of average excess buffer delay
and number of delayed packet outage events per minute.

The first is the average of time spent in the packet buffer for all
packets. The average is calculated for intervals of one minute, and
the result is logged to the UMA stat
WebRTC.Audio.AverageExcessBufferDelayMs.

The second is a counter of delayed packet outage events that is
restarted every minute, and the result is logged to the UMA stat
WebRTC.Audio.DelayedPacketOutageEventsPerMinute. For a description of
delayed packet outages, see previous CL implementing a duration log
for these events.

BUG=webrtc:4915, chromium:488124
R=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1287333005 .

Cr-Commit-Position: refs/heads/master@{#9731}
2015-08-19 08:47:00 +00:00
bef77e234f NetEq: Implement logging of Delayed Packet Outage Events
Measures the duration of each packet loss concealment (a.k.a. expand)
event that is not followed by a merge operation.

Having decoded and played packet m−1, the next expected packet is
m. If packet m arrives after some time of packet loss concealment, we
have a delayed packet outage event. However, if instead packet n>m
arrives, we have a lost packet outage event. In NetEq, the two outage
types results in different operations. Both types start with expand
operations to generate audio to play while the buffer is empty. When a
lost packet outage happens, the expand operation(s) are followed by
one merge operation. For delayed packet outages, merge is not done,
and the expand operations are immediately followed by normal
operations.

This change also includes unit tests for the new statistics.

BUG=webrtc:4915, chromium:488124
R=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1290113002 .

Cr-Commit-Position: refs/heads/master@{#9725}
2015-08-18 12:58:20 +00:00
4cee419e07 Separating voice activity flag from audio level in RtpHeaderExtension.
VAD flag was embedded in RtpHeaderExtension.audioLevel, which is not easy to interpret. This CL tries to separate the flag with the actual audio level.

BUG=
R=andrew@webrtc.org, henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1272343003 .

Cr-Commit-Position: refs/heads/master@{#9691}
2015-08-10 13:08:46 +00:00
d67a219bec Switch to base/logging.h in neteq_impl.cc
This change includes base/logging.h instead of the old and deprecated
system_wrappers/interface/logging.h. This requires some changes of the
actual logging invocations.

For reference the following regexps where used (in Eclipse) for a few
of the replacements:

find: LOG_FERR1\(\s*([^,]*),\s*([^,]*),\s*(.*)\);
replace: LOG($1) << "$2 " << $3;

find: LOG_FERR2\(\s*([^,]*),\s*([^,]*),\s*([^,]*),\s*(.*)\);
replace: LOG($1) << "$2 " << $3 << " " << $4;

BUG=4735
R=minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50229004 .

Cr-Commit-Position: refs/heads/master@{#9669}
2015-08-03 10:55:11 +00:00
b297c5a01f Miscellaneous changes split from https://codereview.webrtc.org/1230503003 .
These are mostly trivial changes and are separated out just to reduce the
diff on that change to the minimum possible.

Note explanatory comments on patch set 1.

BUG=none
TEST=none

Review URL: https://codereview.webrtc.org/1235643003

Cr-Commit-Position: refs/heads/master@{#9617}
2015-07-22 22:17:26 +00:00
c6891248b5 Simplify OWNERS structure in modules/audio_coding
All ownership is now handled by the top-level OWNERS file in
modules/audio_coding.

NOTRY=True

Review URL: https://codereview.webrtc.org/1212133005

Cr-Commit-Position: refs/heads/master@{#9512}
2015-06-29 11:54:50 +00:00
3e89dbf458 Add AudioEncoder::GetTargetBitrate
The GetTargetBitrate implementation will return the
target bitrate of the codec. This may differ from the
desired target bitrate, as set by SetTargetBitrate, depending on implementation.

Tests are updated to exercise the new functionality.

R=kwiberg@webrtc.org

Review URL: https://codereview.webrtc.org/1184313002.

Cr-Commit-Position: refs/heads/master@{#9461}
2015-06-18 12:58:46 +00:00
1d34fe979c Adds support for webrtc::test::ResourcePath on iOS
BUG=webrtc:4752
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1178843002.

Cr-Commit-Position: refs/heads/master@{#9445}
2015-06-16 08:04:24 +00:00
36b7cc3264 Reland "Upconvert various types to int.", neteq portion.
This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24.  Specifically, the
files in webrtc/modules/audio_coding/neteq/ are relanded.

The original commit message is below:

Upconvert various types to int.

Per comments from HL/kwiberg on https://webrtc-codereview.appspot.com/42569004 , when there is existing usage of mixed types (int16_t, int, etc.), we'd prefer to standardize on larger types like int and phase out use of int16_t.

Specifically, "Using int16 just because we're sure all reasonable values will fit in 16 bits isn't usually meaningful in C."

This converts some existing uses of int16_t (and, in a few cases, other types such as uint16_t) to int (or, in a few places, int32_t).  Other locations will be converted to size_t in a separate change.

BUG=none
TBR=kwiberg

Review URL: https://codereview.webrtc.org/1181073002

Cr-Commit-Position: refs/heads/master@{#9427}
2015-06-12 02:57:28 +00:00
728d9037c0 Reformat existing code. There should be no functional effects.
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org

Review URL: https://codereview.webrtc.org/1172163004

Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 21:31:48 +00:00
b7e5054414 Match existing type usage better.
This makes a variety of small changes to synchronize bits of code using different types, remove useless code or casts, and add explicit casts in some places previously doing implicit ones.  For example:

* Change a few type declarations to better match how the majority of code uses those objects.
* Eliminate "< 0" check for unsigned values.
* Replace "(float)sin(x)", where |x| is also a float, with "sinf(x)", and similar.
* Add casts to uint32_t in many places timestamps were used and the existing code stored signed values into the unsigned objects.
* Remove downcasts when the results would be passed to a larger type, e.g. calling "foo((int16_t)x)" with an int |x| when foo() takes an int instead of an int16_t.
* Similarly, add casts when passing a larger type to a function taking a smaller one.
* Add casts to int16_t when doing something like "int16_t = int16_t + int16_t" as the "+" operation would implicitly upconvert to int, and similar.
* Use "false" instead of "0" for setting a bool.
* Shift a few temp types when doing a multi-stage calculation involving typecasts, so as to put the most logical/semantically correct type possible into the temps.  For example, when doing "int foo = int + int; size_t bar = (size_t)foo + size_t;", we might change |foo| to a size_t and move the cast if it makes more sense for |foo| to be represented as a size_t.

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kwiberg@webrtc.org
TBR=andrew, asapersson, henrika

Review URL: https://codereview.webrtc.org/1168753002

Cr-Commit-Position: refs/heads/master@{#9419}
2015-06-11 19:56:03 +00:00
cb180976dd Revert "Upconvert various types to int."
This reverts commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24.

BUG=499241
TBR=hlundin

Review URL: https://codereview.webrtc.org/1179953003

Cr-Commit-Position: refs/heads/master@{#9418}
2015-06-11 19:42:42 +00:00
f045e4da43 Prepare to convert various types to size_t.
This makes some behaviorally-invariant changes to make certain code that
currently only works correctly with signed types work safely regardless of the
signedness of the types in question.  This is preparation for a future change
that will convert a variety of types to size_t.

There are also some formatting changes (e.g. converting "enum hack" usage to real consts) to make it simpler to just change "int" to "size_t" in the future to change the types of those constants.

BUG=none
R=andrew@webrtc.org, juberti@webrtc.org, kwiberg@webrtc.org
TBR=ajm

Review URL: https://codereview.webrtc.org/1174813003

Cr-Commit-Position: refs/heads/master@{#9413}
2015-06-11 04:15:51 +00:00
786dbdcc38 Rename targets to use lower case format.
It makes writing a build script for merging libraries
across architectures easier. See talk/build/build_ios_libs.sh.

BUG=
R=andrew@webrtc.org, kjellander@webrtc.org

Review URL: https://codereview.webrtc.org/1171793002.

Cr-Commit-Position: refs/heads/master@{#9412}
2015-06-10 20:45:12 +00:00
a2c79405b4 Ensures that modules_unittests runs on iOS
BUG=4752
R=tkchin@chromium.org

Review URL: https://codereview.webrtc.org/1171033002.

Cr-Commit-Position: refs/heads/master@{#9408}
2015-06-10 11:24:58 +00:00
2a10087d5e Manual cleanups following clang-formatting.
This primarily addresses two things:
* Tab characters still present, mostly in comments
* printfs split across multiple lines in a suboptimal way

Along the way this fixes a few spelling errors and other minor changes.

BUG=none
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/52689004

Cr-Commit-Position: refs/heads/master@{#9406}
2015-06-10 00:26:48 +00:00
83ad33a8ae Upconvert various types to int.
Per comments from HL/kwiberg on https://webrtc-codereview.appspot.com/42569004 , when there is existing usage of mixed types (int16_t, int, etc.), we'd prefer to standardize on larger types like int and phase out use of int16_t.

Specifically, "Using int16 just because we're sure all reasonable values will fit in 16 bits isn't usually meaningful in C."

This converts some existing uses of int16_t (and, in a few cases, other types such as uint16_t) to int (or, in a few places, int32_t).  Other locations will be converted to size_t in a separate change.

BUG=none
R=andrew@webrtc.org, kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/54629004

Cr-Commit-Position: refs/heads/master@{#9405}
2015-06-10 00:20:09 +00:00
248b0b0790 Run clang-format --style=Chromium on four files I'm otherwise touching.
The existing style in these files is pretty inconsistent and wildly divergent
from most of WebRTC/Chromium; clang-formatting them not only makes them easier
to read, it makes me see fewer presubmit errors when I try to touch the files to
make other changes.

BUG=none
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/52019004

Cr-Commit-Position: refs/heads/master@{#9364}
2015-06-03 19:32:55 +00:00
5abd3e1f98 Revert r9359 "Implement NetEq's CurrentDelay function"
This reverts commit d8a03facf6986a011c8f889c63d87f9216a1e912, since it
broke the Chrome build. Will have to swap to using base/logging.h in
neteq_impl.cc before re-landing this change.

TBR=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50219004

Cr-Commit-Position: refs/heads/master@{#9360}
2015-06-03 10:58:52 +00:00
d8a03facf6 Implement NetEq's CurrentDelay function
This was not implemented before. It returns the current total delay (packet buffer and sync buffer) of NetEq. This is the same information that was already available in NetEqNetworkStatistics::current_buffer_size_ms, that can be obtained through NetEq::NetworkStatistics(). But, since the current delay is a key metric of NetEq, it is convenient to have it available in a simpler way.

R=kwiberg@webrtc.org, minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51149004

Cr-Commit-Position: refs/heads/master@{#9359}
2015-06-03 09:55:53 +00:00
f69f1fbc98 Testing and improving NADA algorithm.
A modified operation mode was added, holding:
--- Stricter conditions for AcceleratedRampUp.
--- Smoother GradualRateUpdate adjustments.
--- New AcceleratedRampDown update mode.
This mode reduces significantly the delay for bitrates around its minimum bound.

Several NADA unittests and a few simulations were added.

Fixed LinkedSet bug.
Fixed IsNewerSequenceNumber/IsNewerTimestamp bug.

BUG=4550
R=stefan@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/54399004

Cr-Commit-Position: refs/heads/master@{#9340}
2015-05-30 15:49:32 +00:00
cf808d2366 Add new fast mode for NetEq's Accelerate operation
This change instroduces a mode where the Accelerate operation will be
more aggressive. When enabled, it will allow acceleration at lower
correlation levels, and possibly remove multiple pitch periods at
once.

The feature is enabled through NetEq::Config, and is off by
default. This means that bit-exactness tests are currently not
affected.

A unit test was added for the Accelerate class, with and without fast
mode enabled.

BUG=4691
R=minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/50039004

Cr-Commit-Position: refs/heads/master@{#9295}
2015-05-27 12:33:39 +00:00