AcmReceiver::decoders_ is now one step closer to being unused.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/2339953002
Cr-Commit-Position: refs/heads/master@{#14274}
This adds a new file, webrtc/modules/audio_coding/neteq/tools/packet_source.cc, so that I'll have somewhere to put the new non-inlined methods.
NOTRY=true
BUG=webrtc:163
Review-Url: https://codereview.webrtc.org/2290593002
Cr-Commit-Position: refs/heads/master@{#13956}
Checksums were updated for NetEq and ACM bitexactness tests (after
verifying the audio quality).
BUG=webrtc:5447
Review-Url: https://codereview.webrtc.org/2266293005
Cr-Commit-Position: refs/heads/master@{#13928}
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}
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}
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}
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}
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}
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}
This gets rid of the complex & icky state where the sample rate is not
yet determined.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/2020353003
Cr-Commit-Position: refs/heads/master@{#13011}
Adding a some checks and switching out a few assert for RTC_[D]CHECK.
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled. I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Committed: https://crrev.com/60c4e0ae8f124f08372645a95042f4a1246d7aa3
Cr-Commit-Position: refs/heads/master@{#12925}
Review URL: https://codereview.webrtc.org/2014973002 .
Cr-Commit-Position: refs/heads/master@{#12926}
Original issue's description:
> Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled. I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
>
> BUG=chromium:613482
> NOTRY=true
> (using notry due to offline android_arm64_rel bot)
>
> Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> Cr-Commit-Position: refs/heads/master@{#12870}
TBR=henrik.lundin@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:613482
Review-Url: https://codereview.webrtc.org/2009253004
Cr-Commit-Position: refs/heads/master@{#12907}
Channel's API remains unchanged, but the creation of a BuiltinAudioDecoderFactory is now in Channel. The next step would be to amend Channel's API (through CreateChannel, I believe) to allow an AudioDecoderFactory to be sent along.
BUG=webrtc:5805
Review-Url: https://codereview.webrtc.org/1992763002
Cr-Commit-Position: refs/heads/master@{#12893}
The return type of PacketSource::NextPacket() is changed from a naked
pointer to an std::uniqe_ptr. The interface contract was and still is
that the ownership is passed from the callee to the caller, but a
unique_ptr makes this explicit.
BUG=webrtc:2692
Review-Url: https://codereview.webrtc.org/2005873002
Cr-Commit-Position: refs/heads/master@{#12884}
Reason for revert:
Reverting temporarily. Need to fix tests downstream that pass invalid arguments.
Original issue's description:
> Adding a some checks and switching out a few assert for RTC_[D]CHECK.
> These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled. I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
>
> BUG=chromium:613482
> NOTRY=true
> (using notry due to offline android_arm64_rel bot)
>
> Committed: https://crrev.com/d36df89d40bde3c62ee5cbff841933e50b3c007b
> Cr-Commit-Position: refs/heads/master@{#12870}
TBR=henrik.lundin@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:613482
Review-Url: https://codereview.webrtc.org/2006243002
Cr-Commit-Position: refs/heads/master@{#12874}
These changes are around use of AudioFrame.data_ to help us catch issues earlier since assert() is left out in release builds, including builds with DCHECK enabled. I've also added a few full-on CHECKs to avoid reading past buffer boundaries or continuing on in a failed state.
BUG=chromium:613482
NOTRY=true
(using notry due to offline android_arm64_rel bot)
Review-Url: https://codereview.webrtc.org/2007563002
Cr-Commit-Position: refs/heads/master@{#12870}
Deleted the temporary ACM method without the muted parameter, and had
to modify several tests for this. The muted parameter is not yet propagated to the AudioConferenceMixer; this is the next step.
BUG=webrtc:5609
TBR=perkj@webrtc.org
Review-Url: https://codereview.webrtc.org/1985743002
Cr-Commit-Position: refs/heads/master@{#12779}
The new parameter indicates if the output in the AudioFrame is muted. If
so, the output samples are not written, but should be interpreted as all
zero.
A version of AudioCodingModule::PlayoutData10Ms() without the new
parameter is maintained while waiting for downstream dependencies to
conform.
BUG=webrtc:5609
Review-Url: https://codereview.webrtc.org/1976913002
Cr-Commit-Position: refs/heads/master@{#12719}
This CL implements the muted output functionality in NetEq. Tests are
added. The feature is currently off by default, and AcmReceiver makes
sure that the muted state is not engaged.
BUG=webrtc:5608
Review-Url: https://codereview.webrtc.org/1965733002
Cr-Commit-Position: refs/heads/master@{#12711}
Later steps in the refactoring will have the factory injected from the
outside rather than owned by NetEq.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/1928293002
Cr-Commit-Position: refs/heads/master@{#12604}
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock.
NOPRESUBMIT=True
BUG=webrtc:3970
Review-Url: https://codereview.webrtc.org/1921653002
Cr-Commit-Position: refs/heads/master@{#12563}
Reason for revert:
There seems an error made in this patch.
Hi Henrik,
I think the bit shift returned by CrossCorrelationWithAutoShift may be wrongly used by DotProduct.
We'd better revert this CL.
Doing another fix (and future fixes) will be paintful. I will work on a easy-to-modify bitexactness test first.
Original issue's description:
> Avoiding overflow in cross correlation in NetEq.
>
> BUG=
TBR=henrik.lundin@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review-Url: https://codereview.webrtc.org/1925053002
Cr-Commit-Position: refs/heads/master@{#12543}
This will allow us to fix the sample rate of each AudioDecoder at
instantiation time.
This change results in different checksums for the following tests:
AcmReceiverBitExactnessOldApi.8kHzOutput
AcmReceiverBitExactnessOldApi.16kHzOutput
AcmReceiverBitExactnessOldApi.32kHzOutput
AcmReceiverBitExactnessOldApi.48kHzOutputExternalDecoder
AcmReceiverBitExactnessOldApi.48kHzOutput
Because they make an ACM and then ask it to decode both 16 kHz and 32
kHz iSAC. (The arm32 and arm64 checksums didn't change, because the
tests skip 32 kHz iSAC on arm.)
BUG=webrtc:5801
Review URL: https://codereview.webrtc.org/1908923002
Cr-Commit-Position: refs/heads/master@{#12463}
Remove the deprecated EncodeInternal interface from AudioEncoder
Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1881003003
Cr-Commit-Position: refs/heads/master@{#12409}
Reason for revert:
Broke import. Implementations of the old interface still exists somewhere.
Original issue's description:
> Remove the deprecated EncodeInternal interface from AudioEncoder
>
> Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
>
> BUG=webrtc:5591
>
> Committed: https://crrev.com/5222d315dbea8f3563c100cc9f2451907f70b05f
> Cr-Commit-Position: refs/heads/master@{#12329}
TBR=kwiberg@webrtc.org,solenberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1883543002
Cr-Commit-Position: refs/heads/master@{#12330}
Also hid MaxEncodedBytes by making it private. It will get removed as soon as subclasses have had time to remove their overrides.
BUG=webrtc:5591
Review URL: https://codereview.webrtc.org/1864993002
Cr-Commit-Position: refs/heads/master@{#12329}
This was previously done in AcmReceiver, but belongs in NetEq where the
rest of the AudioFrame fields are populated.
BUG=webrtc:5669,webrtc:5607
Review URL: https://codereview.webrtc.org/1863993002
Cr-Commit-Position: refs/heads/master@{#12265}
This is in preparation for changes to when the playout timestamp is
valid.
BUG=webrtc:5669
Review URL: https://codereview.webrtc.org/1853183002
Cr-Commit-Position: refs/heads/master@{#12256}
This new unit test verifies the parameter fields (not the audio data
itself) written to the AudioFrame output by AcmReceiver::GetAudio.
Also corrected a few comments reflecting recent changes in the code.
BUG=webrtc:5669
Review URL: https://codereview.webrtc.org/1859953002
Cr-Commit-Position: refs/heads/master@{#12253}
Now that the Rent-A-Codec no longer owns the encoders and decoders it
produces, they may outlive it. It's thus no longer correct for the
Rent-A-Codec to own the bandwidth estimation state; all of the
involved objects need to share ownership.
BUG=webrtc:5028
Review URL: https://codereview.webrtc.org/1821513003
Cr-Commit-Position: refs/heads/master@{#12159}
Except in places where this would break out-of-tree code,
such as Chromium.
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1785173002
Cr-Commit-Position: refs/heads/master@{#12037}
We want this because otherwise the ACM uses its mutex to protect an
encoder that's owned by someone else. That someone else may easily
slip up and delete or otherwise touch the encoder before making sure
that the ACM has stopped using it, bypassing the lock.
BUG=webrtc:5028
Review URL: https://codereview.webrtc.org/1702943002
Cr-Commit-Position: refs/heads/master@{#11909}