ly or Hybrid frames for 40 or 60ms packet, respectively. That is based on
concatenating 20ms frames, right?
Is 60ms the largest packet opus_encode() can generate? In order to get packets
of up to 120 ms by combining multiple frames as described in RFC6716 clause
2.1.4 one would need to use the "repacketizer". That is if I want to
have a 120 ms packet, I would need to take two 60 ms packets generated by
opus_encode(), extract out the compressed frames from each packet, concatenate
them and put on a new TOC with frame count code "c" set to 1.
Regards,
Chris
-----Original Message-----
From: opus-bounces at xiph.org [mailto:opus-bounces at xiph.org] On Behalf Of
Jean-Marc Valin
Sent: Friday, October 25, 2013 7:19 AM
To: O'Connor, Kevin; opus at xiph.org
Subject: Re: [opus] libopus API question - 120ms encoding
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=20
> an Opus frame". Does that mean that it always produces a single
Opus=20
> 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=20
> produce a 120ms Opus packet makes me wonder if that was the intention=20
> and any multi-frame Opus packets must formed outside the libopus encoder
(e.g.
> the Repacketizer).
>=20
> =20
>=20
> If that's not the case and opus_encode() can produce multi-frame
Opus=20
> packets, why is it limited to 60ms Opus packets?
>=20
> =20
>=20
> Kevin O'Connor
>=20
> Interacive Intelligence, Inc.
>=20
> =20
>=20
>=20
>=20
> _______________________________________________
> opus mailing list
> opus at xiph.org
> http://lists.xiph.org/mailman/listinfo/opus
>=20
_______________________________________________
opus mailing list
opus at xiph.org
http://lists.xiph.org/mailman/listinfo/opus