VVC/JEM代码学习11:xDecodeCU

Void TDecCu::xDecodeCU( TComDataCU*const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, const UInt uiWidth, const UInt uiHeight, Bool &isLastCtuOfSliceSegment, UInt uiSplitConstrain)
#else
Void TDecCu::xDecodeCU( TComDataCU*const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment)
#endif
{
  TComPic* pcPic        = pcCU->getPic();
  const TComSPS &sps    = pcPic->getPicSym()->getSPS();
  const TComPPS &pps    = pcPic->getPicSym()->getPPS();
#if !JVET_C0024_QTBT
  const UInt maxCuWidth = sps.getMaxCUWidth();
  const UInt maxCuHeight= sps.getMaxCUHeight();
#endif
  UInt uiCurNumParts    = pcPic->getNumPartitionsInCtu() >> (uiDepth<<1);
  UInt uiQNumParts      = uiCurNumParts>>2;

  Bool bBoundary = false;
  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
#if JVET_C0024_QTBT
  UInt uiRPelX   = uiLPelX + uiWidth  - 1;
#else
  UInt uiRPelX   = uiLPelX + (maxCuWidth>>uiDepth)  - 1;
#endif
  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
#if JVET_C0024_QTBT
  UInt uiBPelY   = uiTPelY + uiHeight - 1;
#else
  UInt uiBPelY   = uiTPelY + (maxCuHeight>>uiDepth) - 1;
#endif

#if JVET_C0024_BT_RMV_REDUNDANT
  pcCU->setSplitConstrain( uiSplitConstrain );
  Bool bQTreeValid = false;
#endif

#if JVET_C0024_QTBT
  Bool bForceQT = uiWidth > MAX_TU_SIZE;
  if( bForceQT )
  {
    assert(uiWidth == uiHeight);
  }
  UInt uiCTUSize = pcCU->getSlice()->getSPS()->getCTUSize();
#if JVET_C0024_DELTA_QP_FIX
  UInt uiQTWidth = uiCTUSize>>uiDepth;
  UInt uiQTHeight = uiCTUSize>>uiDepth;
  const UInt uiQTBTDepth = (uiDepth << 1) + (g_aucConvertToBit[uiQTWidth]-g_aucConvertToBit[uiWidth] + g_aucConvertToBit[uiQTHeight]-g_aucConvertToBit[uiHeight]);
  const UInt uiMaxDQPDepthQTBT = pps.getMaxCuDQPDepth() << 1;
#endif
  if (uiCTUSize>>uiDepth == uiWidth && uiWidth==uiHeight)
  {
#endif
  if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
  {
#if JVET_C0024_QTBT
    if( bForceQT )
    {
      pcCU->setDepthSubParts( uiDepth + 1, uiAbsPartIdx );
    }
    else
#endif//pcCU储存了CU的所有相关信息;
    m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );//解码出来的分割信息也存储在pcCU里,但是没有直接的四叉树分割标记;
  }
  else
  {
    bBoundary = true;
  }

#if JVET_C0024_BT_RMV_REDUNDANT
  bQTreeValid = true;

  UInt uiMinQTSize = sps.getMinQTSize(pcCU->getSlice()->getSliceType(), pcCU->getTextType());//8;

  if ((uiCTUSize>>uiDepth) <= uiMinQTSize ) //如果当前CU的大小小于最小四叉树大小,则不允许进行四叉树划分; 
  {
    bQTreeValid = false;
  }
#endif

#if JVET_C0024_QTBT
  if( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) || bBoundary ) //如果还没达到最大深度或者遇到边缘,则进行四叉树划分;
#else
  if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
#endif
  {
    UInt uiIdx = uiAbsPartIdx;
#if JVET_C0024_DELTA_QP_FIX
    if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
#else
    if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
#endif
    {
      setdQPFlag(true);
#if JVET_C0024_DELTA_QP_FIX
      pcCU->setQuPartIdx( uiAbsPartIdx );
      pcCU->setQuLastCodedQP( pcCU->getCodedQP() );
#endif
#if JVET_C0024_DELTA_QP_FIX
      pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
#else
      pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
#endif
    }

    if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
    {
      setIsChromaQpAdjCoded(true);
    }

    for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )//四叉树划分递归调用四次xDecodeCU;
    {
      uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ];//要得到某个CU的绝对地址,先将Z扫描地址先映射为光栅扫描,再由光栅扫描映射为普通的X,Y坐标;
      uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ];

      if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
      {
#if JVET_C0024_QTBT
        xDecodeCU( pcCU, uiIdx, uiDepth+1, uiWidth>>1, uiHeight>>1, isLastCtuOfSliceSegment );
#else
        xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment );
#endif
      }
      else
      {
        pcCU->setOutsideCUPart( uiIdx, uiDepth+1 );
#if JVET_C0024_QTBT
        pcCU->getPic()->addCodedAreaInCTU(uiWidth*uiHeight>>2);
#endif
      }

      uiIdx += uiQNumParts;
    }
#if JVET_C0024_DELTA_QP_FIX
    if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
#else
    if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
#endif
    {
      if ( getdQPFlag() )
      {
        UInt uiQPSrcPartIdx = uiAbsPartIdx;
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
#else
        pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP
#endif
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setCodedQP( pcCU->getQP(uiQPSrcPartIdx) );
#endif
      }
    }
    return;
  }
#if JVET_C0024_QTBT
  }
#if JVET_C0024_BT_RMV_REDUNDANT  
  Bool bBTHorRmvEnable = false;//是否可以移除水平二叉树划分的标记;
  Bool bBTVerRmvEnable = false;//是否可以移除垂直二叉树划分的标记;
  if (pcCU->getSlice()->getSliceType() != I_SLICE)//如果是B帧或者是P帧;
  {
    bBTHorRmvEnable = true;//则允许移除水平二叉树划分;
    bBTVerRmvEnable = bQTreeValid;//如果可以进行四叉树划分,则允许移除垂直二叉树划分;
  }
#endif

#if JVET_C0024_SPS_MAX_BT_DEPTH
  UInt uiMaxBTD = pcCU->getSlice()->isIntra() ? (isLuma(pcCU->getTextType())?sps.getMaxBTDepthISliceL():sps.getMaxBTDepthISliceC()): sps.getMaxBTDepth();
#else
  UInt uiMaxBTD = pcCU->getSlice()->isIntra() ? (isLuma(pcCU->getTextType())?MAX_BT_DEPTH:MAX_BT_DEPTH_C): MAX_BT_DEPTH_INTER;
#endif
#if JVET_C0024_SPS_MAX_BT_SIZE
  UInt uiMaxBTSize = pcCU->getSlice()->isIntra() ? (isLuma(pcCU->getTextType())?sps.getMaxBTSizeISliceL():sps.getMaxBTSizeISliceC()): sps.getMaxBTSize();
#else
  UInt uiMaxBTSize = isLuma(pcCU->getTextType()) ? pcCU->getSlice()->getMaxBTSize(): MAX_BT_SIZE_C;
#endif
  UInt uiMinBTSize = pcCU->getSlice()->isIntra() ? (isLuma(pcCU->getTextType())?MIN_BT_SIZE:MIN_BT_SIZE_C): MIN_BT_SIZE_INTER;
  UInt uiBTDepth = pcCU->getBTDepth(uiAbsPartIdx, uiWidth, uiHeight);

  if ( (uiHeight>uiMinBTSize || uiWidth>uiMinBTSize) 
    && uiWidth<=uiMaxBTSize && uiHeight<=uiMaxBTSize && uiBTDepth<uiMaxBTD) //如果当前的宽,高和深度满足二叉树划分的条件;
  {
    UInt uiIdxBT = uiAbsPartIdx;
    m_pcEntropyDecoder->decodeBTSplitMode(pcCU, uiAbsPartIdx, uiWidth, uiHeight);//解码出来的二叉树分割标记存储在pcCU里;
#if JVET_C0024_BT_RMV_REDUNDANT
    uiSplitConstrain = 0;
#endif
	if (pcCU->getBTSplitModeForBTDepth(uiAbsPartIdx, uiBTDepth) == 1)//通过pcCU里的信息就可以知道是进行了水平还是垂直划分;
    {
#if JVET_C0024_DELTA_QP_FIX
      if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
      {
        setdQPFlag(true);
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setQuPartIdx( uiAbsPartIdx );
        pcCU->setQuLastCodedQP( pcCU->getCodedQP() );
#endif
        pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
      }
#endif
      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 2; uiPartUnitIdx++ )//水平划分递归调用两次xDecodeCU;
      {
        if (uiPartUnitIdx==1)
        {
          uiIdxBT = g_auiRasterToZscan[g_auiZscanToRaster[uiIdxBT] 
          + (uiHeight>>1)/pcCU->getPic()->getMinCUHeight()*pcCU->getPic()->getNumPartInCtuWidth()];
        }
#if JVET_C0024_BT_RMV_REDUNDANT
        xDecodeCU( pcCU, uiIdxBT, uiDepth, uiWidth, uiHeight>>1, isLastCtuOfSliceSegment, uiSplitConstrain );
        if (pcCU->getBTSplitModeForBTDepth(uiIdxBT, uiBTDepth+1) == 2 && bBTHorRmvEnable && uiPartUnitIdx==0)
        {
          uiSplitConstrain = 2;//限制二叉树水平划分;
        }
#else
        xDecodeCU( pcCU, uiIdxBT, uiDepth, uiWidth, uiHeight>>1, isLastCtuOfSliceSegment );
#endif
      }
#if JVET_C0024_DELTA_QP_FIX
      if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
      {
        if ( getdQPFlag() )
        {
          UInt uiQPSrcPartIdx = uiAbsPartIdx;
          pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
#if JVET_C0024_DELTA_QP_FIX
          pcCU->setCodedQP( pcCU->getQP(uiQPSrcPartIdx) );
#endif
        }
      }
#endif
      return;
    }
    else if (pcCU->getBTSplitModeForBTDepth(uiAbsPartIdx, uiBTDepth)==2)
    {
#if JVET_C0024_DELTA_QP_FIX
      if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
      {
        setdQPFlag(true);
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setQuPartIdx( uiAbsPartIdx );
        pcCU->setQuLastCodedQP( pcCU->getCodedQP() );
#endif
        pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
      }
#endif
      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 2; uiPartUnitIdx++ )//垂直划分递归调用两次xDecodeCU;
      {
        if (uiPartUnitIdx==1)
        {
          uiIdxBT = g_auiRasterToZscan[g_auiZscanToRaster[uiIdxBT] 
          + (uiWidth>>1)/pcCU->getPic()->getMinCUWidth()];
        }
#if JVET_C0024_BT_RMV_REDUNDANT
        xDecodeCU( pcCU, uiIdxBT, uiDepth, uiWidth>>1, uiHeight, isLastCtuOfSliceSegment, uiSplitConstrain );
        if (pcCU->getBTSplitModeForBTDepth(uiIdxBT, uiBTDepth+1) == 1 && bBTVerRmvEnable && uiPartUnitIdx==0)
        {
          uiSplitConstrain = 1;//限制二叉树垂直划分;
        }
#else
        xDecodeCU( pcCU, uiIdxBT, uiDepth, uiWidth>>1, uiHeight, isLastCtuOfSliceSegment );
#endif
      }
#if JVET_C0024_DELTA_QP_FIX
      if( uiQTBTDepth == uiMaxDQPDepthQTBT && pps.getUseDQP())
      {
        if ( getdQPFlag() )
        {
          UInt uiQPSrcPartIdx = uiAbsPartIdx;
          pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
#if JVET_C0024_DELTA_QP_FIX
          pcCU->setCodedQP( pcCU->getQP(uiQPSrcPartIdx) );
#endif
        }
      }
#endif
      return;
    }  
  }

  pcCU->setSizeSubParts( uiWidth, uiHeight, uiAbsPartIdx, uiDepth );
  UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ] >> MIN_CU_LOG2;
  UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ] >> MIN_CU_LOG2;
  pcCU->getPic()->setCodedBlkInCTU(true, uiBlkX, uiBlkY, uiWidth>> MIN_CU_LOG2, uiHeight>> MIN_CU_LOG2);

  pcCU->getPic()->addCodedAreaInCTU(uiWidth*uiHeight);

  UInt uiWidthIdx = g_aucConvertToBit[uiWidth];
  UInt uiHeightIdx = g_aucConvertToBit[uiHeight];
  assert(g_aucConvertToBit[uiWidth]>=0 && g_aucConvertToBit[uiHeight]>=0);
#endif

#if JVET_C0024_DELTA_QP_FIX
  if( uiQTBTDepth <= uiMaxDQPDepthQTBT && pps.getUseDQP())
#else
  if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP())
#endif
  {
    setdQPFlag(true);
#if JVET_C0024_DELTA_QP_FIX
    pcCU->setQuPartIdx( uiAbsPartIdx );
    pcCU->setQuLastCodedQP( pcCU->getCodedQP() );
#endif
#if JVET_C0024_DELTA_QP_FIX
    pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiWidth, uiHeight ); // set QP to default QP
#else
    pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
#endif
  }

  if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
  {
    setIsChromaQpAdjCoded(true);
  }
  //解码这些标记的顺序与编码一样;
  if (pps.getTransquantBypassEnableFlag())
  {
    m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth );
  }

  // decode CU mode and the partition size,解码CU模式和划分大小;
  if( !pcCU->getSlice()->isIntra())//skip是属于帧间的;
  {
    m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
  }
