Skip to content
Snippets Groups Projects
Commit af2ee6fc authored by Alex Converse's avatar Alex Converse
Browse files

Remove useless costly inf checks from the trellis scalefactor search.

Originally committed as revision 23319 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent acc9f51f
No related branches found
No related tags found
No related merge requests found
...@@ -579,8 +579,6 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, ...@@ -579,8 +579,6 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
for (i = 0; i < q1 - q0; i++) { for (i = 0; i < q1 - q0; i++) {
float cost; float cost;
if (isinf(paths[idx - 1][i].cost))
continue;
cost = paths[idx - 1][i].cost + dist cost = paths[idx - 1][i].cost + dist
+ ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO]; + ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
if (cost < paths[idx][q].cost) { if (cost < paths[idx][q].cost) {
...@@ -591,21 +589,8 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, ...@@ -591,21 +589,8 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
} }
} else { } else {
for (q = 0; q < q1 - q0; q++) { for (q = 0; q < q1 - q0; q++) {
if (!isinf(paths[idx - 1][q].cost)) {
paths[idx][q].cost = paths[idx - 1][q].cost + 1; paths[idx][q].cost = paths[idx - 1][q].cost + 1;
paths[idx][q].prev = q; paths[idx][q].prev = q;
continue;
}
for (i = 0; i < q1 - q0; i++) {
float cost;
if (isinf(paths[idx - 1][i].cost))
continue;
cost = paths[idx - 1][i].cost + ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
if (cost < paths[idx][q].cost) {
paths[idx][q].cost = cost;
paths[idx][q].prev = i;
}
}
} }
} }
sce->zeroes[w*16+g] = !nz; sce->zeroes[w*16+g] = !nz;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment