[Ffmpeg-devel] ac3enc.c modifications

Justin Ruggles jruggle
Sun May 15 03:10:56 CEST 2005

Simone Karin Lehmann wrote:
> Back again to the scaling... I still think, that just dropping the bitshift 
> right is the best way to solve this problem.

Hmm.  Now I think I'm going to look into this again.  You bring up some
good points.

> BTW, I'm working one the same features as you do, and have succesfully 
> implemented rematrixing, DC filtering the input, transient detection, and to 
> same degree, block switching to a 256 mdct (but this still gives some high 
> frequency artefacts....hmm, why?), dialog normalisation (I've just patched 
> liba52 to use the dialog normalisation), using doubles.
> In the next few days I'll post my version of ac3enc.c to the ML, so that we 
> can take a look at each others code.

Sweet!  I can't wait to compare.  My version kinda veered away from just
being a patch since there are so many changes.  I also started playing
with VBR, which is supported by liba52, but I'm not sure about DVD
player compatibility...  I'll try to merge some of my changes back in
with ffmpeg in the next couple days so we can do some comparisons.

Some comments while I'm all psyched:

DC filtering:  I agree with Michael that filtering should be left out.
libavcodec is a library, not an application, so filtering the input
would be presumptuous.  FFmpeg, however, is an application, but audio
filtering might just be overkill...i dunno...

block switching/transient detection:  I'm not getting any artifacts that
I can hear, but maybe I'm not using good sample files or listening for
the right thing.

channel coupling:  I attempted it...and gave up...it's so embedded in
every part of the specification.  After changing a million things, I
could never get the output to play clearly.

vbr:  Fun to tinker around with!  but again, not sure how DVD players
will react.  and ffmpeg doesn't support creating vbr audio, so I used a
makeshift frontend to do the testing.  Mostly, I've been setting a
constant csnroffst and adjusting the bitrate and fsnroffst to fit.  I
also used adjustment of the bandwidth code to lower the bitrate for
lower quality settings.

dialog normalization:  I haven't looked into that yet.  It's one of
AC3's strong features though, so I can't wait to hear it in action.

I've been thinking of some good ways to implement fractional frame sizes
for 44100kHz.  I haven't got all the details worked through yet though.
 The most promising idea I have is a table with the numerator &
denominator and keeping a frame count for each of the 2 sizes.  Floating
point might work too though...keeping a running ratio and adjusting

Anyway, enough babbling until there is some code to compare.

More information about the ffmpeg-devel mailing list