diff options
author | Andrew Allen <bitllama@google.com> | 2017-11-07 13:26:23 -0800 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2017-11-07 17:44:36 -0500 |
commit | f643c03fba45ad3547b0e54cc6c0f570361002bf (patch) | |
tree | 38e6605bf9b39151299c364731ec7dde3c92aefc /src/opus_multistream_encoder.c | |
parent | e12df85a62598c7acbee84f13602f82eb6d39734 (diff) | |
download | opus-f643c03fba45ad3547b0e54cc6c0f570361002bf.tar.gz |
Support for Channel Mapping 253
OpusProjection* classes
MixingMatrix class
Projection tests
Change-Id: I98644466abf4ffd36e48bdecad1204d69e1539b9
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'src/opus_multistream_encoder.c')
-rw-r--r-- | src/opus_multistream_encoder.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c index 032fc003..07de6cce 100644 --- a/src/opus_multistream_encoder.c +++ b/src/opus_multistream_encoder.c @@ -70,28 +70,6 @@ typedef void (*opus_copy_channel_in_func)( int frame_size ); -typedef enum { - MAPPING_TYPE_NONE, - MAPPING_TYPE_SURROUND -#ifdef ENABLE_EXPERIMENTAL_AMBISONICS - , /* Do not include comma at end of enumerator list */ - MAPPING_TYPE_AMBISONICS -#endif -} MappingType; - -struct OpusMSEncoder { - ChannelLayout layout; - int arch; - int lfe_stream; - int application; - int variable_duration; - MappingType mapping_type; - opus_int32 bitrate_bps; - /* Encoder states go here */ - /* then opus_val32 window_mem[channels*120]; */ - /* then opus_val32 preemph_mem[channels]; */ -}; - static opus_val32 *ms_get_preemph_mem(OpusMSEncoder *st) { int s; @@ -1196,15 +1174,13 @@ int opus_multistream_encode( } #endif -int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) +int opus_multistream_encoder_ctl_va_list(OpusMSEncoder *st, int request, + va_list ap) { - va_list ap; int coupled_size, mono_size; char *ptr; int ret = OPUS_OK; - va_start(ap, request); - coupled_size = opus_encoder_get_size(2); mono_size = opus_encoder_get_size(1); ptr = (char*)st + align(sizeof(OpusMSEncoder)); @@ -1392,14 +1368,21 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) ret = OPUS_UNIMPLEMENTED; break; } - - va_end(ap); return ret; bad_arg: - va_end(ap); return OPUS_BAD_ARG; } +int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) +{ + int ret; + va_list ap; + va_start(ap, request); + ret = opus_multistream_encoder_ctl_va_list(st, request, ap); + va_end(ap); + return ret; +} + void opus_multistream_encoder_destroy(OpusMSEncoder *st) { opus_free(st); |