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.

9509 lines
392 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. --- a/Makefile.am
  44. +++ b/Makefile.am
  45. @@ -57,14 +57,7 @@ AACDEC_SRC = \
  46. libAACdec/src/channelinfo.cpp \
  47. libAACdec/src/ldfiltbank.cpp \
  48. libAACdec/src/pulsedata.cpp \
  49. - libAACdec/src/stereo.cpp \
  50. - libAACdec/src/usacdec_ace_d4t64.cpp \
  51. - libAACdec/src/usacdec_ace_ltp.cpp \
  52. - libAACdec/src/usacdec_acelp.cpp \
  53. - libAACdec/src/usacdec_fac.cpp \
  54. - libAACdec/src/usacdec_lpc.cpp \
  55. - libAACdec/src/usacdec_lpd.cpp \
  56. - libAACdec/src/usacdec_rom.cpp
  57. + libAACdec/src/stereo.cpp
  58. AACENC_SRC = \
  59. libAACenc/src/aacEnc_ram.cpp \
  60. --- a/Makefile.vc
  61. +++ b/Makefile.vc
  62. @@ -41,14 +41,7 @@ AACDEC_SRC = \
  63. libAACdec/src/channelinfo.cpp \
  64. libAACdec/src/ldfiltbank.cpp \
  65. libAACdec/src/pulsedata.cpp \
  66. - libAACdec/src/stereo.cpp \
  67. - libAACdec/src/usacdec_ace_d4t64.cpp \
  68. - libAACdec/src/usacdec_ace_ltp.cpp \
  69. - libAACdec/src/usacdec_acelp.cpp \
  70. - libAACdec/src/usacdec_fac.cpp \
  71. - libAACdec/src/usacdec_lpc.cpp \
  72. - libAACdec/src/usacdec_lpd.cpp \
  73. - libAACdec/src/usacdec_rom.cpp
  74. + libAACdec/src/stereo.cpp
  75. AACENC_SRC = \
  76. libAACenc/src/aacEnc_ram.cpp \
  77. --- a/libAACdec/src/aacdecoder.cpp
  78. +++ b/libAACdec/src/aacdecoder.cpp
  79. @@ -161,8 +161,6 @@ amm-info@iis.fraunhofer.de
  80. #include "aacdec_pns.h"
  81. -#include "usacdec_lpd.h"
  82. -
  83. #include "ac_arith_coder.h"
  84. #include "tpdec_lib.h"
  85. @@ -1942,17 +1940,6 @@ CAacDecoder_Init(HANDLE_AACDECODER self,
  86. goto bail;
  87. }
  88. }
  89. - if (elCh > 0) {
  90. - self->pAacDecoderStaticChannelInfo[ch - elCh]->nfRandomSeed =
  91. - (ULONG)0x3039;
  92. - if (self->elements[el2] == ID_USAC_CPE) {
  93. - if (asc->m_sc.m_usacConfig.element[el2].m_stereoConfigIndex !=
  94. - 1) {
  95. - self->pAacDecoderStaticChannelInfo[ch - elCh + 1]
  96. - ->nfRandomSeed = (ULONG)0x10932;
  97. - }
  98. - }
  99. - }
  100. } /* for each element */
  101. }
  102. @@ -2010,11 +1997,6 @@ CAacDecoder_Init(HANDLE_AACDECODER self,
  103. self->pAacDecoderStaticChannelInfo[ch]->pOverlapBuffer,
  104. OverlapBufferSize);
  105. - self->pAacDecoderStaticChannelInfo[ch]->last_core_mode = FD_LONG;
  106. - self->pAacDecoderStaticChannelInfo[ch]->last_lpd_mode = 255;
  107. -
  108. - self->pAacDecoderStaticChannelInfo[ch]->last_tcx_pitch = L_DIV;
  109. -
  110. /* Reset DRC control data for this channel */
  111. aacDecoder_drcInitChannelData(
  112. &self->pAacDecoderStaticChannelInfo[ch]->drcData);
  113. @@ -2893,10 +2875,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecod
  114. (self->frameOK && !(flags & AACDEC_CONCEAL));
  115. const int icsIsInvalid = (GetScaleFactorBandsTransmitted(pIcsInfo) >
  116. GetScaleFactorBandsTotal(pIcsInfo));
  117. - const int icsInfoUsedinFadeOut =
  118. - !(pAacDecoderChannelInfo->renderMode == AACDEC_RENDER_LPD &&
  119. - pAacDecoderStaticChannelInfo->last_lpd_mode == 0);
  120. - if (icsInfoUsedinFadeOut && icsIsInvalid && !mute_release_active) {
  121. + if (icsIsInvalid && !mute_release_active) {
  122. self->frameOK = 0;
  123. }
  124. }
  125. @@ -2956,16 +2935,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecod
  126. 2;
  127. } break;
  128. case AACDEC_RENDER_LPD:
  129. -
  130. - CLpd_RenderTimeSignal(
  131. - pAacDecoderStaticChannelInfo, pAacDecoderChannelInfo,
  132. - pTimeData + offset, self->streamInfo.aacSamplesPerFrame,
  133. - &self->samplingRateInfo[streamIndex],
  134. - (self->frameOK && !(flags & AACDEC_CONCEAL) &&
  135. - !frameOk_butConceal),
  136. - flags, self->flags[streamIndex]);
  137. -
  138. - self->extGainDelay = self->streamInfo.aacSamplesPerFrame;
  139. + ErrorStatus = AAC_DEC_UNKNOWN;
  140. break;
  141. default:
  142. ErrorStatus = AAC_DEC_UNKNOWN;
  143. --- a/libAACdec/src/block.cpp
  144. +++ b/libAACdec/src/block.cpp
  145. @@ -107,9 +107,6 @@ amm-info@iis.fraunhofer.de
  146. #include "scale.h"
  147. #include "FDK_tools_rom.h"
  148. -#include "usacdec_fac.h"
  149. -#include "usacdec_lpd.h"
  150. -#include "usacdec_lpc.h"
  151. #include "FDK_trigFcts.h"
  152. #include "ac_arith_coder.h"
  153. @@ -1010,162 +1007,7 @@ void CBlock_FrequencyToTime(
  154. nSpec = 8;
  155. break;
  156. }
  157. -
  158. {
  159. - int last_frame_lost = pAacDecoderStaticChannelInfo->last_lpc_lost;
  160. -
  161. - if (pAacDecoderStaticChannelInfo->last_core_mode == LPD) {
  162. - INT fac_FB = 1;
  163. - if (elFlags & AC_EL_FULLBANDLPD) {
  164. - fac_FB = 2;
  165. - }
  166. -
  167. - FIXP_DBL *synth;
  168. -
  169. - /* Keep some free space at the beginning of the buffer. To be used for
  170. - * past data */
  171. - if (!(elFlags & AC_EL_LPDSTEREOIDX)) {
  172. - synth = pWorkBuffer1 + ((PIT_MAX_MAX - (1 * L_SUBFR)) * fac_FB);
  173. - } else {
  174. - synth = pWorkBuffer1 + PIT_MAX_MAX * fac_FB;
  175. - }
  176. -
  177. - int fac_length =
  178. - (pAacDecoderChannelInfo->icsInfo.WindowSequence == BLOCK_SHORT)
  179. - ? (frameLen >> 4)
  180. - : (frameLen >> 3);
  181. -
  182. - INT pitch[NB_SUBFR_SUPERFR + SYN_SFD];
  183. - FIXP_DBL pit_gain[NB_SUBFR_SUPERFR + SYN_SFD];
  184. -
  185. - int nbDiv = (elFlags & AC_EL_FULLBANDLPD) ? 2 : 4;
  186. - int lFrame = (elFlags & AC_EL_FULLBANDLPD) ? frameLen / 2 : frameLen;
  187. - int nbSubfr =
  188. - lFrame / (nbDiv * L_SUBFR); /* number of subframes per division */
  189. - int LpdSfd = (nbDiv * nbSubfr) >> 1;
  190. - int SynSfd = LpdSfd - BPF_SFD;
  191. -
  192. - FDKmemclear(
  193. - pitch,
  194. - sizeof(
  195. - pitch)); // added to prevent ferret errors in bass_pf_1sf_delay
  196. - FDKmemclear(pit_gain, sizeof(pit_gain));
  197. -
  198. - /* FAC case */
  199. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 0 ||
  200. - pAacDecoderStaticChannelInfo->last_lpd_mode == 4) {
  201. - FIXP_DBL fac_buf[LFAC];
  202. - FIXP_LPC *A = pAacDecoderChannelInfo->data.usac.lp_coeff[0];
  203. -
  204. - if (!frameOk || last_frame_lost ||
  205. - (pAacDecoderChannelInfo->data.usac.fac_data[0] == NULL)) {
  206. - FDKmemclear(fac_buf,
  207. - pAacDecoderChannelInfo->granuleLength * sizeof(FIXP_DBL));
  208. - pAacDecoderChannelInfo->data.usac.fac_data[0] = fac_buf;
  209. - pAacDecoderChannelInfo->data.usac.fac_data_e[0] = 0;
  210. - }
  211. -
  212. - INT A_exp; /* linear prediction coefficients exponent */
  213. - {
  214. - for (int i = 0; i < M_LP_FILTER_ORDER; i++) {
  215. - A[i] = FX_DBL2FX_LPC(fixp_cos(
  216. - fMult(pAacDecoderStaticChannelInfo->lpc4_lsf[i],
  217. - FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  218. - LSF_SCALE - LSPARG_SCALE));
  219. - }
  220. -
  221. - E_LPC_f_lsp_a_conversion(A, A, &A_exp);
  222. - }
  223. -
  224. -#if defined(FDK_ASSERT_ENABLE)
  225. - nSamples =
  226. -#endif
  227. - CLpd_FAC_Acelp2Mdct(
  228. - &pAacDecoderStaticChannelInfo->IMdct, synth,
  229. - SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
  230. - pAacDecoderChannelInfo->specScale, nSpec,
  231. - pAacDecoderChannelInfo->data.usac.fac_data[0],
  232. - pAacDecoderChannelInfo->data.usac.fac_data_e[0], fac_length,
  233. - frameLen, tl,
  234. - FDKgetWindowSlope(
  235. - fr, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  236. - fr, A, A_exp, &pAacDecoderStaticChannelInfo->acelp,
  237. - (FIXP_DBL)0, /* FAC gain has already been applied. */
  238. - (last_frame_lost || !frameOk), 1,
  239. - pAacDecoderStaticChannelInfo->last_lpd_mode, 0,
  240. - pAacDecoderChannelInfo->currAliasingSymmetry);
  241. -
  242. - } else {
  243. -#if defined(FDK_ASSERT_ENABLE)
  244. - nSamples =
  245. -#endif
  246. - imlt_block(
  247. - &pAacDecoderStaticChannelInfo->IMdct, synth,
  248. - SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
  249. - pAacDecoderChannelInfo->specScale, nSpec, frameLen, tl,
  250. - FDKgetWindowSlope(
  251. - fl, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  252. - fl,
  253. - FDKgetWindowSlope(
  254. - fr, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  255. - fr, (FIXP_DBL)0,
  256. - pAacDecoderChannelInfo->currAliasingSymmetry
  257. - ? MLT_FLAG_CURR_ALIAS_SYMMETRY
  258. - : 0);
  259. - }
  260. - FDK_ASSERT(nSamples == frameLen);
  261. -
  262. - /* The "if" clause is entered both for fullbandLpd mono and
  263. - * non-fullbandLpd*. The "else"-> just for fullbandLpd stereo*/
  264. - if (!(elFlags & AC_EL_LPDSTEREOIDX)) {
  265. - FDKmemcpy(pitch, pAacDecoderStaticChannelInfo->old_T_pf,
  266. - SynSfd * sizeof(INT));
  267. - FDKmemcpy(pit_gain, pAacDecoderStaticChannelInfo->old_gain_pf,
  268. - SynSfd * sizeof(FIXP_DBL));
  269. -
  270. - for (int i = SynSfd; i < LpdSfd + 3; i++) {
  271. - pitch[i] = L_SUBFR;
  272. - pit_gain[i] = (FIXP_DBL)0;
  273. - }
  274. -
  275. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 0) {
  276. - pitch[SynSfd] = pitch[SynSfd - 1];
  277. - pit_gain[SynSfd] = pit_gain[SynSfd - 1];
  278. - if (IsLongBlock(&pAacDecoderChannelInfo->icsInfo)) {
  279. - pitch[SynSfd + 1] = pitch[SynSfd];
  280. - pit_gain[SynSfd + 1] = pit_gain[SynSfd];
  281. - }
  282. - }
  283. -
  284. - /* Copy old data to the beginning of the buffer */
  285. - {
  286. - FDKmemcpy(
  287. - pWorkBuffer1, pAacDecoderStaticChannelInfo->old_synth,
  288. - ((PIT_MAX_MAX - (1 * L_SUBFR)) * fac_FB) * sizeof(FIXP_DBL));
  289. - }
  290. -
  291. - FIXP_DBL *p2_synth = pWorkBuffer1 + (PIT_MAX_MAX * fac_FB);
  292. -
  293. - /* recalculate pitch gain to allow postfilering on FAC area */
  294. - for (int i = 0; i < SynSfd + 2; i++) {
  295. - int T = pitch[i];
  296. - FIXP_DBL gain = pit_gain[i];
  297. -
  298. - if (gain > (FIXP_DBL)0) {
  299. - gain = get_gain(&p2_synth[i * L_SUBFR * fac_FB],
  300. - &p2_synth[(i * L_SUBFR * fac_FB) - fac_FB * T],
  301. - L_SUBFR * fac_FB);
  302. - pit_gain[i] = gain;
  303. - }
  304. - }
  305. -
  306. - bass_pf_1sf_delay(p2_synth, pitch, pit_gain, frameLen,
  307. - (LpdSfd + 2) * L_SUBFR + BPF_SFD * L_SUBFR,
  308. - frameLen - (LpdSfd + 4) * L_SUBFR, outSamples,
  309. - pAacDecoderStaticChannelInfo->mem_bpf);
  310. - }
  311. -
  312. - } else /* last_core_mode was not LPD */
  313. {
  314. FIXP_DBL *tmp =
  315. pAacDecoderChannelInfo->pComStaticData->pWorkBufferCore1->mdctOutTemp;
  316. @@ -1190,11 +1032,6 @@ void CBlock_FrequencyToTime(
  317. }
  318. FDK_ASSERT(nSamples == frameLen);
  319. -
  320. - pAacDecoderStaticChannelInfo->last_core_mode =
  321. - (pAacDecoderChannelInfo->icsInfo.WindowSequence == BLOCK_SHORT) ? FD_SHORT
  322. - : FD_LONG;
  323. - pAacDecoderStaticChannelInfo->last_lpd_mode = 255;
  324. }
  325. #include "ldfiltbank.h"
  326. --- a/libAACdec/src/channel.cpp
  327. +++ b/libAACdec/src/channel.cpp
  328. @@ -106,9 +106,6 @@ amm-info@iis.fraunhofer.de
  329. #include "aacdec_tns.h"
  330. #include "FDK_bitstream.h"
  331. -#include "usacdec_lpd.h"
  332. -#include "usacdec_fac.h"
  333. -
  334. static void MapMidSideMaskToPnsCorrelation(
  335. CAacDecoderChannelInfo *pAacDecoderChannelInfo[2]) {
  336. int group;
  337. @@ -164,13 +161,6 @@ void CChannelElement_Decode(
  338. int maxSfBandsL = 0, maxSfBandsR = 0;
  339. int maybe_jstereo = (el_channels > 1);
  340. - if (flags & (AC_USAC | AC_RSVD50 | AC_RSV603DA) && el_channels == 2) {
  341. - if (pAacDecoderChannelInfo[L]->data.usac.core_mode ||
  342. - pAacDecoderChannelInfo[R]->data.usac.core_mode) {
  343. - maybe_jstereo = 0;
  344. - }
  345. - }
  346. -
  347. if (maybe_jstereo) {
  348. maxSfBandsL =
  349. GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo[L]->icsInfo);
  350. @@ -236,9 +226,6 @@ void CChannelElement_Decode(
  351. for (ch = 0; ch < el_channels; ch++) {
  352. if (pAacDecoderChannelInfo[ch]->renderMode == AACDEC_RENDER_LPD) {
  353. - /* Decode LPD data */
  354. - CLpdChannelStream_Decode(pAacDecoderChannelInfo[ch],
  355. - pAacDecoderStaticChannelInfo[ch], flags);
  356. } else {
  357. UCHAR noSfbs =
  358. GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo[ch]->icsInfo);
  359. @@ -651,13 +638,6 @@ AAC_DECODER_ERROR CChannelElement_Read(
  360. break;
  361. case core_mode:
  362. decision_bit = FDKreadBits(hBs, 1);
  363. - pAacDecoderChannelInfo[ch]->data.usac.core_mode = decision_bit;
  364. - if ((ch == 1) && (pAacDecoderChannelInfo[0]->data.usac.core_mode !=
  365. - pAacDecoderChannelInfo[1]->data.usac.core_mode)) {
  366. - /* StereoCoreToolInfo(core_mode[ch] ) */
  367. - pAacDecoderChannelInfo[0]->pDynData->RawDataInfo.CommonWindow = 0;
  368. - pAacDecoderChannelInfo[1]->pDynData->RawDataInfo.CommonWindow = 0;
  369. - }
  370. break;
  371. case tns_active:
  372. pAacDecoderChannelInfo[0]->pDynData->specificTo.usac.tns_active =
  373. @@ -671,53 +651,12 @@ AAC_DECODER_ERROR CChannelElement_Read(
  374. }
  375. break;
  376. case lpd_channel_stream:
  377. -
  378. - {
  379. - error = CLpdChannelStream_Read(/* = lpd_channel_stream() */
  380. - hBs, pAacDecoderChannelInfo[ch],
  381. - pAacDecoderStaticChannelInfo[ch],
  382. - pSamplingRateInfo, flags);
  383. - }
  384. -
  385. pAacDecoderChannelInfo[ch]->renderMode = AACDEC_RENDER_LPD;
  386. break;
  387. case fac_data: {
  388. int fFacDatPresent = FDKreadBit(hBs);
  389. - /* Wee need a valid fac_data[0] even if no FAC data is present (as
  390. - * temporal buffer) */
  391. - pAacDecoderChannelInfo[ch]->data.usac.fac_data[0] =
  392. - pAacDecoderChannelInfo[ch]->data.usac.fac_data0;
  393. -
  394. - if (fFacDatPresent) {
  395. - if (elFlags & AC_EL_LFE) {
  396. - error = AAC_DEC_PARSE_ERROR;
  397. - break;
  398. - }
  399. - /* FAC data present, this frame is FD, so the last mode had to be
  400. - * ACELP. */
  401. - if (pAacDecoderStaticChannelInfo[ch]->last_core_mode != LPD ||
  402. - pAacDecoderStaticChannelInfo[ch]->last_lpd_mode != 0) {
  403. - pAacDecoderChannelInfo[ch]->data.usac.core_mode_last = LPD;
  404. - pAacDecoderChannelInfo[ch]->data.usac.lpd_mode_last = 0;
  405. - /* We can't change the past! So look to the future and go ahead! */
  406. - }
  407. - CLpd_FAC_Read(hBs, pAacDecoderChannelInfo[ch]->data.usac.fac_data[0],
  408. - pAacDecoderChannelInfo[ch]->data.usac.fac_data_e,
  409. - CLpd_FAC_getLength(
  410. - IsLongBlock(&pAacDecoderChannelInfo[ch]->icsInfo),
  411. - pAacDecoderChannelInfo[ch]->granuleLength),
  412. - 1, 0);
  413. - } else {
  414. - if (pAacDecoderStaticChannelInfo[ch]->last_core_mode == LPD &&
  415. - pAacDecoderStaticChannelInfo[ch]->last_lpd_mode == 0) {
  416. - /* ACELP to FD transitons without FAC are possible. That is why we
  417. - zero it out (i.e FAC will not be considered in the subsequent
  418. - calculations */
  419. - FDKmemclear(pAacDecoderChannelInfo[ch]->data.usac.fac_data0,
  420. - LFAC * sizeof(FIXP_DBL));
  421. - }
  422. - }
  423. + error = AAC_DEC_PARSE_ERROR;
  424. } break;
  425. case esc2_rvlc:
  426. if (flags & AC_ER_RVLC) {
  427. @@ -887,13 +826,6 @@ AAC_DECODER_ERROR CChannelElement_Read(
  428. if (error != AAC_DEC_OK) {
  429. return error;
  430. }
  431. -
  432. - if (elFlags & AC_EL_USAC_NOISE) {
  433. - CBlock_ApplyNoise(pAacDecoderChannelInfo[ch], pSamplingRateInfo,
  434. - &pAacDecoderStaticChannelInfo[ch]->nfRandomSeed,
  435. - band_is_noise);
  436. -
  437. - } /* if (elFlags & AC_EL_USAC_NOISE) */
  438. }
  439. }
  440. --- a/libAACdec/src/channelinfo.h
  441. +++ b/libAACdec/src/channelinfo.h
  442. @@ -117,10 +117,6 @@ amm-info@iis.fraunhofer.de
  443. #include "aacdec_pns.h"
  444. -#include "usacdec_acelp.h"
  445. -#include "usacdec_const.h"
  446. -#include "usacdec_rom.h"
  447. -
  448. #include "ac_arith_coder.h"
  449. #include "aacdec_drc_types.h"
  450. @@ -202,55 +198,6 @@ typedef struct {
  451. INT pnsCurrentSeed;
  452. - /* LPD memory */
  453. - FIXP_DBL old_synth[PIT_MAX_MAX - L_SUBFR];
  454. - INT old_T_pf[SYN_SFD];
  455. - FIXP_DBL old_gain_pf[SYN_SFD];
  456. - FIXP_DBL mem_bpf[L_FILT + L_SUBFR];
  457. - UCHAR
  458. - old_bpf_control_info; /* (1: enable, 0: disable) bpf for past superframe
  459. - */
  460. -
  461. - USAC_COREMODE last_core_mode; /* core mode used by the decoder in previous
  462. - frame. (not signalled by the bitstream, see
  463. - CAacDecoderChannelInfo::core_mode_last !! )
  464. - */
  465. - UCHAR last_lpd_mode; /* LPD mode used by the decoder in last LPD subframe
  466. - (not signalled by the bitstream, see
  467. - CAacDecoderChannelInfo::lpd_mode_last !! ) */
  468. - UCHAR last_last_lpd_mode; /* LPD mode used in second last LPD subframe
  469. - (not signalled by the bitstream) */
  470. - UCHAR last_lpc_lost; /* Flag indicating that the previous LPC is lost */
  471. -
  472. - FIXP_LPC
  473. - lpc4_lsf[M_LP_FILTER_ORDER]; /* Last LPC4 coefficients in LSF domain. */
  474. - FIXP_LPC lsf_adaptive_mean[M_LP_FILTER_ORDER]; /* Adaptive mean of LPC
  475. - coefficients in LSF domain
  476. - for concealment. */
  477. - FIXP_LPC lp_coeff_old[2][M_LP_FILTER_ORDER]; /* Last LPC coefficients in LP
  478. - domain. lp_coeff_old[0] is lpc4 (coeffs for
  479. - right folding point of last tcx frame),
  480. - lp_coeff_old[1] are coeffs for left folding
  481. - point of last tcx frame */
  482. - INT lp_coeff_old_exp[2];
  483. -
  484. - FIXP_SGL
  485. - oldStability; /* LPC coeff stability value from last frame (required for
  486. - TCX concealment). */
  487. - UINT numLostLpdFrames; /* Number of consecutive lost subframes. */
  488. -
  489. - /* TCX memory */
  490. - FIXP_DBL last_tcx_gain;
  491. - INT last_tcx_gain_e;
  492. - FIXP_DBL last_alfd_gains[32]; /* Scaled by one bit. */
  493. - SHORT last_tcx_pitch;
  494. - UCHAR last_tcx_noise_factor;
  495. -
  496. - /* ACELP memory */
  497. - CAcelpStaticMem acelp;
  498. -
  499. - ULONG nfRandomSeed; /* seed value for USAC noise filling random generator */
  500. -
  501. CDrcChannelData drcData;
  502. CpePersistentData *pCpeStaticData;
  503. @@ -299,8 +246,6 @@ typedef shouldBeUnion {
  504. * used anymore. */
  505. FIXP_DBL mdctOutTemp[1024];
  506. - FIXP_DBL synth_buf[(PIT_MAX_MAX + SYN_DELAY + L_FRAME_PLUS)];
  507. -
  508. FIXP_DBL workBuffer[WB_SECTION_SIZE];
  509. }
  510. CWorkBufferCore1;
  511. @@ -335,42 +280,6 @@ typedef struct {
  512. */
  513. typedef struct {
  514. shouldBeUnion {
  515. - struct {
  516. - FIXP_DBL fac_data0[LFAC];
  517. - SCHAR fac_data_e[4];
  518. - FIXP_DBL
  519. - *fac_data[4]; /* Pointers to unused parts of pSpectralCoefficient */
  520. -
  521. - UCHAR core_mode; /* current core mode */
  522. - USAC_COREMODE
  523. - core_mode_last; /* previous core mode, signalled in the bitstream
  524. - (not done by the decoder, see
  525. - CAacDecoderStaticChannelInfo::last_core_mode !!)*/
  526. - UCHAR lpd_mode_last; /* previous LPD mode, signalled in the bitstream
  527. - (not done by the decoder, see
  528. - CAacDecoderStaticChannelInfo::last_core_mode !!)*/
  529. - UCHAR mod[4];
  530. - UCHAR bpf_control_info; /* (1: enable, 0: disable) bpf for current
  531. - superframe */
  532. -
  533. - FIXP_LPC lsp_coeff[5][M_LP_FILTER_ORDER]; /* linear prediction
  534. - coefficients in LSP domain */
  535. - FIXP_LPC
  536. - lp_coeff[5][M_LP_FILTER_ORDER]; /* linear prediction coefficients in
  537. - LP domain */
  538. - INT lp_coeff_exp[5];
  539. - FIXP_LPC lsf_adaptive_mean_cand
  540. - [M_LP_FILTER_ORDER]; /* concealment: is copied to
  541. - CAacDecoderStaticChannelInfo->lsf_adaptive_mean once frame is
  542. - assumed to be correct*/
  543. - FIXP_SGL aStability[4]; /* LPC coeff stability values required for ACELP
  544. - and TCX (concealment) */
  545. -
  546. - CAcelpChannelData acelp[4];
  547. -
  548. - FIXP_DBL tcx_gain[4];
  549. - SCHAR tcx_gain_e[4];
  550. - } usac;
  551. struct {
  552. CPnsData PnsData; /* Not required for USAC */
  553. --- a/libAACdec/src/usacdec_ace_d4t64.cpp
  554. +++ /dev/null
  555. @@ -1,439 +0,0 @@
  556. -/* -----------------------------------------------------------------------------
  557. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  558. -
  559. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  560. -Forschung e.V. All rights reserved.
  561. -
  562. - 1. INTRODUCTION
  563. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  564. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  565. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  566. -a wide variety of Android devices.
  567. -
  568. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  569. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  570. -full-bandwidth communications codec by independent studies and is widely
  571. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  572. -specifications.
  573. -
  574. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  575. -those of Fraunhofer) may be obtained through Via Licensing
  576. -(www.vialicensing.com) or through the respective patent owners individually for
  577. -the purpose of encoding or decoding bit streams in products that are compliant
  578. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  579. -Android devices already license these patent claims through Via Licensing or
  580. -directly from the patent owners, and therefore FDK AAC Codec software may
  581. -already be covered under those patent licenses when it is used for those
  582. -licensed purposes only.
  583. -
  584. -Commercially-licensed AAC software libraries, including floating-point versions
  585. -with enhanced sound quality, are also available from Fraunhofer. Users are
  586. -encouraged to check the Fraunhofer website for additional applications
  587. -information and documentation.
  588. -
  589. -2. COPYRIGHT LICENSE
  590. -
  591. -Redistribution and use in source and binary forms, with or without modification,
  592. -are permitted without payment of copyright license fees provided that you
  593. -satisfy the following conditions:
  594. -
  595. -You must retain the complete text of this software license in redistributions of
  596. -the FDK AAC Codec or your modifications thereto in source code form.
  597. -
  598. -You must retain the complete text of this software license in the documentation
  599. -and/or other materials provided with redistributions of the FDK AAC Codec or
  600. -your modifications thereto in binary form. You must make available free of
  601. -charge copies of the complete source code of the FDK AAC Codec and your
  602. -modifications thereto to recipients of copies in binary form.
  603. -
  604. -The name of Fraunhofer may not be used to endorse or promote products derived
  605. -from this library without prior written permission.
  606. -
  607. -You may not charge copyright license fees for anyone to use, copy or distribute
  608. -the FDK AAC Codec software or your modifications thereto.
  609. -
  610. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  611. -that you changed the software and the date of any change. For modified versions
  612. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  613. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  614. -AAC Codec Library for Android."
  615. -
  616. -3. NO PATENT LICENSE
  617. -
  618. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  619. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  620. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  621. -software.
  622. -
  623. -You may use this FDK AAC Codec software or modifications thereto only for
  624. -purposes that are authorized by appropriate patent licenses.
  625. -
  626. -4. DISCLAIMER
  627. -
  628. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  629. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  630. -including but not limited to the implied warranties of merchantability and
  631. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  632. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  633. -or consequential damages, including but not limited to procurement of substitute
  634. -goods or services; loss of use, data, or profits, or business interruption,
  635. -however caused and on any theory of liability, whether in contract, strict
  636. -liability, or tort (including negligence), arising in any way out of the use of
  637. -this software, even if advised of the possibility of such damage.
  638. -
  639. -5. CONTACT INFORMATION
  640. -
  641. -Fraunhofer Institute for Integrated Circuits IIS
  642. -Attention: Audio and Multimedia Departments - FDK AAC LL
  643. -Am Wolfsmantel 33
  644. -91058 Erlangen, Germany
  645. -
  646. -www.iis.fraunhofer.de/amm
  647. -amm-info@iis.fraunhofer.de
  648. ------------------------------------------------------------------------------ */
  649. -
  650. -/**************************** AAC decoder library ******************************
  651. -
  652. - Author(s):
  653. -
  654. - Description: ACELP
  655. -
  656. -*******************************************************************************/
  657. -
  658. -#include "usacdec_ace_d4t64.h"
  659. -
  660. -#define L_SUBFR 64 /* Subframe size */
  661. -
  662. -/*
  663. - * D_ACELP_add_pulse
  664. - *
  665. - * Parameters:
  666. - * pos I: position of pulse
  667. - * nb_pulse I: number of pulses
  668. - * track I: track
  669. - * code O: fixed codebook
  670. - *
  671. - * Function:
  672. - * Add pulses to fixed codebook
  673. - *
  674. - * Returns:
  675. - * void
  676. - */
  677. -static void D_ACELP_add_pulse(SHORT pos[], SHORT nb_pulse, SHORT track,
  678. - FIXP_COD code[]) {
  679. - SHORT i, k;
  680. - for (k = 0; k < nb_pulse; k++) {
  681. - /* i = ((pos[k] & (16-1))*NB_TRACK) + track; */
  682. - i = ((pos[k] & (16 - 1)) << 2) + track;
  683. - if ((pos[k] & 16) == 0) {
  684. - code[i] = code[i] + (FIXP_COD)(512 << (COD_BITS - FRACT_BITS));
  685. - } else {
  686. - code[i] = code[i] - (FIXP_COD)(512 << (COD_BITS - FRACT_BITS));
  687. - }
  688. - }
  689. - return;
  690. -}
  691. -/*
  692. - * D_ACELP_decode_1p_N1
  693. - *
  694. - * Parameters:
  695. - * index I: pulse index
  696. - * N I: number of bits for position
  697. - * offset I: offset
  698. - * pos O: position of the pulse
  699. - *
  700. - * Function:
  701. - * Decode 1 pulse with N+1 bits
  702. - *
  703. - * Returns:
  704. - * void
  705. - */
  706. -static void D_ACELP_decode_1p_N1(LONG index, SHORT N, SHORT offset,
  707. - SHORT pos[]) {
  708. - SHORT pos1;
  709. - LONG i, mask;
  710. -
  711. - mask = ((1 << N) - 1);
  712. - /*
  713. - * Decode 1 pulse with N+1 bits
  714. - */
  715. - pos1 = (SHORT)((index & mask) + offset);
  716. - i = ((index >> N) & 1);
  717. - if (i == 1) {
  718. - pos1 += 16;
  719. - }
  720. - pos[0] = pos1;
  721. - return;
  722. -}
  723. -/*
  724. - * D_ACELP_decode_2p_2N1
  725. - *
  726. - * Parameters:
  727. - * index I: pulse index
  728. - * N I: number of bits for position
  729. - * offset I: offset
  730. - * pos O: position of the pulse
  731. - *
  732. - * Function:
  733. - * Decode 2 pulses with 2*N+1 bits
  734. - *
  735. - * Returns:
  736. - * void
  737. - */
  738. -static void D_ACELP_decode_2p_2N1(LONG index, SHORT N, SHORT offset,
  739. - SHORT pos[]) {
  740. - SHORT pos1, pos2;
  741. - LONG mask, i;
  742. - mask = ((1 << N) - 1);
  743. - /*
  744. - * Decode 2 pulses with 2*N+1 bits
  745. - */
  746. - pos1 = (SHORT)(((index >> N) & mask) + offset);
  747. - i = (index >> (2 * N)) & 1;
  748. - pos2 = (SHORT)((index & mask) + offset);
  749. - if ((pos2 - pos1) < 0) {
  750. - if (i == 1) {
  751. - pos1 += 16;
  752. - } else {
  753. - pos2 += 16;
  754. - }
  755. - } else {
  756. - if (i == 1) {
  757. - pos1 += 16;
  758. - pos2 += 16;
  759. - }
  760. - }
  761. - pos[0] = pos1;
  762. - pos[1] = pos2;
  763. - return;
  764. -}
  765. -/*
  766. - * D_ACELP_decode_3p_3N1
  767. - *
  768. - * Parameters:
  769. - * index I: pulse index
  770. - * N I: number of bits for position
  771. - * offset I: offset
  772. - * pos O: position of the pulse
  773. - *
  774. - * Function:
  775. - * Decode 3 pulses with 3*N+1 bits
  776. - *
  777. - * Returns:
  778. - * void
  779. - */
  780. -static void D_ACELP_decode_3p_3N1(LONG index, SHORT N, SHORT offset,
  781. - SHORT pos[]) {
  782. - SHORT j;
  783. - LONG mask, idx;
  784. -
  785. - /*
  786. - * Decode 3 pulses with 3*N+1 bits
  787. - */
  788. - mask = ((1 << ((2 * N) - 1)) - 1);
  789. - idx = index & mask;
  790. - j = offset;
  791. - if (((index >> ((2 * N) - 1)) & 1) == 1) {
  792. - j += (1 << (N - 1));
  793. - }
  794. - D_ACELP_decode_2p_2N1(idx, N - 1, j, pos);
  795. - mask = ((1 << (N + 1)) - 1);
  796. - idx = (index >> (2 * N)) & mask;
  797. - D_ACELP_decode_1p_N1(idx, N, offset, pos + 2);
  798. - return;
  799. -}
  800. -/*
  801. - * D_ACELP_decode_4p_4N1
  802. - *
  803. - * Parameters:
  804. - * index I: pulse index
  805. - * N I: number of bits for position
  806. - * offset I: offset
  807. - * pos O: position of the pulse
  808. - *
  809. - * Function:
  810. - * Decode 4 pulses with 4*N+1 bits
  811. - *
  812. - * Returns:
  813. - * void
  814. - */
  815. -static void D_ACELP_decode_4p_4N1(LONG index, SHORT N, SHORT offset,
  816. - SHORT pos[]) {
  817. - SHORT j;
  818. - LONG mask, idx;
  819. - /*
  820. - * Decode 4 pulses with 4*N+1 bits
  821. - */
  822. - mask = ((1 << ((2 * N) - 1)) - 1);
  823. - idx = index & mask;
  824. - j = offset;
  825. - if (((index >> ((2 * N) - 1)) & 1) == 1) {
  826. - j += (1 << (N - 1));
  827. - }
  828. - D_ACELP_decode_2p_2N1(idx, N - 1, j, pos);
  829. - mask = ((1 << ((2 * N) + 1)) - 1);
  830. - idx = (index >> (2 * N)) & mask;
  831. - D_ACELP_decode_2p_2N1(idx, N, offset, pos + 2);
  832. - return;
  833. -}
  834. -/*
  835. - * D_ACELP_decode_4p_4N
  836. - *
  837. - * Parameters:
  838. - * index I: pulse index
  839. - * N I: number of bits for position
  840. - * offset I: offset
  841. - * pos O: position of the pulse
  842. - *
  843. - * Function:
  844. - * Decode 4 pulses with 4*N bits
  845. - *
  846. - * Returns:
  847. - * void
  848. - */
  849. -static void D_ACELP_decode_4p_4N(LONG index, SHORT N, SHORT offset,
  850. - SHORT pos[]) {
  851. - SHORT j, n_1;
  852. - /*
  853. - * Decode 4 pulses with 4*N bits
  854. - */
  855. - n_1 = N - 1;
  856. - j = offset + (1 << n_1);
  857. - switch ((index >> ((4 * N) - 2)) & 3) {
  858. - case 0:
  859. - if (((index >> ((4 * n_1) + 1)) & 1) == 0) {
  860. - D_ACELP_decode_4p_4N1(index, n_1, offset, pos);
  861. - } else {
  862. - D_ACELP_decode_4p_4N1(index, n_1, j, pos);
  863. - }
  864. - break;
  865. - case 1:
  866. - D_ACELP_decode_1p_N1((index >> ((3 * n_1) + 1)), n_1, offset, pos);
  867. - D_ACELP_decode_3p_3N1(index, n_1, j, pos + 1);
  868. - break;
  869. - case 2:
  870. - D_ACELP_decode_2p_2N1((index >> ((2 * n_1) + 1)), n_1, offset, pos);
  871. - D_ACELP_decode_2p_2N1(index, n_1, j, pos + 2);
  872. - break;
  873. - case 3:
  874. - D_ACELP_decode_3p_3N1((index >> (n_1 + 1)), n_1, offset, pos);
  875. - D_ACELP_decode_1p_N1(index, n_1, j, pos + 3);
  876. - break;
  877. - }
  878. - return;
  879. -}
  880. -
  881. -/*
  882. - * D_ACELP_decode_4t
  883. - *
  884. - * Parameters:
  885. - * index I: index
  886. - * mode I: speech mode
  887. - * code I: (Q9) algebraic (fixed) codebook excitation
  888. - *
  889. - * Function:
  890. - * 20, 36, 44, 52, 64, 72, 88 bits algebraic codebook.
  891. - * 4 tracks x 16 positions per track = 64 samples.
  892. - *
  893. - * 20 bits 5+5+5+5 --> 4 pulses in a frame of 64 samples.
  894. - * 36 bits 9+9+9+9 --> 8 pulses in a frame of 64 samples.
  895. - * 44 bits 13+9+13+9 --> 10 pulses in a frame of 64 samples.
  896. - * 52 bits 13+13+13+13 --> 12 pulses in a frame of 64 samples.
  897. - * 64 bits 2+2+2+2+14+14+14+14 --> 16 pulses in a frame of 64 samples.
  898. - * 72 bits 10+2+10+2+10+14+10+14 --> 18 pulses in a frame of 64 samples.
  899. - * 88 bits 11+11+11+11+11+11+11+11 --> 24 pulses in a frame of 64 samples.
  900. - *
  901. - * All pulses can have two (2) possible amplitudes: +1 or -1.
  902. - * Each pulse can sixteen (16) possible positions.
  903. - *
  904. - * codevector length 64
  905. - * number of track 4
  906. - * number of position 16
  907. - *
  908. - * Returns:
  909. - * void
  910. - */
  911. -void D_ACELP_decode_4t64(SHORT index[], int nbits, FIXP_COD code[]) {
  912. - LONG L_index;
  913. - SHORT k, pos[6];
  914. -
  915. - FDKmemclear(code, L_SUBFR * sizeof(FIXP_COD));
  916. -
  917. - /* decode the positions and signs of pulses and build the codeword */
  918. - switch (nbits) {
  919. - case 12:
  920. - for (k = 0; k < 4; k += 2) {
  921. - L_index = index[2 * (k / 2) + 1];
  922. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  923. - D_ACELP_add_pulse(pos, 1, 2 * (index[2 * (k / 2)]) + k / 2, code);
  924. - }
  925. - break;
  926. - case 16: {
  927. - int i = 0;
  928. - int offset = index[i++];
  929. - offset = (offset == 0) ? 1 : 3;
  930. - for (k = 0; k < 4; k++) {
  931. - if (k != offset) {
  932. - L_index = index[i++];
  933. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  934. - D_ACELP_add_pulse(pos, 1, k, code);
  935. - }
  936. - }
  937. - } break;
  938. - case 20:
  939. - for (k = 0; k < 4; k++) {
  940. - L_index = (LONG)index[k];
  941. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  942. - D_ACELP_add_pulse(pos, 1, k, code);
  943. - }
  944. - break;
  945. - case 28:
  946. - for (k = 0; k < 4 - 2; k++) {
  947. - L_index = (LONG)index[k];
  948. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  949. - D_ACELP_add_pulse(pos, 2, k, code);
  950. - }
  951. - for (k = 2; k < 4; k++) {
  952. - L_index = (LONG)index[k];
  953. - D_ACELP_decode_1p_N1(L_index, 4, 0, pos);
  954. - D_ACELP_add_pulse(pos, 1, k, code);
  955. - }
  956. - break;
  957. - case 36:
  958. - for (k = 0; k < 4; k++) {
  959. - L_index = (LONG)index[k];
  960. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  961. - D_ACELP_add_pulse(pos, 2, k, code);
  962. - }
  963. - break;
  964. - case 44:
  965. - for (k = 0; k < 4 - 2; k++) {
  966. - L_index = (LONG)index[k];
  967. - D_ACELP_decode_3p_3N1(L_index, 4, 0, pos);
  968. - D_ACELP_add_pulse(pos, 3, k, code);
  969. - }
  970. - for (k = 2; k < 4; k++) {
  971. - L_index = (LONG)index[k];
  972. - D_ACELP_decode_2p_2N1(L_index, 4, 0, pos);
  973. - D_ACELP_add_pulse(pos, 2, k, code);
  974. - }
  975. - break;
  976. - case 52:
  977. - for (k = 0; k < 4; k++) {
  978. - L_index = (LONG)index[k];
  979. - D_ACELP_decode_3p_3N1(L_index, 4, 0, pos);
  980. - D_ACELP_add_pulse(pos, 3, k, code);
  981. - }
  982. - break;
  983. - case 64:
  984. - for (k = 0; k < 4; k++) {
  985. - L_index = (((LONG)index[k] << 14) + (LONG)index[k + 4]);
  986. - D_ACELP_decode_4p_4N(L_index, 4, 0, pos);
  987. - D_ACELP_add_pulse(pos, 4, k, code);
  988. - }
  989. - break;
  990. - default:
  991. - FDK_ASSERT(0);
  992. - }
  993. - return;
  994. -}
  995. --- a/libAACdec/src/usacdec_ace_d4t64.h
  996. +++ /dev/null
  997. @@ -1,117 +0,0 @@
  998. -/* -----------------------------------------------------------------------------
  999. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1000. -
  1001. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1002. -Forschung e.V. All rights reserved.
  1003. -
  1004. - 1. INTRODUCTION
  1005. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1006. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1007. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1008. -a wide variety of Android devices.
  1009. -
  1010. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1011. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1012. -full-bandwidth communications codec by independent studies and is widely
  1013. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1014. -specifications.
  1015. -
  1016. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1017. -those of Fraunhofer) may be obtained through Via Licensing
  1018. -(www.vialicensing.com) or through the respective patent owners individually for
  1019. -the purpose of encoding or decoding bit streams in products that are compliant
  1020. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1021. -Android devices already license these patent claims through Via Licensing or
  1022. -directly from the patent owners, and therefore FDK AAC Codec software may
  1023. -already be covered under those patent licenses when it is used for those
  1024. -licensed purposes only.
  1025. -
  1026. -Commercially-licensed AAC software libraries, including floating-point versions
  1027. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1028. -encouraged to check the Fraunhofer website for additional applications
  1029. -information and documentation.
  1030. -
  1031. -2. COPYRIGHT LICENSE
  1032. -
  1033. -Redistribution and use in source and binary forms, with or without modification,
  1034. -are permitted without payment of copyright license fees provided that you
  1035. -satisfy the following conditions:
  1036. -
  1037. -You must retain the complete text of this software license in redistributions of
  1038. -the FDK AAC Codec or your modifications thereto in source code form.
  1039. -
  1040. -You must retain the complete text of this software license in the documentation
  1041. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1042. -your modifications thereto in binary form. You must make available free of
  1043. -charge copies of the complete source code of the FDK AAC Codec and your
  1044. -modifications thereto to recipients of copies in binary form.
  1045. -
  1046. -The name of Fraunhofer may not be used to endorse or promote products derived
  1047. -from this library without prior written permission.
  1048. -
  1049. -You may not charge copyright license fees for anyone to use, copy or distribute
  1050. -the FDK AAC Codec software or your modifications thereto.
  1051. -
  1052. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1053. -that you changed the software and the date of any change. For modified versions
  1054. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1055. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1056. -AAC Codec Library for Android."
  1057. -
  1058. -3. NO PATENT LICENSE
  1059. -
  1060. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1061. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1062. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1063. -software.
  1064. -
  1065. -You may use this FDK AAC Codec software or modifications thereto only for
  1066. -purposes that are authorized by appropriate patent licenses.
  1067. -
  1068. -4. DISCLAIMER
  1069. -
  1070. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1071. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1072. -including but not limited to the implied warranties of merchantability and
  1073. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1074. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1075. -or consequential damages, including but not limited to procurement of substitute
  1076. -goods or services; loss of use, data, or profits, or business interruption,
  1077. -however caused and on any theory of liability, whether in contract, strict
  1078. -liability, or tort (including negligence), arising in any way out of the use of
  1079. -this software, even if advised of the possibility of such damage.
  1080. -
  1081. -5. CONTACT INFORMATION
  1082. -
  1083. -Fraunhofer Institute for Integrated Circuits IIS
  1084. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1085. -Am Wolfsmantel 33
  1086. -91058 Erlangen, Germany
  1087. -
  1088. -www.iis.fraunhofer.de/amm
  1089. -amm-info@iis.fraunhofer.de
  1090. ------------------------------------------------------------------------------ */
  1091. -
  1092. -/**************************** AAC decoder library ******************************
  1093. -
  1094. - Author(s):
  1095. -
  1096. - Description: ACELP
  1097. -
  1098. -*******************************************************************************/
  1099. -
  1100. -#ifndef USACDEC_ACE_D4T64_H
  1101. -#define USACDEC_ACE_D4T64_H
  1102. -
  1103. -#include "common_fix.h"
  1104. -
  1105. -/* Data type definition for the fixed codebook vector */
  1106. -#define FIXP_COD FIXP_SGL
  1107. -#define FX_COD2FX_DBL(x) (FX_SGL2FX_DBL(x))
  1108. -#define FX_DBL2FX_COD(x) FX_DBL2FX_SGL((x) + (FIXP_DBL)0x8000)
  1109. -#define FX_SGL2FX_COD(x) (x)
  1110. -#define COD_BITS FRACT_BITS
  1111. -
  1112. -void D_ACELP_decode_4t64(SHORT index[], int nbits, FIXP_COD code[]);
  1113. -
  1114. -#endif /* USACDEC_ACE_D4T64_H */
  1115. --- a/libAACdec/src/usacdec_ace_ltp.cpp
  1116. +++ /dev/null
  1117. @@ -1,229 +0,0 @@
  1118. -/* -----------------------------------------------------------------------------
  1119. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1120. -
  1121. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1122. -Forschung e.V. All rights reserved.
  1123. -
  1124. - 1. INTRODUCTION
  1125. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1126. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1127. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1128. -a wide variety of Android devices.
  1129. -
  1130. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1131. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1132. -full-bandwidth communications codec by independent studies and is widely
  1133. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1134. -specifications.
  1135. -
  1136. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1137. -those of Fraunhofer) may be obtained through Via Licensing
  1138. -(www.vialicensing.com) or through the respective patent owners individually for
  1139. -the purpose of encoding or decoding bit streams in products that are compliant
  1140. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1141. -Android devices already license these patent claims through Via Licensing or
  1142. -directly from the patent owners, and therefore FDK AAC Codec software may
  1143. -already be covered under those patent licenses when it is used for those
  1144. -licensed purposes only.
  1145. -
  1146. -Commercially-licensed AAC software libraries, including floating-point versions
  1147. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1148. -encouraged to check the Fraunhofer website for additional applications
  1149. -information and documentation.
  1150. -
  1151. -2. COPYRIGHT LICENSE
  1152. -
  1153. -Redistribution and use in source and binary forms, with or without modification,
  1154. -are permitted without payment of copyright license fees provided that you
  1155. -satisfy the following conditions:
  1156. -
  1157. -You must retain the complete text of this software license in redistributions of
  1158. -the FDK AAC Codec or your modifications thereto in source code form.
  1159. -
  1160. -You must retain the complete text of this software license in the documentation
  1161. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1162. -your modifications thereto in binary form. You must make available free of
  1163. -charge copies of the complete source code of the FDK AAC Codec and your
  1164. -modifications thereto to recipients of copies in binary form.
  1165. -
  1166. -The name of Fraunhofer may not be used to endorse or promote products derived
  1167. -from this library without prior written permission.
  1168. -
  1169. -You may not charge copyright license fees for anyone to use, copy or distribute
  1170. -the FDK AAC Codec software or your modifications thereto.
  1171. -
  1172. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1173. -that you changed the software and the date of any change. For modified versions
  1174. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1175. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1176. -AAC Codec Library for Android."
  1177. -
  1178. -3. NO PATENT LICENSE
  1179. -
  1180. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1181. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1182. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1183. -software.
  1184. -
  1185. -You may use this FDK AAC Codec software or modifications thereto only for
  1186. -purposes that are authorized by appropriate patent licenses.
  1187. -
  1188. -4. DISCLAIMER
  1189. -
  1190. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1191. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1192. -including but not limited to the implied warranties of merchantability and
  1193. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1194. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1195. -or consequential damages, including but not limited to procurement of substitute
  1196. -goods or services; loss of use, data, or profits, or business interruption,
  1197. -however caused and on any theory of liability, whether in contract, strict
  1198. -liability, or tort (including negligence), arising in any way out of the use of
  1199. -this software, even if advised of the possibility of such damage.
  1200. -
  1201. -5. CONTACT INFORMATION
  1202. -
  1203. -Fraunhofer Institute for Integrated Circuits IIS
  1204. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1205. -Am Wolfsmantel 33
  1206. -91058 Erlangen, Germany
  1207. -
  1208. -www.iis.fraunhofer.de/amm
  1209. -amm-info@iis.fraunhofer.de
  1210. ------------------------------------------------------------------------------ */
  1211. -
  1212. -/**************************** AAC decoder library ******************************
  1213. -
  1214. - Author(s): Matthias Hildenbrand
  1215. -
  1216. - Description: USAC ACELP LTP filter
  1217. -
  1218. -*******************************************************************************/
  1219. -
  1220. -#include "usacdec_ace_ltp.h"
  1221. -
  1222. -#include "genericStds.h"
  1223. -#include "common_fix.h"
  1224. -
  1225. -#define UP_SAMP 4
  1226. -#define L_INTERPOL2 16
  1227. -#define L_SUBFR 64
  1228. -
  1229. -#define A2 FL2FX_SGL(2 * 0.18f)
  1230. -#define B FL2FX_SGL(0.64f)
  1231. -
  1232. -static const LONG Pred_lt4_inter4_2[UP_SAMP][L_INTERPOL2] = {
  1233. - {(LONG)0x0000FFFC, (LONG)0x0008FFFC, (LONG)0xFFEB004C, (LONG)0xFF50014A,
  1234. - (LONG)0xFDD90351, (LONG)0xFB2A06CD, (LONG)0xF6920D46, (LONG)0xEBB42B35,
  1235. - (LONG)0x6D9EEF39, (LONG)0x0618FE0F, (LONG)0xFFE00131, (LONG)0xFE5501C5,
  1236. - (LONG)0xFE5E015D, (LONG)0xFEF700B6, (LONG)0xFF920037, (LONG)0xFFEC0003},
  1237. - {(LONG)0x0002FFF2, (LONG)0x0026FFBD, (LONG)0x005DFF98, (LONG)0x0055FFEF,
  1238. - (LONG)0xFF89015F, (LONG)0xFD3A04E5, (LONG)0xF7D90DAA, (LONG)0xE67A50EE,
  1239. - (LONG)0x50EEE67A, (LONG)0x0DAAF7D9, (LONG)0x04E5FD3A, (LONG)0x015FFF89,
  1240. - (LONG)0xFFEF0055, (LONG)0xFF98005D, (LONG)0xFFBD0026, (LONG)0xFFF20002},
  1241. - {(LONG)0x0003FFEC, (LONG)0x0037FF92, (LONG)0x00B6FEF7, (LONG)0x015DFE5E,
  1242. - (LONG)0x01C5FE55, (LONG)0x0131FFE0, (LONG)0xFE0F0618, (LONG)0xEF396D9E,
  1243. - (LONG)0x2B35EBB4, (LONG)0x0D46F692, (LONG)0x06CDFB2A, (LONG)0x0351FDD9,
  1244. - (LONG)0x014AFF50, (LONG)0x004CFFEB, (LONG)0xFFFC0008, (LONG)0xFFFC0000},
  1245. - {(LONG)0x0002FFF2, (LONG)0x002BFF9E, (LONG)0x00B9FECE, (LONG)0x01CFFD75,
  1246. - (LONG)0x035EFBC1, (LONG)0x0521FA0C, (LONG)0x06AAF8C9, (LONG)0x07907852,
  1247. - (LONG)0x0790F8C9, (LONG)0x06AAFA0C, (LONG)0x0521FBC1, (LONG)0x035EFD75,
  1248. - (LONG)0x01CFFECE, (LONG)0x00B9FF9E, (LONG)0x002BFFF2, (LONG)0x00020000}};
  1249. -
  1250. -void Pred_lt4(FIXP_DBL exc[], /* in/out: excitation buffer */
  1251. - int T0, /* input : integer pitch lag */
  1252. - int frac /* input : fraction of lag in range 0..3 */
  1253. -) {
  1254. - int j;
  1255. - FIXP_DBL *x;
  1256. - const LONG *interpol;
  1257. - FIXP_DBL L_sumb, L_sumt;
  1258. -
  1259. - x = &exc[-T0 - L_INTERPOL2 + 1];
  1260. -
  1261. - /* remap frac and x:
  1262. - 0 -> 3 x (unchanged)
  1263. - 1 -> 0 x--
  1264. - 2 -> 1 x--
  1265. - 3 -> 2 x--
  1266. - */
  1267. -
  1268. - if (--frac < 0)
  1269. - frac += UP_SAMP;
  1270. - else
  1271. - x--;
  1272. -
  1273. - j = L_SUBFR + 1;
  1274. - do {
  1275. - LONG filt;
  1276. - FIXP_DBL x0, x1;
  1277. - FIXP_DBL *xi = x++;
  1278. - interpol = Pred_lt4_inter4_2[frac];
  1279. - int i = 3;
  1280. -
  1281. - filt = *interpol++;
  1282. - x0 = *xi++;
  1283. - x1 = *xi++;
  1284. - L_sumt = fMultDiv2(x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1285. - L_sumb = fMultDiv2(x1, (FIXP_SGL)((SHORT)filt));
  1286. - do {
  1287. - filt = *interpol++;
  1288. - x0 = *xi++;
  1289. - x1 = *xi++;
  1290. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1291. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1292. -
  1293. - filt = *interpol++;
  1294. - x0 = *xi++;
  1295. - x1 = *xi++;
  1296. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1297. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1298. -
  1299. - filt = *interpol++;
  1300. - x0 = *xi++;
  1301. - x1 = *xi++;
  1302. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1303. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1304. -
  1305. - filt = *interpol++;
  1306. - x0 = *xi++;
  1307. - x1 = *xi++;
  1308. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1309. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1310. -
  1311. - filt = *interpol++;
  1312. - x0 = *xi++;
  1313. - x1 = *xi++;
  1314. - L_sumt = fMultAddDiv2(L_sumt, x0, (FIXP_SGL)((SHORT)(filt >> 16)));
  1315. - L_sumb = fMultAddDiv2(L_sumb, x1, (FIXP_SGL)((SHORT)filt));
  1316. - } while (--i != 0);
  1317. -
  1318. - L_sumb <<= 1;
  1319. - L_sumb = fAddSaturate(L_sumt << 1, L_sumb);
  1320. - *exc++ = L_sumb;
  1321. - } while (--j != 0);
  1322. - return;
  1323. -}
  1324. -
  1325. -void Pred_lt4_postfilter(FIXP_DBL exc[] /* in/out: excitation buffer */
  1326. -) {
  1327. - /*
  1328. - exc[i] = A*exc[i-1] + B*exc[i] + A*exc[i+1]
  1329. - exc[i+1] = A*exc[i] + B*exc[i+1] + A*exc[i+2] ; i = 0:2:62
  1330. - */
  1331. - int i;
  1332. - FIXP_DBL sum0, sum1, a_exc0, a_exc1;
  1333. - a_exc0 = fMultDiv2(A2, exc[-1]);
  1334. - a_exc1 = fMultDiv2(A2, exc[0]);
  1335. -
  1336. - /* ARM926: 22 cycles/iteration */
  1337. - for (i = 0; i < L_SUBFR; i += 2) {
  1338. - sum0 = a_exc0 + fMult(B, exc[i]);
  1339. - sum1 = a_exc1 + fMult(B, exc[i + 1]);
  1340. - a_exc0 = fMultDiv2(A2, exc[i + 1]);
  1341. - a_exc1 = fMultDiv2(A2, exc[i + 2]);
  1342. - exc[i] = sum0 + a_exc0;
  1343. - exc[i + 1] = sum1 + a_exc1;
  1344. - }
  1345. - return;
  1346. -}
  1347. --- a/libAACdec/src/usacdec_ace_ltp.h
  1348. +++ /dev/null
  1349. @@ -1,128 +0,0 @@
  1350. -/* -----------------------------------------------------------------------------
  1351. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1352. -
  1353. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1354. -Forschung e.V. All rights reserved.
  1355. -
  1356. - 1. INTRODUCTION
  1357. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1358. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1359. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1360. -a wide variety of Android devices.
  1361. -
  1362. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1363. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1364. -full-bandwidth communications codec by independent studies and is widely
  1365. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1366. -specifications.
  1367. -
  1368. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1369. -those of Fraunhofer) may be obtained through Via Licensing
  1370. -(www.vialicensing.com) or through the respective patent owners individually for
  1371. -the purpose of encoding or decoding bit streams in products that are compliant
  1372. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1373. -Android devices already license these patent claims through Via Licensing or
  1374. -directly from the patent owners, and therefore FDK AAC Codec software may
  1375. -already be covered under those patent licenses when it is used for those
  1376. -licensed purposes only.
  1377. -
  1378. -Commercially-licensed AAC software libraries, including floating-point versions
  1379. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1380. -encouraged to check the Fraunhofer website for additional applications
  1381. -information and documentation.
  1382. -
  1383. -2. COPYRIGHT LICENSE
  1384. -
  1385. -Redistribution and use in source and binary forms, with or without modification,
  1386. -are permitted without payment of copyright license fees provided that you
  1387. -satisfy the following conditions:
  1388. -
  1389. -You must retain the complete text of this software license in redistributions of
  1390. -the FDK AAC Codec or your modifications thereto in source code form.
  1391. -
  1392. -You must retain the complete text of this software license in the documentation
  1393. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1394. -your modifications thereto in binary form. You must make available free of
  1395. -charge copies of the complete source code of the FDK AAC Codec and your
  1396. -modifications thereto to recipients of copies in binary form.
  1397. -
  1398. -The name of Fraunhofer may not be used to endorse or promote products derived
  1399. -from this library without prior written permission.
  1400. -
  1401. -You may not charge copyright license fees for anyone to use, copy or distribute
  1402. -the FDK AAC Codec software or your modifications thereto.
  1403. -
  1404. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1405. -that you changed the software and the date of any change. For modified versions
  1406. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1407. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1408. -AAC Codec Library for Android."
  1409. -
  1410. -3. NO PATENT LICENSE
  1411. -
  1412. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1413. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1414. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1415. -software.
  1416. -
  1417. -You may use this FDK AAC Codec software or modifications thereto only for
  1418. -purposes that are authorized by appropriate patent licenses.
  1419. -
  1420. -4. DISCLAIMER
  1421. -
  1422. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1423. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1424. -including but not limited to the implied warranties of merchantability and
  1425. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1426. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1427. -or consequential damages, including but not limited to procurement of substitute
  1428. -goods or services; loss of use, data, or profits, or business interruption,
  1429. -however caused and on any theory of liability, whether in contract, strict
  1430. -liability, or tort (including negligence), arising in any way out of the use of
  1431. -this software, even if advised of the possibility of such damage.
  1432. -
  1433. -5. CONTACT INFORMATION
  1434. -
  1435. -Fraunhofer Institute for Integrated Circuits IIS
  1436. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1437. -Am Wolfsmantel 33
  1438. -91058 Erlangen, Germany
  1439. -
  1440. -www.iis.fraunhofer.de/amm
  1441. -amm-info@iis.fraunhofer.de
  1442. ------------------------------------------------------------------------------ */
  1443. -
  1444. -/**************************** AAC decoder library ******************************
  1445. -
  1446. - Author(s): Matthias Hildenbrand
  1447. -
  1448. - Description: USAC ACELP LTP filter
  1449. -
  1450. -*******************************************************************************/
  1451. -
  1452. -#ifndef USACDEC_ACE_LTP_H
  1453. -#define USACDEC_ACE_LTP_H
  1454. -
  1455. -#include "common_fix.h"
  1456. -
  1457. -/**
  1458. - * \brief Compute the initial adaptive codebook excitation v'(n) by
  1459. - * interpolating the past excitation vector u'(n).
  1460. - * \param exc points to adaptive codebook of current subframe (input/output)
  1461. - * \param T0 integer part of decoded pitch lag (input)
  1462. - * \param frac fractional part of decoded pitch lag (0..3) (input)
  1463. - */
  1464. -void Pred_lt4(FIXP_DBL exc[], /* in/out: excitation buffer */
  1465. - int T0, /* input : integer pitch lag */
  1466. - int frac /* input : fraction of lag */
  1467. -);
  1468. -
  1469. -/**
  1470. - * \brief Compute the adaptive codebook excitation v(n) in case of
  1471. - * ltp_filtering_flag == 0.
  1472. - * \param exc points to adaptive codebook of current subframe (input/output)
  1473. - */
  1474. -void Pred_lt4_postfilter(FIXP_DBL exc[] /* in/out: excitation buffer */
  1475. -);
  1476. -
  1477. -#endif /* USACDEC_ACE_LTP_H */
  1478. --- a/libAACdec/src/usacdec_acelp.cpp
  1479. +++ /dev/null
  1480. @@ -1,1296 +0,0 @@
  1481. -/* -----------------------------------------------------------------------------
  1482. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  1483. -
  1484. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  1485. -Forschung e.V. All rights reserved.
  1486. -
  1487. - 1. INTRODUCTION
  1488. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  1489. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  1490. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  1491. -a wide variety of Android devices.
  1492. -
  1493. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  1494. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  1495. -full-bandwidth communications codec by independent studies and is widely
  1496. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  1497. -specifications.
  1498. -
  1499. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  1500. -those of Fraunhofer) may be obtained through Via Licensing
  1501. -(www.vialicensing.com) or through the respective patent owners individually for
  1502. -the purpose of encoding or decoding bit streams in products that are compliant
  1503. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  1504. -Android devices already license these patent claims through Via Licensing or
  1505. -directly from the patent owners, and therefore FDK AAC Codec software may
  1506. -already be covered under those patent licenses when it is used for those
  1507. -licensed purposes only.
  1508. -
  1509. -Commercially-licensed AAC software libraries, including floating-point versions
  1510. -with enhanced sound quality, are also available from Fraunhofer. Users are
  1511. -encouraged to check the Fraunhofer website for additional applications
  1512. -information and documentation.
  1513. -
  1514. -2. COPYRIGHT LICENSE
  1515. -
  1516. -Redistribution and use in source and binary forms, with or without modification,
  1517. -are permitted without payment of copyright license fees provided that you
  1518. -satisfy the following conditions:
  1519. -
  1520. -You must retain the complete text of this software license in redistributions of
  1521. -the FDK AAC Codec or your modifications thereto in source code form.
  1522. -
  1523. -You must retain the complete text of this software license in the documentation
  1524. -and/or other materials provided with redistributions of the FDK AAC Codec or
  1525. -your modifications thereto in binary form. You must make available free of
  1526. -charge copies of the complete source code of the FDK AAC Codec and your
  1527. -modifications thereto to recipients of copies in binary form.
  1528. -
  1529. -The name of Fraunhofer may not be used to endorse or promote products derived
  1530. -from this library without prior written permission.
  1531. -
  1532. -You may not charge copyright license fees for anyone to use, copy or distribute
  1533. -the FDK AAC Codec software or your modifications thereto.
  1534. -
  1535. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  1536. -that you changed the software and the date of any change. For modified versions
  1537. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  1538. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  1539. -AAC Codec Library for Android."
  1540. -
  1541. -3. NO PATENT LICENSE
  1542. -
  1543. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  1544. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  1545. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  1546. -software.
  1547. -
  1548. -You may use this FDK AAC Codec software or modifications thereto only for
  1549. -purposes that are authorized by appropriate patent licenses.
  1550. -
  1551. -4. DISCLAIMER
  1552. -
  1553. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  1554. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  1555. -including but not limited to the implied warranties of merchantability and
  1556. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  1557. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  1558. -or consequential damages, including but not limited to procurement of substitute
  1559. -goods or services; loss of use, data, or profits, or business interruption,
  1560. -however caused and on any theory of liability, whether in contract, strict
  1561. -liability, or tort (including negligence), arising in any way out of the use of
  1562. -this software, even if advised of the possibility of such damage.
  1563. -
  1564. -5. CONTACT INFORMATION
  1565. -
  1566. -Fraunhofer Institute for Integrated Circuits IIS
  1567. -Attention: Audio and Multimedia Departments - FDK AAC LL
  1568. -Am Wolfsmantel 33
  1569. -91058 Erlangen, Germany
  1570. -
  1571. -www.iis.fraunhofer.de/amm
  1572. -amm-info@iis.fraunhofer.de
  1573. ------------------------------------------------------------------------------ */
  1574. -
  1575. -/**************************** AAC decoder library ******************************
  1576. -
  1577. - Author(s): Matthias Hildenbrand
  1578. -
  1579. - Description: USAC ACELP frame decoder
  1580. -
  1581. -*******************************************************************************/
  1582. -
  1583. -#include "usacdec_acelp.h"
  1584. -
  1585. -#include "usacdec_ace_d4t64.h"
  1586. -#include "usacdec_ace_ltp.h"
  1587. -#include "usacdec_rom.h"
  1588. -#include "usacdec_lpc.h"
  1589. -#include "genericStds.h"
  1590. -
  1591. -#define PIT_FR2_12k8 128 /* Minimum pitch lag with resolution 1/2 */
  1592. -#define PIT_FR1_12k8 160 /* Minimum pitch lag with resolution 1 */
  1593. -#define TILT_CODE2 \
  1594. - FL2FXCONST_SGL(0.3f * 2.0f) /* ACELP code pre-emphasis factor ( *2 ) */
  1595. -#define PIT_SHARP \
  1596. - FL2FXCONST_SGL(0.85f) /* pitch sharpening factor */
  1597. -#define PREEMPH_FAC \
  1598. - FL2FXCONST_SGL(0.68f) /* ACELP synth pre-emphasis factor */
  1599. -
  1600. -#define ACELP_HEADROOM 1
  1601. -#define ACELP_OUTSCALE (MDCT_OUT_HEADROOM - ACELP_HEADROOM)
  1602. -
  1603. -/**
  1604. - * \brief Calculate pre-emphasis (1 - mu z^-1) on input signal.
  1605. - * \param[in] in pointer to input signal; in[-1] is also needed.
  1606. - * \param[out] out pointer to output signal.
  1607. - * \param[in] L length of filtering.
  1608. - */
  1609. -/* static */
  1610. -void E_UTIL_preemph(const FIXP_DBL *in, FIXP_DBL *out, INT L) {
  1611. - int i;
  1612. -
  1613. - for (i = 0; i < L; i++) {
  1614. - out[i] = in[i] - fMult(PREEMPH_FAC, in[i - 1]);
  1615. - }
  1616. -
  1617. - return;
  1618. -}
  1619. -
  1620. -/**
  1621. - * \brief Calculate de-emphasis 1/(1 - TILT_CODE z^-1) on innovative codebook
  1622. - * vector.
  1623. - * \param[in,out] x innovative codebook vector.
  1624. - */
  1625. -static void Preemph_code(
  1626. - FIXP_COD x[] /* (i/o) : input signal overwritten by the output */
  1627. -) {
  1628. - int i;
  1629. - FIXP_DBL L_tmp;
  1630. -
  1631. - /* ARM926: 12 cycles per sample */
  1632. - for (i = L_SUBFR - 1; i > 0; i--) {
  1633. - L_tmp = FX_COD2FX_DBL(x[i]);
  1634. - L_tmp -= fMultDiv2(x[i - 1], TILT_CODE2);
  1635. - x[i] = FX_DBL2FX_COD(L_tmp);
  1636. - }
  1637. -}
  1638. -
  1639. -/**
  1640. - * \brief Apply pitch sharpener to the innovative codebook vector.
  1641. - * \param[in,out] x innovative codebook vector.
  1642. - * \param[in] pit_lag decoded pitch lag.
  1643. - */
  1644. -static void Pit_shrp(
  1645. - FIXP_COD x[], /* in/out: impulse response (or algebraic code) */
  1646. - int pit_lag /* input : pitch lag */
  1647. -) {
  1648. - int i;
  1649. - FIXP_DBL L_tmp;
  1650. -
  1651. - for (i = pit_lag; i < L_SUBFR; i++) {
  1652. - L_tmp = FX_COD2FX_DBL(x[i]);
  1653. - L_tmp += fMult(x[i - pit_lag], PIT_SHARP);
  1654. - x[i] = FX_DBL2FX_COD(L_tmp);
  1655. - }
  1656. -
  1657. - return;
  1658. -}
  1659. -
  1660. - /**
  1661. - * \brief Calculate Quantized codebook gain, Quantized pitch gain and unbiased
  1662. - * Innovative code vector energy.
  1663. - * \param[in] index index of quantizer.
  1664. - * \param[in] code innovative code vector with exponent = SF_CODE.
  1665. - * \param[out] gain_pit Quantized pitch gain g_p with exponent = SF_GAIN_P.
  1666. - * \param[out] gain_code Quantized codebook gain g_c.
  1667. - * \param[in] mean_ener mean_ener defined in open-loop (2 bits), exponent = 7.
  1668. - * \param[out] E_code unbiased innovative code vector energy.
  1669. - * \param[out] E_code_e exponent of unbiased innovative code vector energy.
  1670. - */
  1671. -
  1672. -#define SF_MEAN_ENER_LG10 9
  1673. -
  1674. -/* pow(10.0, {18, 30, 42, 54}/20.0) /(float)(1<<SF_MEAN_ENER_LG10) */
  1675. -static const FIXP_DBL pow_10_mean_energy[4] = {0x01fc5ebd, 0x07e7db92,
  1676. - 0x1f791f65, 0x7d4bfba3};
  1677. -
  1678. -static void D_gain2_plus(int index, FIXP_COD code[], FIXP_SGL *gain_pit,
  1679. - FIXP_DBL *gain_code, int mean_ener_bits, int bfi,
  1680. - FIXP_SGL *past_gpit, FIXP_DBL *past_gcode,
  1681. - FIXP_DBL *pEner_code, int *pEner_code_e) {
  1682. - FIXP_DBL Ltmp;
  1683. - FIXP_DBL gcode0, gcode_inov;
  1684. - INT gcode0_e, gcode_inov_e;
  1685. - int i;
  1686. -
  1687. - FIXP_DBL ener_code;
  1688. - INT ener_code_e;
  1689. -
  1690. - /* ener_code = sum(code[]^2) */
  1691. - ener_code = FIXP_DBL(0);
  1692. - for (i = 0; i < L_SUBFR; i++) {
  1693. - ener_code += fPow2Div2(code[i]);
  1694. - }
  1695. -
  1696. - ener_code_e = fMax(fNorm(ener_code) - 1, 0);
  1697. - ener_code <<= ener_code_e;
  1698. - ener_code_e = 2 * SF_CODE + 1 - ener_code_e;
  1699. -
  1700. - /* export energy of code for calc_period_factor() */
  1701. - *pEner_code = ener_code;
  1702. - *pEner_code_e = ener_code_e;
  1703. -
  1704. - ener_code += scaleValue(FL2FXCONST_DBL(0.01f), -ener_code_e);
  1705. -
  1706. - /* ener_code *= 1/L_SUBFR, and make exponent even (because of square root
  1707. - * below). */
  1708. - if (ener_code_e & 1) {
  1709. - ener_code_e -= 5;
  1710. - ener_code >>= 1;
  1711. - } else {
  1712. - ener_code_e -= 6;
  1713. - }
  1714. - gcode_inov = invSqrtNorm2(ener_code, &gcode0_e);
  1715. - gcode_inov_e = gcode0_e - (ener_code_e >> 1);
  1716. -
  1717. - if (bfi) {
  1718. - FIXP_DBL tgcode;
  1719. - FIXP_SGL tgpit;
  1720. -
  1721. - tgpit = *past_gpit;
  1722. -
  1723. - if (tgpit > FL2FXCONST_SGL(0.95f / (1 << SF_GAIN_P))) {
  1724. - tgpit = FL2FXCONST_SGL(0.95f / (1 << SF_GAIN_P));
  1725. - } else if (tgpit < FL2FXCONST_SGL(0.5f / (1 << SF_GAIN_P))) {
  1726. - tgpit = FL2FXCONST_SGL(0.5f / (1 << SF_GAIN_P));
  1727. - }
  1728. - *gain_pit = tgpit;
  1729. - tgpit = FX_DBL2FX_SGL(fMult(tgpit, FL2FXCONST_DBL(0.95f)));
  1730. - *past_gpit = tgpit;
  1731. -
  1732. - tgpit = FL2FXCONST_SGL(1.4f / (1 << SF_GAIN_P)) - tgpit;
  1733. - tgcode = fMult(*past_gcode, tgpit) << SF_GAIN_P;
  1734. - *gain_code = scaleValue(fMult(tgcode, gcode_inov), gcode_inov_e);
  1735. - *past_gcode = tgcode;
  1736. -
  1737. - return;
  1738. - }
  1739. -
  1740. - /*-------------- Decode gains ---------------*/
  1741. - /*
  1742. - gcode0 = pow(10.0, (float)mean_ener/20.0);
  1743. - gcode0 = gcode0 / sqrt(ener_code/L_SUBFR);
  1744. - */
  1745. - gcode0 = pow_10_mean_energy[mean_ener_bits];
  1746. - gcode0 = fMultDiv2(gcode0, gcode_inov);
  1747. - gcode0_e = gcode0_e + SF_MEAN_ENER_LG10 - (ener_code_e >> 1) + 1;
  1748. -
  1749. - i = index << 1;
  1750. - *gain_pit = fdk_t_qua_gain7b[i]; /* adaptive codebook gain */
  1751. - /* t_qua_gain[ind2p1] : fixed codebook gain correction factor */
  1752. - Ltmp = fMult(fdk_t_qua_gain7b[i + 1], gcode0);
  1753. - *gain_code = scaleValue(Ltmp, gcode0_e - SF_GAIN_C + SF_QUA_GAIN7B);
  1754. -
  1755. - /* update bad frame handler */
  1756. - *past_gpit = *gain_pit;
  1757. -
  1758. - /*--------------------------------------------------------
  1759. - past_gcode = gain_code/gcode_inov
  1760. - --------------------------------------------------------*/
  1761. - {
  1762. - FIXP_DBL gcode_m;
  1763. - INT gcode_e;
  1764. -
  1765. - gcode_m = fDivNormHighPrec(Ltmp, gcode_inov, &gcode_e);
  1766. - gcode_e += (gcode0_e - SF_GAIN_C + SF_QUA_GAIN7B) - (gcode_inov_e);
  1767. - *past_gcode = scaleValue(gcode_m, gcode_e);
  1768. - }
  1769. -}
  1770. -
  1771. -/**
  1772. - * \brief Calculate period/voicing factor r_v
  1773. - * \param[in] exc pitch excitation.
  1774. - * \param[in] gain_pit gain of pitch g_p.
  1775. - * \param[in] gain_code gain of code g_c.
  1776. - * \param[in] gain_code_e exponent of gain of code.
  1777. - * \param[in] ener_code unbiased innovative code vector energy.
  1778. - * \param[in] ener_code_e exponent of unbiased innovative code vector energy.
  1779. - * \return period/voice factor r_v (-1=unvoiced to 1=voiced), exponent SF_PFAC.
  1780. - */
  1781. -static FIXP_DBL calc_period_factor(FIXP_DBL exc[], FIXP_SGL gain_pit,
  1782. - FIXP_DBL gain_code, FIXP_DBL ener_code,
  1783. - int ener_code_e) {
  1784. - int ener_exc_e, L_tmp_e, s = 0;
  1785. - FIXP_DBL ener_exc, L_tmp;
  1786. - FIXP_DBL period_fac;
  1787. -
  1788. - /* energy of pitch excitation */
  1789. - ener_exc = (FIXP_DBL)0;
  1790. - for (int i = 0; i < L_SUBFR; i++) {
  1791. - ener_exc += fPow2Div2(exc[i]) >> s;
  1792. - if (ener_exc >= FL2FXCONST_DBL(0.5f)) {
  1793. - ener_exc >>= 1;
  1794. - s++;
  1795. - }
  1796. - }
  1797. -
  1798. - ener_exc_e = fNorm(ener_exc);
  1799. - ener_exc = fMult(ener_exc << ener_exc_e, fPow2(gain_pit));
  1800. - if (ener_exc != (FIXP_DBL)0) {
  1801. - ener_exc_e = 2 * SF_EXC + 1 + 2 * SF_GAIN_P - ener_exc_e + s;
  1802. - } else {
  1803. - ener_exc_e = 0;
  1804. - }
  1805. -
  1806. - /* energy of innovative code excitation */
  1807. - /* L_tmp = ener_code * gain_code*gain_code; */
  1808. - L_tmp_e = fNorm(gain_code);
  1809. - L_tmp = fPow2(gain_code << L_tmp_e);
  1810. - L_tmp = fMult(ener_code, L_tmp);
  1811. - L_tmp_e = 2 * SF_GAIN_C + ener_code_e - 2 * L_tmp_e;
  1812. -
  1813. - /* Find common exponent */
  1814. - {
  1815. - FIXP_DBL num, den;
  1816. - int exp_diff;
  1817. -
  1818. - exp_diff = ener_exc_e - L_tmp_e;
  1819. - if (exp_diff >= 0) {
  1820. - ener_exc >>= 1;
  1821. - if (exp_diff <= DFRACT_BITS - 2) {
  1822. - L_tmp >>= exp_diff + 1;
  1823. - } else {
  1824. - L_tmp = (FIXP_DBL)0;
  1825. - }
  1826. - den = ener_exc + L_tmp;
  1827. - if (ener_exc_e < DFRACT_BITS - 1) {
  1828. - den += scaleValue(FL2FXCONST_DBL(0.01f), -ener_exc_e - 1);
  1829. - }
  1830. - } else {
  1831. - if (exp_diff >= -(DFRACT_BITS - 2)) {
  1832. - ener_exc >>= 1 - exp_diff;
  1833. - } else {
  1834. - ener_exc = (FIXP_DBL)0;
  1835. - }
  1836. - L_tmp >>= 1;
  1837. - den = ener_exc + L_tmp;
  1838. - if (L_tmp_e < DFRACT_BITS - 1) {
  1839. - den += scaleValue(FL2FXCONST_DBL(0.01f), -L_tmp_e - 1);
  1840. - }
  1841. - }
  1842. - num = (ener_exc - L_tmp);
  1843. - num >>= SF_PFAC;
  1844. -
  1845. - if (den > (FIXP_DBL)0) {
  1846. - if (ener_exc > L_tmp) {
  1847. - period_fac = schur_div(num, den, 16);
  1848. - } else {
  1849. - period_fac = -schur_div(-num, den, 16);
  1850. - }
  1851. - } else {
  1852. - period_fac = (FIXP_DBL)MAXVAL_DBL;
  1853. - }
  1854. - }
  1855. -
  1856. - /* exponent = SF_PFAC */
  1857. - return period_fac;
  1858. -}
  1859. -
  1860. -/*------------------------------------------------------------*
  1861. - * noise enhancer *
  1862. - * ~~~~~~~~~~~~~~ *
  1863. - * - Enhance excitation on noise. (modify gain of code) *
  1864. - * If signal is noisy and LPC filter is stable, move gain *
  1865. - * of code 1.5 dB toward gain of code threshold. *
  1866. - * This decrease by 3 dB noise energy variation. *
  1867. - *------------------------------------------------------------*/
  1868. -/**
  1869. - * \brief Enhance excitation on noise. (modify gain of code)
  1870. - * \param[in] gain_code Quantized codebook gain g_c, exponent = SF_GAIN_C.
  1871. - * \param[in] period_fac periodicity factor, exponent = SF_PFAC.
  1872. - * \param[in] stab_fac stability factor, exponent = SF_STAB.
  1873. - * \param[in,out] p_gc_threshold modified gain of previous subframe.
  1874. - * \return gain_code smoothed gain of code g_sc, exponent = SF_GAIN_C.
  1875. - */
  1876. -static FIXP_DBL
  1877. -noise_enhancer(/* (o) : smoothed gain g_sc SF_GAIN_C */
  1878. - FIXP_DBL gain_code, /* (i) : Quantized codebook gain SF_GAIN_C */
  1879. - FIXP_DBL period_fac, /* (i) : periodicity factor (-1=unvoiced to
  1880. - 1=voiced), SF_PFAC */
  1881. - FIXP_SGL stab_fac, /* (i) : stability factor (0 <= ... < 1.0)
  1882. - SF_STAB */
  1883. - FIXP_DBL
  1884. - *p_gc_threshold) /* (io): gain of code threshold SF_GAIN_C */
  1885. -{
  1886. - FIXP_DBL fac, L_tmp, gc_thres;
  1887. -
  1888. - gc_thres = *p_gc_threshold;
  1889. -
  1890. - L_tmp = gain_code;
  1891. - if (L_tmp < gc_thres) {
  1892. - L_tmp += fMultDiv2(gain_code,
  1893. - FL2FXCONST_SGL(2.0 * 0.19f)); /* +1.5dB => *(1.0+0.19) */
  1894. - if (L_tmp > gc_thres) {
  1895. - L_tmp = gc_thres;
  1896. - }
  1897. - } else {
  1898. - L_tmp = fMult(gain_code,
  1899. - FL2FXCONST_SGL(1.0f / 1.19f)); /* -1.5dB => *10^(-1.5/20) */
  1900. - if (L_tmp < gc_thres) {
  1901. - L_tmp = gc_thres;
  1902. - }
  1903. - }
  1904. - *p_gc_threshold = L_tmp;
  1905. -
  1906. - /* voicing factor lambda = 0.5*(1-period_fac) */
  1907. - /* gain smoothing factor S_m = lambda*stab_fac (=fac)
  1908. - = 0.5(stab_fac - stab_fac * period_fac) */
  1909. - fac = (FX_SGL2FX_DBL(stab_fac) >> (SF_PFAC + 1)) -
  1910. - fMultDiv2(stab_fac, period_fac);
  1911. - /* fac_e = SF_PFAC + SF_STAB */
  1912. - FDK_ASSERT(fac >= (FIXP_DBL)0);
  1913. -
  1914. - /* gain_code = (float)((fac*tmp) + ((1.0-fac)*gain_code)); */
  1915. - gain_code = fMult(fac, L_tmp) -
  1916. - fMult(FL2FXCONST_DBL(-1.0f / (1 << (SF_PFAC + SF_STAB))) + fac,
  1917. - gain_code);
  1918. - gain_code <<= (SF_PFAC + SF_STAB);
  1919. -
  1920. - return gain_code;
  1921. -}
  1922. -
  1923. -/**
  1924. - * \brief Update adaptive codebook u'(n) (exc)
  1925. - * Enhance pitch of c(n) and build post-processed excitation u(n) (exc2)
  1926. - * \param[in] code innovative codevector c(n), exponent = SF_CODE.
  1927. - * \param[in,out] exc filtered adaptive codebook v(n), exponent = SF_EXC.
  1928. - * \param[in] gain_pit adaptive codebook gain, exponent = SF_GAIN_P.
  1929. - * \param[in] gain_code innovative codebook gain g_c, exponent = SF_GAIN_C.
  1930. - * \param[in] gain_code_smoothed smoothed innov. codebook gain g_sc, exponent =
  1931. - * SF_GAIN_C.
  1932. - * \param[in] period_fac periodicity factor r_v, exponent = SF_PFAC.
  1933. - * \param[out] exc2 post-processed excitation u(n), exponent = SF_EXC.
  1934. - */
  1935. -void BuildAdaptiveExcitation(
  1936. - FIXP_COD code[], /* (i) : algebraic codevector c(n) Q9 */
  1937. - FIXP_DBL exc[], /* (io): filtered adaptive codebook v(n) Q15 */
  1938. - FIXP_SGL gain_pit, /* (i) : adaptive codebook gain g_p Q14 */
  1939. - FIXP_DBL gain_code, /* (i) : innovative codebook gain g_c Q16 */
  1940. - FIXP_DBL gain_code_smoothed, /* (i) : smoothed innov. codebook gain g_sc
  1941. - Q16 */
  1942. - FIXP_DBL period_fac, /* (i) : periodicity factor r_v Q15 */
  1943. - FIXP_DBL exc2[] /* (o) : post-processed excitation u(n) Q15 */
  1944. -) {
  1945. -/* Note: code[L_SUBFR] and exc2[L_SUBFR] share the same memory!
  1946. - If exc2[i] is written, code[i] will be destroyed!
  1947. -*/
  1948. -#define SF (SF_CODE + SF_GAIN_C + 1 - SF_EXC)
  1949. -
  1950. - int i;
  1951. - FIXP_DBL tmp, cpe, code_smooth_prev, code_smooth;
  1952. -
  1953. - FIXP_COD code_i;
  1954. - FIXP_DBL cpe_code_smooth, cpe_code_smooth_prev;
  1955. -
  1956. - /* cpe = (1+r_v)/8 * 2 ; ( SF = -1) */
  1957. - cpe = (period_fac >> (2 - SF_PFAC)) + FL2FXCONST_DBL(0.25f);
  1958. -
  1959. - /* u'(n) */
  1960. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1); /* v(0)*g_p */
  1961. - *exc++ = tmp + (fMultDiv2(code[0], gain_code) << SF);
  1962. -
  1963. - /* u(n) */
  1964. - code_smooth_prev = fMultDiv2(*code++, gain_code_smoothed)
  1965. - << SF; /* c(0) * g_sc */
  1966. - code_i = *code++;
  1967. - code_smooth = fMultDiv2(code_i, gain_code_smoothed) << SF; /* c(1) * g_sc */
  1968. - tmp += code_smooth_prev; /* tmp = v(0)*g_p + c(0)*g_sc */
  1969. - cpe_code_smooth = fMultDiv2(cpe, code_smooth);
  1970. - *exc2++ = tmp - cpe_code_smooth;
  1971. - cpe_code_smooth_prev = fMultDiv2(cpe, code_smooth_prev);
  1972. -
  1973. - i = L_SUBFR - 2;
  1974. - do /* ARM926: 22 cycles per iteration */
  1975. - {
  1976. - /* u'(n) */
  1977. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1);
  1978. - *exc++ = tmp + (fMultDiv2(code_i, gain_code) << SF);
  1979. - /* u(n) */
  1980. - tmp += code_smooth; /* += g_sc * c(i) */
  1981. - tmp -= cpe_code_smooth_prev;
  1982. - cpe_code_smooth_prev = cpe_code_smooth;
  1983. - code_i = *code++;
  1984. - code_smooth = fMultDiv2(code_i, gain_code_smoothed) << SF;
  1985. - cpe_code_smooth = fMultDiv2(cpe, code_smooth);
  1986. - *exc2++ = tmp - cpe_code_smooth; /* tmp - c_pe * g_sc * c(i+1) */
  1987. - } while (--i != 0);
  1988. -
  1989. - /* u'(n) */
  1990. - tmp = fMultDiv2(*exc, gain_pit) << (SF_GAIN_P + 1);
  1991. - *exc = tmp + (fMultDiv2(code_i, gain_code) << SF);
  1992. - /* u(n) */
  1993. - tmp += code_smooth;
  1994. - tmp -= cpe_code_smooth_prev;
  1995. - *exc2++ = tmp;
  1996. -
  1997. - return;
  1998. -}
  1999. -
  2000. -/**
  2001. - * \brief Interpolate LPC vector in LSP domain for current subframe and convert
  2002. - * to LP domain
  2003. - * \param[in] lsp_old LPC vector (LSP domain) corresponding to the beginning of
  2004. - * current ACELP frame.
  2005. - * \param[in] lsp_new LPC vector (LSP domain) corresponding to the end of
  2006. - * current ACELP frame.
  2007. - * \param[in] subfr_nr number of current ACELP subframe 0..3.
  2008. - * \param[in] nb_subfr total number of ACELP subframes in this frame.
  2009. - * \param[out] A LP filter coefficients for current ACELP subframe, exponent =
  2010. - * SF_A_COEFFS.
  2011. - */
  2012. -/* static */
  2013. -void int_lpc_acelp(
  2014. - const FIXP_LPC lsp_old[], /* input : LSPs from past frame */
  2015. - const FIXP_LPC lsp_new[], /* input : LSPs from present frame */
  2016. - int subfr_nr, int nb_subfr,
  2017. - FIXP_LPC
  2018. - A[], /* output: interpolated LP coefficients for current subframe */
  2019. - INT *A_exp) {
  2020. - int i;
  2021. - FIXP_LPC lsp_interpol[M_LP_FILTER_ORDER];
  2022. - FIXP_SGL fac_old, fac_new;
  2023. -
  2024. - FDK_ASSERT((nb_subfr == 3) || (nb_subfr == 4));
  2025. -
  2026. - fac_old = lsp_interpol_factor[nb_subfr & 0x1][(nb_subfr - 1) - subfr_nr];
  2027. - fac_new = lsp_interpol_factor[nb_subfr & 0x1][subfr_nr];
  2028. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  2029. - lsp_interpol[i] = FX_DBL2FX_LPC(
  2030. - (fMultDiv2(lsp_old[i], fac_old) + fMultDiv2(lsp_new[i], fac_new)) << 1);
  2031. - }
  2032. -
  2033. - E_LPC_f_lsp_a_conversion(lsp_interpol, A, A_exp);
  2034. -
  2035. - return;
  2036. -}
  2037. -
  2038. -/**
  2039. - * \brief Perform LP synthesis by filtering the post-processed excitation u(n)
  2040. - * through the LP synthesis filter 1/A(z)
  2041. - * \param[in] a LP filter coefficients, exponent = SF_A_COEFFS.
  2042. - * \param[in] length length of input/output signal.
  2043. - * \param[in] x post-processed excitation u(n).
  2044. - * \param[in,out] y LP synthesis signal and filter memory
  2045. - * y[-M_LP_FILTER_ORDER..-1].
  2046. - */
  2047. -
  2048. -/* static */
  2049. -void Syn_filt(const FIXP_LPC a[], /* (i) : a[m] prediction coefficients Q12 */
  2050. - const INT a_exp,
  2051. - INT length, /* (i) : length of input/output signal (64|128) */
  2052. - FIXP_DBL x[], /* (i) : input signal Qx */
  2053. - FIXP_DBL y[] /* (i/o) : filter states / output signal Qx-s*/
  2054. -) {
  2055. - int i, j;
  2056. - FIXP_DBL L_tmp;
  2057. -
  2058. - for (i = 0; i < length; i++) {
  2059. - L_tmp = (FIXP_DBL)0;
  2060. -
  2061. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  2062. - L_tmp -= fMultDiv2(a[j], y[i - (j + 1)]) >> (LP_FILTER_SCALE - 1);
  2063. - }
  2064. -
  2065. - L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE);
  2066. - y[i] = fAddSaturate(L_tmp, x[i]);
  2067. - }
  2068. -
  2069. - return;
  2070. -}
  2071. -
  2072. -/**
  2073. - * \brief Calculate de-emphasis 1/(1 - mu z^-1) on input signal.
  2074. - * \param[in] x input signal.
  2075. - * \param[out] y output signal.
  2076. - * \param[in] L length of signal.
  2077. - * \param[in,out] mem memory (signal[-1]).
  2078. - */
  2079. -/* static */
  2080. -void Deemph(FIXP_DBL *x, FIXP_DBL *y, int L, FIXP_DBL *mem) {
  2081. - int i;
  2082. - FIXP_DBL yi = *mem;
  2083. -
  2084. - for (i = 0; i < L; i++) {
  2085. - FIXP_DBL xi = x[i] >> 1;
  2086. - xi = fMultAddDiv2(xi, PREEMPH_FAC, yi);
  2087. - yi = SATURATE_LEFT_SHIFT(xi, 1, 32);
  2088. - y[i] = yi;
  2089. - }
  2090. - *mem = yi;
  2091. - return;
  2092. -}
  2093. -
  2094. -/**
  2095. - * \brief Compute the LP residual by filtering the input speech through the
  2096. - * analysis filter A(z).
  2097. - * \param[in] a LP filter coefficients, exponent = SF_A_COEFFS
  2098. - * \param[in] x input signal (note that values x[-m..-1] are needed), exponent =
  2099. - * SF_SYNTH
  2100. - * \param[out] y output signal (residual), exponent = SF_EXC
  2101. - * \param[in] l length of filtering
  2102. - */
  2103. -/* static */
  2104. -void E_UTIL_residu(const FIXP_LPC *a, const INT a_exp, FIXP_DBL *x, FIXP_DBL *y,
  2105. - INT l) {
  2106. - FIXP_DBL s;
  2107. - INT i, j;
  2108. -
  2109. - /* (note that values x[-m..-1] are needed) */
  2110. - for (i = 0; i < l; i++) {
  2111. - s = (FIXP_DBL)0;
  2112. -
  2113. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  2114. - s += fMultDiv2(a[j], x[i - j - 1]) >> (LP_FILTER_SCALE - 1);
  2115. - }
  2116. -
  2117. - s = scaleValue(s, a_exp + LP_FILTER_SCALE);
  2118. - y[i] = fAddSaturate(s, x[i]);
  2119. - }
  2120. -
  2121. - return;
  2122. -}
  2123. -
  2124. -/* use to map subfr number to number of bits used for acb_index */
  2125. -static const UCHAR num_acb_idx_bits_table[2][NB_SUBFR] = {
  2126. - {9, 6, 9, 6}, /* coreCoderFrameLength == 1024 */
  2127. - {9, 6, 6, 0} /* coreCoderFrameLength == 768 */
  2128. -};
  2129. -
  2130. -static int DecodePitchLag(HANDLE_FDK_BITSTREAM hBs,
  2131. - const UCHAR num_acb_idx_bits,
  2132. - const int PIT_MIN, /* TMIN */
  2133. - const int PIT_FR2, /* TFR2 */
  2134. - const int PIT_FR1, /* TFR1 */
  2135. - const int PIT_MAX, /* TMAX */
  2136. - int *pT0, int *pT0_frac, int *pT0_min, int *pT0_max) {
  2137. - int acb_idx;
  2138. - int error = 0;
  2139. - int T0, T0_frac;
  2140. -
  2141. - FDK_ASSERT((num_acb_idx_bits == 9) || (num_acb_idx_bits == 6));
  2142. -
  2143. - acb_idx = FDKreadBits(hBs, num_acb_idx_bits);
  2144. -
  2145. - if (num_acb_idx_bits == 6) {
  2146. - /* When the pitch value is encoded on 6 bits, a pitch resolution of 1/4 is
  2147. - always used in the range [T1-8, T1+7.75], where T1 is nearest integer to
  2148. - the fractional pitch lag of the previous subframe.
  2149. - */
  2150. - T0 = *pT0_min + acb_idx / 4;
  2151. - T0_frac = acb_idx & 0x3;
  2152. - } else { /* num_acb_idx_bits == 9 */
  2153. - /* When the pitch value is encoded on 9 bits, a fractional pitch delay is
  2154. - used with resolutions 0.25 in the range [TMIN, TFR2-0.25], resolutions
  2155. - 0.5 in the range [TFR2, TFR1-0.5], and integers only in the range [TFR1,
  2156. - TMAX]. NOTE: for small sampling rates TMAX can get smaller than TFR1.
  2157. - */
  2158. - int T0_min, T0_max;
  2159. -
  2160. - if (acb_idx < (PIT_FR2 - PIT_MIN) * 4) {
  2161. - /* first interval with 0.25 pitch resolution */
  2162. - T0 = PIT_MIN + (acb_idx / 4);
  2163. - T0_frac = acb_idx & 0x3;
  2164. - } else if (acb_idx < ((PIT_FR2 - PIT_MIN) * 4 + (PIT_FR1 - PIT_FR2) * 2)) {
  2165. - /* second interval with 0.5 pitch resolution */
  2166. - acb_idx -= (PIT_FR2 - PIT_MIN) * 4;
  2167. - T0 = PIT_FR2 + (acb_idx / 2);
  2168. - T0_frac = (acb_idx & 0x1) * 2;
  2169. - } else {
  2170. - /* third interval with 1.0 pitch resolution */
  2171. - T0 = acb_idx + PIT_FR1 - ((PIT_FR2 - PIT_MIN) * 4) -
  2172. - ((PIT_FR1 - PIT_FR2) * 2);
  2173. - T0_frac = 0;
  2174. - }
  2175. - /* find T0_min and T0_max for subframe 1 or 3 */
  2176. - T0_min = T0 - 8;
  2177. - if (T0_min < PIT_MIN) {
  2178. - T0_min = PIT_MIN;
  2179. - }
  2180. - T0_max = T0_min + 15;
  2181. - if (T0_max > PIT_MAX) {
  2182. - T0_max = PIT_MAX;
  2183. - T0_min = T0_max - 15;
  2184. - }
  2185. - *pT0_min = T0_min;
  2186. - *pT0_max = T0_max;
  2187. - }
  2188. - *pT0 = T0;
  2189. - *pT0_frac = T0_frac;
  2190. -
  2191. - return error;
  2192. -}
  2193. -static void ConcealPitchLag(CAcelpStaticMem *acelp_mem, const int PIT_MAX,
  2194. - int *pT0, int *pT0_frac) {
  2195. - USHORT *pold_T0 = &acelp_mem->old_T0;
  2196. - UCHAR *pold_T0_frac = &acelp_mem->old_T0_frac;
  2197. -
  2198. - if ((int)*pold_T0 >= PIT_MAX) {
  2199. - *pold_T0 = (UCHAR)(PIT_MAX - 5);
  2200. - }
  2201. - *pT0 = (int)*pold_T0;
  2202. - *pT0_frac = (int)*pold_T0_frac;
  2203. -}
  2204. -
  2205. -static UCHAR tab_coremode2nbits[8] = {20, 28, 36, 44, 52, 64, 12, 16};
  2206. -
  2207. -static int MapCoreMode2NBits(int core_mode) {
  2208. - return (int)tab_coremode2nbits[core_mode];
  2209. -}
  2210. -
  2211. -void CLpd_AcelpDecode(CAcelpStaticMem *acelp_mem, INT i_offset,
  2212. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  2213. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  2214. - FIXP_SGL stab_fac, CAcelpChannelData *pAcelpData,
  2215. - INT numLostSubframes, int lastLpcLost, int frameCnt,
  2216. - FIXP_DBL synth[], int pT[], FIXP_DBL *pit_gain,
  2217. - INT coreCoderFrameLength) {
  2218. - int i_subfr, subfr_nr, l_div, T;
  2219. - int T0 = -1, T0_frac = -1; /* mark invalid */
  2220. -
  2221. - int pit_gain_index = 0;
  2222. -
  2223. - const int PIT_MAX = PIT_MAX_12k8 + (6 * i_offset); /* maximum pitch lag */
  2224. -
  2225. - FIXP_COD *code;
  2226. - FIXP_DBL *exc2;
  2227. - FIXP_DBL *syn;
  2228. - FIXP_DBL *exc;
  2229. - FIXP_LPC A[M_LP_FILTER_ORDER];
  2230. - INT A_exp;
  2231. -
  2232. - FIXP_DBL period_fac;
  2233. - FIXP_SGL gain_pit;
  2234. - FIXP_DBL gain_code, gain_code_smooth, Ener_code;
  2235. - int Ener_code_e;
  2236. - int n;
  2237. - int bfi = (numLostSubframes > 0) ? 1 : 0;
  2238. -
  2239. - C_ALLOC_SCRATCH_START(
  2240. - exc_buf, FIXP_DBL,
  2241. - PIT_MAX_MAX + L_INTERPOL + L_DIV + 1); /* 411 + 17 + 256 + 1 = 685 */
  2242. - C_ALLOC_SCRATCH_START(syn_buf, FIXP_DBL,
  2243. - M_LP_FILTER_ORDER + L_DIV); /* 16 + 256 = 272 */
  2244. - /* use same memory for code[L_SUBFR] and exc2[L_SUBFR] */
  2245. - C_ALLOC_SCRATCH_START(tmp_buf, FIXP_DBL, L_SUBFR); /* 64 */
  2246. - /* make sure they don't overlap if they are accessed alternatingly in
  2247. - * BuildAdaptiveExcitation() */
  2248. -#if (COD_BITS == FRACT_BITS)
  2249. - code = (FIXP_COD *)(tmp_buf + L_SUBFR / 2);
  2250. -#elif (COD_BITS == DFRACT_BITS)
  2251. - code = (FIXP_COD *)tmp_buf;
  2252. -#endif
  2253. - exc2 = (FIXP_DBL *)tmp_buf;
  2254. -
  2255. - syn = syn_buf + M_LP_FILTER_ORDER;
  2256. - exc = exc_buf + PIT_MAX_MAX + L_INTERPOL;
  2257. -
  2258. - FDKmemcpy(syn_buf, acelp_mem->old_syn_mem,
  2259. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2260. - FDKmemcpy(exc_buf, acelp_mem->old_exc_mem,
  2261. - (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2262. -
  2263. - FDKmemclear(exc_buf + (PIT_MAX_MAX + L_INTERPOL),
  2264. - (L_DIV + 1) * sizeof(FIXP_DBL));
  2265. -
  2266. - l_div = coreCoderFrameLength / NB_DIV;
  2267. -
  2268. - for (i_subfr = 0, subfr_nr = 0; i_subfr < l_div;
  2269. - i_subfr += L_SUBFR, subfr_nr++) {
  2270. - /*-------------------------------------------------*
  2271. - * - Decode pitch lag (T0 and T0_frac) *
  2272. - *-------------------------------------------------*/
  2273. - if (bfi) {
  2274. - ConcealPitchLag(acelp_mem, PIT_MAX, &T0, &T0_frac);
  2275. - } else {
  2276. - T0 = (int)pAcelpData->T0[subfr_nr];
  2277. - T0_frac = (int)pAcelpData->T0_frac[subfr_nr];
  2278. - }
  2279. -
  2280. - /*-------------------------------------------------*
  2281. - * - Find the pitch gain, the interpolation filter *
  2282. - * and the adaptive codebook vector. *
  2283. - *-------------------------------------------------*/
  2284. - Pred_lt4(&exc[i_subfr], T0, T0_frac);
  2285. -
  2286. - if ((!bfi && pAcelpData->ltp_filtering_flag[subfr_nr] == 0) ||
  2287. - (bfi && numLostSubframes == 1 && stab_fac < FL2FXCONST_SGL(0.25f))) {
  2288. - /* find pitch excitation with lp filter: v'(n) => v(n) */
  2289. - Pred_lt4_postfilter(&exc[i_subfr]);
  2290. - }
  2291. -
  2292. - /*-------------------------------------------------------*
  2293. - * - Decode innovative codebook. *
  2294. - * - Add the fixed-gain pitch contribution to code[]. *
  2295. - *-------------------------------------------------------*/
  2296. - if (bfi) {
  2297. - for (n = 0; n < L_SUBFR; n++) {
  2298. - code[n] =
  2299. - FX_SGL2FX_COD((FIXP_SGL)E_UTIL_random(&acelp_mem->seed_ace)) >> 4;
  2300. - }
  2301. - } else {
  2302. - int nbits = MapCoreMode2NBits((int)pAcelpData->acelp_core_mode);
  2303. - D_ACELP_decode_4t64(pAcelpData->icb_index[subfr_nr], nbits, &code[0]);
  2304. - }
  2305. -
  2306. - T = T0;
  2307. - if (T0_frac > 2) {
  2308. - T += 1;
  2309. - }
  2310. -
  2311. - Preemph_code(code);
  2312. - Pit_shrp(code, T);
  2313. -
  2314. - /* Output pitch lag for bass post-filter */
  2315. - if (T > PIT_MAX) {
  2316. - pT[subfr_nr] = PIT_MAX;
  2317. - } else {
  2318. - pT[subfr_nr] = T;
  2319. - }
  2320. - D_gain2_plus(
  2321. - pAcelpData->gains[subfr_nr],
  2322. - code, /* (i) : Innovative code vector, exponent = SF_CODE */
  2323. - &gain_pit, /* (o) : Quantized pitch gain, exponent = SF_GAIN_P */
  2324. - &gain_code, /* (o) : Quantized codebook gain */
  2325. - pAcelpData
  2326. - ->mean_energy, /* (i) : mean_ener defined in open-loop (2 bits) */
  2327. - bfi, &acelp_mem->past_gpit, &acelp_mem->past_gcode,
  2328. - &Ener_code, /* (o) : Innovative code vector energy */
  2329. - &Ener_code_e); /* (o) : Innovative code vector energy exponent */
  2330. -
  2331. - pit_gain[pit_gain_index++] = FX_SGL2FX_DBL(gain_pit);
  2332. -
  2333. - /* calc periodicity factor r_v */
  2334. - period_fac =
  2335. - calc_period_factor(/* (o) : factor (-1=unvoiced to 1=voiced) */
  2336. - &exc[i_subfr], /* (i) : pitch excitation, exponent =
  2337. - SF_EXC */
  2338. - gain_pit, /* (i) : gain of pitch, exponent =
  2339. - SF_GAIN_P */
  2340. - gain_code, /* (i) : gain of code */
  2341. - Ener_code, /* (i) : Energy of code[] */
  2342. - Ener_code_e); /* (i) : Exponent of energy of code[]
  2343. - */
  2344. -
  2345. - if (lastLpcLost && frameCnt == 0) {
  2346. - if (gain_pit > FL2FXCONST_SGL(1.0f / (1 << SF_GAIN_P))) {
  2347. - gain_pit = FL2FXCONST_SGL(1.0f / (1 << SF_GAIN_P));
  2348. - }
  2349. - }
  2350. -
  2351. - gain_code_smooth =
  2352. - noise_enhancer(/* (o) : smoothed gain g_sc exponent = SF_GAIN_C */
  2353. - gain_code, /* (i) : Quantized codebook gain */
  2354. - period_fac, /* (i) : periodicity factor (-1=unvoiced to
  2355. - 1=voiced) */
  2356. - stab_fac, /* (i) : stability factor (0 <= ... < 1),
  2357. - exponent = 1 */
  2358. - &acelp_mem->gc_threshold);
  2359. -
  2360. - /* Compute adaptive codebook update u'(n), pitch enhancement c'(n) and
  2361. - * post-processed excitation u(n). */
  2362. - BuildAdaptiveExcitation(code, exc + i_subfr, gain_pit, gain_code,
  2363. - gain_code_smooth, period_fac, exc2);
  2364. -
  2365. - /* Interpolate filter coeffs for current subframe in lsp domain and convert
  2366. - * to LP domain */
  2367. - int_lpc_acelp(lsp_old, /* input : LSPs from past frame */
  2368. - lsp_new, /* input : LSPs from present frame */
  2369. - subfr_nr, /* input : ACELP subframe index */
  2370. - coreCoderFrameLength / L_DIV,
  2371. - A, /* output: LP coefficients of this subframe */
  2372. - &A_exp);
  2373. -
  2374. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2375. - A_exp, L_SUBFR, /* (i) : length */
  2376. - exc2, /* (i) : input signal */
  2377. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2378. - );
  2379. -
  2380. - } /* end of subframe loop */
  2381. -
  2382. - /* update pitch value for bfi procedure */
  2383. - acelp_mem->old_T0_frac = T0_frac;
  2384. - acelp_mem->old_T0 = T0;
  2385. -
  2386. - /* save old excitation and old synthesis memory for next ACELP frame */
  2387. - FDKmemcpy(acelp_mem->old_exc_mem, exc + l_div - (PIT_MAX_MAX + L_INTERPOL),
  2388. - sizeof(FIXP_DBL) * (PIT_MAX_MAX + L_INTERPOL));
  2389. - FDKmemcpy(acelp_mem->old_syn_mem, syn_buf + l_div,
  2390. - sizeof(FIXP_DBL) * M_LP_FILTER_ORDER);
  2391. -
  2392. - Deemph(syn, synth, l_div,
  2393. - &acelp_mem->de_emph_mem); /* ref soft: mem = synth[-1] */
  2394. -
  2395. - scaleValues(synth, l_div, -ACELP_OUTSCALE);
  2396. - acelp_mem->deemph_mem_wsyn = acelp_mem->de_emph_mem;
  2397. -
  2398. - C_ALLOC_SCRATCH_END(tmp_buf, FIXP_DBL, L_SUBFR);
  2399. - C_ALLOC_SCRATCH_END(syn_buf, FIXP_DBL, M_LP_FILTER_ORDER + L_DIV);
  2400. - C_ALLOC_SCRATCH_END(exc_buf, FIXP_DBL, PIT_MAX_MAX + L_INTERPOL + L_DIV + 1);
  2401. - return;
  2402. -}
  2403. -
  2404. -void CLpd_AcelpReset(CAcelpStaticMem *acelp) {
  2405. - acelp->gc_threshold = (FIXP_DBL)0;
  2406. -
  2407. - acelp->past_gpit = (FIXP_SGL)0;
  2408. - acelp->past_gcode = (FIXP_DBL)0;
  2409. - acelp->old_T0 = 64;
  2410. - acelp->old_T0_frac = 0;
  2411. - acelp->deemph_mem_wsyn = (FIXP_DBL)0;
  2412. - acelp->wsyn_rms = (FIXP_DBL)0;
  2413. - acelp->seed_ace = 0;
  2414. -}
  2415. -
  2416. -/* TCX time domain concealment */
  2417. -/* Compare to figure 13a on page 54 in 3GPP TS 26.290 */
  2418. -void CLpd_TcxTDConceal(CAcelpStaticMem *acelp_mem, SHORT *pitch,
  2419. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  2420. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  2421. - const FIXP_SGL stab_fac, INT nLostSf, FIXP_DBL synth[],
  2422. - INT coreCoderFrameLength, UCHAR last_tcx_noise_factor) {
  2423. - /* repeat past excitation with pitch from previous decoded TCX frame */
  2424. - C_ALLOC_SCRATCH_START(
  2425. - exc_buf, FIXP_DBL,
  2426. - PIT_MAX_MAX + L_INTERPOL + L_DIV); /* 411 + 17 + 256 + 1 = */
  2427. - C_ALLOC_SCRATCH_START(syn_buf, FIXP_DBL,
  2428. - M_LP_FILTER_ORDER + L_DIV); /* 256 + 16 = */
  2429. - /* += */
  2430. - FIXP_DBL ns_buf[L_DIV + 1];
  2431. - FIXP_DBL *syn = syn_buf + M_LP_FILTER_ORDER;
  2432. - FIXP_DBL *exc = exc_buf + PIT_MAX_MAX + L_INTERPOL;
  2433. - FIXP_DBL *ns = ns_buf + 1;
  2434. - FIXP_DBL tmp, fact_exc;
  2435. - INT T = fMin(*pitch, (SHORT)PIT_MAX_MAX);
  2436. - int i, i_subfr, subfr_nr;
  2437. - int lDiv = coreCoderFrameLength / NB_DIV;
  2438. -
  2439. - FDKmemcpy(syn_buf, acelp_mem->old_syn_mem,
  2440. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2441. - FDKmemcpy(exc_buf, acelp_mem->old_exc_mem,
  2442. - (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2443. -
  2444. - /* if we lost all packets (i.e. 1 packet of TCX-20 ms, 2 packets of
  2445. - the TCX-40 ms or 4 packets of the TCX-80ms), we lost the whole
  2446. - coded frame extrapolation strategy: repeat lost excitation and
  2447. - use extrapolated LSFs */
  2448. -
  2449. - /* AMR-WB+ like TCX TD concealment */
  2450. -
  2451. - /* number of lost frame cmpt */
  2452. - if (nLostSf < 2) {
  2453. - fact_exc = FL2FXCONST_DBL(0.8f);
  2454. - } else {
  2455. - fact_exc = FL2FXCONST_DBL(0.4f);
  2456. - }
  2457. -
  2458. - /* repeat past excitation */
  2459. - for (i = 0; i < lDiv; i++) {
  2460. - exc[i] = fMult(fact_exc, exc[i - T]);
  2461. - }
  2462. -
  2463. - tmp = fMult(fact_exc, acelp_mem->wsyn_rms);
  2464. - acelp_mem->wsyn_rms = tmp;
  2465. -
  2466. - /* init deemph_mem_wsyn */
  2467. - acelp_mem->deemph_mem_wsyn = exc[-1];
  2468. -
  2469. - ns[-1] = acelp_mem->deemph_mem_wsyn;
  2470. -
  2471. - for (i_subfr = 0, subfr_nr = 0; i_subfr < lDiv;
  2472. - i_subfr += L_SUBFR, subfr_nr++) {
  2473. - FIXP_DBL tRes[L_SUBFR];
  2474. - FIXP_LPC A[M_LP_FILTER_ORDER];
  2475. - INT A_exp;
  2476. -
  2477. - /* interpolate LPC coefficients */
  2478. - int_lpc_acelp(lsp_old, lsp_new, subfr_nr, lDiv / L_SUBFR, A, &A_exp);
  2479. -
  2480. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2481. - A_exp, L_SUBFR, /* (i) : length */
  2482. - &exc[i_subfr], /* (i) : input signal */
  2483. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2484. - );
  2485. -
  2486. - E_LPC_a_weight(
  2487. - A, A,
  2488. - M_LP_FILTER_ORDER); /* overwrite A as it is not needed any longer */
  2489. -
  2490. - E_UTIL_residu(A, A_exp, &syn[i_subfr], tRes, L_SUBFR);
  2491. -
  2492. - Deemph(tRes, &ns[i_subfr], L_SUBFR, &acelp_mem->deemph_mem_wsyn);
  2493. -
  2494. - /* Amplitude limiter (saturate at wsyn_rms) */
  2495. - for (i = i_subfr; i < i_subfr + L_SUBFR; i++) {
  2496. - if (ns[i] > tmp) {
  2497. - ns[i] = tmp;
  2498. - } else {
  2499. - if (ns[i] < -tmp) {
  2500. - ns[i] = -tmp;
  2501. - }
  2502. - }
  2503. - }
  2504. -
  2505. - E_UTIL_preemph(&ns[i_subfr], tRes, L_SUBFR);
  2506. -
  2507. - Syn_filt(A, /* (i) : a[m] prediction coefficients */
  2508. - A_exp, L_SUBFR, /* (i) : length */
  2509. - tRes, /* (i) : input signal */
  2510. - &syn[i_subfr] /* (i/o) : filter states / output signal */
  2511. - );
  2512. -
  2513. - FDKmemmove(&synth[i_subfr], &syn[i_subfr], L_SUBFR * sizeof(FIXP_DBL));
  2514. - }
  2515. -
  2516. - /* save old excitation and old synthesis memory for next ACELP frame */
  2517. - FDKmemcpy(acelp_mem->old_exc_mem, exc + lDiv - (PIT_MAX_MAX + L_INTERPOL),
  2518. - sizeof(FIXP_DBL) * (PIT_MAX_MAX + L_INTERPOL));
  2519. - FDKmemcpy(acelp_mem->old_syn_mem, syn_buf + lDiv,
  2520. - sizeof(FIXP_DBL) * M_LP_FILTER_ORDER);
  2521. - acelp_mem->de_emph_mem = acelp_mem->deemph_mem_wsyn;
  2522. -
  2523. - C_ALLOC_SCRATCH_END(syn_buf, FIXP_DBL, M_LP_FILTER_ORDER + L_DIV);
  2524. - C_ALLOC_SCRATCH_END(exc_buf, FIXP_DBL, PIT_MAX_MAX + L_INTERPOL + L_DIV);
  2525. -}
  2526. -
  2527. -void Acelp_PreProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2528. - INT *old_T_pf, FIXP_DBL *pit_gain,
  2529. - FIXP_DBL *old_gain_pf, INT samplingRate, INT *i_offset,
  2530. - INT coreCoderFrameLength, INT synSfd,
  2531. - INT nbSubfrSuperfr) {
  2532. - int n;
  2533. -
  2534. - /* init beginning of synth_buf with old synthesis from previous frame */
  2535. - FDKmemcpy(synth_buf, old_synth, sizeof(FIXP_DBL) * (PIT_MAX_MAX - BPF_DELAY));
  2536. -
  2537. - /* calculate pitch lag offset for ACELP decoder */
  2538. - *i_offset =
  2539. - (samplingRate * PIT_MIN_12k8 + (FSCALE_DENOM / 2)) / FSCALE_DENOM -
  2540. - PIT_MIN_12k8;
  2541. -
  2542. - /* for bass postfilter */
  2543. - for (n = 0; n < synSfd; n++) {
  2544. - pitch[n] = old_T_pf[n];
  2545. - pit_gain[n] = old_gain_pf[n];
  2546. - }
  2547. - for (n = 0; n < nbSubfrSuperfr; n++) {
  2548. - pitch[n + synSfd] = L_SUBFR;
  2549. - pit_gain[n + synSfd] = (FIXP_DBL)0;
  2550. - }
  2551. -}
  2552. -
  2553. -void Acelp_PostProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2554. - INT *old_T_pf, INT coreCoderFrameLength, INT synSfd,
  2555. - INT nbSubfrSuperfr) {
  2556. - int n;
  2557. -
  2558. - /* store last part of synth_buf (which is not handled by the IMDCT overlap)
  2559. - * for next frame */
  2560. - FDKmemcpy(old_synth, synth_buf + coreCoderFrameLength,
  2561. - sizeof(FIXP_DBL) * (PIT_MAX_MAX - BPF_DELAY));
  2562. -
  2563. - /* for bass postfilter */
  2564. - for (n = 0; n < synSfd; n++) {
  2565. - old_T_pf[n] = pitch[nbSubfrSuperfr + n];
  2566. - }
  2567. -}
  2568. -
  2569. -#define L_FAC_ZIR (LFAC)
  2570. -
  2571. -void CLpd_Acelp_Zir(const FIXP_LPC A[], const INT A_exp,
  2572. - CAcelpStaticMem *acelp_mem, const INT length,
  2573. - FIXP_DBL zir[], int doDeemph) {
  2574. - C_ALLOC_SCRATCH_START(tmp_buf, FIXP_DBL, L_FAC_ZIR + M_LP_FILTER_ORDER);
  2575. - FDK_ASSERT(length <= L_FAC_ZIR);
  2576. -
  2577. - FDKmemcpy(tmp_buf, acelp_mem->old_syn_mem,
  2578. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2579. - FDKmemset(tmp_buf + M_LP_FILTER_ORDER, 0, L_FAC_ZIR * sizeof(FIXP_DBL));
  2580. -
  2581. - Syn_filt(A, A_exp, length, &tmp_buf[M_LP_FILTER_ORDER],
  2582. - &tmp_buf[M_LP_FILTER_ORDER]);
  2583. - if (!doDeemph) {
  2584. - /* if last lpd mode was TD concealment, then bypass deemph */
  2585. - FDKmemcpy(zir, tmp_buf, length * sizeof(*zir));
  2586. - } else {
  2587. - Deemph(&tmp_buf[M_LP_FILTER_ORDER], &zir[0], length,
  2588. - &acelp_mem->de_emph_mem);
  2589. - scaleValues(zir, length, -ACELP_OUTSCALE);
  2590. - }
  2591. - C_ALLOC_SCRATCH_END(tmp_buf, FIXP_DBL, L_FAC_ZIR + M_LP_FILTER_ORDER);
  2592. -}
  2593. -
  2594. -void CLpd_AcelpPrepareInternalMem(const FIXP_DBL *synth, UCHAR last_lpd_mode,
  2595. - UCHAR last_last_lpd_mode,
  2596. - const FIXP_LPC *A_new, const INT A_new_exp,
  2597. - const FIXP_LPC *A_old, const INT A_old_exp,
  2598. - CAcelpStaticMem *acelp_mem,
  2599. - INT coreCoderFrameLength, INT clearOldExc,
  2600. - UCHAR lpd_mode) {
  2601. - int l_div =
  2602. - coreCoderFrameLength / NB_DIV; /* length of one ACELP/TCX20 frame */
  2603. - int l_div_partial;
  2604. - FIXP_DBL *syn, *old_exc_mem;
  2605. -
  2606. - C_ALLOC_SCRATCH_START(synth_buf, FIXP_DBL,
  2607. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2608. - syn = &synth_buf[M_LP_FILTER_ORDER];
  2609. -
  2610. - l_div_partial = PIT_MAX_MAX + L_INTERPOL - l_div;
  2611. - old_exc_mem = acelp_mem->old_exc_mem;
  2612. -
  2613. - if (lpd_mode == 4) {
  2614. - /* Bypass Domain conversion. TCXTD Concealment does no deemphasis in the
  2615. - * end. */
  2616. - FDKmemcpy(
  2617. - synth_buf, &synth[-(PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER)],
  2618. - (PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER) * sizeof(FIXP_DBL));
  2619. - /* Set deemphasis memory state for TD concealment */
  2620. - acelp_mem->deemph_mem_wsyn = scaleValueSaturate(synth[-1], ACELP_OUTSCALE);
  2621. - } else {
  2622. - /* convert past [PIT_MAX_MAX+L_INTERPOL+M_LP_FILTER_ORDER] synthesis to
  2623. - * preemph domain */
  2624. - E_UTIL_preemph(&synth[-(PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER)],
  2625. - synth_buf, PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2626. - scaleValuesSaturate(synth_buf, PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER,
  2627. - ACELP_OUTSCALE);
  2628. - }
  2629. -
  2630. - /* Set deemphasis memory state */
  2631. - acelp_mem->de_emph_mem = scaleValueSaturate(synth[-1], ACELP_OUTSCALE);
  2632. -
  2633. - /* update acelp synth filter memory */
  2634. - FDKmemcpy(acelp_mem->old_syn_mem,
  2635. - &syn[PIT_MAX_MAX + L_INTERPOL - M_LP_FILTER_ORDER],
  2636. - M_LP_FILTER_ORDER * sizeof(FIXP_DBL));
  2637. -
  2638. - if (clearOldExc) {
  2639. - FDKmemclear(old_exc_mem, (PIT_MAX_MAX + L_INTERPOL) * sizeof(FIXP_DBL));
  2640. - C_ALLOC_SCRATCH_END(synth_buf, FIXP_DBL,
  2641. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2642. - return;
  2643. - }
  2644. -
  2645. - /* update past [PIT_MAX_MAX+L_INTERPOL] samples of exc memory */
  2646. - if (last_lpd_mode == 1) { /* last frame was TCX20 */
  2647. - if (last_last_lpd_mode == 0) { /* ACELP -> TCX20 -> ACELP transition */
  2648. - /* Delay valid part of excitation buffer (from previous ACELP frame) by
  2649. - * l_div samples */
  2650. - FDKmemmove(old_exc_mem, old_exc_mem + l_div,
  2651. - sizeof(FIXP_DBL) * l_div_partial);
  2652. - } else if (last_last_lpd_mode > 0) { /* TCX -> TCX20 -> ACELP transition */
  2653. - E_UTIL_residu(A_old, A_old_exp, syn, old_exc_mem, l_div_partial);
  2654. - }
  2655. - E_UTIL_residu(A_new, A_new_exp, syn + l_div_partial,
  2656. - old_exc_mem + l_div_partial, l_div);
  2657. - } else { /* prev frame was FD, TCX40 or TCX80 */
  2658. - int exc_A_new_length = (coreCoderFrameLength / 2 > PIT_MAX_MAX + L_INTERPOL)
  2659. - ? PIT_MAX_MAX + L_INTERPOL
  2660. - : coreCoderFrameLength / 2;
  2661. - int exc_A_old_length = PIT_MAX_MAX + L_INTERPOL - exc_A_new_length;
  2662. - E_UTIL_residu(A_old, A_old_exp, syn, old_exc_mem, exc_A_old_length);
  2663. - E_UTIL_residu(A_new, A_new_exp, &syn[exc_A_old_length],
  2664. - &old_exc_mem[exc_A_old_length], exc_A_new_length);
  2665. - }
  2666. - C_ALLOC_SCRATCH_END(synth_buf, FIXP_DBL,
  2667. - PIT_MAX_MAX + L_INTERPOL + M_LP_FILTER_ORDER);
  2668. -
  2669. - return;
  2670. -}
  2671. -
  2672. -FIXP_DBL *CLpd_ACELP_GetFreeExcMem(CAcelpStaticMem *acelp_mem, INT length) {
  2673. - FDK_ASSERT(length <= PIT_MAX_MAX + L_INTERPOL);
  2674. - return acelp_mem->old_exc_mem;
  2675. -}
  2676. -
  2677. -INT CLpd_AcelpRead(HANDLE_FDK_BITSTREAM hBs, CAcelpChannelData *acelp,
  2678. - INT acelp_core_mode, INT coreCoderFrameLength,
  2679. - INT i_offset) {
  2680. - int nb_subfr = coreCoderFrameLength / L_DIV;
  2681. - const UCHAR *num_acb_index_bits =
  2682. - (nb_subfr == 4) ? num_acb_idx_bits_table[0] : num_acb_idx_bits_table[1];
  2683. - int nbits;
  2684. - int error = 0;
  2685. -
  2686. - const int PIT_MIN = PIT_MIN_12k8 + i_offset;
  2687. - const int PIT_FR2 = PIT_FR2_12k8 - i_offset;
  2688. - const int PIT_FR1 = PIT_FR1_12k8;
  2689. - const int PIT_MAX = PIT_MAX_12k8 + (6 * i_offset);
  2690. - int T0, T0_frac, T0_min = 0, T0_max;
  2691. -
  2692. - if (PIT_MAX > PIT_MAX_MAX) {
  2693. - error = AAC_DEC_DECODE_FRAME_ERROR;
  2694. - goto bail;
  2695. - }
  2696. -
  2697. - acelp->acelp_core_mode = acelp_core_mode;
  2698. -
  2699. - nbits = MapCoreMode2NBits(acelp_core_mode);
  2700. -
  2701. - /* decode mean energy with 2 bits : 18, 30, 42 or 54 dB */
  2702. - acelp->mean_energy = FDKreadBits(hBs, 2);
  2703. -
  2704. - for (int sfr = 0; sfr < nb_subfr; sfr++) {
  2705. - /* read ACB index and store T0 and T0_frac for each ACELP subframe. */
  2706. - error = DecodePitchLag(hBs, num_acb_index_bits[sfr], PIT_MIN, PIT_FR2,
  2707. - PIT_FR1, PIT_MAX, &T0, &T0_frac, &T0_min, &T0_max);
  2708. - if (error) {
  2709. - goto bail;
  2710. - }
  2711. - acelp->T0[sfr] = (USHORT)T0;
  2712. - acelp->T0_frac[sfr] = (UCHAR)T0_frac;
  2713. - acelp->ltp_filtering_flag[sfr] = FDKreadBits(hBs, 1);
  2714. - switch (nbits) {
  2715. - case 12: /* 12 bits AMR-WB codebook is used */
  2716. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 1);
  2717. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2718. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 1);
  2719. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2720. - break;
  2721. - case 16: /* 16 bits AMR-WB codebook is used */
  2722. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 1);
  2723. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2724. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2725. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2726. - break;
  2727. - case 20: /* 20 bits AMR-WB codebook is used */
  2728. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 5);
  2729. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 5);
  2730. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2731. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2732. - break;
  2733. - case 28: /* 28 bits AMR-WB codebook is used */
  2734. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 9);
  2735. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 9);
  2736. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 5);
  2737. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 5);
  2738. - break;
  2739. - case 36: /* 36 bits AMR-WB codebook is used */
  2740. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 9);
  2741. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 9);
  2742. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 9);
  2743. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 9);
  2744. - break;
  2745. - case 44: /* 44 bits AMR-WB codebook is used */
  2746. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 13);
  2747. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 13);
  2748. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 9);
  2749. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 9);
  2750. - break;
  2751. - case 52: /* 52 bits AMR-WB codebook is used */
  2752. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 13);
  2753. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 13);
  2754. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 13);
  2755. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 13);
  2756. - break;
  2757. - case 64: /* 64 bits AMR-WB codebook is used */
  2758. - acelp->icb_index[sfr][0] = FDKreadBits(hBs, 2);
  2759. - acelp->icb_index[sfr][1] = FDKreadBits(hBs, 2);
  2760. - acelp->icb_index[sfr][2] = FDKreadBits(hBs, 2);
  2761. - acelp->icb_index[sfr][3] = FDKreadBits(hBs, 2);
  2762. - acelp->icb_index[sfr][4] = FDKreadBits(hBs, 14);
  2763. - acelp->icb_index[sfr][5] = FDKreadBits(hBs, 14);
  2764. - acelp->icb_index[sfr][6] = FDKreadBits(hBs, 14);
  2765. - acelp->icb_index[sfr][7] = FDKreadBits(hBs, 14);
  2766. - break;
  2767. - default:
  2768. - FDK_ASSERT(0);
  2769. - break;
  2770. - }
  2771. - acelp->gains[sfr] = FDKreadBits(hBs, 7);
  2772. - }
  2773. -
  2774. -bail:
  2775. - return error;
  2776. -}
  2777. --- a/libAACdec/src/usacdec_acelp.h
  2778. +++ /dev/null
  2779. @@ -1,281 +0,0 @@
  2780. -/* -----------------------------------------------------------------------------
  2781. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  2782. -
  2783. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  2784. -Forschung e.V. All rights reserved.
  2785. -
  2786. - 1. INTRODUCTION
  2787. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  2788. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  2789. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  2790. -a wide variety of Android devices.
  2791. -
  2792. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  2793. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  2794. -full-bandwidth communications codec by independent studies and is widely
  2795. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  2796. -specifications.
  2797. -
  2798. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  2799. -those of Fraunhofer) may be obtained through Via Licensing
  2800. -(www.vialicensing.com) or through the respective patent owners individually for
  2801. -the purpose of encoding or decoding bit streams in products that are compliant
  2802. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  2803. -Android devices already license these patent claims through Via Licensing or
  2804. -directly from the patent owners, and therefore FDK AAC Codec software may
  2805. -already be covered under those patent licenses when it is used for those
  2806. -licensed purposes only.
  2807. -
  2808. -Commercially-licensed AAC software libraries, including floating-point versions
  2809. -with enhanced sound quality, are also available from Fraunhofer. Users are
  2810. -encouraged to check the Fraunhofer website for additional applications
  2811. -information and documentation.
  2812. -
  2813. -2. COPYRIGHT LICENSE
  2814. -
  2815. -Redistribution and use in source and binary forms, with or without modification,
  2816. -are permitted without payment of copyright license fees provided that you
  2817. -satisfy the following conditions:
  2818. -
  2819. -You must retain the complete text of this software license in redistributions of
  2820. -the FDK AAC Codec or your modifications thereto in source code form.
  2821. -
  2822. -You must retain the complete text of this software license in the documentation
  2823. -and/or other materials provided with redistributions of the FDK AAC Codec or
  2824. -your modifications thereto in binary form. You must make available free of
  2825. -charge copies of the complete source code of the FDK AAC Codec and your
  2826. -modifications thereto to recipients of copies in binary form.
  2827. -
  2828. -The name of Fraunhofer may not be used to endorse or promote products derived
  2829. -from this library without prior written permission.
  2830. -
  2831. -You may not charge copyright license fees for anyone to use, copy or distribute
  2832. -the FDK AAC Codec software or your modifications thereto.
  2833. -
  2834. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  2835. -that you changed the software and the date of any change. For modified versions
  2836. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  2837. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  2838. -AAC Codec Library for Android."
  2839. -
  2840. -3. NO PATENT LICENSE
  2841. -
  2842. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  2843. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  2844. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  2845. -software.
  2846. -
  2847. -You may use this FDK AAC Codec software or modifications thereto only for
  2848. -purposes that are authorized by appropriate patent licenses.
  2849. -
  2850. -4. DISCLAIMER
  2851. -
  2852. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  2853. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  2854. -including but not limited to the implied warranties of merchantability and
  2855. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  2856. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  2857. -or consequential damages, including but not limited to procurement of substitute
  2858. -goods or services; loss of use, data, or profits, or business interruption,
  2859. -however caused and on any theory of liability, whether in contract, strict
  2860. -liability, or tort (including negligence), arising in any way out of the use of
  2861. -this software, even if advised of the possibility of such damage.
  2862. -
  2863. -5. CONTACT INFORMATION
  2864. -
  2865. -Fraunhofer Institute for Integrated Circuits IIS
  2866. -Attention: Audio and Multimedia Departments - FDK AAC LL
  2867. -Am Wolfsmantel 33
  2868. -91058 Erlangen, Germany
  2869. -
  2870. -www.iis.fraunhofer.de/amm
  2871. -amm-info@iis.fraunhofer.de
  2872. ------------------------------------------------------------------------------ */
  2873. -
  2874. -/**************************** AAC decoder library ******************************
  2875. -
  2876. - Author(s): Matthias Hildenbrand
  2877. -
  2878. - Description: USAC ACELP frame decoder
  2879. -
  2880. -*******************************************************************************/
  2881. -
  2882. -#ifndef USACDEC_ACELP_H
  2883. -#define USACDEC_ACELP_H
  2884. -
  2885. -#include "common_fix.h"
  2886. -#include "FDK_bitstream.h"
  2887. -#include "usacdec_const.h"
  2888. -#include "usacdec_rom.h"
  2889. -
  2890. -//#define ENHANCED_TCX_TD_CONCEAL_ENABLE
  2891. -
  2892. -/** Structure which holds the ACELP internal persistent memory */
  2893. -typedef struct {
  2894. - FIXP_DBL old_exc_mem[PIT_MAX_MAX + L_INTERPOL];
  2895. - FIXP_DBL old_syn_mem[M_LP_FILTER_ORDER]; /* synthesis filter states */
  2896. - FIXP_SGL A[M_LP_FILTER_ORDER];
  2897. - INT A_exp;
  2898. - FIXP_DBL gc_threshold;
  2899. - FIXP_DBL de_emph_mem;
  2900. - FIXP_SGL past_gpit;
  2901. - FIXP_DBL past_gcode;
  2902. - USHORT old_T0;
  2903. - UCHAR old_T0_frac;
  2904. - FIXP_DBL deemph_mem_wsyn;
  2905. - FIXP_DBL wsyn_rms;
  2906. - SHORT seed_ace;
  2907. -} CAcelpStaticMem;
  2908. -
  2909. -/** Structure which holds the parameter data needed to decode one ACELP frame.
  2910. - */
  2911. -typedef struct {
  2912. - UCHAR
  2913. - acelp_core_mode; /**< mean excitation energy index for whole ACELP frame
  2914. - */
  2915. - UCHAR mean_energy; /**< acelp core mode for whole ACELP frame */
  2916. - USHORT T0[NB_SUBFR];
  2917. - UCHAR T0_frac[NB_SUBFR];
  2918. - UCHAR ltp_filtering_flag[NB_SUBFR]; /**< controlls whether LTP postfilter is
  2919. - active for each ACELP subframe */
  2920. - SHORT icb_index[NB_SUBFR]
  2921. - [8]; /**< innovative codebook index for each ACELP subframe */
  2922. - UCHAR gains[NB_SUBFR]; /**< gain index for each ACELP subframe */
  2923. -} CAcelpChannelData;
  2924. -
  2925. -/**
  2926. - * \brief Read the acelp_coding() bitstream part.
  2927. - * \param[in] hBs bitstream handle to read data from.
  2928. - * \param[out] acelpData pointer to structure to store the parsed data of one
  2929. - * ACELP frame.
  2930. - * \param[in] acelp_core_mode the ACELP core mode index.
  2931. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  2932. - */
  2933. -INT CLpd_AcelpRead(HANDLE_FDK_BITSTREAM hBs, CAcelpChannelData *acelpData,
  2934. - INT acelp_core_mode, INT i_offset, INT coreCoderFrameLength);
  2935. -/**
  2936. - * \brief Initialization of memory before one LPD frame is decoded
  2937. - * \param[out] synth_buf synthesis buffer to be initialized, exponent = SF_SYNTH
  2938. - * \param[in] old_synth past synthesis of previous LPD frame, exponent =
  2939. - * SF_SYNTH
  2940. - * \param[out] synth_buf_fb fullband synthesis buffer to be initialized,
  2941. - * exponent = SF_SYNTH
  2942. - * \param[in] old_synth_fb past fullband synthesis of previous LPD frame,
  2943. - * exponent = SF_SYNTH
  2944. - * \param[out] pitch vector where decoded pitch lag values are stored
  2945. - * \param[in] old_T_pf past pitch lag values of previous LPD frame
  2946. - * \param[in] samplingRate sampling rate for pitch lag offset calculation
  2947. - * \param[out] i_offset pitch lag offset for the decoding of the pitch lag
  2948. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  2949. - */
  2950. -void Acelp_PreProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2951. - INT *old_T_pf, FIXP_DBL *pit_gain,
  2952. - FIXP_DBL *old_gain_pf, INT samplingRate, INT *i_offset,
  2953. - INT coreCoderFrameLength, INT synSfd,
  2954. - INT nbSubfrSuperfr);
  2955. -
  2956. -/**
  2957. - * \brief Save tail of buffers for the initialization of the next LPD frame
  2958. - * \param[in] synth_buf synthesis of current LPD frame, exponent = SF_SYNTH
  2959. - * \param[out] old_synth memory where tail of fullband synth_buf is stored,
  2960. - * exponent = SF_SYNTH
  2961. - * \param[in] synth_buf_fb fullband synthesis of current LPD frame, exponent =
  2962. - * SF_SYNTH
  2963. - * \param[out] old_synth_fb memory where tail of fullband synth_buf is stored,
  2964. - * exponent = SF_SYNTH
  2965. - * \param[in] pitch decoded pitch lag values of current LPD frame
  2966. - * \param[out] old_T_pf memory where last SYN_SFD pitch lag values are stored
  2967. - */
  2968. -void Acelp_PostProcessing(FIXP_DBL *synth_buf, FIXP_DBL *old_synth, INT *pitch,
  2969. - INT *old_T_pf, INT coreCoderFrameLength, INT synSfd,
  2970. - INT nbSubfrSuperfr);
  2971. -
  2972. -/**
  2973. - * \brief Decode one ACELP frame (three or four ACELP subframes with 64 samples
  2974. - * each)
  2975. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  2976. - * \param[in] i_offset pitch lag offset
  2977. - * \param[in] lsp_old LPC filter in LSP domain corresponding to previous frame
  2978. - * \param[in] lsp_new LPC filter in LSP domain corresponding to current frame
  2979. - * \param[in] stab_fac stability factor constrained by 0<=stab_fac<=1.0,
  2980. - * exponent = SF_STAB
  2981. - * \param[in] acelpData pointer to struct with data which is needed for decoding
  2982. - * one ACELP frame
  2983. - * \param[out] synth ACELP output signal
  2984. - * \param[out] pT four decoded pitch lag values
  2985. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  2986. - */
  2987. -void CLpd_AcelpDecode(CAcelpStaticMem *acelp_mem, INT i_offset,
  2988. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  2989. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  2990. - FIXP_SGL stab_fac, CAcelpChannelData *acelpData,
  2991. - INT numLostSubframes, int lastLpcLost, int frameCnt,
  2992. - FIXP_DBL synth[], int pT[], FIXP_DBL *pit_gain,
  2993. - INT coreCoderFrameLength);
  2994. -
  2995. -/**
  2996. - * \brief Reset ACELP internal memory.
  2997. - * \param[out] acelp_mem pointer to ACELP memory structure
  2998. - */
  2999. -void CLpd_AcelpReset(CAcelpStaticMem *acelp_mem);
  3000. -
  3001. -/**
  3002. - * \brief Initialize ACELP internal memory in case of FAC before ACELP decoder
  3003. - * is called
  3004. - * \param[in] synth points to end+1 of past valid synthesis signal, exponent =
  3005. - * SF_SYNTH
  3006. - * \param[in] last_lpd_mode last lpd mode
  3007. - * \param[in] last_last_lpd_mode lpd mode before last_lpd_mode
  3008. - * \param[in] A_new LP synthesis filter coeffs corresponding to last frame,
  3009. - * exponent = SF_A_COEFFS
  3010. - * \param[in] A_old LP synthesis filter coeffs corresponding to the frame before
  3011. - * last frame, exponent = SF_A_COEFFS
  3012. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  3013. - * \param[in] coreCoderFrameLength length of core coder frame (1024|768)
  3014. - */
  3015. -void CLpd_AcelpPrepareInternalMem(const FIXP_DBL *synth, UCHAR last_lpd_mode,
  3016. - UCHAR last_last_lpd_mode,
  3017. - const FIXP_LPC *A_new, const INT A_new_exp,
  3018. - const FIXP_LPC *A_old, const INT A_old_exp,
  3019. - CAcelpStaticMem *acelp_mem,
  3020. - INT coreCoderFrameLength, INT clearOldExc,
  3021. - UCHAR lpd_mode);
  3022. -
  3023. -/**
  3024. - * \brief Calculate zero input response (zir) of the acelp synthesis filter
  3025. - * \param[in] A LP synthesis filter coefficients, exponent = SF_A_COEFFS
  3026. - * \param[in,out] acelp_mem pointer to ACELP memory structure
  3027. - * \param[in] length length of zir
  3028. - * \param[out] zir pointer to zir output buffer, exponent = SF_SYNTH
  3029. - */
  3030. -void CLpd_Acelp_Zir(const FIXP_LPC A[], const INT A_exp,
  3031. - CAcelpStaticMem *acelp_mem, const INT length,
  3032. - FIXP_DBL zir[], int doDeemph);
  3033. -
  3034. -/**
  3035. - * \brief Borrow static excitation memory from ACELP decoder
  3036. - * \param[in] acelp_mem pointer to ACELP memory structure
  3037. - * \param[in] length number of requested FIXP_DBL values
  3038. - * \return pointer to requested memory
  3039. - *
  3040. - * The caller has to take care not to overwrite valid memory areas.
  3041. - * During TCX/FAC calculations and before CLpd_AcelpPrepareInternalMem() is
  3042. - * called, the following memory size is available:
  3043. - * - 256 samples in case of ACELP -> TCX20 -> ACELP transition
  3044. - * - PIT_MAX_MAX+L_INTERPOL samples in all other cases
  3045. - */
  3046. -FIXP_DBL *CLpd_ACELP_GetFreeExcMem(CAcelpStaticMem *acelp_mem, INT length);
  3047. -
  3048. -void CLpd_TcxTDConceal(CAcelpStaticMem *acelp_mem, SHORT *pitch,
  3049. - const FIXP_LPC lsp_old[M_LP_FILTER_ORDER],
  3050. - const FIXP_LPC lsp_new[M_LP_FILTER_ORDER],
  3051. - const FIXP_SGL stab_fac, INT numLostSubframes,
  3052. - FIXP_DBL synth[], INT coreCoderFrameLength,
  3053. - UCHAR last_tcx_noise_factor);
  3054. -
  3055. -inline SHORT E_UTIL_random(SHORT *seed) {
  3056. - *seed = (SHORT)((((LONG)*seed * (LONG)31821) >> 1) + (LONG)13849);
  3057. - return (*seed);
  3058. -}
  3059. -
  3060. -#endif /* USACDEC_ACELP_H */
  3061. --- a/libAACdec/src/usacdec_const.h
  3062. +++ /dev/null
  3063. @@ -1,203 +0,0 @@
  3064. -/* -----------------------------------------------------------------------------
  3065. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  3066. -
  3067. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  3068. -Forschung e.V. All rights reserved.
  3069. -
  3070. - 1. INTRODUCTION
  3071. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  3072. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  3073. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  3074. -a wide variety of Android devices.
  3075. -
  3076. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  3077. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  3078. -full-bandwidth communications codec by independent studies and is widely
  3079. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  3080. -specifications.
  3081. -
  3082. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  3083. -those of Fraunhofer) may be obtained through Via Licensing
  3084. -(www.vialicensing.com) or through the respective patent owners individually for
  3085. -the purpose of encoding or decoding bit streams in products that are compliant
  3086. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  3087. -Android devices already license these patent claims through Via Licensing or
  3088. -directly from the patent owners, and therefore FDK AAC Codec software may
  3089. -already be covered under those patent licenses when it is used for those
  3090. -licensed purposes only.
  3091. -
  3092. -Commercially-licensed AAC software libraries, including floating-point versions
  3093. -with enhanced sound quality, are also available from Fraunhofer. Users are
  3094. -encouraged to check the Fraunhofer website for additional applications
  3095. -information and documentation.
  3096. -
  3097. -2. COPYRIGHT LICENSE
  3098. -
  3099. -Redistribution and use in source and binary forms, with or without modification,
  3100. -are permitted without payment of copyright license fees provided that you
  3101. -satisfy the following conditions:
  3102. -
  3103. -You must retain the complete text of this software license in redistributions of
  3104. -the FDK AAC Codec or your modifications thereto in source code form.
  3105. -
  3106. -You must retain the complete text of this software license in the documentation
  3107. -and/or other materials provided with redistributions of the FDK AAC Codec or
  3108. -your modifications thereto in binary form. You must make available free of
  3109. -charge copies of the complete source code of the FDK AAC Codec and your
  3110. -modifications thereto to recipients of copies in binary form.
  3111. -
  3112. -The name of Fraunhofer may not be used to endorse or promote products derived
  3113. -from this library without prior written permission.
  3114. -
  3115. -You may not charge copyright license fees for anyone to use, copy or distribute
  3116. -the FDK AAC Codec software or your modifications thereto.
  3117. -
  3118. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  3119. -that you changed the software and the date of any change. For modified versions
  3120. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  3121. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  3122. -AAC Codec Library for Android."
  3123. -
  3124. -3. NO PATENT LICENSE
  3125. -
  3126. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  3127. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  3128. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  3129. -software.
  3130. -
  3131. -You may use this FDK AAC Codec software or modifications thereto only for
  3132. -purposes that are authorized by appropriate patent licenses.
  3133. -
  3134. -4. DISCLAIMER
  3135. -
  3136. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  3137. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  3138. -including but not limited to the implied warranties of merchantability and
  3139. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  3140. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  3141. -or consequential damages, including but not limited to procurement of substitute
  3142. -goods or services; loss of use, data, or profits, or business interruption,
  3143. -however caused and on any theory of liability, whether in contract, strict
  3144. -liability, or tort (including negligence), arising in any way out of the use of
  3145. -this software, even if advised of the possibility of such damage.
  3146. -
  3147. -5. CONTACT INFORMATION
  3148. -
  3149. -Fraunhofer Institute for Integrated Circuits IIS
  3150. -Attention: Audio and Multimedia Departments - FDK AAC LL
  3151. -Am Wolfsmantel 33
  3152. -91058 Erlangen, Germany
  3153. -
  3154. -www.iis.fraunhofer.de/amm
  3155. -amm-info@iis.fraunhofer.de
  3156. ------------------------------------------------------------------------------ */
  3157. -
  3158. -/**************************** AAC decoder library ******************************
  3159. -
  3160. - Author(s): Manuel Jander
  3161. -
  3162. - Description: USAC related constants
  3163. -
  3164. -*******************************************************************************/
  3165. -
  3166. -#ifndef USACDEC_CONST_H
  3167. -#define USACDEC_CONST_H
  3168. -
  3169. -/* scale factors */
  3170. -#define SF_CODE 6 /* exponent of code[], fixed codebook vector */
  3171. -#define SF_GAIN_C 16 /* exponent of gain code and smoothed gain code */
  3172. -#define SF_EXC 16 /* exponent of exc[] and exc2[], excitation buffer */
  3173. -#define SF_GAIN_P 1 /* exponent of gain_pit */
  3174. -#define SF_PFAC 0 /* exponent of period/voicing factor */
  3175. -#define SF_SYNTH SF_EXC /* exponent of synthesis buffer */
  3176. -#define SF_A_COEFFS 3 /* exponent of LP domain synthesis filter coefficient */
  3177. -#define SF_STAB 1 /* exponent of stability factor */
  3178. -
  3179. -/* definitions which are independent of coreCoderFrameLength */
  3180. -#define M_LP_FILTER_ORDER 16 /* LP filter order */
  3181. -#define LP_FILTER_SCALE 4 /* LP filter scale */
  3182. -
  3183. -#define PIT_MIN_12k8 34 /* Minimum pitch lag with resolution 1/4 */
  3184. -#define PIT_MAX_12k8 231 /* Maximum pitch lag for fs=12.8kHz */
  3185. -#define FSCALE_DENOM 12800 /* Frequency scale denominator */
  3186. -#define FAC_FSCALE_MIN \
  3187. - 6000 /* Minimum allowed frequency scale for acelp decoder */
  3188. -
  3189. -#if !defined(LPD_MAX_CORE_SR)
  3190. -#define LPD_MAX_CORE_SR 24000 /* Default value from ref soft */
  3191. -#endif
  3192. -#define FAC_FSCALE_MAX \
  3193. - LPD_MAX_CORE_SR /* Maximum allowed frequency scale for acelp decoder */
  3194. -
  3195. -/* Maximum pitch lag (= 411 for fs_max = 24000) */
  3196. -#define PIT_MAX_TMP \
  3197. - (PIT_MAX_12k8 + \
  3198. - (6 * \
  3199. - ((((FAC_FSCALE_MAX * PIT_MIN_12k8) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - \
  3200. - PIT_MIN_12k8)))
  3201. -#if (PIT_MAX_TMP < \
  3202. - 256) /* cannot be smaller because of tcx time domain concealment */
  3203. -#define PIT_MAX_MAX 256
  3204. -#else
  3205. -#define PIT_MAX_MAX PIT_MAX_TMP
  3206. -#endif
  3207. -
  3208. -#define NB_DIV 4 /* number of division (20ms) per 80ms frame */
  3209. -#define L_SUBFR 64 /* subframe size (5ms) */
  3210. -#define BPF_SFD 1 /* bass postfilter delay (subframe) */
  3211. -#define BPF_DELAY (BPF_SFD * L_SUBFR) /* bass postfilter delay (samples) */
  3212. -
  3213. -#define L_FILT 12 /* Delay of up-sampling filter (bass post-filter) */
  3214. -#define L_EXTRA 96 /* for bass post-filter */
  3215. -#define L_INTERPOL \
  3216. - (16 + 1) /* Length of filter for interpolation (acelp decoder) */
  3217. -
  3218. -/* definitions for coreCoderFrameLength = 1024 */
  3219. -#define L_FRAME_PLUS_1024 1024 /* length of one 80ms superframe */
  3220. -#define L_DIV_1024 \
  3221. - (L_FRAME_PLUS_1024 / NB_DIV) /* length of one acelp or tcx20 frame */
  3222. -#define NB_SUBFR_1024 \
  3223. - (L_DIV_1024 / L_SUBFR) /* number of 5ms subframe per division */
  3224. -#define NB_SUBFR_SUPERFR_1024 \
  3225. - (L_FRAME_PLUS_1024 / L_SUBFR) /* number of 5ms subframe per 80ms frame */
  3226. -#define AAC_SFD_1024 (NB_SUBFR_SUPERFR_1024 / 2) /* AAC delay (subframe) */
  3227. -#define AAC_DELAY_1024 (AAC_SFD_1024 * L_SUBFR) /* AAC delay (samples) */
  3228. -#define SYN_SFD_1024 (AAC_SFD_1024 - BPF_SFD) /* synthesis delay (subframe) */
  3229. -#define SYN_DELAY_1024 \
  3230. - (SYN_SFD_1024 * L_SUBFR) /* synthesis delay (samples) \
  3231. - */
  3232. -#define LFAC_1024 (L_DIV_1024 / 2) /* FAC frame length */
  3233. -#define LFAC_SHORT_1024 \
  3234. - (L_DIV_1024 / 4) /* for transitions EIGHT_SHORT FD->LPD and vv. */
  3235. -#define FDNS_NPTS_1024 64 /* FD noise shaping resolution (64=100Hz/point) */
  3236. -
  3237. -/* definitions for coreCoderFrameLength = 768 */
  3238. -#define L_FRAME_PLUS_768 768
  3239. -#define L_DIV_768 \
  3240. - (L_FRAME_PLUS_768 / NB_DIV) /* length of one acelp or tcx20 frame */
  3241. -#define NB_SUBFR_768 \
  3242. - (L_DIV_768 / L_SUBFR) /* number of 5ms subframe per division */
  3243. -#define NB_SUBFR_SUPERFR_768 \
  3244. - (L_FRAME_PLUS_768 / L_SUBFR) /* number of 5ms subframe per 80ms frame */
  3245. -#define AAC_SFD_768 (NB_SUBFR_SUPERFR_768 / 2) /* AAC delay (subframe) */
  3246. -#define AAC_DELAY_768 (AAC_SFD_768 * L_SUBFR) /* AAC delay (samples) */
  3247. -#define SYN_SFD_768 (AAC_SFD_768 - BPF_SFD) /* synthesis delay (subframe) */
  3248. -#define SYN_DELAY_768 (SYN_SFD_768 * L_SUBFR) /* synthesis delay (samples) */
  3249. -#define LFAC_768 (L_DIV_768 / 2) /* FAC frame length */
  3250. -#define LFAC_SHORT_768 \
  3251. - (L_DIV_768 / 4) /* for transitions EIGHT_SHORT FD->LPD and vv. */
  3252. -
  3253. -/* maximum (used for memory allocation) */
  3254. -#define L_FRAME_PLUS L_FRAME_PLUS_1024
  3255. -#define L_DIV L_DIV_1024
  3256. -#define NB_SUBFR NB_SUBFR_1024
  3257. -#define NB_SUBFR_SUPERFR NB_SUBFR_SUPERFR_1024
  3258. -#define AAC_SFD AAC_SFD_1024
  3259. -#define AAC_DELAY AAC_DELAY_1024
  3260. -#define SYN_SFD SYN_SFD_1024
  3261. -#define SYN_DELAY SYN_DELAY_1024
  3262. -#define LFAC LFAC_1024
  3263. -#define LFAC_SHORT LFAC_SHORT_1024
  3264. -#define FDNS_NPTS FDNS_NPTS_1024
  3265. -
  3266. -#endif /* USACDEC_CONST_H */
  3267. --- a/libAACdec/src/usacdec_fac.cpp
  3268. +++ /dev/null
  3269. @@ -1,745 +0,0 @@
  3270. -/* -----------------------------------------------------------------------------
  3271. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  3272. -
  3273. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  3274. -Forschung e.V. All rights reserved.
  3275. -
  3276. - 1. INTRODUCTION
  3277. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  3278. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  3279. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  3280. -a wide variety of Android devices.
  3281. -
  3282. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  3283. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  3284. -full-bandwidth communications codec by independent studies and is widely
  3285. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  3286. -specifications.
  3287. -
  3288. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  3289. -those of Fraunhofer) may be obtained through Via Licensing
  3290. -(www.vialicensing.com) or through the respective patent owners individually for
  3291. -the purpose of encoding or decoding bit streams in products that are compliant
  3292. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  3293. -Android devices already license these patent claims through Via Licensing or
  3294. -directly from the patent owners, and therefore FDK AAC Codec software may
  3295. -already be covered under those patent licenses when it is used for those
  3296. -licensed purposes only.
  3297. -
  3298. -Commercially-licensed AAC software libraries, including floating-point versions
  3299. -with enhanced sound quality, are also available from Fraunhofer. Users are
  3300. -encouraged to check the Fraunhofer website for additional applications
  3301. -information and documentation.
  3302. -
  3303. -2. COPYRIGHT LICENSE
  3304. -
  3305. -Redistribution and use in source and binary forms, with or without modification,
  3306. -are permitted without payment of copyright license fees provided that you
  3307. -satisfy the following conditions:
  3308. -
  3309. -You must retain the complete text of this software license in redistributions of
  3310. -the FDK AAC Codec or your modifications thereto in source code form.
  3311. -
  3312. -You must retain the complete text of this software license in the documentation
  3313. -and/or other materials provided with redistributions of the FDK AAC Codec or
  3314. -your modifications thereto in binary form. You must make available free of
  3315. -charge copies of the complete source code of the FDK AAC Codec and your
  3316. -modifications thereto to recipients of copies in binary form.
  3317. -
  3318. -The name of Fraunhofer may not be used to endorse or promote products derived
  3319. -from this library without prior written permission.
  3320. -
  3321. -You may not charge copyright license fees for anyone to use, copy or distribute
  3322. -the FDK AAC Codec software or your modifications thereto.
  3323. -
  3324. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  3325. -that you changed the software and the date of any change. For modified versions
  3326. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  3327. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  3328. -AAC Codec Library for Android."
  3329. -
  3330. -3. NO PATENT LICENSE
  3331. -
  3332. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  3333. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  3334. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  3335. -software.
  3336. -
  3337. -You may use this FDK AAC Codec software or modifications thereto only for
  3338. -purposes that are authorized by appropriate patent licenses.
  3339. -
  3340. -4. DISCLAIMER
  3341. -
  3342. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  3343. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  3344. -including but not limited to the implied warranties of merchantability and
  3345. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  3346. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  3347. -or consequential damages, including but not limited to procurement of substitute
  3348. -goods or services; loss of use, data, or profits, or business interruption,
  3349. -however caused and on any theory of liability, whether in contract, strict
  3350. -liability, or tort (including negligence), arising in any way out of the use of
  3351. -this software, even if advised of the possibility of such damage.
  3352. -
  3353. -5. CONTACT INFORMATION
  3354. -
  3355. -Fraunhofer Institute for Integrated Circuits IIS
  3356. -Attention: Audio and Multimedia Departments - FDK AAC LL
  3357. -Am Wolfsmantel 33
  3358. -91058 Erlangen, Germany
  3359. -
  3360. -www.iis.fraunhofer.de/amm
  3361. -amm-info@iis.fraunhofer.de
  3362. ------------------------------------------------------------------------------ */
  3363. -
  3364. -/**************************** AAC decoder library ******************************
  3365. -
  3366. - Author(s): Manuel Jander
  3367. -
  3368. - Description: USAC FAC
  3369. -
  3370. -*******************************************************************************/
  3371. -
  3372. -#include "usacdec_fac.h"
  3373. -
  3374. -#include "usacdec_const.h"
  3375. -#include "usacdec_lpc.h"
  3376. -#include "usacdec_acelp.h"
  3377. -#include "usacdec_rom.h"
  3378. -#include "dct.h"
  3379. -#include "FDK_tools_rom.h"
  3380. -#include "mdct.h"
  3381. -
  3382. -#define SPEC_FAC(ptr, i, gl) ((ptr) + ((i) * (gl)))
  3383. -
  3384. -FIXP_DBL *CLpd_FAC_GetMemory(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  3385. - UCHAR mod[NB_DIV], int *pState) {
  3386. - FIXP_DBL *ptr;
  3387. - int i;
  3388. - int k = 0;
  3389. - int max_windows = 8;
  3390. -
  3391. - FDK_ASSERT(*pState >= 0 && *pState < max_windows);
  3392. -
  3393. - /* Look for free space to store FAC data. 2 FAC data blocks fit into each TCX
  3394. - * spectral data block. */
  3395. - for (i = *pState; i < max_windows; i++) {
  3396. - if (mod[i >> 1] == 0) {
  3397. - break;
  3398. - }
  3399. - }
  3400. -
  3401. - *pState = i + 1;
  3402. -
  3403. - if (i == max_windows) {
  3404. - ptr = pAacDecoderChannelInfo->data.usac.fac_data0;
  3405. - } else {
  3406. - FDK_ASSERT(mod[(i >> 1)] == 0);
  3407. - ptr = SPEC_FAC(pAacDecoderChannelInfo->pSpectralCoefficient, i,
  3408. - pAacDecoderChannelInfo->granuleLength << k);
  3409. - }
  3410. -
  3411. - return ptr;
  3412. -}
  3413. -
  3414. -int CLpd_FAC_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pFac, SCHAR *pFacScale,
  3415. - int length, int use_gain, int frame) {
  3416. - FIXP_DBL fac_gain;
  3417. - int fac_gain_e = 0;
  3418. -
  3419. - if (use_gain) {
  3420. - CLpd_DecodeGain(&fac_gain, &fac_gain_e, FDKreadBits(hBs, 7));
  3421. - }
  3422. -
  3423. - if (CLpc_DecodeAVQ(hBs, pFac, 1, 1, length) != 0) {
  3424. - return -1;
  3425. - }
  3426. -
  3427. - {
  3428. - int scale;
  3429. -
  3430. - scale = getScalefactor(pFac, length);
  3431. - scaleValues(pFac, length, scale);
  3432. - pFacScale[frame] = DFRACT_BITS - 1 - scale;
  3433. - }
  3434. -
  3435. - if (use_gain) {
  3436. - int i;
  3437. -
  3438. - pFacScale[frame] += fac_gain_e;
  3439. -
  3440. - for (i = 0; i < length; i++) {
  3441. - pFac[i] = fMult(pFac[i], fac_gain);
  3442. - }
  3443. - }
  3444. - return 0;
  3445. -}
  3446. -
  3447. -/**
  3448. - * \brief Apply synthesis filter with zero input to x. The overall filter gain
  3449. - * is 1.0.
  3450. - * \param a LPC filter coefficients.
  3451. - * \param length length of the input/output data vector x.
  3452. - * \param x input/output vector, where the synthesis filter is applied in place.
  3453. - */
  3454. -static void Syn_filt_zero(const FIXP_LPC a[], const INT a_exp, INT length,
  3455. - FIXP_DBL x[]) {
  3456. - int i, j;
  3457. - FIXP_DBL L_tmp;
  3458. -
  3459. - for (i = 0; i < length; i++) {
  3460. - L_tmp = (FIXP_DBL)0;
  3461. -
  3462. - for (j = 0; j < fMin(i, M_LP_FILTER_ORDER); j++) {
  3463. - L_tmp -= fMultDiv2(a[j], x[i - (j + 1)]) >> (LP_FILTER_SCALE - 1);
  3464. - }
  3465. -
  3466. - L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE);
  3467. - x[i] = fAddSaturate(x[i], L_tmp);
  3468. - }
  3469. -}
  3470. -
  3471. -/* Table is also correct for coreCoderFrameLength = 768. Factor 3/4 is canceled
  3472. - out: gainFac = 0.5 * sqrt(fac_length/lFrame)
  3473. -*/
  3474. -static const FIXP_DBL gainFac[4] = {0x40000000, 0x2d413ccd, 0x20000000,
  3475. - 0x16a09e66};
  3476. -
  3477. -void CFac_ApplyGains(FIXP_DBL fac_data[LFAC], const INT fac_length,
  3478. - const FIXP_DBL tcx_gain, const FIXP_DBL alfd_gains[],
  3479. - const INT mod) {
  3480. - FIXP_DBL facFactor;
  3481. - int i;
  3482. -
  3483. - FDK_ASSERT((fac_length == 128) || (fac_length == 96));
  3484. -
  3485. - /* 2) Apply gain factor to FAC data */
  3486. - facFactor = fMult(gainFac[mod], tcx_gain);
  3487. - for (i = 0; i < fac_length; i++) {
  3488. - fac_data[i] = fMult(fac_data[i], facFactor);
  3489. - }
  3490. -
  3491. - /* 3) Apply spectrum deshaping using alfd_gains */
  3492. - for (i = 0; i < fac_length / 4; i++) {
  3493. - int k;
  3494. -
  3495. - k = i >> (3 - mod);
  3496. - fac_data[i] = fMult(fac_data[i], alfd_gains[k])
  3497. - << 1; /* alfd_gains is scaled by one bit. */
  3498. - }
  3499. -}
  3500. -
  3501. -static void CFac_CalcFacSignal(FIXP_DBL *pOut, FIXP_DBL *pFac,
  3502. - const int fac_scale, const int fac_length,
  3503. - const FIXP_LPC A[M_LP_FILTER_ORDER],
  3504. - const INT A_exp, const int fAddZir,
  3505. - const int isFdFac) {
  3506. - FIXP_LPC wA[M_LP_FILTER_ORDER];
  3507. - FIXP_DBL tf_gain = (FIXP_DBL)0;
  3508. - int wlength;
  3509. - int scale = fac_scale;
  3510. -
  3511. - /* obtain tranform gain. */
  3512. - imdct_gain(&tf_gain, &scale, isFdFac ? 0 : fac_length);
  3513. -
  3514. - /* 4) Compute inverse DCT-IV of FAC data. Output scale of DCT IV is 16 bits.
  3515. - */
  3516. - dct_IV(pFac, fac_length, &scale);
  3517. - /* dct_IV scale = log2(fac_length). "- 7" is a factor of 2/128 */
  3518. - if (tf_gain != (FIXP_DBL)0) { /* non-radix 2 transform gain */
  3519. - int i;
  3520. -
  3521. - for (i = 0; i < fac_length; i++) {
  3522. - pFac[i] = fMult(tf_gain, pFac[i]);
  3523. - }
  3524. - }
  3525. - scaleValuesSaturate(pOut, pFac, fac_length,
  3526. - scale); /* Avoid overflow issues and saturate. */
  3527. -
  3528. - E_LPC_a_weight(wA, A, M_LP_FILTER_ORDER);
  3529. -
  3530. - /* We need the output of the IIR filter to be longer than "fac_length".
  3531. - For this reason we run it with zero input appended to the end of the input
  3532. - sequence, i.e. we generate its ZIR and extend the output signal.*/
  3533. - FDKmemclear(pOut + fac_length, fac_length * sizeof(FIXP_DBL));
  3534. - wlength = 2 * fac_length;
  3535. -
  3536. - /* 5) Apply weighted synthesis filter to FAC data, including optional Zir (5.
  3537. - * item 4). */
  3538. - Syn_filt_zero(wA, A_exp, wlength, pOut);
  3539. -}
  3540. -
  3541. -INT CLpd_FAC_Mdct2Acelp(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pFac,
  3542. - const int fac_scale, FIXP_LPC *A, INT A_exp,
  3543. - INT nrOutSamples, const INT fac_length,
  3544. - const INT isFdFac, UCHAR prevWindowShape) {
  3545. - FIXP_DBL *pOvl;
  3546. - FIXP_DBL *pOut0;
  3547. - const FIXP_WTP *pWindow;
  3548. - int i, fl, nrSamples = 0;
  3549. -
  3550. - FDK_ASSERT(fac_length <= 1024 / (4 * 2));
  3551. -
  3552. - fl = fac_length * 2;
  3553. -
  3554. - pWindow = FDKgetWindowSlope(fl, prevWindowShape);
  3555. -
  3556. - /* Adapt window slope length in case of frame loss. */
  3557. - if (hMdct->prev_fr != fl) {
  3558. - int nl = 0;
  3559. - imdct_adapt_parameters(hMdct, &fl, &nl, fac_length, pWindow, nrOutSamples);
  3560. - FDK_ASSERT(nl == 0);
  3561. - }
  3562. -
  3563. - if (nrSamples < nrOutSamples) {
  3564. - pOut0 = output;
  3565. - nrSamples += hMdct->ov_offset;
  3566. - /* Purge buffered output. */
  3567. - FDKmemcpy(pOut0, hMdct->overlap.time, hMdct->ov_offset * sizeof(pOut0[0]));
  3568. - hMdct->ov_offset = 0;
  3569. - }
  3570. -
  3571. - pOvl = hMdct->overlap.freq + hMdct->ov_size - 1;
  3572. -
  3573. - if (nrSamples >= nrOutSamples) {
  3574. - pOut0 = hMdct->overlap.time + hMdct->ov_offset;
  3575. - hMdct->ov_offset += hMdct->prev_nr + fl / 2;
  3576. - } else {
  3577. - pOut0 = output + nrSamples;
  3578. - nrSamples += hMdct->prev_nr + fl / 2;
  3579. - }
  3580. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3581. - for (i = 0; i < hMdct->prev_nr; i++) {
  3582. - FIXP_DBL x = -(*pOvl--);
  3583. - *pOut0 = IMDCT_SCALE_DBL(x);
  3584. - pOut0++;
  3585. - }
  3586. - } else {
  3587. - for (i = 0; i < hMdct->prev_nr; i++) {
  3588. - FIXP_DBL x = (*pOvl--);
  3589. - *pOut0 = IMDCT_SCALE_DBL(x);
  3590. - pOut0++;
  3591. - }
  3592. - }
  3593. - hMdct->prev_nr = 0;
  3594. -
  3595. - {
  3596. - if (pFac != NULL) {
  3597. - /* Note: The FAC gain might have been applied directly after bit stream
  3598. - * parse in this case. */
  3599. - CFac_CalcFacSignal(pOut0, pFac, fac_scale, fac_length, A, A_exp, 0,
  3600. - isFdFac);
  3601. - } else {
  3602. - /* Clear buffer because of the overlap and ADD! */
  3603. - FDKmemclear(pOut0, fac_length * sizeof(FIXP_DBL));
  3604. - }
  3605. - }
  3606. -
  3607. - i = 0;
  3608. -
  3609. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3610. - for (; i < fl / 2; i++) {
  3611. - FIXP_DBL x0;
  3612. -
  3613. - /* Overlap Add */
  3614. - x0 = -fMult(*pOvl--, pWindow[i].v.re);
  3615. -
  3616. - *pOut0 += IMDCT_SCALE_DBL(x0);
  3617. - pOut0++;
  3618. - }
  3619. - } else {
  3620. - for (; i < fl / 2; i++) {
  3621. - FIXP_DBL x0;
  3622. -
  3623. - /* Overlap Add */
  3624. - x0 = fMult(*pOvl--, pWindow[i].v.re);
  3625. -
  3626. - *pOut0 += IMDCT_SCALE_DBL(x0);
  3627. - pOut0++;
  3628. - }
  3629. - }
  3630. - if (hMdct->pFacZir !=
  3631. - 0) { /* this should only happen for ACELP -> TCX20 -> ACELP transition */
  3632. - FIXP_DBL *pOut = pOut0 - fl / 2; /* fl/2 == fac_length */
  3633. - for (i = 0; i < fl / 2; i++) {
  3634. - pOut[i] += IMDCT_SCALE_DBL(hMdct->pFacZir[i]);
  3635. - }
  3636. - hMdct->pFacZir = NULL;
  3637. - }
  3638. -
  3639. - hMdct->prev_fr = 0;
  3640. - hMdct->prev_nr = 0;
  3641. - hMdct->prev_tl = 0;
  3642. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  3643. -
  3644. - return nrSamples;
  3645. -}
  3646. -
  3647. -INT CLpd_FAC_Acelp2Mdct(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *_pSpec,
  3648. - const SHORT spec_scale[], const int nSpec,
  3649. - FIXP_DBL *pFac, const int fac_scale,
  3650. - const INT fac_length, INT noOutSamples, const INT tl,
  3651. - const FIXP_WTP *wrs, const INT fr, FIXP_LPC A[16],
  3652. - INT A_exp, CAcelpStaticMem *acelp_mem,
  3653. - const FIXP_DBL gain, const int last_frame_lost,
  3654. - const int isFdFac, const UCHAR last_lpd_mode,
  3655. - const int k, int currAliasingSymmetry) {
  3656. - FIXP_DBL *pCurr, *pOvl, *pSpec;
  3657. - const FIXP_WTP *pWindow;
  3658. - const FIXP_WTB *FacWindowZir_conceal;
  3659. - UCHAR doFacZirConceal = 0;
  3660. - int doDeemph = 1;
  3661. - const FIXP_WTB *FacWindowZir, *FacWindowSynth;
  3662. - FIXP_DBL *pOut0 = output, *pOut1;
  3663. - int w, i, fl, nl, nr, f_len, nrSamples = 0, s = 0, scale, total_gain_e;
  3664. - FIXP_DBL *pF, *pFAC_and_FAC_ZIR = NULL;
  3665. - FIXP_DBL total_gain = gain;
  3666. -
  3667. - FDK_ASSERT(fac_length <= 1024 / (4 * 2));
  3668. - switch (fac_length) {
  3669. - /* coreCoderFrameLength = 1024 */
  3670. - case 128:
  3671. - pWindow = SineWindow256;
  3672. - FacWindowZir = FacWindowZir128;
  3673. - FacWindowSynth = FacWindowSynth128;
  3674. - break;
  3675. - case 64:
  3676. - pWindow = SineWindow128;
  3677. - FacWindowZir = FacWindowZir64;
  3678. - FacWindowSynth = FacWindowSynth64;
  3679. - break;
  3680. - case 32:
  3681. - pWindow = SineWindow64;
  3682. - FacWindowZir = FacWindowZir32;
  3683. - FacWindowSynth = FacWindowSynth32;
  3684. - break;
  3685. - /* coreCoderFrameLength = 768 */
  3686. - case 96:
  3687. - pWindow = SineWindow192;
  3688. - FacWindowZir = FacWindowZir96;
  3689. - FacWindowSynth = FacWindowSynth96;
  3690. - break;
  3691. - case 48:
  3692. - pWindow = SineWindow96;
  3693. - FacWindowZir = FacWindowZir48;
  3694. - FacWindowSynth = FacWindowSynth48;
  3695. - break;
  3696. - default:
  3697. - FDK_ASSERT(0);
  3698. - return 0;
  3699. - }
  3700. -
  3701. - FacWindowZir_conceal = FacWindowSynth;
  3702. - /* Derive NR and NL */
  3703. - fl = fac_length * 2;
  3704. - nl = (tl - fl) >> 1;
  3705. - nr = (tl - fr) >> 1;
  3706. -
  3707. - if (noOutSamples > nrSamples) {
  3708. - /* Purge buffered output. */
  3709. - FDKmemcpy(pOut0, hMdct->overlap.time, hMdct->ov_offset * sizeof(pOut0[0]));
  3710. - nrSamples = hMdct->ov_offset;
  3711. - hMdct->ov_offset = 0;
  3712. - }
  3713. -
  3714. - if (nrSamples >= noOutSamples) {
  3715. - pOut1 = hMdct->overlap.time + hMdct->ov_offset;
  3716. - if (hMdct->ov_offset < fac_length) {
  3717. - pOut0 = output + nrSamples;
  3718. - } else {
  3719. - pOut0 = pOut1;
  3720. - }
  3721. - hMdct->ov_offset += fac_length + nl;
  3722. - } else {
  3723. - pOut1 = output + nrSamples;
  3724. - pOut0 = output + nrSamples;
  3725. - }
  3726. -
  3727. - {
  3728. - pFAC_and_FAC_ZIR = CLpd_ACELP_GetFreeExcMem(acelp_mem, 2 * fac_length);
  3729. - {
  3730. - const FIXP_DBL *pTmp1, *pTmp2;
  3731. -
  3732. - doFacZirConceal |= ((last_frame_lost != 0) && (k == 0));
  3733. - doDeemph &= (last_lpd_mode != 4);
  3734. - if (doFacZirConceal) {
  3735. - /* ACELP contribution in concealment case:
  3736. - Use ZIR with a modified ZIR window to preserve some more energy.
  3737. - Dont use FAC, which contains wrong information for concealed frame
  3738. - Dont use last ACELP samples, but double ZIR, instead (afterwards) */
  3739. - FDKmemclear(pFAC_and_FAC_ZIR, 2 * fac_length * sizeof(FIXP_DBL));
  3740. - FacWindowSynth = (FIXP_WTB *)pFAC_and_FAC_ZIR;
  3741. - FacWindowZir = FacWindowZir_conceal;
  3742. - } else {
  3743. - CFac_CalcFacSignal(pFAC_and_FAC_ZIR, pFac, fac_scale + s, fac_length, A,
  3744. - A_exp, 1, isFdFac);
  3745. - }
  3746. - /* 6) Get windowed past ACELP samples and ACELP ZIR signal */
  3747. -
  3748. - /*
  3749. - * Get ACELP ZIR (pFac[]) and ACELP past samples (pOut0[]) and add them
  3750. - * to the FAC synth signal contribution on pOut1[].
  3751. - */
  3752. - {
  3753. - {
  3754. - CLpd_Acelp_Zir(A, A_exp, acelp_mem, fac_length, pFac, doDeemph);
  3755. -
  3756. - pTmp1 = pOut0;
  3757. - pTmp2 = pFac;
  3758. - }
  3759. -
  3760. - for (i = 0, w = 0; i < fac_length; i++) {
  3761. - FIXP_DBL x;
  3762. - /* Div2 is compensated by table scaling */
  3763. - x = fMultDiv2(pTmp2[i], FacWindowZir[w]);
  3764. - x += fMultDiv2(pTmp1[-i - 1], FacWindowSynth[w]);
  3765. - x += pFAC_and_FAC_ZIR[i];
  3766. - pOut1[i] = x;
  3767. -
  3768. - w++;
  3769. - }
  3770. - }
  3771. -
  3772. - if (doFacZirConceal) {
  3773. - /* ZIR is the only ACELP contribution, so double it */
  3774. - scaleValues(pOut1, fac_length, 1);
  3775. - }
  3776. - }
  3777. - }
  3778. -
  3779. - if (nrSamples < noOutSamples) {
  3780. - nrSamples += fac_length + nl;
  3781. - }
  3782. -
  3783. - /* Obtain transform gain */
  3784. - total_gain = gain;
  3785. - total_gain_e = 0;
  3786. - imdct_gain(&total_gain, &total_gain_e, tl);
  3787. -
  3788. - /* IMDCT overlap add */
  3789. - scale = total_gain_e;
  3790. - pSpec = _pSpec;
  3791. -
  3792. - /* Note:when comming from an LPD frame (TCX/ACELP) the previous alisaing
  3793. - * symmetry must always be 0 */
  3794. - if (currAliasingSymmetry == 0) {
  3795. - dct_IV(pSpec, tl, &scale);
  3796. - } else {
  3797. - FIXP_DBL _tmp[1024 + ALIGNMENT_DEFAULT / sizeof(FIXP_DBL)];
  3798. - FIXP_DBL *tmp = (FIXP_DBL *)ALIGN_PTR(_tmp);
  3799. - C_ALLOC_ALIGNED_REGISTER(tmp, sizeof(_tmp));
  3800. - dst_III(pSpec, tmp, tl, &scale);
  3801. - C_ALLOC_ALIGNED_UNREGISTER(tmp);
  3802. - }
  3803. -
  3804. - /* Optional scaling of time domain - no yet windowed - of current spectrum */
  3805. - if (total_gain != (FIXP_DBL)0) {
  3806. - for (i = 0; i < tl; i++) {
  3807. - pSpec[i] = fMult(pSpec[i], total_gain);
  3808. - }
  3809. - }
  3810. - int loc_scale = fixmin_I(spec_scale[0] + scale, (INT)DFRACT_BITS - 1);
  3811. - scaleValuesSaturate(pSpec, tl, loc_scale);
  3812. -
  3813. - pOut1 += fl / 2 - 1;
  3814. - pCurr = pSpec + tl - fl / 2;
  3815. -
  3816. - for (i = 0; i < fl / 2; i++) {
  3817. - FIXP_DBL x1;
  3818. -
  3819. - /* FAC signal is already on pOut1, because of that the += operator. */
  3820. - x1 = fMult(*pCurr++, pWindow[i].v.re);
  3821. - FDK_ASSERT((pOut1 >= hMdct->overlap.time &&
  3822. - pOut1 < hMdct->overlap.time + hMdct->ov_size) ||
  3823. - (pOut1 >= output && pOut1 < output + 1024));
  3824. - *pOut1 += IMDCT_SCALE_DBL(-x1);
  3825. - pOut1--;
  3826. - }
  3827. -
  3828. - /* NL output samples TL/2+FL/2..TL. - current[FL/2..0] */
  3829. - pOut1 += (fl / 2) + 1;
  3830. -
  3831. - pFAC_and_FAC_ZIR += fac_length; /* set pointer to beginning of FAC ZIR */
  3832. -
  3833. - if (nl == 0) {
  3834. - /* save pointer to write FAC ZIR data later */
  3835. - hMdct->pFacZir = pFAC_and_FAC_ZIR;
  3836. - } else {
  3837. - FDK_ASSERT(nl >= fac_length);
  3838. - /* FAC ZIR will be added now ... */
  3839. - hMdct->pFacZir = NULL;
  3840. - }
  3841. -
  3842. - pF = pFAC_and_FAC_ZIR;
  3843. - f_len = fac_length;
  3844. -
  3845. - pCurr = pSpec + tl - fl / 2 - 1;
  3846. - for (i = 0; i < nl; i++) {
  3847. - FIXP_DBL x = -(*pCurr--);
  3848. - /* 5) (item 4) Synthesis filter Zir component, FAC ZIR (another one). */
  3849. - if (i < f_len) {
  3850. - x += *pF++;
  3851. - }
  3852. -
  3853. - FDK_ASSERT((pOut1 >= hMdct->overlap.time &&
  3854. - pOut1 < hMdct->overlap.time + hMdct->ov_size) ||
  3855. - (pOut1 >= output && pOut1 < output + 1024));
  3856. - *pOut1 = IMDCT_SCALE_DBL(x);
  3857. - pOut1++;
  3858. - }
  3859. -
  3860. - hMdct->prev_nr = nr;
  3861. - hMdct->prev_fr = fr;
  3862. - hMdct->prev_wrs = wrs;
  3863. - hMdct->prev_tl = tl;
  3864. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  3865. - hMdct->prevAliasSymmetry = currAliasingSymmetry;
  3866. - fl = fr;
  3867. - nl = nr;
  3868. -
  3869. - pOvl = pSpec + tl / 2 - 1;
  3870. - pOut0 = pOut1;
  3871. -
  3872. - for (w = 1; w < nSpec; w++) /* for ACELP -> FD short */
  3873. - {
  3874. - const FIXP_WTP *pWindow_prev;
  3875. -
  3876. - /* Setup window pointers */
  3877. - pWindow_prev = hMdct->prev_wrs;
  3878. -
  3879. - /* Current spectrum */
  3880. - pSpec = _pSpec + w * tl;
  3881. -
  3882. - scale = total_gain_e;
  3883. -
  3884. - /* For the second, third, etc. short frames the alisaing symmetry is equal,
  3885. - * either (0,0) or (1,1) */
  3886. - if (currAliasingSymmetry == 0) {
  3887. - /* DCT IV of current spectrum */
  3888. - dct_IV(pSpec, tl, &scale);
  3889. - } else {
  3890. - dst_IV(pSpec, tl, &scale);
  3891. - }
  3892. -
  3893. - /* Optional scaling of time domain - no yet windowed - of current spectrum
  3894. - */
  3895. - /* and de-scale current spectrum signal (time domain, no yet windowed) */
  3896. - if (total_gain != (FIXP_DBL)0) {
  3897. - for (i = 0; i < tl; i++) {
  3898. - pSpec[i] = fMult(pSpec[i], total_gain);
  3899. - }
  3900. - }
  3901. - loc_scale = fixmin_I(spec_scale[w] + scale, (INT)DFRACT_BITS - 1);
  3902. - scaleValuesSaturate(pSpec, tl, loc_scale);
  3903. -
  3904. - if (noOutSamples <= nrSamples) {
  3905. - /* Divert output first half to overlap buffer if we already got enough
  3906. - * output samples. */
  3907. - pOut0 = hMdct->overlap.time + hMdct->ov_offset;
  3908. - hMdct->ov_offset += hMdct->prev_nr + fl / 2;
  3909. - } else {
  3910. - /* Account output samples */
  3911. - nrSamples += hMdct->prev_nr + fl / 2;
  3912. - }
  3913. -
  3914. - /* NR output samples 0 .. NR. -overlap[TL/2..TL/2-NR] */
  3915. - for (i = 0; i < hMdct->prev_nr; i++) {
  3916. - FIXP_DBL x = -(*pOvl--);
  3917. - *pOut0 = IMDCT_SCALE_DBL(x);
  3918. - pOut0++;
  3919. - }
  3920. -
  3921. - if (noOutSamples <= nrSamples) {
  3922. - /* Divert output second half to overlap buffer if we already got enough
  3923. - * output samples. */
  3924. - pOut1 = hMdct->overlap.time + hMdct->ov_offset + fl / 2 - 1;
  3925. - hMdct->ov_offset += fl / 2 + nl;
  3926. - } else {
  3927. - pOut1 = pOut0 + (fl - 1);
  3928. - nrSamples += fl / 2 + nl;
  3929. - }
  3930. -
  3931. - /* output samples before window crossing point NR .. TL/2.
  3932. - * -overlap[TL/2-NR..TL/2-NR-FL/2] + current[NR..TL/2] */
  3933. - /* output samples after window crossing point TL/2 .. TL/2+FL/2.
  3934. - * -overlap[0..FL/2] - current[TL/2..FL/2] */
  3935. - pCurr = pSpec + tl - fl / 2;
  3936. - if (currAliasingSymmetry == 0) {
  3937. - for (i = 0; i < fl / 2; i++) {
  3938. - FIXP_DBL x0, x1;
  3939. -
  3940. - cplxMult(&x1, &x0, *pCurr++, -*pOvl--, pWindow_prev[i]);
  3941. - *pOut0 = IMDCT_SCALE_DBL(x0);
  3942. - *pOut1 = IMDCT_SCALE_DBL(-x1);
  3943. - pOut0++;
  3944. - pOut1--;
  3945. - }
  3946. - } else {
  3947. - if (hMdct->prevPrevAliasSymmetry == 0) {
  3948. - /* Jump DST II -> DST IV for the second window */
  3949. - for (i = 0; i < fl / 2; i++) {
  3950. - FIXP_DBL x0, x1;
  3951. -
  3952. - cplxMult(&x1, &x0, *pCurr++, -*pOvl--, pWindow_prev[i]);
  3953. - *pOut0 = IMDCT_SCALE_DBL(x0);
  3954. - *pOut1 = IMDCT_SCALE_DBL(x1);
  3955. - pOut0++;
  3956. - pOut1--;
  3957. - }
  3958. - } else {
  3959. - /* Jump DST IV -> DST IV from the second window on */
  3960. - for (i = 0; i < fl / 2; i++) {
  3961. - FIXP_DBL x0, x1;
  3962. -
  3963. - cplxMult(&x1, &x0, *pCurr++, *pOvl--, pWindow_prev[i]);
  3964. - *pOut0 = IMDCT_SCALE_DBL(x0);
  3965. - *pOut1 = IMDCT_SCALE_DBL(x1);
  3966. - pOut0++;
  3967. - pOut1--;
  3968. - }
  3969. - }
  3970. - }
  3971. -
  3972. - if (hMdct->pFacZir != 0) {
  3973. - /* add FAC ZIR of previous ACELP -> mdct transition */
  3974. - FIXP_DBL *pOut = pOut0 - fl / 2;
  3975. - FDK_ASSERT(fl / 2 <= 128);
  3976. - for (i = 0; i < fl / 2; i++) {
  3977. - pOut[i] += IMDCT_SCALE_DBL(hMdct->pFacZir[i]);
  3978. - }
  3979. - hMdct->pFacZir = NULL;
  3980. - }
  3981. - pOut0 += (fl / 2);
  3982. -
  3983. - /* NL output samples TL/2+FL/2..TL. - current[FL/2..0] */
  3984. - pOut1 += (fl / 2) + 1;
  3985. - pCurr = pSpec + tl - fl / 2 - 1;
  3986. - for (i = 0; i < nl; i++) {
  3987. - FIXP_DBL x = -(*pCurr--);
  3988. - *pOut1 = IMDCT_SCALE_DBL(x);
  3989. - pOut1++;
  3990. - }
  3991. -
  3992. - /* Set overlap source pointer for next window pOvl = pSpec + tl/2 - 1; */
  3993. - pOvl = pSpec + tl / 2 - 1;
  3994. -
  3995. - /* Previous window values. */
  3996. - hMdct->prev_nr = nr;
  3997. - hMdct->prev_fr = fr;
  3998. - hMdct->prev_tl = tl;
  3999. - hMdct->prev_wrs = pWindow_prev;
  4000. - hMdct->prevPrevAliasSymmetry = hMdct->prevAliasSymmetry;
  4001. - hMdct->prevAliasSymmetry = currAliasingSymmetry;
  4002. - }
  4003. -
  4004. - /* Save overlap */
  4005. -
  4006. - pOvl = hMdct->overlap.freq + hMdct->ov_size - tl / 2;
  4007. - FDK_ASSERT(pOvl >= hMdct->overlap.time + hMdct->ov_offset);
  4008. - FDK_ASSERT(tl / 2 <= hMdct->ov_size);
  4009. - for (i = 0; i < tl / 2; i++) {
  4010. - pOvl[i] = _pSpec[i + (w - 1) * tl];
  4011. - }
  4012. -
  4013. - return nrSamples;
  4014. -}
  4015. --- a/libAACdec/src/usacdec_fac.h
  4016. +++ /dev/null
  4017. @@ -1,191 +0,0 @@
  4018. -/* -----------------------------------------------------------------------------
  4019. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  4020. -
  4021. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  4022. -Forschung e.V. All rights reserved.
  4023. -
  4024. - 1. INTRODUCTION
  4025. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  4026. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  4027. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  4028. -a wide variety of Android devices.
  4029. -
  4030. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  4031. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  4032. -full-bandwidth communications codec by independent studies and is widely
  4033. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  4034. -specifications.
  4035. -
  4036. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  4037. -those of Fraunhofer) may be obtained through Via Licensing
  4038. -(www.vialicensing.com) or through the respective patent owners individually for
  4039. -the purpose of encoding or decoding bit streams in products that are compliant
  4040. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  4041. -Android devices already license these patent claims through Via Licensing or
  4042. -directly from the patent owners, and therefore FDK AAC Codec software may
  4043. -already be covered under those patent licenses when it is used for those
  4044. -licensed purposes only.
  4045. -
  4046. -Commercially-licensed AAC software libraries, including floating-point versions
  4047. -with enhanced sound quality, are also available from Fraunhofer. Users are
  4048. -encouraged to check the Fraunhofer website for additional applications
  4049. -information and documentation.
  4050. -
  4051. -2. COPYRIGHT LICENSE
  4052. -
  4053. -Redistribution and use in source and binary forms, with or without modification,
  4054. -are permitted without payment of copyright license fees provided that you
  4055. -satisfy the following conditions:
  4056. -
  4057. -You must retain the complete text of this software license in redistributions of
  4058. -the FDK AAC Codec or your modifications thereto in source code form.
  4059. -
  4060. -You must retain the complete text of this software license in the documentation
  4061. -and/or other materials provided with redistributions of the FDK AAC Codec or
  4062. -your modifications thereto in binary form. You must make available free of
  4063. -charge copies of the complete source code of the FDK AAC Codec and your
  4064. -modifications thereto to recipients of copies in binary form.
  4065. -
  4066. -The name of Fraunhofer may not be used to endorse or promote products derived
  4067. -from this library without prior written permission.
  4068. -
  4069. -You may not charge copyright license fees for anyone to use, copy or distribute
  4070. -the FDK AAC Codec software or your modifications thereto.
  4071. -
  4072. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  4073. -that you changed the software and the date of any change. For modified versions
  4074. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  4075. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  4076. -AAC Codec Library for Android."
  4077. -
  4078. -3. NO PATENT LICENSE
  4079. -
  4080. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  4081. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  4082. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  4083. -software.
  4084. -
  4085. -You may use this FDK AAC Codec software or modifications thereto only for
  4086. -purposes that are authorized by appropriate patent licenses.
  4087. -
  4088. -4. DISCLAIMER
  4089. -
  4090. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  4091. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  4092. -including but not limited to the implied warranties of merchantability and
  4093. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  4094. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  4095. -or consequential damages, including but not limited to procurement of substitute
  4096. -goods or services; loss of use, data, or profits, or business interruption,
  4097. -however caused and on any theory of liability, whether in contract, strict
  4098. -liability, or tort (including negligence), arising in any way out of the use of
  4099. -this software, even if advised of the possibility of such damage.
  4100. -
  4101. -5. CONTACT INFORMATION
  4102. -
  4103. -Fraunhofer Institute for Integrated Circuits IIS
  4104. -Attention: Audio and Multimedia Departments - FDK AAC LL
  4105. -Am Wolfsmantel 33
  4106. -91058 Erlangen, Germany
  4107. -
  4108. -www.iis.fraunhofer.de/amm
  4109. -amm-info@iis.fraunhofer.de
  4110. ------------------------------------------------------------------------------ */
  4111. -
  4112. -/**************************** AAC decoder library ******************************
  4113. -
  4114. - Author(s): Manuel Jander
  4115. -
  4116. - Description: USAC FAC
  4117. -
  4118. -*******************************************************************************/
  4119. -
  4120. -#ifndef USACDEC_FAC_H
  4121. -#define USACDEC_FAC_H
  4122. -
  4123. -#include "channelinfo.h"
  4124. -#include "FDK_bitstream.h"
  4125. -
  4126. -/**
  4127. - * \brief Get the address of a memory area of the spectral data memory were the
  4128. - * FAC data can be stored into.
  4129. - * \param spec SPECTRAL_PTR pointing to the current spectral data.
  4130. - * \param mod the current LPD mod array.
  4131. - * \param pState pointer to a private state variable which must be 0 for the
  4132. - * first call and not changed externally.
  4133. - * \param isFullbandLPD is 1 if fullband LPD mode is on, otherwise it is 0.
  4134. - */
  4135. -FIXP_DBL *CLpd_FAC_GetMemory(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  4136. - UCHAR mod[NB_SUBFR], int *pState);
  4137. -
  4138. -/**
  4139. - * \brief read a fac bitstream data block.
  4140. - * \param hBs a bit stream handle, where the fac bitstream data is located.
  4141. - * \param pFac pointer to were the FAC data will be stored into.
  4142. - * \param pFacScale pointer to were the FAC data scale value will be stored
  4143. - * into.
  4144. - * \param tcx_gain value to be used as FAC gain. If zero, read fac_gain from
  4145. - * bitstream.
  4146. - * \param tcx_gain_e exponen value of tcx_gain.
  4147. - * \param frame the subframe to be considered from the current superframe.
  4148. - * Always 0 for FD case.
  4149. - * \return 0 on success, -1 on error.
  4150. - */
  4151. -int CLpd_FAC_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pFac, SCHAR *pFacScale,
  4152. - int length, int use_gain, int frame);
  4153. -
  4154. -/**
  4155. - * \brief Apply TCX and ALFD gains to FAC data.
  4156. - * \param fac_data pointer to FAC data.
  4157. - * \param fac_length FAC length (128 or 96).
  4158. - * \param tcx_gain TCX gain
  4159. - * \param alfd_gains pointer to alfd gains.
  4160. - * \param mod mod value (1,2,3) of TCX frame where the FAC signal needs to be
  4161. - * applied.
  4162. - */
  4163. -void CFac_ApplyGains(FIXP_DBL fac_data[LFAC], const INT fac_length,
  4164. - const FIXP_DBL tcx_gain, const FIXP_DBL alfd_gains[],
  4165. - const INT mod);
  4166. -
  4167. -/**
  4168. - * \brief Do FAC transition from frequency domain to ACELP domain.
  4169. - */
  4170. -INT CLpd_FAC_Mdct2Acelp(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pFac_data,
  4171. - const int fac_data_e, FIXP_LPC *A, INT A_exp,
  4172. - INT nrOutSamples, const INT fac_length,
  4173. - const INT isFdFac, UCHAR prevWindowShape);
  4174. -
  4175. -/**
  4176. - * \brief Do FAC transition from ACELP domain to frequency domain.
  4177. - * \param hMdct MDCT context.
  4178. - * \param output pointer for time domain output.
  4179. - * \param pSpec pointer to MDCT spectrum input.
  4180. - * \param spec_scale MDCT spectrum exponents.
  4181. - * \param nSpec amount of contiguos MDCT spectra.
  4182. - * \param pFac pointer to FAC MDCT domain data.
  4183. - * \param fac_scale exponent of FAC data.
  4184. - * \param fac_length length of FAC data.
  4185. - * \param nrSamples room in samples in output buffer.
  4186. - * \param tl MDCT transform length of pSpec.
  4187. - * \param wrs right MDCT window slope.
  4188. - * \param fr right MDCT window slope length.
  4189. - * \param A LP domain filter coefficients.
  4190. - * \param deemph_mem deemphasis filter state.
  4191. - * \param gain gain to be applied to FAC data before overlap add.
  4192. - * \param old_syn_mem Synthesis filter state.
  4193. - * \param isFdFac indicates fac processing from or to FD.
  4194. - * \param pFacData fac data stored for fullband LPD.
  4195. - * \param elFlags element specific parser guidance flags.
  4196. - * \param isFacForFullband indicates that fac is processed for fullband LPD.
  4197. - */
  4198. -INT CLpd_FAC_Acelp2Mdct(H_MDCT hMdct, FIXP_DBL *output, FIXP_DBL *pSpec,
  4199. - const SHORT spec_scale[], const int nSpec,
  4200. - FIXP_DBL *pFac_data, const int fac_data_e,
  4201. - const INT fac_length, INT nrSamples, const INT tl,
  4202. - const FIXP_WTP *wrs, const INT fr, FIXP_LPC A[16],
  4203. - INT A_exp, CAcelpStaticMem *acelp_mem,
  4204. - const FIXP_DBL gain, const int last_frame_lost,
  4205. - const int isFdFac, const UCHAR last_lpd, const int k,
  4206. - int currAliasingSymmetry);
  4207. -
  4208. -#endif /* USACDEC_FAC_H */
  4209. --- a/libAACdec/src/usacdec_lpc.cpp
  4210. +++ /dev/null
  4211. @@ -1,1194 +0,0 @@
  4212. -/* -----------------------------------------------------------------------------
  4213. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  4214. -
  4215. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  4216. -Forschung e.V. All rights reserved.
  4217. -
  4218. - 1. INTRODUCTION
  4219. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  4220. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  4221. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  4222. -a wide variety of Android devices.
  4223. -
  4224. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  4225. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  4226. -full-bandwidth communications codec by independent studies and is widely
  4227. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  4228. -specifications.
  4229. -
  4230. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  4231. -those of Fraunhofer) may be obtained through Via Licensing
  4232. -(www.vialicensing.com) or through the respective patent owners individually for
  4233. -the purpose of encoding or decoding bit streams in products that are compliant
  4234. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  4235. -Android devices already license these patent claims through Via Licensing or
  4236. -directly from the patent owners, and therefore FDK AAC Codec software may
  4237. -already be covered under those patent licenses when it is used for those
  4238. -licensed purposes only.
  4239. -
  4240. -Commercially-licensed AAC software libraries, including floating-point versions
  4241. -with enhanced sound quality, are also available from Fraunhofer. Users are
  4242. -encouraged to check the Fraunhofer website for additional applications
  4243. -information and documentation.
  4244. -
  4245. -2. COPYRIGHT LICENSE
  4246. -
  4247. -Redistribution and use in source and binary forms, with or without modification,
  4248. -are permitted without payment of copyright license fees provided that you
  4249. -satisfy the following conditions:
  4250. -
  4251. -You must retain the complete text of this software license in redistributions of
  4252. -the FDK AAC Codec or your modifications thereto in source code form.
  4253. -
  4254. -You must retain the complete text of this software license in the documentation
  4255. -and/or other materials provided with redistributions of the FDK AAC Codec or
  4256. -your modifications thereto in binary form. You must make available free of
  4257. -charge copies of the complete source code of the FDK AAC Codec and your
  4258. -modifications thereto to recipients of copies in binary form.
  4259. -
  4260. -The name of Fraunhofer may not be used to endorse or promote products derived
  4261. -from this library without prior written permission.
  4262. -
  4263. -You may not charge copyright license fees for anyone to use, copy or distribute
  4264. -the FDK AAC Codec software or your modifications thereto.
  4265. -
  4266. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  4267. -that you changed the software and the date of any change. For modified versions
  4268. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  4269. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  4270. -AAC Codec Library for Android."
  4271. -
  4272. -3. NO PATENT LICENSE
  4273. -
  4274. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  4275. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  4276. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  4277. -software.
  4278. -
  4279. -You may use this FDK AAC Codec software or modifications thereto only for
  4280. -purposes that are authorized by appropriate patent licenses.
  4281. -
  4282. -4. DISCLAIMER
  4283. -
  4284. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  4285. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  4286. -including but not limited to the implied warranties of merchantability and
  4287. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  4288. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  4289. -or consequential damages, including but not limited to procurement of substitute
  4290. -goods or services; loss of use, data, or profits, or business interruption,
  4291. -however caused and on any theory of liability, whether in contract, strict
  4292. -liability, or tort (including negligence), arising in any way out of the use of
  4293. -this software, even if advised of the possibility of such damage.
  4294. -
  4295. -5. CONTACT INFORMATION
  4296. -
  4297. -Fraunhofer Institute for Integrated Circuits IIS
  4298. -Attention: Audio and Multimedia Departments - FDK AAC LL
  4299. -Am Wolfsmantel 33
  4300. -91058 Erlangen, Germany
  4301. -
  4302. -www.iis.fraunhofer.de/amm
  4303. -amm-info@iis.fraunhofer.de
  4304. ------------------------------------------------------------------------------ */
  4305. -
  4306. -/**************************** AAC decoder library ******************************
  4307. -
  4308. - Author(s): Matthias Hildenbrand, Manuel Jander
  4309. -
  4310. - Description: USAC LPC/AVQ decode
  4311. -
  4312. -*******************************************************************************/
  4313. -
  4314. -#include "usacdec_lpc.h"
  4315. -
  4316. -#include "usacdec_rom.h"
  4317. -#include "FDK_trigFcts.h"
  4318. -
  4319. -#define NQ_MAX 36
  4320. -
  4321. -/*
  4322. - * Helper functions.
  4323. - */
  4324. -
  4325. -/**
  4326. - * \brief Read unary code.
  4327. - * \param hBs bitstream handle as data source.
  4328. - * \return decoded value.
  4329. - */
  4330. -static int get_vlclbf(HANDLE_FDK_BITSTREAM hBs) {
  4331. - int result = 0;
  4332. -
  4333. - while (FDKreadBits(hBs, 1) && result <= NQ_MAX) {
  4334. - result++;
  4335. - }
  4336. - return result;
  4337. -}
  4338. -
  4339. -/**
  4340. - * \brief Read bit count limited unary code.
  4341. - * \param hBs bitstream handle as data source
  4342. - * \param n max amount of bits to be read.
  4343. - * \return decoded value.
  4344. - */
  4345. -static int get_vlclbf_n(HANDLE_FDK_BITSTREAM hBs, int n) {
  4346. - int result = 0;
  4347. -
  4348. - while (FDKreadBits(hBs, 1)) {
  4349. - result++;
  4350. - n--;
  4351. - if (n <= 0) {
  4352. - break;
  4353. - }
  4354. - }
  4355. -
  4356. - return result;
  4357. -}
  4358. -
  4359. -/*
  4360. - * Algebraic Vector Quantizer
  4361. - */
  4362. -
  4363. -/* ZF_SCALE must be greater than (number of FIXP_ZF)/2
  4364. - because the loss of precision caused by fPow2Div2 in RE8_PPV() */
  4365. -//#define ZF_SCALE ((NQ_MAX-3)>>1)
  4366. -#define ZF_SCALE ((DFRACT_BITS / 2))
  4367. -#define FIXP_ZF FIXP_DBL
  4368. -#define INT2ZF(x, s) (FIXP_ZF)((x) << (ZF_SCALE - (s)))
  4369. -#define ZF2INT(x) (INT)((x) >> ZF_SCALE)
  4370. -
  4371. -/* 1.0 in ZF format format */
  4372. -#define ONEZF ((FIXP_ZF)INT2ZF(1, 0))
  4373. -
  4374. -/* static */
  4375. -void nearest_neighbor_2D8(FIXP_ZF x[8], int y[8]) {
  4376. - FIXP_ZF s, em, e[8];
  4377. - int i, j, sum;
  4378. -
  4379. - /* round x into 2Z^8 i.e. compute y=(y1,...,y8) such that yi = 2[xi/2]
  4380. - where [.] is the nearest integer operator
  4381. - in the mean time, compute sum = y1+...+y8
  4382. - */
  4383. - sum = 0;
  4384. - for (i = 0; i < 8; i++) {
  4385. - FIXP_ZF tmp;
  4386. - /* round to ..., -2, 0, 2, ... ([-1..1[ --> 0) */
  4387. - if (x[i] < (FIXP_ZF)0) {
  4388. - tmp = ONEZF - x[i];
  4389. - y[i] = -2 * ((ZF2INT(tmp)) >> 1);
  4390. - } else {
  4391. - tmp = ONEZF + x[i];
  4392. - y[i] = 2 * ((ZF2INT(tmp)) >> 1);
  4393. - }
  4394. - sum += y[i];
  4395. - }
  4396. - /* check if y1+...+y8 is a multiple of 4
  4397. - if not, y is not round xj in the wrong way where j is defined by
  4398. - j = arg max_i | xi -yi|
  4399. - (this is called the Wagner rule)
  4400. - */
  4401. - if (sum % 4) {
  4402. - /* find j = arg max_i | xi -yi| */
  4403. - em = (FIXP_SGL)0;
  4404. - j = 0;
  4405. - for (i = 0; i < 8; i++) {
  4406. - /* compute ei = xi-yi */
  4407. - e[i] = x[i] - INT2ZF(y[i], 0);
  4408. - }
  4409. - for (i = 0; i < 8; i++) {
  4410. - /* compute |ei| = | xi-yi | */
  4411. - if (e[i] < (FIXP_ZF)0) {
  4412. - s = -e[i];
  4413. - } else {
  4414. - s = e[i];
  4415. - }
  4416. - /* check if |ei| is maximal, if so, set j=i */
  4417. - if (em < s) {
  4418. - em = s;
  4419. - j = i;
  4420. - }
  4421. - }
  4422. - /* round xj in the "wrong way" */
  4423. - if (e[j] < (FIXP_ZF)0) {
  4424. - y[j] -= 2;
  4425. - } else {
  4426. - y[j] += 2;
  4427. - }
  4428. - }
  4429. -}
  4430. -
  4431. -/*--------------------------------------------------------------
  4432. - RE8_PPV(x,y)
  4433. - NEAREST NEIGHBOR SEARCH IN INFINITE LATTICE RE8
  4434. - the algorithm is based on the definition of RE8 as
  4435. - RE8 = (2D8) U (2D8+[1,1,1,1,1,1,1,1])
  4436. - it applies the coset decoding of Sloane and Conway
  4437. - (i) x: point in R^8 in 32-ZF_SCALE.ZF_SCALE format
  4438. - (o) y: point in RE8 (8-dimensional integer vector)
  4439. - --------------------------------------------------------------
  4440. -*/
  4441. -/* static */
  4442. -void RE8_PPV(FIXP_ZF x[], SHORT y[], int r) {
  4443. - int i, y0[8], y1[8];
  4444. - FIXP_ZF x1[8], tmp;
  4445. - FIXP_DBL e;
  4446. -
  4447. - /* find the nearest neighbor y0 of x in 2D8 */
  4448. - nearest_neighbor_2D8(x, y0);
  4449. - /* find the nearest neighbor y1 of x in 2D8+(1,...,1) (by coset decoding) */
  4450. - for (i = 0; i < 8; i++) {
  4451. - x1[i] = x[i] - ONEZF;
  4452. - }
  4453. - nearest_neighbor_2D8(x1, y1);
  4454. - for (i = 0; i < 8; i++) {
  4455. - y1[i] += 1;
  4456. - }
  4457. -
  4458. - /* compute e0=||x-y0||^2 and e1=||x-y1||^2 */
  4459. - e = (FIXP_DBL)0;
  4460. - for (i = 0; i < 8; i++) {
  4461. - tmp = x[i] - INT2ZF(y0[i], 0);
  4462. - e += fPow2Div2(
  4463. - tmp << r); /* shift left to ensure that no fract part bits get lost. */
  4464. - tmp = x[i] - INT2ZF(y1[i], 0);
  4465. - e -= fPow2Div2(tmp << r);
  4466. - }
  4467. - /* select best candidate y0 or y1 to minimize distortion */
  4468. - if (e < (FIXP_DBL)0) {
  4469. - for (i = 0; i < 8; i++) {
  4470. - y[i] = y0[i];
  4471. - }
  4472. - } else {
  4473. - for (i = 0; i < 8; i++) {
  4474. - y[i] = y1[i];
  4475. - }
  4476. - }
  4477. -}
  4478. -
  4479. -/* table look-up of unsigned value: find i where index >= table[i]
  4480. - Note: range must be >= 2, index must be >= table[0] */
  4481. -static int table_lookup(const USHORT *table, unsigned int index, int range) {
  4482. - int i;
  4483. -
  4484. - for (i = 4; i < range; i += 4) {
  4485. - if (index < table[i]) {
  4486. - break;
  4487. - }
  4488. - }
  4489. - if (i > range) {
  4490. - i = range;
  4491. - }
  4492. -
  4493. - if (index < table[i - 2]) {
  4494. - i -= 2;
  4495. - }
  4496. - if (index < table[i - 1]) {
  4497. - i--;
  4498. - }
  4499. - i--;
  4500. -
  4501. - return (i); /* index >= table[i] */
  4502. -}
  4503. -
  4504. -/*--------------------------------------------------------------------------
  4505. - re8_decode_rank_of_permutation(rank, xs, x)
  4506. - DECODING OF THE RANK OF THE PERMUTATION OF xs
  4507. - (i) rank: index (rank) of a permutation
  4508. - (i) xs: signed leader in RE8 (8-dimensional integer vector)
  4509. - (o) x: point in RE8 (8-dimensional integer vector)
  4510. - --------------------------------------------------------------------------
  4511. - */
  4512. -static void re8_decode_rank_of_permutation(int rank, int *xs, SHORT x[8]) {
  4513. - INT a[8], w[8], B, fac, fac_B, target;
  4514. - int i, j;
  4515. -
  4516. - /* --- pre-processing based on the signed leader xs ---
  4517. - - compute the alphabet a=[a[0] ... a[q-1]] of x (q elements)
  4518. - such that a[0]!=...!=a[q-1]
  4519. - it is assumed that xs is sorted in the form of a signed leader
  4520. - which can be summarized in 2 requirements:
  4521. - a) |xs[0]| >= |xs[1]| >= |xs[2]| >= ... >= |xs[7]|
  4522. - b) if |xs[i]|=|xs[i-1]|, xs[i]>=xs[i+1]
  4523. - where |.| indicates the absolute value operator
  4524. - - compute q (the number of symbols in the alphabet)
  4525. - - compute w[0..q-1] where w[j] counts the number of occurences of
  4526. - the symbol a[j] in xs
  4527. - - compute B = prod_j=0..q-1 (w[j]!) where .! is the factorial */
  4528. - /* xs[i], xs[i-1] and ptr_w/a*/
  4529. - j = 0;
  4530. - w[j] = 1;
  4531. - a[j] = xs[0];
  4532. - B = 1;
  4533. - for (i = 1; i < 8; i++) {
  4534. - if (xs[i] != xs[i - 1]) {
  4535. - j++;
  4536. - w[j] = 1;
  4537. - a[j] = xs[i];
  4538. - } else {
  4539. - w[j]++;
  4540. - B *= w[j];
  4541. - }
  4542. - }
  4543. -
  4544. - /* --- actual rank decoding ---
  4545. - the rank of x (where x is a permutation of xs) is based on
  4546. - Schalkwijk's formula
  4547. - it is given by rank=sum_{k=0..7} (A_k * fac_k/B_k)
  4548. - the decoding of this rank is sequential and reconstructs x[0..7]
  4549. - element by element from x[0] to x[7]
  4550. - [the tricky part is the inference of A_k for each k...]
  4551. - */
  4552. -
  4553. - if (w[0] == 8) {
  4554. - for (i = 0; i < 8; i++) {
  4555. - x[i] = a[0]; /* avoid fac of 40320 */
  4556. - }
  4557. - } else {
  4558. - target = rank * B;
  4559. - fac_B = 1;
  4560. - /* decode x element by element */
  4561. - for (i = 0; i < 8; i++) {
  4562. - fac = fac_B * fdk_dec_tab_factorial[i]; /* fac = 1..5040 */
  4563. - j = -1;
  4564. - do {
  4565. - target -= w[++j] * fac;
  4566. - } while (target >= 0); /* max of 30 tests / SV */
  4567. - x[i] = a[j];
  4568. - /* update rank, denominator B (B_k) and counter w[j] */
  4569. - target += w[j] * fac; /* target = fac_B*B*rank */
  4570. - fac_B *= w[j];
  4571. - w[j]--;
  4572. - }
  4573. - }
  4574. -}
  4575. -
  4576. -/*--------------------------------------------------------------------------
  4577. - re8_decode_base_index(n, I, y)
  4578. - DECODING OF AN INDEX IN Qn (n=0,2,3 or 4)
  4579. - (i) n: codebook number (*n is an integer defined in {0,2,3,4})
  4580. - (i) I: index of c (pointer to unsigned 16-bit word)
  4581. - (o) y: point in RE8 (8-dimensional integer vector)
  4582. - note: the index I is defined as a 32-bit word, but only
  4583. - 16 bits are required (long can be replaced by unsigned integer)
  4584. - --------------------------------------------------------------------------
  4585. - */
  4586. -static void re8_decode_base_index(int *n, UINT index, SHORT y[8]) {
  4587. - int i, im, t, sign_code, ka, ks, rank, leader[8];
  4588. -
  4589. - if (*n < 2) {
  4590. - for (i = 0; i < 8; i++) {
  4591. - y[i] = 0;
  4592. - }
  4593. - } else {
  4594. - // index = (unsigned int)*I;
  4595. - /* search for the identifier ka of the absolute leader (table-lookup)
  4596. - Q2 is a subset of Q3 - the two cases are considered in the same branch
  4597. - */
  4598. - switch (*n) {
  4599. - case 2:
  4600. - case 3:
  4601. - i = table_lookup(fdk_dec_I3, index, NB_LDQ3);
  4602. - ka = fdk_dec_A3[i];
  4603. - break;
  4604. - case 4:
  4605. - i = table_lookup(fdk_dec_I4, index, NB_LDQ4);
  4606. - ka = fdk_dec_A4[i];
  4607. - break;
  4608. - default:
  4609. - FDK_ASSERT(0);
  4610. - return;
  4611. - }
  4612. - /* reconstruct the absolute leader */
  4613. - for (i = 0; i < 8; i++) {
  4614. - leader[i] = fdk_dec_Da[ka][i];
  4615. - }
  4616. - /* search for the identifier ks of the signed leader (table look-up)
  4617. - (this search is focused based on the identifier ka of the absolute
  4618. - leader)*/
  4619. - t = fdk_dec_Ia[ka];
  4620. - im = fdk_dec_Ns[ka];
  4621. - ks = table_lookup(fdk_dec_Is + t, index, im);
  4622. -
  4623. - /* reconstruct the signed leader from its sign code */
  4624. - sign_code = 2 * fdk_dec_Ds[t + ks];
  4625. - for (i = 7; i >= 0; i--) {
  4626. - leader[i] *= (1 - (sign_code & 2));
  4627. - sign_code >>= 1;
  4628. - }
  4629. -
  4630. - /* compute and decode the rank of the permutation */
  4631. - rank = index - fdk_dec_Is[t + ks]; /* rank = index - cardinality offset */
  4632. -
  4633. - re8_decode_rank_of_permutation(rank, leader, y);
  4634. - }
  4635. - return;
  4636. -}
  4637. -
  4638. -/* re8_y2k(y,m,k)
  4639. - VORONOI INDEXING (INDEX DECODING) k -> y
  4640. - (i) k: Voronoi index k[0..7]
  4641. - (i) m: Voronoi modulo (m = 2^r = 1<<r, where r is integer >=2)
  4642. - (i) r: Voronoi order (m = 2^r = 1<<r, where r is integer >=2)
  4643. - (o) y: 8-dimensional point y[0..7] in RE8
  4644. - */
  4645. -static void re8_k2y(int *k, int r, SHORT *y) {
  4646. - int i, tmp, sum;
  4647. - SHORT v[8];
  4648. - FIXP_ZF zf[8];
  4649. -
  4650. - FDK_ASSERT(r <= ZF_SCALE);
  4651. -
  4652. - /* compute y = k M and z=(y-a)/m, where
  4653. - M = [4 ]
  4654. - [2 2 ]
  4655. - [| \ ]
  4656. - [2 2 ]
  4657. - [1 1 _ 1 1]
  4658. - a=(2,0,...,0)
  4659. - m = 1<<r
  4660. - */
  4661. - for (i = 0; i < 8; i++) {
  4662. - y[i] = k[7];
  4663. - }
  4664. - zf[7] = INT2ZF(y[7], r);
  4665. - sum = 0;
  4666. - for (i = 6; i >= 1; i--) {
  4667. - tmp = 2 * k[i];
  4668. - sum += tmp;
  4669. - y[i] += tmp;
  4670. - zf[i] = INT2ZF(y[i], r);
  4671. - }
  4672. - y[0] += (4 * k[0] + sum);
  4673. - zf[0] = INT2ZF(y[0] - 2, r);
  4674. - /* find nearest neighbor v of z in infinite RE8 */
  4675. - RE8_PPV(zf, v, r);
  4676. - /* compute y -= m v */
  4677. - for (i = 0; i < 8; i++) {
  4678. - y[i] -= (SHORT)(v[i] << r);
  4679. - }
  4680. -}
  4681. -
  4682. -/*--------------------------------------------------------------------------
  4683. - RE8_dec(n, I, k, y)
  4684. - MULTI-RATE INDEXING OF A POINT y in THE LATTICE RE8 (INDEX DECODING)
  4685. - (i) n: codebook number (*n is an integer defined in {0,2,3,4,..,n_max}). n_max
  4686. - = 36 (i) I: index of c (pointer to unsigned 16-bit word) (i) k: index of v
  4687. - (8-dimensional vector of binary indices) = Voronoi index (o) y: point in RE8
  4688. - (8-dimensional integer vector) note: the index I is defined as a 32-bit word,
  4689. - but only 16 bits are required (long can be replaced by unsigned integer)
  4690. -
  4691. - return 0 on success, -1 on error.
  4692. - --------------------------------------------------------------------------
  4693. - */
  4694. -static int RE8_dec(int n, int I, int *k, FIXP_DBL *y) {
  4695. - SHORT v[8];
  4696. - SHORT _y[8];
  4697. - UINT r;
  4698. - int i;
  4699. -
  4700. - /* Check bound of codebook qn */
  4701. - if (n > NQ_MAX) {
  4702. - return -1;
  4703. - }
  4704. -
  4705. - /* decode the sub-indices I and kv[] according to the codebook number n:
  4706. - if n=0,2,3,4, decode I (no Voronoi extension)
  4707. - if n>4, Voronoi extension is used, decode I and kv[] */
  4708. - if (n <= 4) {
  4709. - re8_decode_base_index(&n, I, _y);
  4710. - for (i = 0; i < 8; i++) {
  4711. - y[i] = (LONG)_y[i];
  4712. - }
  4713. - } else {
  4714. - /* compute the Voronoi modulo m = 2^r where r is extension order */
  4715. - r = ((n - 3) >> 1);
  4716. -
  4717. - while (n > 4) {
  4718. - n -= 2;
  4719. - }
  4720. - /* decode base codebook index I into c (c is an element of Q3 or Q4)
  4721. - [here c is stored in y to save memory] */
  4722. - re8_decode_base_index(&n, I, _y);
  4723. - /* decode Voronoi index k[] into v */
  4724. - re8_k2y(k, r, v);
  4725. - /* reconstruct y as y = m c + v (with m=2^r, r integer >=1) */
  4726. - for (i = 0; i < 8; i++) {
  4727. - y[i] = (LONG)((_y[i] << r) + v[i]);
  4728. - }
  4729. - }
  4730. - return 0;
  4731. -}
  4732. -
  4733. -/**************************/
  4734. -/* start LPC decode stuff */
  4735. -/**************************/
  4736. -//#define M 16
  4737. -#define FREQ_MAX 6400.0f
  4738. -#define FREQ_DIV 400.0f
  4739. -#define LSF_GAP 50.0f
  4740. -
  4741. -/**
  4742. - * \brief calculate inverse weighting factor and add non-weighted residual
  4743. - * LSF vector to first stage LSF approximation
  4744. - * \param lsfq first stage LSF approximation values.
  4745. - * \param xq weighted residual LSF vector
  4746. - * \param nk_mode code book number coding mode.
  4747. - */
  4748. -static void lsf_weight_2st(FIXP_LPC *lsfq, FIXP_DBL *xq, int nk_mode) {
  4749. - FIXP_LPC d[M_LP_FILTER_ORDER + 1];
  4750. - FIXP_SGL factor;
  4751. - LONG w; /* inverse weight factor */
  4752. - int i;
  4753. -
  4754. - /* compute lsf distance */
  4755. - d[0] = lsfq[0];
  4756. - d[M_LP_FILTER_ORDER] =
  4757. - FL2FXCONST_LPC(FREQ_MAX / (1 << LSF_SCALE)) - lsfq[M_LP_FILTER_ORDER - 1];
  4758. - for (i = 1; i < M_LP_FILTER_ORDER; i++) {
  4759. - d[i] = lsfq[i] - lsfq[i - 1];
  4760. - }
  4761. -
  4762. - switch (nk_mode) {
  4763. - case 0:
  4764. - factor = FL2FXCONST_SGL(2.0f * 60.0f / FREQ_DIV);
  4765. - break; /* abs */
  4766. - case 1:
  4767. - factor = FL2FXCONST_SGL(2.0f * 65.0f / FREQ_DIV);
  4768. - break; /* mid */
  4769. - case 2:
  4770. - factor = FL2FXCONST_SGL(2.0f * 64.0f / FREQ_DIV);
  4771. - break; /* rel1 */
  4772. - default:
  4773. - factor = FL2FXCONST_SGL(2.0f * 63.0f / FREQ_DIV);
  4774. - break; /* rel2 */
  4775. - }
  4776. - /* add non-weighted residual LSF vector to LSF1st */
  4777. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  4778. - w = (LONG)fMultDiv2(factor, sqrtFixp(fMult(d[i], d[i + 1])));
  4779. - lsfq[i] = fAddSaturate(lsfq[i], FX_DBL2FX_LPC((FIXP_DBL)(w * (LONG)xq[i])));
  4780. - }
  4781. -
  4782. - return;
  4783. -}
  4784. -
  4785. -/**
  4786. - * \brief decode nqn amount of code book numbers. These values determine the
  4787. - * amount of following bits for nqn AVQ RE8 vectors.
  4788. - * \param nk_mode quantization mode.
  4789. - * \param nqn amount code book number to read.
  4790. - * \param qn pointer to output buffer to hold decoded code book numbers qn.
  4791. - */
  4792. -static void decode_qn(HANDLE_FDK_BITSTREAM hBs, int nk_mode, int nqn,
  4793. - int qn[]) {
  4794. - int n;
  4795. -
  4796. - if (nk_mode == 1) { /* nk mode 1 */
  4797. - /* Unary code for mid LPC1/LPC3 */
  4798. - /* Q0=0, Q2=10, Q3=110, ... */
  4799. - for (n = 0; n < nqn; n++) {
  4800. - qn[n] = get_vlclbf(hBs);
  4801. - if (qn[n] > 0) {
  4802. - qn[n]++;
  4803. - }
  4804. - }
  4805. - } else { /* nk_mode 0, 3 and 2 */
  4806. - /* 2 bits to specify Q2,Q3,Q4,ext */
  4807. - for (n = 0; n < nqn; n++) {
  4808. - qn[n] = 2 + FDKreadBits(hBs, 2);
  4809. - }
  4810. - if (nk_mode == 2) {
  4811. - /* Unary code for rel LPC1/LPC3 */
  4812. - /* Q0 = 0, Q5=10, Q6=110, ... */
  4813. - for (n = 0; n < nqn; n++) {
  4814. - if (qn[n] > 4) {
  4815. - qn[n] = get_vlclbf(hBs);
  4816. - if (qn[n] > 0) qn[n] += 4;
  4817. - }
  4818. - }
  4819. - } else { /* nk_mode == (0 and 3) */
  4820. - /* Unary code for abs and rel LPC0/LPC2 */
  4821. - /* Q5 = 0, Q6=10, Q0=110, Q7=1110, ... */
  4822. - for (n = 0; n < nqn; n++) {
  4823. - if (qn[n] > 4) {
  4824. - qn[n] = get_vlclbf(hBs);
  4825. - switch (qn[n]) {
  4826. - case 0:
  4827. - qn[n] = 5;
  4828. - break;
  4829. - case 1:
  4830. - qn[n] = 6;
  4831. - break;
  4832. - case 2:
  4833. - qn[n] = 0;
  4834. - break;
  4835. - default:
  4836. - qn[n] += 4;
  4837. - break;
  4838. - }
  4839. - }
  4840. - }
  4841. - }
  4842. - }
  4843. -}
  4844. -
  4845. -/**
  4846. - * \brief reorder LSF coefficients to minimum distance.
  4847. - * \param lsf pointer to buffer containing LSF coefficients and where reordered
  4848. - * LSF coefficients will be stored into, scaled by LSF_SCALE.
  4849. - * \param min_dist min distance scaled by LSF_SCALE
  4850. - * \param n number of LSF/LSP coefficients.
  4851. - */
  4852. -static void reorder_lsf(FIXP_LPC *lsf, FIXP_LPC min_dist, int n) {
  4853. - FIXP_LPC lsf_min;
  4854. - int i;
  4855. -
  4856. - lsf_min = min_dist;
  4857. - for (i = 0; i < n; i++) {
  4858. - if (lsf[i] < lsf_min) {
  4859. - lsf[i] = lsf_min;
  4860. - }
  4861. - lsf_min = fAddSaturate(lsf[i], min_dist);
  4862. - }
  4863. -
  4864. - /* reverse */
  4865. - lsf_min = FL2FXCONST_LPC(FREQ_MAX / (1 << LSF_SCALE)) - min_dist;
  4866. - for (i = n - 1; i >= 0; i--) {
  4867. - if (lsf[i] > lsf_min) {
  4868. - lsf[i] = lsf_min;
  4869. - }
  4870. -
  4871. - lsf_min = lsf[i] - min_dist;
  4872. - }
  4873. -}
  4874. -
  4875. -/**
  4876. - * \brief First stage approximation
  4877. - * \param hBs bitstream handle as data source
  4878. - * \param lsfq pointer to output buffer to hold LPC coefficients scaled by
  4879. - * LSF_SCALE.
  4880. - */
  4881. -static void vlpc_1st_dec(
  4882. - HANDLE_FDK_BITSTREAM hBs, /* input: codebook index */
  4883. - FIXP_LPC *lsfq /* i/o: i:prediction o:quantized lsf */
  4884. -) {
  4885. - const FIXP_LPC *p_dico;
  4886. - int i, index;
  4887. -
  4888. - index = FDKreadBits(hBs, 8);
  4889. - p_dico = &fdk_dec_dico_lsf_abs_8b[index * M_LP_FILTER_ORDER];
  4890. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  4891. - lsfq[i] = p_dico[i];
  4892. - }
  4893. -}
  4894. -
  4895. -/**
  4896. - * \brief Do first stage approximation weighting and multiply with AVQ
  4897. - * refinement.
  4898. - * \param hBs bitstream handle data ssource.
  4899. - * \param lsfq buffer holding 1st stage approx, 2nd stage approx is added to
  4900. - * this values.
  4901. - * \param nk_mode quantization mode.
  4902. - * \return 0 on success, -1 on error.
  4903. - */
  4904. -static int vlpc_2st_dec(
  4905. - HANDLE_FDK_BITSTREAM hBs,
  4906. - FIXP_LPC *lsfq, /* i/o: i:1st stage o:1st+2nd stage */
  4907. - int nk_mode /* input: 0=abs, >0=rel */
  4908. -) {
  4909. - int err;
  4910. - FIXP_DBL xq[M_LP_FILTER_ORDER]; /* weighted residual LSF vector */
  4911. -
  4912. - /* Decode AVQ refinement */
  4913. - { err = CLpc_DecodeAVQ(hBs, xq, nk_mode, 2, 8); }
  4914. - if (err != 0) {
  4915. - return -1;
  4916. - }
  4917. -
  4918. - /* add non-weighted residual LSF vector to LSF1st */
  4919. - lsf_weight_2st(lsfq, xq, nk_mode);
  4920. -
  4921. - /* reorder */
  4922. - reorder_lsf(lsfq, FL2FXCONST_LPC(LSF_GAP / (1 << LSF_SCALE)),
  4923. - M_LP_FILTER_ORDER);
  4924. -
  4925. - return 0;
  4926. -}
  4927. -
  4928. -/*
  4929. - * Externally visible functions
  4930. - */
  4931. -
  4932. -int CLpc_DecodeAVQ(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *pOutput, int nk_mode,
  4933. - int no_qn, int length) {
  4934. - int i, l;
  4935. -
  4936. - for (i = 0; i < length; i += 8 * no_qn) {
  4937. - int qn[2], nk, n, I;
  4938. - int kv[8] = {0};
  4939. -
  4940. - decode_qn(hBs, nk_mode, no_qn, qn);
  4941. -
  4942. - for (l = 0; l < no_qn; l++) {
  4943. - if (qn[l] == 0) {
  4944. - FDKmemclear(&pOutput[i + l * 8], 8 * sizeof(FIXP_DBL));
  4945. - }
  4946. -
  4947. - /* Voronoi extension order ( nk ) */
  4948. - nk = 0;
  4949. - n = qn[l];
  4950. - if (qn[l] > 4) {
  4951. - nk = (qn[l] - 3) >> 1;
  4952. - n = qn[l] - nk * 2;
  4953. - }
  4954. -
  4955. - /* Base codebook index, in reverse bit group order (!) */
  4956. - I = FDKreadBits(hBs, 4 * n);
  4957. -
  4958. - if (nk > 0) {
  4959. - int j;
  4960. -
  4961. - for (j = 0; j < 8; j++) {
  4962. - kv[j] = FDKreadBits(hBs, nk);
  4963. - }
  4964. - }
  4965. -
  4966. - if (RE8_dec(qn[l], I, kv, &pOutput[i + l * 8]) != 0) {
  4967. - return -1;
  4968. - }
  4969. - }
  4970. - }
  4971. - return 0;
  4972. -}
  4973. -
  4974. -int CLpc_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  4975. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  4976. - FIXP_LPC lsf_adaptive_mean_cand[M_LP_FILTER_ORDER],
  4977. - FIXP_SGL pStability[], UCHAR *mod, int first_lpd_flag,
  4978. - int last_lpc_lost, int last_frame_ok) {
  4979. - int i, k, err;
  4980. - int mode_lpc_bin = 0; /* mode_lpc bitstream representation */
  4981. - int lpc_present[5] = {0, 0, 0, 0, 0};
  4982. - int lpc0_available = 1;
  4983. - int s = 0;
  4984. - int l = 3;
  4985. - const int nbDiv = NB_DIV;
  4986. -
  4987. - lpc_present[4 >> s] = 1; /* LPC4 */
  4988. -
  4989. - /* Decode LPC filters in the following order: LPC 4,0,2,1,3 */
  4990. -
  4991. - /*** Decode LPC4 ***/
  4992. - vlpc_1st_dec(hBs, lsp[4 >> s]);
  4993. - err = vlpc_2st_dec(hBs, lsp[4 >> s], 0); /* nk_mode = 0 */
  4994. - if (err != 0) {
  4995. - return err;
  4996. - }
  4997. -
  4998. - /*** Decode LPC0 and LPC2 ***/
  4999. - k = 0;
  5000. - if (!first_lpd_flag) {
  5001. - lpc_present[0] = 1;
  5002. - lpc0_available = !last_lpc_lost;
  5003. - /* old LPC4 is new LPC0 */
  5004. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5005. - lsp[0][i] = lpc4_lsf[i];
  5006. - }
  5007. - /* skip LPC0 and continue with LPC2 */
  5008. - k = 2;
  5009. - }
  5010. -
  5011. - for (; k < l; k += 2) {
  5012. - int nk_mode = 0;
  5013. -
  5014. - if ((k == 2) && (mod[0] == 3)) {
  5015. - break; /* skip LPC2 */
  5016. - }
  5017. -
  5018. - lpc_present[k >> s] = 1;
  5019. -
  5020. - mode_lpc_bin = FDKreadBit(hBs);
  5021. -
  5022. - if (mode_lpc_bin == 0) {
  5023. - /* LPC0/LPC2: Abs */
  5024. - vlpc_1st_dec(hBs, lsp[k >> s]);
  5025. - } else {
  5026. - /* LPC0/LPC2: RelR */
  5027. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5028. - lsp[k >> s][i] = lsp[4 >> s][i];
  5029. - }
  5030. - nk_mode = 3;
  5031. - }
  5032. -
  5033. - err = vlpc_2st_dec(hBs, lsp[k >> s], nk_mode);
  5034. - if (err != 0) {
  5035. - return err;
  5036. - }
  5037. - }
  5038. -
  5039. - /*** Decode LPC1 ***/
  5040. - if (mod[0] < 2) { /* else: skip LPC1 */
  5041. - lpc_present[1] = 1;
  5042. - mode_lpc_bin = get_vlclbf_n(hBs, 2);
  5043. -
  5044. - switch (mode_lpc_bin) {
  5045. - case 1:
  5046. - /* LPC1: abs */
  5047. - vlpc_1st_dec(hBs, lsp[1]);
  5048. - err = vlpc_2st_dec(hBs, lsp[1], 0);
  5049. - if (err != 0) {
  5050. - return err;
  5051. - }
  5052. - break;
  5053. - case 2:
  5054. - /* LPC1: mid0 (no second stage AVQ quantizer in this case) */
  5055. - if (lpc0_available) { /* LPC0/lsf[0] might be zero some times */
  5056. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5057. - lsp[1][i] = (lsp[0][i] >> 1) + (lsp[2][i] >> 1);
  5058. - }
  5059. - } else {
  5060. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5061. - lsp[1][i] = lsp[2][i];
  5062. - }
  5063. - }
  5064. - break;
  5065. - case 0:
  5066. - /* LPC1: RelR */
  5067. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5068. - lsp[1][i] = lsp[2][i];
  5069. - }
  5070. - err = vlpc_2st_dec(hBs, lsp[1], 2 << s);
  5071. - if (err != 0) {
  5072. - return err;
  5073. - }
  5074. - break;
  5075. - }
  5076. - }
  5077. -
  5078. - /*** Decode LPC3 ***/
  5079. - if ((mod[2] < 2)) { /* else: skip LPC3 */
  5080. - int nk_mode = 0;
  5081. - lpc_present[3] = 1;
  5082. -
  5083. - mode_lpc_bin = get_vlclbf_n(hBs, 3);
  5084. -
  5085. - switch (mode_lpc_bin) {
  5086. - case 1:
  5087. - /* LPC3: abs */
  5088. - vlpc_1st_dec(hBs, lsp[3]);
  5089. - break;
  5090. - case 0:
  5091. - /* LPC3: mid */
  5092. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5093. - lsp[3][i] = (lsp[2][i] >> 1) + (lsp[4][i] >> 1);
  5094. - }
  5095. - nk_mode = 1;
  5096. - break;
  5097. - case 2:
  5098. - /* LPC3: relL */
  5099. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5100. - lsp[3][i] = lsp[2][i];
  5101. - }
  5102. - nk_mode = 2;
  5103. - break;
  5104. - case 3:
  5105. - /* LPC3: relR */
  5106. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5107. - lsp[3][i] = lsp[4][i];
  5108. - }
  5109. - nk_mode = 2;
  5110. - break;
  5111. - }
  5112. - err = vlpc_2st_dec(hBs, lsp[3], nk_mode);
  5113. - if (err != 0) {
  5114. - return err;
  5115. - }
  5116. - }
  5117. -
  5118. - if (!lpc0_available && !last_frame_ok) {
  5119. - /* LPC(0) was lost. Use next available LPC(k) instead */
  5120. - for (k = 1; k < (nbDiv + 1); k++) {
  5121. - if (lpc_present[k]) {
  5122. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5123. -#define LSF_INIT_TILT (0.25f)
  5124. - if (mod[0] > 0) {
  5125. - lsp[0][i] = FX_DBL2FX_LPC(
  5126. - fMult(lsp[k][i], FL2FXCONST_SGL(1.0f - LSF_INIT_TILT)) +
  5127. - fMult(fdk_dec_lsf_init[i], FL2FXCONST_SGL(LSF_INIT_TILT)));
  5128. - } else {
  5129. - lsp[0][i] = lsp[k][i];
  5130. - }
  5131. - }
  5132. - break;
  5133. - }
  5134. - }
  5135. - }
  5136. -
  5137. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5138. - lpc4_lsf[i] = lsp[4 >> s][i];
  5139. - }
  5140. -
  5141. - {
  5142. - FIXP_DBL divFac;
  5143. - int last, numLpc = 0;
  5144. -
  5145. - i = nbDiv;
  5146. - do {
  5147. - numLpc += lpc_present[i--];
  5148. - } while (i >= 0 && numLpc < 3);
  5149. -
  5150. - last = i;
  5151. -
  5152. - switch (numLpc) {
  5153. - case 3:
  5154. - divFac = FL2FXCONST_DBL(1.0f / 3.0f);
  5155. - break;
  5156. - case 2:
  5157. - divFac = FL2FXCONST_DBL(1.0f / 2.0f);
  5158. - break;
  5159. - default:
  5160. - divFac = FL2FXCONST_DBL(1.0f);
  5161. - break;
  5162. - }
  5163. -
  5164. - /* get the adaptive mean for the next (bad) frame */
  5165. - for (k = 0; k < M_LP_FILTER_ORDER; k++) {
  5166. - FIXP_DBL tmp = (FIXP_DBL)0;
  5167. - for (i = nbDiv; i > last; i--) {
  5168. - if (lpc_present[i]) {
  5169. - tmp = fMultAdd(tmp >> 1, lsp[i][k], divFac);
  5170. - }
  5171. - }
  5172. - lsf_adaptive_mean_cand[k] = FX_DBL2FX_LPC(tmp);
  5173. - }
  5174. - }
  5175. -
  5176. - /* calculate stability factor Theta. Needed for ACELP decoder and concealment
  5177. - */
  5178. - {
  5179. - FIXP_LPC *lsf_prev, *lsf_curr;
  5180. - k = 0;
  5181. -
  5182. - FDK_ASSERT(lpc_present[0] == 1 && lpc_present[4 >> s] == 1);
  5183. - lsf_prev = lsp[0];
  5184. - for (i = 1; i < (nbDiv + 1); i++) {
  5185. - if (lpc_present[i]) {
  5186. - FIXP_DBL tmp = (FIXP_DBL)0;
  5187. - int j;
  5188. - lsf_curr = lsp[i];
  5189. -
  5190. - /* sum = tmp * 2^(LSF_SCALE*2 + 4) */
  5191. - for (j = 0; j < M_LP_FILTER_ORDER; j++) {
  5192. - tmp += fPow2Div2((FIXP_SGL)(lsf_curr[j] - lsf_prev[j])) >> 3;
  5193. - }
  5194. -
  5195. - /* tmp = (float)(FL2FXCONST_DBL(1.25f) - fMult(tmp,
  5196. - * FL2FXCONST_DBL(1/400000.0f))); */
  5197. - tmp = FL2FXCONST_DBL(1.25f / (1 << LSF_SCALE)) -
  5198. - fMult(tmp, FL2FXCONST_DBL((1 << (LSF_SCALE + 4)) / 400000.0f));
  5199. - if (tmp >= FL2FXCONST_DBL(1.0f / (1 << LSF_SCALE))) {
  5200. - pStability[k] = FL2FXCONST_SGL(1.0f / 2.0f);
  5201. - } else if (tmp < FL2FXCONST_DBL(0.0f)) {
  5202. - pStability[k] = FL2FXCONST_SGL(0.0f);
  5203. - } else {
  5204. - pStability[k] = FX_DBL2FX_SGL(tmp << (LSF_SCALE - 1));
  5205. - }
  5206. -
  5207. - lsf_prev = lsf_curr;
  5208. - k = i;
  5209. - } else {
  5210. - /* Mark stability value as undefined. */
  5211. - pStability[i] = (FIXP_SGL)-1;
  5212. - }
  5213. - }
  5214. - }
  5215. -
  5216. - /* convert into LSP domain */
  5217. - for (i = 0; i < (nbDiv + 1); i++) {
  5218. - if (lpc_present[i]) {
  5219. - for (k = 0; k < M_LP_FILTER_ORDER; k++) {
  5220. - lsp[i][k] = FX_DBL2FX_LPC(
  5221. - fixp_cos(fMult(lsp[i][k],
  5222. - FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  5223. - LSF_SCALE - LSPARG_SCALE));
  5224. - }
  5225. - }
  5226. - }
  5227. -
  5228. - return 0;
  5229. -}
  5230. -
  5231. -void CLpc_Conceal(FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5232. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5233. - FIXP_LPC lsf_adaptive_mean[M_LP_FILTER_ORDER],
  5234. - const int first_lpd_flag) {
  5235. - int i, j;
  5236. -
  5237. -#define BETA (FL2FXCONST_SGL(0.25f))
  5238. -#define ONE_BETA (FL2FXCONST_SGL(0.75f))
  5239. -#define BFI_FAC (FL2FXCONST_SGL(0.90f))
  5240. -#define ONE_BFI_FAC (FL2FXCONST_SGL(0.10f))
  5241. -
  5242. - /* Frame loss concealment (could be improved) */
  5243. -
  5244. - if (first_lpd_flag) {
  5245. - /* Reset past LSF values */
  5246. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5247. - lsp[0][i] = lpc4_lsf[i] = fdk_dec_lsf_init[i];
  5248. - }
  5249. - } else {
  5250. - /* old LPC4 is new LPC0 */
  5251. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5252. - lsp[0][i] = lpc4_lsf[i];
  5253. - }
  5254. - }
  5255. -
  5256. - /* LPC1 */
  5257. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5258. - FIXP_LPC lsf_mean = FX_DBL2FX_LPC(fMult(BETA, fdk_dec_lsf_init[i]) +
  5259. - fMult(ONE_BETA, lsf_adaptive_mean[i]));
  5260. -
  5261. - lsp[1][i] = FX_DBL2FX_LPC(fMult(BFI_FAC, lpc4_lsf[i]) +
  5262. - fMult(ONE_BFI_FAC, lsf_mean));
  5263. - }
  5264. -
  5265. - /* LPC2 - LPC4 */
  5266. - for (j = 2; j <= 4; j++) {
  5267. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5268. - /* lsf_mean[i] = FX_DBL2FX_LPC(fMult((FIXP_LPC)(BETA + j *
  5269. - FL2FXCONST_LPC(0.1f)), fdk_dec_lsf_init[i])
  5270. - + fMult((FIXP_LPC)(ONE_BETA - j *
  5271. - FL2FXCONST_LPC(0.1f)), lsf_adaptive_mean[i])); */
  5272. -
  5273. - FIXP_LPC lsf_mean = FX_DBL2FX_LPC(
  5274. - fMult((FIXP_SGL)(BETA + (FIXP_SGL)(j * (INT)FL2FXCONST_SGL(0.1f))),
  5275. - (FIXP_SGL)fdk_dec_lsf_init[i]) +
  5276. - fMult(
  5277. - (FIXP_SGL)(ONE_BETA - (FIXP_SGL)(j * (INT)FL2FXCONST_SGL(0.1f))),
  5278. - lsf_adaptive_mean[i]));
  5279. -
  5280. - lsp[j][i] = FX_DBL2FX_LPC(fMult(BFI_FAC, lsp[j - 1][i]) +
  5281. - fMult(ONE_BFI_FAC, lsf_mean));
  5282. - }
  5283. - }
  5284. -
  5285. - /* Update past values for the future */
  5286. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5287. - lpc4_lsf[i] = lsp[4][i];
  5288. - }
  5289. -
  5290. - /* convert into LSP domain */
  5291. - for (j = 0; j < 5; j++) {
  5292. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5293. - lsp[j][i] = FX_DBL2FX_LPC(fixp_cos(
  5294. - fMult(lsp[j][i], FL2FXCONST_SGL((1 << LSPARG_SCALE) * M_PI / 6400.0)),
  5295. - LSF_SCALE - LSPARG_SCALE));
  5296. - }
  5297. - }
  5298. -}
  5299. -
  5300. -void E_LPC_a_weight(FIXP_LPC *wA, const FIXP_LPC *A, int m) {
  5301. - FIXP_DBL f;
  5302. - int i;
  5303. -
  5304. - f = FL2FXCONST_DBL(0.92f);
  5305. - for (i = 0; i < m; i++) {
  5306. - wA[i] = FX_DBL2FX_LPC(fMult(A[i], f));
  5307. - f = fMult(f, FL2FXCONST_DBL(0.92f));
  5308. - }
  5309. -}
  5310. -
  5311. -void CLpd_DecodeGain(FIXP_DBL *gain, INT *gain_e, int gain_code) {
  5312. - /* gain * 2^(gain_e) = 10^(gain_code/28) */
  5313. - *gain = fLdPow(
  5314. - FL2FXCONST_DBL(3.3219280948873623478703194294894 / 4.0), /* log2(10)*/
  5315. - 2,
  5316. - fMultDiv2((FIXP_DBL)gain_code << (DFRACT_BITS - 1 - 7),
  5317. - FL2FXCONST_DBL(2.0f / 28.0f)),
  5318. - 7, gain_e);
  5319. -}
  5320. -
  5321. - /**
  5322. - * \brief * Find the polynomial F1(z) or F2(z) from the LSPs.
  5323. - * This is performed by expanding the product polynomials:
  5324. - *
  5325. - * F1(z) = product ( 1 - 2 LSP_i z^-1 + z^-2 )
  5326. - * i=0,2,4,6,8
  5327. - * F2(z) = product ( 1 - 2 LSP_i z^-1 + z^-2 )
  5328. - * i=1,3,5,7,9
  5329. - *
  5330. - * where LSP_i are the LSPs in the cosine domain.
  5331. - * R.A.Salami October 1990
  5332. - * \param lsp input, line spectral freq. (cosine domain)
  5333. - * \param f output, the coefficients of F1 or F2, scaled by 8 bits
  5334. - * \param n no of coefficients (m/2)
  5335. - * \param flag 1 : F1(z) ; 2 : F2(z)
  5336. - */
  5337. -
  5338. -#define SF_F 8
  5339. -
  5340. -static void get_lsppol(FIXP_LPC lsp[], FIXP_DBL f[], int n, int flag) {
  5341. - FIXP_DBL b;
  5342. - FIXP_LPC *plsp;
  5343. - int i, j;
  5344. -
  5345. - plsp = lsp + flag - 1;
  5346. - f[0] = FL2FXCONST_DBL(1.0f / (1 << SF_F));
  5347. - b = -FX_LPC2FX_DBL(*plsp);
  5348. - f[1] = b >> (SF_F - 1);
  5349. - for (i = 2; i <= n; i++) {
  5350. - plsp += 2;
  5351. - b = -FX_LPC2FX_DBL(*plsp);
  5352. - f[i] = ((fMultDiv2(b, f[i - 1]) << 1) + (f[i - 2])) << 1;
  5353. - for (j = i - 1; j > 1; j--) {
  5354. - f[j] = f[j] + (fMultDiv2(b, f[j - 1]) << 2) + f[j - 2];
  5355. - }
  5356. - f[1] = f[1] + (b >> (SF_F - 1));
  5357. - }
  5358. - return;
  5359. -}
  5360. -
  5361. -#define NC M_LP_FILTER_ORDER / 2
  5362. -
  5363. -/**
  5364. - * \brief lsp input LSP vector
  5365. - * \brief a output LP filter coefficient vector scaled by SF_A_COEFFS.
  5366. - */
  5367. -void E_LPC_f_lsp_a_conversion(FIXP_LPC *lsp, FIXP_LPC *a, INT *a_exp) {
  5368. - FIXP_DBL f1[NC + 1], f2[NC + 1];
  5369. - int i, k;
  5370. -
  5371. - /*-----------------------------------------------------*
  5372. - * Find the polynomials F1(z) and F2(z) *
  5373. - *-----------------------------------------------------*/
  5374. -
  5375. - get_lsppol(lsp, f1, NC, 1);
  5376. - get_lsppol(lsp, f2, NC, 2);
  5377. -
  5378. - /*-----------------------------------------------------*
  5379. - * Multiply F1(z) by (1+z^-1) and F2(z) by (1-z^-1) *
  5380. - *-----------------------------------------------------*/
  5381. - for (i = NC; i > 0; i--) {
  5382. - f1[i] += f1[i - 1];
  5383. - f2[i] -= f2[i - 1];
  5384. - }
  5385. -
  5386. - FIXP_DBL aDBL[M_LP_FILTER_ORDER];
  5387. -
  5388. - for (i = 1, k = M_LP_FILTER_ORDER - 1; i <= NC; i++, k--) {
  5389. - FIXP_DBL tmp1, tmp2;
  5390. -
  5391. - tmp1 = f1[i] >> 1;
  5392. - tmp2 = f2[i] >> 1;
  5393. -
  5394. - aDBL[i - 1] = (tmp1 + tmp2);
  5395. - aDBL[k] = (tmp1 - tmp2);
  5396. - }
  5397. -
  5398. - int headroom_a = getScalefactor(aDBL, M_LP_FILTER_ORDER);
  5399. -
  5400. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  5401. - a[i] = FX_DBL2FX_LPC(aDBL[i] << headroom_a);
  5402. - }
  5403. -
  5404. - *a_exp = 8 - headroom_a;
  5405. -}
  5406. --- a/libAACdec/src/usacdec_lpc.h
  5407. +++ /dev/null
  5408. @@ -1,190 +0,0 @@
  5409. -/* -----------------------------------------------------------------------------
  5410. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  5411. -
  5412. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  5413. -Forschung e.V. All rights reserved.
  5414. -
  5415. - 1. INTRODUCTION
  5416. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  5417. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  5418. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  5419. -a wide variety of Android devices.
  5420. -
  5421. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  5422. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  5423. -full-bandwidth communications codec by independent studies and is widely
  5424. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  5425. -specifications.
  5426. -
  5427. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  5428. -those of Fraunhofer) may be obtained through Via Licensing
  5429. -(www.vialicensing.com) or through the respective patent owners individually for
  5430. -the purpose of encoding or decoding bit streams in products that are compliant
  5431. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  5432. -Android devices already license these patent claims through Via Licensing or
  5433. -directly from the patent owners, and therefore FDK AAC Codec software may
  5434. -already be covered under those patent licenses when it is used for those
  5435. -licensed purposes only.
  5436. -
  5437. -Commercially-licensed AAC software libraries, including floating-point versions
  5438. -with enhanced sound quality, are also available from Fraunhofer. Users are
  5439. -encouraged to check the Fraunhofer website for additional applications
  5440. -information and documentation.
  5441. -
  5442. -2. COPYRIGHT LICENSE
  5443. -
  5444. -Redistribution and use in source and binary forms, with or without modification,
  5445. -are permitted without payment of copyright license fees provided that you
  5446. -satisfy the following conditions:
  5447. -
  5448. -You must retain the complete text of this software license in redistributions of
  5449. -the FDK AAC Codec or your modifications thereto in source code form.
  5450. -
  5451. -You must retain the complete text of this software license in the documentation
  5452. -and/or other materials provided with redistributions of the FDK AAC Codec or
  5453. -your modifications thereto in binary form. You must make available free of
  5454. -charge copies of the complete source code of the FDK AAC Codec and your
  5455. -modifications thereto to recipients of copies in binary form.
  5456. -
  5457. -The name of Fraunhofer may not be used to endorse or promote products derived
  5458. -from this library without prior written permission.
  5459. -
  5460. -You may not charge copyright license fees for anyone to use, copy or distribute
  5461. -the FDK AAC Codec software or your modifications thereto.
  5462. -
  5463. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  5464. -that you changed the software and the date of any change. For modified versions
  5465. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  5466. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  5467. -AAC Codec Library for Android."
  5468. -
  5469. -3. NO PATENT LICENSE
  5470. -
  5471. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  5472. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  5473. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  5474. -software.
  5475. -
  5476. -You may use this FDK AAC Codec software or modifications thereto only for
  5477. -purposes that are authorized by appropriate patent licenses.
  5478. -
  5479. -4. DISCLAIMER
  5480. -
  5481. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  5482. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  5483. -including but not limited to the implied warranties of merchantability and
  5484. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  5485. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  5486. -or consequential damages, including but not limited to procurement of substitute
  5487. -goods or services; loss of use, data, or profits, or business interruption,
  5488. -however caused and on any theory of liability, whether in contract, strict
  5489. -liability, or tort (including negligence), arising in any way out of the use of
  5490. -this software, even if advised of the possibility of such damage.
  5491. -
  5492. -5. CONTACT INFORMATION
  5493. -
  5494. -Fraunhofer Institute for Integrated Circuits IIS
  5495. -Attention: Audio and Multimedia Departments - FDK AAC LL
  5496. -Am Wolfsmantel 33
  5497. -91058 Erlangen, Germany
  5498. -
  5499. -www.iis.fraunhofer.de/amm
  5500. -amm-info@iis.fraunhofer.de
  5501. ------------------------------------------------------------------------------ */
  5502. -
  5503. -/**************************** AAC decoder library ******************************
  5504. -
  5505. - Author(s): Matthias Hildenbrand, Manuel Jander
  5506. -
  5507. - Description: USAC LPC/AVQ decode
  5508. -
  5509. -*******************************************************************************/
  5510. -
  5511. -#ifndef USACDEC_LPC_H
  5512. -#define USACDEC_LPC_H
  5513. -
  5514. -#include "channelinfo.h"
  5515. -#include "common_fix.h"
  5516. -#include "FDK_bitstream.h"
  5517. -#include "usacdec_rom.h"
  5518. -
  5519. -#define LSPARG_SCALE 10
  5520. -
  5521. -/**
  5522. - * \brief AVQ (refinement) decode
  5523. - * \param hBs bitstream handle
  5524. - * \param lsfq buffer for AVQ decode output.
  5525. - * \param nk_mode quantization mode.
  5526. - * \param nqn amount of split/interleaved RE8 vectors.
  5527. - * \param total amount of individual data values to decode.
  5528. - * \return 0 on success, -1 on error.
  5529. - */
  5530. -int CLpc_DecodeAVQ(HANDLE_FDK_BITSTREAM hBs, FIXP_DBL *lsfq, int nk_mode,
  5531. - int nqn, int length);
  5532. -
  5533. -/**
  5534. - * \brief Read and decode LPC coeficient sets. First stage approximation + AVQ
  5535. - * decode.
  5536. - * \param[in] hBs bitstream handle to read data from.
  5537. - * \param[out] lsp buffer into which the decoded LSP coefficients will be stored
  5538. - * into.
  5539. - * \param[in,out] lpc4_lsf buffer into which the decoded LCP4 LSF coefficients
  5540. - * will be stored into (persistent).
  5541. - * \param[out] lsf_adaptive_mean_cand lsf adaptive mean vector needed for
  5542. - * concealment.
  5543. - * \param[out] pStability array with stability values for the ACELP decoder (and
  5544. - * concealment).
  5545. - * \param[in] mod array which defines modes (ACELP, TCX20|40|80) are used in
  5546. - * the current superframe.
  5547. - * \param[in] first_lpd_flag indicates the presence of LPC0
  5548. - * \param[in] last_lpc_lost indicate that LPC4 of previous frame was lost.
  5549. - * \param[in] last_frame_ok indicate that the last frame was ok.
  5550. - * \return 0 on success, -1 on error.
  5551. - */
  5552. -int CLpc_Read(HANDLE_FDK_BITSTREAM hBs, FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5553. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5554. - FIXP_LPC lsf_adaptive_mean_cand[M_LP_FILTER_ORDER],
  5555. - FIXP_SGL pStability[], UCHAR *mod, int first_lpd_flag,
  5556. - int last_lpc_lost, int last_frame_ok);
  5557. -
  5558. -/**
  5559. - * \brief Generate LPC coefficient sets in case frame loss.
  5560. - * \param lsp buffer into which the decoded LSP coefficients will be stored
  5561. - * into.
  5562. - * \param lpc4_lsf buffer into which the decoded LCP4 LSF coefficients will be
  5563. - * stored into (persistent).
  5564. - * \param isf_adaptive_mean
  5565. - * \param first_lpd_flag indicates the previous LSF4 coefficients lpc4_lsf[] are
  5566. - * not valid.
  5567. - */
  5568. -void CLpc_Conceal(FIXP_LPC lsp[][M_LP_FILTER_ORDER],
  5569. - FIXP_LPC lpc4_lsf[M_LP_FILTER_ORDER],
  5570. - FIXP_LPC isf_adaptive_mean[M_LP_FILTER_ORDER],
  5571. - const int first_lpd_flag);
  5572. -
  5573. -/**
  5574. - * \brief apply absolute weighting
  5575. - * \param A weighted LPC coefficient vector output. The first coeffcient is
  5576. - * implicitly 1.0
  5577. - * \param A LPC coefficient vector. The first coeffcient is implicitly 1.0
  5578. - * \param m length of vector A
  5579. - */
  5580. -/* static */
  5581. -void E_LPC_a_weight(FIXP_LPC *wA, const FIXP_LPC *A, const int m);
  5582. -
  5583. -/**
  5584. - * \brief decode TCX/FAC gain. In case of TCX the lg/sqrt(rms) part
  5585. - * must still be applied to obtain the gain value.
  5586. - * \param gain (o) pointer were the gain mantissa is stored into.
  5587. - * \param gain_e (o) pointer were the gain exponent is stored into.
  5588. - * \param gain_code (i) the 7 bit binary word from the bitstream
  5589. - * representing the gain.
  5590. - */
  5591. -void CLpd_DecodeGain(FIXP_DBL *gain, INT *gain_e, int gain_code);
  5592. -
  5593. -/**
  5594. - * \brief convert LSP coefficients into LP domain.
  5595. - */
  5596. -void E_LPC_f_lsp_a_conversion(FIXP_LPC *lsp, FIXP_LPC *a, INT *a_exp);
  5597. -
  5598. -#endif /* USACDEC_LPC_H */
  5599. --- a/libAACdec/src/usacdec_lpd.cpp
  5600. +++ /dev/null
  5601. @@ -1,2017 +0,0 @@
  5602. -/* -----------------------------------------------------------------------------
  5603. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  5604. -
  5605. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  5606. -Forschung e.V. All rights reserved.
  5607. -
  5608. - 1. INTRODUCTION
  5609. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  5610. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  5611. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  5612. -a wide variety of Android devices.
  5613. -
  5614. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  5615. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  5616. -full-bandwidth communications codec by independent studies and is widely
  5617. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  5618. -specifications.
  5619. -
  5620. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  5621. -those of Fraunhofer) may be obtained through Via Licensing
  5622. -(www.vialicensing.com) or through the respective patent owners individually for
  5623. -the purpose of encoding or decoding bit streams in products that are compliant
  5624. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  5625. -Android devices already license these patent claims through Via Licensing or
  5626. -directly from the patent owners, and therefore FDK AAC Codec software may
  5627. -already be covered under those patent licenses when it is used for those
  5628. -licensed purposes only.
  5629. -
  5630. -Commercially-licensed AAC software libraries, including floating-point versions
  5631. -with enhanced sound quality, are also available from Fraunhofer. Users are
  5632. -encouraged to check the Fraunhofer website for additional applications
  5633. -information and documentation.
  5634. -
  5635. -2. COPYRIGHT LICENSE
  5636. -
  5637. -Redistribution and use in source and binary forms, with or without modification,
  5638. -are permitted without payment of copyright license fees provided that you
  5639. -satisfy the following conditions:
  5640. -
  5641. -You must retain the complete text of this software license in redistributions of
  5642. -the FDK AAC Codec or your modifications thereto in source code form.
  5643. -
  5644. -You must retain the complete text of this software license in the documentation
  5645. -and/or other materials provided with redistributions of the FDK AAC Codec or
  5646. -your modifications thereto in binary form. You must make available free of
  5647. -charge copies of the complete source code of the FDK AAC Codec and your
  5648. -modifications thereto to recipients of copies in binary form.
  5649. -
  5650. -The name of Fraunhofer may not be used to endorse or promote products derived
  5651. -from this library without prior written permission.
  5652. -
  5653. -You may not charge copyright license fees for anyone to use, copy or distribute
  5654. -the FDK AAC Codec software or your modifications thereto.
  5655. -
  5656. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  5657. -that you changed the software and the date of any change. For modified versions
  5658. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  5659. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  5660. -AAC Codec Library for Android."
  5661. -
  5662. -3. NO PATENT LICENSE
  5663. -
  5664. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  5665. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  5666. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  5667. -software.
  5668. -
  5669. -You may use this FDK AAC Codec software or modifications thereto only for
  5670. -purposes that are authorized by appropriate patent licenses.
  5671. -
  5672. -4. DISCLAIMER
  5673. -
  5674. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  5675. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  5676. -including but not limited to the implied warranties of merchantability and
  5677. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  5678. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  5679. -or consequential damages, including but not limited to procurement of substitute
  5680. -goods or services; loss of use, data, or profits, or business interruption,
  5681. -however caused and on any theory of liability, whether in contract, strict
  5682. -liability, or tort (including negligence), arising in any way out of the use of
  5683. -this software, even if advised of the possibility of such damage.
  5684. -
  5685. -5. CONTACT INFORMATION
  5686. -
  5687. -Fraunhofer Institute for Integrated Circuits IIS
  5688. -Attention: Audio and Multimedia Departments - FDK AAC LL
  5689. -Am Wolfsmantel 33
  5690. -91058 Erlangen, Germany
  5691. -
  5692. -www.iis.fraunhofer.de/amm
  5693. -amm-info@iis.fraunhofer.de
  5694. ------------------------------------------------------------------------------ */
  5695. -
  5696. -/**************************** AAC decoder library ******************************
  5697. -
  5698. - Author(s): Manuel Jander
  5699. -
  5700. - Description: USAC Linear Prediction Domain coding
  5701. -
  5702. -*******************************************************************************/
  5703. -
  5704. -#include "usacdec_lpd.h"
  5705. -
  5706. -#include "usacdec_rom.h"
  5707. -#include "usacdec_fac.h"
  5708. -#include "usacdec_lpc.h"
  5709. -#include "FDK_tools_rom.h"
  5710. -#include "fft.h"
  5711. -#include "mdct.h"
  5712. -#include "usacdec_acelp.h"
  5713. -#include "overlapadd.h"
  5714. -
  5715. -#include "block.h"
  5716. -
  5717. -#define SF_PITCH_TRACK 6
  5718. -#define SF_GAIN 3
  5719. -#define MIN_VAL FL2FXCONST_DBL(0.0f)
  5720. -#define MAX_VAL (FIXP_DBL) MAXVAL_DBL
  5721. -
  5722. -#include "ac_arith_coder.h"
  5723. -
  5724. -void filtLP(const FIXP_DBL *syn, FIXP_PCM *syn_out, FIXP_DBL *noise,
  5725. - const FIXP_SGL *filt, INT stop, int len) {
  5726. - INT i, j;
  5727. - FIXP_DBL tmp;
  5728. -
  5729. - for (i = 0; i < stop; i++) {
  5730. - tmp = fMultDiv2(noise[i], filt[0]); // Filt in Q-1.16
  5731. - for (j = 1; j <= len; j++) {
  5732. - tmp += fMultDiv2((noise[i - j] + noise[i + j]), filt[j]);
  5733. - }
  5734. - syn_out[i] = (FIXP_PCM)(IMDCT_SCALE(syn[i] - tmp));
  5735. - }
  5736. -}
  5737. -
  5738. -void bass_pf_1sf_delay(
  5739. - FIXP_DBL *syn, /* (i) : 12.8kHz synthesis to postfilter */
  5740. - const INT *T_sf, /* (i) : Pitch period for all subframes (T_sf[16]) */
  5741. - FIXP_DBL *pit_gain,
  5742. - const int frame_length, /* (i) : frame length (should be 768|1024) */
  5743. - const INT l_frame,
  5744. - const INT l_next, /* (i) : look ahead for symmetric filtering */
  5745. - FIXP_PCM *synth_out, /* (o) : filtered synthesis (with delay of 1 subfr) */
  5746. - FIXP_DBL mem_bpf[]) /* i/o : memory state [L_FILT+L_SUBFR] */
  5747. -{
  5748. - INT i, sf, i_subfr, T, T2, lg;
  5749. -
  5750. - FIXP_DBL tmp, ener, corr, gain;
  5751. - FIXP_DBL *noise, *noise_in;
  5752. - FIXP_DBL
  5753. - noise_buf[L_FILT + (2 * L_SUBFR)]; // L_FILT = 12, L_SUBFR = 64 => 140
  5754. - const FIXP_DBL *x, *y;
  5755. -
  5756. - {
  5757. - noise = noise_buf + L_FILT; // L_FILT = 12 delay of upsampling filter
  5758. - noise_in = noise_buf + L_FILT + L_SUBFR;
  5759. - /* Input scaling of the BPF memory */
  5760. - scaleValues(mem_bpf, (L_FILT + L_SUBFR), 1);
  5761. - }
  5762. -
  5763. - int gain_exp = 17;
  5764. -
  5765. - sf = 0;
  5766. - for (i_subfr = 0; i_subfr < l_frame; i_subfr += L_SUBFR, sf++) {
  5767. - T = T_sf[sf];
  5768. - gain = pit_gain[sf];
  5769. -
  5770. - /* Gain is in Q17.14 */
  5771. - /* If gain > 1 set to 1 */
  5772. - if (gain > (FIXP_DBL)(1 << 14)) gain = (FIXP_DBL)(1 << 14);
  5773. -
  5774. - /* If gain < 0 set to 0 */
  5775. - if (gain < (FIXP_DBL)0) gain = (FIXP_DBL)0;
  5776. -
  5777. - if (gain > (FIXP_DBL)0) {
  5778. - /* pitch tracker: test pitch/2 to avoid continuous pitch doubling */
  5779. - /* Note: pitch is limited to PIT_MIN (34 = 376Hz) at the encoder */
  5780. - T2 = T >> 1;
  5781. - x = &syn[i_subfr - L_EXTRA];
  5782. - y = &syn[i_subfr - T2 - L_EXTRA];
  5783. -
  5784. - ener = (FIXP_DBL)0;
  5785. - corr = (FIXP_DBL)0;
  5786. - tmp = (FIXP_DBL)0;
  5787. -
  5788. - int headroom_x = getScalefactor(x, L_SUBFR + L_EXTRA);
  5789. - int headroom_y = getScalefactor(y, L_SUBFR + L_EXTRA);
  5790. -
  5791. - int width_shift = 7;
  5792. -
  5793. - for (i = 0; i < (L_SUBFR + L_EXTRA); i++) {
  5794. - ener += fPow2Div2((x[i] << headroom_x)) >> width_shift;
  5795. - corr += fMultDiv2((x[i] << headroom_x), (y[i] << headroom_y)) >>
  5796. - width_shift;
  5797. - tmp += fPow2Div2((y[i] << headroom_y)) >> width_shift;
  5798. - }
  5799. -
  5800. - int exp_ener = ((17 - headroom_x) << 1) + width_shift + 1;
  5801. - int exp_corr = (17 - headroom_x) + (17 - headroom_y) + width_shift + 1;
  5802. - int exp_tmp = ((17 - headroom_y) << 1) + width_shift + 1;
  5803. -
  5804. - /* Add 0.01 to "ener". Adjust exponents */
  5805. - FIXP_DBL point_zero_one = (FIXP_DBL)0x51eb851f; /* In Q-6.37 */
  5806. - int diff;
  5807. - ener = fAddNorm(ener, exp_ener, point_zero_one, -6, &exp_ener);
  5808. - corr = fAddNorm(corr, exp_corr, point_zero_one, -6, &exp_corr);
  5809. - tmp = fAddNorm(tmp, exp_tmp, point_zero_one, -6, &exp_tmp);
  5810. -
  5811. - /* use T2 if normalized correlation > 0.95 */
  5812. - INT s1, s2;
  5813. - s1 = CntLeadingZeros(ener) - 1;
  5814. - s2 = CntLeadingZeros(tmp) - 1;
  5815. -
  5816. - FIXP_DBL ener_by_tmp = fMultDiv2(ener << s1, tmp << s2);
  5817. - int ener_by_tmp_exp = (exp_ener - s1) + (exp_tmp - s2) + 1;
  5818. -
  5819. - if (ener_by_tmp_exp & 1) {
  5820. - ener_by_tmp <<= 1;
  5821. - ener_by_tmp_exp -= 1;
  5822. - }
  5823. -
  5824. - int temp_exp = 0;
  5825. -
  5826. - FIXP_DBL temp1 = invSqrtNorm2(ener_by_tmp, &temp_exp);
  5827. -
  5828. - int temp1_exp = temp_exp - (ener_by_tmp_exp >> 1);
  5829. -
  5830. - FIXP_DBL tmp_result = fMult(corr, temp1);
  5831. -
  5832. - int tmp_result_exp = exp_corr + temp1_exp;
  5833. -
  5834. - diff = tmp_result_exp - 0;
  5835. - FIXP_DBL point95 = FL2FXCONST_DBL(0.95f);
  5836. - if (diff >= 0) {
  5837. - diff = fMin(diff, 31);
  5838. - point95 = FL2FXCONST_DBL(0.95f) >> diff;
  5839. - } else {
  5840. - diff = fMax(diff, -31);
  5841. - tmp_result >>= (-diff);
  5842. - }
  5843. -
  5844. - if (tmp_result > point95) T = T2;
  5845. -
  5846. - /* prevent that noise calculation below reaches into not defined signal
  5847. - parts at the end of the synth_buf or in other words restrict the below
  5848. - used index (i+i_subfr+T) < l_frame + l_next
  5849. - */
  5850. - lg = l_frame + l_next - T - i_subfr;
  5851. -
  5852. - if (lg > L_SUBFR)
  5853. - lg = L_SUBFR;
  5854. - else if (lg < 0)
  5855. - lg = 0;
  5856. -
  5857. - /* limit gain to avoid problem on burst */
  5858. - if (lg > 0) {
  5859. - FIXP_DBL tmp1;
  5860. -
  5861. - /* max(lg) = 64 => scale with 6 bits minus 1 (fPow2Div2) */
  5862. -
  5863. - s1 = getScalefactor(&syn[i_subfr], lg);
  5864. - s2 = getScalefactor(&syn[i_subfr + T], lg);
  5865. - INT s = fixMin(s1, s2);
  5866. -
  5867. - tmp = (FIXP_DBL)0;
  5868. - ener = (FIXP_DBL)0;
  5869. - for (i = 0; i < lg; i++) {
  5870. - tmp += fPow2Div2(syn[i + i_subfr] << s1) >> (SF_PITCH_TRACK);
  5871. - ener += fPow2Div2(syn[i + i_subfr + T] << s2) >> (SF_PITCH_TRACK);
  5872. - }
  5873. - tmp = tmp >> fMin(DFRACT_BITS - 1, (2 * (s1 - s)));
  5874. - ener = ener >> fMin(DFRACT_BITS - 1, (2 * (s2 - s)));
  5875. -
  5876. - /* error robustness: for the specific case syn[...] == -1.0f for all 64
  5877. - samples ener or tmp might overflow and become negative. For all sane
  5878. - cases we have enough headroom.
  5879. - */
  5880. - if (ener <= (FIXP_DBL)0) {
  5881. - ener = (FIXP_DBL)1;
  5882. - }
  5883. - if (tmp <= (FIXP_DBL)0) {
  5884. - tmp = (FIXP_DBL)1;
  5885. - }
  5886. - FDK_ASSERT(ener > (FIXP_DBL)0);
  5887. -
  5888. - /* tmp = sqrt(tmp/ener) */
  5889. - int result_e = 0;
  5890. - tmp1 = fDivNorm(tmp, ener, &result_e);
  5891. - if (result_e & 1) {
  5892. - tmp1 >>= 1;
  5893. - result_e += 1;
  5894. - }
  5895. - tmp = sqrtFixp(tmp1);
  5896. - result_e >>= 1;
  5897. -
  5898. - gain_exp = 17;
  5899. -
  5900. - diff = result_e - gain_exp;
  5901. -
  5902. - FIXP_DBL gain1 = gain;
  5903. -
  5904. - if (diff >= 0) {
  5905. - diff = fMin(diff, 31);
  5906. - gain1 >>= diff;
  5907. - } else {
  5908. - result_e += (-diff);
  5909. - diff = fMax(diff, -31);
  5910. - tmp >>= (-diff);
  5911. - }
  5912. -
  5913. - if (tmp < gain1) {
  5914. - gain = tmp;
  5915. - gain_exp = result_e;
  5916. - }
  5917. - }
  5918. -
  5919. - /* calculate noise based on voiced pitch */
  5920. - /* fMultDiv2() replaces weighting of gain with 0.5 */
  5921. - diff = gain_exp - 17;
  5922. - if (diff >= 0) {
  5923. - gain <<= diff;
  5924. - } else {
  5925. - gain >>= (-diff);
  5926. - }
  5927. -
  5928. - s1 = CntLeadingZeros(gain) - 1;
  5929. - s1 -= 16; /* Leading bits for SGL */
  5930. -
  5931. - FIXP_SGL gainSGL = FX_DBL2FX_SGL(gain << 16);
  5932. -
  5933. - gainSGL = gainSGL << s1;
  5934. -
  5935. - {
  5936. - for (i = 0; i < lg; i++) {
  5937. - /* scaled with SF_SYNTH + gain_sf + 1 */
  5938. - noise_in[i] =
  5939. - (fMult(gainSGL, syn[i + i_subfr] - (syn[i + i_subfr - T] >> 1) -
  5940. - (syn[i + i_subfr + T] >> 1))) >>
  5941. - s1;
  5942. - }
  5943. -
  5944. - for (i = lg; i < L_SUBFR; i++) {
  5945. - /* scaled with SF_SYNTH + gain_sf + 1 */
  5946. - noise_in[i] =
  5947. - (fMult(gainSGL, syn[i + i_subfr] - syn[i + i_subfr - T])) >> s1;
  5948. - }
  5949. - }
  5950. - } else {
  5951. - FDKmemset(noise_in, (FIXP_DBL)0, L_SUBFR * sizeof(FIXP_DBL));
  5952. - }
  5953. -
  5954. - {
  5955. - FDKmemcpy(noise_buf, mem_bpf, (L_FILT + L_SUBFR) * sizeof(FIXP_DBL));
  5956. -
  5957. - FDKmemcpy(mem_bpf, noise_buf + L_SUBFR,
  5958. - (L_FILT + L_SUBFR) * sizeof(FIXP_DBL));
  5959. - }
  5960. -
  5961. - /* substract from voiced speech low-pass filtered noise */
  5962. - /* filter coefficients are scaled with factor SF_FILT_LP (1) */
  5963. -
  5964. - {
  5965. - filtLP(&syn[i_subfr - L_SUBFR], &synth_out[i_subfr], noise,
  5966. - fdk_dec_filt_lp, L_SUBFR, L_FILT);
  5967. - }
  5968. - }
  5969. -
  5970. - {
  5971. -
  5972. - }
  5973. -
  5974. - // To be determined (info from Ben)
  5975. - {
  5976. - /* Output scaling of the BPF memory */
  5977. - scaleValues(mem_bpf, (L_FILT + L_SUBFR), -1);
  5978. - /* Copy the rest of the signal (after the fac) */
  5979. - scaleValuesSaturate((FIXP_PCM *)&synth_out[l_frame],
  5980. - (FIXP_DBL *)&syn[l_frame - L_SUBFR],
  5981. - (frame_length - l_frame), MDCT_OUT_HEADROOM);
  5982. - }
  5983. -
  5984. - return;
  5985. -}
  5986. -
  5987. -/*
  5988. - * Frequency Domain Noise Shaping
  5989. - */
  5990. -
  5991. -/**
  5992. - * \brief Adaptive Low Frequencies Deemphasis of spectral coefficients.
  5993. - *
  5994. - * Ensure quantization of low frequencies in case where the
  5995. - * signal dynamic is higher than the LPC noise shaping.
  5996. - * This is the inverse operation of adap_low_freq_emph().
  5997. - * Output gain of all blocks.
  5998. - *
  5999. - * \param x pointer to the spectral coefficients, requires 1 bit headroom.
  6000. - * \param lg length of x.
  6001. - * \param bUseNewAlfe if set, apply ALFD for fullband lpd.
  6002. - * \param gainLpc1 pointer to gain based on old input LPC coefficients.
  6003. - * \param gainLpc2 pointer to gain based on new input LPC coefficients.
  6004. - * \param alfd_gains pointer to output gains.
  6005. - * \param s current scale shift factor of x.
  6006. - */
  6007. -#define ALFDPOW2_SCALE 3
  6008. -/*static*/
  6009. -void CLpd_AdaptLowFreqDeemph(FIXP_DBL x[], int lg, FIXP_DBL alfd_gains[],
  6010. - INT s) {
  6011. - {
  6012. - int i, j, k, i_max;
  6013. - FIXP_DBL max, fac;
  6014. - /* Note: This stack array saves temporary accumulation results to be used in
  6015. - * a second run */
  6016. - /* The size should be limited to (1024/4)/8=32 */
  6017. - FIXP_DBL tmp_pow2[32];
  6018. -
  6019. - s = s * 2 + ALFDPOW2_SCALE;
  6020. - s = fMin(31, s);
  6021. -
  6022. - k = 8;
  6023. - i_max = lg / 4; /* ALFD range = 1600Hz (lg = 6400Hz) */
  6024. -
  6025. - /* find spectral peak */
  6026. - max = FL2FX_DBL(0.01f) >> s;
  6027. - for (i = 0; i < i_max; i += k) {
  6028. - FIXP_DBL tmp;
  6029. -
  6030. - tmp = FIXP_DBL(0);
  6031. - FIXP_DBL *pX = &x[i];
  6032. -
  6033. - j = 8;
  6034. - do {
  6035. - FIXP_DBL x0 = *pX++;
  6036. - FIXP_DBL x1 = *pX++;
  6037. - x0 = fPow2Div2(x0);
  6038. - x1 = fPow2Div2(x1);
  6039. - tmp = tmp + (x0 >> (ALFDPOW2_SCALE - 1));
  6040. - tmp = tmp + (x1 >> (ALFDPOW2_SCALE - 1));
  6041. - } while ((j = j - 2) != 0);
  6042. - tmp = fMax(tmp, (FL2FX_DBL(0.01f) >> s));
  6043. - tmp_pow2[i >> 3] = tmp;
  6044. - if (tmp > max) {
  6045. - max = tmp;
  6046. - }
  6047. - }
  6048. -
  6049. - /* deemphasis of all blocks below the peak */
  6050. - fac = FL2FX_DBL(0.1f) >> 1;
  6051. - for (i = 0; i < i_max; i += k) {
  6052. - FIXP_DBL tmp;
  6053. - INT shifti;
  6054. -
  6055. - tmp = tmp_pow2[i >> 3];
  6056. -
  6057. - /* tmp = (float)sqrt(tmp/max); */
  6058. -
  6059. - /* value of tmp is between 8/2*max^2 and max^2 / 2. */
  6060. - /* required shift factor of division can grow up to 27
  6061. - (grows exponentially for values toward zero)
  6062. - thus using normalized division to assure valid result. */
  6063. - {
  6064. - INT sd;
  6065. -
  6066. - if (tmp != (FIXP_DBL)0) {
  6067. - tmp = fDivNorm(max, tmp, &sd);
  6068. - if (sd & 1) {
  6069. - sd++;
  6070. - tmp >>= 1;
  6071. - }
  6072. - } else {
  6073. - tmp = (FIXP_DBL)MAXVAL_DBL;
  6074. - sd = 0;
  6075. - }
  6076. - tmp = invSqrtNorm2(tmp, &shifti);
  6077. - tmp = scaleValue(tmp, shifti - 1 - (sd / 2));
  6078. - }
  6079. - if (tmp > fac) {
  6080. - fac = tmp;
  6081. - }
  6082. - FIXP_DBL *pX = &x[i];
  6083. -
  6084. - j = 8;
  6085. - do {
  6086. - FIXP_DBL x0 = pX[0];
  6087. - FIXP_DBL x1 = pX[1];
  6088. - x0 = fMultDiv2(x0, fac);
  6089. - x1 = fMultDiv2(x1, fac);
  6090. - x0 = x0 << 2;
  6091. - x1 = x1 << 2;
  6092. - *pX++ = x0;
  6093. - *pX++ = x1;
  6094. -
  6095. - } while ((j = j - 2) != 0);
  6096. - /* Store gains for FAC */
  6097. - *alfd_gains++ = fac;
  6098. - }
  6099. - }
  6100. -}
  6101. -
  6102. -/**
  6103. - * \brief Interpolated Noise Shaping for mdct coefficients.
  6104. - * This algorithm shapes temporally the spectral noise between
  6105. - * the two spectral noise represention (FDNS_NPTS of resolution).
  6106. - * The noise is shaped monotonically between the two points
  6107. - * using a curved shape to favor the lower gain in mid-frame.
  6108. - * ODFT and amplitud calculation are applied to the 2 LPC coefficients first.
  6109. - *
  6110. - * \param r pointer to spectrum data.
  6111. - * \param rms RMS of output spectrum.
  6112. - * \param lg length of r.
  6113. - * \param A1 pointer to old input LPC coefficients of length M_LP_FILTER_ORDER
  6114. - * scaled by SF_A_COEFFS.
  6115. - * \param A2 pointer to new input LPC coefficients of length M_LP_FILTER_ORDER
  6116. - * scaled by SF_A_COEFFS.
  6117. - * \param bLpc2Mdct flags control lpc2mdct conversion and noise shaping.
  6118. - * \param gainLpc1 pointer to gain based on old input LPC coefficients.
  6119. - * \param gainLpc2 pointer to gain based on new input LPC coefficients.
  6120. - * \param gLpc_e pointer to exponent of gainLpc1 and gainLpc2.
  6121. - */
  6122. -/* static */
  6123. -#define NSHAPE_SCALE (4)
  6124. -
  6125. -#define LPC2MDCT_CALC (1)
  6126. -#define LPC2MDCT_GAIN_LOAD (2)
  6127. -#define LPC2MDCT_GAIN_SAVE (4)
  6128. -#define LPC2MDCT_APPLY_NSHAPE (8)
  6129. -
  6130. -void lpc2mdctAndNoiseShaping(FIXP_DBL *r, SHORT *pScale, const INT lg,
  6131. - const INT fdns_npts, const FIXP_LPC *A1,
  6132. - const INT A1_exp, const FIXP_LPC *A2,
  6133. - const INT A2_exp) {
  6134. - FIXP_DBL *tmp2 = NULL;
  6135. - FIXP_DBL rr_minus_one;
  6136. - int i, k, s, step;
  6137. -
  6138. - C_AALLOC_SCRATCH_START(tmp1, FIXP_DBL, FDNS_NPTS * 8)
  6139. -
  6140. - {
  6141. - tmp2 = tmp1 + fdns_npts * 4;
  6142. -
  6143. - /* lpc2mdct() */
  6144. -
  6145. - /* ODFT. E_LPC_a_weight() for A1 and A2 vectors is included into the loop
  6146. - * below. */
  6147. - FIXP_DBL f = FL2FXCONST_DBL(0.92f);
  6148. -
  6149. - const FIXP_STP *SinTab;
  6150. - int k_step;
  6151. - /* needed values: sin(phi), cos(phi); phi = i*PI/(2*fdns_npts), i = 0 ...
  6152. - * M_LP_FILTER_ORDER */
  6153. - switch (fdns_npts) {
  6154. - case 64:
  6155. - SinTab = SineTable512;
  6156. - k_step = (512 / 64);
  6157. - FDK_ASSERT(512 >= 64);
  6158. - break;
  6159. - case 48:
  6160. - SinTab = SineTable384;
  6161. - k_step = 384 / 48;
  6162. - FDK_ASSERT(384 >= 48);
  6163. - break;
  6164. - default:
  6165. - FDK_ASSERT(0);
  6166. - return;
  6167. - }
  6168. -
  6169. - for (i = 0, k = k_step; i < M_LP_FILTER_ORDER; i++, k += k_step) {
  6170. - FIXP_STP cs = SinTab[k];
  6171. - FIXP_DBL wA1, wA2;
  6172. -
  6173. - wA1 = fMult(A1[i], f);
  6174. - wA2 = fMult(A2[i], f);
  6175. -
  6176. - /* r[i] = A[i]*cos() */
  6177. - tmp1[2 + i * 2] = fMult(wA1, cs.v.re);
  6178. - tmp2[2 + i * 2] = fMult(wA2, cs.v.re);
  6179. - /* i[i] = A[i]*sin() */
  6180. - tmp1[3 + i * 2] = -fMult(wA1, cs.v.im);
  6181. - tmp2[3 + i * 2] = -fMult(wA2, cs.v.im);
  6182. -
  6183. - f = fMult(f, FL2FXCONST_DBL(0.92f));
  6184. - }
  6185. -
  6186. - /* Guarantee at least 2 bits of headroom for the FFT */
  6187. - /* "3" stands for 1.0 with 2 bits of headroom; (A1_exp + 2) guarantess 2
  6188. - * bits of headroom if A1_exp > 1 */
  6189. - int A1_exp_fix = fMax(3, A1_exp + 2);
  6190. - int A2_exp_fix = fMax(3, A2_exp + 2);
  6191. -
  6192. - /* Set 1.0 in the proper format */
  6193. - tmp1[0] = (FIXP_DBL)(INT)((ULONG)0x80000000 >> A1_exp_fix);
  6194. - tmp2[0] = (FIXP_DBL)(INT)((ULONG)0x80000000 >> A2_exp_fix);
  6195. -
  6196. - tmp1[1] = tmp2[1] = (FIXP_DBL)0;
  6197. -
  6198. - /* Clear the resto of the array */
  6199. - FDKmemclear(
  6200. - tmp1 + 2 * (M_LP_FILTER_ORDER + 1),
  6201. - 2 * (fdns_npts * 2 - (M_LP_FILTER_ORDER + 1)) * sizeof(FIXP_DBL));
  6202. - FDKmemclear(
  6203. - tmp2 + 2 * (M_LP_FILTER_ORDER + 1),
  6204. - 2 * (fdns_npts * 2 - (M_LP_FILTER_ORDER + 1)) * sizeof(FIXP_DBL));
  6205. -
  6206. - /* Guarantee 2 bits of headroom for FFT */
  6207. - scaleValues(&tmp1[2], (2 * M_LP_FILTER_ORDER), (A1_exp - A1_exp_fix));
  6208. - scaleValues(&tmp2[2], (2 * M_LP_FILTER_ORDER), (A2_exp - A2_exp_fix));
  6209. -
  6210. - INT s2;
  6211. - s = A1_exp_fix;
  6212. - s2 = A2_exp_fix;
  6213. -
  6214. - fft(2 * fdns_npts, tmp1, &s);
  6215. - fft(2 * fdns_npts, tmp2, &s2);
  6216. -
  6217. - /* Adjust the exponents of both fft outputs if necessary*/
  6218. - if (s > s2) {
  6219. - scaleValues(tmp2, 2 * fdns_npts, s2 - s);
  6220. - s2 = s;
  6221. - } else if (s < s2) {
  6222. - scaleValues(tmp1, 2 * fdns_npts, s - s2);
  6223. - s = s2;
  6224. - }
  6225. -
  6226. - FDK_ASSERT(s == s2);
  6227. - }
  6228. -
  6229. - /* Get amplitude and apply gains */
  6230. - step = lg / fdns_npts;
  6231. - rr_minus_one = (FIXP_DBL)0;
  6232. -
  6233. - for (k = 0; k < fdns_npts; k++) {
  6234. - FIXP_DBL g1, g2, inv_g1_g2, a, b;
  6235. - INT inv_g1_g2_e;
  6236. - int g_e, shift;
  6237. -
  6238. - {
  6239. - FIXP_DBL real, imag;
  6240. - int si1, si2, sInput;
  6241. -
  6242. - real = tmp1[k * 2];
  6243. - imag = tmp1[k * 2 + 1];
  6244. - sInput = fMax(fMin(fNorm(real), fNorm(imag)) - 1, 0);
  6245. - real <<= sInput;
  6246. - imag <<= sInput;
  6247. - /* g1_e = si1 - 2*s/2 */
  6248. - g1 = invSqrtNorm2(fPow2(real) + fPow2(imag), &si1);
  6249. - si1 += sInput;
  6250. -
  6251. - real = tmp2[k * 2];
  6252. - imag = tmp2[k * 2 + 1];
  6253. - sInput = fMax(fMin(fNorm(real), fNorm(imag)) - 1, 0);
  6254. - real <<= sInput;
  6255. - imag <<= sInput;
  6256. - /* g2_e = si2 - 2*s/2 */
  6257. - g2 = invSqrtNorm2(fPow2(real) + fPow2(imag), &si2);
  6258. - si2 += sInput;
  6259. -
  6260. - /* Pick a common scale factor for g1 and g2 */
  6261. - if (si1 > si2) {
  6262. - g2 >>= si1 - si2;
  6263. - g_e = si1 - s;
  6264. - } else {
  6265. - g1 >>= si2 - si1;
  6266. - g_e = si2 - s;
  6267. - }
  6268. - }
  6269. -
  6270. - /* end of lpc2mdct() */
  6271. -
  6272. - FDK_ASSERT(g1 >= (FIXP_DBL)0);
  6273. - FDK_ASSERT(g2 >= (FIXP_DBL)0);
  6274. -
  6275. - /* mdct_IntNoiseShaping() */
  6276. - {
  6277. - /* inv_g1_g2 * 2^inv_g1_g2_e = 1/(g1+g2) */
  6278. - inv_g1_g2 = (g1 >> 1) + (g2 >> 1);
  6279. - if (inv_g1_g2 != (FIXP_DBL)0) {
  6280. - inv_g1_g2 = fDivNorm(FL2FXCONST_DBL(0.5f), inv_g1_g2, &inv_g1_g2_e);
  6281. - inv_g1_g2_e = inv_g1_g2_e - g_e;
  6282. - } else {
  6283. - inv_g1_g2 = (FIXP_DBL)MAXVAL_DBL;
  6284. - inv_g1_g2_e = 0;
  6285. - }
  6286. -
  6287. - if (g_e < 0) {
  6288. - /* a_e = g_e + inv_g1_g2_e + 1 */
  6289. - a = scaleValue(fMult(fMult(g1, g2), inv_g1_g2), g_e);
  6290. - /* b_e = g_e + inv_g1_g2_e */
  6291. - b = fMult(g2 - g1, inv_g1_g2);
  6292. - shift = g_e + inv_g1_g2_e + 1 - NSHAPE_SCALE;
  6293. - } else {
  6294. - /* a_e = (g_e+g_e) + inv_g1_g2_e + 1 */
  6295. - a = fMult(fMult(g1, g2), inv_g1_g2);
  6296. - /* b_e = (g_e+g_e) + inv_g1_g2_e */
  6297. - b = scaleValue(fMult(g2 - g1, inv_g1_g2), -g_e);
  6298. - shift = (g_e + g_e) + inv_g1_g2_e + 1 - NSHAPE_SCALE;
  6299. - }
  6300. -
  6301. - for (i = k * step; i < (k + 1) * step; i++) {
  6302. - FIXP_DBL tmp;
  6303. -
  6304. - /* rr[i] = 2*a*r[i] + b*rr[i-1] */
  6305. - tmp = fMult(a, r[i]);
  6306. - tmp += scaleValue(fMultDiv2(b, rr_minus_one), NSHAPE_SCALE);
  6307. - tmp = scaleValueSaturate(tmp, shift);
  6308. - rr_minus_one = tmp;
  6309. - r[i] = tmp;
  6310. - }
  6311. - }
  6312. - }
  6313. -
  6314. - /* end of mdct_IntNoiseShaping() */
  6315. - { *pScale += NSHAPE_SCALE; }
  6316. -
  6317. - C_AALLOC_SCRATCH_END(tmp1, FIXP_DBL, FDNS_NPTS * 8)
  6318. -}
  6319. -
  6320. -/**
  6321. - * \brief Calculates the energy.
  6322. - * \param r pointer to spectrum.
  6323. - * \param rs scale factor of spectrum r.
  6324. - * \param lg frame length in audio samples.
  6325. - * \param rms_e pointer to exponent of energy value.
  6326. - * \return mantissa of energy value.
  6327. - */
  6328. -static FIXP_DBL calcEnergy(const FIXP_DBL *r, const SHORT rs, const INT lg,
  6329. - INT *rms_e) {
  6330. - int headroom = getScalefactor(r, lg);
  6331. -
  6332. - FIXP_DBL rms_m = 0;
  6333. -
  6334. - /* Calculate number of growth bits due to addition */
  6335. - INT shift = (INT)(fNormz((FIXP_DBL)lg));
  6336. - shift = 31 - shift;
  6337. -
  6338. - /* Generate 1e-2 in Q-6.37 */
  6339. - const FIXP_DBL value0_01 = 0x51eb851e;
  6340. - const INT value0_01_exp = -6;
  6341. -
  6342. - /* Find the exponent of the resulting energy value */
  6343. - *rms_e = ((rs - headroom) << 1) + shift + 1;
  6344. -
  6345. - INT delta = *rms_e - value0_01_exp;
  6346. - if (delta > 0) {
  6347. - /* Limit shift_to 31*/
  6348. - delta = fMin(31, delta);
  6349. - rms_m = value0_01 >> delta;
  6350. - } else {
  6351. - rms_m = value0_01;
  6352. - *rms_e = value0_01_exp;
  6353. - shift = shift - delta;
  6354. - /* Limit shift_to 31*/
  6355. - shift = fMin(31, shift);
  6356. - }
  6357. -
  6358. - for (int i = 0; i < lg; i++) {
  6359. - rms_m += fPow2Div2(r[i] << headroom) >> shift;
  6360. - }
  6361. -
  6362. - return rms_m;
  6363. -}
  6364. -
  6365. -/**
  6366. - * \brief TCX gain calculation.
  6367. - * \param pAacDecoderChannelInfo channel context data.
  6368. - * \param r output spectrum.
  6369. - * \param rms_e pointer to mantissa of energy value.
  6370. - * \param rms_e pointer to exponent of energy value.
  6371. - * \param frame the frame index of the LPD super frame.
  6372. - * \param lg the frame length in audio samples.
  6373. - * \param gain_m pointer to mantissa of TCX gain.
  6374. - * \param gain_e pointer to exponent of TCX gain.
  6375. - * \param elFlags element specific parser guidance flags.
  6376. - * \param lg_fb the fullband frame length in audio samples.
  6377. - * \param IGF_bgn the IGF start index.
  6378. - */
  6379. -static void calcTCXGain(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6380. - FIXP_DBL *r, FIXP_DBL rms_m, INT rms_e, const INT frame,
  6381. - const INT lg) {
  6382. - if ((rms_m != (FIXP_DBL)0)) {
  6383. - FIXP_DBL tcx_gain_m;
  6384. - INT tcx_gain_e;
  6385. -
  6386. - CLpd_DecodeGain(&tcx_gain_m, &tcx_gain_e,
  6387. - pAacDecoderChannelInfo->pDynData->specificTo.usac
  6388. - .tcx_global_gain[frame]);
  6389. -
  6390. - /* rms * 2^rms_e = lg/sqrt(sum(spec^2)) */
  6391. - if (rms_e & 1) {
  6392. - rms_m >>= 1;
  6393. - rms_e++;
  6394. - }
  6395. -
  6396. - {
  6397. - FIXP_DBL fx_lg;
  6398. - INT fx_lg_e, s;
  6399. - INT inv_e;
  6400. -
  6401. - /* lg = fx_lg * 2^fx_lg_e */
  6402. - s = fNorm((FIXP_DBL)lg);
  6403. - fx_lg = (FIXP_DBL)lg << s;
  6404. - fx_lg_e = DFRACT_BITS - 1 - s;
  6405. - /* 1/sqrt(rms) */
  6406. - rms_m = invSqrtNorm2(rms_m, &inv_e);
  6407. - rms_m = fMult(rms_m, fx_lg);
  6408. - rms_e = inv_e - (rms_e >> 1) + fx_lg_e;
  6409. - }
  6410. -
  6411. - {
  6412. - int s = fNorm(tcx_gain_m);
  6413. - tcx_gain_m = tcx_gain_m << s;
  6414. - tcx_gain_e -= s;
  6415. - }
  6416. -
  6417. - tcx_gain_m = fMultDiv2(tcx_gain_m, rms_m);
  6418. - tcx_gain_e = tcx_gain_e + rms_e;
  6419. -
  6420. - /* global_gain * 2^(global_gain_e+rms_e) = (10^(global_gain/28)) * rms *
  6421. - * 2^rms_e */
  6422. - {
  6423. - { tcx_gain_e += 1; }
  6424. - }
  6425. -
  6426. - pAacDecoderChannelInfo->data.usac.tcx_gain[frame] = tcx_gain_m;
  6427. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[frame] = tcx_gain_e;
  6428. -
  6429. - pAacDecoderChannelInfo->specScale[frame] += tcx_gain_e;
  6430. - }
  6431. -}
  6432. -
  6433. -/**
  6434. - * \brief FDNS decoding.
  6435. - * \param pAacDecoderChannelInfo channel context data.
  6436. - * \param pAacDecoderStaticChannelInfo channel context static data.
  6437. - * \param r output spectrum.
  6438. - * \param lg the frame length in audio samples.
  6439. - * \param frame the frame index of the LPD super frame.
  6440. - * \param pScale pointer to current scale shift factor of r[].
  6441. - * \param A1 old input LPC coefficients of length M_LP_FILTER_ORDER.
  6442. - * \param A2 new input LPC coefficients of length M_LP_FILTER_ORDER.
  6443. - * \param pAlfdGains pointer for ALFD gains output scaled by 1.
  6444. - * \param fdns_npts number of lines (FDNS_NPTS).
  6445. - * \param inf_mask pointer to noise mask.
  6446. - * \param IGF_win_mode IGF window mode (LONG, SHORT, TCX10, TCX20).
  6447. - * \param frameType (IGF_FRAME_DIVISION_AAC_OR_TCX_LONG or
  6448. - * IGF_FRAME_DIVISION_TCX_SHORT_1).
  6449. - * \param elFlags element specific parser guidance flags.
  6450. - * \param lg_fb the fullband frame length in audio samples.
  6451. - * \param IGF_bgn the IGF start index.
  6452. - * \param rms_m mantisse of energy.
  6453. - * \param rms_e exponent of energy.
  6454. - */
  6455. -/* static */
  6456. -void CLpd_FdnsDecode(CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6457. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6458. - FIXP_DBL r[], const INT lg, const INT frame, SHORT *pScale,
  6459. - const FIXP_LPC A1[M_LP_FILTER_ORDER], const INT A1_exp,
  6460. - const FIXP_LPC A2[M_LP_FILTER_ORDER], const INT A2_exp,
  6461. - FIXP_DBL pAlfdGains[LFAC / 4], const INT fdns_npts) {
  6462. - /* Weight LPC coefficients using Rm values */
  6463. - CLpd_AdaptLowFreqDeemph(r, lg, pAlfdGains, *pScale);
  6464. -
  6465. - FIXP_DBL rms_m = (FIXP_DBL)0;
  6466. - INT rms_e = 0;
  6467. - {
  6468. - /* Calculate Energy */
  6469. - rms_m = calcEnergy(r, *pScale, lg, &rms_e);
  6470. - }
  6471. -
  6472. - calcTCXGain(pAacDecoderChannelInfo, r, rms_m, rms_e, frame, lg);
  6473. -
  6474. - /* Apply ODFT and Noise Shaping. LP coefficient (A1, A2) weighting is done
  6475. - * inside on the fly. */
  6476. -
  6477. - lpc2mdctAndNoiseShaping(r, pScale, lg, fdns_npts, A1, A1_exp, A2, A2_exp);
  6478. -}
  6479. -
  6480. -/**
  6481. - * find pitch for TCX20 (time domain) concealment.
  6482. - */
  6483. -static int find_mpitch(FIXP_DBL xri[], int lg) {
  6484. - FIXP_DBL max, pitch;
  6485. - INT pitch_e;
  6486. - int i, n;
  6487. -
  6488. - max = (FIXP_DBL)0;
  6489. - n = 2;
  6490. -
  6491. - /* find maximum below 400Hz */
  6492. - for (i = 2; i < (lg >> 4); i += 2) {
  6493. - FIXP_DBL tmp = fPow2Div2(xri[i]) + fPow2Div2(xri[i + 1]);
  6494. - if (tmp > max) {
  6495. - max = tmp;
  6496. - n = i;
  6497. - }
  6498. - }
  6499. -
  6500. - // pitch = ((float)lg<<1)/(float)n;
  6501. - pitch = fDivNorm((FIXP_DBL)lg << 1, (FIXP_DBL)n, &pitch_e);
  6502. - pitch >>= fixMax(0, DFRACT_BITS - 1 - pitch_e - 16);
  6503. -
  6504. - /* find pitch multiple under 20ms */
  6505. - if (pitch >= (FIXP_DBL)((256 << 16) - 1)) { /*231.0f*/
  6506. - n = 256;
  6507. - } else {
  6508. - FIXP_DBL mpitch = pitch;
  6509. - while (mpitch < (FIXP_DBL)(255 << 16)) {
  6510. - mpitch += pitch;
  6511. - }
  6512. - n = (int)(mpitch - pitch) >> 16;
  6513. - }
  6514. -
  6515. - return (n);
  6516. -}
  6517. -
  6518. -/**
  6519. - * number of spectral coefficients / time domain samples using frame mode as
  6520. - * index.
  6521. - */
  6522. -static const int lg_table_ccfl[2][4] = {
  6523. - {256, 256, 512, 1024}, /* coreCoderFrameLength = 1024 */
  6524. - {192, 192, 384, 768} /* coreCoderFrameLength = 768 */
  6525. -};
  6526. -
  6527. -/**
  6528. - * \brief Decode and render one MDCT-TCX frame.
  6529. - * \param pAacDecoderChannelInfo channel context data.
  6530. - * \param lg the frame length in audio samples.
  6531. - * \param frame the frame index of the LPD super frame.
  6532. - */
  6533. -static void CLpd_TcxDecode(
  6534. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6535. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags,
  6536. - int mod, int last_mod, int frame, int frameOk) {
  6537. - FIXP_DBL *pAlfd_gains = pAacDecoderStaticChannelInfo->last_alfd_gains;
  6538. - ULONG *pSeed = &pAacDecoderStaticChannelInfo->nfRandomSeed;
  6539. - int lg = (pAacDecoderChannelInfo->granuleLength == 128)
  6540. - ? lg_table_ccfl[0][mod + 0]
  6541. - : lg_table_ccfl[1][mod + 0];
  6542. - int next_frame = frame + (1 << (mod - 1));
  6543. - int isFullBandLpd = 0;
  6544. -
  6545. - /* Obtain r[] vector by combining the quant[] and noise[] vectors */
  6546. - {
  6547. - FIXP_DBL noise_level;
  6548. - FIXP_DBL *coeffs =
  6549. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6550. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd);
  6551. - int scale = pAacDecoderChannelInfo->specScale[frame];
  6552. - int i, nfBgn, nfEnd;
  6553. - UCHAR tcx_noise_factor = pAacDecoderChannelInfo->pDynData->specificTo.usac
  6554. - .tcx_noise_factor[frame];
  6555. -
  6556. - /* find pitch for bfi case */
  6557. - pAacDecoderStaticChannelInfo->last_tcx_pitch = find_mpitch(coeffs, lg);
  6558. -
  6559. - if (frameOk) {
  6560. - /* store for concealment */
  6561. - pAacDecoderStaticChannelInfo->last_tcx_noise_factor = tcx_noise_factor;
  6562. - } else {
  6563. - /* restore last frames value */
  6564. - tcx_noise_factor = pAacDecoderStaticChannelInfo->last_tcx_noise_factor;
  6565. - }
  6566. -
  6567. - noise_level =
  6568. - (FIXP_DBL)((LONG)FL2FXCONST_DBL(0.0625f) * (8 - tcx_noise_factor));
  6569. - noise_level = scaleValue(noise_level, -scale);
  6570. -
  6571. - const FIXP_DBL neg_noise_level = -noise_level;
  6572. -
  6573. - {
  6574. - nfBgn = lg / 6;
  6575. - nfEnd = lg;
  6576. - }
  6577. -
  6578. - for (i = nfBgn; i < nfEnd - 7; i += 8) {
  6579. - LONG tmp;
  6580. -
  6581. - /* Fill all 8 consecutive zero coeffs with noise */
  6582. - tmp = coeffs[i + 0] | coeffs[i + 1] | coeffs[i + 2] | coeffs[i + 3] |
  6583. - coeffs[i + 4] | coeffs[i + 5] | coeffs[i + 6] | coeffs[i + 7];
  6584. -
  6585. - if (tmp == 0) {
  6586. - for (int k = i; k < i + 8; k++) {
  6587. - UsacRandomSign(pSeed) ? (coeffs[k] = neg_noise_level)
  6588. - : (coeffs[k] = noise_level);
  6589. - }
  6590. - }
  6591. - }
  6592. - if ((nfEnd - i) >
  6593. - 0) { /* noise filling for last "band" with less than 8 bins */
  6594. - LONG tmp = (LONG)coeffs[i];
  6595. - int k;
  6596. -
  6597. - FDK_ASSERT((nfEnd - i) < 8);
  6598. - for (k = 1; k < (nfEnd - i); k++) {
  6599. - tmp |= (LONG)coeffs[i + k];
  6600. - }
  6601. - if (tmp == 0) {
  6602. - for (k = i; k < nfEnd; k++) {
  6603. - UsacRandomSign(pSeed) ? (coeffs[k] = neg_noise_level)
  6604. - : (coeffs[k] = noise_level);
  6605. - }
  6606. - }
  6607. - }
  6608. - }
  6609. -
  6610. - {
  6611. - /* Convert LPC to LP domain */
  6612. - if (last_mod == 0) {
  6613. - /* Note: The case where last_mod == 255 is handled by other means
  6614. - * in CLpdChannelStream_Read() */
  6615. - E_LPC_f_lsp_a_conversion(
  6616. - pAacDecoderChannelInfo->data.usac.lsp_coeff[frame],
  6617. - pAacDecoderChannelInfo->data.usac.lp_coeff[frame],
  6618. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[frame]);
  6619. - }
  6620. -
  6621. - E_LPC_f_lsp_a_conversion(
  6622. - pAacDecoderChannelInfo->data.usac.lsp_coeff[next_frame],
  6623. - pAacDecoderChannelInfo->data.usac.lp_coeff[next_frame],
  6624. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[next_frame]);
  6625. -
  6626. - /* FDNS decoding */
  6627. - CLpd_FdnsDecode(
  6628. - pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  6629. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6630. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  6631. - lg, frame, pAacDecoderChannelInfo->specScale + frame,
  6632. - pAacDecoderChannelInfo->data.usac.lp_coeff[frame],
  6633. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[frame],
  6634. - pAacDecoderChannelInfo->data.usac.lp_coeff[next_frame],
  6635. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[next_frame], pAlfd_gains,
  6636. - pAacDecoderChannelInfo->granuleLength / 2 /* == FDNS_NPTS(ccfl) */
  6637. - );
  6638. - }
  6639. -}
  6640. -
  6641. -/**
  6642. - * \brief Read the tcx_coding bitstream part
  6643. - * \param hBs bitstream handle to read from.
  6644. - * \param pAacDecoderChannelInfo channel context info to store data into.
  6645. - * \param lg the frame length in audio samples.
  6646. - * \param first_tcx_flag flag indicating that this is the first TCX frame.
  6647. - * \param frame the frame index of the LPD super frame.
  6648. - */
  6649. -static AAC_DECODER_ERROR CLpd_TCX_Read(
  6650. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6651. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, int lg,
  6652. - int first_tcx_flag, int frame, UINT flags) {
  6653. - AAC_DECODER_ERROR errorAAC = AAC_DEC_OK;
  6654. - ARITH_CODING_ERROR error = ARITH_CODER_OK;
  6655. - FIXP_DBL *pSpec;
  6656. - int arith_reset_flag = 0;
  6657. - int isFullBandLpd = 0;
  6658. -
  6659. - pSpec = SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, frame,
  6660. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd);
  6661. -
  6662. - /* TCX noise level */
  6663. - {
  6664. - pAacDecoderChannelInfo->pDynData->specificTo.usac.tcx_noise_factor[frame] =
  6665. - FDKreadBits(hBs, 3);
  6666. - }
  6667. - /* TCX global gain */
  6668. - pAacDecoderChannelInfo->pDynData->specificTo.usac.tcx_global_gain[frame] =
  6669. - FDKreadBits(hBs, 7);
  6670. -
  6671. - /* Arithmetic coded residual/spectrum */
  6672. - if (first_tcx_flag) {
  6673. - if (flags & AC_INDEP) {
  6674. - arith_reset_flag = 1;
  6675. - } else {
  6676. - arith_reset_flag = FDKreadBits(hBs, 1);
  6677. - }
  6678. - }
  6679. -
  6680. - /* CArco_DecodeArithData() output scale of "pSpec" is DFRACT_BITS-1 */
  6681. - error = CArco_DecodeArithData(pAacDecoderStaticChannelInfo->hArCo, hBs, pSpec,
  6682. - lg, lg, arith_reset_flag);
  6683. -
  6684. - /* Rescale residual/spectrum */
  6685. - {
  6686. - int scale = getScalefactor(pSpec, lg) - 2; /* Leave 2 bits headroom */
  6687. -
  6688. - /* Exponent of CArco_DecodeArithData() output is DFRACT_BITS; integer
  6689. - * values. */
  6690. - scaleValues(pSpec, lg, scale);
  6691. - scale = DFRACT_BITS - 1 - scale;
  6692. -
  6693. - pAacDecoderChannelInfo->specScale[frame] = scale;
  6694. - }
  6695. -
  6696. - if (error == ARITH_CODER_ERROR) errorAAC = AAC_DEC_UNKNOWN;
  6697. -
  6698. - return errorAAC;
  6699. -}
  6700. -
  6701. -/**
  6702. - * \brief translate lpd_mode into the mod[] array which describes the mode of
  6703. - * each each LPD frame
  6704. - * \param mod[] the array that will be filled with the mode indexes of the
  6705. - * inidividual frames.
  6706. - * \param lpd_mode the lpd_mode field read from the lpd_channel_stream
  6707. - */
  6708. -static AAC_DECODER_ERROR CLpd_ReadAndMapLpdModeToModArray(
  6709. - UCHAR mod[4], HANDLE_FDK_BITSTREAM hBs, UINT elFlags) {
  6710. - int lpd_mode;
  6711. -
  6712. - {
  6713. - lpd_mode = FDKreadBits(hBs, 5);
  6714. -
  6715. - if (lpd_mode > 25 || lpd_mode < 0) {
  6716. - return AAC_DEC_PARSE_ERROR;
  6717. - }
  6718. -
  6719. - switch (lpd_mode) {
  6720. - case 25:
  6721. - /* 1 80MS frame */
  6722. - mod[0] = mod[1] = mod[2] = mod[3] = 3;
  6723. - break;
  6724. - case 24:
  6725. - /* 2 40MS frames */
  6726. - mod[0] = mod[1] = mod[2] = mod[3] = 2;
  6727. - break;
  6728. - default:
  6729. - switch (lpd_mode >> 2) {
  6730. - case 4:
  6731. - /* lpd_mode 19 - 16 => 1 40MS and 2 20MS frames */
  6732. - mod[0] = mod[1] = 2;
  6733. - mod[2] = (lpd_mode & 1) ? 1 : 0;
  6734. - mod[3] = (lpd_mode & 2) ? 1 : 0;
  6735. - break;
  6736. - case 5:
  6737. - /* lpd_mode 23 - 20 => 2 20MS and 1 40MS frames */
  6738. - mod[2] = mod[3] = 2;
  6739. - mod[0] = (lpd_mode & 1) ? 1 : 0;
  6740. - mod[1] = (lpd_mode & 2) ? 1 : 0;
  6741. - break;
  6742. - default:
  6743. - /* lpd_mode < 16 => 4 20MS frames */
  6744. - mod[0] = (lpd_mode & 1) ? 1 : 0;
  6745. - mod[1] = (lpd_mode & 2) ? 1 : 0;
  6746. - mod[2] = (lpd_mode & 4) ? 1 : 0;
  6747. - mod[3] = (lpd_mode & 8) ? 1 : 0;
  6748. - break;
  6749. - }
  6750. - break;
  6751. - }
  6752. - }
  6753. - return AAC_DEC_OK;
  6754. -}
  6755. -
  6756. -static void CLpd_Reset(
  6757. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6758. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6759. - int keep_past_signal) {
  6760. - int i;
  6761. -
  6762. - /* Reset TCX / ACELP common memory */
  6763. - if (!keep_past_signal) {
  6764. - FDKmemclear(pAacDecoderStaticChannelInfo->old_synth,
  6765. - sizeof(pAacDecoderStaticChannelInfo->old_synth));
  6766. - }
  6767. -
  6768. - /* Initialize the LSFs */
  6769. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  6770. - pAacDecoderStaticChannelInfo->lpc4_lsf[i] = fdk_dec_lsf_init[i];
  6771. - }
  6772. -
  6773. - /* Reset memory needed by bass post-filter */
  6774. - FDKmemclear(pAacDecoderStaticChannelInfo->mem_bpf,
  6775. - sizeof(pAacDecoderStaticChannelInfo->mem_bpf));
  6776. -
  6777. - pAacDecoderStaticChannelInfo->old_bpf_control_info = 0;
  6778. - for (i = 0; i < SYN_SFD; i++) {
  6779. - pAacDecoderStaticChannelInfo->old_T_pf[i] = 64;
  6780. - pAacDecoderStaticChannelInfo->old_gain_pf[i] = (FIXP_DBL)0;
  6781. - }
  6782. -
  6783. - /* Reset ACELP memory */
  6784. - CLpd_AcelpReset(&pAacDecoderStaticChannelInfo->acelp);
  6785. -
  6786. - pAacDecoderStaticChannelInfo->last_lpc_lost = 0; /* prev_lpc_lost */
  6787. - pAacDecoderStaticChannelInfo->last_tcx_pitch = L_DIV; /* pitch_tcx */
  6788. - pAacDecoderStaticChannelInfo->numLostLpdFrames = 0; /* nbLostCmpt */
  6789. -}
  6790. -
  6791. -/*
  6792. - * Externally visible functions
  6793. - */
  6794. -
  6795. -AAC_DECODER_ERROR CLpdChannelStream_Read(
  6796. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  6797. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  6798. - const SamplingRateInfo *pSamplingRateInfo, UINT flags) {
  6799. - AAC_DECODER_ERROR error = AAC_DEC_OK;
  6800. - int first_tcx_flag;
  6801. - int k, nbDiv, fFacDataPresent, first_lpd_flag, acelp_core_mode,
  6802. - facGetMemState = 0;
  6803. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  6804. - int lpd_mode_last, prev_frame_was_lpd;
  6805. - USAC_COREMODE core_mode_last;
  6806. - const int lg_table_offset = 0;
  6807. - const int *lg_table = (pAacDecoderChannelInfo->granuleLength == 128)
  6808. - ? &lg_table_ccfl[0][lg_table_offset]
  6809. - : &lg_table_ccfl[1][lg_table_offset];
  6810. - int last_lpc_lost = pAacDecoderStaticChannelInfo->last_lpc_lost;
  6811. -
  6812. - int last_frame_ok = 1;
  6813. -
  6814. - INT i_offset;
  6815. - UINT samplingRate;
  6816. -
  6817. - samplingRate = pSamplingRateInfo->samplingRate;
  6818. -
  6819. - i_offset =
  6820. - (INT)(samplingRate * PIT_MIN_12k8 + (FSCALE_DENOM / 2)) / FSCALE_DENOM -
  6821. - (INT)PIT_MIN_12k8;
  6822. -
  6823. - if ((samplingRate < FAC_FSCALE_MIN) || (samplingRate > FAC_FSCALE_MAX)) {
  6824. - error = AAC_DEC_PARSE_ERROR;
  6825. - goto bail;
  6826. - }
  6827. -
  6828. - acelp_core_mode = FDKreadBits(hBs, 3);
  6829. -
  6830. - /* lpd_mode */
  6831. - error = CLpd_ReadAndMapLpdModeToModArray(mod, hBs, 0);
  6832. - if (error != AAC_DEC_OK) {
  6833. - goto bail;
  6834. - }
  6835. -
  6836. - /* bpf_control_info */
  6837. - pAacDecoderChannelInfo->data.usac.bpf_control_info = FDKreadBit(hBs);
  6838. -
  6839. - /* last_core_mode */
  6840. - prev_frame_was_lpd = FDKreadBit(hBs);
  6841. - /* fac_data_present */
  6842. - fFacDataPresent = FDKreadBit(hBs);
  6843. -
  6844. - /* Set valid values from
  6845. - * pAacDecoderStaticChannelInfo->{last_core_mode,last_lpd_mode} */
  6846. - pAacDecoderChannelInfo->data.usac.core_mode_last =
  6847. - pAacDecoderStaticChannelInfo->last_core_mode;
  6848. - lpd_mode_last = pAacDecoderChannelInfo->data.usac.lpd_mode_last =
  6849. - pAacDecoderStaticChannelInfo->last_lpd_mode;
  6850. -
  6851. - if (prev_frame_was_lpd == 0) {
  6852. - /* Last frame was FD */
  6853. - pAacDecoderChannelInfo->data.usac.core_mode_last = FD_LONG;
  6854. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 255;
  6855. - } else {
  6856. - /* Last frame was LPD */
  6857. - pAacDecoderChannelInfo->data.usac.core_mode_last = LPD;
  6858. - if (((mod[0] == 0) && fFacDataPresent) ||
  6859. - ((mod[0] != 0) && !fFacDataPresent)) {
  6860. - /* Currend mod is ACELP, fac data present -> TCX, current mod TCX, no fac
  6861. - * data -> TCX */
  6862. - if (lpd_mode_last == 0) {
  6863. - /* Bit stream interruption detected. Assume last TCX mode as TCX20. */
  6864. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 1;
  6865. - }
  6866. - /* Else assume that remembered TCX mode is correct. */
  6867. - } else {
  6868. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 0;
  6869. - }
  6870. - }
  6871. -
  6872. - first_lpd_flag = (pAacDecoderChannelInfo->data.usac.core_mode_last !=
  6873. - LPD); /* Depends on bitstream configuration */
  6874. - first_tcx_flag = 1;
  6875. -
  6876. - if (pAacDecoderStaticChannelInfo->last_core_mode !=
  6877. - LPD) { /* ATTENTION: Reset depends on what we rendered before! */
  6878. - CLpd_Reset(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo, 0);
  6879. -
  6880. - if (!last_frame_ok) {
  6881. - /* If last rendered frame was not LPD and first lpd flag is not set, this
  6882. - * must be an error - set last_lpc_lost flag */
  6883. - last_lpc_lost |= (first_lpd_flag) ? 0 : 1;
  6884. - }
  6885. - }
  6886. -
  6887. - core_mode_last = pAacDecoderChannelInfo->data.usac.core_mode_last;
  6888. - lpd_mode_last = pAacDecoderChannelInfo->data.usac.lpd_mode_last;
  6889. -
  6890. - nbDiv = NB_DIV;
  6891. -
  6892. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  6893. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  6894. -
  6895. - k = 0;
  6896. - while (k < nbDiv) {
  6897. - /* Reset FAC data pointers in order to avoid applying old random FAC data.
  6898. - */
  6899. - pAacDecoderChannelInfo->data.usac.fac_data[k] = NULL;
  6900. -
  6901. - if ((k == 0 && core_mode_last == LPD && fFacDataPresent) ||
  6902. - (lpd_mode_last == 0 && mod[k] > 0) ||
  6903. - ((lpd_mode_last != 255) && lpd_mode_last > 0 && mod[k] == 0)) {
  6904. - int err;
  6905. -
  6906. - /* Assign FAC memory */
  6907. - pAacDecoderChannelInfo->data.usac.fac_data[k] =
  6908. - CLpd_FAC_GetMemory(pAacDecoderChannelInfo, mod, &facGetMemState);
  6909. -
  6910. - /* FAC for (ACELP -> TCX) or (TCX -> ACELP) */
  6911. - err = CLpd_FAC_Read(
  6912. - hBs, pAacDecoderChannelInfo->data.usac.fac_data[k],
  6913. - pAacDecoderChannelInfo->data.usac.fac_data_e,
  6914. - pAacDecoderChannelInfo->granuleLength, /* == fac_length */
  6915. - 0, k);
  6916. - if (err != 0) {
  6917. - error = AAC_DEC_PARSE_ERROR;
  6918. - goto bail;
  6919. - }
  6920. - }
  6921. -
  6922. - if (mod[k] == 0) /* acelp-mode */
  6923. - {
  6924. - int err;
  6925. - err = CLpd_AcelpRead(
  6926. - hBs, &pAacDecoderChannelInfo->data.usac.acelp[k], acelp_core_mode,
  6927. - pAacDecoderChannelInfo->granuleLength * 8 /* coreCoderFrameLength */,
  6928. - i_offset);
  6929. - if (err != 0) {
  6930. - error = AAC_DEC_PARSE_ERROR;
  6931. - goto bail;
  6932. - }
  6933. -
  6934. - lpd_mode_last = 0;
  6935. - k++;
  6936. - } else /* mode != 0 => TCX */
  6937. - {
  6938. - error = CLpd_TCX_Read(hBs, pAacDecoderChannelInfo,
  6939. - pAacDecoderStaticChannelInfo, lg_table[mod[k]],
  6940. - first_tcx_flag, k, flags);
  6941. -
  6942. - lpd_mode_last = mod[k];
  6943. - first_tcx_flag = 0;
  6944. - k += 1 << (mod[k] - 1);
  6945. - }
  6946. - if (error != AAC_DEC_OK) {
  6947. - error = AAC_DEC_PARSE_ERROR;
  6948. - goto bail;
  6949. - }
  6950. - }
  6951. -
  6952. - {
  6953. - int err;
  6954. -
  6955. - /* Read LPC coefficients */
  6956. - err = CLpc_Read(
  6957. - hBs, pAacDecoderChannelInfo->data.usac.lsp_coeff,
  6958. - pAacDecoderStaticChannelInfo->lpc4_lsf,
  6959. - pAacDecoderChannelInfo->data.usac.lsf_adaptive_mean_cand,
  6960. - pAacDecoderChannelInfo->data.usac.aStability, mod, first_lpd_flag,
  6961. - /* if last lpc4 is available from concealment do not extrapolate lpc0
  6962. - from lpc2 */
  6963. - (mod[0] & 0x3) ? 0
  6964. - : (last_lpc_lost &&
  6965. - pAacDecoderStaticChannelInfo->last_core_mode != LPD),
  6966. - last_frame_ok);
  6967. - if (err != 0) {
  6968. - error = AAC_DEC_PARSE_ERROR;
  6969. - goto bail;
  6970. - }
  6971. - }
  6972. -
  6973. - /* adjust old lsp[] following to a bad frame (to avoid overshoot) (ref:
  6974. - * dec_LPD.c) */
  6975. - if (last_lpc_lost && !last_frame_ok) {
  6976. - int k_next;
  6977. - k = 0;
  6978. - while (k < nbDiv) {
  6979. - int i;
  6980. - k_next = k + (((mod[k] & 0x3) == 0) ? 1 : (1 << (mod[k] - 1)));
  6981. - FIXP_LPC *lsp_old = pAacDecoderChannelInfo->data.usac.lsp_coeff[k];
  6982. - FIXP_LPC *lsp_new = pAacDecoderChannelInfo->data.usac.lsp_coeff[k_next];
  6983. -
  6984. - for (i = 0; i < M_LP_FILTER_ORDER; i++) {
  6985. - if (lsp_new[i] < lsp_old[i]) {
  6986. - lsp_old[i] = lsp_new[i];
  6987. - }
  6988. - }
  6989. - k = k_next;
  6990. - }
  6991. - }
  6992. -
  6993. - if (pAacDecoderStaticChannelInfo->last_lpd_mode != 0) {
  6994. - if (pAacDecoderStaticChannelInfo->last_lpd_mode == 255) {
  6995. - /* We need it for TCX decoding or ACELP excitation update */
  6996. - E_LPC_f_lsp_a_conversion(
  6997. - pAacDecoderChannelInfo->data.usac.lsp_coeff[0],
  6998. - pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  6999. - &pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0]);
  7000. - } else { /* last_lpd_mode was TCX */
  7001. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7002. - * converting LSP coefficients again). */
  7003. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7004. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7005. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7006. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7007. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7008. - }
  7009. - } /* case last_lpd_mode was ACELP is handled by CLpd_TcxDecode() */
  7010. -
  7011. - if (fFacDataPresent && (core_mode_last != LPD)) {
  7012. - int prev_frame_was_short;
  7013. -
  7014. - prev_frame_was_short = FDKreadBit(hBs);
  7015. -
  7016. - if (prev_frame_was_short) {
  7017. - core_mode_last = pAacDecoderChannelInfo->data.usac.core_mode_last =
  7018. - FD_SHORT;
  7019. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = 255;
  7020. -
  7021. - if ((pAacDecoderStaticChannelInfo->last_core_mode != FD_SHORT)) {
  7022. - /* USAC Conformance document:
  7023. - short_fac_flag shall be encoded with a value of 1 if the
  7024. - window_sequence of the previous frame was 2 (EIGHT_SHORT_SEQUENCE).
  7025. - Otherwise short_fac_flag shall be encoded with a
  7026. - value of 0. */
  7027. - error = AAC_DEC_PARSE_ERROR;
  7028. - goto bail;
  7029. - }
  7030. - }
  7031. -
  7032. - /* Assign memory */
  7033. - pAacDecoderChannelInfo->data.usac.fac_data[0] =
  7034. - CLpd_FAC_GetMemory(pAacDecoderChannelInfo, mod, &facGetMemState);
  7035. -
  7036. - {
  7037. - int err;
  7038. -
  7039. - /* FAC for FD -> ACELP */
  7040. - err = CLpd_FAC_Read(
  7041. - hBs, pAacDecoderChannelInfo->data.usac.fac_data[0],
  7042. - pAacDecoderChannelInfo->data.usac.fac_data_e,
  7043. - CLpd_FAC_getLength(core_mode_last != FD_SHORT,
  7044. - pAacDecoderChannelInfo->granuleLength),
  7045. - 1, 0);
  7046. - if (err != 0) {
  7047. - error = AAC_DEC_PARSE_ERROR;
  7048. - goto bail;
  7049. - }
  7050. - }
  7051. - }
  7052. -
  7053. -bail:
  7054. - if (error == AAC_DEC_OK) {
  7055. - /* check consitency of last core/lpd mode values */
  7056. - if ((pAacDecoderChannelInfo->data.usac.core_mode_last !=
  7057. - pAacDecoderStaticChannelInfo->last_core_mode) &&
  7058. - (pAacDecoderStaticChannelInfo->last_lpc_lost == 0)) {
  7059. - /* Something got wrong! */
  7060. - /* error = AAC_DEC_PARSE_ERROR; */ /* Throwing errors does not help */
  7061. - } else if ((pAacDecoderChannelInfo->data.usac.core_mode_last == LPD) &&
  7062. - (pAacDecoderChannelInfo->data.usac.lpd_mode_last !=
  7063. - pAacDecoderStaticChannelInfo->last_lpd_mode) &&
  7064. - (pAacDecoderStaticChannelInfo->last_lpc_lost == 0)) {
  7065. - /* Something got wrong! */
  7066. - /* error = AAC_DEC_PARSE_ERROR; */ /* Throwing errors does not help */
  7067. - }
  7068. - }
  7069. -
  7070. - return error;
  7071. -}
  7072. -
  7073. -void CLpdChannelStream_Decode(
  7074. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7075. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags) {
  7076. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  7077. - int k;
  7078. - UCHAR last_lpd_mode;
  7079. - int nbDiv = NB_DIV;
  7080. -
  7081. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7082. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7083. - k = 0;
  7084. - last_lpd_mode =
  7085. - pAacDecoderChannelInfo->data.usac
  7086. - .lpd_mode_last; /* could be different to what has been rendered */
  7087. - while (k < nbDiv) {
  7088. - if (mod[k] == 0) {
  7089. - /* ACELP */
  7090. -
  7091. - /* If FAC (fac_data[k] != NULL), and previous frame was TCX, apply (TCX)
  7092. - * gains to FAC data */
  7093. - if (last_lpd_mode > 0 && last_lpd_mode != 255 &&
  7094. - pAacDecoderChannelInfo->data.usac.fac_data[k]) {
  7095. - CFac_ApplyGains(pAacDecoderChannelInfo->data.usac.fac_data[k],
  7096. - pAacDecoderChannelInfo->granuleLength,
  7097. - pAacDecoderStaticChannelInfo->last_tcx_gain,
  7098. - pAacDecoderStaticChannelInfo->last_alfd_gains,
  7099. - (last_lpd_mode < 4) ? last_lpd_mode : 3);
  7100. -
  7101. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] +=
  7102. - pAacDecoderStaticChannelInfo->last_tcx_gain_e;
  7103. - }
  7104. - } else {
  7105. - /* TCX */
  7106. - CLpd_TcxDecode(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  7107. - flags, mod[k], last_lpd_mode, k, 1 /* frameOk == 1 */
  7108. - );
  7109. -
  7110. - /* Store TCX gain scale for next possible FAC transition. */
  7111. - pAacDecoderStaticChannelInfo->last_tcx_gain =
  7112. - pAacDecoderChannelInfo->data.usac.tcx_gain[k];
  7113. - pAacDecoderStaticChannelInfo->last_tcx_gain_e =
  7114. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k];
  7115. -
  7116. - /* If FAC (fac_data[k] != NULL), apply gains */
  7117. - if (last_lpd_mode == 0 && pAacDecoderChannelInfo->data.usac.fac_data[k]) {
  7118. - CFac_ApplyGains(
  7119. - pAacDecoderChannelInfo->data.usac.fac_data[k],
  7120. - pAacDecoderChannelInfo->granuleLength /* == fac_length */,
  7121. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7122. - pAacDecoderStaticChannelInfo->last_alfd_gains, mod[k]);
  7123. -
  7124. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] +=
  7125. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k];
  7126. - }
  7127. - }
  7128. -
  7129. - /* remember previous mode */
  7130. - last_lpd_mode = mod[k];
  7131. -
  7132. - /* Increase k to next frame */
  7133. - k += (mod[k] == 0) ? 1 : (1 << (mod[k] - 1));
  7134. - }
  7135. -}
  7136. -
  7137. -AAC_DECODER_ERROR CLpd_RenderTimeSignal(
  7138. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7139. - CAacDecoderChannelInfo *pAacDecoderChannelInfo, FIXP_PCM *pTimeData,
  7140. - INT lFrame, SamplingRateInfo *pSamplingRateInfo, UINT frameOk, UINT flags,
  7141. - UINT strmFlags) {
  7142. - UCHAR *mod = pAacDecoderChannelInfo->data.usac.mod;
  7143. - AAC_DECODER_ERROR error = AAC_DEC_OK;
  7144. - int k, i_offset;
  7145. - int last_k;
  7146. - int nrSamples = 0;
  7147. - int facFB = 1;
  7148. - int nbDiv = NB_DIV;
  7149. - int lDiv = lFrame / nbDiv; /* length of division (acelp or tcx20 frame)*/
  7150. - int lFac = lDiv / 2;
  7151. - int nbSubfr =
  7152. - lFrame / (nbDiv * L_SUBFR); /* number of subframes per division */
  7153. - int nbSubfrSuperfr = nbDiv * nbSubfr;
  7154. - int synSfd = (nbSubfrSuperfr / 2) - BPF_SFD;
  7155. - int SynDelay = synSfd * L_SUBFR;
  7156. - int aacDelay = lFrame / 2;
  7157. -
  7158. - /*
  7159. - In respect to the reference software, the synth pointer here is lagging by
  7160. - aacDelay ( == SYN_DELAY + BPF_DELAY ) samples. The corresponding old
  7161. - synthesis samples are handled by the IMDCT overlap.
  7162. - */
  7163. -
  7164. - FIXP_DBL *synth_buf =
  7165. - pAacDecoderChannelInfo->pComStaticData->pWorkBufferCore1->synth_buf;
  7166. - FIXP_DBL *synth = synth_buf + PIT_MAX_MAX - BPF_DELAY;
  7167. - UCHAR last_lpd_mode, last_last_lpd_mode, last_lpc_lost, last_frame_lost;
  7168. -
  7169. - INT pitch[NB_SUBFR_SUPERFR + SYN_SFD];
  7170. - FIXP_DBL pit_gain[NB_SUBFR_SUPERFR + SYN_SFD];
  7171. -
  7172. - const int *lg_table;
  7173. - int lg_table_offset = 0;
  7174. -
  7175. - UINT samplingRate = pSamplingRateInfo->samplingRate;
  7176. -
  7177. - FDKmemclear(pitch, (NB_SUBFR_SUPERFR + SYN_SFD) * sizeof(INT));
  7178. -
  7179. - if (flags & AACDEC_FLUSH) {
  7180. - CLpd_Reset(pAacDecoderChannelInfo, pAacDecoderStaticChannelInfo,
  7181. - flags & AACDEC_FLUSH);
  7182. - frameOk = 0;
  7183. - }
  7184. -
  7185. - switch (lFrame) {
  7186. - case 1024:
  7187. - lg_table = &lg_table_ccfl[0][lg_table_offset];
  7188. - break;
  7189. - case 768:
  7190. - lg_table = &lg_table_ccfl[1][lg_table_offset];
  7191. - break;
  7192. - default:
  7193. - FDK_ASSERT(0);
  7194. - return AAC_DEC_UNKNOWN;
  7195. - }
  7196. -
  7197. - last_frame_lost = 0;
  7198. -
  7199. - /* Maintain LPD mode from previous frame */
  7200. - if ((pAacDecoderStaticChannelInfo->last_core_mode == FD_LONG) ||
  7201. - (pAacDecoderStaticChannelInfo->last_core_mode == FD_SHORT)) {
  7202. - pAacDecoderStaticChannelInfo->last_lpd_mode = 255;
  7203. - }
  7204. -
  7205. - if (!frameOk) {
  7206. - FIXP_DBL old_tcx_gain;
  7207. - FIXP_SGL old_stab;
  7208. - SCHAR old_tcx_gain_e;
  7209. - int nLostSf;
  7210. -
  7211. - last_lpd_mode = pAacDecoderStaticChannelInfo->last_lpd_mode;
  7212. - old_tcx_gain = pAacDecoderStaticChannelInfo->last_tcx_gain;
  7213. - old_tcx_gain_e = pAacDecoderStaticChannelInfo->last_tcx_gain_e;
  7214. - old_stab = pAacDecoderStaticChannelInfo->oldStability;
  7215. - nLostSf = pAacDecoderStaticChannelInfo->numLostLpdFrames;
  7216. -
  7217. - /* patch the last LPD mode */
  7218. - pAacDecoderChannelInfo->data.usac.lpd_mode_last = last_lpd_mode;
  7219. -
  7220. - /* Do mode extrapolation and repeat the previous mode:
  7221. - if previous mode = ACELP -> ACELP
  7222. - if previous mode = TCX-20/40 -> TCX-20
  7223. - if previous mode = TCX-80 -> TCX-80
  7224. - notes:
  7225. - - ACELP is not allowed after TCX (no pitch information to reuse)
  7226. - - TCX-40 is not allowed in the mode repetition to keep the logic simple
  7227. - */
  7228. - switch (last_lpd_mode) {
  7229. - case 0:
  7230. - mod[0] = mod[1] = mod[2] = mod[3] = 0; /* -> ACELP concealment */
  7231. - break;
  7232. - case 3:
  7233. - mod[0] = mod[1] = mod[2] = mod[3] = 3; /* -> TCX FD concealment */
  7234. - break;
  7235. - case 2:
  7236. - mod[0] = mod[1] = mod[2] = mod[3] = 2; /* -> TCX FD concealment */
  7237. - break;
  7238. - case 1:
  7239. - default:
  7240. - mod[0] = mod[1] = mod[2] = mod[3] = 4; /* -> TCX TD concealment */
  7241. - break;
  7242. - }
  7243. -
  7244. - /* LPC extrapolation */
  7245. - CLpc_Conceal(pAacDecoderChannelInfo->data.usac.lsp_coeff,
  7246. - pAacDecoderStaticChannelInfo->lpc4_lsf,
  7247. - pAacDecoderStaticChannelInfo->lsf_adaptive_mean,
  7248. - /*(pAacDecoderStaticChannelInfo->numLostLpdFrames == 0) ||*/
  7249. - (last_lpd_mode == 255));
  7250. -
  7251. - if ((last_lpd_mode > 0) && (last_lpd_mode < 255)) {
  7252. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7253. - * converting LSP coefficients again). */
  7254. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7255. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7256. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7257. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7258. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7259. - } /* case last_lpd_mode was ACELP is handled by CLpd_TcxDecode() */
  7260. - /* case last_lpd_mode was Time domain TCX concealment is handled after this
  7261. - * "if (!frameOk)"-block */
  7262. -
  7263. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7264. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7265. - k = 0;
  7266. - while (k < nbDiv) {
  7267. - pAacDecoderChannelInfo->data.usac.tcx_gain[k] = old_tcx_gain;
  7268. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k] = old_tcx_gain_e;
  7269. -
  7270. - /* restore stability value from last frame */
  7271. - pAacDecoderChannelInfo->data.usac.aStability[k] = old_stab;
  7272. -
  7273. - /* Increase k to next frame */
  7274. - k += ((mod[k] & 0x3) == 0) ? 1 : (1 << ((mod[k] & 0x3) - 1));
  7275. -
  7276. - nLostSf++;
  7277. - }
  7278. - } else {
  7279. - if ((pAacDecoderStaticChannelInfo->last_lpd_mode == 4) && (mod[0] > 0)) {
  7280. - /* Copy old LPC4 LP domain coefficients to LPC0 LP domain buffer (to avoid
  7281. - * converting LSP coefficients again). */
  7282. - FDKmemcpy(pAacDecoderChannelInfo->data.usac.lp_coeff[0],
  7283. - pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7284. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7285. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0] =
  7286. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0];
  7287. - }
  7288. - }
  7289. -
  7290. - Acelp_PreProcessing(synth_buf, pAacDecoderStaticChannelInfo->old_synth, pitch,
  7291. - pAacDecoderStaticChannelInfo->old_T_pf, pit_gain,
  7292. - pAacDecoderStaticChannelInfo->old_gain_pf, samplingRate,
  7293. - &i_offset, lFrame, synSfd, nbSubfrSuperfr);
  7294. -
  7295. - /* k is the frame index. If a frame is of size 40MS or 80MS,
  7296. - this frame index is incremented 2 or 4 instead of 1 respectively. */
  7297. - k = 0;
  7298. - last_k = -1; /* mark invalid */
  7299. - last_lpd_mode = pAacDecoderStaticChannelInfo->last_lpd_mode;
  7300. - last_last_lpd_mode = pAacDecoderStaticChannelInfo->last_last_lpd_mode;
  7301. - last_lpc_lost = pAacDecoderStaticChannelInfo->last_lpc_lost | last_frame_lost;
  7302. -
  7303. - /* This buffer must be avalable for the case of FD->ACELP transition. The
  7304. - beginning of the buffer is used after the BPF to overwrite the output signal.
  7305. - Only the FAC area must be affected by the BPF */
  7306. -
  7307. - while (k < nbDiv) {
  7308. - if (frameOk == 0) {
  7309. - pAacDecoderStaticChannelInfo->numLostLpdFrames++;
  7310. - } else {
  7311. - last_frame_lost |=
  7312. - (pAacDecoderStaticChannelInfo->numLostLpdFrames > 0) ? 1 : 0;
  7313. - pAacDecoderStaticChannelInfo->numLostLpdFrames = 0;
  7314. - }
  7315. - if (mod[k] == 0 || mod[k] == 4) {
  7316. - /* ACELP or TCX time domain concealment */
  7317. - FIXP_DBL *acelp_out;
  7318. -
  7319. - /* FAC management */
  7320. - if ((last_lpd_mode != 0) && (last_lpd_mode != 4)) /* TCX TD concealment */
  7321. - {
  7322. - FIXP_DBL *pFacData = NULL;
  7323. -
  7324. - if (frameOk && !last_frame_lost) {
  7325. - pFacData = pAacDecoderChannelInfo->data.usac.fac_data[k];
  7326. - }
  7327. -
  7328. - nrSamples += CLpd_FAC_Mdct2Acelp(
  7329. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples, pFacData,
  7330. - pAacDecoderChannelInfo->data.usac.fac_data_e[k],
  7331. - pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7332. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k],
  7333. - lFrame - nrSamples,
  7334. - CLpd_FAC_getLength(
  7335. - (pAacDecoderStaticChannelInfo->last_core_mode != FD_SHORT) ||
  7336. - (k > 0),
  7337. - lFac),
  7338. - (pAacDecoderStaticChannelInfo->last_core_mode != LPD) && (k == 0),
  7339. - 0);
  7340. -
  7341. - FDKmemcpy(
  7342. - synth + nrSamples, pAacDecoderStaticChannelInfo->IMdct.overlap.time,
  7343. - pAacDecoderStaticChannelInfo->IMdct.ov_offset * sizeof(FIXP_DBL));
  7344. - {
  7345. - FIXP_LPC *lp_prev =
  7346. - pAacDecoderChannelInfo->data.usac
  7347. - .lp_coeff[0]; /* init value does not real matter */
  7348. - INT lp_prev_exp = pAacDecoderChannelInfo->data.usac.lp_coeff_exp[0];
  7349. -
  7350. - if (last_lpd_mode != 255) { /* last mode was tcx */
  7351. - last_k = k - (1 << (last_lpd_mode - 1));
  7352. - if (last_k < 0) {
  7353. - lp_prev = pAacDecoderStaticChannelInfo->lp_coeff_old[1];
  7354. - lp_prev_exp = pAacDecoderStaticChannelInfo->lp_coeff_old_exp[1];
  7355. - } else {
  7356. - lp_prev = pAacDecoderChannelInfo->data.usac.lp_coeff[last_k];
  7357. - lp_prev_exp =
  7358. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[last_k];
  7359. - }
  7360. - }
  7361. -
  7362. - CLpd_AcelpPrepareInternalMem(
  7363. - synth + aacDelay + k * lDiv, last_lpd_mode,
  7364. - (last_last_lpd_mode == 4) ? 0 : last_last_lpd_mode,
  7365. - pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7366. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k], lp_prev,
  7367. - lp_prev_exp, &pAacDecoderStaticChannelInfo->acelp, lFrame,
  7368. - (last_frame_lost && k < 2), mod[k]);
  7369. - }
  7370. - } else {
  7371. - if (k == 0 && pAacDecoderStaticChannelInfo->IMdct.ov_offset !=
  7372. - lFrame / facFB / 2) {
  7373. - pAacDecoderStaticChannelInfo->IMdct.ov_offset = lFrame / facFB / 2;
  7374. - }
  7375. - nrSamples += imdct_drain(&pAacDecoderStaticChannelInfo->IMdct,
  7376. - synth + nrSamples, lFrame / facFB - nrSamples);
  7377. - }
  7378. -
  7379. - if (nrSamples >= lFrame / facFB) {
  7380. - /* Write ACELP time domain samples into IMDCT overlap buffer at
  7381. - * pAacDecoderStaticChannelInfo->IMdct.overlap.time +
  7382. - * pAacDecoderStaticChannelInfo->IMdct.ov_offset
  7383. - */
  7384. - acelp_out = pAacDecoderStaticChannelInfo->IMdct.overlap.time +
  7385. - pAacDecoderStaticChannelInfo->IMdct.ov_offset;
  7386. -
  7387. - /* Account ACELP time domain output samples to overlap buffer */
  7388. - pAacDecoderStaticChannelInfo->IMdct.ov_offset += lDiv;
  7389. - } else {
  7390. - /* Write ACELP time domain samples into output buffer at pTimeData +
  7391. - * nrSamples */
  7392. - acelp_out = synth + nrSamples;
  7393. -
  7394. - /* Account ACELP time domain output samples to output buffer */
  7395. - nrSamples += lDiv;
  7396. - }
  7397. -
  7398. - if (mod[k] == 4) {
  7399. - pAacDecoderStaticChannelInfo->acelp.wsyn_rms = scaleValue(
  7400. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7401. - fixMin(0,
  7402. - pAacDecoderChannelInfo->data.usac.tcx_gain_e[k] - SF_EXC));
  7403. - CLpd_TcxTDConceal(&pAacDecoderStaticChannelInfo->acelp,
  7404. - &pAacDecoderStaticChannelInfo->last_tcx_pitch,
  7405. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k],
  7406. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k + 1],
  7407. - pAacDecoderChannelInfo->data.usac.aStability[k],
  7408. - pAacDecoderStaticChannelInfo->numLostLpdFrames,
  7409. - acelp_out, lFrame,
  7410. - pAacDecoderStaticChannelInfo->last_tcx_noise_factor);
  7411. -
  7412. - } else {
  7413. - FDK_ASSERT(pAacDecoderChannelInfo->data.usac.aStability[k] >=
  7414. - (FIXP_SGL)0);
  7415. - CLpd_AcelpDecode(&pAacDecoderStaticChannelInfo->acelp, i_offset,
  7416. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k],
  7417. - pAacDecoderChannelInfo->data.usac.lsp_coeff[k + 1],
  7418. - pAacDecoderChannelInfo->data.usac.aStability[k],
  7419. - &pAacDecoderChannelInfo->data.usac.acelp[k],
  7420. - pAacDecoderStaticChannelInfo->numLostLpdFrames,
  7421. - last_lpc_lost, k, acelp_out,
  7422. - &pitch[(k * nbSubfr) + synSfd],
  7423. - &pit_gain[(k * nbSubfr) + synSfd], lFrame);
  7424. - }
  7425. -
  7426. - if (mod[k] != 4) {
  7427. - if (last_lpd_mode != 0 &&
  7428. - pAacDecoderChannelInfo->data.usac
  7429. - .bpf_control_info) { /* FD/TCX -> ACELP transition */
  7430. - /* bass post-filter past FAC area (past two (one for FD short)
  7431. - * subframes) */
  7432. - int currentSf = synSfd + k * nbSubfr;
  7433. -
  7434. - if ((k > 0) || (pAacDecoderStaticChannelInfo->last_core_mode !=
  7435. - FD_SHORT)) { /* TCX or FD long -> ACELP */
  7436. - pitch[currentSf - 2] = pitch[currentSf - 1] = pitch[currentSf];
  7437. - pit_gain[currentSf - 2] = pit_gain[currentSf - 1] =
  7438. - pit_gain[currentSf];
  7439. - } else { /* FD short -> ACELP */
  7440. - pitch[currentSf - 1] = pitch[currentSf];
  7441. - pit_gain[currentSf - 1] = pit_gain[currentSf];
  7442. - }
  7443. - }
  7444. - }
  7445. - } else { /* TCX */
  7446. - int lg = lg_table[mod[k]];
  7447. - int isFullBandLpd = 0;
  7448. -
  7449. - /* FAC management */
  7450. - if ((last_lpd_mode == 0) || (last_lpd_mode == 4)) /* TCX TD concealment */
  7451. - {
  7452. - C_AALLOC_SCRATCH_START(fac_buf, FIXP_DBL, 1024 / 8);
  7453. -
  7454. - /* pAacDecoderChannelInfo->data.usac.fac_data[k] == NULL means no FAC
  7455. - * data available. */
  7456. - if (last_frame_lost == 1 ||
  7457. - pAacDecoderChannelInfo->data.usac.fac_data[k] == NULL) {
  7458. - FDKmemclear(fac_buf, 1024 / 8 * sizeof(FIXP_DBL));
  7459. - pAacDecoderChannelInfo->data.usac.fac_data[k] = fac_buf;
  7460. - pAacDecoderChannelInfo->data.usac.fac_data_e[k] = 0;
  7461. - }
  7462. -
  7463. - nrSamples += CLpd_FAC_Acelp2Mdct(
  7464. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples,
  7465. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, k,
  7466. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  7467. - pAacDecoderChannelInfo->specScale + k, 1,
  7468. - pAacDecoderChannelInfo->data.usac.fac_data[k],
  7469. - pAacDecoderChannelInfo->data.usac.fac_data_e[k],
  7470. - pAacDecoderChannelInfo->granuleLength /* == fac_length */,
  7471. - lFrame - nrSamples, lg,
  7472. - FDKgetWindowSlope(lDiv,
  7473. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7474. - lDiv, pAacDecoderChannelInfo->data.usac.lp_coeff[k],
  7475. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[k],
  7476. - &pAacDecoderStaticChannelInfo->acelp,
  7477. - pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7478. - (last_frame_lost || !frameOk), 0 /* is not FD FAC */
  7479. - ,
  7480. - last_lpd_mode, k,
  7481. - pAacDecoderChannelInfo
  7482. - ->currAliasingSymmetry /* Note: The current aliasing
  7483. - symmetry for a TCX (i.e. LPD)
  7484. - frame must always be 0 */
  7485. - );
  7486. -
  7487. - pitch[(k * nbSubfr) + synSfd + 1] = pitch[(k * nbSubfr) + synSfd] =
  7488. - pitch[(k * nbSubfr) + synSfd - 1];
  7489. - pit_gain[(k * nbSubfr) + synSfd + 1] =
  7490. - pit_gain[(k * nbSubfr) + synSfd] =
  7491. - pit_gain[(k * nbSubfr) + synSfd - 1];
  7492. -
  7493. - C_AALLOC_SCRATCH_END(fac_buf, FIXP_DBL, 1024 / 8);
  7494. - } else {
  7495. - int tl = lg;
  7496. - int fl = lDiv;
  7497. - int fr = lDiv;
  7498. -
  7499. - nrSamples += imlt_block(
  7500. - &pAacDecoderStaticChannelInfo->IMdct, synth + nrSamples,
  7501. - SPEC_TCX(pAacDecoderChannelInfo->pSpectralCoefficient, k,
  7502. - pAacDecoderChannelInfo->granuleLength, isFullBandLpd),
  7503. - pAacDecoderChannelInfo->specScale + k, 1, lFrame - nrSamples, tl,
  7504. - FDKgetWindowSlope(fl,
  7505. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7506. - fl,
  7507. - FDKgetWindowSlope(fr,
  7508. - GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
  7509. - fr, pAacDecoderChannelInfo->data.usac.tcx_gain[k],
  7510. - pAacDecoderChannelInfo->currAliasingSymmetry
  7511. - ? MLT_FLAG_CURR_ALIAS_SYMMETRY
  7512. - : 0);
  7513. - }
  7514. - }
  7515. - /* remember previous mode */
  7516. - last_last_lpd_mode = last_lpd_mode;
  7517. - last_lpd_mode = mod[k];
  7518. - last_lpc_lost = (frameOk == 0) ? 1 : 0;
  7519. -
  7520. - /* Increase k to next frame */
  7521. - last_k = k;
  7522. - k += ((mod[k] & 0x3) == 0) ? 1 : (1 << (mod[k] - 1));
  7523. - }
  7524. -
  7525. - if (frameOk) {
  7526. - /* assume data was ok => store for concealment */
  7527. - FDK_ASSERT(pAacDecoderChannelInfo->data.usac.aStability[last_k] >=
  7528. - (FIXP_SGL)0);
  7529. - pAacDecoderStaticChannelInfo->oldStability =
  7530. - pAacDecoderChannelInfo->data.usac.aStability[last_k];
  7531. - FDKmemcpy(pAacDecoderStaticChannelInfo->lsf_adaptive_mean,
  7532. - pAacDecoderChannelInfo->data.usac.lsf_adaptive_mean_cand,
  7533. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7534. - }
  7535. -
  7536. - /* store past lp coeffs for next superframe (they are only valid and needed if
  7537. - * last_lpd_mode was tcx) */
  7538. - if (last_lpd_mode > 0) {
  7539. - FDKmemcpy(pAacDecoderStaticChannelInfo->lp_coeff_old[0],
  7540. - pAacDecoderChannelInfo->data.usac.lp_coeff[nbDiv],
  7541. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7542. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[0] =
  7543. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[nbDiv];
  7544. - FDKmemcpy(pAacDecoderStaticChannelInfo->lp_coeff_old[1],
  7545. - pAacDecoderChannelInfo->data.usac.lp_coeff[last_k],
  7546. - M_LP_FILTER_ORDER * sizeof(FIXP_LPC));
  7547. - pAacDecoderStaticChannelInfo->lp_coeff_old_exp[1] =
  7548. - pAacDecoderChannelInfo->data.usac.lp_coeff_exp[last_k];
  7549. - }
  7550. -
  7551. - FDK_ASSERT(nrSamples == lFrame);
  7552. -
  7553. - /* check whether usage of bass postfilter was de-activated in the bitstream;
  7554. - if yes, set pitch gain to 0 */
  7555. - if (!(pAacDecoderChannelInfo->data.usac.bpf_control_info)) {
  7556. - if (mod[0] != 0 && (pAacDecoderStaticChannelInfo->old_bpf_control_info)) {
  7557. - for (int i = 2; i < nbSubfrSuperfr; i++)
  7558. - pit_gain[synSfd + i] = (FIXP_DBL)0;
  7559. - } else {
  7560. - for (int i = 0; i < nbSubfrSuperfr; i++)
  7561. - pit_gain[synSfd + i] = (FIXP_DBL)0;
  7562. - }
  7563. - }
  7564. -
  7565. - /* for bass postfilter */
  7566. - for (int n = 0; n < synSfd; n++) {
  7567. - pAacDecoderStaticChannelInfo->old_T_pf[n] = pitch[nbSubfrSuperfr + n];
  7568. - pAacDecoderStaticChannelInfo->old_gain_pf[n] = pit_gain[nbSubfrSuperfr + n];
  7569. - }
  7570. -
  7571. - pAacDecoderStaticChannelInfo->old_bpf_control_info =
  7572. - pAacDecoderChannelInfo->data.usac.bpf_control_info;
  7573. -
  7574. - {
  7575. - INT lookahead = -BPF_DELAY;
  7576. - int copySamp = (mod[nbDiv - 1] == 0) ? (aacDelay) : (aacDelay - lFac);
  7577. -
  7578. - /* Copy enough time domain samples from MDCT to synthesis buffer as needed
  7579. - * by the bass postfilter */
  7580. -
  7581. - lookahead += imdct_copy_ov_and_nr(&pAacDecoderStaticChannelInfo->IMdct,
  7582. - synth + nrSamples, copySamp);
  7583. -
  7584. - FDK_ASSERT(lookahead == copySamp - BPF_DELAY);
  7585. -
  7586. - FIXP_DBL *p2_synth = synth + BPF_DELAY;
  7587. -
  7588. - /* recalculate pitch gain to allow postfilering on FAC area */
  7589. - for (int i = 0; i < nbSubfrSuperfr; i++) {
  7590. - int T = pitch[i];
  7591. - FIXP_DBL gain = pit_gain[i];
  7592. -
  7593. - if (gain > (FIXP_DBL)0) {
  7594. - gain = get_gain(&p2_synth[i * L_SUBFR], &p2_synth[(i * L_SUBFR) - T],
  7595. - L_SUBFR);
  7596. - pit_gain[i] = gain;
  7597. - }
  7598. - }
  7599. -
  7600. - {
  7601. - bass_pf_1sf_delay(p2_synth, pitch, pit_gain, lFrame, lFrame / facFB,
  7602. - mod[nbDiv - 1] ? (SynDelay - (lDiv / 2)) : SynDelay,
  7603. - pTimeData, pAacDecoderStaticChannelInfo->mem_bpf);
  7604. - }
  7605. - }
  7606. -
  7607. - Acelp_PostProcessing(synth_buf, pAacDecoderStaticChannelInfo->old_synth,
  7608. - pitch, pAacDecoderStaticChannelInfo->old_T_pf, lFrame,
  7609. - synSfd, nbSubfrSuperfr);
  7610. -
  7611. - /* Store last mode for next super frame */
  7612. - { pAacDecoderStaticChannelInfo->last_core_mode = LPD; }
  7613. - pAacDecoderStaticChannelInfo->last_lpd_mode = last_lpd_mode;
  7614. - pAacDecoderStaticChannelInfo->last_last_lpd_mode = last_last_lpd_mode;
  7615. - pAacDecoderStaticChannelInfo->last_lpc_lost = last_lpc_lost;
  7616. -
  7617. - return error;
  7618. -}
  7619. --- a/libAACdec/src/usacdec_lpd.h
  7620. +++ /dev/null
  7621. @@ -1,198 +0,0 @@
  7622. -/* -----------------------------------------------------------------------------
  7623. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  7624. -
  7625. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  7626. -Forschung e.V. All rights reserved.
  7627. -
  7628. - 1. INTRODUCTION
  7629. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  7630. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  7631. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  7632. -a wide variety of Android devices.
  7633. -
  7634. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  7635. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  7636. -full-bandwidth communications codec by independent studies and is widely
  7637. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  7638. -specifications.
  7639. -
  7640. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  7641. -those of Fraunhofer) may be obtained through Via Licensing
  7642. -(www.vialicensing.com) or through the respective patent owners individually for
  7643. -the purpose of encoding or decoding bit streams in products that are compliant
  7644. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  7645. -Android devices already license these patent claims through Via Licensing or
  7646. -directly from the patent owners, and therefore FDK AAC Codec software may
  7647. -already be covered under those patent licenses when it is used for those
  7648. -licensed purposes only.
  7649. -
  7650. -Commercially-licensed AAC software libraries, including floating-point versions
  7651. -with enhanced sound quality, are also available from Fraunhofer. Users are
  7652. -encouraged to check the Fraunhofer website for additional applications
  7653. -information and documentation.
  7654. -
  7655. -2. COPYRIGHT LICENSE
  7656. -
  7657. -Redistribution and use in source and binary forms, with or without modification,
  7658. -are permitted without payment of copyright license fees provided that you
  7659. -satisfy the following conditions:
  7660. -
  7661. -You must retain the complete text of this software license in redistributions of
  7662. -the FDK AAC Codec or your modifications thereto in source code form.
  7663. -
  7664. -You must retain the complete text of this software license in the documentation
  7665. -and/or other materials provided with redistributions of the FDK AAC Codec or
  7666. -your modifications thereto in binary form. You must make available free of
  7667. -charge copies of the complete source code of the FDK AAC Codec and your
  7668. -modifications thereto to recipients of copies in binary form.
  7669. -
  7670. -The name of Fraunhofer may not be used to endorse or promote products derived
  7671. -from this library without prior written permission.
  7672. -
  7673. -You may not charge copyright license fees for anyone to use, copy or distribute
  7674. -the FDK AAC Codec software or your modifications thereto.
  7675. -
  7676. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  7677. -that you changed the software and the date of any change. For modified versions
  7678. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  7679. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  7680. -AAC Codec Library for Android."
  7681. -
  7682. -3. NO PATENT LICENSE
  7683. -
  7684. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  7685. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  7686. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  7687. -software.
  7688. -
  7689. -You may use this FDK AAC Codec software or modifications thereto only for
  7690. -purposes that are authorized by appropriate patent licenses.
  7691. -
  7692. -4. DISCLAIMER
  7693. -
  7694. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  7695. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  7696. -including but not limited to the implied warranties of merchantability and
  7697. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  7698. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  7699. -or consequential damages, including but not limited to procurement of substitute
  7700. -goods or services; loss of use, data, or profits, or business interruption,
  7701. -however caused and on any theory of liability, whether in contract, strict
  7702. -liability, or tort (including negligence), arising in any way out of the use of
  7703. -this software, even if advised of the possibility of such damage.
  7704. -
  7705. -5. CONTACT INFORMATION
  7706. -
  7707. -Fraunhofer Institute for Integrated Circuits IIS
  7708. -Attention: Audio and Multimedia Departments - FDK AAC LL
  7709. -Am Wolfsmantel 33
  7710. -91058 Erlangen, Germany
  7711. -
  7712. -www.iis.fraunhofer.de/amm
  7713. -amm-info@iis.fraunhofer.de
  7714. ------------------------------------------------------------------------------ */
  7715. -
  7716. -/**************************** AAC decoder library ******************************
  7717. -
  7718. - Author(s): Manuel Jander
  7719. -
  7720. - Description: USAC Linear Prediction Domain coding
  7721. -
  7722. -*******************************************************************************/
  7723. -
  7724. -#ifndef USACDEC_LPD_H
  7725. -#define USACDEC_LPD_H
  7726. -
  7727. -#include "channelinfo.h"
  7728. -
  7729. -#define OPTIMIZE_AVG_PERFORMANCE
  7730. -
  7731. -/**
  7732. - * \brief read a lpd_channel_stream.
  7733. - * \param hBs a bit stream handle, where the lpd_channel_stream is located.
  7734. - * \param pAacDecoderChannelInfo the channel context structure for storing read
  7735. - * data.
  7736. - * \param flags bit stream syntax flags.
  7737. - * \return AAC_DECODER_ERROR error code.
  7738. - */
  7739. -AAC_DECODER_ERROR CLpdChannelStream_Read(
  7740. - HANDLE_FDK_BITSTREAM hBs, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7741. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7742. - const SamplingRateInfo *pSamplingRateInfo, UINT flags);
  7743. -
  7744. -/**
  7745. - * \brief decode one lpd_channel_stream and render the audio output.
  7746. - * \param pAacDecoderChannelInfo struct holding the channel information to be
  7747. - * rendered.
  7748. - * \param pAacDecoderStaticChannelInfo struct holding the persistent channel
  7749. - * information to be rendered.
  7750. - * \param pSamplingRateInfo holds the sampling rate information
  7751. - * \param elFlags holds the internal decoder flags
  7752. - */
  7753. -void CLpdChannelStream_Decode(
  7754. - CAacDecoderChannelInfo *pAacDecoderChannelInfo,
  7755. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo, UINT flags);
  7756. -
  7757. -/**
  7758. - * \brief generate time domain output signal for LPD channel streams
  7759. - * \param pAacDecoderStaticChannelInfo
  7760. - * \param pAacDecoderChannelInfo
  7761. - * \param pTimeData pointer to output buffer
  7762. - * \param samplesPerFrame amount of output samples
  7763. - * \param pSamplingRateInfo holds the sampling rate information
  7764. - * \param pWorkBuffer1 pointer to work buffer for temporal data
  7765. - */
  7766. -AAC_DECODER_ERROR CLpd_RenderTimeSignal(
  7767. - CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
  7768. - CAacDecoderChannelInfo *pAacDecoderChannelInfo, FIXP_PCM *pTimeData,
  7769. - INT samplesPerFrame, SamplingRateInfo *pSamplingRateInfo, UINT frameOk,
  7770. - UINT flags, UINT strmFlags);
  7771. -
  7772. -static inline INT CLpd_FAC_getLength(int fNotShortBlock, int fac_length_long) {
  7773. - if (fNotShortBlock) {
  7774. - return (fac_length_long);
  7775. - } else {
  7776. - return fac_length_long / 2;
  7777. - }
  7778. -}
  7779. -
  7780. -void filtLP(const FIXP_DBL *syn, FIXP_PCM *syn_out, FIXP_DBL *noise,
  7781. - const FIXP_SGL *filt, INT stop, int len);
  7782. -
  7783. -/**
  7784. - * \brief perform a low-frequency pitch enhancement on time domain signal
  7785. - * \param[in] syn pointer to time domain input signal
  7786. - * \param[in] synFB pointer to time domain input signal
  7787. - * \param[in] upsampling factor
  7788. - * \param[in] T_sf array with past decoded pitch period values for each subframe
  7789. - * \param[in] non_zero_gain_flags indicates whether pitch gains of past
  7790. - * subframes are zero or not, msb -> [1 BPF_DELAY subfr][7 SYN_DELAY subfr][16
  7791. - * new subfr] <- lsb
  7792. - * \param[in] l_frame length of filtering, must be multiple of L_SUBFR
  7793. - * \param[in] l_next length of allowed look ahead on syn[i], i < l_frame+l_next
  7794. - * \param[out] synth_out pointer to time domain output signal
  7795. - * \param[in,out] mem_bpf pointer to filter memory (L_FILT+L_SUBFR)
  7796. - */
  7797. -
  7798. -void bass_pf_1sf_delay(FIXP_DBL syn[], const INT T_sf[], FIXP_DBL *pit_gain,
  7799. - const int frame_length, const INT l_frame,
  7800. - const INT l_next, FIXP_PCM *synth_out,
  7801. - FIXP_DBL mem_bpf[]);
  7802. -
  7803. -/**
  7804. - * \brief random sign generator for FD and TCX noise filling
  7805. - * \param[in,out] seed pointer to random seed
  7806. - * \return if return value is zero use positive sign
  7807. - * \Note: This code is also implemented as a copy in block.cpp, grep for
  7808. - * "UsacRandomSign"
  7809. - */
  7810. -FDK_INLINE
  7811. -int UsacRandomSign(ULONG *seed) {
  7812. - *seed = (ULONG)((UINT64)(*seed) * 69069 + 5);
  7813. -
  7814. - return (int)((*seed) & 0x10000);
  7815. -}
  7816. -
  7817. -void CFdp_Reset(CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo);
  7818. -
  7819. -#endif /* USACDEC_LPD_H */
  7820. --- a/libAACdec/src/usacdec_rom.cpp
  7821. +++ /dev/null
  7822. @@ -1,1504 +0,0 @@
  7823. -/* -----------------------------------------------------------------------------
  7824. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  7825. -
  7826. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  7827. -Forschung e.V. All rights reserved.
  7828. -
  7829. - 1. INTRODUCTION
  7830. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  7831. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  7832. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  7833. -a wide variety of Android devices.
  7834. -
  7835. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  7836. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  7837. -full-bandwidth communications codec by independent studies and is widely
  7838. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  7839. -specifications.
  7840. -
  7841. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  7842. -those of Fraunhofer) may be obtained through Via Licensing
  7843. -(www.vialicensing.com) or through the respective patent owners individually for
  7844. -the purpose of encoding or decoding bit streams in products that are compliant
  7845. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  7846. -Android devices already license these patent claims through Via Licensing or
  7847. -directly from the patent owners, and therefore FDK AAC Codec software may
  7848. -already be covered under those patent licenses when it is used for those
  7849. -licensed purposes only.
  7850. -
  7851. -Commercially-licensed AAC software libraries, including floating-point versions
  7852. -with enhanced sound quality, are also available from Fraunhofer. Users are
  7853. -encouraged to check the Fraunhofer website for additional applications
  7854. -information and documentation.
  7855. -
  7856. -2. COPYRIGHT LICENSE
  7857. -
  7858. -Redistribution and use in source and binary forms, with or without modification,
  7859. -are permitted without payment of copyright license fees provided that you
  7860. -satisfy the following conditions:
  7861. -
  7862. -You must retain the complete text of this software license in redistributions of
  7863. -the FDK AAC Codec or your modifications thereto in source code form.
  7864. -
  7865. -You must retain the complete text of this software license in the documentation
  7866. -and/or other materials provided with redistributions of the FDK AAC Codec or
  7867. -your modifications thereto in binary form. You must make available free of
  7868. -charge copies of the complete source code of the FDK AAC Codec and your
  7869. -modifications thereto to recipients of copies in binary form.
  7870. -
  7871. -The name of Fraunhofer may not be used to endorse or promote products derived
  7872. -from this library without prior written permission.
  7873. -
  7874. -You may not charge copyright license fees for anyone to use, copy or distribute
  7875. -the FDK AAC Codec software or your modifications thereto.
  7876. -
  7877. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  7878. -that you changed the software and the date of any change. For modified versions
  7879. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  7880. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  7881. -AAC Codec Library for Android."
  7882. -
  7883. -3. NO PATENT LICENSE
  7884. -
  7885. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  7886. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  7887. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  7888. -software.
  7889. -
  7890. -You may use this FDK AAC Codec software or modifications thereto only for
  7891. -purposes that are authorized by appropriate patent licenses.
  7892. -
  7893. -4. DISCLAIMER
  7894. -
  7895. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  7896. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  7897. -including but not limited to the implied warranties of merchantability and
  7898. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  7899. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  7900. -or consequential damages, including but not limited to procurement of substitute
  7901. -goods or services; loss of use, data, or profits, or business interruption,
  7902. -however caused and on any theory of liability, whether in contract, strict
  7903. -liability, or tort (including negligence), arising in any way out of the use of
  7904. -this software, even if advised of the possibility of such damage.
  7905. -
  7906. -5. CONTACT INFORMATION
  7907. -
  7908. -Fraunhofer Institute for Integrated Circuits IIS
  7909. -Attention: Audio and Multimedia Departments - FDK AAC LL
  7910. -Am Wolfsmantel 33
  7911. -91058 Erlangen, Germany
  7912. -
  7913. -www.iis.fraunhofer.de/amm
  7914. -amm-info@iis.fraunhofer.de
  7915. ------------------------------------------------------------------------------ */
  7916. -
  7917. -/**************************** AAC decoder library ******************************
  7918. -
  7919. - Author(s): M. Jander
  7920. -
  7921. - Description:
  7922. -
  7923. -*******************************************************************************/
  7924. -
  7925. -#include "usacdec_rom.h"
  7926. -
  7927. -#define NB_SPHERE 32
  7928. -#define NB_LEADER 37
  7929. -#define NB_LDSIGN 226
  7930. -#define NB_LDQ3 9
  7931. -#define NB_LDQ4 28
  7932. -
  7933. -/* For bass post filter */
  7934. -#define FL2FXCONST_SGL_FILT(a) FL2FXCONST_SGL(a*(1 << SF_FILT_LP))
  7935. -#define SF_FILT_LP 1
  7936. -
  7937. -/* table of factorial */
  7938. -const UINT fdk_dec_tab_factorial[8] = {5040, 720, 120, 24, 6, 2, 1, 1};
  7939. -
  7940. -/* Da - Absolute leaders */
  7941. -const UCHAR fdk_dec_Da[NB_LEADER][8] = {
  7942. - {1, 1, 1, 1, 1, 1, 1, 1}, {2, 2, 0, 0, 0, 0, 0, 0},
  7943. - {2, 2, 2, 2, 0, 0, 0, 0}, {3, 1, 1, 1, 1, 1, 1, 1},
  7944. - {4, 0, 0, 0, 0, 0, 0, 0}, {2, 2, 2, 2, 2, 2, 0, 0},
  7945. - {3, 3, 1, 1, 1, 1, 1, 1}, {4, 2, 2, 0, 0, 0, 0, 0},
  7946. - {2, 2, 2, 2, 2, 2, 2, 2}, {3, 3, 3, 1, 1, 1, 1, 1},
  7947. - {4, 2, 2, 2, 2, 0, 0, 0}, {4, 4, 0, 0, 0, 0, 0, 0},
  7948. - {5, 1, 1, 1, 1, 1, 1, 1}, {3, 3, 3, 3, 1, 1, 1, 1},
  7949. - {4, 2, 2, 2, 2, 2, 2, 0}, {4, 4, 2, 2, 0, 0, 0, 0},
  7950. - {5, 3, 1, 1, 1, 1, 1, 1}, {6, 2, 0, 0, 0, 0, 0, 0},
  7951. - {4, 4, 4, 0, 0, 0, 0, 0}, {6, 2, 2, 2, 0, 0, 0, 0},
  7952. - {6, 4, 2, 0, 0, 0, 0, 0}, {7, 1, 1, 1, 1, 1, 1, 1},
  7953. - {8, 0, 0, 0, 0, 0, 0, 0}, {6, 6, 0, 0, 0, 0, 0, 0},
  7954. - {8, 2, 2, 0, 0, 0, 0, 0}, {8, 4, 0, 0, 0, 0, 0, 0},
  7955. - {9, 1, 1, 1, 1, 1, 1, 1}, {10, 2, 0, 0, 0, 0, 0, 0},
  7956. - {8, 8, 0, 0, 0, 0, 0, 0}, {10, 6, 0, 0, 0, 0, 0, 0},
  7957. - {12, 0, 0, 0, 0, 0, 0, 0}, {12, 4, 0, 0, 0, 0, 0, 0},
  7958. - {10, 10, 0, 0, 0, 0, 0, 0}, {14, 2, 0, 0, 0, 0, 0, 0},
  7959. - {12, 8, 0, 0, 0, 0, 0, 0}, {16, 0, 0, 0, 0, 0, 0, 0},
  7960. - {20, 0, 0, 0, 0, 0, 0, 0}};
  7961. -
  7962. -/* Ds - Sign codes of all signed leaders */
  7963. -const UCHAR fdk_dec_Ds[NB_LDSIGN] = {
  7964. - 0, 3, 15, 63, 255, 0, 64, 192, 0, 16, 48, 112, 240, 1, 7,
  7965. - 31, 127, 128, 131, 143, 191, 0, 128, 0, 4, 12, 28, 60, 124, 252,
  7966. - 0, 3, 15, 63, 65, 71, 95, 192, 195, 207, 255, 0, 32, 96, 128,
  7967. - 160, 224, 0, 1, 3, 7, 15, 31, 63, 127, 255, 1, 7, 31, 32,
  7968. - 35, 47, 97, 103, 127, 224, 227, 239, 0, 8, 24, 56, 120, 128, 136,
  7969. - 152, 184, 248, 0, 64, 192, 0, 3, 15, 63, 129, 135, 159, 255, 0,
  7970. - 3, 15, 17, 23, 48, 51, 63, 113, 119, 240, 243, 255, 0, 2, 6,
  7971. - 14, 30, 62, 126, 128, 130, 134, 142, 158, 190, 254, 0, 16, 48, 64,
  7972. - 80, 112, 192, 208, 240, 1, 7, 31, 64, 67, 79, 127, 128, 131, 143,
  7973. - 191, 193, 199, 223, 0, 64, 128, 192, 0, 32, 96, 224, 0, 16, 48,
  7974. - 112, 128, 144, 176, 240, 0, 32, 64, 96, 128, 160, 192, 224, 1, 7,
  7975. - 31, 127, 128, 131, 143, 191, 0, 128, 0, 64, 192, 0, 32, 96, 128,
  7976. - 160, 224, 0, 64, 128, 192, 0, 3, 15, 63, 129, 135, 159, 255, 0,
  7977. - 64, 128, 192, 0, 64, 192, 0, 64, 128, 192, 0, 128, 0, 64, 128,
  7978. - 192, 0, 64, 192, 0, 64, 128, 192, 0, 64, 128, 192, 0, 128, 0,
  7979. - 128};
  7980. -
  7981. -/* Ns - Number of signed leader associated to a given absolute leader */
  7982. -const UCHAR fdk_dec_Ns[NB_LEADER] = {
  7983. - 5, 3, 5, 8, 2, 7, 11, 6, 9, 12, 10, 3, 8, 13, 14, 9, 14, 4, 4,
  7984. - 8, 8, 8, 2, 3, 6, 4, 8, 4, 3, 4, 2, 4, 3, 4, 4, 2, 2};
  7985. -
  7986. -/* Ia - Position of the first signed leader associated to an absolute leader */
  7987. -const UCHAR fdk_dec_Ia[NB_LEADER] = {
  7988. - 0, 5, 8, 13, 21, 23, 30, 41, 47, 56, 68, 78, 81,
  7989. - 89, 102, 116, 125, 139, 143, 147, 155, 163, 171, 173, 176, 182,
  7990. - 186, 194, 198, 201, 205, 207, 211, 214, 218, 222, 224};
  7991. -
  7992. -/* Is - Cardinalite offset of signed leaders */
  7993. -const USHORT fdk_dec_Is[NB_LDSIGN] = {
  7994. - 0, 1, 29, 99, 127, 128, 156, 212, 256, 326, 606,
  7995. - 1026, 1306, 1376, 1432, 1712, 1880, 1888, 1896, 2064, 2344, 240,
  7996. - 248, 0, 28, 196, 616, 1176, 1596, 1764, 1792, 1820, 2240,
  7997. - 2660, 2688, 3024, 4144, 4480, 4508, 4928, 5348, 2400, 2568, 2904,
  7998. - 3072, 3240, 3576, 5376, 5377, 5385, 5413, 5469, 5539, 5595, 5623,
  7999. - 5631, 5632, 5912, 6472, 6528, 6696, 8376, 9216, 10056, 11736, 11904,
  8000. - 11960, 12520, 12800, 13080, 14200, 15880, 17000, 17280, 17560, 18680, 20360,
  8001. - 21480, 3744, 3772, 3828, 21760, 21768, 21936, 22216, 22272, 22328, 22608,
  8002. - 22776, 22784, 22854, 23274, 23344, 24464, 25584, 26004, 28524, 28944, 30064,
  8003. - 31184, 31254, 31674, 31744, 31800, 32136, 32976, 34096, 34936, 35272, 35328,
  8004. - 35384, 35720, 36560, 37680, 38520, 38856, 38912, 39332, 40172, 40592, 41432,
  8005. - 43112, 43952, 44372, 45212, 45632, 45968, 47088, 47424, 47480, 48320, 49160,
  8006. - 49216, 49272, 50112, 50952, 51008, 51344, 52464, 3856, 3912, 3968, 4024,
  8007. - 52800, 52856, 53024, 53192, 53248, 53528, 54368, 55208, 55488, 55768, 56608,
  8008. - 57448, 57728, 58064, 58400, 58736, 59072, 59408, 59744, 60080, 60416, 60472,
  8009. - 60752, 60920, 60928, 60936, 61104, 61384, 4080, 4088, 61440, 61468, 61524,
  8010. - 61552, 61720, 62056, 62224, 62392, 62728, 62896, 62952, 63008, 63064, 63120,
  8011. - 63128, 63296, 63576, 63632, 63688, 63968, 64136, 64144, 64200, 64256, 64312,
  8012. - 64368, 64396, 64452, 64480, 64536, 64592, 64648, 64704, 64712, 64720, 64776,
  8013. - 64832, 64888, 64944, 64972, 65028, 65056, 65112, 65168, 65224, 65280, 65336,
  8014. - 65392, 65448, 65504, 65512, 65520, 65528};
  8015. -
  8016. -/* A3 - Number of the absolute leaders in codebooks Q2 and Q3 */
  8017. -const UCHAR fdk_dec_A3[NB_LDQ3] = {0, 1, 4, 2, 3, 7, 11, 17, 22};
  8018. -
  8019. -/* A4 - Number of the absolute leaders in codebook Q4 */
  8020. -const UCHAR fdk_dec_A4[NB_LDQ4] = {5, 6, 8, 9, 10, 12, 13, 14, 15, 16,
  8021. - 18, 19, 20, 21, 23, 24, 25, 26, 27, 28,
  8022. - 29, 30, 31, 32, 33, 34, 35, 36};
  8023. -
  8024. -/* I3 - Cardinality offsets for absolute leaders in Q3 */
  8025. -const USHORT fdk_dec_I3[NB_LDQ3] = {0, 128, 240, 256, 1376,
  8026. - 2400, 3744, 3856, 4080};
  8027. -
  8028. -/* I4 - Cardinality offset for absolute leaders in Q4 */
  8029. -const USHORT fdk_dec_I4[NB_LDQ4] = {
  8030. - 0, 1792, 5376, 5632, 12800, 21760, 22784, 31744, 38912, 45632,
  8031. - 52800, 53248, 57728, 60416, 61440, 61552, 62896, 63120, 64144, 64368,
  8032. - 64480, 64704, 64720, 64944, 65056, 65280, 65504, 65520};
  8033. -
  8034. -/* Initial ISF memory for concealment case */
  8035. -#define LSFI(x) ((x) << (FRACT_BITS - LSF_SCALE - 1))
  8036. -
  8037. -const FIXP_LPC fdk_dec_lsf_init[16] = {1506, 3012, 4518, 6024, 7529, 9035,
  8038. - 10541, 12047, 13553, 15059, 16565, 18071,
  8039. - 19576, 21082, 22588, 24094};
  8040. -
  8041. -/* dico_lsf_abs_8b is scaled by 1/(1<<13) */
  8042. -#define DICO(x) FX_DBL2FXCONST_LPC(x >> (LSF_SCALE - 13))
  8043. -
  8044. -const FIXP_LPC fdk_dec_dico_lsf_abs_8b[] = {
  8045. - DICO(0x05e57fe8), DICO(0x0ac00810), DICO(0x11ed8500), DICO(0x16d42ce0),
  8046. - DICO(0x1beb1e20), DICO(0x217eaf40), DICO(0x2768c740), DICO(0x2d26f600),
  8047. - DICO(0x32fe68c0), DICO(0x38b1d980), DICO(0x3e95bd80), DICO(0x446dab00),
  8048. - DICO(0x4abfd280), DICO(0x5094b380), DICO(0x56ccb800), DICO(0x5c9aba00),
  8049. - DICO(0x09660ca0), DICO(0x10ab4c00), DICO(0x15a16f20), DICO(0x19d3c780),
  8050. - DICO(0x1ee99060), DICO(0x241d1200), DICO(0x29c83700), DICO(0x2f098f00),
  8051. - DICO(0x34803fc0), DICO(0x3a37bc00), DICO(0x3ff55580), DICO(0x45da9280),
  8052. - DICO(0x4bec6700), DICO(0x5169e300), DICO(0x57797c80), DICO(0x5d09ae80),
  8053. - DICO(0x08a203b0), DICO(0x0d6ed1a0), DICO(0x152ccf20), DICO(0x19639dc0),
  8054. - DICO(0x1d7e3e60), DICO(0x21f4a7c0), DICO(0x27b2f8c0), DICO(0x2dbb4480),
  8055. - DICO(0x33ecde80), DICO(0x3982e100), DICO(0x3ea16100), DICO(0x43ab6080),
  8056. - DICO(0x49534a80), DICO(0x4ea7e100), DICO(0x550d6300), DICO(0x5bcdcc80),
  8057. - DICO(0x072dd048), DICO(0x0c654690), DICO(0x1436e940), DICO(0x19459680),
  8058. - DICO(0x1e0041c0), DICO(0x2240dc80), DICO(0x26de4040), DICO(0x2b509b00),
  8059. - DICO(0x309d8780), DICO(0x36151180), DICO(0x3c6c1200), DICO(0x42df6b80),
  8060. - DICO(0x4a144400), DICO(0x50541280), DICO(0x56c34b80), DICO(0x5cb6c600),
  8061. - DICO(0x051fef00), DICO(0x06b9fb48), DICO(0x0b4f9cc0), DICO(0x17e27800),
  8062. - DICO(0x1b8c7340), DICO(0x1f772ca0), DICO(0x2478dc80), DICO(0x28242240),
  8063. - DICO(0x2f27c640), DICO(0x33b03e80), DICO(0x381f20c0), DICO(0x3c662c00),
  8064. - DICO(0x49565080), DICO(0x529b0f00), DICO(0x583ed080), DICO(0x5d8cec00),
  8065. - DICO(0x071c4d18), DICO(0x097853b0), DICO(0x0f0f0690), DICO(0x157bf980),
  8066. - DICO(0x1801f580), DICO(0x1deb0c20), DICO(0x2523da40), DICO(0x28534600),
  8067. - DICO(0x2eb499c0), DICO(0x32eb5ac0), DICO(0x36749580), DICO(0x3a748200),
  8068. - DICO(0x4325f700), DICO(0x515d8300), DICO(0x58a18700), DICO(0x5d722100),
  8069. - DICO(0x06cbcd88), DICO(0x08bb6740), DICO(0x0dead310), DICO(0x152f0cc0),
  8070. - DICO(0x18427640), DICO(0x1d9f2f20), DICO(0x22ba3b40), DICO(0x271a6e80),
  8071. - DICO(0x2c677ec0), DICO(0x31061b00), DICO(0x349eef40), DICO(0x3c531b80),
  8072. - DICO(0x4aed0580), DICO(0x4f8bbf80), DICO(0x54b74980), DICO(0x5bc9b700),
  8073. - DICO(0x046410c8), DICO(0x06522ab0), DICO(0x0b6528c0), DICO(0x0f94bd90),
  8074. - DICO(0x1a8f8b80), DICO(0x1ea57820), DICO(0x233ee180), DICO(0x27b3acc0),
  8075. - DICO(0x2bd1d240), DICO(0x2fc4bcc0), DICO(0x3a98ea40), DICO(0x43d3f500),
  8076. - DICO(0x49b37580), DICO(0x4e2afd00), DICO(0x55953300), DICO(0x5d36f600),
  8077. - DICO(0x05d0f6c8), DICO(0x07e56d90), DICO(0x0be98080), DICO(0x0f956f30),
  8078. - DICO(0x1259b3c0), DICO(0x1f08b240), DICO(0x25008c00), DICO(0x2900b180),
  8079. - DICO(0x31ea6f00), DICO(0x352d1e00), DICO(0x3c970c80), DICO(0x45271200),
  8080. - DICO(0x4b632280), DICO(0x5098a480), DICO(0x5672fc80), DICO(0x5c163180),
  8081. - DICO(0x05bd81a0), DICO(0x07d4b8f0), DICO(0x0ce224b0), DICO(0x110abe20),
  8082. - DICO(0x13dfeac0), DICO(0x17dedae0), DICO(0x2535c0c0), DICO(0x2a19da80),
  8083. - DICO(0x2e5224c0), DICO(0x38ddeec0), DICO(0x3da99d80), DICO(0x42799100),
  8084. - DICO(0x48973b00), DICO(0x4ea62880), DICO(0x53f77e80), DICO(0x5bd9c100),
  8085. - DICO(0x0395cd50), DICO(0x058244b8), DICO(0x0af45520), DICO(0x1329cea0),
  8086. - DICO(0x1a3970c0), DICO(0x1d9f2e00), DICO(0x21704400), DICO(0x277a34c0),
  8087. - DICO(0x30215b40), DICO(0x33875040), DICO(0x3c159840), DICO(0x452fea00),
  8088. - DICO(0x4981d200), DICO(0x4e15a980), DICO(0x54e84780), DICO(0x5c79ea00),
  8089. - DICO(0x05413b98), DICO(0x08132a80), DICO(0x0dc7f050), DICO(0x13e25460),
  8090. - DICO(0x1784bf80), DICO(0x1d630200), DICO(0x238bc880), DICO(0x28cc0880),
  8091. - DICO(0x30da1a40), DICO(0x391e2200), DICO(0x415d8d00), DICO(0x48f13280),
  8092. - DICO(0x4e300300), DICO(0x52e56580), DICO(0x5849fe80), DICO(0x5cdef400),
  8093. - DICO(0x04a058c8), DICO(0x07569b88), DICO(0x0ef26610), DICO(0x13208140),
  8094. - DICO(0x168c0500), DICO(0x1afec080), DICO(0x22a0abc0), DICO(0x2a057880),
  8095. - DICO(0x2fd1c840), DICO(0x3703c680), DICO(0x3d326b80), DICO(0x43df2e80),
  8096. - DICO(0x4a6f9000), DICO(0x50900d80), DICO(0x56c73f00), DICO(0x5cc3da80),
  8097. - DICO(0x065c99e8), DICO(0x09060c50), DICO(0x0d1ef1c0), DICO(0x16bd9020),
  8098. - DICO(0x1a04dae0), DICO(0x1e3c0580), DICO(0x25783700), DICO(0x29710ac0),
  8099. - DICO(0x309cbb80), DICO(0x36c66280), DICO(0x3adb0580), DICO(0x41b37e00),
  8100. - DICO(0x496ca700), DICO(0x4dab7600), DICO(0x52be6280), DICO(0x58fec480),
  8101. - DICO(0x04640880), DICO(0x05a75ab8), DICO(0x0edba410), DICO(0x16e076a0),
  8102. - DICO(0x198acec0), DICO(0x1eb5fae0), DICO(0x228c9000), DICO(0x29986c00),
  8103. - DICO(0x2c780c80), DICO(0x38078dc0), DICO(0x3f42dc00), DICO(0x441ba900),
  8104. - DICO(0x492f8080), DICO(0x4ed85d00), DICO(0x54605800), DICO(0x5d106a80),
  8105. - DICO(0x045cb970), DICO(0x0627a828), DICO(0x0db35290), DICO(0x1778f780),
  8106. - DICO(0x1a243c60), DICO(0x23c2dd40), DICO(0x27c57840), DICO(0x2f53cd80),
  8107. - DICO(0x36f65600), DICO(0x3bc1b2c0), DICO(0x40c36500), DICO(0x46074180),
  8108. - DICO(0x4b551b80), DICO(0x50a99700), DICO(0x569b6c80), DICO(0x5ca25780),
  8109. - DICO(0x05ef2828), DICO(0x07d3adf8), DICO(0x0b5416d0), DICO(0x0f9adb70),
  8110. - DICO(0x126e7360), DICO(0x1baff460), DICO(0x2b5decc0), DICO(0x31036200),
  8111. - DICO(0x34ca7500), DICO(0x39681340), DICO(0x3da97100), DICO(0x4161ee00),
  8112. - DICO(0x46a62e80), DICO(0x4d1b9380), DICO(0x530e0300), DICO(0x59ff0480),
  8113. - DICO(0x04f5bc50), DICO(0x06e90d18), DICO(0x0c2af480), DICO(0x123f7400),
  8114. - DICO(0x1530a160), DICO(0x18aa3dc0), DICO(0x1cc0a240), DICO(0x2cdb02c0),
  8115. - DICO(0x32909a00), DICO(0x36bae640), DICO(0x3c917a80), DICO(0x40121900),
  8116. - DICO(0x48a90d80), DICO(0x51ccc180), DICO(0x5884ea00), DICO(0x5dbc4280),
  8117. - DICO(0x05791410), DICO(0x07b0dd80), DICO(0x0bec4190), DICO(0x13c30520),
  8118. - DICO(0x17ac1900), DICO(0x1b6f1d00), DICO(0x26e54f40), DICO(0x2d4a8040),
  8119. - DICO(0x311c6840), DICO(0x38ec4180), DICO(0x3f0c4340), DICO(0x427c5b00),
  8120. - DICO(0x4886e480), DICO(0x504a0b00), DICO(0x56d48700), DICO(0x5c80f600),
  8121. - DICO(0x04b58880), DICO(0x0743f0d8), DICO(0x0be95e20), DICO(0x0fd0d9b0),
  8122. - DICO(0x1c2e11a0), DICO(0x2241af80), DICO(0x296e83c0), DICO(0x2f16adc0),
  8123. - DICO(0x32cd6fc0), DICO(0x374ddec0), DICO(0x3da95f80), DICO(0x45d56c80),
  8124. - DICO(0x4c6afa80), DICO(0x5141f380), DICO(0x5616b380), DICO(0x5c58f580),
  8125. - DICO(0x03f4b368), DICO(0x05939890), DICO(0x09d95480), DICO(0x122cac60),
  8126. - DICO(0x17e27e00), DICO(0x1f9dc680), DICO(0x26e26680), DICO(0x2ae64040),
  8127. - DICO(0x2dd6cf40), DICO(0x3295c400), DICO(0x3e23b400), DICO(0x44fd0380),
  8128. - DICO(0x4ad7a700), DICO(0x51295e80), DICO(0x594a9400), DICO(0x5e41aa00),
  8129. - DICO(0x0424b9d8), DICO(0x05b30508), DICO(0x09380f20), DICO(0x0c9509c0),
  8130. - DICO(0x18730860), DICO(0x219a9d40), DICO(0x24f699c0), DICO(0x289b2680),
  8131. - DICO(0x2cb62240), DICO(0x36e88180), DICO(0x3e968800), DICO(0x48053c80),
  8132. - DICO(0x4d6dca80), DICO(0x51d9a580), DICO(0x563e5a80), DICO(0x5c0b2b80),
  8133. - DICO(0x03456ae8), DICO(0x04e49948), DICO(0x07dd0e88), DICO(0x0ed5cd30),
  8134. - DICO(0x1b06e980), DICO(0x1de2b9c0), DICO(0x21160540), DICO(0x270a8240),
  8135. - DICO(0x3352a280), DICO(0x3b8b6c00), DICO(0x40241400), DICO(0x43f60f80),
  8136. - DICO(0x4a897900), DICO(0x51692a00), DICO(0x57449d00), DICO(0x5d497480),
  8137. - DICO(0x04b94290), DICO(0x067e99d0), DICO(0x0ab06840), DICO(0x0e697070),
  8138. - DICO(0x1745c460), DICO(0x22ee8040), DICO(0x2647e8c0), DICO(0x2bc2c680),
  8139. - DICO(0x2fd57d00), DICO(0x37186680), DICO(0x3d074500), DICO(0x412b2800),
  8140. - DICO(0x4579af00), DICO(0x4caff980), DICO(0x557add00), DICO(0x5c6ae780),
  8141. - DICO(0x0423a090), DICO(0x05b9bca0), DICO(0x091b45d0), DICO(0x0c5b6d60),
  8142. - DICO(0x194dd1c0), DICO(0x1fc85020), DICO(0x2486b080), DICO(0x2920af80),
  8143. - DICO(0x2dd4f140), DICO(0x3598be40), DICO(0x3b9c1440), DICO(0x42d19280),
  8144. - DICO(0x4a314280), DICO(0x50b00a00), DICO(0x56c55400), DICO(0x5d5ba300),
  8145. - DICO(0x03e68b28), DICO(0x05a7b190), DICO(0x0917f000), DICO(0x0d247050),
  8146. - DICO(0x19e637a0), DICO(0x2221a540), DICO(0x2777e540), DICO(0x2c103380),
  8147. - DICO(0x30c2e040), DICO(0x389f1240), DICO(0x3f4a2c80), DICO(0x454a4c00),
  8148. - DICO(0x4b0ab680), DICO(0x50cf6000), DICO(0x571c0700), DICO(0x5d2ef600),
  8149. - DICO(0x04886f18), DICO(0x065103e8), DICO(0x0a607d40), DICO(0x0db91960),
  8150. - DICO(0x13546f20), DICO(0x22f5e200), DICO(0x27064240), DICO(0x2e371d40),
  8151. - DICO(0x33659240), DICO(0x38aa1c40), DICO(0x417bb280), DICO(0x47ca9480),
  8152. - DICO(0x4dd6fb80), DICO(0x528e3480), DICO(0x57c49d80), DICO(0x5cc98100),
  8153. - DICO(0x02db2370), DICO(0x04398848), DICO(0x07a8da38), DICO(0x10b90280),
  8154. - DICO(0x1a2a4a20), DICO(0x20b1f640), DICO(0x277096c0), DICO(0x2dc568c0),
  8155. - DICO(0x341b33c0), DICO(0x3a000640), DICO(0x40152880), DICO(0x45eeee00),
  8156. - DICO(0x4c08c480), DICO(0x51bf0600), DICO(0x5799a180), DICO(0x5d23db80),
  8157. - DICO(0x047b1498), DICO(0x06089848), DICO(0x0905af20), DICO(0x0bf13c20),
  8158. - DICO(0x11fcf620), DICO(0x1f79cd00), DICO(0x257f6b40), DICO(0x2cfc2600),
  8159. - DICO(0x31610040), DICO(0x35ea8280), DICO(0x3c774bc0), DICO(0x44417280),
  8160. - DICO(0x4b432500), DICO(0x510e9480), DICO(0x56f2e480), DICO(0x5d282780),
  8161. - DICO(0x02cfd0b0), DICO(0x042845d8), DICO(0x0a1fa610), DICO(0x15911fc0),
  8162. - DICO(0x1bc07f00), DICO(0x2281d640), DICO(0x287abcc0), DICO(0x2ec6b400),
  8163. - DICO(0x34a0d040), DICO(0x3aa4dcc0), DICO(0x4074d980), DICO(0x46726b80),
  8164. - DICO(0x4c3bf900), DICO(0x52055100), DICO(0x57b20500), DICO(0x5d34da80),
  8165. - DICO(0x04d4f768), DICO(0x06cad828), DICO(0x0b52a540), DICO(0x0ea224e0),
  8166. - DICO(0x13c3f460), DICO(0x23808900), DICO(0x27d1cec0), DICO(0x2d6051c0),
  8167. - DICO(0x33c5ff00), DICO(0x37ef2440), DICO(0x3d2a5300), DICO(0x43266000),
  8168. - DICO(0x4a53a100), DICO(0x50acce80), DICO(0x57612100), DICO(0x5cdee380),
  8169. - DICO(0x04039a88), DICO(0x0626dcb0), DICO(0x0c059620), DICO(0x12c3db20),
  8170. - DICO(0x1bb9eb40), DICO(0x240fda00), DICO(0x2baab840), DICO(0x3177c5c0),
  8171. - DICO(0x36cf2e40), DICO(0x3c025100), DICO(0x40bb8d00), DICO(0x45960800),
  8172. - DICO(0x4adaca00), DICO(0x505a7300), DICO(0x566a6400), DICO(0x5c8ce000),
  8173. - DICO(0x062891e8), DICO(0x09680810), DICO(0x0e9a11b0), DICO(0x1523e320),
  8174. - DICO(0x1c57db00), DICO(0x21f22c80), DICO(0x28aeeb00), DICO(0x2e4fd600),
  8175. - DICO(0x341cf000), DICO(0x3a5034c0), DICO(0x40600f80), DICO(0x461fde00),
  8176. - DICO(0x4c368480), DICO(0x51dbbc00), DICO(0x57709780), DICO(0x5cce9880),
  8177. - DICO(0x05d41f70), DICO(0x0a65bb30), DICO(0x132ddfa0), DICO(0x17d26820),
  8178. - DICO(0x1e6d8380), DICO(0x24e68dc0), DICO(0x2b68c4c0), DICO(0x30fa2880),
  8179. - DICO(0x361998c0), DICO(0x3aa1d640), DICO(0x3f942400), DICO(0x44d11680),
  8180. - DICO(0x4ab8e580), DICO(0x50643b80), DICO(0x5697fe00), DICO(0x5cb3a780),
  8181. - DICO(0x0707fa10), DICO(0x0cb8beb0), DICO(0x15011d20), DICO(0x1a4ad300),
  8182. - DICO(0x20997080), DICO(0x26dbe240), DICO(0x2d907880), DICO(0x3307a3c0),
  8183. - DICO(0x38819740), DICO(0x3d3e89c0), DICO(0x41ea2300), DICO(0x469ce200),
  8184. - DICO(0x4be61680), DICO(0x51261b80), DICO(0x5716ef80), DICO(0x5cba2900),
  8185. - DICO(0x084dc830), DICO(0x0f16f610), DICO(0x16ca2420), DICO(0x1bb58380),
  8186. - DICO(0x22f00f00), DICO(0x296ba4c0), DICO(0x306d2600), DICO(0x362ca080),
  8187. - DICO(0x3b86d280), DICO(0x3ffa96c0), DICO(0x446a5300), DICO(0x48d0fd00),
  8188. - DICO(0x4d8a0800), DICO(0x525bf200), DICO(0x57f5aa00), DICO(0x5d569480),
  8189. - DICO(0x08d664f0), DICO(0x110c8520), DICO(0x1865fa40), DICO(0x1efe3160),
  8190. - DICO(0x26f38740), DICO(0x2d4608c0), DICO(0x32862500), DICO(0x374f8840),
  8191. - DICO(0x3bfa9900), DICO(0x3ff5c8c0), DICO(0x4450c500), DICO(0x4918e680),
  8192. - DICO(0x4e1d0f00), DICO(0x53342600), DICO(0x58a38e00), DICO(0x5dbbff00),
  8193. - DICO(0x09143fd0), DICO(0x0f401c30), DICO(0x169c1ee0), DICO(0x1bcfb280),
  8194. - DICO(0x2190dd00), DICO(0x27bf56c0), DICO(0x2e8e0640), DICO(0x34b67080),
  8195. - DICO(0x3b534dc0), DICO(0x41134c00), DICO(0x467a3280), DICO(0x4bd63600),
  8196. - DICO(0x50de8700), DICO(0x55657580), DICO(0x5a0cef00), DICO(0x5e8aa200),
  8197. - DICO(0x06b5d860), DICO(0x0c8a5000), DICO(0x13343620), DICO(0x17a2abe0),
  8198. - DICO(0x1caf7340), DICO(0x22a3f740), DICO(0x29059980), DICO(0x2ecff880),
  8199. - DICO(0x34ce0f00), DICO(0x3ad32280), DICO(0x40f08d80), DICO(0x46d1d400),
  8200. - DICO(0x4ca9df00), DICO(0x523b9580), DICO(0x57ea9b80), DICO(0x5d4a9a00),
  8201. - DICO(0x03822fec), DICO(0x0522c670), DICO(0x099f89a0), DICO(0x12ddc9c0),
  8202. - DICO(0x17c3d380), DICO(0x1d27ec20), DICO(0x2219e480), DICO(0x25fdf580),
  8203. - DICO(0x329d6500), DICO(0x368ba040), DICO(0x3afedb00), DICO(0x430db980),
  8204. - DICO(0x4a105380), DICO(0x51205080), DICO(0x5673b880), DICO(0x5ca2e500),
  8205. - DICO(0x04e07408), DICO(0x06a13dc0), DICO(0x0b31c780), DICO(0x0e67fcd0),
  8206. - DICO(0x13723240), DICO(0x1f87a840), DICO(0x2321ab00), DICO(0x2c604680),
  8207. - DICO(0x310bc180), DICO(0x351eea40), DICO(0x3a2d6440), DICO(0x3e7ebac0),
  8208. - DICO(0x4798ef80), DICO(0x50721100), DICO(0x57ff9880), DICO(0x5dc2e080),
  8209. - DICO(0x05d626b8), DICO(0x07eaf140), DICO(0x0c5675b0), DICO(0x0eba7b00),
  8210. - DICO(0x1a7f36c0), DICO(0x1f969200), DICO(0x244d8c00), DICO(0x29666440),
  8211. - DICO(0x2c94b100), DICO(0x31865380), DICO(0x3713c000), DICO(0x3c228f40),
  8212. - DICO(0x4296ed80), DICO(0x4dcbde00), DICO(0x56059a00), DICO(0x5c932d00),
  8213. - DICO(0x07dceb20), DICO(0x0b533fe0), DICO(0x0eb18880), DICO(0x13124220),
  8214. - DICO(0x167f74e0), DICO(0x1afbee40), DICO(0x229e2f80), DICO(0x26b05ec0),
  8215. - DICO(0x2c7b4040), DICO(0x32806140), DICO(0x38da6540), DICO(0x3e495540),
  8216. - DICO(0x444d3880), DICO(0x4e784400), DICO(0x5865f580), DICO(0x5e616180),
  8217. - DICO(0x06395790), DICO(0x084b8f20), DICO(0x0d0e26a0), DICO(0x10897ac0),
  8218. - DICO(0x14bcd080), DICO(0x1c5babe0), DICO(0x2108f9c0), DICO(0x274f8e80),
  8219. - DICO(0x2b0ba180), DICO(0x305b8480), DICO(0x383ad300), DICO(0x3e34f440),
  8220. - DICO(0x47f7aa00), DICO(0x4fdb5880), DICO(0x56b8c280), DICO(0x5d07d700),
  8221. - DICO(0x051f0880), DICO(0x071b8fa8), DICO(0x0ce79c90), DICO(0x1005bd60),
  8222. - DICO(0x14a4a080), DICO(0x183def40), DICO(0x1ee8d0a0), DICO(0x2c5b9bc0),
  8223. - DICO(0x309f9dc0), DICO(0x35659380), DICO(0x3c0439c0), DICO(0x49603800),
  8224. - DICO(0x5018a800), DICO(0x54862380), DICO(0x593edd80), DICO(0x5d415b80),
  8225. - DICO(0x051c8108), DICO(0x06bd97d8), DICO(0x0b47d030), DICO(0x0d9c81a0),
  8226. - DICO(0x178f0be0), DICO(0x1cdf7c80), DICO(0x2183db40), DICO(0x26ec7180),
  8227. - DICO(0x2a3856c0), DICO(0x366c9b40), DICO(0x3d3611c0), DICO(0x42788100),
  8228. - DICO(0x4981f200), DICO(0x4dd68380), DICO(0x55286a00), DICO(0x5cc72500),
  8229. - DICO(0x06ee58c8), DICO(0x098b1310), DICO(0x0ccbd880), DICO(0x0f9d68f0),
  8230. - DICO(0x1277ac40), DICO(0x1d71faa0), DICO(0x230d9480), DICO(0x276b8c00),
  8231. - DICO(0x2ec77000), DICO(0x31f2a700), DICO(0x3bee0200), DICO(0x42250700),
  8232. - DICO(0x466b7100), DICO(0x4de41980), DICO(0x56a08d80), DICO(0x5d700880),
  8233. - DICO(0x062f1d80), DICO(0x091bcd30), DICO(0x0cd875e0), DICO(0x0fd42e60),
  8234. - DICO(0x1322b980), DICO(0x1f11b480), DICO(0x2651e5c0), DICO(0x29f9b480),
  8235. - DICO(0x2e238840), DICO(0x30fc58c0), DICO(0x37aa3040), DICO(0x3e9ac580),
  8236. - DICO(0x44c6fd00), DICO(0x4eba4300), DICO(0x56fdad00), DICO(0x5d885700),
  8237. - DICO(0x04213a78), DICO(0x05d028c0), DICO(0x09a1f9e0), DICO(0x0d28ae90),
  8238. - DICO(0x151819a0), DICO(0x1c78c860), DICO(0x21d78f00), DICO(0x29992cc0),
  8239. - DICO(0x2fbdc180), DICO(0x36bab700), DICO(0x3d4db1c0), DICO(0x4402a280),
  8240. - DICO(0x4a920700), DICO(0x50988600), DICO(0x5717c100), DICO(0x5d52c200),
  8241. - DICO(0x036af4bc), DICO(0x0514cf40), DICO(0x09ec2d30), DICO(0x113de160),
  8242. - DICO(0x1991b700), DICO(0x20590bc0), DICO(0x23892a00), DICO(0x2654cd00),
  8243. - DICO(0x2ff5c0c0), DICO(0x387ed380), DICO(0x3e305300), DICO(0x46137700),
  8244. - DICO(0x4bc29100), DICO(0x4f96dd80), DICO(0x564aca00), DICO(0x5c4d9e80),
  8245. - DICO(0x041051a0), DICO(0x0734dad8), DICO(0x1064e780), DICO(0x14d8bf00),
  8246. - DICO(0x19727e40), DICO(0x1f7bede0), DICO(0x25b5ebc0), DICO(0x2c71fd40),
  8247. - DICO(0x32813740), DICO(0x39340c80), DICO(0x3f974f40), DICO(0x45ca1580),
  8248. - DICO(0x4be69f00), DICO(0x51c9c900), DICO(0x57a1ce80), DICO(0x5d0b2b00),
  8249. - DICO(0x04b73008), DICO(0x06598b60), DICO(0x0b0aee00), DICO(0x15ac7ba0),
  8250. - DICO(0x18b5e340), DICO(0x1f5308c0), DICO(0x23cfc4c0), DICO(0x27d3fdc0),
  8251. - DICO(0x30138080), DICO(0x343c85c0), DICO(0x389cb540), DICO(0x42def900),
  8252. - DICO(0x4aa6a000), DICO(0x4f719580), DICO(0x5585d080), DICO(0x5bc03f00),
  8253. - DICO(0x05601b88), DICO(0x07616b88), DICO(0x0c22ba40), DICO(0x16bc8200),
  8254. - DICO(0x192ebf80), DICO(0x1f71c120), DICO(0x25c59d00), DICO(0x28f76d00),
  8255. - DICO(0x33dbdd80), DICO(0x39f40d80), DICO(0x3da0c880), DICO(0x432c1e00),
  8256. - DICO(0x4aa19d80), DICO(0x51006f80), DICO(0x56a62e80), DICO(0x5c67d000),
  8257. - DICO(0x053095d0), DICO(0x06c43fc8), DICO(0x0f80a460), DICO(0x139b4960),
  8258. - DICO(0x1769ed80), DICO(0x1c828b00), DICO(0x21195980), DICO(0x26329800),
  8259. - DICO(0x29f35900), DICO(0x2dc9df80), DICO(0x3795f0c0), DICO(0x43139b00),
  8260. - DICO(0x4acae680), DICO(0x5048de00), DICO(0x57c11880), DICO(0x5db35900),
  8261. - DICO(0x0466e180), DICO(0x05d31550), DICO(0x10cad200), DICO(0x168c2be0),
  8262. - DICO(0x1a5e9580), DICO(0x1ef2d480), DICO(0x238db240), DICO(0x2920ce80),
  8263. - DICO(0x2c80b4c0), DICO(0x30bb2700), DICO(0x38b257c0), DICO(0x46abd580),
  8264. - DICO(0x4c30dd80), DICO(0x50e51880), DICO(0x5782ab80), DICO(0x5d23da80),
  8265. - DICO(0x06700f78), DICO(0x085ec0a0), DICO(0x0c037280), DICO(0x16d90a60),
  8266. - DICO(0x1bf46c00), DICO(0x1e6f4740), DICO(0x22c2c180), DICO(0x263fa2c0),
  8267. - DICO(0x2c4a74c0), DICO(0x3642b040), DICO(0x3a476900), DICO(0x3ea12840),
  8268. - DICO(0x46b6e880), DICO(0x4b5bad80), DICO(0x5152a500), DICO(0x5c1c6080),
  8269. - DICO(0x041f8108), DICO(0x05ef1d98), DICO(0x0ce43300), DICO(0x11647cc0),
  8270. - DICO(0x16e77fe0), DICO(0x1cdafc40), DICO(0x218832c0), DICO(0x26dd1b40),
  8271. - DICO(0x2c776100), DICO(0x34f1eb80), DICO(0x3caf6100), DICO(0x45630a80),
  8272. - DICO(0x4c0c5380), DICO(0x517ae980), DICO(0x567f4280), DICO(0x5c4bf900),
  8273. - DICO(0x06673f18), DICO(0x091ee510), DICO(0x0d6ccb10), DICO(0x12503240),
  8274. - DICO(0x158696e0), DICO(0x1f035420), DICO(0x24e6eac0), DICO(0x2a03bf40),
  8275. - DICO(0x329aa000), DICO(0x375aafc0), DICO(0x3da133c0), DICO(0x45645600),
  8276. - DICO(0x4c447c00), DICO(0x51a26b00), DICO(0x57917c00), DICO(0x5c557680),
  8277. - DICO(0x04f84c18), DICO(0x06db4c30), DICO(0x0d53a940), DICO(0x1095cd20),
  8278. - DICO(0x142b0b20), DICO(0x184229c0), DICO(0x20147280), DICO(0x25152740),
  8279. - DICO(0x2db89fc0), DICO(0x35f3d200), DICO(0x400aa680), DICO(0x47a51c00),
  8280. - DICO(0x4d9c5c00), DICO(0x525d1680), DICO(0x5832af00), DICO(0x5d27d580),
  8281. - DICO(0x05c973d0), DICO(0x07c25810), DICO(0x0e928e50), DICO(0x12f5ad00),
  8282. - DICO(0x16b2a800), DICO(0x1c2c9ce0), DICO(0x20b0f100), DICO(0x28be1940),
  8283. - DICO(0x2d0f3c00), DICO(0x30a06f40), DICO(0x399e4340), DICO(0x46b48280),
  8284. - DICO(0x4bbbc300), DICO(0x50283700), DICO(0x54a1a800), DICO(0x5ab20c80),
  8285. - DICO(0x03df9390), DICO(0x055ff1e0), DICO(0x0bbeb640), DICO(0x17d906c0),
  8286. - DICO(0x1ac20140), DICO(0x1fd84440), DICO(0x24502600), DICO(0x2a9fe640),
  8287. - DICO(0x2ef79700), DICO(0x34cbed40), DICO(0x3c48cd00), DICO(0x43ccce80),
  8288. - DICO(0x49b1d500), DICO(0x50145e00), DICO(0x56f16f80), DICO(0x5d46dd80),
  8289. - DICO(0x04a69ef0), DICO(0x06470480), DICO(0x0defbd00), DICO(0x1590e900),
  8290. - DICO(0x18114000), DICO(0x1bda6c60), DICO(0x1f64d160), DICO(0x28d8d640),
  8291. - DICO(0x2d4e2880), DICO(0x34cfe380), DICO(0x3b7077c0), DICO(0x42f36a80),
  8292. - DICO(0x49615580), DICO(0x4ff9d200), DICO(0x5657ef80), DICO(0x5cb91300),
  8293. - DICO(0x038893dc), DICO(0x0535cdf0), DICO(0x0aabff80), DICO(0x146daaa0),
  8294. - DICO(0x1848c700), DICO(0x1ce578c0), DICO(0x21116000), DICO(0x2b116d40),
  8295. - DICO(0x32113500), DICO(0x3751a480), DICO(0x3e88c200), DICO(0x44cb1800),
  8296. - DICO(0x4af1c200), DICO(0x5122b980), DICO(0x5782bc80), DICO(0x5d20be00),
  8297. - DICO(0x03118434), DICO(0x04afe2e8), DICO(0x08f144f0), DICO(0x12c787c0),
  8298. - DICO(0x1c32e4e0), DICO(0x1f701180), DICO(0x2362f740), DICO(0x2b995cc0),
  8299. - DICO(0x3322c540), DICO(0x3951f200), DICO(0x3f7c2c80), DICO(0x4569c480),
  8300. - DICO(0x4b2a6200), DICO(0x50905e80), DICO(0x56236680), DICO(0x5c32fa00),
  8301. - DICO(0x0460c3b0), DICO(0x061e1378), DICO(0x0b07f610), DICO(0x166e0680),
  8302. - DICO(0x18d0f020), DICO(0x21120340), DICO(0x24d4c000), DICO(0x29bafc00),
  8303. - DICO(0x338c0740), DICO(0x36cfbc00), DICO(0x3f313900), DICO(0x47bf9c00),
  8304. - DICO(0x4dd5d480), DICO(0x52848200), DICO(0x585add00), DICO(0x5cf7b480),
  8305. - DICO(0x041a4bc8), DICO(0x05ca0920), DICO(0x0a3ae5b0), DICO(0x13fbb840),
  8306. - DICO(0x1cdd3d00), DICO(0x209d5b80), DICO(0x27e78e80), DICO(0x2d1f4ec0),
  8307. - DICO(0x32d84c80), DICO(0x3b8aa680), DICO(0x4289c180), DICO(0x46c33580),
  8308. - DICO(0x4c23e580), DICO(0x51583180), DICO(0x56f52680), DICO(0x5c7a3d00),
  8309. - DICO(0x03067404), DICO(0x05914038), DICO(0x10d33e60), DICO(0x17377180),
  8310. - DICO(0x1d7f32a0), DICO(0x23848880), DICO(0x29d32200), DICO(0x2fb167c0),
  8311. - DICO(0x356c8480), DICO(0x3b420280), DICO(0x4106d080), DICO(0x46d29280),
  8312. - DICO(0x4c8a1200), DICO(0x52383300), DICO(0x57db8f80), DICO(0x5d61f200),
  8313. - DICO(0x04baf368), DICO(0x06670a08), DICO(0x0e0cbd90), DICO(0x126299c0),
  8314. - DICO(0x17ed7220), DICO(0x1e369900), DICO(0x22d7d300), DICO(0x2c0f9300),
  8315. - DICO(0x2f5e7fc0), DICO(0x3b7c0d40), DICO(0x405aff80), DICO(0x44f2ef80),
  8316. - DICO(0x4982b400), DICO(0x4e501380), DICO(0x539daa00), DICO(0x5c114b00),
  8317. - DICO(0x0694c170), DICO(0x092d6890), DICO(0x0d0faee0), DICO(0x13800d00),
  8318. - DICO(0x170f8d80), DICO(0x1bcd8240), DICO(0x246a8480), DICO(0x28bab640),
  8319. - DICO(0x2f482ac0), DICO(0x36e736c0), DICO(0x3aaa68c0), DICO(0x3fc43500),
  8320. - DICO(0x46e16000), DICO(0x4b3fbc00), DICO(0x4ff68e80), DICO(0x5aabf600),
  8321. - DICO(0x05e849a0), DICO(0x0b485a80), DICO(0x14be52c0), DICO(0x1a079380),
  8322. - DICO(0x1e8b1ce0), DICO(0x22fbca00), DICO(0x28c36a40), DICO(0x2e3b2a00),
  8323. - DICO(0x34360b80), DICO(0x3a24cf00), DICO(0x3fff6200), DICO(0x45a6bf00),
  8324. - DICO(0x4baf7800), DICO(0x51720e80), DICO(0x57560c80), DICO(0x5ce57e00),
  8325. - DICO(0x0751da38), DICO(0x0f0949f0), DICO(0x18141860), DICO(0x1dfcb2c0),
  8326. - DICO(0x24adbf00), DICO(0x296af240), DICO(0x2dbe60c0), DICO(0x3179ae40),
  8327. - DICO(0x35ec4400), DICO(0x3ab76400), DICO(0x4034f400), DICO(0x45cfc700),
  8328. - DICO(0x4bea6b00), DICO(0x516f5f00), DICO(0x57655300), DICO(0x5cfc0e00),
  8329. - DICO(0x069900d0), DICO(0x0d379520), DICO(0x175d0560), DICO(0x1c4d92c0),
  8330. - DICO(0x21407680), DICO(0x250d0340), DICO(0x29804940), DICO(0x2dfb9ac0),
  8331. - DICO(0x337a1f80), DICO(0x39105fc0), DICO(0x3efd0380), DICO(0x44bce380),
  8332. - DICO(0x4b07cc80), DICO(0x50ad7d00), DICO(0x56ddce80), DICO(0x5cb9a000),
  8333. - DICO(0x069c6948), DICO(0x0a56ea10), DICO(0x0f7cca20), DICO(0x12d18680),
  8334. - DICO(0x17036d00), DICO(0x1f4c1e80), DICO(0x262e5540), DICO(0x2b951e40),
  8335. - DICO(0x3468ad40), DICO(0x3a2b2100), DICO(0x3f02f0c0), DICO(0x4383e400),
  8336. - DICO(0x48374180), DICO(0x4d8eec80), DICO(0x54d74800), DICO(0x5c309600),
  8337. - DICO(0x05a50158), DICO(0x0797e350), DICO(0x0cf1f230), DICO(0x14f3fb20),
  8338. - DICO(0x17676400), DICO(0x20636780), DICO(0x2617ef80), DICO(0x29cbf700),
  8339. - DICO(0x32ed57c0), DICO(0x374c3080), DICO(0x3b348e40), DICO(0x3fde0180),
  8340. - DICO(0x44d38c00), DICO(0x4a8c6100), DICO(0x55f0e400), DICO(0x5dfed100),
  8341. - DICO(0x04b74228), DICO(0x0623d3e0), DICO(0x0ab4c670), DICO(0x1bde7fa0),
  8342. - DICO(0x1fcb6ac0), DICO(0x2344a540), DICO(0x275f7c40), DICO(0x2b7a8300),
  8343. - DICO(0x31407440), DICO(0x35237700), DICO(0x38798540), DICO(0x3d0af340),
  8344. - DICO(0x4224c980), DICO(0x49a17900), DICO(0x57702880), DICO(0x5dba4c00),
  8345. - DICO(0x03c83c84), DICO(0x05cc52d8), DICO(0x0b644c10), DICO(0x129ab9a0),
  8346. - DICO(0x1cee46c0), DICO(0x2152b080), DICO(0x247b1c00), DICO(0x27697180),
  8347. - DICO(0x304f7500), DICO(0x3895d880), DICO(0x3c3a1740), DICO(0x413ace80),
  8348. - DICO(0x462b0100), DICO(0x4ab07e00), DICO(0x50967580), DICO(0x5ba5e700),
  8349. - DICO(0x06bcfda8), DICO(0x08c8b920), DICO(0x0de21530), DICO(0x1028d320),
  8350. - DICO(0x168cfe00), DICO(0x20f78a40), DICO(0x248493c0), DICO(0x2c34bf80),
  8351. - DICO(0x2ff88540), DICO(0x32d28c40), DICO(0x36d99640), DICO(0x4438e500),
  8352. - DICO(0x4bacdb00), DICO(0x50343700), DICO(0x56b79080), DICO(0x5b694d00),
  8353. - DICO(0x069109a0), DICO(0x0a73bc50), DICO(0x0e3c8330), DICO(0x13082620),
  8354. - DICO(0x1c3a3760), DICO(0x200b5e80), DICO(0x256a4880), DICO(0x2b256ac0),
  8355. - DICO(0x2f34afc0), DICO(0x35580200), DICO(0x3e0bd9c0), DICO(0x43d92900),
  8356. - DICO(0x494e6e00), DICO(0x4f1a2780), DICO(0x5532a980), DICO(0x5a835a80),
  8357. - DICO(0x04053450), DICO(0x05cb8fe0), DICO(0x097387b0), DICO(0x1121af00),
  8358. - DICO(0x1abf62c0), DICO(0x1e39bbe0), DICO(0x243de300), DICO(0x2b440ec0),
  8359. - DICO(0x2f2c1480), DICO(0x34697d80), DICO(0x405f8600), DICO(0x440b6f80),
  8360. - DICO(0x47373100), DICO(0x4c764f80), DICO(0x55293780), DICO(0x5c59a780),
  8361. - DICO(0x03c5b4a4), DICO(0x056fb380), DICO(0x09b8f910), DICO(0x13833fa0),
  8362. - DICO(0x185eed60), DICO(0x1ce33d40), DICO(0x242e4100), DICO(0x282e5b80),
  8363. - DICO(0x2cfe4d40), DICO(0x38a06d80), DICO(0x3e002240), DICO(0x423be400),
  8364. - DICO(0x49a5e600), DICO(0x5092b780), DICO(0x57023d00), DICO(0x5d5f7c80),
  8365. - DICO(0x077ada38), DICO(0x09d5ac70), DICO(0x0e58be30), DICO(0x14fb2040),
  8366. - DICO(0x17fc9dc0), DICO(0x1c2c31e0), DICO(0x26cf1b00), DICO(0x2a91ba80),
  8367. - DICO(0x2ed880c0), DICO(0x38cbf900), DICO(0x3d2fc700), DICO(0x405d2280),
  8368. - DICO(0x439c1d00), DICO(0x4dd16800), DICO(0x5672c080), DICO(0x5d313880),
  8369. - DICO(0x04272090), DICO(0x05d76e18), DICO(0x0b4d8080), DICO(0x12883f60),
  8370. - DICO(0x17952180), DICO(0x2040d480), DICO(0x23e8cc00), DICO(0x2819c200),
  8371. - DICO(0x2b871040), DICO(0x357c8f00), DICO(0x3caf9ac0), DICO(0x40a39380),
  8372. - DICO(0x45bc2780), DICO(0x4e4aa300), DICO(0x568c2280), DICO(0x5cadc400),
  8373. - DICO(0x0375b03c), DICO(0x056f0b40), DICO(0x0b0dc930), DICO(0x128c51e0),
  8374. - DICO(0x189fa360), DICO(0x1c8197e0), DICO(0x1eed52a0), DICO(0x23ed4500),
  8375. - DICO(0x2e5eb840), DICO(0x36415a40), DICO(0x3dcf6340), DICO(0x43126e80),
  8376. - DICO(0x4aeb7f80), DICO(0x501e1280), DICO(0x5852b100), DICO(0x5d040d80),
  8377. - DICO(0x06351b88), DICO(0x07f90ac0), DICO(0x0bab4ea0), DICO(0x18d04b40),
  8378. - DICO(0x1f1e1480), DICO(0x219abcc0), DICO(0x261c31c0), DICO(0x2a611a00),
  8379. - DICO(0x2e725480), DICO(0x36b511c0), DICO(0x3d362f00), DICO(0x40be6d80),
  8380. - DICO(0x456dc400), DICO(0x4b74c580), DICO(0x55c82680), DICO(0x5e318480),
  8381. - DICO(0x046212d8), DICO(0x05ca95e8), DICO(0x0a02d910), DICO(0x1ae58f40),
  8382. - DICO(0x1e73ec20), DICO(0x2197d640), DICO(0x2581df00), DICO(0x29c83780),
  8383. - DICO(0x31294300), DICO(0x356f8a40), DICO(0x3b97d240), DICO(0x4505cc80),
  8384. - DICO(0x4b497600), DICO(0x504e8780), DICO(0x55644480), DICO(0x5bdedf80),
  8385. - DICO(0x0514f798), DICO(0x06bd0d00), DICO(0x0fc31550), DICO(0x13dfb1a0),
  8386. - DICO(0x17dda900), DICO(0x204a8c40), DICO(0x23095300), DICO(0x2d0da040),
  8387. - DICO(0x31b2a540), DICO(0x34620180), DICO(0x3ab3e000), DICO(0x448ac300),
  8388. - DICO(0x4be6a600), DICO(0x5114e280), DICO(0x562b0780), DICO(0x5b833c00),
  8389. - DICO(0x070f5ef0), DICO(0x0919c2b0), DICO(0x0e778740), DICO(0x154db320),
  8390. - DICO(0x177cfbe0), DICO(0x1ea66040), DICO(0x23666680), DICO(0x2839c400),
  8391. - DICO(0x30cc4ec0), DICO(0x3444a280), DICO(0x38c93580), DICO(0x42a80e00),
  8392. - DICO(0x4c433880), DICO(0x519e4f80), DICO(0x56ff8f80), DICO(0x5be18200),
  8393. - DICO(0x066c5968), DICO(0x08a589f0), DICO(0x0ca4d7a0), DICO(0x0ffdefb0),
  8394. - DICO(0x12943f40), DICO(0x1be84ee0), DICO(0x21276540), DICO(0x265a9540),
  8395. - DICO(0x2e0de140), DICO(0x325148c0), DICO(0x3bd05d40), DICO(0x41e81780),
  8396. - DICO(0x4b7cf400), DICO(0x53289400), DICO(0x597d9000), DICO(0x5e458e00),
  8397. - DICO(0x04da3e40), DICO(0x06e8e1b0), DICO(0x0b9b1a20), DICO(0x11264bc0),
  8398. - DICO(0x14f3d7e0), DICO(0x1cf9c100), DICO(0x23568f40), DICO(0x292b5380),
  8399. - DICO(0x33878d40), DICO(0x38dac840), DICO(0x3d578200), DICO(0x4223a880),
  8400. - DICO(0x473fb700), DICO(0x4c765500), DICO(0x546c6480), DICO(0x5c76d280),
  8401. - DICO(0x05e63bb0), DICO(0x07a1a428), DICO(0x0ec4ff10), DICO(0x1348a100),
  8402. - DICO(0x16204f40), DICO(0x1a0a6440), DICO(0x1e33f6c0), DICO(0x2ae8ccc0),
  8403. - DICO(0x2ed5e6c0), DICO(0x32427600), DICO(0x379d9980), DICO(0x3c0f4080),
  8404. - DICO(0x441ea680), DICO(0x4e592b00), DICO(0x56e27700), DICO(0x5da2e280),
  8405. - DICO(0x0474de80), DICO(0x06167248), DICO(0x0ce650e0), DICO(0x135b4aa0),
  8406. - DICO(0x16cea2a0), DICO(0x1d138ac0), DICO(0x220a84c0), DICO(0x275ca380),
  8407. - DICO(0x2c300340), DICO(0x333b3d80), DICO(0x37a35080), DICO(0x40b83880),
  8408. - DICO(0x494c4780), DICO(0x4ff71c80), DICO(0x56db2d80), DICO(0x5d0aac00),
  8409. - DICO(0x0746cd00), DICO(0x09deff10), DICO(0x0e4a3560), DICO(0x14f005e0),
  8410. - DICO(0x186a4de0), DICO(0x1cd0b240), DICO(0x22287bc0), DICO(0x26ced500),
  8411. - DICO(0x2d57c440), DICO(0x31d943c0), DICO(0x364b0f80), DICO(0x3c85a040),
  8412. - DICO(0x4240ca00), DICO(0x4a648080), DICO(0x54d12200), DICO(0x5d1a1c00),
  8413. - DICO(0x05522eb0), DICO(0x0704efb8), DICO(0x0c66cd50), DICO(0x15aefca0),
  8414. - DICO(0x184f7b00), DICO(0x1e4b26a0), DICO(0x22667640), DICO(0x284e4e00),
  8415. - DICO(0x2d8be3c0), DICO(0x31376f00), DICO(0x39cd9800), DICO(0x3e46b740),
  8416. - DICO(0x43af0380), DICO(0x4e1dec00), DICO(0x562ac500), DICO(0x5d45f580),
  8417. - DICO(0x062f5708), DICO(0x08d079a0), DICO(0x0c1b4920), DICO(0x13f147c0),
  8418. - DICO(0x1ae77c80), DICO(0x1d200ea0), DICO(0x236e4740), DICO(0x2b98d000),
  8419. - DICO(0x2eefc600), DICO(0x34c674c0), DICO(0x3d36f540), DICO(0x411d8c00),
  8420. - DICO(0x45c50300), DICO(0x4d207480), DICO(0x55603100), DICO(0x5c442d80),
  8421. - DICO(0x0510bcd0), DICO(0x06ec00a0), DICO(0x0b639550), DICO(0x15daa2c0),
  8422. - DICO(0x18c0ba60), DICO(0x1e0f7d60), DICO(0x24b05c80), DICO(0x280638c0),
  8423. - DICO(0x314a6580), DICO(0x35e4b2c0), DICO(0x3aef2bc0), DICO(0x4158c280),
  8424. - DICO(0x4d245100), DICO(0x53c69a80), DICO(0x597f1000), DICO(0x5dcb0080),
  8425. - DICO(0x042cb748), DICO(0x05d710b0), DICO(0x0afe6130), DICO(0x1256cdc0),
  8426. - DICO(0x15b8cd00), DICO(0x1dc72d20), DICO(0x2205fc00), DICO(0x2a3d0d00),
  8427. - DICO(0x2f3ba600), DICO(0x33b3d840), DICO(0x3b5a5440), DICO(0x416c9d00),
  8428. - DICO(0x497cdd80), DICO(0x50405e00), DICO(0x570ca980), DICO(0x5d3aa180),
  8429. - DICO(0x0443b7b8), DICO(0x063d8588), DICO(0x0c76ef20), DICO(0x12709b40),
  8430. - DICO(0x1649f0a0), DICO(0x20c522c0), DICO(0x24cde400), DICO(0x2ba78280),
  8431. - DICO(0x3104c340), DICO(0x360b1740), DICO(0x3cd6a6c0), DICO(0x42573800),
  8432. - DICO(0x48b18480), DICO(0x4fca1e00), DICO(0x5700c100), DICO(0x5cf14480),
  8433. - DICO(0x05123628), DICO(0x06bf10b0), DICO(0x0bde7570), DICO(0x175b7ee0),
  8434. - DICO(0x1a134460), DICO(0x20fa4100), DICO(0x25eda440), DICO(0x29c3b540),
  8435. - DICO(0x318a1b40), DICO(0x35e0d500), DICO(0x3a147f00), DICO(0x3f08e980),
  8436. - DICO(0x445d7580), DICO(0x4ec48c80), DICO(0x588bce80), DICO(0x5dfae300),
  8437. - DICO(0x04c9e750), DICO(0x065224f8), DICO(0x0c6f1e30), DICO(0x1a2ffca0),
  8438. - DICO(0x1cac6140), DICO(0x21c2a640), DICO(0x25fb8ac0), DICO(0x2ab90f00),
  8439. - DICO(0x33189200), DICO(0x38088ac0), DICO(0x3bb7de40), DICO(0x40180800),
  8440. - DICO(0x4453c300), DICO(0x4cdba880), DICO(0x54902680), DICO(0x5bb21700),
  8441. - DICO(0x06958570), DICO(0x097f32b0), DICO(0x0cb418b0), DICO(0x141b6900),
  8442. - DICO(0x1c8cfb00), DICO(0x1fab7920), DICO(0x2477c800), DICO(0x2aabed40),
  8443. - DICO(0x2eb1a080), DICO(0x339f67c0), DICO(0x3abcc240), DICO(0x3f661b00),
  8444. - DICO(0x45663280), DICO(0x4c680800), DICO(0x51703000), DICO(0x58a0e000),
  8445. - DICO(0x069f6c88), DICO(0x095e1490), DICO(0x0cf442b0), DICO(0x10ea8d60),
  8446. - DICO(0x1377b580), DICO(0x195ed480), DICO(0x26542b00), DICO(0x2c9ea700),
  8447. - DICO(0x318d8ac0), DICO(0x364e5a40), DICO(0x3a0db000), DICO(0x3e1087c0),
  8448. - DICO(0x450ca380), DICO(0x4c781d00), DICO(0x53cf7a00), DICO(0x5c7d1280),
  8449. - DICO(0x06e51d98), DICO(0x09eb8d30), DICO(0x0e6683d0), DICO(0x129418a0),
  8450. - DICO(0x1562fc80), DICO(0x1f708660), DICO(0x253f1000), DICO(0x293a16c0),
  8451. - DICO(0x2e7c1d80), DICO(0x316e75c0), DICO(0x35a7fbc0), DICO(0x3bfbf780),
  8452. - DICO(0x416a9200), DICO(0x4be36400), DICO(0x56dc7a80), DICO(0x5d64ea80),
  8453. - DICO(0x0574d0c8), DICO(0x0748efd0), DICO(0x0b510860), DICO(0x0e219e00),
  8454. - DICO(0x1299cc00), DICO(0x1ef706a0), DICO(0x22ca38c0), DICO(0x28820a00),
  8455. - DICO(0x2cc635c0), DICO(0x31ef4740), DICO(0x3a5e89c0), DICO(0x42acaa00),
  8456. - DICO(0x4b2bf500), DICO(0x515e0980), DICO(0x57949400), DICO(0x5d002500),
  8457. - DICO(0x07c715d0), DICO(0x0b3fa110), DICO(0x0e745370), DICO(0x11e93560),
  8458. - DICO(0x14bad680), DICO(0x189a0400), DICO(0x240b1240), DICO(0x2a6b3580),
  8459. - DICO(0x2e5e1380), DICO(0x352072c0), DICO(0x3a5037c0), DICO(0x3e3726c0),
  8460. - DICO(0x4725ed80), DICO(0x4f885900), DICO(0x54c8d580), DICO(0x5b261680),
  8461. - DICO(0x075f02a8), DICO(0x0a214900), DICO(0x0e189de0), DICO(0x1376d5a0),
  8462. - DICO(0x163d5c80), DICO(0x1a94b3e0), DICO(0x21376980), DICO(0x259c3140),
  8463. - DICO(0x2e663bc0), DICO(0x337884c0), DICO(0x3a035c00), DICO(0x40b32c00),
  8464. - DICO(0x4b21de00), DICO(0x53298f00), DICO(0x58788080), DICO(0x5cfa7c00),
  8465. - DICO(0x05658988), DICO(0x0797f470), DICO(0x0d250810), DICO(0x102fc2a0),
  8466. - DICO(0x13738fe0), DICO(0x1740bbc0), DICO(0x2491b380), DICO(0x28bc5800),
  8467. - DICO(0x2c75a940), DICO(0x325cb500), DICO(0x37944740), DICO(0x405f2d80),
  8468. - DICO(0x48eb8f00), DICO(0x50676f80), DICO(0x56f70380), DICO(0x5d62c000),
  8469. - DICO(0x0531b540), DICO(0x06ae64c0), DICO(0x0cf7ad30), DICO(0x11c83000),
  8470. - DICO(0x14edc980), DICO(0x18d436c0), DICO(0x1e184080), DICO(0x2603bb80),
  8471. - DICO(0x2a2f2f80), DICO(0x33bdbe00), DICO(0x3a1066c0), DICO(0x42b9ff00),
  8472. - DICO(0x4a617580), DICO(0x51619480), DICO(0x57ccd500), DICO(0x5d4d1600),
  8473. - DICO(0x03e40bac), DICO(0x05f53158), DICO(0x0e76d3b0), DICO(0x17c157a0),
  8474. - DICO(0x1ccb5bc0), DICO(0x250129c0), DICO(0x2b7d9d00), DICO(0x33224d80),
  8475. - DICO(0x3966f600), DICO(0x3f399480), DICO(0x4449fc80), DICO(0x49401b80),
  8476. - DICO(0x4e2ab580), DICO(0x53117000), DICO(0x5848e080), DICO(0x5d66a280),
  8477. - DICO(0x041d4f60), DICO(0x070e8080), DICO(0x1390ec40), DICO(0x177c42c0),
  8478. - DICO(0x1beb1400), DICO(0x208b0580), DICO(0x264cbb40), DICO(0x2bd30940),
  8479. - DICO(0x30b30880), DICO(0x36978e80), DICO(0x3cb2a140), DICO(0x43f6b080),
  8480. - DICO(0x4a881000), DICO(0x505ca780), DICO(0x569a5d80), DICO(0x5cae3580),
  8481. - DICO(0x03f3c760), DICO(0x05564e08), DICO(0x09e310d0), DICO(0x1b9b3d00),
  8482. - DICO(0x20909ac0), DICO(0x2382eec0), DICO(0x278c6700), DICO(0x2b34d500),
  8483. - DICO(0x30fa2ac0), DICO(0x34d27d40), DICO(0x38e334c0), DICO(0x3d732440),
  8484. - DICO(0x46d07800), DICO(0x51f4d400), DICO(0x57744f80), DICO(0x5d56bb80),
  8485. - DICO(0x03abfdd8), DICO(0x0512b140), DICO(0x135f7500), DICO(0x19fcc4c0),
  8486. - DICO(0x1d0b1b80), DICO(0x21eca540), DICO(0x258f8700), DICO(0x29e292c0),
  8487. - DICO(0x2c51fe80), DICO(0x31e2a180), DICO(0x3c638640), DICO(0x44873a00),
  8488. - DICO(0x4bb7e800), DICO(0x5078f700), DICO(0x57fc9b80), DICO(0x5def1c00),
  8489. - DICO(0x04721ef0), DICO(0x06688158), DICO(0x0f65a5d0), DICO(0x14499840),
  8490. - DICO(0x1bf5b8c0), DICO(0x1f33b700), DICO(0x264b6900), DICO(0x2c3e6780),
  8491. - DICO(0x2ec8d440), DICO(0x323885c0), DICO(0x37143300), DICO(0x3bafa800),
  8492. - DICO(0x49030480), DICO(0x54c16b00), DICO(0x58ec4b00), DICO(0x5d713d00),
  8493. - DICO(0x03d114e4), DICO(0x067e5b40), DICO(0x10393420), DICO(0x14961300),
  8494. - DICO(0x1a59cfa0), DICO(0x20854240), DICO(0x26b3f300), DICO(0x2e3e2840),
  8495. - DICO(0x323bd300), DICO(0x37c49280), DICO(0x3d79e500), DICO(0x4352d880),
  8496. - DICO(0x49e17980), DICO(0x4fc72f80), DICO(0x55c0c680), DICO(0x5c53c700),
  8497. - DICO(0x053f5de8), DICO(0x075162b8), DICO(0x0fae8050), DICO(0x13ec0ee0),
  8498. - DICO(0x17f92440), DICO(0x1f054440), DICO(0x24b15d40), DICO(0x2add4480),
  8499. - DICO(0x2e306300), DICO(0x35420680), DICO(0x3c6b6e00), DICO(0x42fc0380),
  8500. - DICO(0x4732e380), DICO(0x4ceb2200), DICO(0x522efe00), DICO(0x5aa12680),
  8501. - DICO(0x06111728), DICO(0x08183c80), DICO(0x0d026650), DICO(0x14b41940),
  8502. - DICO(0x17e37320), DICO(0x1c40b160), DICO(0x219c5400), DICO(0x26d88840),
  8503. - DICO(0x2bfdfe00), DICO(0x315a2800), DICO(0x38cd7140), DICO(0x3de22740),
  8504. - DICO(0x48ff1300), DICO(0x53ef4180), DICO(0x5a479380), DICO(0x5ea1e380),
  8505. - DICO(0x07ea0fa8), DICO(0x0a844ef0), DICO(0x0e1023c0), DICO(0x1208d980),
  8506. - DICO(0x15891360), DICO(0x1bebc380), DICO(0x2087da40), DICO(0x257ac940),
  8507. - DICO(0x2caefa00), DICO(0x300defc0), DICO(0x376aa000), DICO(0x438aad80),
  8508. - DICO(0x49f00500), DICO(0x4e023780), DICO(0x524e5800), DICO(0x5abcb980),
  8509. - DICO(0x079cfc88), DICO(0x0a367240), DICO(0x0f224330), DICO(0x15b51540),
  8510. - DICO(0x19065420), DICO(0x1ddbe0a0), DICO(0x23a99d80), DICO(0x28c2d340),
  8511. - DICO(0x2f627e40), DICO(0x3487e080), DICO(0x38b76bc0), DICO(0x3d135580),
  8512. - DICO(0x43799a80), DICO(0x489a5000), DICO(0x4ece6280), DICO(0x5a82f500),
  8513. - DICO(0x06c37e40), DICO(0x093f0540), DICO(0x0e0d0c30), DICO(0x17487860),
  8514. - DICO(0x1bf78020), DICO(0x20318000), DICO(0x260b8300), DICO(0x2c615980),
  8515. - DICO(0x30c88440), DICO(0x36433b40), DICO(0x3bdb8c40), DICO(0x40050c80),
  8516. - DICO(0x44062f80), DICO(0x48a8d480), DICO(0x4dd64d00), DICO(0x55abd380),
  8517. - DICO(0x05e9e828), DICO(0x07f24330), DICO(0x0c8b4fe0), DICO(0x0ecd2820),
  8518. - DICO(0x17f05c00), DICO(0x1fdb4560), DICO(0x24b4c940), DICO(0x2968d0c0),
  8519. - DICO(0x2cbf3500), DICO(0x381eadc0), DICO(0x3d3baf40), DICO(0x42828080),
  8520. - DICO(0x47f36300), DICO(0x4c8c6600), DICO(0x51d66f00), DICO(0x5a7e0300),
  8521. - DICO(0x065c5cf8), DICO(0x08882540), DICO(0x0d887c70), DICO(0x112ac560),
  8522. - DICO(0x150ccdc0), DICO(0x19e49c20), DICO(0x1eb65680), DICO(0x2a76e040),
  8523. - DICO(0x2f65fc00), DICO(0x36d79cc0), DICO(0x3c85a900), DICO(0x408dc680),
  8524. - DICO(0x44964700), DICO(0x4a98eb00), DICO(0x5528b500), DICO(0x5d660f80),
  8525. - DICO(0x06b56230), DICO(0x08e340f0), DICO(0x0e1e4380), DICO(0x112d2d40),
  8526. - DICO(0x158dfde0), DICO(0x227e6040), DICO(0x26bff7c0), DICO(0x2b73a100),
  8527. - DICO(0x32199580), DICO(0x3585a240), DICO(0x398a5d40), DICO(0x3db8c6c0),
  8528. - DICO(0x43905600), DICO(0x4945f800), DICO(0x4f310380), DICO(0x5a6d2400),
  8529. - DICO(0x05cfc6f8), DICO(0x0832e650), DICO(0x0de82f80), DICO(0x1a1afe80),
  8530. - DICO(0x1e9a1f80), DICO(0x221acd80), DICO(0x27fa00c0), DICO(0x2c4df980),
  8531. - DICO(0x31e04bc0), DICO(0x38c9ed40), DICO(0x3db86080), DICO(0x428ec800),
  8532. - DICO(0x48500500), DICO(0x4e1ca580), DICO(0x53d3f500), DICO(0x5aa6be00),
  8533. - DICO(0x050cc4d0), DICO(0x070c2180), DICO(0x0c4ca980), DICO(0x0fce9f40),
  8534. - DICO(0x14af4160), DICO(0x2206a780), DICO(0x25848e80), DICO(0x2c2b84c0),
  8535. - DICO(0x35a39980), DICO(0x3914bd80), DICO(0x3caff580), DICO(0x3fcb0600),
  8536. - DICO(0x4426b380), DICO(0x486c9700), DICO(0x4f730480), DICO(0x5afd3980),
  8537. - DICO(0x05e40640), DICO(0x0830df50), DICO(0x0b9e83e0), DICO(0x158bacc0),
  8538. - DICO(0x1d0692e0), DICO(0x2021e0c0), DICO(0x26572e00), DICO(0x2d58cc40),
  8539. - DICO(0x30dd0f80), DICO(0x361d68c0), DICO(0x3e3086c0), DICO(0x42450800),
  8540. - DICO(0x46c25800), DICO(0x4c45cf00), DICO(0x51dd4200), DICO(0x57326500),
  8541. - DICO(0x04d32fa0), DICO(0x064ed2c0), DICO(0x0b07cd70), DICO(0x1c7f6da0),
  8542. - DICO(0x213bc140), DICO(0x25051fc0), DICO(0x295cd1c0), DICO(0x2c9f4f80),
  8543. - DICO(0x32271540), DICO(0x36a8ec80), DICO(0x3a8e6b40), DICO(0x3e137580),
  8544. - DICO(0x42795480), DICO(0x4779b780), DICO(0x4f7d9600), DICO(0x5c09b000),
  8545. - DICO(0x044b0748), DICO(0x05fee680), DICO(0x08f66960), DICO(0x11db5940),
  8546. - DICO(0x219ede80), DICO(0x27fb96c0), DICO(0x2affc980), DICO(0x2eadc3c0),
  8547. - DICO(0x32895700), DICO(0x37180d00), DICO(0x3d4bf880), DICO(0x41741980),
  8548. - DICO(0x460d8280), DICO(0x4c34be80), DICO(0x54531e80), DICO(0x5c874000),
  8549. - DICO(0x03e25dcc), DICO(0x069e8170), DICO(0x13b3d9c0), DICO(0x1a803260),
  8550. - DICO(0x1ed3a4a0), DICO(0x23ea6380), DICO(0x2883b900), DICO(0x2e0ceac0),
  8551. - DICO(0x3308e400), DICO(0x38796dc0), DICO(0x3e318e80), DICO(0x441da080),
  8552. - DICO(0x4a892300), DICO(0x509b9f80), DICO(0x56caa380), DICO(0x5cc39e00),
  8553. - DICO(0x05023038), DICO(0x06b6b4d8), DICO(0x0a449370), DICO(0x15b86ea0),
  8554. - DICO(0x224a9200), DICO(0x272e6f40), DICO(0x2a617700), DICO(0x2e915d00),
  8555. - DICO(0x3240ac40), DICO(0x37636300), DICO(0x3dd3ea80), DICO(0x420e1f80),
  8556. - DICO(0x45bf0680), DICO(0x4a26d980), DICO(0x4f82a900), DICO(0x56576800),
  8557. - DICO(0x03d630f4), DICO(0x082140a0), DICO(0x12644700), DICO(0x16b80cc0),
  8558. - DICO(0x1ba90c40), DICO(0x21c38300), DICO(0x27dd1480), DICO(0x2e18ee00),
  8559. - DICO(0x33fb72c0), DICO(0x39f9d980), DICO(0x40219300), DICO(0x4607fd00),
  8560. - DICO(0x4c07e500), DICO(0x51ba8f00), DICO(0x57a24280), DICO(0x5d367700),
  8561. - DICO(0x080a5880), DICO(0x0ef3f570), DICO(0x141fd6c0), DICO(0x17c163a0),
  8562. - DICO(0x1c2840a0), DICO(0x2111fe00), DICO(0x27376bc0), DICO(0x2cc7edc0),
  8563. - DICO(0x329b0100), DICO(0x386d3e40), DICO(0x3ec1bdc0), DICO(0x453f6200),
  8564. - DICO(0x4bf16080), DICO(0x51bded00), DICO(0x57ba6800), DICO(0x5d2ffd80),
  8565. - DICO(0x08643590), DICO(0x0e911f00), DICO(0x15911380), DICO(0x1ab5e180),
  8566. - DICO(0x207ff600), DICO(0x26399b00), DICO(0x2cadae80), DICO(0x3276ca40),
  8567. - DICO(0x389d9cc0), DICO(0x3eb22180), DICO(0x44570700), DICO(0x49d15800),
  8568. - DICO(0x4f591300), DICO(0x54566a80), DICO(0x5967db00), DICO(0x5e307780),
  8569. - DICO(0x07120fa8), DICO(0x0c791c60), DICO(0x112d3b60), DICO(0x149452a0),
  8570. - DICO(0x19d2c100), DICO(0x202f1540), DICO(0x269c10c0), DICO(0x2be22880),
  8571. - DICO(0x312a07c0), DICO(0x36984fc0), DICO(0x3c7ac3c0), DICO(0x435b5000),
  8572. - DICO(0x4aa60280), DICO(0x50f50c00), DICO(0x5719f700), DICO(0x5cb98680),
  8573. - DICO(0x05517c88), DICO(0x06ba0a70), DICO(0x0da167c0), DICO(0x19918440),
  8574. - DICO(0x1bb37220), DICO(0x20681080), DICO(0x23dc6740), DICO(0x2a1403c0),
  8575. - DICO(0x31a71580), DICO(0x34ff0600), DICO(0x395b7cc0), DICO(0x42019200),
  8576. - DICO(0x4c818d00), DICO(0x513ff400), DICO(0x5731ce00), DICO(0x5c5f1180),
  8577. - DICO(0x04f74ec0), DICO(0x067b4628), DICO(0x0dc4c9c0), DICO(0x19e9fa40),
  8578. - DICO(0x1cf00a00), DICO(0x21602a80), DICO(0x25334a80), DICO(0x29b3a800),
  8579. - DICO(0x2f9b3600), DICO(0x338c0540), DICO(0x370c3cc0), DICO(0x3abbc3c0),
  8580. - DICO(0x4053a000), DICO(0x4f14d980), DICO(0x57e0b600), DICO(0x5d95e780),
  8581. - DICO(0x05d844b8), DICO(0x07a05608), DICO(0x0b7837f0), DICO(0x161fb460),
  8582. - DICO(0x19c31d00), DICO(0x1cf36280), DICO(0x20ccc200), DICO(0x24ae3980),
  8583. - DICO(0x2e2b5800), DICO(0x3316af80), DICO(0x37432b00), DICO(0x4050b280),
  8584. - DICO(0x4605be00), DICO(0x4cc78900), DICO(0x556d2080), DICO(0x5c578300),
  8585. - DICO(0x0551b768), DICO(0x07024f60), DICO(0x1045fde0), DICO(0x16480120),
  8586. - DICO(0x19974420), DICO(0x1ec2b280), DICO(0x228b30c0), DICO(0x295e0ec0),
  8587. - DICO(0x2d8775c0), DICO(0x30ef1440), DICO(0x35978080), DICO(0x3a2ab480),
  8588. - DICO(0x40229780), DICO(0x4da40980), DICO(0x5718e480), DICO(0x5d68d400),
  8589. - DICO(0x03f903e4), DICO(0x06731580), DICO(0x0ecf4850), DICO(0x12e57920),
  8590. - DICO(0x1a69ece0), DICO(0x1fe32700), DICO(0x2585b9c0), DICO(0x2aa006c0),
  8591. - DICO(0x2f20ea80), DICO(0x37298bc0), DICO(0x3df2a000), DICO(0x44a6c600),
  8592. - DICO(0x4b10de00), DICO(0x510fb880), DICO(0x5749c280), DICO(0x5d0b9480),
  8593. - DICO(0x03c418fc), DICO(0x056c4cd0), DICO(0x0d0cf070), DICO(0x1907a2c0),
  8594. - DICO(0x1be9bc00), DICO(0x21599480), DICO(0x25700e40), DICO(0x2c83e280),
  8595. - DICO(0x329fa7c0), DICO(0x389f4cc0), DICO(0x3ef60900), DICO(0x44c19300),
  8596. - DICO(0x4af56d00), DICO(0x512eec80), DICO(0x5772ad00), DICO(0x5d37f380),
  8597. - DICO(0x04d57920), DICO(0x0716b5e0), DICO(0x0cb3bcc0), DICO(0x1197f740),
  8598. - DICO(0x163e5fc0), DICO(0x2194e400), DICO(0x274bb600), DICO(0x2f5d7080),
  8599. - DICO(0x361ee340), DICO(0x3b3b22c0), DICO(0x3f800400), DICO(0x4327ef80),
  8600. - DICO(0x48b5d200), DICO(0x5116d300), DICO(0x59652e80), DICO(0x5e444d00),
  8601. - DICO(0x0755b6b0), DICO(0x0b68c2c0), DICO(0x0f3441d0), DICO(0x124a01a0),
  8602. - DICO(0x18910600), DICO(0x20911b80), DICO(0x281f7100), DICO(0x2e4dd640),
  8603. - DICO(0x335bd8c0), DICO(0x37f14a80), DICO(0x3cab7b80), DICO(0x43be3180),
  8604. - DICO(0x4beee100), DICO(0x52292180), DICO(0x57efea00), DICO(0x5d177300),
  8605. - DICO(0x071a7748), DICO(0x0c6cf1b0), DICO(0x10db1500), DICO(0x143bca00),
  8606. - DICO(0x1b86a900), DICO(0x22ed1d80), DICO(0x2a1f61c0), DICO(0x305f1400),
  8607. - DICO(0x3645f580), DICO(0x3be45b00), DICO(0x4166ea80), DICO(0x46c3f200),
  8608. - DICO(0x4c740400), DICO(0x51e30d00), DICO(0x57a37000), DICO(0x5cfc4980),
  8609. - DICO(0x08cdd5b0), DICO(0x0daf9840), DICO(0x11cc02a0), DICO(0x1588ed40),
  8610. - DICO(0x1cfef5e0), DICO(0x239f12c0), DICO(0x296d3b40), DICO(0x2e61c240),
  8611. - DICO(0x333dc800), DICO(0x385d0000), DICO(0x3e1e5180), DICO(0x44196e00),
  8612. - DICO(0x4a833000), DICO(0x503d7b80), DICO(0x56556680), DICO(0x5c410c00),
  8613. - DICO(0x07372408), DICO(0x0d5c41f0), DICO(0x155dc140), DICO(0x1a9a3cc0),
  8614. - DICO(0x21740980), DICO(0x27139f40), DICO(0x2c977040), DICO(0x30cfe5c0),
  8615. - DICO(0x35381240), DICO(0x39b83140), DICO(0x3ef3fe80), DICO(0x44547200),
  8616. - DICO(0x4a812800), DICO(0x5046c200), DICO(0x56957d00), DICO(0x5c85cd80),
  8617. - DICO(0x06da6990), DICO(0x0bc41250), DICO(0x13d54800), DICO(0x1979c220),
  8618. - DICO(0x1fad2f00), DICO(0x24bbe0c0), DICO(0x29c08f00), DICO(0x2e34b940),
  8619. - DICO(0x32c89e40), DICO(0x376a2040), DICO(0x3cd81080), DICO(0x4267bd00),
  8620. - DICO(0x48e8e800), DICO(0x4f150280), DICO(0x55cb1980), DICO(0x5c428b80),
  8621. - DICO(0x087d45d0), DICO(0x0cf1ef20), DICO(0x135cba20), DICO(0x16fc7420),
  8622. - DICO(0x1b2772e0), DICO(0x1fd4fe60), DICO(0x260a0b80), DICO(0x2bc54c00),
  8623. - DICO(0x31694cc0), DICO(0x36d08080), DICO(0x3c245c80), DICO(0x41170900),
  8624. - DICO(0x47b18600), DICO(0x4e706180), DICO(0x558d2000), DICO(0x5c428d00),
  8625. - DICO(0x081e6490), DICO(0x0d16a7d0), DICO(0x124ccd20), DICO(0x154c20c0),
  8626. - DICO(0x1945d8c0), DICO(0x1ee0b700), DICO(0x26a01f00), DICO(0x2d554e40),
  8627. - DICO(0x3432eb80), DICO(0x3a605500), DICO(0x401d8980), DICO(0x45737680),
  8628. - DICO(0x4b03cb00), DICO(0x50666780), DICO(0x56a0cd00), DICO(0x5cb46480),
  8629. - DICO(0x06c58278), DICO(0x091b10b0), DICO(0x0e0e74f0), DICO(0x11faf980),
  8630. - DICO(0x14a48600), DICO(0x1e6f7500), DICO(0x27f77100), DICO(0x2ab49940),
  8631. - DICO(0x32a1f680), DICO(0x38cb2a80), DICO(0x3c3ff140), DICO(0x3f681cc0),
  8632. - DICO(0x44310700), DICO(0x4fa21700), DICO(0x586c6180), DICO(0x5df74200),
  8633. - DICO(0x06a3e478), DICO(0x09714400), DICO(0x0d90b7a0), DICO(0x12df2720),
  8634. - DICO(0x1618f320), DICO(0x1ac52840), DICO(0x27612900), DICO(0x2e438e00),
  8635. - DICO(0x322b6ac0), DICO(0x38022940), DICO(0x3d2a5180), DICO(0x40d76b80),
  8636. - DICO(0x46671500), DICO(0x4c5bd480), DICO(0x517a2500), DICO(0x57775b00),
  8637. - DICO(0x056c2230), DICO(0x07b8f9d8), DICO(0x0bc6e060), DICO(0x16ac2c80),
  8638. - DICO(0x1a92fc00), DICO(0x1e15f000), DICO(0x28b73200), DICO(0x2cd9e5c0),
  8639. - DICO(0x3196ecc0), DICO(0x3abae340), DICO(0x4040c580), DICO(0x44c18d80),
  8640. - DICO(0x4c086800), DICO(0x50b78500), DICO(0x54e42600), DICO(0x5a549a80),
  8641. - DICO(0x04f9fa10), DICO(0x07419358), DICO(0x0c3e15f0), DICO(0x174c1800),
  8642. - DICO(0x1ab1fe60), DICO(0x23a12680), DICO(0x27955780), DICO(0x2d14b1c0),
  8643. - DICO(0x35cefb00), DICO(0x39576700), DICO(0x3e82b780), DICO(0x42b6a680),
  8644. - DICO(0x476d1880), DICO(0x4b6cdd00), DICO(0x52758680), DICO(0x5b69e500),
  8645. - DICO(0x060b7ab0), DICO(0x081c05c0), DICO(0x0b540300), DICO(0x0f564270),
  8646. - DICO(0x1210aa80), DICO(0x1771e060), DICO(0x25d73280), DICO(0x2e49e380),
  8647. - DICO(0x319c1100), DICO(0x3771e700), DICO(0x3c532f40), DICO(0x40c9a900),
  8648. - DICO(0x48cbf580), DICO(0x4f819980), DICO(0x566f9400), DICO(0x5cfdd980),
  8649. - DICO(0x04efb7b8), DICO(0x0b8a3710), DICO(0x124fd520), DICO(0x1846dde0),
  8650. - DICO(0x1e77a9e0), DICO(0x243ea800), DICO(0x2a4e3280), DICO(0x2ff532c0),
  8651. - DICO(0x35d27680), DICO(0x3b8cdb00), DICO(0x41463000), DICO(0x4706c700),
  8652. - DICO(0x4ca42d80), DICO(0x525d9200), DICO(0x57dabb80), DICO(0x5d59a800),
  8653. - DICO(0x03620dec), DICO(0x095872e0), DICO(0x108d4920), DICO(0x16e9ea00),
  8654. - DICO(0x1d60b2e0), DICO(0x235e9d00), DICO(0x29893b80), DICO(0x2f59a3c0),
  8655. - DICO(0x3556b880), DICO(0x3b10bdc0), DICO(0x40f49500), DICO(0x469cc480),
  8656. - DICO(0x4c762d00), DICO(0x51f16980), DICO(0x578c6d00), DICO(0x5c9b5a00),
  8657. - DICO(0x05dd9bc0), DICO(0x079c5b20), DICO(0x0d319af0), DICO(0x18997040),
  8658. - DICO(0x1c0a1980), DICO(0x20e926c0), DICO(0x25ca1640), DICO(0x29879340),
  8659. - DICO(0x30b27040), DICO(0x36077340), DICO(0x39ac3d00), DICO(0x3d686cc0),
  8660. - DICO(0x428e5f00), DICO(0x47c1bf80), DICO(0x4e720800), DICO(0x5b419880),
  8661. - DICO(0x07694258), DICO(0x0b50db90), DICO(0x0f384950), DICO(0x140dac40),
  8662. - DICO(0x17c50d80), DICO(0x1b49b300), DICO(0x24746200), DICO(0x2ce92fc0),
  8663. - DICO(0x309fdac0), DICO(0x35c02a00), DICO(0x3aa3df00), DICO(0x3e1edb00),
  8664. - DICO(0x431ad280), DICO(0x4b57f500), DICO(0x51463980), DICO(0x586b5200),
  8665. - DICO(0x06401dd0), DICO(0x08d3d9b0), DICO(0x0ca0f510), DICO(0x10ed1920),
  8666. - DICO(0x1451c2e0), DICO(0x2082f640), DICO(0x2872c0c0), DICO(0x2ca9da00),
  8667. - DICO(0x3219cd00), DICO(0x35977300), DICO(0x3a8ba1c0), DICO(0x43d5f280),
  8668. - DICO(0x49a51f00), DICO(0x4de9b400), DICO(0x5362ef80), DICO(0x59387300),
  8669. - DICO(0x0589c430), DICO(0x07809918), DICO(0x0d086f80), DICO(0x10371c20),
  8670. - DICO(0x151842c0), DICO(0x1bfcb1c0), DICO(0x22441040), DICO(0x2722b5c0),
  8671. - DICO(0x2b603fc0), DICO(0x314465c0), DICO(0x40308b00), DICO(0x47d5a200),
  8672. - DICO(0x4bf7e000), DICO(0x4f937200), DICO(0x5584eb00), DICO(0x5cb02200),
  8673. - DICO(0x03b592f0), DICO(0x056ba738), DICO(0x0a8e2250), DICO(0x172436c0),
  8674. - DICO(0x1ad35da0), DICO(0x1d72dc80), DICO(0x20cd3900), DICO(0x2a962940),
  8675. - DICO(0x2f3b6700), DICO(0x33312b40), DICO(0x38dc6680), DICO(0x41659200),
  8676. - DICO(0x4d36a380), DICO(0x52b00980), DICO(0x58c82800), DICO(0x5d741600),
  8677. - DICO(0x05bdfe10), DICO(0x0756da20), DICO(0x0cd31fe0), DICO(0x130f1820),
  8678. - DICO(0x1561caa0), DICO(0x1962ab20), DICO(0x1c310840), DICO(0x28bf6f80),
  8679. - DICO(0x2d2d4500), DICO(0x3230f900), DICO(0x3ac2ea80), DICO(0x3ebe71c0),
  8680. - DICO(0x48280700), DICO(0x50254900), DICO(0x5850a200), DICO(0x5e687200),
  8681. - DICO(0x04e2b7e8), DICO(0x067f5430), DICO(0x0a8899a0), DICO(0x0d571560),
  8682. - DICO(0x1c42f440), DICO(0x22e21fc0), DICO(0x27074340), DICO(0x2c493240),
  8683. - DICO(0x2f7ece00), DICO(0x33959ec0), DICO(0x392d3000), DICO(0x459fc800),
  8684. - DICO(0x4ba5f700), DICO(0x4fde7780), DICO(0x55f90380), DICO(0x5c928b00),
  8685. - DICO(0x0557b940), DICO(0x075f0158), DICO(0x0bd8c540), DICO(0x0f4ee370),
  8686. - DICO(0x141dc900), DICO(0x1b241f00), DICO(0x21c32a80), DICO(0x29a23980),
  8687. - DICO(0x2e475380), DICO(0x3616f9c0), DICO(0x3a52a500), DICO(0x40345f00),
  8688. - DICO(0x4763a500), DICO(0x4eb5bb80), DICO(0x561d4480), DICO(0x5d388580),
  8689. - DICO(0x057d7d08), DICO(0x0738c240), DICO(0x0bf46e10), DICO(0x0ec93da0),
  8690. - DICO(0x14ab3cc0), DICO(0x23d0f5c0), DICO(0x271e9900), DICO(0x2c0ee4c0),
  8691. - DICO(0x301d1f00), DICO(0x33868040), DICO(0x37cdde00), DICO(0x3c805440),
  8692. - DICO(0x43c69200), DICO(0x4f5c9a00), DICO(0x56eb3e80), DICO(0x5cdadc80),
  8693. - DICO(0x06cdbab0), DICO(0x0999e600), DICO(0x0df39790), DICO(0x12ffc9a0),
  8694. - DICO(0x15cfe7a0), DICO(0x1c599300), DICO(0x21afd600), DICO(0x26842bc0),
  8695. - DICO(0x32067c00), DICO(0x368bb080), DICO(0x3c350c40), DICO(0x44e8be00),
  8696. - DICO(0x4ac84000), DICO(0x4f9c1280), DICO(0x5449ec00), DICO(0x594d5880),
  8697. - DICO(0x049a6bd0), DICO(0x06849f08), DICO(0x10592b40), DICO(0x168c1940),
  8698. - DICO(0x1992df40), DICO(0x1e91b300), DICO(0x2237e100), DICO(0x2cd73a80),
  8699. - DICO(0x30e7c100), DICO(0x361a45c0), DICO(0x3cdd1f40), DICO(0x41d5d100),
  8700. - DICO(0x46f79480), DICO(0x4e44c880), DICO(0x55830e80), DICO(0x5d7c0680),
  8701. - DICO(0x05087958), DICO(0x06fb7e40), DICO(0x0ac5ace0), DICO(0x14e91d80),
  8702. - DICO(0x19ac68c0), DICO(0x1dbf7600), DICO(0x26f916c0), DICO(0x2bd2c980),
  8703. - DICO(0x307f7900), DICO(0x38e07e40), DICO(0x3df7f1c0), DICO(0x41323d00),
  8704. - DICO(0x44d2f480), DICO(0x48fb0480), DICO(0x51e17900), DICO(0x5c15d700),
  8705. - DICO(0x0346cf40), DICO(0x05423408), DICO(0x0b640ce0), DICO(0x13055060),
  8706. - DICO(0x1a8c0b60), DICO(0x1d8d2280), DICO(0x218b6500), DICO(0x2c385700),
  8707. - DICO(0x30927b40), DICO(0x35d82880), DICO(0x3aa87e00), DICO(0x3da46a40),
  8708. - DICO(0x45ea5280), DICO(0x511ecb80), DICO(0x57b53b00), DICO(0x5d491400),
  8709. - DICO(0x056aa1c8), DICO(0x075a09a0), DICO(0x0a5d61d0), DICO(0x13cb9fe0),
  8710. - DICO(0x1f924dc0), DICO(0x237a11c0), DICO(0x277d6b80), DICO(0x2c2ba440),
  8711. - DICO(0x30195c80), DICO(0x35250cc0), DICO(0x3b718200), DICO(0x40113c80),
  8712. - DICO(0x44df2680), DICO(0x49f0ed80), DICO(0x50791980), DICO(0x5ac10600),
  8713. - DICO(0x046f1e50), DICO(0x061dd758), DICO(0x1236bec0), DICO(0x16c07340),
  8714. - DICO(0x1a7399c0), DICO(0x1f61ee20), DICO(0x244b2280), DICO(0x2b803e40),
  8715. - DICO(0x2eda5300), DICO(0x331210c0), DICO(0x3773bfc0), DICO(0x411c8400),
  8716. - DICO(0x488ff380), DICO(0x4fad2700), DICO(0x55845000), DICO(0x5ca74c00),
  8717. - DICO(0x04b456f0), DICO(0x05fca198), DICO(0x0ad056d0), DICO(0x19c3bfe0),
  8718. - DICO(0x1d446100), DICO(0x20f67200), DICO(0x24a40b40), DICO(0x28d472c0),
  8719. - DICO(0x2da813c0), DICO(0x31880200), DICO(0x35344f40), DICO(0x3ca7f340),
  8720. - DICO(0x4aa94300), DICO(0x4f921500), DICO(0x5516d700), DICO(0x5c832880),
  8721. - DICO(0x07f468c0), DICO(0x0bbb6e90), DICO(0x0f0f8730), DICO(0x143d6180),
  8722. - DICO(0x198b84c0), DICO(0x1c6b30a0), DICO(0x219c8000), DICO(0x28795780),
  8723. - DICO(0x2cce3d00), DICO(0x329b1100), DICO(0x3a8d2240), DICO(0x3f579080),
  8724. - DICO(0x45a74400), DICO(0x4d000f80), DICO(0x52bd6880), DICO(0x5a743a80),
  8725. - DICO(0x06979498), DICO(0x088fecf0), DICO(0x0f1dac90), DICO(0x12077160),
  8726. - DICO(0x16d5b120), DICO(0x1c5465c0), DICO(0x21ad14c0), DICO(0x282be280),
  8727. - DICO(0x2b66a380), DICO(0x2fa3f200), DICO(0x35a06500), DICO(0x3a458d00),
  8728. - DICO(0x44aefc00), DICO(0x4e92f600), DICO(0x55b9fa80), DICO(0x5cfe0280),
  8729. - DICO(0x0552b408), DICO(0x06f6ce38), DICO(0x0e8f8d80), DICO(0x1395e900),
  8730. - DICO(0x17c7b440), DICO(0x1ec64dc0), DICO(0x236e2200), DICO(0x2abc0b80),
  8731. - DICO(0x2e131240), DICO(0x32921100), DICO(0x372633c0), DICO(0x3ca97840),
  8732. - DICO(0x496e5000), DICO(0x4f86a800), DICO(0x54072300), DICO(0x5be31c80),
  8733. - DICO(0x0470c0b8), DICO(0x0662c468), DICO(0x0c493fd0), DICO(0x1a1949c0),
  8734. - DICO(0x1febcc20), DICO(0x2364e900), DICO(0x2a0cce00), DICO(0x2f6f8140),
  8735. - DICO(0x3418b000), DICO(0x3c5c7a40), DICO(0x42d39100), DICO(0x476c2b00),
  8736. - DICO(0x4e11c300), DICO(0x53621500), DICO(0x583fd280), DICO(0x5ce26600),
  8737. - DICO(0x04b006c0), DICO(0x09a1ed40), DICO(0x135aee00), DICO(0x193b5180),
  8738. - DICO(0x1f3679a0), DICO(0x24fdbcc0), DICO(0x2b823e00), DICO(0x31835780),
  8739. - DICO(0x37c74cc0), DICO(0x3df66780), DICO(0x43c18580), DICO(0x49465980),
  8740. - DICO(0x4ed0ce00), DICO(0x53d6fb80), DICO(0x59064300), DICO(0x5deaa100),
  8741. - DICO(0x03cbc49c), DICO(0x07735930), DICO(0x138aaa20), DICO(0x1a1e69a0),
  8742. - DICO(0x21be93c0), DICO(0x2936f780), DICO(0x2fa76f80), DICO(0x34ae6b00),
  8743. - DICO(0x396b7b80), DICO(0x3dbc6700), DICO(0x421a9100), DICO(0x46fd2180),
  8744. - DICO(0x4c5dca80), DICO(0x51923b80), DICO(0x576d1300), DICO(0x5d288680),
  8745. - DICO(0x03cab7d0), DICO(0x052c88b8), DICO(0x09ed24f0), DICO(0x1c261820),
  8746. - DICO(0x209096c0), DICO(0x2361e080), DICO(0x27292800), DICO(0x2bbdc6c0),
  8747. - DICO(0x3292da80), DICO(0x36866a40), DICO(0x3c4d5100), DICO(0x45233400),
  8748. - DICO(0x4d928a00), DICO(0x52ca9d00), DICO(0x5820d000), DICO(0x5d903880),
  8749. - DICO(0x03f83718), DICO(0x0540fa90), DICO(0x13028120), DICO(0x1ad6e160),
  8750. - DICO(0x1d784880), DICO(0x22028900), DICO(0x25976b40), DICO(0x2b293700),
  8751. - DICO(0x2ddb86c0), DICO(0x317c4340), DICO(0x34e62ec0), DICO(0x3b71bd00),
  8752. - DICO(0x4bc34780), DICO(0x52982400), DICO(0x57fa2800), DICO(0x5f19cc00),
  8753. - DICO(0x049ceb50), DICO(0x06a8d4e0), DICO(0x09db2470), DICO(0x120e3e60),
  8754. - DICO(0x1c8ebb80), DICO(0x21221d00), DICO(0x2679bfc0), DICO(0x2b1e7600),
  8755. - DICO(0x2ebbcf80), DICO(0x32d5afc0), DICO(0x3d1bef00), DICO(0x41b11a00),
  8756. - DICO(0x45bb2d80), DICO(0x4cb70300), DICO(0x572fdc80), DICO(0x5d876e80),
  8757. - DICO(0x04abda68), DICO(0x06698cd0), DICO(0x0ca87230), DICO(0x15086a80),
  8758. - DICO(0x176cf4e0), DICO(0x22899440), DICO(0x268fc500), DICO(0x2ba2d940),
  8759. - DICO(0x33505980), DICO(0x36944bc0), DICO(0x3b20c280), DICO(0x437e8f00),
  8760. - DICO(0x4bf29e80), DICO(0x51776a80), DICO(0x57a77800), DICO(0x5cf6c180),
  8761. - DICO(0x06d7f5c0), DICO(0x08fd3cc0), DICO(0x0d8807e0), DICO(0x1140d500),
  8762. - DICO(0x146dfc80), DICO(0x1e9fbaa0), DICO(0x23d7bf00), DICO(0x28b2ae80),
  8763. - DICO(0x2e5a9b00), DICO(0x327005c0), DICO(0x37736640), DICO(0x4001c500),
  8764. - DICO(0x4a862b00), DICO(0x4f7a2e00), DICO(0x54a22080), DICO(0x5b76c380),
  8765. - DICO(0x0671fb68), DICO(0x08e4bf30), DICO(0x0d801250), DICO(0x1176b820),
  8766. - DICO(0x15128860), DICO(0x1ee21180), DICO(0x24799580), DICO(0x29415a40),
  8767. - DICO(0x2efa2380), DICO(0x33fe5040), DICO(0x39bf6d00), DICO(0x3f28b380),
  8768. - DICO(0x442b2280), DICO(0x493de680), DICO(0x54377700), DICO(0x5d3a5480),
  8769. - DICO(0x065b7970), DICO(0x087820b0), DICO(0x0d8d6aa0), DICO(0x16718620),
  8770. - DICO(0x1a3a8f40), DICO(0x1f4099c0), DICO(0x24d87b40), DICO(0x296d85c0),
  8771. - DICO(0x2f887c80), DICO(0x342d1b40), DICO(0x3887fc40), DICO(0x3d758b40),
  8772. - DICO(0x42641c80), DICO(0x47bf6980), DICO(0x55f82900), DICO(0x5e132a00),
  8773. - DICO(0x05ddbc00), DICO(0x081f17a0), DICO(0x0bf23ac0), DICO(0x12fc8d60),
  8774. - DICO(0x172bc440), DICO(0x1a833540), DICO(0x1e942200), DICO(0x21e477c0),
  8775. - DICO(0x2e75da80), DICO(0x399efac0), DICO(0x3dfb6900), DICO(0x428b3780),
  8776. - DICO(0x4922a080), DICO(0x4d4c1700), DICO(0x51bbee00), DICO(0x5b4cfc80),
  8777. - DICO(0x06ecf380), DICO(0x08f83990), DICO(0x0cb55680), DICO(0x140b2860),
  8778. - DICO(0x18084d00), DICO(0x1aff9940), DICO(0x1f5f6f00), DICO(0x224a3d80),
  8779. - DICO(0x2b0f49c0), DICO(0x3613b280), DICO(0x39188f40), DICO(0x3efa3640),
  8780. - DICO(0x4771e400), DICO(0x4ca32380), DICO(0x54627580), DICO(0x5cb91000),
  8781. - DICO(0x069e7f98), DICO(0x0870c760), DICO(0x0d7b73a0), DICO(0x15ab1040),
  8782. - DICO(0x18a4d220), DICO(0x1c4c1f20), DICO(0x1ffaf200), DICO(0x24142580),
  8783. - DICO(0x30e47540), DICO(0x37340200), DICO(0x3a69af40), DICO(0x3ed471c0),
  8784. - DICO(0x44157880), DICO(0x486b7f00), DICO(0x52ed2b00), DICO(0x5ce3a980),
  8785. - DICO(0x047f1080), DICO(0x06463230), DICO(0x0b566e80), DICO(0x0edb9080),
  8786. - DICO(0x128a2fa0), DICO(0x1748b340), DICO(0x210b2b00), DICO(0x28099b80),
  8787. - DICO(0x2f519740), DICO(0x36fe82c0), DICO(0x3d924b80), DICO(0x43cd3c00),
  8788. - DICO(0x4a774680), DICO(0x50d15f00), DICO(0x573b3580), DICO(0x5d4c1c00),
  8789. - DICO(0x05fa6a68), DICO(0x0866e4c0), DICO(0x0d133cc0), DICO(0x156d6b20),
  8790. - DICO(0x18abebe0), DICO(0x1d374900), DICO(0x23d23d00), DICO(0x27b370c0),
  8791. - DICO(0x2f63ef00), DICO(0x352a0600), DICO(0x3a643a40), DICO(0x3f57f980),
  8792. - DICO(0x457a7f00), DICO(0x520f6200), DICO(0x593b2c80), DICO(0x5e192b80),
  8793. - DICO(0x04e4e0c8), DICO(0x067c3450), DICO(0x0acabe70), DICO(0x1865eec0),
  8794. - DICO(0x1c5e9bc0), DICO(0x202facc0), DICO(0x24a609c0), DICO(0x28db7b00),
  8795. - DICO(0x2efbd780), DICO(0x336fe5c0), DICO(0x3819a5c0), DICO(0x3e709b40),
  8796. - DICO(0x4435ff80), DICO(0x4bd5fb80), DICO(0x5564a100), DICO(0x5d0a4980),
  8797. - DICO(0x05a72f00), DICO(0x070199b0), DICO(0x0e654780), DICO(0x14fc7780),
  8798. - DICO(0x174283c0), DICO(0x1b231480), DICO(0x1e7b9000), DICO(0x27a013c0),
  8799. - DICO(0x2b42f500), DICO(0x2fd9ca00), DICO(0x3672a0c0), DICO(0x3cc23f40),
  8800. - DICO(0x48299d80), DICO(0x4f92a800), DICO(0x564d7680), DICO(0x5d3ab580),
  8801. - DICO(0x03e63764), DICO(0x05baa3f0), DICO(0x0ab2a300), DICO(0x12cc5f60),
  8802. - DICO(0x19a8d5e0), DICO(0x1ea788e0), DICO(0x22cd50c0), DICO(0x25d48a00),
  8803. - DICO(0x29924540), DICO(0x32762a00), DICO(0x3bba55c0), DICO(0x4222e800),
  8804. - DICO(0x4aba1280), DICO(0x501d0b80), DICO(0x57091200), DICO(0x5d6bf180),
  8805. - DICO(0x047daeb0), DICO(0x069548b8), DICO(0x0b002410), DICO(0x13ff7060),
  8806. - DICO(0x186aec40), DICO(0x210db240), DICO(0x26f1ce80), DICO(0x2b73c9c0),
  8807. - DICO(0x33d57240), DICO(0x385898c0), DICO(0x3eea8cc0), DICO(0x43c79b00),
  8808. - DICO(0x496ec200), DICO(0x4e150780), DICO(0x54dcb700), DICO(0x5c3f7380),
  8809. - DICO(0x079fd258), DICO(0x0b93bd50), DICO(0x0ff7d8b0), DICO(0x14bd4e00),
  8810. - DICO(0x19536ae0), DICO(0x1d8b1640), DICO(0x23747cc0), DICO(0x2861f280),
  8811. - DICO(0x2d7d2880), DICO(0x3583b040), DICO(0x3c3cab00), DICO(0x41b7b580),
  8812. - DICO(0x498cfc80), DICO(0x506cbd00), DICO(0x57847600), DICO(0x5d05de80),
  8813. - DICO(0x06434ec0), DICO(0x0805ccd0), DICO(0x0c4b4c00), DICO(0x13d551c0),
  8814. - DICO(0x1685abe0), DICO(0x1a83ea60), DICO(0x1ddc3700), DICO(0x22bc4600),
  8815. - DICO(0x2c7ca5c0), DICO(0x30a589c0), DICO(0x395a8700), DICO(0x40c92900),
  8816. - DICO(0x472fae80), DICO(0x4f6f6e80), DICO(0x571b3f80), DICO(0x5d8e6980),
  8817. - DICO(0x05ec21b0), DICO(0x079ee388), DICO(0x0e4b4580), DICO(0x11abf100),
  8818. - DICO(0x16588ec0), DICO(0x1c984ec0), DICO(0x20a384c0), DICO(0x28d6be00),
  8819. - DICO(0x2bcca740), DICO(0x3604b600), DICO(0x3f027280), DICO(0x434af000),
  8820. - DICO(0x48dac280), DICO(0x4d7e8a00), DICO(0x51f61800), DICO(0x5a6d9380),
  8821. - DICO(0x0552c6c0), DICO(0x070c22a0), DICO(0x0a411b50), DICO(0x0e3e5270),
  8822. - DICO(0x1193bb60), DICO(0x1b177e00), DICO(0x275b2500), DICO(0x2b42bd80),
  8823. - DICO(0x322d7e40), DICO(0x3a170880), DICO(0x3d66b580), DICO(0x41413280),
  8824. - DICO(0x46a9ce80), DICO(0x4e4e3800), DICO(0x571f8380), DICO(0x5ddae380),
  8825. - DICO(0x055602c0), DICO(0x06e69118), DICO(0x0c9d13f0), DICO(0x1090d500),
  8826. - DICO(0x138d2280), DICO(0x171bf540), DICO(0x1b585180), DICO(0x288b9740),
  8827. - DICO(0x2db202c0), DICO(0x3525e680), DICO(0x3c303900), DICO(0x4311df80),
  8828. - DICO(0x49b92c00), DICO(0x509de900), DICO(0x56e9a080), DICO(0x5d523a80),
  8829. - DICO(0x04e79810), DICO(0x069626e8), DICO(0x0a6cf680), DICO(0x0da668c0),
  8830. - DICO(0x115872a0), DICO(0x2032eec0), DICO(0x25345dc0), DICO(0x2ae8ea40),
  8831. - DICO(0x30224280), DICO(0x351ff640), DICO(0x3ce65a80), DICO(0x454bff00),
  8832. - DICO(0x4ee08980), DICO(0x543b4280), DICO(0x59c19280), DICO(0x5ddfbb00),
  8833. - DICO(0x03f0bb98), DICO(0x0588f4f0), DICO(0x0a862bc0), DICO(0x14ec76e0),
  8834. - DICO(0x184b8a80), DICO(0x1f7bbd80), DICO(0x23f1a7c0), DICO(0x2c367900),
  8835. - DICO(0x3234af80), DICO(0x35460ac0), DICO(0x38514c00), DICO(0x3d5f3540),
  8836. - DICO(0x48394980), DICO(0x4fbdd380), DICO(0x56de0280), DICO(0x5d4e6500),
  8837. - DICO(0x06050f28), DICO(0x08070af0), DICO(0x0be31240), DICO(0x0f5e53e0),
  8838. - DICO(0x125f1740), DICO(0x215b1fc0), DICO(0x2883d880), DICO(0x2c181080),
  8839. - DICO(0x32810280), DICO(0x35d56800), DICO(0x3a9b0880), DICO(0x3ffaaf80),
  8840. - DICO(0x44c65500), DICO(0x4a45ae80), DICO(0x56b4ed80), DICO(0x5e4adc00),
  8841. - DICO(0x0372bbb4), DICO(0x04ea4848), DICO(0x09b8de70), DICO(0x151b4a40),
  8842. - DICO(0x1be65a00), DICO(0x207655c0), DICO(0x2720dd00), DICO(0x2fc6cc00),
  8843. - DICO(0x35b063c0), DICO(0x39bd30c0), DICO(0x3dc5b580), DICO(0x42af7b00),
  8844. - DICO(0x48d2bf00), DICO(0x4f46bb80), DICO(0x55f7ca80), DICO(0x5ca7e980),
  8845. - DICO(0x033f868c), DICO(0x04d9a0e0), DICO(0x0a18d6d0), DICO(0x13da5580),
  8846. - DICO(0x181ae880), DICO(0x207d8580), DICO(0x262022c0), DICO(0x2c6de040),
  8847. - DICO(0x3321f100), DICO(0x3927f0c0), DICO(0x3f74ce40), DICO(0x4573e980),
  8848. - DICO(0x4ba66c80), DICO(0x51a26100), DICO(0x57d3a800), DICO(0x5d52e780),
  8849. - DICO(0x05189860), DICO(0x07231848), DICO(0x0b915710), DICO(0x0f05d6c0),
  8850. - DICO(0x13bb0820), DICO(0x223adf00), DICO(0x26ce1ec0), DICO(0x2ce1ac00),
  8851. - DICO(0x3401f6c0), DICO(0x3b8c2240), DICO(0x40e4a400), DICO(0x45674f00),
  8852. - DICO(0x4b04b880), DICO(0x4f253200), DICO(0x54168600), DICO(0x58f52780),
  8853. - DICO(0x0338d184), DICO(0x05205790), DICO(0x09abcd80), DICO(0x0f53ff60),
  8854. - DICO(0x1a7fe900), DICO(0x1ef93860), DICO(0x238e2d80), DICO(0x2bd81bc0),
  8855. - DICO(0x33161240), DICO(0x368cfb80), DICO(0x3a28b5c0), DICO(0x40c7a600),
  8856. - DICO(0x4bac7780), DICO(0x524b7880), DICO(0x58638480), DICO(0x5da07b00),
  8857. - DICO(0x04d06f38), DICO(0x065f1518), DICO(0x0c9b31b0), DICO(0x10570d40),
  8858. - DICO(0x15e790a0), DICO(0x20f16380), DICO(0x246f23c0), DICO(0x2e222800),
  8859. - DICO(0x3198bf00), DICO(0x34b84640), DICO(0x38f5b440), DICO(0x4312df80),
  8860. - DICO(0x4d2d3000), DICO(0x5209ee80), DICO(0x579cf180), DICO(0x5cb37680),
  8861. - DICO(0x042e6560), DICO(0x05eaff30), DICO(0x0a090d30), DICO(0x0d9f2ab0),
  8862. - DICO(0x1a6f0260), DICO(0x209e0c00), DICO(0x25dc95c0), DICO(0x29f89840),
  8863. - DICO(0x2f372840), DICO(0x3a301940), DICO(0x3f0e2e80), DICO(0x44465c80),
  8864. - DICO(0x49207780), DICO(0x4dfdab80), DICO(0x532ec000), DICO(0x5acefd00),
  8865. - DICO(0x04e18ad8), DICO(0x06d5b660), DICO(0x0b2a22d0), DICO(0x0e0e4ef0),
  8866. - DICO(0x198304a0), DICO(0x1e4a25c0), DICO(0x23de37c0), DICO(0x290679c0),
  8867. - DICO(0x2d523b00), DICO(0x337df940), DICO(0x37948100), DICO(0x3de07300),
  8868. - DICO(0x49ee6e80), DICO(0x50576100), DICO(0x55fb1e00), DICO(0x5d080500),
  8869. - DICO(0x05312308), DICO(0x070463f0), DICO(0x0daffba0), DICO(0x12d8c3c0),
  8870. - DICO(0x163ab7a0), DICO(0x20c64c40), DICO(0x24c8fe40), DICO(0x2a6f65c0),
  8871. - DICO(0x3055e100), DICO(0x34420d80), DICO(0x389ded00), DICO(0x3cc57640),
  8872. - DICO(0x4280cd00), DICO(0x4e0a4c00), DICO(0x57675f00), DICO(0x5d87d480),
  8873. - DICO(0x047bd598), DICO(0x06cb1498), DICO(0x0c359930), DICO(0x138165e0),
  8874. - DICO(0x1cae3640), DICO(0x21647640), DICO(0x2836fac0), DICO(0x2cd7b840),
  8875. - DICO(0x30d839c0), DICO(0x360c9440), DICO(0x3ae5ca40), DICO(0x40a93b00),
  8876. - DICO(0x49401e80), DICO(0x4f739c80), DICO(0x54f33c00), DICO(0x5c190200),
  8877. - DICO(0x051c0000), DICO(0x06b45258), DICO(0x0a5eee50), DICO(0x0d46fc30),
  8878. - DICO(0x125bbc60), DICO(0x253d8cc0), DICO(0x2a1fd6c0), DICO(0x2df4cf80),
  8879. - DICO(0x3239e3c0), DICO(0x35a683c0), DICO(0x3b0bb980), DICO(0x409b3d00),
  8880. - DICO(0x46633580), DICO(0x4f2b0600), DICO(0x577cea80), DICO(0x5d86ef00),
  8881. - DICO(0x03d19eec), DICO(0x07cce6d0), DICO(0x143b4b00), DICO(0x1a657880),
  8882. - DICO(0x212e0280), DICO(0x2831fbc0), DICO(0x2f8ba080), DICO(0x35db8040),
  8883. - DICO(0x3bf17f00), DICO(0x413eb100), DICO(0x46154900), DICO(0x4ae18080),
  8884. - DICO(0x4f9ba180), DICO(0x5428ba00), DICO(0x590e9080), DICO(0x5de0d880),
  8885. - DICO(0x08c7e720), DICO(0x0ff14810), DICO(0x1758cc40), DICO(0x1cc744c0),
  8886. - DICO(0x23e45cc0), DICO(0x2b527940), DICO(0x32138580), DICO(0x37b77380),
  8887. - DICO(0x3d7da480), DICO(0x4275a800), DICO(0x473ecf00), DICO(0x4bc7dc80),
  8888. - DICO(0x50512400), DICO(0x54d2c600), DICO(0x598ce680), DICO(0x5e1e0800),
  8889. - DICO(0x09167910), DICO(0x107644a0), DICO(0x171a59e0), DICO(0x1be1ea60),
  8890. - DICO(0x21347680), DICO(0x265a5b00), DICO(0x2be41a40), DICO(0x3116e700),
  8891. - DICO(0x368b0300), DICO(0x3c225e80), DICO(0x41a6e880), DICO(0x47631680),
  8892. - DICO(0x4d47d900), DICO(0x52a28400), DICO(0x583f0e80), DICO(0x5d77bc80),
  8893. - DICO(0x040bdf88), DICO(0x05b062a0), DICO(0x0b4a2f70), DICO(0x1b8cd880),
  8894. - DICO(0x1ec58c40), DICO(0x23661880), DICO(0x2790ba80), DICO(0x2d0d6c40),
  8895. - DICO(0x34f0bc40), DICO(0x3a353f80), DICO(0x3fc3bc40), DICO(0x44998700),
  8896. - DICO(0x49b17080), DICO(0x4f31fa00), DICO(0x55311c80), DICO(0x5b5c8f80),
  8897. - DICO(0x043e2bd0), DICO(0x0645b0f0), DICO(0x0ade5b90), DICO(0x0d653a90),
  8898. - DICO(0x1bc224a0), DICO(0x1f623dc0), DICO(0x27e9a840), DICO(0x2c719bc0),
  8899. - DICO(0x2f2ac040), DICO(0x32688300), DICO(0x36695c00), DICO(0x3b8abe40),
  8900. - DICO(0x47153a80), DICO(0x52491b00), DICO(0x57ba7680), DICO(0x5ce6c300),
  8901. - DICO(0x052940b8), DICO(0x06f28228), DICO(0x0a741c90), DICO(0x0daa3110),
  8902. - DICO(0x113bb2e0), DICO(0x2010b640), DICO(0x2610f380), DICO(0x2a5c7740),
  8903. - DICO(0x2f7703c0), DICO(0x3388d080), DICO(0x3ceabe40), DICO(0x42462a80),
  8904. - DICO(0x47fb0e00), DICO(0x4f7ac480), DICO(0x5706f580), DICO(0x5d92b800),
  8905. - DICO(0x03a134a4), DICO(0x05623470), DICO(0x090a0fe0), DICO(0x12f7d3e0),
  8906. - DICO(0x1d63e440), DICO(0x20e6ac80), DICO(0x247da8c0), DICO(0x27d99600),
  8907. - DICO(0x312e99c0), DICO(0x368fb380), DICO(0x3b3e3ec0), DICO(0x40fead80),
  8908. - DICO(0x4888fa00), DICO(0x4fbd5600), DICO(0x5795a480), DICO(0x5d973000),
  8909. - DICO(0x05697990), DICO(0x06f33800), DICO(0x0b298290), DICO(0x0de47a60),
  8910. - DICO(0x12ef62a0), DICO(0x21e30a00), DICO(0x25f8ff00), DICO(0x2b2287c0),
  8911. - DICO(0x2f11fc00), DICO(0x33138000), DICO(0x37b49f80), DICO(0x41325100),
  8912. - DICO(0x4ab62800), DICO(0x501eae80), DICO(0x56228780), DICO(0x5c5d8300),
  8913. - DICO(0x063830d8), DICO(0x08a76a30), DICO(0x0d376890), DICO(0x117d3a00),
  8914. - DICO(0x1476e5c0), DICO(0x1e215720), DICO(0x24bcd680), DICO(0x29674ac0),
  8915. - DICO(0x2faab340), DICO(0x33843a00), DICO(0x3822e900), DICO(0x3d30b6c0),
  8916. - DICO(0x49cd5480), DICO(0x53187d00), DICO(0x591fe100), DICO(0x5db30f80),
  8917. - DICO(0x05cdc378), DICO(0x075c50c8), DICO(0x0e01f830), DICO(0x12b70480),
  8918. - DICO(0x15e333e0), DICO(0x192c9f40), DICO(0x1d2d6b80), DICO(0x2c09ca40),
  8919. - DICO(0x2eea5cc0), DICO(0x32c89380), DICO(0x376a5b40), DICO(0x42a42600),
  8920. - DICO(0x4c695900), DICO(0x5269e380), DICO(0x586d6c80), DICO(0x5cebdb80),
  8921. - DICO(0x052bbb80), DICO(0x0702e268), DICO(0x0ca196d0), DICO(0x0f48cef0),
  8922. - DICO(0x19d28b60), DICO(0x1ec44a40), DICO(0x24d40f00), DICO(0x29e1eac0),
  8923. - DICO(0x2cafaa80), DICO(0x301bd4c0), DICO(0x357ec200), DICO(0x42254480),
  8924. - DICO(0x4be32000), DICO(0x4f7a4a00), DICO(0x5447fc00), DICO(0x5cca6a00),
  8925. - DICO(0x050fdd18), DICO(0x06c77e10), DICO(0x10561140), DICO(0x1564c340),
  8926. - DICO(0x1867abe0), DICO(0x1f00fba0), DICO(0x22c06240), DICO(0x2aed7680),
  8927. - DICO(0x2ecc24c0), DICO(0x32abb300), DICO(0x36b42340), DICO(0x3ed8f480),
  8928. - DICO(0x4bbdfe80), DICO(0x516bf800), DICO(0x58688b00), DICO(0x5dd44980),
  8929. - DICO(0x058aa130), DICO(0x07d69ba8), DICO(0x0d521f40), DICO(0x0ff37ba0),
  8930. - DICO(0x18125ec0), DICO(0x1f3a4520), DICO(0x23349840), DICO(0x2c759580),
  8931. - DICO(0x2fc21c00), DICO(0x33a42fc0), DICO(0x3dc92900), DICO(0x47befd00),
  8932. - DICO(0x4ccd2480), DICO(0x5197a200), DICO(0x56a2ea00), DICO(0x5bdfa900),
  8933. - DICO(0x05ac8640), DICO(0x076aec88), DICO(0x0e2e3230), DICO(0x114b6f40),
  8934. - DICO(0x155d10a0), DICO(0x19bac600), DICO(0x1fbd75c0), DICO(0x2459c0c0),
  8935. - DICO(0x28229b80), DICO(0x2f586fc0), DICO(0x3d0697c0), DICO(0x42a7a500),
  8936. - DICO(0x49b0bb80), DICO(0x4e642e80), DICO(0x55774280), DICO(0x5d1a7900),
  8937. - DICO(0x05efb470), DICO(0x0831c8a0), DICO(0x0d35ece0), DICO(0x13edc400),
  8938. - DICO(0x16c8fec0), DICO(0x1bb25860), DICO(0x204f3140), DICO(0x277b8a40),
  8939. - DICO(0x2fe9a000), DICO(0x33af7c40), DICO(0x3b7d2900), DICO(0x419c9a80),
  8940. - DICO(0x4591dc80), DICO(0x4bdafd00), DICO(0x55638880), DICO(0x5cef2300),
  8941. - DICO(0x05cf4988), DICO(0x078fa8c0), DICO(0x0c291950), DICO(0x12e05320),
  8942. - DICO(0x155997e0), DICO(0x195df540), DICO(0x1c1b82c0), DICO(0x22c29400),
  8943. - DICO(0x307edec0), DICO(0x34e829c0), DICO(0x3b1b5040), DICO(0x434de400),
  8944. - DICO(0x496b9900), DICO(0x4ff88080), DICO(0x5604c480), DICO(0x5c84b080),
  8945. - DICO(0x03679fa4), DICO(0x050d4a20), DICO(0x09feec10), DICO(0x100a21e0),
  8946. - DICO(0x1483b260), DICO(0x1d76c780), DICO(0x24e75c80), DICO(0x2bd62880),
  8947. - DICO(0x32350a40), DICO(0x38be01c0), DICO(0x3f05a280), DICO(0x45295e80),
  8948. - DICO(0x4b554800), DICO(0x51618880), DICO(0x575a1500), DICO(0x5d109d80),
  8949. - DICO(0x034ffd08), DICO(0x04dccea8), DICO(0x07e289b8), DICO(0x0d6950d0),
  8950. - DICO(0x189acec0), DICO(0x1e3bf240), DICO(0x2535aa40), DICO(0x2b88d140),
  8951. - DICO(0x329bbb00), DICO(0x386c3500), DICO(0x3e950800), DICO(0x44c43f00),
  8952. - DICO(0x4b089780), DICO(0x51223280), DICO(0x574c9780), DICO(0x5d366400),
  8953. - DICO(0x036d8db8), DICO(0x04fd88b8), DICO(0x09700a70), DICO(0x116b73c0),
  8954. - DICO(0x17258c40), DICO(0x1fd03000), DICO(0x23fdf400), DICO(0x28e08dc0),
  8955. - DICO(0x32d688c0), DICO(0x37920b00), DICO(0x3daaa080), DICO(0x46a16c00),
  8956. - DICO(0x4f8c3100), DICO(0x54a13700), DICO(0x59d24b80), DICO(0x5cea4d80),
  8957. - DICO(0x05797c88), DICO(0x080dc8f0), DICO(0x0bd21520), DICO(0x1095b540),
  8958. - DICO(0x138fd400), DICO(0x1aed19c0), DICO(0x29fead00), DICO(0x2f70cec0),
  8959. - DICO(0x3327df00), DICO(0x3a812d00), DICO(0x400a8380), DICO(0x449daa00),
  8960. - DICO(0x4cd6b600), DICO(0x51f12400), DICO(0x56bdfd80), DICO(0x5be0a100),
  8961. - DICO(0x04de6d78), DICO(0x072aed40), DICO(0x0c6fc460), DICO(0x0f260220),
  8962. - DICO(0x179d00c0), DICO(0x1e8244e0), DICO(0x23867240), DICO(0x2baf7680),
  8963. - DICO(0x2fa6d240), DICO(0x37e83d40), DICO(0x3d1cbfc0), DICO(0x439d0a00),
  8964. - DICO(0x49fd3e00), DICO(0x50095e80), DICO(0x559f2080), DICO(0x5b889a00),
  8965. - DICO(0x042f5c10), DICO(0x061ab3e8), DICO(0x0dd8f160), DICO(0x126e0b40),
  8966. - DICO(0x16ea9040), DICO(0x20a31700), DICO(0x24608140), DICO(0x2ec65080),
  8967. - DICO(0x334e1a40), DICO(0x38252100), DICO(0x3fff0900), DICO(0x46519a80),
  8968. - DICO(0x4c5e0d80), DICO(0x518c5800), DICO(0x56c5b080), DICO(0x5c6ebb80),
  8969. - DICO(0x045ce230), DICO(0x067547b0), DICO(0x0a21c670), DICO(0x1408b820),
  8970. - DICO(0x1c0505c0), DICO(0x1e806c80), DICO(0x26d3c640), DICO(0x2ca573c0),
  8971. - DICO(0x3014d880), DICO(0x377108c0), DICO(0x3f35cf80), DICO(0x43566100),
  8972. - DICO(0x4a612900), DICO(0x5160c780), DICO(0x57d3e300), DICO(0x5d414b80),
  8973. - DICO(0x04c8eda8), DICO(0x06a32320), DICO(0x09ab2590), DICO(0x14230760),
  8974. - DICO(0x20fb23c0), DICO(0x24aa2880), DICO(0x285a2580), DICO(0x2c464ac0),
  8975. - DICO(0x30098280), DICO(0x36232780), DICO(0x3e428d40), DICO(0x42982280),
  8976. - DICO(0x47e60d80), DICO(0x4e1ecc00), DICO(0x55eb9200), DICO(0x5c81ed00),
  8977. - DICO(0x040d0b90), DICO(0x0586c5c0), DICO(0x0bea2190), DICO(0x1dc8dd60),
  8978. - DICO(0x20a07c40), DICO(0x2437e580), DICO(0x27ca5fc0), DICO(0x2d017980),
  8979. - DICO(0x34100040), DICO(0x38d3afc0), DICO(0x3da9b700), DICO(0x42082480),
  8980. - DICO(0x46586f00), DICO(0x4e3c3d80), DICO(0x55e1ee00), DICO(0x5c938d00),
  8981. - DICO(0x03d18c64), DICO(0x05941d60), DICO(0x116b2560), DICO(0x19cc8820),
  8982. - DICO(0x1ce930c0), DICO(0x22626080), DICO(0x26d2cf80), DICO(0x2ce2c980),
  8983. - DICO(0x305361c0), DICO(0x34b65900), DICO(0x39ee5b40), DICO(0x41508400),
  8984. - DICO(0x47ee1e80), DICO(0x50311180), DICO(0x56cb0c00), DICO(0x5d561680),
  8985. - DICO(0x0af22cf0), DICO(0x154e1c60), DICO(0x1b44ff60), DICO(0x2087d0c0),
  8986. - DICO(0x252f7380), DICO(0x28fe66c0), DICO(0x2d0e9800), DICO(0x30f7ee00),
  8987. - DICO(0x3606d640), DICO(0x3bac0a40), DICO(0x417c3700), DICO(0x470c2900),
  8988. - DICO(0x4cc20d00), DICO(0x51e55e80), DICO(0x576bc200), DICO(0x5caa7080),
  8989. - DICO(0x043314e0), DICO(0x05cb47b0), DICO(0x0985df20), DICO(0x185a22c0),
  8990. - DICO(0x1ea68300), DICO(0x21af9100), DICO(0x25cdcb40), DICO(0x297e0a80),
  8991. - DICO(0x3142ac80), DICO(0x358bb040), DICO(0x3a1345c0), DICO(0x402ca580),
  8992. - DICO(0x4d964780), DICO(0x5420cf80), DICO(0x592adf80), DICO(0x5dfe7a80),
  8993. - DICO(0x04c70e20), DICO(0x062fd6f0), DICO(0x113c60a0), DICO(0x159e9900),
  8994. - DICO(0x1933e5a0), DICO(0x1decffa0), DICO(0x22373400), DICO(0x27ed7180),
  8995. - DICO(0x2a8349c0), DICO(0x2f78f940), DICO(0x3d5c8540), DICO(0x429c3500),
  8996. - DICO(0x4936e300), DICO(0x4de08d00), DICO(0x52627700), DICO(0x5d822680),
  8997. - DICO(0x04982770), DICO(0x06ab1ad8), DICO(0x0cba1090), DICO(0x10839d60),
  8998. - DICO(0x1acd6a60), DICO(0x1f554560), DICO(0x2431c1c0), DICO(0x295db800),
  8999. - DICO(0x2d374c00), DICO(0x31f2fd80), DICO(0x3a200480), DICO(0x416bea80),
  9000. - DICO(0x4ba1ce00), DICO(0x52a88000), DICO(0x58d0db00), DICO(0x5d3e5800),
  9001. - DICO(0x059e0e70), DICO(0x08166ba0), DICO(0x0c9df590), DICO(0x11de5f40),
  9002. - DICO(0x14c08ea0), DICO(0x1c5ad6e0), DICO(0x24178ec0), DICO(0x28eb7640),
  9003. - DICO(0x31626280), DICO(0x35d43100), DICO(0x3cad10c0), DICO(0x422e1480),
  9004. - DICO(0x49baee00), DICO(0x53dd7180), DICO(0x5a17bb80), DICO(0x5e4bb180),
  9005. - DICO(0x03c64d00), DICO(0x05de0b28), DICO(0x0ccb82b0), DICO(0x144b1c00),
  9006. - DICO(0x19e39ec0), DICO(0x21e795c0), DICO(0x28149380), DICO(0x2f1ff7c0),
  9007. - DICO(0x35b7c900), DICO(0x3c5f4800), DICO(0x42799c00), DICO(0x48746180),
  9008. - DICO(0x4e8f4d00), DICO(0x53b98380), DICO(0x58d60000), DICO(0x5d71a000),
  9009. - DICO(0x050a2990), DICO(0x071bdb88), DICO(0x0f0d76b0), DICO(0x17a78de0),
  9010. - DICO(0x1aa20720), DICO(0x22eea3c0), DICO(0x276e9640), DICO(0x2ecc4d80),
  9011. - DICO(0x335f7900), DICO(0x37838640), DICO(0x3c81be80), DICO(0x41a4e400),
  9012. - DICO(0x476fa280), DICO(0x4f2ab780), DICO(0x56e87b80), DICO(0x5cbf2900),
  9013. - DICO(0x06724c98), DICO(0x099f5e20), DICO(0x119bcec0), DICO(0x16be11a0),
  9014. - DICO(0x19d53b00), DICO(0x1eb51360), DICO(0x2302c300), DICO(0x29c20d40),
  9015. - DICO(0x30dd5200), DICO(0x36576a80), DICO(0x3e3e7540), DICO(0x45aa9f80),
  9016. - DICO(0x4c833300), DICO(0x51d7ed00), DICO(0x57a4a380), DICO(0x5cce9100),
  9017. - DICO(0x05588b60), DICO(0x075a70a0), DICO(0x0ef96e30), DICO(0x12ac1100),
  9018. - DICO(0x1649dde0), DICO(0x1a50cdc0), DICO(0x22486140), DICO(0x27c7c800),
  9019. - DICO(0x2e08bd80), DICO(0x355d20c0), DICO(0x3925a9c0), DICO(0x44e2b480),
  9020. - DICO(0x4fa4e680), DICO(0x5470e180), DICO(0x595fee80), DICO(0x5d672f00),
  9021. - DICO(0x04a781c0), DICO(0x060a89f0), DICO(0x111f56a0), DICO(0x16b93be0),
  9022. - DICO(0x19ce9120), DICO(0x1e1fda60), DICO(0x2259f880), DICO(0x285cad80),
  9023. - DICO(0x2b140ec0), DICO(0x2f069940), DICO(0x33bbce40), DICO(0x3dd3e6c0),
  9024. - DICO(0x49154880), DICO(0x5008e380), DICO(0x568c4680), DICO(0x5da43780),
  9025. - DICO(0x053ade38), DICO(0x0708a200), DICO(0x0bad43d0), DICO(0x1860cf40),
  9026. - DICO(0x1c40dbe0), DICO(0x1f5a0120), DICO(0x25bcf7c0), DICO(0x29e0c840),
  9027. - DICO(0x2f223840), DICO(0x390c8940), DICO(0x3e1d7340), DICO(0x41c6a000),
  9028. - DICO(0x46cc2880), DICO(0x5006e280), DICO(0x5744e180), DICO(0x5d297780),
  9029. - DICO(0x0401a3f0), DICO(0x07be4a08), DICO(0x14f5f1a0), DICO(0x1c348080),
  9030. - DICO(0x226753c0), DICO(0x274b1b80), DICO(0x2c11a300), DICO(0x30798c00),
  9031. - DICO(0x35598c80), DICO(0x3aab18c0), DICO(0x4030f380), DICO(0x45c7b400),
  9032. - DICO(0x4be5be00), DICO(0x5180db80), DICO(0x57613b00), DICO(0x5cffff80),
  9033. - DICO(0x084b3090), DICO(0x0fe5b3b0), DICO(0x16dfd480), DICO(0x1d0aa700),
  9034. - DICO(0x24e08180), DICO(0x2b498640), DICO(0x30885b80), DICO(0x34ccc480),
  9035. - DICO(0x38fedec0), DICO(0x3cdf9c40), DICO(0x41737600), DICO(0x46ab9800),
  9036. - DICO(0x4c772e80), DICO(0x51e5b980), DICO(0x57df9900), DICO(0x5d5d7180),
  9037. - DICO(0x09549f00), DICO(0x12b84da0), DICO(0x1aeaf1c0), DICO(0x2142a9c0),
  9038. - DICO(0x275c9a00), DICO(0x2c260c80), DICO(0x3038c700), DICO(0x34081d00),
  9039. - DICO(0x38612f40), DICO(0x3d0bf8c0), DICO(0x42473e00), DICO(0x47ecad80),
  9040. - DICO(0x4db34380), DICO(0x52f0ab00), DICO(0x584cc980), DICO(0x5d62ae80),
  9041. - DICO(0x0aeca1e0), DICO(0x14354700), DICO(0x19955ba0), DICO(0x1de331e0),
  9042. - DICO(0x21cd60c0), DICO(0x25e72d80), DICO(0x2a402880), DICO(0x2efa64c0),
  9043. - DICO(0x3478d9c0), DICO(0x3a889e80), DICO(0x40744e00), DICO(0x4626fe80),
  9044. - DICO(0x4bd80900), DICO(0x51120f00), DICO(0x56d8d280), DICO(0x5c654400),
  9045. - DICO(0x07a40af8), DICO(0x0e65ec20), DICO(0x14c76780), DICO(0x19b35a60),
  9046. - DICO(0x1f76b7c0), DICO(0x24f512c0), DICO(0x2ae89f00), DICO(0x3036c3c0),
  9047. - DICO(0x36041800), DICO(0x3bc4df80), DICO(0x41adb080), DICO(0x477fbb80),
  9048. - DICO(0x4d5aa480), DICO(0x52cb0600), DICO(0x586f7280), DICO(0x5db40180),
  9049. - DICO(0x03997610), DICO(0x06175db0), DICO(0x0ea8c9c0), DICO(0x14397000),
  9050. - DICO(0x1ba34f60), DICO(0x22346680), DICO(0x28958080), DICO(0x2ea76840),
  9051. - DICO(0x33ee68c0), DICO(0x39e769c0), DICO(0x3f862500), DICO(0x4579b080),
  9052. - DICO(0x4b49cd00), DICO(0x5107da80), DICO(0x573cde00), DICO(0x5d090780),
  9053. - DICO(0x046fc2f8), DICO(0x0640dbc0), DICO(0x09da7ab0), DICO(0x174e4220),
  9054. - DICO(0x23dc8cc0), DICO(0x27016200), DICO(0x2a9a5240), DICO(0x2e6cc7c0),
  9055. - DICO(0x321ced40), DICO(0x38ca2d00), DICO(0x41482680), DICO(0x451e3700),
  9056. - DICO(0x4b90d800), DICO(0x50d0ba80), DICO(0x55602e80), DICO(0x5a465200),
  9057. - DICO(0x03ca7e28), DICO(0x057c9dd0), DICO(0x0c9ff0e0), DICO(0x1957fae0),
  9058. - DICO(0x1fef7860), DICO(0x27920c80), DICO(0x2cb233c0), DICO(0x32015c80),
  9059. - DICO(0x36af4f40), DICO(0x3ac18240), DICO(0x3f93d8c0), DICO(0x44eaef80),
  9060. - DICO(0x4aab5d80), DICO(0x50840e80), DICO(0x56c4cc80), DICO(0x5cb26600),
  9061. - DICO(0x038d53f8), DICO(0x050d1118), DICO(0x0bc14690), DICO(0x18918000),
  9062. - DICO(0x1e2a6ee0), DICO(0x24cc0c00), DICO(0x2a767d40), DICO(0x2e614940),
  9063. - DICO(0x32859c40), DICO(0x377fd940), DICO(0x3d3a3e40), DICO(0x43e81380),
  9064. - DICO(0x4aaac080), DICO(0x509e7800), DICO(0x57023a00), DICO(0x5d733c00),
  9065. - DICO(0x04cfa5e0), DICO(0x06deeb38), DICO(0x0a501c40), DICO(0x136d8aa0),
  9066. - DICO(0x17f16e40), DICO(0x1c119300), DICO(0x26154b00), DICO(0x2a0da100),
  9067. - DICO(0x2f5935c0), DICO(0x37108d40), DICO(0x3aef07c0), DICO(0x3fccf340),
  9068. - DICO(0x47e4a080), DICO(0x4d8de100), DICO(0x54eb6980), DICO(0x5cdb5380)};
  9069. -
  9070. -/* ACELP: table for decoding
  9071. - adaptive codebook gain g_p (left column). Scaled by 2.0f.
  9072. - innovative codebook gain g_c (right column). Scaled by 16.0f.
  9073. -*/
  9074. -const FIXP_SGL fdk_t_qua_gain7b[128 * 2] = {
  9075. - 204, 441, 464, 1977, 869, 1077, 1072, 3062, 1281, 4759, 1647,
  9076. - 1539, 1845, 7020, 1853, 634, 1995, 2336, 2351, 15400, 2661, 1165,
  9077. - 2702, 3900, 2710, 10133, 3195, 1752, 3498, 2624, 3663, 849, 3984,
  9078. - 5697, 4214, 3399, 4415, 1304, 4695, 2056, 5376, 4558, 5386, 676,
  9079. - 5518, 23554, 5567, 7794, 5644, 3061, 5672, 1513, 5957, 2338, 6533,
  9080. - 1060, 6804, 5998, 6820, 1767, 6937, 3837, 7277, 414, 7305, 2665,
  9081. - 7466, 11304, 7942, 794, 8007, 1982, 8007, 1366, 8326, 3105, 8336,
  9082. - 4810, 8708, 7954, 8989, 2279, 9031, 1055, 9247, 3568, 9283, 1631,
  9083. - 9654, 6311, 9811, 2605, 10120, 683, 10143, 4179, 10245, 1946, 10335,
  9084. - 1218, 10468, 9960, 10651, 3000, 10951, 1530, 10969, 5290, 11203, 2305,
  9085. - 11325, 3562, 11771, 6754, 11839, 1849, 11941, 4495, 11954, 1298, 11975,
  9086. - 15223, 11977, 883, 11986, 2842, 12438, 2141, 12593, 3665, 12636, 8367,
  9087. - 12658, 1594, 12886, 2628, 12984, 4942, 13146, 1115, 13224, 524, 13341,
  9088. - 3163, 13399, 1923, 13549, 5961, 13606, 1401, 13655, 2399, 13782, 3909,
  9089. - 13868, 10923, 14226, 1723, 14232, 2939, 14278, 7528, 14439, 4598, 14451,
  9090. - 984, 14458, 2265, 14792, 1403, 14818, 3445, 14899, 5709, 15017, 15362,
  9091. - 15048, 1946, 15069, 2655, 15405, 9591, 15405, 4079, 15570, 7183, 15687,
  9092. - 2286, 15691, 1624, 15699, 3068, 15772, 5149, 15868, 1205, 15970, 696,
  9093. - 16249, 3584, 16338, 1917, 16424, 2560, 16483, 4438, 16529, 6410, 16620,
  9094. - 11966, 16839, 8780, 17030, 3050, 17033, 18325, 17092, 1568, 17123, 5197,
  9095. - 17351, 2113, 17374, 980, 17566, 26214, 17609, 3912, 17639, 32767, 18151,
  9096. - 7871, 18197, 2516, 18202, 5649, 18679, 3283, 18930, 1370, 19271, 13757,
  9097. - 19317, 4120, 19460, 1973, 19654, 10018, 19764, 6792, 19912, 5135, 20040,
  9098. - 2841, 21234, 19833};
  9099. -
  9100. -/* ACELP: factor table for interpolation of LPC coeffs in LSP domain */
  9101. -const FIXP_SGL lsp_interpol_factor[2][NB_SUBFR] = {
  9102. - {FL2FXCONST_SGL(0.125f), FL2FXCONST_SGL(0.375f), FL2FXCONST_SGL(0.625f),
  9103. - FL2FXCONST_SGL(0.875f)}, /* for coreCoderFrameLength = 1024 */
  9104. - {FL2FXCONST_SGL(0.166667f), FL2FXCONST_SGL(0.5f), FL2FXCONST_SGL(0.833333f),
  9105. - 0x0} /* for coreCoderFrameLength = 768 */
  9106. -};
  9107. -
  9108. -/* For bass post filter */
  9109. -#ifndef TABLE_filt_lp
  9110. -const FIXP_SGL fdk_dec_filt_lp[1 + L_FILT] = {
  9111. - FL2FXCONST_SGL_FILT(0.088250f), FL2FXCONST_SGL_FILT(0.086410f),
  9112. - FL2FXCONST_SGL_FILT(0.081074f), FL2FXCONST_SGL_FILT(0.072768f),
  9113. - FL2FXCONST_SGL_FILT(0.062294f), FL2FXCONST_SGL_FILT(0.050623f),
  9114. - FL2FXCONST_SGL_FILT(0.038774f), FL2FXCONST_SGL_FILT(0.027692f),
  9115. - FL2FXCONST_SGL_FILT(0.018130f), FL2FXCONST_SGL_FILT(0.010578f),
  9116. - FL2FXCONST_SGL_FILT(0.005221f), FL2FXCONST_SGL_FILT(0.001946f),
  9117. - FL2FXCONST_SGL_FILT(0.000385f)};
  9118. -#endif
  9119. -
  9120. -/* FAC window tables for coreCoderFrameLength = 1024 */
  9121. -const FIXP_WTB FacWindowSynth128[] = {
  9122. - WTC(0x7fff6216), WTC(0x7ffa72d1), WTC(0x7ff09478), WTC(0x7fe1c76b),
  9123. - WTC(0x7fce0c3e), WTC(0x7fb563b3), WTC(0x7f97cebd), WTC(0x7f754e80),
  9124. - WTC(0x7f4de451), WTC(0x7f2191b4), WTC(0x7ef05860), WTC(0x7eba3a39),
  9125. - WTC(0x7e7f3957), WTC(0x7e3f57ff), WTC(0x7dfa98a8), WTC(0x7db0fdf8),
  9126. - WTC(0x7d628ac6), WTC(0x7d0f4218), WTC(0x7cb72724), WTC(0x7c5a3d50),
  9127. - WTC(0x7bf88830), WTC(0x7b920b89), WTC(0x7b26cb4f), WTC(0x7ab6cba4),
  9128. - WTC(0x7a4210d8), WTC(0x79c89f6e), WTC(0x794a7c12), WTC(0x78c7aba2),
  9129. - WTC(0x78403329), WTC(0x77b417df), WTC(0x77235f2d), WTC(0x768e0ea6),
  9130. - WTC(0x75f42c0b), WTC(0x7555bd4c), WTC(0x74b2c884), WTC(0x740b53fb),
  9131. - WTC(0x735f6626), WTC(0x72af05a7), WTC(0x71fa3949), WTC(0x71410805),
  9132. - WTC(0x708378ff), WTC(0x6fc19385), WTC(0x6efb5f12), WTC(0x6e30e34a),
  9133. - WTC(0x6d6227fa), WTC(0x6c8f351c), WTC(0x6bb812d1), WTC(0x6adcc964),
  9134. - WTC(0x69fd614a), WTC(0x6919e320), WTC(0x683257ab), WTC(0x6746c7d8),
  9135. - WTC(0x66573cbb), WTC(0x6563bf92), WTC(0x646c59bf), WTC(0x637114cc),
  9136. - WTC(0x6271fa69), WTC(0x616f146c), WTC(0x60686ccf), WTC(0x5f5e0db3),
  9137. - WTC(0x5e50015d), WTC(0x5d3e5237), WTC(0x5c290acc), WTC(0x5b1035cf),
  9138. - WTC(0x59f3de12), WTC(0x58d40e8c), WTC(0x57b0d256), WTC(0x568a34a9),
  9139. - WTC(0x556040e2), WTC(0x5433027d), WTC(0x53028518), WTC(0x51ced46e),
  9140. - WTC(0x5097fc5e), WTC(0x4f5e08e3), WTC(0x4e210617), WTC(0x4ce10034),
  9141. - WTC(0x4b9e0390), WTC(0x4a581c9e), WTC(0x490f57ee), WTC(0x47c3c22f),
  9142. - WTC(0x46756828), WTC(0x452456bd), WTC(0x43d09aed), WTC(0x427a41d0),
  9143. - WTC(0x4121589b), WTC(0x3fc5ec98), WTC(0x3e680b2c), WTC(0x3d07c1d6),
  9144. - WTC(0x3ba51e29), WTC(0x3a402dd2), WTC(0x38d8fe93), WTC(0x376f9e46),
  9145. - WTC(0x36041ad9), WTC(0x34968250), WTC(0x3326e2c3), WTC(0x31b54a5e),
  9146. - WTC(0x3041c761), WTC(0x2ecc681e), WTC(0x2d553afc), WTC(0x2bdc4e6f),
  9147. - WTC(0x2a61b101), WTC(0x28e5714b), WTC(0x27679df4), WTC(0x25e845b6),
  9148. - WTC(0x24677758), WTC(0x22e541af), WTC(0x2161b3a0), WTC(0x1fdcdc1b),
  9149. - WTC(0x1e56ca1e), WTC(0x1ccf8cb3), WTC(0x1b4732ef), WTC(0x19bdcbf3),
  9150. - WTC(0x183366e9), WTC(0x16a81305), WTC(0x151bdf86), WTC(0x138edbb1),
  9151. - WTC(0x120116d5), WTC(0x1072a048), WTC(0x0ee38766), WTC(0x0d53db92),
  9152. - WTC(0x0bc3ac35), WTC(0x0a3308bd), WTC(0x08a2009a), WTC(0x0710a345),
  9153. - WTC(0x057f0035), WTC(0x03ed26e6), WTC(0x025b26d7), WTC(0x00c90f88),
  9154. -};
  9155. -const FIXP_WTB FacWindowZir128[] = {
  9156. - WTC(0x7f36f078), WTC(0x7da4d929), WTC(0x7c12d91a), WTC(0x7a80ffcb),
  9157. - WTC(0x78ef5cbb), WTC(0x775dff66), WTC(0x75ccf743), WTC(0x743c53cb),
  9158. - WTC(0x72ac246e), WTC(0x711c789a), WTC(0x6f8d5fb8), WTC(0x6dfee92b),
  9159. - WTC(0x6c71244f), WTC(0x6ae4207a), WTC(0x6957ecfb), WTC(0x67cc9917),
  9160. - WTC(0x6642340d), WTC(0x64b8cd11), WTC(0x6330734d), WTC(0x61a935e2),
  9161. - WTC(0x602323e5), WTC(0x5e9e4c60), WTC(0x5d1abe51), WTC(0x5b9888a8),
  9162. - WTC(0x5a17ba4a), WTC(0x5898620c), WTC(0x571a8eb5), WTC(0x559e4eff),
  9163. - WTC(0x5423b191), WTC(0x52aac504), WTC(0x513397e2), WTC(0x4fbe389f),
  9164. - WTC(0x4e4ab5a2), WTC(0x4cd91d3d), WTC(0x4b697db0), WTC(0x49fbe527),
  9165. - WTC(0x489061ba), WTC(0x4727016d), WTC(0x45bfd22e), WTC(0x445ae1d7),
  9166. - WTC(0x42f83e2a), WTC(0x4197f4d4), WTC(0x403a1368), WTC(0x3edea765),
  9167. - WTC(0x3d85be30), WTC(0x3c2f6513), WTC(0x3adba943), WTC(0x398a97d8),
  9168. - WTC(0x383c3dd1), WTC(0x36f0a812), WTC(0x35a7e362), WTC(0x3461fc70),
  9169. - WTC(0x331effcc), WTC(0x31def9e9), WTC(0x30a1f71d), WTC(0x2f6803a2),
  9170. - WTC(0x2e312b92), WTC(0x2cfd7ae8), WTC(0x2bccfd83), WTC(0x2a9fbf1e),
  9171. - WTC(0x2975cb57), WTC(0x284f2daa), WTC(0x272bf174), WTC(0x260c21ee),
  9172. - WTC(0x24efca31), WTC(0x23d6f534), WTC(0x22c1adc9), WTC(0x21affea3),
  9173. - WTC(0x20a1f24d), WTC(0x1f979331), WTC(0x1e90eb94), WTC(0x1d8e0597),
  9174. - WTC(0x1c8eeb34), WTC(0x1b93a641), WTC(0x1a9c406e), WTC(0x19a8c345),
  9175. - WTC(0x18b93828), WTC(0x17cda855), WTC(0x16e61ce0), WTC(0x16029eb6),
  9176. - WTC(0x1523369c), WTC(0x1447ed2f), WTC(0x1370cae4), WTC(0x129dd806),
  9177. - WTC(0x11cf1cb6), WTC(0x1104a0ee), WTC(0x103e6c7b), WTC(0x0f7c8701),
  9178. - WTC(0x0ebef7fb), WTC(0x0e05c6b7), WTC(0x0d50fa59), WTC(0x0ca099da),
  9179. - WTC(0x0bf4ac05), WTC(0x0b4d377c), WTC(0x0aaa42b4), WTC(0x0a0bd3f5),
  9180. - WTC(0x0971f15a), WTC(0x08dca0d3), WTC(0x084be821), WTC(0x07bfccd7),
  9181. - WTC(0x0738545e), WTC(0x06b583ee), WTC(0x06376092), WTC(0x05bdef28),
  9182. - WTC(0x0549345c), WTC(0x04d934b1), WTC(0x046df477), WTC(0x040777d0),
  9183. - WTC(0x03a5c2b0), WTC(0x0348d8dc), WTC(0x02f0bde8), WTC(0x029d753a),
  9184. - WTC(0x024f0208), WTC(0x02056758), WTC(0x01c0a801), WTC(0x0180c6a9),
  9185. - WTC(0x0145c5c7), WTC(0x010fa7a0), WTC(0x00de6e4c), WTC(0x00b21baf),
  9186. - WTC(0x008ab180), WTC(0x00683143), WTC(0x004a9c4d), WTC(0x0031f3c2),
  9187. - WTC(0x001e3895), WTC(0x000f6b88), WTC(0x00058d2f), WTC(0x00009dea),
  9188. -};
  9189. -const FIXP_WTB FacWindowSynth64[] = {
  9190. - WTC(0x7ffd885a), WTC(0x7fe9cbc0), WTC(0x7fc25596), WTC(0x7f872bf3),
  9191. - WTC(0x7f3857f6), WTC(0x7ed5e5c6), WTC(0x7e5fe493), WTC(0x7dd6668f),
  9192. - WTC(0x7d3980ec), WTC(0x7c894bde), WTC(0x7bc5e290), WTC(0x7aef6323),
  9193. - WTC(0x7a05eead), WTC(0x7909a92d), WTC(0x77fab989), WTC(0x76d94989),
  9194. - WTC(0x75a585cf), WTC(0x745f9dd1), WTC(0x7307c3d0), WTC(0x719e2cd2),
  9195. - WTC(0x7023109a), WTC(0x6e96a99d), WTC(0x6cf934fc), WTC(0x6b4af279),
  9196. - WTC(0x698c246c), WTC(0x67bd0fbd), WTC(0x65ddfbd3), WTC(0x63ef3290),
  9197. - WTC(0x61f1003f), WTC(0x5fe3b38d), WTC(0x5dc79d7c), WTC(0x5b9d1154),
  9198. - WTC(0x59646498), WTC(0x571deefa), WTC(0x54ca0a4b), WTC(0x5269126e),
  9199. - WTC(0x4ffb654d), WTC(0x4d8162c4), WTC(0x4afb6c98), WTC(0x4869e665),
  9200. - WTC(0x45cd358f), WTC(0x4325c135), WTC(0x4073f21d), WTC(0x3db832a6),
  9201. - WTC(0x3af2eeb7), WTC(0x382493b0), WTC(0x354d9057), WTC(0x326e54c7),
  9202. - WTC(0x2f875262), WTC(0x2c98fbba), WTC(0x29a3c485), WTC(0x26a82186),
  9203. - WTC(0x23a6887f), WTC(0x209f701c), WTC(0x1d934fe5), WTC(0x1a82a026),
  9204. - WTC(0x176dd9de), WTC(0x145576b1), WTC(0x1139f0cf), WTC(0x0e1bc2e4),
  9205. - WTC(0x0afb6805), WTC(0x07d95b9e), WTC(0x04b6195d), WTC(0x01921d20),
  9206. -};
  9207. -const FIXP_WTB FacWindowZir64[] = {
  9208. - WTC(0x7e6de2e0), WTC(0x7b49e6a3), WTC(0x7826a462), WTC(0x750497fb),
  9209. - WTC(0x71e43d1c), WTC(0x6ec60f31), WTC(0x6baa894f), WTC(0x68922622),
  9210. - WTC(0x657d5fda), WTC(0x626cb01b), WTC(0x5f608fe4), WTC(0x5c597781),
  9211. - WTC(0x5957de7a), WTC(0x565c3b7b), WTC(0x53670446), WTC(0x5078ad9e),
  9212. - WTC(0x4d91ab39), WTC(0x4ab26fa9), WTC(0x47db6c50), WTC(0x450d1149),
  9213. - WTC(0x4247cd5a), WTC(0x3f8c0de3), WTC(0x3cda3ecb), WTC(0x3a32ca71),
  9214. - WTC(0x3796199b), WTC(0x35049368), WTC(0x327e9d3c), WTC(0x30049ab3),
  9215. - WTC(0x2d96ed92), WTC(0x2b35f5b5), WTC(0x28e21106), WTC(0x269b9b68),
  9216. - WTC(0x2462eeac), WTC(0x22386284), WTC(0x201c4c73), WTC(0x1e0effc1),
  9217. - WTC(0x1c10cd70), WTC(0x1a22042d), WTC(0x1842f043), WTC(0x1673db94),
  9218. - WTC(0x14b50d87), WTC(0x1306cb04), WTC(0x11695663), WTC(0x0fdcef66),
  9219. - WTC(0x0e61d32e), WTC(0x0cf83c30), WTC(0x0ba0622f), WTC(0x0a5a7a31),
  9220. - WTC(0x0926b677), WTC(0x08054677), WTC(0x06f656d3), WTC(0x05fa1153),
  9221. - WTC(0x05109cdd), WTC(0x043a1d70), WTC(0x0376b422), WTC(0x02c67f14),
  9222. - WTC(0x02299971), WTC(0x01a01b6d), WTC(0x012a1a3a), WTC(0x00c7a80a),
  9223. - WTC(0x0078d40d), WTC(0x003daa6a), WTC(0x00163440), WTC(0x000277a6),
  9224. -};
  9225. -const FIXP_WTB FacWindowSynth32[] = {
  9226. - WTC(0x7ff62182), WTC(0x7fa736b4), WTC(0x7f0991c4), WTC(0x7e1d93ea),
  9227. - WTC(0x7ce3ceb2), WTC(0x7b5d039e), WTC(0x798a23b1), WTC(0x776c4edb),
  9228. - WTC(0x7504d345), WTC(0x72552c85), WTC(0x6f5f02b2), WTC(0x6c242960),
  9229. - WTC(0x68a69e81), WTC(0x64e88926), WTC(0x60ec3830), WTC(0x5cb420e0),
  9230. - WTC(0x5842dd54), WTC(0x539b2af0), WTC(0x4ebfe8a5), WTC(0x49b41533),
  9231. - WTC(0x447acd50), WTC(0x3f1749b8), WTC(0x398cdd32), WTC(0x33def287),
  9232. - WTC(0x2e110a62), WTC(0x2826b928), WTC(0x2223a4c5), WTC(0x1c0b826a),
  9233. - WTC(0x15e21445), WTC(0x0fab272b), WTC(0x096a9049), WTC(0x03242abf),
  9234. -};
  9235. -const FIXP_WTB FacWindowZir32[] = {
  9236. - WTC(0x7cdbd541), WTC(0x76956fb7), WTC(0x7054d8d5), WTC(0x6a1debbb),
  9237. - WTC(0x63f47d96), WTC(0x5ddc5b3b), WTC(0x57d946d8), WTC(0x51eef59e),
  9238. - WTC(0x4c210d79), WTC(0x467322ce), WTC(0x40e8b648), WTC(0x3b8532b0),
  9239. - WTC(0x364beacd), WTC(0x3140175b), WTC(0x2c64d510), WTC(0x27bd22ac),
  9240. - WTC(0x234bdf20), WTC(0x1f13c7d0), WTC(0x1b1776da), WTC(0x1759617f),
  9241. - WTC(0x13dbd6a0), WTC(0x10a0fd4e), WTC(0x0daad37b), WTC(0x0afb2cbb),
  9242. - WTC(0x0893b125), WTC(0x0675dc4f), WTC(0x04a2fc62), WTC(0x031c314e),
  9243. - WTC(0x01e26c16), WTC(0x00f66e3c), WTC(0x0058c94c), WTC(0x0009de7e),
  9244. -};
  9245. -
  9246. -/* FAC window tables for coreCoderFrameLength = 768 */
  9247. -const FIXP_WTB FacWindowSynth96[] = {
  9248. - WTC(0x7ffee744), WTC(0x7ff62182), WTC(0x7fe49698), WTC(0x7fca47b9),
  9249. - WTC(0x7fa736b4), WTC(0x7f7b65ef), WTC(0x7f46d86c), WTC(0x7f0991c4),
  9250. - WTC(0x7ec3962a), WTC(0x7e74ea6a), WTC(0x7e1d93ea), WTC(0x7dbd98a4),
  9251. - WTC(0x7d54ff2e), WTC(0x7ce3ceb2), WTC(0x7c6a0ef2), WTC(0x7be7c847),
  9252. - WTC(0x7b5d039e), WTC(0x7ac9ca7a), WTC(0x7a2e26f2), WTC(0x798a23b1),
  9253. - WTC(0x78ddcbf5), WTC(0x78292b8d), WTC(0x776c4edb), WTC(0x76a742d1),
  9254. - WTC(0x75da14ef), WTC(0x7504d345), WTC(0x74278c72), WTC(0x73424fa0),
  9255. - WTC(0x72552c85), WTC(0x71603361), WTC(0x706374ff), WTC(0x6f5f02b2),
  9256. - WTC(0x6e52ee52), WTC(0x6d3f4a40), WTC(0x6c242960), WTC(0x6b019f1a),
  9257. - WTC(0x69d7bf57), WTC(0x68a69e81), WTC(0x676e5183), WTC(0x662eedc3),
  9258. - WTC(0x64e88926), WTC(0x639b3a0b), WTC(0x62471749), WTC(0x60ec3830),
  9259. - WTC(0x5f8ab487), WTC(0x5e22a487), WTC(0x5cb420e0), WTC(0x5b3f42ae),
  9260. - WTC(0x59c42381), WTC(0x5842dd54), WTC(0x56bb8a90), WTC(0x552e4605),
  9261. - WTC(0x539b2af0), WTC(0x520254ef), WTC(0x5063e008), WTC(0x4ebfe8a5),
  9262. - WTC(0x4d168b8b), WTC(0x4b67e5e4), WTC(0x49b41533), WTC(0x47fb3757),
  9263. - WTC(0x463d6a87), WTC(0x447acd50), WTC(0x42b37e96), WTC(0x40e79d8c),
  9264. - WTC(0x3f1749b8), WTC(0x3d42a2ec), WTC(0x3b69c947), WTC(0x398cdd32),
  9265. - WTC(0x37abff5d), WTC(0x35c750bc), WTC(0x33def287), WTC(0x31f30638),
  9266. - WTC(0x3003ad85), WTC(0x2e110a62), WTC(0x2c1b3efb), WTC(0x2a226db5),
  9267. - WTC(0x2826b928), WTC(0x26284422), WTC(0x2427319d), WTC(0x2223a4c5),
  9268. - WTC(0x201dc0ef), WTC(0x1e15a99a), WTC(0x1c0b826a), WTC(0x19ff6f2a),
  9269. - WTC(0x17f193c5), WTC(0x15e21445), WTC(0x13d114d0), WTC(0x11beb9aa),
  9270. - WTC(0x0fab272b), WTC(0x0d9681c2), WTC(0x0b80edf1), WTC(0x096a9049),
  9271. - WTC(0x07538d6b), WTC(0x053c0a01), WTC(0x03242abf), WTC(0x010c1460),
  9272. -};
  9273. -const FIXP_WTB FacWindowZir96[] = {
  9274. - WTC(0x7ef3eba0), WTC(0x7cdbd541), WTC(0x7ac3f5ff), WTC(0x78ac7295),
  9275. - WTC(0x76956fb7), WTC(0x747f120f), WTC(0x72697e3e), WTC(0x7054d8d5),
  9276. - WTC(0x6e414656), WTC(0x6c2eeb30), WTC(0x6a1debbb), WTC(0x680e6c3b),
  9277. - WTC(0x660090d6), WTC(0x63f47d96), WTC(0x61ea5666), WTC(0x5fe23f11),
  9278. - WTC(0x5ddc5b3b), WTC(0x5bd8ce63), WTC(0x59d7bbde), WTC(0x57d946d8),
  9279. - WTC(0x55dd924b), WTC(0x53e4c105), WTC(0x51eef59e), WTC(0x4ffc527b),
  9280. - WTC(0x4e0cf9c8), WTC(0x4c210d79), WTC(0x4a38af44), WTC(0x485400a3),
  9281. - WTC(0x467322ce), WTC(0x449636b9), WTC(0x42bd5d14), WTC(0x40e8b648),
  9282. - WTC(0x3f186274), WTC(0x3d4c816a), WTC(0x3b8532b0), WTC(0x39c29579),
  9283. - WTC(0x3804c8a9), WTC(0x364beacd), WTC(0x34981a1c), WTC(0x32e97475),
  9284. - WTC(0x3140175b), WTC(0x2f9c1ff8), WTC(0x2dfdab11), WTC(0x2c64d510),
  9285. - WTC(0x2ad1b9fb), WTC(0x29447570), WTC(0x27bd22ac), WTC(0x263bdc7f),
  9286. - WTC(0x24c0bd52), WTC(0x234bdf20), WTC(0x21dd5b79), WTC(0x20754b79),
  9287. - WTC(0x1f13c7d0), WTC(0x1db8e8b7), WTC(0x1c64c5f5), WTC(0x1b1776da),
  9288. - WTC(0x19d1123d), WTC(0x1891ae7d), WTC(0x1759617f), WTC(0x162840a9),
  9289. - WTC(0x14fe60e6), WTC(0x13dbd6a0), WTC(0x12c0b5c0), WTC(0x11ad11ae),
  9290. - WTC(0x10a0fd4e), WTC(0x0f9c8b01), WTC(0x0e9fcc9f), WTC(0x0daad37b),
  9291. - WTC(0x0cbdb060), WTC(0x0bd8738e), WTC(0x0afb2cbb), WTC(0x0a25eb11),
  9292. - WTC(0x0958bd2f), WTC(0x0893b125), WTC(0x07d6d473), WTC(0x0722340b),
  9293. - WTC(0x0675dc4f), WTC(0x05d1d90e), WTC(0x05363586), WTC(0x04a2fc62),
  9294. - WTC(0x041837b9), WTC(0x0395f10e), WTC(0x031c314e), WTC(0x02ab00d2),
  9295. - WTC(0x0242675c), WTC(0x01e26c16), WTC(0x018b1596), WTC(0x013c69d6),
  9296. - WTC(0x00f66e3c), WTC(0x00b92794), WTC(0x00849a11), WTC(0x0058c94c),
  9297. - WTC(0x0035b847), WTC(0x001b6968), WTC(0x0009de7e), WTC(0x000118bc),
  9298. -};
  9299. -const FIXP_WTB FacWindowSynth48[] = {
  9300. - WTC(0x7ffb9d15), WTC(0x7fd8878e), WTC(0x7f92661d), WTC(0x7f294bfd),
  9301. - WTC(0x7e9d55fc), WTC(0x7deeaa7a), WTC(0x7d1d7958), WTC(0x7c29fbee),
  9302. - WTC(0x7b1474fd), WTC(0x79dd3098), WTC(0x78848414), WTC(0x770acdec),
  9303. - WTC(0x757075ac), WTC(0x73b5ebd1), WTC(0x71dba9ab), WTC(0x6fe2313c),
  9304. - WTC(0x6dca0d14), WTC(0x6b93d02e), WTC(0x694015c3), WTC(0x66cf8120),
  9305. - WTC(0x6442bd7e), WTC(0x619a7dce), WTC(0x5ed77c8a), WTC(0x5bfa7b82),
  9306. - WTC(0x590443a7), WTC(0x55f5a4d2), WTC(0x52cf758f), WTC(0x4f9292dc),
  9307. - WTC(0x4c3fdff4), WTC(0x48d84609), WTC(0x455cb40c), WTC(0x41ce1e65),
  9308. - WTC(0x3e2d7eb1), WTC(0x3a7bd382), WTC(0x36ba2014), WTC(0x32e96c09),
  9309. - WTC(0x2f0ac320), WTC(0x2b1f34eb), WTC(0x2727d486), WTC(0x2325b847),
  9310. - WTC(0x1f19f97b), WTC(0x1b05b40f), WTC(0x16ea0646), WTC(0x12c8106f),
  9311. - WTC(0x0ea0f48c), WTC(0x0a75d60e), WTC(0x0647d97c), WTC(0x02182427),
  9312. -};
  9313. -const FIXP_WTB FacWindowZir48[] = {
  9314. - WTC(0x7de7dbd9), WTC(0x79b82684), WTC(0x758a29f2), WTC(0x715f0b74),
  9315. - WTC(0x6d37ef91), WTC(0x6915f9ba), WTC(0x64fa4bf1), WTC(0x60e60685),
  9316. - WTC(0x5cda47b9), WTC(0x58d82b7a), WTC(0x54e0cb15), WTC(0x50f53ce0),
  9317. - WTC(0x4d1693f7), WTC(0x4945dfec), WTC(0x45842c7e), WTC(0x41d2814f),
  9318. - WTC(0x3e31e19b), WTC(0x3aa34bf4), WTC(0x3727b9f7), WTC(0x33c0200c),
  9319. - WTC(0x306d6d24), WTC(0x2d308a71), WTC(0x2a0a5b2e), WTC(0x26fbbc59),
  9320. - WTC(0x2405847e), WTC(0x21288376), WTC(0x1e658232), WTC(0x1bbd4282),
  9321. - WTC(0x19307ee0), WTC(0x16bfea3d), WTC(0x146c2fd2), WTC(0x1235f2ec),
  9322. - WTC(0x101dcec4), WTC(0x0e245655), WTC(0x0c4a142f), WTC(0x0a8f8a54),
  9323. - WTC(0x08f53214), WTC(0x077b7bec), WTC(0x0622cf68), WTC(0x04eb8b03),
  9324. - WTC(0x03d60412), WTC(0x02e286a8), WTC(0x02115586), WTC(0x0162aa04),
  9325. - WTC(0x00d6b403), WTC(0x006d99e3), WTC(0x00277872), WTC(0x000462eb),
  9326. -};
  9327. --- a/libAACdec/src/usacdec_rom.h
  9328. +++ /dev/null
  9329. @@ -1,154 +0,0 @@
  9330. -/* -----------------------------------------------------------------------------
  9331. -Software License for The Fraunhofer FDK AAC Codec Library for Android
  9332. -
  9333. -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  9334. -Forschung e.V. All rights reserved.
  9335. -
  9336. - 1. INTRODUCTION
  9337. -The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  9338. -that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  9339. -scheme for digital audio. This FDK AAC Codec software is intended to be used on
  9340. -a wide variety of Android devices.
  9341. -
  9342. -AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  9343. -general perceptual audio codecs. AAC-ELD is considered the best-performing
  9344. -full-bandwidth communications codec by independent studies and is widely
  9345. -deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  9346. -specifications.
  9347. -
  9348. -Patent licenses for necessary patent claims for the FDK AAC Codec (including
  9349. -those of Fraunhofer) may be obtained through Via Licensing
  9350. -(www.vialicensing.com) or through the respective patent owners individually for
  9351. -the purpose of encoding or decoding bit streams in products that are compliant
  9352. -with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  9353. -Android devices already license these patent claims through Via Licensing or
  9354. -directly from the patent owners, and therefore FDK AAC Codec software may
  9355. -already be covered under those patent licenses when it is used for those
  9356. -licensed purposes only.
  9357. -
  9358. -Commercially-licensed AAC software libraries, including floating-point versions
  9359. -with enhanced sound quality, are also available from Fraunhofer. Users are
  9360. -encouraged to check the Fraunhofer website for additional applications
  9361. -information and documentation.
  9362. -
  9363. -2. COPYRIGHT LICENSE
  9364. -
  9365. -Redistribution and use in source and binary forms, with or without modification,
  9366. -are permitted without payment of copyright license fees provided that you
  9367. -satisfy the following conditions:
  9368. -
  9369. -You must retain the complete text of this software license in redistributions of
  9370. -the FDK AAC Codec or your modifications thereto in source code form.
  9371. -
  9372. -You must retain the complete text of this software license in the documentation
  9373. -and/or other materials provided with redistributions of the FDK AAC Codec or
  9374. -your modifications thereto in binary form. You must make available free of
  9375. -charge copies of the complete source code of the FDK AAC Codec and your
  9376. -modifications thereto to recipients of copies in binary form.
  9377. -
  9378. -The name of Fraunhofer may not be used to endorse or promote products derived
  9379. -from this library without prior written permission.
  9380. -
  9381. -You may not charge copyright license fees for anyone to use, copy or distribute
  9382. -the FDK AAC Codec software or your modifications thereto.
  9383. -
  9384. -Your modified versions of the FDK AAC Codec must carry prominent notices stating
  9385. -that you changed the software and the date of any change. For modified versions
  9386. -of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  9387. -must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  9388. -AAC Codec Library for Android."
  9389. -
  9390. -3. NO PATENT LICENSE
  9391. -
  9392. -NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  9393. -limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  9394. -Fraunhofer provides no warranty of patent non-infringement with respect to this
  9395. -software.
  9396. -
  9397. -You may use this FDK AAC Codec software or modifications thereto only for
  9398. -purposes that are authorized by appropriate patent licenses.
  9399. -
  9400. -4. DISCLAIMER
  9401. -
  9402. -This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  9403. -holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  9404. -including but not limited to the implied warranties of merchantability and
  9405. -fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  9406. -CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  9407. -or consequential damages, including but not limited to procurement of substitute
  9408. -goods or services; loss of use, data, or profits, or business interruption,
  9409. -however caused and on any theory of liability, whether in contract, strict
  9410. -liability, or tort (including negligence), arising in any way out of the use of
  9411. -this software, even if advised of the possibility of such damage.
  9412. -
  9413. -5. CONTACT INFORMATION
  9414. -
  9415. -Fraunhofer Institute for Integrated Circuits IIS
  9416. -Attention: Audio and Multimedia Departments - FDK AAC LL
  9417. -Am Wolfsmantel 33
  9418. -91058 Erlangen, Germany
  9419. -
  9420. -www.iis.fraunhofer.de/amm
  9421. -amm-info@iis.fraunhofer.de
  9422. ------------------------------------------------------------------------------ */
  9423. -
  9424. -/**************************** AAC decoder library ******************************
  9425. -
  9426. - Author(s): M. Jander
  9427. -
  9428. - Description: re8.h
  9429. -
  9430. -*******************************************************************************/
  9431. -
  9432. -#ifndef USACDEC_ROM_H
  9433. -#define USACDEC_ROM_H
  9434. -
  9435. -#include "common_fix.h"
  9436. -#include "FDK_lpc.h"
  9437. -
  9438. -#include "usacdec_const.h"
  9439. -
  9440. -/* RE8 lattice quantiser constants */
  9441. -#define NB_SPHERE 32
  9442. -#define NB_LEADER 37
  9443. -#define NB_LDSIGN 226
  9444. -#define NB_LDQ3 9
  9445. -#define NB_LDQ4 28
  9446. -
  9447. -#define LSF_SCALE 13
  9448. -
  9449. -/* RE8 lattice quantiser tables */
  9450. -extern const UINT fdk_dec_tab_factorial[8];
  9451. -extern const UCHAR fdk_dec_Ia[NB_LEADER];
  9452. -extern const UCHAR fdk_dec_Ds[NB_LDSIGN];
  9453. -extern const USHORT fdk_dec_Is[NB_LDSIGN];
  9454. -extern const UCHAR fdk_dec_Ns[], fdk_dec_A3[], fdk_dec_A4[];
  9455. -extern const UCHAR fdk_dec_Da[][8];
  9456. -extern const USHORT fdk_dec_I3[], fdk_dec_I4[];
  9457. -
  9458. -/* temp float tables for LPC decoding */
  9459. -extern const FIXP_LPC fdk_dec_lsf_init[16];
  9460. -extern const FIXP_LPC fdk_dec_dico_lsf_abs_8b[16 * 256];
  9461. -
  9462. -/* ACELP tables */
  9463. -#define SF_QUA_GAIN7B 4
  9464. -extern const FIXP_SGL fdk_t_qua_gain7b[128 * 2];
  9465. -extern const FIXP_SGL lsp_interpol_factor[2][NB_SUBFR];
  9466. -
  9467. -/* For bass post filter */
  9468. -#define L_FILT 12 /* Delay of up-sampling filter */
  9469. -
  9470. -extern const FIXP_SGL fdk_dec_filt_lp[1 + L_FILT];
  9471. -
  9472. -extern const FIXP_WTB FacWindowSynth128[128];
  9473. -extern const FIXP_WTB FacWindowZir128[128];
  9474. -extern const FIXP_WTB FacWindowSynth64[64];
  9475. -extern const FIXP_WTB FacWindowZir64[64];
  9476. -extern const FIXP_WTB FacWindowSynth32[32];
  9477. -extern const FIXP_WTB FacWindowZir32[32];
  9478. -extern const FIXP_WTB FacWindowSynth96[96];
  9479. -extern const FIXP_WTB FacWindowZir96[96];
  9480. -extern const FIXP_WTB FacWindowSynth48[48];
  9481. -extern const FIXP_WTB FacWindowZir48[48];
  9482. -
  9483. -#endif /* USACDEC_ROM_H */