56#ifdef DCT_ISLOW_SUPPORTED
100#if BITS_IN_JSAMPLE == 8
116#define FIX_0_298631336 ((INT32) 2446)
117#define FIX_0_390180644 ((INT32) 3196)
118#define FIX_0_541196100 ((INT32) 4433)
119#define FIX_0_765366865 ((INT32) 6270)
120#define FIX_0_899976223 ((INT32) 7373)
121#define FIX_1_175875602 ((INT32) 9633)
122#define FIX_1_501321110 ((INT32) 12299)
123#define FIX_1_847759065 ((INT32) 15137)
124#define FIX_1_961570560 ((INT32) 16069)
125#define FIX_2_053119869 ((INT32) 16819)
126#define FIX_2_562915447 ((INT32) 20995)
127#define FIX_3_072711026 ((INT32) 25172)
129#define FIX_0_298631336 FIX(0.298631336)
130#define FIX_0_390180644 FIX(0.390180644)
131#define FIX_0_541196100 FIX(0.541196100)
132#define FIX_0_765366865 FIX(0.765366865)
133#define FIX_0_899976223 FIX(0.899976223)
134#define FIX_1_175875602 FIX(1.175875602)
135#define FIX_1_501321110 FIX(1.501321110)
136#define FIX_1_847759065 FIX(1.847759065)
137#define FIX_1_961570560 FIX(1.961570560)
138#define FIX_2_053119869 FIX(2.053119869)
139#define FIX_2_562915447 FIX(2.562915447)
140#define FIX_3_072711026 FIX(3.072711026)
151#if BITS_IN_JSAMPLE == 8
152#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
154#define MULTIPLY(var,const) ((var) * (const))
163#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
178 INT32 tmp0, tmp1, tmp2, tmp3;
179 INT32 tmp10, tmp11, tmp12, tmp13;
213 int dcval = DEQUANTIZE(inptr[
DCTSIZE*0], quantptr[
DCTSIZE*0]) << PASS1_BITS;
239 z2 +=
ONE << (CONST_BITS-PASS1_BITS-1);
247 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
248 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
249 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
268 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
269 z2 = MULTIPLY(z2, - FIX_1_961570560);
270 z3 = MULTIPLY(z3, - FIX_0_390180644);
274 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
275 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
276 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
280 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
281 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
282 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
308 for (ctr = 0; ctr <
DCTSIZE; ctr++) {
312 z2 = (
INT32) wsptr[0] +
314 (
ONE << (PASS1_BITS+2)));
324#ifndef NO_ZERO_ROW_TEST
325 if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
326 wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
349 z3 = (
INT32) wsptr[4];
351 tmp0 = (z2 + z3) << CONST_BITS;
352 tmp1 = (z2 - z3) << CONST_BITS;
354 z2 = (
INT32) wsptr[2];
355 z3 = (
INT32) wsptr[6];
357 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
358 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
359 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
370 tmp0 = (
INT32) wsptr[7];
371 tmp1 = (
INT32) wsptr[5];
372 tmp2 = (
INT32) wsptr[3];
373 tmp3 = (
INT32) wsptr[1];
378 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
379 z2 = MULTIPLY(z2, - FIX_1_961570560);
380 z3 = MULTIPLY(z3, - FIX_0_390180644);
384 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
385 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
386 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
390 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
391 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
392 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
399 CONST_BITS+PASS1_BITS+3)
402 CONST_BITS+PASS1_BITS+3)
405 CONST_BITS+PASS1_BITS+3)
408 CONST_BITS+PASS1_BITS+3)
411 CONST_BITS+PASS1_BITS+3)
414 CONST_BITS+PASS1_BITS+3)
417 CONST_BITS+PASS1_BITS+3)
420 CONST_BITS+PASS1_BITS+3)
427#ifdef IDCT_SCALING_SUPPORTED
443 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;
459 for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {
463 tmp13 <<= CONST_BITS;
465 tmp13 +=
ONE << (CONST_BITS-PASS1_BITS-1);
471 tmp10 = MULTIPLY(z2 - z3,
FIX(0.881747734));
472 tmp12 = MULTIPLY(z1 - z2,
FIX(0.314692123));
473 tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2,
FIX(1.841218003));
476 tmp0 = MULTIPLY(tmp0,
FIX(1.274162392)) + tmp13;
477 tmp10 += tmp0 - MULTIPLY(z3,
FIX(0.077722536));
478 tmp12 += tmp0 - MULTIPLY(z1,
FIX(2.470602249));
479 tmp13 += MULTIPLY(z2,
FIX(1.414213562));
487 tmp1 = MULTIPLY(z1 + z2,
FIX(0.935414347));
488 tmp2 = MULTIPLY(z1 - z2,
FIX(0.170262339));
491 tmp2 = MULTIPLY(z2 + z3, -
FIX(1.378756276));
493 z2 = MULTIPLY(z1 + z3,
FIX(0.613604268));
495 tmp2 += z2 + MULTIPLY(z3,
FIX(1.870828693));
499 wsptr[7*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
500 wsptr[7*6] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
501 wsptr[7*1] = (
int)
RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
502 wsptr[7*5] = (
int)
RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
503 wsptr[7*2] = (
int)
RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
504 wsptr[7*4] = (
int)
RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
511 for (ctr = 0; ctr < 7; ctr++) {
517 tmp13 = (
INT32) wsptr[0] +
519 (
ONE << (PASS1_BITS+2)));
520 tmp13 <<= CONST_BITS;
522 z1 = (
INT32) wsptr[2];
523 z2 = (
INT32) wsptr[4];
524 z3 = (
INT32) wsptr[6];
526 tmp10 = MULTIPLY(z2 - z3,
FIX(0.881747734));
527 tmp12 = MULTIPLY(z1 - z2,
FIX(0.314692123));
528 tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2,
FIX(1.841218003));
531 tmp0 = MULTIPLY(tmp0,
FIX(1.274162392)) + tmp13;
532 tmp10 += tmp0 - MULTIPLY(z3,
FIX(0.077722536));
533 tmp12 += tmp0 - MULTIPLY(z1,
FIX(2.470602249));
534 tmp13 += MULTIPLY(z2,
FIX(1.414213562));
538 z1 = (
INT32) wsptr[1];
539 z2 = (
INT32) wsptr[3];
540 z3 = (
INT32) wsptr[5];
542 tmp1 = MULTIPLY(z1 + z2,
FIX(0.935414347));
543 tmp2 = MULTIPLY(z1 - z2,
FIX(0.170262339));
546 tmp2 = MULTIPLY(z2 + z3, -
FIX(1.378756276));
548 z2 = MULTIPLY(z1 + z3,
FIX(0.613604268));
550 tmp2 += z2 + MULTIPLY(z3,
FIX(1.870828693));
555 CONST_BITS+PASS1_BITS+3)
558 CONST_BITS+PASS1_BITS+3)
561 CONST_BITS+PASS1_BITS+3)
564 CONST_BITS+PASS1_BITS+3)
567 CONST_BITS+PASS1_BITS+3)
570 CONST_BITS+PASS1_BITS+3)
573 CONST_BITS+PASS1_BITS+3)
594 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
610 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
616 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
618 tmp10 = MULTIPLY(tmp2,
FIX(0.707106781));
620 tmp11 =
RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);
622 tmp0 = MULTIPLY(tmp10,
FIX(1.224744871));
631 tmp1 = MULTIPLY(z1 + z3,
FIX(0.366025404));
632 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
633 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
634 tmp1 = (z1 - z2 - z3) << PASS1_BITS;
638 wsptr[6*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
639 wsptr[6*5] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
640 wsptr[6*1] = (
int) (tmp11 + tmp1);
641 wsptr[6*4] = (
int) (tmp11 - tmp1);
642 wsptr[6*2] = (
int)
RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
643 wsptr[6*3] = (
int)
RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
649 for (ctr = 0; ctr < 6; ctr++) {
655 tmp0 = (
INT32) wsptr[0] +
657 (
ONE << (PASS1_BITS+2)));
659 tmp2 = (
INT32) wsptr[4];
660 tmp10 = MULTIPLY(tmp2,
FIX(0.707106781));
662 tmp11 = tmp0 - tmp10 - tmp10;
663 tmp10 = (
INT32) wsptr[2];
664 tmp0 = MULTIPLY(tmp10,
FIX(1.224744871));
670 z1 = (
INT32) wsptr[1];
671 z2 = (
INT32) wsptr[3];
672 z3 = (
INT32) wsptr[5];
673 tmp1 = MULTIPLY(z1 + z3,
FIX(0.366025404));
674 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
675 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
676 tmp1 = (z1 - z2 - z3) << CONST_BITS;
681 CONST_BITS+PASS1_BITS+3)
684 CONST_BITS+PASS1_BITS+3)
687 CONST_BITS+PASS1_BITS+3)
690 CONST_BITS+PASS1_BITS+3)
693 CONST_BITS+PASS1_BITS+3)
696 CONST_BITS+PASS1_BITS+3)
717 INT32 tmp0, tmp1, tmp10, tmp11, tmp12;
733 for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
737 tmp12 <<= CONST_BITS;
739 tmp12 +=
ONE << (CONST_BITS-PASS1_BITS-1);
742 z1 = MULTIPLY(tmp0 + tmp1,
FIX(0.790569415));
743 z2 = MULTIPLY(tmp0 - tmp1,
FIX(0.353553391));
754 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
755 tmp0 = z1 + MULTIPLY(z2,
FIX(0.513743148));
756 tmp1 = z1 - MULTIPLY(z3,
FIX(2.176250899));
760 wsptr[5*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
761 wsptr[5*4] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
762 wsptr[5*1] = (
int)
RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
763 wsptr[5*3] = (
int)
RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
770 for (ctr = 0; ctr < 5; ctr++) {
776 tmp12 = (
INT32) wsptr[0] +
778 (
ONE << (PASS1_BITS+2)));
779 tmp12 <<= CONST_BITS;
780 tmp0 = (
INT32) wsptr[2];
781 tmp1 = (
INT32) wsptr[4];
782 z1 = MULTIPLY(tmp0 + tmp1,
FIX(0.790569415));
783 z2 = MULTIPLY(tmp0 - tmp1,
FIX(0.353553391));
791 z2 = (
INT32) wsptr[1];
792 z3 = (
INT32) wsptr[3];
794 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
795 tmp0 = z1 + MULTIPLY(z2,
FIX(0.513743148));
796 tmp1 = z1 - MULTIPLY(z3,
FIX(2.176250899));
801 CONST_BITS+PASS1_BITS+3)
804 CONST_BITS+PASS1_BITS+3)
807 CONST_BITS+PASS1_BITS+3)
810 CONST_BITS+PASS1_BITS+3)
813 CONST_BITS+PASS1_BITS+3)
834 INT32 tmp0, tmp2, tmp10, tmp12;
850 for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {
856 tmp10 = (tmp0 + tmp2) << PASS1_BITS;
857 tmp12 = (tmp0 - tmp2) << PASS1_BITS;
865 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
867 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
868 tmp0 =
RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865),
869 CONST_BITS-PASS1_BITS);
870 tmp2 =
RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065),
871 CONST_BITS-PASS1_BITS);
875 wsptr[4*0] = (
int) (tmp10 + tmp0);
876 wsptr[4*3] = (
int) (tmp10 - tmp0);
877 wsptr[4*1] = (
int) (tmp12 + tmp2);
878 wsptr[4*2] = (
int) (tmp12 - tmp2);
884 for (ctr = 0; ctr < 4; ctr++) {
890 tmp0 = (
INT32) wsptr[0] +
892 (
ONE << (PASS1_BITS+2)));
893 tmp2 = (
INT32) wsptr[2];
895 tmp10 = (tmp0 + tmp2) << CONST_BITS;
896 tmp12 = (tmp0 - tmp2) << CONST_BITS;
901 z2 = (
INT32) wsptr[1];
902 z3 = (
INT32) wsptr[3];
904 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
905 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865);
906 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065);
911 CONST_BITS+PASS1_BITS+3)
914 CONST_BITS+PASS1_BITS+3)
917 CONST_BITS+PASS1_BITS+3)
920 CONST_BITS+PASS1_BITS+3)
941 INT32 tmp0, tmp2, tmp10, tmp12;
956 for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {
962 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
964 tmp12 = MULTIPLY(tmp2,
FIX(0.707106781));
965 tmp10 = tmp0 + tmp12;
966 tmp2 = tmp0 - tmp12 - tmp12;
971 tmp0 = MULTIPLY(tmp12,
FIX(1.224744871));
975 wsptr[3*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
976 wsptr[3*2] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
983 for (ctr = 0; ctr < 3; ctr++) {
989 tmp0 = (
INT32) wsptr[0] +
991 (
ONE << (PASS1_BITS+2)));
993 tmp2 = (
INT32) wsptr[2];
994 tmp12 = MULTIPLY(tmp2,
FIX(0.707106781));
995 tmp10 = tmp0 + tmp12;
996 tmp2 = tmp0 - tmp12 - tmp12;
1000 tmp12 = (
INT32) wsptr[1];
1001 tmp0 = MULTIPLY(tmp12,
FIX(1.224744871));
1006 CONST_BITS+PASS1_BITS+3)
1009 CONST_BITS+PASS1_BITS+3)
1012 CONST_BITS+PASS1_BITS+3)
1032 DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
1096 dcval = DEQUANTIZE(
coef_block[0], quantptr[0]);
1118 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;
1119 INT32 z1, z2, z3, z4;
1134 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1138 tmp0 <<= CONST_BITS;
1140 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
1146 tmp3 = MULTIPLY(z3,
FIX(0.707106781));
1148 tmp2 = tmp0 - tmp3 - tmp3;
1150 tmp0 = MULTIPLY(z1 - z2,
FIX(0.707106781));
1151 tmp11 = tmp2 + tmp0;
1152 tmp14 = tmp2 - tmp0 - tmp0;
1154 tmp0 = MULTIPLY(z1 + z2,
FIX(1.328926049));
1155 tmp2 = MULTIPLY(z1,
FIX(1.083350441));
1156 tmp3 = MULTIPLY(z2,
FIX(0.245575608));
1158 tmp10 = tmp1 + tmp0 - tmp3;
1159 tmp12 = tmp1 - tmp0 + tmp2;
1160 tmp13 = tmp1 - tmp2 + tmp3;
1169 z2 = MULTIPLY(z2, -
FIX(1.224744871));
1171 tmp2 = MULTIPLY(z1 + z3,
FIX(0.909038955));
1172 tmp3 = MULTIPLY(z1 + z4,
FIX(0.483689525));
1173 tmp0 = tmp2 + tmp3 - z2;
1174 tmp1 = MULTIPLY(z3 - z4,
FIX(1.392728481));
1177 tmp1 = MULTIPLY(z1 - z3 - z4,
FIX(1.224744871));
1181 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
1182 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
1183 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);
1184 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);
1185 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
1186 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
1187 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS);
1188 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS);
1195 for (ctr = 0; ctr < 9; ctr++) {
1201 tmp0 = (
INT32) wsptr[0] +
1203 (
ONE << (PASS1_BITS+2)));
1204 tmp0 <<= CONST_BITS;
1206 z1 = (
INT32) wsptr[2];
1207 z2 = (
INT32) wsptr[4];
1208 z3 = (
INT32) wsptr[6];
1210 tmp3 = MULTIPLY(z3,
FIX(0.707106781));
1212 tmp2 = tmp0 - tmp3 - tmp3;
1214 tmp0 = MULTIPLY(z1 - z2,
FIX(0.707106781));
1215 tmp11 = tmp2 + tmp0;
1216 tmp14 = tmp2 - tmp0 - tmp0;
1218 tmp0 = MULTIPLY(z1 + z2,
FIX(1.328926049));
1219 tmp2 = MULTIPLY(z1,
FIX(1.083350441));
1220 tmp3 = MULTIPLY(z2,
FIX(0.245575608));
1222 tmp10 = tmp1 + tmp0 - tmp3;
1223 tmp12 = tmp1 - tmp0 + tmp2;
1224 tmp13 = tmp1 - tmp2 + tmp3;
1228 z1 = (
INT32) wsptr[1];
1229 z2 = (
INT32) wsptr[3];
1230 z3 = (
INT32) wsptr[5];
1231 z4 = (
INT32) wsptr[7];
1233 z2 = MULTIPLY(z2, -
FIX(1.224744871));
1235 tmp2 = MULTIPLY(z1 + z3,
FIX(0.909038955));
1236 tmp3 = MULTIPLY(z1 + z4,
FIX(0.483689525));
1237 tmp0 = tmp2 + tmp3 - z2;
1238 tmp1 = MULTIPLY(z3 - z4,
FIX(1.392728481));
1241 tmp1 = MULTIPLY(z1 - z3 - z4,
FIX(1.224744871));
1246 CONST_BITS+PASS1_BITS+3)
1249 CONST_BITS+PASS1_BITS+3)
1252 CONST_BITS+PASS1_BITS+3)
1255 CONST_BITS+PASS1_BITS+3)
1258 CONST_BITS+PASS1_BITS+3)
1261 CONST_BITS+PASS1_BITS+3)
1264 CONST_BITS+PASS1_BITS+3)
1267 CONST_BITS+PASS1_BITS+3)
1270 CONST_BITS+PASS1_BITS+3)
1291 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1292 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
1293 INT32 z1, z2, z3, z4, z5;
1300 int workspace[8*10];
1308 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1314 z3 +=
ONE << (CONST_BITS-PASS1_BITS-1);
1316 z1 = MULTIPLY(z4,
FIX(1.144122806));
1317 z2 = MULTIPLY(z4,
FIX(0.437016024));
1322 CONST_BITS-PASS1_BITS);
1327 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
1328 tmp12 = z1 + MULTIPLY(z2,
FIX(0.513743148));
1329 tmp13 = z1 - MULTIPLY(z3,
FIX(2.176250899));
1331 tmp20 = tmp10 + tmp12;
1332 tmp24 = tmp10 - tmp12;
1333 tmp21 = tmp11 + tmp13;
1334 tmp23 = tmp11 - tmp13;
1346 tmp12 = MULTIPLY(tmp13,
FIX(0.309016994));
1347 z5 = z3 << CONST_BITS;
1349 z2 = MULTIPLY(tmp11,
FIX(0.951056516));
1352 tmp10 = MULTIPLY(z1,
FIX(1.396802247)) + z2 + z4;
1353 tmp14 = MULTIPLY(z1,
FIX(0.221231742)) - z2 + z4;
1355 z2 = MULTIPLY(tmp11,
FIX(0.587785252));
1356 z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));
1358 tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;
1360 tmp11 = MULTIPLY(z1,
FIX(1.260073511)) - z2 - z4;
1361 tmp13 = MULTIPLY(z1,
FIX(0.642039522)) - z2 + z4;
1365 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1366 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1367 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1368 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1369 wsptr[8*2] = (
int) (tmp22 + tmp12);
1370 wsptr[8*7] = (
int) (tmp22 - tmp12);
1371 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1372 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1373 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1374 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1380 for (ctr = 0; ctr < 10; ctr++) {
1386 z3 = (
INT32) wsptr[0] +
1388 (
ONE << (PASS1_BITS+2)));
1390 z4 = (
INT32) wsptr[4];
1391 z1 = MULTIPLY(z4,
FIX(1.144122806));
1392 z2 = MULTIPLY(z4,
FIX(0.437016024));
1396 tmp22 = z3 - ((z1 - z2) << 1);
1398 z2 = (
INT32) wsptr[2];
1399 z3 = (
INT32) wsptr[6];
1401 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
1402 tmp12 = z1 + MULTIPLY(z2,
FIX(0.513743148));
1403 tmp13 = z1 - MULTIPLY(z3,
FIX(2.176250899));
1405 tmp20 = tmp10 + tmp12;
1406 tmp24 = tmp10 - tmp12;
1407 tmp21 = tmp11 + tmp13;
1408 tmp23 = tmp11 - tmp13;
1412 z1 = (
INT32) wsptr[1];
1413 z2 = (
INT32) wsptr[3];
1414 z3 = (
INT32) wsptr[5];
1416 z4 = (
INT32) wsptr[7];
1421 tmp12 = MULTIPLY(tmp13,
FIX(0.309016994));
1423 z2 = MULTIPLY(tmp11,
FIX(0.951056516));
1426 tmp10 = MULTIPLY(z1,
FIX(1.396802247)) + z2 + z4;
1427 tmp14 = MULTIPLY(z1,
FIX(0.221231742)) - z2 + z4;
1429 z2 = MULTIPLY(tmp11,
FIX(0.587785252));
1430 z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));
1432 tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;
1434 tmp11 = MULTIPLY(z1,
FIX(1.260073511)) - z2 - z4;
1435 tmp13 = MULTIPLY(z1,
FIX(0.642039522)) - z2 + z4;
1440 CONST_BITS+PASS1_BITS+3)
1443 CONST_BITS+PASS1_BITS+3)
1446 CONST_BITS+PASS1_BITS+3)
1449 CONST_BITS+PASS1_BITS+3)
1452 CONST_BITS+PASS1_BITS+3)
1455 CONST_BITS+PASS1_BITS+3)
1458 CONST_BITS+PASS1_BITS+3)
1461 CONST_BITS+PASS1_BITS+3)
1464 CONST_BITS+PASS1_BITS+3)
1467 CONST_BITS+PASS1_BITS+3)
1488 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
1489 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1490 INT32 z1, z2, z3, z4;
1497 int workspace[8*11];
1505 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1509 tmp10 <<= CONST_BITS;
1511 tmp10 +=
ONE << (CONST_BITS-PASS1_BITS-1);
1517 tmp20 = MULTIPLY(z2 - z3,
FIX(2.546640132));
1518 tmp23 = MULTIPLY(z2 - z1,
FIX(0.430815045));
1520 tmp24 = MULTIPLY(z4, -
FIX(1.155664402));
1522 tmp25 = tmp10 + MULTIPLY(z4,
FIX(1.356927976));
1523 tmp21 = tmp20 + tmp23 + tmp25 -
1524 MULTIPLY(z2,
FIX(1.821790775));
1525 tmp20 += tmp25 + MULTIPLY(z3,
FIX(2.115825087));
1526 tmp23 += tmp25 - MULTIPLY(z1,
FIX(1.513598477));
1528 tmp22 = tmp24 - MULTIPLY(z3,
FIX(0.788749120));
1529 tmp24 += MULTIPLY(z2,
FIX(1.944413522)) -
1530 MULTIPLY(z1,
FIX(1.390975730));
1531 tmp25 = tmp10 - MULTIPLY(z4,
FIX(1.414213562));
1541 tmp14 = MULTIPLY(tmp11 + z3 + z4,
FIX(0.398430003));
1542 tmp11 = MULTIPLY(tmp11,
FIX(0.887983902));
1543 tmp12 = MULTIPLY(z1 + z3,
FIX(0.670361295));
1544 tmp13 = tmp14 + MULTIPLY(z1 + z4,
FIX(0.366151574));
1545 tmp10 = tmp11 + tmp12 + tmp13 -
1546 MULTIPLY(z1,
FIX(0.923107866));
1547 z1 = tmp14 - MULTIPLY(z2 + z3,
FIX(1.163011579));
1548 tmp11 += z1 + MULTIPLY(z2,
FIX(2.073276588));
1549 tmp12 += z1 - MULTIPLY(z3,
FIX(1.192193623));
1550 z1 = MULTIPLY(z2 + z4, -
FIX(1.798248910));
1552 tmp13 += z1 + MULTIPLY(z4,
FIX(2.102458632));
1553 tmp14 += MULTIPLY(z2, -
FIX(1.467221301)) +
1554 MULTIPLY(z3,
FIX(1.001388905)) -
1555 MULTIPLY(z4,
FIX(1.684843907));
1559 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1560 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1561 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1562 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1563 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1564 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1565 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1566 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1567 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1568 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1575 for (ctr = 0; ctr < 11; ctr++) {
1581 tmp10 = (
INT32) wsptr[0] +
1583 (
ONE << (PASS1_BITS+2)));
1584 tmp10 <<= CONST_BITS;
1586 z1 = (
INT32) wsptr[2];
1587 z2 = (
INT32) wsptr[4];
1588 z3 = (
INT32) wsptr[6];
1590 tmp20 = MULTIPLY(z2 - z3,
FIX(2.546640132));
1591 tmp23 = MULTIPLY(z2 - z1,
FIX(0.430815045));
1593 tmp24 = MULTIPLY(z4, -
FIX(1.155664402));
1595 tmp25 = tmp10 + MULTIPLY(z4,
FIX(1.356927976));
1596 tmp21 = tmp20 + tmp23 + tmp25 -
1597 MULTIPLY(z2,
FIX(1.821790775));
1598 tmp20 += tmp25 + MULTIPLY(z3,
FIX(2.115825087));
1599 tmp23 += tmp25 - MULTIPLY(z1,
FIX(1.513598477));
1601 tmp22 = tmp24 - MULTIPLY(z3,
FIX(0.788749120));
1602 tmp24 += MULTIPLY(z2,
FIX(1.944413522)) -
1603 MULTIPLY(z1,
FIX(1.390975730));
1604 tmp25 = tmp10 - MULTIPLY(z4,
FIX(1.414213562));
1608 z1 = (
INT32) wsptr[1];
1609 z2 = (
INT32) wsptr[3];
1610 z3 = (
INT32) wsptr[5];
1611 z4 = (
INT32) wsptr[7];
1614 tmp14 = MULTIPLY(tmp11 + z3 + z4,
FIX(0.398430003));
1615 tmp11 = MULTIPLY(tmp11,
FIX(0.887983902));
1616 tmp12 = MULTIPLY(z1 + z3,
FIX(0.670361295));
1617 tmp13 = tmp14 + MULTIPLY(z1 + z4,
FIX(0.366151574));
1618 tmp10 = tmp11 + tmp12 + tmp13 -
1619 MULTIPLY(z1,
FIX(0.923107866));
1620 z1 = tmp14 - MULTIPLY(z2 + z3,
FIX(1.163011579));
1621 tmp11 += z1 + MULTIPLY(z2,
FIX(2.073276588));
1622 tmp12 += z1 - MULTIPLY(z3,
FIX(1.192193623));
1623 z1 = MULTIPLY(z2 + z4, -
FIX(1.798248910));
1625 tmp13 += z1 + MULTIPLY(z4,
FIX(2.102458632));
1626 tmp14 += MULTIPLY(z2, -
FIX(1.467221301)) +
1627 MULTIPLY(z3,
FIX(1.001388905)) -
1628 MULTIPLY(z4,
FIX(1.684843907));
1633 CONST_BITS+PASS1_BITS+3)
1636 CONST_BITS+PASS1_BITS+3)
1639 CONST_BITS+PASS1_BITS+3)
1642 CONST_BITS+PASS1_BITS+3)
1645 CONST_BITS+PASS1_BITS+3)
1648 CONST_BITS+PASS1_BITS+3)
1651 CONST_BITS+PASS1_BITS+3)
1654 CONST_BITS+PASS1_BITS+3)
1657 CONST_BITS+PASS1_BITS+3)
1660 CONST_BITS+PASS1_BITS+3)
1663 CONST_BITS+PASS1_BITS+3)
1684 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1685 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
1686 INT32 z1, z2, z3, z4;
1693 int workspace[8*12];
1701 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1707 z3 +=
ONE << (CONST_BITS-PASS1_BITS-1);
1710 z4 = MULTIPLY(z4,
FIX(1.224744871));
1716 z4 = MULTIPLY(z1,
FIX(1.366025404));
1728 tmp20 = tmp10 + tmp12;
1729 tmp25 = tmp10 - tmp12;
1731 tmp12 = z4 - z1 - z2;
1733 tmp22 = tmp11 + tmp12;
1734 tmp23 = tmp11 - tmp12;
1743 tmp11 = MULTIPLY(z2,
FIX(1.306562965));
1744 tmp14 = MULTIPLY(z2, - FIX_0_541196100);
1747 tmp15 = MULTIPLY(tmp10 + z4,
FIX(0.860918669));
1748 tmp12 = tmp15 + MULTIPLY(tmp10,
FIX(0.261052384));
1749 tmp10 = tmp12 + tmp11 + MULTIPLY(z1,
FIX(0.280143716));
1750 tmp13 = MULTIPLY(z3 + z4, -
FIX(1.045510580));
1751 tmp12 += tmp13 + tmp14 - MULTIPLY(z3,
FIX(1.478575242));
1752 tmp13 += tmp15 - tmp11 + MULTIPLY(z4,
FIX(1.586706681));
1753 tmp15 += tmp14 - MULTIPLY(z1,
FIX(0.676326758)) -
1754 MULTIPLY(z4,
FIX(1.982889723));
1758 z3 = MULTIPLY(z1 + z2, FIX_0_541196100);
1759 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);
1760 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);
1764 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1765 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1766 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1767 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1768 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1769 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1770 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1771 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1772 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1773 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1774 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
1775 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
1781 for (ctr = 0; ctr < 12; ctr++) {
1787 z3 = (
INT32) wsptr[0] +
1789 (
ONE << (PASS1_BITS+2)));
1792 z4 = (
INT32) wsptr[4];
1793 z4 = MULTIPLY(z4,
FIX(1.224744871));
1798 z1 = (
INT32) wsptr[2];
1799 z4 = MULTIPLY(z1,
FIX(1.366025404));
1801 z2 = (
INT32) wsptr[6];
1811 tmp20 = tmp10 + tmp12;
1812 tmp25 = tmp10 - tmp12;
1814 tmp12 = z4 - z1 - z2;
1816 tmp22 = tmp11 + tmp12;
1817 tmp23 = tmp11 - tmp12;
1821 z1 = (
INT32) wsptr[1];
1822 z2 = (
INT32) wsptr[3];
1823 z3 = (
INT32) wsptr[5];
1824 z4 = (
INT32) wsptr[7];
1826 tmp11 = MULTIPLY(z2,
FIX(1.306562965));
1827 tmp14 = MULTIPLY(z2, - FIX_0_541196100);
1830 tmp15 = MULTIPLY(tmp10 + z4,
FIX(0.860918669));
1831 tmp12 = tmp15 + MULTIPLY(tmp10,
FIX(0.261052384));
1832 tmp10 = tmp12 + tmp11 + MULTIPLY(z1,
FIX(0.280143716));
1833 tmp13 = MULTIPLY(z3 + z4, -
FIX(1.045510580));
1834 tmp12 += tmp13 + tmp14 - MULTIPLY(z3,
FIX(1.478575242));
1835 tmp13 += tmp15 - tmp11 + MULTIPLY(z4,
FIX(1.586706681));
1836 tmp15 += tmp14 - MULTIPLY(z1,
FIX(0.676326758)) -
1837 MULTIPLY(z4,
FIX(1.982889723));
1841 z3 = MULTIPLY(z1 + z2, FIX_0_541196100);
1842 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);
1843 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);
1848 CONST_BITS+PASS1_BITS+3)
1851 CONST_BITS+PASS1_BITS+3)
1854 CONST_BITS+PASS1_BITS+3)
1857 CONST_BITS+PASS1_BITS+3)
1860 CONST_BITS+PASS1_BITS+3)
1863 CONST_BITS+PASS1_BITS+3)
1866 CONST_BITS+PASS1_BITS+3)
1869 CONST_BITS+PASS1_BITS+3)
1872 CONST_BITS+PASS1_BITS+3)
1875 CONST_BITS+PASS1_BITS+3)
1878 CONST_BITS+PASS1_BITS+3)
1881 CONST_BITS+PASS1_BITS+3)
1902 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
1903 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
1904 INT32 z1, z2, z3, z4;
1911 int workspace[8*13];
1919 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
1925 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
1934 tmp12 = MULTIPLY(tmp10,
FIX(1.155388986));
1935 tmp13 = MULTIPLY(tmp11,
FIX(0.096834934)) + z1;
1937 tmp20 = MULTIPLY(z2,
FIX(1.373119086)) + tmp12 + tmp13;
1938 tmp22 = MULTIPLY(z2,
FIX(0.501487041)) - tmp12 + tmp13;
1940 tmp12 = MULTIPLY(tmp10,
FIX(0.316450131));
1941 tmp13 = MULTIPLY(tmp11,
FIX(0.486914739)) + z1;
1943 tmp21 = MULTIPLY(z2,
FIX(1.058554052)) - tmp12 + tmp13;
1944 tmp25 = MULTIPLY(z2, -
FIX(1.252223920)) + tmp12 + tmp13;
1946 tmp12 = MULTIPLY(tmp10,
FIX(0.435816023));
1947 tmp13 = MULTIPLY(tmp11,
FIX(0.937303064)) - z1;
1949 tmp23 = MULTIPLY(z2, -
FIX(0.170464608)) - tmp12 - tmp13;
1950 tmp24 = MULTIPLY(z2, -
FIX(0.803364869)) + tmp12 - tmp13;
1952 tmp26 = MULTIPLY(tmp11 - z2,
FIX(1.414213562)) + z1;
1961 tmp11 = MULTIPLY(z1 + z2,
FIX(1.322312651));
1962 tmp12 = MULTIPLY(z1 + z3,
FIX(1.163874945));
1964 tmp13 = MULTIPLY(tmp15,
FIX(0.937797057));
1965 tmp10 = tmp11 + tmp12 + tmp13 -
1966 MULTIPLY(z1,
FIX(2.020082300));
1967 tmp14 = MULTIPLY(z2 + z3, -
FIX(0.338443458));
1968 tmp11 += tmp14 + MULTIPLY(z2,
FIX(0.837223564));
1969 tmp12 += tmp14 - MULTIPLY(z3,
FIX(1.572116027));
1970 tmp14 = MULTIPLY(z2 + z4, -
FIX(1.163874945));
1972 tmp13 += tmp14 + MULTIPLY(z4,
FIX(2.205608352));
1973 tmp14 = MULTIPLY(z3 + z4, -
FIX(0.657217813));
1976 tmp15 = MULTIPLY(tmp15,
FIX(0.338443458));
1977 tmp14 = tmp15 + MULTIPLY(z1,
FIX(0.318774355)) -
1978 MULTIPLY(z2,
FIX(0.466105296));
1979 z1 = MULTIPLY(z3 - z2,
FIX(0.937797057));
1981 tmp15 += z1 + MULTIPLY(z3,
FIX(0.384515595)) -
1982 MULTIPLY(z4,
FIX(1.742345811));
1986 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
1987 wsptr[8*12] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
1988 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
1989 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
1990 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
1991 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
1992 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
1993 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
1994 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
1995 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
1996 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
1997 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
2004 for (ctr = 0; ctr < 13; ctr++) {
2010 z1 = (
INT32) wsptr[0] +
2012 (
ONE << (PASS1_BITS+2)));
2015 z2 = (
INT32) wsptr[2];
2016 z3 = (
INT32) wsptr[4];
2017 z4 = (
INT32) wsptr[6];
2022 tmp12 = MULTIPLY(tmp10,
FIX(1.155388986));
2023 tmp13 = MULTIPLY(tmp11,
FIX(0.096834934)) + z1;
2025 tmp20 = MULTIPLY(z2,
FIX(1.373119086)) + tmp12 + tmp13;
2026 tmp22 = MULTIPLY(z2,
FIX(0.501487041)) - tmp12 + tmp13;
2028 tmp12 = MULTIPLY(tmp10,
FIX(0.316450131));
2029 tmp13 = MULTIPLY(tmp11,
FIX(0.486914739)) + z1;
2031 tmp21 = MULTIPLY(z2,
FIX(1.058554052)) - tmp12 + tmp13;
2032 tmp25 = MULTIPLY(z2, -
FIX(1.252223920)) + tmp12 + tmp13;
2034 tmp12 = MULTIPLY(tmp10,
FIX(0.435816023));
2035 tmp13 = MULTIPLY(tmp11,
FIX(0.937303064)) - z1;
2037 tmp23 = MULTIPLY(z2, -
FIX(0.170464608)) - tmp12 - tmp13;
2038 tmp24 = MULTIPLY(z2, -
FIX(0.803364869)) + tmp12 - tmp13;
2040 tmp26 = MULTIPLY(tmp11 - z2,
FIX(1.414213562)) + z1;
2044 z1 = (
INT32) wsptr[1];
2045 z2 = (
INT32) wsptr[3];
2046 z3 = (
INT32) wsptr[5];
2047 z4 = (
INT32) wsptr[7];
2049 tmp11 = MULTIPLY(z1 + z2,
FIX(1.322312651));
2050 tmp12 = MULTIPLY(z1 + z3,
FIX(1.163874945));
2052 tmp13 = MULTIPLY(tmp15,
FIX(0.937797057));
2053 tmp10 = tmp11 + tmp12 + tmp13 -
2054 MULTIPLY(z1,
FIX(2.020082300));
2055 tmp14 = MULTIPLY(z2 + z3, -
FIX(0.338443458));
2056 tmp11 += tmp14 + MULTIPLY(z2,
FIX(0.837223564));
2057 tmp12 += tmp14 - MULTIPLY(z3,
FIX(1.572116027));
2058 tmp14 = MULTIPLY(z2 + z4, -
FIX(1.163874945));
2060 tmp13 += tmp14 + MULTIPLY(z4,
FIX(2.205608352));
2061 tmp14 = MULTIPLY(z3 + z4, -
FIX(0.657217813));
2064 tmp15 = MULTIPLY(tmp15,
FIX(0.338443458));
2065 tmp14 = tmp15 + MULTIPLY(z1,
FIX(0.318774355)) -
2066 MULTIPLY(z2,
FIX(0.466105296));
2067 z1 = MULTIPLY(z3 - z2,
FIX(0.937797057));
2069 tmp15 += z1 + MULTIPLY(z3,
FIX(0.384515595)) -
2070 MULTIPLY(z4,
FIX(1.742345811));
2075 CONST_BITS+PASS1_BITS+3)
2078 CONST_BITS+PASS1_BITS+3)
2081 CONST_BITS+PASS1_BITS+3)
2084 CONST_BITS+PASS1_BITS+3)
2087 CONST_BITS+PASS1_BITS+3)
2090 CONST_BITS+PASS1_BITS+3)
2093 CONST_BITS+PASS1_BITS+3)
2096 CONST_BITS+PASS1_BITS+3)
2099 CONST_BITS+PASS1_BITS+3)
2102 CONST_BITS+PASS1_BITS+3)
2105 CONST_BITS+PASS1_BITS+3)
2108 CONST_BITS+PASS1_BITS+3)
2111 CONST_BITS+PASS1_BITS+3)
2132 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2133 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
2134 INT32 z1, z2, z3, z4;
2141 int workspace[8*14];
2149 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2155 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
2157 z2 = MULTIPLY(z4,
FIX(1.274162392));
2158 z3 = MULTIPLY(z4,
FIX(0.314692123));
2159 z4 = MULTIPLY(z4,
FIX(0.881747734));
2166 CONST_BITS-PASS1_BITS);
2171 z3 = MULTIPLY(z1 + z2,
FIX(1.105676686));
2173 tmp13 = z3 + MULTIPLY(z1,
FIX(0.273079590));
2174 tmp14 = z3 - MULTIPLY(z2,
FIX(1.719280954));
2175 tmp15 = MULTIPLY(z1,
FIX(0.613604268)) -
2176 MULTIPLY(z2,
FIX(1.378756276));
2178 tmp20 = tmp10 + tmp13;
2179 tmp26 = tmp10 - tmp13;
2180 tmp21 = tmp11 + tmp14;
2181 tmp25 = tmp11 - tmp14;
2182 tmp22 = tmp12 + tmp15;
2183 tmp24 = tmp12 - tmp15;
2191 tmp13 = z4 << CONST_BITS;
2194 tmp11 = MULTIPLY(z1 + z2,
FIX(1.334852607));
2195 tmp12 = MULTIPLY(tmp14,
FIX(1.197448846));
2196 tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1,
FIX(1.126980169));
2197 tmp14 = MULTIPLY(tmp14,
FIX(0.752406978));
2198 tmp16 = tmp14 - MULTIPLY(z1,
FIX(1.061150426));
2200 tmp15 = MULTIPLY(z1,
FIX(0.467085129)) - tmp13;
2203 z4 = MULTIPLY(z2 + z3, -
FIX(0.158341681)) - tmp13;
2204 tmp11 += z4 - MULTIPLY(z2,
FIX(0.424103948));
2205 tmp12 += z4 - MULTIPLY(z3,
FIX(2.373959773));
2206 z4 = MULTIPLY(z3 - z2,
FIX(1.405321284));
2207 tmp14 += z4 + tmp13 - MULTIPLY(z3,
FIX(1.6906431334));
2208 tmp15 += z4 + MULTIPLY(z2,
FIX(0.674957567));
2210 tmp13 = (z1 - z3) << PASS1_BITS;
2214 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
2215 wsptr[8*13] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
2216 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
2217 wsptr[8*12] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
2218 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
2219 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
2220 wsptr[8*3] = (
int) (tmp23 + tmp13);
2221 wsptr[8*10] = (
int) (tmp23 - tmp13);
2222 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
2223 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
2224 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
2225 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
2226 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
2227 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
2233 for (ctr = 0; ctr < 14; ctr++) {
2239 z1 = (
INT32) wsptr[0] +
2241 (
ONE << (PASS1_BITS+2)));
2243 z4 = (
INT32) wsptr[4];
2244 z2 = MULTIPLY(z4,
FIX(1.274162392));
2245 z3 = MULTIPLY(z4,
FIX(0.314692123));
2246 z4 = MULTIPLY(z4,
FIX(0.881747734));
2252 tmp23 = z1 - ((z2 + z3 - z4) << 1);
2254 z1 = (
INT32) wsptr[2];
2255 z2 = (
INT32) wsptr[6];
2257 z3 = MULTIPLY(z1 + z2,
FIX(1.105676686));
2259 tmp13 = z3 + MULTIPLY(z1,
FIX(0.273079590));
2260 tmp14 = z3 - MULTIPLY(z2,
FIX(1.719280954));
2261 tmp15 = MULTIPLY(z1,
FIX(0.613604268)) -
2262 MULTIPLY(z2,
FIX(1.378756276));
2264 tmp20 = tmp10 + tmp13;
2265 tmp26 = tmp10 - tmp13;
2266 tmp21 = tmp11 + tmp14;
2267 tmp25 = tmp11 - tmp14;
2268 tmp22 = tmp12 + tmp15;
2269 tmp24 = tmp12 - tmp15;
2273 z1 = (
INT32) wsptr[1];
2274 z2 = (
INT32) wsptr[3];
2275 z3 = (
INT32) wsptr[5];
2276 z4 = (
INT32) wsptr[7];
2280 tmp11 = MULTIPLY(z1 + z2,
FIX(1.334852607));
2281 tmp12 = MULTIPLY(tmp14,
FIX(1.197448846));
2282 tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1,
FIX(1.126980169));
2283 tmp14 = MULTIPLY(tmp14,
FIX(0.752406978));
2284 tmp16 = tmp14 - MULTIPLY(z1,
FIX(1.061150426));
2286 tmp15 = MULTIPLY(z1,
FIX(0.467085129)) - z4;
2288 tmp13 = MULTIPLY(z2 + z3, -
FIX(0.158341681)) - z4;
2289 tmp11 += tmp13 - MULTIPLY(z2,
FIX(0.424103948));
2290 tmp12 += tmp13 - MULTIPLY(z3,
FIX(2.373959773));
2291 tmp13 = MULTIPLY(z3 - z2,
FIX(1.405321284));
2292 tmp14 += tmp13 + z4 - MULTIPLY(z3,
FIX(1.6906431334));
2293 tmp15 += tmp13 + MULTIPLY(z2,
FIX(0.674957567));
2295 tmp13 = ((z1 - z3) << CONST_BITS) + z4;
2300 CONST_BITS+PASS1_BITS+3)
2303 CONST_BITS+PASS1_BITS+3)
2306 CONST_BITS+PASS1_BITS+3)
2309 CONST_BITS+PASS1_BITS+3)
2312 CONST_BITS+PASS1_BITS+3)
2315 CONST_BITS+PASS1_BITS+3)
2318 CONST_BITS+PASS1_BITS+3)
2321 CONST_BITS+PASS1_BITS+3)
2324 CONST_BITS+PASS1_BITS+3)
2327 CONST_BITS+PASS1_BITS+3)
2330 CONST_BITS+PASS1_BITS+3)
2333 CONST_BITS+PASS1_BITS+3)
2336 CONST_BITS+PASS1_BITS+3)
2339 CONST_BITS+PASS1_BITS+3)
2360 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
2361 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2362 INT32 z1, z2, z3, z4;
2369 int workspace[8*15];
2377 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2383 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
2389 tmp10 = MULTIPLY(z4,
FIX(0.437016024));
2390 tmp11 = MULTIPLY(z4,
FIX(1.144122806));
2394 z1 -= (tmp11 - tmp10) << 1;
2398 tmp10 = MULTIPLY(z3,
FIX(1.337628990));
2399 tmp11 = MULTIPLY(z4,
FIX(0.045680613));
2400 z2 = MULTIPLY(z2,
FIX(1.439773946));
2402 tmp20 = tmp13 + tmp10 + tmp11;
2403 tmp23 = tmp12 - tmp10 + tmp11 + z2;
2405 tmp10 = MULTIPLY(z3,
FIX(0.547059574));
2406 tmp11 = MULTIPLY(z4,
FIX(0.399234004));
2408 tmp25 = tmp13 - tmp10 - tmp11;
2409 tmp26 = tmp12 + tmp10 - tmp11 - z2;
2411 tmp10 = MULTIPLY(z3,
FIX(0.790569415));
2412 tmp11 = MULTIPLY(z4,
FIX(0.353553391));
2414 tmp21 = tmp12 + tmp10 + tmp11;
2415 tmp24 = tmp13 - tmp10 + tmp11;
2418 tmp27 = z1 - tmp11 - tmp11;
2425 z3 = MULTIPLY(z4,
FIX(1.224744871));
2429 tmp15 = MULTIPLY(z1 + tmp13,
FIX(0.831253876));
2430 tmp11 = tmp15 + MULTIPLY(z1,
FIX(0.513743148));
2431 tmp14 = tmp15 - MULTIPLY(tmp13,
FIX(2.176250899));
2433 tmp13 = MULTIPLY(z2, -
FIX(0.831253876));
2434 tmp15 = MULTIPLY(z2, -
FIX(1.344997024));
2436 tmp12 = z3 + MULTIPLY(z2,
FIX(1.406466353));
2438 tmp10 = tmp12 + MULTIPLY(z4,
FIX(2.457431844)) - tmp15;
2439 tmp16 = tmp12 - MULTIPLY(z1,
FIX(1.112434820)) + tmp13;
2440 tmp12 = MULTIPLY(z2,
FIX(1.224744871)) - z3;
2441 z2 = MULTIPLY(z1 + z4,
FIX(0.575212477));
2442 tmp13 += z2 + MULTIPLY(z1,
FIX(0.475753014)) - z3;
2443 tmp15 += z2 - MULTIPLY(z4,
FIX(0.869244010)) + z3;
2447 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
2448 wsptr[8*14] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
2449 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
2450 wsptr[8*13] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
2451 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
2452 wsptr[8*12] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
2453 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
2454 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
2455 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
2456 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
2457 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
2458 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
2459 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
2460 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
2467 for (ctr = 0; ctr < 15; ctr++) {
2473 z1 = (
INT32) wsptr[0] +
2475 (
ONE << (PASS1_BITS+2)));
2478 z2 = (
INT32) wsptr[2];
2479 z3 = (
INT32) wsptr[4];
2480 z4 = (
INT32) wsptr[6];
2482 tmp10 = MULTIPLY(z4,
FIX(0.437016024));
2483 tmp11 = MULTIPLY(z4,
FIX(1.144122806));
2487 z1 -= (tmp11 - tmp10) << 1;
2491 tmp10 = MULTIPLY(z3,
FIX(1.337628990));
2492 tmp11 = MULTIPLY(z4,
FIX(0.045680613));
2493 z2 = MULTIPLY(z2,
FIX(1.439773946));
2495 tmp20 = tmp13 + tmp10 + tmp11;
2496 tmp23 = tmp12 - tmp10 + tmp11 + z2;
2498 tmp10 = MULTIPLY(z3,
FIX(0.547059574));
2499 tmp11 = MULTIPLY(z4,
FIX(0.399234004));
2501 tmp25 = tmp13 - tmp10 - tmp11;
2502 tmp26 = tmp12 + tmp10 - tmp11 - z2;
2504 tmp10 = MULTIPLY(z3,
FIX(0.790569415));
2505 tmp11 = MULTIPLY(z4,
FIX(0.353553391));
2507 tmp21 = tmp12 + tmp10 + tmp11;
2508 tmp24 = tmp13 - tmp10 + tmp11;
2511 tmp27 = z1 - tmp11 - tmp11;
2515 z1 = (
INT32) wsptr[1];
2516 z2 = (
INT32) wsptr[3];
2517 z4 = (
INT32) wsptr[5];
2518 z3 = MULTIPLY(z4,
FIX(1.224744871));
2519 z4 = (
INT32) wsptr[7];
2522 tmp15 = MULTIPLY(z1 + tmp13,
FIX(0.831253876));
2523 tmp11 = tmp15 + MULTIPLY(z1,
FIX(0.513743148));
2524 tmp14 = tmp15 - MULTIPLY(tmp13,
FIX(2.176250899));
2526 tmp13 = MULTIPLY(z2, -
FIX(0.831253876));
2527 tmp15 = MULTIPLY(z2, -
FIX(1.344997024));
2529 tmp12 = z3 + MULTIPLY(z2,
FIX(1.406466353));
2531 tmp10 = tmp12 + MULTIPLY(z4,
FIX(2.457431844)) - tmp15;
2532 tmp16 = tmp12 - MULTIPLY(z1,
FIX(1.112434820)) + tmp13;
2533 tmp12 = MULTIPLY(z2,
FIX(1.224744871)) - z3;
2534 z2 = MULTIPLY(z1 + z4,
FIX(0.575212477));
2535 tmp13 += z2 + MULTIPLY(z1,
FIX(0.475753014)) - z3;
2536 tmp15 += z2 - MULTIPLY(z4,
FIX(0.869244010)) + z3;
2541 CONST_BITS+PASS1_BITS+3)
2544 CONST_BITS+PASS1_BITS+3)
2547 CONST_BITS+PASS1_BITS+3)
2550 CONST_BITS+PASS1_BITS+3)
2553 CONST_BITS+PASS1_BITS+3)
2556 CONST_BITS+PASS1_BITS+3)
2559 CONST_BITS+PASS1_BITS+3)
2562 CONST_BITS+PASS1_BITS+3)
2565 CONST_BITS+PASS1_BITS+3)
2568 CONST_BITS+PASS1_BITS+3)
2571 CONST_BITS+PASS1_BITS+3)
2574 CONST_BITS+PASS1_BITS+3)
2577 CONST_BITS+PASS1_BITS+3)
2580 CONST_BITS+PASS1_BITS+3)
2583 CONST_BITS+PASS1_BITS+3)
2604 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
2605 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2606 INT32 z1, z2, z3, z4;
2613 int workspace[8*16];
2621 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
2625 tmp0 <<= CONST_BITS;
2627 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
2630 tmp1 = MULTIPLY(z1,
FIX(1.306562965));
2631 tmp2 = MULTIPLY(z1, FIX_0_541196100);
2633 tmp10 = tmp0 + tmp1;
2634 tmp11 = tmp0 - tmp1;
2635 tmp12 = tmp0 + tmp2;
2636 tmp13 = tmp0 - tmp2;
2641 z4 = MULTIPLY(z3,
FIX(0.275899379));
2642 z3 = MULTIPLY(z3,
FIX(1.387039845));
2644 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);
2645 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);
2646 tmp2 = z3 - MULTIPLY(z1,
FIX(0.601344887));
2647 tmp3 = z4 - MULTIPLY(z2,
FIX(0.509795579));
2649 tmp20 = tmp10 + tmp0;
2650 tmp27 = tmp10 - tmp0;
2651 tmp21 = tmp12 + tmp1;
2652 tmp26 = tmp12 - tmp1;
2653 tmp22 = tmp13 + tmp2;
2654 tmp25 = tmp13 - tmp2;
2655 tmp23 = tmp11 + tmp3;
2656 tmp24 = tmp11 - tmp3;
2667 tmp1 = MULTIPLY(z1 + z2,
FIX(1.353318001));
2668 tmp2 = MULTIPLY(tmp11,
FIX(1.247225013));
2669 tmp3 = MULTIPLY(z1 + z4,
FIX(1.093201867));
2670 tmp10 = MULTIPLY(z1 - z4,
FIX(0.897167586));
2671 tmp11 = MULTIPLY(tmp11,
FIX(0.666655658));
2672 tmp12 = MULTIPLY(z1 - z2,
FIX(0.410524528));
2673 tmp0 = tmp1 + tmp2 + tmp3 -
2674 MULTIPLY(z1,
FIX(2.286341144));
2675 tmp13 = tmp10 + tmp11 + tmp12 -
2676 MULTIPLY(z1,
FIX(1.835730603));
2677 z1 = MULTIPLY(z2 + z3,
FIX(0.138617169));
2678 tmp1 += z1 + MULTIPLY(z2,
FIX(0.071888074));
2679 tmp2 += z1 - MULTIPLY(z3,
FIX(1.125726048));
2680 z1 = MULTIPLY(z3 - z2,
FIX(1.407403738));
2681 tmp11 += z1 - MULTIPLY(z3,
FIX(0.766367282));
2682 tmp12 += z1 + MULTIPLY(z2,
FIX(1.971951411));
2684 z1 = MULTIPLY(z2, -
FIX(0.666655658));
2686 tmp3 += z1 + MULTIPLY(z4,
FIX(1.065388962));
2687 z2 = MULTIPLY(z2, -
FIX(1.247225013));
2688 tmp10 += z2 + MULTIPLY(z4,
FIX(3.141271809));
2690 z2 = MULTIPLY(z3 + z4, -
FIX(1.353318001));
2693 z2 = MULTIPLY(z4 - z3,
FIX(0.410524528));
2699 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS);
2700 wsptr[8*15] = (
int)
RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS);
2701 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS);
2702 wsptr[8*14] = (
int)
RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS);
2703 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS);
2704 wsptr[8*13] = (
int)
RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS);
2705 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS);
2706 wsptr[8*12] = (
int)
RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS);
2707 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);
2708 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);
2709 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);
2710 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);
2711 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);
2712 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);
2713 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);
2714 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);
2720 for (ctr = 0; ctr < 16; ctr++) {
2726 tmp0 = (
INT32) wsptr[0] +
2728 (
ONE << (PASS1_BITS+2)));
2729 tmp0 <<= CONST_BITS;
2731 z1 = (
INT32) wsptr[4];
2732 tmp1 = MULTIPLY(z1,
FIX(1.306562965));
2733 tmp2 = MULTIPLY(z1, FIX_0_541196100);
2735 tmp10 = tmp0 + tmp1;
2736 tmp11 = tmp0 - tmp1;
2737 tmp12 = tmp0 + tmp2;
2738 tmp13 = tmp0 - tmp2;
2740 z1 = (
INT32) wsptr[2];
2741 z2 = (
INT32) wsptr[6];
2743 z4 = MULTIPLY(z3,
FIX(0.275899379));
2744 z3 = MULTIPLY(z3,
FIX(1.387039845));
2746 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);
2747 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);
2748 tmp2 = z3 - MULTIPLY(z1,
FIX(0.601344887));
2749 tmp3 = z4 - MULTIPLY(z2,
FIX(0.509795579));
2751 tmp20 = tmp10 + tmp0;
2752 tmp27 = tmp10 - tmp0;
2753 tmp21 = tmp12 + tmp1;
2754 tmp26 = tmp12 - tmp1;
2755 tmp22 = tmp13 + tmp2;
2756 tmp25 = tmp13 - tmp2;
2757 tmp23 = tmp11 + tmp3;
2758 tmp24 = tmp11 - tmp3;
2762 z1 = (
INT32) wsptr[1];
2763 z2 = (
INT32) wsptr[3];
2764 z3 = (
INT32) wsptr[5];
2765 z4 = (
INT32) wsptr[7];
2769 tmp1 = MULTIPLY(z1 + z2,
FIX(1.353318001));
2770 tmp2 = MULTIPLY(tmp11,
FIX(1.247225013));
2771 tmp3 = MULTIPLY(z1 + z4,
FIX(1.093201867));
2772 tmp10 = MULTIPLY(z1 - z4,
FIX(0.897167586));
2773 tmp11 = MULTIPLY(tmp11,
FIX(0.666655658));
2774 tmp12 = MULTIPLY(z1 - z2,
FIX(0.410524528));
2775 tmp0 = tmp1 + tmp2 + tmp3 -
2776 MULTIPLY(z1,
FIX(2.286341144));
2777 tmp13 = tmp10 + tmp11 + tmp12 -
2778 MULTIPLY(z1,
FIX(1.835730603));
2779 z1 = MULTIPLY(z2 + z3,
FIX(0.138617169));
2780 tmp1 += z1 + MULTIPLY(z2,
FIX(0.071888074));
2781 tmp2 += z1 - MULTIPLY(z3,
FIX(1.125726048));
2782 z1 = MULTIPLY(z3 - z2,
FIX(1.407403738));
2783 tmp11 += z1 - MULTIPLY(z3,
FIX(0.766367282));
2784 tmp12 += z1 + MULTIPLY(z2,
FIX(1.971951411));
2786 z1 = MULTIPLY(z2, -
FIX(0.666655658));
2788 tmp3 += z1 + MULTIPLY(z4,
FIX(1.065388962));
2789 z2 = MULTIPLY(z2, -
FIX(1.247225013));
2790 tmp10 += z2 + MULTIPLY(z4,
FIX(3.141271809));
2792 z2 = MULTIPLY(z3 + z4, -
FIX(1.353318001));
2795 z2 = MULTIPLY(z4 - z3,
FIX(0.410524528));
2802 CONST_BITS+PASS1_BITS+3)
2805 CONST_BITS+PASS1_BITS+3)
2808 CONST_BITS+PASS1_BITS+3)
2811 CONST_BITS+PASS1_BITS+3)
2814 CONST_BITS+PASS1_BITS+3)
2817 CONST_BITS+PASS1_BITS+3)
2820 CONST_BITS+PASS1_BITS+3)
2823 CONST_BITS+PASS1_BITS+3)
2826 CONST_BITS+PASS1_BITS+3)
2829 CONST_BITS+PASS1_BITS+3)
2832 CONST_BITS+PASS1_BITS+3)
2835 CONST_BITS+PASS1_BITS+3)
2838 CONST_BITS+PASS1_BITS+3)
2841 CONST_BITS+PASS1_BITS+3)
2844 CONST_BITS+PASS1_BITS+3)
2847 CONST_BITS+PASS1_BITS+3)
2867 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
2868 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
2869 INT32 z1, z2, z3, z4;
2903 int dcval = DEQUANTIZE(inptr[
DCTSIZE*0], quantptr[
DCTSIZE*0]) << PASS1_BITS;
2929 z2 +=
ONE << (CONST_BITS-PASS1_BITS-1);
2937 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
2938 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
2939 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
2941 tmp10 = tmp0 + tmp2;
2942 tmp13 = tmp0 - tmp2;
2943 tmp11 = tmp1 + tmp3;
2944 tmp12 = tmp1 - tmp3;
2958 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
2959 z2 = MULTIPLY(z2, - FIX_1_961570560);
2960 z3 = MULTIPLY(z3, - FIX_0_390180644);
2964 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
2965 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
2966 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
2970 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
2971 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
2972 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
2997 for (ctr = 0; ctr < 8; ctr++) {
3003 tmp0 = (
INT32) wsptr[0] +
3005 (
ONE << (PASS1_BITS+2)));
3006 tmp0 <<= CONST_BITS;
3008 z1 = (
INT32) wsptr[4];
3009 tmp1 = MULTIPLY(z1,
FIX(1.306562965));
3010 tmp2 = MULTIPLY(z1, FIX_0_541196100);
3012 tmp10 = tmp0 + tmp1;
3013 tmp11 = tmp0 - tmp1;
3014 tmp12 = tmp0 + tmp2;
3015 tmp13 = tmp0 - tmp2;
3017 z1 = (
INT32) wsptr[2];
3018 z2 = (
INT32) wsptr[6];
3020 z4 = MULTIPLY(z3,
FIX(0.275899379));
3021 z3 = MULTIPLY(z3,
FIX(1.387039845));
3023 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);
3024 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);
3025 tmp2 = z3 - MULTIPLY(z1,
FIX(0.601344887));
3026 tmp3 = z4 - MULTIPLY(z2,
FIX(0.509795579));
3028 tmp20 = tmp10 + tmp0;
3029 tmp27 = tmp10 - tmp0;
3030 tmp21 = tmp12 + tmp1;
3031 tmp26 = tmp12 - tmp1;
3032 tmp22 = tmp13 + tmp2;
3033 tmp25 = tmp13 - tmp2;
3034 tmp23 = tmp11 + tmp3;
3035 tmp24 = tmp11 - tmp3;
3039 z1 = (
INT32) wsptr[1];
3040 z2 = (
INT32) wsptr[3];
3041 z3 = (
INT32) wsptr[5];
3042 z4 = (
INT32) wsptr[7];
3046 tmp1 = MULTIPLY(z1 + z2,
FIX(1.353318001));
3047 tmp2 = MULTIPLY(tmp11,
FIX(1.247225013));
3048 tmp3 = MULTIPLY(z1 + z4,
FIX(1.093201867));
3049 tmp10 = MULTIPLY(z1 - z4,
FIX(0.897167586));
3050 tmp11 = MULTIPLY(tmp11,
FIX(0.666655658));
3051 tmp12 = MULTIPLY(z1 - z2,
FIX(0.410524528));
3052 tmp0 = tmp1 + tmp2 + tmp3 -
3053 MULTIPLY(z1,
FIX(2.286341144));
3054 tmp13 = tmp10 + tmp11 + tmp12 -
3055 MULTIPLY(z1,
FIX(1.835730603));
3056 z1 = MULTIPLY(z2 + z3,
FIX(0.138617169));
3057 tmp1 += z1 + MULTIPLY(z2,
FIX(0.071888074));
3058 tmp2 += z1 - MULTIPLY(z3,
FIX(1.125726048));
3059 z1 = MULTIPLY(z3 - z2,
FIX(1.407403738));
3060 tmp11 += z1 - MULTIPLY(z3,
FIX(0.766367282));
3061 tmp12 += z1 + MULTIPLY(z2,
FIX(1.971951411));
3063 z1 = MULTIPLY(z2, -
FIX(0.666655658));
3065 tmp3 += z1 + MULTIPLY(z4,
FIX(1.065388962));
3066 z2 = MULTIPLY(z2, -
FIX(1.247225013));
3067 tmp10 += z2 + MULTIPLY(z4,
FIX(3.141271809));
3069 z2 = MULTIPLY(z3 + z4, -
FIX(1.353318001));
3072 z2 = MULTIPLY(z4 - z3,
FIX(0.410524528));
3079 CONST_BITS+PASS1_BITS+3)
3082 CONST_BITS+PASS1_BITS+3)
3085 CONST_BITS+PASS1_BITS+3)
3088 CONST_BITS+PASS1_BITS+3)
3091 CONST_BITS+PASS1_BITS+3)
3094 CONST_BITS+PASS1_BITS+3)
3097 CONST_BITS+PASS1_BITS+3)
3100 CONST_BITS+PASS1_BITS+3)
3103 CONST_BITS+PASS1_BITS+3)
3106 CONST_BITS+PASS1_BITS+3)
3109 CONST_BITS+PASS1_BITS+3)
3112 CONST_BITS+PASS1_BITS+3)
3115 CONST_BITS+PASS1_BITS+3)
3118 CONST_BITS+PASS1_BITS+3)
3121 CONST_BITS+PASS1_BITS+3)
3124 CONST_BITS+PASS1_BITS+3)
3144 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
3145 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
3146 INT32 z1, z2, z3, z4;
3163 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3167 tmp23 <<= CONST_BITS;
3169 tmp23 +=
ONE << (CONST_BITS-PASS1_BITS-1);
3175 tmp20 = MULTIPLY(z2 - z3,
FIX(0.881747734));
3176 tmp22 = MULTIPLY(z1 - z2,
FIX(0.314692123));
3177 tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2,
FIX(1.841218003));
3180 tmp10 = MULTIPLY(tmp10,
FIX(1.274162392)) + tmp23;
3181 tmp20 += tmp10 - MULTIPLY(z3,
FIX(0.077722536));
3182 tmp22 += tmp10 - MULTIPLY(z1,
FIX(2.470602249));
3183 tmp23 += MULTIPLY(z2,
FIX(1.414213562));
3191 tmp11 = MULTIPLY(z1 + z2,
FIX(0.935414347));
3192 tmp12 = MULTIPLY(z1 - z2,
FIX(0.170262339));
3193 tmp10 = tmp11 - tmp12;
3195 tmp12 = MULTIPLY(z2 + z3, -
FIX(1.378756276));
3197 z2 = MULTIPLY(z1 + z3,
FIX(0.613604268));
3199 tmp12 += z2 + MULTIPLY(z3,
FIX(1.870828693));
3203 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
3204 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
3205 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
3206 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
3207 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
3208 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
3217 for (ctr = 0; ctr < 7; ctr++) {
3223 z1 = (
INT32) wsptr[0] +
3225 (
ONE << (PASS1_BITS+2)));
3227 z4 = (
INT32) wsptr[4];
3228 z2 = MULTIPLY(z4,
FIX(1.274162392));
3229 z3 = MULTIPLY(z4,
FIX(0.314692123));
3230 z4 = MULTIPLY(z4,
FIX(0.881747734));
3236 tmp23 = z1 - ((z2 + z3 - z4) << 1);
3238 z1 = (
INT32) wsptr[2];
3239 z2 = (
INT32) wsptr[6];
3241 z3 = MULTIPLY(z1 + z2,
FIX(1.105676686));
3243 tmp13 = z3 + MULTIPLY(z1,
FIX(0.273079590));
3244 tmp14 = z3 - MULTIPLY(z2,
FIX(1.719280954));
3245 tmp15 = MULTIPLY(z1,
FIX(0.613604268)) -
3246 MULTIPLY(z2,
FIX(1.378756276));
3248 tmp20 = tmp10 + tmp13;
3249 tmp26 = tmp10 - tmp13;
3250 tmp21 = tmp11 + tmp14;
3251 tmp25 = tmp11 - tmp14;
3252 tmp22 = tmp12 + tmp15;
3253 tmp24 = tmp12 - tmp15;
3257 z1 = (
INT32) wsptr[1];
3258 z2 = (
INT32) wsptr[3];
3259 z3 = (
INT32) wsptr[5];
3260 z4 = (
INT32) wsptr[7];
3264 tmp11 = MULTIPLY(z1 + z2,
FIX(1.334852607));
3265 tmp12 = MULTIPLY(tmp14,
FIX(1.197448846));
3266 tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1,
FIX(1.126980169));
3267 tmp14 = MULTIPLY(tmp14,
FIX(0.752406978));
3268 tmp16 = tmp14 - MULTIPLY(z1,
FIX(1.061150426));
3270 tmp15 = MULTIPLY(z1,
FIX(0.467085129)) - z4;
3272 tmp13 = MULTIPLY(z2 + z3, -
FIX(0.158341681)) - z4;
3273 tmp11 += tmp13 - MULTIPLY(z2,
FIX(0.424103948));
3274 tmp12 += tmp13 - MULTIPLY(z3,
FIX(2.373959773));
3275 tmp13 = MULTIPLY(z3 - z2,
FIX(1.405321284));
3276 tmp14 += tmp13 + z4 - MULTIPLY(z3,
FIX(1.6906431334));
3277 tmp15 += tmp13 + MULTIPLY(z2,
FIX(0.674957567));
3279 tmp13 = ((z1 - z3) << CONST_BITS) + z4;
3284 CONST_BITS+PASS1_BITS+3)
3287 CONST_BITS+PASS1_BITS+3)
3290 CONST_BITS+PASS1_BITS+3)
3293 CONST_BITS+PASS1_BITS+3)
3296 CONST_BITS+PASS1_BITS+3)
3299 CONST_BITS+PASS1_BITS+3)
3302 CONST_BITS+PASS1_BITS+3)
3305 CONST_BITS+PASS1_BITS+3)
3308 CONST_BITS+PASS1_BITS+3)
3311 CONST_BITS+PASS1_BITS+3)
3314 CONST_BITS+PASS1_BITS+3)
3317 CONST_BITS+PASS1_BITS+3)
3320 CONST_BITS+PASS1_BITS+3)
3323 CONST_BITS+PASS1_BITS+3)
3343 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
3344 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
3345 INT32 z1, z2, z3, z4;
3362 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3366 tmp10 <<= CONST_BITS;
3368 tmp10 +=
ONE << (CONST_BITS-PASS1_BITS-1);
3370 tmp20 = MULTIPLY(tmp12,
FIX(0.707106781));
3371 tmp11 = tmp10 + tmp20;
3372 tmp21 =
RIGHT_SHIFT(tmp10 - tmp20 - tmp20, CONST_BITS-PASS1_BITS);
3374 tmp10 = MULTIPLY(tmp20,
FIX(1.224744871));
3375 tmp20 = tmp11 + tmp10;
3376 tmp22 = tmp11 - tmp10;
3383 tmp11 = MULTIPLY(z1 + z3,
FIX(0.366025404));
3384 tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);
3385 tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);
3386 tmp11 = (z1 - z2 - z3) << PASS1_BITS;
3390 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
3391 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
3392 wsptr[8*1] = (
int) (tmp21 + tmp11);
3393 wsptr[8*4] = (
int) (tmp21 - tmp11);
3394 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
3395 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
3403 for (ctr = 0; ctr < 6; ctr++) {
3409 z3 = (
INT32) wsptr[0] +
3411 (
ONE << (PASS1_BITS+2)));
3414 z4 = (
INT32) wsptr[4];
3415 z4 = MULTIPLY(z4,
FIX(1.224744871));
3420 z1 = (
INT32) wsptr[2];
3421 z4 = MULTIPLY(z1,
FIX(1.366025404));
3423 z2 = (
INT32) wsptr[6];
3433 tmp20 = tmp10 + tmp12;
3434 tmp25 = tmp10 - tmp12;
3436 tmp12 = z4 - z1 - z2;
3438 tmp22 = tmp11 + tmp12;
3439 tmp23 = tmp11 - tmp12;
3443 z1 = (
INT32) wsptr[1];
3444 z2 = (
INT32) wsptr[3];
3445 z3 = (
INT32) wsptr[5];
3446 z4 = (
INT32) wsptr[7];
3448 tmp11 = MULTIPLY(z2,
FIX(1.306562965));
3449 tmp14 = MULTIPLY(z2, - FIX_0_541196100);
3452 tmp15 = MULTIPLY(tmp10 + z4,
FIX(0.860918669));
3453 tmp12 = tmp15 + MULTIPLY(tmp10,
FIX(0.261052384));
3454 tmp10 = tmp12 + tmp11 + MULTIPLY(z1,
FIX(0.280143716));
3455 tmp13 = MULTIPLY(z3 + z4, -
FIX(1.045510580));
3456 tmp12 += tmp13 + tmp14 - MULTIPLY(z3,
FIX(1.478575242));
3457 tmp13 += tmp15 - tmp11 + MULTIPLY(z4,
FIX(1.586706681));
3458 tmp15 += tmp14 - MULTIPLY(z1,
FIX(0.676326758)) -
3459 MULTIPLY(z4,
FIX(1.982889723));
3463 z3 = MULTIPLY(z1 + z2, FIX_0_541196100);
3464 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);
3465 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);
3470 CONST_BITS+PASS1_BITS+3)
3473 CONST_BITS+PASS1_BITS+3)
3476 CONST_BITS+PASS1_BITS+3)
3479 CONST_BITS+PASS1_BITS+3)
3482 CONST_BITS+PASS1_BITS+3)
3485 CONST_BITS+PASS1_BITS+3)
3488 CONST_BITS+PASS1_BITS+3)
3491 CONST_BITS+PASS1_BITS+3)
3494 CONST_BITS+PASS1_BITS+3)
3497 CONST_BITS+PASS1_BITS+3)
3500 CONST_BITS+PASS1_BITS+3)
3503 CONST_BITS+PASS1_BITS+3)
3523 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
3524 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
3525 INT32 z1, z2, z3, z4;
3542 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3546 tmp12 <<= CONST_BITS;
3548 tmp12 +=
ONE << (CONST_BITS-PASS1_BITS-1);
3551 z1 = MULTIPLY(tmp13 + tmp14,
FIX(0.790569415));
3552 z2 = MULTIPLY(tmp13 - tmp14,
FIX(0.353553391));
3563 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
3564 tmp13 = z1 + MULTIPLY(z2,
FIX(0.513743148));
3565 tmp14 = z1 - MULTIPLY(z3,
FIX(2.176250899));
3569 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp13, CONST_BITS-PASS1_BITS);
3570 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp10 - tmp13, CONST_BITS-PASS1_BITS);
3571 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp11 + tmp14, CONST_BITS-PASS1_BITS);
3572 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp11 - tmp14, CONST_BITS-PASS1_BITS);
3581 for (ctr = 0; ctr < 5; ctr++) {
3587 z3 = (
INT32) wsptr[0] +
3589 (
ONE << (PASS1_BITS+2)));
3591 z4 = (
INT32) wsptr[4];
3592 z1 = MULTIPLY(z4,
FIX(1.144122806));
3593 z2 = MULTIPLY(z4,
FIX(0.437016024));
3597 tmp22 = z3 - ((z1 - z2) << 1);
3599 z2 = (
INT32) wsptr[2];
3600 z3 = (
INT32) wsptr[6];
3602 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
3603 tmp12 = z1 + MULTIPLY(z2,
FIX(0.513743148));
3604 tmp13 = z1 - MULTIPLY(z3,
FIX(2.176250899));
3606 tmp20 = tmp10 + tmp12;
3607 tmp24 = tmp10 - tmp12;
3608 tmp21 = tmp11 + tmp13;
3609 tmp23 = tmp11 - tmp13;
3613 z1 = (
INT32) wsptr[1];
3614 z2 = (
INT32) wsptr[3];
3615 z3 = (
INT32) wsptr[5];
3617 z4 = (
INT32) wsptr[7];
3622 tmp12 = MULTIPLY(tmp13,
FIX(0.309016994));
3624 z2 = MULTIPLY(tmp11,
FIX(0.951056516));
3627 tmp10 = MULTIPLY(z1,
FIX(1.396802247)) + z2 + z4;
3628 tmp14 = MULTIPLY(z1,
FIX(0.221231742)) - z2 + z4;
3630 z2 = MULTIPLY(tmp11,
FIX(0.587785252));
3631 z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));
3633 tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;
3635 tmp11 = MULTIPLY(z1,
FIX(1.260073511)) - z2 - z4;
3636 tmp13 = MULTIPLY(z1,
FIX(0.642039522)) - z2 + z4;
3641 CONST_BITS+PASS1_BITS+3)
3644 CONST_BITS+PASS1_BITS+3)
3647 CONST_BITS+PASS1_BITS+3)
3650 CONST_BITS+PASS1_BITS+3)
3653 CONST_BITS+PASS1_BITS+3)
3656 CONST_BITS+PASS1_BITS+3)
3659 CONST_BITS+PASS1_BITS+3)
3662 CONST_BITS+PASS1_BITS+3)
3665 CONST_BITS+PASS1_BITS+3)
3668 CONST_BITS+PASS1_BITS+3)
3688 INT32 tmp0, tmp1, tmp2, tmp3;
3689 INT32 tmp10, tmp11, tmp12, tmp13;
3708 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
3714 tmp10 = (tmp0 + tmp2) << PASS1_BITS;
3715 tmp12 = (tmp0 - tmp2) << PASS1_BITS;
3723 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
3725 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
3726 tmp0 =
RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865),
3727 CONST_BITS-PASS1_BITS);
3728 tmp2 =
RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065),
3729 CONST_BITS-PASS1_BITS);
3733 wsptr[8*0] = (
int) (tmp10 + tmp0);
3734 wsptr[8*3] = (
int) (tmp10 - tmp0);
3735 wsptr[8*1] = (
int) (tmp12 + tmp2);
3736 wsptr[8*2] = (
int) (tmp12 - tmp2);
3746 for (ctr = 0; ctr < 4; ctr++) {
3754 z2 = (
INT32) wsptr[0] +
3756 (
ONE << (PASS1_BITS+2)));
3757 z3 = (
INT32) wsptr[4];
3759 tmp0 = (z2 + z3) << CONST_BITS;
3760 tmp1 = (z2 - z3) << CONST_BITS;
3762 z2 = (
INT32) wsptr[2];
3763 z3 = (
INT32) wsptr[6];
3765 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
3766 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
3767 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
3769 tmp10 = tmp0 + tmp2;
3770 tmp13 = tmp0 - tmp2;
3771 tmp11 = tmp1 + tmp3;
3772 tmp12 = tmp1 - tmp3;
3778 tmp0 = (
INT32) wsptr[7];
3779 tmp1 = (
INT32) wsptr[5];
3780 tmp2 = (
INT32) wsptr[3];
3781 tmp3 = (
INT32) wsptr[1];
3786 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
3787 z2 = MULTIPLY(z2, - FIX_1_961570560);
3788 z3 = MULTIPLY(z3, - FIX_0_390180644);
3792 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
3793 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
3794 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
3798 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
3799 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
3800 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
3807 CONST_BITS+PASS1_BITS+3)
3810 CONST_BITS+PASS1_BITS+3)
3813 CONST_BITS+PASS1_BITS+3)
3816 CONST_BITS+PASS1_BITS+3)
3819 CONST_BITS+PASS1_BITS+3)
3822 CONST_BITS+PASS1_BITS+3)
3825 CONST_BITS+PASS1_BITS+3)
3828 CONST_BITS+PASS1_BITS+3)
3848 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
3866 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
3870 tmp0 <<= CONST_BITS;
3872 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
3874 tmp12 = MULTIPLY(tmp2,
FIX(0.707106781));
3875 tmp10 = tmp0 + tmp12;
3876 tmp2 = tmp0 - tmp12 - tmp12;
3881 tmp0 = MULTIPLY(tmp12,
FIX(1.224744871));
3885 wsptr[6*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
3886 wsptr[6*2] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
3895 for (ctr = 0; ctr < 3; ctr++) {
3901 tmp0 = (
INT32) wsptr[0] +
3903 (
ONE << (PASS1_BITS+2)));
3904 tmp0 <<= CONST_BITS;
3905 tmp2 = (
INT32) wsptr[4];
3906 tmp10 = MULTIPLY(tmp2,
FIX(0.707106781));
3907 tmp1 = tmp0 + tmp10;
3908 tmp11 = tmp0 - tmp10 - tmp10;
3909 tmp10 = (
INT32) wsptr[2];
3910 tmp0 = MULTIPLY(tmp10,
FIX(1.224744871));
3911 tmp10 = tmp1 + tmp0;
3912 tmp12 = tmp1 - tmp0;
3916 z1 = (
INT32) wsptr[1];
3917 z2 = (
INT32) wsptr[3];
3918 z3 = (
INT32) wsptr[5];
3919 tmp1 = MULTIPLY(z1 + z3,
FIX(0.366025404));
3920 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
3921 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
3922 tmp1 = (z1 - z2 - z3) << CONST_BITS;
3927 CONST_BITS+PASS1_BITS+3)
3930 CONST_BITS+PASS1_BITS+3)
3933 CONST_BITS+PASS1_BITS+3)
3936 CONST_BITS+PASS1_BITS+3)
3939 CONST_BITS+PASS1_BITS+3)
3942 CONST_BITS+PASS1_BITS+3)
3962 INT32 tmp0, tmp2, tmp10, tmp12;
3970 INT32 workspace[4*2];
3978 for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) {
3989 wsptr[4*0] = tmp10 + tmp0;
3990 wsptr[4*1] = tmp10 - tmp0;
3999 for (ctr = 0; ctr < 2; ctr++) {
4008 tmp10 = (tmp0 + tmp2) << CONST_BITS;
4009 tmp12 = (tmp0 - tmp2) << CONST_BITS;
4017 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4018 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865);
4019 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065);
4068 tmp0 = DEQUANTIZE(
coef_block[0], quantptr[0]);
4074 tmp1 = DEQUANTIZE(
coef_block[1], quantptr[1]);
4095 INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
4096 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
4097 INT32 z1, z2, z3, z4;
4104 int workspace[8*16];
4114 for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
4118 tmp0 <<= CONST_BITS;
4120 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
4123 tmp1 = MULTIPLY(z1,
FIX(1.306562965));
4124 tmp2 = MULTIPLY(z1, FIX_0_541196100);
4126 tmp10 = tmp0 + tmp1;
4127 tmp11 = tmp0 - tmp1;
4128 tmp12 = tmp0 + tmp2;
4129 tmp13 = tmp0 - tmp2;
4134 z4 = MULTIPLY(z3,
FIX(0.275899379));
4135 z3 = MULTIPLY(z3,
FIX(1.387039845));
4137 tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);
4138 tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);
4139 tmp2 = z3 - MULTIPLY(z1,
FIX(0.601344887));
4140 tmp3 = z4 - MULTIPLY(z2,
FIX(0.509795579));
4142 tmp20 = tmp10 + tmp0;
4143 tmp27 = tmp10 - tmp0;
4144 tmp21 = tmp12 + tmp1;
4145 tmp26 = tmp12 - tmp1;
4146 tmp22 = tmp13 + tmp2;
4147 tmp25 = tmp13 - tmp2;
4148 tmp23 = tmp11 + tmp3;
4149 tmp24 = tmp11 - tmp3;
4160 tmp1 = MULTIPLY(z1 + z2,
FIX(1.353318001));
4161 tmp2 = MULTIPLY(tmp11,
FIX(1.247225013));
4162 tmp3 = MULTIPLY(z1 + z4,
FIX(1.093201867));
4163 tmp10 = MULTIPLY(z1 - z4,
FIX(0.897167586));
4164 tmp11 = MULTIPLY(tmp11,
FIX(0.666655658));
4165 tmp12 = MULTIPLY(z1 - z2,
FIX(0.410524528));
4166 tmp0 = tmp1 + tmp2 + tmp3 -
4167 MULTIPLY(z1,
FIX(2.286341144));
4168 tmp13 = tmp10 + tmp11 + tmp12 -
4169 MULTIPLY(z1,
FIX(1.835730603));
4170 z1 = MULTIPLY(z2 + z3,
FIX(0.138617169));
4171 tmp1 += z1 + MULTIPLY(z2,
FIX(0.071888074));
4172 tmp2 += z1 - MULTIPLY(z3,
FIX(1.125726048));
4173 z1 = MULTIPLY(z3 - z2,
FIX(1.407403738));
4174 tmp11 += z1 - MULTIPLY(z3,
FIX(0.766367282));
4175 tmp12 += z1 + MULTIPLY(z2,
FIX(1.971951411));
4177 z1 = MULTIPLY(z2, -
FIX(0.666655658));
4179 tmp3 += z1 + MULTIPLY(z4,
FIX(1.065388962));
4180 z2 = MULTIPLY(z2, -
FIX(1.247225013));
4181 tmp10 += z2 + MULTIPLY(z4,
FIX(3.141271809));
4183 z2 = MULTIPLY(z3 + z4, -
FIX(1.353318001));
4186 z2 = MULTIPLY(z4 - z3,
FIX(0.410524528));
4192 wsptr[8*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS);
4193 wsptr[8*15] = (
int)
RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS);
4194 wsptr[8*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS);
4195 wsptr[8*14] = (
int)
RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS);
4196 wsptr[8*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS);
4197 wsptr[8*13] = (
int)
RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS);
4198 wsptr[8*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS);
4199 wsptr[8*12] = (
int)
RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS);
4200 wsptr[8*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);
4201 wsptr[8*11] = (
int)
RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);
4202 wsptr[8*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);
4203 wsptr[8*10] = (
int)
RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);
4204 wsptr[8*6] = (
int)
RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);
4205 wsptr[8*9] = (
int)
RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);
4206 wsptr[8*7] = (
int)
RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);
4207 wsptr[8*8] = (
int)
RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);
4217 for (ctr = 0; ctr < 16; ctr++) {
4225 z2 = (
INT32) wsptr[0] +
4227 (
ONE << (PASS1_BITS+2)));
4228 z3 = (
INT32) wsptr[4];
4230 tmp0 = (z2 + z3) << CONST_BITS;
4231 tmp1 = (z2 - z3) << CONST_BITS;
4233 z2 = (
INT32) wsptr[2];
4234 z3 = (
INT32) wsptr[6];
4236 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4237 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
4238 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
4240 tmp10 = tmp0 + tmp2;
4241 tmp13 = tmp0 - tmp2;
4242 tmp11 = tmp1 + tmp3;
4243 tmp12 = tmp1 - tmp3;
4249 tmp0 = (
INT32) wsptr[7];
4250 tmp1 = (
INT32) wsptr[5];
4251 tmp2 = (
INT32) wsptr[3];
4252 tmp3 = (
INT32) wsptr[1];
4257 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
4258 z2 = MULTIPLY(z2, - FIX_1_961570560);
4259 z3 = MULTIPLY(z3, - FIX_0_390180644);
4263 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
4264 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
4265 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
4269 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
4270 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
4271 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
4278 CONST_BITS+PASS1_BITS+3)
4281 CONST_BITS+PASS1_BITS+3)
4284 CONST_BITS+PASS1_BITS+3)
4287 CONST_BITS+PASS1_BITS+3)
4290 CONST_BITS+PASS1_BITS+3)
4293 CONST_BITS+PASS1_BITS+3)
4296 CONST_BITS+PASS1_BITS+3)
4299 CONST_BITS+PASS1_BITS+3)
4319 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
4320 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
4321 INT32 z1, z2, z3, z4;
4328 int workspace[7*14];
4338 for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {
4344 z1 +=
ONE << (CONST_BITS-PASS1_BITS-1);
4346 z2 = MULTIPLY(z4,
FIX(1.274162392));
4347 z3 = MULTIPLY(z4,
FIX(0.314692123));
4348 z4 = MULTIPLY(z4,
FIX(0.881747734));
4355 CONST_BITS-PASS1_BITS);
4360 z3 = MULTIPLY(z1 + z2,
FIX(1.105676686));
4362 tmp13 = z3 + MULTIPLY(z1,
FIX(0.273079590));
4363 tmp14 = z3 - MULTIPLY(z2,
FIX(1.719280954));
4364 tmp15 = MULTIPLY(z1,
FIX(0.613604268)) -
4365 MULTIPLY(z2,
FIX(1.378756276));
4367 tmp20 = tmp10 + tmp13;
4368 tmp26 = tmp10 - tmp13;
4369 tmp21 = tmp11 + tmp14;
4370 tmp25 = tmp11 - tmp14;
4371 tmp22 = tmp12 + tmp15;
4372 tmp24 = tmp12 - tmp15;
4380 tmp13 = z4 << CONST_BITS;
4383 tmp11 = MULTIPLY(z1 + z2,
FIX(1.334852607));
4384 tmp12 = MULTIPLY(tmp14,
FIX(1.197448846));
4385 tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1,
FIX(1.126980169));
4386 tmp14 = MULTIPLY(tmp14,
FIX(0.752406978));
4387 tmp16 = tmp14 - MULTIPLY(z1,
FIX(1.061150426));
4389 tmp15 = MULTIPLY(z1,
FIX(0.467085129)) - tmp13;
4392 z4 = MULTIPLY(z2 + z3, -
FIX(0.158341681)) - tmp13;
4393 tmp11 += z4 - MULTIPLY(z2,
FIX(0.424103948));
4394 tmp12 += z4 - MULTIPLY(z3,
FIX(2.373959773));
4395 z4 = MULTIPLY(z3 - z2,
FIX(1.405321284));
4396 tmp14 += z4 + tmp13 - MULTIPLY(z3,
FIX(1.6906431334));
4397 tmp15 += z4 + MULTIPLY(z2,
FIX(0.674957567));
4399 tmp13 = (z1 - z3) << PASS1_BITS;
4403 wsptr[7*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4404 wsptr[7*13] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4405 wsptr[7*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4406 wsptr[7*12] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4407 wsptr[7*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
4408 wsptr[7*11] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
4409 wsptr[7*3] = (
int) (tmp23 + tmp13);
4410 wsptr[7*10] = (
int) (tmp23 - tmp13);
4411 wsptr[7*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4412 wsptr[7*9] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4413 wsptr[7*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
4414 wsptr[7*8] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
4415 wsptr[7*6] = (
int)
RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);
4416 wsptr[7*7] = (
int)
RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);
4424 for (ctr = 0; ctr < 14; ctr++) {
4430 tmp23 = (
INT32) wsptr[0] +
4432 (
ONE << (PASS1_BITS+2)));
4433 tmp23 <<= CONST_BITS;
4435 z1 = (
INT32) wsptr[2];
4436 z2 = (
INT32) wsptr[4];
4437 z3 = (
INT32) wsptr[6];
4439 tmp20 = MULTIPLY(z2 - z3,
FIX(0.881747734));
4440 tmp22 = MULTIPLY(z1 - z2,
FIX(0.314692123));
4441 tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2,
FIX(1.841218003));
4444 tmp10 = MULTIPLY(tmp10,
FIX(1.274162392)) + tmp23;
4445 tmp20 += tmp10 - MULTIPLY(z3,
FIX(0.077722536));
4446 tmp22 += tmp10 - MULTIPLY(z1,
FIX(2.470602249));
4447 tmp23 += MULTIPLY(z2,
FIX(1.414213562));
4451 z1 = (
INT32) wsptr[1];
4452 z2 = (
INT32) wsptr[3];
4453 z3 = (
INT32) wsptr[5];
4455 tmp11 = MULTIPLY(z1 + z2,
FIX(0.935414347));
4456 tmp12 = MULTIPLY(z1 - z2,
FIX(0.170262339));
4457 tmp10 = tmp11 - tmp12;
4459 tmp12 = MULTIPLY(z2 + z3, -
FIX(1.378756276));
4461 z2 = MULTIPLY(z1 + z3,
FIX(0.613604268));
4463 tmp12 += z2 + MULTIPLY(z3,
FIX(1.870828693));
4468 CONST_BITS+PASS1_BITS+3)
4471 CONST_BITS+PASS1_BITS+3)
4474 CONST_BITS+PASS1_BITS+3)
4477 CONST_BITS+PASS1_BITS+3)
4480 CONST_BITS+PASS1_BITS+3)
4483 CONST_BITS+PASS1_BITS+3)
4486 CONST_BITS+PASS1_BITS+3)
4506 INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
4507 INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
4508 INT32 z1, z2, z3, z4;
4515 int workspace[6*12];
4525 for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {
4531 z3 +=
ONE << (CONST_BITS-PASS1_BITS-1);
4534 z4 = MULTIPLY(z4,
FIX(1.224744871));
4540 z4 = MULTIPLY(z1,
FIX(1.366025404));
4552 tmp20 = tmp10 + tmp12;
4553 tmp25 = tmp10 - tmp12;
4555 tmp12 = z4 - z1 - z2;
4557 tmp22 = tmp11 + tmp12;
4558 tmp23 = tmp11 - tmp12;
4567 tmp11 = MULTIPLY(z2,
FIX(1.306562965));
4568 tmp14 = MULTIPLY(z2, - FIX_0_541196100);
4571 tmp15 = MULTIPLY(tmp10 + z4,
FIX(0.860918669));
4572 tmp12 = tmp15 + MULTIPLY(tmp10,
FIX(0.261052384));
4573 tmp10 = tmp12 + tmp11 + MULTIPLY(z1,
FIX(0.280143716));
4574 tmp13 = MULTIPLY(z3 + z4, -
FIX(1.045510580));
4575 tmp12 += tmp13 + tmp14 - MULTIPLY(z3,
FIX(1.478575242));
4576 tmp13 += tmp15 - tmp11 + MULTIPLY(z4,
FIX(1.586706681));
4577 tmp15 += tmp14 - MULTIPLY(z1,
FIX(0.676326758)) -
4578 MULTIPLY(z4,
FIX(1.982889723));
4582 z3 = MULTIPLY(z1 + z2, FIX_0_541196100);
4583 tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);
4584 tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);
4588 wsptr[6*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4589 wsptr[6*11] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4590 wsptr[6*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4591 wsptr[6*10] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4592 wsptr[6*2] = (
int)
RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);
4593 wsptr[6*9] = (
int)
RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);
4594 wsptr[6*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
4595 wsptr[6*8] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
4596 wsptr[6*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4597 wsptr[6*7] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4598 wsptr[6*5] = (
int)
RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);
4599 wsptr[6*6] = (
int)
RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);
4607 for (ctr = 0; ctr < 12; ctr++) {
4613 tmp10 = (
INT32) wsptr[0] +
4615 (
ONE << (PASS1_BITS+2)));
4616 tmp10 <<= CONST_BITS;
4617 tmp12 = (
INT32) wsptr[4];
4618 tmp20 = MULTIPLY(tmp12,
FIX(0.707106781));
4619 tmp11 = tmp10 + tmp20;
4620 tmp21 = tmp10 - tmp20 - tmp20;
4621 tmp20 = (
INT32) wsptr[2];
4622 tmp10 = MULTIPLY(tmp20,
FIX(1.224744871));
4623 tmp20 = tmp11 + tmp10;
4624 tmp22 = tmp11 - tmp10;
4628 z1 = (
INT32) wsptr[1];
4629 z2 = (
INT32) wsptr[3];
4630 z3 = (
INT32) wsptr[5];
4631 tmp11 = MULTIPLY(z1 + z3,
FIX(0.366025404));
4632 tmp10 = tmp11 + ((z1 + z2) << CONST_BITS);
4633 tmp12 = tmp11 + ((z3 - z2) << CONST_BITS);
4634 tmp11 = (z1 - z2 - z3) << CONST_BITS;
4639 CONST_BITS+PASS1_BITS+3)
4642 CONST_BITS+PASS1_BITS+3)
4645 CONST_BITS+PASS1_BITS+3)
4648 CONST_BITS+PASS1_BITS+3)
4651 CONST_BITS+PASS1_BITS+3)
4654 CONST_BITS+PASS1_BITS+3)
4674 INT32 tmp10, tmp11, tmp12, tmp13, tmp14;
4675 INT32 tmp20, tmp21, tmp22, tmp23, tmp24;
4676 INT32 z1, z2, z3, z4, z5;
4683 int workspace[5*10];
4693 for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
4699 z3 +=
ONE << (CONST_BITS-PASS1_BITS-1);
4701 z1 = MULTIPLY(z4,
FIX(1.144122806));
4702 z2 = MULTIPLY(z4,
FIX(0.437016024));
4707 CONST_BITS-PASS1_BITS);
4712 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
4713 tmp12 = z1 + MULTIPLY(z2,
FIX(0.513743148));
4714 tmp13 = z1 - MULTIPLY(z3,
FIX(2.176250899));
4716 tmp20 = tmp10 + tmp12;
4717 tmp24 = tmp10 - tmp12;
4718 tmp21 = tmp11 + tmp13;
4719 tmp23 = tmp11 - tmp13;
4731 tmp12 = MULTIPLY(tmp13,
FIX(0.309016994));
4732 z5 = z3 << CONST_BITS;
4734 z2 = MULTIPLY(tmp11,
FIX(0.951056516));
4737 tmp10 = MULTIPLY(z1,
FIX(1.396802247)) + z2 + z4;
4738 tmp14 = MULTIPLY(z1,
FIX(0.221231742)) - z2 + z4;
4740 z2 = MULTIPLY(tmp11,
FIX(0.587785252));
4741 z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));
4743 tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;
4745 tmp11 = MULTIPLY(z1,
FIX(1.260073511)) - z2 - z4;
4746 tmp13 = MULTIPLY(z1,
FIX(0.642039522)) - z2 + z4;
4750 wsptr[5*0] = (
int)
RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);
4751 wsptr[5*9] = (
int)
RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);
4752 wsptr[5*1] = (
int)
RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);
4753 wsptr[5*8] = (
int)
RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);
4754 wsptr[5*2] = (
int) (tmp22 + tmp12);
4755 wsptr[5*7] = (
int) (tmp22 - tmp12);
4756 wsptr[5*3] = (
int)
RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);
4757 wsptr[5*6] = (
int)
RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);
4758 wsptr[5*4] = (
int)
RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);
4759 wsptr[5*5] = (
int)
RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);
4767 for (ctr = 0; ctr < 10; ctr++) {
4773 tmp12 = (
INT32) wsptr[0] +
4775 (
ONE << (PASS1_BITS+2)));
4776 tmp12 <<= CONST_BITS;
4777 tmp13 = (
INT32) wsptr[2];
4778 tmp14 = (
INT32) wsptr[4];
4779 z1 = MULTIPLY(tmp13 + tmp14,
FIX(0.790569415));
4780 z2 = MULTIPLY(tmp13 - tmp14,
FIX(0.353553391));
4788 z2 = (
INT32) wsptr[1];
4789 z3 = (
INT32) wsptr[3];
4791 z1 = MULTIPLY(z2 + z3,
FIX(0.831253876));
4792 tmp13 = z1 + MULTIPLY(z2,
FIX(0.513743148));
4793 tmp14 = z1 - MULTIPLY(z3,
FIX(2.176250899));
4798 CONST_BITS+PASS1_BITS+3)
4801 CONST_BITS+PASS1_BITS+3)
4804 CONST_BITS+PASS1_BITS+3)
4807 CONST_BITS+PASS1_BITS+3)
4810 CONST_BITS+PASS1_BITS+3)
4830 INT32 tmp0, tmp1, tmp2, tmp3;
4831 INT32 tmp10, tmp11, tmp12, tmp13;
4851 for (ctr = 4; ctr > 0; ctr--) {
4866 int dcval = DEQUANTIZE(inptr[
DCTSIZE*0], quantptr[
DCTSIZE*0]) << PASS1_BITS;
4892 z2 +=
ONE << (CONST_BITS-PASS1_BITS-1);
4900 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4901 tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
4902 tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
4904 tmp10 = tmp0 + tmp2;
4905 tmp13 = tmp0 - tmp2;
4906 tmp11 = tmp1 + tmp3;
4907 tmp12 = tmp1 - tmp3;
4921 z1 = MULTIPLY(z2 + z3, FIX_1_175875602);
4922 z2 = MULTIPLY(z2, - FIX_1_961570560);
4923 z3 = MULTIPLY(z3, - FIX_0_390180644);
4927 z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223);
4928 tmp0 = MULTIPLY(tmp0, FIX_0_298631336);
4929 tmp3 = MULTIPLY(tmp3, FIX_1_501321110);
4933 z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447);
4934 tmp1 = MULTIPLY(tmp1, FIX_2_053119869);
4935 tmp2 = MULTIPLY(tmp2, FIX_3_072711026);
4941 wsptr[4*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
4942 wsptr[4*7] = (
int)
RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
4943 wsptr[4*1] = (
int)
RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
4944 wsptr[4*6] = (
int)
RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
4945 wsptr[4*2] = (
int)
RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
4946 wsptr[4*5] = (
int)
RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
4947 wsptr[4*3] = (
int)
RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
4948 wsptr[4*4] = (
int)
RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
4961 for (ctr = 0; ctr < 8; ctr++) {
4967 tmp0 = (
INT32) wsptr[0] +
4969 (
ONE << (PASS1_BITS+2)));
4970 tmp2 = (
INT32) wsptr[2];
4972 tmp10 = (tmp0 + tmp2) << CONST_BITS;
4973 tmp12 = (tmp0 - tmp2) << CONST_BITS;
4978 z2 = (
INT32) wsptr[1];
4979 z3 = (
INT32) wsptr[3];
4981 z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
4982 tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865);
4983 tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065);
4988 CONST_BITS+PASS1_BITS+3)
4991 CONST_BITS+PASS1_BITS+3)
4994 CONST_BITS+PASS1_BITS+3)
4997 CONST_BITS+PASS1_BITS+3)
5017 INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
5035 for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {
5039 tmp0 <<= CONST_BITS;
5041 tmp0 +=
ONE << (CONST_BITS-PASS1_BITS-1);
5043 tmp10 = MULTIPLY(tmp2,
FIX(0.707106781));
5044 tmp1 = tmp0 + tmp10;
5045 tmp11 =
RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);
5047 tmp0 = MULTIPLY(tmp10,
FIX(1.224744871));
5048 tmp10 = tmp1 + tmp0;
5049 tmp12 = tmp1 - tmp0;
5056 tmp1 = MULTIPLY(z1 + z3,
FIX(0.366025404));
5057 tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);
5058 tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);
5059 tmp1 = (z1 - z2 - z3) << PASS1_BITS;
5063 wsptr[3*0] = (
int)
RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);
5064 wsptr[3*5] = (
int)
RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
5065 wsptr[3*1] = (
int) (tmp11 + tmp1);
5066 wsptr[3*4] = (
int) (tmp11 - tmp1);
5067 wsptr[3*2] = (
int)
RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);
5068 wsptr[3*3] = (
int)
RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);
5076 for (ctr = 0; ctr < 6; ctr++) {
5082 tmp0 = (
INT32) wsptr[0] +
5084 (
ONE << (PASS1_BITS+2)));
5085 tmp0 <<= CONST_BITS;
5086 tmp2 = (
INT32) wsptr[2];
5087 tmp12 = MULTIPLY(tmp2,
FIX(0.707106781));
5088 tmp10 = tmp0 + tmp12;
5089 tmp2 = tmp0 - tmp12 - tmp12;
5093 tmp12 = (
INT32) wsptr[1];
5094 tmp0 = MULTIPLY(tmp12,
FIX(1.224744871));
5099 CONST_BITS+PASS1_BITS+3)
5102 CONST_BITS+PASS1_BITS+3)
5105 CONST_BITS+PASS1_BITS+3)
5125 INT32 tmp0, tmp2, tmp10, tmp12;
5133 INT32 workspace[2*4];
5144 for (ctr = 0; ctr < 2; ctr++, inptr++, quantptr++, wsptr++) {
5150 tmp10 = (tmp0 + tmp2) << CONST_BITS;
5151 tmp12 = (tmp0 - tmp2) << CONST_BITS;
5156 z2 = DEQUANTIZE(inptr[