public class DCT
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NJPEG
Constant for the JPEG block size
|
static int |
QUALITY
Default JPEG quality to use for encoding
|
Constructor and Description |
---|
DCT() |
Modifier and Type | Method and Description |
---|---|
void |
dequantize8x8(double[][] transform)
De-quantize the DCT matrix based on the quantization table
|
void |
fwdDct8x8(int[][] input,
double[][] output)
Perform forward DCT on the 8x8 matrix
|
void |
fwdDctBlock8x8(int[][] input,
int col,
int row,
double[][] output)
Perform forward DCT on a given 8x8 block of the input matrix
|
void |
fwdDctInPlaceNxN(double[][] coeffs)
Perform forward DCT in place for N x N matrix
|
void |
fwdDctNxM(int[][] pixels,
double[][] dcts)
Perform forward DCT for N x M matrix
|
void |
fwdDctNxN(int[][] pixels,
double[][] dcts)
Perform forward DCT for N x N matrix
|
void |
initDct8x8()
Initialize DCT mechanism for 8x8 block
|
void |
initDctNxM(int cols,
int rows)
Initialize DCT mechanism for N x M matrix
|
void |
initDctNxN(int width,
int height)
Initialize DCT mechanism for N x M matrix
|
void |
initQuantum8x8()
Initialize quantization table based on the quality
|
void |
initQuantumJpegChromin()
Initialize quantization table based on JPEG chrominance quantization
|
void |
initQuantumJpegLumin()
Initialize quantization table based on JPEG luminance quantization
|
void |
invDct8x8(double[][] input,
int[][] output)
Perform inverse DCT on the 8x8 matrix
|
void |
invDctBlock8x8(double[][] input,
int[][] output,
int col,
int row)
Perform inverse DCT to given 8x8 block of the output matrix
|
void |
invDctInPlaceNxN(double[][] coeffs)
Perform inverse DCT in place for N x N matrix
|
void |
invDctNxM(double[][] dcts,
int[][] pixels)
Perform inverse DCT on the N x M matrix
|
void |
invDctNxN(double[][] dcts,
int[][] pixels)
Perform inverse DCT on the N x N matrix
|
int |
isMidFreqCoeff8x8(int coeff)
Check whether the coefficient is part of the middle frequencies
|
void |
quantize8x8(double[][] transform)
Quantize the DCT matrix based on the quantization table
|
public static final int NJPEG
public static final int QUALITY
public void initDctNxM(int cols, int rows) throws java.lang.IllegalArgumentException
cols
- Number of columnsrows
- Number of rowsjava.lang.IllegalArgumentException
public void fwdDctNxM(int[][] pixels, double[][] dcts)
pixels
- Input matrixdcts
- DCT matrixpublic void invDctNxM(double[][] dcts, int[][] pixels)
dcts
- Input DCT matrixpixels
- Output matrixpublic void initDctNxN(int width, int height) throws java.lang.IllegalArgumentException
width
- Width of the matrixheight
- Height of the matrixjava.lang.IllegalArgumentException
public void fwdDctNxN(int[][] pixels, double[][] dcts)
pixels
- Input matrixdcts
- DCT matrixpublic void invDctNxN(double[][] dcts, int[][] pixels)
dcts
- Input DCT matrixpixels
- Output matrixpublic void fwdDctInPlaceNxN(double[][] coeffs)
coeffs
- DCT matrixpublic void invDctInPlaceNxN(double[][] coeffs)
coeffs
- DCT matrixpublic void initQuantum8x8()
public void initQuantumJpegLumin()
public void initQuantumJpegChromin()
public void quantize8x8(double[][] transform)
transform
- DCT matrixpublic void dequantize8x8(double[][] transform)
transform
- DCT matrixpublic void initDct8x8()
public void fwdDct8x8(int[][] input, double[][] output)
input
- Input matrixoutput
- Output matrixpublic void fwdDctBlock8x8(int[][] input, int col, int row, double[][] output)
input
- Input matrixcol
- Starting column number for the 8x8 blockrow
- Starting row number for the 8x8 blockoutput
- Output matrixpublic void invDct8x8(double[][] input, int[][] output)
input
- Input matrixoutput
- Output matrixpublic void invDctBlock8x8(double[][] input, int[][] output, int col, int row)
input
- Input matrix (8x8)output
- Output matrixcol
- Starting column number for the 8x8 blockrow
- Starting row number for the 8x8 blockpublic int isMidFreqCoeff8x8(int coeff)
coeff
- Coefficient numberCopyright © 2007-2009 Samir Vaidya. All Rights Reserved.