From d33048329b47cfdd91bb57e74489455db09e5e38 Mon Sep 17 00:00:00 2001 From: Buschel Date: Tue, 14 Sep 2010 19:31:00 +0000 Subject: [PATCH] Fix scaling error that was introduced with r28069. With this fix the level of the hf-spectrum will be correct when decoding aac-he files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28081 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libfaad/sbr_hfadj.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/codecs/libfaad/sbr_hfadj.c b/apps/codecs/libfaad/sbr_hfadj.c index ab712dcd45..4984eaf1c4 100644 --- a/apps/codecs/libfaad/sbr_hfadj.c +++ b/apps/codecs/libfaad/sbr_hfadj.c @@ -156,10 +156,10 @@ static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++) { tmp = QMF_RE(Xsbr[i][m + sbr->kx]); - nrg += MUL_R(tmp, tmp); + nrg += MUL_R(tmp, (tmp>>REAL_BITS)); #ifndef SBR_LOW_POWER tmp = QMF_IM(Xsbr[i][m + sbr->kx]); - nrg += MUL_R(tmp, tmp); + nrg += MUL_R(tmp, (tmp>>REAL_BITS)); #endif } @@ -192,10 +192,10 @@ static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj, for (j = k_l; j < k_h; j++) { tmp = QMF_RE(Xsbr[i][j]); - nrg += MUL_R(tmp, tmp); + nrg += MUL_R(tmp, (tmp>>REAL_BITS)); #ifndef SBR_LOW_POWER tmp = QMF_IM(Xsbr[i][j]); - nrg += MUL_R(tmp, tmp); + nrg += MUL_R(tmp, (tmp>>REAL_BITS)); #endif } } -- 2.11.4.GIT