fi.helsinki.cs.ohtu.mpeg2.video
Interface DiscreteCosineTransform
- All Known Implementing Classes:
- SimpleDiscreteCosineTransform
public interface DiscreteCosineTransform
This is an interface for implementations of the forward discrete cosine transform.
The exact function to be evaluated for each element of a NxN image is:
F(u,v) = (2/N) * C(u) * C(v) * Sigma[x=0->N-1] Sigma[y=0->N-1] (f(x,y) * cosTerm1 * cosTerm2)
,where:
cosTerm1 = ((2x + 1) * u * PI) / 2N
cosTerm2 = ((2y + 1) * v * PI) / 2N
C(x) = 1/sqrt(2) when x = 0,
1 otherwise
transformToFrequencySpace
double[] transformToFrequencySpace(int[] input,
int size)
- Transforms one image with the DCT.
- Parameters:
input
- The image to be transformedsize
- The number of rows and columns in the image
- Returns:
- The transformed image