summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc_tns.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-12-05 19:06:39 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-12-05 19:06:39 +0000
commitdcbe8d8abc9b726650e36572f1f9dbd0879cbd93 (patch)
tree41c0b415814e7dfd1e10ae9c4e7434073cf57b56 /libavcodec/aacenc_tns.c
parent3112501daf715f715f729defaa6133c2fab678f2 (diff)
downloadffmpeg-dcbe8d8abc9b726650e36572f1f9dbd0879cbd93.tar.gz
aacenc_ltp: use an AR filter for LTP encoding as well
Seems to work better. Information on why the decoder does this is lacking. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aacenc_tns.c')
-rw-r--r--libavcodec/aacenc_tns.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c
index 694fbb99e0..85fcb0f33b 100644
--- a/libavcodec/aacenc_tns.c
+++ b/libavcodec/aacenc_tns.c
@@ -107,7 +107,7 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
IndividualChannelStream *ics = &sce->ics;
int w, filt, m, i, top, order, bottom, start, end, size, inc;
const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
- float lpc[TNS_MAX_ORDER], tmp[TNS_MAX_ORDER+1];
+ float lpc[TNS_MAX_ORDER];
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
@@ -133,19 +133,10 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
}
start += w * 128;
- if (!s->options.ltp) { // ar filter
- for (m = 0; m < size; m++, start += inc) {
- for (i = 1; i <= FFMIN(m, order); i++) {
- sce->coeffs[start] += lpc[i-1]*sce->pcoeffs[start - i*inc];
- }
- }
- } else { // ma filter
- for (m = 0; m < size; m++, start += inc) {
- tmp[0] = sce->pcoeffs[start];
- for (i = 1; i <= FFMIN(m, order); i++)
- sce->coeffs[start] += lpc[i-1]*tmp[i];
- for (i = order; i > 0; i--)
- tmp[i] = tmp[i - 1];
+ /* AR filter */
+ for (m = 0; m < size; m++, start += inc) {
+ for (i = 1; i <= FFMIN(m, order); i++) {
+ sce->coeffs[start] += lpc[i-1]*sce->pcoeffs[start - i*inc];
}
}
}