[FFmpeg-cvslog] AAC encoder: use signed coeffs when measuring IS energy

Claudio Freire git at videolan.org
Sun Jan 17 17:14:23 CET 2016


ffmpeg | branch: master | Claudio Freire <klaussfreire at gmail.com> | Sat Jan 16 20:47:00 2016 -0300| [df3fa48288d6e79ac4a193406d514c1dace22397] | committer: Claudio Freire

AAC encoder: use signed coeffs when measuring IS energy

I/S energy, especially when it comes to phase cancellations,
needs to use signed coefficients as input, yet it was using
abs'd coefficients. That was a slight bug.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df3fa48288d6e79ac4a193406d514c1dace22397
---

 libavcodec/aacenc_is.c |    4 ++--
 tests/fate/aac.mak     |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/aacenc_is.c b/libavcodec/aacenc_is.c
index 46a9773..473897b 100644
--- a/libavcodec/aacenc_is.c
+++ b/libavcodec/aacenc_is.c
@@ -120,8 +120,8 @@ void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElemen
                 struct AACISError ph_err1, ph_err2, *best;
                 for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
                     for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
-                        float coef0 = fabsf(sce0->coeffs[start+(w+w2)*128+i]);
-                        float coef1 = fabsf(sce1->coeffs[start+(w+w2)*128+i]);
+                        float coef0 = sce0->coeffs[start+(w+w2)*128+i];
+                        float coef1 = sce1->coeffs[start+(w+w2)*128+i];
                         ener0  += coef0*coef0;
                         ener1  += coef1*coef1;
                         ener01 += (coef0 + coef1)*(coef0 + coef1);
diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
index f3ad7d9..3b66def 100644
--- a/tests/fate/aac.mak
+++ b/tests/fate/aac.mak
@@ -191,7 +191,7 @@ fate-aac-is-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-ref
 fate-aac-is-encode: CMP = stddev
 fate-aac-is-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
 fate-aac-is-encode: CMP_SHIFT = -4096
-fate-aac-is-encode: CMP_TARGET = 597
+fate-aac-is-encode: CMP_TARGET = 615
 fate-aac-is-encode: SIZE_TOLERANCE = 3560
 fate-aac-is-encode: FUZZ = 10
 



More information about the ffmpeg-cvslog mailing list