summaryrefslogtreecommitdiff
path: root/libavcodec/aac.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-09-04 11:03:14 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-09-04 11:03:14 +0000
commit1be0fc2909fbcefd800d20cfff1420234fd0715b (patch)
tree5e947eaeb7845f55f3c6f09b81e67393d8fb74be /libavcodec/aac.c
parent287ba997b5a4df061a0f6efb1cc7e2ae67831f7e (diff)
Avoid duplicating compute_lpc_coefs() function in both the RA288 and AAC decoders.
Originally committed as revision 15193 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aac.c')
-rw-r--r--libavcodec/aac.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c
index a75a7cefdd..94f27acda1 100644
--- a/libavcodec/aac.c
+++ b/libavcodec/aac.c
@@ -79,6 +79,7 @@
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
+#include "lpc.h"
#include "aac.h"
#include "aactab.h"
@@ -634,7 +635,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns,
tmp2_idx = 2*coef_compress + coef_res;
for (i = 0; i < tns->order[w][filt]; i++)
- tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
+ tns->coef[w][filt][i] = -tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
}
}
}
@@ -1124,20 +1125,8 @@ static void apply_tns(float coef[1024], TemporalNoiseShaping * tns, IndividualCh
if (order == 0)
continue;
- /* tns_decode_coef
- * FIXME: This duplicates the functionality of some double code in lpc.c.
- */
- for (m = 0; m < order; m++) {
- float tmp;
- lpc[m] = tns->coef[w][filt][m];
- for (i = 0; i < m/2; i++) {
- tmp = lpc[i];
- lpc[i] += lpc[m] * lpc[m-1-i];
- lpc[m-1-i] += lpc[m] * tmp;
- }
- if(m & 1)
- lpc[i] += lpc[m] * lpc[i];
- }
+ // tns_decode_coef
+ compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
start = ics->swb_offset[FFMIN(bottom, mmm)];
end = ics->swb_offset[FFMIN( top, mmm)];