sbr_dct.c

00001 /*
00002 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
00003 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
00004 **  
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 ** 
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 ** 
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software 
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 **
00019 ** Any non-GPL usage of this software or parts of this software is strictly
00020 ** forbidden.
00021 **
00022 ** Software using this code must display the following message visibly in the
00023 ** software:
00024 ** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com"
00025 ** in, for example, the about-box or help/startup screen.
00026 **
00027 ** Commercial non-GPL licensing of this software is possible.
00028 ** For more info contact Ahead Software through [email protected].
00029 **
00030 ** $Id: sbr_dct.c,v 1.2 2005/11/01 21:41:43 gabest Exp $
00031 **/
00032 
00033 #include "common.h"
00034 
00035 #ifdef SBR_DEC
00036 
00037 #ifdef _MSC_VER
00038 #pragma warning(disable:4305)
00039 #pragma warning(disable:4244)
00040 #endif
00041 
00042 
00043 #include "sbr_dct.h"
00044 
00045 void DCT4_32(real_t *y, real_t *x)
00046 {
00047     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
00048     real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
00049     real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
00050     real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
00051     real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
00052     real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
00053     real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
00054     real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
00055     real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
00056     real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
00057     real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
00058     real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
00059     real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
00060     real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
00061     real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
00062     real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
00063     real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
00064     real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
00065     real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
00066     real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
00067     real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
00068     real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
00069     real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
00070     real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
00071     real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
00072     real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
00073     real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
00074     real_t f271, f272, f273, f274, f275, f276, f277, f278, f279, f280;
00075     real_t f281, f282, f283, f284, f285, f286, f287, f288, f289, f290;
00076     real_t f291, f292, f293, f294, f295, f296, f297, f298, f299, f300;
00077     real_t f301, f302, f303, f304, f305, f306, f307, f310, f311, f312;
00078     real_t f313, f316, f317, f318, f319, f322, f323, f324, f325, f328;
00079     real_t f329, f330, f331, f334, f335, f336, f337, f340, f341, f342;
00080     real_t f343, f346, f347, f348, f349, f352, f353, f354, f355, f358;
00081     real_t f359, f360, f361, f364, f365, f366, f367, f370, f371, f372;
00082     real_t f373, f376, f377, f378, f379, f382, f383, f384, f385, f388;
00083     real_t f389, f390, f391, f394, f395, f396, f397;
00084 
00085     f0 = x[15] - x[16];
00086     f1 = x[15] + x[16];
00087     f2 = MUL_F(FRAC_CONST(0.7071067811865476), f1);
00088     f3 = MUL_F(FRAC_CONST(0.7071067811865476), f0);
00089     f4 = x[8] - x[23];
00090     f5 = x[8] + x[23];
00091     f6 = MUL_F(FRAC_CONST(0.7071067811865476), f5);
00092     f7 = MUL_F(FRAC_CONST(0.7071067811865476), f4);
00093     f8 = x[12] - x[19];
00094     f9 = x[12] + x[19];
00095     f10 = MUL_F(FRAC_CONST(0.7071067811865476), f9);
00096     f11 = MUL_F(FRAC_CONST(0.7071067811865476), f8);
00097     f12 = x[11] - x[20];
00098     f13 = x[11] + x[20];
00099     f14 = MUL_F(FRAC_CONST(0.7071067811865476), f13);
00100     f15 = MUL_F(FRAC_CONST(0.7071067811865476), f12);
00101     f16 = x[14] - x[17];
00102     f17 = x[14] + x[17];
00103     f18 = MUL_F(FRAC_CONST(0.7071067811865476), f17);
00104     f19 = MUL_F(FRAC_CONST(0.7071067811865476), f16);
00105     f20 = x[9] - x[22];
00106     f21 = x[9] + x[22];
00107     f22 = MUL_F(FRAC_CONST(0.7071067811865476), f21);
00108     f23 = MUL_F(FRAC_CONST(0.7071067811865476), f20);
00109     f24 = x[13] - x[18];
00110     f25 = x[13] + x[18];
00111     f26 = MUL_F(FRAC_CONST(0.7071067811865476), f25);
00112     f27 = MUL_F(FRAC_CONST(0.7071067811865476), f24);
00113     f28 = x[10] - x[21];
00114     f29 = x[10] + x[21];
00115     f30 = MUL_F(FRAC_CONST(0.7071067811865476), f29);
00116     f31 = MUL_F(FRAC_CONST(0.7071067811865476), f28);
00117     f32 = x[0] - f2;
00118     f33 = x[0] + f2;
00119     f34 = x[31] - f3;
00120     f35 = x[31] + f3;
00121     f36 = x[7] - f6;
00122     f37 = x[7] + f6;
00123     f38 = x[24] - f7;
00124     f39 = x[24] + f7;
00125     f40 = x[3] - f10;
00126     f41 = x[3] + f10;
00127     f42 = x[28] - f11;
00128     f43 = x[28] + f11;
00129     f44 = x[4] - f14;
00130     f45 = x[4] + f14;
00131     f46 = x[27] - f15;
00132     f47 = x[27] + f15;
00133     f48 = x[1] - f18;
00134     f49 = x[1] + f18;
00135     f50 = x[30] - f19;
00136     f51 = x[30] + f19;
00137     f52 = x[6] - f22;
00138     f53 = x[6] + f22;
00139     f54 = x[25] - f23;
00140     f55 = x[25] + f23;
00141     f56 = x[2] - f26;
00142     f57 = x[2] + f26;
00143     f58 = x[29] - f27;
00144     f59 = x[29] + f27;
00145     f60 = x[5] - f30;
00146     f61 = x[5] + f30;
00147     f62 = x[26] - f31;
00148     f63 = x[26] + f31;
00149     f64 = f39 + f37;
00150     f65 = MUL_F(FRAC_CONST(-0.5411961001461969), f39);
00151     f66 = MUL_F(FRAC_CONST(0.9238795325112867), f64);
00152     f67 = MUL_C(COEF_CONST(1.3065629648763766), f37);
00153     f68 = f65 + f66;
00154     f69 = f67 - f66;
00155     f70 = f38 + f36;
00156     f71 = MUL_C(COEF_CONST(1.3065629648763770), f38);
00157     f72 = MUL_F(FRAC_CONST(-0.3826834323650904), f70);
00158     f73 = MUL_F(FRAC_CONST(0.5411961001461961), f36);
00159     f74 = f71 + f72;
00160     f75 = f73 - f72;
00161     f76 = f47 + f45;
00162     f77 = MUL_F(FRAC_CONST(-0.5411961001461969), f47);
00163     f78 = MUL_F(FRAC_CONST(0.9238795325112867), f76);
00164     f79 = MUL_C(COEF_CONST(1.3065629648763766), f45);
00165     f80 = f77 + f78;
00166     f81 = f79 - f78;
00167     f82 = f46 + f44;
00168     f83 = MUL_C(COEF_CONST(1.3065629648763770), f46);
00169     f84 = MUL_F(FRAC_CONST(-0.3826834323650904), f82);
00170     f85 = MUL_F(FRAC_CONST(0.5411961001461961), f44);
00171     f86 = f83 + f84;
00172     f87 = f85 - f84;
00173     f88 = f55 + f53;
00174     f89 = MUL_F(FRAC_CONST(-0.5411961001461969), f55);
00175     f90 = MUL_F(FRAC_CONST(0.9238795325112867), f88);
00176     f91 = MUL_C(COEF_CONST(1.3065629648763766), f53);
00177     f92 = f89 + f90;
00178     f93 = f91 - f90;
00179     f94 = f54 + f52;
00180     f95 = MUL_C(COEF_CONST(1.3065629648763770), f54);
00181     f96 = MUL_F(FRAC_CONST(-0.3826834323650904), f94);
00182     f97 = MUL_F(FRAC_CONST(0.5411961001461961), f52);
00183     f98 = f95 + f96;
00184     f99 = f97 - f96;
00185     f100 = f63 + f61;
00186     f101 = MUL_F(FRAC_CONST(-0.5411961001461969), f63);
00187     f102 = MUL_F(FRAC_CONST(0.9238795325112867), f100);
00188     f103 = MUL_C(COEF_CONST(1.3065629648763766), f61);
00189     f104 = f101 + f102;
00190     f105 = f103 - f102;
00191     f106 = f62 + f60;
00192     f107 = MUL_C(COEF_CONST(1.3065629648763770), f62);
00193     f108 = MUL_F(FRAC_CONST(-0.3826834323650904), f106);
00194     f109 = MUL_F(FRAC_CONST(0.5411961001461961), f60);
00195     f110 = f107 + f108;
00196     f111 = f109 - f108;
00197     f112 = f33 - f68;
00198     f113 = f33 + f68;
00199     f114 = f35 - f69;
00200     f115 = f35 + f69;
00201     f116 = f32 - f74;
00202     f117 = f32 + f74;
00203     f118 = f34 - f75;
00204     f119 = f34 + f75;
00205     f120 = f41 - f80;
00206     f121 = f41 + f80;
00207     f122 = f43 - f81;
00208     f123 = f43 + f81;
00209     f124 = f40 - f86;
00210     f125 = f40 + f86;
00211     f126 = f42 - f87;
00212     f127 = f42 + f87;
00213     f128 = f49 - f92;
00214     f129 = f49 + f92;
00215     f130 = f51 - f93;
00216     f131 = f51 + f93;
00217     f132 = f48 - f98;
00218     f133 = f48 + f98;
00219     f134 = f50 - f99;
00220     f135 = f50 + f99;
00221     f136 = f57 - f104;
00222     f137 = f57 + f104;
00223     f138 = f59 - f105;
00224     f139 = f59 + f105;
00225     f140 = f56 - f110;
00226     f141 = f56 + f110;
00227     f142 = f58 - f111;
00228     f143 = f58 + f111;
00229     f144 = f123 + f121;
00230     f145 = MUL_F(FRAC_CONST(-0.7856949583871021), f123);
00231     f146 = MUL_F(FRAC_CONST(0.9807852804032304), f144);
00232     f147 = MUL_C(COEF_CONST(1.1758756024193588), f121);
00233     f148 = f145 + f146;
00234     f149 = f147 - f146;
00235     f150 = f127 + f125;
00236     f151 = MUL_F(FRAC_CONST(0.2758993792829431), f127);
00237     f152 = MUL_F(FRAC_CONST(0.5555702330196022), f150);
00238     f153 = MUL_C(COEF_CONST(1.3870398453221475), f125);
00239     f154 = f151 + f152;
00240     f155 = f153 - f152;
00241     f156 = f122 + f120;
00242     f157 = MUL_C(COEF_CONST(1.1758756024193591), f122);
00243     f158 = MUL_F(FRAC_CONST(-0.1950903220161287), f156);
00244     f159 = MUL_F(FRAC_CONST(0.7856949583871016), f120);
00245     f160 = f157 + f158;
00246     f161 = f159 - f158;
00247     f162 = f126 + f124;
00248     f163 = MUL_C(COEF_CONST(1.3870398453221473), f126);
00249     f164 = MUL_F(FRAC_CONST(-0.8314696123025455), f162);
00250     f165 = MUL_F(FRAC_CONST(-0.2758993792829436), f124);
00251     f166 = f163 + f164;
00252     f167 = f165 - f164;
00253     f168 = f139 + f137;
00254     f169 = MUL_F(FRAC_CONST(-0.7856949583871021), f139);
00255     f170 = MUL_F(FRAC_CONST(0.9807852804032304), f168);
00256     f171 = MUL_C(COEF_CONST(1.1758756024193588), f137);
00257     f172 = f169 + f170;
00258     f173 = f171 - f170;
00259     f174 = f143 + f141;
00260     f175 = MUL_F(FRAC_CONST(0.2758993792829431), f143);
00261     f176 = MUL_F(FRAC_CONST(0.5555702330196022), f174);
00262     f177 = MUL_C(COEF_CONST(1.3870398453221475), f141);
00263     f178 = f175 + f176;
00264     f179 = f177 - f176;
00265     f180 = f138 + f136;
00266     f181 = MUL_C(COEF_CONST(1.1758756024193591), f138);
00267     f182 = MUL_F(FRAC_CONST(-0.1950903220161287), f180);
00268     f183 = MUL_F(FRAC_CONST(0.7856949583871016), f136);
00269     f184 = f181 + f182;
00270     f185 = f183 - f182;
00271     f186 = f142 + f140;
00272     f187 = MUL_C(COEF_CONST(1.3870398453221473), f142);
00273     f188 = MUL_F(FRAC_CONST(-0.8314696123025455), f186);
00274     f189 = MUL_F(FRAC_CONST(-0.2758993792829436), f140);
00275     f190 = f187 + f188;
00276     f191 = f189 - f188;
00277     f192 = f113 - f148;
00278     f193 = f113 + f148;
00279     f194 = f115 - f149;
00280     f195 = f115 + f149;
00281     f196 = f117 - f154;
00282     f197 = f117 + f154;
00283     f198 = f119 - f155;
00284     f199 = f119 + f155;
00285     f200 = f112 - f160;
00286     f201 = f112 + f160;
00287     f202 = f114 - f161;
00288     f203 = f114 + f161;
00289     f204 = f116 - f166;
00290     f205 = f116 + f166;
00291     f206 = f118 - f167;
00292     f207 = f118 + f167;
00293     f208 = f129 - f172;
00294     f209 = f129 + f172;
00295     f210 = f131 - f173;
00296     f211 = f131 + f173;
00297     f212 = f133 - f178;
00298     f213 = f133 + f178;
00299     f214 = f135 - f179;
00300     f215 = f135 + f179;
00301     f216 = f128 - f184;
00302     f217 = f128 + f184;
00303     f218 = f130 - f185;
00304     f219 = f130 + f185;
00305     f220 = f132 - f190;
00306     f221 = f132 + f190;
00307     f222 = f134 - f191;
00308     f223 = f134 + f191;
00309     f224 = f211 + f209;
00310     f225 = MUL_F(FRAC_CONST(-0.8971675863426361), f211);
00311     f226 = MUL_F(FRAC_CONST(0.9951847266721968), f224);
00312     f227 = MUL_C(COEF_CONST(1.0932018670017576), f209);
00313     f228 = f225 + f226;
00314     f229 = f227 - f226;
00315     f230 = f215 + f213;
00316     f231 = MUL_F(FRAC_CONST(-0.4105245275223571), f215);
00317     f232 = MUL_F(FRAC_CONST(0.8819212643483549), f230);
00318     f233 = MUL_C(COEF_CONST(1.3533180011743529), f213);
00319     f234 = f231 + f232;
00320     f235 = f233 - f232;
00321     f236 = f219 + f217;
00322     f237 = MUL_F(FRAC_CONST(0.1386171691990915), f219);
00323     f238 = MUL_F(FRAC_CONST(0.6343932841636455), f236);
00324     f239 = MUL_C(COEF_CONST(1.4074037375263826), f217);
00325     f240 = f237 + f238;
00326     f241 = f239 - f238;
00327     f242 = f223 + f221;
00328     f243 = MUL_F(FRAC_CONST(0.6666556584777466), f223);
00329     f244 = MUL_F(FRAC_CONST(0.2902846772544623), f242);
00330     f245 = MUL_C(COEF_CONST(1.2472250129866711), f221);
00331     f246 = f243 + f244;
00332     f247 = f245 - f244;
00333     f248 = f210 + f208;
00334     f249 = MUL_C(COEF_CONST(1.0932018670017574), f210);
00335     f250 = MUL_F(FRAC_CONST(-0.0980171403295605), f248);
00336     f251 = MUL_F(FRAC_CONST(0.8971675863426364), f208);
00337     f252 = f249 + f250;
00338     f253 = f251 - f250;
00339     f254 = f214 + f212;
00340     f255 = MUL_C(COEF_CONST(1.3533180011743529), f214);
00341     f256 = MUL_F(FRAC_CONST(-0.4713967368259979), f254);
00342     f257 = MUL_F(FRAC_CONST(0.4105245275223569), f212);
00343     f258 = f255 + f256;
00344     f259 = f257 - f256;
00345     f260 = f218 + f216;
00346     f261 = MUL_C(COEF_CONST(1.4074037375263826), f218);
00347     f262 = MUL_F(FRAC_CONST(-0.7730104533627369), f260);
00348     f263 = MUL_F(FRAC_CONST(-0.1386171691990913), f216);
00349     f264 = f261 + f262;
00350     f265 = f263 - f262;
00351     f266 = f222 + f220;
00352     f267 = MUL_C(COEF_CONST(1.2472250129866711), f222);
00353     f268 = MUL_F(FRAC_CONST(-0.9569403357322089), f266);
00354     f269 = MUL_F(FRAC_CONST(-0.6666556584777469), f220);
00355     f270 = f267 + f268;
00356     f271 = f269 - f268;
00357     f272 = f193 - f228;
00358     f273 = f193 + f228;
00359     f274 = f195 - f229;
00360     f275 = f195 + f229;
00361     f276 = f197 - f234;
00362     f277 = f197 + f234;
00363     f278 = f199 - f235;
00364     f279 = f199 + f235;
00365     f280 = f201 - f240;
00366     f281 = f201 + f240;
00367     f282 = f203 - f241;
00368     f283 = f203 + f241;
00369     f284 = f205 - f246;
00370     f285 = f205 + f246;
00371     f286 = f207 - f247;
00372     f287 = f207 + f247;
00373     f288 = f192 - f252;
00374     f289 = f192 + f252;
00375     f290 = f194 - f253;
00376     f291 = f194 + f253;
00377     f292 = f196 - f258;
00378     f293 = f196 + f258;
00379     f294 = f198 - f259;
00380     f295 = f198 + f259;
00381     f296 = f200 - f264;
00382     f297 = f200 + f264;
00383     f298 = f202 - f265;
00384     f299 = f202 + f265;
00385     f300 = f204 - f270;
00386     f301 = f204 + f270;
00387     f302 = f206 - f271;
00388     f303 = f206 + f271;
00389     f304 = f275 + f273;
00390     f305 = MUL_F(FRAC_CONST(-0.9751575901732920), f275);
00391     f306 = MUL_F(FRAC_CONST(0.9996988186962043), f304);
00392     f307 = MUL_C(COEF_CONST(1.0242400472191164), f273);
00393     y[0] = f305 + f306;
00394     y[31] = f307 - f306;
00395     f310 = f279 + f277;
00396     f311 = MUL_F(FRAC_CONST(-0.8700688593994936), f279);
00397     f312 = MUL_F(FRAC_CONST(0.9924795345987100), f310);
00398     f313 = MUL_C(COEF_CONST(1.1148902097979263), f277);
00399     y[2] = f311 + f312;
00400     y[29] = f313 - f312;
00401     f316 = f283 + f281;
00402     f317 = MUL_F(FRAC_CONST(-0.7566008898816587), f283);
00403     f318 = MUL_F(FRAC_CONST(0.9757021300385286), f316);
00404     f319 = MUL_C(COEF_CONST(1.1948033701953984), f281);
00405     y[4] = f317 + f318;
00406     y[27] = f319 - f318;
00407     f322 = f287 + f285;
00408     f323 = MUL_F(FRAC_CONST(-0.6358464401941451), f287);
00409     f324 = MUL_F(FRAC_CONST(0.9495281805930367), f322);
00410     f325 = MUL_C(COEF_CONST(1.2632099209919283), f285);
00411     y[6] = f323 + f324;
00412     y[25] = f325 - f324;
00413     f328 = f291 + f289;
00414     f329 = MUL_F(FRAC_CONST(-0.5089684416985408), f291);
00415     f330 = MUL_F(FRAC_CONST(0.9142097557035307), f328);
00416     f331 = MUL_C(COEF_CONST(1.3194510697085207), f289);
00417     y[8] = f329 + f330;
00418     y[23] = f331 - f330;
00419     f334 = f295 + f293;
00420     f335 = MUL_F(FRAC_CONST(-0.3771887988789273), f295);
00421     f336 = MUL_F(FRAC_CONST(0.8700869911087114), f334);
00422     f337 = MUL_C(COEF_CONST(1.3629851833384954), f293);
00423     y[10] = f335 + f336;
00424     y[21] = f337 - f336;
00425     f340 = f299 + f297;
00426     f341 = MUL_F(FRAC_CONST(-0.2417766217337384), f299);
00427     f342 = MUL_F(FRAC_CONST(0.8175848131515837), f340);
00428     f343 = MUL_C(COEF_CONST(1.3933930045694289), f297);
00429     y[12] = f341 + f342;
00430     y[19] = f343 - f342;
00431     f346 = f303 + f301;
00432     f347 = MUL_F(FRAC_CONST(-0.1040360035527077), f303);
00433     f348 = MUL_F(FRAC_CONST(0.7572088465064845), f346);
00434     f349 = MUL_C(COEF_CONST(1.4103816894602612), f301);
00435     y[14] = f347 + f348;
00436     y[17] = f349 - f348;
00437     f352 = f274 + f272;
00438     f353 = MUL_F(FRAC_CONST(0.0347065382144002), f274);
00439     f354 = MUL_F(FRAC_CONST(0.6895405447370668), f352);
00440     f355 = MUL_C(COEF_CONST(1.4137876276885337), f272);
00441     y[16] = f353 + f354;
00442     y[15] = f355 - f354;
00443     f358 = f278 + f276;
00444     f359 = MUL_F(FRAC_CONST(0.1731148370459795), f278);
00445     f360 = MUL_F(FRAC_CONST(0.6152315905806268), f358);
00446     f361 = MUL_C(COEF_CONST(1.4035780182072330), f276);
00447     y[18] = f359 + f360;
00448     y[13] = f361 - f360;
00449     f364 = f282 + f280;
00450     f365 = MUL_F(FRAC_CONST(0.3098559453626100), f282);
00451     f366 = MUL_F(FRAC_CONST(0.5349976198870972), f364);
00452     f367 = MUL_C(COEF_CONST(1.3798511851368043), f280);
00453     y[20] = f365 + f366;
00454     y[11] = f367 - f366;
00455     f370 = f286 + f284;
00456     f371 = MUL_F(FRAC_CONST(0.4436129715409088), f286);
00457     f372 = MUL_F(FRAC_CONST(0.4496113296546065), f370);
00458     f373 = MUL_C(COEF_CONST(1.3428356308501219), f284);
00459     y[22] = f371 + f372;
00460     y[9] = f373 - f372;
00461     f376 = f290 + f288;
00462     f377 = MUL_F(FRAC_CONST(0.5730977622997509), f290);
00463     f378 = MUL_F(FRAC_CONST(0.3598950365349881), f376);
00464     f379 = MUL_C(COEF_CONST(1.2928878353697271), f288);
00465     y[24] = f377 + f378;
00466     y[7] = f379 - f378;
00467     f382 = f294 + f292;
00468     f383 = MUL_F(FRAC_CONST(0.6970633083205415), f294);
00469     f384 = MUL_F(FRAC_CONST(0.2667127574748984), f382);
00470     f385 = MUL_C(COEF_CONST(1.2304888232703382), f292);
00471     y[26] = f383 + f384;
00472     y[5] = f385 - f384;
00473     f388 = f298 + f296;
00474     f389 = MUL_F(FRAC_CONST(0.8143157536286401), f298);
00475     f390 = MUL_F(FRAC_CONST(0.1709618887603012), f388);
00476     f391 = MUL_C(COEF_CONST(1.1562395311492424), f296);
00477     y[28] = f389 + f390;
00478     y[3] = f391 - f390;
00479     f394 = f302 + f300;
00480     f395 = MUL_F(FRAC_CONST(0.9237258930790228), f302);
00481     f396 = MUL_F(FRAC_CONST(0.0735645635996674), f394);
00482     f397 = MUL_C(COEF_CONST(1.0708550202783576), f300);
00483     y[30] = f395 + f396;
00484     y[1] = f397 - f396;
00485 }
00486 
00487 #ifdef SBR_LOW_POWER
00488 
00489 void DCT2_16_unscaled(real_t *y, real_t *x)
00490 {
00491     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
00492     real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
00493     real_t f21, f22, f23, f24, f25, f26, f27, f28, f31, f32;
00494     real_t f33, f34, f37, f38, f39, f40, f41, f42, f43, f44;
00495     real_t f45, f46, f47, f48, f49, f51, f53, f54, f57, f58;
00496     real_t f59, f60, f61, f62, f63, f64, f65, f66, f67, f68;
00497     real_t f69, f70, f71, f72, f73, f74, f75, f76, f77, f78;
00498     real_t f79, f80, f81, f82, f83, f84, f85, f86, f87, f88;
00499     real_t f89, f90, f91, f92, f95, f96, f97, f98, f101, f102;
00500     real_t f103, f104, f107, f108, f109, f110;
00501 
00502     f0 = x[0] - x[15];
00503     f1 = x[0] + x[15];
00504     f2 = x[1] - x[14];
00505     f3 = x[1] + x[14];
00506     f4 = x[2] - x[13];
00507     f5 = x[2] + x[13];
00508     f6 = x[3] - x[12];
00509     f7 = x[3] + x[12];
00510     f8 = x[4] - x[11];
00511     f9 = x[4] + x[11];
00512     f10 = x[5] - x[10];
00513     f11 = x[5] + x[10];
00514     f12 = x[6] - x[9];
00515     f13 = x[6] + x[9];
00516     f14 = x[7] - x[8];
00517     f15 = x[7] + x[8];
00518     f16 = f1 - f15;
00519     f17 = f1 + f15;
00520     f18 = f3 - f13;
00521     f19 = f3 + f13;
00522     f20 = f5 - f11;
00523     f21 = f5 + f11;
00524     f22 = f7 - f9;
00525     f23 = f7 + f9;
00526     f24 = f17 - f23;
00527     f25 = f17 + f23;
00528     f26 = f19 - f21;
00529     f27 = f19 + f21;
00530     f28 = f25 - f27;
00531     y[0] = f25 + f27;
00532     y[8] = MUL_F(f28, FRAC_CONST(0.7071067811865476));
00533     f31 = f24 + f26;
00534     f32 = MUL_C(f24, COEF_CONST(1.3065629648763766));
00535     f33 = MUL_F(f31, FRAC_CONST(-0.9238795325112866));
00536     f34 = MUL_F(f26, FRAC_CONST(-0.5411961001461967));
00537     y[12] = f32 + f33;
00538     y[4] = f34 - f33;
00539     f37 = f16 + f22;
00540     f38 = MUL_C(f16, COEF_CONST(1.1758756024193588));
00541     f39 = MUL_F(f37, FRAC_CONST(-0.9807852804032304));
00542     f40 = MUL_F(f22, FRAC_CONST(-0.7856949583871021));
00543     f41 = f38 + f39;
00544     f42 = f40 - f39;
00545     f43 = f18 + f20;
00546     f44 = MUL_C(f18, COEF_CONST(1.3870398453221473));
00547     f45 = MUL_F(f43, FRAC_CONST(-0.8314696123025455));
00548     f46 = MUL_F(f20, FRAC_CONST(-0.2758993792829436));
00549     f47 = f44 + f45;
00550     f48 = f46 - f45;
00551     f49 = f42 - f48;
00552     y[2] = f42 + f48;
00553     f51 = MUL_F(f49, FRAC_CONST(0.7071067811865476));
00554     y[14] = f41 - f47;
00555     f53 = f41 + f47;
00556     f54 = MUL_F(f53, FRAC_CONST(0.7071067811865476));
00557     y[10] = f51 - f54;
00558     y[6] = f51 + f54;
00559     f57 = f2 - f4;
00560     f58 = f2 + f4;
00561     f59 = f6 - f8;
00562     f60 = f6 + f8;
00563     f61 = f10 - f12;
00564     f62 = f10 + f12;
00565     f63 = MUL_F(f60, FRAC_CONST(0.7071067811865476));
00566     f64 = f0 - f63;
00567     f65 = f0 + f63;
00568     f66 = f58 + f62;
00569     f67 = MUL_C(f58, COEF_CONST(1.3065629648763766));
00570     f68 = MUL_F(f66, FRAC_CONST(-0.9238795325112866));
00571     f69 = MUL_F(f62, FRAC_CONST(-0.5411961001461967));
00572     f70 = f67 + f68;
00573     f71 = f69 - f68;
00574     f72 = f65 - f71;
00575     f73 = f65 + f71;
00576     f74 = f64 - f70;
00577     f75 = f64 + f70;
00578     f76 = MUL_F(f59, FRAC_CONST(0.7071067811865476));
00579     f77 = f14 - f76;
00580     f78 = f14 + f76;
00581     f79 = f61 + f57;
00582     f80 = MUL_C(f61, COEF_CONST(1.3065629648763766));
00583     f81 = MUL_F(f79, FRAC_CONST(-0.9238795325112866));
00584     f82 = MUL_F(f57, FRAC_CONST(-0.5411961001461967));
00585     f83 = f80 + f81;
00586     f84 = f82 - f81;
00587     f85 = f78 - f84;
00588     f86 = f78 + f84;
00589     f87 = f77 - f83;
00590     f88 = f77 + f83;
00591     f89 = f86 + f73;
00592     f90 = MUL_F(f86, FRAC_CONST(-0.8971675863426361));
00593     f91 = MUL_F(f89, FRAC_CONST(0.9951847266721968));
00594     f92 = MUL_C(f73, COEF_CONST(1.0932018670017576));
00595     y[1] = f90 + f91;
00596     y[15] = f92 - f91;
00597     f95 = f75 - f88;
00598     f96 = MUL_F(f88, FRAC_CONST(-0.6666556584777466));
00599     f97 = MUL_F(f95, FRAC_CONST(0.9569403357322089));
00600     f98 = MUL_C(f75, COEF_CONST(1.2472250129866713));
00601     y[3] = f97 - f96;
00602     y[13] = f98 - f97;
00603     f101 = f87 + f74;
00604     f102 = MUL_F(f87, FRAC_CONST(-0.4105245275223571));
00605     f103 = MUL_F(f101, FRAC_CONST(0.8819212643483549));
00606     f104 = MUL_C(f74, COEF_CONST(1.3533180011743529));
00607     y[5] = f102 + f103;
00608     y[11] = f104 - f103;
00609     f107 = f72 - f85;
00610     f108 = MUL_F(f85, FRAC_CONST(-0.1386171691990915));
00611     f109 = MUL_F(f107, FRAC_CONST(0.7730104533627370));
00612     f110 = MUL_C(f72, COEF_CONST(1.4074037375263826));
00613     y[7] = f109 - f108;
00614     y[9] = f110 - f109;
00615 }
00616 
00617 void DCT4_16(real_t *y, real_t *x)
00618 {
00619     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
00620     real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
00621     real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
00622     real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
00623     real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
00624     real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
00625     real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
00626     real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
00627     real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
00628     real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
00629     real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
00630     real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
00631     real_t f121, f122, f123, f124, f125, f126, f127, f128, f130, f132;
00632     real_t f134, f136, f138, f140, f142, f144, f145, f148, f149, f152;
00633     real_t f153, f156, f157;
00634 
00635     f0 = x[0] + x[15];
00636     f1 = MUL_C(COEF_CONST(1.0478631305325901), x[0]);
00637     f2 = MUL_F(FRAC_CONST(-0.9987954562051724), f0);
00638     f3 = MUL_F(FRAC_CONST(-0.9497277818777548), x[15]);
00639     f4 = f1 + f2;
00640     f5 = f3 - f2;
00641     f6 = x[2] + x[13];
00642     f7 = MUL_C(COEF_CONST(1.2130114330978077), x[2]);
00643     f8 = MUL_F(FRAC_CONST(-0.9700312531945440), f6);
00644     f9 = MUL_F(FRAC_CONST(-0.7270510732912803), x[13]);
00645     f10 = f7 + f8;
00646     f11 = f9 - f8;
00647     f12 = x[4] + x[11];
00648     f13 = MUL_C(COEF_CONST(1.3315443865537255), x[4]);
00649     f14 = MUL_F(FRAC_CONST(-0.9039892931234433), f12);
00650     f15 = MUL_F(FRAC_CONST(-0.4764341996931612), x[11]);
00651     f16 = f13 + f14;
00652     f17 = f15 - f14;
00653     f18 = x[6] + x[9];
00654     f19 = MUL_C(COEF_CONST(1.3989068359730781), x[6]);
00655     f20 = MUL_F(FRAC_CONST(-0.8032075314806453), f18);
00656     f21 = MUL_F(FRAC_CONST(-0.2075082269882124), x[9]);
00657     f22 = f19 + f20;
00658     f23 = f21 - f20;
00659     f24 = x[8] + x[7];
00660     f25 = MUL_C(COEF_CONST(1.4125100802019777), x[8]);
00661     f26 = MUL_F(FRAC_CONST(-0.6715589548470187), f24);
00662     f27 = MUL_F(FRAC_CONST(0.0693921705079402), x[7]);
00663     f28 = f25 + f26;
00664     f29 = f27 - f26;
00665     f30 = x[10] + x[5];
00666     f31 = MUL_C(COEF_CONST(1.3718313541934939), x[10]);
00667     f32 = MUL_F(FRAC_CONST(-0.5141027441932219), f30);
00668     f33 = MUL_F(FRAC_CONST(0.3436258658070501), x[5]);
00669     f34 = f31 + f32;
00670     f35 = f33 - f32;
00671     f36 = x[12] + x[3];
00672     f37 = MUL_C(COEF_CONST(1.2784339185752409), x[12]);
00673     f38 = MUL_F(FRAC_CONST(-0.3368898533922200), f36);
00674     f39 = MUL_F(FRAC_CONST(0.6046542117908008), x[3]);
00675     f40 = f37 + f38;
00676     f41 = f39 - f38;
00677     f42 = x[14] + x[1];
00678     f43 = MUL_C(COEF_CONST(1.1359069844201433), x[14]);
00679     f44 = MUL_F(FRAC_CONST(-0.1467304744553624), f42);
00680     f45 = MUL_F(FRAC_CONST(0.8424460355094185), x[1]);
00681     f46 = f43 + f44;
00682     f47 = f45 - f44;
00683     f48 = f5 - f29;
00684     f49 = f5 + f29;
00685     f50 = f4 - f28;
00686     f51 = f4 + f28;
00687     f52 = f11 - f35;
00688     f53 = f11 + f35;
00689     f54 = f10 - f34;
00690     f55 = f10 + f34;
00691     f56 = f17 - f41;
00692     f57 = f17 + f41;
00693     f58 = f16 - f40;
00694     f59 = f16 + f40;
00695     f60 = f23 - f47;
00696     f61 = f23 + f47;
00697     f62 = f22 - f46;
00698     f63 = f22 + f46;
00699     f64 = f48 + f50;
00700     f65 = MUL_C(COEF_CONST(1.1758756024193588), f48);
00701     f66 = MUL_F(FRAC_CONST(-0.9807852804032304), f64);
00702     f67 = MUL_F(FRAC_CONST(-0.7856949583871021), f50);
00703     f68 = f65 + f66;
00704     f69 = f67 - f66;
00705     f70 = f52 + f54;
00706     f71 = MUL_C(COEF_CONST(1.3870398453221475), f52);
00707     f72 = MUL_F(FRAC_CONST(-0.5555702330196022), f70);
00708     f73 = MUL_F(FRAC_CONST(0.2758993792829431), f54);
00709     f74 = f71 + f72;
00710     f75 = f73 - f72;
00711     f76 = f56 + f58;
00712     f77 = MUL_F(FRAC_CONST(0.7856949583871022), f56);
00713     f78 = MUL_F(FRAC_CONST(0.1950903220161283), f76);
00714     f79 = MUL_C(COEF_CONST(1.1758756024193586), f58);
00715     f80 = f77 + f78;
00716     f81 = f79 - f78;
00717     f82 = f60 + f62;
00718     f83 = MUL_F(FRAC_CONST(-0.2758993792829430), f60);
00719     f84 = MUL_F(FRAC_CONST(0.8314696123025452), f82);
00720     f85 = MUL_C(COEF_CONST(1.3870398453221475), f62);
00721     f86 = f83 + f84;
00722     f87 = f85 - f84;
00723     f88 = f49 - f57;
00724     f89 = f49 + f57;
00725     f90 = f51 - f59;
00726     f91 = f51 + f59;
00727     f92 = f53 - f61;
00728     f93 = f53 + f61;
00729     f94 = f55 - f63;
00730     f95 = f55 + f63;
00731     f96 = f69 - f81;
00732     f97 = f69 + f81;
00733     f98 = f68 - f80;
00734     f99 = f68 + f80;
00735     f100 = f75 - f87;
00736     f101 = f75 + f87;
00737     f102 = f74 - f86;
00738     f103 = f74 + f86;
00739     f104 = f88 + f90;
00740     f105 = MUL_C(COEF_CONST(1.3065629648763766), f88);
00741     f106 = MUL_F(FRAC_CONST(-0.9238795325112866), f104);
00742     f107 = MUL_F(FRAC_CONST(-0.5411961001461967), f90);
00743     f108 = f105 + f106;
00744     f109 = f107 - f106;
00745     f110 = f92 + f94;
00746     f111 = MUL_F(FRAC_CONST(0.5411961001461969), f92);
00747     f112 = MUL_F(FRAC_CONST(0.3826834323650898), f110);
00748     f113 = MUL_C(COEF_CONST(1.3065629648763766), f94);
00749     f114 = f111 + f112;
00750     f115 = f113 - f112;
00751     f116 = f96 + f98;
00752     f117 = MUL_C(COEF_CONST(1.3065629648763766), f96);
00753     f118 = MUL_F(FRAC_CONST(-0.9238795325112866), f116);
00754     f119 = MUL_F(FRAC_CONST(-0.5411961001461967), f98);
00755     f120 = f117 + f118;
00756     f121 = f119 - f118;
00757     f122 = f100 + f102;
00758     f123 = MUL_F(FRAC_CONST(0.5411961001461969), f100);
00759     f124 = MUL_F(FRAC_CONST(0.3826834323650898), f122);
00760     f125 = MUL_C(COEF_CONST(1.3065629648763766), f102);
00761     f126 = f123 + f124;
00762     f127 = f125 - f124;
00763     f128 = f89 - f93;
00764     y[0] = f89 + f93;
00765     f130 = f91 - f95;
00766     y[15] = f91 + f95;
00767     f132 = f109 - f115;
00768     y[3] = f109 + f115;
00769     f134 = f108 - f114;
00770     y[12] = f108 + f114;
00771     f136 = f97 - f101;
00772     y[1] = f97 + f101;
00773     f138 = f99 - f103;
00774     y[14] = f99 + f103;
00775     f140 = f121 - f127;
00776     y[2] = f121 + f127;
00777     f142 = f120 - f126;
00778     y[13] = f120 + f126;
00779     f144 = f128 - f130;
00780     f145 = f128 + f130;
00781     y[8] = MUL_F(FRAC_CONST(0.7071067811865474), f144);
00782     y[7] = MUL_F(FRAC_CONST(0.7071067811865474), f145);
00783     f148 = f132 - f134;
00784     f149 = f132 + f134;
00785     y[11] = MUL_F(FRAC_CONST(0.7071067811865474), f148);
00786     y[4] = MUL_F(FRAC_CONST(0.7071067811865474), f149);
00787     f152 = f136 - f138;
00788     f153 = f136 + f138;
00789     y[9] = MUL_F(FRAC_CONST(0.7071067811865474), f152);
00790     y[6] = MUL_F(FRAC_CONST(0.7071067811865474), f153);
00791     f156 = f140 - f142;
00792     f157 = f140 + f142;
00793     y[10] = MUL_F(FRAC_CONST(0.7071067811865474), f156);
00794     y[5] = MUL_F(FRAC_CONST(0.7071067811865474), f157);
00795 }
00796 
00797 void DCT3_32_unscaled(real_t *y, real_t *x)
00798 {
00799     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
00800     real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
00801     real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
00802     real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
00803     real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
00804     real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
00805     real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
00806     real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
00807     real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
00808     real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
00809     real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
00810     real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
00811     real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
00812     real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
00813     real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
00814     real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
00815     real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
00816     real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
00817     real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
00818     real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
00819     real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
00820     real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
00821     real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
00822     real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
00823     real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
00824     real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
00825     real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
00826     real_t f271, f272;
00827 
00828     f0 = MUL_F(x[16], FRAC_CONST(0.7071067811865476));
00829     f1 = x[0] - f0;
00830     f2 = x[0] + f0;
00831     f3 = x[8] + x[24];
00832     f4 = MUL_C(x[8], COEF_CONST(1.3065629648763766));
00833     f5 = MUL_F(f3, FRAC_CONST((-0.9238795325112866)));
00834     f6 = MUL_F(x[24], FRAC_CONST((-0.5411961001461967)));
00835     f7 = f4 + f5;
00836     f8 = f6 - f5;
00837     f9 = f2 - f8;
00838     f10 = f2 + f8;
00839     f11 = f1 - f7;
00840     f12 = f1 + f7;
00841     f13 = x[4] + x[28];
00842     f14 = MUL_C(x[4], COEF_CONST(1.1758756024193588));
00843     f15 = MUL_F(f13, FRAC_CONST((-0.9807852804032304)));
00844     f16 = MUL_F(x[28], FRAC_CONST((-0.7856949583871021)));
00845     f17 = f14 + f15;
00846     f18 = f16 - f15;
00847     f19 = x[12] + x[20];
00848     f20 = MUL_C(x[12], COEF_CONST(1.3870398453221473));
00849     f21 = MUL_F(f19, FRAC_CONST((-0.8314696123025455)));
00850     f22 = MUL_F(x[20], FRAC_CONST((-0.2758993792829436)));
00851     f23 = f20 + f21;
00852     f24 = f22 - f21;
00853     f25 = f18 - f24;
00854     f26 = f18 + f24;
00855     f27 = MUL_F(f25, FRAC_CONST(0.7071067811865476));
00856     f28 = f17 - f23;
00857     f29 = f17 + f23;
00858     f30 = MUL_F(f29, FRAC_CONST(0.7071067811865476));
00859     f31 = f27 - f30;
00860     f32 = f27 + f30;
00861     f33 = f10 - f26;
00862     f34 = f10 + f26;
00863     f35 = f12 - f32;
00864     f36 = f12 + f32;
00865     f37 = f11 - f31;
00866     f38 = f11 + f31;
00867     f39 = f9 - f28;
00868     f40 = f9 + f28;
00869     f41 = x[2] + x[30];
00870     f42 = MUL_C(x[2], COEF_CONST(1.0932018670017569));
00871     f43 = MUL_F(f41, FRAC_CONST((-0.9951847266721969)));
00872     f44 = MUL_F(x[30], FRAC_CONST((-0.8971675863426368)));
00873     f45 = f42 + f43;
00874     f46 = f44 - f43;
00875     f47 = x[6] + x[26];
00876     f48 = MUL_C(x[6], COEF_CONST(1.2472250129866711));
00877     f49 = MUL_F(f47, FRAC_CONST((-0.9569403357322089)));
00878     f50 = MUL_F(x[26], FRAC_CONST((-0.6666556584777469)));
00879     f51 = f48 + f49;
00880     f52 = f50 - f49;
00881     f53 = x[10] + x[22];
00882     f54 = MUL_C(x[10], COEF_CONST(1.3533180011743526));
00883     f55 = MUL_F(f53, FRAC_CONST((-0.8819212643483551)));
00884     f56 = MUL_F(x[22], FRAC_CONST((-0.4105245275223575)));
00885     f57 = f54 + f55;
00886     f58 = f56 - f55;
00887     f59 = x[14] + x[18];
00888     f60 = MUL_C(x[14], COEF_CONST(1.4074037375263826));
00889     f61 = MUL_F(f59, FRAC_CONST((-0.7730104533627369)));
00890     f62 = MUL_F(x[18], FRAC_CONST((-0.1386171691990913)));
00891     f63 = f60 + f61;
00892     f64 = f62 - f61;
00893     f65 = f46 - f64;
00894     f66 = f46 + f64;
00895     f67 = f52 - f58;
00896     f68 = f52 + f58;
00897     f69 = f66 - f68;
00898     f70 = f66 + f68;
00899     f71 = MUL_F(f69, FRAC_CONST(0.7071067811865476));
00900     f72 = f65 + f67;
00901     f73 = MUL_C(f65, COEF_CONST(1.3065629648763766));
00902     f74 = MUL_F(f72, FRAC_CONST((-0.9238795325112866)));
00903     f75 = MUL_F(f67, FRAC_CONST((-0.5411961001461967)));
00904     f76 = f73 + f74;
00905     f77 = f75 - f74;
00906     f78 = f45 - f63;
00907     f79 = f45 + f63;
00908     f80 = f51 - f57;
00909     f81 = f51 + f57;
00910     f82 = f79 + f81;
00911     f83 = MUL_C(f79, COEF_CONST(1.3065629648763770));
00912     f84 = MUL_F(f82, FRAC_CONST((-0.3826834323650904)));
00913     f85 = MUL_F(f81, FRAC_CONST(0.5411961001461961));
00914     f86 = f83 + f84;
00915     f87 = f85 - f84;
00916     f88 = f78 - f80;
00917     f89 = f78 + f80;
00918     f90 = MUL_F(f89, FRAC_CONST(0.7071067811865476));
00919     f91 = f77 - f87;
00920     f92 = f77 + f87;
00921     f93 = f71 - f90;
00922     f94 = f71 + f90;
00923     f95 = f76 - f86;
00924     f96 = f76 + f86;
00925     f97 = f34 - f70;
00926     f98 = f34 + f70;
00927     f99 = f36 - f92;
00928     f100 = f36 + f92;
00929     f101 = f38 - f91;
00930     f102 = f38 + f91;
00931     f103 = f40 - f94;
00932     f104 = f40 + f94;
00933     f105 = f39 - f93;
00934     f106 = f39 + f93;
00935     f107 = f37 - f96;
00936     f108 = f37 + f96;
00937     f109 = f35 - f95;
00938     f110 = f35 + f95;
00939     f111 = f33 - f88;
00940     f112 = f33 + f88;
00941     f113 = x[1] + x[31];
00942     f114 = MUL_C(x[1], COEF_CONST(1.0478631305325901));
00943     f115 = MUL_F(f113, FRAC_CONST((-0.9987954562051724)));
00944     f116 = MUL_F(x[31], FRAC_CONST((-0.9497277818777548)));
00945     f117 = f114 + f115;
00946     f118 = f116 - f115;
00947     f119 = x[5] + x[27];
00948     f120 = MUL_C(x[5], COEF_CONST(1.2130114330978077));
00949     f121 = MUL_F(f119, FRAC_CONST((-0.9700312531945440)));
00950     f122 = MUL_F(x[27], FRAC_CONST((-0.7270510732912803)));
00951     f123 = f120 + f121;
00952     f124 = f122 - f121;
00953     f125 = x[9] + x[23];
00954     f126 = MUL_C(x[9], COEF_CONST(1.3315443865537255));
00955     f127 = MUL_F(f125, FRAC_CONST((-0.9039892931234433)));
00956     f128 = MUL_F(x[23], FRAC_CONST((-0.4764341996931612)));
00957     f129 = f126 + f127;
00958     f130 = f128 - f127;
00959     f131 = x[13] + x[19];
00960     f132 = MUL_C(x[13], COEF_CONST(1.3989068359730781));
00961     f133 = MUL_F(f131, FRAC_CONST((-0.8032075314806453)));
00962     f134 = MUL_F(x[19], FRAC_CONST((-0.2075082269882124)));
00963     f135 = f132 + f133;
00964     f136 = f134 - f133;
00965     f137 = x[17] + x[15];
00966     f138 = MUL_C(x[17], COEF_CONST(1.4125100802019777));
00967     f139 = MUL_F(f137, FRAC_CONST((-0.6715589548470187)));
00968     f140 = MUL_F(x[15], FRAC_CONST(0.0693921705079402));
00969     f141 = f138 + f139;
00970     f142 = f140 - f139;
00971     f143 = x[21] + x[11];
00972     f144 = MUL_C(x[21], COEF_CONST(1.3718313541934939));
00973     f145 = MUL_F(f143, FRAC_CONST((-0.5141027441932219)));
00974     f146 = MUL_F(x[11], FRAC_CONST(0.3436258658070501));
00975     f147 = f144 + f145;
00976     f148 = f146 - f145;
00977     f149 = x[25] + x[7];
00978     f150 = MUL_C(x[25], COEF_CONST(1.2784339185752409));
00979     f151 = MUL_F(f149, FRAC_CONST((-0.3368898533922200)));
00980     f152 = MUL_F(x[7], FRAC_CONST(0.6046542117908008));
00981     f153 = f150 + f151;
00982     f154 = f152 - f151;
00983     f155 = x[29] + x[3];
00984     f156 = MUL_C(x[29], COEF_CONST(1.1359069844201433));
00985     f157 = MUL_F(f155, FRAC_CONST((-0.1467304744553624)));
00986     f158 = MUL_F(x[3], FRAC_CONST(0.8424460355094185));
00987     f159 = f156 + f157;
00988     f160 = f158 - f157;
00989     f161 = f118 - f142;
00990     f162 = f118 + f142;
00991     f163 = f117 - f141;
00992     f164 = f117 + f141;
00993     f165 = f124 - f148;
00994     f166 = f124 + f148;
00995     f167 = f123 - f147;
00996     f168 = f123 + f147;
00997     f169 = f130 - f154;
00998     f170 = f130 + f154;
00999     f171 = f129 - f153;
01000     f172 = f129 + f153;
01001     f173 = f136 - f160;
01002     f174 = f136 + f160;
01003     f175 = f135 - f159;
01004     f176 = f135 + f159;
01005     f177 = f161 + f163;
01006     f178 = MUL_C(f161, COEF_CONST(1.1758756024193588));
01007     f179 = MUL_F(f177, FRAC_CONST((-0.9807852804032304)));
01008     f180 = MUL_F(f163, FRAC_CONST((-0.7856949583871021)));
01009     f181 = f178 + f179;
01010     f182 = f180 - f179;
01011     f183 = f165 + f167;
01012     f184 = MUL_C(f165, COEF_CONST(1.3870398453221475));
01013     f185 = MUL_F(f183, FRAC_CONST((-0.5555702330196022)));
01014     f186 = MUL_F(f167, FRAC_CONST(0.2758993792829431));
01015     f187 = f184 + f185;
01016     f188 = f186 - f185;
01017     f189 = f169 + f171;
01018     f190 = MUL_F(f169, FRAC_CONST(0.7856949583871022));
01019     f191 = MUL_F(f189, FRAC_CONST(0.1950903220161283));
01020     f192 = MUL_C(f171, COEF_CONST(1.1758756024193586));
01021     f193 = f190 + f191;
01022     f194 = f192 - f191;
01023     f195 = f173 + f175;
01024     f196 = MUL_F(f173, FRAC_CONST((-0.2758993792829430)));
01025     f197 = MUL_F(f195, FRAC_CONST(0.8314696123025452));
01026     f198 = MUL_C(f175, COEF_CONST(1.3870398453221475));
01027     f199 = f196 + f197;
01028     f200 = f198 - f197;
01029     f201 = f162 - f170;
01030     f202 = f162 + f170;
01031     f203 = f164 - f172;
01032     f204 = f164 + f172;
01033     f205 = f166 - f174;
01034     f206 = f166 + f174;
01035     f207 = f168 - f176;
01036     f208 = f168 + f176;
01037     f209 = f182 - f194;
01038     f210 = f182 + f194;
01039     f211 = f181 - f193;
01040     f212 = f181 + f193;
01041     f213 = f188 - f200;
01042     f214 = f188 + f200;
01043     f215 = f187 - f199;
01044     f216 = f187 + f199;
01045     f217 = f201 + f203;
01046     f218 = MUL_C(f201, COEF_CONST(1.3065629648763766));
01047     f219 = MUL_F(f217, FRAC_CONST((-0.9238795325112866)));
01048     f220 = MUL_F(f203, FRAC_CONST((-0.5411961001461967)));
01049     f221 = f218 + f219;
01050     f222 = f220 - f219;
01051     f223 = f205 + f207;
01052     f224 = MUL_F(f205, FRAC_CONST(0.5411961001461969));
01053     f225 = MUL_F(f223, FRAC_CONST(0.3826834323650898));
01054     f226 = MUL_C(f207, COEF_CONST(1.3065629648763766));
01055     f227 = f224 + f225;
01056     f228 = f226 - f225;
01057     f229 = f209 + f211;
01058     f230 = MUL_C(f209, COEF_CONST(1.3065629648763766));
01059     f231 = MUL_F(f229, FRAC_CONST((-0.9238795325112866)));
01060     f232 = MUL_F(f211, FRAC_CONST((-0.5411961001461967)));
01061     f233 = f230 + f231;
01062     f234 = f232 - f231;
01063     f235 = f213 + f215;
01064     f236 = MUL_F(f213, FRAC_CONST(0.5411961001461969));
01065     f237 = MUL_F(f235, FRAC_CONST(0.3826834323650898));
01066     f238 = MUL_C(f215, COEF_CONST(1.3065629648763766));
01067     f239 = f236 + f237;
01068     f240 = f238 - f237;
01069     f241 = f202 - f206;
01070     f242 = f202 + f206;
01071     f243 = f204 - f208;
01072     f244 = f204 + f208;
01073     f245 = f222 - f228;
01074     f246 = f222 + f228;
01075     f247 = f221 - f227;
01076     f248 = f221 + f227;
01077     f249 = f210 - f214;
01078     f250 = f210 + f214;
01079     f251 = f212 - f216;
01080     f252 = f212 + f216;
01081     f253 = f234 - f240;
01082     f254 = f234 + f240;
01083     f255 = f233 - f239;
01084     f256 = f233 + f239;
01085     f257 = f241 - f243;
01086     f258 = f241 + f243;
01087     f259 = MUL_F(f257, FRAC_CONST(0.7071067811865474));
01088     f260 = MUL_F(f258, FRAC_CONST(0.7071067811865474));
01089     f261 = f245 - f247;
01090     f262 = f245 + f247;
01091     f263 = MUL_F(f261, FRAC_CONST(0.7071067811865474));
01092     f264 = MUL_F(f262, FRAC_CONST(0.7071067811865474));
01093     f265 = f249 - f251;
01094     f266 = f249 + f251;
01095     f267 = MUL_F(f265, FRAC_CONST(0.7071067811865474));
01096     f268 = MUL_F(f266, FRAC_CONST(0.7071067811865474));
01097     f269 = f253 - f255;
01098     f270 = f253 + f255;
01099     f271 = MUL_F(f269, FRAC_CONST(0.7071067811865474));
01100     f272 = MUL_F(f270, FRAC_CONST(0.7071067811865474));
01101     y[31] = f98 - f242;
01102     y[0] = f98 + f242;
01103     y[30] = f100 - f250;
01104     y[1] = f100 + f250;
01105     y[29] = f102 - f254;
01106     y[2] = f102 + f254;
01107     y[28] = f104 - f246;
01108     y[3] = f104 + f246;
01109     y[27] = f106 - f264;
01110     y[4] = f106 + f264;
01111     y[26] = f108 - f272;
01112     y[5] = f108 + f272;
01113     y[25] = f110 - f268;
01114     y[6] = f110 + f268;
01115     y[24] = f112 - f260;
01116     y[7] = f112 + f260;
01117     y[23] = f111 - f259;
01118     y[8] = f111 + f259;
01119     y[22] = f109 - f267;
01120     y[9] = f109 + f267;
01121     y[21] = f107 - f271;
01122     y[10] = f107 + f271;
01123     y[20] = f105 - f263;
01124     y[11] = f105 + f263;
01125     y[19] = f103 - f248;
01126     y[12] = f103 + f248;
01127     y[18] = f101 - f256;
01128     y[13] = f101 + f256;
01129     y[17] = f99 - f252;
01130     y[14] = f99 + f252;
01131     y[16] = f97 - f244;
01132     y[15] = f97 + f244;
01133 }
01134 
01135 void DCT2_32_unscaled(real_t *y, real_t *x)
01136 {
01137     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
01138     real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
01139     real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
01140     real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
01141     real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
01142     real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
01143     real_t f63, f64, f65, f66, f69, f70, f71, f72, f73, f74;
01144     real_t f75, f76, f77, f78, f79, f80, f81, f83, f85, f86;
01145     real_t f89, f90, f91, f92, f93, f94, f95, f96, f97, f98;
01146     real_t f99, f100, f101, f102, f103, f104, f105, f106, f107, f108;
01147     real_t f109, f110, f111, f112, f113, f114, f115, f116, f117, f118;
01148     real_t f119, f120, f121, f122, f123, f124, f127, f128, f129, f130;
01149     real_t f133, f134, f135, f136, f139, f140, f141, f142, f145, f146;
01150     real_t f147, f148, f149, f150, f151, f152, f153, f154, f155, f156;
01151     real_t f157, f158, f159, f160, f161, f162, f163, f164, f165, f166;
01152     real_t f167, f168, f169, f170, f171, f172, f173, f174, f175, f176;
01153     real_t f177, f178, f179, f180, f181, f182, f183, f184, f185, f186;
01154     real_t f187, f188, f189, f190, f191, f192, f193, f194, f195, f196;
01155     real_t f197, f198, f199, f200, f201, f202, f203, f204, f205, f206;
01156     real_t f207, f208, f209, f210, f211, f212, f213, f214, f215, f216;
01157     real_t f217, f218, f219, f220, f221, f222, f223, f224, f225, f226;
01158     real_t f227, f228, f229, f230, f231, f232, f233, f234, f235, f236;
01159     real_t f237, f238, f239, f240, f241, f242, f243, f244, f247, f248;
01160     real_t f249, f250, f253, f254, f255, f256, f259, f260, f261, f262;
01161     real_t f265, f266, f267, f268, f271, f272, f273, f274, f277, f278;
01162     real_t f279, f280, f283, f284, f285, f286;
01163 
01164     f0 = x[0] - x[31];
01165     f1 = x[0] + x[31];
01166     f2 = x[1] - x[30];
01167     f3 = x[1] + x[30];
01168     f4 = x[2] - x[29];
01169     f5 = x[2] + x[29];
01170     f6 = x[3] - x[28];
01171     f7 = x[3] + x[28];
01172     f8 = x[4] - x[27];
01173     f9 = x[4] + x[27];
01174     f10 = x[5] - x[26];
01175     f11 = x[5] + x[26];
01176     f12 = x[6] - x[25];
01177     f13 = x[6] + x[25];
01178     f14 = x[7] - x[24];
01179     f15 = x[7] + x[24];
01180     f16 = x[8] - x[23];
01181     f17 = x[8] + x[23];
01182     f18 = x[9] - x[22];
01183     f19 = x[9] + x[22];
01184     f20 = x[10] - x[21];
01185     f21 = x[10] + x[21];
01186     f22 = x[11] - x[20];
01187     f23 = x[11] + x[20];
01188     f24 = x[12] - x[19];
01189     f25 = x[12] + x[19];
01190     f26 = x[13] - x[18];
01191     f27 = x[13] + x[18];
01192     f28 = x[14] - x[17];
01193     f29 = x[14] + x[17];
01194     f30 = x[15] - x[16];
01195     f31 = x[15] + x[16];
01196     f32 = f1 - f31;
01197     f33 = f1 + f31;
01198     f34 = f3 - f29;
01199     f35 = f3 + f29;
01200     f36 = f5 - f27;
01201     f37 = f5 + f27;
01202     f38 = f7 - f25;
01203     f39 = f7 + f25;
01204     f40 = f9 - f23;
01205     f41 = f9 + f23;
01206     f42 = f11 - f21;
01207     f43 = f11 + f21;
01208     f44 = f13 - f19;
01209     f45 = f13 + f19;
01210     f46 = f15 - f17;
01211     f47 = f15 + f17;
01212     f48 = f33 - f47;
01213     f49 = f33 + f47;
01214     f50 = f35 - f45;
01215     f51 = f35 + f45;
01216     f52 = f37 - f43;
01217     f53 = f37 + f43;
01218     f54 = f39 - f41;
01219     f55 = f39 + f41;
01220     f56 = f49 - f55;
01221     f57 = f49 + f55;
01222     f58 = f51 - f53;
01223     f59 = f51 + f53;
01224     f60 = f57 - f59;
01225     y[0] = f57 + f59;
01226     y[16] = MUL_F(FRAC_CONST(0.7071067811865476), f60);
01227     f63 = f56 + f58;
01228     f64 = MUL_C(COEF_CONST(1.3065629648763766), f56);
01229     f65 = MUL_F(FRAC_CONST(-0.9238795325112866), f63);
01230     f66 = MUL_F(FRAC_CONST(-0.5411961001461967), f58);
01231     y[24] = f64 + f65;
01232     y[8] = f66 - f65;
01233     f69 = f48 + f54;
01234     f70 = MUL_C(COEF_CONST(1.1758756024193588), f48);
01235     f71 = MUL_F(FRAC_CONST(-0.9807852804032304), f69);
01236     f72 = MUL_F(FRAC_CONST(-0.7856949583871021), f54);
01237     f73 = f70 + f71;
01238     f74 = f72 - f71;
01239     f75 = f50 + f52;
01240     f76 = MUL_C(COEF_CONST(1.3870398453221473), f50);
01241     f77 = MUL_F(FRAC_CONST(-0.8314696123025455), f75);
01242     f78 = MUL_F(FRAC_CONST(-0.2758993792829436), f52);
01243     f79 = f76 + f77;
01244     f80 = f78 - f77;
01245     f81 = f74 - f80;
01246     y[4] = f74 + f80;
01247     f83 = MUL_F(FRAC_CONST(0.7071067811865476), f81);
01248     y[28] = f73 - f79;
01249     f85 = f73 + f79;
01250     f86 = MUL_F(FRAC_CONST(0.7071067811865476), f85);
01251     y[20] = f83 - f86;
01252     y[12] = f83 + f86;
01253     f89 = f34 - f36;
01254     f90 = f34 + f36;
01255     f91 = f38 - f40;
01256     f92 = f38 + f40;
01257     f93 = f42 - f44;
01258     f94 = f42 + f44;
01259     f95 = MUL_F(FRAC_CONST(0.7071067811865476), f92);
01260     f96 = f32 - f95;
01261     f97 = f32 + f95;
01262     f98 = f90 + f94;
01263     f99 = MUL_C(COEF_CONST(1.3065629648763766), f90);
01264     f100 = MUL_F(FRAC_CONST(-0.9238795325112866), f98);
01265     f101 = MUL_F(FRAC_CONST(-0.5411961001461967), f94);
01266     f102 = f99 + f100;
01267     f103 = f101 - f100;
01268     f104 = f97 - f103;
01269     f105 = f97 + f103;
01270     f106 = f96 - f102;
01271     f107 = f96 + f102;
01272     f108 = MUL_F(FRAC_CONST(0.7071067811865476), f91);
01273     f109 = f46 - f108;
01274     f110 = f46 + f108;
01275     f111 = f93 + f89;
01276     f112 = MUL_C(COEF_CONST(1.3065629648763766), f93);
01277     f113 = MUL_F(FRAC_CONST(-0.9238795325112866), f111);
01278     f114 = MUL_F(FRAC_CONST(-0.5411961001461967), f89);
01279     f115 = f112 + f113;
01280     f116 = f114 - f113;
01281     f117 = f110 - f116;
01282     f118 = f110 + f116;
01283     f119 = f109 - f115;
01284     f120 = f109 + f115;
01285     f121 = f118 + f105;
01286     f122 = MUL_F(FRAC_CONST(-0.8971675863426361), f118);
01287     f123 = MUL_F(FRAC_CONST(0.9951847266721968), f121);
01288     f124 = MUL_C(COEF_CONST(1.0932018670017576), f105);
01289     y[2] = f122 + f123;
01290     y[30] = f124 - f123;
01291     f127 = f107 - f120;
01292     f128 = MUL_F(FRAC_CONST(-0.6666556584777466), f120);
01293     f129 = MUL_F(FRAC_CONST(0.9569403357322089), f127);
01294     f130 = MUL_C(COEF_CONST(1.2472250129866713), f107);
01295     y[6] = f129 - f128;
01296     y[26] = f130 - f129;
01297     f133 = f119 + f106;
01298     f134 = MUL_F(FRAC_CONST(-0.4105245275223571), f119);
01299     f135 = MUL_F(FRAC_CONST(0.8819212643483549), f133);
01300     f136 = MUL_C(COEF_CONST(1.3533180011743529), f106);
01301     y[10] = f134 + f135;
01302     y[22] = f136 - f135;
01303     f139 = f104 - f117;
01304     f140 = MUL_F(FRAC_CONST(-0.1386171691990915), f117);
01305     f141 = MUL_F(FRAC_CONST(0.7730104533627370), f139);
01306     f142 = MUL_C(COEF_CONST(1.4074037375263826), f104);
01307     y[14] = f141 - f140;
01308     y[18] = f142 - f141;
01309     f145 = f2 - f4;
01310     f146 = f2 + f4;
01311     f147 = f6 - f8;
01312     f148 = f6 + f8;
01313     f149 = f10 - f12;
01314     f150 = f10 + f12;
01315     f151 = f14 - f16;
01316     f152 = f14 + f16;
01317     f153 = f18 - f20;
01318     f154 = f18 + f20;
01319     f155 = f22 - f24;
01320     f156 = f22 + f24;
01321     f157 = f26 - f28;
01322     f158 = f26 + f28;
01323     f159 = MUL_F(FRAC_CONST(0.7071067811865476), f152);
01324     f160 = f0 - f159;
01325     f161 = f0 + f159;
01326     f162 = f148 + f156;
01327     f163 = MUL_C(COEF_CONST(1.3065629648763766), f148);
01328     f164 = MUL_F(FRAC_CONST(-0.9238795325112866), f162);
01329     f165 = MUL_F(FRAC_CONST(-0.5411961001461967), f156);
01330     f166 = f163 + f164;
01331     f167 = f165 - f164;
01332     f168 = f161 - f167;
01333     f169 = f161 + f167;
01334     f170 = f160 - f166;
01335     f171 = f160 + f166;
01336     f172 = f146 + f158;
01337     f173 = MUL_C(COEF_CONST(1.1758756024193588), f146);
01338     f174 = MUL_F(FRAC_CONST(-0.9807852804032304), f172);
01339     f175 = MUL_F(FRAC_CONST(-0.7856949583871021), f158);
01340     f176 = f173 + f174;
01341     f177 = f175 - f174;
01342     f178 = f150 + f154;
01343     f179 = MUL_C(COEF_CONST(1.3870398453221473), f150);
01344     f180 = MUL_F(FRAC_CONST(-0.8314696123025455), f178);
01345     f181 = MUL_F(FRAC_CONST(-0.2758993792829436), f154);
01346     f182 = f179 + f180;
01347     f183 = f181 - f180;
01348     f184 = f177 - f183;
01349     f185 = f177 + f183;
01350     f186 = MUL_F(FRAC_CONST(0.7071067811865476), f184);
01351     f187 = f176 - f182;
01352     f188 = f176 + f182;
01353     f189 = MUL_F(FRAC_CONST(0.7071067811865476), f188);
01354     f190 = f186 - f189;
01355     f191 = f186 + f189;
01356     f192 = f169 - f185;
01357     f193 = f169 + f185;
01358     f194 = f171 - f191;
01359     f195 = f171 + f191;
01360     f196 = f170 - f190;
01361     f197 = f170 + f190;
01362     f198 = f168 - f187;
01363     f199 = f168 + f187;
01364     f200 = MUL_F(FRAC_CONST(0.7071067811865476), f151);
01365     f201 = f30 - f200;
01366     f202 = f30 + f200;
01367     f203 = f155 + f147;
01368     f204 = MUL_C(COEF_CONST(1.3065629648763766), f155);
01369     f205 = MUL_F(FRAC_CONST(-0.9238795325112866), f203);
01370     f206 = MUL_F(FRAC_CONST(-0.5411961001461967), f147);
01371     f207 = f204 + f205;
01372     f208 = f206 - f205;
01373     f209 = f202 - f208;
01374     f210 = f202 + f208;
01375     f211 = f201 - f207;
01376     f212 = f201 + f207;
01377     f213 = f157 + f145;
01378     f214 = MUL_C(COEF_CONST(1.1758756024193588), f157);
01379     f215 = MUL_F(FRAC_CONST(-0.9807852804032304), f213);
01380     f216 = MUL_F(FRAC_CONST(-0.7856949583871021), f145);
01381     f217 = f214 + f215;
01382     f218 = f216 - f215;
01383     f219 = f153 + f149;
01384     f220 = MUL_C(COEF_CONST(1.3870398453221473), f153);
01385     f221 = MUL_F(FRAC_CONST(-0.8314696123025455), f219);
01386     f222 = MUL_F(FRAC_CONST(-0.2758993792829436), f149);
01387     f223 = f220 + f221;
01388     f224 = f222 - f221;
01389     f225 = f218 - f224;
01390     f226 = f218 + f224;
01391     f227 = MUL_F(FRAC_CONST(0.7071067811865476), f225);
01392     f228 = f217 - f223;
01393     f229 = f217 + f223;
01394     f230 = MUL_F(FRAC_CONST(0.7071067811865476), f229);
01395     f231 = f227 - f230;
01396     f232 = f227 + f230;
01397     f233 = f210 - f226;
01398     f234 = f210 + f226;
01399     f235 = f212 - f232;
01400     f236 = f212 + f232;
01401     f237 = f211 - f231;
01402     f238 = f211 + f231;
01403     f239 = f209 - f228;
01404     f240 = f209 + f228;
01405     f241 = f234 + f193;
01406     f242 = MUL_F(FRAC_CONST(-0.9497277818777543), f234);
01407     f243 = MUL_F(FRAC_CONST(0.9987954562051724), f241);
01408     f244 = MUL_C(COEF_CONST(1.0478631305325905), f193);
01409     y[1] = f242 + f243;
01410     y[31] = f244 - f243;
01411     f247 = f195 - f236;
01412     f248 = MUL_F(FRAC_CONST(-0.8424460355094192), f236);
01413     f249 = MUL_F(FRAC_CONST(0.9891765099647810), f247);
01414     f250 = MUL_C(COEF_CONST(1.1359069844201428), f195);
01415     y[3] = f249 - f248;
01416     y[29] = f250 - f249;
01417     f253 = f238 + f197;
01418     f254 = MUL_F(FRAC_CONST(-0.7270510732912801), f238);
01419     f255 = MUL_F(FRAC_CONST(0.9700312531945440), f253);
01420     f256 = MUL_C(COEF_CONST(1.2130114330978079), f197);
01421     y[5] = f254 + f255;
01422     y[27] = f256 - f255;
01423     f259 = f199 - f240;
01424     f260 = MUL_F(FRAC_CONST(-0.6046542117908007), f240);
01425     f261 = MUL_F(FRAC_CONST(0.9415440651830208), f259);
01426     f262 = MUL_C(COEF_CONST(1.2784339185752409), f199);
01427     y[7] = f261 - f260;
01428     y[25] = f262 - f261;
01429     f265 = f239 + f198;
01430     f266 = MUL_F(FRAC_CONST(-0.4764341996931611), f239);
01431     f267 = MUL_F(FRAC_CONST(0.9039892931234433), f265);
01432     f268 = MUL_C(COEF_CONST(1.3315443865537255), f198);
01433     y[9] = f266 + f267;
01434     y[23] = f268 - f267;
01435     f271 = f196 - f237;
01436     f272 = MUL_F(FRAC_CONST(-0.3436258658070505), f237);
01437     f273 = MUL_F(FRAC_CONST(0.8577286100002721), f271);
01438     f274 = MUL_C(COEF_CONST(1.3718313541934939), f196);
01439     y[11] = f273 - f272;
01440     y[21] = f274 - f273;
01441     f277 = f235 + f194;
01442     f278 = MUL_F(FRAC_CONST(-0.2075082269882114), f235);
01443     f279 = MUL_F(FRAC_CONST(0.8032075314806448), f277);
01444     f280 = MUL_C(COEF_CONST(1.3989068359730783), f194);
01445     y[13] = f278 + f279;
01446     y[19] = f280 - f279;
01447     f283 = f192 - f233;
01448     f284 = MUL_F(FRAC_CONST(-0.0693921705079408), f233);
01449     f285 = MUL_F(FRAC_CONST(0.7409511253549591), f283);
01450     f286 = MUL_C(COEF_CONST(1.4125100802019774), f192);
01451     y[15] = f285 - f284;
01452     y[17] = f286 - f285;
01453 }
01454 
01455 #else
01456 
01457 
01458 #define n 32
01459 #define log2n 5
01460 
01461 // w_array_real[i] = cos(2*M_PI*i/32)
01462 static const real_t w_array_real[] = {
01463     FRAC_CONST(1.000000000000000), FRAC_CONST(0.980785279337272),
01464     FRAC_CONST(0.923879528329380), FRAC_CONST(0.831469603195765),
01465     FRAC_CONST(0.707106765732237), FRAC_CONST(0.555570210304169),
01466     FRAC_CONST(0.382683402077046), FRAC_CONST(0.195090284503576),
01467     FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090370246552),
01468     FRAC_CONST(-0.382683482845162), FRAC_CONST(-0.555570282993553),
01469     FRAC_CONST(-0.707106827549476), FRAC_CONST(-0.831469651765257),
01470     FRAC_CONST(-0.923879561784627), FRAC_CONST(-0.980785296392607)
01471 };
01472 
01473 // w_array_imag[i] = sin(-2*M_PI*i/32)
01474 static const real_t w_array_imag[] = {
01475     FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090327375064),
01476     FRAC_CONST(-0.382683442461104), FRAC_CONST(-0.555570246648862),
01477     FRAC_CONST(-0.707106796640858), FRAC_CONST(-0.831469627480512),
01478     FRAC_CONST(-0.923879545057005), FRAC_CONST(-0.980785287864940),
01479     FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.980785270809601),
01480     FRAC_CONST(-0.923879511601754), FRAC_CONST(-0.831469578911016),
01481     FRAC_CONST(-0.707106734823616), FRAC_CONST(-0.555570173959476),
01482     FRAC_CONST(-0.382683361692986), FRAC_CONST(-0.195090241632088)
01483 };
01484 
01485 // FFT decimation in frequency
01486 // 4*16*2+16=128+16=144 multiplications
01487 // 6*16*2+10*8+4*16*2=192+80+128=400 additions
01488 static void fft_dif(real_t * Real, real_t * Imag)
01489 {
01490     real_t w_real, w_imag; // For faster access
01491     real_t point1_real, point1_imag, point2_real, point2_imag; // For faster access
01492     uint32_t j, i, i2, w_index; // Counters
01493 
01494     // First 2 stages of 32 point FFT decimation in frequency
01495     // 4*16*2=64*2=128 multiplications
01496     // 6*16*2=96*2=192 additions
01497         // Stage 1 of 32 point FFT decimation in frequency
01498     for (i = 0; i < 16; i++)
01499     {
01500         point1_real = Real[i];
01501         point1_imag = Imag[i];
01502         i2 = i+16;
01503         point2_real = Real[i2];
01504         point2_imag = Imag[i2];
01505 
01506         w_real = w_array_real[i];
01507         w_imag = w_array_imag[i];
01508 
01509         // temp1 = x[i] - x[i2]
01510         point1_real -= point2_real;
01511         point1_imag -= point2_imag;
01512 
01513         // x[i1] = x[i] + x[i2]
01514         Real[i] += point2_real;
01515         Imag[i] += point2_imag;
01516 
01517         // x[i2] = (x[i] - x[i2]) * w
01518         Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
01519         Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
01520      }
01521     // Stage 2 of 32 point FFT decimation in frequency
01522     for (j = 0, w_index = 0; j < 8; j++, w_index += 2)
01523     {
01524         w_real = w_array_real[w_index];
01525         w_imag = w_array_imag[w_index];
01526 
01527         i = j;
01528         point1_real = Real[i];
01529         point1_imag = Imag[i];
01530         i2 = i+8;
01531         point2_real = Real[i2];
01532         point2_imag = Imag[i2];
01533 
01534         // temp1 = x[i] - x[i2]
01535         point1_real -= point2_real;
01536         point1_imag -= point2_imag;
01537 
01538         // x[i1] = x[i] + x[i2]
01539         Real[i] += point2_real;
01540         Imag[i] += point2_imag;
01541 
01542         // x[i2] = (x[i] - x[i2]) * w
01543         Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
01544         Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
01545 
01546         i = j+16;
01547         point1_real = Real[i];
01548         point1_imag = Imag[i];
01549         i2 = i+8;
01550         point2_real = Real[i2];
01551         point2_imag = Imag[i2];
01552 
01553         // temp1 = x[i] - x[i2]
01554         point1_real -= point2_real;
01555         point1_imag -= point2_imag;
01556 
01557         // x[i1] = x[i] + x[i2]
01558         Real[i] += point2_real;
01559         Imag[i] += point2_imag;
01560 
01561         // x[i2] = (x[i] - x[i2]) * w
01562         Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
01563         Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
01564     }
01565 
01566     // Stage 3 of 32 point FFT decimation in frequency
01567     // 2*4*2=16 multiplications
01568     // 4*4*2+6*4*2=10*8=80 additions
01569     for (i = 0; i < n; i += 8)
01570     {
01571         i2 = i+4;
01572         point1_real = Real[i];
01573         point1_imag = Imag[i];
01574 
01575         point2_real = Real[i2];
01576         point2_imag = Imag[i2];
01577 
01578         // out[i1] = point1 + point2
01579         Real[i] += point2_real;
01580         Imag[i] += point2_imag;
01581 
01582         // out[i2] = point1 - point2
01583         Real[i2] = point1_real - point2_real;
01584         Imag[i2] = point1_imag - point2_imag;
01585     }
01586     w_real = w_array_real[4]; // = sqrt(2)/2
01587     // w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
01588     for (i = 1; i < n; i += 8)
01589     {
01590         i2 = i+4;
01591         point1_real = Real[i];
01592         point1_imag = Imag[i];
01593 
01594         point2_real = Real[i2];
01595         point2_imag = Imag[i2];
01596 
01597         // temp1 = x[i] - x[i2]
01598         point1_real -= point2_real;
01599         point1_imag -= point2_imag;
01600 
01601         // x[i1] = x[i] + x[i2]
01602         Real[i] += point2_real;
01603         Imag[i] += point2_imag;
01604 
01605         // x[i2] = (x[i] - x[i2]) * w
01606         Real[i2] = MUL_F(point1_real+point1_imag, w_real);
01607         Imag[i2] = MUL_F(point1_imag-point1_real, w_real);
01608     }
01609     for (i = 2; i < n; i += 8)
01610     {
01611         i2 = i+4;
01612         point1_real = Real[i];
01613         point1_imag = Imag[i];
01614 
01615         point2_real = Real[i2];
01616         point2_imag = Imag[i2];
01617 
01618         // x[i] = x[i] + x[i2]
01619         Real[i] += point2_real;
01620         Imag[i] += point2_imag;
01621 
01622         // x[i2] = (x[i] - x[i2]) * (-i)
01623         Real[i2] = point1_imag - point2_imag;
01624         Imag[i2] = point2_real - point1_real;
01625     }
01626     w_real = w_array_real[12]; // = -sqrt(2)/2
01627     // w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
01628     for (i = 3; i < n; i += 8)
01629     {
01630         i2 = i+4;
01631         point1_real = Real[i];
01632         point1_imag = Imag[i];
01633 
01634         point2_real = Real[i2];
01635         point2_imag = Imag[i2];
01636 
01637         // temp1 = x[i] - x[i2]
01638         point1_real -= point2_real;
01639         point1_imag -= point2_imag;
01640 
01641         // x[i1] = x[i] + x[i2]
01642         Real[i] += point2_real;
01643         Imag[i] += point2_imag;
01644 
01645         // x[i2] = (x[i] - x[i2]) * w
01646         Real[i2] = MUL_F(point1_real-point1_imag, w_real);
01647         Imag[i2] = MUL_F(point1_real+point1_imag, w_real);
01648     }
01649 
01650 
01651     // Stage 4 of 32 point FFT decimation in frequency (no multiplications)
01652     // 16*4=64 additions
01653     for (i = 0; i < n; i += 4)
01654     {
01655         i2 = i+2;
01656         point1_real = Real[i];
01657         point1_imag = Imag[i];
01658 
01659         point2_real = Real[i2];
01660         point2_imag = Imag[i2];
01661 
01662         // x[i1] = x[i] + x[i2]
01663         Real[i] += point2_real;
01664         Imag[i] += point2_imag;
01665 
01666         // x[i2] = x[i] - x[i2]
01667         Real[i2] = point1_real - point2_real;
01668         Imag[i2] = point1_imag - point2_imag;
01669     }
01670     for (i = 1; i < n; i += 4)
01671     {
01672         i2 = i+2;
01673         point1_real = Real[i];
01674         point1_imag = Imag[i];
01675 
01676         point2_real = Real[i2];
01677         point2_imag = Imag[i2];
01678 
01679         // x[i] = x[i] + x[i2]
01680         Real[i] += point2_real;
01681         Imag[i] += point2_imag;
01682 
01683         // x[i2] = (x[i] - x[i2]) * (-i)
01684         Real[i2] = point1_imag - point2_imag;
01685         Imag[i2] = point2_real - point1_real;
01686     }
01687 
01688     // Stage 5 of 32 point FFT decimation in frequency (no multiplications)
01689     // 16*4=64 additions
01690     for (i = 0; i < n; i += 2)
01691     {
01692         i2 = i+1;
01693         point1_real = Real[i];
01694         point1_imag = Imag[i];
01695 
01696         point2_real = Real[i2];
01697         point2_imag = Imag[i2];
01698 
01699         // out[i1] = point1 + point2
01700         Real[i] += point2_real;
01701         Imag[i] += point2_imag;
01702 
01703         // out[i2] = point1 - point2
01704         Real[i2] = point1_real - point2_real;
01705         Imag[i2] = point1_imag - point2_imag;
01706     }
01707 
01708 #ifdef REORDER_IN_FFT
01709     FFTReorder(Real, Imag);
01710 #endif // #ifdef REORDER_IN_FFT
01711 }
01712 #undef n
01713 #undef log2n
01714 
01715 static const real_t dct4_64_tab[] = {
01716     COEF_CONST(0.999924719333649), COEF_CONST(0.998118102550507),
01717     COEF_CONST(0.993906974792480), COEF_CONST(0.987301409244537),
01718     COEF_CONST(0.978317379951477), COEF_CONST(0.966976463794708),
01719     COEF_CONST(0.953306019306183), COEF_CONST(0.937339007854462),
01720     COEF_CONST(0.919113874435425), COEF_CONST(0.898674488067627),
01721     COEF_CONST(0.876070082187653), COEF_CONST(0.851355195045471),
01722     COEF_CONST(0.824589252471924), COEF_CONST(0.795836925506592),
01723     COEF_CONST(0.765167236328125), COEF_CONST(0.732654273509979),
01724     COEF_CONST(0.698376238346100), COEF_CONST(0.662415742874146),
01725     COEF_CONST(0.624859452247620), COEF_CONST(0.585797846317291),
01726     COEF_CONST(0.545324981212616), COEF_CONST(0.503538429737091),
01727     COEF_CONST(0.460538715124130), COEF_CONST(0.416429549455643),
01728     COEF_CONST(0.371317148208618), COEF_CONST(0.325310230255127),
01729     COEF_CONST(0.278519600629807), COEF_CONST(0.231058135628700),
01730     COEF_CONST(0.183039888739586), COEF_CONST(0.134580686688423),
01731     COEF_CONST(0.085797272622585), COEF_CONST(0.036807164549828),
01732     COEF_CONST(-1.012196302413940), COEF_CONST(-1.059438824653626),
01733     COEF_CONST(-1.104129195213318), COEF_CONST(-1.146159529685974),
01734     COEF_CONST(-1.185428738594055), COEF_CONST(-1.221842169761658),
01735     COEF_CONST(-1.255311965942383), COEF_CONST(-1.285757660865784),
01736     COEF_CONST(-1.313105940818787), COEF_CONST(-1.337290763854981),
01737     COEF_CONST(-1.358253836631775), COEF_CONST(-1.375944852828980),
01738     COEF_CONST(-1.390321016311646), COEF_CONST(-1.401347875595093),
01739     COEF_CONST(-1.408998727798462), COEF_CONST(-1.413255214691162),
01740     COEF_CONST(-1.414107084274292), COEF_CONST(-1.411552190780640),
01741     COEF_CONST(-1.405596733093262), COEF_CONST(-1.396255016326904),
01742     COEF_CONST(-1.383549690246582), COEF_CONST(-1.367511272430420),
01743     COEF_CONST(-1.348178386688232), COEF_CONST(-1.325597524642944),
01744     COEF_CONST(-1.299823284149170), COEF_CONST(-1.270917654037476),
01745     COEF_CONST(-1.238950133323669), COEF_CONST(-1.203998088836670),
01746     COEF_CONST(-1.166145324707031), COEF_CONST(-1.125483393669128),
01747     COEF_CONST(-1.082109928131104), COEF_CONST(-1.036129593849182),
01748     COEF_CONST(-0.987653195858002), COEF_CONST(-0.936797380447388),
01749     COEF_CONST(-0.883684754371643), COEF_CONST(-0.828443288803101),
01750     COEF_CONST(-0.771206021308899), COEF_CONST(-0.712110757827759),
01751     COEF_CONST(-0.651300072669983), COEF_CONST(-0.588920354843140),
01752     COEF_CONST(-0.525121808052063), COEF_CONST(-0.460058242082596),
01753     COEF_CONST(-0.393886327743530), COEF_CONST(-0.326765477657318),
01754     COEF_CONST(-0.258857429027557), COEF_CONST(-0.190325915813446),
01755     COEF_CONST(-0.121335685253143), COEF_CONST(-0.052053272724152),
01756     COEF_CONST(0.017354607582092), COEF_CONST(0.086720645427704),
01757     COEF_CONST(0.155877828598022), COEF_CONST(0.224659323692322),
01758     COEF_CONST(0.292899727821350), COEF_CONST(0.360434412956238),
01759     COEF_CONST(0.427100926637650), COEF_CONST(0.492738455533981),
01760     COEF_CONST(0.557188928127289), COEF_CONST(0.620297133922577),
01761     COEF_CONST(0.681910991668701), COEF_CONST(0.741881847381592),
01762     COEF_CONST(0.800065577030182), COEF_CONST(0.856321990489960),
01763     COEF_CONST(0.910515367984772), COEF_CONST(0.962515234947205),
01764     COEF_CONST(1.000000000000000), COEF_CONST(0.998795449733734),
01765     COEF_CONST(0.995184719562531), COEF_CONST(0.989176511764526),
01766     COEF_CONST(0.980785250663757), COEF_CONST(0.970031261444092),
01767     COEF_CONST(0.956940352916718), COEF_CONST(0.941544055938721),
01768     COEF_CONST(0.923879504203796), COEF_CONST(0.903989315032959),
01769     COEF_CONST(0.881921231746674), COEF_CONST(0.857728600502014),
01770     COEF_CONST(0.831469595432281), COEF_CONST(0.803207516670227),
01771     COEF_CONST(0.773010432720184), COEF_CONST(0.740951120853424),
01772     COEF_CONST(0.707106769084930), COEF_CONST(0.671558916568756),
01773     COEF_CONST(0.634393274784088), COEF_CONST(0.595699310302734),
01774     COEF_CONST(0.555570185184479), COEF_CONST(0.514102697372437),
01775     COEF_CONST(0.471396654844284), COEF_CONST(0.427555114030838),
01776     COEF_CONST(0.382683426141739), COEF_CONST(0.336889833211899),
01777     COEF_CONST(0.290284633636475), COEF_CONST(0.242980122566223),
01778     COEF_CONST(0.195090234279633), COEF_CONST(0.146730497479439),
01779     COEF_CONST(0.098017133772373), COEF_CONST(0.049067649990320),
01780     COEF_CONST(-1.000000000000000), COEF_CONST(-1.047863125801086),
01781     COEF_CONST(-1.093201875686646), COEF_CONST(-1.135906934738159),
01782     COEF_CONST(-1.175875544548035), COEF_CONST(-1.213011503219605),
01783     COEF_CONST(-1.247225046157837), COEF_CONST(-1.278433918952942),
01784     COEF_CONST(-1.306562900543213), COEF_CONST(-1.331544399261475),
01785     COEF_CONST(-1.353317975997925), COEF_CONST(-1.371831417083740),
01786     COEF_CONST(-1.387039899826050), COEF_CONST(-1.398906826972961),
01787     COEF_CONST(-1.407403707504273), COEF_CONST(-1.412510156631470),
01788     COEF_CONST(0), COEF_CONST(-1.412510156631470),
01789     COEF_CONST(-1.407403707504273), COEF_CONST(-1.398906826972961),
01790     COEF_CONST(-1.387039899826050), COEF_CONST(-1.371831417083740),
01791     COEF_CONST(-1.353317975997925), COEF_CONST(-1.331544399261475),
01792     COEF_CONST(-1.306562900543213), COEF_CONST(-1.278433918952942),
01793     COEF_CONST(-1.247225046157837), COEF_CONST(-1.213011384010315),
01794     COEF_CONST(-1.175875544548035), COEF_CONST(-1.135907053947449),
01795     COEF_CONST(-1.093201875686646), COEF_CONST(-1.047863125801086),
01796     COEF_CONST(-1.000000000000000), COEF_CONST(-0.949727773666382),
01797     COEF_CONST(-0.897167563438416), COEF_CONST(-0.842446029186249),
01798     COEF_CONST(-0.785694956779480), COEF_CONST(-0.727051079273224),
01799     COEF_CONST(-0.666655659675598), COEF_CONST(-0.604654192924500),
01800     COEF_CONST(-0.541196048259735), COEF_CONST(-0.476434230804443),
01801     COEF_CONST(-0.410524487495422), COEF_CONST(-0.343625843524933),
01802     COEF_CONST(-0.275899350643158), COEF_CONST(-0.207508206367493),
01803     COEF_CONST(-0.138617098331451), COEF_CONST(-0.069392144680023),
01804     COEF_CONST(0), COEF_CONST(0.069392263889313),
01805     COEF_CONST(0.138617157936096), COEF_CONST(0.207508206367493),
01806     COEF_CONST(0.275899469852448), COEF_CONST(0.343625962734222),
01807     COEF_CONST(0.410524636507034), COEF_CONST(0.476434201002121),
01808     COEF_CONST(0.541196107864380), COEF_CONST(0.604654192924500),
01809     COEF_CONST(0.666655719280243), COEF_CONST(0.727051138877869),
01810     COEF_CONST(0.785695075988770), COEF_CONST(0.842446029186249),
01811     COEF_CONST(0.897167563438416), COEF_CONST(0.949727773666382)
01812 };
01813 
01814 /* size 64 only! */
01815 void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag)
01816 {
01817     // Tables with bit reverse values for 5 bits, bit reverse of i at i-th position
01818     const uint8_t bit_rev_tab[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 };
01819     uint32_t i, i_rev;
01820 
01821     /* Step 2: modulate */
01822     // 3*32=96 multiplications
01823     // 3*32=96 additions
01824     for (i = 0; i < 32; i++)
01825     {
01826         real_t x_re, x_im, tmp;
01827         x_re = in_real[i];
01828         x_im = in_imag[i];
01829         tmp =        MUL_C(x_re + x_im, dct4_64_tab[i]);
01830         in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp;
01831         in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp;
01832     }
01833 
01834     /* Step 3: FFT, but with output in bit reverse order */
01835     fft_dif(in_real, in_imag);
01836 
01837     /* Step 4: modulate + bitreverse reordering */
01838     // 3*31+2=95 multiplications
01839     // 3*31+2=95 additions
01840     for (i = 0; i < 16; i++)
01841     {
01842         real_t x_re, x_im, tmp;
01843         i_rev = bit_rev_tab[i];
01844         x_re = in_real[i_rev];
01845         x_im = in_imag[i_rev];
01846 
01847         tmp =         MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
01848         out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
01849         out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
01850     }
01851     // i = 16, i_rev = 1 = rev(16);
01852     out_imag[16] = MUL_C(in_imag[1] - in_real[1], dct4_64_tab[16 + 3*32]);
01853     out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]);
01854     for (i = 17; i < 32; i++)
01855     {
01856         real_t x_re, x_im, tmp;
01857         i_rev = bit_rev_tab[i];
01858         x_re = in_real[i_rev];
01859         x_im = in_imag[i_rev];
01860         tmp =         MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
01861         out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
01862         out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
01863     }
01864 
01865 }
01866 
01867 void DST4_32(real_t *y, real_t *x)
01868 {
01869     real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9;
01870     real_t f10, f11, f12, f13, f14, f15, f16, f17, f18, f19;
01871     real_t f20, f21, f22, f23, f24, f25, f26, f27, f28, f29;
01872     real_t f30, f31, f32, f33, f34, f35, f36, f37, f38, f39;
01873     real_t f40, f41, f42, f43, f44, f45, f46, f47, f48, f49;
01874     real_t f50, f51, f52, f53, f54, f55, f56, f57, f58, f59;
01875     real_t f60, f61, f62, f63, f64, f65, f66, f67, f68, f69;
01876     real_t f70, f71, f72, f73, f74, f75, f76, f77, f78, f79;
01877     real_t f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
01878     real_t f90, f91, f92, f93, f94, f95, f96, f97, f98, f99;
01879     real_t f100, f101, f102, f103, f104, f105, f106, f107, f108, f109;
01880     real_t f110, f111, f112, f113, f114, f115, f116, f117, f118, f119;
01881     real_t f120, f121, f122, f123, f124, f125, f126, f127, f128, f129;
01882     real_t f130, f131, f132, f133, f134, f135, f136, f137, f138, f139;
01883     real_t f140, f141, f142, f143, f144, f145, f146, f147, f148, f149;
01884     real_t f150, f151, f152, f153, f154, f155, f156, f157, f158, f159;
01885     real_t f160, f161, f162, f163, f164, f165, f166, f167, f168, f169;
01886     real_t f170, f171, f172, f173, f174, f175, f176, f177, f178, f179;
01887     real_t f180, f181, f182, f183, f184, f185, f186, f187, f188, f189;
01888     real_t f190, f191, f192, f193, f194, f195, f196, f197, f198, f199;
01889     real_t f200, f201, f202, f203, f204, f205, f206, f207, f208, f209;
01890     real_t f210, f211, f212, f213, f214, f215, f216, f217, f218, f219;
01891     real_t f220, f221, f222, f223, f224, f225, f226, f227, f228, f229;
01892     real_t f230, f231, f232, f233, f234, f235, f236, f237, f238, f239;
01893     real_t f240, f241, f242, f243, f244, f245, f246, f247, f248, f249;
01894     real_t f250, f251, f252, f253, f254, f255, f256, f257, f258, f259;
01895     real_t f260, f261, f262, f263, f264, f265, f266, f267, f268, f269;
01896     real_t f270, f271, f272, f273, f274, f275, f276, f277, f278, f279;
01897     real_t f280, f281, f282, f283, f284, f285, f286, f287, f288, f289;
01898     real_t f290, f291, f292, f293, f294, f295, f296, f297, f298, f299;
01899     real_t f300, f301, f302, f303, f304, f305, f306, f307, f308, f309;
01900     real_t f310, f311, f312, f313, f314, f315, f316, f317, f318, f319;
01901     real_t f320, f321, f322, f323, f324, f325, f326, f327, f328, f329;
01902     real_t f330, f331, f332, f333, f334, f335;
01903 
01904     f0 = x[0] - x[1];
01905     f1 = x[2] - x[1];
01906     f2 = x[2] - x[3];
01907     f3 = x[4] - x[3];
01908     f4 = x[4] - x[5];
01909     f5 = x[6] - x[5];
01910     f6 = x[6] - x[7];
01911     f7 = x[8] - x[7];
01912     f8 = x[8] - x[9];
01913     f9 = x[10] - x[9];
01914     f10 = x[10] - x[11];
01915     f11 = x[12] - x[11];
01916     f12 = x[12] - x[13];
01917     f13 = x[14] - x[13];
01918     f14 = x[14] - x[15];
01919     f15 = x[16] - x[15];
01920     f16 = x[16] - x[17];
01921     f17 = x[18] - x[17];
01922     f18 = x[18] - x[19];
01923     f19 = x[20] - x[19];
01924     f20 = x[20] - x[21];
01925     f21 = x[22] - x[21];
01926     f22 = x[22] - x[23];
01927     f23 = x[24] - x[23];
01928     f24 = x[24] - x[25];
01929     f25 = x[26] - x[25];
01930     f26 = x[26] - x[27];
01931     f27 = x[28] - x[27];
01932     f28 = x[28] - x[29];
01933     f29 = x[30] - x[29];
01934     f30 = x[30] - x[31];
01935     f31 = MUL_F(FRAC_CONST(0.7071067811865476), f15);
01936     f32 = x[0] - f31;
01937     f33 = x[0] + f31;
01938     f34 = f7 + f23;
01939     f35 = MUL_C(COEF_CONST(1.3065629648763766), f7);
01940     f36 = MUL_F(FRAC_CONST(-0.9238795325112866), f34);
01941     f37 = MUL_F(FRAC_CONST(-0.5411961001461967), f23);
01942     f38 = f35 + f36;
01943     f39 = f37 - f36;
01944     f40 = f33 - f39;
01945     f41 = f33 + f39;
01946     f42 = f32 - f38;
01947     f43 = f32 + f38;
01948     f44 = f11 - f19;
01949     f45 = f11 + f19;
01950     f46 = MUL_F(FRAC_CONST(0.7071067811865476), f45);
01951     f47 = f3 - f46;
01952     f48 = f3 + f46;
01953     f49 = MUL_F(FRAC_CONST(0.7071067811865476), f44);
01954     f50 = f49 - f27;
01955     f51 = f49 + f27;
01956     f52 = f51 + f48;
01957     f53 = MUL_F(FRAC_CONST(-0.7856949583871021), f51);
01958     f54 = MUL_F(FRAC_CONST(0.9807852804032304), f52);
01959     f55 = MUL_C(COEF_CONST(1.1758756024193588), f48);
01960     f56 = f53 + f54;
01961     f57 = f55 - f54;
01962     f58 = f50 + f47;
01963     f59 = MUL_F(FRAC_CONST(-0.2758993792829430), f50);
01964     f60 = MUL_F(FRAC_CONST(0.8314696123025452), f58);
01965     f61 = MUL_C(COEF_CONST(1.3870398453221475), f47);
01966     f62 = f59 + f60;
01967     f63 = f61 - f60;
01968     f64 = f41 - f56;
01969     f65 = f41 + f56;
01970     f66 = f43 - f62;
01971     f67 = f43 + f62;
01972     f68 = f42 - f63;
01973     f69 = f42 + f63;
01974     f70 = f40 - f57;
01975     f71 = f40 + f57;
01976     f72 = f5 - f9;
01977     f73 = f5 + f9;
01978     f74 = f13 - f17;
01979     f75 = f13 + f17;
01980     f76 = f21 - f25;
01981     f77 = f21 + f25;
01982     f78 = MUL_F(FRAC_CONST(0.7071067811865476), f75);
01983     f79 = f1 - f78;
01984     f80 = f1 + f78;
01985     f81 = f73 + f77;
01986     f82 = MUL_C(COEF_CONST(1.3065629648763766), f73);
01987     f83 = MUL_F(FRAC_CONST(-0.9238795325112866), f81);
01988     f84 = MUL_F(FRAC_CONST(-0.5411961001461967), f77);
01989     f85 = f82 + f83;
01990     f86 = f84 - f83;
01991     f87 = f80 - f86;
01992     f88 = f80 + f86;
01993     f89 = f79 - f85;
01994     f90 = f79 + f85;
01995     f91 = MUL_F(FRAC_CONST(0.7071067811865476), f74);
01996     f92 = f29 - f91;
01997     f93 = f29 + f91;
01998     f94 = f76 + f72;
01999     f95 = MUL_C(COEF_CONST(1.3065629648763766), f76);
02000     f96 = MUL_F(FRAC_CONST(-0.9238795325112866), f94);
02001     f97 = MUL_F(FRAC_CONST(-0.5411961001461967), f72);
02002     f98 = f95 + f96;
02003     f99 = f97 - f96;
02004     f100 = f93 - f99;
02005     f101 = f93 + f99;
02006     f102 = f92 - f98;
02007     f103 = f92 + f98;
02008     f104 = f101 + f88;
02009     f105 = MUL_F(FRAC_CONST(-0.8971675863426361), f101);
02010     f106 = MUL_F(FRAC_CONST(0.9951847266721968), f104);
02011     f107 = MUL_C(COEF_CONST(1.0932018670017576), f88);
02012     f108 = f105 + f106;
02013     f109 = f107 - f106;
02014     f110 = f90 - f103;
02015     f111 = MUL_F(FRAC_CONST(-0.6666556584777466), f103);
02016     f112 = MUL_F(FRAC_CONST(0.9569403357322089), f110);
02017     f113 = MUL_C(COEF_CONST(1.2472250129866713), f90);
02018     f114 = f112 - f111;
02019     f115 = f113 - f112;
02020     f116 = f102 + f89;
02021     f117 = MUL_F(FRAC_CONST(-0.4105245275223571), f102);
02022     f118 = MUL_F(FRAC_CONST(0.8819212643483549), f116);
02023     f119 = MUL_C(COEF_CONST(1.3533180011743529), f89);
02024     f120 = f117 + f118;
02025     f121 = f119 - f118;
02026     f122 = f87 - f100;
02027     f123 = MUL_F(FRAC_CONST(-0.1386171691990915), f100);
02028     f124 = MUL_F(FRAC_CONST(0.7730104533627370), f122);
02029     f125 = MUL_C(COEF_CONST(1.4074037375263826), f87);
02030     f126 = f124 - f123;
02031     f127 = f125 - f124;
02032     f128 = f65 - f108;
02033     f129 = f65 + f108;
02034     f130 = f67 - f114;
02035     f131 = f67 + f114;
02036     f132 = f69 - f120;
02037     f133 = f69 + f120;
02038     f134 = f71 - f126;
02039     f135 = f71 + f126;
02040     f136 = f70 - f127;
02041     f137 = f70 + f127;
02042     f138 = f68 - f121;
02043     f139 = f68 + f121;
02044     f140 = f66 - f115;
02045     f141 = f66 + f115;
02046     f142 = f64 - f109;
02047     f143 = f64 + f109;
02048     f144 = f0 + f30;
02049     f145 = MUL_C(COEF_CONST(1.0478631305325901), f0);
02050     f146 = MUL_F(FRAC_CONST(-0.9987954562051724), f144);
02051     f147 = MUL_F(FRAC_CONST(-0.9497277818777548), f30);
02052     f148 = f145 + f146;
02053     f149 = f147 - f146;
02054     f150 = f4 + f26;
02055     f151 = MUL_F(FRAC_CONST(1.2130114330978077), f4);
02056     f152 = MUL_F(FRAC_CONST(-0.9700312531945440), f150);
02057     f153 = MUL_F(FRAC_CONST(-0.7270510732912803), f26);
02058     f154 = f151 + f152;
02059     f155 = f153 - f152;
02060     f156 = f8 + f22;
02061     f157 = MUL_C(COEF_CONST(1.3315443865537255), f8);
02062     f158 = MUL_F(FRAC_CONST(-0.9039892931234433), f156);
02063     f159 = MUL_F(FRAC_CONST(-0.4764341996931612), f22);
02064     f160 = f157 + f158;
02065     f161 = f159 - f158;
02066     f162 = f12 + f18;
02067     f163 = MUL_C(COEF_CONST(1.3989068359730781), f12);
02068     f164 = MUL_F(FRAC_CONST(-0.8032075314806453), f162);
02069     f165 = MUL_F(FRAC_CONST(-0.2075082269882124), f18);
02070     f166 = f163 + f164;
02071     f167 = f165 - f164;
02072     f168 = f16 + f14;
02073     f169 = MUL_C(COEF_CONST(1.4125100802019777), f16);
02074     f170 = MUL_F(FRAC_CONST(-0.6715589548470187), f168);
02075     f171 = MUL_F(FRAC_CONST(0.0693921705079402), f14);
02076     f172 = f169 + f170;
02077     f173 = f171 - f170;
02078     f174 = f20 + f10;
02079     f175 = MUL_C(COEF_CONST(1.3718313541934939), f20);
02080     f176 = MUL_F(FRAC_CONST(-0.5141027441932219), f174);
02081     f177 = MUL_F(FRAC_CONST(0.3436258658070501), f10);
02082     f178 = f175 + f176;
02083     f179 = f177 - f176;
02084     f180 = f24 + f6;
02085     f181 = MUL_C(COEF_CONST(1.2784339185752409), f24);
02086     f182 = MUL_F(FRAC_CONST(-0.3368898533922200), f180);
02087     f183 = MUL_F(FRAC_CONST(0.6046542117908008), f6);
02088     f184 = f181 + f182;
02089     f185 = f183 - f182;
02090     f186 = f28 + f2;
02091     f187 = MUL_C(COEF_CONST(1.1359069844201433), f28);
02092     f188 = MUL_F(FRAC_CONST(-0.1467304744553624), f186);
02093     f189 = MUL_F(FRAC_CONST(0.8424460355094185), f2);
02094     f190 = f187 + f188;
02095     f191 = f189 - f188;
02096     f192 = f149 - f173;
02097     f193 = f149 + f173;
02098     f194 = f148 - f172;
02099     f195 = f148 + f172;
02100     f196 = f155 - f179;
02101     f197 = f155 + f179;
02102     f198 = f154 - f178;
02103     f199 = f154 + f178;
02104     f200 = f161 - f185;
02105     f201 = f161 + f185;
02106     f202 = f160 - f184;
02107     f203 = f160 + f184;
02108     f204 = f167 - f191;
02109     f205 = f167 + f191;
02110     f206 = f166 - f190;
02111     f207 = f166 + f190;
02112     f208 = f192 + f194;
02113     f209 = MUL_C(COEF_CONST(1.1758756024193588), f192);
02114     f210 = MUL_F(FRAC_CONST(-0.9807852804032304), f208);
02115     f211 = MUL_F(FRAC_CONST(-0.7856949583871021), f194);
02116     f212 = f209 + f210;
02117     f213 = f211 - f210;
02118     f214 = f196 + f198;
02119     f215 = MUL_C(COEF_CONST(1.3870398453221475), f196);
02120     f216 = MUL_F(FRAC_CONST(-0.5555702330196022), f214);
02121     f217 = MUL_F(FRAC_CONST(0.2758993792829431), f198);
02122     f218 = f215 + f216;
02123     f219 = f217 - f216;
02124     f220 = f200 + f202;
02125     f221 = MUL_F(FRAC_CONST(0.7856949583871022), f200);
02126     f222 = MUL_F(FRAC_CONST(0.1950903220161283), f220);
02127     f223 = MUL_C(COEF_CONST(1.1758756024193586), f202);
02128     f224 = f221 + f222;
02129     f225 = f223 - f222;
02130     f226 = f204 + f206;
02131     f227 = MUL_F(FRAC_CONST(-0.2758993792829430), f204);
02132     f228 = MUL_F(FRAC_CONST(0.8314696123025452), f226);
02133     f229 = MUL_C(COEF_CONST(1.3870398453221475), f206);
02134     f230 = f227 + f228;
02135     f231 = f229 - f228;
02136     f232 = f193 - f201;
02137     f233 = f193 + f201;
02138     f234 = f195 - f203;
02139     f235 = f195 + f203;
02140     f236 = f197 - f205;
02141     f237 = f197 + f205;
02142     f238 = f199 - f207;
02143     f239 = f199 + f207;
02144     f240 = f213 - f225;
02145     f241 = f213 + f225;
02146     f242 = f212 - f224;
02147     f243 = f212 + f224;
02148     f244 = f219 - f231;
02149     f245 = f219 + f231;
02150     f246 = f218 - f230;
02151     f247 = f218 + f230;
02152     f248 = f232 + f234;
02153     f249 = MUL_C(COEF_CONST(1.3065629648763766), f232);
02154     f250 = MUL_F(FRAC_CONST(-0.9238795325112866), f248);
02155     f251 = MUL_F(FRAC_CONST(-0.5411961001461967), f234);
02156     f252 = f249 + f250;
02157     f253 = f251 - f250;
02158     f254 = f236 + f238;
02159     f255 = MUL_F(FRAC_CONST(0.5411961001461969), f236);
02160     f256 = MUL_F(FRAC_CONST(0.3826834323650898), f254);
02161     f257 = MUL_C(COEF_CONST(1.3065629648763766), f238);
02162     f258 = f255 + f256;
02163     f259 = f257 - f256;
02164     f260 = f240 + f242;
02165     f261 = MUL_C(COEF_CONST(1.3065629648763766), f240);
02166     f262 = MUL_F(FRAC_CONST(-0.9238795325112866), f260);
02167     f263 = MUL_F(FRAC_CONST(-0.5411961001461967), f242);
02168     f264 = f261 + f262;
02169     f265 = f263 - f262;
02170     f266 = f244 + f246;
02171     f267 = MUL_F(FRAC_CONST(0.5411961001461969), f244);
02172     f268 = MUL_F(FRAC_CONST(0.3826834323650898), f266);
02173     f269 = MUL_C(COEF_CONST(1.3065629648763766), f246);
02174     f270 = f267 + f268;
02175     f271 = f269 - f268;
02176     f272 = f233 - f237;
02177     f273 = f233 + f237;
02178     f274 = f235 - f239;
02179     f275 = f235 + f239;
02180     f276 = f253 - f259;
02181     f277 = f253 + f259;
02182     f278 = f252 - f258;
02183     f279 = f252 + f258;
02184     f280 = f241 - f245;
02185     f281 = f241 + f245;
02186     f282 = f243 - f247;
02187     f283 = f243 + f247;
02188     f284 = f265 - f271;
02189     f285 = f265 + f271;
02190     f286 = f264 - f270;
02191     f287 = f264 + f270;
02192     f288 = f272 - f274;
02193     f289 = f272 + f274;
02194     f290 = MUL_F(FRAC_CONST(0.7071067811865474), f288);
02195     f291 = MUL_F(FRAC_CONST(0.7071067811865474), f289);
02196     f292 = f276 - f278;
02197     f293 = f276 + f278;
02198     f294 = MUL_F(FRAC_CONST(0.7071067811865474), f292);
02199     f295 = MUL_F(FRAC_CONST(0.7071067811865474), f293);
02200     f296 = f280 - f282;
02201     f297 = f280 + f282;
02202     f298 = MUL_F(FRAC_CONST(0.7071067811865474), f296);
02203     f299 = MUL_F(FRAC_CONST(0.7071067811865474), f297);
02204     f300 = f284 - f286;
02205     f301 = f284 + f286;
02206     f302 = MUL_F(FRAC_CONST(0.7071067811865474), f300);
02207     f303 = MUL_F(FRAC_CONST(0.7071067811865474), f301);
02208     f304 = f129 - f273;
02209     f305 = f129 + f273;
02210     f306 = f131 - f281;
02211     f307 = f131 + f281;
02212     f308 = f133 - f285;
02213     f309 = f133 + f285;
02214     f310 = f135 - f277;
02215     f311 = f135 + f277;
02216     f312 = f137 - f295;
02217     f313 = f137 + f295;
02218     f314 = f139 - f303;
02219     f315 = f139 + f303;
02220     f316 = f141 - f299;
02221     f317 = f141 + f299;
02222     f318 = f143 - f291;
02223     f319 = f143 + f291;
02224     f320 = f142 - f290;
02225     f321 = f142 + f290;
02226     f322 = f140 - f298;
02227     f323 = f140 + f298;
02228     f324 = f138 - f302;
02229     f325 = f138 + f302;
02230     f326 = f136 - f294;
02231     f327 = f136 + f294;
02232     f328 = f134 - f279;
02233     f329 = f134 + f279;
02234     f330 = f132 - f287;
02235     f331 = f132 + f287;
02236     f332 = f130 - f283;
02237     f333 = f130 + f283;
02238     f334 = f128 - f275;
02239     f335 = f128 + f275;
02240     y[31] = MUL_F(FRAC_CONST(0.5001506360206510), f305);
02241     y[30] = MUL_F(FRAC_CONST(0.5013584524464084), f307);
02242     y[29] = MUL_F(FRAC_CONST(0.5037887256810443), f309);
02243     y[28] = MUL_F(FRAC_CONST(0.5074711720725553), f311);
02244     y[27] = MUL_F(FRAC_CONST(0.5124514794082247), f313);
02245     y[26] = MUL_F(FRAC_CONST(0.5187927131053328), f315);
02246     y[25] = MUL_F(FRAC_CONST(0.5265773151542700), f317);
02247     y[24] = MUL_F(FRAC_CONST(0.5359098169079920), f319);
02248     y[23] = MUL_F(FRAC_CONST(0.5469204379855088), f321);
02249     y[22] = MUL_F(FRAC_CONST(0.5597698129470802), f323);
02250     y[21] = MUL_F(FRAC_CONST(0.5746551840326600), f325);
02251     y[20] = MUL_F(FRAC_CONST(0.5918185358574165), f327);
02252     y[19] = MUL_F(FRAC_CONST(0.6115573478825099), f329);
02253     y[18] = MUL_F(FRAC_CONST(0.6342389366884031), f331);
02254     y[17] = MUL_F(FRAC_CONST(0.6603198078137061), f333);
02255     y[16] = MUL_F(FRAC_CONST(0.6903721282002123), f335);
02256     y[15] = MUL_F(FRAC_CONST(0.7251205223771985), f334);
02257     y[14] = MUL_F(FRAC_CONST(0.7654941649730891), f332);
02258     y[13] = MUL_F(FRAC_CONST(0.8127020908144905), f330);
02259     y[12] = MUL_F(FRAC_CONST(0.8683447152233481), f328);
02260     y[11] = MUL_F(FRAC_CONST(0.9345835970364075), f326);
02261     y[10] = MUL_C(COEF_CONST(1.0144082649970547), f324);
02262     y[9] = MUL_C(COEF_CONST(1.1120716205797176), f322);
02263     y[8] = MUL_C(COEF_CONST(1.2338327379765710), f320);
02264     y[7] = MUL_C(COEF_CONST(1.3892939586328277), f318);
02265     y[6] = MUL_C(COEF_CONST(1.5939722833856311), f316);
02266     y[5] = MUL_C(COEF_CONST(1.8746759800084078), f314);
02267     y[4] = MUL_C(COEF_CONST(2.2820500680051619), f312);
02268     y[3] = MUL_C(COEF_CONST(2.9246284281582162), f310);
02269     y[2] = MUL_C(COEF_CONST(4.0846110781292477), f308);
02270     y[1] = MUL_C(COEF_CONST(6.7967507116736332), f306);
02271     y[0] = MUL_R(REAL_CONST(20.3738781672314530), f304);
02272 }
02273 
02274 #endif
02275 
02276 #endif

Generated on Tue Dec 13 14:47:44 2005 for guliverkli by  doxygen 1.4.5