[Ffmpeg-devel] [PATCH] ac3enc mdct data type

Michael Niedermayer michaelni
Tue Apr 11 13:59:47 CEST 2006


On Mon, Apr 10, 2006 at 11:59:09PM -0400, Justin Ruggles wrote:
> Michael Niedermayer wrote:
> > Hi
> > 
> > On Mon, Apr 10, 2006 at 09:13:09PM -0400, Justin Ruggles wrote:
> > 
> >>Hello,
> >>
> >>This probably should have gone along with the last patch I submitted.
> >>Now we've determined the range of the MDCT coefficients, they don't need
> >>to be int32_t.  This patch changes them to int16_t to save a little memory.
> > 
> > 
> > int16_t is not optimal, use int or int_fast16_t IMHO
> I'm not too familiar with int_fastXX_t types.  Does this just choose the
> fastest int type depending the platform?  

intXX_t forces twos complement XX bits no matter how slow
int_fastXX_t is the "fastest" type with at least XX bits
so IMHO we either shoud use (short/int/long or int_fastXX_t) where speed

> And if so, why is it not used
> more often?
> > btw, maybe you want to write an optional floating point based MDCT?
> > it would be faster and more accurate on modern cpus ...
> > 
> > [...]
> > 
> I already have...well, sort of :)  I'm actually writing a floating-point
> based stand-alone AC-3 encoder, derived mostly from FFmpeg, but with a
> lot of the code structure re-written.  My main motivation is to add more
> complex functionality such as that in LAME or FAAC.  Right now it's not
> even close to release-ready though.  I will eventually release it under
> LGPL in case there is ever anything useful that might be okay to go back
> into FFmpeg.
> Anyway...I've never tried to do selectable floating-point/fixed-point
> before.  From what I gather, I could keep most of the code as-is and
> just use #ifdef's and typedef's.  Are there any other codecs in FFmpeg
> that do this that I could use as a model?  FFmpeg already has

yes, compute_antialias* in mpegaudiodec.c or the various dcts we use
for the mpeg like codecs

a more complete float/int split in a codec would be possible too of


In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list