Mukund Raman
2015-Apr-02 01:14 UTC
[opus] Opus multi-stream/surround: Audio corruption on decoded content
For some reason the attachment did not go through. Re-attaching. From: Mukund Raman Sent: Wednesday, April 01, 2015 6:12 PM To: 'opus at xiph.org' Subject: Opus multi-stream/surround: Audio corruption on decoded content Hello Everyone, I am using the opus 1.1 multistream APIs to encode a 5.1 surround stream on the server, stream it to client, decode it and capture the pcm data. I noticed that there was severe corruption/attenuation on one of the channels(specifically Back/Rear Right). This would appear to be the last channel in the stream. I am attaching an image of the PCM dumps from the original and the one decoded on the client which shows the channel corruption. If required I can also provide the source and destination wav files. The track I am trying to play is purely speech data, however, it has been formatted as Hi-Definition content (16 bit LPCM, 48 KHz). I'd like to add that I have also tried a simple loopback test; where I read from 'the' source file encode it, immediately decode the encoded buffer and write to a output file and I am seeing the same kind of corruption. Since my actual use-case will involve mixed media content, i.e. typically voice and music, I was a bit concerned about this. If the file purely has music(and no speech), I do notice some attenuation, however, it does not suffer from any distortions. Following is the code I am using for initializing the opus multi-stream encoder: - <code> <defines and vars> #define CHANNELS 6 #define OPUS_SURROUND_MAPPING_FAMILY 1 #define SAMPLE_RATE 48000 typedef union t_SurroundInfo { unsigned char surroundInfo[1]; struct { unsigned char channels; unsigned char streams; unsigned char coupled_streams; unsigned char channel_mapping[MAX_SURROUND_CHANNELS]; }s; }SurroundInfo; </defines and vars> <encoder> int streams = 0; int coupled_streams = 0; m_SurroundInfo.s.channels = CHANNELS; // set to 6 m_MSEnc = opus_multistream_surround_encoder_create(SAMPLE_RATE, // SAMPLE_RATE = 48000 m_SurroundInfo.s.channels, OPUS_SURROUND_MAPPING_FAMILY, &streams, &coupled_streams, m_SurroundInfo.s.channel_mapping, OPUS_APPLICATION_RESTRICTED_LOWDELAY, &err ); if (err != OPUS_OK) return; m_SurroundInfo.s.streams = (unsigned char)streams; m_SurroundInfo.s.coupled_streams = (unsigned char)coupled_streams; opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_BITRATE(bitRate)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_BANDWIDTH(OPUS_AUTO)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_VBR(0)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_VBR_CONSTRAINT(0)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_COMPLEXITY(10)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_INBAND_FEC(0)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_FORCE_CHANNELS(OPUS_AUTO)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_DTX(0)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_PACKET_LOSS_PERC(0)); opus_multistream_encoder_ctl(m_MSEnc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY)); </encoder> <decoder> int streams = (int)m_SurroundInfo.s.streams; int coupled_streams = (int)m_SurroundInfo.s.coupled_streams; m_MSDec = opus_multistream_decoder_create(SAMPLE_RATE, m_SurroundInfo.s.channels, streams, coupled_streams, m_SurroundInfo.s.channel_mapping, &err ); </decoder> </code> I'd appreciate it, if someone can shed some light on why the observed phenomenon is occurring. Could it just be that, I am playing a content that only has speech and actually forcing opus mode to CELT? Thanks in advance. Warm regards, Mukund. ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20150402/284df0de/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: opus_multistream_corruption.jpg Type: image/jpeg Size: 25847 bytes Desc: opus_multistream_corruption.jpg Url : http://lists.xiph.org/pipermail/opus/attachments/20150402/284df0de/attachment-0001.jpg