summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacenc_ltp.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-11-26 18:20:42 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-11-26 18:20:42 +0000
commitf5b7a29ae893add491397bebe6f4cc5deec2d480 (patch)
treef753a01e502773492ea22e658c02797316fc4f5e /libavcodec/aacenc_ltp.c
parent1e5dbb3409ccb47500c56b9746610bb75445a81b (diff)
downloadffmpeg-streaming-f5b7a29ae893add491397bebe6f4cc5deec2d480.zip
ffmpeg-streaming-f5b7a29ae893add491397bebe6f4cc5deec2d480.tar.gz
aac_ltp: actually signal LTP as off during EIGHT_SHORT windows
This hugely reduces the echo which was introduced with the previous commit (though likely because previously everything was broken). Makes LTP actually worthwhile now. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aacenc_ltp.c')
-rw-r--r--libavcodec/aacenc_ltp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/aacenc_ltp.c b/libavcodec/aacenc_ltp.c
index 5aaaf6f..e19f3cc 100644
--- a/libavcodec/aacenc_ltp.c
+++ b/libavcodec/aacenc_ltp.c
@@ -135,8 +135,10 @@ void ff_aac_adjust_common_ltp(AACEncContext *s, ChannelElement *cpe)
if (!cpe->common_window ||
sce0->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE ||
- sce1->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE)
+ sce1->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ sce0->ics.ltp.present = 0;
return;
+ }
for (sfb = 0; sfb < FFMIN(sce0->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++) {
int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb];
OpenPOWER on IntegriCloud