Browse code

avcodec/aac: Add floating point 960/120 MDCT window

Co-Authored-By: Alex Converse <alex.converse@gmail.com>
Co-Authored-By: Rostislav Pehlivanov <atomnuker@gmail.com>

Paul B Mahol authored on 2017/07/04 23:59:13
Showing 6 changed files
... ...
@@ -327,7 +327,9 @@ struct AACContext {
327 327
 #if USE_FIXED
328 328
     AVFixedDSPContext *fdsp;
329 329
 #else
330
+    MDCT15Context *mdct120;
330 331
     MDCT15Context *mdct480;
332
+    MDCT15Context *mdct960;
331 333
     AVFloatDSPContext *fdsp;
332 334
 #endif /* USE_FIXED */
333 335
     int random_state;
... ...
@@ -353,6 +355,7 @@ struct AACContext {
353 353
 
354 354
     OutputConfiguration oc[2];
355 355
     int warned_num_aac_frames;
356
+    int warned_960_sbr;
356 357
 
357 358
     /* aacdec functions pointers */
358 359
     void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
... ...
@@ -811,11 +811,21 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
811 811
     uint8_t layout_map[MAX_ELEM_ID*4][3];
812 812
     int tags = 0;
813 813
 
814
+#if USE_FIXED
814 815
     if (get_bits1(gb)) { // frameLengthFlag
815
-        avpriv_request_sample(avctx, "960/120 MDCT window");
816
+        avpriv_report_missing_feature(avctx, "Fixed point 960/120 MDCT window");
816 817
         return AVERROR_PATCHWELCOME;
817 818
     }
818 819
     m4ac->frame_length_short = 0;
820
+#else
821
+    m4ac->frame_length_short = get_bits1(gb);
822
+    if (m4ac->frame_length_short && m4ac->sbr == 1) {
823
+      avpriv_report_missing_feature(avctx, "SBR with 960 frame length");
824
+      if (ac) ac->warned_960_sbr = 1;
825
+      m4ac->sbr = 0;
826
+      m4ac->ps = 0;
827
+    }
828
+#endif
819 829
 
820 830
     if (get_bits1(gb))       // dependsOnCoreCoder
821 831
         skip_bits(gb, 14);   // coreCoderDelay
... ...
@@ -1126,6 +1136,12 @@ static av_cold void aac_static_table_init(void)
1126 1126
     // window initialization
1127 1127
     AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_1024), 4.0, 1024);
1128 1128
     AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_128), 6.0, 128);
1129
+#if !USE_FIXED
1130
+    AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_960), 4.0, 960);
1131
+    AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_120), 6.0, 120);
1132
+    AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_960), 960);
1133
+    AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_120), 120);
1134
+#endif
1129 1135
     AAC_RENAME(ff_init_ff_sine_windows)(10);
1130 1136
     AAC_RENAME(ff_init_ff_sine_windows)( 9);
1131 1137
     AAC_RENAME(ff_init_ff_sine_windows)( 7);
... ...
@@ -1211,9 +1227,15 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
1211 1211
     AAC_RENAME_32(ff_mdct_init)(&ac->mdct_small,  8, 1, 1.0 / RANGE15(128.0));
1212 1212
     AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ltp,   11, 0, RANGE15(-2.0));
1213 1213
 #if !USE_FIXED
1214
+    ret = ff_mdct15_init(&ac->mdct120, 1, 3, 1.0f/(16*1024*120*2));
1215
+    if (ret < 0)
1216
+        return ret;
1214 1217
     ret = ff_mdct15_init(&ac->mdct480, 1, 5, 1.0f/(16*1024*960));
1215 1218
     if (ret < 0)
1216 1219
         return ret;
1220
+    ret = ff_mdct15_init(&ac->mdct960, 1, 6, 1.0f/(16*1024*960*2));
1221
+    if (ret < 0)
1222
+        return ret;
1217 1223
 #endif
1218 1224
 
1219 1225
     return 0;
... ...
@@ -1316,8 +1338,13 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
1316 1316
             }
1317 1317
         }
1318 1318
         ics->num_windows       = 8;
