[Speex-dev] rtp payload lenth

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Sep 19 06:10:22 PDT 2007


The way it works is that Speex defines a special mode number 15 (encoded
as 01111) that means "this is the end". Also, it knows that no frame can
be encoded in less than 5 bits (mode 0, encoded as 00000 means
"silence"). That way, the idea is to pad the last byte with a zero,
followed (until the byte is complete) with ones. If there are less than
5 padded bits, Speex knows it can't be a real frame. If there are 5 bits
or more, it ends up reading the terminator code (mode 15) and knows
there's nothing else. That way, you can pack as many frames as you like
in one packet and Speex will always be able to tell how many there are.

	Jean-Marc

Pawel Cyrta wrote:
> 
> I have another question:)
> 
> What is decoder doing when he will receive the padding bits?
> e.g.:
> 39 is the size in bytes of one payload given to decoder  in mode 5 (37,5
> bytes + padding)
> 
> Does he recognise the padding bits (by this magic 0 bit and all 1's
> afterwards)?
> Or
> Does decoder produce output with all the bits
> 
> Pawel
> 
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev


More information about the Speex-dev mailing list