Commit Graph

477 Commits

Author SHA1 Message Date
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
223641f1b9 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

Review-Url: https://codereview.webrtc.org/2520003005
Cr-Commit-Position: refs/heads/master@{#15227}
2016-11-24 14:08:09 +00:00
c1dd1a5916 Really disable Opus complexity tests on Android
This is a follow-up to https://codereview.webrtc.org/2525603002/,
which was incomplete.

BUG=webrtc:6708
TBR=philipel@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2524813002
Cr-Commit-Position: refs/heads/master@{#15202}
2016-11-22 19:19:21 +00:00
0eb19602a3 ComfortNoise: Calculate used scale factor in Q13
BUG=chromium:666518

Review-Url: https://codereview.webrtc.org/2519873003
Cr-Commit-Position: refs/heads/master@{#15189}
2016-11-22 13:15:29 +00:00
58f90a76cc Disable Opus complexity tests on Android
Reason: breaks perf bots

BUG=webrtc:6708
TBR=philipel@webrtc.org

Review-Url: https://codereview.webrtc.org/2525603002
Cr-Commit-Position: refs/heads/master@{#15188}
2016-11-22 12:13:08 +00:00
875862ca86 Let Opus increase complexity for low bitrates
This change adds code that lets Opus increase the complexity setting
at low bitrates (only relevant for mobile where the default complexity
is not already maximum). The feature is default off.

Also adding a performance test to make sure the complexity adaptation
has desired effect.

BUG=webrtc:6708

Review-Url: https://codereview.webrtc.org/2503443002
Cr-Commit-Position: refs/heads/master@{#15182}
2016-11-22 10:08:01 +00:00
b4af3d673a Remove all references to GYP
Remove all .gyp and .gypi files.
Remove entries from OWNERS files for *.isolate, *.gyp, *.gypi
Remove unused scripts in webrtc/build.

BUG=webrtc:6323
R=henrika@webrtc.org, phoglund@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#15107}
2016-11-16 19:11:38 +00:00
6b825df37e Using AudioOption to enable audio network adaptor.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2397573006
Cr-Commit-Position: refs/heads/master@{#14845}
2016-10-31 11:08:37 +00:00
bc8074474d Eliminate left shift of negative value by using multiplication instead
NOPRESUBMIT=true
BUG=chromium:653267

Review-Url: https://codereview.webrtc.org/2439353003
Cr-Commit-Position: refs/heads/master@{#14837}
2016-10-31 09:26:14 +00:00
da2bf4e150 Stop using old AudioCodingModule::RegisterReceiveCodec overloads
BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2388153004
Cr-Commit-Position: refs/heads/master@{#14753}
2016-10-24 20:47:16 +00:00
a6f495c7c2 Simplifying audio network adaptor by moving receiver frame length range to ctor.
It turns out that that audio network adaptor can always be created with knowledge of receiver frame length range. There is no need to keep some infrastructure that is used for runtime setting of receiver frame length ranges.

BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2429503002
Cr-Commit-Position: refs/heads/master@{#14748}
2016-10-24 16:19:22 +00:00
7e30432b36 Hooking up audio network adaptor to VoE.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2390883004
Cr-Commit-Position: refs/heads/master@{#14611}
2016-10-12 12:01:01 +00:00
41b9c801c2 Adding audio network adaptor to AudioEncoderOpus.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2362703002
Cr-Commit-Position: refs/heads/master@{#14555}
2016-10-06 14:13:59 +00:00
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
c8299f9f87 Posting Opus's set-force-channels functionality to WebRTC.
BUG=webrtc:6303

Review-Url: https://codereview.webrtc.org/2352713005
Cr-Commit-Position: refs/heads/master@{#14394}
2016-09-27 09:08:54 +00:00
a70695a3e1 Moved Opus-specific payload splitting into AudioDecoderOpus.
The biggest change to NetEq is the move from a primary flag, to a
Priority with two separate levels: one set by RED splitting and one
set by the codec itself. This allows us to unambigously prioritize
"fallback" packets from these two sources. I've chosen what I believe
is the sensible ordering: packets that the codec prioritizes are
chosen first, regardless of if they are secondary RED packets or
not. So if we were to use Opus w/ FEC in RED, we'd only do Opus FEC
decoding if there was no RED packet that could cover the time slot.

With this change, PayloadSplitter now only deals with RED
packets. Maybe it should be renamed RedPayloadSplitter?

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2342443005
Cr-Commit-Position: refs/heads/master@{#14347}
2016-09-22 09:07:03 +00:00
c4ccd4d61c AcmReceiver: Eliminate AcmReceiver::decoders_
BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2351183002
Cr-Commit-Position: refs/heads/master@{#14335}
2016-09-21 17:55:21 +00:00