Commit dcbe8d8a authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

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: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent 3112501d
...@@ -107,7 +107,7 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce) ...@@ -107,7 +107,7 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
IndividualChannelStream *ics = &sce->ics; IndividualChannelStream *ics = &sce->ics;
int w, filt, m, i, top, order, bottom, start, end, size, inc; int w, filt, m, i, top, order, bottom, start, end, size, inc;
const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb); 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++) { for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb; bottom = ics->num_swb;
...@@ -133,21 +133,12 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce) ...@@ -133,21 +133,12 @@ void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
} }
start += w * 128; start += w * 128;
if (!s->options.ltp) { // ar filter /* AR filter */
for (m = 0; m < size; m++, start += inc) { for (m = 0; m < size; m++, start += inc) {
for (i = 1; i <= FFMIN(m, order); i++) { for (i = 1; i <= FFMIN(m, order); i++) {
sce->coeffs[start] += lpc[i-1]*sce->pcoeffs[start - i*inc]; 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];
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment