The DCT definitions here are based on the python scipy.fft.dct definitions.
Specifically this use:
# python code
scipy.fft.dct(x, norm = "forward", orthogonalize = True)
$$
y_k = \frac{1}{zN} \sum_{j=0}^{N-1}x_j\cos\left(\frac{\pi k(2j+1)}{2N}\right)
$$
$$
z = \begin{cases}
\sqrt{2}& \text{for }k=0\\
1 & \text{for }k>0
\end{cases}
$$
For the Inverse Discrete Cosine Transform, see idct.