[vorbis-dev] mdct.c

Pattara Kiatisevi pkiatisevi at student.ei.uni-stuttgart.de
Wed Mar 20 14:03:35 PST 2002



On Wed, 20 Mar 2002, Dave Hooper wrote:

> I'm no authority but I'll hazard a few answers...
>
> > Hmm, I have some quite stupid questions. The data in Ogg/Vorbis file -->
> > each sample = int 16-bit word? And output pcm data also = int 16-bit word?
>
> That can't be correct.  If the data in an Ogg/Vorbis file was such that each
> sample was a 16-bit int then it would hardly be a compression system.
> The Ogg/Vorbis file format encapsulates a bit stream - there is not a direct
> n-bits-per-sample correspondence (unlike certain other compression formats
> e.g. ATRAC1)

Hmm, you are right... But is the smallest element of data read from this
stream a kind of integer in a fixed-length amount (let's say 8 or 16
bits)? Or it is not at byte boundary at all...

>
> > If yes then..
> > -why is the conversion to float back and forth needed? Is there any
> > particular benefit as the reason to choose floating point at the time you
> > implemented the MDCT code?
>
> I'm under the impression that, in general, on modern computer hardware, the
> kind of arithmetic you need in an MDCT is quicker with floats than with
> ints.  This is especially true with multiplication and (often even more so)
> with division.  Whether or not this was the original reason behind a
> floating-point MDCT I couldn't say.

Then it is probably faster to run the decoder with floating point and FPU
than the integer version without FPU given that both circuits work at the
same frequency?

<p>>
> > -is there any limit (or reasonable limit) of this floating point input &
> > output data value for MDCT? From my observation I see that the range is
> > between -1 to 1.
>
> I don't see any reason why the input limits must be +- 1.  Consider the
> spectrogram of a peak-to-peak square wave.  I seem to remember that the
> output range is indeed +-1 however I can't recall if it is clamped at this
> or if it will stray outside given the right kind of input data.

What I did was to insert a code to check maximum and minimum value of
input and output vector in mdct_backward() and observe it :).

It would be great to know the limit of both input and output (and both
floating- and fixed- points.

BTW, I look in the code, if INTEGERIZED_MDCT is defined. The floating
point value in the input vector will be converted to int with this macro:

#define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5))

But I can't see the conversion back to float, not sure the output vector
will have the data in float?

Thank you very much and sorry if too stupid questions, they will be
improved gradually :)

Pattara

<p><p><p><p>>
> Dave
>
>
> --- >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.
>
>

<p><p><p><p><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 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