Hi, Just to confirm: for blockSizes of 256 and 2048 (0 and 1 respectively) the number of sample inside this audio packet will be acording to table below: LastWind ThisWin Samples 0 0 128 0 1 576 1 0 576 1 1 1024 Correct?? thanks a lot. --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Adriano Almeida wrote:> Hi, > > Just to confirm: > for blockSizes of 256 and 2048 (0 and 1 respectively) the number of > sample inside this audio packet will be acording to table below: > > LastWind ThisWin Samples > 0 0 128 > 0 1 576 > 1 0 576 > 1 1 1024 > > Correct??There're (usually) 128 MDCT coeffs/ch in a "0"-packet and 1024 samples in a "1"-packet. (The blocksize field in the packet header refers to the nominal window sizes which are 2*samples/packet). Due to this overlap add synthesis of the MDCT you have to buffer some samples for the next packet in order to return the correct values. 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.) 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. :-( <p>bye, Sebastian <p>--- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Fri, May 07, 2004 at 04:54:23PM -0300, Adriano Almeida wrote:> Hi, > > Just to confirm: > for blockSizes of 256 and 2048 (0 and 1 respectively) the number of sample inside this audio packet will be acording to table below: > > LastWind ThisWin Samples > 0 0 128 > 0 1 576 > 1 0 576 > 1 1 1024 > > Correct??Short answer is yes; to be painfully picky (it can matter in some cases) what it really means is "this is how many finished samples result from overlap/add of these two packets". But your math is correct. 1/4 of packet A + 1/4 of packet B. Cheers, 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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.