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}
This commit is contained in:
Alex Loiko
2019-04-08 17:19:41 +02:00
committed by Commit Bot
parent e9d2b4efdd
commit e5b94160b5
20 changed files with 918 additions and 96 deletions

View File

@ -79,6 +79,7 @@ int16_t WebRtcOpus_MultistreamEncoderCreate(
OpusEncInst** inst,
size_t channels,
int32_t application,
size_t streams,
size_t coupled_streams,
const unsigned char *channel_mapping) {
int opus_app;
@ -99,7 +100,6 @@ int16_t WebRtcOpus_MultistreamEncoderCreate(
OpusEncInst* state = (OpusEncInst*)calloc(1, sizeof(OpusEncInst));
RTC_DCHECK(state);
int streams = channels - coupled_streams;
int error;
state->multistream_encoder =
opus_multistream_encoder_create(
@ -407,6 +407,7 @@ int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, size_t channels) {
int16_t WebRtcOpus_MultistreamDecoderCreate(
OpusDecInst** inst, size_t channels,
size_t streams,
size_t coupled_streams,
const unsigned char* channel_mapping) {
int error;
@ -419,11 +420,9 @@ int16_t WebRtcOpus_MultistreamDecoderCreate(
return -1;
}
int streams = channels - coupled_streams;
// Create new memory, always at 48000 Hz.
state->multistream_decoder = opus_multistream_decoder_create(
48000, (int)channels,
48000, channels,
streams,
coupled_streams,
channel_mapping,