|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.openstego.util.dct.DCT
public class DCT
Class to handle Discrete Cosine Transforms (DCT). This class is conversion of C to Java for the file "dct.c" file provided by Peter Meerwald at: http://www.cosy.sbg.ac.at/~pmeerw/Watermarking/ Refer to his thesis on watermarking: Peter Meerwald, Digital Image Watermarking in the Wavelet Transfer Domain, Master's Thesis, Department of Scientific Computing, University of Salzburg, Austria, January 2001.
Field Summary | |
---|---|
static int |
NJPEG
Constant for the JPEG block size |
static int |
QUALITY
Default JPEG quality to use for encoding |
Constructor Summary | |
---|---|
DCT()
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NJPEG
public static final int QUALITY
Constructor Detail |
---|
public DCT()
Method Detail |
---|
public void initDctNxM(int cols, int rows) throws java.lang.IllegalArgumentException
cols
- Number of columnsrows
- Number of rows
java.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 matrix
java.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 number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |