[Ffmpeg-devel] ac3enc.c modifications
Justin Ruggles
jruggle
Thu May 19 18:30:32 CEST 2005
Simone Karin Lehmann wrote:
> sample_t was intended to switch between doubles and integers at compile time,
> but I didn't finish to fully implement the integer code. This is why you get
> silence.
Oh, ok. Now it makes sense.
> ... but the calculations to get these values will be more accurate if you use
> doubles. In mdct() there are plenty of multiplications using sin and cos
> factors. Only using integers will give some really great rounding errors.
> I've done a lot of testing to this. First I encoded a wav file only using
> integers, decoded it back to wav, took audicity to give me spectrum analysis.
> Second I did the same procedure with doubles.
> The spectrum resulting out of the doubles encoding was more closely to
> original than only encoding in integer arithmetics.
I can see where that would work. Since it uses summations, the rounding
errors would just keep adding up. And if you're going for accuracy over
speed, using floating-point would help. How does the spectrum vary
between using floats vs. doubles?
I was going to suggest keeping mdct_coefs as int32 and just using
doubles internally in the mdct, but the rematrixing would get a very
slight accuracy gain with floating point as well.
-Justin
More information about the ffmpeg-devel
mailing list