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}
By converting three raw pointers to scoped_ptrs, we can eliminate the
need for a manually-defined destructor, and generally sleep better at
night.
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1310213003 .
Cr-Commit-Position: refs/heads/master@{#9776}
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}
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}
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}
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}
Re-lands "Renamed the ACMDump to RtcEventLog and moved it to webrtc/video, since it is not specific to the audio coding module."
This reverts commit b933667a7f97697d6390d1eee5f378cedd9ca208.
R=pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1259683003 .
Cr-Commit-Position: refs/heads/master@{#9661}
Prevents presubmit failures when touching audio_coding_module.gypi due
to source files being included from outside the gypi directory.
BUG=
R=minyue@webrtc.org
Review URL: https://codereview.webrtc.org/1262333002 .
Cr-Commit-Position: refs/heads/master@{#9659}
Placed the protobuf structures in the namespace webrtc::rtclog. Removed the message field from the DebugEvent structure, since it was not used.
Added an interface to set config information for VideoReceiveStream and VideoSendStream in the event log.
Added function to log full RTCP packets and changed RTP-logging to only log headers.
Significantly extended the unit tests for RtcEventLog.
R=ivoc@webrtc.org, minyue@webrtc.org, pbos@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1230973005 .
Cr-Commit-Position: refs/heads/master@{#9656}
WebRtcIsacfix_AllpassFilter2FixDec16Neon was disabled due to a Clang
bug. The bug is fixed in current Clang version, re-enable it in this patch.
BUG=4567
R=andrew@webrtc.org, kjellander@webrtc.org
TEST=buildbot build
Change-Id: I71e309cec6caf376181cf9c299c9e8967c9a328e
Review URL: https://codereview.webrtc.org/1194773002 .
Patch from Zhongwei Yao <zhongwei.yao@arm.com>.
Cr-Commit-Position: refs/heads/master@{#9645}
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}
This patch tests separate iSAC encoder and decoder in more cases (32
kHz in addition to 16 kHz, and 30 ms adaptive and 60 ms nonadaptive).
In order to handle 32 kHz adaptive, the decoder needs to be told of
the encoder's sample rate (16 kHz worked already because that's the
default). And since we can't set the encoder's frame size without also
setting its bit rate, we need a way to set the decoder's bit rate as
well.
It turned out to be way too messy to continue verifying that the
bandwidth estimator does something reasonable in all these cases,
because it seems it doesn't. So the GetSetBandwidthInfo is now just
responsible for ensuring that split encoder/decoder behaves the same
as conjoined encoder/decoder; the job of verifying that the bandwidth
estimator does its job properly falls on some other test (that doesn't
exist yet).
Review URL: https://codereview.webrtc.org/1225093005
Cr-Commit-Position: refs/heads/master@{#9583}
They make it possible to send bandwidth estimation info from decoder
to encoder even if they are separate objects (which we want them to be
because multithreading).
R=henrik.lundin@webrtc.org
Review URL: https://codereview.webrtc.org/1208923002.
Cr-Commit-Position: refs/heads/master@{#9535}
Using random "garbage" bytes makes testing harder for no good reason.
Any deterministic sequence would do, but we choose all zeros because
it's simple.
Review URL: https://codereview.webrtc.org/1211243014
Cr-Commit-Position: refs/heads/master@{#9532}
in the ACMDump. The ACMDump interface itself is not updated, so there
is no way (yet) to actually write the configuration fields.
BUG=
Review URL: https://codereview.webrtc.org/1202833003
Cr-Commit-Position: refs/heads/master@{#9519}
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}
This change introduces the sub-class ChangeLogger in AudioCodingModuleImpl. The class writes values to the named UMA histogram, but only if the value has changed since the last time (and always for the first call). This is to avoid the problem with audio codecs being registered but never used. Before this change, these codecs' bitrate was also logged, even though they were never used.
BUG=chromium:488124
R=kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1203803004
Cr-Commit-Position: refs/heads/master@{#9506}
This CL logs the target audio bitrate to a UMA histogram called
WebRTC.Audio.TargetBitrateInKbps. It logs the rate when a codec is
created, and when the target is explicitly updated. Note that since
each codec implementation is free to change or ignore the target
value, there is no guarantee that the logged value will actually be
used as the target.
BUG=chromium:488124
Review URL: https://codereview.webrtc.org/1178053002
Cr-Commit-Position: refs/heads/master@{#9484}
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}
These tables are constant, so it makes sense for all encoders to share
one copy---but it was initialized in a racy way, and there's no
appealing way to fix that without adding dependencies on locking
functions. So we simply give each codec instance its own copy, which
costs 8 * (240 + 240 + 120 + 120) = 5760 bytes apiece.
As noted in the TODO comment, the size of the tables could be reduced,
and they could be filled in at compile-time, but that would make the
encoder output slightly different, which would mess with our tests.
R=henrik.lundin@webrtc.org, solenberg@webrtc.org
Review URL: https://codereview.webrtc.org/1177993003.
Cr-Commit-Position: refs/heads/master@{#9442}
Before this change, it could happen that a caller would get a pointer
to the encoder_ but not use it before another thread called the
Reconstruct method, changing the pointer. This of course resulted in
bad access crashes. With this change, each use of the pointer acquired
from the encoder() method is protected by the same lock that is
required to update the pointer. Note that this fix is probably too
aggressive, since it also affects the Opus implementation; the crash
has so far only been seen for iSAC.
Also adding a test to trigger the problem. The test did not trigger
the problem deterministically, but out would typically find it in less
than 1000 runs.
BUG=chromium:499468
R=jmarusic@webrtc.org, kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1176303004.
Cr-Commit-Position: refs/heads/master@{#9436}
Fix AppRTCDemo crash under iOS due to the unaligned access in vld1
instruction in iSACFix codec, which is not allowed in iOS build.
BUG=4717
R=andrew@webrtc.org, jridges@masque.com
TEST=Run the AppRTCDemo
Change-Id: Ie5fbc9b8ae88cd00b243a8e65cab95b00362a9da
Review URL: https://codereview.webrtc.org/1182493006.
Cr-Commit-Position: refs/heads/master@{#9432}
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}
This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24. Specifically, the
files in webrtc/modules/audio_coding/codecs/ that are not in ilbc/ or isac/, as
well as webrtc/modules/audio_coding/main/test/opus_test.cc, 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/1179093003
Cr-Commit-Position: refs/heads/master@{#9424}
This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24. Specifically, the
files in webrtc/modules/audio_coding/codecs/ilbc/ 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/1184643002
Cr-Commit-Position: refs/heads/master@{#9423}
This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24. Specifically, the
files in webrtc/modules/audio_coding/codecs/isac/ 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/1179093002
Cr-Commit-Position: refs/heads/master@{#9422}
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}
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}
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}