newmdct.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. /*
  2. * MP3 window subband -> subband filtering -> mdct routine
  3. *
  4. * Copyright (c) 1999 Takehiro TOMINAGA
  5. *
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. /*
  23. * Special Thanks to Patrick De Smet for your advices.
  24. */
  25. /* $Id: newmdct.c,v 1.25 2001/01/17 09:54:20 robert Exp $ */
  26. #ifdef HAVE_CONFIG_H
  27. # include <config.h>
  28. #endif
  29. #include "util.h"
  30. #include "l3side.h"
  31. #include "newmdct.h"
  32. #ifdef WITH_DMALLOC
  33. #include <dmalloc.h>
  34. #endif
  35. #define SCALE (32768.0/ 2.384e-06)
  36. #ifndef USE_GOGO_SUBBAND
  37. static const FLOAT8 enwindow[] =
  38. {
  39. -4.77e-07*0.740951125354959/2.384e-06, 1.03951e-04*0.740951125354959/2.384e-06, 9.53674e-04*0.740951125354959/2.384e-06, 2.841473e-03*0.740951125354959/2.384e-06,
  40. 3.5758972e-02*0.740951125354959/2.384e-06, 3.401756e-03*0.740951125354959/2.384e-06, 9.83715e-04*0.740951125354959/2.384e-06, 9.9182e-05*0.740951125354959/2.384e-06, /* 15*/
  41. 1.2398e-05*0.740951125354959/2.384e-06, 1.91212e-04*0.740951125354959/2.384e-06, 2.283096e-03*0.740951125354959/2.384e-06,1.6994476e-02*0.740951125354959/2.384e-06,
  42. -1.8756866e-02*0.740951125354959/2.384e-06,-2.630711e-03*0.740951125354959/2.384e-06, -2.47478e-04*0.740951125354959/2.384e-06, -1.4782e-05*0.740951125354959/2.384e-06,
  43. 9.063471690191471e-01,
  44. 1.960342806591213e-01,
  45. -4.77e-07*0.773010453362737/2.384e-06, 1.05858e-04*0.773010453362737/2.384e-06, 9.30786e-04*0.773010453362737/2.384e-06, 2.521515e-03*0.773010453362737/2.384e-06,
  46. 3.5694122e-02*0.773010453362737/2.384e-06, 3.643036e-03*0.773010453362737/2.384e-06, 9.91821e-04*0.773010453362737/2.384e-06, 9.6321e-05*0.773010453362737/2.384e-06, /* 14*/
  47. 1.1444e-05*0.773010453362737/2.384e-06, 1.65462e-04*0.773010453362737/2.384e-06, 2.110004e-03*0.773010453362737/2.384e-06,1.6112804e-02*0.773010453362737/2.384e-06,
  48. -1.9634247e-02*0.773010453362737/2.384e-06,-2.803326e-03*0.773010453362737/2.384e-06, -2.77042e-04*0.773010453362737/2.384e-06, -1.6689e-05*0.773010453362737/2.384e-06,
  49. 8.206787908286602e-01,
  50. 3.901806440322567e-01,
  51. -4.77e-07*0.803207531480645/2.384e-06, 1.07288e-04*0.803207531480645/2.384e-06, 9.02653e-04*0.803207531480645/2.384e-06, 2.174854e-03*0.803207531480645/2.384e-06,
  52. 3.5586357e-02*0.803207531480645/2.384e-06, 3.858566e-03*0.803207531480645/2.384e-06, 9.95159e-04*0.803207531480645/2.384e-06, 9.3460e-05*0.803207531480645/2.384e-06, /* 13*/
  53. 1.0014e-05*0.803207531480645/2.384e-06, 1.40190e-04*0.803207531480645/2.384e-06, 1.937389e-03*0.803207531480645/2.384e-06,1.5233517e-02*0.803207531480645/2.384e-06,
  54. -2.0506859e-02*0.803207531480645/2.384e-06,-2.974033e-03*0.803207531480645/2.384e-06, -3.07560e-04*0.803207531480645/2.384e-06, -1.8120e-05*0.803207531480645/2.384e-06,
  55. 7.416505462720353e-01,
  56. 5.805693545089249e-01,
  57. -4.77e-07*0.831469612302545/2.384e-06, 1.08242e-04*0.831469612302545/2.384e-06, 8.68797e-04*0.831469612302545/2.384e-06, 1.800537e-03*0.831469612302545/2.384e-06,
  58. 3.5435200e-02*0.831469612302545/2.384e-06, 4.049301e-03*0.831469612302545/2.384e-06, 9.94205e-04*0.831469612302545/2.384e-06, 9.0599e-05*0.831469612302545/2.384e-06, /* 12*/
  59. 9.060e-06*0.831469612302545/2.384e-06, 1.16348e-04*0.831469612302545/2.384e-06, 1.766682e-03*0.831469612302545/2.384e-06,1.4358521e-02*0.831469612302545/2.384e-06,
  60. -2.1372318e-02*0.831469612302545/2.384e-06, -3.14188e-03*0.831469612302545/2.384e-06, -3.39031e-04*0.831469612302545/2.384e-06, -1.9550e-05*0.831469612302545/2.384e-06,
  61. 6.681786379192989e-01,
  62. 7.653668647301797e-01,
  63. -4.77e-07*0.857728610000272/2.384e-06, 1.08719e-04*0.857728610000272/2.384e-06, 8.29220e-04*0.857728610000272/2.384e-06, 1.399517e-03*0.857728610000272/2.384e-06,
  64. 3.5242081e-02*0.857728610000272/2.384e-06, 4.215240e-03*0.857728610000272/2.384e-06, 9.89437e-04*0.857728610000272/2.384e-06, 8.7261e-05*0.857728610000272/2.384e-06, /* 11*/
  65. 8.106e-06*0.857728610000272/2.384e-06, 9.3937e-05*0.857728610000272/2.384e-06, 1.597881e-03*0.857728610000272/2.384e-06,1.3489246e-02*0.857728610000272/2.384e-06,
  66. -2.2228718e-02*0.857728610000272/2.384e-06,-3.306866e-03*0.857728610000272/2.384e-06, -3.71456e-04*0.857728610000272/2.384e-06, -2.1458e-05*0.857728610000272/2.384e-06,
  67. 5.993769336819237e-01,
  68. 9.427934736519954e-01,
  69. -4.77e-07*0.881921264348355/2.384e-06, 1.08719e-04*0.881921264348355/2.384e-06, 7.8392e-04*0.881921264348355/2.384e-06, 9.71317e-04*0.881921264348355/2.384e-06,
  70. 3.5007000e-02*0.881921264348355/2.384e-06, 4.357815e-03*0.881921264348355/2.384e-06, 9.80854e-04*0.881921264348355/2.384e-06, 8.3923e-05*0.881921264348355/2.384e-06, /* 10*/
  71. 7.629e-06*0.881921264348355/2.384e-06, 7.2956e-05*0.881921264348355/2.384e-06, 1.432419e-03*0.881921264348355/2.384e-06,1.2627602e-02*0.881921264348355/2.384e-06,
  72. -2.3074150e-02*0.881921264348355/2.384e-06,-3.467083e-03*0.881921264348355/2.384e-06, -4.04358e-04*0.881921264348355/2.384e-06, -2.3365e-05*0.881921264348355/2.384e-06,
  73. 5.345111359507916e-01,
  74. 1.111140466039205e+00,
  75. -9.54e-07*0.903989293123443/2.384e-06, 1.08242e-04*0.903989293123443/2.384e-06, 7.31945e-04*0.903989293123443/2.384e-06, 5.15938e-04*0.903989293123443/2.384e-06,
  76. 3.4730434e-02*0.903989293123443/2.384e-06, 4.477024e-03*0.903989293123443/2.384e-06, 9.68933e-04*0.903989293123443/2.384e-06, 8.0585e-05*0.903989293123443/2.384e-06, /* 9*/
  77. 6.676e-06*0.903989293123443/2.384e-06, 5.2929e-05*0.903989293123443/2.384e-06, 1.269817e-03*0.903989293123443/2.384e-06,1.1775017e-02*0.903989293123443/2.384e-06,
  78. -2.3907185e-02*0.903989293123443/2.384e-06,-3.622532e-03*0.903989293123443/2.384e-06, -4.38213e-04*0.903989293123443/2.384e-06, -2.5272e-05*0.903989293123443/2.384e-06,
  79. 4.729647758913199e-01,
  80. 1.268786568327291e+00,
  81. -9.54e-07*0.92387953251128675613/2.384e-06, 1.06812e-04*0.92387953251128675613/2.384e-06, 6.74248e-04*0.92387953251128675613/2.384e-06, 3.3379e-05*0.92387953251128675613/2.384e-06,
  82. 3.4412861e-02*0.92387953251128675613/2.384e-06, 4.573822e-03*0.92387953251128675613/2.384e-06, 9.54151e-04*0.92387953251128675613/2.384e-06, 7.6771e-05*0.92387953251128675613/2.384e-06,
  83. 6.199e-06*0.92387953251128675613/2.384e-06, 3.4332e-05*0.92387953251128675613/2.384e-06, 1.111031e-03*0.92387953251128675613/2.384e-06,1.0933399e-02*0.92387953251128675613/2.384e-06,
  84. -2.4725437e-02*0.92387953251128675613/2.384e-06,-3.771782e-03*0.92387953251128675613/2.384e-06, -4.72546e-04*0.92387953251128675613/2.384e-06, -2.7657e-05*0.92387953251128675613/2.384e-06,
  85. 4.1421356237309504879e-01, /* tan(PI/8) */
  86. 1.414213562373095e+00,
  87. -9.54e-07*0.941544065183021/2.384e-06, 1.05381e-04*0.941544065183021/2.384e-06, 6.10352e-04*0.941544065183021/2.384e-06, -4.75883e-04*0.941544065183021/2.384e-06,
  88. 3.4055710e-02*0.941544065183021/2.384e-06, 4.649162e-03*0.941544065183021/2.384e-06, 9.35555e-04*0.941544065183021/2.384e-06, 7.3433e-05*0.941544065183021/2.384e-06, /* 7*/
  89. 5.245e-06*0.941544065183021/2.384e-06, 1.7166e-05*0.941544065183021/2.384e-06, 9.56535e-04*0.941544065183021/2.384e-06,1.0103703e-02*0.941544065183021/2.384e-06,
  90. -2.5527000e-02*0.941544065183021/2.384e-06,-3.914356e-03*0.941544065183021/2.384e-06, -5.07355e-04*0.941544065183021/2.384e-06, -3.0041e-05*0.941544065183021/2.384e-06,
  91. 3.578057213145241e-01,
  92. 1.546020906725474e+00,
  93. -9.54e-07*0.956940335732209/2.384e-06, 1.02520e-04*0.956940335732209/2.384e-06, 5.39303e-04*0.956940335732209/2.384e-06,-1.011848e-03*0.956940335732209/2.384e-06,
  94. 3.3659935e-02*0.956940335732209/2.384e-06, 4.703045e-03*0.956940335732209/2.384e-06, 9.15051e-04*0.956940335732209/2.384e-06, 7.0095e-05*0.956940335732209/2.384e-06, /* 6*/
  95. 4.768e-06*0.956940335732209/2.384e-06, 9.54e-07*0.956940335732209/2.384e-06, 8.06808e-04*0.956940335732209/2.384e-06, 9.287834e-03*0.956940335732209/2.384e-06,
  96. -2.6310921e-02*0.956940335732209/2.384e-06,-4.048824e-03*0.956940335732209/2.384e-06, -5.42164e-04*0.956940335732209/2.384e-06, -3.2425e-05*0.956940335732209/2.384e-06,
  97. 3.033466836073424e-01,
  98. 1.662939224605090e+00,
  99. -1.431e-06*0.970031253194544/2.384e-06, 9.9182e-05*0.970031253194544/2.384e-06, 4.62532e-04*0.970031253194544/2.384e-06,-1.573563e-03*0.970031253194544/2.384e-06,
  100. 3.3225536e-02*0.970031253194544/2.384e-06, 4.737377e-03*0.970031253194544/2.384e-06, 8.91685e-04*0.970031253194544/2.384e-06, 6.6280e-05*0.970031253194544/2.384e-06, /* 5*/
  101. 4.292e-06*0.970031253194544/2.384e-06, -1.3828e-05*0.970031253194544/2.384e-06, 6.61850e-04*0.970031253194544/2.384e-06, 8.487225e-03*0.970031253194544/2.384e-06,
  102. -2.7073860e-02*0.970031253194544/2.384e-06,-4.174709e-03*0.970031253194544/2.384e-06, -5.76973e-04*0.970031253194544/2.384e-06, -3.4809e-05*0.970031253194544/2.384e-06,
  103. 2.504869601913055e-01,
  104. 1.763842528696710e+00,
  105. -1.431e-06*0.98078528040323/2.384e-06, 9.5367e-05*0.98078528040323/2.384e-06, 3.78609e-04*0.98078528040323/2.384e-06,-2.161503e-03*0.98078528040323/2.384e-06,
  106. 3.2754898e-02*0.98078528040323/2.384e-06, 4.752159e-03*0.98078528040323/2.384e-06, 8.66413e-04*0.98078528040323/2.384e-06, 6.2943e-05*0.98078528040323/2.384e-06, /* 4*/
  107. 3.815e-06*0.98078528040323/2.384e-06, -2.718e-05*0.98078528040323/2.384e-06, 5.22137e-04*0.98078528040323/2.384e-06, 7.703304e-03*0.98078528040323/2.384e-06,
  108. -2.7815342e-02*0.98078528040323/2.384e-06,-4.290581e-03*0.98078528040323/2.384e-06, -6.11782e-04*0.98078528040323/2.384e-06, -3.7670e-05*0.98078528040323/2.384e-06,
  109. 1.989123673796580e-01,
  110. 1.847759065022573e+00,
  111. -1.907e-06*0.989176509964781/2.384e-06, 9.0122e-05*0.989176509964781/2.384e-06, 2.88486e-04*0.989176509964781/2.384e-06,-2.774239e-03*0.989176509964781/2.384e-06,
  112. 3.2248020e-02*0.989176509964781/2.384e-06, 4.748821e-03*0.989176509964781/2.384e-06, 8.38757e-04*0.989176509964781/2.384e-06, 5.9605e-05*0.989176509964781/2.384e-06, /* 3*/
  113. 3.338e-06*0.989176509964781/2.384e-06, -3.9577e-05*0.989176509964781/2.384e-06, 3.88145e-04*0.989176509964781/2.384e-06, 6.937027e-03*0.989176509964781/2.384e-06,
  114. -2.8532982e-02*0.989176509964781/2.384e-06,-4.395962e-03*0.989176509964781/2.384e-06, -6.46591e-04*0.989176509964781/2.384e-06, -4.0531e-05*0.989176509964781/2.384e-06,
  115. 1.483359875383474e-01,
  116. 1.913880671464418e+00,
  117. -1.907e-06*0.995184726672197/2.384e-06, 8.4400e-05*0.995184726672197/2.384e-06, 1.91689e-04*0.995184726672197/2.384e-06,-3.411293e-03*0.995184726672197/2.384e-06,
  118. 3.1706810e-02*0.995184726672197/2.384e-06, 4.728317e-03*0.995184726672197/2.384e-06, 8.09669e-04*0.995184726672197/2.384e-06, 5.579e-05*0.995184726672197/2.384e-06,
  119. 3.338e-06*0.995184726672197/2.384e-06, -5.0545e-05*0.995184726672197/2.384e-06, 2.59876e-04*0.995184726672197/2.384e-06, 6.189346e-03*0.995184726672197/2.384e-06,
  120. -2.9224873e-02*0.995184726672197/2.384e-06,-4.489899e-03*0.995184726672197/2.384e-06, -6.80923e-04*0.995184726672197/2.384e-06, -4.3392e-05*0.995184726672197/2.384e-06,
  121. 9.849140335716425e-02,
  122. 1.961570560806461e+00,
  123. -2.384e-06*0.998795456205172/2.384e-06, 7.7724e-05*0.998795456205172/2.384e-06, 8.8215e-05*0.998795456205172/2.384e-06,-4.072189e-03*0.998795456205172/2.384e-06,
  124. 3.1132698e-02*0.998795456205172/2.384e-06, 4.691124e-03*0.998795456205172/2.384e-06, 7.79152e-04*0.998795456205172/2.384e-06, 5.2929e-05*0.998795456205172/2.384e-06,
  125. 2.861e-06*0.998795456205172/2.384e-06, -6.0558e-05*0.998795456205172/2.384e-06, 1.37329e-04*0.998795456205172/2.384e-06, 5.462170e-03*0.998795456205172/2.384e-06,
  126. -2.9890060e-02*0.998795456205172/2.384e-06,-4.570484e-03*0.998795456205172/2.384e-06, -7.14302e-04*0.998795456205172/2.384e-06, -4.6253e-05*0.998795456205172/2.384e-06,
  127. 4.912684976946725e-02,
  128. 1.990369453344394e+00,
  129. 3.5780907e-02 * SQRT2*0.5/2.384e-06,1.7876148e-02 * SQRT2*0.5/2.384e-06, 3.134727e-03 * SQRT2*0.5/2.384e-06, 2.457142e-03 * SQRT2*0.5/2.384e-06,
  130. 9.71317e-04 * SQRT2*0.5/2.384e-06, 2.18868e-04 * SQRT2*0.5/2.384e-06, 1.01566e-04 * SQRT2*0.5/2.384e-06, 1.3828e-05 * SQRT2*0.5/2.384e-06,
  131. 3.0526638e-02/2.384e-06, 4.638195e-03/2.384e-06, 7.47204e-04/2.384e-06, 4.9591e-05/2.384e-06,
  132. 4.756451e-03/2.384e-06, 2.1458e-05/2.384e-06, -6.9618e-05/2.384e-06,/* 2.384e-06/2.384e-06*/
  133. };
  134. #endif
  135. #define NS 12
  136. #define NL 36
  137. static const FLOAT8 win[4][NL] = {
  138. {
  139. 2.382191739347913e-13,
  140. 6.423305872147834e-13,
  141. 9.400849094049688e-13,
  142. 1.122435026096556e-12,
  143. 1.183840321267481e-12,
  144. 1.122435026096556e-12,
  145. 9.400849094049690e-13,
  146. 6.423305872147839e-13,
  147. 2.382191739347918e-13,
  148. 5.456116108943412e-12,
  149. 4.878985199565852e-12,
  150. 4.240448995017367e-12,
  151. 3.559909094758252e-12,
  152. 2.858043359288075e-12,
  153. 2.156177623817898e-12,
  154. 1.475637723558783e-12,
  155. 8.371015190102974e-13,
  156. 2.599706096327376e-13,
  157. -5.456116108943412e-12,
  158. -4.878985199565852e-12,
  159. -4.240448995017367e-12,
  160. -3.559909094758252e-12,
  161. -2.858043359288076e-12,
  162. -2.156177623817898e-12,
  163. -1.475637723558783e-12,
  164. -8.371015190102975e-13,
  165. -2.599706096327376e-13,
  166. -2.382191739347923e-13,
  167. -6.423305872147843e-13,
  168. -9.400849094049696e-13,
  169. -1.122435026096556e-12,
  170. -1.183840321267481e-12,
  171. -1.122435026096556e-12,
  172. -9.400849094049694e-13,
  173. -6.423305872147840e-13,
  174. -2.382191739347918e-13,
  175. },
  176. {
  177. 2.382191739347913e-13,
  178. 6.423305872147834e-13,
  179. 9.400849094049688e-13,
  180. 1.122435026096556e-12,
  181. 1.183840321267481e-12,
  182. 1.122435026096556e-12,
  183. 9.400849094049688e-13,
  184. 6.423305872147841e-13,
  185. 2.382191739347918e-13,
  186. 5.456116108943413e-12,
  187. 4.878985199565852e-12,
  188. 4.240448995017367e-12,
  189. 3.559909094758253e-12,
  190. 2.858043359288075e-12,
  191. 2.156177623817898e-12,
  192. 1.475637723558782e-12,
  193. 8.371015190102975e-13,
  194. 2.599706096327376e-13,
  195. -5.461314069809755e-12,
  196. -4.921085770524055e-12,
  197. -4.343405037091838e-12,
  198. -3.732668368707687e-12,
  199. -3.093523840190885e-12,
  200. -2.430835727329465e-12,
  201. -1.734679010007751e-12,
  202. -9.748253656609281e-13,
  203. -2.797435120168326e-13,
  204. 0.000000000000000e+00,
  205. 0.000000000000000e+00,
  206. 0.000000000000000e+00,
  207. 0.000000000000000e+00,
  208. 0.000000000000000e+00,
  209. 0.000000000000000e+00,
  210. -2.283748241799531e-13,
  211. -4.037858874020686e-13,
  212. -2.146547464825323e-13,
  213. },
  214. {
  215. 1.316524975873958e-01, /* win[SHORT_TYPE] */
  216. 4.142135623730950e-01,
  217. 7.673269879789602e-01,
  218. 1.091308501069271e+00, /* tantab_l */
  219. 1.303225372841206e+00,
  220. 1.569685577117490e+00,
  221. 1.920982126971166e+00,
  222. 2.414213562373094e+00,
  223. 3.171594802363212e+00,
  224. 4.510708503662055e+00,
  225. 7.595754112725146e+00,
  226. 2.290376554843115e+01,
  227. 0.98480775301220802032, /* cx */
  228. 0.64278760968653936292,
  229. 0.34202014332566882393,
  230. 0.93969262078590842791,
  231. -0.17364817766693030343,
  232. -0.76604444311897790243,
  233. 0.86602540378443870761,
  234. 0.500000000000000e+00,
  235. -5.144957554275265e-01, /* ca */
  236. -4.717319685649723e-01,
  237. -3.133774542039019e-01,
  238. -1.819131996109812e-01,
  239. -9.457419252642064e-02,
  240. -4.096558288530405e-02,
  241. -1.419856857247115e-02,
  242. -3.699974673760037e-03,
  243. 8.574929257125442e-01, /* cs */
  244. 8.817419973177052e-01,
  245. 9.496286491027329e-01,
  246. 9.833145924917901e-01,
  247. 9.955178160675857e-01,
  248. 9.991605581781475e-01,
  249. 9.998991952444470e-01,
  250. 9.999931550702802e-01,
  251. },
  252. {
  253. 0.000000000000000e+00,
  254. 0.000000000000000e+00,
  255. 0.000000000000000e+00,
  256. 0.000000000000000e+00,
  257. 0.000000000000000e+00,
  258. 0.000000000000000e+00,
  259. 2.283748241799531e-13,
  260. 4.037858874020686e-13,
  261. 2.146547464825323e-13,
  262. 5.461314069809755e-12,
  263. 4.921085770524055e-12,
  264. 4.343405037091838e-12,
  265. 3.732668368707687e-12,
  266. 3.093523840190885e-12,
  267. 2.430835727329466e-12,
  268. 1.734679010007751e-12,
  269. 9.748253656609281e-13,
  270. 2.797435120168326e-13,
  271. -5.456116108943413e-12,
  272. -4.878985199565852e-12,
  273. -4.240448995017367e-12,
  274. -3.559909094758253e-12,
  275. -2.858043359288075e-12,
  276. -2.156177623817898e-12,
  277. -1.475637723558782e-12,
  278. -8.371015190102975e-13,
  279. -2.599706096327376e-13,
  280. -2.382191739347913e-13,
  281. -6.423305872147834e-13,
  282. -9.400849094049688e-13,
  283. -1.122435026096556e-12,
  284. -1.183840321267481e-12,
  285. -1.122435026096556e-12,
  286. -9.400849094049688e-13,
  287. -6.423305872147841e-13,
  288. -2.382191739347918e-13,
  289. }
  290. };
  291. #define tantab_l (win[SHORT_TYPE]+3)
  292. #define cx (win[SHORT_TYPE]+12)
  293. #define ca (win[SHORT_TYPE]+20)
  294. #define cs (win[SHORT_TYPE]+28)
  295. /************************************************************************
  296. *
  297. * window_subband()
  298. *
  299. * PURPOSE: Overlapping window on PCM samples
  300. *
  301. * SEMANTICS:
  302. * 32 16-bit pcm samples are scaled to fractional 2's complement and
  303. * concatenated to the end of the window buffer #x#. The updated window
  304. * buffer #x# is then windowed by the analysis window #c# to produce the
  305. * windowed sample #z#
  306. *
  307. ************************************************************************/
  308. /*
  309. * new IDCT routine written by Takehiro TOMINAGA
  310. */
  311. static const int order[] = {
  312. 0, 1,16,17, 8, 9,24,25, 4, 5,20,21,12,13,28,29,
  313. 2, 3,18,19,10,11,26,27, 6, 7,22,23,14,15,30,31
  314. };
  315. /* returns sum_j=0^31 a[j]*cos(PI*j*(k+1/2)/32), 0<=k<32 */
  316. INLINE static void
  317. window_subband(const sample_t *x1, FLOAT8 a[SBLIMIT])
  318. {
  319. int i;
  320. FLOAT8 const *wp = enwindow+10;
  321. const sample_t *x2 = &x1[238-14-286];
  322. for (i = -15; i < 0; i++) {
  323. FLOAT8 w, s, t;
  324. w = wp[-10]; s = x2[-224] * w; t = x1[ 224] * w;
  325. w = wp[-9]; s += x2[-160] * w; t += x1[ 160] * w;
  326. w = wp[-8]; s += x2[- 96] * w; t += x1[ 96] * w;
  327. w = wp[-7]; s += x2[- 32] * w; t += x1[ 32] * w;
  328. w = wp[-6]; s += x2[ 32] * w; t += x1[- 32] * w;
  329. w = wp[-5]; s += x2[ 96] * w; t += x1[- 96] * w;
  330. w = wp[-4]; s += x2[ 160] * w; t += x1[-160] * w;
  331. w = wp[-3]; s += x2[ 224] * w; t += x1[-224] * w;
  332. w = wp[-2]; s += x1[-256] * w; t -= x2[ 256] * w;
  333. w = wp[-1]; s += x1[-192] * w; t -= x2[ 192] * w;
  334. w = wp[ 0]; s += x1[-128] * w; t -= x2[ 128] * w;
  335. w = wp[ 1]; s += x1[- 64] * w; t -= x2[ 64] * w;
  336. w = wp[ 2]; s += x1[ 0] * w; t -= x2[ 0] * w;
  337. w = wp[ 3]; s += x1[ 64] * w; t -= x2[- 64] * w;
  338. w = wp[ 4]; s += x1[ 128] * w; t -= x2[-128] * w;
  339. w = wp[ 5]; s += x1[ 192] * w; t -= x2[-192] * w;
  340. /*
  341. * this multiplyer could be removed, but it needs more 256 FLOAT data.
  342. * thinking about the data cache performance, I think we should not
  343. * use such a huge table. tt 2000/Oct/25
  344. */
  345. s *= wp[6];
  346. w = t - s;
  347. a[30+i*2] = t + s;
  348. a[31+i*2] = wp[7] * w;
  349. wp += 18;
  350. x1--;
  351. x2++;
  352. }
  353. {
  354. FLOAT8 s,t,u,v;
  355. t = x1[- 16] * wp[-10]; s = x1[ -32] * wp[-2];
  356. t += (x1[- 48] - x1[ 16]) * wp[-9]; s += x1[ -96] * wp[-1];
  357. t += (x1[- 80] + x1[ 48]) * wp[-8]; s += x1[-160] * wp[ 0];
  358. t += (x1[-112] - x1[ 80]) * wp[-7]; s += x1[-224] * wp[ 1];
  359. t += (x1[-144] + x1[112]) * wp[-6]; s -= x1[ 32] * wp[ 2];
  360. t += (x1[-176] - x1[144]) * wp[-5]; s -= x1[ 96] * wp[ 3];
  361. t += (x1[-208] + x1[176]) * wp[-4]; s -= x1[ 160] * wp[ 4];
  362. t += (x1[-240] - x1[208]) * wp[-3]; s -= x1[ 224];
  363. u = s - t;
  364. v = s + t;
  365. t = a[14];
  366. s = a[15] - t;
  367. a[31] = v + t; // A0
  368. a[30] = u + s; // A1
  369. a[15] = u - s; // A2
  370. a[14] = v - t; // A3
  371. }
  372. {
  373. FLOAT8 xr;
  374. xr = a[28] - a[ 0]; a[ 0] += a[28]; a[28] = xr * wp[-2*18+7];
  375. xr = a[29] - a[ 1]; a[ 1] += a[29]; a[29] = xr * wp[-2*18+7];
  376. xr = a[26] - a[ 2]; a[ 2] += a[26]; a[26] = xr * wp[-4*18+7];
  377. xr = a[27] - a[ 3]; a[ 3] += a[27]; a[27] = xr * wp[-4*18+7];
  378. xr = a[24] - a[ 4]; a[ 4] += a[24]; a[24] = xr * wp[-6*18+7];
  379. xr = a[25] - a[ 5]; a[ 5] += a[25]; a[25] = xr * wp[-6*18+7];
  380. xr = a[22] - a[ 6]; a[ 6] += a[22]; a[22] = xr * SQRT2;
  381. xr = a[23] - a[ 7]; a[ 7] += a[23]; a[23] = xr * SQRT2 - a[ 7];
  382. a[ 7] -= a[ 6];
  383. a[22] -= a[ 7];
  384. a[23] -= a[22];
  385. xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr;
  386. xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr;
  387. xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr;
  388. xr = a[23]; a[23] = a[14] - xr; a[14] = a[14] + xr;
  389. xr = a[20] - a[ 8]; a[ 8] += a[20]; a[20] = xr * wp[-10*18+7];
  390. xr = a[21] - a[ 9]; a[ 9] += a[21]; a[21] = xr * wp[-10*18+7];
  391. xr = a[18] - a[10]; a[10] += a[18]; a[18] = xr * wp[-12*18+7];
  392. xr = a[19] - a[11]; a[11] += a[19]; a[19] = xr * wp[-12*18+7];
  393. xr = a[16] - a[12]; a[12] += a[16]; a[16] = xr * wp[-14*18+7];
  394. xr = a[17] - a[13]; a[13] += a[17]; a[17] = xr * wp[-14*18+7];
  395. xr = -a[20] + a[24]; a[20] += a[24]; a[24] = xr * wp[-12*18+7];
  396. xr = -a[21] + a[25]; a[21] += a[25]; a[25] = xr * wp[-12*18+7];
  397. xr = a[ 4] - a[ 8]; a[ 4] += a[ 8]; a[ 8] = xr * wp[-12*18+7];
  398. xr = a[ 5] - a[ 9]; a[ 5] += a[ 9]; a[ 9] = xr * wp[-12*18+7];
  399. xr = a[ 0] - a[12]; a[ 0] += a[12]; a[12] = xr * wp[-4*18+7];
  400. xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = xr * wp[-4*18+7];
  401. xr = a[16] - a[28]; a[16] += a[28]; a[28] = xr * wp[-4*18+7];
  402. xr = -a[17] + a[29]; a[17] += a[29]; a[29] = xr * wp[-4*18+7];
  403. xr = SQRT2 * (a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr;
  404. xr = SQRT2 * (a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr;
  405. xr = SQRT2 * (-a[18] + a[26]); a[18] += a[26]; a[26] = xr - a[18];
  406. xr = SQRT2 * (-a[19] + a[27]); a[19] += a[27]; a[27] = xr - a[19];
  407. xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr;
  408. xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr;
  409. xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr;
  410. xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr;
  411. xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr;
  412. xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr;
  413. xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr;
  414. xr = a[27]; a[27] = a[ 6] - xr; a[ 6] += xr;
  415. xr = SQRT2 * (a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr;
  416. xr = SQRT2 * (a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr;
  417. xr = SQRT2 * (a[16] - a[20]); a[16] += a[20]; a[20] = xr;
  418. xr = SQRT2 * (a[17] - a[21]); a[17] += a[21]; a[21] = xr;
  419. xr = -SQRT2 * (a[ 8] - a[12]); a[ 8] += a[12]; a[12] = xr - a[ 8];
  420. xr = -SQRT2 * (a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9];
  421. xr = -SQRT2 * (a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25];
  422. xr = -SQRT2 * (a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24];
  423. xr = a[24] - a[16]; a[24] = xr;
  424. xr = a[20] - xr; a[20] = xr;
  425. xr = a[28] - xr; a[28] = xr;
  426. xr = a[25] - a[17]; a[25] = xr;
  427. xr = a[21] - xr; a[21] = xr;
  428. xr = a[29] - xr; a[29] = xr;
  429. xr = a[17] - a[ 1]; a[17] = xr;
  430. xr = a[ 9] - xr; a[ 9] = xr;
  431. xr = a[25] - xr; a[25] = xr;
  432. xr = a[ 5] - xr; a[ 5] = xr;
  433. xr = a[21] - xr; a[21] = xr;
  434. xr = a[13] - xr; a[13] = xr;
  435. xr = a[29] - xr; a[29] = xr;
  436. xr = a[ 1] - a[ 0]; a[ 1] = xr;
  437. xr = a[16] - xr; a[16] = xr;
  438. xr = a[17] - xr; a[17] = xr;
  439. xr = a[ 8] - xr; a[ 8] = xr;
  440. xr = a[ 9] - xr; a[ 9] = xr;
  441. xr = a[24] - xr; a[24] = xr;
  442. xr = a[25] - xr; a[25] = xr;
  443. xr = a[ 4] - xr; a[ 4] = xr;
  444. xr = a[ 5] - xr; a[ 5] = xr;
  445. xr = a[20] - xr; a[20] = xr;
  446. xr = a[21] - xr; a[21] = xr;
  447. xr = a[12] - xr; a[12] = xr;
  448. xr = a[13] - xr; a[13] = xr;
  449. xr = a[28] - xr; a[28] = xr;
  450. xr = a[29] - xr; a[29] = xr;
  451. xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr;
  452. xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr;
  453. xr = a[16]; a[16] += a[15]; a[15] -= xr;
  454. xr = a[17]; a[17] += a[14]; a[14] -= xr;
  455. xr = a[ 8]; a[ 8] += a[23]; a[23] -= xr;
  456. xr = a[ 9]; a[ 9] += a[22]; a[22] -= xr;
  457. xr = a[24]; a[24] += a[ 7]; a[ 7] -= xr;
  458. xr = a[25]; a[25] += a[ 6]; a[ 6] -= xr;
  459. xr = a[ 4]; a[ 4] += a[27]; a[27] -= xr;
  460. xr = a[ 5]; a[ 5] += a[26]; a[26] -= xr;
  461. xr = a[20]; a[20] += a[11]; a[11] -= xr;
  462. xr = a[21]; a[21] += a[10]; a[10] -= xr;
  463. xr = a[12]; a[12] += a[19]; a[19] -= xr;
  464. xr = a[13]; a[13] += a[18]; a[18] -= xr;
  465. xr = a[28]; a[28] += a[ 3]; a[ 3] -= xr;
  466. xr = a[29]; a[29] += a[ 2]; a[ 2] -= xr;
  467. }
  468. }
  469. /*-------------------------------------------------------------------*/
  470. /* */
  471. /* Function: Calculation of the MDCT */
  472. /* In the case of long blocks (type 0,1,3) there are */
  473. /* 36 coefficents in the time domain and 18 in the frequency */
  474. /* domain. */
  475. /* In the case of short blocks (type 2) there are 3 */
  476. /* transformations with short length. This leads to 12 coefficents */
  477. /* in the time and 6 in the frequency domain. In this case the */
  478. /* results are stored side by side in the vector out[]. */
  479. /* */
  480. /* New layer3 */
  481. /* */
  482. /*-------------------------------------------------------------------*/
  483. inline static void mdct_short(FLOAT8 *inout)
  484. {
  485. int l;
  486. for ( l = 0; l < 3; l++ ) {
  487. FLOAT8 tc0,tc1,tc2,ts0,ts1,ts2;
  488. ts0 = inout[2*3] * win[SHORT_TYPE][0] - inout[5*3];
  489. tc0 = inout[0*3] * win[SHORT_TYPE][2] - inout[3*3];
  490. tc1 = ts0 + tc0;
  491. tc2 = ts0 - tc0;
  492. ts0 = inout[5*3] * win[SHORT_TYPE][0] + inout[2*3];
  493. tc0 = inout[3*3] * win[SHORT_TYPE][2] + inout[0*3];
  494. ts1 = ts0 + tc0;
  495. ts2 = -ts0 + tc0;
  496. tc0 = (inout[1*3] * win[SHORT_TYPE][1] - inout[4*3]) * 2.069978111953089e-11; /* tritab_s[1] */
  497. ts0 = (inout[4*3] * win[SHORT_TYPE][1] + inout[1*3]) * 2.069978111953089e-11; /* tritab_s[1] */
  498. inout[3*0] = tc1 * 1.907525191737280e-11 /* tritab_s[2] */ + tc0;
  499. inout[3*5] = -ts1 * 1.907525191737280e-11 /* tritab_s[0] */ + ts0;
  500. tc2 = tc2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[2] */;
  501. ts1 = ts1 * 0.5 * 1.907525191737281e-11 + ts0;
  502. inout[3*1] = tc2-ts1;
  503. inout[3*2] = tc2+ts1;
  504. tc1 = tc1 * 0.5 * 1.907525191737281e-11 - tc0;
  505. ts2 = ts2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[0] */;
  506. inout[3*3] = tc1+ts2;
  507. inout[3*4] = tc1-ts2;
  508. inout++;
  509. }
  510. }
  511. inline static void mdct_long(FLOAT8 *out, FLOAT8 *in)
  512. {
  513. FLOAT8 ct,st;
  514. {
  515. FLOAT8 tc1, tc2, tc3, tc4, ts5, ts6, ts7, ts8;
  516. // 1,2, 5,6, 9,10, 13,14, 17
  517. tc1 = in[17]-in[ 9];
  518. tc3 = in[15]-in[11];
  519. tc4 = in[14]-in[12];
  520. ts5 = in[ 0]+in[ 8];
  521. ts6 = in[ 1]+in[ 7];
  522. ts7 = in[ 2]+in[ 6];
  523. ts8 = in[ 3]+in[ 5];
  524. out[17] = (ts5+ts7-ts8)-(ts6-in[4]);
  525. st = (ts5+ts7-ts8)*cx[7]+(ts6-in[4]);
  526. ct = (tc1-tc3-tc4)*cx[6];
  527. out[5] = ct+st;
  528. out[6] = ct-st;
  529. tc2 = (in[16]-in[10])*cx[6];
  530. ts6 = ts6*cx[7] + in[4];
  531. ct = tc1*cx[0] + tc2 + tc3*cx[1] + tc4*cx[2];
  532. st = -ts5*cx[4] + ts6 - ts7*cx[5] + ts8*cx[3];
  533. out[1] = ct+st;
  534. out[2] = ct-st;
  535. ct = tc1*cx[1] - tc2 - tc3*cx[2] + tc4*cx[0];
  536. st = -ts5*cx[5] + ts6 - ts7*cx[3] + ts8*cx[4];
  537. out[ 9] = ct+st;
  538. out[10] = ct-st;
  539. ct = tc1*cx[2] - tc2 + tc3*cx[0] - tc4*cx[1];
  540. st = ts5*cx[3] - ts6 + ts7*cx[4] - ts8*cx[5];
  541. out[13] = ct+st;
  542. out[14] = ct-st;
  543. }
  544. {
  545. FLOAT8 ts1, ts2, ts3, ts4, tc5, tc6, tc7, tc8;
  546. ts1 = in[ 8]-in[ 0];
  547. ts3 = in[ 6]-in[ 2];
  548. ts4 = in[ 5]-in[ 3];
  549. tc5 = in[17]+in[ 9];
  550. tc6 = in[16]+in[10];
  551. tc7 = in[15]+in[11];
  552. tc8 = in[14]+in[12];
  553. out[0] = (tc5+tc7+tc8)+(tc6+in[13]);
  554. ct = (tc5+tc7+tc8)*cx[7]-(tc6+in[13]);
  555. st = (ts1-ts3+ts4)*cx[6];
  556. out[11] = ct+st;
  557. out[12] = ct-st;
  558. ts2 = (in[7]-in[1])*cx[6];
  559. tc6 = in[13] - tc6*cx[7];
  560. ct = tc5*cx[3] - tc6 + tc7*cx[4] + tc8*cx[5];
  561. st = ts1*cx[2] + ts2 + ts3*cx[0] + ts4*cx[1];
  562. out[3] = ct+st;
  563. out[4] = ct-st;
  564. ct = -tc5*cx[5] + tc6 - tc7*cx[3] - tc8*cx[4];
  565. st = ts1*cx[1] + ts2 - ts3*cx[2] - ts4*cx[0];
  566. out[7] = ct+st;
  567. out[8] = ct-st;
  568. ct = -tc5*cx[4] + tc6 - tc7*cx[5] - tc8*cx[3];
  569. st = ts1*cx[0] - ts2 + ts3*cx[1] - ts4*cx[2];
  570. out[15] = ct+st;
  571. out[16] = ct-st;
  572. }
  573. }
  574. void mdct_sub48( lame_internal_flags *gfc, const sample_t *w0, const sample_t *w1,
  575. FLOAT8 mdct_freq[2][2][576] )
  576. {
  577. int gr, k, ch;
  578. const sample_t *wk;
  579. wk = w0 + 286;
  580. /* thinking cache performance, ch->gr loop is better than gr->ch loop */
  581. for (ch = 0; ch < gfc->channels_out; ch++) {
  582. for (gr = 0; gr < gfc->mode_gr; gr++) {
  583. int band;
  584. FLOAT8 *mdct_enc = &mdct_freq[gr][ch][0];
  585. gr_info *gi = &(gfc->l3_side.gr[gr].ch[ch].tt);
  586. FLOAT8 *samp = gfc->sb_sample[ch][1 - gr][0];
  587. for (k = 0; k < 18 / 2; k++) {
  588. window_subband(wk, samp);
  589. window_subband(wk + 32, samp + 32);
  590. samp += 64;
  591. wk += 64;
  592. /*
  593. * Compensate for inversion in the analysis filter
  594. */
  595. for (band = 1; band < 32; band+=2) {
  596. samp[band-32] *= -1;
  597. }
  598. }
  599. /* apply filters on the polyphase filterbank outputs */
  600. /* bands <= gfc->highpass_band will be zeroed out below */
  601. /* bands >= gfc->lowpass_band will be zeroed out below */
  602. if (gfc->filter_type==0) {
  603. for (band=gfc->highpass_start_band; band <= gfc->highpass_end_band; band++) {
  604. for (k=0; k<18; k++)
  605. gfc->sb_sample[ch][1-gr][k][order[band]]*=gfc->amp_highpass[band];
  606. }
  607. for (band=gfc->lowpass_start_band; band <= gfc->lowpass_end_band; band++) {
  608. for (k=0; k<18; k++)
  609. gfc->sb_sample[ch][1-gr][k][order[band]]*=gfc->amp_lowpass[band];
  610. }
  611. }
  612. /*
  613. * Perform imdct of 18 previous subband samples
  614. * + 18 current subband samples
  615. */
  616. for (band = 0; band < 32; band++, mdct_enc += 18) {
  617. int type = gi->block_type;
  618. FLOAT8 *band0, *band1;
  619. band0 = gfc->sb_sample[ch][ gr][0] + order[band];
  620. band1 = gfc->sb_sample[ch][1-gr][0] + order[band];
  621. if (gi->mixed_block_flag && band < 2)
  622. type = 0;
  623. if (band >= gfc->lowpass_band || band <= gfc->highpass_band) {
  624. memset((char *)mdct_enc,0,18*sizeof(FLOAT8));
  625. } else {
  626. if (type == SHORT_TYPE) {
  627. for (k = -NS/4; k < 0; k++) {
  628. FLOAT8 w = win[SHORT_TYPE][k+3];
  629. mdct_enc[k*3+ 9] = band0[( 9+k)*32] * w - band0[( 8-k)*32];
  630. mdct_enc[k*3+18] = band0[(14-k)*32] * w + band0[(15+k)*32];
  631. mdct_enc[k*3+10] = band0[(15+k)*32] * w - band0[(14-k)*32];
  632. mdct_enc[k*3+19] = band1[( 2-k)*32] * w + band1[( 3+k)*32];
  633. mdct_enc[k*3+11] = band1[( 3+k)*32] * w - band1[( 2-k)*32];
  634. mdct_enc[k*3+20] = band1[( 8-k)*32] * w + band1[( 9+k)*32];
  635. }
  636. mdct_short(mdct_enc);
  637. } else {
  638. FLOAT8 work[18];
  639. for (k = -NL/4; k < 0; k++) {
  640. FLOAT8 a, b;
  641. a = win[type][k+27] * band1[(k+9)*32]
  642. + win[type][k+36] * band1[(8-k)*32];
  643. b = win[type][k+ 9] * band0[(k+9)*32]
  644. - win[type][k+18] * band0[(8-k)*32];
  645. work[k+ 9] = a - b*tantab_l[k+9];
  646. work[k+18] = a*tantab_l[k+9] + b;
  647. }
  648. mdct_long(mdct_enc, work);
  649. }
  650. }
  651. /*
  652. * Perform aliasing reduction butterfly
  653. */
  654. if (type != SHORT_TYPE) {
  655. if (band == 0)
  656. continue;
  657. for (k = 7; k >= 0; --k) {
  658. FLOAT8 bu,bd;
  659. bu = mdct_enc[k] * ca[k] + mdct_enc[-1-k] * cs[k];
  660. bd = mdct_enc[k] * cs[k] - mdct_enc[-1-k] * ca[k];
  661. mdct_enc[-1-k] = bu;
  662. mdct_enc[k] = bd;
  663. }
  664. }
  665. }
  666. }
  667. wk = w1 + 286;
  668. if (gfc->mode_gr == 1) {
  669. memcpy(gfc->sb_sample[ch][0], gfc->sb_sample[ch][1], 576 * sizeof(FLOAT8));
  670. }
  671. }
  672. }