]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/aacenc.c
all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h
[ffmpeg] / libavcodec / aacenc.c
index 1de266de623df7ec05c6e35dc97b4a51e3c963b9..023260a7aec997acf286fa6519936e63deb74e1c 100644 (file)
@@ -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;
     }
 }
 
@@ -995,6 +994,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
     ERROR_IF(s->options.ltp && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL,
              "The LPT profile requires experimental compliance, add -strict -2 to enable!\n");
 
+    /* M/S introduces horrible artifacts with multichannel files, this is temporary */
+    if (s->channels > 3)
+        s->options.mid_side = 0;
+
     if ((ret = dsp_init(avctx, s)) < 0)
         goto fail;