⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chenimage.h

📁 LDPC码的实现,包括编码器和解码器,使用了DCT.
💻 H
📖 第 1 页 / 共 2 页
字号:
 * short* pShiftsX
 * short* pShiftsY
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageBlockMatch2D(const int nWidth, const int nHeight, const int nBlockSize, const int nMaxShift, const short* pSrc1, const short* pSrc2, short* pShiftedImg, short* pResidual, short* pShiftsX, short* pShiftsY); 

/* -----------------------------------------------------------------------------
 * ChenImage_JPEGLSPredict
 * -----------------------------------------------------------------------------
 * Predicts a pixel given the causal neighborhood pixels, using the JPEG-LS
 * nonlinear predictor.
 *
 * Inputs:
 * const short nS1
 * const short nS2
 * const short nS3
 *
 * Outputs:
 * short* pS0
 * -----------------------------------------------------------------------------
 */
int ChenImage_JPEGLSPredict(const short nS1, const short nS2, const short nS3, short* pS0);

/* -----------------------------------------------------------------------------
 * ChenImage_extrapolateImage
 * -----------------------------------------------------------------------------
 * Shifts an image by integer displacements in horziontal and vertical
 * directions. Performs extrapolation at borders.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 * const int nXShift -- positive to expand right, negative to expand left
 * const int nYShift -- positive to expand down, negative to expand up
 *
 * Outputs:
 * short* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_extrapolateImage(const short nWidth, const short nHeight, const short* pSrc, const int nXShift, const int nYShift, short* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_shiftImage
 * -----------------------------------------------------------------------------
 * Shifts an image by integer displacements in horziontal and vertical
 * directions. Performs extrapolation at borders.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 * const int nXShift
 * const int nYShift
 *
 * Outputs:
 * short* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_shiftImage(const int nWidth, const int nHeight, const short* pSrc, const int nXShift, const int nYShift, short* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_interpolateImage
 * -----------------------------------------------------------------------------
 * Interpolates a small image into a large image.
 *
 * Inputs:
 * const int nInterpolateMethod -- IPPI_INTER_NN, IPPI_INTER_LINEAR, ...
 * const int nWidthSmall
 * const int nHeightSmall
 * const short* (float*) pSrc
 * const int nWidthLarge
 * const int nHeightLarge
 *
 * Outputs:
 * short* (float*) pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_interpolateImage(const int nInterpolateMethod, const int nWidthSmall, const int nHeightSmall, const short* pSrc, const int nWidthLarge, const int nHeightLarge, short* pDst);
int ChenImage_interpolateImage(const int nInterpolateMethod, const int nWidthSmall, const int nHeightSmall, const float* pSrc, const int nWidthLarge, const int nHeightLarge, float* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_copyImage
 * -----------------------------------------------------------------------------
 * Copies one image into another.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 *
 * Outputs:
 * short* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_copyImage(const int nWidth, const int nHeight, const short* pSrc, short* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_laplacianPDF
 * -----------------------------------------------------------------------------
 * Calculates the Laplacian PDF at sample locations.
 *
 * Inputs:
 * const int nLength
 * const float fLambda
 * const float* pSrc
 *
 * Outputs:
 * float* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_laplacianPDF(const int nLength, const float fLambda, const float* pSrc, float* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_fitBlockLaplacianModel
 * -----------------------------------------------------------------------------
 * Estimates a Laplacian model for each block of an image.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 * const int nBlockSize
 *
 * Outputs:
 * float* pLaplacianML -- nBlockSize x nBlockSize
 * float* pEntropyML
 * float* pLaplacianME
 * float* pEntropyME
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageFitBlockLaplacianModel(const int nWidth, const int nHeight, const short* pSrc, const int nBlockSize, float* pLaplacianML, float* pEntropyML, float* pLaplacianME, float* pEntropyME);

/* -----------------------------------------------------------------------------
 * ChenImage_imageFitLaplacianModel
 * -----------------------------------------------------------------------------
 * Estimates a Laplacian model for an entire image. Uses both maximum
 * likelihood and minimum entropy criteria.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 *
 * Outputs:
 * float* pLaplacianML - maximum likelihood
 * float* pEntropyML -- in bits per original bit (bits per pixel / 8)
 * float* pLaplacianME -- minimum entropy
 * float* pEntropyME -- in bits per original bit (bits per pixel / 8)
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageFitLaplacianModel(const int nWidth, const int nHeight, const short* pSrc, float* pLaplacianML, float* pEntropyML, float* pLaplacianME, float* pEntropyME);

/* -----------------------------------------------------------------------------
 * ChenImage_generalGaussianPDF
 * -----------------------------------------------------------------------------
 * Calculates the generalized Gaussian PDF at sample locations.
 *
 * Inputs:
 * const int nLength
 * const float fR
 * const float fStdDev
 * const float* pSrc -- sample locations
 *
 * Outputs:
 * float* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_generalGaussianPDF(const int nLength, const float fR, const float fStdDev, const float* pSrc, float* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_generalGaussianTransEqn
 * -----------------------------------------------------------------------------
 * Calculates the transcendental equation for ML estimation of the generalized
 * Gaussian shape parameter.
 *
 * Inputs:
 * const int nLength
 * const float fR
 * const short* pSrc
 *
 * Outputs:
 * float* pG
 * -----------------------------------------------------------------------------
 */
int ChenImage_generalGaussianTransEqn(const int nDataLength, const float fR, const short* pSrcAbs, float* pG);

/* -----------------------------------------------------------------------------
 * ChenImage_imageFitBlockGeneralGaussianModel
 * -----------------------------------------------------------------------------
 * Estimates a generalized Gaussian model for each block of an image.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 * const int nBlockSize
 *
 * Outputs:
 * float* pStdDev -- nBlockSize x nBlockSize
 * float* pParamRML 
 * float* pEntropyML
 * float* pParamRME
 * float* pEntropyME
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageFitBlockGeneralGaussianModel(const int nWidth, const int nHeight, const short* pSrc, const int nBlockSize, float* pStdDev, float* pParamRML, float* pEntropyML, float* pParamRME, float* pEntropyME);

/* -----------------------------------------------------------------------------
 * ChenImage_imageFitGeneralGaussianModel
 * -----------------------------------------------------------------------------
 * Estimates a generalized Gaussian model for an entire image. Uses both maximum
 * likelihood and minimum entropy criteria.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc
 *
 * Outputs:
 * float* pStdDev -- standard deviation
 * float* pRML - maximum likelihood
 * float* pEntropyML -- in bits per original bit (bits per pixel / 8)
 * float* pRME -- minimum entropy
 * float* pEntropyME -- in bits per original bit (bits per pixel / 8)
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageFitGeneralGaussianModel(const int nWidth, const int nHeight, const short* pSrc, float* pStdDev, float* pParamRML, float* pEntropyML, float* pParamRME, float* pEntropyME);

/* -----------------------------------------------------------------------------
 * ChenImage_blockQuantize
 * -----------------------------------------------------------------------------
 * Quantize each coefficient in a block separately.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc (const float* pSrc)
 * const int nBlockSize
 * const short* pTable
 *
 * Outputs:
 * short* pDst (float* pDst)
 * -----------------------------------------------------------------------------
 */
int ChenImage_blockQuantize(const int nWidth, const int nHeight, const short* pSrc, const int nBlockSize, const short* pTable, short* pDst);
int ChenImage_blockQuantize(const int nWidth, const int nHeight, const float* pSrc, const int nBlockSize, const short* pTable, float* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_blockDequantize
 * -----------------------------------------------------------------------------
 * Dequantize each coefficient in a block separately.
 *
 * Inputs:
 * const int nWidth
 * const int nHeight
 * const short* pSrc (const float* pSrc)
 * const int nBlockSize
 * const short* pTable
 *
 * Outputs:
 * short* pDst (short* pDst)
 * -----------------------------------------------------------------------------
 */
int ChenImage_blockDequantize(const int nWidth, const int nHeight, const short* pSrc, const int nBlockSize, const short* pTable, short* pDst);
int ChenImage_blockDequantize(const int nWidth, const int nHeight, const float* pSrc, const int nBlockSize, const short* pTable, float* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_HuffmanEncode
 * -----------------------------------------------------------------------------
 * Encodes a data vector using a Huffman code.
 *
 * Inputs:
 * const int nSrcLen
 * const uchar* pSrc
 *
 * Outputs:
 * uchar* pDst
 * int* pDstLen
 * -----------------------------------------------------------------------------
 */
int ChenImage_HuffmanEncode(const int nSrcLen, const uchar* pSrc, uchar* pDst, int* pDstLen);

/* -----------------------------------------------------------------------------
 * ChenImage_HuffmanDecode
 * -----------------------------------------------------------------------------
 * Decodes a Huffman vector into a data vector.
 *
 * Inputs:
 * const int nSrcLen
 * const uchar* pSrc
 *
 * Outputs:
 * int* pDstLen
 * uchar* pDst
 * -----------------------------------------------------------------------------
 */
int ChenImage_HuffmanDecode(const int nSrcLen, const uchar* pSrc, int* pDstLen, uchar* pDst);

/* -----------------------------------------------------------------------------
 * ChenImage_imageToQuadrants
 * -----------------------------------------------------------------------------
 * Converts an image into four quadrant-sized images.
 *
 * Inputs:
 * const int nWidth -- full image width
 * const int nHeight -- full image height
 * const short* pImg
 *
 * Outputs:
 * short* pImgQuads[4]
 * -----------------------------------------------------------------------------
 */
int ChenImage_imageToQuadrants(const int nWidth, const int nHeight, const short* pImg, short** pImgQuads);

/* -----------------------------------------------------------------------------
 * ChenImage_quadrantsToImage
 * -----------------------------------------------------------------------------
 * Converts four quadrant-sized images into a single image.
 *
 * Inputs:
 * const int nWidth -- full image width
 * const int nHeight -- full image height
 * const short* pImgQuads[4]
 *
 * Outputs:
 * short* pImg
 * -----------------------------------------------------------------------------
 */
int ChenImage_quadrantsToImage(const int nWidth, const int nHeight, const short** pImgQuads, short* pImg);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -