You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9569 lines
395 KiB

  1. From 0fc0e0e0b89de3becd5f099eae725f13eeecc0d1 Mon Sep 17 00:00:00 2001
  2. From: Wim Taymans <wtaymans@redhat.com>
  3. Date: Tue, 25 Jun 2019 11:43:16 +0200
  4. Subject: Remove USAC
  5. ---
  6. Makefile.am | 9 +-
  7. Makefile.vc | 9 +-
  8. libAACdec/src/aacdecoder.cpp | 34 +-
  9. libAACdec/src/block.cpp | 163 ---
  10. libAACdec/src/channel.cpp | 70 +-
  11. libAACdec/src/channelinfo.h | 91 --
  12. libAACdec/src/usacdec_ace_d4t64.cpp | 439 --------
  13. libAACdec/src/usacdec_ace_d4t64.h | 117 --
  14. libAACdec/src/usacdec_ace_ltp.cpp | 229 ----
  15. libAACdec/src/usacdec_ace_ltp.h | 128 ---
  16. libAACdec/src/usacdec_acelp.cpp | 1296 ----------------------
  17. libAACdec/src/usacdec_acelp.h | 281 -----
  18. libAACdec/src/usacdec_const.h | 203 ----
  19. libAACdec/src/usacdec_fac.cpp | 745 -------------
  20. libAACdec/src/usacdec_fac.h | 191 ----
  21. libAACdec/src/usacdec_lpc.cpp | 1194 ---------------------
  22. libAACdec/src/usacdec_lpc.h | 190 ----
  23. libAACdec/src/usacdec_lpd.cpp | 2017 -----------------------------------
  24. libAACdec/src/usacdec_lpd.h | 198 ----
  25. libAACdec/src/usacdec_rom.cpp | 1504 --------------------------
  26. libAACdec/src/usacdec_rom.h | 154 ---
  27. 22 files changed, 6 insertions(+), 9258 deletions(-)
  28. delete mode 100644 libAACdec/src/usacdec_ace_d4t64.cpp
  29. delete mode 100644 libAACdec/src/usacdec_ace_d4t64.h
  30. delete mode 100644 libAACdec/src/usacdec_ace_ltp.cpp
  31. delete mode 100644 libAACdec/src/usacdec_ace_ltp.h
  32. delete mode 100644 libAACdec/src/usacdec_acelp.cpp
  33. delete mode 100644 libAACdec/src/usacdec_acelp.h
  34. delete mode 100644 libAACdec/src/usacdec_const.h
  35. delete mode 100644 libAACdec/src/usacdec_fac.cpp
  36. delete mode 100644 libAACdec/src/usacdec_fac.h
  37. delete mode 100644 libAACdec/src/usacdec_lpc.cpp
  38. delete mode 100644 libAACdec/src/usacdec_lpc.h
  39. delete mode 100644 libAACdec/src/usacdec_lpd.cpp
  40. delete mode 100644 libAACdec/src/usacdec_lpd.h
  41. delete mode 100644 libAACdec/src/usacdec_rom.cpp
  42. delete mode 100644 libAACdec/src/usacdec_rom.h
  43. diff --git a/Makefile.am b/Makefile.am
  44. index 1550d95..d5fd180 100644
  45. --- a/Makefile.am
  46. +++ b/Makefile.am
  47. @@ -57,14 +57,7 @@ AACDEC_SRC = \
  48. libAACdec/src/channelinfo.cpp \
  49. libAACdec/src/ldfiltbank.cpp \
  50. libAACdec/src/pulsedata.cpp \
  51. - libAACdec/src/stereo.cpp \
  52. - libAACdec/src/usacdec_ace_d4t64.cpp \
  53. - libAACdec/src/usacdec_ace_ltp.cpp \
  54. - libAACdec/src/usacdec_acelp.cpp \
  55. - libAACdec/src/usacdec_fac.cpp \
  56. - libAACdec/src/usacdec_lpc.cpp \
  57. - libAACdec/src/usacdec_lpd.cpp \
  58. - libAACdec/src/usacdec_rom.cpp
  59. + libAACdec/src/stereo.cpp
  60. AACENC_SRC = \
  61. libAACenc/src/aacEnc_ram.cpp \
  62. diff --git a/Makefile.vc b/Makefile.vc
  63. index 54f3744..c236c15 100644
  64. --- a/Makefile.vc
  65. +++ b/Makefile.vc
  66. @@ -41,14 +41,7 @@ AACDEC_SRC = \
  67. libAACdec/src/channelinfo.cpp \
  68. libAACdec/src/ldfiltbank.cpp \
  69. libAACdec/src/pulsedata.cpp \
  70. - libAACdec/src/stereo.cpp \
  71. - libAACdec/src/usacdec_ace_d4t64.cpp \
  72. - libAACdec/src/usacdec_ace_ltp.cpp \
  73. - libAACdec/src/usacdec_acelp.cpp \
  74. - libAACdec/src/usacdec_fac.cpp \
  75. - libAACdec/src/usacdec_lpc.cpp \
  76. - libAACdec/src/usacdec_lpd.cpp \
  77. - libAACdec/src/usacdec_rom.cpp
  78. + libAACdec/src/stereo.cpp
  79. AACENC_SRC = \
  80. libAACenc/src/aacEnc_ram.cpp \
  81. diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
  82. index cc3e245..cd57500 100644
  83. --- a/libAACdec/src/aacdecoder.cpp
  84. +++ b/libAACdec/src/aacdecoder.cpp
  85. @@ -161,8 +161,6 @@ amm-info@iis.fraunhofer.de
  86. #include "aacdec_pns.h"
  87. -#include "usacdec_lpd.h"
  88. -
  89. #include "ac_arith_coder.h"
  90. #include "tpdec_lib.h"
  91. @@ -1942,17 +1940,6 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
  92. goto bail;
  93. }
  94. }
  95. - if (elCh > 0) {
  96. - self->pAacDecoderStaticChannelInfo[ch - elCh]->nfRandomSeed =
  97. - (ULONG)0x3039;
  98. - if (self->elements[el2] == ID_USAC_CPE) {
  99. - if (asc->m_sc.m_usacConfig.element[el2].m_stereoConfigIndex !=
  100. - 1) {
  101. - self->pAacDecoderStaticChannelInfo[ch - elCh + 1]
  102. - ->nfRandomSeed = (ULONG)0x10932;
  103. - }
  104. - }
  105. - }
  106. } /* for each element */
  107. }
  108. @@ -2010,11 +1997,6 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
  109. self->pAacDecoderStaticChannelInfo[ch]->pOverlapBuffer,
  110. OverlapBufferSize);
  111. - self->pAacDecoderStaticChannelInfo[ch]->last_core_mode = FD_LONG;
  112. - self->pAacDecoderStaticChannelInfo[ch]->last_lpd_mode = 255;
  113. -
  114. - self->pAacDecoderStaticChannelInfo[ch]->last_tcx_pitch = L_DIV;
  115. -
  116. /* Reset DRC control data for this channel */
  117. aacDecoder_drcInitChannelData(
  118. &self->pAacDecoderStaticChannelInfo[ch]->drcData);
  119. @@ -2893,10 +2875,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
  120. (self->frameOK && !(flags & AACDEC_CONCEAL));
  121. const int icsIsInvalid = (GetScaleFactorBandsTransmitted(pIcsInfo) >
  122. GetScaleFactorBandsTotal(pIcsInfo));
  123. - const int icsInfoUsedinFadeOut =
  124. - !(pAacDecoderChannelInfo->renderMode == AACDEC_RENDER_LPD &&
  125. - pAacDecoderStaticChannelInfo->last_lpd_mode == 0);
  126. - if (icsInfoUsedinFadeOut && icsIsInvalid && !mute_release_active) {
  127. + if (icsIsInvalid && !mute_release_active) {
  128. self->frameOK = 0;
  129. }
  130. }
  131. @@ -2956,16 +2935,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
  132. 2;
  133. } break;
  134. case AACDEC_RENDER_LPD:
  135. -
  136. - CLpd_RenderTimeSignal(
  137. - pAacDecoderStaticChannelInfo, pAacDecoderChannelInfo,
  138. - pTimeData + offset, self->streamInfo.aacSamplesPerFrame,
  139. - &self->samplingRateInfo[streamIndex],
  140. - (self->frameOK && !(flags & AACDEC_CONCEAL) &&
  141. - !frameOk_butConceal),
  142. - flags, self->flags[streamIndex]);
  143. -
  144. - self->extGainDelay = self->streamInfo.aacSamplesPerFrame;
  145. + ErrorStatus = AAC_DEC_UNKNOWN;
  146. break;
  147. default:
  148. ErrorStatus = AAC_DEC_UNKNOWN;
  149. diff --git a/libAACdec/src/block.cpp b/libAACdec/src/block.cpp
  150. index a394cd7..b8ca877 100644
  151. --- a/libAACdec/src/block.cpp
  152. +++ b/libAACdec/src/block.cpp
  153. @@ -107,9 +107,6 @@ amm-info@iis.fraunhofer.de
  154. #include "scale.h"
  155. #include "FDK_tools_rom.h"
  156. -#include "usacdec_fac.h"
  157. -#include "usacdec_lpd.h"
  158. -#include "usacdec_lpc.h"
  159. #include "FDK_trigFcts.h"
  160. #include "ac_arith_coder.h"
  161. @@ -1010,162 +1007,7 @@ void CBlock_FrequencyToTime(
  162. nSpec = 8;
  163. break;
  164. }
  165. -
  166. {
  167. - int last_frame_lost = pAacDecoderStaticChannelInfo->last_lpc_lost;
  168. -
  169. - if (pAacDecoderStaticChannelInfo->last_core_mode == LPD) {
  170. - INT fac_FB = 1;
  171. - if (elFlags & AC_EL_FULLBANDLPD) {
  172. - fac_FB = 2;
  173. - }
  174. -
  175. - FIXP_DBL *synth;
  176. -
  177. - /* Keep some free space at the beginning of the buffer. To be used for
  178. - * past data */
  179. - if (!(elFlags & AC_EL_LPDSTEREOIDX)) {
  180. - synth = pWorkBuffer1 + ((PIT_MAX_MAX - (1 * L_SUBFR)) * fac_FB);
  181. - } else {
  182. - synth = pWorkBuffer1 + PIT_MAX_MAX * fac_FB;
  183. - }
  184. -
  185. - int fac_length =
  186. - (pAacDecoderChannelInfo->icsInfo.WindowSequence == BLOCK_SHORT)
  187. - ? (frameLen >> 4)
  188. - : (frameLen >> 3);
  189. -
  190. - INT pitch[NB_SUBFR_SUPERFR + SYN_SFD];
  191. - FIXP_DBL pit_gain[NB_SUBFR_SUPERFR + SYN_SFD];
  192. -
  193. - int nbDiv = (elFlags & AC_EL_FULLBANDLPD) ? 2 : 4;
  194. - int lFrame = (elFlags & AC_EL_FULLBANDLPD) ? frameLen / 2 : frameLen;
  195. - int nbSubfr =
  196. - lFrame / (nbDiv * L_SUBFR); /* number of subframes per division */
  197. - int LpdSfd = (nbDiv * nbSubfr) >> 1;
  198. - int SynSfd = LpdSfd - BPF_SFD;
  199. -
  200. - FDKmemclear(
  201. - pitch,
  202. - sizeof(
  203. - pitch)); // added to prevent ferret errors in bass_pf_1sf_delay
  204. - FDKmemclear(pit_gain, sizeof(pit_gain));
  205. -
  206. - /* FAC case */
  207. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 0 ||
  208. - pAacDecoderStaticChannelInfo->last_lpd_mode == 4) {
  209. - FIXP_DBL fac_buf[LFAC];
  210. - FIXP_LPC *A = pAacDecoderChannelInfo->data.usac.lp_coeff[0];
  211. -
  212. - if (!frameOk || last_frame_lost ||
  213. - (pAacDecoderChannelInfo->data.usac.fac_data[0] == NULL)) {
  214. - FDKmemclear(fac_buf,
  215. - pAacDecoderChannelInfo->granuleLength * sizeof(FIXP_DBL));
  216. - pAacDecoderChannelInfo->data.usac.fac_data[0] = fac_buf;
  217. - pAacDecoderChannelInfo->data.usac.fac_data_e[0] = 0;
  218. - }
  219. -
  220. - INT A_exp; /* linear prediction coefficients exponent */
  221. - {
  222. - for (int i = 0; i < M_LP_FILTER_ORDER; i++) {
  223. - A[i] = FX_DBL2FX_LPC(fixp_cos(
  224. - fMult(pAacDecoderStaticChannelInfo->lpc4_lsf[i],
  225. - FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  226. - LSF_SCALE - LSPARG_SCALE));
  227. - }
  228. -
  229. - E_LPC_f_lsp_a_conversion(A, A, &A_exp);
  230. - }
  231. -
  232. -#if defined(FDK_ASSERT_ENABLE)
  233. - nSamples =
  234. -#endif
  235. - CLpd_FAC_Acelp2Mdct(
  236. - &pAacDecoderStaticChannelInfo->IMdct, synth,
  237. - SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
  238. - pAacDecoderChannelInfo->specScale, nSpec,
  239. - pAacDecoderChannelInfo->data.usac.fac_data[0],
  240. - pAacDecoderChannelInfo->data.usac.fac_data_e[0], fac_length,
  241. - frameLen, tl,
  242. - FDKgetWindowSlope(
  243. - fr, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  244. - fr, A, A_exp, &pAacDecoderStaticChannelInfo->acelp,
  245. - (FIXP_DBL)0, /* FAC gain has already been applied. */
  246. - (last_frame_lost || !frameOk), 1,
  247. - pAacDecoderStaticChannelInfo->last_lpd_mode, 0,
  248. - pAacDecoderChannelInfo->currAliasingSymmetry);
  249. -
  250. - } else {
  251. -#if defined(FDK_ASSERT_ENABLE)
  252. - nSamples =
  253. -#endif
  254. - imlt_block(
  255. - &pAacDecoderStaticChannelInfo->IMdct, synth,
  256. - SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
  257. - pAacDecoderChannelInfo->specScale, nSpec, frameLen, tl,
  258. - FDKgetWindowSlope(
  259. - fl, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  260. - fl,
  261. - FDKgetWindowSlope(
  262. - fr, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  263. - fr, (FIXP_DBL)0,
  264. - pAacDecoderChannelInfo->currAliasingSymmetry
  265. - ? MLT_FLAG_CURR_ALIAS_SYMMETRY
  266. - : 0);
  267. - }
  268. - FDK_ASSERT(nSamples == frameLen);
  269. -
  270. - /* The "if" clause is entered both for fullbandLpd mono and
  271. - * non-fullbandLpd*. The "else"-> just for fullbandLpd stereo*/
  272. - if (!(elFlags & AC_EL_LPDSTEREOIDX)) {
  273. - FDKmemcpy(pitch, pAacDecoderStaticChannelInfo->old_T_pf,
  274. - SynSfd * sizeof(INT));
  275. - FDKmemcpy(pit_gain, pAacDecoderStaticChannelInfo->old_gain_pf,
  276. - SynSfd * sizeof(FIXP_DBL));
  277. -
  278. - for (int i = SynSfd; i < LpdSfd + 3; i++) {
  279. - pitch[i] = L_SUBFR;
  280. - pit_gain[i] = (FIXP_DBL)0;
  281. - }
  282. -
  283. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 0) {
  284. - pitch[SynSfd] = pitch[SynSfd - 1];
  285. - pit_gain[SynSfd] = pit_gain[SynSfd - 1];
  286. - if (IsLongBlock(&pAacDecoderChannelInfo->icsInfo)) {
  287. - pitch[SynSfd + 1] = pitch[SynSfd];
  288. - pit_gain[SynSfd + 1] = pit_gain[SynSfd];
  289. - }
  290. - }
  291. -
  292. - /* Copy old data to the beginning of the buffer */
  293. - {
  294. - FDKmemcpy(
  295. - pWorkBuffer1, pAacDecoderStaticChannelInfo->old_synth,
  296. - ((PIT_MAX_MAX - (1 * L_SUBFR)) * fac_FB) * sizeof(FIXP_DBL));
  297. - }
  298. -
  299. - FIXP_DBL *p2_synth = pWorkBuffer1 + (PIT_MAX_MAX * fac_FB);
  300. -
  301. - /* recalculate pitch gain to allow postfilering on FAC area */
  302. - for (int i = 0; i < SynSfd + 2; i++) {
  303. - int T = pitch[i];
  304. - FIXP_DBL gain = pit_gain[i];
  305. -
  306. - if (gain > (FIXP_DBL)0) {
  307. - gain = get_gain(&p2_synth[i * L_SUBFR * fac_FB],
  308. - &p2_synth[(i * L_SUBFR * fac_FB) - fac_FB * T],
  309. - L_SUBFR * fac_FB);
  310. - pit_gain[i] = gain;
  311. - }
  312. - }
  313. -
  314. - bass_pf_1sf_delay(p2_synth, pitch, pit_gain, frameLen,
  315. - (LpdSfd + 2) * L_SUBFR + BPF_SFD * L_SUBFR,
  316. - frameLen - (LpdSfd + 4) * L_SUBFR, outSamples,
  317. - pAacDecoderStaticChannelInfo->mem_bpf);
  318. - }
  319. -
  320. - } else /* last_core_mode was not LPD */
  321. {
  322. FIXP_DBL *tmp =
  323. pAacDecoderChannelInfo->pComStaticData->pWorkBufferCore1->mdctOutTemp;
  324. @@ -1190,11 +1032,6 @@ void CBlock_FrequencyToTime(
  325. }
  326. FDK_ASSERT(nSamples == frameLen);
  327. -
  328. - pAacDecoderStaticChannelInfo->last_core_mode =
  329. - (pAacDecoderChannelInfo->icsInfo.WindowSequence == BLOCK_SHORT) ? FD_SHORT
  330. - : FD_LONG;
  331. - pAacDecoderStaticChannelInfo->last_lpd_mode = 255;
  332. }
  333. #include "ldfiltbank.h"
  334. diff --git a/libAACdec/src/channel.cpp b/libAACdec/src/channel.cpp
  335. index e17ccf4..fe63756 100644
  336. --- a/libAACdec/src/channel.cpp
  337. +++ b/libAACdec/src/channel.cpp
  338. @@ -106,9 +106,6 @@ amm-info@iis.fraunhofer.de
  339. #include "aacdec_tns.h"
  340. #include "FDK_bitstream.h"
  341. -#include "usacdec_lpd.h"
  342. -#include "usacdec_fac.h"
  343. -
  344. static void MapMidSideMaskToPnsCorrelation(
  345. CAacDecoderChannelInfo *pAacDecoderChannelInfo[2]) {
  346. int group;
  347. @@ -164,13 +161,6 @@ void CChannelElement_Decode(
  348. int maxSfBandsL = 0, maxSfBandsR = 0;
  349. int maybe_jstereo = (el_channels > 1);
  350. - if (flags & (AC_USAC | AC_RSVD50 | AC_RSV603DA) && el_channels == 2) {
  351. - if (pAacDecoderChannelInfo[L]->data.usac.core_mode ||
  352. - pAacDecoderChannelInfo[R]->data.usac.core_mode) {
  353. - maybe_jstereo = 0;
  354. - }
  355. - }
  356. -
  357. if (maybe_jstereo) {
  358. maxSfBandsL =
  359. GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo[L]->icsInfo);
  360. @@ -236,9 +226,6 @@ void CChannelElement_Decode(
  361. for (ch = 0; ch < el_channels; ch++) {
  362. if (pAacDecoderChannelInfo[ch]->renderMode == AACDEC_RENDER_LPD) {
  363. - /* Decode LPD data */
  364. - CLpdChannelStream_Decode(pAacDecoderChannelInfo[ch],
  365. - pAacDecoderStaticChannelInfo[ch], flags);
  366. } else {
  367. UCHAR noSfbs =
  368. GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo[ch]->icsInfo);
  369. @@ -651,13 +638,6 @@ AAC_DECODER_ERROR CChannelElement_Read(
  370. break;
  371. case core_mode:
  372. decision_bit = FDKreadBits(hBs, 1);
  373. - pAacDecoderChannelInfo[ch]->data.usac.core_mode = decision_bit;
  374. - if ((ch == 1) && (pAacDecoderChannelInfo[0]->data.usac.core_mode !=
  375. - pAacDecoderChannelInfo[1]->data.usac.core_mode)) {
  376. - /* StereoCoreToolInfo(core_mode[ch] ) */
  377. - pAacDecoderChannelInfo[0]->pDynData->RawDataInfo.CommonWindow = 0;
  378. - pAacDecoderChannelInfo[1]->pDynData->RawDataInfo.CommonWindow = 0;
  379. - }
  380. break;
  381. case tns_active:
  382. pAacDecoderChannelInfo[0]->pDynData->specificTo.usac.tns_active =
  383. @@ -671,53 +651,12 @@ AAC_DECODER_ERROR CChannelElement_Read(
  384. }
  385. break;
  386. case lpd_channel_stream:
  387. -
  388. - {
  389. - error = CLpdChannelStream_Read(/* = lpd_channel_stream() */
  390. - hBs, pAacDecoderChannelInfo[ch],
  391. - pAacDecoderStaticChannelInfo[ch],
  392. - pSamplingRateInfo, flags);
  393. - }
  394. -
  395. pAacDecoderChannelInfo[ch]->renderMode = AACDEC_RENDER_LPD;
  396. break;
  397. case fac_data: {
  398. int fFacDatPresent = FDKreadBit(hBs);
  399. - /* Wee need a valid fac_data[0] even if no FAC data is present (as
  400. - * temporal buffer) */
  401. - pAacDecoderChannelInfo[ch]->data.usac.fac_data[0] =
  402. - pAacDecoderChannelInfo[ch]->data.usac.fac_data0;
  403. -
  404. - if (fFacDatPresent) {
  405. - if (elFlags & AC_EL_LFE) {
  406. - error = AAC_DEC_PARSE_ERROR;
  407. - break;
  408. - }
  409. - /* FAC data present, this frame is FD, so the last mode had to be
  410. - * ACELP. */
  411. - if (pAacDecoderStaticChannelInfo[ch]->last_core_mode != LPD ||
  412. - pAacDecoderStaticChannelInfo[ch]->last_lpd_mode != 0) {
  413. - pAacDecoderChannelInfo[ch]->data.usac.core_mode_last = LPD;
  414. - pAacDecoderChannelInfo[ch]->data.usac.lpd_mode_last = 0;
  415. - /* We can't change the past! So look to the future and go ahead! */
  416. - }
  417. - CLpd_FAC_Read(hBs, pAacDecoderChannelInfo[ch]->data.usac.fac_data[0],
  418. - pAacDecoderChannelInfo[ch]->data.usac.fac_data_e,
  419. - CLpd_FAC_getLength(
  420. - IsLongBlock(&pAacDecoderChannelInfo[ch]->icsInfo),
  421. - pAacDecoderChannelInfo[ch]->granuleLength),
  422. - 1, 0);
  423. - } else {
  424. - if (pAacDecoderStaticChannelInfo[ch]->last_core_mode == LPD &&
  425. - pAacDecoderStaticChannelInfo[ch]->last_lpd_mode == 0) {
  426. - /* ACELP to FD transitons without FAC are possible. That is why we
  427. - zero it out (i.e FAC will not be considered in the subsequent
  428. - calculations */
  429. - FDKmemclear(pAacDecoderChannelInfo[ch]->data.usac.fac_data0,
  430. - LFAC * sizeof(FIXP_DBL));
  431. - }
  432. - }
  433. + error = AAC_DEC_PARSE_ERROR;
  434. } break;
  435. case esc2_rvlc:
  436. if (flags & AC_ER_RVLC) {
  437. @@ -887,13 +826,6 @@ AAC_DECODER_ERROR CChannelElement_Read(
  438. if (error != AAC_DEC_OK) {
  439. return error;
  440. }
  441. -
  442. - if (elFlags & AC_EL_USAC_NOISE) {
  443. - CBlock_ApplyNoise(pAacDecoderChannelInfo[ch], pSamplingRateInfo,
  444. - &pAacDecoderStaticChannelInfo[ch]->nfRandomSeed,
  445. - band_is_noise);
  446. -
  447. - } /* if (elFlags & AC_EL_USAC_NOISE) */
  448. }
  449. }
  450. diff --git a/libAACdec/src/channelinfo.h b/libAACdec/src/channelinfo.h
  451. index 04f0012..42c8298 100644
  452. --- a/libAACdec/src/channelinfo.h
  453. +++ b/libAACdec/src/channelinfo.h
  454. @@ -117,10 +117,6 @@ amm-info@iis.fraunhofer.de
  455. #include "aacdec_pns.h"
  456. -#include "usacdec_acelp.h"
  457. -#include "usacdec_const.h"
  458. -#include "usacdec_rom.h"
  459. -
  460. #include "ac_arith_coder.h"
  461. #include "aacdec_drc_types.h"
  462. @@ -202,55 +198,6 @@ typedef struct {
  463. INT pnsCurrentSeed;
  464. - /* LPD memory */
  465. - FIXP_DBL old_synth[PIT_MAX_MAX - L_SUBFR];
  466. - INT old_T_pf[SYN_SFD];
  467. - FIXP_DBL old_gain_pf[SYN_SFD];
  468. - FIXP_DBL mem_bpf[L_FILT + L_SUBFR];
  469. - UCHAR
  470. - old_bpf_control_info; /* (1: enable, 0: disable) bpf for past superframe
  471. - */
  472. -
  473. - USAC_COREMODE last_core_mode; /* core mode used by the decoder in previous
  474. - frame. (not signalled by the bitstream, see
  475. - CAacDecoderChannelInfo::core_mode_last !! )
  476. - */
  477. - UCHAR last_lpd_mode; /* LPD mode used by the decoder in last LPD subframe
  478. - (not signalled by the bitstream, see
  479. - CAacDecoderChannelInfo::lpd_mode_last !! ) */
  480. - UCHAR last_last_lpd_mode; /* LPD mode used in second last LPD subframe
  481. - (not signalled by the bitstream) */
  482. - UCHAR last_lpc_lost; /* Flag indicating that the previous LPC is lost */
  483. -
  484. - FIXP_LPC
  485. - lpc4_lsf[M_LP_FILTER_ORDER]; /* Last LPC4 coefficients in LSF domain. */
  486. - FIXP_LPC lsf_adaptive_mean[M_LP_FILTER_ORDER]; /* Adaptive mean of LPC
  487. - coefficients in LSF domain
  488. - for concealment. */
  489. - FIXP_LPC lp_coeff_old[2][M_LP_FILTER_ORDER]; /* Last LPC coefficients in LP
  490. - domain. lp_coeff_old[0] is lpc4 (coeffs for
  491. - right folding point of last tcx frame),
  492. - lp_coeff_old[1] are coeffs for left folding
  493. - point of last tcx frame */
  494. - INT lp_coeff_old_exp[2];
  495. -
  496. - FIXP_SGL
  497. - oldStability; /* LPC coeff stability value from last frame (required for
  498. - TCX concealment). */
  499. - UINT numLostLpdFrames; /* Number of consecutive lost subframes. */
  500. -
  501. - /* TCX memory */
  502. - FIXP_DBL last_tcx_gain;
  503. - INT last_tcx_gain_e;
  504. - FIXP_DBL last_alfd_gains[32]; /* Scaled by one bit. */
  505. - SHORT last_tcx_pitch;
  506. - UCHAR last_tcx_noise_factor;
  507. -
  508. - /* ACELP memory */
  509. - CAcelpStaticMem acelp;
  510. -
  511. - ULONG nfRandomSeed; /* seed value for USAC noise filling random generator */
  512. -
  513. CDrcChannelData drcData;
  514. CpePersistentData *pCpeStaticData;
  515. @@ -299,8 +246,6 @@ typedef shouldBeUnion {
  516. * used anymore. */
  517. FIXP_DBL mdctOutTemp[1024];
  518. - FIXP_DBL synth_buf[(PIT_MAX_MAX + SYN_DELAY + L_FRAME_PLUS)];
  519. -
  520. FIXP_DBL workBuffer[WB_SECTION_SIZE];
  521. }
  522. CWorkBufferCore1;
  523. @@ -335,42 +280,6 @@ typedef struct {
  524. */
  525. typedef struct {
  526. shouldBeUnion {
  527. - struct {
  528. - FIXP_DBL fac_data0[LFAC];
  529. - SCHAR fac_data_e[4];
  530. - FIXP_DBL
  531. - *fac_data[4]; /* Pointers to unused parts of pSpectralCoefficient */
  532. -
  533. - UCHAR core_mode; /* current core mode */
  534. - USAC_COREMODE
  535. - core_mode_last; /* previous core mode, signalled in the bitstream
  536. - (not done by the decoder, see
  537. - CAacDecoderStaticChannelInfo::last_core_mode !!)*/
  538. - UCHAR lpd_mode_last; /* previous LPD mode, signalled in the bitstream
  539. - (not done by the decoder, see
  540. - CAacDecoderStaticChannelInfo::last_core_mode !!)*/
  541. - UCHAR mod[4];
  542. - UCHAR bpf_control_info; /* (1: enable, 0: disable) bpf for current
  543. - superframe */
  544. -
  545. - FIXP_LPC lsp_coeff[5][M_LP_FILTER_ORDER]; /* linear prediction
  546. - coefficients in LSP domain */
  547. - FIXP_LPC
  548. - lp_coeff[5][M_LP_FILTER_ORDER]; /* linear prediction coefficients in
  549. - LP domain */
  550. - INT lp_coeff_exp[5];
  551. - FIXP_LPC lsf_adaptive_mean_cand
  552. - [M_LP_FILTER_ORDER]; /* concealment: is copied to
  553. - CAacDecoderStaticChannelInfo->lsf_adaptive_mean once frame is
  554. - assumed to be correct*/
  555. - FIXP_SGL aStability[4]; /* LPC coeff stability values required for ACELP
  556. - and TCX (concealment) */
  557. -
  558. - CAcelpChannelData acelp[4];
  559. -
  560. - FIXP_DBL tcx_gain[4];
  561. - SCHAR tcx_gain_e[4];
  562. - } usac;
  563. struct {
  564. CPnsData PnsData; /* Not required for USAC */
  565. diff --git a/libAACdec/src/usacdec_ace_d4t64.cpp b/libAACdec/src/usacdec_ace_d4t64.cpp
  566. deleted file mode 100644
  567. index 43e06cd..0000000
  568. --- a/libAACdec/src/usacdec_ace_d4t64.cpp
  569. +++ /dev/null
  570. @@ -1,439 +0,0 @@
  571. -/* -----------------------------------------------------------------------------
  572. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  573. -
  574. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  575. -Forschung e.V. All rights reserved.
  576. -
  577. - 1. INTRODUCTION
  578. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  579. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  580. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  581. -a wide variety of Android devices.
  582. -
  583. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  584. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  585. -full-bandwidth communications codec by independent studies and is widely
  586. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  587. -specifications.
  588. -
  589. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  590. -those of Fraunhofer) may be obtained through Via Licensing
  591. -(www.vialicensing.com) or through the respective patent owners individually for
  592. -the purpose of encoding or decoding bit streams in products that are compliant
  593. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  594. -Android devices already license these patent claims through Via Licensing or
  595. -directly from the patent owners, and therefore FDK AAC Codec software may
  596. -already be covered under those patent licenses when it is used for those
  597. -licensed purposes only.
  598. -
  599. -Commercially-licensed AAC software libraries, including floating-point versions
  600. -with enhanced sound quality, are also available from Fraunhofer. Users are
  601. -encouraged to check the Fraunhofer website for additional applications
  602. -information and documentation.
  603. -
  604. -2. COPYRIGHT LICENSE
  605. -
  606. -Redistribution and use in source and binary forms, with or without modification,
  607. -are permitted without payment of copyright license fees provided that you
  608. -satisfy the following conditions:
  609. -
  610. -You must retain the complete text of this software license in redistributions of
  611. -the FDK AAC Codec or your modifications thereto in source code form.
  612. -
  613. -You must retain the complete text of this software license in the documentation
  614. -and/or other materials provided with redistributions of the FDK AAC Codec or
  615. -your modifications thereto in binary form. You must make available free of
  616. -charge copies of the complete source code of the FDK AAC Codec and your
  617. -modifications thereto to recipients of copies in binary form.
  618. -
  619. -The name of Fraunhofer may not be used to endorse or promote products derived
  620. -from this library without prior written permission.
  621. -
  622. -You may not charge copyright license fees for anyone to use, copy or distribute
  623. -the FDK AAC Codec software or your modifications thereto.
  624. -
  625. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  626. -that you changed the software and the date of any change. For modified versions
  627. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  628. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  629. -AAC Codec Library for Android."
  630. -
  631. -3. NO PATENT LICENSE
  632. -
  633. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  634. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  635. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  636. -software.
  637. -
  638. -You may use this FDK AAC Codec software or modifications thereto only for
  639. -purposes that are authorized by appropriate patent licenses.
  640. -
  641. -4. DISCLAIMER
  642. -
  643. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  644. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  645. -including but not limited to the implied warranties of merchantability and
  646. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  647. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  648. -or consequential damages, including but not limited to procurement of substitute
  649. -goods or services; loss of use, data, or profits, or business interruption,
  650. -however caused and on any theory of liability, whether in contract, strict
  651. -liability, or tort (including negligence), arising in any way out of the use of
  652. -this software, even if advised of the possibility of such damage.
  653. -
  654. -5. CONTACT INFORMATION
  655. -
  656. -Fraunhofer Institute for Integrated Circuits IIS
  657. -Attention: Audio and Multimedia Departments - FDK AAC LL
  658. -Am Wolfsmantel 33
  659. -91058 Erlangen, Germany
  660. -
  661. -www.iis.fraunhofer.de/amm
  662. -amm-info@iis.fraunhofer.de
  663. ------------------------------------------------------------------------------ */
  664. -
  665. -/**************************** AAC decoder library ******************************
  666. -
  667. - Author(s):
  668. -
  669. - Description: ACELP
  670. -
  671. -*******************************************************************************/
  672. -
  673. -#include "usacdec_ace_d4t64.h"
  674. -
  675. -#define L_SUBFR 64 /* Subframe size */
  676. -
  677. -/*
  678. - * D_ACELP_add_pulse
  679. - *
  680. - * Parameters:
  681. - * pos I: position of pulse
  682. - * nb_pulse I: number of pulses
  683. - * track I: track
  684. - * code O: fixed codebook
  685. - *
  686. - * Function:
  687. - * Add pulses to fixed codebook
  688. - *
  689. - * Returns:
  690. - * void
  691. - */
  692. -static void D_ACELP_add_pulse(SHORT pos[], SHORT nb_pulse, SHORT track,
  693. - FIXP_COD code[]) {
  694. - SHORT i, k;
  695. - for (k = 0; k < nb_pulse; k++) {
  696. - /* i = ((pos[k] & (16-1))*NB_TRACK) + track; */
  697. - i = ((pos[k] & (16 - 1)) << 2) + track;
  698. - if ((pos[k] & 16) == 0) {
  699. - code[i] = code[i] + (FIXP_COD)(512 << (COD_BITS - FRACT_BITS));
  700. - } else {
  701. - code[i] = code[i] - (FIXP_COD)(512 << (COD_BITS - FRACT_BITS));
  702. - }
  703. - }
  704. - return;
  705. -}
  706. -/*
  707. - * D_ACELP_decode_1p_N1
  708. - *
  709. - * Parameters:
  710. - * index I: pulse index
  711. - * N I: number of bits for position
  712. - * offset I: offset
  713. - * pos O: position of the pulse
  714. - *
  715. - * Function:
  716. - * Decode 1 pulse with N+1 bits
  717. - *
  718. - * Returns:
  719. - * void
  720. - */
  721. -static void D_ACELP_decode_1p_N1(LONG index, SHORT N, SHORT offset,
  722. - SHORT pos[]) {
  723. - SHORT pos1;
  724. - LONG i, mask;
  725. -
  726. - mask = ((1 << N) - 1);
  727. - /*
  728. - * Decode 1 pulse with N+1 bits
  729. - */
  730. - pos1 = (SHORT)((index & mask) + offset);
  731. - i = ((index >> N) & 1);
  732. - if (i == 1) {
  733. - pos1 += 16;
  734. - }
  735. - pos[0] = pos1;
  736. - return;
  737. -}
  738. -/*
  739. - * D_ACELP_decode_2p_2N1
  740. - *
  741. - * Parameters:
  742. - * index I: pulse index
  743. - * N I: number of bits for position
  744. - * offset I: offset
  745. - * pos O: position of the pulse
  746. - *
  747. - * Function:
  748. - * Decode 2 pulses with 2*N+1 bits
  749. - *
  750. - * Returns:
  751. - * void
  752. - */
  753. -static void D_ACELP_decode_2p_2N1(LONG index, SHORT N, SHORT offset,
  754. - SHORT pos[]) {
  755. - SHORT pos1, pos2;
  756. - LONG mask, i;
  757. - mask = ((1 << N) - 1);
  758. - /*
  759. - * Decode 2 pulses with 2*N+1 bits
  760. - */
  761. - pos1 = (SHORT)(((index >> N) & mask) + offset);
  762. - i = (index >> (2 * N)) & 1;
  763. - pos2 = (SHORT)((index & mask) + offset);
  764. - if ((pos2 - pos1) < 0) {
  765. - if (i == 1) {
  766. - pos1 += 16;
  767. - } else {
  768. - pos2 += 16;
  769. - }
  770. - } else {
  771. - if (i == 1) {
  772. - pos1 += 16;
  773. - pos2 += 16;
  774. - }
  775. - }
  776. - pos[0] = pos1;
  777. - pos[1] = pos2;
  778. - return;
  779. -}
  780. -/*
  781. - * D_ACELP_decode_3p_3N1
  782. - *
  783. - * Parameters:
  784. - * index I: pulse index
  785. - * N I: number of bits for position
  786. - * offset I: offset
  787. - * pos O: position of the pulse
  788. - *
  789. - * Function:
  790. - * Decode 3 pulses with 3*N+1 bits
  791. - *
  792. - * Returns:
  793. - * void
  794. - */
  795. -static void D_ACELP_decode_3p_3N1(LONG index, SHORT N, SHORT offset,
  796. - SHORT pos[]) {
  797. - SHORT j;
  798. - LONG mask, idx;
  799. -
  800. - /*
  801. - * Decode 3 pulses with 3*N+1 bits
  802. - */
  803. - mask = ((1 << ((2 * N) - 1)) - 1);
  804. - idx = index & mask;
  805. - j = offset;
  806. - if (((index >> ((2 * N) - 1)) & 1) == 1) {
  807. - j += (1 << (N - 1));
  808. - }
  809. - D_ACELP_decode_2p_2N1(idx, N - 1, j, pos);
  810. - mask = ((1 << (N + 1)) - 1);
  811. - idx = (index >> (2 * N)) & mask;
  812. - D_ACELP_decode_1p_N1(idx, N, offset, pos + 2);
  813. - return;
  814. -}
  815. -/*
  816. - * D_ACELP_decode_4p_4N1
  817. - *
  818. - * Parameters:
  819. - * index I: pulse index
  820. - * N I: number of bits for position
  821. - * offset I: offset
  822. - * pos O: position of the pulse
  823. - *
  824. - * Function:
  825. - * Decode 4 pulses with 4*N+1 bits
  826. - *
  827. - * Returns:
  828. - * void
  829. - */
  830. -static void D_ACELP_decode_4p_4N1(LONG index, SHORT N, SHORT offset,
  831. - SHORT pos[]) {
  832. - SHORT j;
  833. - LONG mask, idx;
  834. - /*
  835. - * Decode 4 pulses with 4*N+1 bits
  836. - */
  837. - mask = ((1 << ((2 * N) - 1)) - 1);
  838. - idx = index & mask;
  839. - j = offset;
  840. - if (((index >> ((2 * N) - 1)) & 1) == 1) {
  841. - j += (1 << (N - 1));
  842. - }
  843. - D_ACELP_decode_2p_2N1(idx, N - 1, j, pos);
  844. - mask = ((1 << ((2 * N) + 1)) - 1);
  845. - idx = (index >> (2 * N)) & mask;
  846. - D_ACELP_decode_2p_2N1(idx, N, offset, pos + 2);
  847. - return;
  848. -}
  849. -/*
  850. - * D_ACELP_decode_4p_4N
  851. - *
  852. - * Parameters:
  853. - * index I: pulse index
  854. - * N I: number of bits for position
  855. - * offset I: offset
  856. - * pos O: position of the pulse
  857. - *
  858. - * Function:
  859. - * Decode 4 pulses with 4*N bits
  860. - *
  861. - * Returns:
  862. - * void
  863. - */
  864. -static void D_ACELP_decode_4p_4N(LONG index, SHORT N, SHORT offset,
  865. - SHORT pos[]) {
  866. - SHORT j, n_1;
  867. - /*
  868. - * Decode 4 pulses with 4*N bits
  869. - */
  870. - n_1 = N - 1;
  871. - j = offset + (1 << n_1);
  872. - switch ((index >> ((4 * N) - 2)) & 3) {
  873. - case 0:
  874. - if (((index >> ((4 * n_1) + 1)) & 1) == 0) {
  875. - D_ACELP_decode_4p_4N1(index, n_1, offset, pos);
  876. - } else {
  877. - D_ACELP_decode_4p_4N1(index, n_1, j, pos);
  878. - }
  879. - break;
  880. - case 1:
  881. - D_ACELP_decode_1p_N1((index >> ((3 * n_1) + 1)), n_1, offset, pos);
  882. - D_ACELP_decode_3p_3N1(index, n_1, j, pos + 1);
  883. - break;
  884. - case 2:
  885. - D_ACELP_decode_2p_2N1((index >> ((2 * n_1) + 1)), n_1, offset, pos);
  886. - D_ACELP_decode_2p_2N1(index, n_1, j, pos + 2);
  887. - break;
  888. - case 3:
  889. - D_ACELP_decode_3p_3N1((index >> (n_1 + 1)), n_1, offset, pos);
  890. - D_ACELP_decode_1p_N1(index, n_1, j, pos + 3);
  891. - break;
  892. - }
  893. - return;
  894. -}
  895. -
  896. -/*
  897. - * D_ACELP_decode_4t
  898. - *
  899. - * Parameters:
  900. - * index I: index
  901. - * mode I: speech mode
  902. - * code I: (Q9) algebraic (fixed) codebook excitation
  903. - *
  904. - * Function:
  905. - * 20, 36, 44, 52, 64, 72, 88 bits algebraic codebook.
  906. - * 4 tracks x 16 positions per track = 64 samples.
  907. - *
  908. - * 20 bits 5+5+5+5 --> 4 pulses in a frame of 64 samples.
  909. - * 36 bits 9+9+9+9 --> 8 pulses in a frame of 64 samples.
  910. - * 44 bits 13+9+13+9 --> 10 pulses in a frame of 64 samples.
  911. - * 52 bits 13+13+13+13 --> 12 pulses in a frame of 64 samples.
  912. - * 64 bits 2+2+2+2+14+14+14+14 --> 16 pulses in a frame of 64 samples.
  913. - * 72 bits 10+2+10+2+10+14+10+14 --> 18 pulses in a frame of 64 samples.
  914. - * 88 bits 11+11+11+11+11+11+11+11 --> 24 pulses in a frame of 64 samples.
  915. - *
  916. - * All pulses can have two (2) possible amplitudes: +1 or -1.
  917. - * Each pulse can sixteen (16) possible positions.
  918. - *
  919. - * codevector length 64
  920. - * number of track 4
  921. - * number of position 16
  922. - *
  923. - * Returns:
  924. - * void
  925. - */
  926. -void D_ACELP_decode_4t64(SHORT index[], int nbits, FIXP_COD code[]) {
  927. - LONG L_index;
  928. - SHORT k, pos[6];
  929. -
  930. - FDKmemclear(code, L_SUBFR * sizeof(FIXP_COD));
  931. -
  932. - /* decode the positions and signs of pulses and build the codeword */
  933. - switch (nbits) {
  934. - case 12:
  935. - for (k = 0; k < 4; k += 2) {
  936. - L_index = index[2 * (k / 2) + 1];
  937. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  938. - D_ACELP_add_pulse(pos, 1, 2 * (index[2 * (k / 2)]) + k / 2, code);
  939. - }
  940. - break;
  941. - case 16: {
  942. - int i = 0;
  943. - int offset = index[i++];
  944. - offset = (offset == 0) ? 1 : 3;
  945. - for (k = 0; k < 4; k++) {
  946. - if (k != offset) {
  947. - L_index = index[i++];
  948. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  949. - D_ACELP_add_pulse(pos, 1, k, code);
  950. - }
  951. - }
  952. - } break;
  953. - case 20:
  954. - for (k = 0; k < 4; k++) {
  955. - L_index = (LONG)index[k];
  956. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  957. - D_ACELP_add_pulse(pos, 1, k, code);
  958. - }
  959. - break;
  960. - case 28:
  961. - for (k = 0; k < 4 - 2; k++) {
  962. - L_index = (LONG)index[k];
  963. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  964. - D_ACELP_add_pulse(pos, 2, k, code);
  965. - }
  966. - for (k = 2; k < 4; k++) {
  967. - L_index = (LONG)index[k];
  968. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  969. - D_ACELP_add_pulse(pos, 1, k, code);
  970. - }
  971. - break;
  972. - case 36:
  973. - for (k = 0; k < 4; k++) {
  974. - L_index = (LONG)index[k];
  975. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  976. - D_ACELP_add_pulse(pos, 2, k, code);
  977. - }
  978. - break;
  979. - case 44:
  980. - for (k = 0; k < 4 - 2; k++) {
  981. - L_index = (LONG)index[k];
  982. - D_ACELP_decode_3p_3N1(L_index, 4, 0, pos);
  983. - D_ACELP_add_pulse(pos, 3, k, code);
  984. - }
  985. - for (k = 2; k < 4; k++) {
  986. - L_index = (LONG)index[k];
  987. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  988. - D_ACELP_add_pulse(pos, 2, k, code);
  989. - }
  990. - break;
  991. - case 52:
  992. - for (k = 0; k < 4; k++) {
  993. - L_index = (LONG)index[k];
  994. - D_ACELP_decode_3p_3N1(L_index, 4, 0, pos);
  995. - D_ACELP_add_pulse(pos, 3, k, code);
  996. - }
  997. - break;
  998. - case 64:
  999. - for (k = 0; k < 4; k++) {
  1000. - L_index = (((LONG)index[k] << 14) + (LONG)index[k + 4]);
  1001. - D_ACELP_decode_4p_4N(L_index, 4, 0, pos);
  1002. - D_ACELP_add_pulse(pos, 4, k, code);
  1003. - }
  1004. - break;
  1005. - default:
  1006. - FDK_ASSERT(0);
  1007. - }
  1008. - return;
  1009. -}
  1010. diff --git a/libAACdec/src/usacdec_ace_d4t64.h b/libAACdec/src/usacdec_ace_d4t64.h
  1011. deleted file mode 100644
  1012. index 76bc3d9..0000000
  1013. --- a/libAACdec/src/usacdec_ace_d4t64.h
  1014. +++ /dev/null
  1015. @@ -1,117 +0,0 @@
  1016. -/* -----------------------------------------------------------------------------
  1017. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1018. -
  1019. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1020. -Forschung e.V. All rights reserved.
  1021. -
  1022. - 1. INTRODUCTION
  1023. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1024. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1025. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1026. -a wide variety of Android devices.
  1027. -
  1028. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1029. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1030. -full-bandwidth communications codec by independent studies and is widely
  1031. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1032. -specifications.
  1033. -
  1034. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1035. -those of Fraunhofer) may be obtained through Via Licensing
  1036. -(www.vialicensing.com) or through the respective patent owners individually for
  1037. -the purpose of encoding or decoding bit streams in products that are compliant
  1038. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1039. -Android devices already license these patent claims through Via Licensing or
  1040. -directly from the patent owners, and therefore FDK AAC Codec software may
  1041. -already be covered under those patent licenses when it is used for those
  1042. -licensed purposes only.
  1043. -
  1044. -Commercially-licensed AAC software libraries, including floating-point versions
  1045. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1046. -encouraged to check the Fraunhofer website for additional applications
  1047. -information and documentation.
  1048. -
  1049. -2. COPYRIGHT LICENSE
  1050. -
  1051. -Redistribution and use in source and binary forms, with or without modification,
  1052. -are permitted without payment of copyright license fees provided that you
  1053. -satisfy the following conditions:
  1054. -
  1055. -You must retain the complete text of this software license in redistributions of
  1056. -the FDK AAC Codec or your modifications thereto in source code form.
  1057. -
  1058. -You must retain the complete text of this software license in the documentation
  1059. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1060. -your modifications thereto in binary form. You must make available free of
  1061. -charge copies of the complete source code of the FDK AAC Codec and your
  1062. -modifications thereto to recipients of copies in binary form.
  1063. -
  1064. -The name of Fraunhofer may not be used to endorse or promote products derived
  1065. -from this library without prior written permission.
  1066. -
  1067. -You may not charge copyright license fees for anyone to use, copy or distribute
  1068. -the FDK AAC Codec software or your modifications thereto.
  1069. -
  1070. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1071. -that you changed the software and the date of any change. For modified versions
  1072. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1073. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1074. -AAC Codec Library for Android."
  1075. -
  1076. -3. NO PATENT LICENSE
  1077. -
  1078. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1079. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1080. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1081. -software.
  1082. -
  1083. -You may use this FDK AAC Codec software or modifications thereto only for
  1084. -purposes that are authorized by appropriate patent licenses.
  1085. -
  1086. -4. DISCLAIMER
  1087. -
  1088. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1089. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1090. -including but not limited to the implied warranties of merchantability and
  1091. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1092. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1093. -or consequential damages, including but not limited to procurement of substitute
  1094. -goods or services; loss of use, data, or profits, or business interruption,
  1095. -however caused and on any theory of liability, whether in contract, strict
  1096. -liability, or tort (including negligence), arising in any way out of the use of
  1097. -this software, even if advised of the possibility of such damage.
  1098. -
  1099. -5. CONTACT INFORMATION
  1100. -
  1101. -Fraunhofer Institute for Integrated Circuits IIS
  1102. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1103. -Am Wolfsmantel 33
  1104. -91058 Erlangen, Germany
  1105. -
  1106. -www.iis.fraunhofer.de/amm
  1107. -amm-info@iis.fraunhofer.de
  1108. ------------------------------------------------------------------------------ */
  1109. -
  1110. -/**************************** AAC decoder library ******************************
  1111. -
  1112. - Author(s):
  1113. -
  1114. - Description: ACELP
  1115. -
  1116. -*******************************************************************************/
  1117. -
  1118. -#ifndef USACDEC_ACE_D4T64_H
  1119. -#define USACDEC_ACE_D4T64_H
  1120. -
  1121. -#include "common_fix.h"
  1122. -
  1123. -/* Data type definition for the fixed codebook vector */
  1124. -#define FIXP_COD FIXP_SGL
  1125. -#define FX_COD2FX_DBL(x) (FX_SGL2FX_DBL(x))
  1126. -#define FX_DBL2FX_COD(x) FX_DBL2FX_SGL((x) + (FIXP_DBL)0x8000)
  1127. -#define FX_SGL2FX_COD(x) (x)
  1128. -#define COD_BITS FRACT_BITS
  1129. -
  1130. -void D_ACELP_decode_4t64(SHORT index[], int nbits, FIXP_COD code[]);
  1131. -
  1132. -#endif /* USACDEC_ACE_D4T64_H */
  1133. diff --git a/libAACdec/src/usacdec_ace_ltp.cpp b/libAACdec/src/usacdec_ace_ltp.cpp
  1134. deleted file mode 100644
  1135. index 5964b49..0000000
  1136. --- a/libAACdec/src/usacdec_ace_ltp.cpp
  1137. +++ /dev/null
  1138. @@ -1,229 +0,0 @@
  1139. -/* -----------------------------------------------------------------------------
  1140. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1141. -
  1142. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1143. -Forschung e.V. All rights reserved.
  1144. -
  1145. - 1. INTRODUCTION
  1146. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1147. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1148. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1149. -a wide variety of Android devices.
  1150. -
  1151. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1152. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1153. -full-bandwidth communications codec by independent studies and is widely
  1154. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1155. -specifications.
  1156. -
  1157. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1158. -those of Fraunhofer) may be obtained through Via Licensing
  1159. -(www.vialicensing.com) or through the respective patent owners individually for
  1160. -the purpose of encoding or decoding bit streams in products that are compliant
  1161. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1162. -Android devices already license these patent claims through Via Licensing or
  1163. -directly from the patent owners, and therefore FDK AAC Codec software may
  1164. -already be covered under those patent licenses when it is used for those
  1165. -licensed purposes only.
  1166. -
  1167. -Commercially-licensed AAC software libraries, including floating-point versions
  1168. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1169. -encouraged to check the Fraunhofer website for additional applications
  1170. -information and documentation.
  1171. -
  1172. -2. COPYRIGHT LICENSE
  1173. -
  1174. -Redistribution and use in source and binary forms, with or without modification,
  1175. -are permitted without payment of copyright license fees provided that you
  1176. -satisfy the following conditions:
  1177. -
  1178. -You must retain the complete text of this software license in redistributions of
  1179. -the FDK AAC Codec or your modifications thereto in source code form.
  1180. -
  1181. -You must retain the complete text of this software license in the documentation
  1182. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1183. -your modifications thereto in binary form. You must make available free of
  1184. -charge copies of the complete source code of the FDK AAC Codec and your
  1185. -modifications thereto to recipients of copies in binary form.
  1186. -
  1187. -The name of Fraunhofer may not be used to endorse or promote products derived
  1188. -from this library without prior written permission.
  1189. -
  1190. -You may not charge copyright license fees for anyone to use, copy or distribute
  1191. -the FDK AAC Codec software or your modifications thereto.
  1192. -
  1193. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1194. -that you changed the software and the date of any change. For modified versions
  1195. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1196. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1197. -AAC Codec Library for Android."
  1198. -
  1199. -3. NO PATENT LICENSE
  1200. -
  1201. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1202. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1203. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1204. -software.
  1205. -
  1206. -You may use this FDK AAC Codec software or modifications thereto only for
  1207. -purposes that are authorized by appropriate patent licenses.
  1208. -
  1209. -4. DISCLAIMER
  1210. -
  1211. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1212. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1213. -including but not limited to the implied warranties of merchantability and
  1214. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1215. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1216. -or consequential damages, including but not limited to procurement of substitute
  1217. -goods or services; loss of use, data, or profits, or business interruption,
  1218. -however caused and on any theory of liability, whether in contract, strict
  1219. -liability, or tort (including negligence), arising in any way out of the use of
  1220. -this software, even if advised of the possibility of such damage.
  1221. -
  1222. -5. CONTACT INFORMATION
  1223. -
  1224. -Fraunhofer Institute for Integrated Circuits IIS
  1225. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1226. -Am Wolfsmantel 33
  1227. -91058 Erlangen, Germany
  1228. -
  1229. -www.iis.fraunhofer.de/amm
  1230. -amm-info@iis.fraunhofer.de
  1231. ------------------------------------------------------------------------------ */
  1232. -
  1233. -/**************************** AAC decoder library ******************************
  1234. -
  1235. - Author(s): Matthias Hildenbrand
  1236. -
  1237. - Description: USAC ACELP LTP filter
  1238. -
  1239. -*******************************************************************************/
  1240. -
  1241. -#include "usacdec_ace_ltp.h"
  1242. -
  1243. -#include "genericStds.h"
  1244. -#include "common_fix.h"
  1245. -
  1246. -#define UP_SAMP 4
  1247. -#define L_INTERPOL2 16
  1248. -#define L_SUBFR 64
  1249. -
  1250. -#define A2 FL2FX_SGL(2 * 0.18f)
  1251. -#define B FL2FX_SGL(0.64f)
  1252. -
  1253. -static const LONG Pred_lt4_inter4_2[UP_SAMP][L_INTERPOL2] = {
  1254. - {(LONG)0x0000FFFC, (LONG)0x0008FFFC, (LONG)0xFFEB004C, (LONG)0xFF50014A,
  1255. - (LONG)0xFDD90351, (LONG)0xFB2A06CD, (LONG)0xF6920D46, (LONG)0xEBB42B35,
  1256. - (LONG)0x6D9EEF39, (LONG)0x0618FE0F, (LONG)0xFFE00131, (LONG)0xFE5501C5,
  1257. - (LONG)0xFE5E015D, (LONG)0xFEF700B6, (LONG)0xFF920037, (LONG)0xFFEC0003},
  1258. - {(LONG)0x0002FFF2, (LONG)0x0026FFBD, (LONG)0x005DFF98, (LONG)0x0055FFEF,
  1259. - (LONG)0xFF89015F, (LONG)0xFD3A04E5, (LONG)0xF7D90DAA, (LONG)0xE67A50EE,
  1260. - (LONG)0x50EEE67A, (LONG)0x0DAAF7D9, (LONG)0x04E5FD3A, (LONG)0x015FFF89,
  1261. - (LONG)0xFFEF0055, (LONG)0xFF98005D, (LONG)0xFFBD0026, (LONG)0xFFF20002},
  1262. - {(LONG)0x0003FFEC, (LONG)0x0037FF92, (LONG)0x00B6FEF7, (LONG)0x015DFE5E,
  1263. - (LONG)0x01C5FE55, (LONG)0x0131FFE0, (LONG)0xFE0F0618, (LONG)0xEF396D9E,
  1264. - (LONG)0x2B35EBB4, (LONG)0x0D46F692, (LONG)0x06CDFB2A, (LONG)0x0351FDD9,
  1265. - (LONG)0x014AFF50, (LONG)0x004CFFEB, (LONG)0xFFFC0008, (LONG)0xFFFC0000},
  1266. - {(LONG)0x0002FFF2, (LONG)0x002BFF9E, (LONG)0x00B9FECE, (LONG)0x01CFFD75,
  1267. - (LONG)0x035EFBC1, (LONG)0x0521FA0C, (LONG)0x06AAF8C9, (LONG)0x07907852,
  1268. - (LONG)0x0790F8C9, (LONG)0x06AAFA0C, (LONG)0x0521FBC1, (LONG)0x035EFD75,
  1269. - (LONG)0x01CFFECE, (LONG)0x00B9FF9E, (LONG)0x002BFFF2, (LONG)0x00020000}};
  1270. -
  1271. -void Pred_lt4(FIXP_DBL exc[], /* in/out: excitation buffer */
  1272. - int T0, /* input : integer pitch lag */
  1273. - int frac /* input : fraction of lag in range 0..3 */
  1274. -) {
  1275. - int j;
  1276. - FIXP_DBL *x;
  1277. - const LONG *interpol;
  1278. - FIXP_DBL L_sumb, L_sumt;
  1279. -
  1280. - x = &exc[-T0 - L_INTERPOL2 + 1];
  1281. -
  1282. - /* remap frac and x:
  1283. - 0 -> 3 x (unchanged)
  1284. - 1 -> 0 x--
  1285. - 2 -> 1 x--
  1286. - 3 -> 2 x--
  1287. - */
  1288. -
  1289. - if (--frac < 0)
  1290. - frac += UP_SAMP;
  1291. - else
  1292. - x--;
  1293. -
  1294. - j = L_SUBFR + 1;
  1295. - do {
  1296. - LONG filt;
  1297. - FIXP_DBL x0, x1;
  1298. - FIXP_DBL *xi = x++;
  1299. - interpol = Pred_lt4_inter4_2[frac];
  1300. - int i = 3;
  1301. -
  1302. - filt = *interpol++;
  1303. - x0 = *xi++;
  1304. - x1 = *xi++;
  1305. - L_sumt = fMultDiv2(x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1306. - L_sumb = fMultDiv2(x1, (FIXP_SGL)((SHORT)filt));
  1307. - do {
  1308. - filt = *interpol++;
  1309. - x0 = *xi++;
  1310. - x1 = *xi++;
  1311. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1312. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1313. -
  1314. - filt = *interpol++;
  1315. - x0 = *xi++;
  1316. - x1 = *xi++;
  1317. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1318. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1319. -
  1320. - filt = *interpol++;
  1321. - x0 = *xi++;
  1322. - x1 = *xi++;
  1323. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1324. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1325. -
  1326. - filt = *interpol++;
  1327. - x0 = *xi++;
  1328. - x1 = *xi++;
  1329. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1330. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1331. -
  1332. - filt = *interpol++;
  1333. - x0 = *xi++;
  1334. - x1 = *xi++;
  1335. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1336. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1337. - } while (--i != 0);
  1338. -
  1339. - L_sumb <<= 1;
  1340. - L_sumb = fAddSaturate(L_sumt << 1, L_sumb);
  1341. - *exc++ = L_sumb;
  1342. - } while (--j != 0);
  1343. - return;
  1344. -}
  1345. -
  1346. -void Pred_lt4_postfilter(FIXP_DBL exc[] /* in/out: excitation buffer */
  1347. -) {
  1348. - /*
  1349. - exc[i] = A*exc[i-1] + B*exc[i] + A*exc[i+1]
  1350. - exc[i+1] = A*exc[i] + B*exc[i+1] + A*exc[i+2] ; i = 0:2:62
  1351. - */
  1352. - int i;
  1353. - FIXP_DBL sum0, sum1, a_exc0, a_exc1;
  1354. - a_exc0 = fMultDiv2(A2, exc[-1]);
  1355. - a_exc1 = fMultDiv2(A2, exc[0]);
  1356. -
  1357. - /* ARM926: 22 cycles/iteration */
  1358. - for (i = 0; i < L_SUBFR; i += 2) {
  1359. - sum0 = a_exc0 + fMult(B, exc[i]);
  1360. - sum1 = a_exc1 + fMult(B, exc[i + 1]);
  1361. - a_exc0 = fMultDiv2(A2, exc[i + 1]);
  1362. - a_exc1 = fMultDiv2(A2, exc[i + 2]);
  1363. - exc[i] = sum0 + a_exc0;
  1364. - exc[i + 1] = sum1 + a_exc1;
  1365. - }
  1366. - return;
  1367. -}
  1368. diff --git a/libAACdec/src/usacdec_ace_ltp.h b/libAACdec/src/usacdec_ace_ltp.h
  1369. deleted file mode 100644
  1370. index 5128acd..0000000
  1371. --- a/libAACdec/src/usacdec_ace_ltp.h
  1372. +++ /dev/null
  1373. @@ -1,128 +0,0 @@
  1374. -/* -----------------------------------------------------------------------------
  1375. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1376. -
  1377. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1378. -Forschung e.V. All rights reserved.
  1379. -
  1380. - 1. INTRODUCTION
  1381. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1382. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1383. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1384. -a wide variety of Android devices.
  1385. -
  1386. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1387. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1388. -full-bandwidth communications codec by independent studies and is widely
  1389. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1390. -specifications.
  1391. -
  1392. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1393. -those of Fraunhofer) may be obtained through Via Licensing
  1394. -(www.vialicensing.com) or through the respective patent owners individually for
  1395. -the purpose of encoding or decoding bit streams in products that are compliant
  1396. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1397. -Android devices already license these patent claims through Via Licensing or
  1398. -directly from the patent owners, and therefore FDK AAC Codec software may
  1399. -already be covered under those patent licenses when it is used for those
  1400. -licensed purposes only.
  1401. -
  1402. -Commercially-licensed AAC software libraries, including floating-point versions
  1403. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1404. -encouraged to check the Fraunhofer website for additional applications
  1405. -information and documentation.
  1406. -
  1407. -2. COPYRIGHT LICENSE
  1408. -
  1409. -Redistribution and use in source and binary forms, with or without modification,
  1410. -are permitted without payment of copyright license fees provided that you
  1411. -satisfy the following conditions:
  1412. -
  1413. -You must retain the complete text of this software license in redistributions of
  1414. -the FDK AAC Codec or your modifications thereto in source code form.
  1415. -
  1416. -You must retain the complete text of this software license in the documentation
  1417. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1418. -your modifications thereto in binary form. You must make available free of
  1419. -charge copies of the complete source code of the FDK AAC Codec and your
  1420. -modifications thereto to recipients of copies in binary form.
  1421. -
  1422. -The name of Fraunhofer may not be used to endorse or promote products derived
  1423. -from this library without prior written permission.
  1424. -
  1425. -You may not charge copyright license fees for anyone to use, copy or distribute
  1426. -the FDK AAC Codec software or your modifications thereto.
  1427. -
  1428. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1429. -that you changed the software and the date of any change. For modified versions
  1430. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1431. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1432. -AAC Codec Library for Android."
  1433. -
  1434. -3. NO PATENT LICENSE
  1435. -
  1436. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1437. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1438. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1439. -software.
  1440. -
  1441. -You may use this FDK AAC Codec software or modifications thereto only for
  1442. -purposes that are authorized by appropriate patent licenses.
  1443. -
  1444. -4. DISCLAIMER
  1445. -
  1446. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1447. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1448. -including but not limited to the implied warranties of merchantability and
  1449. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1450. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1451. -or consequential damages, including but not limited to procurement of substitute
  1452. -goods or services; loss of use, data, or profits, or business interruption,
  1453. -however caused and on any theory of liability, whether in contract, strict
  1454. -liability, or tort (including negligence), arising in any way out of the use of
  1455. -this software, even if advised of the possibility of such damage.
  1456. -
  1457. -5. CONTACT INFORMATION
  1458. -
  1459. -Fraunhofer Institute for Integrated Circuits IIS
  1460. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1461. -Am Wolfsmantel 33
  1462. -91058 Erlangen, Germany
  1463. -
  1464. -www.iis.fraunhofer.de/amm
  1465. -amm-info@iis.fraunhofer.de
  1466. ------------------------------------------------------------------------------ */
  1467. -
  1468. -/**************************** AAC decoder library ******************************
  1469. -
  1470. - Author(s): Matthias Hildenbrand
  1471. -
  1472. - Description: USAC ACELP LTP filter
  1473. -
  1474. -*******************************************************************************/
  1475. -
  1476. -#ifndef USACDEC_ACE_LTP_H
  1477. -#define USACDEC_ACE_LTP_H
  1478. -
  1479. -#include "common_fix.h"
  1480. -
  1481. -/**
  1482. - * \brief Compute the initial adaptive codebook excitation v'(n) by
  1483. - * interpolating the past excitation vector u'(n).
  1484. - * \param exc points to adaptive codebook of current subframe (input/output)
  1485. - * \param T0 integer part of decoded pitch lag (input)
  1486. - * \param frac fractional part of decoded pitch lag (0..3) (input)
  1487. - */
  1488. -void Pred_lt4(FIXP_DBL exc[], /* in/out: excitation buffer */
  1489. - int T0, /* input : integer pitch lag */
  1490. - int frac /* input : fraction of lag */
  1491. -);
  1492. -
  1493. -/**
  1494. - * \brief Compute the adaptive codebook excitation v(n) in case of
  1495. - * ltp_filtering_flag == 0.
  1496. - * \param exc points to adaptive codebook of current subframe (input/output)
  1497. - */
  1498. -void Pred_lt4_postfilter(FIXP_DBL exc[] /* in/out: excitation buffer */
  1499. -);
  1500. -
  1501. -#endif /* USACDEC_ACE_LTP_H */
  1502. diff --git a/libAACdec/src/usacdec_acelp.cpp b/libAACdec/src/usacdec_acelp.cpp
  1503. deleted file mode 100644
  1504. index a606459..0000000
  1505. --- a/libAACdec/src/usacdec_acelp.cpp
  1506. +++ /dev/null
  1507. @@ -1,1296 +0,0 @@
  1508. -/* -----------------------------------------------------------------------------
  1509. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1510. -
  1511. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1512. -Forschung e.V. All rights reserved.
  1513. -
  1514. - 1. INTRODUCTION
  1515. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1516. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1517. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1518. -a wide variety of Android devices.
  1519. -
  1520. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1521. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1522. -full-bandwidth communications codec by independent studies and is widely
  1523. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1524. -specifications.
  1525. -
  1526. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1527. -those of Fraunhofer) may be obtained through Via Licensing
  1528. -(www.vialicensing.com) or through the respective patent owners individually for
  1529. -the purpose of encoding or decoding bit streams in products that are compliant
  1530. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1531. -Android devices already license these patent claims through Via Licensing or
  1532. -directly from the patent owners, and therefore FDK AAC Codec software may
  1533. -already be covered under those patent licenses when it is used for those
  1534. -licensed purposes only.
  1535. -
  1536. -Commercially-licensed AAC software libraries, including floating-point versions
  1537. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1538. -encouraged to check the Fraunhofer website for additional applications
  1539. -information and documentation.
  1540. -
  1541. -2. COPYRIGHT LICENSE
  1542. -
  1543. -Redistribution and use in source and binary forms, with or without modification,
  1544. -are permitted without payment of copyright license fees provided that you
  1545. -satisfy the following conditions:
  1546. -
  1547. -You must retain the complete text of this software license in redistributions of
  1548. -the FDK AAC Codec or your modifications thereto in source code form.
  1549. -
  1550. -You must retain the complete text of this software license in the documentation
  1551. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1552. -your modifications thereto in binary form. You must make available free of
  1553. -charge copies of the complete source code of the FDK AAC Codec and your
  1554. -modifications thereto to recipients of copies in binary form.
  1555. -
  1556. -The name of Fraunhofer may not be used to endorse or promote products derived
  1557. -from this library without prior written permission.
  1558. -
  1559. -You may not charge copyright license fees for anyone to use, copy or distribute
  1560. -the FDK AAC Codec software or your modifications thereto.
  1561. -
  1562. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1563. -that you changed the software and the date of any change. For modified versions
  1564. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1565. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1566. -AAC Codec Library for Android."
  1567. -
  1568. -3. NO PATENT LICENSE
  1569. -
  1570. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1571. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1572. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1573. -software.
  1574. -
  1575. -You may use this FDK AAC Codec software or modifications thereto only for
  1576. -purposes that are authorized by appropriate patent licenses.
  1577. -
  1578. -4. DISCLAIMER
  1579. -
  1580. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1581. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1582. -including but not limited to the implied warranties of merchantability and
  1583. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1584. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1585. -or consequential damages, including but not limited to procurement of substitute
  1586. -goods or services; loss of use, data, or profits, or business interruption,
  1587. -however caused and on any theory of liability, whether in contract, strict
  1588. -liability, or tort (including negligence), arising in any way out of the use of
  1589. -this software, even if advised of the possibility of such damage.
  1590. -
  1591. -5. CONTACT INFORMATION
  1592. -
  1593. -Fraunhofer Institute for Integrated Circuits IIS
  1594. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1595. -Am Wolfsmantel 33
  1596. -91058 Erlangen, Germany
  1597. -
  1598. -www.iis.fraunhofer.de/amm
  1599. -amm-info@iis.fraunhofer.de
  1600. ------------------------------------------------------------------------------ */
  1601. -
  1602. -/**************************** AAC decoder library ******************************
  1603. -
  1604. - Author(s): Matthias Hildenbrand
  1605. -
  1606. - Description: USAC ACELP frame decoder
  1607. -
  1608. -*******************************************************************************/
  1609. -
  1610. -#include "usacdec_acelp.h"
  1611. -
  1612. -#include "usacdec_ace_d4t64.h"
  1613. -#include "usacdec_ace_ltp.h"
  1614. -#include "usacdec_rom.h"
  1615. -#include "usacdec_lpc.h"
  1616. -#include "genericStds.h"
  1617. -
  1618. -#define PIT_FR2_12k8 128 /* Minimum pitch lag with resolution 1/2 */
  1619. -#define PIT_FR1_12k8 160 /* Minimum pitch lag with resolution 1 */
  1620. -#define TILT_CODE2 \
  1621. - FL2FXCONST_SGL(0.3f * 2.0f) /* ACELP code pre-emphasis factor ( *2 ) */
  1622. -#define PIT_SHARP \
  1623. - FL2FXCONST_SGL(0.85f) /* pitch sharpening factor */
  1624. -#define PREEMPH_FAC \
  1625. - FL2FXCONST_SGL(0.68f) /* ACELP synth pre-emphasis factor */
  1626. -
  1627. -#define ACELP_HEADROOM 1
  1628. -#define ACELP_OUTSCALE (MDCT_OUT_HEADROOM - ACELP_HEADROOM)
  1629. -
  1630. -/**
  1631. - * \brief Calculate pre-emphasis (1 - mu z^-1) on input signal.
  1632. - * \param[in] in pointer to input signal; in[-1] is also needed.
  1633. - * \param[out] out pointer to output signal.
  1634. - * \param[in] L length of filtering.
  1635. - */
  1636. -/* static */
  1637. -void E_UTIL_preemph(const FIXP_DBL *in, FIXP_DBL *out, INT L) {
  1638. - int i;
  1639. -
  1640. - for (i = 0; i < L; i++) {
  1641. - out[i] = in[i] - fMult(PREEMPH_FAC, in[i - 1]);
  1642. - }
  1643. -
  1644. - return;
  1645. -}
  1646. -
  1647. -/**
  1648. - * \brief Calculate de-emphasis 1/(1 - TILT_CODE z^-1) on innovative codebook
  1649. - * vector.
  1650. - * \param[in,out] x innovative codebook vector.
  1651. - */
  1652. -static void Preemph_code(
  1653. - FIXP_COD x[] /* (i/o) : input signal overwritten by the output */
  1654. -) {
  1655. - int i;
  1656. - FIXP_DBL L_tmp;
  1657. -
  1658. - /* ARM926: 12 cycles per sample */
  1659. - for (i = L_SUBFR - 1; i > 0; i--) {
  1660. - L_tmp = FX_COD2FX_DBL(x[i]);
  1661. - L_tmp -= fMultDiv2(x[i - 1], TILT_CODE2);
  1662. - x[i] = FX_DBL2FX_COD(L_tmp);
  1663. - }
  1664. -}
  1665. -
  1666. -/**
  1667. - * \brief Apply pitch sharpener to the innovative codebook vector.
  1668. - * \param[in,out] x innovative codebook vector.
  1669. - * \param[in] pit_lag decoded pitch lag.
  1670. - */
  1671. -static void Pit_shrp(
  1672. - FIXP_COD x[], /* in/out: impulse response (or algebraic code) */
  1673. - int pit_lag /* input : pitch lag */
  1674. -) {
  1675. - int i;
  1676. - FIXP_DBL L_tmp;
  1677. -
  1678. - for (i = pit_lag; i < L_SUBFR; i++) {
  1679. - L_tmp = FX_COD2FX_DBL(x[i]);
  1680. - L_tmp += fMult(x[i - pit_lag], PIT_SHARP);
  1681. - x[i] = FX_DBL2FX_COD(L_tmp);
  1682. - }
  1683. -
  1684. - return;
  1685. -}
  1686. -
  1687. - /**
  1688. - * \brief Calculate Quantized codebook gain, Quantized pitch gain and unbiased
  1689. - * Innovative code vector energy.
  1690. - * \param[in] index index of quantizer.
  1691. - * \param[in] code innovative code vector with exponent = SF_CODE.
  1692. - * \param[out] gain_pit Quantized pitch gain g_p with exponent = SF_GAIN_P.
  1693. - * \param[out] gain_code Quantized codebook gain g_c.
  1694. - * \param[in] mean_ener mean_ener defined in open-loop (2 bits), exponent = 7.
  1695. - * \param[out] E_code unbiased innovative code vector energy.
  1696. - * \param[out] E_code_e exponent of unbiased innovative code vector energy.
  1697. - */
  1698. -
  1699. -#define SF_MEAN_ENER_LG10 9
  1700. -
  1701. -/* pow(10.0, {18, 30, 42, 54}/20.0) /(float)(1<<SF_MEAN_ENER_LG10) */
  1702. -static const FIXP_DBL pow_10_mean_energy[4] = {0x01fc5ebd, 0x07e7db92,
  1703. - 0x1f791f65, 0x7d4bfba3};
  1704. -
  1705. -static void D_gain2_plus(int index, FIXP_COD code[], FIXP_SGL *gain_pit,
  1706. - FIXP_DBL *gain_code, int mean_ener_bits, int bfi,
  1707. - FIXP_SGL *past_gpit, FIXP_DBL *past_gcode,
  1708. - FIXP_DBL *pEner_code, int *pEner_code_e) {
  1709. - FIXP_DBL Ltmp;
  1710. - FIXP_DBL gcode0, gcode_inov;
  1711. - INT gcode0_e, gcode_inov_e;
  1712. - int i;
  1713. -
  1714. - FIXP_DBL ener_code;
  1715. - INT ener_code_e;
  1716. -
  1717. - /* ener_code = sum(code[]^2) */
  1718. - ener_code = FIXP_DBL(0);
  1719. - for (i = 0; i < L_SUBFR; i++) {
  1720. - ener_code += fPow2Div2(code[i]);
  1721. - }
  1722. -
  1723. - ener_code_e = fMax(fNorm(ener_code) - 1, 0);
  1724. - ener_code <<= ener_code_e;
  1725. - ener_code_e = 2 * SF_CODE + 1 - ener_code_e;
  1726. -
  1727. - /* export energy of code for calc_period_factor() */
  1728. - *pEner_code = ener_code;
  1729. - *pEner_code_e = ener_code_e;
  1730. -
  1731. - ener_code += scaleValue(FL2FXCONST_DBL(0.01f), -ener_code_e);
  1732. -
  1733. - /* ener_code *= 1/L_SUBFR, and make exponent even (because of square root
  1734. - * below). */
  1735. - if (ener_code_e & 1) {
  1736. - ener_code_e -= 5;
  1737. - ener_code >>= 1;
  1738. - } else {
  1739. - ener_code_e -= 6;
  1740. - }
  1741. - gcode_inov = invSqrtNorm2(ener_code, &gcode0_e);
  1742. - gcode_inov_e = gcode0_e - (ener_code_e >> 1);
  1743. -
  1744. - if (bfi) {
  1745. - FIXP_DBL tgcode;
  1746. - FIXP_SGL tgpit;
  1747. -
  1748. - tgpit = *past_gpit;
  1749. -
  1750. - if (tgpit > FL2FXCONST_SGL(0.95f / (1 << SF_GAIN_P))) {
  1751. - tgpit = FL2FXCONST_SGL(0.95f / (1 << SF_GAIN_P));
  1752. - } else if (tgpit < FL2FXCONST_SGL(0.5f / (1 << SF_GAIN_P))) {
  1753. - tgpit = FL2FXCONST_SGL(0.5f / (1 << SF_GAIN_P));
  1754. - }
  1755. - *gain_pit = tgpit;
  1756. - tgpit = FX_DBL2FX_SGL(fMult(tgpit, FL2FXCONST_DBL(0.95f)));
  1757. - *past_gpit = tgpit;
  1758. -
  1759. - tgpit = FL2FXCONST_SGL(1.4f / (1 << SF_GAIN_P)) - tgpit;
  1760. - tgcode = fMult(*past_gcode, tgpit) << SF_GAIN_P;
  1761. - *gain_code = scaleValue(fMult(tgcode, gcode_inov), gcode_inov_e);
  1762. - *past_gcode = tgcode;
  1763. -
  1764. - return;
  1765. - }
  1766. -
  1767. - /*-------------- Decode gains ---------------*/
  1768. - /*
  1769. - gcode0 = pow(10.0, (float)mean_ener/20.0);
  1770. - gcode0 = gcode0 / sqrt(ener_code/L_SUBFR);
  1771. - */
  1772. - gcode0 = pow_10_mean_energy[mean_ener_bits];
  1773. - gcode0 = fMultDiv2(gcode0, gcode_inov);
  1774. - gcode0_e = gcode0_e + SF_MEAN_ENER_LG10 - (ener_code_e >> 1) + 1;
  1775. -
  1776. - i = index << 1;
  1777. - *gain_pit = fdk_t_qua_gain7b[i]; /* adaptive codebook gain */
  1778. - /* t_qua_gain[ind2p1] : fixed codebook gain correction factor */
  1779. - Ltmp = fMult(fdk_t_qua_gain7b[i + 1], gcode0);
  1780. - *gain_code = scaleValue(Ltmp, gcode0_e - SF_GAIN_C + SF_QUA_GAIN7B);
  1781. -
  1782. - /* update bad frame handler */
  1783. - *past_gpit = *gain_pit;
  1784. -
  1785. - /*--------------------------------------------------------
  1786. - past_gcode = gain_code/gcode_inov
  1787. - --------------------------------------------------------*/
  1788. - {
  1789. - FIXP_DBL gcode_m;
  1790. - INT gcode_e;
  1791. -
  1792. - gcode_m = fDivNormHighPrec(Ltmp, gcode_inov, &gcode_e);
  1793. - gcode_e += (gcode0_e - SF_GAIN_C + SF_QUA_GAIN7B) - (gcode_inov_e);
  1794. - *past_gcode = scaleValue(gcode_m, gcode_e);
  1795. - }
  1796. -}
  1797. -
  1798. -/**
  1799. - * \brief Calculate period/voicing factor r_v
  1800. - * \param[in] exc pitch excitation.
  1801. - * \param[in] gain_pit gain of pitch g_p.
  1802. - * \param[in] gain_code gain of code g_c.
  1803. - * \param[in] gain_code_e exponent of gain of code.
  1804. - * \param[in] ener_code unbiased innovative code vector energy.
  1805. - * \param[in] ener_code_e exponent of unbiased innovative code vector energy.
  1806. - * \return period/voice factor r_v (-1=unvoiced to 1=voiced), exponent SF_PFAC.
  1807. - */
  1808. -static FIXP_DBL calc_period_factor(FIXP_DBL exc[], FIXP_SGL gain_pit,
  1809. - FIXP_DBL gain_code, FIXP_DBL ener_code,
  1810. - int ener_code_e) {
  1811. - int ener_exc_e, L_tmp_e, s = 0;
  1812. - FIXP_DBL ener_exc, L_tmp;
  1813. - FIXP_DBL period_fac;
  1814. -
  1815. - /* energy of pitch excitation */
  1816. - ener_exc = (FIXP_DBL)0;
  1817. - for (int i = 0; i < L_SUBFR; i++) {
  1818. - ener_exc += fPow2Div2(exc[i]) >> s;
  1819. - if (ener_exc >= FL2FXCONST_DBL(0.5f)) {
  1820. - ener_exc >>= 1;
  1821. - s++;
  1822. - }
  1823. - }
  1824. -
  1825. - ener_exc_e = fNorm(ener_exc);
  1826. - ener_exc = fMult(ener_exc << ener_exc_e, fPow2(gain_pit));
  1827. - if (ener_exc != (FIXP_DBL)0) {
  1828. - ener_exc_e = 2 * SF_EXC + 1 + 2 * SF_GAIN_P - ener_exc_e + s;
  1829. - } else {
  1830. - ener_exc_e = 0;
  1831. - }
  1832. -
  1833. - /* energy of innovative code excitation */
  1834. - /* L_tmp = ener_code * gain_code*gain_code; */
  1835. - L_tmp_e = fNorm(gain_code);
  1836. - L_tmp = fPow2(gain_code << L_tmp_e);
  1837. - L_tmp = fMult(ener_code, L_tmp);
  1838. - L_tmp_e = 2 * SF_GAIN_C + ener_code_e - 2 * L_tmp_e;
  1839. -
  1840. - /* Find common exponent */
  1841. - {
  1842. - FIXP_DBL num, den;
  1843. - int exp_diff;
  1844. -
  1845. - exp_diff = ener_exc_e - L_tmp_e;
  1846. - if (exp_diff >= 0) {
  1847. - ener_exc >>= 1;
  1848. - if (exp_diff <= DFRACT_BITS - 2) {
  1849. - L_tmp >>= exp_diff + 1;
  1850. - } else {
  1851. - L_tmp = (FIXP_DBL)0;
  1852. - }
  1853. - den = ener_exc + L_tmp;
  1854. - if (ener_exc_e < DFRACT_BITS - 1) {
  1855. - den += scaleValue(FL2FXCONST_DBL(0.01f), -ener_exc_e - 1);
  1856. - }
  1857. - } else {
  1858. - if (exp_diff >= -(DFRACT_BITS - 2)) {
  1859. - ener_exc >>= 1 - exp_diff;
  1860. - } else {
  1861. - ener_exc = (FIXP_DBL)0;
  1862. - }
  1863. - L_tmp >>= 1;
  1864. - den = ener_exc + L_tmp;
  1865. - if (L_tmp_e < DFRACT_BITS - 1) {
  1866. - den += scaleValue(FL2FXCONST_DBL(0.01f), -L_tmp_e - 1);
  1867. - }
  1868. - }
  1869. - num = (ener_exc - L_tmp);
  1870. - num >>= SF_PFAC;
  1871. -
  1872. - if (den > (FIXP_DBL)0) {
  1873. - if (ener_exc > L_tmp) {
  1874. - period_fac = schur_div(num, den, 16);
  1875. - } else {
  1876. - period_fac = -schur_div(-num, den, 16);
  1877. - }
  1878. - } else {
  1879. - period_fac = (FIXP_DBL)MAXVAL_DBL;
  1880. - }
  1881. - }
  1882. -
  1883. - /* exponent = SF_PFAC */
  1884. - return period_fac;
  1885. -}
  1886. -
  1887. -/*------------------------------------------------------------*
  1888. - * noise enhancer *
  1889. - * ~~~~~~~~~~~~~~ *
  1890. - * - Enhance excitation on noise. (modify gain of code) *
  1891. - * If signal is noisy and LPC filter is stable, move gain *
  1892. - * of code 1.5 dB toward gain of code threshold. *
  1893. - * This decrease by 3 dB noise energy variation. *
  1894. - *------------------------------------------------------------*/
  1895. -/**
  1896. - * \brief Enhance excitation on noise. (modify gain of code)
  1897. - * \param[in] gain_code Quantized codebook gain g_c, exponent = SF_GAIN_C.
  1898. - * \param[in] period_fac periodicity factor, exponent = SF_PFAC.
  1899. - * \param[in] stab_fac stability factor, exponent = SF_STAB.
  1900. - * \param[in,out] p_gc_threshold modified gain of previous subframe.
  1901. - * \return gain_code smoothed gain of code g_sc, exponent = SF_GAIN_C.
  1902. - */
  1903. -static FIXP_DBL
  1904. -noise_enhancer(/* (o) : smoothed gain g_sc SF_GAIN_C */
  1905. - FIXP_DBL gain_code, /* (i) : Quantized codebook gain SF_GAIN_C */
  1906. - FIXP_DBL period_fac, /* (i) : periodicity factor (-1=unvoiced to
  1907. - 1=voiced), SF_PFAC */
  1908. - FIXP_SGL stab_fac, /* (i) : stability factor (0 <= ... < 1.0)
  1909. - SF_STAB */
  1910. - FIXP_DBL
  1911. - *p_gc_threshold) /* (io): gain of code threshold SF_GAIN_C */
  1912. -{
  1913. - FIXP_DBL fac, L_tmp, gc_thres;
  1914. -
  1915. - gc_thres = *p_gc_threshold;
  1916. -
  1917. - L_tmp = gain_code;
  1918. - if (L_tmp < gc_thres) {
  1919. - L_tmp += fMultDiv2(gain_code,
  1920. - FL2FXCONST_SGL(2.0 * 0.19f)); /* +1.5dB => *(1.0+0.19) */
  1921. - if (L_tmp > gc_thres) {
  1922. - L_tmp = gc_thres;
  1923. - }
  1924. - } else {
  1925. - L_tmp = fMult(gain_code,
  1926. - FL2FXCONST_SGL(1.0f / 1.19f)); /* -1.5dB => *10^(-1.5/20) */
  1927. - if (L_tmp < gc_thres) {
  1928. - L_tmp = gc_thres;
  1929. - }
  1930. - }
  1931. - *p_gc_threshold = L_tmp;
  1932. -
  1933. - /* voicing factor lambda = 0.5*(1-period_fac) */
  1934. - /* gain smoothing factor S_m = lambda*stab_fac (=fac)
  1935. - = 0.5(stab_fac - stab_fac * period_fac) */
  1936. - fac = (FX_SGL2FX_DBL(stab_fac) >> (SF_PFAC + 1)) -
  1937. - fMultDiv2(stab_fac, period_fac);
  1938. - /* fac_e = SF_PFAC + SF_STAB */
  1939. - FDK_ASSERT(fac >= (FIXP_DBL)0);
  1940. -
  1941. - /* gain_code = (float)((fac*tmp) + ((1.0-fac)*gain_code)); */
  1942. - gain_code = fMult(fac, L_tmp) -
  1943. - fMult(FL2FXCONST_DBL(-1.0f / (1 << (SF_PFAC + SF_STAB))) + fac,
  1944. - gain_code);
  1945. - gain_code <<= (SF_PFAC + SF_STAB);
  1946. -
  1947. - return gain_code;
  1948. -}
  1949. -
  1950. -/**
  1951. - * \brief Update adaptive codebook u'(n) (exc)
  1952. - * Enhance pitch of c(n) and build post-processed excitation u(n) (exc2)
  1953. - * \param[in] code innovative codevector c(n), exponent = SF_CODE.
  1954. - * \param[in,out] exc filtered adaptive codebook v(n), exponent = SF_EXC.
  1955. - * \param[in] gain_pit adaptive codebook gain, exponent = SF_GAIN_P.
  1956. - * \param[in] gain_code innovative codebook gain g_c, exponent = SF_GAIN_C.
  1957. - * \param[in] gain_code_smoothed smoothed innov. codebook gain g_sc, exponent =
  1958. - * SF_GAIN_C.
  1959. - * \param[in] period_fac periodicity factor r_v, exponent = SF_PFAC.
  1960. - * \param[out] exc2 post-processed excitation u(n), exponent = SF_EXC.
  1961. - */
  1962. -void BuildAdaptiveExcitation(
  1963. - FIXP_COD code[], /* (i) : algebraic codevector c(n) Q9 */
  1964. - FIXP_DBL exc[], /* (io): filtered adaptive codebook v(n) Q15 */
  1965. - FIXP_SGL gain_pit, /* (i) : adaptive codebook gain g_p Q14 */
  1966. - FIXP_DBL gain_code, /* (i) : innovative codebook gain g_c Q16 */
  1967. - FIXP_DBL gain_code_smoothed, /* (i) : smoothed innov. codebook gain g_sc
  1968. - Q16 */
  1969. - FIXP_DBL period_fac, /* (i) : periodicity factor r_v Q15 */
  1970. - FIXP_DBL exc2[] /* (o) : post-processed excitation u(n) Q15 */
  1971. -) {
  1972. -/* Note: code[L_SUBFR] and exc2[L_SUBFR] share the same memory!
  1973. - If exc2[i] is written, code[i] will be destroyed!
  1974. -*/
  1975. -#define SF (SF_CODE + SF_GAIN_C + 1 - SF_EXC)
  1976. -
  1977. - int i;
  1978. - FIXP_DBL tmp, cpe, code_smooth_prev, code_smooth;
  1979. -
  1980. - FIXP_COD code_i;
  1981. - FIXP_DBL cpe_code_smooth, cpe_code_smooth_prev;
  1982. -
  1983. - /* cpe = (1+r_v)/8 * 2 ; ( SF = -1) */
  1984. - cpe = (period_fac >> (2 - SF_PFAC)) + FL2FXCONST_DBL(0.25f);
  1985. -
  1986. - /* u'(n) */
  1987. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1); /* v(0)*g_p */
  1988. - *exc++ = tmp + (fMultDiv2(code[0], gain_code) << SF);
  1989. -
  1990. - /* u(n) */
  1991. - code_smooth_prev = fMultDiv2(*code++, gain_code_smoothed)
  1992. - << SF; /* c(0) * g_sc */
  1993. - code_i = *code++;
  1994. - code_smooth = fMultDiv2(code_i, gain_code_smoothed) << SF; /* c(1) * g_sc */
  1995. - tmp += code_smooth_prev; /* tmp = v(0)*g_p + c(0)*g_sc */
  1996. - cpe_code_smooth = fMultDiv2(cpe, code_smooth);
  1997. - *exc2++ = tmp - cpe_code_smooth;
  1998. - cpe_code_smooth_prev = fMultDiv2(cpe, code_smooth_prev);
  1999. -
  2000. - i = L_SUBFR - 2;
  2001. - do /* ARM926: 22 cycles per iteration */
  2002. - {
  2003. - /* u'(n) */
  2004. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1);
  2005. - *exc++ = tmp + (fMultDiv2(code_i, gain_code) << SF);
  2006. - /* u(n) */
  2007. - tmp += code_smooth; /* += g_sc * c(i) */
  2008. - tmp -= cpe_code_smooth_prev;
  2009. - cpe_code_smooth_prev = cpe_code_smooth;
  2010. - code_i = *code++;
  2011. - code_smooth = fMultDiv2(code_i, gain_code_smoothed) << SF;
  2012. - cpe_code_smooth = fMultDiv2(cpe, code_smooth);
  2013. - *exc2++ = tmp - cpe_code_smooth; /* tmp - c_pe * g_sc * c(i+1) */
  2014. - } while (--i != 0);
  2015. -
  2016. - /* u'(n) */
  2017. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1);
  2018. - *exc = tmp + (fMultDiv2(code_i, gain_code) << SF);
  2019. - /* u(n) */
  2020. - tmp += code_smooth;
  2021. - tmp -= cpe_code_smooth_prev;
  2022. - *exc2++ = tmp;
  2023. -
  2024. - return;
  2025. -}
  2026. -
  2027. -/**
  2028. - * \brief Interpolate LPC vector in LSP domain for current subframe and convert
  2029. - * to LP domain
  2030. - * \param[in] lsp_old LPC vector (LSP domain) corresponding to the beginning of
  2031. - * current ACELP frame.
  2032. - * \param[in] lsp_new LPC vector (LSP domain) corresponding to the end of
  2033. - * current ACELP frame.
  2034. - * \param[in] subfr_nr number of current ACELP subframe 0..3.
  2035. - * \param[in] nb_subfr total number of ACELP subframes in this frame.
  2036. - * \param[out] A LP filter coefficients for current ACELP subframe, exponent =
  2037. - * SF_A_COEFFS.
  2038. - */
  2039. -/* static */
  2040. -void int_lpc_acelp(
  2041. - const FIXP_LPC lsp_old[], /* input : LSPs from past frame */
  2042. - const FIXP_LPC lsp_new[], /* input : LSPs from present frame */
  2043. - int subfr_nr, int nb_subfr,
  2044. - FIXP_LPC
  2045. - A[], /* output: interpolated LP coefficients for current subframe */
  2046. - INT *A_exp) {
  2047. - int i;
  2048. - FIXP_LPC lsp_interpol[M_LP_FILTER_ORDER];
  2049. - FIXP_SGL fac_old, fac_new;
  2050. -
  2051. - FDK_ASSERT((nb_subfr == 3) || (nb_subfr == 4));
  2052. -
  2053. - fac_old = lsp_interpol_factor[nb_subfr & 0x1][(nb_subfr - 1) - subfr_nr];
  2054. - fac_new = lsp_interpol_factor[nb_subfr & 0x1][subfr_nr];
  2055. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  2056. - lsp_interpol[i] = FX_DBL2FX_LPC(
  2057. - (fMultDiv2(lsp_old[i], fac_old) + fMultDiv2(lsp_new[i], fac_new)) << 1);
  2058. - }
  2059. -
  2060. - E_LPC_f_lsp_a_conversion(lsp_interpol, A, A_exp);
  2061. -
  2062. - return;
  2063. -}
  2064. -
  2065. -/**
  2066. - * \brief Perform LP synthesis by filtering the post-processed excitation u(n)
  2067. - * through the LP synthesis filter 1/A(z)
  2068. - * \param[in] a LP filter coefficients, exponent = SF_A_COEFFS.
  2069. - * \param[in] length length of input/output signal.
  2070. - * \param[in] x post-processed excitation u(n).
  2071. - * \param[in,out] y LP synthesis signal and filter memory
  2072. - * y[-M_LP_FILTER_ORDER..-1].
  2073. - */
  2074. -
  2075. -/* static */
  2076. -void Syn_filt(const FIXP_LPC a[], /* (i) : a[m] prediction coefficients Q12 */
  2077. - const INT a_exp,
  2078. - INT length, /* (i) : length of input/output signal (64|128) */
  2079. - FIXP_DBL x[], /* (i) : input signal Qx */
  2080. - FIXP_DBL y[] /* (i/o) : filter states / output signal Qx-s*/
  2081. -) {
  2082. - int i, j;
  2083. - FIXP_DBL L_tmp;
  2084. -
  2085. - for (i = 0; i < length; i++) {
  2086. - L_tmp = (FIXP_DBL)0;
  2087. -
  2088. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  2089. - L_tmp -= fMultDiv2(a[j], y[i - (j + 1)]) >> (LP_FILTER_SCALE - 1);
  2090. - }
  2091. -
  2092. - L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE);
  2093. - y[i] = fAddSaturate(L_tmp, x[i]);
  2094. - }
  2095. -
  2096. - return;
  2097. -}
  2098. -
  2099. -/**
  2100. - * \brief Calculate de-emphasis 1/(1 - mu z^-1) on input signal.
  2101. - * \param[in] x input signal.
  2102. - * \param[out] y output signal.
  2103. - * \param[in] L length of signal.
  2104. - * \param[in,out] mem memory (signal[-1]).
  2105. - */
  2106. -/* static */
  2107. -void Deemph(FIXP_DBL *x, FIXP_DBL *y, int L, FIXP_DBL *mem) {
  2108. - int i;
  2109. - FIXP_DBL yi = *mem;
  2110. -
  2111. - for (i = 0; i < L; i++) {
  2112. - FIXP_DBL xi = x[i] >> 1;
  2113. - xi = fMultAddDiv2(xi, PREEMPH_FAC, yi);
  2114. - yi = SATURATE_LEFT_SHIFT(xi, 1, 32);
  2115. - y[i] = yi;
  2116. - }
  2117. - *mem = yi;
  2118. - return;
  2119. -}
  2120. -
  2121. -/**
  2122. - * \brief Compute the LP residual by filtering the input speech through the
  2123. - * analysis filter A(z).
  2124. - * \param[in] a LP filter coefficients, exponent = SF_A_COEFFS
  2125. - * \param[in] x input signal (note that values x[-m..-1] are needed), exponent =
  2126. - * SF_SYNTH
  2127. - * \param[out] y output signal (residual), exponent = SF_EXC
  2128. - * \param[in] l length of filtering
  2129. - */
  2130. -/* static */
  2131. -void E_UTIL_residu(const FIXP_LPC *a, const INT a_exp, FIXP_DBL *x, FIXP_DBL *y,
  2132. - INT l) {
  2133. - FIXP_DBL s;
  2134. - INT i, j;
  2135. -
  2136. - /* (note that values x[-m..-1] are needed) */
  2137. - for (i = 0; i < l; i++) {
  2138. - s = (FIXP_DBL)0;
  2139. -
  2140. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  2141. - s += fMultDiv2(a[j], x[i - j - 1]) >> (LP_FILTER_SCALE - 1);
  2142. - }
  2143. -
  2144. - s = scaleValue(s, a_exp + LP_FILTER_SCALE);
  2145. - y[i] = fAddSaturate(s, x[i]);
  2146. - }
  2147. -
  2148. - return;
  2149. -}
  2150. -
  2151. -/* use to map subfr number to number of bits used for acb_index */
  2152. -static const UCHAR num_acb_idx_bits_table[2][NB_SUBFR] = {
  2153. - {9, 6, 9, 6}, /* coreCoderFrameLength == 1024 */
  2154. - {9, 6, 6, 0} /* coreCoderFrameLength == 768 */
  2155. -};
  2156. -
  2157. -static int DecodePitchLag(HANDLE_FDK_BITSTREAM hBs,
  2158. - const UCHAR num_acb_idx_bits,
  2159. - const int PIT_MIN, /* TMIN */
  2160. - const int PIT_FR2, /* TFR2 */
  2161. - const int PIT_FR1, /* TFR1 */
  2162. - const int PIT_MAX, /* TMAX */
  2163. - int *pT0, int *pT0_frac, int *pT0_min, int *pT0_max) {
  2164. - int acb_idx;
  2165. - int error = 0;
  2166. - int T0, T0_frac;
  2167. -
  2168. - FDK_ASSERT((num_acb_idx_bits == 9) || (num_acb_idx_bits == 6));
  2169. -
  2170. - acb_idx = FDKreadBits(hBs, num_acb_idx_bits);
  2171. -
  2172. - if (num_acb_idx_bits == 6) {
  2173. - /* When the pitch value is encoded on 6 bits, a pitch resolution of 1/4 is
  2174. - always used in the range [T1-8, T1+7.75], where T1 is nearest integer to
  2175. - the fractional pitch lag of the previous subframe.
  2176. - */
  2177. - T0 = *pT0_min + acb_idx / 4;
  2178. - T0_frac = acb_idx & 0x3;
  2179. - } else { /* num_acb_idx_bits == 9 */
  2180. - /* When the pitch value is encoded on 9 bits, a fractional pitch delay is
  2181. - used with resolutions 0.25 in the range [TMIN, TFR2-0.25], resolutions
  2182. - 0.5 in the range [TFR2, TFR1-0.5], and integers only in the range [TFR1,
  2183. - TMAX]. NOTE: for small sampling rates TMAX can get smaller than TFR1.
  2184. - */
  2185. - int T0_min, T0_max;
  2186. -
  2187. - if (acb_idx < (PIT_FR2 - PIT_MIN) * 4) {
  2188. - /* first interval with 0.25 pitch resolution */
  2189. - T0 = PIT_MIN + (acb_idx / 4);
  2190. - T0_frac = acb_idx & 0x3;
  2191. - } else if (acb_idx < ((PIT_FR2 - PIT_MIN) * 4 + (PIT_FR1 - PIT_FR2) * 2)) {
  2192. - /* second interval with 0.5 pitch resolution */
  2193. - acb_idx -= (PIT_FR2 - PIT_MIN) * 4;
  2194. - T0 = PIT_FR2 + (acb_idx / 2);
  2195. - T0_frac = (acb_idx & 0x1) * 2;
  2196. - } else {
  2197. - /* third interval with 1.0 pitch resolution */
  2198. - T0 = acb_idx + PIT_FR1 - ((PIT_FR2 - PIT_MIN) * 4) -
  2199. - ((PIT_FR1 - PIT_FR2) * 2);
  2200. - T0_frac = 0;
  2201. - }
  2202. - /* find T0_min and T0_max for subframe 1 or 3 */
  2203. - T0_min = T0 - 8;
  2204. - if (T0_min < PIT_MIN) {
  2205. - T0_min = PIT_MIN;
  2206. - }
  2207. - T0_max = T0_min + 15;
  2208. - if (T0_max > PIT_MAX) {
  2209. - T0_max = PIT_MAX;
  2210. - T0_min = T0_max - 15;
  2211. - }
  2212. - *pT0_min = T0_min;
  2213. - *pT0_max = T0_max;
  2214. - }
  2215. - *pT0 = T0;
  2216. - *pT0_frac = T0_frac;
  2217. -
  2218. - return error;
  2219. -}
  2220. -static void ConcealPitchLag(CAcelpStaticMem *acelp_mem, const int PIT_MAX,
  2221. - int *pT0, int *pT0_frac) {
  2222. - USHORT *pold_T0 = &acelp_mem->old_T0;
  2223. - UCHAR *pold_T0_frac = &acelp_mem->old_T0_frac;
  2224. -
  2225. - if ((int)*pold_T0 >= PIT_MAX) {
  2226. - *pold_T0 = (UCHAR)(PIT_MAX - 5);
  2227. - }
  2228. - *pT0 = (int)*pold_T0;
  2229. - *pT0_frac = (int)*pold_T0_frac;
  2230. -}
  2231. -
  2232. -static UCHAR tab_coremode2nbits[8] = {20, 28, 36, 44, 52, 64, 12, 16};
  2233. -
  2234. -static int MapCoreMode2NBits(int core_mode) {
  2235. - return (int)tab_coremode2nbits[core_mode];
  2236. -}
  2237. -
  2238. -void CLpd_AcelpDecode(CAcelpStaticMem *acelp_mem, INT i_offset,
  2239. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  2240. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  2241. - FIXP_SGL stab_fac, CAcelpChannelData *pAcelpData,
  2242. - INT numLostSubframes, int lastLpcLost, int frameCnt,
  2243. - FIXP_DBL synth[], int pT[], FIXP_DBL *pit_gain,
  2244. - INT coreCoderFrameLength) {
  2245. - int i_subfr, subfr_nr, l_div, T;
  2246. - int T0 = -1, T0_frac = -1; /* mark invalid */
  2247. -
  2248. - int pit_gain_index = 0;
  2249. -
  2250. - const int PIT_MAX = PIT_MAX_12k8 + (6 * i_offset); /* maximum pitch lag */
  2251. -
  2252. - FIXP_COD *code;
  2253. - FIXP_DBL *exc2;
  2254. - FIXP_DBL *syn;
  2255. - FIXP_DBL *exc;
  2256. - FIXP_LPC A[M_LP_FILTER_ORDER];
  2257. - INT A_exp;
  2258. -
  2259. - FIXP_DBL period_fac;
  2260. - FIXP_SGL gain_pit;
  2261. - FIXP_DBL gain_code, gain_code_smooth, Ener_code;
  2262. - int Ener_code_e;
  2263. - int n;
  2264. - int bfi = (numLostSubframes > 0) ? 1 : 0;
  2265. -
  2266. - C_ALLOC_SCRATCH_START(
  2267. - exc_buf, FIXP_DBL,
  2268. - PIT_MAX_MAX + L_INTERPOL + L_DIV + 1); /* 411 + 17 + 256 + 1 = 685 */
  2269. - C_ALLOC_SCRATCH_START(syn_buf, FIXP_DBL,
  2270. - M_LP_FILTER_ORDER + L_DIV); /* 16 + 256 = 272 */
  2271. - /* use same memory for code[L_SUBFR] and exc2[L_SUBFR] */
  2272. - C_ALLOC_SCRATCH_START(tmp_buf, FIXP_DBL, L_SUBFR); /* 64 */
  2273. - /* make sure they don't overlap if they are accessed alternatingly in
  2274. - * BuildAdaptiveExcitation() */
  2275. -#if (COD_BITS == FRACT_BITS)
  2276. - code = (FIXP_COD *)(tmp_buf + L_SUBFR / 2);
  2277. -#elif (COD_BITS == DFRACT_BITS)
  2278. - code = (FIXP_COD *)tmp_buf;
  2279. -#endif
  2280. - exc2 = (FIXP_DBL *)tmp_buf;
  2281. -
  2282. - syn = syn_buf + M_LP_FILTER_ORDER;
  2283. - exc = exc_buf + PIT_MAX_MAX + L_INTERPOL;
  2284. -
  2285. - FDKmemcpy(syn_buf, acelp_mem->old_syn_mem,
  2286. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2287. - FDKmemcpy(exc_buf, acelp_mem->old_exc_mem,
  2288. - (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2289. -
  2290. - FDKmemclear(exc_buf + (PIT_MAX_MAX + L_INTERPOL),
  2291. - (L_DIV + 1) * sizeof(FIXP_DBL));
  2292. -
  2293. - l_div = coreCoderFrameLength / NB_DIV;
  2294. -
  2295. - for (i_subfr = 0, subfr_nr = 0; i_subfr < l_div;
  2296. - i_subfr += L_SUBFR, subfr_nr++) {
  2297. - /*-------------------------------------------------*
  2298. - * - Decode pitch lag (T0 and T0_frac) *
  2299. - *-------------------------------------------------*/
  2300. - if (bfi) {
  2301. - ConcealPitchLag(acelp_mem, PIT_MAX, &T0, &T0_frac);
  2302. - } else {
  2303. - T0 = (int)pAcelpData->T0[subfr_nr];
  2304. - T0_frac = (int)pAcelpData->T0_frac[subfr_nr];
  2305. - }
  2306. -
  2307. - /*-------------------------------------------------*
  2308. - * - Find the pitch gain, the interpolation filter *
  2309. - * and the adaptive codebook vector. *
  2310. - *-------------------------------------------------*/
  2311. - Pred_lt4(&exc[i_subfr], T0, T0_frac);
  2312. -
  2313. - if ((!bfi && pAcelpData->ltp_filtering_flag[subfr_nr] == 0) ||
  2314. - (bfi && numLostSubframes == 1 && stab_fac < FL2FXCONST_SGL(0.25f))) {
  2315. - /* find pitch excitation with lp filter: v'(n) => v(n) */
  2316. - Pred_lt4_postfilter(&exc[i_subfr]);
  2317. - }
  2318. -
  2319. - /*-------------------------------------------------------*
  2320. - * - Decode innovative codebook. *
  2321. - * - Add the fixed-gain pitch contribution to code[]. *
  2322. - *-------------------------------------------------------*/
  2323. - if (bfi) {
  2324. - for (n = 0; n < L_SUBFR; n++) {
  2325. - code[n] =
  2326. - FX_SGL2FX_COD((FIXP_SGL)E_UTIL_random(&acelp_mem->seed_ace)) >> 4;
  2327. - }
  2328. - } else {
  2329. - int nbits = MapCoreMode2NBits((int)pAcelpData->acelp_core_mode);
  2330. - D_ACELP_decode_4t64(pAcelpData->icb_index[subfr_nr], nbits, &code[0]);
  2331. - }
  2332. -
  2333. - T = T0;
  2334. - if (T0_frac > 2) {
  2335. - T += 1;
  2336. - }
  2337. -
  2338. - Preemph_code(code);
  2339. - Pit_shrp(code, T);
  2340. -
  2341. - /* Output pitch lag for bass post-filter */
  2342. - if (T > PIT_MAX) {
  2343. - pT[subfr_nr] = PIT_MAX;
  2344. - } else {
  2345. - pT[subfr_nr] = T;
  2346. - }
  2347. - D_gain2_plus(
  2348. - pAcelpData->gains[subfr_nr],
  2349. - code, /* (i) : Innovative code vector, exponent = SF_CODE */
  2350. - &gain_pit, /* (o) : Quantized pitch gain, exponent = SF_GAIN_P */
  2351. - &gain_code, /* (o) : Quantized codebook gain */
  2352. - pAcelpData
  2353. - ->mean_energy, /* (i) : mean_ener defined in open-loop (2 bits) */
  2354. - bfi, &acelp_mem->past_gpit, &acelp_mem->past_gcode,
  2355. - &Ener_code, /* (o) : Innovative code vector energy */
  2356. - &Ener_code_e); /* (o) : Innovative code vector energy exponent */
  2357. -
  2358. - pit_gain[pit_gain_index++] = FX_SGL2FX_DBL(gain_pit);
  2359. -
  2360. - /* calc periodicity factor r_v */
  2361. - period_fac =
  2362. - calc_period_factor(/* (o) : factor (-1=unvoiced to 1=voiced) */
  2363. - &exc[i_subfr], /* (i) : pitch excitation, exponent =
  2364. - SF_EXC */
  2365. - gain_pit, /* (i) : gain of pitch, exponent =
  2366. - SF_GAIN_P */
  2367. - gain_code, /* (i) : gain of code */
  2368. - Ener_code, /* (i) : Energy of code[] */
  2369. - Ener_code_e); /* (i) : Exponent of energy of code[]
  2370. - */
  2371. -
  2372. - if (lastLpcLost && frameCnt == 0) {
  2373. - if (gain_pit > FL2FXCONST_SGL(1.0f / (1 << SF_GAIN_P))) {
  2374. - gain_pit = FL2FXCONST_SGL(1.0f / (1 << SF_GAIN_P));
  2375. - }
  2376. - }
  2377. -
  2378. - gain_code_smooth =
  2379. - noise_enhancer(/* (o) : smoothed gain g_sc exponent = SF_GAIN_C */
  2380. - gain_code, /* (i) : Quantized codebook gain */
  2381. - period_fac, /* (i) : periodicity factor (-1=unvoiced to
  2382. - 1=voiced) */
  2383. - stab_fac, /* (i) : stability factor (0 <= ... < 1),
  2384. - exponent = 1 */
  2385. - &acelp_mem->gc_threshold);
  2386. -
  2387. - /* Compute adaptive codebook update u'(n), pitch enhancement c'(n) and
  2388. - * post-processed excitation u(n). */
  2389. - BuildAdaptiveExcitation(code, exc + i_subfr, gain_pit, gain_code,
  2390. - gain_code_smooth, period_fac, exc2);
  2391. -
  2392. - /* Interpolate filter coeffs for current subframe in lsp domain and convert
  2393. - * to LP domain */
  2394. - int_lpc_acelp(lsp_old, /* input : LSPs from past frame */
  2395. - lsp_new, /* input : LSPs from present frame */
  2396. - subfr_nr, /* input : ACELP subframe index */
  2397. - coreCoderFrameLength / L_DIV,
  2398. - A, /* output: LP coefficients of this subframe */
  2399. - &A_exp);
  2400. -
  2401. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2402. - A_exp, L_SUBFR, /* (i) : length */
  2403. - exc2, /* (i) : input signal */
  2404. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2405. - );
  2406. -
  2407. - } /* end of subframe loop */
  2408. -
  2409. - /* update pitch value for bfi procedure */
  2410. - acelp_mem->old_T0_frac = T0_frac;
  2411. - acelp_mem->old_T0 = T0;
  2412. -
  2413. - /* save old excitation and old synthesis memory for next ACELP frame */
  2414. - FDKmemcpy(acelp_mem->old_exc_mem, exc + l_div - (PIT_MAX_MAX + L_INTERPOL),
  2415. - sizeof(FIXP_DBL) * (PIT_MAX_MAX + L_INTERPOL));
  2416. - FDKmemcpy(acelp_mem->old_syn_mem, syn_buf + l_div,
  2417. - sizeof(FIXP_DBL) * M_LP_FILTER_ORDER);
  2418. -
  2419. - Deemph(syn, synth, l_div,
  2420. - &acelp_mem->de_emph_mem); /* ref soft: mem = synth[-1] */
  2421. -
  2422. - scaleValues(synth, l_div, -ACELP_OUTSCALE);
  2423. - acelp_mem->deemph_mem_wsyn = acelp_mem->de_emph_mem;
  2424. -
  2425. - C_ALLOC_SCRATCH_END(tmp_buf, FIXP_DBL, L_SUBFR);
  2426. - C_ALLOC_SCRATCH_END(syn_buf, FIXP_DBL, M_LP_FILTER_ORDER + L_DIV);
  2427. - C_ALLOC_SCRATCH_END(exc_buf, FIXP_DBL, PIT_MAX_MAX + L_INTERPOL + L_DIV + 1);
  2428. - return;
  2429. -}
  2430. -
  2431. -void CLpd_AcelpReset(CAcelpStaticMem *acelp) {
  2432. - acelp->gc_threshold = (FIXP_DBL)0;
  2433. -
  2434. - acelp->past_gpit = (FIXP_SGL)0;
  2435. - acelp->past_gcode = (FIXP_DBL)0;
  2436. - acelp->old_T0 = 64;
  2437. - acelp->old_T0_frac = 0;
  2438. - acelp->deemph_mem_wsyn = (FIXP_DBL)0;
  2439. - acelp->wsyn_rms = (FIXP_DBL)0;
  2440. - acelp->seed_ace = 0;
  2441. -}
  2442. -
  2443. -/* TCX time domain concealment */
  2444. -/* Compare to figure 13a on page 54 in 3GPP TS 26.290 */
  2445. -void CLpd_TcxTDConceal(CAcelpStaticMem *acelp_mem, SHORT *pitch,
  2446. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  2447. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  2448. - const FIXP_SGL stab_fac, INT nLostSf, FIXP_DBL synth[],
  2449. - INT coreCoderFrameLength, UCHAR last_tcx_noise_factor) {
  2450. - /* repeat past excitation with pitch from previous decoded TCX frame */
  2451. - C_ALLOC_SCRATCH_START(
  2452. - exc_buf, FIXP_DBL,
  2453. - PIT_MAX_MAX + L_INTERPOL + L_DIV); /* 411 + 17 + 256 + 1 = */
  2454. - C_ALLOC_SCRATCH_START(syn_buf, FIXP_DBL,
  2455. - M_LP_FILTER_ORDER + L_DIV); /* 256 + 16 = */
  2456. - /* += */
  2457. - FIXP_DBL ns_buf[L_DIV + 1];
  2458. - FIXP_DBL *syn = syn_buf + M_LP_FILTER_ORDER;
  2459. - FIXP_DBL *exc = exc_buf + PIT_MAX_MAX + L_INTERPOL;
  2460. - FIXP_DBL *ns = ns_buf + 1;
  2461. - FIXP_DBL tmp, fact_exc;
  2462. - INT T = fMin(*pitch, (SHORT)PIT_MAX_MAX);
  2463. - int i, i_subfr, subfr_nr;
  2464. - int lDiv = coreCoderFrameLength / NB_DIV;
  2465. -
  2466. - FDKmemcpy(syn_buf, acelp_mem->old_syn_mem,
  2467. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2468. - FDKmemcpy(exc_buf, acelp_mem->old_exc_mem,
  2469. - (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2470. -
  2471. - /* if we lost all packets (i.e. 1 packet of TCX-20 ms, 2 packets of
  2472. - the TCX-40 ms or 4 packets of the TCX-80ms), we lost the whole
  2473. - coded frame extrapolation strategy: repeat lost excitation and
  2474. - use extrapolated LSFs */
  2475. -
  2476. - /* AMR-WB+ like TCX TD concealment */
  2477. -
  2478. - /* number of lost frame cmpt */
  2479. - if (nLostSf < 2) {
  2480. - fact_exc = FL2FXCONST_DBL(0.8f);
  2481. - } else {
  2482. - fact_exc = FL2FXCONST_DBL(0.4f);
  2483. - }
  2484. -
  2485. - /* repeat past excitation */
  2486. - for (i = 0; i < lDiv; i++) {
  2487. - exc[i] = fMult(fact_exc, exc[i - T]);
  2488. - }
  2489. -
  2490. - tmp = fMult(fact_exc, acelp_mem->wsyn_rms);
  2491. - acelp_mem->wsyn_rms = tmp;
  2492. -
  2493. - /* init deemph_mem_wsyn */
  2494. - acelp_mem->deemph_mem_wsyn = exc[-1];
  2495. -
  2496. - ns[-1] = acelp_mem->deemph_mem_wsyn;
  2497. -
  2498. - for (i_subfr = 0, subfr_nr = 0; i_subfr < lDiv;
  2499. - i_subfr += L_SUBFR, subfr_nr++) {
  2500. - FIXP_DBL tRes[L_SUBFR];
  2501. - FIXP_LPC A[M_LP_FILTER_ORDER];
  2502. - INT A_exp;
  2503. -
  2504. - /* interpolate LPC coefficients */
  2505. - int_lpc_acelp(lsp_old, lsp_new, subfr_nr, lDiv / L_SUBFR, A, &A_exp);
  2506. -
  2507. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2508. - A_exp, L_SUBFR, /* (i) : length */
  2509. - &exc[i_subfr], /* (i) : input signal */
  2510. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2511. - );
  2512. -
  2513. - E_LPC_a_weight(
  2514. - A, A,
  2515. - M_LP_FILTER_ORDER); /* overwrite A as it is not needed any longer */
  2516. -
  2517. - E_UTIL_residu(A, A_exp, &syn[i_subfr], tRes, L_SUBFR);
  2518. -
  2519. - Deemph(tRes, &ns[i_subfr], L_SUBFR, &acelp_mem->deemph_mem_wsyn);
  2520. -
  2521. - /* Amplitude limiter (saturate at wsyn_rms) */
  2522. - for (i = i_subfr; i < i_subfr + L_SUBFR; i++) {
  2523. - if (ns[i] > tmp) {
  2524. - ns[i] = tmp;
  2525. - } else {
  2526. - if (ns[i] < -tmp) {
  2527. - ns[i] = -tmp;
  2528. - }
  2529. - }
  2530. - }
  2531. -
  2532. - E_UTIL_preemph(&ns[i_subfr], tRes, L_SUBFR);
  2533. -
  2534. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2535. - A_exp, L_SUBFR, /* (i) : length */
  2536. - tRes, /* (i) : input signal */
  2537. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2538. - );
  2539. -
  2540. - FDKmemmove(&synth[i_subfr], &syn[i_subfr], L_SUBFR * sizeof(FIXP_DBL));
  2541. - }
  2542. -
  2543. - /* save old excitation and old synthesis memory for next ACELP frame */
  2544. - FDKmemcpy(acelp_mem->old_exc_mem, exc + lDiv - (PIT_MAX_MAX + L_INTERPOL),
  2545. - sizeof(FIXP_DBL) * (PIT_MAX_MAX + L_INTERPOL));
  2546. - FDKmemcpy(acelp_mem->old_syn_mem, syn_buf + lDiv,
  2547. - sizeof(FIXP_DBL) * M_LP_FILTER_ORDER);
  2548. - acelp_mem->de_emph_mem = acelp_mem->deemph_mem_wsyn;
  2549. -
  2550. - C_ALLOC_SCRATCH_END(syn_buf, FIXP_DBL, M_LP_FILTER_ORDER + L_DIV);
  2551. - C_ALLOC_SCRATCH_END(exc_buf, FIXP_DBL, PIT_MAX_MAX + L_INTERPOL + L_DIV);
  2552. -}
  2553. -
  2554. -void Acelp_PreProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2555. - INT *old_T_pf, FIXP_DBL *pit_gain,
  2556. - FIXP_DBL *old_gain_pf, INT samplingRate, INT *i_offset,
  2557. - INT coreCoderFrameLength, INT synSfd,
  2558. - INT nbSubfrSuperfr) {
  2559. - int n;
  2560. -
  2561. - /* init beginning of synth_buf with old synthesis from previous frame */
  2562. - FDKmemcpy(synth_buf, old_synth, sizeof(FIXP_DBL) * (PIT_MAX_MAX - BPF_DELAY));
  2563. -
  2564. - /* calculate pitch lag offset for ACELP decoder */
  2565. - *i_offset =
  2566. - (samplingRate * PIT_MIN_12k8 + (FSCALE_DENOM / 2)) / FSCALE_DENOM -
  2567. - PIT_MIN_12k8;
  2568. -
  2569. - /* for bass postfilter */
  2570. - for (n = 0; n < synSfd; n++) {
  2571. - pitch[n] = old_T_pf[n];
  2572. - pit_gain[n] = old_gain_pf[n];
  2573. - }
  2574. - for (n = 0; n < nbSubfrSuperfr; n++) {
  2575. - pitch[n + synSfd] = L_SUBFR;
  2576. - pit_gain[n + synSfd] = (FIXP_DBL)0;
  2577. - }
  2578. -}
  2579. -
  2580. -void Acelp_PostProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2581. - INT *old_T_pf, INT coreCoderFrameLength, INT synSfd,
  2582. - INT nbSubfrSuperfr) {
  2583. - int n;
  2584. -
  2585. - /* store last part of synth_buf (which is not handled by the IMDCT overlap)
  2586. - * for next frame */
  2587. - FDKmemcpy(old_synth, synth_buf + coreCoderFrameLength,
  2588. - sizeof(FIXP_DBL) * (PIT_MAX_MAX - BPF_DELAY));
  2589. -
  2590. - /* for bass postfilter */
  2591. - for (n = 0; n < synSfd; n++) {
  2592. - old_T_pf[n] = pitch[nbSubfrSuperfr + n];
  2593. - }
  2594. -}
  2595. -
  2596. -#define L_FAC_ZIR (LFAC)
  2597. -
  2598. -void CLpd_Acelp_Zir(const FIXP_LPC A[], const INT A_exp,
  2599. - CAcelpStaticMem *acelp_mem, const INT length,
  2600. - FIXP_DBL zir[], int doDeemph) {
  2601. - C_ALLOC_SCRATCH_START(tmp_buf, FIXP_DBL, L_FAC_ZIR + M_LP_FILTER_ORDER);
  2602. - FDK_ASSERT(length <= L_FAC_ZIR);
  2603. -
  2604. - FDKmemcpy(tmp_buf, acelp_mem->old_syn_mem,
  2605. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2606. - FDKmemset(tmp_buf + M_LP_FILTER_ORDER, 0, L_FAC_ZIR * sizeof(FIXP_DBL));
  2607. -
  2608. - Syn_filt(A, A_exp, length, &tmp_buf[M_LP_FILTER_ORDER],
  2609. - &tmp_buf[M_LP_FILTER_ORDER]);
  2610. - if (!doDeemph) {
  2611. - /* if last lpd mode was TD concealment, then bypass deemph */
  2612. - FDKmemcpy(zir, tmp_buf, length * sizeof(*zir));
  2613. - } else {
  2614. - Deemph(&tmp_buf[M_LP_FILTER_ORDER], &zir[0], length,
  2615. - &acelp_mem->de_emph_mem);
  2616. - scaleValues(zir, length, -ACELP_OUTSCALE);
  2617. - }
  2618. - C_ALLOC_SCRATCH_END(tmp_buf, FIXP_DBL, L_FAC_ZIR + M_LP_FILTER_ORDER);
  2619. -}
  2620. -
  2621. -void CLpd_AcelpPrepareInternalMem(const FIXP_DBL *synth, UCHAR last_lpd_mode,
  2622. - UCHAR last_last_lpd_mode,
  2623. - const FIXP_LPC *A_new, const INT A_new_exp,
  2624. - const FIXP_LPC *A_old, const INT A_old_exp,
  2625. - CAcelpStaticMem *acelp_mem,
  2626. - INT coreCoderFrameLength, INT clearOldExc,
  2627. - UCHAR lpd_mode) {
  2628. - int l_div =
  2629. - coreCoderFrameLength / NB_DIV; /* length of one ACELP/TCX20 frame */
  2630. - int l_div_partial;
  2631. - FIXP_DBL *syn, *old_exc_mem;
  2632. -
  2633. - C_ALLOC_SCRATCH_START(synth_buf, FIXP_DBL,
  2634. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2635. - syn = &synth_buf[M_LP_FILTER_ORDER];
  2636. -
  2637. - l_div_partial = PIT_MAX_MAX + L_INTERPOL - l_div;
  2638. - old_exc_mem = acelp_mem->old_exc_mem;
  2639. -
  2640. - if (lpd_mode == 4) {
  2641. - /* Bypass Domain conversion. TCXTD Concealment does no deemphasis in the
  2642. - * end. */
  2643. - FDKmemcpy(
  2644. - synth_buf, &synth[-(PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER)],
  2645. - (PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER) * sizeof(FIXP_DBL));
  2646. - /* Set deemphasis memory state for TD concealment */
  2647. - acelp_mem->deemph_mem_wsyn = scaleValueSaturate(synth[-1], ACELP_OUTSCALE);
  2648. - } else {
  2649. - /* convert past [PIT_MAX_MAX+L_INTERPOL+M_LP_FILTER_ORDER] synthesis to
  2650. - * preemph domain */
  2651. - E_UTIL_preemph(&synth[-(PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER)],
  2652. - synth_buf, PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2653. - scaleValuesSaturate(synth_buf, PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER,
  2654. - ACELP_OUTSCALE);
  2655. - }
  2656. -
  2657. - /* Set deemphasis memory state */
  2658. - acelp_mem->de_emph_mem = scaleValueSaturate(synth[-1], ACELP_OUTSCALE);
  2659. -
  2660. - /* update acelp synth filter memory */
  2661. - FDKmemcpy(acelp_mem->old_syn_mem,
  2662. - &syn[PIT_MAX_MAX + L_INTERPOL - M_LP_FILTER_ORDER],
  2663. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2664. -
  2665. - if (clearOldExc) {
  2666. - FDKmemclear(old_exc_mem, (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2667. - C_ALLOC_SCRATCH_END(synth_buf, FIXP_DBL,
  2668. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2669. - return;
  2670. - }
  2671. -
  2672. - /* update past [PIT_MAX_MAX+L_INTERPOL] samples of exc memory */
  2673. - if (last_lpd_mode == 1) { /* last frame was TCX20 */
  2674. - if (last_last_lpd_mode == 0) { /* ACELP -> TCX20 -> ACELP transition */
  2675. - /* Delay valid part of excitation buffer (from previous ACELP frame) by
  2676. - * l_div samples */
  2677. - FDKmemmove(old_exc_mem, old_exc_mem + l_div,
  2678. - sizeof(FIXP_DBL) * l_div_partial);
  2679. - } else if (last_last_lpd_mode > 0) { /* TCX -> TCX20 -> ACELP transition */
  2680. - E_UTIL_residu(A_old, A_old_exp, syn, old_exc_mem, l_div_partial);
  2681. - }
  2682. - E_UTIL_residu(A_new, A_new_exp, syn + l_div_partial,
  2683. - old_exc_mem + l_div_partial, l_div);
  2684. - } else { /* prev frame was FD, TCX40 or TCX80 */
  2685. - int exc_A_new_length = (coreCoderFrameLength / 2 > PIT_MAX_MAX + L_INTERPOL)
  2686. - ? PIT_MAX_MAX + L_INTERPOL
  2687. - : coreCoderFrameLength / 2;
  2688. - int exc_A_old_length = PIT_MAX_MAX + L_INTERPOL - exc_A_new_length;
  2689. - E_UTIL_residu(A_old, A_old_exp, syn, old_exc_mem, exc_A_old_length);
  2690. - E_UTIL_residu(A_new, A_new_exp, &syn[exc_A_old_length],
  2691. - &old_exc_mem[exc_A_old_length], exc_A_new_length);
  2692. - }
  2693. - C_ALLOC_SCRATCH_END(synth_buf, FIXP_DBL,
  2694. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2695. -
  2696. - return;
  2697. -}
  2698. -
  2699. -FIXP_DBL *CLpd_ACELP_GetFreeExcMem(CAcelpStaticMem *acelp_mem, INT length) {
  2700. - FDK_ASSERT(length <= PIT_MAX_MAX + L_INTERPOL);
  2701. - return acelp_mem->old_exc_mem;
  2702. -}
  2703. -
  2704. -INT CLpd_AcelpRead(HANDLE_FDK_BITSTREAM hBs, CAcelpChannelData *acelp,
  2705. - INT acelp_core_mode, INT coreCoderFrameLength,
  2706. - INT i_offset) {
  2707. - int nb_subfr = coreCoderFrameLength / L_DIV;
  2708. - const UCHAR *num_acb_index_bits =
  2709. - (nb_subfr == 4) ? num_acb_idx_bits_table[0] : num_acb_idx_bits_table[1];
  2710. - int nbits;
  2711. - int error = 0;
  2712. -
  2713. - const int PIT_MIN = PIT_MIN_12k8 + i_offset;
  2714. - const int PIT_FR2 = PIT_FR2_12k8 - i_offset;
  2715. - const int PIT_FR1 = PIT_FR1_12k8;
  2716. - const int PIT_MAX = PIT_MAX_12k8 + (6 * i_offset);
  2717. - int T0, T0_frac, T0_min = 0, T0_max;
  2718. -
  2719. - if (PIT_MAX > PIT_MAX_MAX) {
  2720. - error = AAC_DEC_DECODE_FRAME_ERROR;
  2721. - goto bail;
  2722. - }
  2723. -
  2724. - acelp->acelp_core_mode = acelp_core_mode;
  2725. -
  2726. - nbits = MapCoreMode2NBits(acelp_core_mode);
  2727. -
  2728. - /* decode mean energy with 2 bits : 18, 30, 42 or 54 dB */
  2729. - acelp->mean_energy = FDKreadBits(hBs, 2);
  2730. -
  2731. - for (int sfr = 0; sfr < nb_subfr; sfr++) {
  2732. - /* read ACB index and store T0 and T0_frac for each ACELP subframe. */
  2733. - error = DecodePitchLag(hBs, num_acb_index_bits[sfr], PIT_MIN, PIT_FR2,
  2734. - PIT_FR1, PIT_MAX, &T0, &T0_frac, &T0_min, &T0_max);
  2735. - if (error) {
  2736. - goto bail;
  2737. - }
  2738. - acelp->T0[sfr] = (USHORT)T0;
  2739. - acelp->T0_frac[sfr] = (UCHAR)T0_frac;
  2740. - acelp->ltp_filtering_flag[sfr] = FDKreadBits(hBs, 1);
  2741. - switch (nbits) {
  2742. - case 12: /* 12 bits AMR-WB codebook is used */
  2743. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 1);
  2744. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2745. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 1);
  2746. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2747. - break;
  2748. - case 16: /* 16 bits AMR-WB codebook is used */
  2749. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 1);
  2750. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2751. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2752. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2753. - break;
  2754. - case 20: /* 20 bits AMR-WB codebook is used */
  2755. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 5);
  2756. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2757. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2758. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2759. - break;
  2760. - case 28: /* 28 bits AMR-WB codebook is used */
  2761. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 9);
  2762. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 9);
  2763. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2764. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2765. - break;
  2766. - case 36: /* 36 bits AMR-WB codebook is used */
  2767. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 9);
  2768. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 9);
  2769. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 9);
  2770. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 9);
  2771. - break;
  2772. - case 44: /* 44 bits AMR-WB codebook is used */
  2773. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 13);
  2774. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 13);
  2775. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 9);
  2776. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 9);
  2777. - break;
  2778. - case 52: /* 52 bits AMR-WB codebook is used */
  2779. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 13);
  2780. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 13);
  2781. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 13);
  2782. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 13);
  2783. - break;
  2784. - case 64: /* 64 bits AMR-WB codebook is used */
  2785. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 2);
  2786. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 2);
  2787. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 2);
  2788. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 2);
  2789. - acelp->icb_index[sfr][4] = FDKreadBits(hBs, 14);
  2790. - acelp->icb_index[sfr][5] = FDKreadBits(hBs, 14);
  2791. - acelp->icb_index[sfr][6] = FDKreadBits(hBs, 14);
  2792. - acelp->icb_index[sfr][7] = FDKreadBits(hBs, 14);
  2793. - break;
  2794. - default:
  2795. - FDK_ASSERT(0);
  2796. - break;
  2797. - }
  2798. - acelp->gains[sfr] = FDKreadBits(hBs, 7);
  2799. - }
  2800. -
  2801. -bail:
  2802. - return error;
  2803. -}
  2804. diff --git a/libAACdec/src/usacdec_acelp.h b/libAACdec/src/usacdec_acelp.h
  2805. deleted file mode 100644
  2806. index 9de41ff..0000000
  2807. --- a/libAACdec/src/usacdec_acelp.h
  2808. +++ /dev/null
  2809. @@ -1,281 +0,0 @@
  2810. -/* -----------------------------------------------------------------------------
  2811. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  2812. -
  2813. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  2814. -Forschung e.V. All rights reserved.
  2815. -
  2816. - 1. INTRODUCTION
  2817. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  2818. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  2819. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  2820. -a wide variety of Android devices.
  2821. -
  2822. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  2823. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  2824. -full-bandwidth communications codec by independent studies and is widely
  2825. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  2826. -specifications.
  2827. -
  2828. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  2829. -those of Fraunhofer) may be obtained through Via Licensing
  2830. -(www.vialicensing.com) or through the respective patent owners individually for
  2831. -the purpose of encoding or decoding bit streams in products that are compliant
  2832. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  2833. -Android devices already license these patent claims through Via Licensing or
  2834. -directly from the patent owners, and therefore FDK AAC Codec software may
  2835. -already be covered under those patent licenses when it is used for those
  2836. -licensed purposes only.
  2837. -
  2838. -Commercially-licensed AAC software libraries, including floating-point versions
  2839. -with enhanced sound quality, are also available from Fraunhofer. Users are
  2840. -encouraged to check the Fraunhofer website for additional applications
  2841. -information and documentation.
  2842. -
  2843. -2. COPYRIGHT LICENSE
  2844. -
  2845. -Redistribution and use in source and binary forms, with or without modification,
  2846. -are permitted without payment of copyright license fees provided that you
  2847. -satisfy the following conditions:
  2848. -
  2849. -You must retain the complete text of this software license in redistributions of
  2850. -the FDK AAC Codec or your modifications thereto in source code form.
  2851. -
  2852. -You must retain the complete text of this software license in the documentation
  2853. -and/or other materials provided with redistributions of the FDK AAC Codec or
  2854. -your modifications thereto in binary form. You must make available free of
  2855. -charge copies of the complete source code of the FDK AAC Codec and your
  2856. -modifications thereto to recipients of copies in binary form.
  2857. -
  2858. -The name of Fraunhofer may not be used to endorse or promote products derived
  2859. -from this library without prior written permission.
  2860. -
  2861. -You may not charge copyright license fees for anyone to use, copy or distribute
  2862. -the FDK AAC Codec software or your modifications thereto.
  2863. -
  2864. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  2865. -that you changed the software and the date of any change. For modified versions
  2866. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  2867. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  2868. -AAC Codec Library for Android."
  2869. -
  2870. -3. NO PATENT LICENSE
  2871. -
  2872. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  2873. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  2874. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  2875. -software.
  2876. -
  2877. -You may use this FDK AAC Codec software or modifications thereto only for
  2878. -purposes that are authorized by appropriate patent licenses.
  2879. -
  2880. -4. DISCLAIMER
  2881. -
  2882. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  2883. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  2884. -including but not limited to the implied warranties of merchantability and
  2885. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  2886. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  2887. -or consequential damages, including but not limited to procurement of substitute
  2888. -goods or services; loss of use, data, or profits, or business interruption,
  2889. -however caused and on any theory of liability, whether in contract, strict
  2890. -liability, or tort (including negligence), arising in any way out of the use of
  2891. -this software, even if advised of the possibility of such damage.
  2892. -
  2893. -5. CONTACT INFORMATION
  2894. -
  2895. -Fraunhofer Institute for Integrated Circuits IIS
  2896. -Attention: Audio and Multimedia Departments - FDK AAC LL
  2897. -Am Wolfsmantel 33
  2898. -91058 Erlangen, Germany
  2899. -
  2900. -www.iis.fraunhofer.de/amm
  2901. -amm-info@iis.fraunhofer.de
  2902. ------------------------------------------------------------------------------ */
  2903. -
  2904. -/**************************** AAC decoder library ******************************
  2905. -
  2906. - Author(s): Matthias Hildenbrand
  2907. -
  2908. - Description: USAC ACELP frame decoder
  2909. -
  2910. -*******************************************************************************/
  2911. -
  2912. -#ifndef USACDEC_ACELP_H
  2913. -#define USACDEC_ACELP_H
  2914. -
  2915. -#include "common_fix.h"
  2916. -#include "FDK_bitstream.h"
  2917. -#include "usacdec_const.h"
  2918. -#include "usacdec_rom.h"
  2919. -
  2920. -//#define ENHANCED_TCX_TD_CONCEAL_ENABLE
  2921. -
  2922. -/** Structure which holds the ACELP internal persistent memory */
  2923. -typedef struct {
  2924. - FIXP_DBL old_exc_mem[PIT_MAX_MAX + L_INTERPOL];
  2925. - FIXP_DBL old_syn_mem[M_LP_FILTER_ORDER]; /* synthesis filter states */
  2926. - FIXP_SGL A[M_LP_FILTER_ORDER];
  2927. - INT A_exp;
  2928. - FIXP_DBL gc_threshold;
  2929. - FIXP_DBL de_emph_mem;
  2930. - FIXP_SGL past_gpit;
  2931. - FIXP_DBL past_gcode;
  2932. - USHORT old_T0;
  2933. - UCHAR old_T0_frac;
  2934. - FIXP_DBL deemph_mem_wsyn;
  2935. - FIXP_DBL wsyn_rms;
  2936. - SHORT seed_ace;
  2937. -} CAcelpStaticMem;
  2938. -
  2939. -/** Structure which holds the parameter data needed to decode one ACELP frame.
  2940. - */
  2941. -typedef struct {
  2942. - UCHAR
  2943. - acelp_core_mode; /**< mean excitation energy index for whole ACELP frame
  2944. - */
  2945. - UCHAR mean_energy; /**< acelp core mode for whole ACELP frame */
  2946. - USHORT T0[NB_SUBFR];
  2947. - UCHAR T0_frac[NB_SUBFR];
  2948. - UCHAR ltp_filtering_flag[NB_SUBFR]; /**< controlls whether LTP postfilter is
  2949. - active for each ACELP subframe */
  2950. - SHORT icb_index[NB_SUBFR]
  2951. - [8]; /**< innovative codebook index for each ACELP subframe */
  2952. - UCHAR gains[NB_SUBFR]; /**< gain index for each ACELP subframe */
  2953. -} CAcelpChannelData;
  2954. -
  2955. -/**
  2956. - * \brief Read the acelp_coding() bitstream part.
  2957. - * \param[in] hBs bitstream handle to read data from.
  2958. - * \param[out] acelpData pointer to structure to store the parsed data of one
  2959. - * ACELP frame.
  2960. - * \param[in] acelp_core_mode the ACELP core mode index.
  2961. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  2962. - */
  2963. -INT CLpd_AcelpRead(HANDLE_FDK_BITSTREAM hBs, CAcelpChannelData *acelpData,
  2964. - INT acelp_core_mode, INT i_offset, INT coreCoderFrameLength);
  2965. -/**
  2966. - * \brief Initialization of memory before one LPD frame is decoded
  2967. - * \param[out] synth_buf synthesis buffer to be initialized, exponent = SF_SYNTH
  2968. - * \param[in] old_synth past synthesis of previous LPD frame, exponent =
  2969. - * SF_SYNTH
  2970. - * \param[out] synth_buf_fb fullband synthesis buffer to be initialized,
  2971. - * exponent = SF_SYNTH
  2972. - * \param[in] old_synth_fb past fullband synthesis of previous LPD frame,
  2973. - * exponent = SF_SYNTH
  2974. - * \param[out] pitch vector where decoded pitch lag values are stored
  2975. - * \param[in] old_T_pf past pitch lag values of previous LPD frame
  2976. - * \param[in] samplingRate sampling rate for pitch lag offset calculation
  2977. - * \param[out] i_offset pitch lag offset for the decoding of the pitch lag
  2978. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  2979. - */
  2980. -void Acelp_PreProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2981. - INT *old_T_pf, FIXP_DBL *pit_gain,
  2982. - FIXP_DBL *old_gain_pf, INT samplingRate, INT *i_offset,
  2983. - INT coreCoderFrameLength, INT synSfd,
  2984. - INT nbSubfrSuperfr);
  2985. -
  2986. -/**
  2987. - * \brief Save tail of buffers for the initialization of the next LPD frame
  2988. - * \param[in] synth_buf synthesis of current LPD frame, exponent = SF_SYNTH
  2989. - * \param[out] old_synth memory where tail of fullband synth_buf is stored,
  2990. - * exponent = SF_SYNTH
  2991. - * \param[in] synth_buf_fb fullband synthesis of current LPD frame, exponent =
  2992. - * SF_SYNTH
  2993. - * \param[out] old_synth_fb memory where tail of fullband synth_buf is stored,
  2994. - * exponent = SF_SYNTH
  2995. - * \param[in] pitch decoded pitch lag values of current LPD frame
  2996. - * \param[out] old_T_pf memory where last SYN_SFD pitch lag values are stored
  2997. - */
  2998. -void Acelp_PostProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2999. - INT *old_T_pf, INT coreCoderFrameLength, INT synSfd,
  3000. - INT nbSubfrSuperfr);
  3001. -
  3002. -/**
  3003. - * \brief Decode one ACELP frame (three or four ACELP subframes with 64 samples
  3004. - * each)
  3005. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  3006. - * \param[in] i_offset pitch lag offset
  3007. - * \param[in] lsp_old LPC filter in LSP domain corresponding to previous frame
  3008. - * \param[in] lsp_new LPC filter in LSP domain corresponding to current frame
  3009. - * \param[in] stab_fac stability factor constrained by 0<=stab_fac<=1.0,
  3010. - * exponent = SF_STAB
  3011. - * \param[in] acelpData pointer to struct with data which is needed for decoding
  3012. - * one ACELP frame
  3013. - * \param[out] synth ACELP output signal
  3014. - * \param[out] pT four decoded pitch lag values
  3015. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  3016. - */
  3017. -void CLpd_AcelpDecode(CAcelpStaticMem *acelp_mem, INT i_offset,
  3018. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  3019. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  3020. - FIXP_SGL stab_fac, CAcelpChannelData *acelpData,
  3021. - INT numLostSubframes, int lastLpcLost, int frameCnt,
  3022. - FIXP_DBL synth[], int pT[], FIXP_DBL *pit_gain,
  3023. - INT coreCoderFrameLength);
  3024. -
  3025. -/**
  3026. - * \brief Reset ACELP internal memory.
  3027. - * \param[out] acelp_mem pointer to ACELP memory structure
  3028. - */
  3029. -void CLpd_AcelpReset(CAcelpStaticMem *acelp_mem);
  3030. -
  3031. -/**
  3032. - * \brief Initialize ACELP internal memory in case of FAC before ACELP decoder
  3033. - * is called
  3034. - * \param[in] synth points to end+1 of past valid synthesis signal, exponent =
  3035. - * SF_SYNTH
  3036. - * \param[in] last_lpd_mode last lpd mode
  3037. - * \param[in] last_last_lpd_mode lpd mode before last_lpd_mode
  3038. - * \param[in] A_new LP synthesis filter coeffs corresponding to last frame,
  3039. - * exponent = SF_A_COEFFS
  3040. - * \param[in] A_old LP synthesis filter coeffs corresponding to the frame before
  3041. - * last frame, exponent = SF_A_COEFFS
  3042. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  3043. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  3044. - */
  3045. -void CLpd_AcelpPrepareInternalMem(const FIXP_DBL *synth, UCHAR last_lpd_mode,
  3046. - UCHAR last_last_lpd_mode,
  3047. - const FIXP_LPC *A_new, const INT A_new_exp,
  3048. - const FIXP_LPC *A_old, const INT A_old_exp,
  3049. - CAcelpStaticMem *acelp_mem,
  3050. - INT coreCoderFrameLength, INT clearOldExc,
  3051. - UCHAR lpd_mode);
  3052. -
  3053. -/**
  3054. - * \brief Calculate zero input response (zir) of the acelp synthesis filter
  3055. - * \param[in] A LP synthesis filter coefficients, exponent = SF_A_COEFFS
  3056. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  3057. - * \param[in] length length of zir
  3058. - * \param[out] zir pointer to zir output buffer, exponent = SF_SYNTH
  3059. - */
  3060. -void CLpd_Acelp_Zir(const FIXP_LPC A[], const INT A_exp,
  3061. - CAcelpStaticMem *acelp_mem, const INT length,
  3062. - FIXP_DBL zir[], int doDeemph);
  3063. -
  3064. -/**
  3065. - * \brief Borrow static excitation memory from ACELP decoder
  3066. - * \param[in] acelp_mem pointer to ACELP memory structure
  3067. - * \param[in] length number of requested FIXP_DBL values
  3068. - * \return pointer to requested memory
  3069. - *
  3070. - * The caller has to take care not to overwrite valid memory areas.
  3071. - * During TCX/FAC calculations and before CLpd_AcelpPrepareInternalMem() is
  3072. - * called, the following memory size is available:
  3073. - * - 256 samples in case of ACELP -> TCX20 -> ACELP transition
  3074. - * - PIT_MAX_MAX+L_INTERPOL samples in all other cases
  3075. - */
  3076. -FIXP_DBL *CLpd_ACELP_GetFreeExcMem(CAcelpStaticMem *acelp_mem, INT length);
  3077. -
  3078. -void CLpd_TcxTDConceal(CAcelpStaticMem *acelp_mem, SHORT *pitch,
  3079. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  3080. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  3081. - const FIXP_SGL stab_fac, INT numLostSubframes,
  3082. - FIXP_DBL synth[], INT coreCoderFrameLength,
  3083. - UCHAR last_tcx_noise_factor);
  3084. -
  3085. -inline SHORT E_UTIL_random(SHORT *seed) {
  3086. - *seed = (SHORT)((((LONG)*seed * (LONG)31821) >> 1) + (LONG)13849);
  3087. - return (*seed);
  3088. -}
  3089. -
  3090. -#endif /* USACDEC_ACELP_H */
  3091. diff --git a/libAACdec/src/usacdec_const.h b/libAACdec/src/usacdec_const.h
  3092. deleted file mode 100644
  3093. index f68e808..0000000
  3094. --- a/libAACdec/src/usacdec_const.h
  3095. +++ /dev/null
  3096. @@ -1,203 +0,0 @@
  3097. -/* -----------------------------------------------------------------------------
  3098. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  3099. -
  3100. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  3101. -Forschung e.V. All rights reserved.
  3102. -
  3103. - 1. INTRODUCTION
  3104. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  3105. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  3106. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  3107. -a wide variety of Android devices.
  3108. -
  3109. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  3110. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  3111. -full-bandwidth communications codec by independent studies and is widely
  3112. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  3113. -specifications.
  3114. -
  3115. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  3116. -those of Fraunhofer) may be obtained through Via Licensing
  3117. -(www.vialicensing.com) or through the respective patent owners individually for
  3118. -the purpose of encoding or decoding bit streams in products that are compliant
  3119. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  3120. -Android devices already license these patent claims through Via Licensing or
  3121. -directly from the patent owners, and therefore FDK AAC Codec software may
  3122. -already be covered under those patent licenses when it is used for those
  3123. -licensed purposes only.
  3124. -
  3125. -Commercially-licensed AAC software libraries, including floating-point versions
  3126. -with enhanced sound quality, are also available from Fraunhofer. Users are
  3127. -encouraged to check the Fraunhofer website for additional applications
  3128. -information and documentation.
  3129. -
  3130. -2. COPYRIGHT LICENSE
  3131. -
  3132. -Redistribution and use in source and binary forms, with or without modification,
  3133. -are permitted without payment of copyright license fees provided that you
  3134. -satisfy the following conditions:
  3135. -
  3136. -You must retain the complete text of this software license in redistributions of
  3137. -the FDK AAC Codec or your modifications thereto in source code form.
  3138. -
  3139. -You must retain the complete text of this software license in the documentation
  3140. -and/or other materials provided with redistributions of the FDK AAC Codec or
  3141. -your modifications thereto in binary form. You must make available free of
  3142. -charge copies of the complete source code of the FDK AAC Codec and your
  3143. -modifications thereto to recipients of copies in binary form.
  3144. -
  3145. -The name of Fraunhofer may not be used to endorse or promote products derived
  3146. -from this library without prior written permission.
  3147. -
  3148. -You may not charge copyright license fees for anyone to use, copy or distribute
  3149. -the FDK AAC Codec software or your modifications thereto.
  3150. -
  3151. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  3152. -that you changed the software and the date of any change. For modified versions
  3153. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  3154. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  3155. -AAC Codec Library for Android."
  3156. -
  3157. -3. NO PATENT LICENSE
  3158. -
  3159. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  3160. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  3161. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  3162. -software.
  3163. -
  3164. -You may use this FDK AAC Codec software or modifications thereto only for
  3165. -purposes that are authorized by appropriate patent licenses.
  3166. -
  3167. -4. DISCLAIMER
  3168. -
  3169. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  3170. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  3171. -including but not limited to the implied warranties of merchantability and
  3172. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  3173. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  3174. -or consequential damages, including but not limited to procurement of substitute
  3175. -goods or services; loss of use, data, or profits, or business interruption,
  3176. -however caused and on any theory of liability, whether in contract, strict
  3177. -liability, or tort (including negligence), arising in any way out of the use of
  3178. -this software, even if advised of the possibility of such damage.
  3179. -
  3180. -5. CONTACT INFORMATION
  3181. -
  3182. -Fraunhofer Institute for Integrated Circuits IIS
  3183. -Attention: Audio and Multimedia Departments - FDK AAC LL
  3184. -Am Wolfsmantel 33
  3185. -91058 Erlangen, Germany
  3186. -
  3187. -www.iis.fraunhofer.de/amm
  3188. -amm-info@iis.fraunhofer.de
  3189. ------------------------------------------------------------------------------ */
  3190. -
  3191. -/**************************** AAC decoder library ******************************
  3192. -
  3193. - Author(s): Manuel Jander
  3194. -
  3195. - Description: USAC related constants
  3196. -
  3197. -*******************************************************************************/
  3198. -
  3199. -#ifndef USACDEC_CONST_H
  3200. -#define USACDEC_CONST_H
  3201. -
  3202. -/* scale factors */
  3203. -#define SF_CODE 6 /* exponent of code[], fixed codebook vector */
  3204. -#define SF_GAIN_C 16 /* exponent of gain code and smoothed gain code */
  3205. -#define SF_EXC 16 /* exponent of exc[] and exc2[], excitation buffer */
  3206. -#define SF_GAIN_P 1 /* exponent of gain_pit */
  3207. -#define SF_PFAC 0 /* exponent of period/voicing factor */
  3208. -#define SF_SYNTH SF_EXC /* exponent of synthesis buffer */
  3209. -#define SF_A_COEFFS 3 /* exponent of LP domain synthesis filter coefficient */
  3210. -#define SF_STAB 1 /* exponent of stability factor */
  3211. -
  3212. -/* definitions which are independent of coreCoderFrameLength */
  3213. -#define M_LP_FILTER_ORDER 16 /* LP filter order */
  3214. -#define LP_FILTER_SCALE 4 /* LP filter scale */
  3215. -
  3216. -#define PIT_MIN_12k8 34 /* Minimum pitch lag with resolution 1/4 */
  3217. -#define PIT_MAX_12k8 231 /* Maximum pitch lag for fs=12.8kHz */
  3218. -#define FSCALE_DENOM 12800 /* Frequency scale denominator */
  3219. -#define FAC_FSCALE_MIN \
  3220. - 6000 /* Minimum allowed frequency scale for acelp decoder */
  3221. -
  3222. -#if !defined(LPD_MAX_CORE_SR)
  3223. -#define LPD_MAX_CORE_SR 24000 /* Default value from ref soft */
  3224. -#endif
  3225. -#define FAC_FSCALE_MAX \
  3226. - LPD_MAX_CORE_SR /* Maximum allowed frequency scale for acelp decoder */
  3227. -
  3228. -/* Maximum pitch lag (= 411 for fs_max = 24000) */
  3229. -#define PIT_MAX_TMP \
  3230. - (PIT_MAX_12k8 + \
  3231. - (6 * \
  3232. - ((((FAC_FSCALE_MAX * PIT_MIN_12k8) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - \
  3233. - PIT_MIN_12k8)))
  3234. -#if (PIT_MAX_TMP < \
  3235. - 256) /* cannot be smaller because of tcx time domain concealment */
  3236. -#define PIT_MAX_MAX 256
  3237. -#else
  3238. -#define PIT_MAX_MAX PIT_MAX_TMP
  3239. -#endif
  3240. -
  3241. -#define NB_DIV 4 /* number of division (20ms) per 80ms frame */
  3242. -#define L_SUBFR 64 /* subframe size (5ms) */
  3243. -#define BPF_SFD 1 /* bass postfilter delay (subframe) */
  3244. -#define BPF_DELAY (BPF_SFD * L_SUBFR) /* bass postfilter delay (samples) */
  3245. -
  3246. -#define L_FILT 12 /* Delay of up-sampling filter (bass post-filter) */
  3247. -#define L_EXTRA 96 /* for bass post-filter */
  3248. -#define L_INTERPOL \
  3249. - (16 + 1) /* Length of filter for interpolation (acelp decoder) */
  3250. -
  3251. -/* definitions for coreCoderFrameLength = 1024 */
  3252. -#define L_FRAME_PLUS_1024 1024 /* length of one 80ms superframe */
  3253. -#define L_DIV_1024 \
  3254. - (L_FRAME_PLUS_1024 / NB_DIV) /* length of one acelp or tcx20 frame */
  3255. -#define NB_SUBFR_1024 \
  3256. - (L_DIV_1024 / L_SUBFR) /* number of 5ms subframe per division */
  3257. -#define NB_SUBFR_SUPERFR_1024 \
  3258. - (L_FRAME_PLUS_1024 / L_SUBFR) /* number of 5ms subframe per 80ms frame */
  3259. -#define AAC_SFD_1024 (NB_SUBFR_SUPERFR_1024 / 2) /* AAC delay (subframe) */
  3260. -#define AAC_DELAY_1024 (AAC_SFD_1024 * L_SUBFR) /* AAC delay (samples) */
  3261. -#define SYN_SFD_1024 (AAC_SFD_1024 - BPF_SFD) /* synthesis delay (subframe) */
  3262. -#define SYN_DELAY_1024 \
  3263. - (SYN_SFD_1024 * L_SUBFR) /* synthesis delay (samples) \
  3264. - */
  3265. -#define LFAC_1024 (L_DIV_1024 / 2) /* FAC frame length */
  3266. -#define LFAC_SHORT_1024 \
  3267. - (L_DIV_1024 / 4) /* for transitions EIGHT_SHORT FD->LPD and vv. */
  3268. -#define FDNS_NPTS_1024 64 /* FD noise shaping resolution (64=100Hz/point) */
  3269. -
  3270. -/* definitions for coreCoderFrameLength = 768 */
  3271. -#define L_FRAME_PLUS_768 768
  3272. -#define L_DIV_768 \
  3273. - (L_FRAME_PLUS_768 / NB_DIV) /* length of one acelp or tcx20 frame */
  3274. -#define NB_SUBFR_768 \
  3275. - (L_DIV_768 / L_SUBFR) /* number of 5ms subframe per division */
  3276. -#define NB_SUBFR_SUPERFR_768 \
  3277. - (L_FRAME_PLUS_768 / L_SUBFR) /* number of 5ms subframe per 80ms frame */
  3278. -#define AAC_SFD_768 (NB_SUBFR_SUPERFR_768 / 2) /* AAC delay (subframe) */
  3279. -#define AAC_DELAY_768 (AAC_SFD_768 * L_SUBFR) /* AAC delay (samples) */
  3280. -#define SYN_SFD_768 (AAC_SFD_768 - BPF_SFD) /* synthesis delay (subframe) */
  3281. -#define SYN_DELAY_768 (SYN_SFD_768 * L_SUBFR) /* synthesis delay (samples) */
  3282. -#define LFAC_768 (L_DIV_768 / 2) /* FAC frame length */
  3283. -#define LFAC_SHORT_768 \
  3284. - (L_DIV_768 / 4) /* for transitions EIGHT_SHORT FD->LPD and vv. */
  3285. -
  3286. -/* maximum (used for memory allocation) */
  3287. -#define L_FRAME_PLUS L_FRAME_PLUS_1024
  3288. -#define L_DIV L_DIV_1024
  3289. -#define NB_SUBFR NB_SUBFR_1024
  3290. -#define NB_SUBFR_SUPERFR NB_SUBFR_SUPERFR_1024
  3291. -#define AAC_SFD AAC_SFD_1024
  3292. -#define AAC_DELAY AAC_DELAY_1024
  3293. -#define SYN_SFD SYN_SFD_1024
  3294. -#define SYN_DELAY SYN_DELAY_1024
  3295. -#define LFAC LFAC_1024
  3296. -#define LFAC_SHORT LFAC_SHORT_1024
  3297. -#define FDNS_NPTS FDNS_NPTS_1024
  3298. -
  3299. -#endif /* USACDEC_CONST_H */
  3300. diff --git a/libAACdec/src/usacdec_fac.cpp b/libAACdec/src/usacdec_fac.cpp
  3301. deleted file mode 100644
  3302. index 0d3d844..0000000
  3303. --- a/libAACdec/src/usacdec_fac.cpp
  3304. +++ /dev/null
  3305. @@ -1,745 +0,0 @@
  3306. -/* -----------------------------------------------------------------------------
  3307. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  3308. -
  3309. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  3310. -Forschung e.V. All rights reserved.
  3311. -
  3312. - 1. INTRODUCTION
  3313. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  3314. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  3315. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  3316. -a wide variety of Android devices.
  3317. -
  3318. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  3319. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  3320. -full-bandwidth communications codec by independent studies and is widely
  3321. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  3322. -specifications.
  3323. -
  3324. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  3325. -those of Fraunhofer) may be obtained through Via Licensing
  3326. -(www.vialicensing.com) or through the respective patent owners individually for
  3327. -the purpose of encoding or decoding bit streams in products that are compliant
  3328. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  3329. -Android devices already license these patent claims through Via Licensing or
  3330. -directly from the patent owners, and therefore FDK AAC Codec software may
  3331. -already be covered under those patent licenses when it is used for those
  3332. -licensed purposes only.
  3333. -
  3334. -Commercially-licensed AAC software libraries, including floating-point versions
  3335. -with enhanced sound quality, are also available from Fraunhofer. Users are
  3336. -encouraged to check the Fraunhofer website for additional applications
  3337. -information and documentation.
  3338. -
  3339. -2. COPYRIGHT LICENSE
  3340. -
  3341. -Redistribution and use in source and binary forms, with or without modification,
  3342. -are permitted without payment of copyright license fees provided that you
  3343. -satisfy the following conditions:
  3344. -
  3345. -You must retain the complete text of this software license in redistributions of
  3346. -the FDK AAC Codec or your modifications thereto in source code form.
  3347. -
  3348. -You must retain the complete text of this software license in the documentation
  3349. -and/or other materials provided with redistributions of the FDK AAC Codec or
  3350. -your modifications thereto in binary form. You must make available free of
  3351. -charge copies of the complete source code of the FDK AAC Codec and your
  3352. -modifications thereto to recipients of copies in binary form.
  3353. -
  3354. -The name of Fraunhofer may not be used to endorse or promote products derived
  3355. -from this library without prior written permission.
  3356. -
  3357. -You may not charge copyright license fees for anyone to use, copy or distribute
  3358. -the FDK AAC Codec software or your modifications thereto.
  3359. -
  3360. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  3361. -that you changed the software and the date of any change. For modified versions
  3362. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  3363. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  3364. -AAC Codec Library for Android."
  3365. -
  3366. -3. NO PATENT LICENSE
  3367. -
  3368. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  3369. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  3370. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  3371. -software.
  3372. -
  3373. -You may use this FDK AAC Codec software or modifications thereto only for
  3374. -purposes that are authorized by appropriate patent licenses.
  3375. -
  3376. -4. DISCLAIMER
  3377. -
  3378. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  3379. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  3380. -including but not limited to the implied warranties of merchantability and
  3381. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  3382. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  3383. -or consequential damages, including but not limited to procurement of substitute
  3384. -goods or services; loss of use, data, or profits, or business interruption,
  3385. -however caused and on any theory of liability, whether in contract, strict
  3386. -liability, or tort (including negligence), arising in any way out of the use of
  3387. -this software, even if advised of the possibility of such damage.
  3388. -
  3389. -5. CONTACT INFORMATION
  3390. -
  3391. -Fraunhofer Institute for Integrated Circuits IIS
  3392. -Attention: Audio and Multimedia Departments - FDK AAC LL
  3393. -Am Wolfsmantel 33
  3394. -91058 Erlangen, Germany
  3395. -
  3396. -www.iis.fraunhofer.de/amm
  3397. -amm-info@iis.fraunhofer.de
  3398. ------------------------------------------------------------------------------ */
  3399. -
  3400. -/**************************** AAC decoder library ******************************
  3401. -
  3402. - Author(s): Manuel Jander
  3403. -
  3404. - Description: USAC FAC
  3405. -
  3406. -*******************************************************************************/
  3407. -
  3408. -#include "usacdec_fac.h"
  3409. -
  3410. -#include "usacdec_const.h"
  3411. -#include "usacdec_lpc.h"
  3412. -#include "usacdec_acelp.h"
  3413. -#include "usacdec_rom.h"
  3414. -#include "dct.h"
  3415. -#include "FDK_tools_rom.h"
  3416. -#include "mdct.h"
  3417. -
  3418. -#define SPEC_FAC(ptr, i, gl) ((ptr) + ((i) * (gl)))
  3419. -
  3420. -FIXP_DBL *CLpd_FAC_GetMemory(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  3421. - UCHAR mod[NB_DIV], int *pState) {
  3422. - FIXP_DBL *ptr;
  3423. - int i;
  3424. - int k = 0;
  3425. - int max_windows = 8;
  3426. -
  3427. - FDK_ASSERT(*pState >= 0 && *pState < max_windows);
  3428. -
  3429. - /* Look for free space to store FAC data. 2 FAC data blocks fit into each TCX
  3430. - * spectral data block. */
  3431. - for (i = *pState; i < max_windows; i++) {
  3432. - if (mod[i >> 1] == 0) {
  3433. - break;
  3434. - }
  3435. - }
  3436. -
  3437. - *pState = i + 1;
  3438. -
  3439. - if (i == max_windows) {
  3440. - ptr = pAacDecoderChannelInfo->data.usac.fac_data0;
  3441. - } else {
  3442. - FDK_ASSERT(mod[(i >> 1)] == 0);
  3443. - ptr = SPEC_FAC(pAacDecoderChannelInfo->pSpectralCoefficient, i,
  3444. - pAacDecoderChannelInfo->granuleLength << k);
  3445. - }
  3446. -
  3447. - return ptr;
  3448. -}
  3449. -
  3450. -int CLpd_FAC_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pFac, SCHAR *pFacScale,
  3451. - int length, int use_gain, int frame) {
  3452. - FIXP_DBL fac_gain;
  3453. - int fac_gain_e = 0;
  3454. -
  3455. - if (use_gain) {
  3456. - CLpd_DecodeGain(&fac_gain, &fac_gain_e, FDKreadBits(hBs, 7));
  3457. - }
  3458. -
  3459. - if (CLpc_DecodeAVQ(hBs, pFac, 1, 1, length) != 0) {
  3460. - return -1;
  3461. - }
  3462. -
  3463. - {
  3464. - int scale;
  3465. -
  3466. - scale = getScalefactor(pFac, length);
  3467. - scaleValues(pFac, length, scale);
  3468. - pFacScale[frame] = DFRACT_BITS - 1 - scale;
  3469. - }
  3470. -
  3471. - if (use_gain) {
  3472. - int i;
  3473. -
  3474. - pFacScale[frame] += fac_gain_e;
  3475. -
  3476. - for (i = 0; i < length; i++) {
  3477. - pFac[i] = fMult(pFac[i], fac_gain);
  3478. - }
  3479. - }
  3480. - return 0;
  3481. -}
  3482. -
  3483. -/**
  3484. - * \brief Apply synthesis filter with zero input to x. The overall filter gain
  3485. - * is 1.0.
  3486. - * \param a LPC filter coefficients.
  3487. - * \param length length of the input/output data vector x.
  3488. - * \param x input/output vector, where the synthesis filter is applied in place.
  3489. - */
  3490. -static void Syn_filt_zero(const FIXP_LPC a[], const INT a_exp, INT length,
  3491. - FIXP_DBL x[]) {
  3492. - int i, j;
  3493. - FIXP_DBL L_tmp;
  3494. -
  3495. - for (i = 0; i < length; i++) {
  3496. - L_tmp = (FIXP_DBL)0;
  3497. -
  3498. - for (j = 0; j < fMin(i, M_LP_FILTER_ORDER); j++) {
  3499. - L_tmp -= fMultDiv2(a[j], x[i - (j + 1)]) >> (LP_FILTER_SCALE - 1);
  3500. - }
  3501. -
  3502. - L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE);
  3503. - x[i] = fAddSaturate(x[i], L_tmp);
  3504. - }
  3505. -}
  3506. -
  3507. -/* Table is also correct for coreCoderFrameLength = 768. Factor 3/4 is canceled
  3508. - out: gainFac = 0.5 * sqrt(fac_length/lFrame)
  3509. -*/
  3510. -static const FIXP_DBL gainFac[4] = {0x40000000, 0x2d413ccd, 0x20000000,
  3511. - 0x16a09e66};
  3512. -
  3513. -void CFac_ApplyGains(FIXP_DBL fac_data[LFAC], const INT fac_length,
  3514. - const FIXP_DBL tcx_gain, const FIXP_DBL alfd_gains[],
  3515. - const INT mod) {
  3516. - FIXP_DBL facFactor;
  3517. - int i;
  3518. -
  3519. - FDK_ASSERT((fac_length == 128) || (fac_length == 96));
  3520. -
  3521. - /* 2) Apply gain factor to FAC data */
  3522. - facFactor = fMult(gainFac[mod], tcx_gain);
  3523. - for (i = 0; i < fac_length; i++) {
  3524. - fac_data[i] = fMult(fac_data[i], facFactor);
  3525. - }
  3526. -
  3527. - /* 3) Apply spectrum deshaping using alfd_gains */
  3528. - for (i = 0; i < fac_length / 4; i++) {
  3529. - int k;
  3530. -
  3531. - k = i >> (3 - mod);
  3532. - fac_data[i] = fMult(fac_data[i], alfd_gains[k])
  3533. - << 1; /* alfd_gains is scaled by one bit. */
  3534. - }
  3535. -}
  3536. -
  3537. -static void CFac_CalcFacSignal(FIXP_DBL *pOut, FIXP_DBL *pFac,
  3538. - const int fac_scale, const int fac_length,
  3539. - const FIXP_LPC A[M_LP_FILTER_ORDER],
  3540. - const INT A_exp, const int fAddZir,
  3541. - const int isFdFac) {
  3542. - FIXP_LPC wA[M_LP_FILTER_ORDER];
  3543. - FIXP_DBL tf_gain = (FIXP_DBL)0;
  3544. - int wlength;
  3545. - int scale = fac_scale;
  3546. -
  3547. - /* obtain tranform gain. */
  3548. - imdct_gain(&tf_gain, &scale, isFdFac ? 0 : fac_length);
  3549. -
  3550. - /* 4) Compute inverse DCT-IV of FAC data. Output scale of DCT IV is 16 bits.
  3551. - */
  3552. - dct_IV(pFac, fac_length, &scale);
  3553. - /* dct_IV scale = log2(fac_length). "- 7" is a factor of 2/128 */
  3554. - if (tf_gain != (FIXP_DBL)0) { /* non-radix 2 transform gain */
  3555. - int i;
  3556. -
  3557. - for (i = 0; i < fac_length; i++) {
  3558. - pFac[i] = fMult(tf_gain, pFac[i]);
  3559. - }
  3560. - }
  3561. - scaleValuesSaturate(pOut, pFac, fac_length,
  3562. - scale); /* Avoid overflow issues and saturate. */
  3563. -
  3564. - E_LPC_a_weight(wA, A, M_LP_FILTER_ORDER);
  3565. -
  3566. - /* We need the output of the IIR filter to be longer than "fac_length".
  3567. - For this reason we run it with zero input appended to the end of the input
  3568. - sequence, i.e. we generate its ZIR and extend the output signal.*/
  3569. - FDKmemclear(pOut + fac_length, fac_length * sizeof(FIXP_DBL));
  3570. - wlength = 2 * fac_length;
  3571. -
  3572. - /* 5) Apply weighted synthesis filter to FAC data, including optional Zir (5.
  3573. - * item 4). */
  3574. - Syn_filt_zero(wA, A_exp, wlength, pOut);
  3575. -}
  3576. -
  3577. -INT CLpd_FAC_Mdct2Acelp(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pFac,
  3578. - const int fac_scale, FIXP_LPC *A, INT A_exp,
  3579. - INT nrOutSamples, const INT fac_length,
  3580. - const INT isFdFac, UCHAR prevWindowShape) {
  3581. - FIXP_DBL *pOvl;
  3582. - FIXP_DBL *pOut0;
  3583. - const FIXP_WTP *pWindow;
  3584. - int i, fl, nrSamples = 0;
  3585. -
  3586. - FDK_ASSERT(fac_length <= 1024 / (4 * 2));
  3587. -
  3588. - fl = fac_length * 2;
  3589. -
  3590. - pWindow = FDKgetWindowSlope(fl, prevWindowShape);
  3591. -
  3592. - /* Adapt window slope length in case of frame loss. */
  3593. - if (hMdct->prev_fr != fl) {
  3594. - int nl = 0;
  3595. - imdct_adapt_parameters(hMdct, &fl, &nl, fac_length, pWindow, nrOutSamples);
  3596. - FDK_ASSERT(nl == 0);
  3597. - }
  3598. -
  3599. - if (nrSamples < nrOutSamples) {
  3600. - pOut0 = output;
  3601. - nrSamples += hMdct->ov_offset;
  3602. - /* Purge buffered output. */
  3603. - FDKmemcpy(pOut0, hMdct->overlap.time, hMdct->ov_offset * sizeof(pOut0[0]));
  3604. - hMdct->ov_offset = 0;
  3605. - }
  3606. -
  3607. - pOvl = hMdct->overlap.freq + hMdct->ov_size - 1;
  3608. -
  3609. - if (nrSamples >= nrOutSamples) {
  3610. - pOut0 = hMdct->overlap.time + hMdct->ov_offset;
  3611. - hMdct->ov_offset += hMdct->prev_nr + fl / 2;
  3612. - } else {
  3613. - pOut0 = output + nrSamples;
  3614. - nrSamples += hMdct->prev_nr + fl / 2;
  3615. - }
  3616. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3617. - for (i = 0; i < hMdct->prev_nr; i++) {
  3618. - FIXP_DBL x = -(*pOvl--);
  3619. - *pOut0 = IMDCT_SCALE_DBL(x);
  3620. - pOut0++;
  3621. - }
  3622. - } else {
  3623. - for (i = 0; i < hMdct->prev_nr; i++) {
  3624. - FIXP_DBL x = (*pOvl--);
  3625. - *pOut0 = IMDCT_SCALE_DBL(x);
  3626. - pOut0++;
  3627. - }
  3628. - }
  3629. - hMdct->prev_nr = 0;
  3630. -
  3631. - {
  3632. - if (pFac != NULL) {
  3633. - /* Note: The FAC gain might have been applied directly after bit stream
  3634. - * parse in this case. */
  3635. - CFac_CalcFacSignal(pOut0, pFac, fac_scale, fac_length, A, A_exp, 0,
  3636. - isFdFac);
  3637. - } else {
  3638. - /* Clear buffer because of the overlap and ADD! */
  3639. - FDKmemclear(pOut0, fac_length * sizeof(FIXP_DBL));
  3640. - }
  3641. - }
  3642. -
  3643. - i = 0;
  3644. -
  3645. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3646. - for (; i < fl / 2; i++) {
  3647. - FIXP_DBL x0;
  3648. -
  3649. - /* Overlap Add */
  3650. - x0 = -fMult(*pOvl--, pWindow[i].v.re);
  3651. -
  3652. - *pOut0 += IMDCT_SCALE_DBL(x0);
  3653. - pOut0++;
  3654. - }
  3655. - } else {
  3656. - for (; i < fl / 2; i++) {
  3657. - FIXP_DBL x0;
  3658. -
  3659. - /* Overlap Add */
  3660. - x0 = fMult(*pOvl--, pWindow[i].v.re);
  3661. -
  3662. - *pOut0 += IMDCT_SCALE_DBL(x0);
  3663. - pOut0++;
  3664. - }
  3665. - }
  3666. - if (hMdct->pFacZir !=
  3667. - 0) { /* this should only happen for ACELP -> TCX20 -> ACELP transition */
  3668. - FIXP_DBL *pOut = pOut0 - fl / 2; /* fl/2 == fac_length */
  3669. - for (i = 0; i < fl / 2; i++) {
  3670. - pOut[i] += IMDCT_SCALE_DBL(hMdct->pFacZir[i]);
  3671. - }
  3672. - hMdct->pFacZir = NULL;
  3673. - }
  3674. -
  3675. - hMdct->prev_fr = 0;
  3676. - hMdct->prev_nr = 0;
  3677. - hMdct->prev_tl = 0;
  3678. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  3679. -
  3680. - return nrSamples;
  3681. -}
  3682. -
  3683. -INT CLpd_FAC_Acelp2Mdct(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *_pSpec,
  3684. - const SHORT spec_scale[], const int nSpec,
  3685. - FIXP_DBL *pFac, const int fac_scale,
  3686. - const INT fac_length, INT noOutSamples, const INT tl,
  3687. - const FIXP_WTP *wrs, const INT fr, FIXP_LPC A[16],
  3688. - INT A_exp, CAcelpStaticMem *acelp_mem,
  3689. - const FIXP_DBL gain, const int last_frame_lost,
  3690. - const int isFdFac, const UCHAR last_lpd_mode,
  3691. - const int k, int currAliasingSymmetry) {
  3692. - FIXP_DBL *pCurr, *pOvl, *pSpec;
  3693. - const FIXP_WTP *pWindow;
  3694. - const FIXP_WTB *FacWindowZir_conceal;
  3695. - UCHAR doFacZirConceal = 0;
  3696. - int doDeemph = 1;
  3697. - const FIXP_WTB *FacWindowZir, *FacWindowSynth;
  3698. - FIXP_DBL *pOut0 = output, *pOut1;
  3699. - int w, i, fl, nl, nr, f_len, nrSamples = 0, s = 0, scale, total_gain_e;
  3700. - FIXP_DBL *pF, *pFAC_and_FAC_ZIR = NULL;
  3701. - FIXP_DBL total_gain = gain;
  3702. -
  3703. - FDK_ASSERT(fac_length <= 1024 / (4 * 2));
  3704. - switch (fac_length) {
  3705. - /* coreCoderFrameLength = 1024 */
  3706. - case 128:
  3707. - pWindow = SineWindow256;
  3708. - FacWindowZir = FacWindowZir128;
  3709. - FacWindowSynth = FacWindowSynth128;
  3710. - break;
  3711. - case 64:
  3712. - pWindow = SineWindow128;
  3713. - FacWindowZir = FacWindowZir64;
  3714. - FacWindowSynth = FacWindowSynth64;
  3715. - break;
  3716. - case 32:
  3717. - pWindow = SineWindow64;
  3718. - FacWindowZir = FacWindowZir32;
  3719. - FacWindowSynth = FacWindowSynth32;
  3720. - break;
  3721. - /* coreCoderFrameLength = 768 */
  3722. - case 96:
  3723. - pWindow = SineWindow192;
  3724. - FacWindowZir = FacWindowZir96;
  3725. - FacWindowSynth = FacWindowSynth96;
  3726. - break;
  3727. - case 48:
  3728. - pWindow = SineWindow96;
  3729. - FacWindowZir = FacWindowZir48;
  3730. - FacWindowSynth = FacWindowSynth48;
  3731. - break;
  3732. - default:
  3733. - FDK_ASSERT(0);
  3734. - return 0;
  3735. - }
  3736. -
  3737. - FacWindowZir_conceal = FacWindowSynth;
  3738. - /* Derive NR and NL */
  3739. - fl = fac_length * 2;
  3740. - nl = (tl - fl) >> 1;
  3741. - nr = (tl - fr) >> 1;
  3742. -
  3743. - if (noOutSamples > nrSamples) {
  3744. - /* Purge buffered output. */
  3745. - FDKmemcpy(pOut0, hMdct->overlap.time, hMdct->ov_offset * sizeof(pOut0[0]));
  3746. - nrSamples = hMdct->ov_offset;
  3747. - hMdct->ov_offset = 0;
  3748. - }
  3749. -
  3750. - if (nrSamples >= noOutSamples) {
  3751. - pOut1 = hMdct->overlap.time + hMdct->ov_offset;
  3752. - if (hMdct->ov_offset < fac_length) {
  3753. - pOut0 = output + nrSamples;
  3754. - } else {
  3755. - pOut0 = pOut1;
  3756. - }
  3757. - hMdct->ov_offset += fac_length + nl;
  3758. - } else {
  3759. - pOut1 = output + nrSamples;
  3760. - pOut0 = output + nrSamples;
  3761. - }
  3762. -
  3763. - {
  3764. - pFAC_and_FAC_ZIR = CLpd_ACELP_GetFreeExcMem(acelp_mem, 2 * fac_length);
  3765. - {
  3766. - const FIXP_DBL *pTmp1, *pTmp2;
  3767. -
  3768. - doFacZirConceal |= ((last_frame_lost != 0) && (k == 0));
  3769. - doDeemph &= (last_lpd_mode != 4);
  3770. - if (doFacZirConceal) {
  3771. - /* ACELP contribution in concealment case:
  3772. - Use ZIR with a modified ZIR window to preserve some more energy.
  3773. - Dont use FAC, which contains wrong information for concealed frame
  3774. - Dont use last ACELP samples, but double ZIR, instead (afterwards) */
  3775. - FDKmemclear(pFAC_and_FAC_ZIR, 2 * fac_length * sizeof(FIXP_DBL));
  3776. - FacWindowSynth = (FIXP_WTB *)pFAC_and_FAC_ZIR;
  3777. - FacWindowZir = FacWindowZir_conceal;
  3778. - } else {
  3779. - CFac_CalcFacSignal(pFAC_and_FAC_ZIR, pFac, fac_scale + s, fac_length, A,
  3780. - A_exp, 1, isFdFac);
  3781. - }
  3782. - /* 6) Get windowed past ACELP samples and ACELP ZIR signal */
  3783. -
  3784. - /*
  3785. - * Get ACELP ZIR (pFac[]) and ACELP past samples (pOut0[]) and add them
  3786. - * to the FAC synth signal contribution on pOut1[].
  3787. - */
  3788. - {
  3789. - {
  3790. - CLpd_Acelp_Zir(A, A_exp, acelp_mem, fac_length, pFac, doDeemph);
  3791. -
  3792. - pTmp1 = pOut0;
  3793. - pTmp2 = pFac;
  3794. - }
  3795. -
  3796. - for (i = 0, w = 0; i < fac_length; i++) {
  3797. - FIXP_DBL x;
  3798. - /* Div2 is compensated by table scaling */
  3799. - x = fMultDiv2(pTmp2[i], FacWindowZir[w]);
  3800. - x += fMultDiv2(pTmp1[-i - 1], FacWindowSynth[w]);
  3801. - x += pFAC_and_FAC_ZIR[i];
  3802. - pOut1[i] = x;
  3803. -
  3804. - w++;
  3805. - }
  3806. - }
  3807. -
  3808. - if (doFacZirConceal) {
  3809. - /* ZIR is the only ACELP contribution, so double it */
  3810. - scaleValues(pOut1, fac_length, 1);
  3811. - }
  3812. - }
  3813. - }
  3814. -
  3815. - if (nrSamples < noOutSamples) {
  3816. - nrSamples += fac_length + nl;
  3817. - }
  3818. -
  3819. - /* Obtain transform gain */
  3820. - total_gain = gain;
  3821. - total_gain_e = 0;
  3822. - imdct_gain(&total_gain, &total_gain_e, tl);
  3823. -
  3824. - /* IMDCT overlap add */
  3825. - scale = total_gain_e;
  3826. - pSpec = _pSpec;
  3827. -
  3828. - /* Note:when comming from an LPD frame (TCX/ACELP) the previous alisaing
  3829. - * symmetry must always be 0 */
  3830. - if (currAliasingSymmetry == 0) {
  3831. - dct_IV(pSpec, tl, &scale);
  3832. - } else {
  3833. - FIXP_DBL _tmp[1024 + ALIGNMENT_DEFAULT / sizeof(FIXP_DBL)];
  3834. - FIXP_DBL *tmp = (FIXP_DBL *)ALIGN_PTR(_tmp);
  3835. - C_ALLOC_ALIGNED_REGISTER(tmp, sizeof(_tmp));
  3836. - dst_III(pSpec, tmp, tl, &scale);
  3837. - C_ALLOC_ALIGNED_UNREGISTER(tmp);
  3838. - }
  3839. -
  3840. - /* Optional scaling of time domain - no yet windowed - of current spectrum */
  3841. - if (total_gain != (FIXP_DBL)0) {
  3842. - for (i = 0; i < tl; i++) {
  3843. - pSpec[i] = fMult(pSpec[i], total_gain);
  3844. - }
  3845. - }
  3846. - int loc_scale = fixmin_I(spec_scale[0] + scale, (INT)DFRACT_BITS - 1);
  3847. - scaleValuesSaturate(pSpec, tl, loc_scale);
  3848. -
  3849. - pOut1 += fl / 2 - 1;
  3850. - pCurr = pSpec + tl - fl / 2;
  3851. -
  3852. - for (i = 0; i < fl / 2; i++) {
  3853. - FIXP_DBL x1;
  3854. -
  3855. - /* FAC signal is already on pOut1, because of that the += operator. */
  3856. - x1 = fMult(*pCurr++, pWindow[i].v.re);
  3857. - FDK_ASSERT((pOut1 >= hMdct->overlap.time &&
  3858. - pOut1 < hMdct->overlap.time + hMdct->ov_size) ||
  3859. - (pOut1 >= output && pOut1 < output + 1024));
  3860. - *pOut1 += IMDCT_SCALE_DBL(-x1);
  3861. - pOut1--;
  3862. - }
  3863. -
  3864. - /* NL output samples TL/2+FL/2..TL. - current[FL/2..0] */
  3865. - pOut1 += (fl / 2) + 1;
  3866. -
  3867. - pFAC_and_FAC_ZIR += fac_length; /* set pointer to beginning of FAC ZIR */
  3868. -
  3869. - if (nl == 0) {
  3870. - /* save pointer to write FAC ZIR data later */
  3871. - hMdct->pFacZir = pFAC_and_FAC_ZIR;
  3872. - } else {
  3873. - FDK_ASSERT(nl >= fac_length);
  3874. - /* FAC ZIR will be added now ... */
  3875. - hMdct->pFacZir = NULL;
  3876. - }
  3877. -
  3878. - pF = pFAC_and_FAC_ZIR;
  3879. - f_len = fac_length;
  3880. -
  3881. - pCurr = pSpec + tl - fl / 2 - 1;
  3882. - for (i = 0; i < nl; i++) {
  3883. - FIXP_DBL x = -(*pCurr--);
  3884. - /* 5) (item 4) Synthesis filter Zir component, FAC ZIR (another one). */
  3885. - if (i < f_len) {
  3886. - x += *pF++;
  3887. - }
  3888. -
  3889. - FDK_ASSERT((pOut1 >= hMdct->overlap.time &&
  3890. - pOut1 < hMdct->overlap.time + hMdct->ov_size) ||
  3891. - (pOut1 >= output && pOut1 < output + 1024));
  3892. - *pOut1 = IMDCT_SCALE_DBL(x);
  3893. - pOut1++;
  3894. - }
  3895. -
  3896. - hMdct->prev_nr = nr;
  3897. - hMdct->prev_fr = fr;
  3898. - hMdct->prev_wrs = wrs;
  3899. - hMdct->prev_tl = tl;
  3900. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  3901. - hMdct->prevAliasSymmetry = currAliasingSymmetry;
  3902. - fl = fr;
  3903. - nl = nr;
  3904. -
  3905. - pOvl = pSpec + tl / 2 - 1;
  3906. - pOut0 = pOut1;
  3907. -
  3908. - for (w = 1; w < nSpec; w++) /* for ACELP -> FD short */
  3909. - {
  3910. - const FIXP_WTP *pWindow_prev;
  3911. -
  3912. - /* Setup window pointers */
  3913. - pWindow_prev = hMdct->prev_wrs;
  3914. -
  3915. - /* Current spectrum */
  3916. - pSpec = _pSpec + w * tl;
  3917. -
  3918. - scale = total_gain_e;
  3919. -
  3920. - /* For the second, third, etc. short frames the alisaing symmetry is equal,
  3921. - * either (0,0) or (1,1) */
  3922. - if (currAliasingSymmetry == 0) {
  3923. - /* DCT IV of current spectrum */
  3924. - dct_IV(pSpec, tl, &scale);
  3925. - } else {
  3926. - dst_IV(pSpec, tl, &scale);
  3927. - }
  3928. -
  3929. - /* Optional scaling of time domain - no yet windowed - of current spectrum
  3930. - */
  3931. - /* and de-scale current spectrum signal (time domain, no yet windowed) */
  3932. - if (total_gain != (FIXP_DBL)0) {
  3933. - for (i = 0; i < tl; i++) {
  3934. - pSpec[i] = fMult(pSpec[i], total_gain);
  3935. - }
  3936. - }
  3937. - loc_scale = fixmin_I(spec_scale[w] + scale, (INT)DFRACT_BITS - 1);
  3938. - scaleValuesSaturate(pSpec, tl, loc_scale);
  3939. -
  3940. - if (noOutSamples <= nrSamples) {
  3941. - /* Divert output first half to overlap buffer if we already got enough
  3942. - * output samples. */
  3943. - pOut0 = hMdct->overlap.time + hMdct->ov_offset;
  3944. - hMdct->ov_offset += hMdct->prev_nr + fl / 2;
  3945. - } else {
  3946. - /* Account output samples */
  3947. - nrSamples += hMdct->prev_nr + fl / 2;
  3948. - }
  3949. -
  3950. - /* NR output samples 0 .. NR. -overlap[TL/2..TL/2-NR] */
  3951. - for (i = 0; i < hMdct->prev_nr; i++) {
  3952. - FIXP_DBL x = -(*pOvl--);
  3953. - *pOut0 = IMDCT_SCALE_DBL(x);
  3954. - pOut0++;
  3955. - }
  3956. -
  3957. - if (noOutSamples <= nrSamples) {
  3958. - /* Divert output second half to overlap buffer if we already got enough
  3959. - * output samples. */
  3960. - pOut1 = hMdct->overlap.time + hMdct->ov_offset + fl / 2 - 1;
  3961. - hMdct->ov_offset += fl / 2 + nl;
  3962. - } else {
  3963. - pOut1 = pOut0 + (fl - 1);
  3964. - nrSamples += fl / 2 + nl;
  3965. - }
  3966. -
  3967. - /* output samples before window crossing point NR .. TL/2.
  3968. - * -overlap[TL/2-NR..TL/2-NR-FL/2] + current[NR..TL/2] */
  3969. - /* output samples after window crossing point TL/2 .. TL/2+FL/2.
  3970. - * -overlap[0..FL/2] - current[TL/2..FL/2] */
  3971. - pCurr = pSpec + tl - fl / 2;
  3972. - if (currAliasingSymmetry == 0) {
  3973. - for (i = 0; i < fl / 2; i++) {
  3974. - FIXP_DBL x0, x1;
  3975. -
  3976. - cplxMult(&x1, &x0, *pCurr++, -*pOvl--, pWindow_prev[i]);
  3977. - *pOut0 = IMDCT_SCALE_DBL(x0);
  3978. - *pOut1 = IMDCT_SCALE_DBL(-x1);
  3979. - pOut0++;
  3980. - pOut1--;
  3981. - }
  3982. - } else {
  3983. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3984. - /* Jump DST II -> DST IV for the second window */
  3985. - for (i = 0; i < fl / 2; i++) {
  3986. - FIXP_DBL x0, x1;
  3987. -
  3988. - cplxMult(&x1, &x0, *pCurr++, -*pOvl--, pWindow_prev[i]);
  3989. - *pOut0 = IMDCT_SCALE_DBL(x0);
  3990. - *pOut1 = IMDCT_SCALE_DBL(x1);
  3991. - pOut0++;
  3992. - pOut1--;
  3993. - }
  3994. - } else {
  3995. - /* Jump DST IV -> DST IV from the second window on */
  3996. - for (i = 0; i < fl / 2; i++) {
  3997. - FIXP_DBL x0, x1;
  3998. -
  3999. - cplxMult(&x1, &x0, *pCurr++, *pOvl--, pWindow_prev[i]);
  4000. - *pOut0 = IMDCT_SCALE_DBL(x0);
  4001. - *pOut1 = IMDCT_SCALE_DBL(x1);
  4002. - pOut0++;
  4003. - pOut1--;
  4004. - }
  4005. - }
  4006. - }
  4007. -
  4008. - if (hMdct->pFacZir != 0) {
  4009. - /* add FAC ZIR of previous ACELP -> mdct transition */
  4010. - FIXP_DBL *pOut = pOut0 - fl / 2;
  4011. - FDK_ASSERT(fl / 2 <= 128);
  4012. - for (i = 0; i < fl / 2; i++) {
  4013. - pOut[i] += IMDCT_SCALE_DBL(hMdct->pFacZir[i]);
  4014. - }
  4015. - hMdct->pFacZir = NULL;
  4016. - }
  4017. - pOut0 += (fl / 2);
  4018. -
  4019. - /* NL output samples TL/2+FL/2..TL. - current[FL/2..0] */
  4020. - pOut1 += (fl / 2) + 1;
  4021. - pCurr = pSpec + tl - fl / 2 - 1;
  4022. - for (i = 0; i < nl; i++) {
  4023. - FIXP_DBL x = -(*pCurr--);
  4024. - *pOut1 = IMDCT_SCALE_DBL(x);
  4025. - pOut1++;
  4026. - }
  4027. -
  4028. - /* Set overlap source pointer for next window pOvl = pSpec + tl/2 - 1; */
  4029. - pOvl = pSpec + tl / 2 - 1;
  4030. -
  4031. - /* Previous window values. */
  4032. - hMdct->prev_nr = nr;
  4033. - hMdct->prev_fr = fr;
  4034. - hMdct->prev_tl = tl;
  4035. - hMdct->prev_wrs = pWindow_prev;
  4036. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  4037. - hMdct->prevAliasSymmetry = currAliasingSymmetry;
  4038. - }
  4039. -
  4040. - /* Save overlap */
  4041. -
  4042. - pOvl = hMdct->overlap.freq + hMdct->ov_size - tl / 2;
  4043. - FDK_ASSERT(pOvl >= hMdct->overlap.time + hMdct->ov_offset);
  4044. - FDK_ASSERT(tl / 2 <= hMdct->ov_size);
  4045. - for (i = 0; i < tl / 2; i++) {
  4046. - pOvl[i] = _pSpec[i + (w - 1) * tl];
  4047. - }
  4048. -
  4049. - return nrSamples;
  4050. -}
  4051. diff --git a/libAACdec/src/usacdec_fac.h b/libAACdec/src/usacdec_fac.h
  4052. deleted file mode 100644
  4053. index 100a6fa..0000000
  4054. --- a/libAACdec/src/usacdec_fac.h
  4055. +++ /dev/null
  4056. @@ -1,191 +0,0 @@
  4057. -/* -----------------------------------------------------------------------------
  4058. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  4059. -
  4060. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  4061. -Forschung e.V. All rights reserved.
  4062. -
  4063. - 1. INTRODUCTION
  4064. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  4065. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  4066. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  4067. -a wide variety of Android devices.
  4068. -
  4069. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  4070. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  4071. -full-bandwidth communications codec by independent studies and is widely
  4072. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  4073. -specifications.
  4074. -
  4075. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  4076. -those of Fraunhofer) may be obtained through Via Licensing
  4077. -(www.vialicensing.com) or through the respective patent owners individually for
  4078. -the purpose of encoding or decoding bit streams in products that are compliant
  4079. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  4080. -Android devices already license these patent claims through Via Licensing or
  4081. -directly from the patent owners, and therefore FDK AAC Codec software may
  4082. -already be covered under those patent licenses when it is used for those
  4083. -licensed purposes only.
  4084. -
  4085. -Commercially-licensed AAC software libraries, including floating-point versions
  4086. -with enhanced sound quality, are also available from Fraunhofer. Users are
  4087. -encouraged to check the Fraunhofer website for additional applications
  4088. -information and documentation.
  4089. -
  4090. -2. COPYRIGHT LICENSE
  4091. -
  4092. -Redistribution and use in source and binary forms, with or without modification,
  4093. -are permitted without payment of copyright license fees provided that you
  4094. -satisfy the following conditions:
  4095. -
  4096. -You must retain the complete text of this software license in redistributions of
  4097. -the FDK AAC Codec or your modifications thereto in source code form.
  4098. -
  4099. -You must retain the complete text of this software license in the documentation
  4100. -and/or other materials provided with redistributions of the FDK AAC Codec or
  4101. -your modifications thereto in binary form. You must make available free of
  4102. -charge copies of the complete source code of the FDK AAC Codec and your
  4103. -modifications thereto to recipients of copies in binary form.
  4104. -
  4105. -The name of Fraunhofer may not be used to endorse or promote products derived
  4106. -from this library without prior written permission.
  4107. -
  4108. -You may not charge copyright license fees for anyone to use, copy or distribute
  4109. -the FDK AAC Codec software or your modifications thereto.
  4110. -
  4111. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  4112. -that you changed the software and the date of any change. For modified versions
  4113. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  4114. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  4115. -AAC Codec Library for Android."
  4116. -
  4117. -3. NO PATENT LICENSE
  4118. -
  4119. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  4120. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  4121. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  4122. -software.
  4123. -
  4124. -You may use this FDK AAC Codec software or modifications thereto only for
  4125. -purposes that are authorized by appropriate patent licenses.
  4126. -
  4127. -4. DISCLAIMER
  4128. -
  4129. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  4130. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  4131. -including but not limited to the implied warranties of merchantability and
  4132. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  4133. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  4134. -or consequential damages, including but not limited to procurement of substitute
  4135. -goods or services; loss of use, data, or profits, or business interruption,
  4136. -however caused and on any theory of liability, whether in contract, strict
  4137. -liability, or tort (including negligence), arising in any way out of the use of
  4138. -this software, even if advised of the possibility of such damage.
  4139. -
  4140. -5. CONTACT INFORMATION
  4141. -
  4142. -Fraunhofer Institute for Integrated Circuits IIS
  4143. -Attention: Audio and Multimedia Departments - FDK AAC LL
  4144. -Am Wolfsmantel 33
  4145. -91058 Erlangen, Germany
  4146. -
  4147. -www.iis.fraunhofer.de/amm
  4148. -amm-info@iis.fraunhofer.de
  4149. ------------------------------------------------------------------------------ */
  4150. -
  4151. -/**************************** AAC decoder library ******************************
  4152. -
  4153. - Author(s): Manuel Jander
  4154. -
  4155. - Description: USAC FAC
  4156. -
  4157. -*******************************************************************************/
  4158. -
  4159. -#ifndef USACDEC_FAC_H
  4160. -#define USACDEC_FAC_H
  4161. -
  4162. -#include "channelinfo.h"
  4163. -#include "FDK_bitstream.h"
  4164. -
  4165. -/**
  4166. - * \brief Get the address of a memory area of the spectral data memory were the
  4167. - * FAC data can be stored into.
  4168. - * \param spec SPECTRAL_PTR pointing to the current spectral data.
  4169. - * \param mod the current LPD mod array.
  4170. - * \param pState pointer to a private state variable which must be 0 for the
  4171. - * first call and not changed externally.
  4172. - * \param isFullbandLPD is 1 if fullband LPD mode is on, otherwise it is 0.
  4173. - */
  4174. -FIXP_DBL *CLpd_FAC_GetMemory(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  4175. - UCHAR mod[NB_SUBFR], int *pState);
  4176. -
  4177. -/**
  4178. - * \brief read a fac bitstream data block.
  4179. - * \param hBs a bit stream handle, where the fac bitstream data is located.
  4180. - * \param pFac pointer to were the FAC data will be stored into.
  4181. - * \param pFacScale pointer to were the FAC data scale value will be stored
  4182. - * into.
  4183. - * \param tcx_gain value to be used as FAC gain. If zero, read fac_gain from
  4184. - * bitstream.
  4185. - * \param tcx_gain_e exponen value of tcx_gain.
  4186. - * \param frame the subframe to be considered from the current superframe.
  4187. - * Always 0 for FD case.
  4188. - * \return 0 on success, -1 on error.
  4189. - */
  4190. -int CLpd_FAC_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pFac, SCHAR *pFacScale,
  4191. - int length, int use_gain, int frame);
  4192. -
  4193. -/**
  4194. - * \brief Apply TCX and ALFD gains to FAC data.
  4195. - * \param fac_data pointer to FAC data.
  4196. - * \param fac_length FAC length (128 or 96).
  4197. - * \param tcx_gain TCX gain
  4198. - * \param alfd_gains pointer to alfd gains.
  4199. - * \param mod mod value (1,2,3) of TCX frame where the FAC signal needs to be
  4200. - * applied.
  4201. - */
  4202. -void CFac_ApplyGains(FIXP_DBL fac_data[LFAC], const INT fac_length,
  4203. - const FIXP_DBL tcx_gain, const FIXP_DBL alfd_gains[],
  4204. - const INT mod);
  4205. -
  4206. -/**
  4207. - * \brief Do FAC transition from frequency domain to ACELP domain.
  4208. - */
  4209. -INT CLpd_FAC_Mdct2Acelp(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pFac_data,
  4210. - const int fac_data_e, FIXP_LPC *A, INT A_exp,
  4211. - INT nrOutSamples, const INT fac_length,
  4212. - const INT isFdFac, UCHAR prevWindowShape);
  4213. -
  4214. -/**
  4215. - * \brief Do FAC transition from ACELP domain to frequency domain.
  4216. - * \param hMdct MDCT context.
  4217. - * \param output pointer for time domain output.
  4218. - * \param pSpec pointer to MDCT spectrum input.
  4219. - * \param spec_scale MDCT spectrum exponents.
  4220. - * \param nSpec amount of contiguos MDCT spectra.
  4221. - * \param pFac pointer to FAC MDCT domain data.
  4222. - * \param fac_scale exponent of FAC data.
  4223. - * \param fac_length length of FAC data.
  4224. - * \param nrSamples room in samples in output buffer.
  4225. - * \param tl MDCT transform length of pSpec.
  4226. - * \param wrs right MDCT window slope.
  4227. - * \param fr right MDCT window slope length.
  4228. - * \param A LP domain filter coefficients.
  4229. - * \param deemph_mem deemphasis filter state.
  4230. - * \param gain gain to be applied to FAC data before overlap add.
  4231. - * \param old_syn_mem Synthesis filter state.
  4232. - * \param isFdFac indicates fac processing from or to FD.
  4233. - * \param pFacData fac data stored for fullband LPD.
  4234. - * \param elFlags element specific parser guidance flags.
  4235. - * \param isFacForFullband indicates that fac is processed for fullband LPD.
  4236. - */
  4237. -INT CLpd_FAC_Acelp2Mdct(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pSpec,
  4238. - const SHORT spec_scale[], const int nSpec,
  4239. - FIXP_DBL *pFac_data, const int fac_data_e,
  4240. - const INT fac_length, INT nrSamples, const INT tl,
  4241. - const FIXP_WTP *wrs, const INT fr, FIXP_LPC A[16],
  4242. - INT A_exp, CAcelpStaticMem *acelp_mem,
  4243. - const FIXP_DBL gain, const int last_frame_lost,
  4244. - const int isFdFac, const UCHAR last_lpd, const int k,
  4245. - int currAliasingSymmetry);
  4246. -
  4247. -#endif /* USACDEC_FAC_H */
  4248. diff --git a/libAACdec/src/usacdec_lpc.cpp b/libAACdec/src/usacdec_lpc.cpp
  4249. deleted file mode 100644
  4250. index 271463f..0000000
  4251. --- a/libAACdec/src/usacdec_lpc.cpp
  4252. +++ /dev/null
  4253. @@ -1,1194 +0,0 @@
  4254. -/* -----------------------------------------------------------------------------
  4255. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  4256. -
  4257. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  4258. -Forschung e.V. All rights reserved.
  4259. -
  4260. - 1. INTRODUCTION
  4261. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  4262. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  4263. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  4264. -a wide variety of Android devices.
  4265. -
  4266. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  4267. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  4268. -full-bandwidth communications codec by independent studies and is widely
  4269. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  4270. -specifications.
  4271. -
  4272. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  4273. -those of Fraunhofer) may be obtained through Via Licensing
  4274. -(www.vialicensing.com) or through the respective patent owners individually for
  4275. -the purpose of encoding or decoding bit streams in products that are compliant
  4276. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  4277. -Android devices already license these patent claims through Via Licensing or
  4278. -directly from the patent owners, and therefore FDK AAC Codec software may
  4279. -already be covered under those patent licenses when it is used for those
  4280. -licensed purposes only.
  4281. -
  4282. -Commercially-licensed AAC software libraries, including floating-point versions
  4283. -with enhanced sound quality, are also available from Fraunhofer. Users are
  4284. -encouraged to check the Fraunhofer website for additional applications
  4285. -information and documentation.
  4286. -
  4287. -2. COPYRIGHT LICENSE
  4288. -
  4289. -Redistribution and use in source and binary forms, with or without modification,
  4290. -are permitted without payment of copyright license fees provided that you
  4291. -satisfy the following conditions:
  4292. -
  4293. -You must retain the complete text of this software license in redistributions of
  4294. -the FDK AAC Codec or your modifications thereto in source code form.
  4295. -
  4296. -You must retain the complete text of this software license in the documentation
  4297. -and/or other materials provided with redistributions of the FDK AAC Codec or
  4298. -your modifications thereto in binary form. You must make available free of
  4299. -charge copies of the complete source code of the FDK AAC Codec and your
  4300. -modifications thereto to recipients of copies in binary form.
  4301. -
  4302. -The name of Fraunhofer may not be used to endorse or promote products derived
  4303. -from this library without prior written permission.
  4304. -
  4305. -You may not charge copyright license fees for anyone to use, copy or distribute
  4306. -the FDK AAC Codec software or your modifications thereto.
  4307. -
  4308. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  4309. -that you changed the software and the date of any change. For modified versions
  4310. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  4311. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  4312. -AAC Codec Library for Android."
  4313. -
  4314. -3. NO PATENT LICENSE
  4315. -
  4316. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  4317. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  4318. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  4319. -software.
  4320. -
  4321. -You may use this FDK AAC Codec software or modifications thereto only for
  4322. -purposes that are authorized by appropriate patent licenses.
  4323. -
  4324. -4. DISCLAIMER
  4325. -
  4326. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  4327. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  4328. -including but not limited to the implied warranties of merchantability and
  4329. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  4330. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  4331. -or consequential damages, including but not limited to procurement of substitute
  4332. -goods or services; loss of use, data, or profits, or business interruption,
  4333. -however caused and on any theory of liability, whether in contract, strict
  4334. -liability, or tort (including negligence), arising in any way out of the use of
  4335. -this software, even if advised of the possibility of such damage.
  4336. -
  4337. -5. CONTACT INFORMATION
  4338. -
  4339. -Fraunhofer Institute for Integrated Circuits IIS
  4340. -Attention: Audio and Multimedia Departments - FDK AAC LL
  4341. -Am Wolfsmantel 33
  4342. -91058 Erlangen, Germany
  4343. -
  4344. -www.iis.fraunhofer.de/amm
  4345. -amm-info@iis.fraunhofer.de
  4346. ------------------------------------------------------------------------------ */
  4347. -
  4348. -/**************************** AAC decoder library ******************************
  4349. -
  4350. - Author(s): Matthias Hildenbrand, Manuel Jander
  4351. -
  4352. - Description: USAC LPC/AVQ decode
  4353. -
  4354. -*******************************************************************************/
  4355. -
  4356. -#include "usacdec_lpc.h"
  4357. -
  4358. -#include "usacdec_rom.h"
  4359. -#include "FDK_trigFcts.h"
  4360. -
  4361. -#define NQ_MAX 36
  4362. -
  4363. -/*
  4364. - * Helper functions.
  4365. - */
  4366. -
  4367. -/**
  4368. - * \brief Read unary code.
  4369. - * \param hBs bitstream handle as data source.
  4370. - * \return decoded value.
  4371. - */
  4372. -static int get_vlclbf(HANDLE_FDK_BITSTREAM hBs) {
  4373. - int result = 0;
  4374. -
  4375. - while (FDKreadBits(hBs, 1) && result <= NQ_MAX) {
  4376. - result++;
  4377. - }
  4378. - return result;
  4379. -}
  4380. -
  4381. -/**
  4382. - * \brief Read bit count limited unary code.
  4383. - * \param hBs bitstream handle as data source
  4384. - * \param n max amount of bits to be read.
  4385. - * \return decoded value.
  4386. - */
  4387. -static int get_vlclbf_n(HANDLE_FDK_BITSTREAM hBs, int n) {
  4388. - int result = 0;
  4389. -
  4390. - while (FDKreadBits(hBs, 1)) {
  4391. - result++;
  4392. - n--;
  4393. - if (n <= 0) {
  4394. - break;
  4395. - }
  4396. - }
  4397. -
  4398. - return result;
  4399. -}
  4400. -
  4401. -/*
  4402. - * Algebraic Vector Quantizer
  4403. - */
  4404. -
  4405. -/* ZF_SCALE must be greater than (number of FIXP_ZF)/2
  4406. - because the loss of precision caused by fPow2Div2 in RE8_PPV() */
  4407. -//#define ZF_SCALE ((NQ_MAX-3)>>1)
  4408. -#define ZF_SCALE ((DFRACT_BITS / 2))
  4409. -#define FIXP_ZF FIXP_DBL
  4410. -#define INT2ZF(x, s) (FIXP_ZF)((x) << (ZF_SCALE - (s)))
  4411. -#define ZF2INT(x) (INT)((x) >> ZF_SCALE)
  4412. -
  4413. -/* 1.0 in ZF format format */
  4414. -#define ONEZF ((FIXP_ZF)INT2ZF(1, 0))
  4415. -
  4416. -/* static */
  4417. -void nearest_neighbor_2D8(FIXP_ZF x[8], int y[8]) {
  4418. - FIXP_ZF s, em, e[8];
  4419. - int i, j, sum;
  4420. -
  4421. - /* round x into 2Z^8 i.e. compute y=(y1,...,y8) such that yi = 2[xi/2]
  4422. - where [.] is the nearest integer operator
  4423. - in the mean time, compute sum = y1+...+y8
  4424. - */
  4425. - sum = 0;
  4426. - for (i = 0; i < 8; i++) {
  4427. - FIXP_ZF tmp;
  4428. - /* round to ..., -2, 0, 2, ... ([-1..1[ --> 0) */
  4429. - if (x[i] < (FIXP_ZF)0) {
  4430. - tmp = ONEZF - x[i];
  4431. - y[i] = -2 * ((ZF2INT(tmp)) >> 1);
  4432. - } else {
  4433. - tmp = ONEZF + x[i];
  4434. - y[i] = 2 * ((ZF2INT(tmp)) >> 1);
  4435. - }
  4436. - sum += y[i];
  4437. - }
  4438. - /* check if y1+...+y8 is a multiple of 4
  4439. - if not, y is not round xj in the wrong way where j is defined by
  4440. - j = arg max_i | xi -yi|
  4441. - (this is called the Wagner rule)
  4442. - */
  4443. - if (sum % 4) {
  4444. - /* find j = arg max_i | xi -yi| */
  4445. - em = (FIXP_SGL)0;
  4446. - j = 0;
  4447. - for (i = 0; i < 8; i++) {
  4448. - /* compute ei = xi-yi */
  4449. - e[i] = x[i] - INT2ZF(y[i], 0);
  4450. - }
  4451. - for (i = 0; i < 8; i++) {
  4452. - /* compute |ei| = | xi-yi | */
  4453. - if (e[i] < (FIXP_ZF)0) {
  4454. - s = -e[i];
  4455. - } else {
  4456. - s = e[i];
  4457. - }
  4458. - /* check if |ei| is maximal, if so, set j=i */
  4459. - if (em < s) {
  4460. - em = s;
  4461. - j = i;
  4462. - }
  4463. - }
  4464. - /* round xj in the "wrong way" */
  4465. - if (e[j] < (FIXP_ZF)0) {
  4466. - y[j] -= 2;
  4467. - } else {
  4468. - y[j] += 2;
  4469. - }
  4470. - }
  4471. -}
  4472. -
  4473. -/*--------------------------------------------------------------
  4474. - RE8_PPV(x,y)
  4475. - NEAREST NEIGHBOR SEARCH IN INFINITE LATTICE RE8
  4476. - the algorithm is based on the definition of RE8 as
  4477. - RE8 = (2D8) U (2D8+[1,1,1,1,1,1,1,1])
  4478. - it applies the coset decoding of Sloane and Conway
  4479. - (i) x: point in R^8 in 32-ZF_SCALE.ZF_SCALE format
  4480. - (o) y: point in RE8 (8-dimensional integer vector)
  4481. - --------------------------------------------------------------
  4482. -*/
  4483. -/* static */
  4484. -void RE8_PPV(FIXP_ZF x[], SHORT y[], int r) {
  4485. - int i, y0[8], y1[8];
  4486. - FIXP_ZF x1[8], tmp;
  4487. - FIXP_DBL e;
  4488. -
  4489. - /* find the nearest neighbor y0 of x in 2D8 */
  4490. - nearest_neighbor_2D8(x, y0);
  4491. - /* find the nearest neighbor y1 of x in 2D8+(1,...,1) (by coset decoding) */
  4492. - for (i = 0; i < 8; i++) {
  4493. - x1[i] = x[i] - ONEZF;
  4494. - }
  4495. - nearest_neighbor_2D8(x1, y1);
  4496. - for (i = 0; i < 8; i++) {
  4497. - y1[i] += 1;
  4498. - }
  4499. -
  4500. - /* compute e0=||x-y0||^2 and e1=||x-y1||^2 */
  4501. - e = (FIXP_DBL)0;
  4502. - for (i = 0; i < 8; i++) {
  4503. - tmp = x[i] - INT2ZF(y0[i], 0);
  4504. - e += fPow2Div2(
  4505. - tmp << r); /* shift left to ensure that no fract part bits get lost. */
  4506. - tmp = x[i] - INT2ZF(y1[i], 0);
  4507. - e -= fPow2Div2(tmp << r);
  4508. - }
  4509. - /* select best candidate y0 or y1 to minimize distortion */
  4510. - if (e < (FIXP_DBL)0) {
  4511. - for (i = 0; i < 8; i++) {
  4512. - y[i] = y0[i];
  4513. - }
  4514. - } else {
  4515. - for (i = 0; i < 8; i++) {
  4516. - y[i] = y1[i];
  4517. - }
  4518. - }
  4519. -}
  4520. -
  4521. -/* table look-up of unsigned value: find i where index >= table[i]
  4522. - Note: range must be >= 2, index must be >= table[0] */
  4523. -static int table_lookup(const USHORT *table, unsigned int index, int range) {
  4524. - int i;
  4525. -
  4526. - for (i = 4; i < range; i += 4) {
  4527. - if (index < table[i]) {
  4528. - break;
  4529. - }
  4530. - }
  4531. - if (i > range) {
  4532. - i = range;
  4533. - }
  4534. -
  4535. - if (index < table[i - 2]) {
  4536. - i -= 2;
  4537. - }
  4538. - if (index < table[i - 1]) {
  4539. - i--;
  4540. - }
  4541. - i--;
  4542. -
  4543. - return (i); /* index >= table[i] */
  4544. -}
  4545. -
  4546. -/*--------------------------------------------------------------------------
  4547. - re8_decode_rank_of_permutation(rank, xs, x)
  4548. - DECODING OF THE RANK OF THE PERMUTATION OF xs
  4549. - (i) rank: index (rank) of a permutation
  4550. - (i) xs: signed leader in RE8 (8-dimensional integer vector)
  4551. - (o) x: point in RE8 (8-dimensional integer vector)
  4552. - --------------------------------------------------------------------------
  4553. - */
  4554. -static void re8_decode_rank_of_permutation(int rank, int *xs, SHORT x[8]) {
  4555. - INT a[8], w[8], B, fac, fac_B, target;
  4556. - int i, j;
  4557. -
  4558. - /* --- pre-processing based on the signed leader xs ---
  4559. - - compute the alphabet a=[a[0] ... a[q-1]] of x (q elements)
  4560. - such that a[0]!=...!=a[q-1]
  4561. - it is assumed that xs is sorted in the form of a signed leader
  4562. - which can be summarized in 2 requirements:
  4563. - a) |xs[0]| >= |xs[1]| >= |xs[2]| >= ... >= |xs[7]|
  4564. - b) if |xs[i]|=|xs[i-1]|, xs[i]>=xs[i+1]
  4565. - where |.| indicates the absolute value operator
  4566. - - compute q (the number of symbols in the alphabet)
  4567. - - compute w[0..q-1] where w[j] counts the number of occurences of
  4568. - the symbol a[j] in xs
  4569. - - compute B = prod_j=0..q-1 (w[j]!) where .! is the factorial */
  4570. - /* xs[i], xs[i-1] and ptr_w/a*/
  4571. - j = 0;
  4572. - w[j] = 1;
  4573. - a[j] = xs[0];
  4574. - B = 1;
  4575. - for (i = 1; i < 8; i++) {
  4576. - if (xs[i] != xs[i - 1]) {
  4577. - j++;
  4578. - w[j] = 1;
  4579. - a[j] = xs[i];
  4580. - } else {
  4581. - w[j]++;
  4582. - B *= w[j];
  4583. - }
  4584. - }
  4585. -
  4586. - /* --- actual rank decoding ---
  4587. - the rank of x (where x is a permutation of xs) is based on
  4588. - Schalkwijk's formula
  4589. - it is given by rank=sum_{k=0..7} (A_k * fac_k/B_k)
  4590. - the decoding of this rank is sequential and reconstructs x[0..7]
  4591. - element by element from x[0] to x[7]
  4592. - [the tricky part is the inference of A_k for each k...]
  4593. - */
  4594. -
  4595. - if (w[0] == 8) {
  4596. - for (i = 0; i < 8; i++) {
  4597. - x[i] = a[0]; /* avoid fac of 40320 */
  4598. - }
  4599. - } else {
  4600. - target = rank * B;
  4601. - fac_B = 1;
  4602. - /* decode x element by element */
  4603. - for (i = 0; i < 8; i++) {
  4604. - fac = fac_B * fdk_dec_tab_factorial[i]; /* fac = 1..5040 */
  4605. - j = -1;
  4606. - do {
  4607. - target -= w[++j] * fac;
  4608. - } while (target >= 0); /* max of 30 tests / SV */
  4609. - x[i] = a[j];
  4610. - /* update rank, denominator B (B_k) and counter w[j] */
  4611. - target += w[j] * fac; /* target = fac_B*B*rank */
  4612. - fac_B *= w[j];
  4613. - w[j]--;
  4614. - }
  4615. - }
  4616. -}
  4617. -
  4618. -/*--------------------------------------------------------------------------
  4619. - re8_decode_base_index(n, I, y)
  4620. - DECODING OF AN INDEX IN Qn (n=0,2,3 or 4)
  4621. - (i) n: codebook number (*n is an integer defined in {0,2,3,4})
  4622. - (i) I: index of c (pointer to unsigned 16-bit word)
  4623. - (o) y: point in RE8 (8-dimensional integer vector)
  4624. - note: the index I is defined as a 32-bit word, but only
  4625. - 16 bits are required (long can be replaced by unsigned integer)
  4626. - --------------------------------------------------------------------------
  4627. - */
  4628. -static void re8_decode_base_index(int *n, UINT index, SHORT y[8]) {
  4629. - int i, im, t, sign_code, ka, ks, rank, leader[8];
  4630. -
  4631. - if (*n < 2) {
  4632. - for (i = 0; i < 8; i++) {
  4633. - y[i] = 0;
  4634. - }
  4635. - } else {
  4636. - // index = (unsigned int)*I;
  4637. - /* search for the identifier ka of the absolute leader (table-lookup)
  4638. - Q2 is a subset of Q3 - the two cases are considered in the same branch
  4639. - */
  4640. - switch (*n) {
  4641. - case 2:
  4642. - case 3:
  4643. - i = table_lookup(fdk_dec_I3, index, NB_LDQ3);
  4644. - ka = fdk_dec_A3[i];
  4645. - break;
  4646. - case 4:
  4647. - i = table_lookup(fdk_dec_I4, index, NB_LDQ4);
  4648. - ka = fdk_dec_A4[i];
  4649. - break;
  4650. - default:
  4651. - FDK_ASSERT(0);
  4652. - return;
  4653. - }
  4654. - /* reconstruct the absolute leader */
  4655. - for (i = 0; i < 8; i++) {
  4656. - leader[i] = fdk_dec_Da[ka][i];
  4657. - }
  4658. - /* search for the identifier ks of the signed leader (table look-up)
  4659. - (this search is focused based on the identifier ka of the absolute
  4660. - leader)*/
  4661. - t = fdk_dec_Ia[ka];
  4662. - im = fdk_dec_Ns[ka];
  4663. - ks = table_lookup(fdk_dec_Is + t, index, im);
  4664. -
  4665. - /* reconstruct the signed leader from its sign code */
  4666. - sign_code = 2 * fdk_dec_Ds[t + ks];
  4667. - for (i = 7; i >= 0; i--) {
  4668. - leader[i] *= (1 - (sign_code & 2));
  4669. - sign_code >>= 1;
  4670. - }
  4671. -
  4672. - /* compute and decode the rank of the permutation */
  4673. - rank = index - fdk_dec_Is[t + ks]; /* rank = index - cardinality offset */
  4674. -
  4675. - re8_decode_rank_of_permutation(rank, leader, y);
  4676. - }
  4677. - return;
  4678. -}
  4679. -
  4680. -/* re8_y2k(y,m,k)
  4681. - VORONOI INDEXING (INDEX DECODING) k -> y
  4682. - (i) k: Voronoi index k[0..7]
  4683. - (i) m: Voronoi modulo (m = 2^r = 1<<r, where r is integer >=2)
  4684. - (i) r: Voronoi order (m = 2^r = 1<<r, where r is integer >=2)
  4685. - (o) y: 8-dimensional point y[0..7] in RE8
  4686. - */
  4687. -static void re8_k2y(int *k, int r, SHORT *y) {
  4688. - int i, tmp, sum;
  4689. - SHORT v[8];
  4690. - FIXP_ZF zf[8];
  4691. -
  4692. - FDK_ASSERT(r <= ZF_SCALE);
  4693. -
  4694. - /* compute y = k M and z=(y-a)/m, where
  4695. - M = [4 ]
  4696. - [2 2 ]
  4697. - [| \ ]
  4698. - [2 2 ]
  4699. - [1 1 _ 1 1]
  4700. - a=(2,0,...,0)
  4701. - m = 1<<r
  4702. - */
  4703. - for (i = 0; i < 8; i++) {
  4704. - y[i] = k[7];
  4705. - }
  4706. - zf[7] = INT2ZF(y[7], r);
  4707. - sum = 0;
  4708. - for (i = 6; i >= 1; i--) {
  4709. - tmp = 2 * k[i];
  4710. - sum += tmp;
  4711. - y[i] += tmp;
  4712. - zf[i] = INT2ZF(y[i], r);
  4713. - }
  4714. - y[0] += (4 * k[0] + sum);
  4715. - zf[0] = INT2ZF(y[0] - 2, r);
  4716. - /* find nearest neighbor v of z in infinite RE8 */
  4717. - RE8_PPV(zf, v, r);
  4718. - /* compute y -= m v */
  4719. - for (i = 0; i < 8; i++) {
  4720. - y[i] -= (SHORT)(v[i] << r);
  4721. - }
  4722. -}
  4723. -
  4724. -/*--------------------------------------------------------------------------
  4725. - RE8_dec(n, I, k, y)
  4726. - MULTI-RATE INDEXING OF A POINT y in THE LATTICE RE8 (INDEX DECODING)
  4727. - (i) n: codebook number (*n is an integer defined in {0,2,3,4,..,n_max}). n_max
  4728. - = 36 (i) I: index of c (pointer to unsigned 16-bit word) (i) k: index of v
  4729. - (8-dimensional vector of binary indices) = Voronoi index (o) y: point in RE8
  4730. - (8-dimensional integer vector) note: the index I is defined as a 32-bit word,
  4731. - but only 16 bits are required (long can be replaced by unsigned integer)
  4732. -
  4733. - return 0 on success, -1 on error.
  4734. - --------------------------------------------------------------------------
  4735. - */
  4736. -static int RE8_dec(int n, int I, int *k, FIXP_DBL *y) {
  4737. - SHORT v[8];
  4738. - SHORT _y[8];
  4739. - UINT r;
  4740. - int i;
  4741. -
  4742. - /* Check bound of codebook qn */
  4743. - if (n > NQ_MAX) {
  4744. - return -1;
  4745. - }
  4746. -
  4747. - /* decode the sub-indices I and kv[] according to the codebook number n:
  4748. - if n=0,2,3,4, decode I (no Voronoi extension)
  4749. - if n>4, Voronoi extension is used, decode I and kv[] */
  4750. - if (n <= 4) {
  4751. - re8_decode_base_index(&n, I, _y);
  4752. - for (i = 0; i < 8; i++) {
  4753. - y[i] = (LONG)_y[i];
  4754. - }
  4755. - } else {
  4756. - /* compute the Voronoi modulo m = 2^r where r is extension order */
  4757. - r = ((n - 3) >> 1);
  4758. -
  4759. - while (n > 4) {
  4760. - n -= 2;
  4761. - }
  4762. - /* decode base codebook index I into c (c is an element of Q3 or Q4)
  4763. - [here c is stored in y to save memory] */
  4764. - re8_decode_base_index(&n, I, _y);
  4765. - /* decode Voronoi index k[] into v */
  4766. - re8_k2y(k, r, v);
  4767. - /* reconstruct y as y = m c + v (with m=2^r, r integer >=1) */
  4768. - for (i = 0; i < 8; i++) {
  4769. - y[i] = (LONG)((_y[i] << r) + v[i]);
  4770. - }
  4771. - }
  4772. - return 0;
  4773. -}
  4774. -
  4775. -/**************************/
  4776. -/* start LPC decode stuff */
  4777. -/**************************/
  4778. -//#define M 16
  4779. -#define FREQ_MAX 6400.0f
  4780. -#define FREQ_DIV 400.0f
  4781. -#define LSF_GAP 50.0f
  4782. -
  4783. -/**
  4784. - * \brief calculate inverse weighting factor and add non-weighted residual
  4785. - * LSF vector to first stage LSF approximation
  4786. - * \param lsfq first stage LSF approximation values.
  4787. - * \param xq weighted residual LSF vector
  4788. - * \param nk_mode code book number coding mode.
  4789. - */
  4790. -static void lsf_weight_2st(FIXP_LPC *lsfq, FIXP_DBL *xq, int nk_mode) {
  4791. - FIXP_LPC d[M_LP_FILTER_ORDER + 1];
  4792. - FIXP_SGL factor;
  4793. - LONG w; /* inverse weight factor */
  4794. - int i;
  4795. -
  4796. - /* compute lsf distance */
  4797. - d[0] = lsfq[0];
  4798. - d[M_LP_FILTER_ORDER] =
  4799. - FL2FXCONST_LPC(FREQ_MAX / (1 << LSF_SCALE)) - lsfq[M_LP_FILTER_ORDER - 1];
  4800. - for (i = 1; i < M_LP_FILTER_ORDER; i++) {
  4801. - d[i] = lsfq[i] - lsfq[i - 1];
  4802. - }
  4803. -
  4804. - switch (nk_mode) {
  4805. - case 0:
  4806. - factor = FL2FXCONST_SGL(2.0f * 60.0f / FREQ_DIV);
  4807. - break; /* abs */
  4808. - case 1:
  4809. - factor = FL2FXCONST_SGL(2.0f * 65.0f / FREQ_DIV);
  4810. - break; /* mid */
  4811. - case 2:
  4812. - factor = FL2FXCONST_SGL(2.0f * 64.0f / FREQ_DIV);
  4813. - break; /* rel1 */
  4814. - default:
  4815. - factor = FL2FXCONST_SGL(2.0f * 63.0f / FREQ_DIV);
  4816. - break; /* rel2 */
  4817. - }
  4818. - /* add non-weighted residual LSF vector to LSF1st */
  4819. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  4820. - w = (LONG)fMultDiv2(factor, sqrtFixp(fMult(d[i], d[i + 1])));
  4821. - lsfq[i] = fAddSaturate(lsfq[i], FX_DBL2FX_LPC((FIXP_DBL)(w * (LONG)xq[i])));
  4822. - }
  4823. -
  4824. - return;
  4825. -}
  4826. -
  4827. -/**
  4828. - * \brief decode nqn amount of code book numbers. These values determine the
  4829. - * amount of following bits for nqn AVQ RE8 vectors.
  4830. - * \param nk_mode quantization mode.
  4831. - * \param nqn amount code book number to read.
  4832. - * \param qn pointer to output buffer to hold decoded code book numbers qn.
  4833. - */
  4834. -static void decode_qn(HANDLE_FDK_BITSTREAM hBs, int nk_mode, int nqn,
  4835. - int qn[]) {
  4836. - int n;
  4837. -
  4838. - if (nk_mode == 1) { /* nk mode 1 */
  4839. - /* Unary code for mid LPC1/LPC3 */
  4840. - /* Q0=0, Q2=10, Q3=110, ... */
  4841. - for (n = 0; n < nqn; n++) {
  4842. - qn[n] = get_vlclbf(hBs);
  4843. - if (qn[n] > 0) {
  4844. - qn[n]++;
  4845. - }
  4846. - }
  4847. - } else { /* nk_mode 0, 3 and 2 */
  4848. - /* 2 bits to specify Q2,Q3,Q4,ext */
  4849. - for (n = 0; n < nqn; n++) {
  4850. - qn[n] = 2 + FDKreadBits(hBs, 2);
  4851. - }
  4852. - if (nk_mode == 2) {
  4853. - /* Unary code for rel LPC1/LPC3 */
  4854. - /* Q0 = 0, Q5=10, Q6=110, ... */
  4855. - for (n = 0; n < nqn; n++) {
  4856. - if (qn[n] > 4) {
  4857. - qn[n] = get_vlclbf(hBs);
  4858. - if (qn[n] > 0) qn[n] += 4;
  4859. - }
  4860. - }
  4861. - } else { /* nk_mode == (0 and 3) */
  4862. - /* Unary code for abs and rel LPC0/LPC2 */
  4863. - /* Q5 = 0, Q6=10, Q0=110, Q7=1110, ... */
  4864. - for (n = 0; n < nqn; n++) {
  4865. - if (qn[n] > 4) {
  4866. - qn[n] = get_vlclbf(hBs);
  4867. - switch (qn[n]) {
  4868. - case 0:
  4869. - qn[n] = 5;
  4870. - break;
  4871. - case 1:
  4872. - qn[n] = 6;
  4873. - break;
  4874. - case 2:
  4875. - qn[n] = 0;
  4876. - break;
  4877. - default:
  4878. - qn[n] += 4;
  4879. - break;
  4880. - }
  4881. - }
  4882. - }
  4883. - }
  4884. - }
  4885. -}
  4886. -
  4887. -/**
  4888. - * \brief reorder LSF coefficients to minimum distance.
  4889. - * \param lsf pointer to buffer containing LSF coefficients and where reordered
  4890. - * LSF coefficients will be stored into, scaled by LSF_SCALE.
  4891. - * \param min_dist min distance scaled by LSF_SCALE
  4892. - * \param n number of LSF/LSP coefficients.
  4893. - */
  4894. -static void reorder_lsf(FIXP_LPC *lsf, FIXP_LPC min_dist, int n) {
  4895. - FIXP_LPC lsf_min;
  4896. - int i;
  4897. -
  4898. - lsf_min = min_dist;
  4899. - for (i = 0; i < n; i++) {
  4900. - if (lsf[i] < lsf_min) {
  4901. - lsf[i] = lsf_min;
  4902. - }
  4903. - lsf_min = fAddSaturate(lsf[i], min_dist);
  4904. - }
  4905. -
  4906. - /* reverse */
  4907. - lsf_min = FL2FXCONST_LPC(FREQ_MAX / (1 << LSF_SCALE)) - min_dist;
  4908. - for (i = n - 1; i >= 0; i--) {
  4909. - if (lsf[i] > lsf_min) {
  4910. - lsf[i] = lsf_min;
  4911. - }
  4912. -
  4913. - lsf_min = lsf[i] - min_dist;
  4914. - }
  4915. -}
  4916. -
  4917. -/**
  4918. - * \brief First stage approximation
  4919. - * \param hBs bitstream handle as data source
  4920. - * \param lsfq pointer to output buffer to hold LPC coefficients scaled by
  4921. - * LSF_SCALE.
  4922. - */
  4923. -static void vlpc_1st_dec(
  4924. - HANDLE_FDK_BITSTREAM hBs, /* input: codebook index */
  4925. - FIXP_LPC *lsfq /* i/o: i:prediction o:quantized lsf */
  4926. -) {
  4927. - const FIXP_LPC *p_dico;
  4928. - int i, index;
  4929. -
  4930. - index = FDKreadBits(hBs, 8);
  4931. - p_dico = &fdk_dec_dico_lsf_abs_8b[index * M_LP_FILTER_ORDER];
  4932. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  4933. - lsfq[i] = p_dico[i];
  4934. - }
  4935. -}
  4936. -
  4937. -/**
  4938. - * \brief Do first stage approximation weighting and multiply with AVQ
  4939. - * refinement.
  4940. - * \param hBs bitstream handle data ssource.
  4941. - * \param lsfq buffer holding 1st stage approx, 2nd stage approx is added to
  4942. - * this values.
  4943. - * \param nk_mode quantization mode.
  4944. - * \return 0 on success, -1 on error.
  4945. - */
  4946. -static int vlpc_2st_dec(
  4947. - HANDLE_FDK_BITSTREAM hBs,
  4948. - FIXP_LPC *lsfq, /* i/o: i:1st stage o:1st+2nd stage */
  4949. - int nk_mode /* input: 0=abs, >0=rel */
  4950. -) {
  4951. - int err;
  4952. - FIXP_DBL xq[M_LP_FILTER_ORDER]; /* weighted residual LSF vector */
  4953. -
  4954. - /* Decode AVQ refinement */
  4955. - { err = CLpc_DecodeAVQ(hBs, xq, nk_mode, 2, 8); }
  4956. - if (err != 0) {
  4957. - return -1;
  4958. - }
  4959. -
  4960. - /* add non-weighted residual LSF vector to LSF1st */
  4961. - lsf_weight_2st(lsfq, xq, nk_mode);
  4962. -
  4963. - /* reorder */
  4964. - reorder_lsf(lsfq, FL2FXCONST_LPC(LSF_GAP / (1 << LSF_SCALE)),
  4965. - M_LP_FILTER_ORDER);
  4966. -
  4967. - return 0;
  4968. -}
  4969. -
  4970. -/*
  4971. - * Externally visible functions
  4972. - */
  4973. -
  4974. -int CLpc_DecodeAVQ(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pOutput, int nk_mode,
  4975. - int no_qn, int length) {
  4976. - int i, l;
  4977. -
  4978. - for (i = 0; i < length; i += 8 * no_qn) {
  4979. - int qn[2], nk, n, I;
  4980. - int kv[8] = {0};
  4981. -
  4982. - decode_qn(hBs, nk_mode, no_qn, qn);
  4983. -
  4984. - for (l = 0; l < no_qn; l++) {
  4985. - if (qn[l] == 0) {
  4986. - FDKmemclear(&pOutput[i + l * 8], 8 * sizeof(FIXP_DBL));
  4987. - }
  4988. -
  4989. - /* Voronoi extension order ( nk ) */
  4990. - nk = 0;
  4991. - n = qn[l];
  4992. - if (qn[l] > 4) {
  4993. - nk = (qn[l] - 3) >> 1;
  4994. - n = qn[l] - nk * 2;
  4995. - }
  4996. -
  4997. - /* Base codebook index, in reverse bit group order (!) */
  4998. - I = FDKreadBits(hBs, 4 * n);
  4999. -
  5000. - if (nk > 0) {
  5001. - int j;
  5002. -
  5003. - for (j = 0; j < 8; j++) {
  5004. - kv[j] = FDKreadBits(hBs, nk);
  5005. - }
  5006. - }
  5007. -
  5008. - if (RE8_dec(qn[l], I, kv, &pOutput[i + l * 8]) != 0) {
  5009. - return -1;
  5010. - }
  5011. - }
  5012. - }
  5013. - return 0;
  5014. -}
  5015. -
  5016. -int CLpc_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5017. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5018. - FIXP_LPC lsf_adaptive_mean_cand[M_LP_FILTER_ORDER],
  5019. - FIXP_SGL pStability[], UCHAR *mod, int first_lpd_flag,
  5020. - int last_lpc_lost, int last_frame_ok) {
  5021. - int i, k, err;
  5022. - int mode_lpc_bin = 0; /* mode_lpc bitstream representation */
  5023. - int lpc_present[5] = {0, 0, 0, 0, 0};
  5024. - int lpc0_available = 1;
  5025. - int s = 0;
  5026. - int l = 3;
  5027. - const int nbDiv = NB_DIV;
  5028. -
  5029. - lpc_present[4 >> s] = 1; /* LPC4 */
  5030. -
  5031. - /* Decode LPC filters in the following order: LPC 4,0,2,1,3 */
  5032. -
  5033. - /*** Decode LPC4 ***/
  5034. - vlpc_1st_dec(hBs, lsp[4 >> s]);
  5035. - err = vlpc_2st_dec(hBs, lsp[4 >> s], 0); /* nk_mode = 0 */
  5036. - if (err != 0) {
  5037. - return err;
  5038. - }
  5039. -
  5040. - /*** Decode LPC0 and LPC2 ***/
  5041. - k = 0;
  5042. - if (!first_lpd_flag) {
  5043. - lpc_present[0] = 1;
  5044. - lpc0_available = !last_lpc_lost;
  5045. - /* old LPC4 is new LPC0 */
  5046. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5047. - lsp[0][i] = lpc4_lsf[i];
  5048. - }
  5049. - /* skip LPC0 and continue with LPC2 */
  5050. - k = 2;
  5051. - }
  5052. -
  5053. - for (; k < l; k += 2) {
  5054. - int nk_mode = 0;
  5055. -
  5056. - if ((k == 2) && (mod[0] == 3)) {
  5057. - break; /* skip LPC2 */
  5058. - }
  5059. -
  5060. - lpc_present[k >> s] = 1;
  5061. -
  5062. - mode_lpc_bin = FDKreadBit(hBs);
  5063. -
  5064. - if (mode_lpc_bin == 0) {
  5065. - /* LPC0/LPC2: Abs */
  5066. - vlpc_1st_dec(hBs, lsp[k >> s]);
  5067. - } else {
  5068. - /* LPC0/LPC2: RelR */
  5069. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5070. - lsp[k >> s][i] = lsp[4 >> s][i];
  5071. - }
  5072. - nk_mode = 3;
  5073. - }
  5074. -
  5075. - err = vlpc_2st_dec(hBs, lsp[k >> s], nk_mode);
  5076. - if (err != 0) {
  5077. - return err;
  5078. - }
  5079. - }
  5080. -
  5081. - /*** Decode LPC1 ***/
  5082. - if (mod[0] < 2) { /* else: skip LPC1 */
  5083. - lpc_present[1] = 1;
  5084. - mode_lpc_bin = get_vlclbf_n(hBs, 2);
  5085. -
  5086. - switch (mode_lpc_bin) {
  5087. - case 1:
  5088. - /* LPC1: abs */
  5089. - vlpc_1st_dec(hBs, lsp[1]);
  5090. - err = vlpc_2st_dec(hBs, lsp[1], 0);
  5091. - if (err != 0) {
  5092. - return err;
  5093. - }
  5094. - break;
  5095. - case 2:
  5096. - /* LPC1: mid0 (no second stage AVQ quantizer in this case) */
  5097. - if (lpc0_available) { /* LPC0/lsf[0] might be zero some times */
  5098. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5099. - lsp[1][i] = (lsp[0][i] >> 1) + (lsp[2][i] >> 1);
  5100. - }
  5101. - } else {
  5102. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5103. - lsp[1][i] = lsp[2][i];
  5104. - }
  5105. - }
  5106. - break;
  5107. - case 0:
  5108. - /* LPC1: RelR */
  5109. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5110. - lsp[1][i] = lsp[2][i];
  5111. - }
  5112. - err = vlpc_2st_dec(hBs, lsp[1], 2 << s);
  5113. - if (err != 0) {
  5114. - return err;
  5115. - }
  5116. - break;
  5117. - }
  5118. - }
  5119. -
  5120. - /*** Decode LPC3 ***/
  5121. - if ((mod[2] < 2)) { /* else: skip LPC3 */
  5122. - int nk_mode = 0;
  5123. - lpc_present[3] = 1;
  5124. -
  5125. - mode_lpc_bin = get_vlclbf_n(hBs, 3);
  5126. -
  5127. - switch (mode_lpc_bin) {
  5128. - case 1:
  5129. - /* LPC3: abs */
  5130. - vlpc_1st_dec(hBs, lsp[3]);
  5131. - break;
  5132. - case 0:
  5133. - /* LPC3: mid */
  5134. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5135. - lsp[3][i] = (lsp[2][i] >> 1) + (lsp[4][i] >> 1);
  5136. - }
  5137. - nk_mode = 1;
  5138. - break;
  5139. - case 2:
  5140. - /* LPC3: relL */
  5141. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5142. - lsp[3][i] = lsp[2][i];
  5143. - }
  5144. - nk_mode = 2;
  5145. - break;
  5146. - case 3:
  5147. - /* LPC3: relR */
  5148. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5149. - lsp[3][i] = lsp[4][i];
  5150. - }
  5151. - nk_mode = 2;
  5152. - break;
  5153. - }
  5154. - err = vlpc_2st_dec(hBs, lsp[3], nk_mode);
  5155. - if (err != 0) {
  5156. - return err;
  5157. - }
  5158. - }
  5159. -
  5160. - if (!lpc0_available && !last_frame_ok) {
  5161. - /* LPC(0) was lost. Use next available LPC(k) instead */
  5162. - for (k = 1; k < (nbDiv + 1); k++) {
  5163. - if (lpc_present[k]) {
  5164. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5165. -#define LSF_INIT_TILT (0.25f)
  5166. - if (mod[0] > 0) {
  5167. - lsp[0][i] = FX_DBL2FX_LPC(
  5168. - fMult(lsp[k][i], FL2FXCONST_SGL(1.0f - LSF_INIT_TILT)) +
  5169. - fMult(fdk_dec_lsf_init[i], FL2FXCONST_SGL(LSF_INIT_TILT)));
  5170. - } else {
  5171. - lsp[0][i] = lsp[k][i];
  5172. - }
  5173. - }
  5174. - break;
  5175. - }
  5176. - }
  5177. - }
  5178. -
  5179. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5180. - lpc4_lsf[i] = lsp[4 >> s][i];
  5181. - }
  5182. -
  5183. - {
  5184. - FIXP_DBL divFac;
  5185. - int last, numLpc = 0;
  5186. -
  5187. - i = nbDiv;
  5188. - do {
  5189. - numLpc += lpc_present[i--];
  5190. - } while (i >= 0 && numLpc < 3);
  5191. -
  5192. - last = i;
  5193. -
  5194. - switch (numLpc) {
  5195. - case 3:
  5196. - divFac = FL2FXCONST_DBL(1.0f / 3.0f);
  5197. - break;
  5198. - case 2:
  5199. - divFac = FL2FXCONST_DBL(1.0f / 2.0f);
  5200. - break;
  5201. - default:
  5202. - divFac = FL2FXCONST_DBL(1.0f);
  5203. - break;
  5204. - }
  5205. -
  5206. - /* get the adaptive mean for the next (bad) frame */
  5207. - for (k = 0; k < M_LP_FILTER_ORDER; k++) {
  5208. - FIXP_DBL tmp = (FIXP_DBL)0;
  5209. - for (i = nbDiv; i > last; i--) {
  5210. - if (lpc_present[i]) {
  5211. - tmp = fMultAdd(tmp >> 1, lsp[i][k], divFac);
  5212. - }
  5213. - }
  5214. - lsf_adaptive_mean_cand[k] = FX_DBL2FX_LPC(tmp);
  5215. - }
  5216. - }
  5217. -
  5218. - /* calculate stability factor Theta. Needed for ACELP decoder and concealment
  5219. - */
  5220. - {
  5221. - FIXP_LPC *lsf_prev, *lsf_curr;
  5222. - k = 0;
  5223. -
  5224. - FDK_ASSERT(lpc_present[0] == 1 && lpc_present[4 >> s] == 1);
  5225. - lsf_prev = lsp[0];
  5226. - for (i = 1; i < (nbDiv + 1); i++) {
  5227. - if (lpc_present[i]) {
  5228. - FIXP_DBL tmp = (FIXP_DBL)0;
  5229. - int j;
  5230. - lsf_curr = lsp[i];
  5231. -
  5232. - /* sum = tmp * 2^(LSF_SCALE*2 + 4) */
  5233. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  5234. - tmp += fPow2Div2((FIXP_SGL)(lsf_curr[j] - lsf_prev[j])) >> 3;
  5235. - }
  5236. -
  5237. - /* tmp = (float)(FL2FXCONST_DBL(1.25f) - fMult(tmp,
  5238. - * FL2FXCONST_DBL(1/400000.0f))); */
  5239. - tmp = FL2FXCONST_DBL(1.25f / (1 << LSF_SCALE)) -
  5240. - fMult(tmp, FL2FXCONST_DBL((1 << (LSF_SCALE + 4)) / 400000.0f));
  5241. - if (tmp >= FL2FXCONST_DBL(1.0f / (1 << LSF_SCALE))) {
  5242. - pStability[k] = FL2FXCONST_SGL(1.0f / 2.0f);
  5243. - } else if (tmp < FL2FXCONST_DBL(0.0f)) {
  5244. - pStability[k] = FL2FXCONST_SGL(0.0f);
  5245. - } else {
  5246. - pStability[k] = FX_DBL2FX_SGL(tmp << (LSF_SCALE - 1));
  5247. - }
  5248. -
  5249. - lsf_prev = lsf_curr;
  5250. - k = i;
  5251. - } else {
  5252. - /* Mark stability value as undefined. */
  5253. - pStability[i] = (FIXP_SGL)-1;
  5254. - }
  5255. - }
  5256. - }
  5257. -
  5258. - /* convert into LSP domain */
  5259. - for (i = 0; i < (nbDiv + 1); i++) {
  5260. - if (lpc_present[i]) {
  5261. - for (k = 0; k < M_LP_FILTER_ORDER; k++) {
  5262. - lsp[i][k] = FX_DBL2FX_LPC(
  5263. - fixp_cos(fMult(lsp[i][k],
  5264. - FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  5265. - LSF_SCALE - LSPARG_SCALE));
  5266. - }
  5267. - }
  5268. - }
  5269. -
  5270. - return 0;
  5271. -}
  5272. -
  5273. -void CLpc_Conceal(FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5274. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5275. - FIXP_LPC lsf_adaptive_mean[M_LP_FILTER_ORDER],
  5276. - const int first_lpd_flag) {
  5277. - int i, j;
  5278. -
  5279. -#define BETA (FL2FXCONST_SGL(0.25f))
  5280. -#define ONE_BETA (FL2FXCONST_SGL(0.75f))
  5281. -#define BFI_FAC (FL2FXCONST_SGL(0.90f))
  5282. -#define ONE_BFI_FAC (FL2FXCONST_SGL(0.10f))
  5283. -
  5284. - /* Frame loss concealment (could be improved) */
  5285. -
  5286. - if (first_lpd_flag) {
  5287. - /* Reset past LSF values */
  5288. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5289. - lsp[0][i] = lpc4_lsf[i] = fdk_dec_lsf_init[i];
  5290. - }
  5291. - } else {
  5292. - /* old LPC4 is new LPC0 */
  5293. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5294. - lsp[0][i] = lpc4_lsf[i];
  5295. - }
  5296. - }
  5297. -
  5298. - /* LPC1 */
  5299. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5300. - FIXP_LPC lsf_mean = FX_DBL2FX_LPC(fMult(BETA, fdk_dec_lsf_init[i]) +
  5301. - fMult(ONE_BETA, lsf_adaptive_mean[i]));
  5302. -
  5303. - lsp[1][i] = FX_DBL2FX_LPC(fMult(BFI_FAC, lpc4_lsf[i]) +
  5304. - fMult(ONE_BFI_FAC, lsf_mean));
  5305. - }
  5306. -
  5307. - /* LPC2 - LPC4 */
  5308. - for (j = 2; j <= 4; j++) {
  5309. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5310. - /* lsf_mean[i] = FX_DBL2FX_LPC(fMult((FIXP_LPC)(BETA + j *
  5311. - FL2FXCONST_LPC(0.1f)), fdk_dec_lsf_init[i])
  5312. - + fMult((FIXP_LPC)(ONE_BETA - j *
  5313. - FL2FXCONST_LPC(0.1f)), lsf_adaptive_mean[i])); */
  5314. -
  5315. - FIXP_LPC lsf_mean = FX_DBL2FX_LPC(
  5316. - fMult((FIXP_SGL)(BETA + (FIXP_SGL)(j * (INT)FL2FXCONST_SGL(0.1f))),
  5317. - (FIXP_SGL)fdk_dec_lsf_init[i]) +
  5318. - fMult(
  5319. - (FIXP_SGL)(ONE_BETA - (FIXP_SGL)(j * (INT)FL2FXCONST_SGL(0.1f))),
  5320. - lsf_adaptive_mean[i]));
  5321. -
  5322. - lsp[j][i] = FX_DBL2FX_LPC(fMult(BFI_FAC, lsp[j - 1][i]) +
  5323. - fMult(ONE_BFI_FAC, lsf_mean));
  5324. - }
  5325. - }
  5326. -
  5327. - /* Update past values for the future */
  5328. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5329. - lpc4_lsf[i] = lsp[4][i];
  5330. - }
  5331. -
  5332. - /* convert into LSP domain */
  5333. - for (j = 0; j < 5; j++) {
  5334. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5335. - lsp[j][i] = FX_DBL2FX_LPC(fixp_cos(
  5336. - fMult(lsp[j][i], FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  5337. - LSF_SCALE - LSPARG_SCALE));
  5338. - }
  5339. - }
  5340. -}
  5341. -
  5342. -void E_LPC_a_weight(FIXP_LPC *wA, const FIXP_LPC *A, int m) {
  5343. - FIXP_DBL f;
  5344. - int i;
  5345. -
  5346. - f = FL2FXCONST_DBL(0.92f);
  5347. - for (i = 0; i < m; i++) {
  5348. - wA[i] = FX_DBL2FX_LPC(fMult(A[i], f));
  5349. - f = fMult(f, FL2FXCONST_DBL(0.92f));
  5350. - }
  5351. -}
  5352. -
  5353. -void CLpd_DecodeGain(FIXP_DBL *gain, INT *gain_e, int gain_code) {
  5354. - /* gain * 2^(gain_e) = 10^(gain_code/28) */
  5355. - *gain = fLdPow(
  5356. - FL2FXCONST_DBL(3.3219280948873623478703194294894 / 4.0), /* log2(10)*/
  5357. - 2,
  5358. - fMultDiv2((FIXP_DBL)gain_code << (DFRACT_BITS - 1 - 7),
  5359. - FL2FXCONST_DBL(2.0f / 28.0f)),
  5360. - 7, gain_e);
  5361. -}
  5362. -
  5363. - /**
  5364. - * \brief * Find the polynomial F1(z) or F2(z) from the LSPs.
  5365. - * This is performed by expanding the product polynomials:
  5366. - *
  5367. - * F1(z) = product ( 1 - 2 LSP_i z^-1 + z^-2 )
  5368. - * i=0,2,4,6,8
  5369. - * F2(z) = product ( 1 - 2 LSP_i z^-1 + z^-2 )
  5370. - * i=1,3,5,7,9
  5371. - *
  5372. - * where LSP_i are the LSPs in the cosine domain.
  5373. - * R.A.Salami October 1990
  5374. - * \param lsp input, line spectral freq. (cosine domain)
  5375. - * \param f output, the coefficients of F1 or F2, scaled by 8 bits
  5376. - * \param n no of coefficients (m/2)
  5377. - * \param flag 1 : F1(z) ; 2 : F2(z)
  5378. - */
  5379. -
  5380. -#define SF_F 8
  5381. -
  5382. -static void get_lsppol(FIXP_LPC lsp[], FIXP_DBL f[], int n, int flag) {
  5383. - FIXP_DBL b;
  5384. - FIXP_LPC *plsp;
  5385. - int i, j;
  5386. -
  5387. - plsp = lsp + flag - 1;
  5388. - f[0] = FL2FXCONST_DBL(1.0f / (1 << SF_F));
  5389. - b = -FX_LPC2FX_DBL(*plsp);
  5390. - f[1] = b >> (SF_F - 1);
  5391. - for (i = 2; i <= n; i++) {
  5392. - plsp += 2;
  5393. - b = -FX_LPC2FX_DBL(*plsp);
  5394. - f[i] = ((fMultDiv2(b, f[i - 1]) << 1) + (f[i - 2])) << 1;
  5395. - for (j = i - 1; j > 1; j--) {
  5396. - f[j] = f[j] + (fMultDiv2(b, f[j - 1]) << 2) + f[j - 2];
  5397. - }
  5398. - f[1] = f[1] + (b >> (SF_F - 1));
  5399. - }
  5400. - return;
  5401. -}
  5402. -
  5403. -#define NC M_LP_FILTER_ORDER / 2
  5404. -
  5405. -/**
  5406. - * \brief lsp input LSP vector
  5407. - * \brief a output LP filter coefficient vector scaled by SF_A_COEFFS.
  5408. - */
  5409. -void E_LPC_f_lsp_a_conversion(FIXP_LPC *lsp, FIXP_LPC *a, INT *a_exp) {
  5410. - FIXP_DBL f1[NC + 1], f2[NC + 1];
  5411. - int i, k;
  5412. -
  5413. - /*-----------------------------------------------------*
  5414. - * Find the polynomials F1(z) and F2(z) *
  5415. - *-----------------------------------------------------*/
  5416. -
  5417. - get_lsppol(lsp, f1, NC, 1);
  5418. - get_lsppol(lsp, f2, NC, 2);
  5419. -
  5420. - /*-----------------------------------------------------*
  5421. - * Multiply F1(z) by (1+z^-1) and F2(z) by (1-z^-1) *
  5422. - *-----------------------------------------------------*/
  5423. - for (i = NC; i > 0; i--) {
  5424. - f1[i] += f1[i - 1];
  5425. - f2[i] -= f2[i - 1];
  5426. - }
  5427. -
  5428. - FIXP_DBL aDBL[M_LP_FILTER_ORDER];
  5429. -
  5430. - for (i = 1, k = M_LP_FILTER_ORDER - 1; i <= NC; i++, k--) {
  5431. - FIXP_DBL tmp1, tmp2;
  5432. -
  5433. - tmp1 = f1[i] >> 1;
  5434. - tmp2 = f2[i] >> 1;
  5435. -
  5436. - aDBL[i - 1] = (tmp1 + tmp2);
  5437. - aDBL[k] = (tmp1 - tmp2);
  5438. - }
  5439. -
  5440. - int headroom_a = getScalefactor(aDBL, M_LP_FILTER_ORDER);
  5441. -
  5442. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5443. - a[i] = FX_DBL2FX_LPC(aDBL[i] << headroom_a);
  5444. - }
  5445. -
  5446. - *a_exp = 8 - headroom_a;
  5447. -}
  5448. diff --git a/libAACdec/src/usacdec_lpc.h b/libAACdec/src/usacdec_lpc.h
  5449. deleted file mode 100644
  5450. index a6713c1..0000000
  5451. --- a/libAACdec/src/usacdec_lpc.h
  5452. +++ /dev/null
  5453. @@ -1,190 +0,0 @@
  5454. -/* -----------------------------------------------------------------------------
  5455. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  5456. -
  5457. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  5458. -Forschung e.V. All rights reserved.
  5459. -
  5460. - 1. INTRODUCTION
  5461. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  5462. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  5463. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  5464. -a wide variety of Android devices.
  5465. -
  5466. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  5467. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  5468. -full-bandwidth communications codec by independent studies and is widely
  5469. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  5470. -specifications.
  5471. -
  5472. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  5473. -those of Fraunhofer) may be obtained through Via Licensing
  5474. -(www.vialicensing.com) or through the respective patent owners individually for
  5475. -the purpose of encoding or decoding bit streams in products that are compliant
  5476. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  5477. -Android devices already license these patent claims through Via Licensing or
  5478. -directly from the patent owners, and therefore FDK AAC Codec software may
  5479. -already be covered under those patent licenses when it is used for those
  5480. -licensed purposes only.
  5481. -
  5482. -Commercially-licensed AAC software libraries, including floating-point versions
  5483. -with enhanced sound quality, are also available from Fraunhofer. Users are
  5484. -encouraged to check the Fraunhofer website for additional applications
  5485. -information and documentation.
  5486. -
  5487. -2. COPYRIGHT LICENSE
  5488. -
  5489. -Redistribution and use in source and binary forms, with or without modification,
  5490. -are permitted without payment of copyright license fees provided that you
  5491. -satisfy the following conditions:
  5492. -
  5493. -You must retain the complete text of this software license in redistributions of
  5494. -the FDK AAC Codec or your modifications thereto in source code form.
  5495. -
  5496. -You must retain the complete text of this software license in the documentation
  5497. -and/or other materials provided with redistributions of the FDK AAC Codec or
  5498. -your modifications thereto in binary form. You must make available free of
  5499. -charge copies of the complete source code of the FDK AAC Codec and your
  5500. -modifications thereto to recipients of copies in binary form.
  5501. -
  5502. -The name of Fraunhofer may not be used to endorse or promote products derived
  5503. -from this library without prior written permission.
  5504. -
  5505. -You may not charge copyright license fees for anyone to use, copy or distribute
  5506. -the FDK AAC Codec software or your modifications thereto.
  5507. -
  5508. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  5509. -that you changed the software and the date of any change. For modified versions
  5510. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  5511. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  5512. -AAC Codec Library for Android."
  5513. -
  5514. -3. NO PATENT LICENSE
  5515. -
  5516. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  5517. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  5518. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  5519. -software.
  5520. -
  5521. -You may use this FDK AAC Codec software or modifications thereto only for
  5522. -purposes that are authorized by appropriate patent licenses.
  5523. -
  5524. -4. DISCLAIMER
  5525. -
  5526. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  5527. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  5528. -including but not limited to the implied warranties of merchantability and
  5529. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  5530. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  5531. -or consequential damages, including but not limited to procurement of substitute
  5532. -goods or services; loss of use, data, or profits, or business interruption,
  5533. -however caused and on any theory of liability, whether in contract, strict
  5534. -liability, or tort (including negligence), arising in any way out of the use of
  5535. -this software, even if advised of the possibility of such damage.
  5536. -
  5537. -5. CONTACT INFORMATION
  5538. -
  5539. -Fraunhofer Institute for Integrated Circuits IIS
  5540. -Attention: Audio and Multimedia Departments - FDK AAC LL
  5541. -Am Wolfsmantel 33
  5542. -91058 Erlangen, Germany
  5543. -
  5544. -www.iis.fraunhofer.de/amm
  5545. -amm-info@iis.fraunhofer.de
  5546. ------------------------------------------------------------------------------ */
  5547. -
  5548. -/**************************** AAC decoder library ******************************
  5549. -
  5550. - Author(s): Matthias Hildenbrand, Manuel Jander
  5551. -
  5552. - Description: USAC LPC/AVQ decode
  5553. -
  5554. -*******************************************************************************/
  5555. -
  5556. -#ifndef USACDEC_LPC_H
  5557. -#define USACDEC_LPC_H
  5558. -
  5559. -#include "channelinfo.h"
  5560. -#include "common_fix.h"
  5561. -#include "FDK_bitstream.h"
  5562. -#include "usacdec_rom.h"
  5563. -
  5564. -#define LSPARG_SCALE 10
  5565. -
  5566. -/**
  5567. - * \brief AVQ (refinement) decode
  5568. - * \param hBs bitstream handle
  5569. - * \param lsfq buffer for AVQ decode output.
  5570. - * \param nk_mode quantization mode.
  5571. - * \param nqn amount of split/interleaved RE8 vectors.
  5572. - * \param total amount of individual data values to decode.
  5573. - * \return 0 on success, -1 on error.
  5574. - */
  5575. -int CLpc_DecodeAVQ(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *lsfq, int nk_mode,
  5576. - int nqn, int length);
  5577. -
  5578. -/**
  5579. - * \brief Read and decode LPC coeficient sets. First stage approximation + AVQ
  5580. - * decode.
  5581. - * \param[in] hBs bitstream handle to read data from.
  5582. - * \param[out] lsp buffer into which the decoded LSP coefficients will be stored
  5583. - * into.
  5584. - * \param[in,out] lpc4_lsf buffer into which the decoded LCP4 LSF coefficients
  5585. - * will be stored into (persistent).
  5586. - * \param[out] lsf_adaptive_mean_cand lsf adaptive mean vector needed for
  5587. - * concealment.
  5588. - * \param[out] pStability array with stability values for the ACELP decoder (and
  5589. - * concealment).
  5590. - * \param[in] mod array which defines modes (ACELP, TCX20|40|80) are used in
  5591. - * the current superframe.
  5592. - * \param[in] first_lpd_flag indicates the presence of LPC0
  5593. - * \param[in] last_lpc_lost indicate that LPC4 of previous frame was lost.
  5594. - * \param[in] last_frame_ok indicate that the last frame was ok.
  5595. - * \return 0 on success, -1 on error.
  5596. - */
  5597. -int CLpc_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5598. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5599. - FIXP_LPC lsf_adaptive_mean_cand[M_LP_FILTER_ORDER],
  5600. - FIXP_SGL pStability[], UCHAR *mod, int first_lpd_flag,
  5601. - int last_lpc_lost, int last_frame_ok);
  5602. -
  5603. -/**
  5604. - * \brief Generate LPC coefficient sets in case frame loss.
  5605. - * \param lsp buffer into which the decoded LSP coefficients will be stored
  5606. - * into.
  5607. - * \param lpc4_lsf buffer into which the decoded LCP4 LSF coefficients will be
  5608. - * stored into (persistent).
  5609. - * \param isf_adaptive_mean
  5610. - * \param first_lpd_flag indicates the previous LSF4 coefficients lpc4_lsf[] are
  5611. - * not valid.
  5612. - */
  5613. -void CLpc_Conceal(FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5614. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5615. - FIXP_LPC isf_adaptive_mean[M_LP_FILTER_ORDER],
  5616. - const int first_lpd_flag);
  5617. -
  5618. -/**
  5619. - * \brief apply absolute weighting
  5620. - * \param A weighted LPC coefficient vector output. The first coeffcient is
  5621. - * implicitly 1.0
  5622. - * \param A LPC coefficient vector. The first coeffcient is implicitly 1.0
  5623. - * \param m length of vector A
  5624. - */
  5625. -/* static */
  5626. -void E_LPC_a_weight(FIXP_LPC *wA, const FIXP_LPC *A, const int m);
  5627. -
  5628. -/**
  5629. - * \brief decode TCX/FAC gain. In case of TCX the lg/sqrt(rms) part
  5630. - * must still be applied to obtain the gain value.
  5631. - * \param gain (o) pointer were the gain mantissa is stored into.
  5632. - * \param gain_e (o) pointer were the gain exponent is stored into.
  5633. - * \param gain_code (i) the 7 bit binary word from the bitstream
  5634. - * representing the gain.
  5635. - */
  5636. -void CLpd_DecodeGain(FIXP_DBL *gain, INT *gain_e, int gain_code);
  5637. -
  5638. -/**
  5639. - * \brief convert LSP coefficients into LP domain.
  5640. - */
  5641. -void E_LPC_f_lsp_a_conversion(FIXP_LPC *lsp, FIXP_LPC *a, INT *a_exp);
  5642. -
  5643. -#endif /* USACDEC_LPC_H */
  5644. diff --git a/libAACdec/src/usacdec_lpd.cpp b/libAACdec/src/usacdec_lpd.cpp
  5645. deleted file mode 100644
  5646. index fcf7a76..0000000
  5647. --- a/libAACdec/src/usacdec_lpd.cpp
  5648. +++ /dev/null
  5649. @@ -1,2017 +0,0 @@
  5650. -/* -----------------------------------------------------------------------------
  5651. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  5652. -
  5653. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  5654. -Forschung e.V. All rights reserved.
  5655. -
  5656. - 1. INTRODUCTION
  5657. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  5658. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  5659. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  5660. -a wide variety of Android devices.
  5661. -
  5662. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  5663. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  5664. -full-bandwidth communications codec by independent studies and is widely
  5665. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  5666. -specifications.
  5667. -
  5668. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  5669. -those of Fraunhofer) may be obtained through Via Licensing
  5670. -(www.vialicensing.com) or through the respective patent owners individually for
  5671. -the purpose of encoding or decoding bit streams in products that are compliant
  5672. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  5673. -Android devices already license these patent claims through Via Licensing or
  5674. -directly from the patent owners, and therefore FDK AAC Codec software may
  5675. -already be covered under those patent licenses when it is used for those
  5676. -licensed purposes only.
  5677. -
  5678. -Commercially-licensed AAC software libraries, including floating-point versions
  5679. -with enhanced sound quality, are also available from Fraunhofer. Users are
  5680. -encouraged to check the Fraunhofer website for additional applications
  5681. -information and documentation.
  5682. -
  5683. -2. COPYRIGHT LICENSE
  5684. -
  5685. -Redistribution and use in source and binary forms, with or without modification,
  5686. -are permitted without payment of copyright license fees provided that you
  5687. -satisfy the following conditions:
  5688. -
  5689. -You must retain the complete text of this software license in redistributions of
  5690. -the FDK AAC Codec or your modifications thereto in source code form.
  5691. -
  5692. -You must retain the complete text of this software license in the documentation
  5693. -and/or other materials provided with redistributions of the FDK AAC Codec or
  5694. -your modifications thereto in binary form. You must make available free of
  5695. -charge copies of the complete source code of the FDK AAC Codec and your
  5696. -modifications thereto to recipients of copies in binary form.
  5697. -
  5698. -The name of Fraunhofer may not be used to endorse or promote products derived
  5699. -from this library without prior written permission.
  5700. -
  5701. -You may not charge copyright license fees for anyone to use, copy or distribute
  5702. -the FDK AAC Codec software or your modifications thereto.
  5703. -
  5704. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  5705. -that you changed the software and the date of any change. For modified versions
  5706. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  5707. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  5708. -AAC Codec Library for Android."
  5709. -
  5710. -3. NO PATENT LICENSE
  5711. -
  5712. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  5713. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  5714. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  5715. -software.
  5716. -
  5717. -You may use this FDK AAC Codec software or modifications thereto only for
  5718. -purposes that are authorized by appropriate patent licenses.
  5719. -
  5720. -4. DISCLAIMER
  5721. -
  5722. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  5723. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  5724. -including but not limited to the implied warranties of merchantability and
  5725. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  5726. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  5727. -or consequential damages, including but not limited to procurement of substitute
  5728. -goods or services; loss of use, data, or profits, or business interruption,
  5729. -however caused and on any theory of liability, whether in contract, strict
  5730. -liability, or tort (including negligence), arising in any way out of the use of
  5731. -this software, even if advised of the possibility of such damage.
  5732. -
  5733. -5. CONTACT INFORMATION
  5734. -
  5735. -Fraunhofer Institute for Integrated Circuits IIS
  5736. -Attention: Audio and Multimedia Departments - FDK AAC LL
  5737. -Am Wolfsmantel 33
  5738. -91058 Erlangen, Germany
  5739. -
  5740. -www.iis.fraunhofer.de/amm
  5741. -amm-info@iis.fraunhofer.de
  5742. ------------------------------------------------------------------------------ */
  5743. -
  5744. -/**************************** AAC decoder library ******************************
  5745. -
  5746. - Author(s): Manuel Jander
  5747. -
  5748. - Description: USAC Linear Prediction Domain coding
  5749. -
  5750. -*******************************************************************************/
  5751. -
  5752. -#include "usacdec_lpd.h"
  5753. -
  5754. -#include "usacdec_rom.h"
  5755. -#include "usacdec_fac.h"
  5756. -#include "usacdec_lpc.h"
  5757. -#include "FDK_tools_rom.h"
  5758. -#include "fft.h"
  5759. -#include "mdct.h"
  5760. -#include "usacdec_acelp.h"
  5761. -#include "overlapadd.h"
  5762. -
  5763. -#include "block.h"
  5764. -
  5765. -#define SF_PITCH_TRACK 6
  5766. -#define SF_GAIN 3
  5767. -#define MIN_VAL FL2FXCONST_DBL(0.0f)
  5768. -#define MAX_VAL (FIXP_DBL) MAXVAL_DBL
  5769. -
  5770. -#include "ac_arith_coder.h"
  5771. -
  5772. -void filtLP(const FIXP_DBL *syn, FIXP_PCM *syn_out, FIXP_DBL *noise,
  5773. - const FIXP_SGL *filt, INT stop, int len) {
  5774. - INT i, j;
  5775. - FIXP_DBL tmp;
  5776. -
  5777. - for (i = 0; i < stop; i++) {
  5778. - tmp = fMultDiv2(noise[i], filt[0]); // Filt in Q-1.16
  5779. - for (j = 1; j <= len; j++) {
  5780. - tmp += fMultDiv2((noise[i - j] + noise[i + j]), filt[j]);
  5781. - }
  5782. - syn_out[i] = (FIXP_PCM)(IMDCT_SCALE(syn[i] - tmp));
  5783. - }
  5784. -}
  5785. -
  5786. -void bass_pf_1sf_delay(
  5787. - FIXP_DBL *syn, /* (i) : 12.8kHz synthesis to postfilter */
  5788. - const INT *T_sf, /* (i) : Pitch period for all subframes (T_sf[16]) */
  5789. - FIXP_DBL *pit_gain,
  5790. - const int frame_length, /* (i) : frame length (should be 768|1024) */
  5791. - const INT l_frame,
  5792. - const INT l_next, /* (i) : look ahead for symmetric filtering */
  5793. - FIXP_PCM *synth_out, /* (o) : filtered synthesis (with delay of 1 subfr) */
  5794. - FIXP_DBL mem_bpf[]) /* i/o : memory state [L_FILT+L_SUBFR] */
  5795. -{
  5796. - INT i, sf, i_subfr, T, T2, lg;
  5797. -
  5798. - FIXP_DBL tmp, ener, corr, gain;
  5799. - FIXP_DBL *noise, *noise_in;
  5800. - FIXP_DBL
  5801. - noise_buf[L_FILT + (2 * L_SUBFR)]; // L_FILT = 12, L_SUBFR = 64 => 140
  5802. - const FIXP_DBL *x, *y;
  5803. -
  5804. - {
  5805. - noise = noise_buf + L_FILT; // L_FILT = 12 delay of upsampling filter
  5806. - noise_in = noise_buf + L_FILT + L_SUBFR;
  5807. - /* Input scaling of the BPF memory */
  5808. - scaleValues(mem_bpf, (L_FILT + L_SUBFR), 1);
  5809. - }
  5810. -
  5811. - int gain_exp = 17;
  5812. -
  5813. - sf = 0;
  5814. - for (i_subfr = 0; i_subfr < l_frame; i_subfr += L_SUBFR, sf++) {
  5815. - T = T_sf[sf];
  5816. - gain = pit_gain[sf];
  5817. -
  5818. - /* Gain is in Q17.14 */
  5819. - /* If gain > 1 set to 1 */
  5820. - if (gain > (FIXP_DBL)(1 << 14)) gain = (FIXP_DBL)(1 << 14);
  5821. -
  5822. - /* If gain < 0 set to 0 */
  5823. - if (gain < (FIXP_DBL)0) gain = (FIXP_DBL)0;
  5824. -
  5825. - if (gain > (FIXP_DBL)0) {
  5826. - /* pitch tracker: test pitch/2 to avoid continuous pitch doubling */
  5827. - /* Note: pitch is limited to PIT_MIN (34 = 376Hz) at the encoder */
  5828. - T2 = T >> 1;
  5829. - x = &syn[i_subfr - L_EXTRA];
  5830. - y = &syn[i_subfr - T2 - L_EXTRA];
  5831. -
  5832. - ener = (FIXP_DBL)0;
  5833. - corr = (FIXP_DBL)0;
  5834. - tmp = (FIXP_DBL)0;
  5835. -
  5836. - int headroom_x = getScalefactor(x, L_SUBFR + L_EXTRA);
  5837. - int headroom_y = getScalefactor(y, L_SUBFR + L_EXTRA);
  5838. -
  5839. - int width_shift = 7;
  5840. -
  5841. - for (i = 0; i < (L_SUBFR + L_EXTRA); i++) {
  5842. - ener += fPow2Div2((x[i] << headroom_x)) >> width_shift;
  5843. - corr += fMultDiv2((x[i] << headroom_x), (y[i] << headroom_y)) >>
  5844. - width_shift;
  5845. - tmp += fPow2Div2((y[i] << headroom_y)) >> width_shift;
  5846. - }
  5847. -
  5848. - int exp_ener = ((17 - headroom_x) << 1) + width_shift + 1;
  5849. - int exp_corr = (17 - headroom_x) + (17 - headroom_y) + width_shift + 1;
  5850. - int exp_tmp = ((17 - headroom_y) << 1) + width_shift + 1;
  5851. -
  5852. - /* Add 0.01 to "ener". Adjust exponents */
  5853. - FIXP_DBL point_zero_one = (FIXP_DBL)0x51eb851f; /* In Q-6.37 */
  5854. - int diff;
  5855. - ener = fAddNorm(ener, exp_ener, point_zero_one, -6, &exp_ener);
  5856. - corr = fAddNorm(corr, exp_corr, point_zero_one, -6, &exp_corr);
  5857. - tmp = fAddNorm(tmp, exp_tmp, point_zero_one, -6, &exp_tmp);
  5858. -
  5859. - /* use T2 if normalized correlation > 0.95 */
  5860. - INT s1, s2;
  5861. - s1 = CntLeadingZeros(ener) - 1;
  5862. - s2 = CntLeadingZeros(tmp) - 1;
  5863. -
  5864. - FIXP_DBL ener_by_tmp = fMultDiv2(ener << s1, tmp << s2);
  5865. - int ener_by_tmp_exp = (exp_ener - s1) + (exp_tmp - s2) + 1;
  5866. -
  5867. - if (ener_by_tmp_exp & 1) {
  5868. - ener_by_tmp <<= 1;
  5869. - ener_by_tmp_exp -= 1;
  5870. - }
  5871. -
  5872. - int temp_exp = 0;
  5873. -
  5874. - FIXP_DBL temp1 = invSqrtNorm2(ener_by_tmp, &temp_exp);
  5875. -
  5876. - int temp1_exp = temp_exp - (ener_by_tmp_exp >> 1);
  5877. -
  5878. - FIXP_DBL tmp_result = fMult(corr, temp1);
  5879. -
  5880. - int tmp_result_exp = exp_corr + temp1_exp;
  5881. -
  5882. - diff = tmp_result_exp - 0;
  5883. - FIXP_DBL point95 = FL2FXCONST_DBL(0.95f);
  5884. - if (diff >= 0) {
  5885. - diff = fMin(diff, 31);
  5886. - point95 = FL2FXCONST_DBL(0.95f) >> diff;
  5887. - } else {
  5888. - diff = fMax(diff, -31);
  5889. - tmp_result >>= (-diff);
  5890. - }
  5891. -
  5892. - if (tmp_result > point95) T = T2;
  5893. -
  5894. - /* prevent that noise calculation below reaches into not defined signal
  5895. - parts at the end of the synth_buf or in other words restrict the below
  5896. - used index (i+i_subfr+T) < l_frame + l_next
  5897. - */
  5898. - lg = l_frame + l_next - T - i_subfr;
  5899. -
  5900. - if (lg > L_SUBFR)
  5901. - lg = L_SUBFR;
  5902. - else if (lg < 0)
  5903. - lg = 0;
  5904. -
  5905. - /* limit gain to avoid problem on burst */
  5906. - if (lg > 0) {
  5907. - FIXP_DBL tmp1;
  5908. -
  5909. - /* max(lg) = 64 => scale with 6 bits minus 1 (fPow2Div2) */
  5910. -
  5911. - s1 = getScalefactor(&syn[i_subfr], lg);
  5912. - s2 = getScalefactor(&syn[i_subfr + T], lg);
  5913. - INT s = fixMin(s1, s2);
  5914. -
  5915. - tmp = (FIXP_DBL)0;
  5916. - ener = (FIXP_DBL)0;
  5917. - for (i = 0; i < lg; i++) {
  5918. - tmp += fPow2Div2(syn[i + i_subfr] << s1) >> (SF_PITCH_TRACK);
  5919. - ener += fPow2Div2(syn[i + i_subfr + T] << s2) >> (SF_PITCH_TRACK);
  5920. - }
  5921. - tmp = tmp >> fMin(DFRACT_BITS - 1, (2 * (s1 - s)));
  5922. - ener = ener >> fMin(DFRACT_BITS - 1, (2 * (s2 - s)));
  5923. -
  5924. - /* error robustness: for the specific case syn[...] == -1.0f for all 64
  5925. - samples ener or tmp might overflow and become negative. For all sane
  5926. - cases we have enough headroom.
  5927. - */
  5928. - if (ener <= (FIXP_DBL)0) {
  5929. - ener = (FIXP_DBL)1;
  5930. - }
  5931. - if (tmp <= (FIXP_DBL)0) {
  5932. - tmp = (FIXP_DBL)1;
  5933. - }
  5934. - FDK_ASSERT(ener > (FIXP_DBL)0);
  5935. -
  5936. - /* tmp = sqrt(tmp/ener) */
  5937. - int result_e = 0;
  5938. - tmp1 = fDivNorm(tmp, ener, &result_e);
  5939. - if (result_e & 1) {
  5940. - tmp1 >>= 1;
  5941. - result_e += 1;
  5942. - }
  5943. - tmp = sqrtFixp(tmp1);
  5944. - result_e >>= 1;
  5945. -
  5946. - gain_exp = 17;
  5947. -
  5948. - diff = result_e - gain_exp;
  5949. -
  5950. - FIXP_DBL gain1 = gain;
  5951. -
  5952. - if (diff >= 0) {
  5953. - diff = fMin(diff, 31);
  5954. - gain1 >>= diff;
  5955. - } else {
  5956. - result_e += (-diff);
  5957. - diff = fMax(diff, -31);
  5958. - tmp >>= (-diff);
  5959. - }
  5960. -
  5961. - if (tmp < gain1) {
  5962. - gain = tmp;
  5963. - gain_exp = result_e;
  5964. - }
  5965. - }
  5966. -
  5967. - /* calculate noise based on voiced pitch */
  5968. - /* fMultDiv2() replaces weighting of gain with 0.5 */
  5969. - diff = gain_exp - 17;
  5970. - if (diff >= 0) {
  5971. - gain <<= diff;
  5972. - } else {
  5973. - gain >>= (-diff);
  5974. - }
  5975. -
  5976. - s1 = CntLeadingZeros(gain) - 1;
  5977. - s1 -= 16; /* Leading bits for SGL */
  5978. -
  5979. - FIXP_SGL gainSGL = FX_DBL2FX_SGL(gain << 16);
  5980. -
  5981. - gainSGL = gainSGL << s1;
  5982. -
  5983. - {
  5984. - for (i = 0; i < lg; i++) {
  5985. - /* scaled with SF_SYNTH + gain_sf + 1 */
  5986. - noise_in[i] =
  5987. - (fMult(gainSGL, syn[i + i_subfr] - (syn[i + i_subfr - T] >> 1) -
  5988. - (syn[i + i_subfr + T] >> 1))) >>
  5989. - s1;
  5990. - }
  5991. -
  5992. - for (i = lg; i < L_SUBFR; i++) {
  5993. - /* scaled with SF_SYNTH + gain_sf + 1 */
  5994. - noise_in[i] =
  5995. - (fMult(gainSGL, syn[i + i_subfr] - syn[i + i_subfr - T])) >> s1;
  5996. - }
  5997. - }
  5998. - } else {
  5999. - FDKmemset(noise_in, (FIXP_DBL)0, L_SUBFR * sizeof(FIXP_DBL));
  6000. - }
  6001. -
  6002. - {
  6003. - FDKmemcpy(noise_buf, mem_bpf, (L_FILT + L_SUBFR) * sizeof(FIXP_DBL));
  6004. -
  6005. - FDKmemcpy(mem_bpf, noise_buf + L_SUBFR,
  6006. - (L_FILT + L_SUBFR) * sizeof(FIXP_DBL));
  6007. - }
  6008. -
  6009. - /* substract from voiced speech low-pass filtered noise */
  6010. - /* filter coefficients are scaled with factor SF_FILT_LP (1) */
  6011. -
  6012. - {
  6013. - filtLP(&syn[i_subfr - L_SUBFR], &synth_out[i_subfr], noise,
  6014. - fdk_dec_filt_lp, L_SUBFR, L_FILT);
  6015. - }
  6016. - }
  6017. -
  6018. - {
  6019. -
  6020. - }
  6021. -
  6022. - // To be determined (info from Ben)
  6023. - {
  6024. - /* Output scaling of the BPF memory */
  6025. - scaleValues(mem_bpf, (L_FILT + L_SUBFR), -1);
  6026. - /* Copy the rest of the signal (after the fac) */
  6027. - scaleValuesSaturate((FIXP_PCM *)&synth_out[l_frame],
  6028. - (FIXP_DBL *)&syn[l_frame - L_SUBFR],
  6029. - (frame_length - l_frame), MDCT_OUT_HEADROOM);
  6030. - }
  6031. -
  6032. - return;
  6033. -}
  6034. -
  6035. -/*
  6036. - * Frequency Domain Noise Shaping
  6037. - */
  6038. -
  6039. -/**
  6040. - * \brief Adaptive Low Frequencies Deemphasis of spectral coefficients.
  6041. - *
  6042. - * Ensure quantization of low frequencies in case where the
  6043. - * signal dynamic is higher than the LPC noise shaping.
  6044. - * This is the inverse operation of adap_low_freq_emph().
  6045. - * Output gain of all blocks.
  6046. - *
  6047. - * \param x pointer to the spectral coefficients, requires 1 bit headroom.
  6048. - * \param lg length of x.
  6049. - * \param bUseNewAlfe if set, apply ALFD for fullband lpd.
  6050. - * \param gainLpc1 pointer to gain based on old input LPC coefficients.
  6051. - * \param gainLpc2 pointer to gain based on new input LPC coefficients.
  6052. - * \param alfd_gains pointer to output gains.
  6053. - * \param s current scale shift factor of x.
  6054. - */
  6055. -#define ALFDPOW2_SCALE 3
  6056. -/*static*/
  6057. -void CLpd_AdaptLowFreqDeemph(FIXP_DBL x[], int lg, FIXP_DBL alfd_gains[],
  6058. - INT s) {
  6059. - {
  6060. - int i, j, k, i_max;
  6061. - FIXP_DBL max, fac;
  6062. - /* Note: This stack array saves temporary accumulation results to be used in
  6063. - * a second run */
  6064. - /* The size should be limited to (1024/4)/8=32 */
  6065. - FIXP_DBL tmp_pow2[32];
  6066. -
  6067. - s = s * 2 + ALFDPOW2_SCALE;
  6068. - s = fMin(31, s);
  6069. -
  6070. - k = 8;
  6071. - i_max = lg / 4; /* ALFD range = 1600Hz (lg = 6400Hz) */
  6072. -
  6073. - /* find spectral peak */
  6074. - max = FL2FX_DBL(0.01f) >> s;
  6075. - for (i = 0; i < i_max; i += k) {
  6076. - FIXP_DBL tmp;
  6077. -
  6078. - tmp = FIXP_DBL(0);
  6079. - FIXP_DBL *pX = &x[i];
  6080. -
  6081. - j = 8;
  6082. - do {
  6083. - FIXP_DBL x0 = *pX++;
  6084. - FIXP_DBL x1 = *pX++;
  6085. - x0 = fPow2Div2(x0);
  6086. - x1 = fPow2Div2(x1);
  6087. - tmp = tmp + (x0 >> (ALFDPOW2_SCALE - 1));
  6088. - tmp = tmp + (x1 >> (ALFDPOW2_SCALE - 1));
  6089. - } while ((j = j - 2) != 0);
  6090. - tmp = fMax(tmp, (FL2FX_DBL(0.01f) >> s));
  6091. - tmp_pow2[i >> 3] = tmp;
  6092. - if (tmp > max) {
  6093. - max = tmp;
  6094. - }
  6095. - }
  6096. -
  6097. - /* deemphasis of all blocks below the peak */
  6098. - fac = FL2FX_DBL(0.1f) >> 1;
  6099. - for (i = 0; i < i_max; i += k) {
  6100. - FIXP_DBL tmp;
  6101. - INT shifti;
  6102. -
  6103. - tmp = tmp_pow2[i >> 3];
  6104. -
  6105. - /* tmp = (float)sqrt(tmp/max); */
  6106. -
  6107. - /* value of tmp is between 8/2*max^2 and max^2 / 2. */
  6108. - /* required shift factor of division can grow up to 27
  6109. - (grows exponentially for values toward zero)
  6110. - thus using normalized division to assure valid result. */
  6111. - {
  6112. - INT sd;
  6113. -
  6114. - if (tmp != (FIXP_DBL)0) {
  6115. - tmp = fDivNorm(max, tmp, &sd);
  6116. - if (sd & 1) {
  6117. - sd++;
  6118. - tmp >>= 1;
  6119. - }
  6120. - } else {
  6121. - tmp = (FIXP_DBL)MAXVAL_DBL;
  6122. - sd = 0;
  6123. - }
  6124. - tmp = invSqrtNorm2(tmp, &shifti);
  6125. - tmp = scaleValue(tmp, shifti - 1 - (sd / 2));
  6126. - }
  6127. - if (tmp > fac) {
  6128. - fac = tmp;
  6129. - }
  6130. - FIXP_DBL *pX = &x[i];
  6131. -
  6132. - j = 8;
  6133. - do {
  6134. - FIXP_DBL x0 = pX[0];
  6135. - FIXP_DBL x1 = pX[1];
  6136. - x0 = fMultDiv2(x0, fac);
  6137. - x1 = fMultDiv2(x1, fac);
  6138. - x0 = x0 << 2;
  6139. - x1 = x1 << 2;
  6140. - *pX++ = x0;
  6141. - *pX++ = x1;
  6142. -
  6143. - } while ((j = j - 2) != 0);
  6144. - /* Store gains for FAC */
  6145. - *alfd_gains++ = fac;
  6146. - }
  6147. - }
  6148. -}
  6149. -
  6150. -/**
  6151. - * \brief Interpolated Noise Shaping for mdct coefficients.
  6152. - * This algorithm shapes temporally the spectral noise between
  6153. - * the two spectral noise represention (FDNS_NPTS of resolution).
  6154. - * The noise is shaped monotonically between the two points
  6155. - * using a curved shape to favor the lower gain in mid-frame.
  6156. - * ODFT and amplitud calculation are applied to the 2 LPC coefficients first.
  6157. - *
  6158. - * \param r pointer to spectrum data.
  6159. - * \param rms RMS of output spectrum.
  6160. - * \param lg length of r.
  6161. - * \param A1 pointer to old input LPC coefficients of length M_LP_FILTER_ORDER
  6162. - * scaled by SF_A_COEFFS.
  6163. - * \param A2 pointer to new input LPC coefficients of length M_LP_FILTER_ORDER
  6164. - * scaled by SF_A_COEFFS.
  6165. - * \param bLpc2Mdct flags control lpc2mdct conversion and noise shaping.
  6166. - * \param gainLpc1 pointer to gain based on old input LPC coefficients.
  6167. - * \param gainLpc2 pointer to gain based on new input LPC coefficients.
  6168. - * \param gLpc_e pointer to exponent of gainLpc1 and gainLpc2.
  6169. - */
  6170. -/* static */
  6171. -#define NSHAPE_SCALE (4)
  6172. -
  6173. -#define LPC2MDCT_CALC (1)
  6174. -#define LPC2MDCT_GAIN_LOAD (2)
  6175. -#define LPC2MDCT_GAIN_SAVE (4)
  6176. -#define LPC2MDCT_APPLY_NSHAPE (8)
  6177. -
  6178. -void lpc2mdctAndNoiseShaping(FIXP_DBL *r, SHORT *pScale, const INT lg,
  6179. - const INT fdns_npts, const FIXP_LPC *A1,
  6180. - const INT A1_exp, const FIXP_LPC *A2,
  6181. - const INT A2_exp) {
  6182. - FIXP_DBL *tmp2 = NULL;
  6183. - FIXP_DBL rr_minus_one;
  6184. - int i, k, s, step;
  6185. -
  6186. - C_AALLOC_SCRATCH_START(tmp1, FIXP_DBL, FDNS_NPTS * 8)
  6187. -
  6188. - {
  6189. - tmp2 = tmp1 + fdns_npts * 4;
  6190. -
  6191. - /* lpc2mdct() */
  6192. -
  6193. - /* ODFT. E_LPC_a_weight() for A1 and A2 vectors is included into the loop
  6194. - * below. */
  6195. - FIXP_DBL f = FL2FXCONST_DBL(0.92f);
  6196. -
  6197. - const FIXP_STP *SinTab;
  6198. - int k_step;
  6199. - /* needed values: sin(phi), cos(phi); phi = i*PI/(2*fdns_npts), i = 0 ...
  6200. - * M_LP_FILTER_ORDER */
  6201. - switch (fdns_npts) {
  6202. - case 64:
  6203. - SinTab = SineTable512;
  6204. - k_step = (512 / 64);
  6205. - FDK_ASSERT(512 >= 64);
  6206. - break;
  6207. - case 48:
  6208. - SinTab = SineTable384;
  6209. - k_step = 384 / 48;
  6210. - FDK_ASSERT(384 >= 48);
  6211. - break;
  6212. - default:
  6213. - FDK_ASSERT(0);
  6214. - return;
  6215. - }
  6216. -
  6217. - for (i = 0, k = k_step; i < M_LP_FILTER_ORDER; i++, k += k_step) {
  6218. - FIXP_STP cs = SinTab[k];
  6219. - FIXP_DBL wA1, wA2;
  6220. -
  6221. - wA1 = fMult(A1[i], f);
  6222. - wA2 = fMult(A2[i], f);
  6223. -
  6224. - /* r[i] = A[i]*cos() */
  6225. - tmp1[2 + i * 2] = fMult(wA1, cs.v.re);
  6226. - tmp2[2 + i * 2] = fMult(wA2, cs.v.re);
  6227. - /* i[i] = A[i]*sin() */
  6228. - tmp1[3 + i * 2] = -fMult(wA1, cs.v.im);
  6229. - tmp2[3 + i * 2] = -fMult(wA2, cs.v.im);
  6230. -
  6231. - f = fMult(f, FL2FXCONST_DBL(0.92f));
  6232. - }
  6233. -
  6234. - /* Guarantee at least 2 bits of headroom for the FFT */
  6235. - /* "3" stands for 1.0 with 2 bits of headroom; (A1_exp + 2) guarantess 2
  6236. - * bits of headroom if A1_exp > 1 */
  6237. - int A1_exp_fix = fMax(3, A1_exp + 2);
  6238. - int A2_exp_fix = fMax(3, A2_exp + 2);
  6239. -
  6240. - /* Set 1.0 in the proper format */
  6241. - tmp1[0] = (FIXP_DBL)(INT)((ULONG)0x80000000 >> A1_exp_fix);
  6242. - tmp2[0] = (FIXP_DBL)(INT)((ULONG)0x80000000 >> A2_exp_fix);
  6243. -
  6244. - tmp1[1] = tmp2[1] = (FIXP_DBL)0;
  6245. -
  6246. - /* Clear the resto of the array */
  6247. - FDKmemclear(
  6248. - tmp1 + 2 * (M_LP_FILTER_ORDER + 1),
  6249. - 2 * (fdns_npts * 2 - (M_LP_FILTER_ORDER + 1)) * sizeof(FIXP_DBL));
  6250. - FDKmemclear(
  6251. - tmp2 + 2 * (M_LP_FILTER_ORDER + 1),
  6252. - 2 * (fdns_npts * 2 - (M_LP_FILTER_ORDER + 1)) * sizeof(FIXP_DBL));
  6253. -
  6254. - /* Guarantee 2 bits of headroom for FFT */
  6255. - scaleValues(&tmp1[2], (2 * M_LP_FILTER_ORDER), (A1_exp - A1_exp_fix));
  6256. - scaleValues(&tmp2[2], (2 * M_LP_FILTER_ORDER), (A2_exp - A2_exp_fix));
  6257. -
  6258. - INT s2;
  6259. - s = A1_exp_fix;
  6260. - s2 = A2_exp_fix;
  6261. -
  6262. - fft(2 * fdns_npts, tmp1, &s);
  6263. - fft(2 * fdns_npts, tmp2, &s2);
  6264. -
  6265. - /* Adjust the exponents of both fft outputs if necessary*/
  6266. - if (s > s2) {
  6267. - scaleValues(tmp2, 2 * fdns_npts, s2 - s);
  6268. - s2 = s;
  6269. - } else if (s < s2) {
  6270. - scaleValues(tmp1, 2 * fdns_npts, s - s2);
  6271. - s = s2;
  6272. - }
  6273. -
  6274. - FDK_ASSERT(s == s2);
  6275. - }
  6276. -
  6277. - /* Get amplitude and apply gains */
  6278. - step = lg / fdns_npts;
  6279. - rr_minus_one = (FIXP_DBL)0;
  6280. -
  6281. - for (k = 0; k < fdns_npts; k++) {
  6282. - FIXP_DBL g1, g2, inv_g1_g2, a, b;
  6283. - INT inv_g1_g2_e;
  6284. - int g_e, shift;
  6285. -
  6286. - {
  6287. - FIXP_DBL real, imag;
  6288. - int si1, si2, sInput;
  6289. -
  6290. - real = tmp1[k * 2];
  6291. - imag = tmp1[k * 2 + 1];
  6292. - sInput = fMax(fMin(fNorm(real), fNorm(imag)) - 1, 0);
  6293. - real <<= sInput;
  6294. - imag <<= sInput;
  6295. - /* g1_e = si1 - 2*s/2 */
  6296. - g1 = invSqrtNorm2(fPow2(real) + fPow2(imag), &si1);
  6297. - si1 += sInput;
  6298. -
  6299. - real = tmp2[k * 2];
  6300. - imag = tmp2[k * 2 + 1];
  6301. - sInput = fMax(fMin(fNorm(real), fNorm(imag)) - 1, 0);
  6302. - real <<= sInput;
  6303. - imag <<= sInput;
  6304. - /* g2_e = si2 - 2*s/2 */
  6305. - g2 = invSqrtNorm2(fPow2(real) + fPow2(imag), &si2);
  6306. - si2 += sInput;
  6307. -
  6308. - /* Pick a common scale factor for g1 and g2 */
  6309. - if (si1 > si2) {
  6310. - g2 >>= si1 - si2;
  6311. - g_e = si1 - s;
  6312. - } else {
  6313. - g1 >>= si2 - si1;
  6314. - g_e = si2 - s;
  6315. - }
  6316. - }
  6317. -
  6318. - /* end of lpc2mdct() */
  6319. -
  6320. - FDK_ASSERT(g1 >= (FIXP_DBL)0);
  6321. - FDK_ASSERT(g2 >= (FIXP_DBL)0);
  6322. -
  6323. - /* mdct_IntNoiseShaping() */
  6324. - {
  6325. - /* inv_g1_g2 * 2^inv_g1_g2_e = 1/(g1+g2) */
  6326. - inv_g1_g2 = (g1 >> 1) + (g2 >> 1);
  6327. - if (inv_g1_g2 != (FIXP_DBL)0) {
  6328. - inv_g1_g2 = fDivNorm(FL2FXCONST_DBL(0.5f), inv_g1_g2, &inv_g1_g2_e);
  6329. - inv_g1_g2_e = inv_g1_g2_e - g_e;
  6330. - } else {
  6331. - inv_g1_g2 = (FIXP_DBL)MAXVAL_DBL;
  6332. - inv_g1_g2_e = 0;
  6333. - }
  6334. -
  6335. - if (g_e < 0) {
  6336. - /* a_e = g_e + inv_g1_g2_e + 1 */
  6337. - a = scaleValue(fMult(fMult(g1, g2), inv_g1_g2), g_e);
  6338. - /* b_e = g_e + inv_g1_g2_e */
  6339. - b = fMult(g2 - g1, inv_g1_g2);
  6340. - shift = g_e + inv_g1_g2_e + 1 - NSHAPE_SCALE;
  6341. - } else {
  6342. - /* a_e = (g_e+g_e) + inv_g1_g2_e + 1 */
  6343. - a = fMult(fMult(g1, g2), inv_g1_g2);
  6344. - /* b_e = (g_e+g_e) + inv_g1_g2_e */
  6345. - b = scaleValue(fMult(g2 - g1, inv_g1_g2), -g_e);
  6346. - shift = (g_e + g_e) + inv_g1_g2_e + 1 - NSHAPE_SCALE;
  6347. - }
  6348. -
  6349. - for (i = k * step; i < (k + 1) * step; i++) {
  6350. - FIXP_DBL tmp;
  6351. -
  6352. - /* rr[i] = 2*a*r[i] + b*rr[i-1] */
  6353. - tmp = fMult(a, r[i]);
  6354. - tmp += scaleValue(fMultDiv2(b, rr_minus_one), NSHAPE_SCALE);
  6355. - tmp = scaleValueSaturate(tmp, shift);
  6356. - rr_minus_one = tmp;
  6357. - r[i] = tmp;
  6358. - }
  6359. - }
  6360. - }
  6361. -
  6362. - /* end of mdct_IntNoiseShaping() */
  6363. - { *pScale += NSHAPE_SCALE; }
  6364. -
  6365. - C_AALLOC_SCRATCH_END(tmp1, FIXP_DBL, FDNS_NPTS * 8)
  6366. -}
  6367. -
  6368. -/**
  6369. - * \brief Calculates the energy.
  6370. - * \param r pointer to spectrum.
  6371. - * \param rs scale factor of spectrum r.
  6372. - * \param lg frame length in audio samples.
  6373. - * \param rms_e pointer to exponent of energy value.
  6374. - * \return mantissa of energy value.
  6375. - */
  6376. -static FIXP_DBL calcEnergy(const FIXP_DBL *r, const SHORT rs, const INT lg,
  6377. - INT *rms_e) {
  6378. - int headroom = getScalefactor(r, lg);
  6379. -
  6380. - FIXP_DBL rms_m = 0;
  6381. -
  6382. - /* Calculate number of growth bits due to addition */
  6383. - INT shift = (INT)(fNormz((FIXP_DBL)lg));
  6384. - shift = 31 - shift;
  6385. -
  6386. - /* Generate 1e-2 in Q-6.37 */
  6387. - const FIXP_DBL value0_01 = 0x51eb851e;
  6388. - const INT value0_01_exp = -6;
  6389. -
  6390. - /* Find the exponent of the resulting energy value */
  6391. - *rms_e = ((rs - headroom) << 1) + shift + 1;
  6392. -
  6393. - INT delta = *rms_e - value0_01_exp;
  6394. - if (delta > 0) {
  6395. - /* Limit shift_to 31*/
  6396. - delta = fMin(31, delta);
  6397. - rms_m = value0_01 >> delta;
  6398. - } else {
  6399. - rms_m = value0_01;
  6400. - *rms_e = value0_01_exp;
  6401. - shift = shift - delta;
  6402. - /* Limit shift_to 31*/
  6403. - shift = fMin(31, shift);
  6404. - }
  6405. -
  6406. - for (int i = 0; i < lg; i++) {
  6407. - rms_m += fPow2Div2(r[i] << headroom) >> shift;
  6408. - }
  6409. -
  6410. - return rms_m;
  6411. -}
  6412. -
  6413. -/**
  6414. - * \brief TCX gain calculation.
  6415. - * \param pAacDecoderChannelInfo channel context data.
  6416. - * \param r output spectrum.
  6417. - * \param rms_e pointer to mantissa of energy value.
  6418. - * \param rms_e pointer to exponent of energy value.
  6419. - * \param frame the frame index of the LPD super frame.
  6420. - * \param lg the frame length in audio samples.
  6421. - * \param gain_m pointer to mantissa of TCX gain.
  6422. - * \param gain_e pointer to exponent of TCX gain.
  6423. - * \param elFlags element specific parser guidance flags.
  6424. - * \param lg_fb the fullband frame length in audio samples.
  6425. - * \param IGF_bgn the IGF start index.
  6426. - */
  6427. -static void calcTCXGain(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6428. - FIXP_DBL *r, FIXP_DBL rms_m, INT rms_e, const INT frame,
  6429. - const INT lg) {
  6430. - if ((rms_m != (FIXP_DBL)0)) {
  6431. - FIXP_DBL tcx_gain_m;
  6432. - INT tcx_gain_e;
  6433. -
  6434. - CLpd_DecodeGain(&tcx_gain_m, &tcx_gain_e,
  6435. - pAacDecoderChannelInfo->pDynData->specificTo.usac
  6436. - .tcx_global_gain[frame]);
  6437. -
  6438. - /* rms * 2^rms_e = lg/sqrt(sum(spec^2)) */
  6439. - if (rms_e & 1) {
  6440. - rms_m >>= 1;
  6441. - rms_e++;
  6442. - }
  6443. -
  6444. - {
  6445. - FIXP_DBL fx_lg;
  6446. - INT fx_lg_e, s;
  6447. - INT inv_e;
  6448. -
  6449. - /* lg = fx_lg * 2^fx_lg_e */
  6450. - s = fNorm((FIXP_DBL)lg);
  6451. - fx_lg = (FIXP_DBL)lg << s;
  6452. - fx_lg_e = DFRACT_BITS - 1 - s;
  6453. - /* 1/sqrt(rms) */
  6454. - rms_m = invSqrtNorm2(rms_m, &inv_e);
  6455. - rms_m = fMult(rms_m, fx_lg);
  6456. - rms_e = inv_e - (rms_e >> 1) + fx_lg_e;
  6457. - }
  6458. -
  6459. - {
  6460. - int s = fNorm(tcx_gain_m);
  6461. - tcx_gain_m = tcx_gain_m << s;
  6462. - tcx_gain_e -= s;
  6463. - }
  6464. -
  6465. - tcx_gain_m = fMultDiv2(tcx_gain_m, rms_m);
  6466. - tcx_gain_e = tcx_gain_e + rms_e;
  6467. -
  6468. - /* global_gain * 2^(global_gain_e+rms_e) = (10^(global_gain/28)) * rms *
  6469. - * 2^rms_e */
  6470. - {
  6471. - { tcx_gain_e += 1; }
  6472. - }
  6473. -
  6474. - pAacDecoderChannelInfo->data.usac.tcx_gain[frame] = tcx_gain_m;
  6475. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[frame] = tcx_gain_e;
  6476. -
  6477. - pAacDecoderChannelInfo->specScale[frame] += tcx_gain_e;
  6478. - }
  6479. -}
  6480. -
  6481. -/**
  6482. - * \brief FDNS decoding.
  6483. - * \param pAacDecoderChannelInfo channel context data.
  6484. - * \param pAacDecoderStaticChannelInfo channel context static data.
  6485. - * \param r output spectrum.
  6486. - * \param lg the frame length in audio samples.
  6487. - * \param frame the frame index of the LPD super frame.
  6488. - * \param pScale pointer to current scale shift factor of r[].
  6489. - * \param A1 old input LPC coefficients of length M_LP_FILTER_ORDER.
  6490. - * \param A2 new input LPC coefficients of length M_LP_FILTER_ORDER.
  6491. - * \param pAlfdGains pointer for ALFD gains output scaled by 1.
  6492. - * \param fdns_npts number of lines (FDNS_NPTS).
  6493. - * \param inf_mask pointer to noise mask.
  6494. - * \param IGF_win_mode IGF window mode (LONG, SHORT, TCX10, TCX20).
  6495. - * \param frameType (IGF_FRAME_DIVISION_AAC_OR_TCX_LONG or
  6496. - * IGF_FRAME_DIVISION_TCX_SHORT_1).
  6497. - * \param elFlags element specific parser guidance flags.
  6498. - * \param lg_fb the fullband frame length in audio samples.
  6499. - * \param IGF_bgn the IGF start index.
  6500. - * \param rms_m mantisse of energy.
  6501. - * \param rms_e exponent of energy.
  6502. - */
  6503. -/* static */
  6504. -void CLpd_FdnsDecode(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6505. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6506. - FIXP_DBL r[], const INT lg, const INT frame, SHORT *pScale,
  6507. - const FIXP_LPC A1[M_LP_FILTER_ORDER], const INT A1_exp,
  6508. - const FIXP_LPC A2[M_LP_FILTER_ORDER], const INT A2_exp,
  6509. - FIXP_DBL pAlfdGains[LFAC / 4], const INT fdns_npts) {
  6510. - /* Weight LPC coefficients using Rm values */
  6511. - CLpd_AdaptLowFreqDeemph(r, lg, pAlfdGains, *pScale);
  6512. -
  6513. - FIXP_DBL rms_m = (FIXP_DBL)0;
  6514. - INT rms_e = 0;
  6515. - {
  6516. - /* Calculate Energy */
  6517. - rms_m = calcEnergy(r, *pScale, lg, &rms_e);
  6518. - }
  6519. -
  6520. - calcTCXGain(pAacDecoderChannelInfo, r, rms_m, rms_e, frame, lg);
  6521. -
  6522. - /* Apply ODFT and Noise Shaping. LP coefficient (A1, A2) weighting is done
  6523. - * inside on the fly. */
  6524. -
  6525. - lpc2mdctAndNoiseShaping(r, pScale, lg, fdns_npts, A1, A1_exp, A2, A2_exp);
  6526. -}
  6527. -
  6528. -/**
  6529. - * find pitch for TCX20 (time domain) concealment.
  6530. - */
  6531. -static int find_mpitch(FIXP_DBL xri[], int lg) {
  6532. - FIXP_DBL max, pitch;
  6533. - INT pitch_e;
  6534. - int i, n;
  6535. -
  6536. - max = (FIXP_DBL)0;
  6537. - n = 2;
  6538. -
  6539. - /* find maximum below 400Hz */
  6540. - for (i = 2; i < (lg >> 4); i += 2) {
  6541. - FIXP_DBL tmp = fPow2Div2(xri[i]) + fPow2Div2(xri[i + 1]);
  6542. - if (tmp > max) {
  6543. - max = tmp;
  6544. - n = i;
  6545. - }
  6546. - }
  6547. -
  6548. - // pitch = ((float)lg<<1)/(float)n;
  6549. - pitch = fDivNorm((FIXP_DBL)lg << 1, (FIXP_DBL)n, &pitch_e);
  6550. - pitch >>= fixMax(0, DFRACT_BITS - 1 - pitch_e - 16);
  6551. -
  6552. - /* find pitch multiple under 20ms */
  6553. - if (pitch >= (FIXP_DBL)((256 << 16) - 1)) { /*231.0f*/
  6554. - n = 256;
  6555. - } else {
  6556. - FIXP_DBL mpitch = pitch;
  6557. - while (mpitch < (FIXP_DBL)(255 << 16)) {
  6558. - mpitch += pitch;
  6559. - }
  6560. - n = (int)(mpitch - pitch) >> 16;
  6561. - }
  6562. -
  6563. - return (n);
  6564. -}
  6565. -
  6566. -/**
  6567. - * number of spectral coefficients / time domain samples using frame mode as
  6568. - * index.
  6569. - */
  6570. -static const int lg_table_ccfl[2][4] = {
  6571. - {256, 256, 512, 1024}, /* coreCoderFrameLength = 1024 */
  6572. - {192, 192, 384, 768} /* coreCoderFrameLength = 768 */
  6573. -};
  6574. -
  6575. -/**
  6576. - * \brief Decode and render one MDCT-TCX frame.
  6577. - * \param pAacDecoderChannelInfo channel context data.
  6578. - * \param lg the frame length in audio samples.
  6579. - * \param frame the frame index of the LPD super frame.
  6580. - */
  6581. -static void CLpd_TcxDecode(
  6582. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6583. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags,
  6584. - int mod, int last_mod, int frame, int frameOk) {
  6585. - FIXP_DBL *pAlfd_gains = pAacDecoderStaticChannelInfo->last_alfd_gains;
  6586. - ULONG *pSeed = &pAacDecoderStaticChannelInfo->nfRandomSeed;
  6587. - int lg = (pAacDecoderChannelInfo->granuleLength == 128)
  6588. - ? lg_table_ccfl[0][mod + 0]
  6589. - : lg_table_ccfl[1][mod + 0];
  6590. - int next_frame = frame + (1 << (mod - 1));
  6591. - int isFullBandLpd = 0;
  6592. -
  6593. - /* Obtain r[] vector by combining the quant[] and noise[] vectors */
  6594. - {
  6595. - FIXP_DBL noise_level;
  6596. - FIXP_DBL *coeffs =
  6597. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6598. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd);
  6599. - int scale = pAacDecoderChannelInfo->specScale[frame];
  6600. - int i, nfBgn, nfEnd;
  6601. - UCHAR tcx_noise_factor = pAacDecoderChannelInfo->pDynData->specificTo.usac
  6602. - .tcx_noise_factor[frame];
  6603. -
  6604. - /* find pitch for bfi case */
  6605. - pAacDecoderStaticChannelInfo->last_tcx_pitch = find_mpitch(coeffs, lg);
  6606. -
  6607. - if (frameOk) {
  6608. - /* store for concealment */
  6609. - pAacDecoderStaticChannelInfo->last_tcx_noise_factor = tcx_noise_factor;
  6610. - } else {
  6611. - /* restore last frames value */
  6612. - tcx_noise_factor = pAacDecoderStaticChannelInfo->last_tcx_noise_factor;
  6613. - }
  6614. -
  6615. - noise_level =
  6616. - (FIXP_DBL)((LONG)FL2FXCONST_DBL(0.0625f) * (8 - tcx_noise_factor));
  6617. - noise_level = scaleValue(noise_level, -scale);
  6618. -
  6619. - const FIXP_DBL neg_noise_level = -noise_level;
  6620. -
  6621. - {
  6622. - nfBgn = lg / 6;
  6623. - nfEnd = lg;
  6624. - }
  6625. -
  6626. - for (i = nfBgn; i < nfEnd - 7; i += 8) {
  6627. - LONG tmp;
  6628. -
  6629. - /* Fill all 8 consecutive zero coeffs with noise */
  6630. - tmp = coeffs[i + 0] | coeffs[i + 1] | coeffs[i + 2] | coeffs[i + 3] |
  6631. - coeffs[i + 4] | coeffs[i + 5] | coeffs[i + 6] | coeffs[i + 7];
  6632. -
  6633. - if (tmp == 0) {
  6634. - for (int k = i; k < i + 8; k++) {
  6635. - UsacRandomSign(pSeed) ? (coeffs[k] = neg_noise_level)
  6636. - : (coeffs[k] = noise_level);
  6637. - }
  6638. - }
  6639. - }
  6640. - if ((nfEnd - i) >
  6641. - 0) { /* noise filling for last "band" with less than 8 bins */
  6642. - LONG tmp = (LONG)coeffs[i];
  6643. - int k;
  6644. -
  6645. - FDK_ASSERT((nfEnd - i) < 8);
  6646. - for (k = 1; k < (nfEnd - i); k++) {
  6647. - tmp |= (LONG)coeffs[i + k];
  6648. - }
  6649. - if (tmp == 0) {
  6650. - for (k = i; k < nfEnd; k++) {
  6651. - UsacRandomSign(pSeed) ? (coeffs[k] = neg_noise_level)
  6652. - : (coeffs[k] = noise_level);
  6653. - }
  6654. - }
  6655. - }
  6656. - }
  6657. -
  6658. - {
  6659. - /* Convert LPC to LP domain */
  6660. - if (last_mod == 0) {
  6661. - /* Note: The case where last_mod == 255 is handled by other means
  6662. - * in CLpdChannelStream_Read() */
  6663. - E_LPC_f_lsp_a_conversion(
  6664. - pAacDecoderChannelInfo->data.usac.lsp_coeff[frame],
  6665. - pAacDecoderChannelInfo->data.usac.lp_coeff[frame],
  6666. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[frame]);
  6667. - }
  6668. -
  6669. - E_LPC_f_lsp_a_conversion(
  6670. - pAacDecoderChannelInfo->data.usac.lsp_coeff[next_frame],
  6671. - pAacDecoderChannelInfo->data.usac.lp_coeff[next_frame],
  6672. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[next_frame]);
  6673. -
  6674. - /* FDNS decoding */
  6675. - CLpd_FdnsDecode(
  6676. - pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  6677. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6678. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  6679. - lg, frame, pAacDecoderChannelInfo->specScale + frame,
  6680. - pAacDecoderChannelInfo->data.usac.lp_coeff[frame],
  6681. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[frame],
  6682. - pAacDecoderChannelInfo->data.usac.lp_coeff[next_frame],
  6683. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[next_frame], pAlfd_gains,
  6684. - pAacDecoderChannelInfo->granuleLength / 2 /* == FDNS_NPTS(ccfl) */
  6685. - );
  6686. - }
  6687. -}
  6688. -
  6689. -/**
  6690. - * \brief Read the tcx_coding bitstream part
  6691. - * \param hBs bitstream handle to read from.
  6692. - * \param pAacDecoderChannelInfo channel context info to store data into.
  6693. - * \param lg the frame length in audio samples.
  6694. - * \param first_tcx_flag flag indicating that this is the first TCX frame.
  6695. - * \param frame the frame index of the LPD super frame.
  6696. - */
  6697. -static AAC_DECODER_ERROR CLpd_TCX_Read(
  6698. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6699. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, int lg,
  6700. - int first_tcx_flag, int frame, UINT flags) {
  6701. - AAC_DECODER_ERROR errorAAC = AAC_DEC_OK;
  6702. - ARITH_CODING_ERROR error = ARITH_CODER_OK;
  6703. - FIXP_DBL *pSpec;
  6704. - int arith_reset_flag = 0;
  6705. - int isFullBandLpd = 0;
  6706. -
  6707. - pSpec = SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6708. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd);
  6709. -
  6710. - /* TCX noise level */
  6711. - {
  6712. - pAacDecoderChannelInfo->pDynData->specificTo.usac.tcx_noise_factor[frame] =
  6713. - FDKreadBits(hBs, 3);
  6714. - }
  6715. - /* TCX global gain */
  6716. - pAacDecoderChannelInfo->pDynData->specificTo.usac.tcx_global_gain[frame] =
  6717. - FDKreadBits(hBs, 7);
  6718. -
  6719. - /* Arithmetic coded residual/spectrum */
  6720. - if (first_tcx_flag) {
  6721. - if (flags & AC_INDEP) {
  6722. - arith_reset_flag = 1;
  6723. - } else {
  6724. - arith_reset_flag = FDKreadBits(hBs, 1);
  6725. - }
  6726. - }
  6727. -
  6728. - /* CArco_DecodeArithData() output scale of "pSpec" is DFRACT_BITS-1 */
  6729. - error = CArco_DecodeArithData(pAacDecoderStaticChannelInfo->hArCo, hBs, pSpec,
  6730. - lg, lg, arith_reset_flag);
  6731. -
  6732. - /* Rescale residual/spectrum */
  6733. - {
  6734. - int scale = getScalefactor(pSpec, lg) - 2; /* Leave 2 bits headroom */
  6735. -
  6736. - /* Exponent of CArco_DecodeArithData() output is DFRACT_BITS; integer
  6737. - * values. */
  6738. - scaleValues(pSpec, lg, scale);
  6739. - scale = DFRACT_BITS - 1 - scale;
  6740. -
  6741. - pAacDecoderChannelInfo->specScale[frame] = scale;
  6742. - }
  6743. -
  6744. - if (error == ARITH_CODER_ERROR) errorAAC = AAC_DEC_UNKNOWN;
  6745. -
  6746. - return errorAAC;
  6747. -}
  6748. -
  6749. -/**
  6750. - * \brief translate lpd_mode into the mod[] array which describes the mode of
  6751. - * each each LPD frame
  6752. - * \param mod[] the array that will be filled with the mode indexes of the
  6753. - * inidividual frames.
  6754. - * \param lpd_mode the lpd_mode field read from the lpd_channel_stream
  6755. - */
  6756. -static AAC_DECODER_ERROR CLpd_ReadAndMapLpdModeToModArray(
  6757. - UCHAR mod[4], HANDLE_FDK_BITSTREAM hBs, UINT elFlags) {
  6758. - int lpd_mode;
  6759. -
  6760. - {
  6761. - lpd_mode = FDKreadBits(hBs, 5);
  6762. -
  6763. - if (lpd_mode > 25 || lpd_mode < 0) {
  6764. - return AAC_DEC_PARSE_ERROR;
  6765. - }
  6766. -
  6767. - switch (lpd_mode) {
  6768. - case 25:
  6769. - /* 1 80MS frame */
  6770. - mod[0] = mod[1] = mod[2] = mod[3] = 3;
  6771. - break;
  6772. - case 24:
  6773. - /* 2 40MS frames */
  6774. - mod[0] = mod[1] = mod[2] = mod[3] = 2;
  6775. - break;
  6776. - default:
  6777. - switch (lpd_mode >> 2) {
  6778. - case 4:
  6779. - /* lpd_mode 19 - 16 => 1 40MS and 2 20MS frames */
  6780. - mod[0] = mod[1] = 2;
  6781. - mod[2] = (lpd_mode & 1) ? 1 : 0;
  6782. - mod[3] = (lpd_mode & 2) ? 1 : 0;
  6783. - break;
  6784. - case 5:
  6785. - /* lpd_mode 23 - 20 => 2 20MS and 1 40MS frames */
  6786. - mod[2] = mod[3] = 2;
  6787. - mod[0] = (lpd_mode & 1) ? 1 : 0;
  6788. - mod[1] = (lpd_mode & 2) ? 1 : 0;
  6789. - break;
  6790. - default:
  6791. - /* lpd_mode < 16 => 4 20MS frames */
  6792. - mod[0] = (lpd_mode & 1) ? 1 : 0;
  6793. - mod[1] = (lpd_mode & 2) ? 1 : 0;
  6794. - mod[2] = (lpd_mode & 4) ? 1 : 0;
  6795. - mod[3] = (lpd_mode & 8) ? 1 : 0;
  6796. - break;
  6797. - }
  6798. - break;
  6799. - }
  6800. - }
  6801. - return AAC_DEC_OK;
  6802. -}
  6803. -
  6804. -static void CLpd_Reset(
  6805. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6806. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6807. - int keep_past_signal) {
  6808. - int i;
  6809. -
  6810. - /* Reset TCX / ACELP common memory */
  6811. - if (!keep_past_signal) {
  6812. - FDKmemclear(pAacDecoderStaticChannelInfo->old_synth,
  6813. - sizeof(pAacDecoderStaticChannelInfo->old_synth));
  6814. - }
  6815. -
  6816. - /* Initialize the LSFs */
  6817. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  6818. - pAacDecoderStaticChannelInfo->lpc4_lsf[i] = fdk_dec_lsf_init[i];
  6819. - }
  6820. -
  6821. - /* Reset memory needed by bass post-filter */
  6822. - FDKmemclear(pAacDecoderStaticChannelInfo->mem_bpf,
  6823. - sizeof(pAacDecoderStaticChannelInfo->mem_bpf));
  6824. -
  6825. - pAacDecoderStaticChannelInfo->old_bpf_control_info = 0;
  6826. - for (i = 0; i < SYN_SFD; i++) {
  6827. - pAacDecoderStaticChannelInfo->old_T_pf[i] = 64;
  6828. - pAacDecoderStaticChannelInfo->old_gain_pf[i] = (FIXP_DBL)0;
  6829. - }
  6830. -
  6831. - /* Reset ACELP memory */
  6832. - CLpd_AcelpReset(&pAacDecoderStaticChannelInfo->acelp);
  6833. -
  6834. - pAacDecoderStaticChannelInfo->last_lpc_lost = 0; /* prev_lpc_lost */
  6835. - pAacDecoderStaticChannelInfo->last_tcx_pitch = L_DIV; /* pitch_tcx */
  6836. - pAacDecoderStaticChannelInfo->numLostLpdFrames = 0; /* nbLostCmpt */
  6837. -}
  6838. -
  6839. -/*
  6840. - * Externally visible functions
  6841. - */
  6842. -
  6843. -AAC_DECODER_ERROR CLpdChannelStream_Read(
  6844. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6845. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6846. - const SamplingRateInfo *pSamplingRateInfo, UINT flags) {
  6847. - AAC_DECODER_ERROR error = AAC_DEC_OK;
  6848. - int first_tcx_flag;
  6849. - int k, nbDiv, fFacDataPresent, first_lpd_flag, acelp_core_mode,
  6850. - facGetMemState = 0;
  6851. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  6852. - int lpd_mode_last, prev_frame_was_lpd;
  6853. - USAC_COREMODE core_mode_last;
  6854. - const int lg_table_offset = 0;
  6855. - const int *lg_table = (pAacDecoderChannelInfo->granuleLength == 128)
  6856. - ? &lg_table_ccfl[0][lg_table_offset]
  6857. - : &lg_table_ccfl[1][lg_table_offset];
  6858. - int last_lpc_lost = pAacDecoderStaticChannelInfo->last_lpc_lost;
  6859. -
  6860. - int last_frame_ok = 1;
  6861. -
  6862. - INT i_offset;
  6863. - UINT samplingRate;
  6864. -
  6865. - samplingRate = pSamplingRateInfo->samplingRate;
  6866. -
  6867. - i_offset =
  6868. - (INT)(samplingRate * PIT_MIN_12k8 + (FSCALE_DENOM / 2)) / FSCALE_DENOM -
  6869. - (INT)PIT_MIN_12k8;
  6870. -
  6871. - if ((samplingRate < FAC_FSCALE_MIN) || (samplingRate > FAC_FSCALE_MAX)) {
  6872. - error = AAC_DEC_PARSE_ERROR;
  6873. - goto bail;
  6874. - }
  6875. -
  6876. - acelp_core_mode = FDKreadBits(hBs, 3);
  6877. -
  6878. - /* lpd_mode */
  6879. - error = CLpd_ReadAndMapLpdModeToModArray(mod, hBs, 0);
  6880. - if (error != AAC_DEC_OK) {
  6881. - goto bail;
  6882. - }
  6883. -
  6884. - /* bpf_control_info */
  6885. - pAacDecoderChannelInfo->data.usac.bpf_control_info = FDKreadBit(hBs);
  6886. -
  6887. - /* last_core_mode */
  6888. - prev_frame_was_lpd = FDKreadBit(hBs);
  6889. - /* fac_data_present */
  6890. - fFacDataPresent = FDKreadBit(hBs);
  6891. -
  6892. - /* Set valid values from
  6893. - * pAacDecoderStaticChannelInfo->{last_core_mode,last_lpd_mode} */
  6894. - pAacDecoderChannelInfo->data.usac.core_mode_last =
  6895. - pAacDecoderStaticChannelInfo->last_core_mode;
  6896. - lpd_mode_last = pAacDecoderChannelInfo->data.usac.lpd_mode_last =
  6897. - pAacDecoderStaticChannelInfo->last_lpd_mode;
  6898. -
  6899. - if (prev_frame_was_lpd == 0) {
  6900. - /* Last frame was FD */
  6901. - pAacDecoderChannelInfo->data.usac.core_mode_last = FD_LONG;
  6902. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 255;
  6903. - } else {
  6904. - /* Last frame was LPD */
  6905. - pAacDecoderChannelInfo->data.usac.core_mode_last = LPD;
  6906. - if (((mod[0] == 0) && fFacDataPresent) ||
  6907. - ((mod[0] != 0) && !fFacDataPresent)) {
  6908. - /* Currend mod is ACELP, fac data present -> TCX, current mod TCX, no fac
  6909. - * data -> TCX */
  6910. - if (lpd_mode_last == 0) {
  6911. - /* Bit stream interruption detected. Assume last TCX mode as TCX20. */
  6912. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 1;
  6913. - }
  6914. - /* Else assume that remembered TCX mode is correct. */
  6915. - } else {
  6916. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 0;
  6917. - }
  6918. - }
  6919. -
  6920. - first_lpd_flag = (pAacDecoderChannelInfo->data.usac.core_mode_last !=
  6921. - LPD); /* Depends on bitstream configuration */
  6922. - first_tcx_flag = 1;
  6923. -
  6924. - if (pAacDecoderStaticChannelInfo->last_core_mode !=
  6925. - LPD) { /* ATTENTION: Reset depends on what we rendered before! */
  6926. - CLpd_Reset(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo, 0);
  6927. -
  6928. - if (!last_frame_ok) {
  6929. - /* If last rendered frame was not LPD and first lpd flag is not set, this
  6930. - * must be an error - set last_lpc_lost flag */
  6931. - last_lpc_lost |= (first_lpd_flag) ? 0 : 1;
  6932. - }
  6933. - }
  6934. -
  6935. - core_mode_last = pAacDecoderChannelInfo->data.usac.core_mode_last;
  6936. - lpd_mode_last = pAacDecoderChannelInfo->data.usac.lpd_mode_last;
  6937. -
  6938. - nbDiv = NB_DIV;
  6939. -
  6940. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  6941. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  6942. -
  6943. - k = 0;
  6944. - while (k < nbDiv) {
  6945. - /* Reset FAC data pointers in order to avoid applying old random FAC data.
  6946. - */
  6947. - pAacDecoderChannelInfo->data.usac.fac_data[k] = NULL;
  6948. -
  6949. - if ((k == 0 && core_mode_last == LPD && fFacDataPresent) ||
  6950. - (lpd_mode_last == 0 && mod[k] > 0) ||
  6951. - ((lpd_mode_last != 255) && lpd_mode_last > 0 && mod[k] == 0)) {
  6952. - int err;
  6953. -
  6954. - /* Assign FAC memory */
  6955. - pAacDecoderChannelInfo->data.usac.fac_data[k] =
  6956. - CLpd_FAC_GetMemory(pAacDecoderChannelInfo, mod, &facGetMemState);
  6957. -
  6958. - /* FAC for (ACELP -> TCX) or (TCX -> ACELP) */
  6959. - err = CLpd_FAC_Read(
  6960. - hBs, pAacDecoderChannelInfo->data.usac.fac_data[k],
  6961. - pAacDecoderChannelInfo->data.usac.fac_data_e,
  6962. - pAacDecoderChannelInfo->granuleLength, /* == fac_length */
  6963. - 0, k);
  6964. - if (err != 0) {
  6965. - error = AAC_DEC_PARSE_ERROR;
  6966. - goto bail;
  6967. - }
  6968. - }
  6969. -
  6970. - if (mod[k] == 0) /* acelp-mode */
  6971. - {
  6972. - int err;
  6973. - err = CLpd_AcelpRead(
  6974. - hBs, &pAacDecoderChannelInfo->data.usac.acelp[k], acelp_core_mode,
  6975. - pAacDecoderChannelInfo->granuleLength * 8 /* coreCoderFrameLength */,
  6976. - i_offset);
  6977. - if (err != 0) {
  6978. - error = AAC_DEC_PARSE_ERROR;
  6979. - goto bail;
  6980. - }
  6981. -
  6982. - lpd_mode_last = 0;
  6983. - k++;
  6984. - } else /* mode != 0 => TCX */
  6985. - {
  6986. - error = CLpd_TCX_Read(hBs, pAacDecoderChannelInfo,
  6987. - pAacDecoderStaticChannelInfo, lg_table[mod[k]],
  6988. - first_tcx_flag, k, flags);
  6989. -
  6990. - lpd_mode_last = mod[k];
  6991. - first_tcx_flag = 0;
  6992. - k += 1 << (mod[k] - 1);
  6993. - }
  6994. - if (error != AAC_DEC_OK) {
  6995. - error = AAC_DEC_PARSE_ERROR;
  6996. - goto bail;
  6997. - }
  6998. - }
  6999. -
  7000. - {
  7001. - int err;
  7002. -
  7003. - /* Read LPC coefficients */
  7004. - err = CLpc_Read(
  7005. - hBs, pAacDecoderChannelInfo->data.usac.lsp_coeff,
  7006. - pAacDecoderStaticChannelInfo->lpc4_lsf,
  7007. - pAacDecoderChannelInfo->data.usac.lsf_adaptive_mean_cand,
  7008. - pAacDecoderChannelInfo->data.usac.aStability, mod, first_lpd_flag,
  7009. - /* if last lpc4 is available from concealment do not extrapolate lpc0
  7010. - from lpc2 */
  7011. - (mod[0] & 0x3) ? 0
  7012. - : (last_lpc_lost &&
  7013. - pAacDecoderStaticChannelInfo->last_core_mode != LPD),
  7014. - last_frame_ok);
  7015. - if (err != 0) {
  7016. - error = AAC_DEC_PARSE_ERROR;
  7017. - goto bail;
  7018. - }
  7019. - }
  7020. -
  7021. - /* adjust old lsp[] following to a bad frame (to avoid overshoot) (ref:
  7022. - * dec_LPD.c) */
  7023. - if (last_lpc_lost && !last_frame_ok) {
  7024. - int k_next;
  7025. - k = 0;
  7026. - while (k < nbDiv) {
  7027. - int i;
  7028. - k_next = k + (((mod[k] & 0x3) == 0) ? 1 : (1 << (mod[k] - 1)));
  7029. - FIXP_LPC *lsp_old = pAacDecoderChannelInfo->data.usac.lsp_coeff[k];
  7030. - FIXP_LPC *lsp_new = pAacDecoderChannelInfo->data.usac.lsp_coeff[k_next];
  7031. -
  7032. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  7033. - if (lsp_new[i] < lsp_old[i]) {
  7034. - lsp_old[i] = lsp_new[i];
  7035. - }
  7036. - }
  7037. - k = k_next;
  7038. - }
  7039. - }
  7040. -
  7041. - if (pAacDecoderStaticChannelInfo->last_lpd_mode != 0) {
  7042. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 255) {
  7043. - /* We need it for TCX decoding or ACELP excitation update */
  7044. - E_LPC_f_lsp_a_conversion(
  7045. - pAacDecoderChannelInfo->data.usac.lsp_coeff[0],
  7046. - pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7047. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0]);
  7048. - } else { /* last_lpd_mode was TCX */
  7049. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7050. - * converting LSP coefficients again). */
  7051. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7052. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7053. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7054. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7055. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7056. - }
  7057. - } /* case last_lpd_mode was ACELP is handled by CLpd_TcxDecode() */
  7058. -
  7059. - if (fFacDataPresent && (core_mode_last != LPD)) {
  7060. - int prev_frame_was_short;
  7061. -
  7062. - prev_frame_was_short = FDKreadBit(hBs);
  7063. -
  7064. - if (prev_frame_was_short) {
  7065. - core_mode_last = pAacDecoderChannelInfo->data.usac.core_mode_last =
  7066. - FD_SHORT;
  7067. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 255;
  7068. -
  7069. - if ((pAacDecoderStaticChannelInfo->last_core_mode != FD_SHORT)) {
  7070. - /* USAC Conformance document:
  7071. - short_fac_flag shall be encoded with a value of 1 if the
  7072. - window_sequence of the previous frame was 2 (EIGHT_SHORT_SEQUENCE).
  7073. - Otherwise short_fac_flag shall be encoded with a
  7074. - value of 0. */
  7075. - error = AAC_DEC_PARSE_ERROR;
  7076. - goto bail;
  7077. - }
  7078. - }
  7079. -
  7080. - /* Assign memory */
  7081. - pAacDecoderChannelInfo->data.usac.fac_data[0] =
  7082. - CLpd_FAC_GetMemory(pAacDecoderChannelInfo, mod, &facGetMemState);
  7083. -
  7084. - {
  7085. - int err;
  7086. -
  7087. - /* FAC for FD -> ACELP */
  7088. - err = CLpd_FAC_Read(
  7089. - hBs, pAacDecoderChannelInfo->data.usac.fac_data[0],
  7090. - pAacDecoderChannelInfo->data.usac.fac_data_e,
  7091. - CLpd_FAC_getLength(core_mode_last != FD_SHORT,
  7092. - pAacDecoderChannelInfo->granuleLength),
  7093. - 1, 0);
  7094. - if (err != 0) {
  7095. - error = AAC_DEC_PARSE_ERROR;
  7096. - goto bail;
  7097. - }
  7098. - }
  7099. - }
  7100. -
  7101. -bail:
  7102. - if (error == AAC_DEC_OK) {
  7103. - /* check consitency of last core/lpd mode values */
  7104. - if ((pAacDecoderChannelInfo->data.usac.core_mode_last !=
  7105. - pAacDecoderStaticChannelInfo->last_core_mode) &&
  7106. - (pAacDecoderStaticChannelInfo->last_lpc_lost == 0)) {
  7107. - /* Something got wrong! */
  7108. - /* error = AAC_DEC_PARSE_ERROR; */ /* Throwing errors does not help */
  7109. - } else if ((pAacDecoderChannelInfo->data.usac.core_mode_last == LPD) &&
  7110. - (pAacDecoderChannelInfo->data.usac.lpd_mode_last !=
  7111. - pAacDecoderStaticChannelInfo->last_lpd_mode) &&
  7112. - (pAacDecoderStaticChannelInfo->last_lpc_lost == 0)) {
  7113. - /* Something got wrong! */
  7114. - /* error = AAC_DEC_PARSE_ERROR; */ /* Throwing errors does not help */
  7115. - }
  7116. - }
  7117. -
  7118. - return error;
  7119. -}
  7120. -
  7121. -void CLpdChannelStream_Decode(
  7122. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7123. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags) {
  7124. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  7125. - int k;
  7126. - UCHAR last_lpd_mode;
  7127. - int nbDiv = NB_DIV;
  7128. -
  7129. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7130. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7131. - k = 0;
  7132. - last_lpd_mode =
  7133. - pAacDecoderChannelInfo->data.usac
  7134. - .lpd_mode_last; /* could be different to what has been rendered */
  7135. - while (k < nbDiv) {
  7136. - if (mod[k] == 0) {
  7137. - /* ACELP */
  7138. -
  7139. - /* If FAC (fac_data[k] != NULL), and previous frame was TCX, apply (TCX)
  7140. - * gains to FAC data */
  7141. - if (last_lpd_mode > 0 && last_lpd_mode != 255 &&
  7142. - pAacDecoderChannelInfo->data.usac.fac_data[k]) {
  7143. - CFac_ApplyGains(pAacDecoderChannelInfo->data.usac.fac_data[k],
  7144. - pAacDecoderChannelInfo->granuleLength,
  7145. - pAacDecoderStaticChannelInfo->last_tcx_gain,
  7146. - pAacDecoderStaticChannelInfo->last_alfd_gains,
  7147. - (last_lpd_mode < 4) ? last_lpd_mode : 3);
  7148. -
  7149. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] +=
  7150. - pAacDecoderStaticChannelInfo->last_tcx_gain_e;
  7151. - }
  7152. - } else {
  7153. - /* TCX */
  7154. - CLpd_TcxDecode(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  7155. - flags, mod[k], last_lpd_mode, k, 1 /* frameOk == 1 */
  7156. - );
  7157. -
  7158. - /* Store TCX gain scale for next possible FAC transition. */
  7159. - pAacDecoderStaticChannelInfo->last_tcx_gain =
  7160. - pAacDecoderChannelInfo->data.usac.tcx_gain[k];
  7161. - pAacDecoderStaticChannelInfo->last_tcx_gain_e =
  7162. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k];
  7163. -
  7164. - /* If FAC (fac_data[k] != NULL), apply gains */
  7165. - if (last_lpd_mode == 0 && pAacDecoderChannelInfo->data.usac.fac_data[k]) {
  7166. - CFac_ApplyGains(
  7167. - pAacDecoderChannelInfo->data.usac.fac_data[k],
  7168. - pAacDecoderChannelInfo->granuleLength /* == fac_length */,
  7169. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7170. - pAacDecoderStaticChannelInfo->last_alfd_gains, mod[k]);
  7171. -
  7172. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] +=
  7173. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k];
  7174. - }
  7175. - }
  7176. -
  7177. - /* remember previous mode */
  7178. - last_lpd_mode = mod[k];
  7179. -
  7180. - /* Increase k to next frame */
  7181. - k += (mod[k] == 0) ? 1 : (1 << (mod[k] - 1));
  7182. - }
  7183. -}
  7184. -
  7185. -AAC_DECODER_ERROR CLpd_RenderTimeSignal(
  7186. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7187. - CAacDecoderChannelInfo *pAacDecoderChannelInfo, FIXP_PCM *pTimeData,
  7188. - INT lFrame, SamplingRateInfo *pSamplingRateInfo, UINT frameOk, UINT flags,
  7189. - UINT strmFlags) {
  7190. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  7191. - AAC_DECODER_ERROR error = AAC_DEC_OK;
  7192. - int k, i_offset;
  7193. - int last_k;
  7194. - int nrSamples = 0;
  7195. - int facFB = 1;
  7196. - int nbDiv = NB_DIV;
  7197. - int lDiv = lFrame / nbDiv; /* length of division (acelp or tcx20 frame)*/
  7198. - int lFac = lDiv / 2;
  7199. - int nbSubfr =
  7200. - lFrame / (nbDiv * L_SUBFR); /* number of subframes per division */
  7201. - int nbSubfrSuperfr = nbDiv * nbSubfr;
  7202. - int synSfd = (nbSubfrSuperfr / 2) - BPF_SFD;
  7203. - int SynDelay = synSfd * L_SUBFR;
  7204. - int aacDelay = lFrame / 2;
  7205. -
  7206. - /*
  7207. - In respect to the reference software, the synth pointer here is lagging by
  7208. - aacDelay ( == SYN_DELAY + BPF_DELAY ) samples. The corresponding old
  7209. - synthesis samples are handled by the IMDCT overlap.
  7210. - */
  7211. -
  7212. - FIXP_DBL *synth_buf =
  7213. - pAacDecoderChannelInfo->pComStaticData->pWorkBufferCore1->synth_buf;
  7214. - FIXP_DBL *synth = synth_buf + PIT_MAX_MAX - BPF_DELAY;
  7215. - UCHAR last_lpd_mode, last_last_lpd_mode, last_lpc_lost, last_frame_lost;
  7216. -
  7217. - INT pitch[NB_SUBFR_SUPERFR + SYN_SFD];
  7218. - FIXP_DBL pit_gain[NB_SUBFR_SUPERFR + SYN_SFD];
  7219. -
  7220. - const int *lg_table;
  7221. - int lg_table_offset = 0;
  7222. -
  7223. - UINT samplingRate = pSamplingRateInfo->samplingRate;
  7224. -
  7225. - FDKmemclear(pitch, (NB_SUBFR_SUPERFR + SYN_SFD) * sizeof(INT));
  7226. -
  7227. - if (flags & AACDEC_FLUSH) {
  7228. - CLpd_Reset(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  7229. - flags & AACDEC_FLUSH);
  7230. - frameOk = 0;
  7231. - }
  7232. -
  7233. - switch (lFrame) {
  7234. - case 1024:
  7235. - lg_table = &lg_table_ccfl[0][lg_table_offset];
  7236. - break;
  7237. - case 768:
  7238. - lg_table = &lg_table_ccfl[1][lg_table_offset];
  7239. - break;
  7240. - default:
  7241. - FDK_ASSERT(0);
  7242. - return AAC_DEC_UNKNOWN;
  7243. - }
  7244. -
  7245. - last_frame_lost = 0;
  7246. -
  7247. - /* Maintain LPD mode from previous frame */
  7248. - if ((pAacDecoderStaticChannelInfo->last_core_mode == FD_LONG) ||
  7249. - (pAacDecoderStaticChannelInfo->last_core_mode == FD_SHORT)) {
  7250. - pAacDecoderStaticChannelInfo->last_lpd_mode = 255;
  7251. - }
  7252. -
  7253. - if (!frameOk) {
  7254. - FIXP_DBL old_tcx_gain;
  7255. - FIXP_SGL old_stab;
  7256. - SCHAR old_tcx_gain_e;
  7257. - int nLostSf;
  7258. -
  7259. - last_lpd_mode = pAacDecoderStaticChannelInfo->last_lpd_mode;
  7260. - old_tcx_gain = pAacDecoderStaticChannelInfo->last_tcx_gain;
  7261. - old_tcx_gain_e = pAacDecoderStaticChannelInfo->last_tcx_gain_e;
  7262. - old_stab = pAacDecoderStaticChannelInfo->oldStability;
  7263. - nLostSf = pAacDecoderStaticChannelInfo->numLostLpdFrames;
  7264. -
  7265. - /* patch the last LPD mode */
  7266. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = last_lpd_mode;
  7267. -
  7268. - /* Do mode extrapolation and repeat the previous mode:
  7269. - if previous mode = ACELP -> ACELP
  7270. - if previous mode = TCX-20/40 -> TCX-20
  7271. - if previous mode = TCX-80 -> TCX-80
  7272. - notes:
  7273. - - ACELP is not allowed after TCX (no pitch information to reuse)
  7274. - - TCX-40 is not allowed in the mode repetition to keep the logic simple
  7275. - */
  7276. - switch (last_lpd_mode) {
  7277. - case 0:
  7278. - mod[0] = mod[1] = mod[2] = mod[3] = 0; /* -> ACELP concealment */
  7279. - break;
  7280. - case 3:
  7281. - mod[0] = mod[1] = mod[2] = mod[3] = 3; /* -> TCX FD concealment */
  7282. - break;
  7283. - case 2:
  7284. - mod[0] = mod[1] = mod[2] = mod[3] = 2; /* -> TCX FD concealment */
  7285. - break;
  7286. - case 1:
  7287. - default:
  7288. - mod[0] = mod[1] = mod[2] = mod[3] = 4; /* -> TCX TD concealment */
  7289. - break;
  7290. - }
  7291. -
  7292. - /* LPC extrapolation */
  7293. - CLpc_Conceal(pAacDecoderChannelInfo->data.usac.lsp_coeff,
  7294. - pAacDecoderStaticChannelInfo->lpc4_lsf,
  7295. - pAacDecoderStaticChannelInfo->lsf_adaptive_mean,
  7296. - /*(pAacDecoderStaticChannelInfo->numLostLpdFrames == 0) ||*/
  7297. - (last_lpd_mode == 255));
  7298. -
  7299. - if ((last_lpd_mode > 0) && (last_lpd_mode < 255)) {
  7300. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7301. - * converting LSP coefficients again). */
  7302. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7303. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7304. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7305. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7306. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7307. - } /* case last_lpd_mode was ACELP is handled by CLpd_TcxDecode() */
  7308. - /* case last_lpd_mode was Time domain TCX concealment is handled after this
  7309. - * "if (!frameOk)"-block */
  7310. -
  7311. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7312. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7313. - k = 0;
  7314. - while (k < nbDiv) {
  7315. - pAacDecoderChannelInfo->data.usac.tcx_gain[k] = old_tcx_gain;
  7316. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k] = old_tcx_gain_e;
  7317. -
  7318. - /* restore stability value from last frame */
  7319. - pAacDecoderChannelInfo->data.usac.aStability[k] = old_stab;
  7320. -
  7321. - /* Increase k to next frame */
  7322. - k += ((mod[k] & 0x3) == 0) ? 1 : (1 << ((mod[k] & 0x3) - 1));
  7323. -
  7324. - nLostSf++;
  7325. - }
  7326. - } else {
  7327. - if ((pAacDecoderStaticChannelInfo->last_lpd_mode == 4) && (mod[0] > 0)) {
  7328. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7329. - * converting LSP coefficients again). */
  7330. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7331. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7332. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7333. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7334. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7335. - }
  7336. - }
  7337. -
  7338. - Acelp_PreProcessing(synth_buf, pAacDecoderStaticChannelInfo->old_synth, pitch,
  7339. - pAacDecoderStaticChannelInfo->old_T_pf, pit_gain,
  7340. - pAacDecoderStaticChannelInfo->old_gain_pf, samplingRate,
  7341. - &i_offset, lFrame, synSfd, nbSubfrSuperfr);
  7342. -
  7343. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7344. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7345. - k = 0;
  7346. - last_k = -1; /* mark invalid */
  7347. - last_lpd_mode = pAacDecoderStaticChannelInfo->last_lpd_mode;
  7348. - last_last_lpd_mode = pAacDecoderStaticChannelInfo->last_last_lpd_mode;
  7349. - last_lpc_lost = pAacDecoderStaticChannelInfo->last_lpc_lost | last_frame_lost;
  7350. -
  7351. - /* This buffer must be avalable for the case of FD->ACELP transition. The
  7352. - beginning of the buffer is used after the BPF to overwrite the output signal.
  7353. - Only the FAC area must be affected by the BPF */
  7354. -
  7355. - while (k < nbDiv) {
  7356. - if (frameOk == 0) {
  7357. - pAacDecoderStaticChannelInfo->numLostLpdFrames++;
  7358. - } else {
  7359. - last_frame_lost |=
  7360. - (pAacDecoderStaticChannelInfo->numLostLpdFrames > 0) ? 1 : 0;
  7361. - pAacDecoderStaticChannelInfo->numLostLpdFrames = 0;
  7362. - }
  7363. - if (mod[k] == 0 || mod[k] == 4) {
  7364. - /* ACELP or TCX time domain concealment */
  7365. - FIXP_DBL *acelp_out;
  7366. -
  7367. - /* FAC management */
  7368. - if ((last_lpd_mode != 0) && (last_lpd_mode != 4)) /* TCX TD concealment */
  7369. - {
  7370. - FIXP_DBL *pFacData = NULL;
  7371. -
  7372. - if (frameOk && !last_frame_lost) {
  7373. - pFacData = pAacDecoderChannelInfo->data.usac.fac_data[k];
  7374. - }
  7375. -
  7376. - nrSamples += CLpd_FAC_Mdct2Acelp(
  7377. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples, pFacData,
  7378. - pAacDecoderChannelInfo->data.usac.fac_data_e[k],
  7379. - pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7380. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k],
  7381. - lFrame - nrSamples,
  7382. - CLpd_FAC_getLength(
  7383. - (pAacDecoderStaticChannelInfo->last_core_mode != FD_SHORT) ||
  7384. - (k > 0),
  7385. - lFac),
  7386. - (pAacDecoderStaticChannelInfo->last_core_mode != LPD) && (k == 0),
  7387. - 0);
  7388. -
  7389. - FDKmemcpy(
  7390. - synth + nrSamples, pAacDecoderStaticChannelInfo->IMdct.overlap.time,
  7391. - pAacDecoderStaticChannelInfo->IMdct.ov_offset * sizeof(FIXP_DBL));
  7392. - {
  7393. - FIXP_LPC *lp_prev =
  7394. - pAacDecoderChannelInfo->data.usac
  7395. - .lp_coeff[0]; /* init value does not real matter */
  7396. - INT lp_prev_exp = pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0];
  7397. -
  7398. - if (last_lpd_mode != 255) { /* last mode was tcx */
  7399. - last_k = k - (1 << (last_lpd_mode - 1));
  7400. - if (last_k < 0) {
  7401. - lp_prev = pAacDecoderStaticChannelInfo->lp_coeff_old[1];
  7402. - lp_prev_exp = pAacDecoderStaticChannelInfo->lp_coeff_old_exp[1];
  7403. - } else {
  7404. - lp_prev = pAacDecoderChannelInfo->data.usac.lp_coeff[last_k];
  7405. - lp_prev_exp =
  7406. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[last_k];
  7407. - }
  7408. - }
  7409. -
  7410. - CLpd_AcelpPrepareInternalMem(
  7411. - synth + aacDelay + k * lDiv, last_lpd_mode,
  7412. - (last_last_lpd_mode == 4) ? 0 : last_last_lpd_mode,
  7413. - pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7414. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k], lp_prev,
  7415. - lp_prev_exp, &pAacDecoderStaticChannelInfo->acelp, lFrame,
  7416. - (last_frame_lost && k < 2), mod[k]);
  7417. - }
  7418. - } else {
  7419. - if (k == 0 && pAacDecoderStaticChannelInfo->IMdct.ov_offset !=
  7420. - lFrame / facFB / 2) {
  7421. - pAacDecoderStaticChannelInfo->IMdct.ov_offset = lFrame / facFB / 2;
  7422. - }
  7423. - nrSamples += imdct_drain(&pAacDecoderStaticChannelInfo->IMdct,
  7424. - synth + nrSamples, lFrame / facFB - nrSamples);
  7425. - }
  7426. -
  7427. - if (nrSamples >= lFrame / facFB) {
  7428. - /* Write ACELP time domain samples into IMDCT overlap buffer at
  7429. - * pAacDecoderStaticChannelInfo->IMdct.overlap.time +
  7430. - * pAacDecoderStaticChannelInfo->IMdct.ov_offset
  7431. - */
  7432. - acelp_out = pAacDecoderStaticChannelInfo->IMdct.overlap.time +
  7433. - pAacDecoderStaticChannelInfo->IMdct.ov_offset;
  7434. -
  7435. - /* Account ACELP time domain output samples to overlap buffer */
  7436. - pAacDecoderStaticChannelInfo->IMdct.ov_offset += lDiv;
  7437. - } else {
  7438. - /* Write ACELP time domain samples into output buffer at pTimeData +
  7439. - * nrSamples */
  7440. - acelp_out = synth + nrSamples;
  7441. -
  7442. - /* Account ACELP time domain output samples to output buffer */
  7443. - nrSamples += lDiv;
  7444. - }
  7445. -
  7446. - if (mod[k] == 4) {
  7447. - pAacDecoderStaticChannelInfo->acelp.wsyn_rms = scaleValue(
  7448. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7449. - fixMin(0,
  7450. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k] - SF_EXC));
  7451. - CLpd_TcxTDConceal(&pAacDecoderStaticChannelInfo->acelp,
  7452. - &pAacDecoderStaticChannelInfo->last_tcx_pitch,
  7453. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k],
  7454. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k + 1],
  7455. - pAacDecoderChannelInfo->data.usac.aStability[k],
  7456. - pAacDecoderStaticChannelInfo->numLostLpdFrames,
  7457. - acelp_out, lFrame,
  7458. - pAacDecoderStaticChannelInfo->last_tcx_noise_factor);
  7459. -
  7460. - } else {
  7461. - FDK_ASSERT(pAacDecoderChannelInfo->data.usac.aStability[k] >=
  7462. - (FIXP_SGL)0);
  7463. - CLpd_AcelpDecode(&pAacDecoderStaticChannelInfo->acelp, i_offset,
  7464. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k],
  7465. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k + 1],
  7466. - pAacDecoderChannelInfo->data.usac.aStability[k],
  7467. - &pAacDecoderChannelInfo->data.usac.acelp[k],
  7468. - pAacDecoderStaticChannelInfo->numLostLpdFrames,
  7469. - last_lpc_lost, k, acelp_out,
  7470. - &pitch[(k * nbSubfr) + synSfd],
  7471. - &pit_gain[(k * nbSubfr) + synSfd], lFrame);
  7472. - }
  7473. -
  7474. - if (mod[k] != 4) {
  7475. - if (last_lpd_mode != 0 &&
  7476. - pAacDecoderChannelInfo->data.usac
  7477. - .bpf_control_info) { /* FD/TCX -> ACELP transition */
  7478. - /* bass post-filter past FAC area (past two (one for FD short)
  7479. - * subframes) */
  7480. - int currentSf = synSfd + k * nbSubfr;
  7481. -
  7482. - if ((k > 0) || (pAacDecoderStaticChannelInfo->last_core_mode !=
  7483. - FD_SHORT)) { /* TCX or FD long -> ACELP */
  7484. - pitch[currentSf - 2] = pitch[currentSf - 1] = pitch[currentSf];
  7485. - pit_gain[currentSf - 2] = pit_gain[currentSf - 1] =
  7486. - pit_gain[currentSf];
  7487. - } else { /* FD short -> ACELP */
  7488. - pitch[currentSf - 1] = pitch[currentSf];
  7489. - pit_gain[currentSf - 1] = pit_gain[currentSf];
  7490. - }
  7491. - }
  7492. - }
  7493. - } else { /* TCX */
  7494. - int lg = lg_table[mod[k]];
  7495. - int isFullBandLpd = 0;
  7496. -
  7497. - /* FAC management */
  7498. - if ((last_lpd_mode == 0) || (last_lpd_mode == 4)) /* TCX TD concealment */
  7499. - {
  7500. - C_AALLOC_SCRATCH_START(fac_buf, FIXP_DBL, 1024 / 8);
  7501. -
  7502. - /* pAacDecoderChannelInfo->data.usac.fac_data[k] == NULL means no FAC
  7503. - * data available. */
  7504. - if (last_frame_lost == 1 ||
  7505. - pAacDecoderChannelInfo->data.usac.fac_data[k] == NULL) {
  7506. - FDKmemclear(fac_buf, 1024 / 8 * sizeof(FIXP_DBL));
  7507. - pAacDecoderChannelInfo->data.usac.fac_data[k] = fac_buf;
  7508. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] = 0;
  7509. - }
  7510. -
  7511. - nrSamples += CLpd_FAC_Acelp2Mdct(
  7512. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples,
  7513. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, k,
  7514. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  7515. - pAacDecoderChannelInfo->specScale + k, 1,
  7516. - pAacDecoderChannelInfo->data.usac.fac_data[k],
  7517. - pAacDecoderChannelInfo->data.usac.fac_data_e[k],
  7518. - pAacDecoderChannelInfo->granuleLength /* == fac_length */,
  7519. - lFrame - nrSamples, lg,
  7520. - FDKgetWindowSlope(lDiv,
  7521. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7522. - lDiv, pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7523. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k],
  7524. - &pAacDecoderStaticChannelInfo->acelp,
  7525. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7526. - (last_frame_lost || !frameOk), 0 /* is not FD FAC */
  7527. - ,
  7528. - last_lpd_mode, k,
  7529. - pAacDecoderChannelInfo
  7530. - ->currAliasingSymmetry /* Note: The current aliasing
  7531. - symmetry for a TCX (i.e. LPD)
  7532. - frame must always be 0 */
  7533. - );
  7534. -
  7535. - pitch[(k * nbSubfr) + synSfd + 1] = pitch[(k * nbSubfr) + synSfd] =
  7536. - pitch[(k * nbSubfr) + synSfd - 1];
  7537. - pit_gain[(k * nbSubfr) + synSfd + 1] =
  7538. - pit_gain[(k * nbSubfr) + synSfd] =
  7539. - pit_gain[(k * nbSubfr) + synSfd - 1];
  7540. -
  7541. - C_AALLOC_SCRATCH_END(fac_buf, FIXP_DBL, 1024 / 8);
  7542. - } else {
  7543. - int tl = lg;
  7544. - int fl = lDiv;
  7545. - int fr = lDiv;
  7546. -
  7547. - nrSamples += imlt_block(
  7548. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples,
  7549. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, k,
  7550. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  7551. - pAacDecoderChannelInfo->specScale + k, 1, lFrame - nrSamples, tl,
  7552. - FDKgetWindowSlope(fl,
  7553. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7554. - fl,
  7555. - FDKgetWindowSlope(fr,
  7556. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7557. - fr, pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7558. - pAacDecoderChannelInfo->currAliasingSymmetry
  7559. - ? MLT_FLAG_CURR_ALIAS_SYMMETRY
  7560. - : 0);
  7561. - }
  7562. - }
  7563. - /* remember previous mode */
  7564. - last_last_lpd_mode = last_lpd_mode;
  7565. - last_lpd_mode = mod[k];
  7566. - last_lpc_lost = (frameOk == 0) ? 1 : 0;
  7567. -
  7568. - /* Increase k to next frame */
  7569. - last_k = k;
  7570. - k += ((mod[k] & 0x3) == 0) ? 1 : (1 << (mod[k] - 1));
  7571. - }
  7572. -
  7573. - if (frameOk) {
  7574. - /* assume data was ok => store for concealment */
  7575. - FDK_ASSERT(pAacDecoderChannelInfo->data.usac.aStability[last_k] >=
  7576. - (FIXP_SGL)0);
  7577. - pAacDecoderStaticChannelInfo->oldStability =
  7578. - pAacDecoderChannelInfo->data.usac.aStability[last_k];
  7579. - FDKmemcpy(pAacDecoderStaticChannelInfo->lsf_adaptive_mean,
  7580. - pAacDecoderChannelInfo->data.usac.lsf_adaptive_mean_cand,
  7581. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7582. - }
  7583. -
  7584. - /* store past lp coeffs for next superframe (they are only valid and needed if
  7585. - * last_lpd_mode was tcx) */
  7586. - if (last_lpd_mode > 0) {
  7587. - FDKmemcpy(pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7588. - pAacDecoderChannelInfo->data.usac.lp_coeff[nbDiv],
  7589. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7590. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0] =
  7591. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[nbDiv];
  7592. - FDKmemcpy(pAacDecoderStaticChannelInfo->lp_coeff_old[1],
  7593. - pAacDecoderChannelInfo->data.usac.lp_coeff[last_k],
  7594. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7595. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[1] =
  7596. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[last_k];
  7597. - }
  7598. -
  7599. - FDK_ASSERT(nrSamples == lFrame);
  7600. -
  7601. - /* check whether usage of bass postfilter was de-activated in the bitstream;
  7602. - if yes, set pitch gain to 0 */
  7603. - if (!(pAacDecoderChannelInfo->data.usac.bpf_control_info)) {
  7604. - if (mod[0] != 0 && (pAacDecoderStaticChannelInfo->old_bpf_control_info)) {
  7605. - for (int i = 2; i < nbSubfrSuperfr; i++)
  7606. - pit_gain[synSfd + i] = (FIXP_DBL)0;
  7607. - } else {
  7608. - for (int i = 0; i < nbSubfrSuperfr; i++)
  7609. - pit_gain[synSfd + i] = (FIXP_DBL)0;
  7610. - }
  7611. - }
  7612. -
  7613. - /* for bass postfilter */
  7614. - for (int n = 0; n < synSfd; n++) {
  7615. - pAacDecoderStaticChannelInfo->old_T_pf[n] = pitch[nbSubfrSuperfr + n];
  7616. - pAacDecoderStaticChannelInfo->old_gain_pf[n] = pit_gain[nbSubfrSuperfr + n];
  7617. - }
  7618. -
  7619. - pAacDecoderStaticChannelInfo->old_bpf_control_info =
  7620. - pAacDecoderChannelInfo->data.usac.bpf_control_info;
  7621. -
  7622. - {
  7623. - INT lookahead = -BPF_DELAY;
  7624. - int copySamp = (mod[nbDiv - 1] == 0) ? (aacDelay) : (aacDelay - lFac);
  7625. -
  7626. - /* Copy enough time domain samples from MDCT to synthesis buffer as needed
  7627. - * by the bass postfilter */
  7628. -
  7629. - lookahead += imdct_copy_ov_and_nr(&pAacDecoderStaticChannelInfo->IMdct,
  7630. - synth + nrSamples, copySamp);
  7631. -
  7632. - FDK_ASSERT(lookahead == copySamp - BPF_DELAY);
  7633. -
  7634. - FIXP_DBL *p2_synth = synth + BPF_DELAY;
  7635. -
  7636. - /* recalculate pitch gain to allow postfilering on FAC area */
  7637. - for (int i = 0; i < nbSubfrSuperfr; i++) {
  7638. - int T = pitch[i];
  7639. - FIXP_DBL gain = pit_gain[i];
  7640. -
  7641. - if (gain > (FIXP_DBL)0) {
  7642. - gain = get_gain(&p2_synth[i * L_SUBFR], &p2_synth[(i * L_SUBFR) - T],
  7643. - L_SUBFR);
  7644. - pit_gain[i] = gain;
  7645. - }
  7646. - }
  7647. -
  7648. - {
  7649. - bass_pf_1sf_delay(p2_synth, pitch, pit_gain, lFrame, lFrame / facFB,
  7650. - mod[nbDiv - 1] ? (SynDelay - (lDiv / 2)) : SynDelay,
  7651. - pTimeData, pAacDecoderStaticChannelInfo->mem_bpf);
  7652. - }
  7653. - }
  7654. -
  7655. - Acelp_PostProcessing(synth_buf, pAacDecoderStaticChannelInfo->old_synth,
  7656. - pitch, pAacDecoderStaticChannelInfo->old_T_pf, lFrame,
  7657. - synSfd, nbSubfrSuperfr);
  7658. -
  7659. - /* Store last mode for next super frame */
  7660. - { pAacDecoderStaticChannelInfo->last_core_mode = LPD; }
  7661. - pAacDecoderStaticChannelInfo->last_lpd_mode = last_lpd_mode;
  7662. - pAacDecoderStaticChannelInfo->last_last_lpd_mode = last_last_lpd_mode;
  7663. - pAacDecoderStaticChannelInfo->last_lpc_lost = last_lpc_lost;
  7664. -
  7665. - return error;
  7666. -}
  7667. diff --git a/libAACdec/src/usacdec_lpd.h b/libAACdec/src/usacdec_lpd.h
  7668. deleted file mode 100644
  7669. index 3e7938d..0000000
  7670. --- a/libAACdec/src/usacdec_lpd.h
  7671. +++ /dev/null
  7672. @@ -1,198 +0,0 @@
  7673. -/* -----------------------------------------------------------------------------
  7674. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  7675. -
  7676. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  7677. -Forschung e.V. All rights reserved.
  7678. -
  7679. - 1. INTRODUCTION
  7680. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  7681. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  7682. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  7683. -a wide variety of Android devices.
  7684. -
  7685. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  7686. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  7687. -full-bandwidth communications codec by independent studies and is widely
  7688. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  7689. -specifications.
  7690. -
  7691. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  7692. -those of Fraunhofer) may be obtained through Via Licensing
  7693. -(www.vialicensing.com) or through the respective patent owners individually for
  7694. -the purpose of encoding or decoding bit streams in products that are compliant
  7695. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  7696. -Android devices already license these patent claims through Via Licensing or
  7697. -directly from the patent owners, and therefore FDK AAC Codec software may
  7698. -already be covered under those patent licenses when it is used for those
  7699. -licensed purposes only.
  7700. -
  7701. -Commercially-licensed AAC software libraries, including floating-point versions
  7702. -with enhanced sound quality, are also available from Fraunhofer. Users are
  7703. -encouraged to check the Fraunhofer website for additional applications
  7704. -information and documentation.
  7705. -
  7706. -2. COPYRIGHT LICENSE
  7707. -
  7708. -Redistribution and use in source and binary forms, with or without modification,
  7709. -are permitted without payment of copyright license fees provided that you
  7710. -satisfy the following conditions:
  7711. -
  7712. -You must retain the complete text of this software license in redistributions of
  7713. -the FDK AAC Codec or your modifications thereto in source code form.
  7714. -
  7715. -You must retain the complete text of this software license in the documentation
  7716. -and/or other materials provided with redistributions of the FDK AAC Codec or
  7717. -your modifications thereto in binary form. You must make available free of
  7718. -charge copies of the complete source code of the FDK AAC Codec and your
  7719. -modifications thereto to recipients of copies in binary form.
  7720. -
  7721. -The name of Fraunhofer may not be used to endorse or promote products derived
  7722. -from this library without prior written permission.
  7723. -
  7724. -You may not charge copyright license fees for anyone to use, copy or distribute
  7725. -the FDK AAC Codec software or your modifications thereto.
  7726. -
  7727. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  7728. -that you changed the software and the date of any change. For modified versions
  7729. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  7730. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  7731. -AAC Codec Library for Android."
  7732. -
  7733. -3. NO PATENT LICENSE
  7734. -
  7735. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  7736. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  7737. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  7738. -software.
  7739. -
  7740. -You may use this FDK AAC Codec software or modifications thereto only for
  7741. -purposes that are authorized by appropriate patent licenses.
  7742. -
  7743. -4. DISCLAIMER
  7744. -
  7745. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  7746. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  7747. -including but not limited to the implied warranties of merchantability and
  7748. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  7749. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  7750. -or consequential damages, including but not limited to procurement of substitute
  7751. -goods or services; loss of use, data, or profits, or business interruption,
  7752. -however caused and on any theory of liability, whether in contract, strict
  7753. -liability, or tort (including negligence), arising in any way out of the use of
  7754. -this software, even if advised of the possibility of such damage.
  7755. -
  7756. -5. CONTACT INFORMATION
  7757. -
  7758. -Fraunhofer Institute for Integrated Circuits IIS
  7759. -Attention: Audio and Multimedia Departments - FDK AAC LL
  7760. -Am Wolfsmantel 33
  7761. -91058 Erlangen, Germany
  7762. -
  7763. -www.iis.fraunhofer.de/amm
  7764. -amm-info@iis.fraunhofer.de
  7765. ------------------------------------------------------------------------------ */
  7766. -
  7767. -/**************************** AAC decoder library ******************************
  7768. -
  7769. - Author(s): Manuel Jander
  7770. -
  7771. - Description: USAC Linear Prediction Domain coding
  7772. -
  7773. -*******************************************************************************/
  7774. -
  7775. -#ifndef USACDEC_LPD_H
  7776. -#define USACDEC_LPD_H
  7777. -
  7778. -#include "channelinfo.h"
  7779. -
  7780. -#define OPTIMIZE_AVG_PERFORMANCE
  7781. -
  7782. -/**
  7783. - * \brief read a lpd_channel_stream.
  7784. - * \param hBs a bit stream handle, where the lpd_channel_stream is located.
  7785. - * \param pAacDecoderChannelInfo the channel context structure for storing read
  7786. - * data.
  7787. - * \param flags bit stream syntax flags.
  7788. - * \return AAC_DECODER_ERROR error code.
  7789. - */
  7790. -AAC_DECODER_ERROR CLpdChannelStream_Read(
  7791. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7792. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7793. - const SamplingRateInfo *pSamplingRateInfo, UINT flags);
  7794. -
  7795. -/**
  7796. - * \brief decode one lpd_channel_stream and render the audio output.
  7797. - * \param pAacDecoderChannelInfo struct holding the channel information to be
  7798. - * rendered.
  7799. - * \param pAacDecoderStaticChannelInfo struct holding the persistent channel
  7800. - * information to be rendered.
  7801. - * \param pSamplingRateInfo holds the sampling rate information
  7802. - * \param elFlags holds the internal decoder flags
  7803. - */
  7804. -void CLpdChannelStream_Decode(
  7805. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7806. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags);
  7807. -
  7808. -/**
  7809. - * \brief generate time domain output signal for LPD channel streams
  7810. - * \param pAacDecoderStaticChannelInfo
  7811. - * \param pAacDecoderChannelInfo
  7812. - * \param pTimeData pointer to output buffer
  7813. - * \param samplesPerFrame amount of output samples
  7814. - * \param pSamplingRateInfo holds the sampling rate information
  7815. - * \param pWorkBuffer1 pointer to work buffer for temporal data
  7816. - */
  7817. -AAC_DECODER_ERROR CLpd_RenderTimeSignal(
  7818. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7819. - CAacDecoderChannelInfo *pAacDecoderChannelInfo, FIXP_PCM *pTimeData,
  7820. - INT samplesPerFrame, SamplingRateInfo *pSamplingRateInfo, UINT frameOk,
  7821. - UINT flags, UINT strmFlags);
  7822. -
  7823. -static inline INT CLpd_FAC_getLength(int fNotShortBlock, int fac_length_long) {
  7824. - if (fNotShortBlock) {
  7825. - return (fac_length_long);
  7826. - } else {
  7827. - return fac_length_long / 2;
  7828. - }
  7829. -}
  7830. -
  7831. -void filtLP(const FIXP_DBL *syn, FIXP_PCM *syn_out, FIXP_DBL *noise,
  7832. - const FIXP_SGL *filt, INT stop, int len);
  7833. -
  7834. -/**
  7835. - * \brief perform a low-frequency pitch enhancement on time domain signal
  7836. - * \param[in] syn pointer to time domain input signal
  7837. - * \param[in] synFB pointer to time domain input signal
  7838. - * \param[in] upsampling factor
  7839. - * \param[in] T_sf array with past decoded pitch period values for each subframe
  7840. - * \param[in] non_zero_gain_flags indicates whether pitch gains of past
  7841. - * subframes are zero or not, msb -> [1 BPF_DELAY subfr][7 SYN_DELAY subfr][16
  7842. - * new subfr] <- lsb
  7843. - * \param[in] l_frame length of filtering, must be multiple of L_SUBFR
  7844. - * \param[in] l_next length of allowed look ahead on syn[i], i < l_frame+l_next
  7845. - * \param[out] synth_out pointer to time domain output signal
  7846. - * \param[in,out] mem_bpf pointer to filter memory (L_FILT+L_SUBFR)
  7847. - */
  7848. -
  7849. -void bass_pf_1sf_delay(FIXP_DBL syn[], const INT T_sf[], FIXP_DBL *pit_gain,
  7850. - const int frame_length, const INT l_frame,
  7851. - const INT l_next, FIXP_PCM *synth_out,
  7852. - FIXP_DBL mem_bpf[]);
  7853. -
  7854. -/**
  7855. - * \brief random sign generator for FD and TCX noise filling
  7856. - * \param[in,out] seed pointer to random seed
  7857. - * \return if return value is zero use positive sign
  7858. - * \Note: This code is also implemented as a copy in block.cpp, grep for
  7859. - * "UsacRandomSign"
  7860. - */
  7861. -FDK_INLINE
  7862. -int UsacRandomSign(ULONG *seed) {
  7863. - *seed = (ULONG)((UINT64)(*seed) * 69069 + 5);
  7864. -
  7865. - return (int)((*seed) & 0x10000);
  7866. -}
  7867. -
  7868. -void CFdp_Reset(CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo);
  7869. -
  7870. -#endif /* USACDEC_LPD_H */
  7871. diff --git a/libAACdec/src/usacdec_rom.cpp b/libAACdec/src/usacdec_rom.cpp
  7872. deleted file mode 100644
  7873. index ca3009e..0000000
  7874. --- a/libAACdec/src/usacdec_rom.cpp
  7875. +++ /dev/null
  7876. @@ -1,1504 +0,0 @@
  7877. -/* -----------------------------------------------------------------------------
  7878. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  7879. -
  7880. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  7881. -Forschung e.V. All rights reserved.
  7882. -
  7883. - 1. INTRODUCTION
  7884. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  7885. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  7886. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  7887. -a wide variety of Android devices.
  7888. -
  7889. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  7890. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  7891. -full-bandwidth communications codec by independent studies and is widely
  7892. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  7893. -specifications.
  7894. -
  7895. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  7896. -those of Fraunhofer) may be obtained through Via Licensing
  7897. -(www.vialicensing.com) or through the respective patent owners individually for
  7898. -the purpose of encoding or decoding bit streams in products that are compliant
  7899. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  7900. -Android devices already license these patent claims through Via Licensing or
  7901. -directly from the patent owners, and therefore FDK AAC Codec software may
  7902. -already be covered under those patent licenses when it is used for those
  7903. -licensed purposes only.
  7904. -
  7905. -Commercially-licensed AAC software libraries, including floating-point versions
  7906. -with enhanced sound quality, are also available from Fraunhofer. Users are
  7907. -encouraged to check the Fraunhofer website for additional applications
  7908. -information and documentation.
  7909. -
  7910. -2. COPYRIGHT LICENSE
  7911. -
  7912. -Redistribution and use in source and binary forms, with or without modification,
  7913. -are permitted without payment of copyright license fees provided that you
  7914. -satisfy the following conditions:
  7915. -
  7916. -You must retain the complete text of this software license in redistributions of
  7917. -the FDK AAC Codec or your modifications thereto in source code form.
  7918. -
  7919. -You must retain the complete text of this software license in the documentation
  7920. -and/or other materials provided with redistributions of the FDK AAC Codec or
  7921. -your modifications thereto in binary form. You must make available free of
  7922. -charge copies of the complete source code of the FDK AAC Codec and your
  7923. -modifications thereto to recipients of copies in binary form.
  7924. -
  7925. -The name of Fraunhofer may not be used to endorse or promote products derived
  7926. -from this library without prior written permission.
  7927. -
  7928. -You may not charge copyright license fees for anyone to use, copy or distribute
  7929. -the FDK AAC Codec software or your modifications thereto.
  7930. -
  7931. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  7932. -that you changed the software and the date of any change. For modified versions
  7933. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  7934. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  7935. -AAC Codec Library for Android."
  7936. -
  7937. -3. NO PATENT LICENSE
  7938. -
  7939. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  7940. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  7941. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  7942. -software.
  7943. -
  7944. -You may use this FDK AAC Codec software or modifications thereto only for
  7945. -purposes that are authorized by appropriate patent licenses.
  7946. -
  7947. -4. DISCLAIMER
  7948. -
  7949. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  7950. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  7951. -including but not limited to the implied warranties of merchantability and
  7952. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  7953. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  7954. -or consequential damages, including but not limited to procurement of substitute
  7955. -goods or services; loss of use, data, or profits, or business interruption,
  7956. -however caused and on any theory of liability, whether in contract, strict
  7957. -liability, or tort (including negligence), arising in any way out of the use of
  7958. -this software, even if advised of the possibility of such damage.
  7959. -
  7960. -5. CONTACT INFORMATION
  7961. -
  7962. -Fraunhofer Institute for Integrated Circuits IIS
  7963. -Attention: Audio and Multimedia Departments - FDK AAC LL
  7964. -Am Wolfsmantel 33
  7965. -91058 Erlangen, Germany
  7966. -
  7967. -www.iis.fraunhofer.de/amm
  7968. -amm-info@iis.fraunhofer.de
  7969. ------------------------------------------------------------------------------ */
  7970. -
  7971. -/**************************** AAC decoder library ******************************
  7972. -
  7973. - Author(s): M. Jander
  7974. -
  7975. - Description:
  7976. -
  7977. -*******************************************************************************/
  7978. -
  7979. -#include "usacdec_rom.h"
  7980. -
  7981. -#define NB_SPHERE 32
  7982. -#define NB_LEADER 37
  7983. -#define NB_LDSIGN 226
  7984. -#define NB_LDQ3 9
  7985. -#define NB_LDQ4 28
  7986. -
  7987. -/* For bass post filter */
  7988. -#define FL2FXCONST_SGL_FILT(a) FL2FXCONST_SGL(a*(1 << SF_FILT_LP))
  7989. -#define SF_FILT_LP 1
  7990. -
  7991. -/* table of factorial */
  7992. -const UINT fdk_dec_tab_factorial[8] = {5040, 720, 120, 24, 6, 2, 1, 1};
  7993. -
  7994. -/* Da - Absolute leaders */
  7995. -const UCHAR fdk_dec_Da[NB_LEADER][8] = {
  7996. - {1, 1, 1, 1, 1, 1, 1, 1}, {2, 2, 0, 0, 0, 0, 0, 0},
  7997. - {2, 2, 2, 2, 0, 0, 0, 0}, {3, 1, 1, 1, 1, 1, 1, 1},
  7998. - {4, 0, 0, 0, 0, 0, 0, 0}, {2, 2, 2, 2, 2, 2, 0, 0},
  7999. - {3, 3, 1, 1, 1, 1, 1, 1}, {4, 2, 2, 0, 0, 0, 0, 0},
  8000. - {2, 2, 2, 2, 2, 2, 2, 2}, {3, 3, 3, 1, 1, 1, 1, 1},
  8001. - {4, 2, 2, 2, 2, 0, 0, 0}, {4, 4, 0, 0, 0, 0, 0, 0},
  8002. - {5, 1, 1, 1, 1, 1, 1, 1}, {3, 3, 3, 3, 1, 1, 1, 1},
  8003. - {4, 2, 2, 2, 2, 2, 2, 0}, {4, 4, 2, 2, 0, 0, 0, 0},
  8004. - {5, 3, 1, 1, 1, 1, 1, 1}, {6, 2, 0, 0, 0, 0, 0, 0},
  8005. - {4, 4, 4, 0, 0, 0, 0, 0}, {6, 2, 2, 2, 0, 0, 0, 0},
  8006. - {6, 4, 2, 0, 0, 0, 0, 0}, {7, 1, 1, 1, 1, 1, 1, 1},
  8007. - {8, 0, 0, 0, 0, 0, 0, 0}, {6, 6, 0, 0, 0, 0, 0, 0},
  8008. - {8, 2, 2, 0, 0, 0, 0, 0}, {8, 4, 0, 0, 0, 0, 0, 0},
  8009. - {9, 1, 1, 1, 1, 1, 1, 1}, {10, 2, 0, 0, 0, 0, 0, 0},
  8010. - {8, 8, 0, 0, 0, 0, 0, 0}, {10, 6, 0, 0, 0, 0, 0, 0},
  8011. - {12, 0, 0, 0, 0, 0, 0, 0}, {12, 4, 0, 0, 0, 0, 0, 0},
  8012. - {10, 10, 0, 0, 0, 0, 0, 0}, {14, 2, 0, 0, 0, 0, 0, 0},
  8013. - {12, 8, 0, 0, 0, 0, 0, 0}, {16, 0, 0, 0, 0, 0, 0, 0},
  8014. - {20, 0, 0, 0, 0, 0, 0, 0}};
  8015. -
  8016. -/* Ds - Sign codes of all signed leaders */
  8017. -const UCHAR fdk_dec_Ds[NB_LDSIGN] = {
  8018. - 0, 3, 15, 63, 255, 0, 64, 192, 0, 16, 48, 112, 240, 1, 7,
  8019. - 31, 127, 128, 131, 143, 191, 0, 128, 0, 4, 12, 28, 60, 124, 252,
  8020. - 0, 3, 15, 63, 65, 71, 95, 192, 195, 207, 255, 0, 32, 96, 128,
  8021. - 160, 224, 0, 1, 3, 7, 15, 31, 63, 127, 255, 1, 7, 31, 32,
  8022. - 35, 47, 97, 103, 127, 224, 227, 239, 0, 8, 24, 56, 120, 128, 136,
  8023. - 152, 184, 248, 0, 64, 192, 0, 3, 15, 63, 129, 135, 159, 255, 0,
  8024. - 3, 15, 17, 23, 48, 51, 63, 113, 119, 240, 243, 255, 0, 2, 6,
  8025. - 14, 30, 62, 126, 128, 130, 134, 142, 158, 190, 254, 0, 16, 48, 64,
  8026. - 80, 112, 192, 208, 240, 1, 7, 31, 64, 67, 79, 127, 128, 131, 143,
  8027. - 191, 193, 199, 223, 0, 64, 128, 192, 0, 32, 96, 224, 0, 16, 48,
  8028. - 112, 128, 144, 176, 240, 0, 32, 64, 96, 128, 160, 192, 224, 1, 7,
  8029. - 31, 127, 128, 131, 143, 191, 0, 128, 0, 64, 192, 0, 32, 96, 128,
  8030. - 160, 224, 0, 64, 128, 192, 0, 3, 15, 63, 129, 135, 159, 255, 0,
  8031. - 64, 128, 192, 0, 64, 192, 0, 64, 128, 192, 0, 128, 0, 64, 128,
  8032. - 192, 0, 64, 192, 0, 64, 128, 192, 0, 64, 128, 192, 0, 128, 0,
  8033. - 128};
  8034. -
  8035. -/* Ns - Number of signed leader associated to a given absolute leader */
  8036. -const UCHAR fdk_dec_Ns[NB_LEADER] = {
  8037. - 5, 3, 5, 8, 2, 7, 11, 6, 9, 12, 10, 3, 8, 13, 14, 9, 14, 4, 4,
  8038. - 8, 8, 8, 2, 3, 6, 4, 8, 4, 3, 4, 2, 4, 3, 4, 4, 2, 2};
  8039. -
  8040. -/* Ia - Position of the first signed leader associated to an absolute leader */
  8041. -const UCHAR fdk_dec_Ia[NB_LEADER] = {
  8042. - 0, 5, 8, 13, 21, 23, 30, 41, 47, 56, 68, 78, 81,
  8043. - 89, 102, 116, 125, 139, 143, 147, 155, 163, 171, 173, 176, 182,
  8044. - 186, 194, 198, 201, 205, 207, 211, 214, 218, 222, 224};
  8045. -
  8046. -/* Is - Cardinalite offset of signed leaders */
  8047. -const USHORT fdk_dec_Is[NB_LDSIGN] = {
  8048. - 0, 1, 29, 99, 127, 128, 156, 212, 256, 326, 606,
  8049. - 1026, 1306, 1376, 1432, 1712, 1880, 1888, 1896, 2064, 2344, 240,
  8050. - 248, 0, 28, 196, 616, 1176, 1596, 1764, 1792, 1820, 2240,
  8051. - 2660, 2688, 3024, 4144, 4480, 4508, 4928, 5348, 2400, 2568, 2904,
  8052. - 3072, 3240, 3576, 5376, 5377, 5385, 5413, 5469, 5539, 5595, 5623,
  8053. - 5631, 5632, 5912, 6472, 6528, 6696, 8376, 9216, 10056, 11736, 11904,
  8054. - 11960, 12520, 12800, 13080, 14200, 15880, 17000, 17280, 17560, 18680, 20360,
  8055. - 21480, 3744, 3772, 3828, 21760, 21768, 21936, 22216, 22272, 22328, 22608,
  8056. - 22776, 22784, 22854, 23274, 23344, 24464, 25584, 26004, 28524, 28944, 30064,
  8057. - 31184, 31254, 31674, 31744, 31800, 32136, 32976, 34096, 34936, 35272, 35328,
  8058. - 35384, 35720, 36560, 37680, 38520, 38856, 38912, 39332, 40172, 40592, 41432,
  8059. - 43112, 43952, 44372, 45212, 45632, 45968, 47088, 47424, 47480, 48320, 49160,
  8060. - 49216, 49272, 50112, 50952, 51008, 51344, 52464, 3856, 3912, 3968, 4024,
  8061. - 52800, 52856, 53024, 53192, 53248, 53528, 54368, 55208, 55488, 55768, 56608,
  8062. - 57448, 57728, 58064, 58400, 58736, 59072, 59408, 59744, 60080, 60416, 60472,
  8063. - 60752, 60920, 60928, 60936, 61104, 61384, 4080, 4088, 61440, 61468, 61524,
  8064. - 61552, 61720, 62056, 62224, 62392, 62728, 62896, 62952, 63008, 63064, 63120,
  8065. - 63128, 63296, 63576, 63632, 63688, 63968, 64136, 64144, 64200, 64256, 64312,
  8066. - 64368, 64396, 64452, 64480, 64536, 64592, 64648, 64704, 64712, 64720, 64776,
  8067. - 64832, 64888, 64944, 64972, 65028, 65056, 65112, 65168, 65224, 65280, 65336,
  8068. - 65392, 65448, 65504, 65512, 65520, 65528};
  8069. -
  8070. -/* A3 - Number of the absolute leaders in codebooks Q2 and Q3 */
  8071. -const UCHAR fdk_dec_A3[NB_LDQ3] = {0, 1, 4, 2, 3, 7, 11, 17, 22};
  8072. -
  8073. -/* A4 - Number of the absolute leaders in codebook Q4 */
  8074. -const UCHAR fdk_dec_A4[NB_LDQ4] = {5, 6, 8, 9, 10, 12, 13, 14, 15, 16,
  8075. - 18, 19, 20, 21, 23, 24, 25, 26, 27, 28,
  8076. - 29, 30, 31, 32, 33, 34, 35, 36};
  8077. -
  8078. -/* I3 - Cardinality offsets for absolute leaders in Q3 */
  8079. -const USHORT fdk_dec_I3[NB_LDQ3] = {0, 128, 240, 256, 1376,
  8080. - 2400, 3744, 3856, 4080};
  8081. -
  8082. -/* I4 - Cardinality offset for absolute leaders in Q4 */
  8083. -const USHORT fdk_dec_I4[NB_LDQ4] = {
  8084. - 0, 1792, 5376, 5632, 12800, 21760, 22784, 31744, 38912, 45632,
  8085. - 52800, 53248, 57728, 60416, 61440, 61552, 62896, 63120, 64144, 64368,
  8086. - 64480, 64704, 64720, 64944, 65056, 65280, 65504, 65520};
  8087. -
  8088. -/* Initial ISF memory for concealment case */
  8089. -#define LSFI(x) ((x) << (FRACT_BITS - LSF_SCALE - 1))
  8090. -
  8091. -const FIXP_LPC fdk_dec_lsf_init[16] = {1506, 3012, 4518, 6024, 7529, 9035,
  8092. - 10541, 12047, 13553, 15059, 16565, 18071,
  8093. - 19576, 21082, 22588, 24094};
  8094. -
  8095. -/* dico_lsf_abs_8b is scaled by 1/(1<<13) */
  8096. -#define DICO(x) FX_DBL2FXCONST_LPC(x >> (LSF_SCALE - 13))
  8097. -
  8098. -const FIXP_LPC fdk_dec_dico_lsf_abs_8b[] = {
  8099. - DICO(0x05e57fe8), DICO(0x0ac00810), DICO(0x11ed8500), DICO(0x16d42ce0),
  8100. - DICO(0x1beb1e20), DICO(0x217eaf40), DICO(0x2768c740), DICO(0x2d26f600),
  8101. - DICO(0x32fe68c0), DICO(0x38b1d980), DICO(0x3e95bd80), DICO(0x446dab00),
  8102. - DICO(0x4abfd280), DICO(0x5094b380), DICO(0x56ccb800), DICO(0x5c9aba00),
  8103. - DICO(0x09660ca0), DICO(0x10ab4c00), DICO(0x15a16f20), DICO(0x19d3c780),
  8104. - DICO(0x1ee99060), DICO(0x241d1200), DICO(0x29c83700), DICO(0x2f098f00),
  8105. - DICO(0x34803fc0), DICO(0x3a37bc00), DICO(0x3ff55580), DICO(0x45da9280),
  8106. - DICO(0x4bec6700), DICO(0x5169e300), DICO(0x57797c80), DICO(0x5d09ae80),
  8107. - DICO(0x08a203b0), DICO(0x0d6ed1a0), DICO(0x152ccf20), DICO(0x19639dc0),
  8108. - DICO(0x1d7e3e60), DICO(0x21f4a7c0), DICO(0x27b2f8c0), DICO(0x2dbb4480),
  8109. - DICO(0x33ecde80), DICO(0x3982e100), DICO(0x3ea16100), DICO(0x43ab6080),
  8110. - DICO(0x49534a80), DICO(0x4ea7e100), DICO(0x550d6300), DICO(0x5bcdcc80),
  8111. - DICO(0x072dd048), DICO(0x0c654690), DICO(0x1436e940), DICO(0x19459680),
  8112. - DICO(0x1e0041c0), DICO(0x2240dc80), DICO(0x26de4040), DICO(0x2b509b00),
  8113. - DICO(0x309d8780), DICO(0x36151180), DICO(0x3c6c1200), DICO(0x42df6b80),
  8114. - DICO(0x4a144400), DICO(0x50541280), DICO(0x56c34b80), DICO(0x5cb6c600),
  8115. - DICO(0x051fef00), DICO(0x06b9fb48), DICO(0x0b4f9cc0), DICO(0x17e27800),
  8116. - DICO(0x1b8c7340), DICO(0x1f772ca0), DICO(0x2478dc80), DICO(0x28242240),
  8117. - DICO(0x2f27c640), DICO(0x33b03e80), DICO(0x381f20c0), DICO(0x3c662c00),
  8118. - DICO(0x49565080), DICO(0x529b0f00), DICO(0x583ed080), DICO(0x5d8cec00),
  8119. - DICO(0x071c4d18), DICO(0x097853b0), DICO(0x0f0f0690), DICO(0x157bf980),
  8120. - DICO(0x1801f580), DICO(0x1deb0c20), DICO(0x2523da40), DICO(0x28534600),
  8121. - DICO(0x2eb499c0), DICO(0x32eb5ac0), DICO(0x36749580), DICO(0x3a748200),
  8122. - DICO(0x4325f700), DICO(0x515d8300), DICO(0x58a18700), DICO(0x5d722100),
  8123. - DICO(0x06cbcd88), DICO(0x08bb6740), DICO(0x0dead310), DICO(0x152f0cc0),
  8124. - DICO(0x18427640), DICO(0x1d9f2f20), DICO(0x22ba3b40), DICO(0x271a6e80),
  8125. - DICO(0x2c677ec0), DICO(0x31061b00), DICO(0x349eef40), DICO(0x3c531b80),
  8126. - DICO(0x4aed0580), DICO(0x4f8bbf80), DICO(0x54b74980), DICO(0x5bc9b700),
  8127. - DICO(0x046410c8), DICO(0x06522ab0), DICO(0x0b6528c0), DICO(0x0f94bd90),
  8128. - DICO(0x1a8f8b80), DICO(0x1ea57820), DICO(0x233ee180), DICO(0x27b3acc0),
  8129. - DICO(0x2bd1d240), DICO(0x2fc4bcc0), DICO(0x3a98ea40), DICO(0x43d3f500),
  8130. - DICO(0x49b37580), DICO(0x4e2afd00), DICO(0x55953300), DICO(0x5d36f600),
  8131. - DICO(0x05d0f6c8), DICO(0x07e56d90), DICO(0x0be98080), DICO(0x0f956f30),
  8132. - DICO(0x1259b3c0), DICO(0x1f08b240), DICO(0x25008c00), DICO(0x2900b180),
  8133. - DICO(0x31ea6f00), DICO(0x352d1e00), DICO(0x3c970c80), DICO(0x45271200),
  8134. - DICO(0x4b632280), DICO(0x5098a480), DICO(0x5672fc80), DICO(0x5c163180),
  8135. - DICO(0x05bd81a0), DICO(0x07d4b8f0), DICO(0x0ce224b0), DICO(0x110abe20),
  8136. - DICO(0x13dfeac0), DICO(0x17dedae0), DICO(0x2535c0c0), DICO(0x2a19da80),
  8137. - DICO(0x2e5224c0), DICO(0x38ddeec0), DICO(0x3da99d80), DICO(0x42799100),
  8138. - DICO(0x48973b00), DICO(0x4ea62880), DICO(0x53f77e80), DICO(0x5bd9c100),
  8139. - DICO(0x0395cd50), DICO(0x058244b8), DICO(0x0af45520), DICO(0x1329cea0),
  8140. - DICO(0x1a3970c0), DICO(0x1d9f2e00), DICO(0x21704400), DICO(0x277a34c0),
  8141. - DICO(0x30215b40), DICO(0x33875040), DICO(0x3c159840), DICO(0x452fea00),
  8142. - DICO(0x4981d200), DICO(0x4e15a980), DICO(0x54e84780), DICO(0x5c79ea00),
  8143. - DICO(0x05413b98), DICO(0x08132a80), DICO(0x0dc7f050), DICO(0x13e25460),
  8144. - DICO(0x1784bf80), DICO(0x1d630200), DICO(0x238bc880), DICO(0x28cc0880),
  8145. - DICO(0x30da1a40), DICO(0x391e2200), DICO(0x415d8d00), DICO(0x48f13280),
  8146. - DICO(0x4e300300), DICO(0x52e56580), DICO(0x5849fe80), DICO(0x5cdef400),
  8147. - DICO(0x04a058c8), DICO(0x07569b88), DICO(0x0ef26610), DICO(0x13208140),
  8148. - DICO(0x168c0500), DICO(0x1afec080), DICO(0x22a0abc0), DICO(0x2a057880),
  8149. - DICO(0x2fd1c840), DICO(0x3703c680), DICO(0x3d326b80), DICO(0x43df2e80),
  8150. - DICO(0x4a6f9000), DICO(0x50900d80), DICO(0x56c73f00), DICO(0x5cc3da80),
  8151. - DICO(0x065c99e8), DICO(0x09060c50), DICO(0x0d1ef1c0), DICO(0x16bd9020),
  8152. - DICO(0x1a04dae0), DICO(0x1e3c0580), DICO(0x25783700), DICO(0x29710ac0),
  8153. - DICO(0x309cbb80), DICO(0x36c66280), DICO(0x3adb0580), DICO(0x41b37e00),
  8154. - DICO(0x496ca700), DICO(0x4dab7600), DICO(0x52be6280), DICO(0x58fec480),
  8155. - DICO(0x04640880), DICO(0x05a75ab8), DICO(0x0edba410), DICO(0x16e076a0),
  8156. - DICO(0x198acec0), DICO(0x1eb5fae0), DICO(0x228c9000), DICO(0x29986c00),
  8157. - DICO(0x2c780c80), DICO(0x38078dc0), DICO(0x3f42dc00), DICO(0x441ba900),
  8158. - DICO(0x492f8080), DICO(0x4ed85d00), DICO(0x54605800), DICO(0x5d106a80),
  8159. - DICO(0x045cb970), DICO(0x0627a828), DICO(0x0db35290), DICO(0x1778f780),
  8160. - DICO(0x1a243c60), DICO(0x23c2dd40), DICO(0x27c57840), DICO(0x2f53cd80),
  8161. - DICO(0x36f65600), DICO(0x3bc1b2c0), DICO(0x40c36500), DICO(0x46074180),
  8162. - DICO(0x4b551b80), DICO(0x50a99700), DICO(0x569b6c80), DICO(0x5ca25780),
  8163. - DICO(0x05ef2828), DICO(0x07d3adf8), DICO(0x0b5416d0), DICO(0x0f9adb70),
  8164. - DICO(0x126e7360), DICO(0x1baff460), DICO(0x2b5decc0), DICO(0x31036200),
  8165. - DICO(0x34ca7500), DICO(0x39681340), DICO(0x3da97100), DICO(0x4161ee00),
  8166. - DICO(0x46a62e80), DICO(0x4d1b9380), DICO(0x530e0300), DICO(0x59ff0480),
  8167. - DICO(0x04f5bc50), DICO(0x06e90d18), DICO(0x0c2af480), DICO(0x123f7400),
  8168. - DICO(0x1530a160), DICO(0x18aa3dc0), DICO(0x1cc0a240), DICO(0x2cdb02c0),
  8169. - DICO(0x32909a00), DICO(0x36bae640), DICO(0x3c917a80), DICO(0x40121900),
  8170. - DICO(0x48a90d80), DICO(0x51ccc180), DICO(0x5884ea00), DICO(0x5dbc4280),
  8171. - DICO(0x05791410), DICO(0x07b0dd80), DICO(0x0bec4190), DICO(0x13c30520),
  8172. - DICO(0x17ac1900), DICO(0x1b6f1d00), DICO(0x26e54f40), DICO(0x2d4a8040),
  8173. - DICO(0x311c6840), DICO(0x38ec4180), DICO(0x3f0c4340), DICO(0x427c5b00),
  8174. - DICO(0x4886e480), DICO(0x504a0b00), DICO(0x56d48700), DICO(0x5c80f600),
  8175. - DICO(0x04b58880), DICO(0x0743f0d8), DICO(0x0be95e20), DICO(0x0fd0d9b0),
  8176. - DICO(0x1c2e11a0), DICO(0x2241af80), DICO(0x296e83c0), DICO(0x2f16adc0),
  8177. - DICO(0x32cd6fc0), DICO(0x374ddec0), DICO(0x3da95f80), DICO(0x45d56c80),
  8178. - DICO(0x4c6afa80), DICO(0x5141f380), DICO(0x5616b380), DICO(0x5c58f580),
  8179. - DICO(0x03f4b368), DICO(0x05939890), DICO(0x09d95480), DICO(0x122cac60),
  8180. - DICO(0x17e27e00), DICO(0x1f9dc680), DICO(0x26e26680), DICO(0x2ae64040),
  8181. - DICO(0x2dd6cf40), DICO(0x3295c400), DICO(0x3e23b400), DICO(0x44fd0380),
  8182. - DICO(0x4ad7a700), DICO(0x51295e80), DICO(0x594a9400), DICO(0x5e41aa00),
  8183. - DICO(0x0424b9d8), DICO(0x05b30508), DICO(0x09380f20), DICO(0x0c9509c0),
  8184. - DICO(0x18730860), DICO(0x219a9d40), DICO(0x24f699c0), DICO(0x289b2680),
  8185. - DICO(0x2cb62240), DICO(0x36e88180), DICO(0x3e968800), DICO(0x48053c80),
  8186. - DICO(0x4d6dca80), DICO(0x51d9a580), DICO(0x563e5a80), DICO(0x5c0b2b80),
  8187. - DICO(0x03456ae8), DICO(0x04e49948), DICO(0x07dd0e88), DICO(0x0ed5cd30),
  8188. - DICO(0x1b06e980), DICO(0x1de2b9c0), DICO(0x21160540), DICO(0x270a8240),
  8189. - DICO(0x3352a280), DICO(0x3b8b6c00), DICO(0x40241400), DICO(0x43f60f80),
  8190. - DICO(0x4a897900), DICO(0x51692a00), DICO(0x57449d00), DICO(0x5d497480),
  8191. - DICO(0x04b94290), DICO(0x067e99d0), DICO(0x0ab06840), DICO(0x0e697070),
  8192. - DICO(0x1745c460), DICO(0x22ee8040), DICO(0x2647e8c0), DICO(0x2bc2c680),
  8193. - DICO(0x2fd57d00), DICO(0x37186680), DICO(0x3d074500), DICO(0x412b2800),
  8194. - DICO(0x4579af00), DICO(0x4caff980), DICO(0x557add00), DICO(0x5c6ae780),
  8195. - DICO(0x0423a090), DICO(0x05b9bca0), DICO(0x091b45d0), DICO(0x0c5b6d60),
  8196. - DICO(0x194dd1c0), DICO(0x1fc85020), DICO(0x2486b080), DICO(0x2920af80),
  8197. - DICO(0x2dd4f140), DICO(0x3598be40), DICO(0x3b9c1440), DICO(0x42d19280),
  8198. - DICO(0x4a314280), DICO(0x50b00a00), DICO(0x56c55400), DICO(0x5d5ba300),
  8199. - DICO(0x03e68b28), DICO(0x05a7b190), DICO(0x0917f000), DICO(0x0d247050),
  8200. - DICO(0x19e637a0), DICO(0x2221a540), DICO(0x2777e540), DICO(0x2c103380),
  8201. - DICO(0x30c2e040), DICO(0x389f1240), DICO(0x3f4a2c80), DICO(0x454a4c00),
  8202. - DICO(0x4b0ab680), DICO(0x50cf6000), DICO(0x571c0700), DICO(0x5d2ef600),
  8203. - DICO(0x04886f18), DICO(0x065103e8), DICO(0x0a607d40), DICO(0x0db91960),
  8204. - DICO(0x13546f20), DICO(0x22f5e200), DICO(0x27064240), DICO(0x2e371d40),
  8205. - DICO(0x33659240), DICO(0x38aa1c40), DICO(0x417bb280), DICO(0x47ca9480),
  8206. - DICO(0x4dd6fb80), DICO(0x528e3480), DICO(0x57c49d80), DICO(0x5cc98100),
  8207. - DICO(0x02db2370), DICO(0x04398848), DICO(0x07a8da38), DICO(0x10b90280),
  8208. - DICO(0x1a2a4a20), DICO(0x20b1f640), DICO(0x277096c0), DICO(0x2dc568c0),
  8209. - DICO(0x341b33c0), DICO(0x3a000640), DICO(0x40152880), DICO(0x45eeee00),
  8210. - DICO(0x4c08c480), DICO(0x51bf0600), DICO(0x5799a180), DICO(0x5d23db80),
  8211. - DICO(0x047b1498), DICO(0x06089848), DICO(0x0905af20), DICO(0x0bf13c20),
  8212. - DICO(0x11fcf620), DICO(0x1f79cd00), DICO(0x257f6b40), DICO(0x2cfc2600),
  8213. - DICO(0x31610040), DICO(0x35ea8280), DICO(0x3c774bc0), DICO(0x44417280),
  8214. - DICO(0x4b432500), DICO(0x510e9480), DICO(0x56f2e480), DICO(0x5d282780),
  8215. - DICO(0x02cfd0b0), DICO(0x042845d8), DICO(0x0a1fa610), DICO(0x15911fc0),
  8216. - DICO(0x1bc07f00), DICO(0x2281d640), DICO(0x287abcc0), DICO(0x2ec6b400),
  8217. - DICO(0x34a0d040), DICO(0x3aa4dcc0), DICO(0x4074d980), DICO(0x46726b80),
  8218. - DICO(0x4c3bf900), DICO(0x52055100), DICO(0x57b20500), DICO(0x5d34da80),
  8219. - DICO(0x04d4f768), DICO(0x06cad828), DICO(0x0b52a540), DICO(0x0ea224e0),
  8220. - DICO(0x13c3f460), DICO(0x23808900), DICO(0x27d1cec0), DICO(0x2d6051c0),
  8221. - DICO(0x33c5ff00), DICO(0x37ef2440), DICO(0x3d2a5300), DICO(0x43266000),
  8222. - DICO(0x4a53a100), DICO(0x50acce80), DICO(0x57612100), DICO(0x5cdee380),
  8223. - DICO(0x04039a88), DICO(0x0626dcb0), DICO(0x0c059620), DICO(0x12c3db20),
  8224. - DICO(0x1bb9eb40), DICO(0x240fda00), DICO(0x2baab840), DICO(0x3177c5c0),
  8225. - DICO(0x36cf2e40), DICO(0x3c025100), DICO(0x40bb8d00), DICO(0x45960800),
  8226. - DICO(0x4adaca00), DICO(0x505a7300), DICO(0x566a6400), DICO(0x5c8ce000),
  8227. - DICO(0x062891e8), DICO(0x09680810), DICO(0x0e9a11b0), DICO(0x1523e320),
  8228. - DICO(0x1c57db00), DICO(0x21f22c80), DICO(0x28aeeb00), DICO(0x2e4fd600),
  8229. - DICO(0x341cf000), DICO(0x3a5034c0), DICO(0x40600f80), DICO(0x461fde00),
  8230. - DICO(0x4c368480), DICO(0x51dbbc00), DICO(0x57709780), DICO(0x5cce9880),
  8231. - DICO(0x05d41f70), DICO(0x0a65bb30), DICO(0x132ddfa0), DICO(0x17d26820),
  8232. - DICO(0x1e6d8380), DICO(0x24e68dc0), DICO(0x2b68c4c0), DICO(0x30fa2880),
  8233. - DICO(0x361998c0), DICO(0x3aa1d640), DICO(0x3f942400), DICO(0x44d11680),
  8234. - DICO(0x4ab8e580), DICO(0x50643b80), DICO(0x5697fe00), DICO(0x5cb3a780),
  8235. - DICO(0x0707fa10), DICO(0x0cb8beb0), DICO(0x15011d20), DICO(0x1a4ad300),
  8236. - DICO(0x20997080), DICO(0x26dbe240), DICO(0x2d907880), DICO(0x3307a3c0),
  8237. - DICO(0x38819740), DICO(0x3d3e89c0), DICO(0x41ea2300), DICO(0x469ce200),
  8238. - DICO(0x4be61680), DICO(0x51261b80), DICO(0x5716ef80), DICO(0x5cba2900),
  8239. - DICO(0x084dc830), DICO(0x0f16f610), DICO(0x16ca2420), DICO(0x1bb58380),
  8240. - DICO(0x22f00f00), DICO(0x296ba4c0), DICO(0x306d2600), DICO(0x362ca080),
  8241. - DICO(0x3b86d280), DICO(0x3ffa96c0), DICO(0x446a5300), DICO(0x48d0fd00),
  8242. - DICO(0x4d8a0800), DICO(0x525bf200), DICO(0x57f5aa00), DICO(0x5d569480),
  8243. - DICO(0x08d664f0), DICO(0x110c8520), DICO(0x1865fa40), DICO(0x1efe3160),
  8244. - DICO(0x26f38740), DICO(0x2d4608c0), DICO(0x32862500), DICO(0x374f8840),
  8245. - DICO(0x3bfa9900), DICO(0x3ff5c8c0), DICO(0x4450c500), DICO(0x4918e680),
  8246. - DICO(0x4e1d0f00), DICO(0x53342600), DICO(0x58a38e00), DICO(0x5dbbff00),
  8247. - DICO(0x09143fd0), DICO(0x0f401c30), DICO(0x169c1ee0), DICO(0x1bcfb280),
  8248. - DICO(0x2190dd00), DICO(0x27bf56c0), DICO(0x2e8e0640), DICO(0x34b67080),
  8249. - DICO(0x3b534dc0), DICO(0x41134c00), DICO(0x467a3280), DICO(0x4bd63600),
  8250. - DICO(0x50de8700), DICO(0x55657580), DICO(0x5a0cef00), DICO(0x5e8aa200),
  8251. - DICO(0x06b5d860), DICO(0x0c8a5000), DICO(0x13343620), DICO(0x17a2abe0),
  8252. - DICO(0x1caf7340), DICO(0x22a3f740), DICO(0x29059980), DICO(0x2ecff880),
  8253. - DICO(0x34ce0f00), DICO(0x3ad32280), DICO(0x40f08d80), DICO(0x46d1d400),
  8254. - DICO(0x4ca9df00), DICO(0x523b9580), DICO(0x57ea9b80), DICO(0x5d4a9a00),
  8255. - DICO(0x03822fec), DICO(0x0522c670), DICO(0x099f89a0), DICO(0x12ddc9c0),
  8256. - DICO(0x17c3d380), DICO(0x1d27ec20), DICO(0x2219e480), DICO(0x25fdf580),
  8257. - DICO(0x329d6500), DICO(0x368ba040), DICO(0x3afedb00), DICO(0x430db980),
  8258. - DICO(0x4a105380), DICO(0x51205080), DICO(0x5673b880), DICO(0x5ca2e500),
  8259. - DICO(0x04e07408), DICO(0x06a13dc0), DICO(0x0b31c780), DICO(0x0e67fcd0),
  8260. - DICO(0x13723240), DICO(0x1f87a840), DICO(0x2321ab00), DICO(0x2c604680),
  8261. - DICO(0x310bc180), DICO(0x351eea40), DICO(0x3a2d6440), DICO(0x3e7ebac0),
  8262. - DICO(0x4798ef80), DICO(0x50721100), DICO(0x57ff9880), DICO(0x5dc2e080),
  8263. - DICO(0x05d626b8), DICO(0x07eaf140), DICO(0x0c5675b0), DICO(0x0eba7b00),
  8264. - DICO(0x1a7f36c0), DICO(0x1f969200), DICO(0x244d8c00), DICO(0x29666440),
  8265. - DICO(0x2c94b100), DICO(0x31865380), DICO(0x3713c000), DICO(0x3c228f40),
  8266. - DICO(0x4296ed80), DICO(0x4dcbde00), DICO(0x56059a00), DICO(0x5c932d00),
  8267. - DICO(0x07dceb20), DICO(0x0b533fe0), DICO(0x0eb18880), DICO(0x13124220),
  8268. - DICO(0x167f74e0), DICO(0x1afbee40), DICO(0x229e2f80), DICO(0x26b05ec0),
  8269. - DICO(0x2c7b4040), DICO(0x32806140), DICO(0x38da6540), DICO(0x3e495540),
  8270. - DICO(0x444d3880), DICO(0x4e784400), DICO(0x5865f580), DICO(0x5e616180),
  8271. - DICO(0x06395790), DICO(0x084b8f20), DICO(0x0d0e26a0), DICO(0x10897ac0),
  8272. - DICO(0x14bcd080), DICO(0x1c5babe0), DICO(0x2108f9c0), DICO(0x274f8e80),
  8273. - DICO(0x2b0ba180), DICO(0x305b8480), DICO(0x383ad300), DICO(0x3e34f440),
  8274. - DICO(0x47f7aa00), DICO(0x4fdb5880), DICO(0x56b8c280), DICO(0x5d07d700),
  8275. - DICO(0x051f0880), DICO(0x071b8fa8), DICO(0x0ce79c90), DICO(0x1005bd60),
  8276. - DICO(0x14a4a080), DICO(0x183def40), DICO(0x1ee8d0a0), DICO(0x2c5b9bc0),
  8277. - DICO(0x309f9dc0), DICO(0x35659380), DICO(0x3c0439c0), DICO(0x49603800),
  8278. - DICO(0x5018a800), DICO(0x54862380), DICO(0x593edd80), DICO(0x5d415b80),
  8279. - DICO(0x051c8108), DICO(0x06bd97d8), DICO(0x0b47d030), DICO(0x0d9c81a0),
  8280. - DICO(0x178f0be0), DICO(0x1cdf7c80), DICO(0x2183db40), DICO(0x26ec7180),
  8281. - DICO(0x2a3856c0), DICO(0x366c9b40), DICO(0x3d3611c0), DICO(0x42788100),
  8282. - DICO(0x4981f200), DICO(0x4dd68380), DICO(0x55286a00), DICO(0x5cc72500),
  8283. - DICO(0x06ee58c8), DICO(0x098b1310), DICO(0x0ccbd880), DICO(0x0f9d68f0),
  8284. - DICO(0x1277ac40), DICO(0x1d71faa0), DICO(0x230d9480), DICO(0x276b8c00),
  8285. - DICO(0x2ec77000), DICO(0x31f2a700), DICO(0x3bee0200), DICO(0x42250700),
  8286. - DICO(0x466b7100), DICO(0x4de41980), DICO(0x56a08d80), DICO(0x5d700880),
  8287. - DICO(0x062f1d80), DICO(0x091bcd30), DICO(0x0cd875e0), DICO(0x0fd42e60),
  8288. - DICO(0x1322b980), DICO(0x1f11b480), DICO(0x2651e5c0), DICO(0x29f9b480),
  8289. - DICO(0x2e238840), DICO(0x30fc58c0), DICO(0x37aa3040), DICO(0x3e9ac580),
  8290. - DICO(0x44c6fd00), DICO(0x4eba4300), DICO(0x56fdad00), DICO(0x5d885700),
  8291. - DICO(0x04213a78), DICO(0x05d028c0), DICO(0x09a1f9e0), DICO(0x0d28ae90),
  8292. - DICO(0x151819a0), DICO(0x1c78c860), DICO(0x21d78f00), DICO(0x29992cc0),
  8293. - DICO(0x2fbdc180), DICO(0x36bab700), DICO(0x3d4db1c0), DICO(0x4402a280),
  8294. - DICO(0x4a920700), DICO(0x50988600), DICO(0x5717c100), DICO(0x5d52c200),
  8295. - DICO(0x036af4bc), DICO(0x0514cf40), DICO(0x09ec2d30), DICO(0x113de160),
  8296. - DICO(0x1991b700), DICO(0x20590bc0), DICO(0x23892a00), DICO(0x2654cd00),
  8297. - DICO(0x2ff5c0c0), DICO(0x387ed380), DICO(0x3e305300), DICO(0x46137700),
  8298. - DICO(0x4bc29100), DICO(0x4f96dd80), DICO(0x564aca00), DICO(0x5c4d9e80),
  8299. - DICO(0x041051a0), DICO(0x0734dad8), DICO(0x1064e780), DICO(0x14d8bf00),
  8300. - DICO(0x19727e40), DICO(0x1f7bede0), DICO(0x25b5ebc0), DICO(0x2c71fd40),
  8301. - DICO(0x32813740), DICO(0x39340c80), DICO(0x3f974f40), DICO(0x45ca1580),
  8302. - DICO(0x4be69f00), DICO(0x51c9c900), DICO(0x57a1ce80), DICO(0x5d0b2b00),
  8303. - DICO(0x04b73008), DICO(0x06598b60), DICO(0x0b0aee00), DICO(0x15ac7ba0),
  8304. - DICO(0x18b5e340), DICO(0x1f5308c0), DICO(0x23cfc4c0), DICO(0x27d3fdc0),
  8305. - DICO(0x30138080), DICO(0x343c85c0), DICO(0x389cb540), DICO(0x42def900),
  8306. - DICO(0x4aa6a000), DICO(0x4f719580), DICO(0x5585d080), DICO(0x5bc03f00),
  8307. - DICO(0x05601b88), DICO(0x07616b88), DICO(0x0c22ba40), DICO(0x16bc8200),
  8308. - DICO(0x192ebf80), DICO(0x1f71c120), DICO(0x25c59d00), DICO(0x28f76d00),
  8309. - DICO(0x33dbdd80), DICO(0x39f40d80), DICO(0x3da0c880), DICO(0x432c1e00),
  8310. - DICO(0x4aa19d80), DICO(0x51006f80), DICO(0x56a62e80), DICO(0x5c67d000),
  8311. - DICO(0x053095d0), DICO(0x06c43fc8), DICO(0x0f80a460), DICO(0x139b4960),
  8312. - DICO(0x1769ed80), DICO(0x1c828b00), DICO(0x21195980), DICO(0x26329800),
  8313. - DICO(0x29f35900), DICO(0x2dc9df80), DICO(0x3795f0c0), DICO(0x43139b00),
  8314. - DICO(0x4acae680), DICO(0x5048de00), DICO(0x57c11880), DICO(0x5db35900),
  8315. - DICO(0x0466e180), DICO(0x05d31550), DICO(0x10cad200), DICO(0x168c2be0),
  8316. - DICO(0x1a5e9580), DICO(0x1ef2d480), DICO(0x238db240), DICO(0x2920ce80),
  8317. - DICO(0x2c80b4c0), DICO(0x30bb2700), DICO(0x38b257c0), DICO(0x46abd580),
  8318. - DICO(0x4c30dd80), DICO(0x50e51880), DICO(0x5782ab80), DICO(0x5d23da80),
  8319. - DICO(0x06700f78), DICO(0x085ec0a0), DICO(0x0c037280), DICO(0x16d90a60),
  8320. - DICO(0x1bf46c00), DICO(0x1e6f4740), DICO(0x22c2c180), DICO(0x263fa2c0),
  8321. - DICO(0x2c4a74c0), DICO(0x3642b040), DICO(0x3a476900), DICO(0x3ea12840),
  8322. - DICO(0x46b6e880), DICO(0x4b5bad80), DICO(0x5152a500), DICO(0x5c1c6080),
  8323. - DICO(0x041f8108), DICO(0x05ef1d98), DICO(0x0ce43300), DICO(0x11647cc0),
  8324. - DICO(0x16e77fe0), DICO(0x1cdafc40), DICO(0x218832c0), DICO(0x26dd1b40),
  8325. - DICO(0x2c776100), DICO(0x34f1eb80), DICO(0x3caf6100), DICO(0x45630a80),
  8326. - DICO(0x4c0c5380), DICO(0x517ae980), DICO(0x567f4280), DICO(0x5c4bf900),
  8327. - DICO(0x06673f18), DICO(0x091ee510), DICO(0x0d6ccb10), DICO(0x12503240),
  8328. - DICO(0x158696e0), DICO(0x1f035420), DICO(0x24e6eac0), DICO(0x2a03bf40),
  8329. - DICO(0x329aa000), DICO(0x375aafc0), DICO(0x3da133c0), DICO(0x45645600),
  8330. - DICO(0x4c447c00), DICO(0x51a26b00), DICO(0x57917c00), DICO(0x5c557680),
  8331. - DICO(0x04f84c18), DICO(0x06db4c30), DICO(0x0d53a940), DICO(0x1095cd20),
  8332. - DICO(0x142b0b20), DICO(0x184229c0), DICO(0x20147280), DICO(0x25152740),
  8333. - DICO(0x2db89fc0), DICO(0x35f3d200), DICO(0x400aa680), DICO(0x47a51c00),
  8334. - DICO(0x4d9c5c00), DICO(0x525d1680), DICO(0x5832af00), DICO(0x5d27d580),
  8335. - DICO(0x05c973d0), DICO(0x07c25810), DICO(0x0e928e50), DICO(0x12f5ad00),
  8336. - DICO(0x16b2a800), DICO(0x1c2c9ce0), DICO(0x20b0f100), DICO(0x28be1940),
  8337. - DICO(0x2d0f3c00), DICO(0x30a06f40), DICO(0x399e4340), DICO(0x46b48280),
  8338. - DICO(0x4bbbc300), DICO(0x50283700), DICO(0x54a1a800), DICO(0x5ab20c80),
  8339. - DICO(0x03df9390), DICO(0x055ff1e0), DICO(0x0bbeb640), DICO(0x17d906c0),
  8340. - DICO(0x1ac20140), DICO(0x1fd84440), DICO(0x24502600), DICO(0x2a9fe640),
  8341. - DICO(0x2ef79700), DICO(0x34cbed40), DICO(0x3c48cd00), DICO(0x43ccce80),
  8342. - DICO(0x49b1d500), DICO(0x50145e00), DICO(0x56f16f80), DICO(0x5d46dd80),
  8343. - DICO(0x04a69ef0), DICO(0x06470480), DICO(0x0defbd00), DICO(0x1590e900),
  8344. - DICO(0x18114000), DICO(0x1bda6c60), DICO(0x1f64d160), DICO(0x28d8d640),
  8345. - DICO(0x2d4e2880), DICO(0x34cfe380), DICO(0x3b7077c0), DICO(0x42f36a80),
  8346. - DICO(0x49615580), DICO(0x4ff9d200), DICO(0x5657ef80), DICO(0x5cb91300),
  8347. - DICO(0x038893dc), DICO(0x0535cdf0), DICO(0x0aabff80), DICO(0x146daaa0),
  8348. - DICO(0x1848c700), DICO(0x1ce578c0), DICO(0x21116000), DICO(0x2b116d40),
  8349. - DICO(0x32113500), DICO(0x3751a480), DICO(0x3e88c200), DICO(0x44cb1800),
  8350. - DICO(0x4af1c200), DICO(0x5122b980), DICO(0x5782bc80), DICO(0x5d20be00),
  8351. - DICO(0x03118434), DICO(0x04afe2e8), DICO(0x08f144f0), DICO(0x12c787c0),
  8352. - DICO(0x1c32e4e0), DICO(0x1f701180), DICO(0x2362f740), DICO(0x2b995cc0),
  8353. - DICO(0x3322c540), DICO(0x3951f200), DICO(0x3f7c2c80), DICO(0x4569c480),
  8354. - DICO(0x4b2a6200), DICO(0x50905e80), DICO(0x56236680), DICO(0x5c32fa00),
  8355. - DICO(0x0460c3b0), DICO(0x061e1378), DICO(0x0b07f610), DICO(0x166e0680),
  8356. - DICO(0x18d0f020), DICO(0x21120340), DICO(0x24d4c000), DICO(0x29bafc00),
  8357. - DICO(0x338c0740), DICO(0x36cfbc00), DICO(0x3f313900), DICO(0x47bf9c00),
  8358. - DICO(0x4dd5d480), DICO(0x52848200), DICO(0x585add00), DICO(0x5cf7b480),
  8359. - DICO(0x041a4bc8), DICO(0x05ca0920), DICO(0x0a3ae5b0), DICO(0x13fbb840),
  8360. - DICO(0x1cdd3d00), DICO(0x209d5b80), DICO(0x27e78e80), DICO(0x2d1f4ec0),
  8361. - DICO(0x32d84c80), DICO(0x3b8aa680), DICO(0x4289c180), DICO(0x46c33580),
  8362. - DICO(0x4c23e580), DICO(0x51583180), DICO(0x56f52680), DICO(0x5c7a3d00),
  8363. - DICO(0x03067404), DICO(0x05914038), DICO(0x10d33e60), DICO(0x17377180),
  8364. - DICO(0x1d7f32a0), DICO(0x23848880), DICO(0x29d32200), DICO(0x2fb167c0),
  8365. - DICO(0x356c8480), DICO(0x3b420280), DICO(0x4106d080), DICO(0x46d29280),
  8366. - DICO(0x4c8a1200), DICO(0x52383300), DICO(0x57db8f80), DICO(0x5d61f200),
  8367. - DICO(0x04baf368), DICO(0x06670a08), DICO(0x0e0cbd90), DICO(0x126299c0),
  8368. - DICO(0x17ed7220), DICO(0x1e369900), DICO(0x22d7d300), DICO(0x2c0f9300),
  8369. - DICO(0x2f5e7fc0), DICO(0x3b7c0d40), DICO(0x405aff80), DICO(0x44f2ef80),
  8370. - DICO(0x4982b400), DICO(0x4e501380), DICO(0x539daa00), DICO(0x5c114b00),
  8371. - DICO(0x0694c170), DICO(0x092d6890), DICO(0x0d0faee0), DICO(0x13800d00),
  8372. - DICO(0x170f8d80), DICO(0x1bcd8240), DICO(0x246a8480), DICO(0x28bab640),
  8373. - DICO(0x2f482ac0), DICO(0x36e736c0), DICO(0x3aaa68c0), DICO(0x3fc43500),
  8374. - DICO(0x46e16000), DICO(0x4b3fbc00), DICO(0x4ff68e80), DICO(0x5aabf600),
  8375. - DICO(0x05e849a0), DICO(0x0b485a80), DICO(0x14be52c0), DICO(0x1a079380),
  8376. - DICO(0x1e8b1ce0), DICO(0x22fbca00), DICO(0x28c36a40), DICO(0x2e3b2a00),
  8377. - DICO(0x34360b80), DICO(0x3a24cf00), DICO(0x3fff6200), DICO(0x45a6bf00),
  8378. - DICO(0x4baf7800), DICO(0x51720e80), DICO(0x57560c80), DICO(0x5ce57e00),
  8379. - DICO(0x0751da38), DICO(0x0f0949f0), DICO(0x18141860), DICO(0x1dfcb2c0),
  8380. - DICO(0x24adbf00), DICO(0x296af240), DICO(0x2dbe60c0), DICO(0x3179ae40),
  8381. - DICO(0x35ec4400), DICO(0x3ab76400), DICO(0x4034f400), DICO(0x45cfc700),
  8382. - DICO(0x4bea6b00), DICO(0x516f5f00), DICO(0x57655300), DICO(0x5cfc0e00),
  8383. - DICO(0x069900d0), DICO(0x0d379520), DICO(0x175d0560), DICO(0x1c4d92c0),
  8384. - DICO(0x21407680), DICO(0x250d0340), DICO(0x29804940), DICO(0x2dfb9ac0),
  8385. - DICO(0x337a1f80), DICO(0x39105fc0), DICO(0x3efd0380), DICO(0x44bce380),
  8386. - DICO(0x4b07cc80), DICO(0x50ad7d00), DICO(0x56ddce80), DICO(0x5cb9a000),
  8387. - DICO(0x069c6948), DICO(0x0a56ea10), DICO(0x0f7cca20), DICO(0x12d18680),
  8388. - DICO(0x17036d00), DICO(0x1f4c1e80), DICO(0x262e5540), DICO(0x2b951e40),
  8389. - DICO(0x3468ad40), DICO(0x3a2b2100), DICO(0x3f02f0c0), DICO(0x4383e400),
  8390. - DICO(0x48374180), DICO(0x4d8eec80), DICO(0x54d74800), DICO(0x5c309600),
  8391. - DICO(0x05a50158), DICO(0x0797e350), DICO(0x0cf1f230), DICO(0x14f3fb20),
  8392. - DICO(0x17676400), DICO(0x20636780), DICO(0x2617ef80), DICO(0x29cbf700),
  8393. - DICO(0x32ed57c0), DICO(0x374c3080), DICO(0x3b348e40), DICO(0x3fde0180),
  8394. - DICO(0x44d38c00), DICO(0x4a8c6100), DICO(0x55f0e400), DICO(0x5dfed100),
  8395. - DICO(0x04b74228), DICO(0x0623d3e0), DICO(0x0ab4c670), DICO(0x1bde7fa0),
  8396. - DICO(0x1fcb6ac0), DICO(0x2344a540), DICO(0x275f7c40), DICO(0x2b7a8300),
  8397. - DICO(0x31407440), DICO(0x35237700), DICO(0x38798540), DICO(0x3d0af340),
  8398. - DICO(0x4224c980), DICO(0x49a17900), DICO(0x57702880), DICO(0x5dba4c00),
  8399. - DICO(0x03c83c84), DICO(0x05cc52d8), DICO(0x0b644c10), DICO(0x129ab9a0),
  8400. - DICO(0x1cee46c0), DICO(0x2152b080), DICO(0x247b1c00), DICO(0x27697180),
  8401. - DICO(0x304f7500), DICO(0x3895d880), DICO(0x3c3a1740), DICO(0x413ace80),
  8402. - DICO(0x462b0100), DICO(0x4ab07e00), DICO(0x50967580), DICO(0x5ba5e700),
  8403. - DICO(0x06bcfda8), DICO(0x08c8b920), DICO(0x0de21530), DICO(0x1028d320),
  8404. - DICO(0x168cfe00), DICO(0x20f78a40), DICO(0x248493c0), DICO(0x2c34bf80),
  8405. - DICO(0x2ff88540), DICO(0x32d28c40), DICO(0x36d99640), DICO(0x4438e500),
  8406. - DICO(0x4bacdb00), DICO(0x50343700), DICO(0x56b79080), DICO(0x5b694d00),
  8407. - DICO(0x069109a0), DICO(0x0a73bc50), DICO(0x0e3c8330), DICO(0x13082620),
  8408. - DICO(0x1c3a3760), DICO(0x200b5e80), DICO(0x256a4880), DICO(0x2b256ac0),
  8409. - DICO(0x2f34afc0), DICO(0x35580200), DICO(0x3e0bd9c0), DICO(0x43d92900),
  8410. - DICO(0x494e6e00), DICO(0x4f1a2780), DICO(0x5532a980), DICO(0x5a835a80),
  8411. - DICO(0x04053450), DICO(0x05cb8fe0), DICO(0x097387b0), DICO(0x1121af00),
  8412. - DICO(0x1abf62c0), DICO(0x1e39bbe0), DICO(0x243de300), DICO(0x2b440ec0),
  8413. - DICO(0x2f2c1480), DICO(0x34697d80), DICO(0x405f8600), DICO(0x440b6f80),
  8414. - DICO(0x47373100), DICO(0x4c764f80), DICO(0x55293780), DICO(0x5c59a780),
  8415. - DICO(0x03c5b4a4), DICO(0x056fb380), DICO(0x09b8f910), DICO(0x13833fa0),
  8416. - DICO(0x185eed60), DICO(0x1ce33d40), DICO(0x242e4100), DICO(0x282e5b80),
  8417. - DICO(0x2cfe4d40), DICO(0x38a06d80), DICO(0x3e002240), DICO(0x423be400),
  8418. - DICO(0x49a5e600), DICO(0x5092b780), DICO(0x57023d00), DICO(0x5d5f7c80),
  8419. - DICO(0x077ada38), DICO(0x09d5ac70), DICO(0x0e58be30), DICO(0x14fb2040),
  8420. - DICO(0x17fc9dc0), DICO(0x1c2c31e0), DICO(0x26cf1b00), DICO(0x2a91ba80),
  8421. - DICO(0x2ed880c0), DICO(0x38cbf900), DICO(0x3d2fc700), DICO(0x405d2280),
  8422. - DICO(0x439c1d00), DICO(0x4dd16800), DICO(0x5672c080), DICO(0x5d313880),
  8423. - DICO(0x04272090), DICO(0x05d76e18), DICO(0x0b4d8080), DICO(0x12883f60),
  8424. - DICO(0x17952180), DICO(0x2040d480), DICO(0x23e8cc00), DICO(0x2819c200),
  8425. - DICO(0x2b871040), DICO(0x357c8f00), DICO(0x3caf9ac0), DICO(0x40a39380),
  8426. - DICO(0x45bc2780), DICO(0x4e4aa300), DICO(0x568c2280), DICO(0x5cadc400),
  8427. - DICO(0x0375b03c), DICO(0x056f0b40), DICO(0x0b0dc930), DICO(0x128c51e0),
  8428. - DICO(0x189fa360), DICO(0x1c8197e0), DICO(0x1eed52a0), DICO(0x23ed4500),
  8429. - DICO(0x2e5eb840), DICO(0x36415a40), DICO(0x3dcf6340), DICO(0x43126e80),
  8430. - DICO(0x4aeb7f80), DICO(0x501e1280), DICO(0x5852b100), DICO(0x5d040d80),
  8431. - DICO(0x06351b88), DICO(0x07f90ac0), DICO(0x0bab4ea0), DICO(0x18d04b40),
  8432. - DICO(0x1f1e1480), DICO(0x219abcc0), DICO(0x261c31c0), DICO(0x2a611a00),
  8433. - DICO(0x2e725480), DICO(0x36b511c0), DICO(0x3d362f00), DICO(0x40be6d80),
  8434. - DICO(0x456dc400), DICO(0x4b74c580), DICO(0x55c82680), DICO(0x5e318480),
  8435. - DICO(0x046212d8), DICO(0x05ca95e8), DICO(0x0a02d910), DICO(0x1ae58f40),
  8436. - DICO(0x1e73ec20), DICO(0x2197d640), DICO(0x2581df00), DICO(0x29c83780),
  8437. - DICO(0x31294300), DICO(0x356f8a40), DICO(0x3b97d240), DICO(0x4505cc80),
  8438. - DICO(0x4b497600), DICO(0x504e8780), DICO(0x55644480), DICO(0x5bdedf80),
  8439. - DICO(0x0514f798), DICO(0x06bd0d00), DICO(0x0fc31550), DICO(0x13dfb1a0),
  8440. - DICO(0x17dda900), DICO(0x204a8c40), DICO(0x23095300), DICO(0x2d0da040),
  8441. - DICO(0x31b2a540), DICO(0x34620180), DICO(0x3ab3e000), DICO(0x448ac300),
  8442. - DICO(0x4be6a600), DICO(0x5114e280), DICO(0x562b0780), DICO(0x5b833c00),
  8443. - DICO(0x070f5ef0), DICO(0x0919c2b0), DICO(0x0e778740), DICO(0x154db320),
  8444. - DICO(0x177cfbe0), DICO(0x1ea66040), DICO(0x23666680), DICO(0x2839c400),
  8445. - DICO(0x30cc4ec0), DICO(0x3444a280), DICO(0x38c93580), DICO(0x42a80e00),
  8446. - DICO(0x4c433880), DICO(0x519e4f80), DICO(0x56ff8f80), DICO(0x5be18200),
  8447. - DICO(0x066c5968), DICO(0x08a589f0), DICO(0x0ca4d7a0), DICO(0x0ffdefb0),
  8448. - DICO(0x12943f40), DICO(0x1be84ee0), DICO(0x21276540), DICO(0x265a9540),
  8449. - DICO(0x2e0de140), DICO(0x325148c0), DICO(0x3bd05d40), DICO(0x41e81780),
  8450. - DICO(0x4b7cf400), DICO(0x53289400), DICO(0x597d9000), DICO(0x5e458e00),
  8451. - DICO(0x04da3e40), DICO(0x06e8e1b0), DICO(0x0b9b1a20), DICO(0x11264bc0),
  8452. - DICO(0x14f3d7e0), DICO(0x1cf9c100), DICO(0x23568f40), DICO(0x292b5380),
  8453. - DICO(0x33878d40), DICO(0x38dac840), DICO(0x3d578200), DICO(0x4223a880),
  8454. - DICO(0x473fb700), DICO(0x4c765500), DICO(0x546c6480), DICO(0x5c76d280),
  8455. - DICO(0x05e63bb0), DICO(0x07a1a428), DICO(0x0ec4ff10), DICO(0x1348a100),
  8456. - DICO(0x16204f40), DICO(0x1a0a6440), DICO(0x1e33f6c0), DICO(0x2ae8ccc0),
  8457. - DICO(0x2ed5e6c0), DICO(0x32427600), DICO(0x379d9980), DICO(0x3c0f4080),
  8458. - DICO(0x441ea680), DICO(0x4e592b00), DICO(0x56e27700), DICO(0x5da2e280),
  8459. - DICO(0x0474de80), DICO(0x06167248), DICO(0x0ce650e0), DICO(0x135b4aa0),
  8460. - DICO(0x16cea2a0), DICO(0x1d138ac0), DICO(0x220a84c0), DICO(0x275ca380),
  8461. - DICO(0x2c300340), DICO(0x333b3d80), DICO(0x37a35080), DICO(0x40b83880),
  8462. - DICO(0x494c4780), DICO(0x4ff71c80), DICO(0x56db2d80), DICO(0x5d0aac00),
  8463. - DICO(0x0746cd00), DICO(0x09deff10), DICO(0x0e4a3560), DICO(0x14f005e0),
  8464. - DICO(0x186a4de0), DICO(0x1cd0b240), DICO(0x22287bc0), DICO(0x26ced500),
  8465. - DICO(0x2d57c440), DICO(0x31d943c0), DICO(0x364b0f80), DICO(0x3c85a040),
  8466. - DICO(0x4240ca00), DICO(0x4a648080), DICO(0x54d12200), DICO(0x5d1a1c00),
  8467. - DICO(0x05522eb0), DICO(0x0704efb8), DICO(0x0c66cd50), DICO(0x15aefca0),
  8468. - DICO(0x184f7b00), DICO(0x1e4b26a0), DICO(0x22667640), DICO(0x284e4e00),
  8469. - DICO(0x2d8be3c0), DICO(0x31376f00), DICO(0x39cd9800), DICO(0x3e46b740),
  8470. - DICO(0x43af0380), DICO(0x4e1dec00), DICO(0x562ac500), DICO(0x5d45f580),
  8471. - DICO(0x062f5708), DICO(0x08d079a0), DICO(0x0c1b4920), DICO(0x13f147c0),
  8472. - DICO(0x1ae77c80), DICO(0x1d200ea0), DICO(0x236e4740), DICO(0x2b98d000),
  8473. - DICO(0x2eefc600), DICO(0x34c674c0), DICO(0x3d36f540), DICO(0x411d8c00),
  8474. - DICO(0x45c50300), DICO(0x4d207480), DICO(0x55603100), DICO(0x5c442d80),
  8475. - DICO(0x0510bcd0), DICO(0x06ec00a0), DICO(0x0b639550), DICO(0x15daa2c0),
  8476. - DICO(0x18c0ba60), DICO(0x1e0f7d60), DICO(0x24b05c80), DICO(0x280638c0),
  8477. - DICO(0x314a6580), DICO(0x35e4b2c0), DICO(0x3aef2bc0), DICO(0x4158c280),
  8478. - DICO(0x4d245100), DICO(0x53c69a80), DICO(0x597f1000), DICO(0x5dcb0080),
  8479. - DICO(0x042cb748), DICO(0x05d710b0), DICO(0x0afe6130), DICO(0x1256cdc0),
  8480. - DICO(0x15b8cd00), DICO(0x1dc72d20), DICO(0x2205fc00), DICO(0x2a3d0d00),
  8481. - DICO(0x2f3ba600), DICO(0x33b3d840), DICO(0x3b5a5440), DICO(0x416c9d00),
  8482. - DICO(0x497cdd80), DICO(0x50405e00), DICO(0x570ca980), DICO(0x5d3aa180),
  8483. - DICO(0x0443b7b8), DICO(0x063d8588), DICO(0x0c76ef20), DICO(0x12709b40),
  8484. - DICO(0x1649f0a0), DICO(0x20c522c0), DICO(0x24cde400), DICO(0x2ba78280),
  8485. - DICO(0x3104c340), DICO(0x360b1740), DICO(0x3cd6a6c0), DICO(0x42573800),
  8486. - DICO(0x48b18480), DICO(0x4fca1e00), DICO(0x5700c100), DICO(0x5cf14480),
  8487. - DICO(0x05123628), DICO(0x06bf10b0), DICO(0x0bde7570), DICO(0x175b7ee0),
  8488. - DICO(0x1a134460), DICO(0x20fa4100), DICO(0x25eda440), DICO(0x29c3b540),
  8489. - DICO(0x318a1b40), DICO(0x35e0d500), DICO(0x3a147f00), DICO(0x3f08e980),
  8490. - DICO(0x445d7580), DICO(0x4ec48c80), DICO(0x588bce80), DICO(0x5dfae300),
  8491. - DICO(0x04c9e750), DICO(0x065224f8), DICO(0x0c6f1e30), DICO(0x1a2ffca0),
  8492. - DICO(0x1cac6140), DICO(0x21c2a640), DICO(0x25fb8ac0), DICO(0x2ab90f00),
  8493. - DICO(0x33189200), DICO(0x38088ac0), DICO(0x3bb7de40), DICO(0x40180800),
  8494. - DICO(0x4453c300), DICO(0x4cdba880), DICO(0x54902680), DICO(0x5bb21700),
  8495. - DICO(0x06958570), DICO(0x097f32b0), DICO(0x0cb418b0), DICO(0x141b6900),
  8496. - DICO(0x1c8cfb00), DICO(0x1fab7920), DICO(0x2477c800), DICO(0x2aabed40),
  8497. - DICO(0x2eb1a080), DICO(0x339f67c0), DICO(0x3abcc240), DICO(0x3f661b00),
  8498. - DICO(0x45663280), DICO(0x4c680800), DICO(0x51703000), DICO(0x58a0e000),
  8499. - DICO(0x069f6c88), DICO(0x095e1490), DICO(0x0cf442b0), DICO(0x10ea8d60),
  8500. - DICO(0x1377b580), DICO(0x195ed480), DICO(0x26542b00), DICO(0x2c9ea700),
  8501. - DICO(0x318d8ac0), DICO(0x364e5a40), DICO(0x3a0db000), DICO(0x3e1087c0),
  8502. - DICO(0x450ca380), DICO(0x4c781d00), DICO(0x53cf7a00), DICO(0x5c7d1280),
  8503. - DICO(0x06e51d98), DICO(0x09eb8d30), DICO(0x0e6683d0), DICO(0x129418a0),
  8504. - DICO(0x1562fc80), DICO(0x1f708660), DICO(0x253f1000), DICO(0x293a16c0),
  8505. - DICO(0x2e7c1d80), DICO(0x316e75c0), DICO(0x35a7fbc0), DICO(0x3bfbf780),
  8506. - DICO(0x416a9200), DICO(0x4be36400), DICO(0x56dc7a80), DICO(0x5d64ea80),
  8507. - DICO(0x0574d0c8), DICO(0x0748efd0), DICO(0x0b510860), DICO(0x0e219e00),
  8508. - DICO(0x1299cc00), DICO(0x1ef706a0), DICO(0x22ca38c0), DICO(0x28820a00),
  8509. - DICO(0x2cc635c0), DICO(0x31ef4740), DICO(0x3a5e89c0), DICO(0x42acaa00),
  8510. - DICO(0x4b2bf500), DICO(0x515e0980), DICO(0x57949400), DICO(0x5d002500),
  8511. - DICO(0x07c715d0), DICO(0x0b3fa110), DICO(0x0e745370), DICO(0x11e93560),
  8512. - DICO(0x14bad680), DICO(0x189a0400), DICO(0x240b1240), DICO(0x2a6b3580),
  8513. - DICO(0x2e5e1380), DICO(0x352072c0), DICO(0x3a5037c0), DICO(0x3e3726c0),
  8514. - DICO(0x4725ed80), DICO(0x4f885900), DICO(0x54c8d580), DICO(0x5b261680),
  8515. - DICO(0x075f02a8), DICO(0x0a214900), DICO(0x0e189de0), DICO(0x1376d5a0),
  8516. - DICO(0x163d5c80), DICO(0x1a94b3e0), DICO(0x21376980), DICO(0x259c3140),
  8517. - DICO(0x2e663bc0), DICO(0x337884c0), DICO(0x3a035c00), DICO(0x40b32c00),
  8518. - DICO(0x4b21de00), DICO(0x53298f00), DICO(0x58788080), DICO(0x5cfa7c00),
  8519. - DICO(0x05658988), DICO(0x0797f470), DICO(0x0d250810), DICO(0x102fc2a0),
  8520. - DICO(0x13738fe0), DICO(0x1740bbc0), DICO(0x2491b380), DICO(0x28bc5800),
  8521. - DICO(0x2c75a940), DICO(0x325cb500), DICO(0x37944740), DICO(0x405f2d80),
  8522. - DICO(0x48eb8f00), DICO(0x50676f80), DICO(0x56f70380), DICO(0x5d62c000),
  8523. - DICO(0x0531b540), DICO(0x06ae64c0), DICO(0x0cf7ad30), DICO(0x11c83000),
  8524. - DICO(0x14edc980), DICO(0x18d436c0), DICO(0x1e184080), DICO(0x2603bb80),
  8525. - DICO(0x2a2f2f80), DICO(0x33bdbe00), DICO(0x3a1066c0), DICO(0x42b9ff00),
  8526. - DICO(0x4a617580), DICO(0x51619480), DICO(0x57ccd500), DICO(0x5d4d1600),
  8527. - DICO(0x03e40bac), DICO(0x05f53158), DICO(0x0e76d3b0), DICO(0x17c157a0),
  8528. - DICO(0x1ccb5bc0), DICO(0x250129c0), DICO(0x2b7d9d00), DICO(0x33224d80),
  8529. - DICO(0x3966f600), DICO(0x3f399480), DICO(0x4449fc80), DICO(0x49401b80),
  8530. - DICO(0x4e2ab580), DICO(0x53117000), DICO(0x5848e080), DICO(0x5d66a280),
  8531. - DICO(0x041d4f60), DICO(0x070e8080), DICO(0x1390ec40), DICO(0x177c42c0),
  8532. - DICO(0x1beb1400), DICO(0x208b0580), DICO(0x264cbb40), DICO(0x2bd30940),
  8533. - DICO(0x30b30880), DICO(0x36978e80), DICO(0x3cb2a140), DICO(0x43f6b080),
  8534. - DICO(0x4a881000), DICO(0x505ca780), DICO(0x569a5d80), DICO(0x5cae3580),
  8535. - DICO(0x03f3c760), DICO(0x05564e08), DICO(0x09e310d0), DICO(0x1b9b3d00),
  8536. - DICO(0x20909ac0), DICO(0x2382eec0), DICO(0x278c6700), DICO(0x2b34d500),
  8537. - DICO(0x30fa2ac0), DICO(0x34d27d40), DICO(0x38e334c0), DICO(0x3d732440),
  8538. - DICO(0x46d07800), DICO(0x51f4d400), DICO(0x57744f80), DICO(0x5d56bb80),
  8539. - DICO(0x03abfdd8), DICO(0x0512b140), DICO(0x135f7500), DICO(0x19fcc4c0),
  8540. - DICO(0x1d0b1b80), DICO(0x21eca540), DICO(0x258f8700), DICO(0x29e292c0),
  8541. - DICO(0x2c51fe80), DICO(0x31e2a180), DICO(0x3c638640), DICO(0x44873a00),
  8542. - DICO(0x4bb7e800), DICO(0x5078f700), DICO(0x57fc9b80), DICO(0x5def1c00),
  8543. - DICO(0x04721ef0), DICO(0x06688158), DICO(0x0f65a5d0), DICO(0x14499840),
  8544. - DICO(0x1bf5b8c0), DICO(0x1f33b700), DICO(0x264b6900), DICO(0x2c3e6780),
  8545. - DICO(0x2ec8d440), DICO(0x323885c0), DICO(0x37143300), DICO(0x3bafa800),
  8546. - DICO(0x49030480), DICO(0x54c16b00), DICO(0x58ec4b00), DICO(0x5d713d00),
  8547. - DICO(0x03d114e4), DICO(0x067e5b40), DICO(0x10393420), DICO(0x14961300),
  8548. - DICO(0x1a59cfa0), DICO(0x20854240), DICO(0x26b3f300), DICO(0x2e3e2840),
  8549. - DICO(0x323bd300), DICO(0x37c49280), DICO(0x3d79e500), DICO(0x4352d880),
  8550. - DICO(0x49e17980), DICO(0x4fc72f80), DICO(0x55c0c680), DICO(0x5c53c700),
  8551. - DICO(0x053f5de8), DICO(0x075162b8), DICO(0x0fae8050), DICO(0x13ec0ee0),
  8552. - DICO(0x17f92440), DICO(0x1f054440), DICO(0x24b15d40), DICO(0x2add4480),
  8553. - DICO(0x2e306300), DICO(0x35420680), DICO(0x3c6b6e00), DICO(0x42fc0380),
  8554. - DICO(0x4732e380), DICO(0x4ceb2200), DICO(0x522efe00), DICO(0x5aa12680),
  8555. - DICO(0x06111728), DICO(0x08183c80), DICO(0x0d026650), DICO(0x14b41940),
  8556. - DICO(0x17e37320), DICO(0x1c40b160), DICO(0x219c5400), DICO(0x26d88840),
  8557. - DICO(0x2bfdfe00), DICO(0x315a2800), DICO(0x38cd7140), DICO(0x3de22740),
  8558. - DICO(0x48ff1300), DICO(0x53ef4180), DICO(0x5a479380), DICO(0x5ea1e380),
  8559. - DICO(0x07ea0fa8), DICO(0x0a844ef0), DICO(0x0e1023c0), DICO(0x1208d980),
  8560. - DICO(0x15891360), DICO(0x1bebc380), DICO(0x2087da40), DICO(0x257ac940),
  8561. - DICO(0x2caefa00), DICO(0x300defc0), DICO(0x376aa000), DICO(0x438aad80),
  8562. - DICO(0x49f00500), DICO(0x4e023780), DICO(0x524e5800), DICO(0x5abcb980),
  8563. - DICO(0x079cfc88), DICO(0x0a367240), DICO(0x0f224330), DICO(0x15b51540),
  8564. - DICO(0x19065420), DICO(0x1ddbe0a0), DICO(0x23a99d80), DICO(0x28c2d340),
  8565. - DICO(0x2f627e40), DICO(0x3487e080), DICO(0x38b76bc0), DICO(0x3d135580),
  8566. - DICO(0x43799a80), DICO(0x489a5000), DICO(0x4ece6280), DICO(0x5a82f500),
  8567. - DICO(0x06c37e40), DICO(0x093f0540), DICO(0x0e0d0c30), DICO(0x17487860),
  8568. - DICO(0x1bf78020), DICO(0x20318000), DICO(0x260b8300), DICO(0x2c615980),
  8569. - DICO(0x30c88440), DICO(0x36433b40), DICO(0x3bdb8c40), DICO(0x40050c80),
  8570. - DICO(0x44062f80), DICO(0x48a8d480), DICO(0x4dd64d00), DICO(0x55abd380),
  8571. - DICO(0x05e9e828), DICO(0x07f24330), DICO(0x0c8b4fe0), DICO(0x0ecd2820),
  8572. - DICO(0x17f05c00), DICO(0x1fdb4560), DICO(0x24b4c940), DICO(0x2968d0c0),
  8573. - DICO(0x2cbf3500), DICO(0x381eadc0), DICO(0x3d3baf40), DICO(0x42828080),
  8574. - DICO(0x47f36300), DICO(0x4c8c6600), DICO(0x51d66f00), DICO(0x5a7e0300),
  8575. - DICO(0x065c5cf8), DICO(0x08882540), DICO(0x0d887c70), DICO(0x112ac560),
  8576. - DICO(0x150ccdc0), DICO(0x19e49c20), DICO(0x1eb65680), DICO(0x2a76e040),
  8577. - DICO(0x2f65fc00), DICO(0x36d79cc0), DICO(0x3c85a900), DICO(0x408dc680),
  8578. - DICO(0x44964700), DICO(0x4a98eb00), DICO(0x5528b500), DICO(0x5d660f80),
  8579. - DICO(0x06b56230), DICO(0x08e340f0), DICO(0x0e1e4380), DICO(0x112d2d40),
  8580. - DICO(0x158dfde0), DICO(0x227e6040), DICO(0x26bff7c0), DICO(0x2b73a100),
  8581. - DICO(0x32199580), DICO(0x3585a240), DICO(0x398a5d40), DICO(0x3db8c6c0),
  8582. - DICO(0x43905600), DICO(0x4945f800), DICO(0x4f310380), DICO(0x5a6d2400),
  8583. - DICO(0x05cfc6f8), DICO(0x0832e650), DICO(0x0de82f80), DICO(0x1a1afe80),
  8584. - DICO(0x1e9a1f80), DICO(0x221acd80), DICO(0x27fa00c0), DICO(0x2c4df980),
  8585. - DICO(0x31e04bc0), DICO(0x38c9ed40), DICO(0x3db86080), DICO(0x428ec800),
  8586. - DICO(0x48500500), DICO(0x4e1ca580), DICO(0x53d3f500), DICO(0x5aa6be00),
  8587. - DICO(0x050cc4d0), DICO(0x070c2180), DICO(0x0c4ca980), DICO(0x0fce9f40),
  8588. - DICO(0x14af4160), DICO(0x2206a780), DICO(0x25848e80), DICO(0x2c2b84c0),
  8589. - DICO(0x35a39980), DICO(0x3914bd80), DICO(0x3caff580), DICO(0x3fcb0600),
  8590. - DICO(0x4426b380), DICO(0x486c9700), DICO(0x4f730480), DICO(0x5afd3980),
  8591. - DICO(0x05e40640), DICO(0x0830df50), DICO(0x0b9e83e0), DICO(0x158bacc0),
  8592. - DICO(0x1d0692e0), DICO(0x2021e0c0), DICO(0x26572e00), DICO(0x2d58cc40),
  8593. - DICO(0x30dd0f80), DICO(0x361d68c0), DICO(0x3e3086c0), DICO(0x42450800),
  8594. - DICO(0x46c25800), DICO(0x4c45cf00), DICO(0x51dd4200), DICO(0x57326500),
  8595. - DICO(0x04d32fa0), DICO(0x064ed2c0), DICO(0x0b07cd70), DICO(0x1c7f6da0),
  8596. - DICO(0x213bc140), DICO(0x25051fc0), DICO(0x295cd1c0), DICO(0x2c9f4f80),
  8597. - DICO(0x32271540), DICO(0x36a8ec80), DICO(0x3a8e6b40), DICO(0x3e137580),
  8598. - DICO(0x42795480), DICO(0x4779b780), DICO(0x4f7d9600), DICO(0x5c09b000),
  8599. - DICO(0x044b0748), DICO(0x05fee680), DICO(0x08f66960), DICO(0x11db5940),
  8600. - DICO(0x219ede80), DICO(0x27fb96c0), DICO(0x2affc980), DICO(0x2eadc3c0),
  8601. - DICO(0x32895700), DICO(0x37180d00), DICO(0x3d4bf880), DICO(0x41741980),
  8602. - DICO(0x460d8280), DICO(0x4c34be80), DICO(0x54531e80), DICO(0x5c874000),
  8603. - DICO(0x03e25dcc), DICO(0x069e8170), DICO(0x13b3d9c0), DICO(0x1a803260),
  8604. - DICO(0x1ed3a4a0), DICO(0x23ea6380), DICO(0x2883b900), DICO(0x2e0ceac0),
  8605. - DICO(0x3308e400), DICO(0x38796dc0), DICO(0x3e318e80), DICO(0x441da080),
  8606. - DICO(0x4a892300), DICO(0x509b9f80), DICO(0x56caa380), DICO(0x5cc39e00),
  8607. - DICO(0x05023038), DICO(0x06b6b4d8), DICO(0x0a449370), DICO(0x15b86ea0),
  8608. - DICO(0x224a9200), DICO(0x272e6f40), DICO(0x2a617700), DICO(0x2e915d00),
  8609. - DICO(0x3240ac40), DICO(0x37636300), DICO(0x3dd3ea80), DICO(0x420e1f80),
  8610. - DICO(0x45bf0680), DICO(0x4a26d980), DICO(0x4f82a900), DICO(0x56576800),
  8611. - DICO(0x03d630f4), DICO(0x082140a0), DICO(0x12644700), DICO(0x16b80cc0),
  8612. - DICO(0x1ba90c40), DICO(0x21c38300), DICO(0x27dd1480), DICO(0x2e18ee00),
  8613. - DICO(0x33fb72c0), DICO(0x39f9d980), DICO(0x40219300), DICO(0x4607fd00),
  8614. - DICO(0x4c07e500), DICO(0x51ba8f00), DICO(0x57a24280), DICO(0x5d367700),
  8615. - DICO(0x080a5880), DICO(0x0ef3f570), DICO(0x141fd6c0), DICO(0x17c163a0),
  8616. - DICO(0x1c2840a0), DICO(0x2111fe00), DICO(0x27376bc0), DICO(0x2cc7edc0),
  8617. - DICO(0x329b0100), DICO(0x386d3e40), DICO(0x3ec1bdc0), DICO(0x453f6200),
  8618. - DICO(0x4bf16080), DICO(0x51bded00), DICO(0x57ba6800), DICO(0x5d2ffd80),
  8619. - DICO(0x08643590), DICO(0x0e911f00), DICO(0x15911380), DICO(0x1ab5e180),
  8620. - DICO(0x207ff600), DICO(0x26399b00), DICO(0x2cadae80), DICO(0x3276ca40),
  8621. - DICO(0x389d9cc0), DICO(0x3eb22180), DICO(0x44570700), DICO(0x49d15800),
  8622. - DICO(0x4f591300), DICO(0x54566a80), DICO(0x5967db00), DICO(0x5e307780),
  8623. - DICO(0x07120fa8), DICO(0x0c791c60), DICO(0x112d3b60), DICO(0x149452a0),
  8624. - DICO(0x19d2c100), DICO(0x202f1540), DICO(0x269c10c0), DICO(0x2be22880),
  8625. - DICO(0x312a07c0), DICO(0x36984fc0), DICO(0x3c7ac3c0), DICO(0x435b5000),
  8626. - DICO(0x4aa60280), DICO(0x50f50c00), DICO(0x5719f700), DICO(0x5cb98680),
  8627. - DICO(0x05517c88), DICO(0x06ba0a70), DICO(0x0da167c0), DICO(0x19918440),
  8628. - DICO(0x1bb37220), DICO(0x20681080), DICO(0x23dc6740), DICO(0x2a1403c0),
  8629. - DICO(0x31a71580), DICO(0x34ff0600), DICO(0x395b7cc0), DICO(0x42019200),
  8630. - DICO(0x4c818d00), DICO(0x513ff400), DICO(0x5731ce00), DICO(0x5c5f1180),
  8631. - DICO(0x04f74ec0), DICO(0x067b4628), DICO(0x0dc4c9c0), DICO(0x19e9fa40),
  8632. - DICO(0x1cf00a00), DICO(0x21602a80), DICO(0x25334a80), DICO(0x29b3a800),
  8633. - DICO(0x2f9b3600), DICO(0x338c0540), DICO(0x370c3cc0), DICO(0x3abbc3c0),
  8634. - DICO(0x4053a000), DICO(0x4f14d980), DICO(0x57e0b600), DICO(0x5d95e780),
  8635. - DICO(0x05d844b8), DICO(0x07a05608), DICO(0x0b7837f0), DICO(0x161fb460),
  8636. - DICO(0x19c31d00), DICO(0x1cf36280), DICO(0x20ccc200), DICO(0x24ae3980),
  8637. - DICO(0x2e2b5800), DICO(0x3316af80), DICO(0x37432b00), DICO(0x4050b280),
  8638. - DICO(0x4605be00), DICO(0x4cc78900), DICO(0x556d2080), DICO(0x5c578300),
  8639. - DICO(0x0551b768), DICO(0x07024f60), DICO(0x1045fde0), DICO(0x16480120),
  8640. - DICO(0x19974420), DICO(0x1ec2b280), DICO(0x228b30c0), DICO(0x295e0ec0),
  8641. - DICO(0x2d8775c0), DICO(0x30ef1440), DICO(0x35978080), DICO(0x3a2ab480),
  8642. - DICO(0x40229780), DICO(0x4da40980), DICO(0x5718e480), DICO(0x5d68d400),
  8643. - DICO(0x03f903e4), DICO(0x06731580), DICO(0x0ecf4850), DICO(0x12e57920),
  8644. - DICO(0x1a69ece0), DICO(0x1fe32700), DICO(0x2585b9c0), DICO(0x2aa006c0),
  8645. - DICO(0x2f20ea80), DICO(0x37298bc0), DICO(0x3df2a000), DICO(0x44a6c600),
  8646. - DICO(0x4b10de00), DICO(0x510fb880), DICO(0x5749c280), DICO(0x5d0b9480),
  8647. - DICO(0x03c418fc), DICO(0x056c4cd0), DICO(0x0d0cf070), DICO(0x1907a2c0),
  8648. - DICO(0x1be9bc00), DICO(0x21599480), DICO(0x25700e40), DICO(0x2c83e280),
  8649. - DICO(0x329fa7c0), DICO(0x389f4cc0), DICO(0x3ef60900), DICO(0x44c19300),
  8650. - DICO(0x4af56d00), DICO(0x512eec80), DICO(0x5772ad00), DICO(0x5d37f380),
  8651. - DICO(0x04d57920), DICO(0x0716b5e0), DICO(0x0cb3bcc0), DICO(0x1197f740),
  8652. - DICO(0x163e5fc0), DICO(0x2194e400), DICO(0x274bb600), DICO(0x2f5d7080),
  8653. - DICO(0x361ee340), DICO(0x3b3b22c0), DICO(0x3f800400), DICO(0x4327ef80),
  8654. - DICO(0x48b5d200), DICO(0x5116d300), DICO(0x59652e80), DICO(0x5e444d00),
  8655. - DICO(0x0755b6b0), DICO(0x0b68c2c0), DICO(0x0f3441d0), DICO(0x124a01a0),
  8656. - DICO(0x18910600), DICO(0x20911b80), DICO(0x281f7100), DICO(0x2e4dd640),
  8657. - DICO(0x335bd8c0), DICO(0x37f14a80), DICO(0x3cab7b80), DICO(0x43be3180),
  8658. - DICO(0x4beee100), DICO(0x52292180), DICO(0x57efea00), DICO(0x5d177300),
  8659. - DICO(0x071a7748), DICO(0x0c6cf1b0), DICO(0x10db1500), DICO(0x143bca00),
  8660. - DICO(0x1b86a900), DICO(0x22ed1d80), DICO(0x2a1f61c0), DICO(0x305f1400),
  8661. - DICO(0x3645f580), DICO(0x3be45b00), DICO(0x4166ea80), DICO(0x46c3f200),
  8662. - DICO(0x4c740400), DICO(0x51e30d00), DICO(0x57a37000), DICO(0x5cfc4980),
  8663. - DICO(0x08cdd5b0), DICO(0x0daf9840), DICO(0x11cc02a0), DICO(0x1588ed40),
  8664. - DICO(0x1cfef5e0), DICO(0x239f12c0), DICO(0x296d3b40), DICO(0x2e61c240),
  8665. - DICO(0x333dc800), DICO(0x385d0000), DICO(0x3e1e5180), DICO(0x44196e00),
  8666. - DICO(0x4a833000), DICO(0x503d7b80), DICO(0x56556680), DICO(0x5c410c00),
  8667. - DICO(0x07372408), DICO(0x0d5c41f0), DICO(0x155dc140), DICO(0x1a9a3cc0),
  8668. - DICO(0x21740980), DICO(0x27139f40), DICO(0x2c977040), DICO(0x30cfe5c0),
  8669. - DICO(0x35381240), DICO(0x39b83140), DICO(0x3ef3fe80), DICO(0x44547200),
  8670. - DICO(0x4a812800), DICO(0x5046c200), DICO(0x56957d00), DICO(0x5c85cd80),
  8671. - DICO(0x06da6990), DICO(0x0bc41250), DICO(0x13d54800), DICO(0x1979c220),
  8672. - DICO(0x1fad2f00), DICO(0x24bbe0c0), DICO(0x29c08f00), DICO(0x2e34b940),
  8673. - DICO(0x32c89e40), DICO(0x376a2040), DICO(0x3cd81080), DICO(0x4267bd00),
  8674. - DICO(0x48e8e800), DICO(0x4f150280), DICO(0x55cb1980), DICO(0x5c428b80),
  8675. - DICO(0x087d45d0), DICO(0x0cf1ef20), DICO(0x135cba20), DICO(0x16fc7420),
  8676. - DICO(0x1b2772e0), DICO(0x1fd4fe60), DICO(0x260a0b80), DICO(0x2bc54c00),
  8677. - DICO(0x31694cc0), DICO(0x36d08080), DICO(0x3c245c80), DICO(0x41170900),
  8678. - DICO(0x47b18600), DICO(0x4e706180), DICO(0x558d2000), DICO(0x5c428d00),
  8679. - DICO(0x081e6490), DICO(0x0d16a7d0), DICO(0x124ccd20), DICO(0x154c20c0),
  8680. - DICO(0x1945d8c0), DICO(0x1ee0b700), DICO(0x26a01f00), DICO(0x2d554e40),
  8681. - DICO(0x3432eb80), DICO(0x3a605500), DICO(0x401d8980), DICO(0x45737680),
  8682. - DICO(0x4b03cb00), DICO(0x50666780), DICO(0x56a0cd00), DICO(0x5cb46480),
  8683. - DICO(0x06c58278), DICO(0x091b10b0), DICO(0x0e0e74f0), DICO(0x11faf980),
  8684. - DICO(0x14a48600), DICO(0x1e6f7500), DICO(0x27f77100), DICO(0x2ab49940),
  8685. - DICO(0x32a1f680), DICO(0x38cb2a80), DICO(0x3c3ff140), DICO(0x3f681cc0),
  8686. - DICO(0x44310700), DICO(0x4fa21700), DICO(0x586c6180), DICO(0x5df74200),
  8687. - DICO(0x06a3e478), DICO(0x09714400), DICO(0x0d90b7a0), DICO(0x12df2720),
  8688. - DICO(0x1618f320), DICO(0x1ac52840), DICO(0x27612900), DICO(0x2e438e00),
  8689. - DICO(0x322b6ac0), DICO(0x38022940), DICO(0x3d2a5180), DICO(0x40d76b80),
  8690. - DICO(0x46671500), DICO(0x4c5bd480), DICO(0x517a2500), DICO(0x57775b00),
  8691. - DICO(0x056c2230), DICO(0x07b8f9d8), DICO(0x0bc6e060), DICO(0x16ac2c80),
  8692. - DICO(0x1a92fc00), DICO(0x1e15f000), DICO(0x28b73200), DICO(0x2cd9e5c0),
  8693. - DICO(0x3196ecc0), DICO(0x3abae340), DICO(0x4040c580), DICO(0x44c18d80),
  8694. - DICO(0x4c086800), DICO(0x50b78500), DICO(0x54e42600), DICO(0x5a549a80),
  8695. - DICO(0x04f9fa10), DICO(0x07419358), DICO(0x0c3e15f0), DICO(0x174c1800),
  8696. - DICO(0x1ab1fe60), DICO(0x23a12680), DICO(0x27955780), DICO(0x2d14b1c0),
  8697. - DICO(0x35cefb00), DICO(0x39576700), DICO(0x3e82b780), DICO(0x42b6a680),
  8698. - DICO(0x476d1880), DICO(0x4b6cdd00), DICO(0x52758680), DICO(0x5b69e500),
  8699. - DICO(0x060b7ab0), DICO(0x081c05c0), DICO(0x0b540300), DICO(0x0f564270),
  8700. - DICO(0x1210aa80), DICO(0x1771e060), DICO(0x25d73280), DICO(0x2e49e380),
  8701. - DICO(0x319c1100), DICO(0x3771e700), DICO(0x3c532f40), DICO(0x40c9a900),
  8702. - DICO(0x48cbf580), DICO(0x4f819980), DICO(0x566f9400), DICO(0x5cfdd980),
  8703. - DICO(0x04efb7b8), DICO(0x0b8a3710), DICO(0x124fd520), DICO(0x1846dde0),
  8704. - DICO(0x1e77a9e0), DICO(0x243ea800), DICO(0x2a4e3280), DICO(0x2ff532c0),
  8705. - DICO(0x35d27680), DICO(0x3b8cdb00), DICO(0x41463000), DICO(0x4706c700),
  8706. - DICO(0x4ca42d80), DICO(0x525d9200), DICO(0x57dabb80), DICO(0x5d59a800),
  8707. - DICO(0x03620dec), DICO(0x095872e0), DICO(0x108d4920), DICO(0x16e9ea00),
  8708. - DICO(0x1d60b2e0), DICO(0x235e9d00), DICO(0x29893b80), DICO(0x2f59a3c0),
  8709. - DICO(0x3556b880), DICO(0x3b10bdc0), DICO(0x40f49500), DICO(0x469cc480),
  8710. - DICO(0x4c762d00), DICO(0x51f16980), DICO(0x578c6d00), DICO(0x5c9b5a00),
  8711. - DICO(0x05dd9bc0), DICO(0x079c5b20), DICO(0x0d319af0), DICO(0x18997040),
  8712. - DICO(0x1c0a1980), DICO(0x20e926c0), DICO(0x25ca1640), DICO(0x29879340),
  8713. - DICO(0x30b27040), DICO(0x36077340), DICO(0x39ac3d00), DICO(0x3d686cc0),
  8714. - DICO(0x428e5f00), DICO(0x47c1bf80), DICO(0x4e720800), DICO(0x5b419880),
  8715. - DICO(0x07694258), DICO(0x0b50db90), DICO(0x0f384950), DICO(0x140dac40),
  8716. - DICO(0x17c50d80), DICO(0x1b49b300), DICO(0x24746200), DICO(0x2ce92fc0),
  8717. - DICO(0x309fdac0), DICO(0x35c02a00), DICO(0x3aa3df00), DICO(0x3e1edb00),
  8718. - DICO(0x431ad280), DICO(0x4b57f500), DICO(0x51463980), DICO(0x586b5200),
  8719. - DICO(0x06401dd0), DICO(0x08d3d9b0), DICO(0x0ca0f510), DICO(0x10ed1920),
  8720. - DICO(0x1451c2e0), DICO(0x2082f640), DICO(0x2872c0c0), DICO(0x2ca9da00),
  8721. - DICO(0x3219cd00), DICO(0x35977300), DICO(0x3a8ba1c0), DICO(0x43d5f280),
  8722. - DICO(0x49a51f00), DICO(0x4de9b400), DICO(0x5362ef80), DICO(0x59387300),
  8723. - DICO(0x0589c430), DICO(0x07809918), DICO(0x0d086f80), DICO(0x10371c20),
  8724. - DICO(0x151842c0), DICO(0x1bfcb1c0), DICO(0x22441040), DICO(0x2722b5c0),
  8725. - DICO(0x2b603fc0), DICO(0x314465c0), DICO(0x40308b00), DICO(0x47d5a200),
  8726. - DICO(0x4bf7e000), DICO(0x4f937200), DICO(0x5584eb00), DICO(0x5cb02200),
  8727. - DICO(0x03b592f0), DICO(0x056ba738), DICO(0x0a8e2250), DICO(0x172436c0),
  8728. - DICO(0x1ad35da0), DICO(0x1d72dc80), DICO(0x20cd3900), DICO(0x2a962940),
  8729. - DICO(0x2f3b6700), DICO(0x33312b40), DICO(0x38dc6680), DICO(0x41659200),
  8730. - DICO(0x4d36a380), DICO(0x52b00980), DICO(0x58c82800), DICO(0x5d741600),
  8731. - DICO(0x05bdfe10), DICO(0x0756da20), DICO(0x0cd31fe0), DICO(0x130f1820),
  8732. - DICO(0x1561caa0), DICO(0x1962ab20), DICO(0x1c310840), DICO(0x28bf6f80),
  8733. - DICO(0x2d2d4500), DICO(0x3230f900), DICO(0x3ac2ea80), DICO(0x3ebe71c0),
  8734. - DICO(0x48280700), DICO(0x50254900), DICO(0x5850a200), DICO(0x5e687200),
  8735. - DICO(0x04e2b7e8), DICO(0x067f5430), DICO(0x0a8899a0), DICO(0x0d571560),
  8736. - DICO(0x1c42f440), DICO(0x22e21fc0), DICO(0x27074340), DICO(0x2c493240),
  8737. - DICO(0x2f7ece00), DICO(0x33959ec0), DICO(0x392d3000), DICO(0x459fc800),
  8738. - DICO(0x4ba5f700), DICO(0x4fde7780), DICO(0x55f90380), DICO(0x5c928b00),
  8739. - DICO(0x0557b940), DICO(0x075f0158), DICO(0x0bd8c540), DICO(0x0f4ee370),
  8740. - DICO(0x141dc900), DICO(0x1b241f00), DICO(0x21c32a80), DICO(0x29a23980),
  8741. - DICO(0x2e475380), DICO(0x3616f9c0), DICO(0x3a52a500), DICO(0x40345f00),
  8742. - DICO(0x4763a500), DICO(0x4eb5bb80), DICO(0x561d4480), DICO(0x5d388580),
  8743. - DICO(0x057d7d08), DICO(0x0738c240), DICO(0x0bf46e10), DICO(0x0ec93da0),
  8744. - DICO(0x14ab3cc0), DICO(0x23d0f5c0), DICO(0x271e9900), DICO(0x2c0ee4c0),
  8745. - DICO(0x301d1f00), DICO(0x33868040), DICO(0x37cdde00), DICO(0x3c805440),
  8746. - DICO(0x43c69200), DICO(0x4f5c9a00), DICO(0x56eb3e80), DICO(0x5cdadc80),
  8747. - DICO(0x06cdbab0), DICO(0x0999e600), DICO(0x0df39790), DICO(0x12ffc9a0),
  8748. - DICO(0x15cfe7a0), DICO(0x1c599300), DICO(0x21afd600), DICO(0x26842bc0),
  8749. - DICO(0x32067c00), DICO(0x368bb080), DICO(0x3c350c40), DICO(0x44e8be00),
  8750. - DICO(0x4ac84000), DICO(0x4f9c1280), DICO(0x5449ec00), DICO(0x594d5880),
  8751. - DICO(0x049a6bd0), DICO(0x06849f08), DICO(0x10592b40), DICO(0x168c1940),
  8752. - DICO(0x1992df40), DICO(0x1e91b300), DICO(0x2237e100), DICO(0x2cd73a80),
  8753. - DICO(0x30e7c100), DICO(0x361a45c0), DICO(0x3cdd1f40), DICO(0x41d5d100),
  8754. - DICO(0x46f79480), DICO(0x4e44c880), DICO(0x55830e80), DICO(0x5d7c0680),
  8755. - DICO(0x05087958), DICO(0x06fb7e40), DICO(0x0ac5ace0), DICO(0x14e91d80),
  8756. - DICO(0x19ac68c0), DICO(0x1dbf7600), DICO(0x26f916c0), DICO(0x2bd2c980),
  8757. - DICO(0x307f7900), DICO(0x38e07e40), DICO(0x3df7f1c0), DICO(0x41323d00),
  8758. - DICO(0x44d2f480), DICO(0x48fb0480), DICO(0x51e17900), DICO(0x5c15d700),
  8759. - DICO(0x0346cf40), DICO(0x05423408), DICO(0x0b640ce0), DICO(0x13055060),
  8760. - DICO(0x1a8c0b60), DICO(0x1d8d2280), DICO(0x218b6500), DICO(0x2c385700),
  8761. - DICO(0x30927b40), DICO(0x35d82880), DICO(0x3aa87e00), DICO(0x3da46a40),
  8762. - DICO(0x45ea5280), DICO(0x511ecb80), DICO(0x57b53b00), DICO(0x5d491400),
  8763. - DICO(0x056aa1c8), DICO(0x075a09a0), DICO(0x0a5d61d0), DICO(0x13cb9fe0),
  8764. - DICO(0x1f924dc0), DICO(0x237a11c0), DICO(0x277d6b80), DICO(0x2c2ba440),
  8765. - DICO(0x30195c80), DICO(0x35250cc0), DICO(0x3b718200), DICO(0x40113c80),
  8766. - DICO(0x44df2680), DICO(0x49f0ed80), DICO(0x50791980), DICO(0x5ac10600),
  8767. - DICO(0x046f1e50), DICO(0x061dd758), DICO(0x1236bec0), DICO(0x16c07340),
  8768. - DICO(0x1a7399c0), DICO(0x1f61ee20), DICO(0x244b2280), DICO(0x2b803e40),
  8769. - DICO(0x2eda5300), DICO(0x331210c0), DICO(0x3773bfc0), DICO(0x411c8400),
  8770. - DICO(0x488ff380), DICO(0x4fad2700), DICO(0x55845000), DICO(0x5ca74c00),
  8771. - DICO(0x04b456f0), DICO(0x05fca198), DICO(0x0ad056d0), DICO(0x19c3bfe0),
  8772. - DICO(0x1d446100), DICO(0x20f67200), DICO(0x24a40b40), DICO(0x28d472c0),
  8773. - DICO(0x2da813c0), DICO(0x31880200), DICO(0x35344f40), DICO(0x3ca7f340),
  8774. - DICO(0x4aa94300), DICO(0x4f921500), DICO(0x5516d700), DICO(0x5c832880),
  8775. - DICO(0x07f468c0), DICO(0x0bbb6e90), DICO(0x0f0f8730), DICO(0x143d6180),
  8776. - DICO(0x198b84c0), DICO(0x1c6b30a0), DICO(0x219c8000), DICO(0x28795780),
  8777. - DICO(0x2cce3d00), DICO(0x329b1100), DICO(0x3a8d2240), DICO(0x3f579080),
  8778. - DICO(0x45a74400), DICO(0x4d000f80), DICO(0x52bd6880), DICO(0x5a743a80),
  8779. - DICO(0x06979498), DICO(0x088fecf0), DICO(0x0f1dac90), DICO(0x12077160),
  8780. - DICO(0x16d5b120), DICO(0x1c5465c0), DICO(0x21ad14c0), DICO(0x282be280),
  8781. - DICO(0x2b66a380), DICO(0x2fa3f200), DICO(0x35a06500), DICO(0x3a458d00),
  8782. - DICO(0x44aefc00), DICO(0x4e92f600), DICO(0x55b9fa80), DICO(0x5cfe0280),
  8783. - DICO(0x0552b408), DICO(0x06f6ce38), DICO(0x0e8f8d80), DICO(0x1395e900),
  8784. - DICO(0x17c7b440), DICO(0x1ec64dc0), DICO(0x236e2200), DICO(0x2abc0b80),
  8785. - DICO(0x2e131240), DICO(0x32921100), DICO(0x372633c0), DICO(0x3ca97840),
  8786. - DICO(0x496e5000), DICO(0x4f86a800), DICO(0x54072300), DICO(0x5be31c80),
  8787. - DICO(0x0470c0b8), DICO(0x0662c468), DICO(0x0c493fd0), DICO(0x1a1949c0),
  8788. - DICO(0x1febcc20), DICO(0x2364e900), DICO(0x2a0cce00), DICO(0x2f6f8140),
  8789. - DICO(0x3418b000), DICO(0x3c5c7a40), DICO(0x42d39100), DICO(0x476c2b00),
  8790. - DICO(0x4e11c300), DICO(0x53621500), DICO(0x583fd280), DICO(0x5ce26600),
  8791. - DICO(0x04b006c0), DICO(0x09a1ed40), DICO(0x135aee00), DICO(0x193b5180),
  8792. - DICO(0x1f3679a0), DICO(0x24fdbcc0), DICO(0x2b823e00), DICO(0x31835780),
  8793. - DICO(0x37c74cc0), DICO(0x3df66780), DICO(0x43c18580), DICO(0x49465980),
  8794. - DICO(0x4ed0ce00), DICO(0x53d6fb80), DICO(0x59064300), DICO(0x5deaa100),
  8795. - DICO(0x03cbc49c), DICO(0x07735930), DICO(0x138aaa20), DICO(0x1a1e69a0),
  8796. - DICO(0x21be93c0), DICO(0x2936f780), DICO(0x2fa76f80), DICO(0x34ae6b00),
  8797. - DICO(0x396b7b80), DICO(0x3dbc6700), DICO(0x421a9100), DICO(0x46fd2180),
  8798. - DICO(0x4c5dca80), DICO(0x51923b80), DICO(0x576d1300), DICO(0x5d288680),
  8799. - DICO(0x03cab7d0), DICO(0x052c88b8), DICO(0x09ed24f0), DICO(0x1c261820),
  8800. - DICO(0x209096c0), DICO(0x2361e080), DICO(0x27292800), DICO(0x2bbdc6c0),
  8801. - DICO(0x3292da80), DICO(0x36866a40), DICO(0x3c4d5100), DICO(0x45233400),
  8802. - DICO(0x4d928a00), DICO(0x52ca9d00), DICO(0x5820d000), DICO(0x5d903880),
  8803. - DICO(0x03f83718), DICO(0x0540fa90), DICO(0x13028120), DICO(0x1ad6e160),
  8804. - DICO(0x1d784880), DICO(0x22028900), DICO(0x25976b40), DICO(0x2b293700),
  8805. - DICO(0x2ddb86c0), DICO(0x317c4340), DICO(0x34e62ec0), DICO(0x3b71bd00),
  8806. - DICO(0x4bc34780), DICO(0x52982400), DICO(0x57fa2800), DICO(0x5f19cc00),
  8807. - DICO(0x049ceb50), DICO(0x06a8d4e0), DICO(0x09db2470), DICO(0x120e3e60),
  8808. - DICO(0x1c8ebb80), DICO(0x21221d00), DICO(0x2679bfc0), DICO(0x2b1e7600),
  8809. - DICO(0x2ebbcf80), DICO(0x32d5afc0), DICO(0x3d1bef00), DICO(0x41b11a00),
  8810. - DICO(0x45bb2d80), DICO(0x4cb70300), DICO(0x572fdc80), DICO(0x5d876e80),
  8811. - DICO(0x04abda68), DICO(0x06698cd0), DICO(0x0ca87230), DICO(0x15086a80),
  8812. - DICO(0x176cf4e0), DICO(0x22899440), DICO(0x268fc500), DICO(0x2ba2d940),
  8813. - DICO(0x33505980), DICO(0x36944bc0), DICO(0x3b20c280), DICO(0x437e8f00),
  8814. - DICO(0x4bf29e80), DICO(0x51776a80), DICO(0x57a77800), DICO(0x5cf6c180),
  8815. - DICO(0x06d7f5c0), DICO(0x08fd3cc0), DICO(0x0d8807e0), DICO(0x1140d500),
  8816. - DICO(0x146dfc80), DICO(0x1e9fbaa0), DICO(0x23d7bf00), DICO(0x28b2ae80),
  8817. - DICO(0x2e5a9b00), DICO(0x327005c0), DICO(0x37736640), DICO(0x4001c500),
  8818. - DICO(0x4a862b00), DICO(0x4f7a2e00), DICO(0x54a22080), DICO(0x5b76c380),
  8819. - DICO(0x0671fb68), DICO(0x08e4bf30), DICO(0x0d801250), DICO(0x1176b820),
  8820. - DICO(0x15128860), DICO(0x1ee21180), DICO(0x24799580), DICO(0x29415a40),
  8821. - DICO(0x2efa2380), DICO(0x33fe5040), DICO(0x39bf6d00), DICO(0x3f28b380),
  8822. - DICO(0x442b2280), DICO(0x493de680), DICO(0x54377700), DICO(0x5d3a5480),
  8823. - DICO(0x065b7970), DICO(0x087820b0), DICO(0x0d8d6aa0), DICO(0x16718620),
  8824. - DICO(0x1a3a8f40), DICO(0x1f4099c0), DICO(0x24d87b40), DICO(0x296d85c0),
  8825. - DICO(0x2f887c80), DICO(0x342d1b40), DICO(0x3887fc40), DICO(0x3d758b40),
  8826. - DICO(0x42641c80), DICO(0x47bf6980), DICO(0x55f82900), DICO(0x5e132a00),
  8827. - DICO(0x05ddbc00), DICO(0x081f17a0), DICO(0x0bf23ac0), DICO(0x12fc8d60),
  8828. - DICO(0x172bc440), DICO(0x1a833540), DICO(0x1e942200), DICO(0x21e477c0),
  8829. - DICO(0x2e75da80), DICO(0x399efac0), DICO(0x3dfb6900), DICO(0x428b3780),
  8830. - DICO(0x4922a080), DICO(0x4d4c1700), DICO(0x51bbee00), DICO(0x5b4cfc80),
  8831. - DICO(0x06ecf380), DICO(0x08f83990), DICO(0x0cb55680), DICO(0x140b2860),
  8832. - DICO(0x18084d00), DICO(0x1aff9940), DICO(0x1f5f6f00), DICO(0x224a3d80),
  8833. - DICO(0x2b0f49c0), DICO(0x3613b280), DICO(0x39188f40), DICO(0x3efa3640),
  8834. - DICO(0x4771e400), DICO(0x4ca32380), DICO(0x54627580), DICO(0x5cb91000),
  8835. - DICO(0x069e7f98), DICO(0x0870c760), DICO(0x0d7b73a0), DICO(0x15ab1040),
  8836. - DICO(0x18a4d220), DICO(0x1c4c1f20), DICO(0x1ffaf200), DICO(0x24142580),
  8837. - DICO(0x30e47540), DICO(0x37340200), DICO(0x3a69af40), DICO(0x3ed471c0),
  8838. - DICO(0x44157880), DICO(0x486b7f00), DICO(0x52ed2b00), DICO(0x5ce3a980),
  8839. - DICO(0x047f1080), DICO(0x06463230), DICO(0x0b566e80), DICO(0x0edb9080),
  8840. - DICO(0x128a2fa0), DICO(0x1748b340), DICO(0x210b2b00), DICO(0x28099b80),
  8841. - DICO(0x2f519740), DICO(0x36fe82c0), DICO(0x3d924b80), DICO(0x43cd3c00),
  8842. - DICO(0x4a774680), DICO(0x50d15f00), DICO(0x573b3580), DICO(0x5d4c1c00),
  8843. - DICO(0x05fa6a68), DICO(0x0866e4c0), DICO(0x0d133cc0), DICO(0x156d6b20),
  8844. - DICO(0x18abebe0), DICO(0x1d374900), DICO(0x23d23d00), DICO(0x27b370c0),
  8845. - DICO(0x2f63ef00), DICO(0x352a0600), DICO(0x3a643a40), DICO(0x3f57f980),
  8846. - DICO(0x457a7f00), DICO(0x520f6200), DICO(0x593b2c80), DICO(0x5e192b80),
  8847. - DICO(0x04e4e0c8), DICO(0x067c3450), DICO(0x0acabe70), DICO(0x1865eec0),
  8848. - DICO(0x1c5e9bc0), DICO(0x202facc0), DICO(0x24a609c0), DICO(0x28db7b00),
  8849. - DICO(0x2efbd780), DICO(0x336fe5c0), DICO(0x3819a5c0), DICO(0x3e709b40),
  8850. - DICO(0x4435ff80), DICO(0x4bd5fb80), DICO(0x5564a100), DICO(0x5d0a4980),
  8851. - DICO(0x05a72f00), DICO(0x070199b0), DICO(0x0e654780), DICO(0x14fc7780),
  8852. - DICO(0x174283c0), DICO(0x1b231480), DICO(0x1e7b9000), DICO(0x27a013c0),
  8853. - DICO(0x2b42f500), DICO(0x2fd9ca00), DICO(0x3672a0c0), DICO(0x3cc23f40),
  8854. - DICO(0x48299d80), DICO(0x4f92a800), DICO(0x564d7680), DICO(0x5d3ab580),
  8855. - DICO(0x03e63764), DICO(0x05baa3f0), DICO(0x0ab2a300), DICO(0x12cc5f60),
  8856. - DICO(0x19a8d5e0), DICO(0x1ea788e0), DICO(0x22cd50c0), DICO(0x25d48a00),
  8857. - DICO(0x29924540), DICO(0x32762a00), DICO(0x3bba55c0), DICO(0x4222e800),
  8858. - DICO(0x4aba1280), DICO(0x501d0b80), DICO(0x57091200), DICO(0x5d6bf180),
  8859. - DICO(0x047daeb0), DICO(0x069548b8), DICO(0x0b002410), DICO(0x13ff7060),
  8860. - DICO(0x186aec40), DICO(0x210db240), DICO(0x26f1ce80), DICO(0x2b73c9c0),
  8861. - DICO(0x33d57240), DICO(0x385898c0), DICO(0x3eea8cc0), DICO(0x43c79b00),
  8862. - DICO(0x496ec200), DICO(0x4e150780), DICO(0x54dcb700), DICO(0x5c3f7380),
  8863. - DICO(0x079fd258), DICO(0x0b93bd50), DICO(0x0ff7d8b0), DICO(0x14bd4e00),
  8864. - DICO(0x19536ae0), DICO(0x1d8b1640), DICO(0x23747cc0), DICO(0x2861f280),
  8865. - DICO(0x2d7d2880), DICO(0x3583b040), DICO(0x3c3cab00), DICO(0x41b7b580),
  8866. - DICO(0x498cfc80), DICO(0x506cbd00), DICO(0x57847600), DICO(0x5d05de80),
  8867. - DICO(0x06434ec0), DICO(0x0805ccd0), DICO(0x0c4b4c00), DICO(0x13d551c0),
  8868. - DICO(0x1685abe0), DICO(0x1a83ea60), DICO(0x1ddc3700), DICO(0x22bc4600),
  8869. - DICO(0x2c7ca5c0), DICO(0x30a589c0), DICO(0x395a8700), DICO(0x40c92900),
  8870. - DICO(0x472fae80), DICO(0x4f6f6e80), DICO(0x571b3f80), DICO(0x5d8e6980),
  8871. - DICO(0x05ec21b0), DICO(0x079ee388), DICO(0x0e4b4580), DICO(0x11abf100),
  8872. - DICO(0x16588ec0), DICO(0x1c984ec0), DICO(0x20a384c0), DICO(0x28d6be00),
  8873. - DICO(0x2bcca740), DICO(0x3604b600), DICO(0x3f027280), DICO(0x434af000),
  8874. - DICO(0x48dac280), DICO(0x4d7e8a00), DICO(0x51f61800), DICO(0x5a6d9380),
  8875. - DICO(0x0552c6c0), DICO(0x070c22a0), DICO(0x0a411b50), DICO(0x0e3e5270),
  8876. - DICO(0x1193bb60), DICO(0x1b177e00), DICO(0x275b2500), DICO(0x2b42bd80),
  8877. - DICO(0x322d7e40), DICO(0x3a170880), DICO(0x3d66b580), DICO(0x41413280),
  8878. - DICO(0x46a9ce80), DICO(0x4e4e3800), DICO(0x571f8380), DICO(0x5ddae380),
  8879. - DICO(0x055602c0), DICO(0x06e69118), DICO(0x0c9d13f0), DICO(0x1090d500),
  8880. - DICO(0x138d2280), DICO(0x171bf540), DICO(0x1b585180), DICO(0x288b9740),
  8881. - DICO(0x2db202c0), DICO(0x3525e680), DICO(0x3c303900), DICO(0x4311df80),
  8882. - DICO(0x49b92c00), DICO(0x509de900), DICO(0x56e9a080), DICO(0x5d523a80),
  8883. - DICO(0x04e79810), DICO(0x069626e8), DICO(0x0a6cf680), DICO(0x0da668c0),
  8884. - DICO(0x115872a0), DICO(0x2032eec0), DICO(0x25345dc0), DICO(0x2ae8ea40),
  8885. - DICO(0x30224280), DICO(0x351ff640), DICO(0x3ce65a80), DICO(0x454bff00),
  8886. - DICO(0x4ee08980), DICO(0x543b4280), DICO(0x59c19280), DICO(0x5ddfbb00),
  8887. - DICO(0x03f0bb98), DICO(0x0588f4f0), DICO(0x0a862bc0), DICO(0x14ec76e0),
  8888. - DICO(0x184b8a80), DICO(0x1f7bbd80), DICO(0x23f1a7c0), DICO(0x2c367900),
  8889. - DICO(0x3234af80), DICO(0x35460ac0), DICO(0x38514c00), DICO(0x3d5f3540),
  8890. - DICO(0x48394980), DICO(0x4fbdd380), DICO(0x56de0280), DICO(0x5d4e6500),
  8891. - DICO(0x06050f28), DICO(0x08070af0), DICO(0x0be31240), DICO(0x0f5e53e0),
  8892. - DICO(0x125f1740), DICO(0x215b1fc0), DICO(0x2883d880), DICO(0x2c181080),
  8893. - DICO(0x32810280), DICO(0x35d56800), DICO(0x3a9b0880), DICO(0x3ffaaf80),
  8894. - DICO(0x44c65500), DICO(0x4a45ae80), DICO(0x56b4ed80), DICO(0x5e4adc00),
  8895. - DICO(0x0372bbb4), DICO(0x04ea4848), DICO(0x09b8de70), DICO(0x151b4a40),
  8896. - DICO(0x1be65a00), DICO(0x207655c0), DICO(0x2720dd00), DICO(0x2fc6cc00),
  8897. - DICO(0x35b063c0), DICO(0x39bd30c0), DICO(0x3dc5b580), DICO(0x42af7b00),
  8898. - DICO(0x48d2bf00), DICO(0x4f46bb80), DICO(0x55f7ca80), DICO(0x5ca7e980),
  8899. - DICO(0x033f868c), DICO(0x04d9a0e0), DICO(0x0a18d6d0), DICO(0x13da5580),
  8900. - DICO(0x181ae880), DICO(0x207d8580), DICO(0x262022c0), DICO(0x2c6de040),
  8901. - DICO(0x3321f100), DICO(0x3927f0c0), DICO(0x3f74ce40), DICO(0x4573e980),
  8902. - DICO(0x4ba66c80), DICO(0x51a26100), DICO(0x57d3a800), DICO(0x5d52e780),
  8903. - DICO(0x05189860), DICO(0x07231848), DICO(0x0b915710), DICO(0x0f05d6c0),
  8904. - DICO(0x13bb0820), DICO(0x223adf00), DICO(0x26ce1ec0), DICO(0x2ce1ac00),
  8905. - DICO(0x3401f6c0), DICO(0x3b8c2240), DICO(0x40e4a400), DICO(0x45674f00),
  8906. - DICO(0x4b04b880), DICO(0x4f253200), DICO(0x54168600), DICO(0x58f52780),
  8907. - DICO(0x0338d184), DICO(0x05205790), DICO(0x09abcd80), DICO(0x0f53ff60),
  8908. - DICO(0x1a7fe900), DICO(0x1ef93860), DICO(0x238e2d80), DICO(0x2bd81bc0),
  8909. - DICO(0x33161240), DICO(0x368cfb80), DICO(0x3a28b5c0), DICO(0x40c7a600),
  8910. - DICO(0x4bac7780), DICO(0x524b7880), DICO(0x58638480), DICO(0x5da07b00),
  8911. - DICO(0x04d06f38), DICO(0x065f1518), DICO(0x0c9b31b0), DICO(0x10570d40),
  8912. - DICO(0x15e790a0), DICO(0x20f16380), DICO(0x246f23c0), DICO(0x2e222800),
  8913. - DICO(0x3198bf00), DICO(0x34b84640), DICO(0x38f5b440), DICO(0x4312df80),
  8914. - DICO(0x4d2d3000), DICO(0x5209ee80), DICO(0x579cf180), DICO(0x5cb37680),
  8915. - DICO(0x042e6560), DICO(0x05eaff30), DICO(0x0a090d30), DICO(0x0d9f2ab0),
  8916. - DICO(0x1a6f0260), DICO(0x209e0c00), DICO(0x25dc95c0), DICO(0x29f89840),
  8917. - DICO(0x2f372840), DICO(0x3a301940), DICO(0x3f0e2e80), DICO(0x44465c80),
  8918. - DICO(0x49207780), DICO(0x4dfdab80), DICO(0x532ec000), DICO(0x5acefd00),
  8919. - DICO(0x04e18ad8), DICO(0x06d5b660), DICO(0x0b2a22d0), DICO(0x0e0e4ef0),
  8920. - DICO(0x198304a0), DICO(0x1e4a25c0), DICO(0x23de37c0), DICO(0x290679c0),
  8921. - DICO(0x2d523b00), DICO(0x337df940), DICO(0x37948100), DICO(0x3de07300),
  8922. - DICO(0x49ee6e80), DICO(0x50576100), DICO(0x55fb1e00), DICO(0x5d080500),
  8923. - DICO(0x05312308), DICO(0x070463f0), DICO(0x0daffba0), DICO(0x12d8c3c0),
  8924. - DICO(0x163ab7a0), DICO(0x20c64c40), DICO(0x24c8fe40), DICO(0x2a6f65c0),
  8925. - DICO(0x3055e100), DICO(0x34420d80), DICO(0x389ded00), DICO(0x3cc57640),
  8926. - DICO(0x4280cd00), DICO(0x4e0a4c00), DICO(0x57675f00), DICO(0x5d87d480),
  8927. - DICO(0x047bd598), DICO(0x06cb1498), DICO(0x0c359930), DICO(0x138165e0),
  8928. - DICO(0x1cae3640), DICO(0x21647640), DICO(0x2836fac0), DICO(0x2cd7b840),
  8929. - DICO(0x30d839c0), DICO(0x360c9440), DICO(0x3ae5ca40), DICO(0x40a93b00),
  8930. - DICO(0x49401e80), DICO(0x4f739c80), DICO(0x54f33c00), DICO(0x5c190200),
  8931. - DICO(0x051c0000), DICO(0x06b45258), DICO(0x0a5eee50), DICO(0x0d46fc30),
  8932. - DICO(0x125bbc60), DICO(0x253d8cc0), DICO(0x2a1fd6c0), DICO(0x2df4cf80),
  8933. - DICO(0x3239e3c0), DICO(0x35a683c0), DICO(0x3b0bb980), DICO(0x409b3d00),
  8934. - DICO(0x46633580), DICO(0x4f2b0600), DICO(0x577cea80), DICO(0x5d86ef00),
  8935. - DICO(0x03d19eec), DICO(0x07cce6d0), DICO(0x143b4b00), DICO(0x1a657880),
  8936. - DICO(0x212e0280), DICO(0x2831fbc0), DICO(0x2f8ba080), DICO(0x35db8040),
  8937. - DICO(0x3bf17f00), DICO(0x413eb100), DICO(0x46154900), DICO(0x4ae18080),
  8938. - DICO(0x4f9ba180), DICO(0x5428ba00), DICO(0x590e9080), DICO(0x5de0d880),
  8939. - DICO(0x08c7e720), DICO(0x0ff14810), DICO(0x1758cc40), DICO(0x1cc744c0),
  8940. - DICO(0x23e45cc0), DICO(0x2b527940), DICO(0x32138580), DICO(0x37b77380),
  8941. - DICO(0x3d7da480), DICO(0x4275a800), DICO(0x473ecf00), DICO(0x4bc7dc80),
  8942. - DICO(0x50512400), DICO(0x54d2c600), DICO(0x598ce680), DICO(0x5e1e0800),
  8943. - DICO(0x09167910), DICO(0x107644a0), DICO(0x171a59e0), DICO(0x1be1ea60),
  8944. - DICO(0x21347680), DICO(0x265a5b00), DICO(0x2be41a40), DICO(0x3116e700),
  8945. - DICO(0x368b0300), DICO(0x3c225e80), DICO(0x41a6e880), DICO(0x47631680),
  8946. - DICO(0x4d47d900), DICO(0x52a28400), DICO(0x583f0e80), DICO(0x5d77bc80),
  8947. - DICO(0x040bdf88), DICO(0x05b062a0), DICO(0x0b4a2f70), DICO(0x1b8cd880),
  8948. - DICO(0x1ec58c40), DICO(0x23661880), DICO(0x2790ba80), DICO(0x2d0d6c40),
  8949. - DICO(0x34f0bc40), DICO(0x3a353f80), DICO(0x3fc3bc40), DICO(0x44998700),
  8950. - DICO(0x49b17080), DICO(0x4f31fa00), DICO(0x55311c80), DICO(0x5b5c8f80),
  8951. - DICO(0x043e2bd0), DICO(0x0645b0f0), DICO(0x0ade5b90), DICO(0x0d653a90),
  8952. - DICO(0x1bc224a0), DICO(0x1f623dc0), DICO(0x27e9a840), DICO(0x2c719bc0),
  8953. - DICO(0x2f2ac040), DICO(0x32688300), DICO(0x36695c00), DICO(0x3b8abe40),
  8954. - DICO(0x47153a80), DICO(0x52491b00), DICO(0x57ba7680), DICO(0x5ce6c300),
  8955. - DICO(0x052940b8), DICO(0x06f28228), DICO(0x0a741c90), DICO(0x0daa3110),
  8956. - DICO(0x113bb2e0), DICO(0x2010b640), DICO(0x2610f380), DICO(0x2a5c7740),
  8957. - DICO(0x2f7703c0), DICO(0x3388d080), DICO(0x3ceabe40), DICO(0x42462a80),
  8958. - DICO(0x47fb0e00), DICO(0x4f7ac480), DICO(0x5706f580), DICO(0x5d92b800),
  8959. - DICO(0x03a134a4), DICO(0x05623470), DICO(0x090a0fe0), DICO(0x12f7d3e0),
  8960. - DICO(0x1d63e440), DICO(0x20e6ac80), DICO(0x247da8c0), DICO(0x27d99600),
  8961. - DICO(0x312e99c0), DICO(0x368fb380), DICO(0x3b3e3ec0), DICO(0x40fead80),
  8962. - DICO(0x4888fa00), DICO(0x4fbd5600), DICO(0x5795a480), DICO(0x5d973000),
  8963. - DICO(0x05697990), DICO(0x06f33800), DICO(0x0b298290), DICO(0x0de47a60),
  8964. - DICO(0x12ef62a0), DICO(0x21e30a00), DICO(0x25f8ff00), DICO(0x2b2287c0),
  8965. - DICO(0x2f11fc00), DICO(0x33138000), DICO(0x37b49f80), DICO(0x41325100),
  8966. - DICO(0x4ab62800), DICO(0x501eae80), DICO(0x56228780), DICO(0x5c5d8300),
  8967. - DICO(0x063830d8), DICO(0x08a76a30), DICO(0x0d376890), DICO(0x117d3a00),
  8968. - DICO(0x1476e5c0), DICO(0x1e215720), DICO(0x24bcd680), DICO(0x29674ac0),
  8969. - DICO(0x2faab340), DICO(0x33843a00), DICO(0x3822e900), DICO(0x3d30b6c0),
  8970. - DICO(0x49cd5480), DICO(0x53187d00), DICO(0x591fe100), DICO(0x5db30f80),
  8971. - DICO(0x05cdc378), DICO(0x075c50c8), DICO(0x0e01f830), DICO(0x12b70480),
  8972. - DICO(0x15e333e0), DICO(0x192c9f40), DICO(0x1d2d6b80), DICO(0x2c09ca40),
  8973. - DICO(0x2eea5cc0), DICO(0x32c89380), DICO(0x376a5b40), DICO(0x42a42600),
  8974. - DICO(0x4c695900), DICO(0x5269e380), DICO(0x586d6c80), DICO(0x5cebdb80),
  8975. - DICO(0x052bbb80), DICO(0x0702e268), DICO(0x0ca196d0), DICO(0x0f48cef0),
  8976. - DICO(0x19d28b60), DICO(0x1ec44a40), DICO(0x24d40f00), DICO(0x29e1eac0),
  8977. - DICO(0x2cafaa80), DICO(0x301bd4c0), DICO(0x357ec200), DICO(0x42254480),
  8978. - DICO(0x4be32000), DICO(0x4f7a4a00), DICO(0x5447fc00), DICO(0x5cca6a00),
  8979. - DICO(0x050fdd18), DICO(0x06c77e10), DICO(0x10561140), DICO(0x1564c340),
  8980. - DICO(0x1867abe0), DICO(0x1f00fba0), DICO(0x22c06240), DICO(0x2aed7680),
  8981. - DICO(0x2ecc24c0), DICO(0x32abb300), DICO(0x36b42340), DICO(0x3ed8f480),
  8982. - DICO(0x4bbdfe80), DICO(0x516bf800), DICO(0x58688b00), DICO(0x5dd44980),
  8983. - DICO(0x058aa130), DICO(0x07d69ba8), DICO(0x0d521f40), DICO(0x0ff37ba0),
  8984. - DICO(0x18125ec0), DICO(0x1f3a4520), DICO(0x23349840), DICO(0x2c759580),
  8985. - DICO(0x2fc21c00), DICO(0x33a42fc0), DICO(0x3dc92900), DICO(0x47befd00),
  8986. - DICO(0x4ccd2480), DICO(0x5197a200), DICO(0x56a2ea00), DICO(0x5bdfa900),
  8987. - DICO(0x05ac8640), DICO(0x076aec88), DICO(0x0e2e3230), DICO(0x114b6f40),
  8988. - DICO(0x155d10a0), DICO(0x19bac600), DICO(0x1fbd75c0), DICO(0x2459c0c0),
  8989. - DICO(0x28229b80), DICO(0x2f586fc0), DICO(0x3d0697c0), DICO(0x42a7a500),
  8990. - DICO(0x49b0bb80), DICO(0x4e642e80), DICO(0x55774280), DICO(0x5d1a7900),
  8991. - DICO(0x05efb470), DICO(0x0831c8a0), DICO(0x0d35ece0), DICO(0x13edc400),
  8992. - DICO(0x16c8fec0), DICO(0x1bb25860), DICO(0x204f3140), DICO(0x277b8a40),
  8993. - DICO(0x2fe9a000), DICO(0x33af7c40), DICO(0x3b7d2900), DICO(0x419c9a80),
  8994. - DICO(0x4591dc80), DICO(0x4bdafd00), DICO(0x55638880), DICO(0x5cef2300),
  8995. - DICO(0x05cf4988), DICO(0x078fa8c0), DICO(0x0c291950), DICO(0x12e05320),
  8996. - DICO(0x155997e0), DICO(0x195df540), DICO(0x1c1b82c0), DICO(0x22c29400),
  8997. - DICO(0x307edec0), DICO(0x34e829c0), DICO(0x3b1b5040), DICO(0x434de400),
  8998. - DICO(0x496b9900), DICO(0x4ff88080), DICO(0x5604c480), DICO(0x5c84b080),
  8999. - DICO(0x03679fa4), DICO(0x050d4a20), DICO(0x09feec10), DICO(0x100a21e0),
  9000. - DICO(0x1483b260), DICO(0x1d76c780), DICO(0x24e75c80), DICO(0x2bd62880),
  9001. - DICO(0x32350a40), DICO(0x38be01c0), DICO(0x3f05a280), DICO(0x45295e80),
  9002. - DICO(0x4b554800), DICO(0x51618880), DICO(0x575a1500), DICO(0x5d109d80),
  9003. - DICO(0x034ffd08), DICO(0x04dccea8), DICO(0x07e289b8), DICO(0x0d6950d0),
  9004. - DICO(0x189acec0), DICO(0x1e3bf240), DICO(0x2535aa40), DICO(0x2b88d140),
  9005. - DICO(0x329bbb00), DICO(0x386c3500), DICO(0x3e950800), DICO(0x44c43f00),
  9006. - DICO(0x4b089780), DICO(0x51223280), DICO(0x574c9780), DICO(0x5d366400),
  9007. - DICO(0x036d8db8), DICO(0x04fd88b8), DICO(0x09700a70), DICO(0x116b73c0),
  9008. - DICO(0x17258c40), DICO(0x1fd03000), DICO(0x23fdf400), DICO(0x28e08dc0),
  9009. - DICO(0x32d688c0), DICO(0x37920b00), DICO(0x3daaa080), DICO(0x46a16c00),
  9010. - DICO(0x4f8c3100), DICO(0x54a13700), DICO(0x59d24b80), DICO(0x5cea4d80),
  9011. - DICO(0x05797c88), DICO(0x080dc8f0), DICO(0x0bd21520), DICO(0x1095b540),
  9012. - DICO(0x138fd400), DICO(0x1aed19c0), DICO(0x29fead00), DICO(0x2f70cec0),
  9013. - DICO(0x3327df00), DICO(0x3a812d00), DICO(0x400a8380), DICO(0x449daa00),
  9014. - DICO(0x4cd6b600), DICO(0x51f12400), DICO(0x56bdfd80), DICO(0x5be0a100),
  9015. - DICO(0x04de6d78), DICO(0x072aed40), DICO(0x0c6fc460), DICO(0x0f260220),
  9016. - DICO(0x179d00c0), DICO(0x1e8244e0), DICO(0x23867240), DICO(0x2baf7680),
  9017. - DICO(0x2fa6d240), DICO(0x37e83d40), DICO(0x3d1cbfc0), DICO(0x439d0a00),
  9018. - DICO(0x49fd3e00), DICO(0x50095e80), DICO(0x559f2080), DICO(0x5b889a00),
  9019. - DICO(0x042f5c10), DICO(0x061ab3e8), DICO(0x0dd8f160), DICO(0x126e0b40),
  9020. - DICO(0x16ea9040), DICO(0x20a31700), DICO(0x24608140), DICO(0x2ec65080),
  9021. - DICO(0x334e1a40), DICO(0x38252100), DICO(0x3fff0900), DICO(0x46519a80),
  9022. - DICO(0x4c5e0d80), DICO(0x518c5800), DICO(0x56c5b080), DICO(0x5c6ebb80),
  9023. - DICO(0x045ce230), DICO(0x067547b0), DICO(0x0a21c670), DICO(0x1408b820),
  9024. - DICO(0x1c0505c0), DICO(0x1e806c80), DICO(0x26d3c640), DICO(0x2ca573c0),
  9025. - DICO(0x3014d880), DICO(0x377108c0), DICO(0x3f35cf80), DICO(0x43566100),
  9026. - DICO(0x4a612900), DICO(0x5160c780), DICO(0x57d3e300), DICO(0x5d414b80),
  9027. - DICO(0x04c8eda8), DICO(0x06a32320), DICO(0x09ab2590), DICO(0x14230760),
  9028. - DICO(0x20fb23c0), DICO(0x24aa2880), DICO(0x285a2580), DICO(0x2c464ac0),
  9029. - DICO(0x30098280), DICO(0x36232780), DICO(0x3e428d40), DICO(0x42982280),
  9030. - DICO(0x47e60d80), DICO(0x4e1ecc00), DICO(0x55eb9200), DICO(0x5c81ed00),
  9031. - DICO(0x040d0b90), DICO(0x0586c5c0), DICO(0x0bea2190), DICO(0x1dc8dd60),
  9032. - DICO(0x20a07c40), DICO(0x2437e580), DICO(0x27ca5fc0), DICO(0x2d017980),
  9033. - DICO(0x34100040), DICO(0x38d3afc0), DICO(0x3da9b700), DICO(0x42082480),
  9034. - DICO(0x46586f00), DICO(0x4e3c3d80), DICO(0x55e1ee00), DICO(0x5c938d00),
  9035. - DICO(0x03d18c64), DICO(0x05941d60), DICO(0x116b2560), DICO(0x19cc8820),
  9036. - DICO(0x1ce930c0), DICO(0x22626080), DICO(0x26d2cf80), DICO(0x2ce2c980),
  9037. - DICO(0x305361c0), DICO(0x34b65900), DICO(0x39ee5b40), DICO(0x41508400),
  9038. - DICO(0x47ee1e80), DICO(0x50311180), DICO(0x56cb0c00), DICO(0x5d561680),
  9039. - DICO(0x0af22cf0), DICO(0x154e1c60), DICO(0x1b44ff60), DICO(0x2087d0c0),
  9040. - DICO(0x252f7380), DICO(0x28fe66c0), DICO(0x2d0e9800), DICO(0x30f7ee00),
  9041. - DICO(0x3606d640), DICO(0x3bac0a40), DICO(0x417c3700), DICO(0x470c2900),
  9042. - DICO(0x4cc20d00), DICO(0x51e55e80), DICO(0x576bc200), DICO(0x5caa7080),
  9043. - DICO(0x043314e0), DICO(0x05cb47b0), DICO(0x0985df20), DICO(0x185a22c0),
  9044. - DICO(0x1ea68300), DICO(0x21af9100), DICO(0x25cdcb40), DICO(0x297e0a80),
  9045. - DICO(0x3142ac80), DICO(0x358bb040), DICO(0x3a1345c0), DICO(0x402ca580),
  9046. - DICO(0x4d964780), DICO(0x5420cf80), DICO(0x592adf80), DICO(0x5dfe7a80),
  9047. - DICO(0x04c70e20), DICO(0x062fd6f0), DICO(0x113c60a0), DICO(0x159e9900),
  9048. - DICO(0x1933e5a0), DICO(0x1decffa0), DICO(0x22373400), DICO(0x27ed7180),
  9049. - DICO(0x2a8349c0), DICO(0x2f78f940), DICO(0x3d5c8540), DICO(0x429c3500),
  9050. - DICO(0x4936e300), DICO(0x4de08d00), DICO(0x52627700), DICO(0x5d822680),
  9051. - DICO(0x04982770), DICO(0x06ab1ad8), DICO(0x0cba1090), DICO(0x10839d60),
  9052. - DICO(0x1acd6a60), DICO(0x1f554560), DICO(0x2431c1c0), DICO(0x295db800),
  9053. - DICO(0x2d374c00), DICO(0x31f2fd80), DICO(0x3a200480), DICO(0x416bea80),
  9054. - DICO(0x4ba1ce00), DICO(0x52a88000), DICO(0x58d0db00), DICO(0x5d3e5800),
  9055. - DICO(0x059e0e70), DICO(0x08166ba0), DICO(0x0c9df590), DICO(0x11de5f40),
  9056. - DICO(0x14c08ea0), DICO(0x1c5ad6e0), DICO(0x24178ec0), DICO(0x28eb7640),
  9057. - DICO(0x31626280), DICO(0x35d43100), DICO(0x3cad10c0), DICO(0x422e1480),
  9058. - DICO(0x49baee00), DICO(0x53dd7180), DICO(0x5a17bb80), DICO(0x5e4bb180),
  9059. - DICO(0x03c64d00), DICO(0x05de0b28), DICO(0x0ccb82b0), DICO(0x144b1c00),
  9060. - DICO(0x19e39ec0), DICO(0x21e795c0), DICO(0x28149380), DICO(0x2f1ff7c0),
  9061. - DICO(0x35b7c900), DICO(0x3c5f4800), DICO(0x42799c00), DICO(0x48746180),
  9062. - DICO(0x4e8f4d00), DICO(0x53b98380), DICO(0x58d60000), DICO(0x5d71a000),
  9063. - DICO(0x050a2990), DICO(0x071bdb88), DICO(0x0f0d76b0), DICO(0x17a78de0),
  9064. - DICO(0x1aa20720), DICO(0x22eea3c0), DICO(0x276e9640), DICO(0x2ecc4d80),
  9065. - DICO(0x335f7900), DICO(0x37838640), DICO(0x3c81be80), DICO(0x41a4e400),
  9066. - DICO(0x476fa280), DICO(0x4f2ab780), DICO(0x56e87b80), DICO(0x5cbf2900),
  9067. - DICO(0x06724c98), DICO(0x099f5e20), DICO(0x119bcec0), DICO(0x16be11a0),
  9068. - DICO(0x19d53b00), DICO(0x1eb51360), DICO(0x2302c300), DICO(0x29c20d40),
  9069. - DICO(0x30dd5200), DICO(0x36576a80), DICO(0x3e3e7540), DICO(0x45aa9f80),
  9070. - DICO(0x4c833300), DICO(0x51d7ed00), DICO(0x57a4a380), DICO(0x5cce9100),
  9071. - DICO(0x05588b60), DICO(0x075a70a0), DICO(0x0ef96e30), DICO(0x12ac1100),
  9072. - DICO(0x1649dde0), DICO(0x1a50cdc0), DICO(0x22486140), DICO(0x27c7c800),
  9073. - DICO(0x2e08bd80), DICO(0x355d20c0), DICO(0x3925a9c0), DICO(0x44e2b480),
  9074. - DICO(0x4fa4e680), DICO(0x5470e180), DICO(0x595fee80), DICO(0x5d672f00),
  9075. - DICO(0x04a781c0), DICO(0x060a89f0), DICO(0x111f56a0), DICO(0x16b93be0),
  9076. - DICO(0x19ce9120), DICO(0x1e1fda60), DICO(0x2259f880), DICO(0x285cad80),
  9077. - DICO(0x2b140ec0), DICO(0x2f069940), DICO(0x33bbce40), DICO(0x3dd3e6c0),
  9078. - DICO(0x49154880), DICO(0x5008e380), DICO(0x568c4680), DICO(0x5da43780),
  9079. - DICO(0x053ade38), DICO(0x0708a200), DICO(0x0bad43d0), DICO(0x1860cf40),
  9080. - DICO(0x1c40dbe0), DICO(0x1f5a0120), DICO(0x25bcf7c0), DICO(0x29e0c840),
  9081. - DICO(0x2f223840), DICO(0x390c8940), DICO(0x3e1d7340), DICO(0x41c6a000),
  9082. - DICO(0x46cc2880), DICO(0x5006e280), DICO(0x5744e180), DICO(0x5d297780),
  9083. - DICO(0x0401a3f0), DICO(0x07be4a08), DICO(0x14f5f1a0), DICO(0x1c348080),
  9084. - DICO(0x226753c0), DICO(0x274b1b80), DICO(0x2c11a300), DICO(0x30798c00),
  9085. - DICO(0x35598c80), DICO(0x3aab18c0), DICO(0x4030f380), DICO(0x45c7b400),
  9086. - DICO(0x4be5be00), DICO(0x5180db80), DICO(0x57613b00), DICO(0x5cffff80),
  9087. - DICO(0x084b3090), DICO(0x0fe5b3b0), DICO(0x16dfd480), DICO(0x1d0aa700),
  9088. - DICO(0x24e08180), DICO(0x2b498640), DICO(0x30885b80), DICO(0x34ccc480),
  9089. - DICO(0x38fedec0), DICO(0x3cdf9c40), DICO(0x41737600), DICO(0x46ab9800),
  9090. - DICO(0x4c772e80), DICO(0x51e5b980), DICO(0x57df9900), DICO(0x5d5d7180),
  9091. - DICO(0x09549f00), DICO(0x12b84da0), DICO(0x1aeaf1c0), DICO(0x2142a9c0),
  9092. - DICO(0x275c9a00), DICO(0x2c260c80), DICO(0x3038c700), DICO(0x34081d00),
  9093. - DICO(0x38612f40), DICO(0x3d0bf8c0), DICO(0x42473e00), DICO(0x47ecad80),
  9094. - DICO(0x4db34380), DICO(0x52f0ab00), DICO(0x584cc980), DICO(0x5d62ae80),
  9095. - DICO(0x0aeca1e0), DICO(0x14354700), DICO(0x19955ba0), DICO(0x1de331e0),
  9096. - DICO(0x21cd60c0), DICO(0x25e72d80), DICO(0x2a402880), DICO(0x2efa64c0),
  9097. - DICO(0x3478d9c0), DICO(0x3a889e80), DICO(0x40744e00), DICO(0x4626fe80),
  9098. - DICO(0x4bd80900), DICO(0x51120f00), DICO(0x56d8d280), DICO(0x5c654400),
  9099. - DICO(0x07a40af8), DICO(0x0e65ec20), DICO(0x14c76780), DICO(0x19b35a60),
  9100. - DICO(0x1f76b7c0), DICO(0x24f512c0), DICO(0x2ae89f00), DICO(0x3036c3c0),
  9101. - DICO(0x36041800), DICO(0x3bc4df80), DICO(0x41adb080), DICO(0x477fbb80),
  9102. - DICO(0x4d5aa480), DICO(0x52cb0600), DICO(0x586f7280), DICO(0x5db40180),
  9103. - DICO(0x03997610), DICO(0x06175db0), DICO(0x0ea8c9c0), DICO(0x14397000),
  9104. - DICO(0x1ba34f60), DICO(0x22346680), DICO(0x28958080), DICO(0x2ea76840),
  9105. - DICO(0x33ee68c0), DICO(0x39e769c0), DICO(0x3f862500), DICO(0x4579b080),
  9106. - DICO(0x4b49cd00), DICO(0x5107da80), DICO(0x573cde00), DICO(0x5d090780),
  9107. - DICO(0x046fc2f8), DICO(0x0640dbc0), DICO(0x09da7ab0), DICO(0x174e4220),
  9108. - DICO(0x23dc8cc0), DICO(0x27016200), DICO(0x2a9a5240), DICO(0x2e6cc7c0),
  9109. - DICO(0x321ced40), DICO(0x38ca2d00), DICO(0x41482680), DICO(0x451e3700),
  9110. - DICO(0x4b90d800), DICO(0x50d0ba80), DICO(0x55602e80), DICO(0x5a465200),
  9111. - DICO(0x03ca7e28), DICO(0x057c9dd0), DICO(0x0c9ff0e0), DICO(0x1957fae0),
  9112. - DICO(0x1fef7860), DICO(0x27920c80), DICO(0x2cb233c0), DICO(0x32015c80),
  9113. - DICO(0x36af4f40), DICO(0x3ac18240), DICO(0x3f93d8c0), DICO(0x44eaef80),
  9114. - DICO(0x4aab5d80), DICO(0x50840e80), DICO(0x56c4cc80), DICO(0x5cb26600),
  9115. - DICO(0x038d53f8), DICO(0x050d1118), DICO(0x0bc14690), DICO(0x18918000),
  9116. - DICO(0x1e2a6ee0), DICO(0x24cc0c00), DICO(0x2a767d40), DICO(0x2e614940),
  9117. - DICO(0x32859c40), DICO(0x377fd940), DICO(0x3d3a3e40), DICO(0x43e81380),
  9118. - DICO(0x4aaac080), DICO(0x509e7800), DICO(0x57023a00), DICO(0x5d733c00),
  9119. - DICO(0x04cfa5e0), DICO(0x06deeb38), DICO(0x0a501c40), DICO(0x136d8aa0),
  9120. - DICO(0x17f16e40), DICO(0x1c119300), DICO(0x26154b00), DICO(0x2a0da100),
  9121. - DICO(0x2f5935c0), DICO(0x37108d40), DICO(0x3aef07c0), DICO(0x3fccf340),
  9122. - DICO(0x47e4a080), DICO(0x4d8de100), DICO(0x54eb6980), DICO(0x5cdb5380)};
  9123. -
  9124. -/* ACELP: table for decoding
  9125. - adaptive codebook gain g_p (left column). Scaled by 2.0f.
  9126. - innovative codebook gain g_c (right column). Scaled by 16.0f.
  9127. -*/
  9128. -const FIXP_SGL fdk_t_qua_gain7b[128 * 2] = {
  9129. - 204, 441, 464, 1977, 869, 1077, 1072, 3062, 1281, 4759, 1647,
  9130. - 1539, 1845, 7020, 1853, 634, 1995, 2336, 2351, 15400, 2661, 1165,
  9131. - 2702, 3900, 2710, 10133, 3195, 1752, 3498, 2624, 3663, 849, 3984,
  9132. - 5697, 4214, 3399, 4415, 1304, 4695, 2056, 5376, 4558, 5386, 676,
  9133. - 5518, 23554, 5567, 7794, 5644, 3061, 5672, 1513, 5957, 2338, 6533,
  9134. - 1060, 6804, 5998, 6820, 1767, 6937, 3837, 7277, 414, 7305, 2665,
  9135. - 7466, 11304, 7942, 794, 8007, 1982, 8007, 1366, 8326, 3105, 8336,
  9136. - 4810, 8708, 7954, 8989, 2279, 9031, 1055, 9247, 3568, 9283, 1631,
  9137. - 9654, 6311, 9811, 2605, 10120, 683, 10143, 4179, 10245, 1946, 10335,
  9138. - 1218, 10468, 9960, 10651, 3000, 10951, 1530, 10969, 5290, 11203, 2305,
  9139. - 11325, 3562, 11771, 6754, 11839, 1849, 11941, 4495, 11954, 1298, 11975,
  9140. - 15223, 11977, 883, 11986, 2842, 12438, 2141, 12593, 3665, 12636, 8367,
  9141. - 12658, 1594, 12886, 2628, 12984, 4942, 13146, 1115, 13224, 524, 13341,
  9142. - 3163, 13399, 1923, 13549, 5961, 13606, 1401, 13655, 2399, 13782, 3909,
  9143. - 13868, 10923, 14226, 1723, 14232, 2939, 14278, 7528, 14439, 4598, 14451,
  9144. - 984, 14458, 2265, 14792, 1403, 14818, 3445, 14899, 5709, 15017, 15362,
  9145. - 15048, 1946, 15069, 2655, 15405, 9591, 15405, 4079, 15570, 7183, 15687,
  9146. - 2286, 15691, 1624, 15699, 3068, 15772, 5149, 15868, 1205, 15970, 696,
  9147. - 16249, 3584, 16338, 1917, 16424, 2560, 16483, 4438, 16529, 6410, 16620,
  9148. - 11966, 16839, 8780, 17030, 3050, 17033, 18325, 17092, 1568, 17123, 5197,
  9149. - 17351, 2113, 17374, 980, 17566, 26214, 17609, 3912, 17639, 32767, 18151,
  9150. - 7871, 18197, 2516, 18202, 5649, 18679, 3283, 18930, 1370, 19271, 13757,
  9151. - 19317, 4120, 19460, 1973, 19654, 10018, 19764, 6792, 19912, 5135, 20040,
  9152. - 2841, 21234, 19833};
  9153. -
  9154. -/* ACELP: factor table for interpolation of LPC coeffs in LSP domain */
  9155. -const FIXP_SGL lsp_interpol_factor[2][NB_SUBFR] = {
  9156. - {FL2FXCONST_SGL(0.125f), FL2FXCONST_SGL(0.375f), FL2FXCONST_SGL(0.625f),
  9157. - FL2FXCONST_SGL(0.875f)}, /* for coreCoderFrameLength = 1024 */
  9158. - {FL2FXCONST_SGL(0.166667f), FL2FXCONST_SGL(0.5f), FL2FXCONST_SGL(0.833333f),
  9159. - 0x0} /* for coreCoderFrameLength = 768 */
  9160. -};
  9161. -
  9162. -/* For bass post filter */
  9163. -#ifndef TABLE_filt_lp
  9164. -const FIXP_SGL fdk_dec_filt_lp[1 + L_FILT] = {
  9165. - FL2FXCONST_SGL_FILT(0.088250f), FL2FXCONST_SGL_FILT(0.086410f),
  9166. - FL2FXCONST_SGL_FILT(0.081074f), FL2FXCONST_SGL_FILT(0.072768f),
  9167. - FL2FXCONST_SGL_FILT(0.062294f), FL2FXCONST_SGL_FILT(0.050623f),
  9168. - FL2FXCONST_SGL_FILT(0.038774f), FL2FXCONST_SGL_FILT(0.027692f),
  9169. - FL2FXCONST_SGL_FILT(0.018130f), FL2FXCONST_SGL_FILT(0.010578f),
  9170. - FL2FXCONST_SGL_FILT(0.005221f), FL2FXCONST_SGL_FILT(0.001946f),
  9171. - FL2FXCONST_SGL_FILT(0.000385f)};
  9172. -#endif
  9173. -
  9174. -/* FAC window tables for coreCoderFrameLength = 1024 */
  9175. -const FIXP_WTB FacWindowSynth128[] = {
  9176. - WTC(0x7fff6216), WTC(0x7ffa72d1), WTC(0x7ff09478), WTC(0x7fe1c76b),
  9177. - WTC(0x7fce0c3e), WTC(0x7fb563b3), WTC(0x7f97cebd), WTC(0x7f754e80),
  9178. - WTC(0x7f4de451), WTC(0x7f2191b4), WTC(0x7ef05860), WTC(0x7eba3a39),
  9179. - WTC(0x7e7f3957), WTC(0x7e3f57ff), WTC(0x7dfa98a8), WTC(0x7db0fdf8),
  9180. - WTC(0x7d628ac6), WTC(0x7d0f4218), WTC(0x7cb72724), WTC(0x7c5a3d50),
  9181. - WTC(0x7bf88830), WTC(0x7b920b89), WTC(0x7b26cb4f), WTC(0x7ab6cba4),
  9182. - WTC(0x7a4210d8), WTC(0x79c89f6e), WTC(0x794a7c12), WTC(0x78c7aba2),
  9183. - WTC(0x78403329), WTC(0x77b417df), WTC(0x77235f2d), WTC(0x768e0ea6),
  9184. - WTC(0x75f42c0b), WTC(0x7555bd4c), WTC(0x74b2c884), WTC(0x740b53fb),
  9185. - WTC(0x735f6626), WTC(0x72af05a7), WTC(0x71fa3949), WTC(0x71410805),
  9186. - WTC(0x708378ff), WTC(0x6fc19385), WTC(0x6efb5f12), WTC(0x6e30e34a),
  9187. - WTC(0x6d6227fa), WTC(0x6c8f351c), WTC(0x6bb812d1), WTC(0x6adcc964),
  9188. - WTC(0x69fd614a), WTC(0x6919e320), WTC(0x683257ab), WTC(0x6746c7d8),
  9189. - WTC(0x66573cbb), WTC(0x6563bf92), WTC(0x646c59bf), WTC(0x637114cc),
  9190. - WTC(0x6271fa69), WTC(0x616f146c), WTC(0x60686ccf), WTC(0x5f5e0db3),
  9191. - WTC(0x5e50015d), WTC(0x5d3e5237), WTC(0x5c290acc), WTC(0x5b1035cf),
  9192. - WTC(0x59f3de12), WTC(0x58d40e8c), WTC(0x57b0d256), WTC(0x568a34a9),
  9193. - WTC(0x556040e2), WTC(0x5433027d), WTC(0x53028518), WTC(0x51ced46e),
  9194. - WTC(0x5097fc5e), WTC(0x4f5e08e3), WTC(0x4e210617), WTC(0x4ce10034),
  9195. - WTC(0x4b9e0390), WTC(0x4a581c9e), WTC(0x490f57ee), WTC(0x47c3c22f),
  9196. - WTC(0x46756828), WTC(0x452456bd), WTC(0x43d09aed), WTC(0x427a41d0),
  9197. - WTC(0x4121589b), WTC(0x3fc5ec98), WTC(0x3e680b2c), WTC(0x3d07c1d6),
  9198. - WTC(0x3ba51e29), WTC(0x3a402dd2), WTC(0x38d8fe93), WTC(0x376f9e46),
  9199. - WTC(0x36041ad9), WTC(0x34968250), WTC(0x3326e2c3), WTC(0x31b54a5e),
  9200. - WTC(0x3041c761), WTC(0x2ecc681e), WTC(0x2d553afc), WTC(0x2bdc4e6f),
  9201. - WTC(0x2a61b101), WTC(0x28e5714b), WTC(0x27679df4), WTC(0x25e845b6),
  9202. - WTC(0x24677758), WTC(0x22e541af), WTC(0x2161b3a0), WTC(0x1fdcdc1b),
  9203. - WTC(0x1e56ca1e), WTC(0x1ccf8cb3), WTC(0x1b4732ef), WTC(0x19bdcbf3),
  9204. - WTC(0x183366e9), WTC(0x16a81305), WTC(0x151bdf86), WTC(0x138edbb1),
  9205. - WTC(0x120116d5), WTC(0x1072a048), WTC(0x0ee38766), WTC(0x0d53db92),
  9206. - WTC(0x0bc3ac35), WTC(0x0a3308bd), WTC(0x08a2009a), WTC(0x0710a345),
  9207. - WTC(0x057f0035), WTC(0x03ed26e6), WTC(0x025b26d7), WTC(0x00c90f88),
  9208. -};
  9209. -const FIXP_WTB FacWindowZir128[] = {
  9210. - WTC(0x7f36f078), WTC(0x7da4d929), WTC(0x7c12d91a), WTC(0x7a80ffcb),
  9211. - WTC(0x78ef5cbb), WTC(0x775dff66), WTC(0x75ccf743), WTC(0x743c53cb),
  9212. - WTC(0x72ac246e), WTC(0x711c789a), WTC(0x6f8d5fb8), WTC(0x6dfee92b),
  9213. - WTC(0x6c71244f), WTC(0x6ae4207a), WTC(0x6957ecfb), WTC(0x67cc9917),
  9214. - WTC(0x6642340d), WTC(0x64b8cd11), WTC(0x6330734d), WTC(0x61a935e2),
  9215. - WTC(0x602323e5), WTC(0x5e9e4c60), WTC(0x5d1abe51), WTC(0x5b9888a8),
  9216. - WTC(0x5a17ba4a), WTC(0x5898620c), WTC(0x571a8eb5), WTC(0x559e4eff),
  9217. - WTC(0x5423b191), WTC(0x52aac504), WTC(0x513397e2), WTC(0x4fbe389f),
  9218. - WTC(0x4e4ab5a2), WTC(0x4cd91d3d), WTC(0x4b697db0), WTC(0x49fbe527),
  9219. - WTC(0x489061ba), WTC(0x4727016d), WTC(0x45bfd22e), WTC(0x445ae1d7),
  9220. - WTC(0x42f83e2a), WTC(0x4197f4d4), WTC(0x403a1368), WTC(0x3edea765),
  9221. - WTC(0x3d85be30), WTC(0x3c2f6513), WTC(0x3adba943), WTC(0x398a97d8),
  9222. - WTC(0x383c3dd1), WTC(0x36f0a812), WTC(0x35a7e362), WTC(0x3461fc70),
  9223. - WTC(0x331effcc), WTC(0x31def9e9), WTC(0x30a1f71d), WTC(0x2f6803a2),
  9224. - WTC(0x2e312b92), WTC(0x2cfd7ae8), WTC(0x2bccfd83), WTC(0x2a9fbf1e),
  9225. - WTC(0x2975cb57), WTC(0x284f2daa), WTC(0x272bf174), WTC(0x260c21ee),
  9226. - WTC(0x24efca31), WTC(0x23d6f534), WTC(0x22c1adc9), WTC(0x21affea3),
  9227. - WTC(0x20a1f24d), WTC(0x1f979331), WTC(0x1e90eb94), WTC(0x1d8e0597),
  9228. - WTC(0x1c8eeb34), WTC(0x1b93a641), WTC(0x1a9c406e), WTC(0x19a8c345),
  9229. - WTC(0x18b93828), WTC(0x17cda855), WTC(0x16e61ce0), WTC(0x16029eb6),
  9230. - WTC(0x1523369c), WTC(0x1447ed2f), WTC(0x1370cae4), WTC(0x129dd806),
  9231. - WTC(0x11cf1cb6), WTC(0x1104a0ee), WTC(0x103e6c7b), WTC(0x0f7c8701),
  9232. - WTC(0x0ebef7fb), WTC(0x0e05c6b7), WTC(0x0d50fa59), WTC(0x0ca099da),
  9233. - WTC(0x0bf4ac05), WTC(0x0b4d377c), WTC(0x0aaa42b4), WTC(0x0a0bd3f5),
  9234. - WTC(0x0971f15a), WTC(0x08dca0d3), WTC(0x084be821), WTC(0x07bfccd7),
  9235. - WTC(0x0738545e), WTC(0x06b583ee), WTC(0x06376092), WTC(0x05bdef28),
  9236. - WTC(0x0549345c), WTC(0x04d934b1), WTC(0x046df477), WTC(0x040777d0),
  9237. - WTC(0x03a5c2b0), WTC(0x0348d8dc), WTC(0x02f0bde8), WTC(0x029d753a),
  9238. - WTC(0x024f0208), WTC(0x02056758), WTC(0x01c0a801), WTC(0x0180c6a9),
  9239. - WTC(0x0145c5c7), WTC(0x010fa7a0), WTC(0x00de6e4c), WTC(0x00b21baf),
  9240. - WTC(0x008ab180), WTC(0x00683143), WTC(0x004a9c4d), WTC(0x0031f3c2),
  9241. - WTC(0x001e3895), WTC(0x000f6b88), WTC(0x00058d2f), WTC(0x00009dea),
  9242. -};
  9243. -const FIXP_WTB FacWindowSynth64[] = {
  9244. - WTC(0x7ffd885a), WTC(0x7fe9cbc0), WTC(0x7fc25596), WTC(0x7f872bf3),
  9245. - WTC(0x7f3857f6), WTC(0x7ed5e5c6), WTC(0x7e5fe493), WTC(0x7dd6668f),
  9246. - WTC(0x7d3980ec), WTC(0x7c894bde), WTC(0x7bc5e290), WTC(0x7aef6323),
  9247. - WTC(0x7a05eead), WTC(0x7909a92d), WTC(0x77fab989), WTC(0x76d94989),
  9248. - WTC(0x75a585cf), WTC(0x745f9dd1), WTC(0x7307c3d0), WTC(0x719e2cd2),
  9249. - WTC(0x7023109a), WTC(0x6e96a99d), WTC(0x6cf934fc), WTC(0x6b4af279),
  9250. - WTC(0x698c246c), WTC(0x67bd0fbd), WTC(0x65ddfbd3), WTC(0x63ef3290),
  9251. - WTC(0x61f1003f), WTC(0x5fe3b38d), WTC(0x5dc79d7c), WTC(0x5b9d1154),
  9252. - WTC(0x59646498), WTC(0x571deefa), WTC(0x54ca0a4b), WTC(0x5269126e),
  9253. - WTC(0x4ffb654d), WTC(0x4d8162c4), WTC(0x4afb6c98), WTC(0x4869e665),
  9254. - WTC(0x45cd358f), WTC(0x4325c135), WTC(0x4073f21d), WTC(0x3db832a6),
  9255. - WTC(0x3af2eeb7), WTC(0x382493b0), WTC(0x354d9057), WTC(0x326e54c7),
  9256. - WTC(0x2f875262), WTC(0x2c98fbba), WTC(0x29a3c485), WTC(0x26a82186),
  9257. - WTC(0x23a6887f), WTC(0x209f701c), WTC(0x1d934fe5), WTC(0x1a82a026),
  9258. - WTC(0x176dd9de), WTC(0x145576b1), WTC(0x1139f0cf), WTC(0x0e1bc2e4),
  9259. - WTC(0x0afb6805), WTC(0x07d95b9e), WTC(0x04b6195d), WTC(0x01921d20),
  9260. -};
  9261. -const FIXP_WTB FacWindowZir64[] = {
  9262. - WTC(0x7e6de2e0), WTC(0x7b49e6a3), WTC(0x7826a462), WTC(0x750497fb),
  9263. - WTC(0x71e43d1c), WTC(0x6ec60f31), WTC(0x6baa894f), WTC(0x68922622),
  9264. - WTC(0x657d5fda), WTC(0x626cb01b), WTC(0x5f608fe4), WTC(0x5c597781),
  9265. - WTC(0x5957de7a), WTC(0x565c3b7b), WTC(0x53670446), WTC(0x5078ad9e),
  9266. - WTC(0x4d91ab39), WTC(0x4ab26fa9), WTC(0x47db6c50), WTC(0x450d1149),
  9267. - WTC(0x4247cd5a), WTC(0x3f8c0de3), WTC(0x3cda3ecb), WTC(0x3a32ca71),
  9268. - WTC(0x3796199b), WTC(0x35049368), WTC(0x327e9d3c), WTC(0x30049ab3),
  9269. - WTC(0x2d96ed92), WTC(0x2b35f5b5), WTC(0x28e21106), WTC(0x269b9b68),
  9270. - WTC(0x2462eeac), WTC(0x22386284), WTC(0x201c4c73), WTC(0x1e0effc1),
  9271. - WTC(0x1c10cd70), WTC(0x1a22042d), WTC(0x1842f043), WTC(0x1673db94),
  9272. - WTC(0x14b50d87), WTC(0x1306cb04), WTC(0x11695663), WTC(0x0fdcef66),
  9273. - WTC(0x0e61d32e), WTC(0x0cf83c30), WTC(0x0ba0622f), WTC(0x0a5a7a31),
  9274. - WTC(0x0926b677), WTC(0x08054677), WTC(0x06f656d3), WTC(0x05fa1153),
  9275. - WTC(0x05109cdd), WTC(0x043a1d70), WTC(0x0376b422), WTC(0x02c67f14),
  9276. - WTC(0x02299971), WTC(0x01a01b6d), WTC(0x012a1a3a), WTC(0x00c7a80a),
  9277. - WTC(0x0078d40d), WTC(0x003daa6a), WTC(0x00163440), WTC(0x000277a6),
  9278. -};
  9279. -const FIXP_WTB FacWindowSynth32[] = {
  9280. - WTC(0x7ff62182), WTC(0x7fa736b4), WTC(0x7f0991c4), WTC(0x7e1d93ea),
  9281. - WTC(0x7ce3ceb2), WTC(0x7b5d039e), WTC(0x798a23b1), WTC(0x776c4edb),
  9282. - WTC(0x7504d345), WTC(0x72552c85), WTC(0x6f5f02b2), WTC(0x6c242960),
  9283. - WTC(0x68a69e81), WTC(0x64e88926), WTC(0x60ec3830), WTC(0x5cb420e0),
  9284. - WTC(0x5842dd54), WTC(0x539b2af0), WTC(0x4ebfe8a5), WTC(0x49b41533),
  9285. - WTC(0x447acd50), WTC(0x3f1749b8), WTC(0x398cdd32), WTC(0x33def287),
  9286. - WTC(0x2e110a62), WTC(0x2826b928), WTC(0x2223a4c5), WTC(0x1c0b826a),
  9287. - WTC(0x15e21445), WTC(0x0fab272b), WTC(0x096a9049), WTC(0x03242abf),
  9288. -};
  9289. -const FIXP_WTB FacWindowZir32[] = {
  9290. - WTC(0x7cdbd541), WTC(0x76956fb7), WTC(0x7054d8d5), WTC(0x6a1debbb),
  9291. - WTC(0x63f47d96), WTC(0x5ddc5b3b), WTC(0x57d946d8), WTC(0x51eef59e),
  9292. - WTC(0x4c210d79), WTC(0x467322ce), WTC(0x40e8b648), WTC(0x3b8532b0),
  9293. - WTC(0x364beacd), WTC(0x3140175b), WTC(0x2c64d510), WTC(0x27bd22ac),
  9294. - WTC(0x234bdf20), WTC(0x1f13c7d0), WTC(0x1b1776da), WTC(0x1759617f),
  9295. - WTC(0x13dbd6a0), WTC(0x10a0fd4e), WTC(0x0daad37b), WTC(0x0afb2cbb),
  9296. - WTC(0x0893b125), WTC(0x0675dc4f), WTC(0x04a2fc62), WTC(0x031c314e),
  9297. - WTC(0x01e26c16), WTC(0x00f66e3c), WTC(0x0058c94c), WTC(0x0009de7e),
  9298. -};
  9299. -
  9300. -/* FAC window tables for coreCoderFrameLength = 768 */
  9301. -const FIXP_WTB FacWindowSynth96[] = {
  9302. - WTC(0x7ffee744), WTC(0x7ff62182), WTC(0x7fe49698), WTC(0x7fca47b9),
  9303. - WTC(0x7fa736b4), WTC(0x7f7b65ef), WTC(0x7f46d86c), WTC(0x7f0991c4),
  9304. - WTC(0x7ec3962a), WTC(0x7e74ea6a), WTC(0x7e1d93ea), WTC(0x7dbd98a4),
  9305. - WTC(0x7d54ff2e), WTC(0x7ce3ceb2), WTC(0x7c6a0ef2), WTC(0x7be7c847),
  9306. - WTC(0x7b5d039e), WTC(0x7ac9ca7a), WTC(0x7a2e26f2), WTC(0x798a23b1),
  9307. - WTC(0x78ddcbf5), WTC(0x78292b8d), WTC(0x776c4edb), WTC(0x76a742d1),
  9308. - WTC(0x75da14ef), WTC(0x7504d345), WTC(0x74278c72), WTC(0x73424fa0),
  9309. - WTC(0x72552c85), WTC(0x71603361), WTC(0x706374ff), WTC(0x6f5f02b2),
  9310. - WTC(0x6e52ee52), WTC(0x6d3f4a40), WTC(0x6c242960), WTC(0x6b019f1a),
  9311. - WTC(0x69d7bf57), WTC(0x68a69e81), WTC(0x676e5183), WTC(0x662eedc3),
  9312. - WTC(0x64e88926), WTC(0x639b3a0b), WTC(0x62471749), WTC(0x60ec3830),
  9313. - WTC(0x5f8ab487), WTC(0x5e22a487), WTC(0x5cb420e0), WTC(0x5b3f42ae),
  9314. - WTC(0x59c42381), WTC(0x5842dd54), WTC(0x56bb8a90), WTC(0x552e4605),
  9315. - WTC(0x539b2af0), WTC(0x520254ef), WTC(0x5063e008), WTC(0x4ebfe8a5),
  9316. - WTC(0x4d168b8b), WTC(0x4b67e5e4), WTC(0x49b41533), WTC(0x47fb3757),
  9317. - WTC(0x463d6a87), WTC(0x447acd50), WTC(0x42b37e96), WTC(0x40e79d8c),
  9318. - WTC(0x3f1749b8), WTC(0x3d42a2ec), WTC(0x3b69c947), WTC(0x398cdd32),
  9319. - WTC(0x37abff5d), WTC(0x35c750bc), WTC(0x33def287), WTC(0x31f30638),
  9320. - WTC(0x3003ad85), WTC(0x2e110a62), WTC(0x2c1b3efb), WTC(0x2a226db5),
  9321. - WTC(0x2826b928), WTC(0x26284422), WTC(0x2427319d), WTC(0x2223a4c5),
  9322. - WTC(0x201dc0ef), WTC(0x1e15a99a), WTC(0x1c0b826a), WTC(0x19ff6f2a),
  9323. - WTC(0x17f193c5), WTC(0x15e21445), WTC(0x13d114d0), WTC(0x11beb9aa),
  9324. - WTC(0x0fab272b), WTC(0x0d9681c2), WTC(0x0b80edf1), WTC(0x096a9049),
  9325. - WTC(0x07538d6b), WTC(0x053c0a01), WTC(0x03242abf), WTC(0x010c1460),
  9326. -};
  9327. -const FIXP_WTB FacWindowZir96[] = {
  9328. - WTC(0x7ef3eba0), WTC(0x7cdbd541), WTC(0x7ac3f5ff), WTC(0x78ac7295),
  9329. - WTC(0x76956fb7), WTC(0x747f120f), WTC(0x72697e3e), WTC(0x7054d8d5),
  9330. - WTC(0x6e414656), WTC(0x6c2eeb30), WTC(0x6a1debbb), WTC(0x680e6c3b),
  9331. - WTC(0x660090d6), WTC(0x63f47d96), WTC(0x61ea5666), WTC(0x5fe23f11),
  9332. - WTC(0x5ddc5b3b), WTC(0x5bd8ce63), WTC(0x59d7bbde), WTC(0x57d946d8),
  9333. - WTC(0x55dd924b), WTC(0x53e4c105), WTC(0x51eef59e), WTC(0x4ffc527b),
  9334. - WTC(0x4e0cf9c8), WTC(0x4c210d79), WTC(0x4a38af44), WTC(0x485400a3),
  9335. - WTC(0x467322ce), WTC(0x449636b9), WTC(0x42bd5d14), WTC(0x40e8b648),
  9336. - WTC(0x3f186274), WTC(0x3d4c816a), WTC(0x3b8532b0), WTC(0x39c29579),
  9337. - WTC(0x3804c8a9), WTC(0x364beacd), WTC(0x34981a1c), WTC(0x32e97475),
  9338. - WTC(0x3140175b), WTC(0x2f9c1ff8), WTC(0x2dfdab11), WTC(0x2c64d510),
  9339. - WTC(0x2ad1b9fb), WTC(0x29447570), WTC(0x27bd22ac), WTC(0x263bdc7f),
  9340. - WTC(0x24c0bd52), WTC(0x234bdf20), WTC(0x21dd5b79), WTC(0x20754b79),
  9341. - WTC(0x1f13c7d0), WTC(0x1db8e8b7), WTC(0x1c64c5f5), WTC(0x1b1776da),
  9342. - WTC(0x19d1123d), WTC(0x1891ae7d), WTC(0x1759617f), WTC(0x162840a9),
  9343. - WTC(0x14fe60e6), WTC(0x13dbd6a0), WTC(0x12c0b5c0), WTC(0x11ad11ae),
  9344. - WTC(0x10a0fd4e), WTC(0x0f9c8b01), WTC(0x0e9fcc9f), WTC(0x0daad37b),
  9345. - WTC(0x0cbdb060), WTC(0x0bd8738e), WTC(0x0afb2cbb), WTC(0x0a25eb11),
  9346. - WTC(0x0958bd2f), WTC(0x0893b125), WTC(0x07d6d473), WTC(0x0722340b),
  9347. - WTC(0x0675dc4f), WTC(0x05d1d90e), WTC(0x05363586), WTC(0x04a2fc62),
  9348. - WTC(0x041837b9), WTC(0x0395f10e), WTC(0x031c314e), WTC(0x02ab00d2),
  9349. - WTC(0x0242675c), WTC(0x01e26c16), WTC(0x018b1596), WTC(0x013c69d6),
  9350. - WTC(0x00f66e3c), WTC(0x00b92794), WTC(0x00849a11), WTC(0x0058c94c),
  9351. - WTC(0x0035b847), WTC(0x001b6968), WTC(0x0009de7e), WTC(0x000118bc),
  9352. -};
  9353. -const FIXP_WTB FacWindowSynth48[] = {
  9354. - WTC(0x7ffb9d15), WTC(0x7fd8878e), WTC(0x7f92661d), WTC(0x7f294bfd),
  9355. - WTC(0x7e9d55fc), WTC(0x7deeaa7a), WTC(0x7d1d7958), WTC(0x7c29fbee),
  9356. - WTC(0x7b1474fd), WTC(0x79dd3098), WTC(0x78848414), WTC(0x770acdec),
  9357. - WTC(0x757075ac), WTC(0x73b5ebd1), WTC(0x71dba9ab), WTC(0x6fe2313c),
  9358. - WTC(0x6dca0d14), WTC(0x6b93d02e), WTC(0x694015c3), WTC(0x66cf8120),
  9359. - WTC(0x6442bd7e), WTC(0x619a7dce), WTC(0x5ed77c8a), WTC(0x5bfa7b82),
  9360. - WTC(0x590443a7), WTC(0x55f5a4d2), WTC(0x52cf758f), WTC(0x4f9292dc),
  9361. - WTC(0x4c3fdff4), WTC(0x48d84609), WTC(0x455cb40c), WTC(0x41ce1e65),
  9362. - WTC(0x3e2d7eb1), WTC(0x3a7bd382), WTC(0x36ba2014), WTC(0x32e96c09),
  9363. - WTC(0x2f0ac320), WTC(0x2b1f34eb), WTC(0x2727d486), WTC(0x2325b847),
  9364. - WTC(0x1f19f97b), WTC(0x1b05b40f), WTC(0x16ea0646), WTC(0x12c8106f),
  9365. - WTC(0x0ea0f48c), WTC(0x0a75d60e), WTC(0x0647d97c), WTC(0x02182427),
  9366. -};
  9367. -const FIXP_WTB FacWindowZir48[] = {
  9368. - WTC(0x7de7dbd9), WTC(0x79b82684), WTC(0x758a29f2), WTC(0x715f0b74),
  9369. - WTC(0x6d37ef91), WTC(0x6915f9ba), WTC(0x64fa4bf1), WTC(0x60e60685),
  9370. - WTC(0x5cda47b9), WTC(0x58d82b7a), WTC(0x54e0cb15), WTC(0x50f53ce0),
  9371. - WTC(0x4d1693f7), WTC(0x4945dfec), WTC(0x45842c7e), WTC(0x41d2814f),
  9372. - WTC(0x3e31e19b), WTC(0x3aa34bf4), WTC(0x3727b9f7), WTC(0x33c0200c),
  9373. - WTC(0x306d6d24), WTC(0x2d308a71), WTC(0x2a0a5b2e), WTC(0x26fbbc59),
  9374. - WTC(0x2405847e), WTC(0x21288376), WTC(0x1e658232), WTC(0x1bbd4282),
  9375. - WTC(0x19307ee0), WTC(0x16bfea3d), WTC(0x146c2fd2), WTC(0x1235f2ec),
  9376. - WTC(0x101dcec4), WTC(0x0e245655), WTC(0x0c4a142f), WTC(0x0a8f8a54),
  9377. - WTC(0x08f53214), WTC(0x077b7bec), WTC(0x0622cf68), WTC(0x04eb8b03),
  9378. - WTC(0x03d60412), WTC(0x02e286a8), WTC(0x02115586), WTC(0x0162aa04),
  9379. - WTC(0x00d6b403), WTC(0x006d99e3), WTC(0x00277872), WTC(0x000462eb),
  9380. -};
  9381. diff --git a/libAACdec/src/usacdec_rom.h b/libAACdec/src/usacdec_rom.h
  9382. deleted file mode 100644
  9383. index f969e90..0000000
  9384. --- a/libAACdec/src/usacdec_rom.h
  9385. +++ /dev/null
  9386. @@ -1,154 +0,0 @@
  9387. -/* -----------------------------------------------------------------------------
  9388. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  9389. -
  9390. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  9391. -Forschung e.V. All rights reserved.
  9392. -
  9393. - 1. INTRODUCTION
  9394. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  9395. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  9396. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  9397. -a wide variety of Android devices.
  9398. -
  9399. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  9400. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  9401. -full-bandwidth communications codec by independent studies and is widely
  9402. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  9403. -specifications.
  9404. -
  9405. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  9406. -those of Fraunhofer) may be obtained through Via Licensing
  9407. -(www.vialicensing.com) or through the respective patent owners individually for
  9408. -the purpose of encoding or decoding bit streams in products that are compliant
  9409. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  9410. -Android devices already license these patent claims through Via Licensing or
  9411. -directly from the patent owners, and therefore FDK AAC Codec software may
  9412. -already be covered under those patent licenses when it is used for those
  9413. -licensed purposes only.
  9414. -
  9415. -Commercially-licensed AAC software libraries, including floating-point versions
  9416. -with enhanced sound quality, are also available from Fraunhofer. Users are
  9417. -encouraged to check the Fraunhofer website for additional applications
  9418. -information and documentation.
  9419. -
  9420. -2. COPYRIGHT LICENSE
  9421. -
  9422. -Redistribution and use in source and binary forms, with or without modification,
  9423. -are permitted without payment of copyright license fees provided that you
  9424. -satisfy the following conditions:
  9425. -
  9426. -You must retain the complete text of this software license in redistributions of
  9427. -the FDK AAC Codec or your modifications thereto in source code form.
  9428. -
  9429. -You must retain the complete text of this software license in the documentation
  9430. -and/or other materials provided with redistributions of the FDK AAC Codec or
  9431. -your modifications thereto in binary form. You must make available free of
  9432. -charge copies of the complete source code of the FDK AAC Codec and your
  9433. -modifications thereto to recipients of copies in binary form.
  9434. -
  9435. -The name of Fraunhofer may not be used to endorse or promote products derived
  9436. -from this library without prior written permission.
  9437. -
  9438. -You may not charge copyright license fees for anyone to use, copy or distribute
  9439. -the FDK AAC Codec software or your modifications thereto.
  9440. -
  9441. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  9442. -that you changed the software and the date of any change. For modified versions
  9443. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  9444. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  9445. -AAC Codec Library for Android."
  9446. -
  9447. -3. NO PATENT LICENSE
  9448. -
  9449. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  9450. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  9451. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  9452. -software.
  9453. -
  9454. -You may use this FDK AAC Codec software or modifications thereto only for
  9455. -purposes that are authorized by appropriate patent licenses.
  9456. -
  9457. -4. DISCLAIMER
  9458. -
  9459. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  9460. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  9461. -including but not limited to the implied warranties of merchantability and
  9462. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  9463. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  9464. -or consequential damages, including but not limited to procurement of substitute
  9465. -goods or services; loss of use, data, or profits, or business interruption,
  9466. -however caused and on any theory of liability, whether in contract, strict
  9467. -liability, or tort (including negligence), arising in any way out of the use of
  9468. -this software, even if advised of the possibility of such damage.
  9469. -
  9470. -5. CONTACT INFORMATION
  9471. -
  9472. -Fraunhofer Institute for Integrated Circuits IIS
  9473. -Attention: Audio and Multimedia Departments - FDK AAC LL
  9474. -Am Wolfsmantel 33
  9475. -91058 Erlangen, Germany
  9476. -
  9477. -www.iis.fraunhofer.de/amm
  9478. -amm-info@iis.fraunhofer.de
  9479. ------------------------------------------------------------------------------ */
  9480. -
  9481. -/**************************** AAC decoder library ******************************
  9482. -
  9483. - Author(s): M. Jander
  9484. -
  9485. - Description: re8.h
  9486. -
  9487. -*******************************************************************************/
  9488. -
  9489. -#ifndef USACDEC_ROM_H
  9490. -#define USACDEC_ROM_H
  9491. -
  9492. -#include "common_fix.h"
  9493. -#include "FDK_lpc.h"
  9494. -
  9495. -#include "usacdec_const.h"
  9496. -
  9497. -/* RE8 lattice quantiser constants */
  9498. -#define NB_SPHERE 32
  9499. -#define NB_LEADER 37
  9500. -#define NB_LDSIGN 226
  9501. -#define NB_LDQ3 9
  9502. -#define NB_LDQ4 28
  9503. -
  9504. -#define LSF_SCALE 13
  9505. -
  9506. -/* RE8 lattice quantiser tables */
  9507. -extern const UINT fdk_dec_tab_factorial[8];
  9508. -extern const UCHAR fdk_dec_Ia[NB_LEADER];
  9509. -extern const UCHAR fdk_dec_Ds[NB_LDSIGN];
  9510. -extern const USHORT fdk_dec_Is[NB_LDSIGN];
  9511. -extern const UCHAR fdk_dec_Ns[], fdk_dec_A3[], fdk_dec_A4[];
  9512. -extern const UCHAR fdk_dec_Da[][8];
  9513. -extern const USHORT fdk_dec_I3[], fdk_dec_I4[];
  9514. -
  9515. -/* temp float tables for LPC decoding */
  9516. -extern const FIXP_LPC fdk_dec_lsf_init[16];
  9517. -extern const FIXP_LPC fdk_dec_dico_lsf_abs_8b[16 * 256];
  9518. -
  9519. -/* ACELP tables */
  9520. -#define SF_QUA_GAIN7B 4
  9521. -extern const FIXP_SGL fdk_t_qua_gain7b[128 * 2];
  9522. -extern const FIXP_SGL lsp_interpol_factor[2][NB_SUBFR];
  9523. -
  9524. -/* For bass post filter */
  9525. -#define L_FILT 12 /* Delay of up-sampling filter */
  9526. -
  9527. -extern const FIXP_SGL fdk_dec_filt_lp[1 + L_FILT];
  9528. -
  9529. -extern const FIXP_WTB FacWindowSynth128[128];
  9530. -extern const FIXP_WTB FacWindowZir128[128];
  9531. -extern const FIXP_WTB FacWindowSynth64[64];
  9532. -extern const FIXP_WTB FacWindowZir64[64];
  9533. -extern const FIXP_WTB FacWindowSynth32[32];
  9534. -extern const FIXP_WTB FacWindowZir32[32];
  9535. -extern const FIXP_WTB FacWindowSynth96[96];
  9536. -extern const FIXP_WTB FacWindowZir96[96];
  9537. -extern const FIXP_WTB FacWindowSynth48[48];
  9538. -extern const FIXP_WTB FacWindowZir48[48];
  9539. -
  9540. -#endif /* USACDEC_ROM_H */
  9541. --
  9542. cgit v1.1