📄 decoderquad.h
字号:
// decoderQuad.h
//------------------------------------------------------------
// David Chen*, David Varodayan, Markus Flierl, Bernd Girod
// Image, Video, and Multimedia Systems Group
// Information Systems Laboratory
// Stanford University
//
// *Contact: dmchen@stanford.edu
//------------------------------------------------------------
#ifndef _DECODERQUAD_H_
#define _DECODERQUAD_H_
#include "common.h"
#include <ChenImage.h>
// [[ * ]] indicates dimension or length
/* -----------------------------------------------------------------------------
* pixelQuads_decodeFrameYUV
* -----------------------------------------------------------------------------
* Decodes a YUV [4:2:0] frame using LDPC parity bitstreams and side
* information frame.
*
* Inputs:
* const CodingOption* pOption
* structure containing coding options
* const short* pSideInfoFrame[3]
* previously received frame serving as side information
* Y component [[ HEIGHT x WIDTH ]]
* U component [[ HEIGHT_QUAD x WIDTH_QUAD ]]
* V component [[ HEIGHT_QUAD x WIDTH_QUAD ]]
* const unsigned char* pAccumSyndromeQuads[6]
* LDPC parity bitstreams [[ BITS_QUAD ]]
* four streams for four quadrants of luminance component
* two streams for two chrominance components
* const short* pScaledQArray
* table for quantization of DCT coefficients [[ NUM_COEFFS ]]
* const float fRateLowerBoundQuads[6]
* initial rates at which to start decoding
* four rate values for four quadrants of luminance component
* two rate values for two chrominance components
* bits-per-original-bit
* const float* pLaplacianQuads
* Laplacian parameter sets [[ NUM_COEFFS ]]
* four sets for four quadrants of luminance component
* two sets for two chrominance components
* const char* pLadderFile
* name of ladder file
* const short* pOracleShiftsXQuads
* const short* pOracleShiftsYQuads
* blockwise oracle motion fields
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* four fields for four quadrants of luminance component
* two fields for two chrominance components
* used only for motion oracle mode
*
* Outputs:
* short* pDecodedFrame[3]
* decoded frame, same dimensions as side information frame
* float pRate[6]
* final rates required for successful decoding
* four rate values for four quadrants of luminance component
* two rate values for two chrominance components
* bits-per-original-bit
* short* pDecodedShiftsX[6]
* short* pDecodedShiftsY[6]
* decoded blockwise motion fields
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* most-probable motion candidate chosen
* four fields for four quadrants of luminance component
* two fields for two chrominance components
* float* pDecodedShiftProb[6]
* decoded blockwise max probabilities
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* probability for most-probable motion candidate
* four fields for four quadrants of luminance component
* two fields for two chrominance components
* -----------------------------------------------------------------------------
*/
int pixelQuads_decodeFrameYUV(const CodingOption* pOption, const short** pSideInfoFrame, const uchar** pAccumSyndrome, const short* pScaledQArray, const float* pLowerRateBound, const float** pLaplacian, const char* pLadderFile, const short** pOracleShiftsX, const short** pOracleShiftsY, short** pDecodedFrame, float* pRate, short** pDecodedShiftsX, short** pDecodedShiftsY, float** pDecodedShiftProb);
/* -----------------------------------------------------------------------------
* pixelQuads_decodeImage
* -----------------------------------------------------------------------------
* Decodes four LDPC parity streams, one for each quadrant of an image, into
* a reconstructed image.
*
* Inputs:
* const CodingOption* pOption
* structure containing coding options
* const short* pImgY
* grayscale side information image [[ HEIGHT x WIDTH ]]
* const unsigned char* pAccumSyndromeQuads[4]
* LDPC parity streams [[ BITS_QUAD ]]
* four streams for four quadrants of image
* const short* pScaledQArray
* table for quantization of DCT coefficients [[ NUM_COEFFS ]]
* const float fRateLowerBoundQuads[4]
* initial rates at which to start decoding
* four rate values for four quadrants of image
* bits-per-original-bit
* const float* pLaplacianQuads[4]
* Laplacian parameter sets [[ NUM_COEFFS ]]
* four sets for four quadrants of image
* const char* pLadderFile
* name of ladder file
* const short* pOracleShiftsXQuads
* const short* pOracleShiftsYQuads
* blockwise oracle motion fields
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* four fields for four quadrants of image
* used only for motion oracle mode
*
* Outputs:
* short* pDecodedImg
* decoded image, same dimensions as side information image
* float pRate[4]
* final rates required for successful decoding
* four rate values for four quadrants of image
* bits-per-original-bit
* short* pDecodedShiftsX[4]
* short* pDecodedShiftsY[4]
* decoded blockwise motion fields
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* most-probable motion candidate chosen
* four fields for four quadrants of image
* float* pDecodedShiftProb[4]
* decoded blockwise max probabilities
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* probability for most-probable motion candidate
* four fields for four quadrants of image
* -----------------------------------------------------------------------------
*/
int pixelQuads_decodeImage(const CodingOption* pOption, const short* pImgY, const uchar** pAccumSyndrome, const short* pScaledQArray, const float* pLowerRateBound, const float** pLaplacian, const char* pLadderFile, const short** pOracleShiftsX, const short** pOracleShiftsY, short* pDecodedImg, float* pRate, short** pDecodedShiftsX, short** pDecodedShiftsY, float** pDecodedShiftProb);
/* -----------------------------------------------------------------------------
* pixelQuads_decodeImageQuad
* -----------------------------------------------------------------------------
* Decodes an image X given the LDPC bitstream and the side info image Y.
* Uses space-invariant noise model and blockwise disparity field.
*
* Inputs:
* const CodingOption* pOption
* structure containing coding options
* const short* pImgY
* side information image [[ HEIGHT_QUAD x WIDTH_QUAD ]]
* const unsigned char* pAccumSyndrome
* LDPC parity stream [[ BITS_QUAD ]]
* const short* pScaledQArray
* table for quantization of DCT coefficients [[ NUM_COEFFS ]]
* const float fRateLowerBound
* initial rate at which to start decoding
* bits-per-original-bit
* const float* pLaplacian
* Laplacian parameter set [[ NUM_COEFFS ]]
* const char* pLadderFile
* name of ladder file
* const short* pOracleShiftsX
* const short* pOracleShiftsY
* blockwise oracle motion field
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD ]]
* used only for motion oracle mode
*
* Outputs:
* short* pDecodedImg
* decoded image, same dimensions as side information image
* float* pRate
* final rate required for successful decoding
* bits-per-original-bit
* short* pDecodedShiftsX
* short* pDecodedShiftsY
* decoded blockwise motion field
* [[ 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_decodeImageQuad(const CodingOption* pOption, const short* pImgY, const uchar* pAccumSyndrome, const short* pScaledQArray, const float fLowerRateBound, const float* pLaplacian, const char* pLadderFile, const short* pOracleShiftsX, const short* pOracleShiftsY, short* pDecodedImg, float* pRate, short* pDecodedShiftsX, short* pDecodedShiftsY, float* pDecodedShiftsProb);
/* -----------------------------------------------------------------------------
* pixelQuads_pixelDecoderQuad
* -----------------------------------------------------------------------------
* Uses values of side information to influence beliefs in bit nodes.
*
* Inputs:
* const int nCodeLength
* length of LDPC code
* 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 double* pMotionBlock
* blockwise motion probabilities
* [[ BLOCK_ROWS_QUAD x BLOCK_COLS_QUAD x NUM_SHIFTS_2D ]]
* const short* pQuantRange
* dynamic ranges of DCT subbands [[ NUM_COEFFS ]]
* const double* pLLROutput
* log-likelihood ratio for decoded bits
*
* Outputs:
* double* pLLRSideInfo
* log-likelihood ratio for side information [[ BITS_QUAD ]]
* double* pProbArray
* quantized transform coefficiet probabilities [[ LEVELS ]]
* -----------------------------------------------------------------------------
*/
int pixelQuads_pixelDecoderQuad(const int nCodeLength, const short* pSideInfo, const double* pChannel, const double* pMotionBlock, const short* pQuantizedCoeffRange, const double* pLLROutput, double* pLLRSideInfo, double* pProbArray);
/* -----------------------------------------------------------------------------
* pixelQuads_ldpcDecoderQuad
* -----------------------------------------------------------------------------
* Exchanges info between bit nodes linked by edges in LDPC graph.
*
* Inputs:
* const int* pIR
* sparse matrix index storage buffer
* const int* pJC
* sparse matrix index storage buffer
* const int nSubcodeLength
* length of subsegment of LDPC code
* const int nCodeLength
* length of LDPC code
* const int nCodeEdges
* number of edges in decoding graph
* const double* pSyndrome
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -