1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

AAC encoder: fix initialization of minsf

In some situations (exactly zeroed DC coeffs) minsf would
be initialized with garbage
This commit is contained in:
Claudio Freire 2016-04-03 15:03:53 -03:00
parent 76466ab214
commit bad41d3724

View File

@ -302,10 +302,11 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
const float *scaled = s->scoefs + start; const float *scaled = s->scoefs + start;
int minsfidx; int minsfidx;
maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled); maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
if (maxvals[w*16+g] > 0) if (maxvals[w*16+g] > 0) {
minsfidx = coef2minsf(maxvals[w*16+g]); minsfidx = coef2minsf(maxvals[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
minsf[(w+w2)*16+g] = minsfidx; minsf[(w+w2)*16+g] = minsfidx;
}
start += sce->ics.swb_sizes[g]; start += sce->ics.swb_sizes[g];
} }
} }