The standard slightly modified the maximum TNS bands allowed.
Unified · Split
| @@ -757,7 +757,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce, · 756 unmodified lines | |||
| 757 | ics->swb_offset = ff_swb_offset_128[usac->rate_idx]; | 757 | ics->swb_offset = ff_swb_offset_128[usac->rate_idx]; |
| 758 | ics->num_swb = ff_aac_num_swb_128[usac->rate_idx]; | 758 | ics->num_swb = ff_aac_num_swb_128[usac->rate_idx]; |
| 759 | } | 759 | } |
| 760 | ics->tns_max_bands = ff_tns_max_bands_128[usac->rate_idx]; | 760 | ics->tns_max_bands = ff_tns_max_bands_usac_128[usac->rate_idx]; |
| 761 | 761 | ||
| 762 | /* Setup scalefactor grouping. 7 bit mask. */ | 762 | /* Setup scalefactor grouping. 7 bit mask. */ |
| 763 | ics->num_window_groups = 0; | 763 | ics->num_window_groups = 0; |
| @@ -780,7 +780,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce, · 16 unmodified lines | |||
| 780 | ics->swb_offset = ff_swb_offset_1024[usac->rate_idx]; | 780 | ics->swb_offset = ff_swb_offset_1024[usac->rate_idx]; |
| 781 | ics->num_swb = ff_aac_num_swb_1024[usac->rate_idx]; | 781 | ics->num_swb = ff_aac_num_swb_1024[usac->rate_idx]; |
| 782 | } | 782 | } |
| 783 | ics->tns_max_bands = ff_tns_max_bands_1024[usac->rate_idx]; | 783 | ics->tns_max_bands = ff_tns_max_bands_usac_1024[usac->rate_idx]; |
| 784 | 784 | ||
| 785 | ics->group_len[0] = 1; | 785 | ics->group_len[0] = 1; |
| 786 | ics->num_window_groups = 1; | 786 | ics->num_window_groups = 1; |
| @@ -1985,6 +1985,10 @@ const uint8_t ff_tns_max_bands_1024[] = { · 1984 unmodified lines | |||
| 1985 | 31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39 | 1985 | 31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39 |
| 1986 | }; | 1986 | }; |
| 1987 | 1987 | ||
| 1988 | const uint8_t ff_tns_max_bands_usac_1024[] = { | ||
| 1989 | 31, 31, 34, 40, 42, 51, 47, 47, 43, 43, 43, 40, 40 | ||
| 1990 | }; | ||
| 1991 | |||
| 1988 | const uint8_t ff_tns_max_bands_512[] = { | 1992 | const uint8_t ff_tns_max_bands_512[] = { |
| 1989 | 0, 0, 0, 31, 32, 37, 31, 31, 0, 0, 0, 0, 0 | 1993 | 0, 0, 0, 31, 32, 37, 31, 31, 0, 0, 0, 0, 0 |
| 1990 | }; | 1994 | }; |
| @@ -1996,6 +2000,10 @@ const uint8_t ff_tns_max_bands_480[] = { · 5 unmodified lines | |||
| 1996 | const uint8_t ff_tns_max_bands_128[] = { | 2000 | const uint8_t ff_tns_max_bands_128[] = { |
| 1997 | 9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 | 2001 | 9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 |
| 1998 | }; | 2002 | }; |
| 2003 | |||
| 2004 | const uint8_t ff_tns_max_bands_usac_128[] = { | ||
| 2005 | 9, 9, 10, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15 | ||
| 2006 | }; | ||
| 1999 | // @} | 2007 | // @} |
| 2000 | 2008 | ||
| 2001 | const uint8_t ff_usac_noise_fill_start_offset[2][2] = { | 2009 | const uint8_t ff_usac_noise_fill_start_offset[2][2] = { |
| @@ -115,6 +115,9 @@ extern const uint8_t ff_tns_max_bands_512 [13]; · 114 unmodified lines | |||
| 115 | extern const uint8_t ff_tns_max_bands_480 [13]; | 115 | extern const uint8_t ff_tns_max_bands_480 [13]; |
| 116 | extern const uint8_t ff_tns_max_bands_128 [13]; | 116 | extern const uint8_t ff_tns_max_bands_128 [13]; |
| 117 | 117 | ||
| 118 | extern const uint8_t ff_tns_max_bands_usac_1024[13]; | ||
| 119 | extern const uint8_t ff_tns_max_bands_usac_128[13]; | ||
| 120 | |||
| 118 | /* [x][y], x == 1 -> frame len is 768 frames, y == 1 -> is eight_short */ | 121 | /* [x][y], x == 1 -> frame len is 768 frames, y == 1 -> is eight_short */ |
| 119 | extern const uint8_t ff_usac_noise_fill_start_offset[2][2]; | 122 | extern const uint8_t ff_usac_noise_fill_start_offset[2][2]; |
| 120 | 123 | ||