[FFmpeg-devel] [PATCH] ac3enc: Change EXP_DIFF_THRESHOLD to 500.

Måns Rullgård mans
Wed Feb 2 21:07:04 CET 2011

Justin Ruggles <justin.ruggles at gmail.com> writes:

> Hi,
> This patch changes the exponent difference threshold in the exponent
> strategy decision function of the AC-3 encoder.
> I did try porting the exponent strategy algorithm from Aften, but
> unfortunately did not get good results.  I did some tests when
> adding that to Aften, but I guess they were not very thorough.
> This time I did a lot of testing of different material and of
> altering the algorithms in various ways.
> One thing that I did gain from the testing was that the FFmpeg
> algorithm (which is recommended by the spec as a "simple algorithm"
> for a "basic encoder") uses too many bits for exponents at
> low bitrates.  But the encoder doesn't do well at low bitrates
> for other reasons too, so I think any special-case handling of
> exponent strategy in low bitrate situations should be done at
> a later time.
> What did improve quality across bitrates for all samples was
> lowering EXP_DIFF_THRESHOLD.  I tested lowering in increments of 100
> From 1000 down to 500 generally increased in quality with each step,
> but 400 was generally much worse.  The full graphs are very
> cluttered and hard to read without zooming, so here are some graphs
> showing only 1000 and 500 with the bit rate range of 96 to 256 kbps.
> All tests use stereo 16-bit 48kHz.
>  0.0 = Imperceptible
> -1.0 = Perceptible, but not annoying
> -2.0 = Slightly annoying
> -3.0 = Annoying
> -4.0 = Very annoying
> allsamples: 8m0s, 16 30-sec music clips of various styles
> http://www.flickr.com/photos/justinruggles/5411063230/sizes/l/in/photostream/
> comp: 1m30s, 6 music clips, sound like difficult samples
> http://www.flickr.com/photos/justinruggles/5410452353/sizes/l/in/photostream/
> divertimenti: 3m1s, classical music, resampled from 24/192
> http://www.flickr.com/photos/justinruggles/5411063192/sizes/l/in/photostream/
> elephant: 10m58s, Elephant's Dream movie soundtrack
> http://www.flickr.com/photos/justinruggles/5411063276/sizes/l/in/photostream/
> warfilm: 2m32s, movie clip with action sequences
> http://www.flickr.com/photos/justinruggles/5411063362/sizes/l/in/photostream/
> Justin Ruggles (1):
>   ac3enc: Change EXP_DIFF_THRESHOLD to 500.

It's mostly better and never worse, so I see no reason not to make
this change.  Pushing.

BTW, that line has been unchanged since very first revision.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list