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

📄 decoderquad.h

📁 LDPC码的实现,包括编码器和解码器,使用了DCT.
💻 H
📖 第 1 页 / 共 2 页
字号:
 *		LDPC parity stream [[ BITS_QUAD ]]
 * const double* pLLRSideInfo
 *		log likelihood ratio for side information [[ BITS_QUAD ]]
 *
 * Outputs:
 * double* pLLROutput
 *		log likelihood ratio for decoded bits [[ BITS_QUAD ]]
 * double* pLLRMemory
 *		log likelihood memory
 * double* pCheckLLR
 *		log likehood check
 * double* pCheckLLRMag
 *		log likelihood check magnitudes
 * double* pRowTotal
 *		syndrome row checks [[ BITS_QUAD ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_ldpcDecoderQuad(const int* pIR, const int* pJC, const int nSubcodeLength, const int nCodeLength, const int nCodeEdges, const double* pSyndrome, const double* pLLRSideInfo, double* pLLROutput, double* pLLRMemory, double* pCheckLLR, double* pCheckLLRMag, double* pRowTotal);

/* -----------------------------------------------------------------------------
 * pixelQuads_motionEstimatorQuad
 * -----------------------------------------------------------------------------
 * Estimates blockwise motion field.
 *
 * Inputs:
 * const double* pLLROutput
 *		log likelihood ratio for decoded bits [[ BITS_QUAD ]]
 * const short* pSideInfo
 *		side information array 
 *		[[ NUM_SHIFTS_2D x HEIGHT_QUAD x WIDTH_QUAD ]]
 * const double* pChannel
 *		Laplacian noise channel [[ NUM_COEFFS x LEVELS ]]
 *		NUM_COEFFS channels for NUM_COEFFS subbands
 * const short* pQuantRange
 *		dynamic ranges of DCT subbands [[ NUM_COEFFS ]]
 *
 * Outputs:
 * double* pTheta
 *		probabilities for decoded bits [[ LEVELS x NUM_COEFFS ]]
 * double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_motionEstimatorQuad(const double* pLLROutput, const short* pSideInfo, const double* pChannel, const short* pQuantRange, double* pThetaArray, double* pMotionBlock);

/* -----------------------------------------------------------------------------
 * pixelQuads_interpolateMotionQuad
 * -----------------------------------------------------------------------------
 * Interpolates blockwise motion probabilities to pixelwise motion 
 * probabilities.
 *
 * Inputs:
 * const int nInterpolateMethod
 *		interpolation method
 *		INTERP_NN (nearest neighbor)
 *		INTERP_LINEAR (bilinear)
 *
 * Outputs:
 * double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * double* pMotionPixel
 *		pixelwise motion probabilities 
 *		[[ ROWS_QUAD x COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_interpolateMotionQuad(const int nInterpolateMethod, double* pMotionBlock, double* pMotionPixel);

/* -----------------------------------------------------------------------------
 * pixelQuads_initializeMotionLearningQuad
 * -----------------------------------------------------------------------------
 * Sets the blockwise motion field to have maximum weight on (0,0) and some
 * weight on other motion values.
 *
 * Outputs:
 * double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_initializeMotionLearningQuad(double* pMotionBlock);

/* -----------------------------------------------------------------------------
 * pixelQuads_initializeMotionOracleQuad
 * -----------------------------------------------------------------------------
 * Sets the blockwise motion field to have all weight on the oracle-guided 
 * values.
 *
 * Inputs:
 * const short* pShiftsX
 * const short* pShiftsY
 *		blockwise oracle motion field 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
 *
 * Outputs:
 * double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_initializeMotionOracleQuad(const short* pShiftsX, const short* pShiftsY, double* pMotionBlock);

/* -----------------------------------------------------------------------------
 * pixelQuads_initializeMotionNoCompensationQuad
 * -----------------------------------------------------------------------------
 * Sets the disparity field to have all weight on (0,0).
 *
 * Outputs:
 * double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_initializeMotionNoCompensationQuad(double* pMotionBlock);

/* -----------------------------------------------------------------------------
 * pixelQuads_decodeBitsQuad
 * -----------------------------------------------------------------------------
 * Decodes the binary bitstream of image X given the LDPC parity bitstream
 * and side info image Y.
 *
 * Inputs:
 * const CodingOption* pOption
 *		structure containing all coding options
 * const short* pSideInfo
 *		side information array 
 *		[[ NUM_SHIFTS_2D x HEIGHT_QUAD x WIDTH_QUAD ]]
 * const unsigned char* pParityStream
 *		LDPC parity stream [[ BITS_QUAD ]]
 * const float fRateBound
 *		rate at which to start decoding
 *		bits-per-original-bit
 * const float* pLaplacian
 *		Laplacian parameters for subbands [[ NUM_COEFFS ]]
 * const short* pQuantCoeffRange
 *		dynamic ranges for subbands [[ NUM_COEFFS ]]
 * const short* pOracleShiftsX
 * const short* pOracleShiftsY
 *		blockwise oracle motion field 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
 *		used only for motion oracle mode
 * 
 * Outputs:
 * double* pDecodedStream
 *		decoded binary stream [[ BITS_QUAD ]]
 *		binary representation of quantized transform coefficients
 * double* pDecodedRate
 *		final rate required for successful decoding
 *		bits-per-original-bit
 * double* pDecodedMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * double* pDecodedMotionPixel
 *		pixelwise motion probabilities
 *		[[ ROWS_QUAD x COLS_QUAD x NUM_SHIFTS_2D ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_decodeBitsQuad(const CodingOption* pOption, const short* pSideInfo, const uchar* pParityStream, const float fRateBound, const float* pLaplacian, const short* pQuantCoeffRange, const short* pOracleShiftsX, const short* pOracleShiftsY, double* pDecodedStream, float* pDecodedRate, double *pDecodedMotionBlock, double* pDecodedMotionPixel);

/* -----------------------------------------------------------------------------
 * pixelQuads_generateSideInfoQuad
 * -----------------------------------------------------------------------------
 * Shifts side information image to various positions and performs DCT and
 * quantization on shifted images.
 *
 * Inputs:
 * const short* pImgY
 *		side information image [[ HEIGHT_QUAD x WIDTH_QUAD ]]
 * const short* pScaledQArray
 *		table for quantization of DCT coefficients [[ NUM_COEFFS ]]
 * 
 * Outputs:
 * short* pSideInfoQuant
 *		side information array 
 *		[[ NUM_SHIFTS_2D x HEIGHT_QUAD x WIDTH_QUAD ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_generateSideInfoQuad(const short* pImgY, const short* pScaledQArray, short* pSideInfoQuant);

/* -----------------------------------------------------------------------------
 * pixelQuads_motionCompensateReconstructQuad
 * -----------------------------------------------------------------------------
 * Reconstructs an image given the decoded quantized transform coefficients,
 * the decoded blockwise motion field, and the side info image.
 *
 * Inputs:
 * const short* pImgY
 *		side information image [[ HEIGHT_QUAD x WIDTH_QUAD ]]
 * const short* pDecodedTransQuant
 *		quantized transform coefficients of X [[ HEIGHT_QUAD x WIDTH_QUAD ]]
 * const double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * const short* pScaledQArray
 *		table for quantization of DCT coefficients [[ NUM_COEFFS ]]
 * 
 * Outputs:
 * short* pImgRecover
 *		reconstructed image [[ HEIGHT_QUAD x WIDTH_QUAD ]]
 * -----------------------------------------------------------------------------
 */
int pixelQuads_motionCompensateReconstructQuad(const short* pImgY, const short* pDecodedTransQuant, const double* pMotionBlock, const short* pScaledQArray, short* pImgRecover);

/* -----------------------------------------------------------------------------
 * pixelQuads_findMaxProbabilityQuad
 * -----------------------------------------------------------------------------
 * Finds most-probable motion vector on a blockwise basis from the motion
 * probabilities after decoding.
 *
 * Inputs:
 * const double* pMotionBlock
 *		blockwise motion probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
 * 		
 * Outputs:
 * short* pDecodedShiftsX
 * short* pDecodedShiftsY
 *		decoded blockwise motion fields 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
 *		most-probable motion candidate chosen
 * float* pDecodedShiftProb
 *		decoded blockwise max probabilities 
 *		[[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
 *		probability for most-probable motion candidate
 * -----------------------------------------------------------------------------
 */
int pixelQuads_findMaxMotionProbabilityQuad(const double* pMotionBlock, short* pDecodedShiftsX, short* pDecodedShiftsY, float* pDecodedShiftProb);

#endif

⌨️ 快捷键说明

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