diff options
author | Yotam Ofek <yotam.ofek@gmail.com> | 2024-05-12 08:53:41 +0000 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-05-12 16:01:44 +0200 |
commit | 02c032abcd43465b30ad58ede18abcdc24b5c006 (patch) | |
tree | 921c57343066fe84b0a5ce7635b0c1b9886664e0 /libavcodec | |
parent | 0d9591841b2b38a1620d393a0ca7594fa5955407 (diff) | |
download | ffmpeg-02c032abcd43465b30ad58ede18abcdc24b5c006.tar.gz |
avcodec/aacenc_tns: remove unreachable code branch
the condition being tested was the same as the stop condition for the containing loop,
so inside the loop it would always test positive
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacenc_tns.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c index 60888fece7..fa3cd2af39 100644 --- a/libavcodec/aacenc_tns.c +++ b/libavcodec/aacenc_tns.c @@ -181,7 +181,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) for (w = 0; w < sce->ics.num_windows; w++) { float en[2] = {0.0f, 0.0f}; - int oc_start = 0, os_start = 0; + int oc_start = 0; int coef_start = sce->ics.swb_offset[sfb_start]; for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) { @@ -202,12 +202,11 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3; for (g = 0; g < tns->n_filt[w]; g++) { tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g]; - tns->order[w][g] = g < tns->n_filt[w] ? order/tns->n_filt[w] : order - oc_start; - tns->length[w][g] = g < tns->n_filt[w] ? sfb_len/tns->n_filt[w] : sfb_len - os_start; + tns->order[w][g] = order/tns->n_filt[w]; + tns->length[w][g] = sfb_len/tns->n_filt[w]; quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g], tns->order[w][g], c_bits); oc_start += tns->order[w][g]; - os_start += tns->length[w][g]; } count++; } |