Commit Graph

406 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
a10740239d Fix UBSan errors (signed integer overflow)
WebRtcSpl_CrossCorrelation and WebRtcSpl_DotProductWithScale compute
the int32 sum of pairwise products from two int16 arrays. So as to
avoid overflow (which could otherwise happen when as little as two
products were summed), the products are right-shifted by an amount
specified by the caller.

This CL changes WebRtcIlbcfix_MyCorr and WebRtcIlbcfix_Smooth to give
sufficient right-shift amounts, instead of ones that may be too small
and cause overflow.

BUG=chromium:601787

Review-Url: https://codereview.webrtc.org/2014033002
Cr-Commit-Position: refs/heads/master@{#13066}
2016-06-08 12:24:47 +00:00
7bf939c720 Check for out-of-bounds access on |kIntrpCoef|.
BUG=chromium:600953

Review-Url: https://codereview.webrtc.org/2025493002
Cr-Commit-Position: refs/heads/master@{#13039}
2016-06-03 17:06:05 +00:00
f882880947 AudioDecoder: Document that the sample rate and number of channels is constant
Review-Url: https://codereview.webrtc.org/2029273003
Cr-Commit-Position: refs/heads/master@{#13012}
2016-06-02 10:19:26 +00:00
abe95ba323 AudioDecoderIsacT: Require caller to always specify sample rate
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}
2016-06-02 09:59:02 +00:00
6c2eab34f8 AudioDecoder: New method SampleRateHz, + implementations for our codecs
This will let NetEq (and the factory, and every layer in between) keep
track of just the decoder, instead of decoder and sample rate.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2024633002
Cr-Commit-Position: refs/heads/master@{#12968}
2016-05-31 09:46:28 +00:00
4f6c2b6eff Fix UBSan errors (left shift of negative value)
BUG=chromium:601787

Review-Url: https://codereview.webrtc.org/2000403006
Cr-Commit-Position: refs/heads/master@{#12911}
2016-05-26 10:40:56 +00:00
64208e5523 Fix UBSan errors (left shift of negative value)
I've settled on replacing x << n with x * (1 << n); this gets rid of
the "left shift of negative value" warning, but will still trigger
undefined behavior if the multiplication overflows. It also still
looks like a left shift, which is good for the readability of the
fixed-point code.

(The compiler is smart enough to recognize that the
multiplication+shift is just a shift, for both variable and constant
shift amounts, so the generated code should not change.)

BUG=chromium:603491

Review-Url: https://codereview.webrtc.org/1989803002
Cr-Commit-Position: refs/heads/master@{#12845}
2016-05-23 10:28:35 +00:00
2036135620 AudioEncoderOpus: Default to 32 kbit/s for mono, 64 kbit/s for stereo
When this class was created, we inadvertently set the default to 64
kbit/s for both cases, failing to preserve the previous behavior. This
patch restores the old behavior.

From what I've been able to dig up, this problem did not affect Opus
encoders created internally in the Audio Coding Module. Those have
always used the bitrate from the supplied CodecInst.

Review-Url: https://codereview.webrtc.org/1942193002
Cr-Commit-Position: refs/heads/master@{#12827}
2016-05-20 11:57:08 +00:00
3fc8e8dde3 Fix UBSan errors (left shift of negative value)
BUG=chromium:604803

Review-Url: https://codereview.webrtc.org/1988113003
Cr-Commit-Position: refs/heads/master@{#12826}
2016-05-20 11:40:33 +00:00
e725f7c73e Turned AudioDecoderFactory into a RefCounted thing to use with scoped_refptr.
First step of AudioDecoderFactory injection CLs. AudioDecoderFactories will be shared, and shared_ptr is currently off the table, so this CL changes the current uses of AudioDecoderFactory from std::unique_ptr to rtc::scoped_refptr.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/1990803004
Cr-Commit-Position: refs/heads/master@{#12815}
2016-05-19 17:48:12 +00:00
89f237cedc Fix UBSan errors (left shift of negative value, left shift overflows int)
BUG=chromium:603498

Review-Url: https://codereview.webrtc.org/1979973003
Cr-Commit-Position: refs/heads/master@{#12787}
2016-05-18 09:20:35 +00:00
e305d956c0 Remove runtime NEON detection
Chrome does not detect NEON instruction set at runtime in WebRTC code starting
with M50, which is now in Stable. Remove support for runtime detection for
simplicity.

The only remaining piece of Chrome that will continue to depend on runtime
detection is /net, where devices with _broken_ neon support are also detected,
and it is not configurable via GYP/GN.

BUG=522035
NOPRESUBMIT=true

Review-Url: https://codereview.webrtc.org/1955413003
Cr-Commit-Position: refs/heads/master@{#12778}
2016-05-17 17:56:48 +00:00
9b2228fdfc Fix UBSan errors (left shift of negative value)
BUG=chromium:603501

Review-Url: https://codereview.webrtc.org/1988723002
Cr-Commit-Position: refs/heads/master@{#12775}
2016-05-17 13:40:48 +00:00
8bce67b745 Added UMA logging for audio codec usage. A histogram statistic named "WebRTC.Audio.Encoder.CodecType" has been created.
Review-Url: https://codereview.webrtc.org/1967503002
Cr-Commit-Position: refs/heads/master@{#12760}
2016-05-16 14:34:31 +00:00
7e3968e46c Removed MaxEncodedBytes from AudioEncoder.
This is the last step in changing the signature of AudioEncoder::Encode
to taking an rtc::Buffer as its output parameter, rather than a pointer
to and a size parameter.

The notry parameter has been added specifically to work around android_compile_x86_dbg bot failing.

NOTRY=True
BUG=webrtc:5591

Review-Url: https://codereview.webrtc.org/1962013003
Cr-Commit-Position: refs/heads/master@{#12685}
2016-05-11 11:39:58 +00:00
5178ee86ba NetEq: Use a BuiltinAudioDecoderFactory to create decoders
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}
2016-05-03 08:39:08 +00:00
bfefb03ec1 Replace scoped_ptr with unique_ptr everywhere
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.

BUG=webrtc:5520

Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}
2016-05-01 21:53:55 +00:00
ef8b61e110 Enable -Winconsistent-missing-override flag.
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}
2016-04-29 13:09:23 +00:00
c01c6a423c New interface (AudioDecoderFactory), with an implementation
This is a first draft of what we're hoping to use to create all
AudioDecoder instances. Follow-up CLs will start using this internally
in NetEq instead of calling constructors manually.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/1917163002
Cr-Commit-Position: refs/heads/master@{#12548}
2016-04-28 21:23:41 +00:00
4485ffb58d #include "webrtc/base/constructormagic.h" where appropriate
Any file that uses the RTC_DISALLOW_* macros should #include
"webrtc/base/constructormagic.h", but a shocking number of them don't.
This causes trouble when we try to wean files off of #including
scoped_ptr.h, since a bunch of files get their constructormagic macros
only from there.

Rather than fixing these errors one by one as they turn up, this CL
simply ensures that every file in the WebRTC tree that uses the
RTC_DISALLOW_* macros #includes "webrtc/base/constructormagic.h".

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12509}
2016-04-26 15:14:48 +00:00
4e7f6c1887 Add proper dependencies for webrtc/modules/audio_coding/codecs
The audio_decoder_interface and audio_encoder_interface
targets are depending on rtc_base_approved headers but don't
declare such dependencies.

NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#12500}
2016-04-26 04:59:56 +00:00
97ba30eedf Convert CNG into C++ and remove it from AudioDecoder
Broke out CNG from AudioDecoder as they didn't really share an interface.

Converted the CNG code to C++, to make initialization and resource handling easier. This includes several changes to the behavior, favoring RTC_CHECKs over returning error codes.

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

Cr-Commit-Position: refs/heads/master@{#12491}
2016-04-25 14:56:05 +00:00
4fb3d2bcca Add defaulted move constructors for some types that just got copy constructors
They can all benefit from moving, since they contain std::string and
std::vector. We intended to add these in
https://codereview.webrtc.org/1896953004/, but got compiler errors we
couldn't make sense of, so we skipped them. It turns out that what the
compiler was complaining about was that when we said we'd have a
user-defined move constructor, it stopped generating a copy assignment
operator for us. This CL solves the problem by outfitting the types
with defaulted copy and move assignment operators too.

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

Cr-Commit-Position: refs/heads/master@{#12469}
2016-04-22 11:59:34 +00:00
470dd37b41 Roll chromium_revision 212f976fef..61ed337cfe (387882:388120)
https://codereview.chromium.org/1826693002 enables some
more Clang warnings which were fixed.

Change log: 212f976fef..61ed337cfe
Full diff: 212f976fef..61ed337cfe

No dependencies changed.
No update to Clang.

TBR=
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#12422}
2016-04-19 10:03:31 +00:00
264087f45a A few small cleanups of stuff caught by lint
Review URL: https://codereview.webrtc.org/1871003002

Cr-Commit-Position: refs/heads/master@{#12412}
2016-04-18 15:07:33 +00:00
2903ba5ff3 Reland Remove the deprecated EncodeInternal interface from AudioEncoder
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}
2016-04-18 13:14:42 +00:00
6ca0a31708 We no longer use compilers that can't =default move construction and assignment
Review URL: https://codereview.webrtc.org/1891483006

Cr-Commit-Position: refs/heads/master@{#12376}
2016-04-15 12:25:03 +00:00
164bc4bbd3 Revert of Remove the deprecated EncodeInternal interface from AudioEncoder (patchset #4 id:60001 of https://codereview.webrtc.org/1864993002/ )
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}
2016-04-12 10:58:10 +00:00
5222d315db 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/1864993002

Cr-Commit-Position: refs/heads/master@{#12329}
2016-04-12 10:31:03 +00:00
0d05da7ee6 Rent-A-Codec: Reference count the shared iSAC bandwidth estimation state
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}
2016-03-30 11:10:18 +00:00
b252856d10 Remove all uses of the HAVE_CONFIG_H define.
BUG=
R=henrik.lundin@webrtc.org, pthatcher@google.com, stefan@webrtc.org, tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12141}
2016-03-29 15:47:28 +00:00
15622c0aaf WebRtcIsacfix_PitchFilter: Don't read uninitialized array entries
WebRtcIsacfix_PitchFilterCore requires indW32 >= PITCH_FRACORDER - 2;
otherwise, it will read from entries of ubufQQ that haven't been
written yet. (The problem of indW32 being too small has only been seen
in fuzzer tests, not in real life.)

BUG=chromium:581901

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

Cr-Commit-Position: refs/heads/master@{#12047}
2016-03-18 05:17:21 +00:00
d44c077dce Revert of Safe numeric library: base/numerics (copied from Chromium) (patchset #11 id:250001 of https://codereview.webrtc.org/1753293002/ )
Reason for revert:
Looks like the Chrome iOS build is broken because of these two changes.  So I'm going to have to revert.  Here's the error:

https://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/185624/steps/compile/logs/stdio

FAILED: rm -f arch/libsafe_numerics.arm64.a && ./gyp-mac-tool filter-libtool libtool  -static -o arch/libsafe_numerics.arm64.a
error: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
FAILED: rm -f arch/libsafe_numerics.armv7.a && ./gyp-mac-tool filter-libtool libtool  -static -o arch/libsafe_numerics.armv7.a
error: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode7.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
ninja: build stopped: subcommand failed.

Original issue's description:
> Safe numeric library added: base/numerics (copied from Chromium)
>
> This copies the contents (unittest excluded) of base/numerics in
> chromium to base/numerics in webrtc. Files added:
> - safe_conversions.h
> - safe_conversions_impl.h
> - safe_math.h
> - safe_math_impl.h
>
> A really old version of safe_conversions[_impl].h previously existed in
> base/, this has been deleted and sources using it have been updated
> to include the new base/numerics/safe_converions.h.
>
> This CL also adds a DEPS file to webrtc/base.
>
> NOPRESUBMIT=True
> BUG=webrtc:5548, webrtc:5623
>
> Committed: https://crrev.com/de1c81b2d2196be611674aa6019b9db3a9329042
> Cr-Commit-Position: refs/heads/master@{#11907}

TBR=kjellander@webrtc.org,kwiberg@webrtc.org,tina.legrand@webrtc.org,hbos@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5548, webrtc:5623

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

Cr-Commit-Position: refs/heads/master@{#11965}
2016-03-12 01:12:40 +00:00
6030a129c0 Pass ownership of external encoders to the ACM
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}
2016-03-08 14:01:37 +00:00
de1c81b2d2 Safe numeric library added: base/numerics (copied from Chromium)
This copies the contents (unittest excluded) of base/numerics in
chromium to base/numerics in webrtc. Files added:
- safe_conversions.h
- safe_conversions_impl.h
- safe_math.h
- safe_math_impl.h

A really old version of safe_conversions[_impl].h previously existed in
base/, this has been deleted and sources using it have been updated
to include the new base/numerics/safe_converions.h.

This CL also adds a DEPS file to webrtc/base.

NOPRESUBMIT=True
BUG=webrtc:5548, webrtc:5623

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

Cr-Commit-Position: refs/heads/master@{#11907}
2016-03-08 12:46:07 +00:00
4f43fcfd49 Renamed new EncodeInternal to EncodeImpl to ensure proper backwards compatibility.
Renamed the new variant of EncodeInternal to EncodeImpl, so that
subclasses implementing one of the EncodeInternal don't need to
explicitly contain 'using AudioEncoder::EncodeInternal' to avoid their
implementation hiding the other variant of EncodeInternal. This causes
a warning (treated as an error) when building using GCC.

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

Cr-Commit-Position: refs/heads/master@{#11868}
2016-03-04 08:54:38 +00:00
10a029e952 Changed AudioEncoder::Encode to take an rtc::Buffer* instead of uint8_t* and a maximum size.
For backwards compatibility, I've added kept the old interface to
Encode() and EncodeInternal and created default implementations of both
variants of EncodeInternal(), each calling the other. At least one of
the variants must be implemented in a subclass or we'll run out of stack
and explode. Would be nice if we could catch that before runtime. :/

The new interface to EncodeInternal() is protected, since it should
never be called from the outside.

Was unable to mark the old EncodeInternal() as RTC_DEPRECATED, since the
default implementaion of the new variant needs to call it to work around
old implementations. The old Encode() variant is deprecated, at least.

Added a test for backwards compatibility in audio_encoder_unittest.cc.
For the added test I broke out MockEncodeHelper from
audio_encoder_copy_red_unittest.cc and renamed it MockAudioEncoderHelper.

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

Cr-Commit-Position: refs/heads/master@{#11823}
2016-03-01 08:41:39 +00:00
7e937e951c Remove workaround for Opus DTX noise pumping issue.
A workaround for Opus DTX noise pumping issue was made according upon this
https://codereview.webrtc.org/1422213003

Recently, Opus has fixed this problem internally, and hence the workaround is not needed any longer.

This CL removes this workaround.

BUG=586175
R=flim@webrtc.org, tina.legrand@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11805}
2016-02-29 09:24:25 +00:00
806706875d iSAC entropy coder: Avoid signed integer overflow
By doing an unsigned instead of a signed addition, we get the exact
same machine code (in non-UBSan builds), but no longer trigger
undefined behavior since unsigned overflow is defined behavior.

BUG=webrtc:5485

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

Cr-Commit-Position: refs/heads/master@{#11776}
2016-02-26 10:52:14 +00:00
58e08cbea8 Reset indexer upon initialization in AudioLoop.
The array is reset in Init() but not the indexer. This makes the start point undefined after Init() for re-initializing an AudioLoop. This can be fixed.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#11739}
2016-02-24 11:49:23 +00:00
b7261fd3ae iSAC float: Check for end of input buffer while decoding
Previously, we relied on the encoded stream to come to an end before
the end of the buffer. This is a bad idea, since it is possible to
craft a stream that fills the buffer while decoding to less than the
expected amount of data; without the new checks introduced here, this
causes the decoder to read past the end of the input buffer.

BUG=chromium:582471, chromium:587852

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

Cr-Commit-Position: refs/heads/master@{#11734}
2016-02-24 09:34:33 +00:00