I am looking for a simple algorithm for fast DCT and IDCT of matrix [NxM]
问题 I am looking for a simple algorithm to perform fast DCT (type 2) of a matrix of any size [NxM], and also an algorithm for the inverse transformation IDCT (also called DCT type 3). I need a DCT-2D algorithm, but even a DCT-1D algorithm is good enough because I can use DCT-1D to implement DCT-2D (and IDCT-1D to implement IDCT-2D ). PHP code is preferable, but any algorithm that is clear enough will do. My current PHP script for implementing DCT/IDCT is very slow whenever matrix size is more