diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-08-29 19:01:59 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-08-29 19:01:59 +0100 |
commit | 0818705bf37e2c62de1947f1c06ad63262e51fc6 (patch) | |
tree | 4b47f92aa81fef42fd879affbe6242233ae20c6b /libavcodec/aacenc_tns.c | |
parent | 47b41feb7283dcb4622dc0ada8056cb9a2de0f53 (diff) | |
download | ffmpeg-0818705bf37e2c62de1947f1c06ad63262e51fc6.tar.gz |
aacenc_tns: fix triggering an assertion with assert-level=2
It also made no sense to actually make the filter span the entire
window including the first band of the next window.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aacenc_tns.c')
-rw-r--r-- | libavcodec/aacenc_tns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c index 912229e692..e948b32ba8 100644 --- a/libavcodec/aacenc_tns.c +++ b/libavcodec/aacenc_tns.c @@ -173,7 +173,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE; const int tns_max_order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; - for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (w = 0; w < sce->ics.num_windows; w++) { int order = 0, filters = 1; int sfb_start = 0, sfb_len = 0; int coef_start = 0, coef_len = 0; @@ -197,7 +197,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) threshold += band->threshold; } if (!sfb_len) { - sfb_len = (w+sce->ics.group_len[w])*16+g - sfb_start; + sfb_len = (w+1)*16+g - sfb_start - 1; coef_len = sce->ics.swb_offset[sfb_start + sfb_len] - coef_start; } } |