1319
-        ics->swb_offset        =    ff_swb_offset_128[sampling_index];
1320
-        ics->num_swb           =   ff_aac_num_swb_128[sampling_index];
1319
+        if (m4ac->frame_length_short) {
1320
+            ics->swb_offset    =  ff_swb_offset_120[sampling_index];
1321
+            ics->num_swb       = ff_aac_num_swb_120[sampling_index];
1322
+        } else {
1323
+            ics->swb_offset    =  ff_swb_offset_128[sampling_index];
1324
+            ics->num_swb       = ff_aac_num_swb_128[sampling_index];
1325
+        }
1321 1326
         ics->tns_max_bands     = ff_tns_max_bands_128[sampling_index];
1322 1327
         ics->predictor_present = 0;
1323 1328
     } else {
... ...
@@ -1338,8 +1365,13 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
1338 1338
                 goto fail;
1339 1339
             }
1340 1340
         } else {
1341
-            ics->swb_offset    =    ff_swb_offset_1024[sampling_index];
1342
-            ics->num_swb       =   ff_aac_num_swb_1024[sampling_index];
1341
+            if (m4ac->frame_length_short) {
1342
+                ics->num_swb    = ff_aac_num_swb_960[sampling_index];
1343
+                ics->swb_offset = ff_swb_offset_960[sampling_index];
1344
+            } else {
1345
+                ics->num_swb    = ff_aac_num_swb_1024[sampling_index];
1346
+                ics->swb_offset = ff_swb_offset_1024[sampling_index];
1347
+            }
1343 1348
             ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index];
1344 1349
         }
1345 1350
         if (aot != AOT_ER_AAC_ELD) {
... ...
@@ -2361,6 +2393,13 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
2361 2361
         if (!che) {
2362 2362
             av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
2363 2363
             return res;
2364
+        } else if (ac->oc[1].m4ac.frame_length_short) {
2365
+            if (!ac->warned_960_sbr)
2366
+              avpriv_report_missing_feature(ac->avctx,
2367
+                                            "SBR with 960 frame length");
2368
+            ac->warned_960_sbr = 1;
2369
+            skip_bits_long(gb, 8 * cnt - 4);
2370
+            return res;
2364 2371
         } else if (!ac->oc[1].m4ac.sbr) {
2365 2372
             av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
2366 2373
             skip_bits_long(gb, 8 * cnt - 4);
... ...
@@ -2620,6 +2659,72 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
2620 2620
     }
2621 2621
 }
2622 2622
 
