summaryrefslogtreecommitdiffstats
path: root/libAACenc/src
diff options
context:
space:
mode:
authorMathias Coinchon <coinchon@yahoo.com>2014-12-23 17:33:12 +0100
committerMathias Coinchon <coinchon@yahoo.com>2014-12-23 17:33:12 +0100
commitbe56dcde84b8d25ff7c06ab464afdb06f3c0e832 (patch)
tree8f577e793b1536e693521427d60fb981cc1b26de /libAACenc/src
parent432c89bd6584497d9c94cd115dbdd00bf60c8177 (diff)
downloadODR-AudioEnc-be56dcde84b8d25ff7c06ab464afdb06f3c0e832.tar.gz
ODR-AudioEnc-be56dcde84b8d25ff7c06ab464afdb06f3c0e832.tar.bz2
ODR-AudioEnc-be56dcde84b8d25ff7c06ab464afdb06f3c0e832.zip
Added missing sampling frequencies for 960 transform. Clarified sfb table list.
Diffstat (limited to 'libAACenc/src')
-rw-r--r--libAACenc/src/aacenc_tns.cpp11
-rw-r--r--libAACenc/src/psy_configuration.cpp104
2 files changed, 104 insertions, 11 deletions
diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp
index eca892e..76de985 100644
--- a/libAACenc/src/aacenc_tns.cpp
+++ b/libAACenc/src/aacenc_tns.cpp
@@ -188,12 +188,17 @@ static const TNS_MAX_TAB_ENTRY tnsMaxBandsTab1024[] =
static const TNS_MAX_TAB_ENTRY tnsMaxBandsTab960[] =
{
+ { 96000, { 31, 9}},
+ { 88200, { 31, 9}},
+ { 64000, { 34, 10}},
{ 48000, { 49, 14}},
{ 44100, { 49, 14}},
{ 32000, { 49, 14}},
{ 24000, { 46, 15}},
- { 22050, { 46, 15}},
- { 16000, { 42, 15}},
+ { 22050, { 46, 14}},
+ { 16000, { 46, 15}},
+ { 12000, { 42, 15}},
+ { 11025, { 42, 15}},
{ 8000, { 40, 15}}
};
@@ -202,7 +207,7 @@ static const TNS_MAX_TAB_ENTRY tnsMaxBandsTab480[] =
{ 48000, { 31, -1}},
{ 44100, { 32, -1}},
{ 32000, { 37, -1}},
- { 24000, { 30, -1}},
+ { 24001, { 30, -1}},
{ 22050, { 30, -1}}
};
diff --git a/libAACenc/src/psy_configuration.cpp b/libAACenc/src/psy_configuration.cpp
index 136e90a..3533231 100644
--- a/libAACenc/src/psy_configuration.cpp
+++ b/libAACenc/src/psy_configuration.cpp
@@ -132,6 +132,27 @@ const SFB_PARAM_SHORT p_FDKaacEnc_8000_short_120 = {
{ 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 12 }
};
+const SFB_PARAM_LONG p_FDKaacEnc_11025_long_960 = {
+ 42,
+ { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24,
+ 24, 28, 28, 32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_11025_short_120 = {
+ 15,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 12 }
+};
+
+const SFB_PARAM_LONG p_FDKaacEnc_12000_long_960 = {
+ 42,
+ { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24,
+ 24, 28, 28, 32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_12000_short_120 = {
+ 15,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 12 }
+};
const SFB_PARAM_LONG p_FDKaacEnc_16000_long_960 = {
42,
@@ -144,6 +165,18 @@ const SFB_PARAM_SHORT p_FDKaacEnc_16000_short_120 = {
{ 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 12 }
};
+const SFB_PARAM_LONG p_FDKaacEnc_22050_long_960 = {
+ 46,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 16, 16, 16,
+ 20, 20, 24, 24, 28, 28, 32, 36, 36, 40, 44, 48, 52, 52,
+ 64, 64, 64, 64 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_22050_short_120 = {
+ 15,
+ { 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 12 }
+};
+
const SFB_PARAM_LONG p_FDKaacEnc_24000_long_960 = {
46,
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8,
@@ -156,11 +189,30 @@ const SFB_PARAM_SHORT p_FDKaacEnc_24000_short_120 = {
{ 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 12 }
};
+const SFB_PARAM_LONG p_FDKaacEnc_32000_long_960 = {
+ 49,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12,
+ 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32 }
+};
+
const SFB_PARAM_SHORT p_FDKaacEnc_32000_short_120 = {
14,
- { 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16 }
+ { 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 8 }
};
+const SFB_PARAM_LONG p_FDKaacEnc_44100_long_960 = {
+ 49,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8,
+ 8, 8, 8, 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28,
+ 28, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32 }
+};
+
+const SFB_PARAM_SHORT p_FDKaacEnc_44100_short_120 = {
+ 14,
+ { 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 8 }
+};
const SFB_PARAM_LONG p_FDKaacEnc_48000_long_960 = {
49,
@@ -174,15 +226,51 @@ const SFB_PARAM_SHORT p_FDKaacEnc_48000_short_120 = {
{ 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 8 }
};
-//TODO: add others
+const SFB_PARAM_LONG p_FDKaacEnc_64000_long_960 = {
+ 46,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 12,
+ 12, 16, 16, 16, 20, 24, 24, 28, 36, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 16 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_64000_short_120 = {
+ 12,
+ { 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 28 }
+};
+
+const SFB_PARAM_LONG p_FDKaacEnc_88200_long_960 = {
+ 40,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 12,
+ 12, 12, 12, 12, 16, 16, 24, 28, 36, 44, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_88200_short_120 = {
+ 12,
+ { 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 28 }
+};
+
+const SFB_PARAM_LONG p_FDKaacEnc_96000_long_960 = {
+ 40,
+ { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 12,
+ 12, 12, 12, 12, 16, 16, 24, 28, 36, 44, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 }
+};
+const SFB_PARAM_SHORT p_FDKaacEnc_96000_short_120 = {
+ 12,
+ { 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 28 }
+};
+
+
static const SFB_INFO_TAB sfbInfoTab960[] = {
{ 8000, &p_FDKaacEnc_8000_long_960, &p_FDKaacEnc_8000_short_120},
+ {11025, &p_FDKaacEnc_11025_long_960, &p_FDKaacEnc_11025_short_120},
+ {12000, &p_FDKaacEnc_12000_long_960, &p_FDKaacEnc_12000_short_120},
{16000, &p_FDKaacEnc_16000_long_960, &p_FDKaacEnc_16000_short_120},
- {22050, &p_FDKaacEnc_24000_long_960, &p_FDKaacEnc_24000_short_120},
+ {22050, &p_FDKaacEnc_22050_long_960, &p_FDKaacEnc_22050_short_120},
{24000, &p_FDKaacEnc_24000_long_960, &p_FDKaacEnc_24000_short_120},
- {32000, &p_FDKaacEnc_48000_long_960, &p_FDKaacEnc_32000_short_120},
- {44100, &p_FDKaacEnc_48000_long_960, &p_FDKaacEnc_48000_short_120},
+ {32000, &p_FDKaacEnc_32000_long_960, &p_FDKaacEnc_32000_short_120},
+ {44100, &p_FDKaacEnc_44100_long_960, &p_FDKaacEnc_44100_short_120},
{48000, &p_FDKaacEnc_48000_long_960, &p_FDKaacEnc_48000_short_120},
+ {64000, &p_FDKaacEnc_64000_long_960, &p_FDKaacEnc_64000_short_120},
+ {88200, &p_FDKaacEnc_88200_long_960, &p_FDKaacEnc_88200_short_120},
+ {96000, &p_FDKaacEnc_96000_long_960, &p_FDKaacEnc_96000_short_120},
};
@@ -378,13 +466,13 @@ static FIXP_DBL FDKaacEnc_BarcLineValue(INT noOfLines, INT fftLine, LONG samplin
center_freq = center_freq << 2; /* q13 */
break;
case 960:
- center_freq = fMult(center_freq, INV480) << 3;
+ center_freq = fMult(center_freq, INV480) << 3;
break;
case 128:
center_freq = center_freq << 5; /* q13 */
break;
case 120:
- center_freq = fMult(center_freq, INV480) << 6;
+ center_freq = fMult(center_freq, INV480) << 6;
break;
case 512:
center_freq = (fftLine * samplingFreq) << 3; // q13
@@ -582,7 +670,7 @@ static void FDKaacEnc_initMinSnr(const LONG bitrate,
pePerWindow = fMult(pePerWindow, FL2FXCONST_DBL(480.f/512.f));
break;
case 960:
- pePerWindow = fMult(pePerWindow, FL2FXCONST_DBL(960.f/1024.f));
+ pePerWindow = fMult(pePerWindow, FL2FXCONST_DBL(960.f/1024.f));
qperwin = qperwin - 10;
break;
case 120: