aacenc_pred: disable PNS SFBs and disable right predictors with IS
authorRostislav Pehlivanov <atomnuker@gmail.com>
Sun, 6 Sep 2015 14:10:28 +0000 (15:10 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Sun, 6 Sep 2015 14:30:26 +0000 (15:30 +0100)
Since PNS generates coefficients it doesn't make sense to send
the predicted ones as well. Also the specifications explicitly
state to disable right channel IS predictors.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/aacenc_pred.c

index eb8e7f7..c0e5e6e 100644 (file)
@@ -262,7 +262,9 @@ void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce)
         const int num_coeffs = sce->ics.swb_offset[sfb + 1] - start_coef;
         const FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[sfb];
 
-        if (start_coef + num_coeffs > MAX_PREDICTORS)
+        if (start_coef + num_coeffs > MAX_PREDICTORS ||
+            (s->cur_channel && sce->band_type[sfb] >= INTENSITY_BT2) ||
+            sce->band_type[sfb] == NOISE_BT)
             continue;
 
         /* Normal coefficients */