avcodec/aacpsy: Fix AAC Psy PE reduction calculation when multiple iterations are...
authorClaudio Freire <claudiofreire@klaumptop.jampp.local>
Sun, 1 Mar 2015 23:11:12 +0000 (20:11 -0300)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Mar 2015 12:31:31 +0000 (13:31 +0100)
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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacpsy.c
tests/fate/aac.mak

index 068fbcd..d1e65f6 100644 (file)
@@ -717,7 +717,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
             }
             desired_pe_no_ah = FFMAX(desired_pe - (pe - pe_no_ah), 0.0f);
             if (active_lines > 0.0f)
-                reduction += calc_reduction_3gpp(a, desired_pe_no_ah, pe_no_ah, active_lines);
+                reduction = calc_reduction_3gpp(a, desired_pe_no_ah, pe_no_ah, active_lines);
 
             pe = 0.0f;
             for (w = 0; w < wi->num_windows*16; w += 16) {
index b36c861..97e5d27 100644 (file)
@@ -91,7 +91,7 @@ fate-aac-aref-encode: CMD = enc_dec_pcm adts wav s16le $(REF) -strict -2 -c:a aa
 fate-aac-aref-encode: CMP = stddev
 fate-aac-aref-encode: REF = ./tests/data/asynth-44100-2.wav
 fate-aac-aref-encode: CMP_SHIFT = -4096
-fate-aac-aref-encode: CMP_TARGET = 1862
+fate-aac-aref-encode: CMP_TARGET = 438
 fate-aac-aref-encode: SIZE_TOLERANCE = 2464
 
 FATE_AAC_ENCODE += fate-aac-ln-encode