Commit Graph

930 Commits

Author SHA1 Message Date
25702cb162 Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests).  Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks

All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.

BUG=none
TEST=none

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

Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 21:50:32 +00:00
49c454e748 Cleaning neteq_unittest resource files.
BUG=webrtc:2692

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

Cr-Commit-Position: refs/heads/master@{#11189}
2016-01-08 19:30:18 +00:00
e1ca167217 Add tracing to NetEqImpl::GetAudio
BUG=webrtc:5167
R=pbos@webrtc.org
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#11183}
2016-01-08 11:50:14 +00:00
e2976c87f7 Remove DISABLED_ON_ macros.
Macro incorrectly displays DISABLED_ON_ANDROID in test names for
parameterized tests under --gtest_list_tests, causing tests to be
disabled on all platforms since they contain the DISABLED_ prefix rather
than their expanded variants.

This expands the macro variants to inline if they're disabled or not,
and removes building some tests under configurations where they should
fail, instead of building them but disabling them by default.

The change also removes gtest_disable.h as an unused include from many
other files.

BUG=webrtc:5387, webrtc:5400
R=kjellander@webrtc.org, phoglund@webrtc.org
TBR=henrik.lundin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11150}
2016-01-04 21:44:16 +00:00
93c08b7438 Adding bit exactness test for Opus decoding in NetEq.
Opus has become the mostly used codec in WebRTC. There, however, is no bit exactness test for Opus decoding in NetEq.

The new RTP file is generated by the following steps:
    1. Encode a clean RTP file with Opus
RTPencode resources/audio_coding/speech_mono_32_48kHz.pcm neteq_opus_raw.rtp 960 opus 1

    2. Adding jitter to the clean RTP file
RTPjitter neteq_opus_raw.rtp jitter.dat neteq_opus.rtp
(Note: jitter.dat does not exist in WebRTC resources folder. Check the source code for RTPjitter to know how to define such a file.)

BUG=webrtc:3987
TEST=observed Opus normal decoding and FEC decoding were used, listened to the reference output.

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

Cr-Commit-Position: refs/heads/master@{#11113}
2015-12-22 17:57:47 +00:00
53805324c0 Rename RTC_HISTOGRAM_* macros to RTC_HISTOGRAM_*_SPARSE_* to indicate that these are for infrequent updates.
This implementation will be replaced by a faster one and sparse will be removed.

BUG=webrtc:5283

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

Cr-Commit-Position: refs/heads/master@{#11099}
2015-12-21 09:46:25 +00:00
740c367af3 iSAC: Remove unnecessary WEBRTC_LINUX define.
I can only find one use in iSAC codebase:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc/modules/audio_coding/test/iSACTest.cc&l=19

It's the prime suspect for causing a compilation error for iOS failing to
include linux/net.h which is being included in
webrtc/voice_engine/voice_engine_defines.h

NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#11089}
2015-12-18 20:28:28 +00:00
a689b44c17 Add tracing to NetEqImpl::InsertPacket
BUG=webrtc:5167
R=pbos@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11065}
2015-12-17 11:50:11 +00:00
0eb15ed7b8 Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector
We can now use std::move instead!

This CL leaves the Pass methods in place; a follow-up CL will add deprecation annotations to them.

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

Cr-Commit-Position: refs/heads/master@{#11064}
2015-12-17 11:04:24 +00:00
7cae30cbe1 Disable warnings failing when using Clang on Windows.
This makes it possible to build WebRTC using Clang on Windows.
Depends on https://codereview.webrtc.org/1524703006/

BUG=webrtc:5360, webrtc:5366
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#11058}
2015-12-16 22:05:36 +00:00
361888c324 OWNERS: Add * to .gyp{i,} everywhere.
Also convert DOS->Unix line endings in two of the OWNERS files.

NOTRY=True
NOPRESUBMIT=True
R=niklas.enbom@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11056}
2015-12-16 19:44:39 +00:00
5f026d03af Update NetEq network statistics in neteq_unittest.
NetEqNetworkStatistics has been updated some time ago. A bit exactness test in neteq unittests is still using the old NetEqNetworkStatistics.

New neteq4_network_stats.dat generated by running TestBitExactness with flag "genref"

BUG=

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

Cr-Commit-Position: refs/heads/master@{#11052}
2015-12-16 15:36:10 +00:00
44307630d3 AudioCodingModuleImpl: Stop failing artificially for non-Opus encoders
All encoders already handle the "Opus-specific" requests sanely (by
failing nicely), so we don't need extra checks to protect them.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#11051}
2015-12-16 14:24:09 +00:00
a6db4958c9 Move Rent-A-Codec out of CodecManager
So that the two of them sit next to each other at the top level of
AudioCodingModuleImpl. CodecManager now manages the specifications for
Rent-A-Codec, rather than managing encoders directly.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#11048}
2015-12-16 12:19:14 +00:00
95d9851a6c Add speech encoder to the encoder stack specification struct
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#11037}
2015-12-15 22:21:40 +00:00
7eb914debb Fix incorrect comment
Review URL: https://codereview.webrtc.org/1524663004

Cr-Commit-Position: refs/heads/master@{#11036}
2015-12-15 22:20:29 +00:00
82ccfcf5ca Remove unused and rarely used LOG_ macros.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#11014}
2015-12-14 16:22:21 +00:00
5b659c0d10 Special-case android-arm64 in codec bitexactness tests
We already had a special case for android, but it only worked for arm32.

BUG=webrtc:4198, webrtc:4199

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

Cr-Commit-Position: refs/heads/master@{#10989}
2015-12-11 15:34:05 +00:00
cb23c0d984 Adding Opus to RTPencode.
As a step toward fixing webrtc:3987, here we update the RTPencode to allow Opus RTP payloads.

BUG=webrtc:3987, webrtc:2692

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

Cr-Commit-Position: refs/heads/master@{#10987}
2015-12-11 09:58:31 +00:00
4d68208a20 Reduce the runtime of some ACM tests in modules_tests
By reducing the length of the audio input, the total runtime of
$ out/Debug/modules_tests --gtest_filter=AudioCodingModuleTest.*
is reduced by more than 10x, when run single-threaded.

The PCMFile helper class is extended with a FastForward method (to
skip initial silence in the test files) and a limiter on how much to
read.

BUG=webrtc:2463
R=ivoc@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10973}
2015-12-10 15:24:50 +00:00
866df6602c Typo fix: Enable a bunch of tests that were accidentally disabled
They were meant to be run if we have either iSAC float or fix, but the
typo made them run for just float.

BUG=webrtc:4198, webrtc:4199

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

Cr-Commit-Position: refs/heads/master@{#10969}
2015-12-10 12:20:06 +00:00
4cf61dd116 NetEq: Add codec name and RTP timestamp rate to DecoderInfo
The new fields are default-populated for built-in decoders, but for
external decoders, the name can now be given when registering the
decoder.

BUG=webrtc:3520

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

Cr-Commit-Position: refs/heads/master@{#10952}
2015-12-09 14:21:02 +00:00
e10c82dc12 Deletes temporary files that are generated in several ACM unittests.
This applies to AcmSwitchingOutputFrequencyOldApi.*,
AcmReceiverBitExactnessOldApi.* and AcmSenderBitExactnessOldApi.*.

BUG=webrtc:4647
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#10936}
2015-12-08 13:03:32 +00:00
d7b7ae8bda Add encode/decode time tracing to audio_coding.
Also removes virtual from VideoDecoder::Decode and updated mocks and
tests accordingly to use VideoDecoder::DecodeInternal instead.

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

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

Cr-Commit-Position: refs/heads/master@{#10935}
2015-12-08 12:41:44 +00:00
325b34542d There was an old scaling for CNG 48 kHz in the code, from the time where Audio Coding Module didn't have full 48 kHz support. This CL removes the scaling.
The bug hasn't caused us any problems, since we don't run CNG together with Opus (our only real 48 kHz codec), but would cause problems if used with PCB16b @ 48 kHz.

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

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

Cr-Commit-Position: refs/heads/master@{#10929}
2015-12-08 09:13:08 +00:00
d048aa0e64 Make the audio codecs' GN targets self-sufficient
Also running "gn format" on the file.

R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10886}
2015-12-03 16:47:35 +00:00
dfbb3a4bfc Simplify CodecManager::RegisterEncoder()
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10855}
2015-12-01 12:45:09 +00:00
19822d63c1 audio_coding: Cleanup duplicated headers after "main" removal.
In https://codereview.webrtc.org/1481493004/ some duplicated headers
were left to make it possible to update downstream without breakage.
Now that's done and we can remove these to avoid confusion.

BUG=webrtc:5095
TBR=henrik.lundin@webrtc.org, kwiberg@webrtc.org
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#10829}
2015-11-27 18:55:49 +00:00
8c38e8b9b9 Clean up PlatformThread.
* Move PlatformThread to rtc::.
* Remove ::CreateThread factory method.
* Make non-scoped_ptr from a lot of invocations.
* Make Start/Stop void.
* Remove rtc::Thread priorities, which were unused and would collide.
* Add ::IsRunning() to PlatformThread.

BUG=
R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10812}
2015-11-26 16:45:57 +00:00
3e6db2321c audio_coding: remove "main" directory
This is the last piece of the old directory layout of the modules.

Duplicated header files are left in audio_coding/main/include until
downstream code is updated to the new location. They have pragma
warnings added to them and identical header guards as the new headers to avoid breaking things.

BUG=webrtc:5095
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
NOTRY=True
NOPRESUBMIT=True

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

Cr-Commit-Position: refs/heads/master@{#10803}
2015-11-26 12:45:01 +00:00
9cd5c8ca79 Move the FEC enabling logic from CodecManager to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10785}
2015-11-25 09:25:14 +00:00
989b4abcf3 Move the stereo-disables-CNG logic from CodecManager to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10784}
2015-11-25 09:19:19 +00:00
12411ef40e Move ThreadWrapper to ProcessThread in base.
Also removes all virtual methods. Permits using a thread from
rtc_base_approved (namely event tracing).

BUG=webrtc:5158
R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10760}
2015-11-23 22:48:01 +00:00
057fb89f83 Add new method AcmReceiver::last_packet_sample_rate_hz()
This change allows us to delete AcmReceiver::last_audio_codec_id().

BUG=webrtc:3520

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

Cr-Commit-Position: refs/heads/master@{#10756}
2015-11-23 16:19:58 +00:00
d89814bfd7 NetEq: Add new method last_output_sample_rate_hz
This change moves the logics for keeping track of the last ouput
sample rate from AcmReceiver to NetEq, where it fits better. The
getter function AcmReceiver::current_sample_rate_hz() is renamed to
last_output_sample_rate_hz().

BUG=webrtc:3520

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

Cr-Commit-Position: refs/heads/master@{#10754}
2015-11-23 14:49:31 +00:00
1379f1f1e6 Extract the parameters for the encoder stack from the CodecManager
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10750}
2015-11-23 12:30:56 +00:00
672304a654 NetEq: Remove overly verbose logging
This change removes all LS_VERBOSE logs that will print once every
packet or more often.

TBR=pbos@webrtc.org
BUG=webrtc:5227

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

Cr-Commit-Position: refs/heads/master@{#10733}
2015-11-20 19:57:11 +00:00
3c652b6746 modules/audio_coding: Remove some codec include dirs
Also clean up some include_dir entries and update the few
references to them with absolute include paths instead.
Finally fixed a few lint errors and invalid header guards.

None of these are used downstream.

BUG=webrtc:5095
TESTED=git cl try -c --bot=android_compile_rel --bot=linux_compile_rel --bot=win_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
R=kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10700}
2015-11-18 22:08:46 +00:00
223692aa85 Remove dead code
Review URL: https://codereview.webrtc.org/1452153003

Cr-Commit-Position: refs/heads/master@{#10692}
2015-11-18 16:27:56 +00:00
e1a27d48ad Move CNG/RED payload type extraction to Rent-A-Codec
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10691}
2015-11-18 15:32:57 +00:00
9a7c838ec4 Adding stddef.h to opus_inst.h.
This is to prevent size_t from undefined. This does not happen in current WebRTC since the sources that opus_inst.h gets used have proper definitions. But it would be good to add the definition in itself.

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

Cr-Commit-Position: refs/heads/master@{#10653}
2015-11-16 16:07:04 +00:00
e155ae671c Move CNG and RED management into the Rent-A-Codec
This leaves CodecOwner without a job, so we eliminate it.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10650}
2015-11-16 12:50:02 +00:00
ee2bac26dd AcmReceiver::InsertPacket and NetEq::InsertPacket: Take ArrayView arguments
Instead of separate pointer and size arguments.

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

Cr-Commit-Position: refs/heads/master@{#10606}
2015-11-11 18:34:07 +00:00
4dc941128f CodecManager::RegisterEncoder: Call SetFec on new encoder, not old
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10604}
2015-11-11 16:34:28 +00:00
be57983f4b Rename Maybe to Optional
And add examples of good and bad usage to the documentation.

R=aluebs@webrtc.org, henrik.lundin@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10588}
2015-11-10 21:34:32 +00:00
ed8275a44f CodecManager: Eliminate the stereo_send_ member
It can be computed from other members, notably the current encoder's
number of channels.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10585}
2015-11-10 17:47:41 +00:00
c95c366f5a Move the Rent-A-Codec™ from CodecOwner to CodecManager
Future CLs will move it even further down the stack.

BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10580}
2015-11-10 14:35:28 +00:00
805fc710f7 Let Rent-A-Codec™ create and own speech encoders
BUG=webrtc:5028

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

Cr-Commit-Position: refs/heads/master@{#10575}
2015-11-10 12:05:23 +00:00
3cea256806 Reland "Prevent Opus DTX from generating intermittent noise during silence"
The original CL is reviewed at
https://codereview.webrtc.org/1415173005/

A silly mistake was made at the last patch set, and the CL was reverted. This CL is to fix and reland it.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#10574}
2015-11-10 11:49:32 +00:00
b4a753fdb5 Revert of Prevent Opus DTX from generating intermittent noise during silence (patchset #10 id:250001 of https://codereview.webrtc.org/1415173005/ )
Reason for revert:
Breaks voe_auto_test on all three "large tests bots".
https://build.chromium.org/p/client.webrtc/builders/Win32%20Release%20%5Blarge%20tests%5D/builds/5630/steps/voe_auto_test/logs/stdio
https://build.chromium.org/p/client.webrtc/builders/Mac32%20Release%20%5Blarge%20tests%5D/builds/5599/steps/voe_auto_test/logs/stdio
https://build.chromium.org/p/client.webrtc/builders/Linux64%20Release%20%5Blarge%20tests%5D/builds/5645/steps/voe_auto_test/logs/stdio

Notice these bots are no longer a part of the default trybot set, so they have to be run manually when working with code that affects their tests (they were removed as they queued up all the time in the CQ, and usually don't catch breakages).

Original issue's description:
> Prevent Opus DTX from generating intermittent noise during silence.
>
> Opus may have an internal error that causes this. Here we make a workaround by adding some small disturbance to the input signals to break a long sequence of zeros.
>
> BUG=webrtc:5127
>
> Committed: https://crrev.com/f475add57eada116bc960fe2935876ec8c077977
> Cr-Commit-Position: refs/heads/master@{#10565}

TBR=tina.legrand@webrtc.org,kwiberg@webrtc.org,solenberg@webrtc.org,minyue@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5127

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

Cr-Commit-Position: refs/heads/master@{#10567}
2015-11-09 21:27:11 +00:00