2623
+/**
2624
+ * Conduct IMDCT and windowing.
2625
+ */
2626
+static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce)
2627
+{
2628
+#if !USE_FIXED
2629
+    IndividualChannelStream *ics = &sce->ics;
2630
+    INTFLOAT *in    = sce->coeffs;
2631
+    INTFLOAT *out   = sce->ret;
2632
+    INTFLOAT *saved = sce->saved;
2633
+    const INTFLOAT *swindow      = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120);
2634
+    const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_960) : AAC_RENAME(ff_sine_960);
2635
+    const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_120) : AAC_RENAME(ff_sine_120);
2636
+    INTFLOAT *buf  = ac->buf_mdct;
2637
+    INTFLOAT *temp = ac->temp;
2638
+    int i;
2639
+
2640
+    // imdct
2641
+    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
2642
+        for (i = 0; i < 8; i++)
2643
+            ac->mdct120->imdct_half(ac->mdct120, buf + i * 120, in + i * 128, 1);
2644
+    } else {
2645
+        ac->mdct960->imdct_half(ac->mdct960, buf, in, 1);
2646
+    }
2647
+
2648
+    /* window overlapping
2649
+     * NOTE: To simplify the overlapping code, all 'meaningless' short to long
2650
+     * and long to short transitions are considered to be short to short
2651
+     * transitions. This leaves just two cases (long to long and short to short)
2652
+     * with a little special sauce for EIGHT_SHORT_SEQUENCE.
2653
+     */
2654
+
2655
+    if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
2656
+        (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
2657
+        ac->fdsp->vector_fmul_window(    out,               saved,            buf,         lwindow_prev, 480);
2658
+    } else {
2659
+        memcpy(                          out,               saved,            420 * sizeof(*out));
2660
+
2661
+        if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
2662
+            ac->fdsp->vector_fmul_window(out + 420 + 0*120, saved + 420,      buf + 0*120, swindow_prev, 60);
2663
+            ac->fdsp->vector_fmul_window(out + 420 + 1*120, buf + 0*120 + 60, buf + 1*120, swindow,      60);
2664
+            ac->fdsp->vector_fmul_window(out + 420 + 2*120, buf + 1*120 + 60, buf + 2*120, swindow,      60);
2665
+            ac->fdsp->vector_fmul_window(out + 420 + 3*120, buf + 2*120 + 60, buf + 3*120, swindow,      60);
2666
+            ac->fdsp->vector_fmul_window(temp,              buf + 3*120 + 60, buf + 4*120, swindow,      60);
2667
+            memcpy(                      out + 420 + 4*120, temp, 60 * sizeof(*out));
2668
+        } else {
2669
+            ac->fdsp->vector_fmul_window(out + 420,         saved + 420,      buf,         swindow_prev, 60);
2670
+            memcpy(                      out + 540,         buf + 60,         420 * sizeof(*out));
2671
+        }
2672
+    }
2673
+
2674
+    // buffer update
2675
+    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
2676
+        memcpy(                      saved,       temp + 60,         60 * sizeof(*saved));
2677
+        ac->fdsp->vector_fmul_window(saved + 60,  buf + 4*120 + 60, buf + 5*120, swindow, 60);
2678
+        ac->fdsp->vector_fmul_window(saved + 180, buf + 5*120 + 60, buf + 6*120, swindow, 60);
2679
+        ac->fdsp->vector_fmul_window(saved + 300, buf + 6*120 + 60, buf + 7*120, swindow, 60);
2680
+        memcpy(                      saved + 420, buf + 7*120 + 60,  60 * sizeof(*saved));
2681
+    } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
2682
+        memcpy(                      saved,       buf + 480,        420 * sizeof(*saved));
2683
+        memcpy(                      saved + 420, buf + 7*120 + 60,  60 * sizeof(*saved));
2684
+    } else { // LONG_STOP or ONLY_LONG
2685
+        memcpy(                      saved,       buf + 480,        480 * sizeof(*saved));
2686
+    }
2687
+#endif
2688
+}
2623 2689
 static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
2624 2690
 {
2625 2691
     IndividualChannelStream *ics = &sce->ics;
... ...
@@ -2771,7 +2876,10 @@ static void spectral_to_sample(AACContext *ac, int samples)
2771 2771
         imdct_and_window = imdct_and_windowing_eld;
2772 2772
         break;
2773 2773
     default:
2774
-        imdct_and_window = ac->imdct_and_windowing;
2774
+        if (ac->oc[1].m4ac.frame_length_short)
2775
+            imdct_and_window = imdct_and_windowing_960;
2776
+        else
2777
+            imdct_and_window = ac->imdct_and_windowing;
2775 2778
     }
2776 2779
     for (type = 3; type >= 0; type--) {
2777 2780
         for (i = 0; i < MAX_ELEM_ID; i++) {
... ...
@@ -3015,7 +3123,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
3015 3015
                 err = AVERROR_INVALIDDATA;
3016 3016
                 goto fail;
3017 3017
             }
3018
-            samples = 1024;
3018
+            samples = ac->oc[1].m4ac.frame_length_short ? 960 : 1024;
3019 3019
             che->present = 1;
3020 3020
         }
3021 3021
 
... ...
@@ -3242,7 +3350,9 @@ static av_cold int aac_decode_close(AVCodecContext *avctx)
3242 3242
     ff_mdct_end(&ac->mdct_ld);
3243 3243
     ff_mdct_end(&ac->mdct_ltp);
3244 3244
 #if !USE_FIXED
3245
+    ff_mdct15_uninit(&ac->mdct120);
3245 3246
     ff_mdct15_uninit(&ac->mdct480);
3247
+    ff_mdct15_uninit(&ac->mdct960);
3246 3248
 #endif
3247 3249
     av_freep(&ac->fdsp);
3248 3250
     return 0;
... ...
@@ -37,6 +37,8 @@ float ff_aac_pow34sf_tab[428];
37 37
 
38 38
 DECLARE_ALIGNED(32, float,  ff_aac_kbd_long_1024)[1024];
