aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-06-06 17:33:18 +0200
committerLynne <dev@lynne.ee>2024-06-08 00:22:40 +0200
commit722352333524cb2047d09e2548b495f511de4331 (patch)
treebc77f93ed229fa1d6db3cd4d198856bdb1caf2ea /libavcodec
parent9b41cc04300e8d00ae3a6326639e975712e21bb6 (diff)
downloadffmpeg-722352333524cb2047d09e2548b495f511de4331.tar.gz
aacdec_usac: use correct TNS values
The standard slightly modified the maximum TNS bands allowed.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aac/aacdec_usac.c4
-rw-r--r--libavcodec/aactab.c8
-rw-r--r--libavcodec/aactab.h3
3 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 9173f1b354..edbf0bc1be 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -757,7 +757,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce,
ics->swb_offset = ff_swb_offset_128[usac->rate_idx];
ics->num_swb = ff_aac_num_swb_128[usac->rate_idx];
}
- ics->tns_max_bands = ff_tns_max_bands_128[usac->rate_idx];
+ ics->tns_max_bands = ff_tns_max_bands_usac_128[usac->rate_idx];
/* Setup scalefactor grouping. 7 bit mask. */
ics->num_window_groups = 0;
@@ -780,7 +780,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce,
ics->swb_offset = ff_swb_offset_1024[usac->rate_idx];
ics->num_swb = ff_aac_num_swb_1024[usac->rate_idx];
}
- ics->tns_max_bands = ff_tns_max_bands_1024[usac->rate_idx];
+ ics->tns_max_bands = ff_tns_max_bands_usac_1024[usac->rate_idx];
ics->group_len[0] = 1;
ics->num_window_groups = 1;
diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c
index 7b040531aa..8d4587d241 100644
--- a/libavcodec/aactab.c
+++ b/libavcodec/aactab.c
@@ -1985,6 +1985,10 @@ const uint8_t ff_tns_max_bands_1024[] = {
31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39
};
+const uint8_t ff_tns_max_bands_usac_1024[] = {
+ 31, 31, 34, 40, 42, 51, 47, 47, 43, 43, 43, 40, 40
+};
+
const uint8_t ff_tns_max_bands_512[] = {
0, 0, 0, 31, 32, 37, 31, 31, 0, 0, 0, 0, 0
};
@@ -1996,6 +2000,10 @@ const uint8_t ff_tns_max_bands_480[] = {
const uint8_t ff_tns_max_bands_128[] = {
9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
};
+
+const uint8_t ff_tns_max_bands_usac_128[] = {
+ 9, 9, 10, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15
+};
// @}
const uint8_t ff_usac_noise_fill_start_offset[2][2] = {
diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h
index 8dbb2098c5..84879aa8f8 100644
--- a/libavcodec/aactab.h
+++ b/libavcodec/aactab.h
@@ -115,6 +115,9 @@ extern const uint8_t ff_tns_max_bands_512 [13];
extern const uint8_t ff_tns_max_bands_480 [13];
extern const uint8_t ff_tns_max_bands_128 [13];
+extern const uint8_t ff_tns_max_bands_usac_1024[13];
+extern const uint8_t ff_tns_max_bands_usac_128[13];
+
/* [x][y], x == 1 -> frame len is 768 frames, y == 1 -> is eight_short */
extern const uint8_t ff_usac_noise_fill_start_offset[2][2];