[opus] Regarding encoded data

u ugurbd at gmail.com
Sat Jul 25 15:48:53 UTC 2020


Hello,

I've been trying to understand how to use opus codec for quite some time.
There is a thing that doesn't make sense to me. I will try to explain what
it is below,

In *opus_encode() *function, *opus_int16 pcm* is said to have a size
of *frame_size
* channels*, where *frame_size* is said to be one of* 20, 240, 480, 960,
1920, and 2880.*
Let's say, frame_size is 960, then opus_int16 pcm's size in bytes would be
*3840*. Documentation page says the recommended size for *output
payload *should
be around
*4000.*
I check the return values returned by *opus_encode(), *and they are between
250 and 300, which is the length of the encoded packet.

Now, we are supposed to send *ouput_payload* - which is 4000 bytes long -
over the network. That means sending more bytes than sending opus_int16
pcm, which is length of *3840 *in bytes*.*
So what is the advantage of encoding the data if we are to send more bytes
than initially held?

I also tried setting *output payload's *size to be one of *512, 256, 128 *
bytes and all seemed to work fine. I understand when *output payload* is
shorter than *opus_int16 pcm* in size but don't understand when it is
bigger.

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20200725/19b48155/attachment.html>


More information about the opus mailing list