Those are two simple implementations of the Discrete Cosine Transform.
In this repository, there is a dct_transform_lee directory that is a port from C to Odin of an MIT licensed discrete cosine transform that uses the fast Lee algorithm and the original can be found in the following file link:
Fast Discrete Cosine Transform algoriothm
by Nayuki Minase
https://github.com/nayuki/Nayuki-web-published-code/blob/master/fast-discrete-cosine-transform-algorithms/fast-dct-lee.c
from Project Nayuki
Fast discrete cosine transform algorithms
https://www.nayuki.io/page/fast-discrete-cosine-transform-algorithms
Then, I added to that file the 2D transform 16x16, constructed from the 1D transform and the correction factors for the transform. The other is a simple directed and slower implementation of the 2D Cosine Transform. Both give the same exact values but the one that uses Lee Algorithm is significantly faster.
MIT Open Source License
Best regards,
Joao Carvalho