[vorbis-dev] Vorbis bitstream specification...
Segher Boessenkool
segher at chello.nl
Mon Feb 11 11:35:13 PST 2002
> Codebooks are general and may need to be anywhere from 1.31 to 24.8.
Don't forget about -100.132 and things like that.
> 3) the MDCT on mainline has a stable dynamic range and is easy to
> integerize. The mainline integer version assumes a 14 bit fraction on
> the trig lookups, which frankly is far too little. This is done only
> because C doesn't have a 32x32->64 bit two result register multiply.
#ifndef BIGENDIAN
union magic {
struct {
int32 lo;
int32 hi;
} halves;
int64 whole;
};
#else
...
#endif
tatic inline int32 himul(int32 x, int32 y) {
union magic magic;
magic.whole = (int64)x * y;
return magic.halves.hi;
}
and with optimization turned on, everything will work Just Fine(tm).
Also, signed a.b * signed c.d ==> signed (a+c-1).(b+d) (effective range).
You can do tricks with unsigned muls to prevent that -1.
> If you're on ARM (for example) and have SMULL, use 2.30 for the
> lookups, only save the RdHi register and you'll have very good S/N.
Roundoff errors? You can do it like this, but be careful about signs.
(Truncating in two's complement always rounds towards -inf; make sure
these errors don't accumulate).
> There's nothing tricky in an integerization;
...but there are a lot of tricks in integerization :)
<p>Segher
<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