Commit Graph

270 Commits

Author SHA1 Message Date
88de4792d0 AudioEncoderIsac: Print error code if CHECK for successful encoding fails
This will hopefully make the crash in bug 4577 easier to understand if
it happens again.

BUG=4577
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/52389004

Cr-Commit-Position: refs/heads/master@{#9100}
2015-04-28 13:43:43 +00:00
e8a197bd07 Enable isac NEON building on Aarch64
Passed building isac_neon and modules_unittests on Android ARM64 and
ARMv7.
Passed modules_unittests with following filters:
--gtest_filter=FiltersTest*
--gtest_filter=LpcMaskingModelTest*
--gtest_filter=TransformTest*
--gtest_filter=FilterBanksTest*

WebRtcIsacfix_CalculateResidualEnergyNeon is not enabled due to Issue
4224.

BUG=4002
R=andrew@webrtc.org, jridges@masque.com, kjellander@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44229004

Patch from Zhongwei Yao <zhongwei.yao@arm.com>.

Cr-Commit-Position: refs/heads/master@{#9092}
2015-04-28 06:42:04 +00:00
d3e8eda839 (Re-land) AudioEncoderDecoderIsac: Merge the two config structs
This reverts commit 599beb86, which in turn reverted 7c324cac. What
makes it work this time is that we don't remove the option of setting
bit_rate to 0 in order to ask for the default value.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4228, chromium:478161
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48199004

Cr-Commit-Position: refs/heads/master@{#9068}
2015-04-23 12:06:46 +00:00
92f9eacd13 g722 and red encoders: Use rtc::Buffer instead of scoped_ptr<uint8_t[]>
It's a win for red, and a toss-up for g722 since it never resizes its
buffer.

R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45219005

Cr-Commit-Position: refs/heads/master@{#9067}
2015-04-23 11:53:02 +00:00
8f85dbcce4 Reduce the number of registers used in MIPS optimizations.
This change is needed by ChromeOS as it introduces -fno-omit-frame-pointer
flag (see code.google.com/p/chromium/issues/detail?id=477749). This causes
compile error for MIPS, as some MIPS optimization blocks use maximum possible
number of available registers.
Also, this change contains minor GN build fix for MIPS platform regarding the
pitch_filter_mips.c / pitch_filter_c.c file inclusion.

BUG=477749
R=andrew@webrtc.org, djordje.pesut@imgtec.com, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48139004

Patch from Ljubomir Papuga <lpapuga@mips.com>.

Cr-Commit-Position: refs/heads/master@{#9047}
2015-04-21 23:52:26 +00:00
599beb8687 Revert "AudioEncoderDecoderIsac: Merge the two config structs"
Reason for revert - breaks Hangouts

This reverts commit 7c324cac50ac38122b3f3b26455bc55ad834bfc0.

BUG=chromium:478161

Review URL: https://webrtc-codereview.appspot.com/43209004

Cr-Commit-Position: refs/heads/master@{#9030}
2015-04-17 21:13:59 +00:00
7c324cac50 AudioEncoderDecoderIsac: Merge the two config structs
This patch merges the Config and ConfigAdaptive structs, so that iSAC
has just one config struct like the other codecs. Future CLs will make
use of this.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4228
R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45979004

Cr-Commit-Position: refs/heads/master@{#9015}
2015-04-16 04:00:18 +00:00
f2822edf61 Refactor audio_coding/codecs/isac/fix: Removed usage of macro WEBRTC_SPL_MUL_16_16_RSFT
The macro is defined as
#define WEBRTC_SPL_MUL_16_16_RSFT(a, b, c) \
(WEBRTC_SPL_MUL_16_16(a, b) >> (c))

where the latter macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) \
((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definitions on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_{armv7,mips}.h)

The replacement consists of
- avoiding casts to int16_t if inputs already are int16_t
- adding explicit cast to <type> if result is assigned to <type> (other than int or int32_t)
- minor cleanups like remove of unnecessary parentheses and style changes
- removed commented code lines used during development
- excluded fft.c since there are neon optimizations used and a removal may cause a performance regression

BUG=3348, 3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48799004

Cr-Commit-Position: refs/heads/master@{#8967}
2015-04-10 06:06:46 +00:00
d417c93c10 Remove android_webview_build conditions.
Now that android_webview_build is no longer supported, remove build
conditionals referencing it and also remove the extra level of
indirection used to reference the cpufeatures target.

BUG=chromium:440793
R=henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44119005

Patch from Richard Coles <torne@chromium.org>.

Cr-Commit-Position: refs/heads/master@{#8963}
2015-04-09 15:36:13 +00:00
d4e75016a3 Refactor audio_coding/codecs/isac/fix: Removed usage of trivial macro WEBRTC_SPL_LSHIFT_W32()
The macro is defined as
#define WEBRTC_SPL_LSHIFT_W32(a, b) ((a) << (b))
hence trivial.
The macro name may in fact mislead the user to assume a cast/truncation to int32_t is done.
- Removing usage of it.
- Some style changes.

BUG=3348, 3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/46749005

Cr-Commit-Position: refs/heads/master@{#8918}
2015-04-02 04:59:44 +00:00
f809b9b38d Fix bug in WebRtcIsacfix_FilterMaLoopNeon.
Pass content_browsertests in Chromium. Performance test result (lower is
better):
C version: 100%
old intrinsics Neon version (with bug): 16.5%
new intrinsics Neon version: 18.0%
asm Neon version: 23.3%

BUG=4002
R=andrew@webrtc.org, jridges@masque.com

Change-Id: Ia0a96ac237216b635fc528f67d39319cdf246281

Review URL: https://webrtc-codereview.appspot.com/46739004

Cr-Commit-Position: refs/heads/master@{#8907}
2015-04-01 09:43:22 +00:00
582f80e95c Clamp decoder sample rate to 32000 in iSAC
We want to crate the illusion that iSAC supports 48000 Hz decoding,
while in fact it outputs 32000 Hz. This is the iSAC fullband mode.

Currently this is (also) handled by higher layers, but in future
changes this will not be the case.

R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/47809004

Cr-Commit-Position: refs/heads/master@{#8889}
2015-03-30 13:01:47 +00:00
09b6ff9460 Disable PLC for iSAC
A codec's packet-loss concealer is called once from NetEq before
decoding the first packet after a packet loss. The purpose is not to
use the PLC output, but to prepare the state of the decoder such that
it may recover faster after the loss. However, this effect is not
achieved by calling iSAC's PLC. Also, there are some problems with the
fixed-point implementation of the PLC (see the associated bug).

BUG=4423
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42849004

Cr-Commit-Position: refs/heads/master@{#8827}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8827 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-23 12:24:14 +00:00
6069032ebb Refactor audio_coding/isac: removed usage of macro WEBRTC_SPL_LSHIFT_W32
The macro is defined as
#define WEBRTC_SPL_LSHIFT_W32(a, b) ((a) << (b))
It is a trivial operation that need no macro. In fact it may be confusing for to the user, since it can be interpreted as having an implicit cast to int32_t.

BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44659004

Cr-Commit-Position: refs/heads/master@{#8801}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8801 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-20 07:03:41 +00:00
4ab23d0e8f Refactor audio_coding/ilbc: removes usage of macro WEBRTC_SPL_LSHIFT_W32
The macro is defined as
#define WEBRTC_SPL_LSHIFT_W32(a, b) ((a) << (b))
It is a trivial operation that need no macro. In fact it may be confusing for to the user, since it can be interpreted as having an implicit cast to int32_t.

Also removes unnecessary casts to int32_t from int16_t.

BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48519004

Cr-Commit-Position: refs/heads/master@{#8800}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8800 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-20 06:01:43 +00:00
9afaee74ab Reland 8749: AudioEncoder: return EncodedInfo from Encode() and EncodeInternal()
Old review at:
https://webrtc-codereview.appspot.com/43839004/

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45769004

Cr-Commit-Position: refs/heads/master@{#8788}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8788 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-19 08:51:20 +00:00
6dba1ebd14 Make AudioDecoder stateless
The channels_ member varable is removed from the base class, and the
associated accessor function is changed to Channels() which is a pure
virtual function.

R=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43779004

Cr-Commit-Position: refs/heads/master@{#8775}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8775 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-18 09:48:12 +00:00
019955d770 Revert 8749 "We changed Encode() and EncodeInternal() return typ..."
The reason is that this cl adds a static initializer so we can't roll webrtc into Chromium.
See audio_encoder.cc and 'sizes' regression here:
http://build.chromium.org/p/chromium/builders/Linux%20x64/builds/186

> We changed Encode() and EncodeInternal() return type from bool to void in this issue:
> https://webrtc-codereview.appspot.com/38279004/
> Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.
> 
> R=kwiberg@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/43839004

TBR=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/49449004

Cr-Commit-Position: refs/heads/master@{#8772}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8772 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-18 06:38:40 +00:00
7c112f3e5a Adding build_opus as a switch in GYP.
This is to allow not building Opus. On non-chromium non-gyp chases, one can let WebRTC depend on other Opus builds.

BUG=
R=kjellander@webrtc.org, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43739004

Cr-Commit-Position: refs/heads/master@{#8754}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8754 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-17 14:05:18 +00:00
0cb612b43b We changed Encode() and EncodeInternal() return type from bool to void in this issue:
https://webrtc-codereview.appspot.com/38279004/
Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43839004

Cr-Commit-Position: refs/heads/master@{#8749}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8749 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-17 12:13:13 +00:00
7f7d7e3427 Prevent crash in NetEQ when decoder overflow.
NetEQ can crash when decoder gives too many output samples than it can handle. A practical case this happens is when multiple opus packets are combined.

The best solution is to pass the max size to the ACM decode function and let it return a failure if the max size if too small.

BUG=4361
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45619004

Cr-Commit-Position: refs/heads/master@{#8730}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8730 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-16 12:31:19 +00:00
bc2bb34419 Refactor audio_coding/codecs/isac: Removed usage of macro WEBRTC_SPL_MUL_16_16
The macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) ((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definition on ARMv7 and MIPS, see
common_audio/signal_processing/include/spl_inl_armv7.h and
common_audio/signal_processing/include/spl_inl_mips.h)

The replacement consists of
- avoiding casts to int16_t if inputs already are int16_t
- adding explicit cast to <type> if result is assigned to <type> (other than int
or int32_t)

Some other minor code cleanup also exists.

BUG=3348,3353
TESTED=locally on Mac and trybots
R=henrik.lundin@webrtc.org, kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42639004

Cr-Commit-Position: refs/heads/master@{#8717}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8717 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-13 12:59:36 +00:00
0c5b137e7e Remove support for iSAC RCU
The current way that iSAC RCU is packetized and sent as a RED packet,
with the same payload type for primary and redundant payloads, does
not follow the specification for RED. As it is now, it is impossible
for a receiver to know if an incoming RED packet with iSAC payloads
inside consists of two "primary" (but time-shifted) payloads, or one
primary and one RCU payload. The RED standard stipulates that the
former option is the correct interpretation, while our implementation
currently applies the latter.

This CL removes support for iSAC RCU from Audio Coding Module, but
leaves it in the iSAC codec itself (i.e., in the C implementation).

BUG=4402
COAUTHOR=kwiberg@webrtc.org
R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45569004

Cr-Commit-Position: refs/heads/master@{#8713}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8713 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-13 08:28:54 +00:00
e16bfde512 Adding flag to force Opus application and DTX while toggling.
Currently, we only allow Opus DTX in combination with Opus kVoip mode. When one of them is toggled, the other might need to change as well. This CL is to introduce a flag to force a co-config.

BUG=
R=henrik.lundin@webrtc.org, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40159004

Cr-Commit-Position: refs/heads/master@{#8698}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8698 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-12 15:29:23 +00:00
51ccf37638 AudioEncoder: add method MaxEncodedBytes
Added method AudioEncoder::MaxEncodedBytes() and provided implementations in derived encoders. This method returns the number of bytes that can be produced by the encoder at each Encode() call.
Unit tests were updated to use the new method.
Buffer allocation was not changed in AudioCodingModuleImpl::Encode(). It will be done after additional investigation.
Other refactoring work that was done, that may not be obvious why:
1. Moved some code into AudioEncoderCng::EncodePassive() to make it more consistent with EncodeActive().
2. Changed the order of NumChannels() and  RtpTimestampRateHz() declarations in AudioEncoderG722 and AudioEncoderCopyRed classes. It just bothered me that the order was not the same as in AudioEncoder class and its other derived classes.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40259005

Cr-Commit-Position: refs/heads/master@{#8671}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8671 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-10 15:42:21 +00:00
6b56d0793e Revert 8632 "Enable isac NEON building on Aarch64"
Breaks Chromium audio tests on Nexus 9.
http://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Tests%20%28dbg%29%20%28L%20Nexus9%29/builds/1152/steps/content_browsertests/logs/stdio

It also actually broke already on our android_arm64 trybot in the CL:
http://build.chromium.org/p/tryserver.webrtc/builders/android_arm64/builds/3282
but I failed to double-check that (I guess I assumed it was flakiness since
that bot has been flaking a lot lately).

> Enable isac NEON building on Aarch64
> 
> Passed building isac_neon and modules_unittests on Android ARM64 and ARMv7.
> Passed modules_unittests with following filters:
>   --gtest_filter=FiltersTest*
>   --gtest_filter=LpcMaskingModelTest*
>   --gtest_filter=TransformTest*
>   --gtest_filter=FilterBanksTest*
> 
> WebRtcIsacfix_CalculateResidualEnergyNeon is not enabled due to Issue 4224.
> 
> BUG=4002
> R=andrew@webrtc.org, jridges@masque.com, kjellander@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/39979004
> 
> Patch from Zhongwei Yao <zhongwei.yao@arm.com>.

TBR=zhongwei.yao@arm.com, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45559004

Cr-Commit-Position: refs/heads/master@{#8649}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8649 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-09 11:08:42 +00:00
75e850e192 Enable isac NEON building on Aarch64
Passed building isac_neon and modules_unittests on Android ARM64 and ARMv7.
Passed modules_unittests with following filters:
  --gtest_filter=FiltersTest*
  --gtest_filter=LpcMaskingModelTest*
  --gtest_filter=TransformTest*
  --gtest_filter=FilterBanksTest*

WebRtcIsacfix_CalculateResidualEnergyNeon is not enabled due to Issue 4224.

BUG=4002
R=andrew@webrtc.org, jridges@masque.com, kjellander@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39979004

Patch from Zhongwei Yao <zhongwei.yao@arm.com>.

Cr-Commit-Position: refs/heads/master@{#8632}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8632 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-06 12:29:23 +00:00
fa67463d37 skip isac_neon if neon is not supported
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39909004

Patch from Mostyn Bramley-Moore <mostynb@opera.com>.

Cr-Commit-Position: refs/heads/master@{#8610}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8610 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-05 06:07:51 +00:00
c86bbbaa93 Add speech flag to EncodedInfo
The flag indicates if the encoded bitstream is speech or comfort noise.

COAUTHOR=kwiberg@webrtc.org
R=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42629004

Cr-Commit-Position: refs/heads/master@{#8598}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8598 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-04 16:03:19 +00:00
14665ff7d4 Roll chromium_revision e144d30..6fdb142 (318658:318841) + remove OVERRIDE macro
Clang version changed 223108:230914
Details: e144d30..6fdb142/tools/clang/scripts/update.sh

Removes the OVERRIDE macro defined in:
* webrtc/base/common.h
* webrtc/typedefs.h

The majority of the source changes were done by running this in src/:
perl -0pi -e "s/virtual\s([^({;]*(\([^({;]*\)[^({;]*))(OVERRIDE|override)/\1override/sg" `find {talk,webrtc} -name "*.h"  -o -name "*.cc*" -o -name "*.mm*"`

which converted all:
virtual Foo() OVERRIDE
functions to:
Foo() override

Then I manually edited:
* talk/media/webrtc/fakewebrtccommon.h
* webrtc/test/fake_common.h

Remaining uses of OVERRIDE was fixed by search+replace.

Manual edits were done to fix virtual destructors that were
overriding inherited ones.

Finally a build error related to the pure virtual definitions of
Read, Write and Rewind in common_types.h required a bit of
refactoring in:
* webrtc/common_types.cc
* webrtc/common_types.h
* webrtc/system_wrappers/interface/file_wrapper.h
* webrtc/system_wrappers/source/file_impl.cc

This roll should make it possible for us to finally re-enable deadlock
detection for TSan on the buildbots.

BUG=4106
R=pbos@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41069004

Cr-Commit-Position: refs/heads/master@{#8596}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8596 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-04 13:04:54 +00:00
1d25c87199 Reland r8577 "Collapse AudioEncoderDecoderIsacRed into ..."
This effectively reverts r8578.

TBR=jmarusic@webrtc.org

Original commit message:
Collapse AudioEncoderDecoderIsacRed into AudioEncoderDecoderIsac

With this change, support for iSAC-RED is incorporated into the
regular AudioEncoderDecoderIsac class.

COAUTHOR=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44539004

Cr-Commit-Position: refs/heads/master@{#8589}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8589 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-04 08:55:42 +00:00
bcef431902 Revert r8577 "Collapse AudioEncoderDecoderIsacRed into ..."
Some of the build bots seems to have reacted to this change.

TBR=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42169004

Cr-Commit-Position: refs/heads/master@{#8578}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8578 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-03 20:13:48 +00:00
1fc28f2305 Collapse AudioEncoderDecoderIsacRed into AudioEncoderDecoderIsac
With this change, support for iSAC-RED is incorporated into the regular
AudioEncoderDecoderIsac class.

COAUTHOR=kwiberg@webrtc.org
R=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43549004

Cr-Commit-Position: refs/heads/master@{#8577}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8577 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-03 19:31:17 +00:00
0561716ae2 Adding Opus DTX support in ACM.
This solution does not use the existing VAD/DTX logic of ACM, since Opus DTX is codec feature, while ACM VAD/DTX is mainly for setting the WebRTC VAD/DTX.

During the development of this CL, two old bugs were found and are fixed in this CL too.

They are in
webrtc/modules/audio_coding/test/Channels.cc
and webrtc/modules/audio_coding/main/acm2/acm_opus_unittest.cc
respectively.

BUG=webrtc:1014
R=henrik.lundin@webrtc.org, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38469004

Cr-Commit-Position: refs/heads/master@{#8573}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8573 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-03 12:03:14 +00:00
db93b68031 Removing NetEq's direct dependencies on Opus headers.
Neteq had a direct dependency on Chromium/third_party/opus. This should be relayed by target webrtc_opus.

BUG=
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42529004

Cr-Commit-Position: refs/heads/master@{#8567}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8567 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-03 09:28:53 +00:00
2f6ae0de5b audio_coding/codec/ilbc: Removed usage of WEBRTC_SPL_MUL_16_16_RSFT
The macro is defined as
#define WEBRTC_SPL_MUL_16_16_RSFT(a, b, c) \
    (WEBRTC_SPL_MUL_16_16(a, b) >> (c))

where the latter macro is in C defined as
(For definitions on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_{armv7,mips}.h)

The replacement consists of
- avoiding casts to int16_t if inputs already are int16_t
- adding explicit cast to <type> if result is assigned to <type> (other than int or int32_t)
- minor cleanups like remove of unnecessary parantheses and style changes

BUG=3348, 3353
TESTED=locally on Mac and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39139004

Cr-Commit-Position: refs/heads/master@{#8544}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8544 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-01 19:51:31 +00:00
abbdd520b0 AudioEncoder: documentation fix
Follow-up to https://webrtc-codereview.appspot.com/38279004/

R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38309004

Cr-Commit-Position: refs/heads/master@{#8524}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8524 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-27 09:20:25 +00:00
b1f0de30be AudioEncoder: change Encode and EncodeInternal return type to void
After code cleanup done on issues:
https://webrtc-codereview.appspot.com/34259004/
https://webrtc-codereview.appspot.com/43409004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/36209004/
https://webrtc-codereview.appspot.com/40899004/
https://webrtc-codereview.appspot.com/39279004/
https://webrtc-codereview.appspot.com/42099005/
and the similar work done for AudioEncoderDecoderIsacT,  methods AudioEncoder::Encode and AudioEncoder::EncodeInternal will always succeed. Therefore, there is no need for them to return bool value that represents success or failure.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38279004

Cr-Commit-Position: refs/heads/master@{#8518}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8518 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 15:38:46 +00:00
00b8f6b364 Use base/scoped_ptr.h; system_wrappers/interface/scoped_ptr.h is going away
BUG=
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36229004

Cr-Commit-Position: refs/heads/master@{#8517}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8517 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 14:43:50 +00:00
9b969e167d AudioEncoderCopyRed: CHECK that encode call doesn't fail
Call to AudioEncoder::Encode fails only if fed bad input, so instead of handling failure, we can just CHECK.
There is also no need to handle case where size of encoded data is larger than allowed maximum, so we just CHECK.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42099005

Cr-Commit-Position: refs/heads/master@{#8504}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8504 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-25 11:53:45 +00:00
1eda4e3db6 Reland r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This should be safe to land now that issue 4143 was resolved (in r8492).
This change effectively reverts 8488.

TBR=kwiberg@webrtc.org

Original commit message:
This CL changes the way the decoder sample rate is set and updated. In
practice, it only concerns the iSAC (float) codec.

One single iSAC decoder instance is used for both wideband and
super-wideband decoding, and the instance must be told to switch
output frequency if the payload type changes. This used to be done
through a call to UpdateDecoderSampleRate, but is now instead done in
the Decode call as an extra parameter.

Review URL: https://webrtc-codereview.appspot.com/39289004

Cr-Commit-Position: refs/heads/master@{#8496}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8496 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-25 10:03:19 +00:00
d4dfba8ea1 iSAC Decode: Prevent Memcheck from complaining about uninitialized value
Without this patch, Valgrind's Memcheck was complaining that the test
for whether we should return -1 following the call to
WebRtcIsac_DecodeLb made a conditional branch or move based on the
value of numSamplesLB, which was uninitialized if WebRtcIsac_DecodeLb
failed.

However, as can be seen in the source, the control flow only depends
on the value of numSamplesLB if numDecodedBytesLB >= 0; i.e., if
WebRtcIsac_DecodeLb returned successfully, in which case numSamplesLB
is always initialized. The discrepancy is due to the fact that
Valgrind works on the generated machine code, which contains spurious
such dependencies. The generated code for this test:

  if ((numDecodedBytesLB < 0) || (numDecodedBytesLB > lenEncodedLBBytes) ||
      (numSamplesLB > MAX_FRAMESAMPLES)) {

looks like this:

  95:   0f bf 45 d6             movswl -0x2a(%rbp),%eax
  99:   3d c0 03 00 00          cmp    $0x3c0,%eax
  9e:   0f 8f 45 01 00 00       jg     1e9 <Decode+0x1e9>
  a4:   44 89 f0                mov    %r14d,%eax
  a7:   c1 e0 10                shl    $0x10,%eax
  aa:   0f 88 39 01 00 00       js     1e9 <Decode+0x1e9>
  b0:   41 0f bf ce             movswl %r14w,%ecx
  b4:   89 8d 98 e1 ff ff       mov    %ecx,-0x1e68(%rbp)
  ba:   41 0f bf c7             movswl %r15w,%eax
  be:   39 c1                   cmp    %eax,%ecx
  c0:   0f 8f 23 01 00 00       jg     1e9 <Decode+0x1e9>

Note how the compiler has seemingly ignored the C language's guarantee
that the arguments to || must be evaluated in left-to-right order, and
compares numSamplesLB (%eax) with MAX_FRAMESAMPLES (0x3c0, a.k.a. 960)
before the other two conditions! If the uninitialized value in
numSamplesLB happens to be greater than 960, we'll jump to
Decode+0x1e9 (where we'll return -1) without even looking at the other
two conditions. Has the compiler generated broken code?

Well, no. If numDecodedBytesLB is < 0 so that numSamplesLB is
uninitialized, we'll end up jumping to 1e9 whether that value is
greater than 960 or not; we'll just do it with different jump
instructions. This is entirely invisible as far as the C language is
concerned, but the dependency on the uninitialized value is visible at
the machine code level, which is why Memcheck complains.

This patch solves the problem by pragmatically initializing
numSamplesLB before the call even though it isn't necessary other than
for placating Memcheck.

BUG=4143
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36309004

Cr-Commit-Position: refs/heads/master@{#8492}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8492 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-25 08:09:28 +00:00
903182bd8e Revert r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This change uncovered issue 4143, evading the Memcheck suppression
since the signature is changed in the Decode function.

A fix for this is in the making; see
https://review.webrtc.org/36309004. This CL will be re-landed once the
fix is in place.

BUG=4143
TBR=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42089004

Cr-Commit-Position: refs/heads/master@{#8488}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8488 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 21:18:44 +00:00
b9c18d5643 Set decoder output frequency in AudioDecoder::Decode call
This CL changes the way the decoder sample rate is set and updated. In
practice, it only concerns the iSAC (float) codec.

One single iSAC decoder instance is used for both wideband and
super-wideband decoding, and the instance must be told to switch
output frequency if the payload type changes. This used to be done
through a call to UpdateDecoderSampleRate, but is now instead done in
the Decode call as an extra parameter.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34349004

Cr-Commit-Position: refs/heads/master@{#8476}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8476 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 15:59:20 +00:00
f88791d783 AudioEncoderCng: CHECK that encode calls don't fail
Calls to WebRtcCng_Encode, AudioEncoder::Encode and Vad::VoiceActivity fail only if fed bad input, so instead of handling failure, we can just CHECK. This also makes it unnecessary for methods AudioEncoderCng::EncodePassive and AudioEncoderCng::EncodeActive to return a value, so we can make them void.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39279004

Cr-Commit-Position: refs/heads/master@{#8475}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8475 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 14:59:19 +00:00
13ca5f6db2 AudioEncoderOpus: CHECK that encode call doesn't fail
WebRtcOpus_Encode will only ever fail if fed bad input, and since we don't do that, we can CHECK that it doesn't fail instead of having code that tries to handle failure.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40899004

Cr-Commit-Position: refs/heads/master@{#8469}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8469 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 09:57:18 +00:00
f3a306b5bc g722: Enhanced documentation. Added CHECK.
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43409004

Cr-Commit-Position: refs/heads/master@{#8462}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8462 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-23 15:41:49 +00:00
2acec4cc32 Enhanced documentation. Replaced DCHECK with CHECK.
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34309004

Cr-Commit-Position: refs/heads/master@{#8461}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8461 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-23 15:28:14 +00:00
2a5cfc2167 Replaced unnecessary check with an explicit CHECK.
WebRtcIlbcfix_Encode method that is called returns an error code only if a packet with more than 3 frames is passed, which is illegal.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36209004

Cr-Commit-Position: refs/heads/master@{#8456}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8456 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-23 08:53:15 +00:00
be96bfb179 Re-land "Switch to using AudioEncoderIsac instead of ACMISAC"
It should work now, after the fix in r8431.

Previously committed in r8342, reverted in r8372, committed in r8378,
and reverted in r8412.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4228
TBR=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34279004

Cr-Commit-Position: refs/heads/master@{#8433}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8433 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-19 15:10:49 +00:00