feature: Add 2.5 ms and 5 ms LC3 plus frame durations

fix: Check TNS bitstream data

fix: LTPF Activation with 2.5 ms frame sizes
This commit is contained in:
anonymix007
2023-12-13 10:56:20 -08:00
committed by Antoine Soulier
parent a75f187e00
commit 149cb6537e
43 changed files with 3095 additions and 1628 deletions
+40 -15
View File
@@ -25,29 +25,54 @@
enum lc3_bandwidth lc3_bwdet_run(
enum lc3_dt dt, enum lc3_srate sr, const float *e)
{
/* Bandwidth regions (Table 3.6) */
/* Bandwidth regions */
struct region { int is : 8; int ie : 8; };
static const struct region bws_table[LC3_NUM_DT]
[LC3_NUM_BANDWIDTH-1][LC3_NUM_BANDWIDTH-1] = {
#if !LC3_NPLUS
[LC3_DT_7M5] = {
{ { 51, 63+1 } },
{ { 45, 55+1 }, { 58, 63+1 } },
{ { 42, 51+1 }, { 53, 58+1 }, { 60, 63+1 } },
{ { 40, 48+1 }, { 51, 55+1 }, { 57, 60+1 }, { 61, 63+1 } },
},
static const struct region bws_table_2m5[][LC3_NUM_BANDWIDTH-1] = {
{ { 24, 34+1 } },
{ { 24, 32+1 }, { 35, 39+1 } },
{ { 24, 31+1 }, { 33, 38+1 }, { 39, 42+1 } },
{ { 22, 29+1 }, { 31, 35+1 }, { 37, 40+1 }, { 41, 43+1 } },
};
[LC3_DT_10M] = {
{ { 53, 63+1 } },
{ { 47, 56+1 }, { 59, 63+1 } },
{ { 44, 52+1 }, { 54, 59+1 }, { 60, 63+1 } },
{ { 41, 49+1 }, { 51, 55+1 }, { 57, 60+1 }, { 61, 63+1 } },
},
static const struct region bws_table_5m[][LC3_NUM_BANDWIDTH-1] = {
{ { 39, 49+1 } },
{ { 35, 44+1 }, { 47, 51+1 } },
{ { 34, 42+1 }, { 44, 49+1 }, { 50, 53+1 } },
{ { 32, 40+1 }, { 42, 46+1 }, { 48, 51+1 }, { 52, 54+1 } },
};
#endif /* !LC3_NPLUS */
static const struct region bws_table_7m5[][LC3_NUM_BANDWIDTH-1] = {
{ { 51, 63+1 } },
{ { 45, 55+1 }, { 58, 63+1 } },
{ { 42, 51+1 }, { 53, 58+1 }, { 60, 63+1 } },
{ { 40, 48+1 }, { 51, 55+1 }, { 57, 60+1 }, { 61, 63+1 } },
};
static const struct region bws_table_10m[][LC3_NUM_BANDWIDTH-1] = {
{ { 53, 63+1 } },
{ { 47, 56+1 }, { 59, 63+1 } },
{ { 44, 52+1 }, { 54, 59+1 }, { 60, 63+1 } },
{ { 41, 49+1 }, { 51, 55+1 }, { 57, 60+1 }, { 61, 63+1 } },
};
static const struct region (*bws_table[])[LC3_NUM_BANDWIDTH-1] = {
#if !LC3_NPLUS
[LC3_DT_2M5] = bws_table_2m5,
[LC3_DT_5M ] = bws_table_5m,
#endif /* !LC3_NPLUS */
[LC3_DT_7M5] = bws_table_7m5,
[LC3_DT_10M] = bws_table_10m,
};
static const int l_table[LC3_NUM_DT][LC3_NUM_BANDWIDTH-1] = {
[LC3_DT_2M5] = { 4, 4, 3, 1 },
[LC3_DT_5M ] = { 4, 4, 3, 1 },
[LC3_DT_7M5] = { 4, 4, 3, 2 },
[LC3_DT_10M] = { 4, 4, 3, 1 },
};