本文的前面參考的基礎是http://blog.csdn.net/hevc_cjl/article/details/8183144,博主將光柵掃描轉爲Z掃描的技術原理講的很清楚,看到有人問博主怎麼將這些信息打印出來的,在此我稍微講述一下:
本人是在TComRom.cpp里加了幾行代碼,具體代碼爲:
在Void initRasterToZscan ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth )函數改爲:
Void initRasterToZscan ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth )
{
UInt uiMinCUWidth = uiMaxCUWidth >> ( uiMaxDepth - 1 );
UInt uiMinCUHeight = uiMaxCUHeight >> ( uiMaxDepth - 1 );
UInt uiNumPartInWidth = (UInt)uiMaxCUWidth / uiMinCUWidth;
UInt uiNumPartInHeight = (UInt)uiMaxCUHeight / uiMinCUHeight;
for ( UInt i = 0; i < uiNumPartInWidth*uiNumPartInHeight; i++ )
{
g_auiRasterToZscan[ g_auiZscanToRaster[i] ] = i;
num++;
if(num==16)
{
cout<<g_auiZscanToRaster[i]<<endl;
num=0;
}
else
cout<<g_auiZscanToRaster[i]<<" ";
}
}
num爲自己定義的全局變量,編譯運行程序即可。
注意要把解碼器設爲啓動項目,且裏面的調試參數要改。
結果如下: