[opus] libopus API question - 120ms encoding

Jean-Marc Valin jmvalin at jmvalin.ca
Thu Oct 24 18:49:10 PDT 2013


The general ideao of opus_encode() is indeed to encode a single frame.
However, there is an exception for 40 and 60 ms because only one mode
(SILK-only) has this frame size. The original code would automatically
force SILK-only mode on 40 and 60 ms, but that was suboptimal for mode
switching. This why opus_encode() can now generate packets that
concatenate 2-3 CELT-only or 2-3 hybrid frames when called for 40 or 60
ms. This is the only exception. It will *not* encode 120 ms, nor 30 ms
frames from concatenating 3 10-ms frames. For anything else, you need
the repacketizer.

Cheers,

	Jean-Marc

On 10/24/2013 01:45 PM, O'Connor, Kevin wrote:
> The libopus encoder’s opus_encode() method is documented as “Encodes an
> Opus frame”. Does that  mean that it always produces a single Opus frame
> (i.e. the number of frames in the TOC byte will always be 0)? It’s not
> clear from the documentation, but the fact that it cannot produce a
> 120ms Opus packet makes me wonder if that was the intention and any
> multi-frame Opus packets must formed outside the libopus encoder (e.g.
> the Repacketizer).
> 
>  
> 
> If that’s not the case and opus_encode() can produce multi-frame Opus
> packets, why is it limited to 60ms Opus packets?
> 
>  
> 
> Kevin O’Connor
> 
> Interacive Intelligence, Inc.
> 
>  
> 
> 
> 
> _______________________________________________
> opus mailing list
> opus at xiph.org
> http://lists.xiph.org/mailman/listinfo/opus
> 



More information about the opus mailing list