Commit graph

137 commits

Author SHA1 Message Date
Niels Möller
0aa7e37363 Add include of <cstdlib>
Needed since opus_interface.cc uses the C functions calloc and free.

Bug: None
Change-Id: Iad30be533d7f6d8234c8e49efd461dc6ce0e2442
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164534
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30168}
2020-01-07 14:46:03 +00:00
Sam Zackrisson
184da528a7 Fix ASAN bug in iSAC codec
There is a value missing in an array, causing indexing to sometimes be off by one.
The result is never used anyway, so the "solution" is to insert an extra zero at the end.

Details:

In an old refactoring CL, the corresponding array in the floating point version of iSAC is declared with 578 elements, the fixed point version has 577.
See WebRtcIsac_kQKltCodeLenShape:
https://webrtc-codereview.appspot.com/548004/patch/10002/11005
Perhaps the entire array was not carried over to fixed point.

However, the floating point version does not actually have 578 elements in its definition, it has 568. The remaining 10 elements are initialized to 0. So there is no value to use from there, and using a zero instead will mimic the behavior of the floating point code.


Use of the value:
WebRtcIsacfix_kCodeLenShapeQ11 is only accessed in one place [0].
The value sumQQ is set to is only used to compute the BitsQQ,
which is only used to populate the sizeQ11 param of EstCodeLpcCoef,
which is never used anywhere. Not within EstCodeLpcCoef, not within the calling function WebRtcIsacfix_EncodeLpc [1], not in the calling function's calling function [2]. Then it falls out of scope.

[0] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c?l=1223&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de
[1] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c?l=1468&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de
[2] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c?l=214&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de

Tested: Instructions in linked bug. No longer repro after applying this CL.
Bug: webrtc:10584
Change-Id: I87a90e8cf58d82f615217e05ea401d3259887769
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161942
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30065}
2019-12-11 15:59:14 +00:00
Artem Titov
9dc209a23a Add ability to disable detailed error message in RTC_CHECKs
Bug: webrtc:11133
Change-Id: I989654f1fb97b476a17956d69ee374406439ea8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160653
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29952}
2019-11-28 17:51:00 +00:00
Minyue Li
332274dfef Adding GetInDtx to WebRTC Opus Interface.
Bug: webrtc:11085
Change-Id: Ie9152cbe3f3c70f6febafb877852d68a831bcae9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159708
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29834}
2019-11-19 14:14:06 +00:00
Yves Gerey
3a65f392a3 Expose NetEqDecodingTest for re-use in chromium tests.
This CL allows to trigger related tests when rolling opus
(at chromium side). Namely:
* TestOpusBitExactness
* TestOpusDtxBitExactness

This CL also prevents name clash for OpusTest:
* modules/audio_coding/test/opus_test.h: Helper class.
* modules/audio_coding/neteq/opus_unittest.cc: Local test fixture.

Bug: chromium:1002973
Change-Id: If8470b5f64fbdb1f7a84b838bde62d8c90390f2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159033
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29759}
2019-11-11 17:45:46 +00:00
Minyue Li
8e83c7ac09 Make Opus PLC always output 10ms audio.
BUG: b/143582588
Change-Id: I41ad5f4f91d9af3f595666a8f32b7ab5382605bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158672
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29733}
2019-11-07 21:15:58 +00:00
Sergey Silkin
bd826152dd Suppress noisy logging from opus encoder.
Bug: none
Change-Id: Icc3d61f9dfe2582f8ae5de37de7ea148d272876c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158897
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29706}
2019-11-06 12:33:53 +00:00
Sebastian Jansson
cd2a92f8e0 Removes RPLR based FEC controller.
This is not used and adds a lot of maintenance overhead to
the code since it requires that the transport feedback adapter
communicates directly with audio send stream.

This also means that the packet loss tracker used as input for
this can be removed and a lot of wiring up code overall.

Bug: webrtc:9883
Change-Id: I25689fb622ed89cbb378c27212a159485f5f53be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156502
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29667}
2019-10-31 13:56:44 +00:00
Minyue Li
fb075d558d Removing unused Opus wrapper API: WebRTCOpus_DecodePlc.
Bug: None
Change-Id: I5b613b4c13ec5f6ad13d8430043d006f6d83c11f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158671
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29664}
2019-10-31 12:01:31 +00:00
Minyue Li
54d027843a Renaming opus_interface.c to opus_interface.cc.
This is to allow advanced features of WebRTC/Chrome e.g., field trials.

More style compliant changes may follow up. Only a minimal (not in terms of line changes) is applied, so that presubmit does not complain. These changes include

1. removing unused headers.
2. eliminating c-style casting.

Bug: b/143582588
Change-Id: I6d0fd926c542ab0afdc38cc4bf03aaf584ec13dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158670
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29657}
2019-10-30 15:48:28 +00:00
Ivo Creusen
79e653c46d Apply bitrate boosting depending on field-trial.
This field-trial allows us to provide multipliers for the opus target
bitrate.

Bug: webrtc:11055
Change-Id: I79c4c6389c6908daadda355e5ce0668413d0aaa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158530
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29634}
2019-10-28 17:05:30 +00:00
Minyue Li
1272dade56 Reduce log level of Opus bitrate.
Bug: None
Change-Id: Iab815dbbc12bf1ca2c1cc87acb0765e2ccade591
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157895
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29570}
2019-10-22 12:02:09 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00
Sebastian Jansson
62aee9379c Adds trial to calculate audio overhead based on available data.
This adds the ability to disable legacy overhead calculation so we'll
use the available data on per packet over head and frame length range
to set the min and max total  allocatable bitrate.

Bug: webrtc:11001
Change-Id: I2a94499433e15bad11a08f81fe7f1dfc27982cdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155175
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29368}
2019-10-02 13:42:15 +00:00
Sebastian Jansson
f34116e356 Replacing bandwidth adaptation trial with stable target in Opus encoder.
This also means that the NetworkEstimate::bandwidth can be deprecated
as it's currently just a copy of the target_rate.

Bug: webrtc:10981
Change-Id: I1bc57b98480bd77ce052736b19d630c775428546
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153669
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29288}
2019-09-24 16:35:02 +00:00
Niels Möller
ef14f072a9 Delete AudioDecoder method IncomingPacket
Only the ISAC codec had an non-trivial implementation, for its unused
adaptive mode. This cl deletes that implementation, and the call
from NetEq, and the interface method.

Bug: webrtc:10098
Change-Id: Iaf7667e0ae867fc9d64286dff4c01a8ce0b6e2a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153882
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29279}
2019-09-24 08:30:24 +00:00
Niels Möller
544dfb5a97 Delete isac GetBandwidthInfo/SetBandwidthInfo
Bug: webrtc:10098
Change-Id: I4a56cdc6d081b15a1fc52cba2051783daf4e5ae3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153881
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29256}
2019-09-20 13:53:52 +00:00
Niels Möller
48b32b748e Delete support for enabling adaptive isac mode
This appears unused. If deleted, other code related to isac bandwidth
estimation becomes unused and may be deleted in followup cls.

Bug: webrtc:10098
Change-Id: Ifeac2e90de895b12c337ea28cc33704350b9abf4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153667
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29252}
2019-09-20 10:41:09 +00:00
Niels Möller
e0b31677b6 Delete dead code inside #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
Bug: None
Change-Id: If31f2a5e4a2536b3c7fda596f2c251e8074a18d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153671
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29249}
2019-09-20 07:40:10 +00:00
Niels Möller
6a092637f0 Delete obsolete isac "assign" api
Bug: None
Change-Id: I116e3f4b89e2c1e1f0d06e2ff5d58d2a50e2aadb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153665
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29239}
2019-09-19 13:26:26 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Minyue Li
9b29d69650 Make ANA frame length controller more robust to encoder frame lengths.
Bug: webrtc:10820
Change-Id: Ic3a30976d0181de9cdd35e44d4c5439cadad4812
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149163
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28873}
2019-08-16 10:55:39 +00:00
Jiawei Ou
608e6ba394 Add AudioDecoderIsacT::Config to include sampling rate and BWInfo object
This CL will make AudioDecoderIsacT symmetrical to AudioEncoderIsacT.

Bug: webrtc:10826
Change-Id: I78d1cf7bc2245bf4a282aabd81c8ece6ca23f285
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146683
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28847}
2019-08-14 00:40:19 +00:00
Oleh Prypin
b1686786e8 Add RTC_ prefix to non-standard format specifier macro "PRIdNS"
Some of the macros in format_macros.h follow the C standard and try to fill holes in it (on Windows). But this one has no direct equivalent in the standard and is just mimicking the naming convention. That's not nice.

References:
https://devblogs.microsoft.com/cppblog/c99-library-support-in-visual-studio-2013/
https://stackoverflow.com/a/2524673

Change-Id: I53f3faca2976a5b5d4b04a67ffb56ae0f4e930b2
Bug: webrtc:10852
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147862
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28794}
2019-08-07 13:36:05 +00:00
Mirko Bonadei
6982f6091b Remove empty OWNERS file.
No-Try: True
Bug: None
Change-Id: Ief114d10198c0b5871bd431c79c78eb5e36f35d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146541
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28630}
2019-07-22 11:55:23 +00:00
Mirko Bonadei
e9ff992fd6 Fix isac_fix_test perf reporting.
The regression has been introduced by [1] and here is an example of
the problem [2].

[1] - https://webrtc.googlesource.com/src/+/2ab97f6f8e27b47c0d9beeb8b6ca5387bda9f55c
[2] - https://ci.chromium.org/p/webrtc/builders/perf/Perf%20Linux%20Trusty/1543

TBR=minyue@webrtc.org

Bug: webrtc:10616
Change-Id: I109b55a612d49981ce74c3e4cd50603ee0003250
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146540
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28627}
2019-07-22 07:24:07 +00:00
Yves Gerey
bb80c1347c Guard against clang-format wrong behavior.
Prevent clang-format to touch these two files,
as the result doesn't honor ColumnLimit setting.

Bug: webrtc:9340
Change-Id: I9b692a82df5385fa2d1216d915898439234b34b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145720
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28577}
2019-07-16 12:18:32 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Minyue Li
e8fbc5d702 Refactor WebRtcOpus_PacketHasFec.
WebRtcOpus_PacketHasFec was written long time ago. see http://webrtc-codereview.appspot.com/7539004.
When revisiting, I notice that adding more comments should help. Code style should be improved a bit too.

Bug: webrtc:10772
Change-Id: If4d60b210e6235b4f787608047e88efc949f6838
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144056
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28479}
2019-07-04 07:51:52 +00:00
Karl Wiberg
225842ced8 Initialize signal processing function pointers statically
The last run-time logic for selecting function pointers was removed in
May 2016, here: https://codereview.webrtc.org/1955413003

It would be even better if we could eliminate the function pointers
entirely and just have different implementations that we select at
compile time; I've left a TODO asking for this.

Bug: webrtc:9553
Change-Id: Ica71d71e19759da00967168f6479b7eb8b46c590
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144053
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28414}
2019-06-28 14:20:03 +00:00
Karl Wiberg
7eb0a5e210 AudioDecoderOpus: Add support for 16 kHz output sample rate
In addition to the 48 kHz that we've always used.

Bug: webrtc:10631
Change-Id: If73bf7ff9c1c0d22e0d1caa245128612850f8e41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138268
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28104}
2019-05-29 12:42:38 +00:00
Karl Wiberg
a1d1a1e976 WebRTC Opus C interface: Add support for non-48 kHz decode sample rate
Plus tests for 16 kHz.

Bug: webrtc:10631
Change-Id: I2d89bc6d0d9548f0ad7bb1e36d6dfde6b6b31f83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138072
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28099}
2019-05-29 10:33:03 +00:00
Karl Wiberg
126f2b37ac AudioEncoderOpus: Add support for 16 kHz input sample rate
In addition to the 48 kHz that we've always used.

Bug: webrtc:10631
Change-Id: I5e4f6600e39a463d20d3988db098c7e38281f4a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138264
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28074}
2019-05-27 13:01:04 +00:00
Karl Wiberg
e0eb325d0d AudioEncoderOpusImpl: Remove unused static methods
Bug: webrtc:10631
Change-Id: I17583ff04f461a281c4ab0ad9322506431c9cade
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138074
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28070}
2019-05-27 12:02:38 +00:00
Karl Wiberg
7e7c5c3c25 WebRTC Opus C interface: Add support for non-48 kHz encode sample rate
Plus tests fo 16 kHz.

Bug: webrtc:10631
Change-Id: I162c40b6120d7e308e535faba7501e437b0b5dc4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137047
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28029}
2019-05-22 22:56:58 +00:00
Karl Wiberg
eb16697259 AudioEncoderOpus: Don't mix up sample rate and RTP timestamp rate
A later change will allow them to differ.

