[vorbis-dev] Samples inside a packet

Monty xiphmont at xiph.org
Fri May 7 15:41:29 PDT 2004



> One possible and easy solution would be to return blocksize/4
> samples from the previous block and blocksize/4 from the current
> block. I'm not sure if libVorbis does it this way. (If it is,
> your values are correct.)

It does.

> But this can be improved. For example: If the last and the current
> blocks are long blocks and is followd by a short block, the
> decoder could return 1472 samples because the next packet (due to
> its short window) does not effect that many samples.
> 
> My experimental Java decoder for example tries to minimize the
> delay as much as possible. It works like this:
> 
> prev	curr	next	smpls you get
> 1	1	0	1472
> 1	1	1	1024
> 0	1	0	1024
> 0	1	1	576
> 1	0	0	128
> 1	0	1	128
> 0	0	0	128
> 0	0	1	128
> 
> Unfortunalety it has not been specified how one should do this
> and what the granule pos actually means in detail. :-(

The timing is not actually handled this way, and you should follow
1/4+1/4, else PCM positioning will be incorrect and disagree with
granpos.

And yes... the docs are not clear on the point.  That should/must/will
be addressed.

The 'next widow' flag was added to the spec to allow some additional
parallelization/pipelining of decoding should someone decide to
implement an encoder that aggressive.  There was a time I planned to
do that in the ref decoder, but when the time came it started to look
like a pretty useless optimization to waste time on :-)

Monty
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list