39 39
 DECLARE_ALIGNED(32, float,  ff_aac_kbd_short_128)[128];
40
+DECLARE_ALIGNED(32, float,  ff_aac_kbd_long_960)[960];
41
+DECLARE_ALIGNED(32, float,  ff_aac_kbd_short_120)[120];
40 42
 DECLARE_ALIGNED(32, int,    ff_aac_kbd_long_1024_fixed)[1024];
41 43
 DECLARE_ALIGNED(32, int,    ff_aac_kbd_short_128_fixed)[128];
42 44
 
... ...
@@ -44,6 +46,10 @@ const uint8_t ff_aac_num_swb_1024[] = {
44 44
     41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40
45 45
 };
46 46
 
47
+const uint8_t ff_aac_num_swb_960[] = {
48
+    40, 40, 46, 49, 49, 49, 46, 46, 42, 42, 42, 40, 40
49
+};
50
+
47 51
 const uint8_t ff_aac_num_swb_512[] = {
48 52
      0,  0,  0, 36, 36, 37, 31, 31,  0,  0,  0,  0,  0
49 53
 };
... ...
@@ -56,6 +62,10 @@ const uint8_t ff_aac_num_swb_128[] = {
56 56
     12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15
57 57
 };
58 58
 
59
+const uint8_t ff_aac_num_swb_120[] = {
60
+    12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15
61
+};
62
+
59 63
 const uint8_t ff_aac_pred_sfb_max[] = {
60 64
     33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34, 34
61 65
 };
... ...
@@ -1229,6 +1239,100 @@ static const uint16_t swb_offset_128_8[] = {
1229 1229
     36,  44,  52,  60,  72,  88, 108, 128
1230 1230
 };
1231 1231
 
1232
+static const uint16_t swb_offset_960_96[] =
1233
+{
1234
+    0,   4,   8,   12,  16,  20,  24,  28,  32,  36,
1235
+    40,  44,  48,  52,  56,  64,  72,  80,  88,  96,
1236
+    108, 120, 132, 144, 156, 172, 188, 212, 240, 276,
1237
+    320, 384, 448, 512, 576, 640, 704, 768, 832, 896,
1238
+    960
1239
+};
1240
+
1241
+static const uint16_t swb_offset_960_64[] =
1242
+{
1243
+    0,   4,   8,   12,  16,  20,  24,  28,  32,  36,
1244
+    40,  44,  48,  52,  56,  64,  72,  80,  88,  100,
1245
+    112, 124, 140, 156, 172, 192, 216, 240, 268, 304,
1246
+    344, 384, 424, 464, 504, 544, 584, 624, 664, 704,
1247
+    744, 784, 824, 864, 904, 944, 960
1248
+};
1249
+
1250
+static const uint16_t swb_offset_960_48[] =
1251
+{
1252
+    0,   4,   8,   12,  16,  20,  24,  28,  32,  36,
1253
+    40,  48,  56,  64,  72,  80,  88,  96,  108, 120,
1254
+    132, 144, 160, 176, 196, 216, 240, 264, 292, 320,
1255
+    352, 384, 416, 448, 480, 512, 544, 576, 608, 640,
1256
+    672, 704, 736, 768, 800, 832, 864, 896, 928, 960
1257
+};
1258
+
1259
+static const uint16_t swb_offset_960_32[] =
1260
+{
1261
+    0,   4,   8,   12,  16,  20,  24,  28,  32,  36,
1262
+    40,  48,  56,  64,  72,  80,  88,  96,  108, 120,
1263
+    132, 144, 160, 176, 196, 216, 240, 264, 292, 320,
1264
+    352, 384, 416, 448, 480, 512, 544, 576, 608, 640,
1265
+    672, 704, 736, 768, 800, 832, 864, 896, 928, 960
1266
+};
1267
+
1268
+static const uint16_t swb_offset_960_24[] =
1269
+{
1270
+    0,   4,   8,   12,  16,  20,  24,  28,  32,  36,
1271
+    40,  44,  52,  60,  68,  76,  84,  92,  100, 108,
1272
+    116, 124, 136, 148, 160, 172, 188, 204, 220, 240,
1273
+    260, 284, 308, 336, 364, 396, 432, 468, 508, 552,
1274
+    600, 652, 704, 768, 832, 896, 960
1275
+};
1276
+
1277
+static const uint16_t swb_offset_960_16[] =
1278
+{
1279
+    0,   8,   16,  24,  32,  40,  48,  56,  64,  72,
1280
+    80,  88,  100, 112, 124, 136, 148, 160, 172, 184,
1281
+    196, 212, 228, 244, 260, 280, 300, 320, 344, 368,
1282
+    396, 424, 456, 492, 532, 572, 616, 664, 716, 772,
1283
+    832, 896, 960
1284
+};
1285
+
1286
+static const uint16_t swb_offset_960_8[] =
1287
+{
1288
+    0,   12,  24,  36,  48,  60,  72,  84,  96,  108,
1289
+    120, 132, 144, 156, 172, 188, 204, 220, 236, 252,
1290
+    268, 288, 308, 328, 348, 372, 396, 420, 448, 476,
1291
+    508, 544, 580, 620, 664, 712, 764, 820, 880, 944,
1292
+    960
1293
+};
1294
+
1295
+
1296
+static const uint16_t swb_offset_120_96[] =
1297
+{
1298
+    0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 120
1299
+};
1300
+
1301
+static const uint16_t swb_offset_120_64[] =
1302
+{
1303
+    0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 120
1304
+};
1305
+
1306
+static const uint16_t swb_offset_120_48[] =
1307
+{
1308
+    0,  4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80, 96, 112, 120
1309
+};
1310
+
1311
+static const uint16_t swb_offset_120_24[] =
1312
+{
1313
+    0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64, 76, 92, 108, 120
1314
+};
1315
+
1316
+static const uint16_t swb_offset_120_16[] =
1317
+{
1318
+    0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 60, 72, 88, 108, 120
1319
+};
1320
+
1321
+static const uint16_t swb_offset_120_8[] =
1322
+{
1323
+    0, 4, 8, 12, 16,  20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 120
1324
+};
1325
+
1232 1326
 const uint16_t * const ff_swb_offset_1024[] = {
1233 1327
     swb_offset_1024_96, swb_offset_1024_96, swb_offset_1024_64,
1234 1328
     swb_offset_1024_48, swb_offset_1024_48, swb_offset_1024_32,
... ...
@@ -1237,6 +1341,14 @@ const uint16_t * const ff_swb_offset_1024[] = {
1237 1237
     swb_offset_1024_8
1238 1238
 };
1239 1239
 
1240
+const uint16_t * const ff_swb_offset_960[] = {
1241
+    swb_offset_960_96, swb_offset_960_96, swb_offset_960_64,
1242
+    swb_offset_960_48, swb_offset_960_48, swb_offset_960_32,
1243
+    swb_offset_960_24, swb_offset_960_24, swb_offset_960_16,
1244
+    swb_offset_960_16, swb_offset_960_16, swb_offset_960_8,
1245
+    swb_offset_960_8
1246
+};
1247
+
1240 1248
 const uint16_t * const ff_swb_offset_512[] = {
1241 1249
     NULL,               NULL,               NULL,
1242 1250
     swb_offset_512_48,  swb_offset_512_48,  swb_offset_512_32,
... ...
@@ -1263,6 +1375,14 @@ const uint16_t * const ff_swb_offset_128[] = {
1263 1263
     swb_offset_128_8
1264 1264
 };
1265 1265
 
1266
+const uint16_t * const ff_swb_offset_120[] = {
1267
+    swb_offset_120_96, swb_offset_120_96, swb_offset_120_96,
1268
+    swb_offset_120_48, swb_offset_120_48, swb_offset_120_48,
1269
+    swb_offset_120_24, swb_offset_120_24, swb_offset_120_16,
1270
+    swb_offset_120_16, swb_offset_120_16, swb_offset_120_8,
1271
+    swb_offset_120_8
1272
+};
1273
+
1266 1274
 // @}
1267 1275
 
1268 1276
 /* @name ff_tns_max_bands
... ...
@@ -136,6 +136,8 @@ static const INTFLOAT * const tns_tmp2_map[4] = {
136 136
  */
137 137
 DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_long_1024)[1024];
138 138
 DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_short_128)[128];
