Browse code

aacenc: use the new function for setting special band scalefactor indices

This commit enables the function added with commit 7c10b87 and uses that
new function for setting any special scalefactor indices. This commit does
not change the behaviour of the encoder since no bands are being marked as
either NOISE_BT(due to the previous PNS implementation removed in the
previous commit) or INTENSITY_BT2/INTENSITY_BT.

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Rostislav Pehlivanov authored on 2015/07/03 03:13:04
Showing 3 changed files
... ...
@@ -1222,24 +1222,28 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
1222 1222
         search_for_quantizers_faac,
1223 1223
         encode_window_bands_info,
1224 1224
         quantize_and_encode_band,
1225
+        set_special_band_scalefactors,
1225 1226
         search_for_ms,
1226 1227
     },
1227 1228
     [AAC_CODER_ANMR] = {
1228 1229
         search_for_quantizers_anmr,
1229 1230
         encode_window_bands_info,
1230 1231
         quantize_and_encode_band,
1232
+        set_special_band_scalefactors,
1231 1233
         search_for_ms,
1232 1234
     },
1233 1235
     [AAC_CODER_TWOLOOP] = {
1234 1236
         search_for_quantizers_twoloop,
1235 1237
         codebook_trellis_rate,
1236 1238
         quantize_and_encode_band,
1239
+        set_special_band_scalefactors,
1237 1240
         search_for_ms,
1238 1241
     },
1239 1242
     [AAC_CODER_FAST] = {
1240 1243
         search_for_quantizers_fast,
1241 1244
         encode_window_bands_info,
1242 1245
         quantize_and_encode_band,
1246
+        set_special_band_scalefactors,
1243 1247
         search_for_ms,
1244 1248
     },
1245 1249
 };
... ...
@@ -652,6 +652,9 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
652 652
                     s->coder->search_for_ms(s, cpe, s->lambda);
653 653
                 }
654 654
             }
655
+            if (s->coder->set_special_band_scalefactors)
656
+                for (ch = 0; ch < chans; ch++)
657
+                    s->coder->set_special_band_scalefactors(s, &cpe->ch[ch]);
655 658
             adjust_frame_information(cpe, chans);
656 659
             if (chans == 2) {
657 660
                 put_bits(&s->pb, 1, cpe->common_window);
... ...
@@ -54,6 +54,7 @@ typedef struct AACCoefficientsEncoder {
54 54
                                      int win, int group_len, const float lambda);
55 55
     void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
56 56
                                      int scale_idx, int cb, const float lambda);
57
+    void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
57 58
     void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
58 59
 } AACCoefficientsEncoder;
59 60