Hi all,
To add to the input buffer requirement....
I did some calculation ...
If our Ogg Vorbis codec configuration is,
Bitrate = ABR up to 496 kbps (per channel).
max channels = 2 ch
Max sampling frequency = 48 KHz
Considering the worst case vector, 48 KHz 2 - channel.
Input stram bit rate is 496*2 = 992 kbps (kbits per sec).
992 kbps = 992/8 kBps = 124 kBps (kBytes per sec)
To represent '1 sec' of data (represents 48000 samples in time), it
requires worst case *128 kB*.
If 4096 is the *max* samples / frame / channel as per Vorbis** (Is
*4096* correct???)
Then the input packet size is nearly (124/48000)*4096 ~= 10.581 KB
Is this calculation correct ??? or near to the real world streams ???
On 8/1/05, Sherin S <sherin.s@gmail.com> wrote:> Hi all,
>
> I am in the thinking phase of Vorbis 'file' to 'buffer'
conversion.
> ie, accessing the stream data from the static buffer, rather than
> accessing the file from the decoder( the way it is implemented in the
> vorbis decoder).
>
> I am putting my understanding and the respective query below,
>
> As the general convention , there are two methods by which i can do this.
>
> 1) Assume what ever size input buffer.
> -------------------------------------------------------
> In this case, from every point in the decoder when ever the input
> stream is accessed, it has to check for wheather the end of the buffer
> has reached or not.\
>
> If (end of buffer )
> {
> then request for populating the input buffer;
> }
> else
> {
> continue processing;
> }
>
> 2) Assume a max input buffer size.
> ---------------------------------------------------
> In this case, every time the decoder is invoked we are sure the
> input buffer contains full data required for that audio packet.
> So, there is no need for any complexity inside the decoder like
> checking for end of buffer or so.
>
> But, vorbis specification is not giving any max limit (or minimum
> compression) figure. (In AAC case the standard mention about this
> scenario)
>
> What is the input buffer size which i can assume, which will cover
> real world "OGG VORBIS" stream. ie none of the input granule
won't
> exceed the max limit.
>
> What is the choice of the implementors ??
>
> I found it in one source that,
> they have assumed 8KB input buffer. they are saying they hav't come
> accross any ogg stream which exceed this limit.
>
> How risky is this assumption ?
>
> Can I go ahead with this figure ??
>
> - sher
>