[FFmpeg-trac] #2686(avcodec:open): Native AAC encoder collapses at high bitrates on some samples

FFmpeg trac at avcodec.org
Thu Mar 5 14:17:38 CET 2015

#2686: Native AAC encoder collapses at high bitrates on some samples
             Reporter:  Kamedo2      |                    Owner:
                 Type:  defect       |  klaussfreire
             Priority:  normal       |                   Status:  open
              Version:  git-master   |                Component:  avcodec
             Keywords:  aac          |               Resolution:
  regression                         |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  0            |

Comment (by Kamedo2):

 Lots of good jobs are going on, such as these, thanks to Claudio Freire
 and Michael Niedermayer.
 Now the patch does not apply to the git head.
 avcodec/aacpsy: Fix AAC Psy PE reduction calculation when multiple
 iterations are required

 This is a small change, but it does have a big impact on bit allocation.

 all the regressions marked in the report have no audible
 difference (I didn't check them all though), but the improvements can
 be heard.

 This affects mostly high bit rates. It's related to issue #2686.

 In the report, A is the patched version, B is unpatched, all
 comparisons show deltas in the form (A-B), so a positive pSNR delta
 means a better quality in the patched version, and negative a
 regression. Regressions are only considered for pSNR deltas below
 -1db, they're considered serious below -6db.

 All measurements were done with tiny_psnr.

 The summary of the report inline for quick reading:

 Files: 58
 Bitrates: 6
 Tests: 347
 Serious Regressions: 0 (0%)
 Regressions: 10 (2%)
 Improvements: 54 (15%)
 Big improvements: 26 (7%)
 Worst regression - sine_tester.flac - 384k
   - StdDev: 1.68        pSNR: -3.05     maxdiff: -178.00
 Best improvement - 07 - Bound.flac - 384k
   - StdDev: -1700.05    pSNR: 20.64     maxdiff: -29595.00
 Average          - StdDev: -55.67       pSNR: 1.20      maxdiff: -1593.00

 AAC: Fix M/S stereo encoding

 This patch fixes a pointer arithmetic bug in adjust_frame_information that
 resulted in heavily corrupted audio when using M/S encoding. Also, a
 backup copy of untransformed coefficients has to be kept around or
 attempts at re-processing the frame (which happens when hevavily
 overspending bits during transients) will result in re-encoding of the
 coefficients and subsequent corruption of the resulting stream.

 A/B testing shows the bug as corrected, but still cannot prove that M/S
 coding is a win at least in numbers. Limited listening tests do show
 improvement on M/S encoded samples in lower bitrates, but they're hidden
 among the other artifacts that remain to be corrected in the encoder.

 Some of the regressions flagged in the report do show poor stereo image
 (but not buggy), so M/S encoding is clearly not good enough yet to be
 defaulted to auto.

 In numbers, Patched against Unpatched, stereo_mode auto:

   Files: 114
   Bitrates: 6
   Tests: 683

   Serious Regressions: 0 (0%)
   Regressions: 0 (0%)
   Improvements: 227 (33%)
   Big improvements: 92 (13%)
   Worst regression - mybloodrusts.wv - 256k
     - StdDev: 28.61       pSNR: -0.43     maxdiff: 1372.00
   Best improvement - 60.wv - 384k
     - StdDev: -369.57     pSNR: 45.02     maxdiff: -13322.00
   Average          - StdDev: -80.56       pSNR: 2.49      maxdiff:

 Patched against Unpatched stereo_mode ms_off shows no difference.

 Patched stereo_mode auto vs Unpatched stereo_mode ms_off shows a small
 average improvement, just not too significant:

   Serious Regressions: 0 (0%)
   Regressions: 10 (1%)
   Improvements: 45 (6%)
   Big improvements: 2 (0%)
   Worst regression - Illinois.wv - 256k
     - StdDev: 33.20       pSNR: -2.03     maxdiff: 477.00
   Best improvement - song_of_circomstances.flac - 384k
     - StdDev: -3.97       pSNR: 7.61      maxdiff: -826.00
   Average          - StdDev: -10.25       pSNR: 0.20      maxdiff: -281.00

Ticket URL: <https://trac.ffmpeg.org/ticket/2686#comment:365>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list