Commit Graph

494 Commits

Author SHA1 Message Date
cde46b7278 Resolve cyclic dependency between audio network adaptor and event log api
BUG=webrtc:7257

Review-Url: https://codereview.webrtc.org/2745473003
Cr-Commit-Position: refs/heads/master@{#17565}
2017-04-06 12:59:10 +00:00
28dc285f22 Adding cbr support for Opus
BUG=webrtc:7394

Review-Url: https://codereview.webrtc.org/2772773002
Cr-Commit-Position: refs/heads/master@{#17564}
2017-04-06 12:48:36 +00:00
388fe425c7 Make WARN_UNUSED_RESULT a no-op on gcc
Because on gcc, cast to void doesn't silence the warning. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

Also add an RTC_ prefix to the macro instead of only defining it if it
wasn't already defined, to ensure that we always get our own version.

BUG=none

Review-Url: https://codereview.webrtc.org/2797983003
Cr-Commit-Position: refs/heads/master@{#17563}
2017-04-06 11:32:27 +00:00
3153c6dce5 Fixing DTX unittest for AudioEncoderOpus.
BUG=None

Review-Url: https://codereview.webrtc.org/2785363002
Cr-Commit-Position: refs/heads/master@{#17520}
2017-04-04 06:34:39 +00:00
d00aad5eb2 Revert of Loosening the coupling between WebRTC and //third_party/protobuf (patchset #16 id:300001 of https://codereview.webrtc.org/2747863003/ )
Reason for revert:
I will try to reland next week because it is causing some problems.

Original issue's description:
> To accommodate some downstream WebRTC users we need to loosen
> the coupling between our code and the //third_party/protobuf.
>
> This includes using typedefs to define strings instead of
> assuming std::string.
>
> After this refactoring it will be possible to link with other
> protobuf implementations than the current one.
>
> We moved the PRESUBMIT check to another CL [1]. The goal of this
> presubmit is to avoid the direct usage of google::protobuf outside
> of the webrtc/base/protobuf_utils.h header file.
>
> [1] - https://codereview.webrtc.org/2753823003/
>
> BUG=webrtc:7340
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2747863003
> Cr-Commit-Position: refs/heads/master@{#17466}
> Committed: 16ab93b952

TBR=kjellander@webrtc.org,henrik.lundin@webrtc.org,kwiberg@webrtc.org,michaelt@webrtc.org,peah@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7340

Review-Url: https://codereview.webrtc.org/2786363002
Cr-Commit-Position: refs/heads/master@{#17483}
2017-03-31 10:08:07 +00:00
16ab93b952 To accommodate some downstream WebRTC users we need to loosen
the coupling between our code and the //third_party/protobuf.

This includes using typedefs to define strings instead of
assuming std::string.

After this refactoring it will be possible to link with other
protobuf implementations than the current one.

We moved the PRESUBMIT check to another CL [1]. The goal of this
presubmit is to avoid the direct usage of google::protobuf outside
of the webrtc/base/protobuf_utils.h header file.

[1] - https://codereview.webrtc.org/2753823003/

BUG=webrtc:7340
NOTRY=True

Review-Url: https://codereview.webrtc.org/2747863003
Cr-Commit-Position: refs/heads/master@{#17466}
2017-03-30 08:24:20 +00:00
0e4a685542 Added licence boilerplate to our MATLAB files.
The command

tools/checklicenses/checklicenses.py --ignore-suppressions ./webrtc

previously produced this output:
'webrtc/modules/audio_processing/test/apmtest.m' has non-whitelisted license 'UNKNOWN'
'webrtc/modules/audio_processing/transient/test/readDetection.m' has non-whitelisted license 'UNKNOWN'
'webrtc/modules/audio_processing/transient/test/readPCM.m' has non-whitelisted license 'UNKNOWN'
...

This CL adds the WebRTC licence with appropriate year to all our
MATLAB files. All these files were contributed by WebRTC project
members hlundin@, pbos@, niklase@.

BUG=chromium:98592
NOTRY=True

Review-Url: https://codereview.webrtc.org/2781663005
Cr-Commit-Position: refs/heads/master@{#17428}
2017-03-28 17:18:58 +00:00
dadb4dc3c9 Allow ANA to receive RPLR (recoverable packet loss rate) indications
This is part of a series of CLs. Next CLs:
1. CL for RPLR-based FecController
2. CL for allowing experiment-driven configuration of the above (through both field-trials and protobuf)

BUG=webrtc:7058

Review-Url: https://codereview.webrtc.org/2661043003
Cr-Commit-Position: refs/heads/master@{#17368}
2017-03-23 22:29:50 +00:00
14325edfe4 Don't expect factory to create iLBC decoder if it isn't supported
BUG=webrtc:7377

Review-Url: https://codereview.webrtc.org/2762153002
Cr-Commit-Position: refs/heads/master@{#17328}
2017-03-21 19:16:51 +00:00
a613eb6bff Fixing a few tests for the upcoming Opus 1.2-alpha.
BUG=b/35415318

NOTRY=True

Review-Url: https://codereview.webrtc.org/2746763005
Cr-Commit-Position: refs/heads/master@{#17234}
2017-03-14 21:33:30 +00:00
cfd88bbe80 Fix AudioEncoderOpus::RecreateEncoderInstance() referring to old config_
BUG=webrtc:7334

Review-Url: https://codereview.webrtc.org/2742383002
Cr-Commit-Position: refs/heads/master@{#17222}
2017-03-14 09:50:46 +00:00
a1896a649c iSAC fix entropy coder: Recently added DCHECK could in fact trigger
A DCHECK added in a recent bugfix, which asserted that a signed 64->32
bit cast did not overflow, has been found to not always pass. We fix
this by saturating.

BUG=chromium:693868

Review-Url: https://codereview.webrtc.org/2746903002
Cr-Commit-Position: refs/heads/master@{#17209}
2017-03-13 12:28:47 +00:00
a2b2f6fe96 Remove dead test code and fix usage print-out for other tests
BUG=none

Review-Url: https://codereview.webrtc.org/2744213002
Cr-Commit-Position: refs/heads/master@{#17204}
2017-03-13 11:39:33 +00:00
551e984851 Make error reporting more detailed
In an attempt to help Kenny locate the evil Dr. Deo.

BUG=webrtc:7307

Review-Url: https://codereview.webrtc.org/2732193006
Cr-Commit-Position: refs/heads/master@{#17135}
2017-03-09 10:08:28 +00:00
e7811f5d69 Fix segmentation fault in AudioEncoderOpusTest.EncodeAtMinBitrate.
BUG=webrtc:7105

Review-Url: https://codereview.webrtc.org/2733803002
Cr-Commit-Position: refs/heads/master@{#17069}
2017-03-06 14:49:27 +00:00
930ff23261 Fixing a unittest to allow new Opus version.
New Opus version starts to support 120ms frame lengths. AudioEncoderOpusTest had an unnecessary check on the available frame lengths.

It is removed in this CL.

BUG=b/35415318

Review-Url: https://codereview.webrtc.org/2731583003
Cr-Commit-Position: refs/heads/master@{#17011}
2017-03-03 15:34:52 +00:00
65cb70d939 Fix cyclic deps: rent_a_codec<->audio_coding and rent_a_codec<->neteq
In short, what I did was to

  * Remove acm_common_defs.h (the stuff in it was used only by
    acm_codec_database.cc).

  * Move audio_coding_module_typedefs.h to a new build target.

  * Move the NetEqDecoder enum (and the associated
    NetEqDecoderToSdpAudioFormat function) to a new file in a new
    build target.

BUG=webrtc:7243, webrtc:7244

Review-Url: https://codereview.webrtc.org/2723253005
Cr-Commit-Position: refs/heads/master@{#17005}
2017-03-03 14:16:28 +00:00
3a2c803dc3 Multiply in 64 bits to avoid overflow
A fuzzer run caused the operands of this multiplication to be 512 and
5000000, resulting in a product about 20% too large for int32_t. So
change this from a 16x32->32 to a 16x32->64 multiplication. Since we
right shift by 2 at the end, the end result will still fit in int32_t.

I also had to fix a few follow-on add/sub overflows found by the same
fuzzer input once the multiplication was fixed. I chose to saturate
these, since it wasn't just an intermediate value that overflowed.

BUG=chromium:693868

Review-Url: https://codereview.webrtc.org/2729573002
Cr-Commit-Position: refs/heads/master@{#17003}
2017-03-03 13:44:49 +00:00
d3edd770ad Introduce dchecked_cast, and start using it
It's the faster, less strict cousin of checked_cast.

BUG=none

Review-Url: https://codereview.webrtc.org/2714063002
Cr-Commit-Position: refs/heads/master@{#16958}
2017-03-02 02:52:48 +00:00
deaf6fb071 Opus: Let the decoder interpret 2-byte payloads as DTX/CNG packets
This CL matches the work done in
https://codereview.webrtc.org/2693453003.

BUG=webrtc:7272
TBR=minyue@webrtc.org

Review-Url: https://codereview.webrtc.org/2723893004
Cr-Commit-Position: refs/heads/master@{#16930}
2017-03-01 08:49:18 +00:00
c1b57a15bf Test field trial group with startswith rather than equals.
BUG=webrtc:7266

Review-Url: https://codereview.webrtc.org/2717973005
Cr-Commit-Position: refs/heads/master@{#16915}
2017-02-28 16:50:47 +00:00
6f08d7d68d Change frame length on very low bandwidth.
BUG=webrtc:7199

Review-Url: https://codereview.webrtc.org/2703353002
Cr-Commit-Position: refs/heads/master@{#16777}
2017-02-22 15:35:05 +00:00
bcd88dbc01 WebRtcVoiceEngineTest: Changed a static_cast to a checked_cast.
Also two spelling fixes.
This is a follow-up to https://codereview.webrtc.org/2669583002/

TBR=kwiberg@webrtc.org
BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2697453004
Cr-Commit-Position: refs/heads/master@{#16586}
2017-02-13 15:04:05 +00:00
9238245d9b Fix nr of bytes sent to Opus decoder in DTX mode
BUG=webrtc:7144

Review-Url: https://codereview.webrtc.org/2693453003
Cr-Commit-Position: refs/heads/master@{#16542}
2017-02-10 21:50:38 +00:00
087bd34d23 Move AudioDecoder and related stuff to the api/ directory
BUG=webrtc:5805, webrtc:6725

Review-Url: https://codereview.webrtc.org/2668523004
Cr-Commit-Position: refs/heads/master@{#16534}
2017-02-10 16:15:44 +00:00
9def800b70 Added a flag to AudioCodecSpec to indicate adaptive bitrate support.
It's currently only used to ensure transport-cc is enabled for the format in question. It might be used to toggle more things in future.

BUG=webrtc:5806

Review-Url: https://codereview.webrtc.org/2669583002
Cr-Commit-Position: refs/heads/master@{#16514}
2017-02-09 13:14:32 +00:00
a55f021d43 Add 120ms frame ability to ANA
BUG=webrtc:7093

Review-Url: https://codereview.webrtc.org/2669733002
Cr-Commit-Position: refs/heads/master@{#16416}
2017-02-02 15:47:19 +00:00
2e03c66119 Adding build switch for Opus that supports 120ms ptime.
BUG=webrtc:7097

TEST=Set "ptime=120", try WebRTC calls over custom build Chromium with and without Opus 120ms. Try both Chromium w <-> Chromium w and Chromium w <-> Chromium w/o

Review-Url: https://codereview.webrtc.org/2668633004
Cr-Commit-Position: refs/heads/master@{#16408}
2017-02-02 01:31:11 +00:00
54340d8e75 Change opus min bitrate.
BUG=webrtc:7087

Review-Url: https://codereview.webrtc.org/2668693003
Cr-Commit-Position: refs/heads/master@{#16383}
2017-01-31 17:06:53 +00:00
0fe1216c9c Move more calls to webrtc::field_trial::FindFullName into ctor, thereby minimizing the non-trivial cost of repeated string comparisons.
BUG=webrtc:7059

Review-Url: https://codereview.webrtc.org/2657863002
Cr-Commit-Position: refs/heads/master@{#16378}
2017-01-31 13:48:37 +00:00
c14b7ed479 iSAC float decoder: Don't read past end of initialized part of buffer
We read past the end of the initialized part of the buffer, seemingly
on purpose (no one knows the details of this code anymore). The right
thing to do is probably to zero that part of the buffer.

(The *right* right thing to would be to rewrite this so that it was
easier to see what data was supposed to be where when, but
priorities...)

BUG=chromium:683040

Review-Url: https://codereview.webrtc.org/2659383002
Cr-Commit-Position: refs/heads/master@{#16365}
2017-01-30 20:17:05 +00:00
a6ca518dd5 iSAC: Untangle some cyclic dependencies
BUG=webrtc:6828, webrtc:7042

Review-Url: https://codereview.webrtc.org/2656823005
Cr-Commit-Position: refs/heads/master@{#16358}
2017-01-30 13:28:54 +00:00
d32bf75721 Pass SdpAudioFormat through Channel, without converting to CodecInst
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2516993002
Cr-Commit-Position: refs/heads/master@{#16165}
2017-01-19 15:03:59 +00:00
bc5d921659 Rename base/analytics/ to base/numerics/
BUG=webrtc:6832

Review-Url: https://codereview.webrtc.org/2626203002
Cr-Commit-Position: refs/heads/master@{#16060}
2017-01-13 17:14:33 +00:00
bf279fc4b9 Pass event log to ANA.
BUG=webrtc:6845

Review-Url: https://codereview.webrtc.org/2553413002
Cr-Commit-Position: refs/heads/master@{#16052}
2017-01-13 14:02:29 +00:00
566d820e00 Update smoothed bitrate.
BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2546493002
Cr-Commit-Position: refs/heads/master@{#16036}
2017-01-12 18:17:38 +00:00
4716048ccd Fixing name of a unittest for AudioEncoderOpus.
BUG=webrtc:6936, webrtc:6303

Review-Url: https://codereview.webrtc.org/2606743002
Cr-Commit-Position: refs/heads/master@{#15811}
2016-12-27 21:08:49 +00:00
584c35a334 Make a the decisions of ANA optional for the opus encoder.
BUG=webrtc:6936, webrtc:6303

Review-Url: https://codereview.webrtc.org/2592253004
Cr-Commit-Position: refs/heads/master@{#15807}
2016-12-27 16:21:29 +00:00
59dbfe6d32 Add a unit test for Opus complexity adaptation
The test verifies that the hysteresis window in the configuration works
as intended.

BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2594563002
Cr-Commit-Position: refs/heads/master@{#15700}
2016-12-20 09:17:55 +00:00
8c1dd8d32f Re-enable Opus complexity tests on Android
This effectively reverts commit c3e1cabc696240e4b5a128653264785292878205
(https://codereview.webrtc.org/2589703002/).

The reason the test was failing before was missing resource
dependencies in the GN file. This is now fixed.

Furthermore, the test did not trigger the complexity adaptation that
it was supposed to test, since the hysteresis window of the bitrate
was not taken into account. This is also fixed.

Finally, a percent label was added to a printout, to match the same
printout in the other test.

BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2580383002
Cr-Commit-Position: refs/heads/master@{#15679}
2016-12-19 14:18:35 +00:00
c3e1cabc69 Revert of Re-enable Opus complexity tests on Android (patchset #1 id:1 of https://codereview.webrtc.org/2589673002/ )
Reason for revert:
This fails on perf bots.

See for instance https://uberchromegw.corp.google.com/i/client.webrtc.perf/builders/Android32%20Tests%20%28K%20Nexus5%29/builds/105/steps/webrtc_perf_tests/logs/stdio:

I  643.319s run_tests_on_device(03832b22f0e944a0)  Note: Google Test filter = AudioEncoderOpusComplexityAdaptationTest.AdaptationOff
I  643.319s run_tests_on_device(03832b22f0e944a0)  [==========] Running 1 test from 1 test case.
I  643.319s run_tests_on_device(03832b22f0e944a0)  [----------] Global test environment set-up.
I  643.319s run_tests_on_device(03832b22f0e944a0)  [----------] 1 test from AudioEncoderOpusComplexityAdaptationTest
I  643.319s run_tests_on_device(03832b22f0e944a0)  [ RUN      ] AudioEncoderOpusComplexityAdaptationTest.AdaptationOff
I  643.319s run_tests_on_device(03832b22f0e944a0)  ../../webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc:36: Failure
I  643.319s run_tests_on_device(03832b22f0e944a0)  Value of: audio_loop.Init(kInputFileName, kMaxLoopLengthSamples, kInputBlockSizeSamples)
I  643.320s run_tests_on_device(03832b22f0e944a0)    Actual: false
I  643.320s run_tests_on_device(03832b22f0e944a0)  Expected: true
I  643.320s run_tests_on_device(03832b22f0e944a0)  [ CRASHED      ]
I  643.405s run_tests_on_device(0384888cf0e945d1)  >>ScopedMainEntryLogger
I  643.405s run_tests_on_device(0384888cf0e945d1)  Note: Google Test filter = AudioEncoderOpusComplexityAdaptationTest.AdaptationOn
I  643.405s run_tests_on_device(0384888cf0e945d1)  [==========] Running 1 test from 1 test case.
I  643.405s run_tests_on_device(0384888cf0e945d1)  [----------] Global test environment set-up.
I  643.405s run_tests_on_device(0384888cf0e945d1)  [----------] 1 test from AudioEncoderOpusComplexityAdaptationTest
I  643.405s run_tests_on_device(0384888cf0e945d1)  [ RUN      ] AudioEncoderOpusComplexityAdaptationTest.AdaptationOn
I  643.405s run_tests_on_device(0384888cf0e945d1)  ../../webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc:36: Failure
I  643.405s run_tests_on_device(0384888cf0e945d1)  Value of: audio_loop.Init(kInputFileName, kMaxLoopLengthSamples, kInputBlockSizeSamples)
I  643.405s run_tests_on_device(0384888cf0e945d1)    Actual: false
I  643.405s run_tests_on_device(0384888cf0e945d1)  Expected: true
I  643.405s run_tests_on_device(0384888cf0e945d1)  [ CRASHED      ]

Original issue's description:
> Re-enable Opus complexity tests on Android
>
> BUG=webrtc:6708
> TBR=minyue@webrtc.org
>
> Review-Url: https://codereview.webrtc.org/2589673002
> Cr-Commit-Position: refs/heads/master@{#15667}
> Committed: 14479ddfd4

TBR=
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2589703002
Cr-Commit-Position: refs/heads/master@{#15668}
2016-12-19 10:03:33 +00:00
14479ddfd4 Re-enable Opus complexity tests on Android
BUG=webrtc:6708
TBR=minyue@webrtc.org

Review-Url: https://codereview.webrtc.org/2589673002
Cr-Commit-Position: refs/heads/master@{#15667}
2016-12-19 09:36:34 +00:00
eca373f3ba Adding OnReceivedOverhead to AudioEncoder.
BUG=webrtc:6762

Review-Url: https://codereview.webrtc.org/2528933002
Cr-Commit-Position: refs/heads/master@{#15457}
2016-12-07 09:40:42 +00:00
4b9a2cb0d8 Reland "Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate."
The earlier attempt of this was in
https://codereview.webrtc.org/2411613002/

It was reverted due to failures on internal bots, showing that we cannot deprecate one method.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2538493006
Cr-Commit-Position: refs/heads/master@{#15333}
2016-11-30 14:50:08 +00:00
e69b46863a Revert of Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate. (patchset #5 id:240001 of https://codereview.webrtc.org/2411613002/ )
Reason for revert:
internal bot failure

Original issue's description:
> Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate.
>
> BUG=webrtc:6303
>
> Committed: https://crrev.com/84e56d576806635c966093d5421c5d04c9b90746
> Cr-Commit-Position: refs/heads/master@{#15310}

TBR=kwiberg@webrtc.org,henrik.lundin@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2537243004
Cr-Commit-Position: refs/heads/master@{#15312}
2016-11-30 09:19:06 +00:00
84e56d5768 Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2411613002
Cr-Commit-Position: refs/heads/master@{#15310}
2016-11-30 08:28:07 +00:00
352444fcac RTC_[D]CHECK_op: Remove superfluous casts
There's no longer any need to make the two arguments have the same
signedness, so we can remove a bunch of superfluous (and sometimes
dangerous) casts.

It turned out I also had to fix the safe_cmp functions to properly handle
enums that are implicitly convertible to integers.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2534683002
Cr-Commit-Position: refs/heads/master@{#15281}
2016-11-28 23:59:03 +00:00
af476c737f RTC_[D]CHECK_op: Remove "u" suffix on integer constants
There's no longer any need to make the two arguments have the same
signedness, so we can drop the "u" suffix on literal integer
arguments.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2535593002
Cr-Commit-Position: refs/heads/master@{#15280}
2016-11-28 23:21:51 +00:00
69b627d89d Move smoothing filter to common audio and exp_filter to base/analytics.
An earlier attempt of this work can be found here https://codereview.webrtc.org/2520003005/#ps100001, but was reverted.

PS4 in that CL was not valid since separation of BUILD.gn can cause internal bot to fail.

This is a new attempt, which is the same as https://codereview.webrtc.org/2520003005/#ps100001 but PS4 reverted.

BUG=webrtc:6443
TBR=tommi@webrtc.org, solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2532523002
Cr-Commit-Position: refs/heads/master@{#15233}
2016-11-24 19:01:14 +00:00
3c3aef44de Revert of Reland "Move smoothing filter to common audio". (patchset #5 id:100001 of https://codereview.webrtc.org/2520003005/ )
Reason for revert:
Internal bots failed.

Original issue's description:
> Reland "Move smoothing filter to common audio".
>
> The original CL was this https://codereview.webrtc.org/2484153002/
>
> Due to failure with internal trial servers, it was reverted. This CL tries to reland it.
>
> BUG=webrtc:6443
>
> Committed: https://crrev.com/223641f1b903e41e77d88f03199b4cdb65255ec8
> Cr-Commit-Position: refs/heads/master@{#15227}

TBR=tommi@webrtc.org,solenberg@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2529943002
Cr-Commit-Position: refs/heads/master@{#15228}
2016-11-24 15:13:24 +00:00