History

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

Yotam Ofek committed 2 years ago

Commit 02c032a1 parent 0d959181 file · +3 −4Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/aacenc_tns.c+3−4
@@ -181,7 +181,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) · 180 unmodified lines
181 181
182 for (w = 0; w < sce->ics.num_windows; w++) {182 for (w = 0; w < sce->ics.num_windows; w++) {
183 float en[2] = {0.0f, 0.0f};183 float en[2] = {0.0f, 0.0f};
184 int oc_start = 0, os_start = 0;184 int oc_start = 0;
185 int coef_start = sce->ics.swb_offset[sfb_start];185 int coef_start = sce->ics.swb_offset[sfb_start];
186 186
187 for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {187 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) · 14 unmodified lines
202 tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;202 tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
203 for (g = 0; g < tns->n_filt[w]; g++) {203 for (g = 0; g < tns->n_filt[w]; g++) {
204 tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];204 tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];
205 tns->order[w][g] = g < tns->n_filt[w] ? order/tns->n_filt[w] : order - oc_start;205 tns->order[w][g] = order/tns->n_filt[w];
206 tns->length[w][g] = g < tns->n_filt[w] ? sfb_len/tns->n_filt[w] : sfb_len - os_start;206 tns->length[w][g] = sfb_len/tns->n_filt[w];
207 quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g],207 quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g],
208 tns->order[w][g], c_bits);208 tns->order[w][g], c_bits);
209 oc_start += tns->order[w][g];209 oc_start += tns->order[w][g];
210 os_start += tns->length[w][g];
211 }210 }
212 count++;211 count++;
213 }212 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t