[opus] Force Opus/CELT to encode 2 mono instead of 1 stereo

Ralph Giles giles at thaumas.net
Mon Sep 25 17:43:51 UTC 2017


On 2017-09-25 10:24 AM, Andrew P. Lentvorski wrote:

> The old CELT thing treated the L and R channels as independent mono
> streams, encoded them somehow with CELT to form one bitstream, sent one
> bitstream across, and then unpacked it manually after the decoder.

You can try calling `opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(2))` 
on the encoder context. That will prevent the encoder from producing 
mono packets when it thinks that's a more efficient representation of 
the signal.

Does upping the bitrate help?

In general, I suspect the answer is no. The opus encoder expects to 
exploit correllations between the two channels when given them, so it's 
not too surprising there's bleed-through at low bitrates. The general 
expectation is that applications will use distinct codec contexts for 
uncoupled streams, or for coupled streams with more that two channels.

  -r


More information about the opus mailing list