[Ffmpeg-devel] ac3enc.c modifications
Justin Ruggles
jruggle
Tue May 17 16:05:55 CEST 2005
Hello,
I've been looking over your changes, and I like a lot of what you've
done. Before I go into my comments on specific sections, I have a
couple more general questions.
Simone Karin Lehmann wrote:
> /* use double prec */
> #define AC3ENC_DOUBLE
>
> #ifdef AC3ENC_DOUBLE
> typedef double sample_t;
> #else
> typedef int16_t sample_t;
> #endif
Is the use of sample_t meant to allow different data types? When I take
out the "#define AC3ENC_DOUBLE", I get silent output. So is the intent
to always use double and just call it sample_t or to use sample_t as a
way to allow either integer or floating-point processing?
Secondly, I don't see where there's much, if any, benefit to using
double precision. The ac3 format doesn't encode the data nearly that
precisely. Right now, your code converts the doubles to int32s before
encoding both the exponents and mantissas, so the precision is lost
anyway. Using 32-bit integers seems plenty accurate to me. An idea I
saw that you used in the MDCT might be able to be used more generally.
If the 16-bit input data is converted to 24-bit data wrapped in an int32
from the beginning, then it would increase the accuracy without
unnecessary floating-point arithmetic.
Briefly, some of the things I like.
-adjusting the bandwidth to the bitrate (much needed!)
-zeroing out the data above used bandwidth
-the 8kHz filter for the transient detect
-dialog normalization
:)
-Justin
More information about the ffmpeg-devel
mailing list