1320 Commits

Author SHA1 Message Date
henrik.lundin
b3f1c5d2fe Add NetEq::FilteredCurrentDelayMs() and use it in VoiceEngine
The new method returns the current total delay (packet buffer and sync
buffer) in ms, with smoothing applied to even out short-time
fluctuations due to jitter. The packet buffer part of the delay is not
updated during DTX/CNG periods.

This CL also pipes the new metric through ACM and uses it in
VoiceEngine. It replaces the previous method of estimating the buffer
delay (where an inserted packet's RTP timestamp was compared with the
last played timestamp from NetEq). The new method works better under
periods of DTX/CNG.

Review-Url: https://codereview.webrtc.org/2262203002
Cr-Commit-Position: refs/heads/master@{#13855}
2016-08-22 22:40:00 +00:00
ehmaldonado
6c46eaa544 Add gtest as a dependency for neteq_quality_test_support.
Was removed in Patch Set 5 of https://codereview.webrtc.org/2252413002
but shouldn't have been, since it's actually required.

https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h?l=17

BUG=webrtc:6228
NOTRY=True

Review-Url: https://codereview.webrtc.org/2262173003
Cr-Commit-Position: refs/heads/master@{#13851}
2016-08-22 16:48:11 +00:00
kwiberg
7f82fc988d WebRtcIlbcfix_Smooth: Fix UBSan fuzzer bug (left shift of 1 by 31 overflows)
scale1 == 31 if and only if w10 == 0. So even though 1 << scale1
overflows, we know that the result of the multiplication should be 0.
Handle that case.

BUG=chromium:615818

Review-Url: https://codereview.webrtc.org/2258543002
Cr-Commit-Position: refs/heads/master@{#13847}
2016-08-22 14:43:50 +00:00
ehmaldonado
861da3c662 Refactor neteq_test_support.
Take 'tools/neteq_quality_test.cc' and 'tools/neteq_quality_test.h' outside of neteq_test_support into their own target, neteq_quality_test_support.

BUG=webrtc:6228
NOTRY=True

Review-Url: https://codereview.webrtc.org/2252413002
Cr-Commit-Position: refs/heads/master@{#13831}
2016-08-19 14:02:31 +00:00
ehmaldonado
bcba64a0fa GN: Add "//build/config/sanitizers:deps" as a dependency to executable targets.
When the sanitizer bots are switched to GN, this needs to be included as a dependency so that the executables can be compiled.

BUG=webrtc:6215
NOTRY=True

Review-Url: https://codereview.webrtc.org/2250893003
Cr-Commit-Position: refs/heads/master@{#13829}
2016-08-19 09:11:15 +00:00
henrik.lundin
38d840c35a NetEq: Changing checked_cast to saturated_cast
The cast involves packet_len_samp, which is derived from the timestamps
and sequence numbers of incoming packets. Being values from the outside,
these should be treated as if any value is possible, making a
checked_cast unsuitable. Changing instead to saturated_cast to avoid
overflow with out-of-bounds values.

Review-Url: https://codereview.webrtc.org/2243403007
Cr-Commit-Position: refs/heads/master@{#13815}
2016-08-18 10:49:41 +00:00
ossu
d4e9f62ea7 Updated AudioDecoderFactory to list AudioCodecSpecs instead of SdpAudioFormats.
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2123923004
Cr-Commit-Position: refs/heads/master@{#13810}
2016-08-18 09:02:15 +00:00
ossu
c54071d8ab WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
Reland of https://codereview.webrtc.org/2072753002/ which broke
chromium due to how their build was setup. This issue should now be
resolved.

Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.

Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.

BUG=webrtc:5805
TBR=ivoc@webrtc.org

Review-Url: https://codereview.webrtc.org/2250683002
Cr-Commit-Position: refs/heads/master@{#13793}
2016-08-17 09:45:47 +00:00
aleloi
b7186d0aa7 Migrated GN target :isac_fix_test
Migrated GN target :isac_fix_test from
webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi

NOTRY=True

BUG=webrtc:6191

Review-Url: https://codereview.webrtc.org/2247233002
Cr-Commit-Position: refs/heads/master@{#13770}
2016-08-16 08:47:26 +00:00
ehmaldonado
b1e66110e3 GN: Fix audio_decoder_unittests for android.
Tested on a physical device.

BUG=webrtc:6036
NOTRY=True

Review-Url: https://codereview.webrtc.org/2241293002
Cr-Commit-Position: refs/heads/master@{#13761}
2016-08-15 19:02:08 +00:00
sakal
714dd4e532 GN: Update tests to have the correct shard timeout value on Android.
TBR=mflodman@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2231413002
Cr-Commit-Position: refs/heads/master@{#13741}
2016-08-15 09:29:19 +00:00
flim
64a7eab891 Update tests and DTX check for Opus 1.1.3.
DTX is now indicated by packets that may have a size of up to 2 bytes.
Ref: https://git.xiph.org/?p=opus.git;a=commit;h=1c311423c86b89eba27a494e17c79fefd7d75ab0

BUG=

Review-Url: https://codereview.webrtc.org/2158293003
Cr-Commit-Position: refs/heads/master@{#13736}
2016-08-12 11:36:14 +00:00
aleloi
c4ac700781 Migrated GN target :neteq_pcmu_quality_test
Migrated GN target :neteq_pcmu_quality_test from
webrtc/modules/audio_coding/neteq/neteq_tests.gypi

NOTRY=True

BUG=webrtc:6190

Review-Url: https://codereview.webrtc.org/2224313002
Cr-Commit-Position: refs/heads/master@{#13711}
2016-08-10 12:06:31 +00:00
aleloi
6df36dc054 Migrated GN target :neteq_isac_quality_test
Migrated GN target :neteq_isac_quality_test from
webrtc/modules/audio_coding/neteq/neteq_tests.gypi

NOTRY=True

BUG=webrtc:6190

Review-Url: https://codereview.webrtc.org/2226253002
Cr-Commit-Position: refs/heads/master@{#13710}
2016-08-10 12:04:51 +00:00
aleloi
0e0be0a2f5 Migrated GN target :neteq_ilbc_quality_test
Migrated GN target :neteq_ilbc_quality_test from
webrtc/modules/audio_coding/neteq/neteq_tests.gypi

NOTRY=True

BUG=webrtc:6190

Review-Url: https://codereview.webrtc.org/2221193004
Cr-Commit-Position: refs/heads/master@{#13708}
2016-08-10 11:55:29 +00:00
aleloi
6391012514 Migrated GN target :audio_classifier_test
Migrated GN target :audio_classifier_test from
webrtc/modules/audio_coding/neteq/neteq_tests.gypi

NOTRY=True

BUG=webrtc:6190

Review-Url: https://codereview.webrtc.org/2225333002
Cr-Commit-Position: refs/heads/master@{#13706}
2016-08-10 11:41:23 +00:00
aleloi
116fd61599 Migrated GN target :neteq_speed_test
Migrated GN target :neteq_speed_test from
webrtc/modules/audio_coding/neteq/neteq.gypi

NOTRY=True

BUG=webrtc:6190

Review-Url: https://codereview.webrtc.org/2223343004
Cr-Commit-Position: refs/heads/master@{#13704}
2016-08-10 11:16:45 +00:00
aleloi
630c6d58d3 Migrated GN target :neteq_opus_quality_test
Migrated GN target :neteq_opus_quality_test from
webrtc/modules/audio_coding/neteq/neteq_tests.gypi

NOTRY=True

BUG=webrtc:6190, webrtc:2692

Review-Url: https://codereview.webrtc.org/2223933004
Cr-Commit-Position: refs/heads/master@{#13701}
2016-08-10 09:11:49 +00:00
aleloi
e5106e75da Removed target rtp_to_text. The code does not even run.
NOTRY=True

BUG=webrtc:6162, webrtc:2692

Review-Url: https://codereview.webrtc.org/2199803002
Cr-Commit-Position: refs/heads/master@{#13692}
2016-08-09 13:56:16 +00:00
ehmaldonado
f98dc105ba GN: Add target for modules_tests.
Additional changes I needed to make it work:

- Modified a header in RTPFile.cc. Every other file is
  using "webrtc/engine_configurations.h" instead.

- Disabled flag 4373 for msvs because it was disabled
  in build/common.gypi.

BUG=webrtc:6038
TBR=kwiberg@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2187563005
Cr-Commit-Position: refs/heads/master@{#13628}
2016-08-03 17:46:51 +00:00
aleloi
17dfa7425f Gyp->GN migration of RTPjitter.
BUG=6162

NOTRY=True

Review-Url: https://codereview.webrtc.org/2196283002
Cr-Commit-Position: refs/heads/master@{#13620}
2016-08-03 08:17:29 +00:00
aleloi
5a74650522 Migrated GN target RTPtimeshift.
NOTRY=true

BUG=6162

Review-Url: https://codereview.webrtc.org/2201883004
Cr-Commit-Position: refs/heads/master@{#13607}
2016-08-02 13:06:39 +00:00
aleloi
5556dcb24c Migrated GN target rtpcat.
BUG=6162

Review-Url: https://codereview.webrtc.org/2202193002
Cr-Commit-Position: refs/heads/master@{#13605}
2016-08-02 11:27:32 +00:00
aleloi
76cbe19f8a Migrated RTPchange Gyp target to GN.
BUG=6162

Review-Url: https://codereview.webrtc.org/2194213002
Cr-Commit-Position: refs/heads/master@{#13601}
2016-08-02 09:05:07 +00:00
aleloi
8266773f18 Migrated target RTPencode to GN
TBR=henrik.lundin@webrtc.org

BUG=6162

Review-Url: https://codereview.webrtc.org/2195353002
Cr-Commit-Position: refs/heads/master@{#13599}
2016-08-02 08:45:58 +00:00
charujain
ddf3e4accd GN conversion of audio_decoder_unittests
BUG=webrtc 6036

Review-Url: https://codereview.webrtc.org/2180853006
Cr-Commit-Position: refs/heads/master@{#13588}
2016-08-01 14:49:50 +00:00
aleloi
e6b60a4368 Migrated audio_codec_speed_tests target to GN.
Review-Url: https://codereview.webrtc.org/2177373004
Cr-Commit-Position: refs/heads/master@{#13549}
2016-07-28 09:34:39 +00:00
aleloi
00730c724d Migrated GN target insert_packet_with_timing.
Review-Url: https://codereview.webrtc.org/2187003002
Cr-Commit-Position: refs/heads/master@{#13548}
2016-07-28 08:34:11 +00:00
aleloi
333f206f8b Target delay_test migrated to GN.
Review-Url: https://codereview.webrtc.org/2188473003
Cr-Commit-Position: refs/heads/master@{#13547}
2016-07-28 08:21:38 +00:00
ivoc
85228d6af6 Regression test for issue where Opus DTX status was being forgotten.
BUG=webrtc:6020

Review-Url: https://codereview.webrtc.org/2177263002
Cr-Commit-Position: refs/heads/master@{#13539}
2016-07-27 11:53:52 +00:00
flim
1cd46643d7 Disable some Opus tests pending an update
These tests will be reenabled and fixed after Opus 1.1.3 has landed in
Chromium and is rolled into WebRTC.

BUG=

Review-Url: https://codereview.webrtc.org/2185673002
Cr-Commit-Position: refs/heads/master@{#13534}
2016-07-26 16:01:45 +00:00
aleloi
47bded4428 GN migration of target audio_coding/neteq/rtp_analyze.
Review-Url: https://codereview.webrtc.org/2185533003
Cr-Commit-Position: refs/heads/master@{#13533}
2016-07-26 13:46:26 +00:00
aleloi
3022a34e7c GN migration of target audio_coding/neteq/neteq_test_tools
Review-Url: https://codereview.webrtc.org/2178353002
Cr-Commit-Position: refs/heads/master@{#13531}
2016-07-26 13:36:09 +00:00
ossu
f93be584f7 Revert of WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs. (patchset #10 id:200001 of https://codereview.webrtc.org/2072753002/ )
Reason for revert:
For some reason, payload_type_mapper.cc is not being picked up in Chrome builds, leading to undefined references. Reverting while investigating.

Original issue's description:
> WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
>
> Changed WebRtcVoiceEngine to present receive codecs from the formats
> provided by its decoder factory. Added supported formats to
> BuiltinAudioDecoderFactory. Added helper functions for creating some
> simple decoder factories for mocking.
>
> Created a PayloadTypeMapper for assigning payload types to formats. I
> think we'll eventually want to use this further up, or possibly in
> both the audio and video sides. It would be best if the engines didn't
> have to talk payload types at all, but it might be more difficult to
> get around when payload types depend on each-other, like the RTX
> codecs for video.
>
> This CL also includes some changes to rtc::Optional. I've put them in
> a separate CL that should (or should not) land first, making these
> changes void.
> See: https://codereview.webrtc.org/2072713002/
>
> BUG=webrtc:5805
>
> Committed: https://crrev.com/95eb1ba0db79d8fd134ae61b0a24648598684e8a
> Cr-Commit-Position: refs/heads/master@{#13459}

TBR=ivoc@webrtc.org,tina.legrand@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2151453002
Cr-Commit-Position: refs/heads/master@{#13460}
2016-07-13 13:31:37 +00:00
ossu
95eb1ba0db WebRtcVoiceEngine: Use AudioDecoderFactory to generate recv codecs.
Changed WebRtcVoiceEngine to present receive codecs from the formats
provided by its decoder factory. Added supported formats to
BuiltinAudioDecoderFactory. Added helper functions for creating some
simple decoder factories for mocking.

Created a PayloadTypeMapper for assigning payload types to formats. I
think we'll eventually want to use this further up, or possibly in
both the audio and video sides. It would be best if the engines didn't
have to talk payload types at all, but it might be more difficult to
get around when payload types depend on each-other, like the RTX
codecs for video.

This CL also includes some changes to rtc::Optional. I've put them in
a separate CL that should (or should not) land first, making these
changes void.
See: https://codereview.webrtc.org/2072713002/

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2072753002
Cr-Commit-Position: refs/heads/master@{#13459}
2016-07-13 13:05:32 +00:00
ossu
108ecec51c Removed LEGACY_BITEXACT from neteq_impl.cc and updated the ACM unit tests.
I'll be rewriting AcmReceiver soon and am trying to reduce the amount of
old stuff that needs to be supported.

I've manually checked the outputs of the AcmReceiver bitexactness
tests with this change. A large part of the tests are still bitexact,
with one section only differing slightly in timings. Nothing audible
unless playing the old and new versions back simultaneously.

The output of NetEqDecoderTest were also changed due to this CL, although only on android. I built and ran the test locally and compared the audio output manually - the changes were the same as for the other tests; i.e. very slight timing changes for a part of the output.

I updated the network stats checksum for android without analyzing it further. I expect it goes hand-in-hand with the changes to the output; i.e. the changes in it are fine because the audio output is fine. Likely, the stats will show changes in the usage of CNG, since that is what the code changes.

BUG=webrtc:1361

Review-Url: https://codereview.webrtc.org/2117763002
Cr-Commit-Position: refs/heads/master@{#13415}
2016-07-08 15:45:26 +00:00
ossu
63fb95a68d Fixed time moving backwards in the AudioCodingModule.
There was a fast path in PreprocessToAddData that would just use the
input timestamps if the input format was equal to the required format of
the encoder. This works well as long as the codec never changes. If we
are first doing resampling (specifically upsampling) and then change to
a codec that does not require resampling, we'll need to stick to
whatever input timestamp we left off at, rather than silently accepting
whatever we're sent.

BUG=622435

Review-Url: https://codereview.webrtc.org/2119393002
Cr-Commit-Position: refs/heads/master@{#13398}
2016-07-06 16:34:31 +00:00
kwiberg
3f81fcd2e8 Don't recreate the speech encoder if we don't have to
If the specification for the speech encoder hasn't changed, we should
reuse it instead of recreating it. Otherwise, we lose its state. (This
problem was originally discovered because AudioEncoderOpus instances
would forget that they were supposed to be using DTX.)

BUG=webrtc:6020, chromium:622647

Review-Url: https://codereview.webrtc.org/2089183002
Cr-Commit-Position: refs/heads/master@{#13273}
2016-06-23 10:58:45 +00:00
henrik.lundin
d5f50a1b53 NetEq: Fix a bug in DelayPeakDetector causing asserts to trigger
In some situation, typically when incoming packets were reordered, the
DelayPeakDetector::Update method may be called twice (or more) with
non-zero inter_arrival_time argument, but without the TickTimer object
being updated in between (i.e., packets coming in more or less at the
same time). In these situations, a delay peak may be registered with
zero peak period. This could eventually trigger the DCHECK in
DelayPeakDetector::MaxPeakPeriod().

With this fix, the problem is solved by not registering peaks for which
the TickTimer object has not moved since the last peak.

The problem was originally introduced with
https://codereview.webrtc.org/1921163003.

BUG=webrtc:6021

Review-Url: https://codereview.webrtc.org/2085233002
Cr-Commit-Position: refs/heads/master@{#13257}
2016-06-22 16:07:07 +00:00
henrik.lundin
e8a77e3309 Refactor neteq_rtpplay
This change is a major refactoring of the neteq_rtpplay tool. It
consists of the following parts:

- NetEqTest class: Breaks out the main simulation loop from
  neteq_rtpplay into a separate class with well defined inputs and
  outputs.
- NetEqInput: Interface class for the input to NetEqTest.
- NetEqPacketSourceInput: Implementation of NetEqInput that provides a
  PacketSource objects with a NetEqInput interface. This has two
  subclasses; one for RtpFileSource and one for RtcEventLogSource.
- NetEqReplacementInput: An object that modifies the packets provided by
  another NetEqInput object, and replaces the packet payloads with meta
  data readable by a FakeDecodeFromFile decoder.
- FakeDecodeFromFile: An AudioDecoder implementation that produces
  "decoded" data by reading from an audio file.

BUG=webrtc:2692, webrtc:5447

Review-Url: https://codereview.webrtc.org/2020363003
Cr-Commit-Position: refs/heads/master@{#13252}
2016-06-22 13:34:08 +00:00
henrik.lundin
03153f1032 GN: Add neteq_rtpplay and rtc_event_log_source
BUG=webrtc:5949

Review-Url: https://codereview.webrtc.org/2081113003
Cr-Commit-Position: refs/heads/master@{#13239}
2016-06-21 12:38:48 +00:00
kwiberg
44bf02fba2 Remove SdpAudioFormat's default constructor
We didn't really want it; it was only necessary because we wanted to
use rtc::Optional<SdpAudioFormat>, and Optional used to require the
contained type to be default constructable. But as of May 9th
(https://codereview.webrtc.org/1896833004), it no longer does.

Review-Url: https://codereview.webrtc.org/2066233002
Cr-Commit-Position: refs/heads/master@{#13211}
2016-06-20 09:39:53 +00:00
kwiberg
c13ded54ca Move AudioCodingModuleImpl to anonymous namespace in audio_coding_module.cc
AudioCodingModuleImpl is the only implementation of the
AudioCodingModule interface (except for test mocks). So it's a good
fit to put it in an anonymous namespace in the interface's .cc file,
to ensure that no one except AudioCodingModule::Create ever references
it.

Except for moving code, this CL introduces two other small changes:

  * It cleans up the set of #includes in audio_coding_module.cc.
    Specifically, I removed #includes that were already present in
    audio_coding_module.h, and did not bring along any #includes from
    audio_coding_module_impl.h and .cc except those that were
    necessary to get it to compile.

  * It moves AudioCodingModuleImpl from the webrtc::acm2 to the
    webrtc::<anonymous> namespace. This means I had to qualify a few
    things it references with acm2::.

Review-Url: https://codereview.webrtc.org/2069723003
Cr-Commit-Position: refs/heads/master@{#13191}
2016-06-17 13:00:52 +00:00
Niels Möller
fc3a8ee47b Delete unused code.
* Unused audio_coding and video_coding test code.
* Obsolete voice_engine android test app.
* Left-over placeholder files for remoteaudiotrack and
  portallocatorfactory.

In addition, change modules.gyp dependency from rtc_base to
rtc_base_approved.

BUG=
R=henrik.lundin@webrtc.org, henrika@webrtc.org, pbos@webrtc.org, tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13166}
2016-06-16 13:51:40 +00:00
kwiberg
342f74005f NetEq: Ask AudioDecoder for sample rate instead of passing it as an argument
BUG=webrtc:5801
NOTRY=true

Review-Url: https://codereview.webrtc.org/2027993002
Cr-Commit-Position: refs/heads/master@{#13162}
2016-06-16 10:18:09 +00:00
kwiberg
347d35129e AudioDecoder: Remove the default implementation of SampleRateHz
And implement SampleRateHz in a bunch of mocks.

BUG=webrtc:5801
NOTRY=true

Review-Url: https://codereview.webrtc.org/2029543002
Cr-Commit-Position: refs/heads/master@{#13161}
2016-06-16 08:59:13 +00:00
kwiberg
ceb9d0cc29 Audio decoder factory test: Ensure that g722's sample rate is 16 kHz, not 8 kHz
Review-Url: https://codereview.webrtc.org/2068133002
Cr-Commit-Position: refs/heads/master@{#13153}
2016-06-15 12:55:22 +00:00
kwiberg
6808419068 iSAC decoder: Remove obsolete TODO
NOTRY=true

Review-Url: https://codereview.webrtc.org/2069993002
Cr-Commit-Position: refs/heads/master@{#13152}
2016-06-15 12:54:20 +00:00
kjellander
fb11424551 GN: Add modules_unittests
Changes:
* Enabled protobuf for iOS globally.
* Set WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE on a global
scope similar to GYP since tests depend on it.
* Added missing rtc_libvpx_build_vp9 variable.
* Moved out audio_coding defines into .gni file to avoid code duplication
* Renamed files to avoid object naming conflicts that GN disallows:
  * webrtc/modules/audio_processing/{echo_cancellation_unittest.cc->echo_cancellation_bit_exact_unittest.cc}
  * webrtc/modules/video_coding/codecs/vp9/{screenshare_layers_unittest.cc->vp9_screenshare_layers_unittest.cc}

BUG=webrtc:5949
TESTED=Built and ran the tests on Mac. Also ran:
gn gen out/Default --args="rtc_enable_bwe_test_logging=true"
and verified that more objects are being built (1885 vs 1883)
when compiling modules_unittests.

NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2041233006
Cr-Commit-Position: refs/heads/master@{#13108}
2016-06-13 07:19:53 +00:00
henrik.lundin
919518613f NetEq: Rename Nack to NackTracker to avoid name collisions in GN
BUG=webrtc:5949
NOTRY=True
R=kjellander@webrtc.org

Review-Url: https://codereview.webrtc.org/2045243002
Cr-Commit-Position: refs/heads/master@{#13069}
2016-06-08 13:43:49 +00:00