[opus] OPUS_SET_MAX_BANDWIDTH does not have expected results

Philip Gruebele pgruebele at cox.net
Wed Feb 26 21:03:52 PST 2014

Hi All.

I am seeing the following unexpected behavior with 
OPUS_SET_MAX_BANDWIDTH.  I expect that setting this to 
OPUS_BANDWIDTH_NARROWBAND would give similar results to passing an 8Khz 
sample rate stream, but OPUS_SET_MAX_BANDWIDTH has almost no effect with 
any settings.

My test data has 4Khz bandwidth.  I am testing the opus encoder (latest 
versions) with the following opus_encoder_ctl options: OPUS_SET_VBR=1, 

I compress 2 separate audio streams which only differ in the sample 
rate.   One is 8Khz and the other is 16Khz.  Both contain identical 4Khz 
bandwidth audio (the 16Khz file is a properly up-sampled copy of the 
8Khz file).  When compressing these, the 16Khz input generates about 
double the opus file size even though the audio content is identical.  I 
found this to be unexpected since I expected VBR mode to care only about 
the incoming audio bandwidth and not the incoming sample rate.

order to explicitly tell opus that even though the stream is 16Khz, the 
stream bandwidth is only 4Khz.  However, this does not change the opus 
file size for the 16Khz stream.  In fact, the OPUS_SET_MAX_BANDWIDTH 
setting really has little effect regardless of which bandwidth I select 
with it.  Is this a bug?  Am I misunderstanding something here?

Basically I will have a 16Khz stream in which the bandwidth will toggle 
between 4 and 8 Khz.  I would like opus to optimally compress this, but 
based on these tests it appears that the vbr compression rate is 
linearly related to the input sample rate even though I expected it to 
be a function of the actual input audio bandwidth. Because of this 
shortcoming I am considering using ogg with opus links, and creating a 
new link every time the bandwidth changes and setting the sample rate to 
be 2x the bandwidth.  This would generate better compressed output but 
is a much more complex solution so any advice would be greatly appreciated.


More information about the opus mailing list