X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Faacenc.c;h=023260a7aec997acf286fa6519936e63deb74e1c;hb=db1a642cd213804ed1579a19c9f5db08407dad9b;hp=5a70da176459a9dedee7cc518afe94b2aa5bbe1a;hpb=10424024a16a7646169b9c9008c5f7b77cbc2211;p=ffmpeg diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 5a70da17645..023260a7aec 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -78,11 +78,10 @@ static void put_audio_specific_config(AVCodecContext *avctx) void ff_quantize_band_cost_cache_init(struct AACEncContext *s) { - int sf, g; - for (sf = 0; sf < 256; sf++) { - for (g = 0; g < 128; g++) { - s->quantize_band_cost_cache[sf][g].bits = -1; - } + ++s->quantize_band_cost_cache_generation; + if (s->quantize_band_cost_cache_generation == 0) { + memset(s->quantize_band_cost_cache, 0, sizeof(s->quantize_band_cost_cache)); + s->quantize_band_cost_cache_generation = 1; } }