OSDN Git Service

aacenc: Correct spreading calculation for high spreading.
authorNathan Caldwell <saintdev@gmail.com>
Mon, 1 Nov 2010 07:45:13 +0000 (07:45 +0000)
committerAlex Converse <alex.converse@gmail.com>
Mon, 1 Nov 2010 07:45:13 +0000 (07:45 +0000)
commitd56920e206b639d9e2a4e22b90acc680c6e4ca04
treef82f7da1cd86521226ec1f9e1219752679c5a7ce
parent3ea12f65ba7b68f840f029119c76e718e7c05a3e
aacenc: Correct spreading calculation for high spreading.

The 3GPP spec uses the following calculation for high spreading:

thr'_spr = max(thr_scaled, s_h(n) * thr_scaled(n-1))

where, n is defined as the current band, and s_h() is defined as "[...] the
distance of adjacent bands in Bark and a constant slope that is 15 dB/Bark
[...]". This is a little ambiguous as you would assume you want the Bark
width of the previous band for this calculation. However, this assumption
appears to be incorrect, and you really want the Bark width of the current
band. Coincidentally this is exactly what the spec calls for! =P

This noticeably improves Tom's Diner at low bitrates (I tested at 64kbps,
with mid/side disabled).

Patch by: Nathan Caldwell <saintdev@gmail.com>

Originally committed as revision 25622 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/aacpsy.c