標籤:hevc 變換 殘差係數 hm 代碼詳解
上一篇中主要介紹了編碼中的原理,這裡主要是結合HM中的代碼介紹讀殘差係數的方法
HM變換係數熵解碼簡介:
初始一個TU對象
成員變數介紹:
public:
typedef enum TU_SPLIT_MODE { DONT_SPLIT=0, VERTICAL_SPLIT=1, QUAD_SPLIT=2, NUMBER_OF_SPLIT_MODES=3 } SPLIT_MODE; //<TU在遞迴過程中的三種劈分方式
static const UInt NUMBER_OF_SECTIONS[NUMBER_OF_SPLIT_MODES];
protected:
ChromaFormat mChromaFormat;
Bool mbProcessLastOfLevel; // if true, then if size n/2 x n/2 is invalid, the nxn block for a channel is processed only for the last block, not the first.
UInt mCuDepth; //<CU是TU的根節點,記錄CU深度
UInt mTrDepthRelCU[MAX_NUM_COMPONENT]; //<記錄TU相對於CU的深度
UInt mSection;//<如果進行劈分,那麼劈分後處理SubCU的index
TU_SPLIT_MODE mSplitMode;//< the split mode
TComRectangle mRect[MAX_NUM_COMPONENT]; //<當前TU的位置資訊 Bool mCodeAll[MAX_NUM_COMPONENT];
UInt mOrigWidth[MAX_NUM_COMPONENT];
UInt mOffsets[MAX_NUM_COMPONENT];//<cur TU 與 CU左上方的位移量,比如TU 為8*8,那麼處理第二個TU則位移64個bit
UInt mAbsPartIdxCU;//<the abs index of CU in LCU
UInt mAbsPartIdxTURelCU;//<the abs index of TU in cur CU
UInt mAbsPartIdxStep;//<if split, the added index
TComDataCU *mpcCU;
UInt mLog2TrLumaSize;//< relative to the size of Cur TU
TComTU *mpParent; //<如果劈分進行遞迴,對應父節點
下面是解碼的這個外圍的流程圖
其中涉及到兩個比較重要得函數:
pareseCBF 和 parseCoeffNxN,前一個函數比較簡單,後面將重點分析一下第二個函數
因為涉及好多的表格,這裡不好編輯,我就直接把放上來
文檔下載連結
http://download.csdn.net/detail/xietingcandice/8329321
HEVC殘差係數解碼代碼詳解