[Ffmpeg-devel] [PATCH] Vorbis decoder

Alexander Strasser eclipse7
Fri May 13 20:01:29 CEST 2005


Rich Felker wrote:
> On Fri, May 13, 2005 at 05:28:10PM +0200, Balatoni Denes wrote:
> > > > +    uint32_t ret=0;
> > >
> > > exact width types should only be used when an exact width is needed (not
> > > for local variables like ret,i, ...)
> > I tried to use the possible minimal size for each variable. So if for example 
> > somebody wants to port this decoder to C64 or ZX Spectrum, he will know where 
> > he can use native 8 bit types, or needs 16 bits, or must use more than 16 
> > bits (in those cases 32 bits are usually not needed though).
> 
> This is the exact same design mistake as in FAAD. It makes code slow
> and difficult to read. Always use int unless you need a particular
> size; specifically-sized types are only for use in addressing sample
> buffers and similar data.

  Yeah, this is what i thought too. But as it seems it is not perfect :(
AFAICT it doesn't work out that good on new 64 bit architectures where
it is decided for some compilers that int still stays 32 bit. Though i
wonder why? The 32 bit or 16 bit types could be still made accessible
through (u)int(X)X types or not?
  So nowadays maybe it is really best to use the `fast' types Micheal
mentioned, though it doesn't read that nice...

  Alex (beastd)





More information about the ffmpeg-devel mailing list