MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / InverseDCT1D

Function InverseDCT1D

Source/Core/JpegTask.cpp:522–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520#define K9 -0.899976223f // C7-C3
521#define K10 -2.562915448f // -C1-C3
522static void InverseDCT1D(const float * const x, float *dst, u32 stride)
523{
524 float e[4] {};
525 float f[4] {};
526 float x26 {}, x1357 {}, x15 {}, x37 {}, x17 {}, x35 {};
527
528 x15 = K3 * (x[1] + x[5]);
529 x37 = K4 * (x[3] + x[7]);
530 x17 = K9 * (x[1] + x[7]);
531 x35 = K10 * (x[3] + x[5]);
532 x1357 = C3 * (x[1] + x[3] + x[5] + x[7]);
533 x26 = C6 * (x[2] + x[6]);
534
535 f[0] = x[0] + x[4];
536 f[1] = x[0] - x[4];
537 f[2] = x26 + K1*x[2];
538 f[3] = x26 + K2*x[6];
539
540 e[0] = x1357 + x15 + K5*x[1] + x17;
541 e[1] = x1357 + x37 + K7*x[3] + x35;
542 e[2] = x1357 + x15 + K6*x[5] + x35;
543 e[3] = x1357 + x37 + K8*x[7] + x17;
544
545 *dst = f[0] + f[2] + e[0]; dst += stride;
546 *dst = f[1] + f[3] + e[1]; dst += stride;
547 *dst = f[1] - f[3] + e[2]; dst += stride;
548 *dst = f[0] - f[2] + e[3]; dst += stride;
549 *dst = f[0] - f[2] - e[3]; dst += stride;
550 *dst = f[1] - f[3] - e[2]; dst += stride;
551 *dst = f[1] + f[3] - e[1]; dst += stride;
552 *dst = f[0] + f[2] - e[0]; dst += stride;
553}
554#undef C3
555#undef C6
556#undef K1

Callers 1

InverseDCTSubBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected