[FFmpeg-devel] [Patch] AAC encoder improvements

Claudio Freire klaussfreire at gmail.com
Sat May 4 21:14:45 CEST 2013


Attached is a patch with some improvements to the AAC encoder. The patch
has my default username wrong, feel free to replace it with Claudio Freire <
klaussfreire at gmail.com>

Those are rather simple low-hanging-fruit improvements that have the most
impact on encoding quality, especially multichannel audio. In the case of
multichannel audio, the biggest offending bug was that psy was applied
independently to each channel group with bitrate/nchannels per-channel
bitrate. Since stereo has only one channel group, it worked fine, but for
multichannel, this means lots of bits reserved to little-used surround
channels, and thus really poor performance on front channels.

With that fixed, plust a little rounding bug, I tried to make the "fast"
encoder a bit more decent. I think I did accomplish some decency without
much of a performance impact. I'll probably keep working on that one, since
it's cool having a decent fast encoder (think realtime on embedded devices
for instance).

Also, twoloop had a rather peculiar... bug shall I say... where the scalers
selected were all flat, and had little correlation with the masking
thresholds. I believe this was indeed a bug caused by naive clamping of the
scalers' range, something that I addressed by "normalizing" them. Indeed
the result sounds much more natural, especially on low bit rates. I have
only my own listening sessions to prove that, although I myself am pretty
convinced it's an improvement. But I'm open to suggestions on how to test
this.

Finally, I fixed joint stereo. It had one bug, namely, that it did not
recompute psy masking and quantizer scaling after doing the mid-side
transformation, resulting in artifacts everywhere and generally poor
quality. It was also a bit eager to apply the transformation when it wasn't
really beneficial, so I patched cost estimation with an IMVHO better
option: average thresholds for mid (I think this is numerically accurate),
and minimum thresholds for side (this I've pulled out of a magic hat -
heuristic, to punish side energy, seems to work). Indeed now auto joint
stereo mode seems to result in better quality on all samples I've tried.

Without further ado, the patch is attached. Won't be the last one. I
noticed there are quite some missing features to be implemented, and might
as well do so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Several-improvements-to-the-AAC-encoder.patch
Type: application/octet-stream
Size: 9525 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130504/1428949f/attachment.obj>


More information about the ffmpeg-devel mailing list