summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder_twoloop.h
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2016-04-03 15:03:53 -0300
committerClaudio Freire <klaussfreire@gmail.com>2016-04-03 15:03:53 -0300
commitbad41d3724228cf9b03973a68cf3082adffb48f8 (patch)
treecec0d858e70a57ae5586b96b157064242b4d0dfd /libavcodec/aaccoder_twoloop.h
parent76466ab214ef20ea628703457bf8d595c4669f8c (diff)
downloadffmpeg-bad41d3724228cf9b03973a68cf3082adffb48f8.tar.gz
AAC encoder: fix initialization of minsf
In some situations (exactly zeroed DC coeffs) minsf would be initialized with garbage
Diffstat (limited to 'libavcodec/aaccoder_twoloop.h')
-rw-r--r--libavcodec/aaccoder_twoloop.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/aaccoder_twoloop.h b/libavcodec/aaccoder_twoloop.h
index 41d3ffd8a0..42aea52000 100644
--- a/libavcodec/aaccoder_twoloop.h
+++ b/libavcodec/aaccoder_twoloop.h
@@ -302,10 +302,11 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
const float *scaled = s->scoefs + start;
int minsfidx;
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]);
- for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
- minsf[(w+w2)*16+g] = minsfidx;
+ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
+ minsf[(w+w2)*16+g] = minsfidx;
+ }
start += sce->ics.swb_sizes[g];
}
}