Bug: webrtc:10631
Change-Id: I4e13f41980261990b3bbbc6897cd754369265ca0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137046
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27991}
2019-05-20 17:33:56 +00:00
Alex Loiko
44c21f48ee Encoder side of Multistream Opus.
Follows https://webrtc-review.googlesource.com/c/src/+/129768 closely.
Adds an ENCODER and sets it up to parse SDP config for multistream
opus.

E.g. this is the new SDP syntax for 6.1 surround sound:
"multiopus/48000/6 channel_mapping=0,4,1,2,3,5 num_streams=4 coupled_streams=2"


Bug: webrtc:8649
Change-Id: I3fc341e76f5c41dab0243cf65f6461e4c3d9d67d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132001
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27775}
2019-04-25 15:07:38 +00:00
Sebastian Jansson
40889f35fc Removes TimeMicros interface from ThreadProcessingFakeClock.
Bug: webrtc:9883
Change-Id: Ib48872f81f734b09e3ffa4d9d26da79177b02303
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133341
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27668}
2019-04-17 15:37:48 +00:00
Mirko Bonadei
6a489f22c7 Fully qualify googletest symbols.
Semi-automatically created with:

git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g"
git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g"
git cl format

After this, two .cc files failed to compile and I have fixed them
manually.

Bug: webrtc:10523
Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27526}
2019-04-09 17:18:20 +00:00
Alex Loiko
e5b94160b5 Decoder for multistream Opus.
See https://webrtc-review.googlesource.com/c/src/+/121764 for the
overall vision.

This CL adds a multistream Opus decoder. It's a new code-path to not
interfere with the standard Opus decoder. We introduce new SDP syntax,
which uses terminology of RFC 7845. We also set up the decoder side to
parse it. The encoder part will come in a later CL.

E.g. this is the new SDP syntax for 6.1 surround sound:
"multiopus/48000/6 channel_mapping=0,4,1,2,3,5 num_streams=4 coupled_streams=2"

Bug: webrtc:8649
Change-Id: Ifbc584cbb6d07aed373f223512a20d6d72cec5ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129768
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27493}
2019-04-08 16:15:37 +00:00
Alex Loiko
50b8c399c9 Generalize the C-language Opus interface.
Switch to explicit channel mappings (RFC 7845) when creating
multi-stream Opus en/de-coders. The responsibility of setting up the
channel mappings will shift from WebRTC to the WebRTC user.

See https://webrtc-review.googlesource.com/c/src/+/121764 for the
current vision. See also the first child CL
https://webrtc-review.googlesource.com/c/src/+/129768
that sets up the Decoder to use this code.

Bug: webrtc:8649
Change-Id: I55959a293d54bb4c982eff68ec107c5ef8666c5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129767
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27452}
2019-04-04 14:06:44 +00:00
Artem Titov
94b57c044e Cleanup BUILD.gn files from imports like foo:foo
Repalce all occurrences of foo:foo in deps with just foo in BUILD.gn
files.

Done with Sublime regex replace.
Find: \b([-a-zA-Z0-9_]+):+\1\b
In: *.gn
Replace with: \1

Bug: None
Change-Id: I40aba1b14face687a595b852ffe443cb20197611
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127899
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27225}
2019-03-21 13:05:28 +00:00
Mirko Bonadei
c4dd730765 Fix -Wextra-semi warnings.
Starting from https://chromium-review.googlesource.com/c/1485012,
-Wextra-semi is enabled and WebRTC has some violations to fix.

This is a follow-up of https://webrtc-review.googlesource.com/c/123560.

Bug: webrtc:10355
Change-Id: I012b7497fc8991037fd77aa98f1579c22e08206f
Reviewed-on: https://webrtc-review.googlesource.com/c/124126
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26831}
2019-02-25 09:22:51 +00:00
Alex Loiko
65438812ba 2nd reland of https://webrtc-review.googlesource.com/c/src/+/114883
The difference to the original is new bitexactness strings.  The
reason for reland is breaking downstream projects.

Original CL description:

Tests for multi-stream Opus.

This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

TBR=ossu@webrtc.org

Bug: webrtc:8649
Change-Id: I6261b18c69fd666d43ab34ed8f1bc9d5cc82b21f
Reviewed-on: https://webrtc-review.googlesource.com/c/123882
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26809}
2019-02-22 09:59:01 +00:00
Nico Weber
22f9925b3e webrtc: Remove semicolons.
Bug: chromium:926235
Change-Id: I66c10ab3df38adf87152d1f18cc8162afedca7e4
Reviewed-on: https://webrtc-review.googlesource.com/c/123560
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26780}
2019-02-20 16:02:59 +00:00
Alex Loiko
8b3db59b6e Revert "Reland of https://webrtc-review.googlesource.com/c/src/+/114883"
This reverts commit 5341aaccdb.

Reason for revert: Order of initialization of global static strings.

Original change's description:
> Reland of https://webrtc-review.googlesource.com/c/src/+/114883
> 
> The difference to the original is new bitexactness strings AND
> global static file string constants. The reason for reland is breaking
> downstream projects.
> 
> Original CL description:
> 
> Tests for multi-stream Opus.
> 
> This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
> tests are in audio_coding_unittest.cc. Some refactoring of
> AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
> possible. A few checks for "channels \in {1, 2}" are replaced with
> "channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
> other changes are made to be able to write and read multi-channel WAV
> files.
> 
> The SDP changes are NOT included; as of this CL there is no way to set
> up a multi-stream opus en/de-coder from SDP strings.
> 
> Bug: webrtc:8649
> Change-Id: I9fd47c790c241c1876c4a731b0840bec30b4f1b2
> Reviewed-on: https://webrtc-review.googlesource.com/c/123387
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Commit-Queue: Alex Loiko <aleloi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26774}

TBR=aleloi@webrtc.org,ossu@webrtc.org

Change-Id: I88060f2050ccee83d6091b042a10f79b3c4edc47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8649
Reviewed-on: https://webrtc-review.googlesource.com/c/123580
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26777}
2019-02-20 15:17:49 +00:00
Alex Loiko
5341aaccdb Reland of https://webrtc-review.googlesource.com/c/src/+/114883
The difference to the original is new bitexactness strings AND
global static file string constants. The reason for reland is breaking
downstream projects.

Original CL description:

Tests for multi-stream Opus.

This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

Bug: webrtc:8649
Change-Id: I9fd47c790c241c1876c4a731b0840bec30b4f1b2
Reviewed-on: https://webrtc-review.googlesource.com/c/123387
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26774}
2019-02-20 14:57:01 +00:00
Mirko Bonadei
ffd1f93a8d Revert "Tests for multi-stream Opus."
This reverts commit 9c31ac2323.

Reason for revert: Breaks downstream project.

Original change's description:
> Tests for multi-stream Opus.
> 
> This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
> tests are in audio_coding_unittest.cc. Some refactoring of
> AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
> possible. A few checks for "channels \in {1, 2}" are replaced with
> "channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
> other changes are made to be able to write and read multi-channel WAV
> files.
> 
> The SDP changes are NOT included; as of this CL there is no way to set
> up a multi-stream opus en/de-coder from SDP strings.
> 
> Bug: webrtc:8649
> Change-Id: I1d93a9b8eecc3f6e19896ff2e2ce9b63da77a23c
> Reviewed-on: https://webrtc-review.googlesource.com/c/114883
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Commit-Queue: Alex Loiko <aleloi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26742}

TBR=aleloi@webrtc.org,ossu@webrtc.org

Change-Id: I0ac48b7320d31d3e7af33bf8714c3db6c807b82e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8649
Reviewed-on: https://webrtc-review.googlesource.com/c/123385
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26747}
2019-02-18 23:10:05 +00:00
Alex Loiko
9c31ac2323 Tests for multi-stream Opus.
This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

Bug: webrtc:8649
Change-Id: I1d93a9b8eecc3f6e19896ff2e2ce9b63da77a23c
Reviewed-on: https://webrtc-review.googlesource.com/c/114883
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26742}
2019-02-18 17:09:59 +00:00
Mirko Bonadei
e45c688e67 Remove webrtc::ProtoString.
Bug: None
Change-Id: If99a977532eda41eada25f57ff0ff6fe17085986
Reviewed-on: https://webrtc-review.googlesource.com/c/122581
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26726}
2019-02-16 11:11:45 +00:00