#if COM16_C806_OBMC
  pcCU->setOBMCFlagSubParts( true, uiAbsPartIdx, uiDepth );
#endif

  if( pcCU->isSkipped(uiAbsPartIdx) )
  {
#if JVET_C0024_QTBT
    m_pppcCU[uiWidthIdx][uiHeightIdx]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    m_pppcCU[uiWidthIdx][uiHeightIdx]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
#else
    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
#endif
#if VCEG_AZ07_FRUC_MERGE
    m_pcEntropyDecoder->decodeFRUCMgrMode( pcCU , uiAbsPartIdx , uiDepth , 0 );//解码FRUC merge模式;
    if( !pcCU->getFRUCMgrMode( uiAbsPartIdx ) )//如果不是FRUC merge模式;
    {
#endif

#if COM16_C1016_AFFINE
    if ( pcCU->isAffineMrgFlagCoded(uiAbsPartIdx, 0) )//则解码Affine merge 标记;
    {
      m_pcEntropyDecoder->decodeAffineFlag( pcCU, uiAbsPartIdx, uiDepth, 0 );
    }

    if ( !pcCU->isAffine(uiAbsPartIdx) )//如果不是Affine模式,则解码merge索引;
    {
      m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
    }
#else
    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );

#endif

#if VCEG_AZ07_FRUC_MERGE

    }

#if VCEG_AZ06_IC
    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );//解码局部亮度光照补偿的标记;
#endif
#endif
#if JVET_C0024_QTBT
    if(  pcCU->getSlice()->getPPS()->getUseDQP())
    {
#if JVET_C0024_DELTA_QP_FIX
      pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiWidth, uiHeight ); // set QP
#else
      pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP
#endif
#if JVET_C0024_DELTA_QP_FIX
      pcCU->setCodedQP( pcCU->getQP(uiAbsPartIdx) );
#endif
    }

    if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded())
    {
      pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP
    }
#else
    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
#endif
    return;
  }

  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );//解码预测模式(帧内帧间);
#if JVET_C0024_QTBT
  if (isLuma(pcCU->getTextType()))
  {
#endif
#if VCEG_AZ05_INTRA_MPI
  m_pcEntropyDecoder->decodeMPIIdx(pcCU, uiAbsPartIdx, uiDepth);
#endif
#if COM16_C1046_PDPC_INTRA && !JVET_G0104_PLANAR_PDPC
  m_pcEntropyDecoder->decodePDPCIdx(pcCU, uiAbsPartIdx, uiDepth);
#endif
#if JVET_C0024_QTBT
  }
#else
  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
#endif

#if JVET_C0024_QTBT
  if (pcCU->isIntra( uiAbsPartIdx ) )//如果是帧内预测;
#else
  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
#endif
  {
    m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );//解码PCM的信息;

    if(pcCU->getIPCMFlag(uiAbsPartIdx))
    {
#if JVET_C0024_QTBT
      if(  pcCU->getSlice()->getPPS()->getUseDQP())
      {
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiWidth, uiHeight ); // set QP
#else
        pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP
#endif
#if JVET_C0024_DELTA_QP_FIX
        pcCU->setCodedQP( pcCU->getQP(uiAbsPartIdx) );
#endif
      }
      if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded())
      {
        pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP
      }
#else
      xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
#endif
      return;
    }
  }

  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
#if JVET_C0024_QTBT
  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_pppcCU[uiWidthIdx][uiHeightIdx]);//解码预测信息;
#else
  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
#endif
#if COM16_C806_OBMC
  m_pcEntropyDecoder->decodeOBMCFlag( pcCU, uiAbsPartIdx, uiDepth );//解码重叠块运动补偿标记;
#endif
#if VCEG_AZ06_IC
  m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );//解码局部光照补偿;
#endif
  // Coefficient decoding
  Bool bCodeDQP = getdQPFlag();
  Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded();
  m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded );//解码残差系数;
  setIsChromaQpAdjCoded( isChromaQpAdjCoded );
  setdQPFlag( bCodeDQP );

#if JVET_C0024_QTBT
  if(  pcCU->getSlice()->getPPS()->getUseDQP())
  {
#if JVET_C0024_DELTA_QP_FIX
    pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiWidth, uiHeight ); // set QP
#else
    pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP
#endif
#if JVET_C0024_DELTA_QP_FIX
    pcCU->setCodedQP( pcCU->getQP(uiAbsPartIdx) );
#endif
  }

  if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded())
  {
    pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP
  }
#else
  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
#endif
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值