139
+DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_long_960)[960];
140
+DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_short_120)[120];
139 141
 DECLARE_ALIGNED(32, extern int,    ff_aac_kbd_long_1024_fixed)[1024];
140 142
 DECLARE_ALIGNED(32, extern int,    ff_aac_kbd_long_512_fixed)[512];
141 143
 DECLARE_ALIGNED(32, extern int,    ff_aac_kbd_short_128_fixed)[128];
... ...
@@ -149,9 +151,11 @@ DECLARE_ALIGNED(32, extern const int,   ff_aac_eld_window_480_fixed)[1800];
149 149
  * @{
150 150
  */
151 151
 extern const uint8_t ff_aac_num_swb_1024[];
152
+extern const uint8_t ff_aac_num_swb_960 [];
152 153
 extern const uint8_t ff_aac_num_swb_512 [];
153 154
 extern const uint8_t ff_aac_num_swb_480 [];
154 155
 extern const uint8_t ff_aac_num_swb_128 [];
156
+extern const uint8_t ff_aac_num_swb_120 [];
155 157
 // @}
156 158
 
157 159
 extern const uint8_t ff_aac_pred_sfb_max [];
... ...
@@ -168,9 +172,11 @@ extern const float *ff_aac_codebook_vector_vals[];
168 168
 extern const uint16_t *ff_aac_codebook_vector_idx[];
169 169
 
170 170
 extern const uint16_t * const ff_swb_offset_1024[13];
171
+extern const uint16_t * const ff_swb_offset_960 [13];
171 172
 extern const uint16_t * const ff_swb_offset_512 [13];
172 173
 extern const uint16_t * const ff_swb_offset_480 [13];
173 174
 extern const uint16_t * const ff_swb_offset_128 [13];
175
+extern const uint16_t * const ff_swb_offset_120 [13];
174 176
 
175 177
 extern const uint8_t ff_tns_max_bands_1024[13];
176 178
 extern const uint8_t ff_tns_max_bands_512 [13];
... ...
@@ -52,14 +52,16 @@ void AAC_RENAME(ff_init_ff_sine_windows)(int index);
52 52
 
53 53
 extern SINETABLE(  32);
54 54
 extern SINETABLE(  64);
55
+extern SINETABLE( 120);
55 56
 extern SINETABLE( 128);
56 57
 extern SINETABLE( 256);
57 58
 extern SINETABLE( 512);
59
+extern SINETABLE( 960);
58 60
 extern SINETABLE(1024);
59 61
 extern SINETABLE(2048);
60 62
 extern SINETABLE(4096);
61 63
 extern SINETABLE(8192);
62 64
 
63
-extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[14];
65
+extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[16];
64 66
 
65 67
 #endif /* AVCODEC_SINEWIN_H */
... ...
@@ -34,9 +34,11 @@
34 34
 #if !CONFIG_HARDCODED_TABLES
35 35
 SINETABLE(  32);
36 36
 SINETABLE(  64);
37
+SINETABLE( 120);
37 38
 SINETABLE( 128);
38 39
 SINETABLE( 256);
39 40
 SINETABLE( 512);
41
+SINETABLE( 960);
40 42
 SINETABLE(1024);
41 43
 SINETABLE(2048);
42 44
 SINETABLE(4096);
... ...
@@ -59,7 +61,8 @@ SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[] = {
59 59
     NULL, NULL, NULL, NULL, NULL, // unused
60 60
     AAC_RENAME(ff_sine_32) , AAC_RENAME(ff_sine_64), AAC_RENAME(ff_sine_128),
61 61
     AAC_RENAME(ff_sine_256), AAC_RENAME(ff_sine_512), AAC_RENAME(ff_sine_1024),
62
-    AAC_RENAME(ff_sine_2048), AAC_RENAME(ff_sine_4096), AAC_RENAME(ff_sine_8192)
62
+    AAC_RENAME(ff_sine_2048), AAC_RENAME(ff_sine_4096), AAC_RENAME(ff_sine_8192),
63
+    AAC_RENAME(ff_sine_120), AAC_RENAME(ff_sine_960),
63 64
 };
64 65
 
65 66
 // Generate a sine window.