newmdct.c

Go to the documentation of this file.
00001 /*
00002  *      MP3 window subband -> subband filtering -> mdct routine
00003  *
00004  *      Copyright (c) 1999-2000 Takehiro Tominaga
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 /*
00024  *         Special Thanks to Patrick De Smet for your advices.
00025  */
00026 
00027 /* $Id: newmdct.c,v 1.34 2007/07/24 17:46:10 bouvigne Exp $ */
00028 
00029 #ifdef HAVE_CONFIG_H
00030 # include <config.h>
00031 #endif
00032 
00033 #include "lame.h"
00034 #include "machine.h"
00035 #include "encoder.h"
00036 #include "util.h"
00037 #include "newmdct.h"
00038 
00039 
00040 
00041 #ifndef USE_GOGO_SUBBAND
00042 static const FLOAT enwindow[] = {
00043     -4.77e-07 * 0.740951125354959 / 2.384e-06, 1.03951e-04 * 0.740951125354959 / 2.384e-06,
00044         9.53674e-04 * 0.740951125354959 / 2.384e-06, 2.841473e-03 * 0.740951125354959 / 2.384e-06,
00045     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 */
00046     1.2398e-05 * 0.740951125354959 / 2.384e-06, 1.91212e-04 * 0.740951125354959 / 2.384e-06,
00047         2.283096e-03 * 0.740951125354959 / 2.384e-06, 1.6994476e-02 * 0.740951125354959 / 2.384e-06,
00048     -1.8756866e-02 * 0.740951125354959 / 2.384e-06, -2.630711e-03 * 0.740951125354959 / 2.384e-06,
00049         -2.47478e-04 * 0.740951125354959 / 2.384e-06, -1.4782e-05 * 0.740951125354959 / 2.384e-06,
00050     9.063471690191471e-01,
00051     1.960342806591213e-01,
00052 
00053 
00054     -4.77e-07 * 0.773010453362737 / 2.384e-06, 1.05858e-04 * 0.773010453362737 / 2.384e-06,
00055         9.30786e-04 * 0.773010453362737 / 2.384e-06, 2.521515e-03 * 0.773010453362737 / 2.384e-06,
00056     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 */
00057     1.1444e-05 * 0.773010453362737 / 2.384e-06, 1.65462e-04 * 0.773010453362737 / 2.384e-06,
00058         2.110004e-03 * 0.773010453362737 / 2.384e-06, 1.6112804e-02 * 0.773010453362737 / 2.384e-06,
00059     -1.9634247e-02 * 0.773010453362737 / 2.384e-06, -2.803326e-03 * 0.773010453362737 / 2.384e-06,
00060         -2.77042e-04 * 0.773010453362737 / 2.384e-06, -1.6689e-05 * 0.773010453362737 / 2.384e-06,
00061     8.206787908286602e-01,
00062     3.901806440322567e-01,
00063 
00064 
00065     -4.77e-07 * 0.803207531480645 / 2.384e-06, 1.07288e-04 * 0.803207531480645 / 2.384e-06,
00066         9.02653e-04 * 0.803207531480645 / 2.384e-06, 2.174854e-03 * 0.803207531480645 / 2.384e-06,
00067     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 */
00068     1.0014e-05 * 0.803207531480645 / 2.384e-06, 1.40190e-04 * 0.803207531480645 / 2.384e-06,
00069         1.937389e-03 * 0.803207531480645 / 2.384e-06, 1.5233517e-02 * 0.803207531480645 / 2.384e-06,
00070     -2.0506859e-02 * 0.803207531480645 / 2.384e-06, -2.974033e-03 * 0.803207531480645 / 2.384e-06,
00071         -3.07560e-04 * 0.803207531480645 / 2.384e-06, -1.8120e-05 * 0.803207531480645 / 2.384e-06,
00072     7.416505462720353e-01,
00073     5.805693545089249e-01,
00074 
00075 
00076     -4.77e-07 * 0.831469612302545 / 2.384e-06, 1.08242e-04 * 0.831469612302545 / 2.384e-06,
00077         8.68797e-04 * 0.831469612302545 / 2.384e-06, 1.800537e-03 * 0.831469612302545 / 2.384e-06,
00078     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 */
00079     9.060e-06 * 0.831469612302545 / 2.384e-06, 1.16348e-04 * 0.831469612302545 / 2.384e-06,
00080         1.766682e-03 * 0.831469612302545 / 2.384e-06, 1.4358521e-02 * 0.831469612302545 / 2.384e-06,
00081     -2.1372318e-02 * 0.831469612302545 / 2.384e-06, -3.14188e-03 * 0.831469612302545 / 2.384e-06,
00082         -3.39031e-04 * 0.831469612302545 / 2.384e-06, -1.9550e-05 * 0.831469612302545 / 2.384e-06,
00083     6.681786379192989e-01,
00084     7.653668647301797e-01,
00085 
00086 
00087     -4.77e-07 * 0.857728610000272 / 2.384e-06, 1.08719e-04 * 0.857728610000272 / 2.384e-06,
00088         8.29220e-04 * 0.857728610000272 / 2.384e-06, 1.399517e-03 * 0.857728610000272 / 2.384e-06,
00089     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 */
00090     8.106e-06 * 0.857728610000272 / 2.384e-06, 9.3937e-05 * 0.857728610000272 / 2.384e-06,
00091         1.597881e-03 * 0.857728610000272 / 2.384e-06, 1.3489246e-02 * 0.857728610000272 / 2.384e-06,
00092     -2.2228718e-02 * 0.857728610000272 / 2.384e-06, -3.306866e-03 * 0.857728610000272 / 2.384e-06,
00093         -3.71456e-04 * 0.857728610000272 / 2.384e-06, -2.1458e-05 * 0.857728610000272 / 2.384e-06,
00094     5.993769336819237e-01,
00095     9.427934736519954e-01,
00096 
00097 
00098     -4.77e-07 * 0.881921264348355 / 2.384e-06, 1.08719e-04 * 0.881921264348355 / 2.384e-06,
00099         7.8392e-04 * 0.881921264348355 / 2.384e-06, 9.71317e-04 * 0.881921264348355 / 2.384e-06,
00100     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 */
00101     7.629e-06 * 0.881921264348355 / 2.384e-06, 7.2956e-05 * 0.881921264348355 / 2.384e-06,
00102         1.432419e-03 * 0.881921264348355 / 2.384e-06, 1.2627602e-02 * 0.881921264348355 / 2.384e-06,
00103     -2.3074150e-02 * 0.881921264348355 / 2.384e-06, -3.467083e-03 * 0.881921264348355 / 2.384e-06,
00104         -4.04358e-04 * 0.881921264348355 / 2.384e-06, -2.3365e-05 * 0.881921264348355 / 2.384e-06,
00105     5.345111359507916e-01,
00106     1.111140466039205e+00,
00107 
00108 
00109     -9.54e-07 * 0.903989293123443 / 2.384e-06, 1.08242e-04 * 0.903989293123443 / 2.384e-06,
00110         7.31945e-04 * 0.903989293123443 / 2.384e-06, 5.15938e-04 * 0.903989293123443 / 2.384e-06,
00111     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 */
00112     6.676e-06 * 0.903989293123443 / 2.384e-06, 5.2929e-05 * 0.903989293123443 / 2.384e-06,
00113         1.269817e-03 * 0.903989293123443 / 2.384e-06, 1.1775017e-02 * 0.903989293123443 / 2.384e-06,
00114     -2.3907185e-02 * 0.903989293123443 / 2.384e-06, -3.622532e-03 * 0.903989293123443 / 2.384e-06,
00115         -4.38213e-04 * 0.903989293123443 / 2.384e-06, -2.5272e-05 * 0.903989293123443 / 2.384e-06,
00116     4.729647758913199e-01,
00117     1.268786568327291e+00,
00118 
00119 
00120     -9.54e-07 * 0.92387953251128675613 / 2.384e-06,
00121         1.06812e-04 * 0.92387953251128675613 / 2.384e-06,
00122         6.74248e-04 * 0.92387953251128675613 / 2.384e-06,
00123         3.3379e-05 * 0.92387953251128675613 / 2.384e-06,
00124     3.4412861e-02 * 0.92387953251128675613 / 2.384e-06,
00125         4.573822e-03 * 0.92387953251128675613 / 2.384e-06,
00126         9.54151e-04 * 0.92387953251128675613 / 2.384e-06,
00127         7.6771e-05 * 0.92387953251128675613 / 2.384e-06,
00128     6.199e-06 * 0.92387953251128675613 / 2.384e-06, 3.4332e-05 * 0.92387953251128675613 / 2.384e-06,
00129         1.111031e-03 * 0.92387953251128675613 / 2.384e-06,
00130         1.0933399e-02 * 0.92387953251128675613 / 2.384e-06,
00131     -2.4725437e-02 * 0.92387953251128675613 / 2.384e-06,
00132         -3.771782e-03 * 0.92387953251128675613 / 2.384e-06,
00133         -4.72546e-04 * 0.92387953251128675613 / 2.384e-06,
00134         -2.7657e-05 * 0.92387953251128675613 / 2.384e-06,
00135     4.1421356237309504879e-01, /* tan(PI/8) */
00136     1.414213562373095e+00,
00137 
00138 
00139     -9.54e-07 * 0.941544065183021 / 2.384e-06, 1.05381e-04 * 0.941544065183021 / 2.384e-06,
00140         6.10352e-04 * 0.941544065183021 / 2.384e-06, -4.75883e-04 * 0.941544065183021 / 2.384e-06,
00141     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 */
00142     5.245e-06 * 0.941544065183021 / 2.384e-06, 1.7166e-05 * 0.941544065183021 / 2.384e-06,
00143         9.56535e-04 * 0.941544065183021 / 2.384e-06, 1.0103703e-02 * 0.941544065183021 / 2.384e-06,
00144     -2.5527000e-02 * 0.941544065183021 / 2.384e-06, -3.914356e-03 * 0.941544065183021 / 2.384e-06,
00145         -5.07355e-04 * 0.941544065183021 / 2.384e-06, -3.0041e-05 * 0.941544065183021 / 2.384e-06,
00146     3.578057213145241e-01,
00147     1.546020906725474e+00,
00148 
00149 
00150     -9.54e-07 * 0.956940335732209 / 2.384e-06, 1.02520e-04 * 0.956940335732209 / 2.384e-06,
00151         5.39303e-04 * 0.956940335732209 / 2.384e-06, -1.011848e-03 * 0.956940335732209 / 2.384e-06,
00152     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 */
00153     4.768e-06 * 0.956940335732209 / 2.384e-06, 9.54e-07 * 0.956940335732209 / 2.384e-06,
00154         8.06808e-04 * 0.956940335732209 / 2.384e-06, 9.287834e-03 * 0.956940335732209 / 2.384e-06,
00155     -2.6310921e-02 * 0.956940335732209 / 2.384e-06, -4.048824e-03 * 0.956940335732209 / 2.384e-06,
00156         -5.42164e-04 * 0.956940335732209 / 2.384e-06, -3.2425e-05 * 0.956940335732209 / 2.384e-06,
00157     3.033466836073424e-01,
00158     1.662939224605090e+00,
00159 
00160 
00161     -1.431e-06 * 0.970031253194544 / 2.384e-06, 9.9182e-05 * 0.970031253194544 / 2.384e-06,
00162         4.62532e-04 * 0.970031253194544 / 2.384e-06, -1.573563e-03 * 0.970031253194544 / 2.384e-06,
00163     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 */
00164     4.292e-06 * 0.970031253194544 / 2.384e-06, -1.3828e-05 * 0.970031253194544 / 2.384e-06,
00165         6.61850e-04 * 0.970031253194544 / 2.384e-06, 8.487225e-03 * 0.970031253194544 / 2.384e-06,
00166     -2.7073860e-02 * 0.970031253194544 / 2.384e-06, -4.174709e-03 * 0.970031253194544 / 2.384e-06,
00167         -5.76973e-04 * 0.970031253194544 / 2.384e-06, -3.4809e-05 * 0.970031253194544 / 2.384e-06,
00168     2.504869601913055e-01,
00169     1.763842528696710e+00,
00170 
00171 
00172     -1.431e-06 * 0.98078528040323 / 2.384e-06, 9.5367e-05 * 0.98078528040323 / 2.384e-06,
00173         3.78609e-04 * 0.98078528040323 / 2.384e-06, -2.161503e-03 * 0.98078528040323 / 2.384e-06,
00174     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 */
00175     3.815e-06 * 0.98078528040323 / 2.384e-06, -2.718e-05 * 0.98078528040323 / 2.384e-06,
00176         5.22137e-04 * 0.98078528040323 / 2.384e-06, 7.703304e-03 * 0.98078528040323 / 2.384e-06,
00177     -2.7815342e-02 * 0.98078528040323 / 2.384e-06, -4.290581e-03 * 0.98078528040323 / 2.384e-06,
00178         -6.11782e-04 * 0.98078528040323 / 2.384e-06, -3.7670e-05 * 0.98078528040323 / 2.384e-06,
00179     1.989123673796580e-01,
00180     1.847759065022573e+00,
00181 
00182 
00183     -1.907e-06 * 0.989176509964781 / 2.384e-06, 9.0122e-05 * 0.989176509964781 / 2.384e-06,
00184         2.88486e-04 * 0.989176509964781 / 2.384e-06, -2.774239e-03 * 0.989176509964781 / 2.384e-06,
00185     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 */
00186     3.338e-06 * 0.989176509964781 / 2.384e-06, -3.9577e-05 * 0.989176509964781 / 2.384e-06,
00187         3.88145e-04 * 0.989176509964781 / 2.384e-06, 6.937027e-03 * 0.989176509964781 / 2.384e-06,
00188     -2.8532982e-02 * 0.989176509964781 / 2.384e-06, -4.395962e-03 * 0.989176509964781 / 2.384e-06,
00189         -6.46591e-04 * 0.989176509964781 / 2.384e-06, -4.0531e-05 * 0.989176509964781 / 2.384e-06,
00190     1.483359875383474e-01,
00191     1.913880671464418e+00,
00192 
00193 
00194     -1.907e-06 * 0.995184726672197 / 2.384e-06, 8.4400e-05 * 0.995184726672197 / 2.384e-06,
00195         1.91689e-04 * 0.995184726672197 / 2.384e-06, -3.411293e-03 * 0.995184726672197 / 2.384e-06,
00196     3.1706810e-02 * 0.995184726672197 / 2.384e-06, 4.728317e-03 * 0.995184726672197 / 2.384e-06,
00197         8.09669e-04 * 0.995184726672197 / 2.384e-06, 5.579e-05 * 0.995184726672197 / 2.384e-06,
00198     3.338e-06 * 0.995184726672197 / 2.384e-06, -5.0545e-05 * 0.995184726672197 / 2.384e-06,
00199         2.59876e-04 * 0.995184726672197 / 2.384e-06, 6.189346e-03 * 0.995184726672197 / 2.384e-06,
00200     -2.9224873e-02 * 0.995184726672197 / 2.384e-06, -4.489899e-03 * 0.995184726672197 / 2.384e-06,
00201         -6.80923e-04 * 0.995184726672197 / 2.384e-06, -4.3392e-05 * 0.995184726672197 / 2.384e-06,
00202     9.849140335716425e-02,
00203     1.961570560806461e+00,
00204 
00205 
00206     -2.384e-06 * 0.998795456205172 / 2.384e-06, 7.7724e-05 * 0.998795456205172 / 2.384e-06,
00207         8.8215e-05 * 0.998795456205172 / 2.384e-06, -4.072189e-03 * 0.998795456205172 / 2.384e-06,
00208     3.1132698e-02 * 0.998795456205172 / 2.384e-06, 4.691124e-03 * 0.998795456205172 / 2.384e-06,
00209         7.79152e-04 * 0.998795456205172 / 2.384e-06, 5.2929e-05 * 0.998795456205172 / 2.384e-06,
00210     2.861e-06 * 0.998795456205172 / 2.384e-06, -6.0558e-05 * 0.998795456205172 / 2.384e-06,
00211         1.37329e-04 * 0.998795456205172 / 2.384e-06, 5.462170e-03 * 0.998795456205172 / 2.384e-06,
00212     -2.9890060e-02 * 0.998795456205172 / 2.384e-06, -4.570484e-03 * 0.998795456205172 / 2.384e-06,
00213         -7.14302e-04 * 0.998795456205172 / 2.384e-06, -4.6253e-05 * 0.998795456205172 / 2.384e-06,
00214     4.912684976946725e-02,
00215     1.990369453344394e+00,
00216 
00217 
00218     3.5780907e-02 * SQRT2 * 0.5 / 2.384e-06, 1.7876148e-02 * SQRT2 * 0.5 / 2.384e-06,
00219         3.134727e-03 * SQRT2 * 0.5 / 2.384e-06, 2.457142e-03 * SQRT2 * 0.5 / 2.384e-06,
00220     9.71317e-04 * SQRT2 * 0.5 / 2.384e-06, 2.18868e-04 * SQRT2 * 0.5 / 2.384e-06,
00221         1.01566e-04 * SQRT2 * 0.5 / 2.384e-06, 1.3828e-05 * SQRT2 * 0.5 / 2.384e-06,
00222 
00223     3.0526638e-02 / 2.384e-06, 4.638195e-03 / 2.384e-06, 7.47204e-04 / 2.384e-06,
00224         4.9591e-05 / 2.384e-06,
00225     4.756451e-03 / 2.384e-06, 2.1458e-05 / 2.384e-06, -6.9618e-05 / 2.384e-06, /*    2.384e-06/2.384e-06 */
00226 };
00227 #endif
00228 
00229 
00230 #define NS 12
00231 #define NL 36
00232 
00233 static const FLOAT win[4][NL] = {
00234     {
00235      2.382191739347913e-13,
00236      6.423305872147834e-13,
00237      9.400849094049688e-13,
00238      1.122435026096556e-12,
00239      1.183840321267481e-12,
00240      1.122435026096556e-12,
00241      9.400849094049690e-13,
00242      6.423305872147839e-13,
00243      2.382191739347918e-13,
00244 
00245      5.456116108943412e-12,
00246      4.878985199565852e-12,
00247      4.240448995017367e-12,
00248      3.559909094758252e-12,
00249      2.858043359288075e-12,
00250      2.156177623817898e-12,
00251      1.475637723558783e-12,
00252      8.371015190102974e-13,
00253      2.599706096327376e-13,
00254 
00255      -5.456116108943412e-12,
00256      -4.878985199565852e-12,
00257      -4.240448995017367e-12,
00258      -3.559909094758252e-12,
00259      -2.858043359288076e-12,
00260      -2.156177623817898e-12,
00261      -1.475637723558783e-12,
00262      -8.371015190102975e-13,
00263      -2.599706096327376e-13,
00264 
00265      -2.382191739347923e-13,
00266      -6.423305872147843e-13,
00267      -9.400849094049696e-13,
00268      -1.122435026096556e-12,
00269      -1.183840321267481e-12,
00270      -1.122435026096556e-12,
00271      -9.400849094049694e-13,
00272      -6.423305872147840e-13,
00273      -2.382191739347918e-13,
00274      },
00275     {
00276      2.382191739347913e-13,
00277      6.423305872147834e-13,
00278      9.400849094049688e-13,
00279      1.122435026096556e-12,
00280      1.183840321267481e-12,
00281      1.122435026096556e-12,
00282      9.400849094049688e-13,
00283      6.423305872147841e-13,
00284      2.382191739347918e-13,
00285 
00286      5.456116108943413e-12,
00287      4.878985199565852e-12,
00288      4.240448995017367e-12,
00289      3.559909094758253e-12,
00290      2.858043359288075e-12,
00291      2.156177623817898e-12,
00292      1.475637723558782e-12,
00293      8.371015190102975e-13,
00294      2.599706096327376e-13,
00295 
00296      -5.461314069809755e-12,
00297      -4.921085770524055e-12,
00298      -4.343405037091838e-12,
00299      -3.732668368707687e-12,
00300      -3.093523840190885e-12,
00301      -2.430835727329465e-12,
00302      -1.734679010007751e-12,
00303      -9.748253656609281e-13,
00304      -2.797435120168326e-13,
00305 
00306      0.000000000000000e+00,
00307      0.000000000000000e+00,
00308      0.000000000000000e+00,
00309      0.000000000000000e+00,
00310      0.000000000000000e+00,
00311      0.000000000000000e+00,
00312      -2.283748241799531e-13,
00313      -4.037858874020686e-13,
00314      -2.146547464825323e-13,
00315      },
00316     {
00317      1.316524975873958e-01, /* win[SHORT_TYPE] */
00318      4.142135623730950e-01,
00319      7.673269879789602e-01,
00320 
00321      1.091308501069271e+00, /* tantab_l */
00322      1.303225372841206e+00,
00323      1.569685577117490e+00,
00324      1.920982126971166e+00,
00325      2.414213562373094e+00,
00326      3.171594802363212e+00,
00327      4.510708503662055e+00,
00328      7.595754112725146e+00,
00329      2.290376554843115e+01,
00330 
00331      0.98480775301220802032, /* cx */
00332      0.64278760968653936292,
00333      0.34202014332566882393,
00334      0.93969262078590842791,
00335      -0.17364817766693030343,
00336      -0.76604444311897790243,
00337      0.86602540378443870761,
00338      0.500000000000000e+00,
00339 
00340      -5.144957554275265e-01, /* ca */
00341      -4.717319685649723e-01,
00342      -3.133774542039019e-01,
00343      -1.819131996109812e-01,
00344      -9.457419252642064e-02,
00345      -4.096558288530405e-02,
00346      -1.419856857247115e-02,
00347      -3.699974673760037e-03,
00348 
00349      8.574929257125442e-01, /* cs */
00350      8.817419973177052e-01,
00351      9.496286491027329e-01,
00352      9.833145924917901e-01,
00353      9.955178160675857e-01,
00354      9.991605581781475e-01,
00355      9.998991952444470e-01,
00356      9.999931550702802e-01,
00357      },
00358     {
00359      0.000000000000000e+00,
00360      0.000000000000000e+00,
00361      0.000000000000000e+00,
00362      0.000000000000000e+00,
00363      0.000000000000000e+00,
00364      0.000000000000000e+00,
00365      2.283748241799531e-13,
00366      4.037858874020686e-13,
00367      2.146547464825323e-13,
00368 
00369      5.461314069809755e-12,
00370      4.921085770524055e-12,
00371      4.343405037091838e-12,
00372      3.732668368707687e-12,
00373      3.093523840190885e-12,
00374      2.430835727329466e-12,
00375      1.734679010007751e-12,
00376      9.748253656609281e-13,
00377      2.797435120168326e-13,
00378 
00379      -5.456116108943413e-12,
00380      -4.878985199565852e-12,
00381      -4.240448995017367e-12,
00382      -3.559909094758253e-12,
00383      -2.858043359288075e-12,
00384      -2.156177623817898e-12,
00385      -1.475637723558782e-12,
00386      -8.371015190102975e-13,
00387      -2.599706096327376e-13,
00388 
00389      -2.382191739347913e-13,
00390      -6.423305872147834e-13,
00391      -9.400849094049688e-13,
00392      -1.122435026096556e-12,
00393      -1.183840321267481e-12,
00394      -1.122435026096556e-12,
00395      -9.400849094049688e-13,
00396      -6.423305872147841e-13,
00397      -2.382191739347918e-13,
00398      }
00399 };
00400 
00401 #define tantab_l (win[SHORT_TYPE]+3)
00402 #define cx (win[SHORT_TYPE]+12)
00403 #define ca (win[SHORT_TYPE]+20)
00404 #define cs (win[SHORT_TYPE]+28)
00405 
00406 /************************************************************************
00407 *
00408 * window_subband()
00409 *
00410 * PURPOSE:  Overlapping window on PCM samples
00411 *
00412 * SEMANTICS:
00413 * 32 16-bit pcm samples are scaled to fractional 2's complement and
00414 * concatenated to the end of the window buffer #x#. The updated window
00415 * buffer #x# is then windowed by the analysis window #c# to produce the
00416 * windowed sample #z#
00417 *
00418 ************************************************************************/
00419 
00420 /*
00421  *      new IDCT routine written by Takehiro TOMINAGA
00422  */
00423 static const int order[] = {
00424     0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29,
00425     2, 3, 18, 19, 10, 11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31
00426 };
00427 
00428 
00429 /* returns sum_j=0^31 a[j]*cos(PI*j*(k+1/2)/32), 0<=k<32 */
00430 inline static void
00431 window_subband(const sample_t * x1, FLOAT a[SBLIMIT])
00432 {
00433     int     i;
00434     FLOAT const *wp = enwindow + 10;
00435 
00436     const sample_t *x2 = &x1[238 - 14 - 286];
00437 
00438     for (i = -15; i < 0; i++) {
00439         FLOAT   w, s, t;
00440 
00441         w = wp[-10];
00442         s = x2[-224] * w;
00443         t = x1[224] * w;
00444         w = wp[-9];
00445         s += x2[-160] * w;
00446         t += x1[160] * w;
00447         w = wp[-8];
00448         s += x2[-96] * w;
00449         t += x1[96] * w;
00450         w = wp[-7];
00451         s += x2[-32] * w;
00452         t += x1[32] * w;
00453         w = wp[-6];
00454         s += x2[32] * w;
00455         t += x1[-32] * w;
00456         w = wp[-5];
00457         s += x2[96] * w;
00458         t += x1[-96] * w;
00459         w = wp[-4];
00460         s += x2[160] * w;
00461         t += x1[-160] * w;
00462         w = wp[-3];
00463         s += x2[224] * w;
00464         t += x1[-224] * w;
00465 
00466         w = wp[-2];
00467         s += x1[-256] * w;
00468         t -= x2[256] * w;
00469         w = wp[-1];
00470         s += x1[-192] * w;
00471         t -= x2[192] * w;
00472         w = wp[0];
00473         s += x1[-128] * w;
00474         t -= x2[128] * w;
00475         w = wp[1];
00476         s += x1[-64] * w;
00477         t -= x2[64] * w;
00478         w = wp[2];
00479         s += x1[0] * w;
00480         t -= x2[0] * w;
00481         w = wp[3];
00482         s += x1[64] * w;
00483         t -= x2[-64] * w;
00484         w = wp[4];
00485         s += x1[128] * w;
00486         t -= x2[-128] * w;
00487         w = wp[5];
00488         s += x1[192] * w;
00489         t -= x2[-192] * w;
00490 
00491         /*
00492          * this multiplyer could be removed, but it needs more 256 FLOAT data.
00493          * thinking about the data cache performance, I think we should not
00494          * use such a huge table. tt 2000/Oct/25
00495          */
00496         s *= wp[6];
00497         w = t - s;
00498         a[30 + i * 2] = t + s;
00499         a[31 + i * 2] = wp[7] * w;
00500         wp += 18;
00501         x1--;
00502         x2++;
00503     }
00504     {
00505         FLOAT   s, t, u, v;
00506         t = x1[-16] * wp[-10];
00507         s = x1[-32] * wp[-2];
00508         t += (x1[-48] - x1[16]) * wp[-9];
00509         s += x1[-96] * wp[-1];
00510         t += (x1[-80] + x1[48]) * wp[-8];
00511         s += x1[-160] * wp[0];
00512         t += (x1[-112] - x1[80]) * wp[-7];
00513         s += x1[-224] * wp[1];
00514         t += (x1[-144] + x1[112]) * wp[-6];
00515         s -= x1[32] * wp[2];
00516         t += (x1[-176] - x1[144]) * wp[-5];
00517         s -= x1[96] * wp[3];
00518         t += (x1[-208] + x1[176]) * wp[-4];
00519         s -= x1[160] * wp[4];
00520         t += (x1[-240] - x1[208]) * wp[-3];
00521         s -= x1[224];
00522 
00523         u = s - t;
00524         v = s + t;
00525 
00526         t = a[14];
00527         s = a[15] - t;
00528 
00529         a[31] = v + t;  /* A0 */
00530         a[30] = u + s;  /* A1 */
00531         a[15] = u - s;  /* A2 */
00532         a[14] = v - t;  /* A3 */
00533     }
00534     {
00535         FLOAT   xr;
00536         xr = a[28] - a[0];
00537         a[0] += a[28];
00538         a[28] = xr * wp[-2 * 18 + 7];
00539         xr = a[29] - a[1];
00540         a[1] += a[29];
00541         a[29] = xr * wp[-2 * 18 + 7];
00542 
00543         xr = a[26] - a[2];
00544         a[2] += a[26];
00545         a[26] = xr * wp[-4 * 18 + 7];
00546         xr = a[27] - a[3];
00547         a[3] += a[27];
00548         a[27] = xr * wp[-4 * 18 + 7];
00549 
00550         xr = a[24] - a[4];
00551         a[4] += a[24];
00552         a[24] = xr * wp[-6 * 18 + 7];
00553         xr = a[25] - a[5];
00554         a[5] += a[25];
00555         a[25] = xr * wp[-6 * 18 + 7];
00556 
00557         xr = a[22] - a[6];
00558         a[6] += a[22];
00559         a[22] = xr * SQRT2;
00560         xr = a[23] - a[7];
00561         a[7] += a[23];
00562         a[23] = xr * SQRT2 - a[7];
00563         a[7] -= a[6];
00564         a[22] -= a[7];
00565         a[23] -= a[22];
00566 
00567         xr = a[6];
00568         a[6] = a[31] - xr;
00569         a[31] = a[31] + xr;
00570         xr = a[7];
00571         a[7] = a[30] - xr;
00572         a[30] = a[30] + xr;
00573         xr = a[22];
00574         a[22] = a[15] - xr;
00575         a[15] = a[15] + xr;
00576         xr = a[23];
00577         a[23] = a[14] - xr;
00578         a[14] = a[14] + xr;
00579 
00580         xr = a[20] - a[8];
00581         a[8] += a[20];
00582         a[20] = xr * wp[-10 * 18 + 7];
00583         xr = a[21] - a[9];
00584         a[9] += a[21];
00585         a[21] = xr * wp[-10 * 18 + 7];
00586 
00587         xr = a[18] - a[10];
00588         a[10] += a[18];
00589         a[18] = xr * wp[-12 * 18 + 7];
00590         xr = a[19] - a[11];
00591         a[11] += a[19];
00592         a[19] = xr * wp[-12 * 18 + 7];
00593 
00594         xr = a[16] - a[12];
00595         a[12] += a[16];
00596         a[16] = xr * wp[-14 * 18 + 7];
00597         xr = a[17] - a[13];
00598         a[13] += a[17];
00599         a[17] = xr * wp[-14 * 18 + 7];
00600 
00601         xr = -a[20] + a[24];
00602         a[20] += a[24];
00603         a[24] = xr * wp[-12 * 18 + 7];
00604         xr = -a[21] + a[25];
00605         a[21] += a[25];
00606         a[25] = xr * wp[-12 * 18 + 7];
00607 
00608         xr = a[4] - a[8];
00609         a[4] += a[8];
00610         a[8] = xr * wp[-12 * 18 + 7];
00611         xr = a[5] - a[9];
00612         a[5] += a[9];
00613         a[9] = xr * wp[-12 * 18 + 7];
00614 
00615         xr = a[0] - a[12];
00616         a[0] += a[12];
00617         a[12] = xr * wp[-4 * 18 + 7];
00618         xr = a[1] - a[13];
00619         a[1] += a[13];
00620         a[13] = xr * wp[-4 * 18 + 7];
00621         xr = a[16] - a[28];
00622         a[16] += a[28];
00623         a[28] = xr * wp[-4 * 18 + 7];
00624         xr = -a[17] + a[29];
00625         a[17] += a[29];
00626         a[29] = xr * wp[-4 * 18 + 7];
00627 
00628         xr = SQRT2 * (a[2] - a[10]);
00629         a[2] += a[10];
00630         a[10] = xr;
00631         xr = SQRT2 * (a[3] - a[11]);
00632         a[3] += a[11];
00633         a[11] = xr;
00634         xr = SQRT2 * (-a[18] + a[26]);
00635         a[18] += a[26];
00636         a[26] = xr - a[18];
00637         xr = SQRT2 * (-a[19] + a[27]);
00638         a[19] += a[27];
00639         a[27] = xr - a[19];
00640 
00641         xr = a[2];
00642         a[19] -= a[3];
00643         a[3] -= xr;
00644         a[2] = a[31] - xr;
00645         a[31] += xr;
00646         xr = a[3];
00647         a[11] -= a[19];
00648         a[18] -= xr;
00649         a[3] = a[30] - xr;
00650         a[30] += xr;
00651         xr = a[18];
00652         a[27] -= a[11];
00653         a[19] -= xr;
00654         a[18] = a[15] - xr;
00655         a[15] += xr;
00656 
00657         xr = a[19];
00658         a[10] -= xr;
00659         a[19] = a[14] - xr;
00660         a[14] += xr;
00661         xr = a[10];
00662         a[11] -= xr;
00663         a[10] = a[23] - xr;
00664         a[23] += xr;
00665         xr = a[11];
00666         a[26] -= xr;
00667         a[11] = a[22] - xr;
00668         a[22] += xr;
00669         xr = a[26];
00670         a[27] -= xr;
00671         a[26] = a[7] - xr;
00672         a[7] += xr;
00673 
00674         xr = a[27];
00675         a[27] = a[6] - xr;
00676         a[6] += xr;
00677 
00678         xr = SQRT2 * (a[0] - a[4]);
00679         a[0] += a[4];
00680         a[4] = xr;
00681         xr = SQRT2 * (a[1] - a[5]);
00682         a[1] += a[5];
00683         a[5] = xr;
00684         xr = SQRT2 * (a[16] - a[20]);
00685         a[16] += a[20];
00686         a[20] = xr;
00687         xr = SQRT2 * (a[17] - a[21]);
00688         a[17] += a[21];
00689         a[21] = xr;
00690 
00691         xr = -SQRT2 * (a[8] - a[12]);
00692         a[8] += a[12];
00693         a[12] = xr - a[8];
00694         xr = -SQRT2 * (a[9] - a[13]);
00695         a[9] += a[13];
00696         a[13] = xr - a[9];
00697         xr = -SQRT2 * (a[25] - a[29]);
00698         a[25] += a[29];
00699         a[29] = xr - a[25];
00700         xr = -SQRT2 * (a[24] + a[28]);
00701         a[24] -= a[28];
00702         a[28] = xr - a[24];
00703 
00704         xr = a[24] - a[16];
00705         a[24] = xr;
00706         xr = a[20] - xr;
00707         a[20] = xr;
00708         xr = a[28] - xr;
00709         a[28] = xr;
00710 
00711         xr = a[25] - a[17];
00712         a[25] = xr;
00713         xr = a[21] - xr;
00714         a[21] = xr;
00715         xr = a[29] - xr;
00716         a[29] = xr;
00717 
00718         xr = a[17] - a[1];
00719         a[17] = xr;
00720         xr = a[9] - xr;
00721         a[9] = xr;
00722         xr = a[25] - xr;
00723         a[25] = xr;
00724         xr = a[5] - xr;
00725         a[5] = xr;
00726         xr = a[21] - xr;
00727         a[21] = xr;
00728         xr = a[13] - xr;
00729         a[13] = xr;
00730         xr = a[29] - xr;
00731         a[29] = xr;
00732 
00733         xr = a[1] - a[0];
00734         a[1] = xr;
00735         xr = a[16] - xr;
00736         a[16] = xr;
00737         xr = a[17] - xr;
00738         a[17] = xr;
00739         xr = a[8] - xr;
00740         a[8] = xr;
00741         xr = a[9] - xr;
00742         a[9] = xr;
00743         xr = a[24] - xr;
00744         a[24] = xr;
00745         xr = a[25] - xr;
00746         a[25] = xr;
00747         xr = a[4] - xr;
00748         a[4] = xr;
00749         xr = a[5] - xr;
00750         a[5] = xr;
00751         xr = a[20] - xr;
00752         a[20] = xr;
00753         xr = a[21] - xr;
00754         a[21] = xr;
00755         xr = a[12] - xr;
00756         a[12] = xr;
00757         xr = a[13] - xr;
00758         a[13] = xr;
00759         xr = a[28] - xr;
00760         a[28] = xr;
00761         xr = a[29] - xr;
00762         a[29] = xr;
00763 
00764         xr = a[0];
00765         a[0] += a[31];
00766         a[31] -= xr;
00767         xr = a[1];
00768         a[1] += a[30];
00769         a[30] -= xr;
00770         xr = a[16];
00771         a[16] += a[15];
00772         a[15] -= xr;
00773         xr = a[17];
00774         a[17] += a[14];
00775         a[14] -= xr;
00776         xr = a[8];
00777         a[8] += a[23];
00778         a[23] -= xr;
00779         xr = a[9];
00780         a[9] += a[22];
00781         a[22] -= xr;
00782         xr = a[24];
00783         a[24] += a[7];
00784         a[7] -= xr;
00785         xr = a[25];
00786         a[25] += a[6];
00787         a[6] -= xr;
00788         xr = a[4];
00789         a[4] += a[27];
00790         a[27] -= xr;
00791         xr = a[5];
00792         a[5] += a[26];
00793         a[26] -= xr;
00794         xr = a[20];
00795         a[20] += a[11];
00796         a[11] -= xr;
00797         xr = a[21];
00798         a[21] += a[10];
00799         a[10] -= xr;
00800         xr = a[12];
00801         a[12] += a[19];
00802         a[19] -= xr;
00803         xr = a[13];
00804         a[13] += a[18];
00805         a[18] -= xr;
00806         xr = a[28];
00807         a[28] += a[3];
00808         a[3] -= xr;
00809         xr = a[29];
00810         a[29] += a[2];
00811         a[2] -= xr;
00812     }
00813 
00814 }
00815 
00816 
00817 /*-------------------------------------------------------------------*/
00818 /*                                                                   */
00819 /*   Function: Calculation of the MDCT                               */
00820 /*   In the case of long blocks (type 0,1,3) there are               */
00821 /*   36 coefficents in the time domain and 18 in the frequency       */
00822 /*   domain.                                                         */
00823 /*   In the case of short blocks (type 2) there are 3                */
00824 /*   transformations with short length. This leads to 12 coefficents */
00825 /*   in the time and 6 in the frequency domain. In this case the     */
00826 /*   results are stored side by side in the vector out[].            */
00827 /*                                                                   */
00828 /*   New layer3                                                      */
00829 /*                                                                   */
00830 /*-------------------------------------------------------------------*/
00831 
00832 inline static void
00833 mdct_short(FLOAT * inout)
00834 {
00835     int     l;
00836     for (l = 0; l < 3; l++) {
00837         FLOAT   tc0, tc1, tc2, ts0, ts1, ts2;
00838 
00839         ts0 = inout[2 * 3] * win[SHORT_TYPE][0] - inout[5 * 3];
00840         tc0 = inout[0 * 3] * win[SHORT_TYPE][2] - inout[3 * 3];
00841         tc1 = ts0 + tc0;
00842         tc2 = ts0 - tc0;
00843 
00844         ts0 = inout[5 * 3] * win[SHORT_TYPE][0] + inout[2 * 3];
00845         tc0 = inout[3 * 3] * win[SHORT_TYPE][2] + inout[0 * 3];
00846         ts1 = ts0 + tc0;
00847         ts2 = -ts0 + tc0;
00848 
00849         tc0 = (inout[1 * 3] * win[SHORT_TYPE][1] - inout[4 * 3]) * 2.069978111953089e-11; /* tritab_s[1] */
00850         ts0 = (inout[4 * 3] * win[SHORT_TYPE][1] + inout[1 * 3]) * 2.069978111953089e-11; /* tritab_s[1] */
00851 
00852         inout[3 * 0] = tc1 * 1.907525191737280e-11 /* tritab_s[2] */  + tc0;
00853         inout[3 * 5] = -ts1 * 1.907525191737280e-11 /* tritab_s[0] */  + ts0;
00854 
00855         tc2 = tc2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[2] */ ;
00856         ts1 = ts1 * 0.5 * 1.907525191737281e-11 + ts0;
00857         inout[3 * 1] = tc2 - ts1;
00858         inout[3 * 2] = tc2 + ts1;
00859 
00860         tc1 = tc1 * 0.5 * 1.907525191737281e-11 - tc0;
00861         ts2 = ts2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[0] */ ;
00862         inout[3 * 3] = tc1 + ts2;
00863         inout[3 * 4] = tc1 - ts2;
00864 
00865         inout++;
00866     }
00867 }
00868 
00869 inline static void
00870 mdct_long(FLOAT * out, FLOAT const *in)
00871 {
00872     FLOAT   ct, st;
00873     {
00874         FLOAT   tc1, tc2, tc3, tc4, ts5, ts6, ts7, ts8;
00875         /* 1,2, 5,6, 9,10, 13,14, 17 */
00876         tc1 = in[17] - in[9];
00877         tc3 = in[15] - in[11];
00878         tc4 = in[14] - in[12];
00879         ts5 = in[0] + in[8];
00880         ts6 = in[1] + in[7];
00881         ts7 = in[2] + in[6];
00882         ts8 = in[3] + in[5];
00883 
00884         out[17] = (ts5 + ts7 - ts8) - (ts6 - in[4]);
00885         st = (ts5 + ts7 - ts8) * cx[7] + (ts6 - in[4]);
00886         ct = (tc1 - tc3 - tc4) * cx[6];
00887         out[5] = ct + st;
00888         out[6] = ct - st;
00889 
00890         tc2 = (in[16] - in[10]) * cx[6];
00891         ts6 = ts6 * cx[7] + in[4];
00892         ct = tc1 * cx[0] + tc2 + tc3 * cx[1] + tc4 * cx[2];
00893         st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3];
00894         out[1] = ct + st;
00895         out[2] = ct - st;
00896 
00897         ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0];
00898         st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4];
00899         out[9] = ct + st;
00900         out[10] = ct - st;
00901 
00902         ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1];
00903         st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5];
00904         out[13] = ct + st;
00905         out[14] = ct - st;
00906     }
00907     {
00908         FLOAT   ts1, ts2, ts3, ts4, tc5, tc6, tc7, tc8;
00909 
00910         ts1 = in[8] - in[0];
00911         ts3 = in[6] - in[2];
00912         ts4 = in[5] - in[3];
00913         tc5 = in[17] + in[9];
00914         tc6 = in[16] + in[10];
00915         tc7 = in[15] + in[11];
00916         tc8 = in[14] + in[12];
00917 
00918         out[0] = (tc5 + tc7 + tc8) + (tc6 + in[13]);
00919         ct = (tc5 + tc7 + tc8) * cx[7] - (tc6 + in[13]);
00920         st = (ts1 - ts3 + ts4) * cx[6];
00921         out[11] = ct + st;
00922         out[12] = ct - st;
00923 
00924         ts2 = (in[7] - in[1]) * cx[6];
00925         tc6 = in[13] - tc6 * cx[7];
00926         ct = tc5 * cx[3] - tc6 + tc7 * cx[4] + tc8 * cx[5];
00927         st = ts1 * cx[2] + ts2 + ts3 * cx[0] + ts4 * cx[1];
00928         out[3] = ct + st;
00929         out[4] = ct - st;
00930 
00931         ct = -tc5 * cx[5] + tc6 - tc7 * cx[3] - tc8 * cx[4];
00932         st = ts1 * cx[1] + ts2 - ts3 * cx[2] - ts4 * cx[0];
00933         out[7] = ct + st;
00934         out[8] = ct - st;
00935 
00936         ct = -tc5 * cx[4] + tc6 - tc7 * cx[5] - tc8 * cx[3];
00937         st = ts1 * cx[0] - ts2 + ts3 * cx[1] - ts4 * cx[2];
00938         out[15] = ct + st;
00939         out[16] = ct - st;
00940     }
00941 }
00942 
00943 
00944 void
00945 mdct_sub48(lame_internal_flags * gfc, const sample_t * w0, const sample_t * w1)
00946 {
00947     int     gr, k, ch;
00948     const sample_t *wk;
00949 
00950     wk = w0 + 286;
00951     /* thinking cache performance, ch->gr loop is better than gr->ch loop */
00952     for (ch = 0; ch < gfc->channels_out; ch++) {
00953         for (gr = 0; gr < gfc->mode_gr; gr++) {
00954             int     band;
00955             gr_info *const gi = &(gfc->l3_side.tt[gr][ch]);
00956             FLOAT  *mdct_enc = gi->xr;
00957             FLOAT  *samp = gfc->sb_sample[ch][1 - gr][0];
00958 
00959             for (k = 0; k < 18 / 2; k++) {
00960                 window_subband(wk, samp);
00961                 window_subband(wk + 32, samp + 32);
00962                 samp += 64;
00963                 wk += 64;
00964                 /*
00965                  * Compensate for inversion in the analysis filter
00966                  */
00967                 for (band = 1; band < 32; band += 2) {
00968                     samp[band - 32] *= -1;
00969                 }
00970             }
00971 
00972             /*
00973              * Perform imdct of 18 previous subband samples
00974              * + 18 current subband samples
00975              */
00976             for (band = 0; band < 32; band++, mdct_enc += 18) {
00977                 int     type = gi->block_type;
00978                 FLOAT const *const band0 = gfc->sb_sample[ch][gr][0] + order[band];
00979                 FLOAT  *const band1 = gfc->sb_sample[ch][1 - gr][0] + order[band];
00980                 if (gi->mixed_block_flag && band < 2)
00981                     type = 0;
00982                 if (gfc->amp_filter[band] == 0.0) {
00983                     memset(mdct_enc, 0, 18 * sizeof(FLOAT));
00984                 }
00985                 else {
00986                     if (gfc->amp_filter[band] != 1.0) {
00987                         for (k = 0; k < 18; k++)
00988                             band1[k * 32] *= gfc->amp_filter[band];
00989                     }
00990                     if (type == SHORT_TYPE) {
00991                         for (k = -NS / 4; k < 0; k++) {
00992                             FLOAT const w = win[SHORT_TYPE][k + 3];
00993                             mdct_enc[k * 3 + 9] = band0[(9 + k) * 32] * w - band0[(8 - k) * 32];
00994                             mdct_enc[k * 3 + 18] = band0[(14 - k) * 32] * w + band0[(15 + k) * 32];
00995                             mdct_enc[k * 3 + 10] = band0[(15 + k) * 32] * w - band0[(14 - k) * 32];
00996                             mdct_enc[k * 3 + 19] = band1[(2 - k) * 32] * w + band1[(3 + k) * 32];
00997                             mdct_enc[k * 3 + 11] = band1[(3 + k) * 32] * w - band1[(2 - k) * 32];
00998                             mdct_enc[k * 3 + 20] = band1[(8 - k) * 32] * w + band1[(9 + k) * 32];
00999                         }
01000                         mdct_short(mdct_enc);
01001                     }
01002                     else {
01003                         FLOAT   work[18];
01004                         for (k = -NL / 4; k < 0; k++) {
01005                             FLOAT   a, b;
01006                             a = win[type][k + 27] * band1[(k + 9) * 32]
01007                                 + win[type][k + 36] * band1[(8 - k) * 32];
01008                             b = win[type][k + 9] * band0[(k + 9) * 32]
01009                                 - win[type][k + 18] * band0[(8 - k) * 32];
01010                             work[k + 9] = a - b * tantab_l[k + 9];
01011                             work[k + 18] = a * tantab_l[k + 9] + b;
01012                         }
01013 
01014                         mdct_long(mdct_enc, work);
01015                     }
01016                 }
01017                 /*
01018                  * Perform aliasing reduction butterfly
01019                  */
01020                 if (type != SHORT_TYPE && band != 0) {
01021                     for (k = 7; k >= 0; --k) {
01022                         FLOAT   bu, bd;
01023                         bu = mdct_enc[k] * ca[k] + mdct_enc[-1 - k] * cs[k];
01024                         bd = mdct_enc[k] * cs[k] - mdct_enc[-1 - k] * ca[k];
01025 
01026                         mdct_enc[-1 - k] = bu;
01027                         mdct_enc[k] = bd;
01028                     }
01029                 }
01030             }
01031         }
01032         wk = w1 + 286;
01033         if (gfc->mode_gr == 1) {
01034             memcpy(gfc->sb_sample[ch][0], gfc->sb_sample[ch][1], 576 * sizeof(FLOAT));
01035         }
01036     }
01037 }

Generated on Sun Dec 2 11:34:19 2007 for LAME by  doxygen 1.5.2