Ignore:
Timestamp:
20 Jul 2015, 14:13:33 (9 years ago)
Author:
tech
Message:

Upgrade to HM-16.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSearch.cpp

    r1283 r1287  
    116116
    117117TEncSearch::TEncSearch()
     118: m_puhQTTempTrIdx(NULL)
     119, m_pcQTTempTComYuv(NULL)
     120, m_pcEncCfg (NULL)
     121, m_pcTrQuant (NULL)
     122, m_pcRdCost (NULL)
     123, m_pcEntropyCoder (NULL)
     124, m_iSearchRange (0)
     125, m_bipredSearchRange (0)
     126, m_iFastSearch (0)
     127, m_pppcRDSbacCoder (NULL)
     128, m_pcRDGoOnSbacCoder (NULL)
     129, m_pTempPel (NULL)
     130, m_puiDFilter (NULL)
     131, m_isInitialized (false)
    118132{
    119133  for (UInt ch=0; ch<MAX_NUM_COMPONENT; ch++)
     
    134148    m_puhQTTempTransformSkipFlag[ch]               = NULL;
    135149  }
    136   m_puhQTTempTrIdx                                 = NULL;
    137   m_pcQTTempTComYuv                                = NULL;
    138   m_pcEncCfg                                       = NULL;
    139   m_pcEntropyCoder                                 = NULL;
    140   m_pTempPel                                       = NULL;
     150
     151  for (Int i=0; i<MAX_NUM_REF_LIST_ADAPT_SR; i++)
     152  {
     153    memset (m_aaiAdaptSR[i], 0, MAX_IDX_ADAPT_SR * sizeof (Int));
     154  }
     155  for (Int i=0; i<AMVP_MAX_NUM_CANDS+1; i++)
     156  {
     157    memset (m_auiMVPIdxCost[i], 0, (AMVP_MAX_NUM_CANDS+1) * sizeof (UInt) );
     158  }
     159
    141160  setWpScalingDistParam( NULL, -1, REF_PIC_LIST_X );
    142161}
    143162
    144163
    145 
    146 
    147 TEncSearch::~TEncSearch()
     164Void TEncSearch::destroy()
    148165{
     166  assert (m_isInitialized);
    149167  if ( m_pTempPel )
    150168  {
     
    197215
    198216  m_tmpYuvPred.destroy();
     217  m_isInitialized = false;
     218}
     219
     220TEncSearch::~TEncSearch()
     221{
     222  if (m_isInitialized)
     223  {
     224    destroy();
     225  }
    199226}
    200227
     
    216243                      )
    217244{
     245  assert (!m_isInitialized);
    218246  m_pcEncCfg             = pcEncCfg;
    219247  m_pcTrQuant            = pcTrQuant;
     
    296324  m_pcQTTempTransformSkipTComYuv.create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() );
    297325  m_tmpYuvPred.create(MAX_CU_SIZE, MAX_CU_SIZE, pcEncCfg->getChromaFormatIdc());
     326  m_isInitialized = true;
    298327}
    299328
     
    12241253
    12251254  //===== init availability pattern =====
    1226   Bool  bAboveAvail = false;
    1227   Bool  bLeftAvail  = false;
    1228 
    12291255  DEBUG_STRING_NEW(sTemp)
    12301256
     
    12351261    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    12361262
    1237     initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
     1263    initIntraPatternChType( rTu, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
    12381264
    12391265    //===== get prediction signal =====
     
    12461272    {
    12471273#endif
    1248     predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
     1274    predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions );
    12491275#if NH_3D_DMM
    12501276    }
     
    15751601  checkTransformSkip           &= (!pcCU->getCUTransquantBypass(0));
    15761602
     1603  assert (rTu.ProcessComponentSection(COMPONENT_Y));
     1604  const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
     1605
    15771606  if ( m_pcEncCfg->getUseTransformSkipFast() )
    15781607  {
     
    16091638        }
    16101639
    1611         if (rTu.ProcessComponentSection(COMPONENT_Y))
    1612         {
    1613           const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1614           pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1615 
    1616           xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 );
    1617         }
     1640
     1641        pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     1642        xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 );
     1643
    16181644        singleCbfTmpLuma = pcCU->getCbf( uiAbsPartIdx, COMPONENT_Y, uiTrDepth );
    16191645
     
    16691695      }
    16701696
    1671       if (rTu.ProcessComponentSection(COMPONENT_Y))
    1672       {
    1673         const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1674         pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1675       }
     1697      pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    16761698
    16771699      if(bestModeId[COMPONENT_Y] == firstCheckId)
    16781700      {
    16791701        xLoadIntraResultQT(COMPONENT_Y, rTu );
    1680         if (rTu.ProcessComponentSection(COMPONENT_Y))
    1681         {
    1682           pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) );
    1683         }
     1702        pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) );
    16841703
    16851704        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiFullDepth ][ CI_TEMP_BEST ] );
     
    16951714      //----- code luma/chroma block with given intra prediction mode and store Cbf-----
    16961715      dSingleCost   = 0.0;
    1697 
    1698       if (rTu.ProcessComponentSection(COMPONENT_Y))
    1699       {
    1700         const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1701         pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1702       }
    17031716#if NH_3D_ENC_DEPTH
    17041717      xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag );
    17051718#else
     1719      pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    17061720      xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug));
    17071721#endif
     
    18351849    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiFullDepth );
    18361850    const TComRectangle &tuRect=rTu.getRect(COMPONENT_Y);
    1837     const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    18381851    pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    18391852    pcCU ->setTransformSkipSubParts  ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     
    18891902  //===== reconstruction =====
    18901903
    1891   Bool bAboveAvail = false;
    1892   Bool bLeftAvail  = false;
    1893 
    18941904  TComTURecurse rTu(pcCU, 0);
    18951905  const ChromaFormat chFmt     = rTu.GetChromaFormat();
     
    18981908  {
    18991909    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, VER_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    1900     initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
    1901     predIntraAng( COMPONENT_Y, VER_IDX, 0, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
     1910    initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
     1911    predIntraAng( COMPONENT_Y, VER_IDX, 0, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions );
    19021912  }
    19031913  else if ( uiPredMode == 1 )
    19041914  {
    19051915    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, HOR_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    1906     initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
    1907     predIntraAng( COMPONENT_Y, HOR_IDX, 0, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
     1916    initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
     1917    predIntraAng( COMPONENT_Y, HOR_IDX, 0, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions );
    19081918  }
    19091919  else if ( uiPredMode == 2 )
     
    20192029    TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT);
    20202030
    2021     Bool bAboveAvail = false;
    2022     Bool bLeftAvail  = false;
    2023     initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) );
     2031    initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) );
    20242032
    20252033    // get partition
     
    20752083     
    20762084      //===== init pattern for luma prediction =====
    2077       Bool bAboveAvail = false;
    2078       Bool bLeftAvail  = false;
    20792085     
    2080       initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) );
     2086      initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) );
    20812087     
    2082       predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter );
     2088      predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bUseFilter );
    20832089     
    20842090      // copy for prediction of next part
     
    28582864  //{
    28592865    //===== init pattern for luma prediction =====
    2860     Bool bAboveAvail = false;
    2861     Bool bLeftAvail  = false;
    28622866    DEBUG_STRING_NEW(sTemp2)
    28632867
     
    28672871    Int numModesForFullRD = m_pcEncCfg->getFastUDIUseMPMEnabled()?g_aucIntraModeNumFast_UseMPM[ uiWidthBit ] : g_aucIntraModeNumFast_NotUseMPM[ uiWidthBit ];
    28682872
    2869     if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
    2870     {
    2871       initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
    2872     }
     2873    // this should always be true
     2874    assert (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y));
     2875    initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
    28732876#if NH_3D_ENC_DEPTH
    28742877    if( bOnlyIVP )
     
    29172920        const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    29182921
    2919         predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) );
     2922        predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) );
    29202923#if NH_3D_VSO // M34
    29212924        Dist uiSad;           
     
    63666369                  nonCoeffDist = m_pcRdCost->getDistPart( channelBitDepth, m_pcQTTempTComYuv[uiQTTempAccessLayer].getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ),
    63676370                                                          m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride( compID ), pcResi->getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ),
    6368                                                           pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual destortion
     6371                                                          pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual distortion
    63696372                }
    63706373                else
     
    63886391#endif
    63896392                    nonCoeffDist = m_pcRdCost->getDistPart( channelBitDepth, m_pTempPel, tuCompRect.width, pcResi->getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ),
    6390                                                           pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual destortion
     6393                                                          pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual distortion
    63916394                   
    63926395                }
     
    64126415              if((puiZeroDist != NULL) && isFirstMode)
    64136416              {
    6414                 *puiZeroDist += nonCoeffDist; // initialized with zero residual destortion
     6417                *puiZeroDist += nonCoeffDist; // initialized with zero residual distortion
    64156418              }
    64166419
Note: See TracChangeset for help on using the changeset viewer.