xReconIntraQT函数在解码端实现帧内预测模式cu的解析恢复。
根据解码得到的帧内亮度和色度的预测模式,得到预测像素pred,再由coeff经过反变换等操作得到残差像素resi,由pred和resi像素信息,就可以重建得到cu帧内模式重建像素reco。
相比VTM1,函数只多了LM模式预测的代码,其它的函数流程等都没有变化。
void DecCu::xReconIntraQT( CodingUnit &cu )
{
if( cu.ipcm )
{
xReconPCM( *cu.firstTU ); //pcm模式
return;
}
//4:0:0采样时只有Y通道,其它采样模式时有Y、Cb、Cr三通道
const uint32_t numChType = ::getNumberValidChannels( cu.chromaFormat );
for( uint32_t chType = CHANNEL_TYPE_LUMA; chType < numChType; chType++ )
{
if( cu.blocks[chType].valid() )
{
xIntraRecQT( cu, ChannelType( chType ) ); //cu分别对luma和chroma,实现帧内像素的重建
}
}
}
//luma和chroma的tu,都是调用xIntraRecBlk函数来进行tu像素的重建
void DecCu::xIntraRecQT(CodingUnit &cu, const ChannelType chType)
{
for( auto &currTU : CU::traverseTUs( cu ) ) //cu的每个tu,分别进行帧内像素重建
{
if