[opus] OPUS encoded data size and bandwidth of encoder

Abdullah Sajjad binn.sajjad at gmail.com
Thu Jun 11 13:58:31 UTC 2020


Hey, I am having trouble with the size of the encoded bytes by Opus. I am
also having issue with the Bandwidth ctl.
Here is the scenario.
If I encode 16khz sampled audio:
opus_encoder_ctl(enc,OPUS_SET_MAX_BANDWIDTH(OPUS_BANDWIDTH_WIDEBAND))

opus_encoder_ctl(enc, OPUS_GET_BANDWIDTH(&x)) = 1102
opus_encoder_ctl(enc, OPUS_GET_MAX_BANDWIDTH(&x)) = 1103
average encoded size = 120 bytes


if I encode 48khz sampled audio:
  opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_WIDEBAND))

opus_encoder_ctl(enc, OPUS_GET_BANDWIDTH(&x)) = 1103
opus_encoder_ctl(enc, OPUS_GET_MAX_BANDWIDTH(&x)) = 1103
average encoded size = 280 bytes

I do not understand why 48khz encoded data has more bytes even when I am
asking it to encode to a smaller frequency range. And why is the bandwidth set
to medium band for 16khz sampled input? Shouldn't it be wideband?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20200611/f598938d/attachment.html>


More information about the opus mailing list