summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-04-20 13:27:06 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-06-30 15:17:40 -0400
commita9aa58247a81c603b415149cfd05c90ecdd0b09d (patch)
tree79a3b283ec33d5cb3b0d7b69a6d0bc66e892c07b /src
parent0ac49443b6d8ab148f7f603e79263af647bdfb47 (diff)
downloadopus-exp_bitstream.tar.gz
Make it possible to ignore inverted phase stereo for downmix purposesexp_bitstream
Diffstat (limited to 'src')
-rw-r--r--src/opus_decoder.c20
-rw-r--r--src/opus_encoder.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 080bec50..af46d82f 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -899,6 +899,26 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...)
*value = st->last_packet_duration;
}
break;
+ case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST:
+ {
+ opus_int32 value = va_arg(ap, opus_int32);
+ if(value<0 || value>1)
+ {
+ goto bad_arg;
+ }
+ celt_decoder_ctl(celt_dec, OPUS_SET_PHASE_INVERSION_DISABLED(value));
+ }
+ break;
+ case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST:
+ {
+ opus_int32 *value = va_arg(ap, opus_int32*);
+ if (!value)
+ {
+ goto bad_arg;
+ }
+ celt_decoder_ctl(celt_dec, OPUS_GET_PHASE_INVERSION_DISABLED(value));
+ }
+ break;
default:
/*fprintf(stderr, "unknown opus_decoder_ctl() request: %d", request);*/
ret = OPUS_UNIMPLEMENTED;
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 227c7154..6509c917 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -2728,6 +2728,26 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...)
*value = st->silk_mode.reducedDependency;
}
break;
+ case OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST:
+ {
+ opus_int32 value = va_arg(ap, opus_int32);
+ if(value<0 || value>1)
+ {
+ goto bad_arg;
+ }
+ celt_encoder_ctl(celt_enc, OPUS_SET_PHASE_INVERSION_DISABLED(value));
+ }
+ break;
+ case OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST:
+ {
+ opus_int32 *value = va_arg(ap, opus_int32*);
+ if (!value)
+ {
+ goto bad_arg;
+ }
+ celt_encoder_ctl(celt_enc, OPUS_GET_PHASE_INVERSION_DISABLED(value));
+ }
+ break;
case OPUS_RESET_STATE:
{
void *silk_enc;