DCT-II or "the" DCT transformation of 31-point signal This function contains 320 FP additions, 170 FP multiplications, (or, 229 additions, 79 multiplications, 91 fused multiply/add), 150 stack variables, 64 constants, and 62 memory accesses.
DCT-II or "the" DCT transformation of 31-point signal.
125{
126 E T2J, T1H, T1J, T1I, T1K, T1T, T2S, T3a, T31, T3b, T3M, T1M, T1P, T1N, T1Q;
127 E T1i, T1l, T1A, T1D, T1b, T1k, T1v, T1C, T3n, T3I, T3y, T3D, T3S, T3V, T43;
128 E T46, T3P, T3U, T40, T45;
130 {
131 E TN, T2K, TW, T32, T16, T2T, T1d, T1e, T3e, T3d, T2R, T3p, TK, TO, Tu;
132 E T1p, T3i, T3F, T12, T17, T30, T3s, Tf, T1o, T3l, T3G, TT, TX, T39, T3v;
136 TN = TL - TM;
137 T2K = TL + TM;
138 {
142 TW = TU - TV;
143 T32 = TU + TV;
146 T16 = T14 - T15;
147 T2T = T14 + T15;
148 }
149 {
150 E Ty, T2L, TI, T2P, TB, T2M, TF, T2O;
151 {
155 Ty = Tw - Tx;
156 T2L = Tw + Tx;
159 TI = TG - TH;
160 T2P = TG + TH;
161 }
162 {
166 TB = Tz - TA;
167 T2M = Tz + TA;
169 TE = I[0];
170 TF = TD - TE;
171 T2O = TD + TE;
172 }
173 T1d = Ty - TB;
174 T1e = TF - TI;
175 T3e = T2O - T2P;
176 T3d = T2M - T2L;
177 {
179 T2N = T2L + T2M;
180 T2Q = T2O + T2P;
181 T2R = T2N + T2Q;
182 T3p = KP559016994 * (T2Q - T2N);
183 TC = Ty + TB;
184 TJ = TF + TI;
185 TK = KP559016994 * (TC - TJ);
186 TO = TC + TJ;
187 }
188 }
189 {
190 E Ti, T2U, Ts, T2Y, Tl, T2V, Tp, T2X;
191 {
195 Ti = Tg - Th;
196 T2U = Tg + Th;
199 Ts = Tq - Tr;
200 T2Y = Tq + Tr;
201 }
202 {
206 Tl = Tj - Tk;
207 T2V = Tj + Tk;
210 Tp = Tn - To;
211 T2X = Tn + To;
212 }
213 {
215 Tm = Ti - Tl;
216 Tt = Tp - Ts;
217 Tu =
FMA(KP475528258, Tm, KP293892626 * Tt);
218 T1p =
FNMS(KP475528258, Tt, KP293892626 * Tm);
219 T3g = T2V - T2U;
220 T3h = T2X - T2Y;
221 T3i =
FMA(KP293892626, T3g, KP475528258 * T3h);
222 T3F =
FNMS(KP293892626, T3h, KP475528258 * T3g);
223 }
224 {
225 E T10, T11, T2W, T2Z;
226 T10 = Ti + Tl;
227 T11 = Tp + Ts;
228 T12 = T10 - T11;
229 T17 = T10 + T11;
230 T2W = T2U + T2V;
231 T2Z = T2X + T2Y;
232 T30 = T2W + T2Z;
233 T3s = KP559016994 * (T2Z - T2W);
234 }
235 }
236 {
237 E T3, T33, Td, T37, T6, T34, Ta, T36;
238 {
242 T3 = T1 - T2;
243 T33 = T1 + T2;
246 Td = Tb - Tc;
247 T37 = Tb + Tc;
248 }
249 {
253 T6 = T4 - T5;
254 T34 = T4 + T5;
257 Ta = T8 - T9;
258 T36 = T8 + T9;
259 }
260 {
262 T7 = T3 - T6;
263 Te = Ta - Td;
264 Tf =
FMA(KP475528258, T7, KP293892626 * Te);
265 T1o =
FNMS(KP475528258, Te, KP293892626 * T7);
266 T3j = T34 - T33;
267 T3k = T36 - T37;
268 T3l =
FMA(KP293892626, T3j, KP475528258 * T3k);
269 T3G =
FNMS(KP293892626, T3k, KP475528258 * T3j);
270 }
271 {
273 TR = T3 + T6;
274 TS = Ta + Td;
275 TT = KP559016994 * (TR - TS);
276 TX = TR + TS;
277 T35 = T33 + T34;
278 T38 = T36 + T37;
279 T39 = T35 + T38;
280 T3v = T38 - T35;
281 }
282 }
283 T1H = TN + TO;
284 T1J = T16 + T17;
285 T1I = TW + TX;
286 T1K =
FMA(KP258006924, T1H, KP102097497 * T1I) - (KP360104421 * T1J);
287 T1T = KP371184290 * (T1H + T1J + T1I);
288 T2S = T2K + T2R;
289 T3a = T32 + T39;
290 T31 = T2T + T30;
291 T3b = T2S + T31 + T3a;
292 T3M =
FMA(KP045346848, T31, KP296373721 * T3a) - (KP341720569 * T2S);
293 {
294 E Tv, T1q, TQ, T1r, TZ, T1s, T1c, T1f, T1g, T19, T1t, T1w, T1x, T1y;
295 {
297 Tv = KP3_464101615 * (Tf - Tu);
298 T1q = KP3_464101615 * (T1o - T1p);
299 TP =
FNMS(KP250000000, TO, TN);
300 TQ = TK + TP;
301 T1r = TP - TK;
302 TY =
FNMS(KP250000000, TX, TW);
303 TZ = TT + TY;
304 T1s = TY - TT;
305 T1c = Tu + Tf;
306 T1f =
FMA(KP475528258, T1d, KP293892626 * T1e);
307 T1g =
FNMS(KP4_000000000, T1f, KP2_000000000 * T1c);
308 T13 = KP559016994 * T12;
309 T18 =
FNMS(KP250000000, T17, T16);
310 T19 = T13 + T18;
311 T1t = T18 - T13;
312 T1w = T1p + T1o;
313 T1x =
FNMS(KP475528258, T1e, KP293892626 * T1d);
314 T1y =
FNMS(KP4_000000000, T1x, KP2_000000000 * T1w);
315 }
316 T1M = T1f + T1c;
317 T1P = T1x + T1w;
318 T1N = TQ + T19 + TZ;
319 T1Q = T1r + T1t + T1s;
320 {
321 E T1h, T1z, T1a, T1u;
322 T1h = KP1_732050807 * (TZ - T19);
323 T1i = T1g + T1h;
324 T1l = T1h - T1g;
325 T1z = KP1_732050807 * (T1s - T1t);
326 T1A = T1y + T1z;
327 T1D = T1z - T1y;
328 T1a =
FMS(KP2_000000000, TQ, TZ) - T19;
329 T1b = Tv + T1a;
330 T1k = T1a - Tv;
331 T1u =
FMS(KP2_000000000, T1r, T1s) - T1t;
332 T1v = T1q + T1u;
333 T1C = T1u - T1q;
334 }
335 }
336 {
337 E T3O, T3Z, T3q, T3A, T3t, T3B, T3x, T3C, T3f, T3m, T3R, T3E, T3H, T42;
338 {
339 E T3o, T3r, T3w, T3u;
340 T3O = KP3_464101615 * (T3l - T3i);
341 T3Z = KP3_464101615 * (T3G - T3F);
342 T3o =
FMS(KP250000000, T2R, T2K);
343 T3q = T3o - T3p;
344 T3A = T3o + T3p;
345 T3r =
FMS(KP250000000, T30, T2T);
346 T3t = T3r - T3s;
347 T3B = T3r + T3s;
348 T3w = KP559016994 * T3v;
349 T3u =
FMS(KP250000000, T39, T32);
350 T3x = T3u - T3w;
351 T3C = T3u + T3w;
352 T3f =
FMA(KP293892626, T3d, KP475528258 * T3e);
353 T3m = T3i + T3l;
354 T3R =
FNMS(KP2_000000000, T3m, KP4_000000000 * T3f);
355 T3E =
FNMS(KP293892626, T3e, KP475528258 * T3d);
356 T3H = T3F + T3G;
357 T42 =
FNMS(KP2_000000000, T3H, KP4_000000000 * T3E);
358 }
359 T3n = T3f + T3m;
360 T3I = T3E + T3H;
361 T3y = T3q + T3t + T3x;
362 T3D = T3A + T3B + T3C;
363 {
364 E T3Q, T41, T3N, T3Y;
365 T3Q = KP1_732050807 * (T3t - T3x);
366 T3S = T3Q - T3R;
367 T3V = T3R + T3Q;
368 T41 = KP1_732050807 * (T3B - T3C);
369 T43 = T41 - T42;
370 T46 = T42 + T41;
371 T3N =
FMS(KP2_000000000, T3q, T3x) - T3t;
372 T3P = T3N - T3O;
373 T3U = T3O + T3N;
374 T3Y =
FMS(KP2_000000000, T3A, T3C) - T3B;
375 T40 = T3Y - T3Z;
376 T45 = T3Z + T3Y;
377 }
378 }
379 }
380 O[0] = KP2_000000000 * (T2J + T3b);
381 {
382 E T2l, T2B, T1U, T2o, T2C, T2a, T2w, T2c, T1G, T2d, T23, T25, T2y, T2h, T22;
383 E T26, T2j, T2k, T24, T1L, T1V;
384 T2j =
FNMS(KP700592410, T1M, KP122761339 * T1N);
385 T2k =
FMA(KP404201883, T1P, KP311340628 * T1Q);
386 T2l =
FMA(KP1_902113032, T2j, KP1_175570504 * T2k);
387 T2B =
FNMS(KP1_902113032, T2k, KP1_175570504 * T2j);
388 {
389 E T1S, T2m, T1O, T1R, T2n;
390 T1O =
FMA(KP245522678, T1M, KP350296205 * T1N);
391 T1R =
FNMS(KP202100941, T1Q, KP622681257 * T1P);
392 T1S = T1O + T1R;
393 T2m = KP1_118033988 * (T1R - T1O);
394 T1U =
FMS(KP2_000000000, T1S, T1T);
395 T2n =
FMA(KP500000000, T1S, T1T);
396 T2o = T2m + T2n;
397 T2C = T2n - T2m;
398 }
399 {
400 E T1n, T29, T1F, T28;
401 {
402 E T1j, T1m, T1B, T1E;
403 T1j =
FNMS(KP184517712, T1i, KP019941366 * T1b);
404 T1m =
FNMS(KP183845747, T1l, KP025400502 * T1k);
405 T1n = T1j + T1m;
406 T29 = T1m - T1j;
407 T1B =
FMA(KP184926209, T1v, KP015708004 * T1A);
408 T1E =
FMA(KP183215435, T1C, KP029606561 * T1D);
409 T1F = T1B - T1E;
410 T28 = T1B + T1E;
411 }
412 T2a =
FNMS(KP1_647278207, T29, KP1_018073920 * T28);
413 T2w =
FMA(KP1_018073920, T29, KP1_647278207 * T28);
414 T2c = KP559016994 * (T1F - T1n);
415 T1G = T1n + T1F;
416 T2d =
FMA(KP250000000, T1G, T1K);
417 }
418 {
419 E T21, T2g, T1Y, T2f;
420 T23 =
FMA(KP462201919, T1H, KP155909426 * T1J) - (KP618111346 * T1I);
421 {
422 E T1Z, T20, T1W, T1X;
423 T1Z =
FNMS(KP015708004, T1v, KP184926209 * T1A);
424 T20 =
FNMS(KP183215435, T1D, KP029606561 * T1C);
425 T21 = T1Z + T20;
426 T2g = T1Z - T20;
427 T1W =
FMA(KP184517712, T1b, KP019941366 * T1i);
428 T1X =
FMA(KP183845747, T1k, KP025400502 * T1l);
429 T1Y = T1W + T1X;
430 T2f = T1W - T1X;
431 }
432 T25 = KP968245836 * (T1Y - T21);
433 T2y =
FNMS(KP587785252, T2f, KP951056516 * T2g);
434 T2h =
FMA(KP951056516, T2f, KP587785252 * T2g);
435 T22 = T1Y + T21;
436 T26 =
FNMS(KP433012701, T22, T23);
437 }
438 T24 =
FMA(KP1_732050807, T22, T23);
439 T1L = T1G - T1K;
440 T1V = T1U - T1L;
441 O[
WS(os, 1)] =
FMA(KP2_000000000, T1L, T1U);
442 O[
WS(os, 25)] = T24 + T1V;
443 O[
WS(os, 5)] = T1V - T24;
444 {
445 E T2D, T2G, T2x, T2H, T2A, T2F, T2v, T2z, T2E, T2I;
446 T2D = T2B - T2C;
447 T2G = T2B + T2C;
448 T2v = T25 - T26;
449 T2x = T2v - T2w;
450 T2H = T2w + T2v;
451 T2z = T2d - T2c;
452 T2A = T2y + T2z;
453 T2F = T2y - T2z;
454 O[
WS(os, 23)] =
FNMS(KP2_000000000, T2A, T2D);
455 O[
WS(os, 27)] =
FMS(KP2_000000000, T2F, T2G);
456 T2E = T2A + T2D;
457 O[
WS(os, 17)] = T2x - T2E;
458 O[
WS(os, 9)] = T2x + T2E;
459 T2I = T2F + T2G;
460 O[
WS(os, 11)] = T2H - T2I;
461 O[
WS(os, 7)] = T2H + T2I;
462 }
463 {
464 E T2p, T2r, T2b, T2u, T2i, T2s, T27, T2e, T2q, T2t;
465 T2p = T2l - T2o;
466 T2r = T2l + T2o;
467 T27 = T25 + T26;
468 T2b = T27 - T2a;
469 T2u = T2a + T27;
470 T2e = T2c + T2d;
471 T2i = T2e - T2h;
472 T2s = T2h + T2e;
473 O[
WS(os, 15)] =
FNMS(KP2_000000000, T2i, T2p);
474 O[
WS(os, 29)] =
FMA(KP2_000000000, T2s, T2r);
475 T2q = T2i + T2p;
476 O[
WS(os, 13)] = T2b - T2q;
477 O[
WS(os, 3)] = T2b + T2q;
478 T2t = T2r - T2s;
479 O[
WS(os, 19)] = T2t - T2u;
480 O[
WS(os, 21)] = T2u + T2t;
481 }
482 }
483 {
484 E T4x, T4P, T3L, T4u, T4O, T4p, T4T, T4E, T49, T4o, T4c, T4n, T4M, T4A, T4j;
485 E T4z, T4v, T4w, T4k, T4a, T4b;
486 T4v =
FNMS(KP127938670, T3y, KP696877247 * T3n);
487 T4w =
FMA(KP606988889, T3I, KP213702830 * T3D);
488 T4x =
FMA(KP1_175570504, T4v, KP1_902113032 * T4w);
489 T4P =
FNMS(KP1_902113032, T4v, KP1_175570504 * T4w);
490 {
491 E T3c, T3K, T4t, T3z, T3J, T4s;
492 T3c =
FNMS(KP2_000000000, T2J, KP066666666 * T3b);
493 T3z =
FMA(KP255877341, T3n, KP348438623 * T3y);
494 T3J =
FNMS(KP427405661, T3I, KP303494444 * T3D);
495 T3K = T3z + T3J;
496 T4t = KP1_118033988 * (T3J - T3z);
497 T3L =
FMA(KP2_000000000, T3K, T3c);
498 T4s =
FNMS(KP500000000, T3K, T3c);
499 T4u = T4s + T4t;
500 T4O = T4t - T4s;
501 }
502 {
503 E T3X, T4C, T48, T4D;
504 {
505 E T3T, T3W, T44, T47;
506 T3T =
FMA(KP185591687, T3P, KP000412259 * T3S);
507 T3W =
FMA(KP112172063, T3U, KP147857608 * T3V);
508 T3X = T3T - T3W;
509 T4C = T3T + T3W;
510 T44 =
FMA(KP028866483, T40, KP183333495 * T43);
511 T47 =
FMA(KP092681288, T45, KP160793728 * T46);
512 T48 = T44 - T47;
513 T4D = T44 + T47;
514 }
515 T4p = KP559016994 * (T48 - T3X);
516 T4T =
FNMS(KP1_647278207, T4C, KP1_018073920 * T4D);
517 T4E =
FMA(KP1_018073920, T4C, KP1_647278207 * T4D);
518 T49 = T3X + T48;
519 T4o =
FNMS(KP250000000, T49, T3M);
520 }
521 {
522 E T4i, T4m, T4f, T4l;
523 T4c =
FMA(KP251026872, T2S, KP387067417 * T3a) - (KP638094290 * T31);
524 {
525 E T4g, T4h, T4d, T4e;
526 T4g =
FNMS(KP183333495, T40, KP028866483 * T43);
527 T4h =
FNMS(KP092681288, T46, KP160793728 * T45);
528 T4i = T4g + T4h;
529 T4m = T4h - T4g;
530 T4d =
FNMS(KP000412259, T3P, KP185591687 * T3S);
531 T4e =
FNMS(KP112172063, T3V, KP147857608 * T3U);
532 T4f = T4d + T4e;
533 T4l = T4e - T4d;
534 }
535 T4n =
FMA(KP587785252, T4l, KP951056516 * T4m);
536 T4M =
FNMS(KP951056516, T4l, KP587785252 * T4m);
537 T4A = KP968245836 * (T4i - T4f);
538 T4j = T4f + T4i;
539 T4z =
FNMS(KP433012701, T4j, T4c);
540 }
541 T4k =
FMA(KP1_732050807, T4j, T4c);
542 T4a = T3M + T49;
543 T4b = T3L - T4a;
544 O[
WS(os, 6)] = T4b - T4k;
545 O[
WS(os, 30)] =
FMA(KP2_000000000, T4a, T3L);
546 O[
WS(os, 26)] = T4k + T4b;
547 {
548 E T4Q, T4W, T4N, T4V, T4U, T4Y, T4L, T4S, T4R, T4X;
549 T4Q = T4O - T4P;
550 T4W = T4O + T4P;
551 T4L = T4p - T4o;
552 T4N = T4L - T4M;
553 T4V = T4M + T4L;
554 T4S = T4z - T4A;
555 T4U = T4S + T4T;
556 T4Y = T4S - T4T;
557 O[
WS(os, 4)] =
FMA(KP2_000000000, T4N, T4Q);
558 O[
WS(os, 8)] =
FMA(KP2_000000000, T4V, T4W);
559 T4R = T4Q - T4N;
560 O[
WS(os, 20)] = T4R - T4U;
561 O[
WS(os, 24)] = T4U + T4R;
562 T4X = T4V - T4W;
563 O[
WS(os, 14)] = T4X - T4Y;
564 O[
WS(os, 22)] = T4Y + T4X;
565 }
566 {
567 E T4y, T4J, T4r, T4I, T4F, T4H, T4q, T4B, T4G, T4K;
568 T4y = T4u + T4x;
569 T4J = T4x - T4u;
570 T4q = T4o + T4p;
571 T4r = T4n + T4q;
572 T4I = T4n - T4q;
573 T4B = T4z + T4A;
574 T4F = T4B + T4E;
575 T4H = T4B - T4E;
576 O[
WS(os, 2)] =
FMA(KP2_000000000, T4r, T4y);
577 O[
WS(os, 16)] =
FMA(KP2_000000000, T4I, T4J);
578 T4G = T4y - T4r;
579 O[
WS(os, 12)] = T4F - T4G;
580 O[
WS(os, 10)] = T4F + T4G;
581 T4K = T4I - T4J;
582 O[
WS(os, 28)] = T4H - T4K;
583 O[
WS(os, 18)] = T4H + T4K;
584 }
585 }
586}