Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp


Ignore:
Timestamp:
26 May 2013, 15:41:34 (11 years ago)
Author:
tech
Message:
  • Reintegrated branch 6.2-dev0 rev. 442.
  • Changed version number.
  • Added coding results.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r332 r443  
    206206 
    207207#if H3D_IVMP
     208#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     209  const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     210#else
    208211  const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + 1;
     212#endif
    209213  for( Int iNum = 0; iNum < iNumAMVPCands+1; iNum++)
    210214    for( Int iIdx = 0; iIdx < iNumAMVPCands; iIdx++)
     
    908912      if( uiAbsPartIdx == 0 )
    909913      {
    910         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
     914        m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0
     915#if PKU_QC_DEPTH_INTRA_UNI_D0195
     916         ,true
     917#endif
     918          );
    911919      }
    912920    }
     
    17011709      UChar ucSegment = pMask?(UChar)pMask[uiX]:0;
    17021710      assert( ucSegment < uiNumSegments );
     1711#if MTK_SAMPLE_BASED_SDC_D0110     
     1712      Pel pResiDC = apDCResiValues[ucSegment];
    17031713     
     1714      pReco    [ uiX ] = Clip( pPred[ uiX ] + pResiDC );
     1715#else
    17041716      Pel pPredVal= apDCPredValues[ucSegment];
    17051717      Pel pResiDC = apDCResiValues[ucSegment];
    17061718     
    17071719      pReco    [ uiX ] = Clip( pPredVal + pResiDC );
     1720#endif
    17081721      pRecIPred[ uiX ] = pReco[ uiX ];
    17091722    }
     
    17351748  if ( m_pcRdCost->getUseVSO() )
    17361749  {
     1750#if FIX_SDC_ENC_RD_WVSO_D0163 && LGE_WVSO_A0119
     1751    if ( m_pcRdCost->getUseWVSO() )
     1752    {   
     1753      Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     1754      Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     1755      Dist iD = (Dist) m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     1756      Dist iVSO = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
     1757      ruiDist += (iDWeight * iD + iVSOWeight * iVSO) / ( iDWeight + iVSOWeight);
     1758    }
     1759    else
     1760#endif
    17371761    ruiDist = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    17381762  }
     
    17511775 
    17521776  // encode pred direction + residual data
    1753   m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
    1754  
     1777  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true
     1778#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1779    ,true
     1780#endif
     1781    );
    17551782  UInt   uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    17561783 
     
    29212948                                 , Int* iVSPIndexTrue
    29222949#endif
     2950#if MERL_VSP_NBDV_RefVId_Fix_D0166
     2951                                 , Int* iVSPDirTrue
     2952#endif
    29232953                                 )
    29242954{
     
    29622992  }
    29632993#else
     2994
    29642995#if MERL_VSP_C0152
    2965   pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue );
    2966 #else
    2967   pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    2968 #endif
    2969 #endif
    2970 
     2996  pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue
     2997#if MERL_VSP_NBDV_RefVId_Fix_D0166
     2998                               , iVSPDirTrue
     2999#endif
     3000  );
     3001
     3002#else
     3003  pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand
     3004#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3005                               , iVSPDirTrue
     3006#endif
     3007  );
     3008#endif
     3009
     3010#endif
    29713011
    29723012#if H3D_IVMP
     
    29853025      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    29863026#if MERL_VSP_C0152
     3027#if MTK_D0156
     3028      if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
     3029      {
     3030          pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3031      }
     3032      else
     3033#endif
    29873034      {
    29883035        Int iVSPIdx = 0;
     3036#if LGE_VSP_INHERIT_D0092
     3037        if (iVSPIndexTrue[uiMergeCand] == 1)
     3038        {
     3039            iVSPIdx = 1;
     3040        }
     3041#else
    29893042        Int numVSPIdx;
    29903043        numVSPIdx = 3;
     
    29973050            }
    29983051        }
     3052#endif
    29993053        pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3054#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3055        pcCU->setVSPDirSubParts(0, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3056#endif
     3057#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
     3058       if(iVSPIdx != 0)
     3059       {
     3060        Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
     3061        cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx);
     3062      }
     3063#endif
    30003064      }
    30013065#endif
     
    31093173
    31103174#if H3D_IVMP
     3175#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     3176  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     3177#else
    31113178  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     3179#endif
    31123180#endif
    31133181
     
    31383206    //reset the VSP flag to be 0
    31393207    pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
     3208#endif
     3209#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3210    pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
    31403211#endif
    31413212#if AMP_MRG
     
    33773448        iNumIter = 1;
    33783449      }
    3379      
     3450
    33803451      for ( Int iIter = 0; iIter < iNumIter; iIter++ )
    33813452      {
     
    36573728      UInt uiMRGIndex = 0;
    36583729#if MERL_VSP_C0152
     3730#if LGE_VSP_INHERIT_D0092
     3731      Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
     3732      for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
     3733      {
     3734          iVSPIndexTrue[i] = 0;
     3735      }
     3736#else
    36593737      Int iVSPIndexTrue[3] = {-1, -1, -1};
     3738#endif
     3739#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3740      Int iVSPDirTrue[3]   = {-1, -1, -1};
     3741#endif
    36603742#endif
    36613743      UInt uiMEInterDir = 0;
     
    36883770
    36893771
    3690 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost
     3772      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost
    36913773#if CU_BASED_MRG_CAND_LIST
    36923774                 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand,
     
    36943776#if MERL_VSP_C0152
    36953777                 , iVSPIndexTrue
     3778#endif
     3779#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3780                 , iVSPDirTrue
    36963781#endif
    36973782        );
     
    37033788        pcCU->setMergeIndexSubParts( uiMRGIndex,    uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    37043789#if MERL_VSP_C0152
     3790
     3791#if MTK_D0156
     3792        if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
     3793        {
     3794            pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3795        }
     3796        else
     3797#endif
    37053798        {
    37063799          Int iVSPIdx = 0;
     3800#if LGE_VSP_INHERIT_D0092
     3801          if (iVSPIndexTrue[uiMRGIndex] == 1)
     3802          {
     3803              iVSPIdx = 1;
     3804          }
     3805#else
    37073806          Int numVSPIdx;
    37083807          numVSPIdx = 3;
     
    37153814              }
    37163815          }
     3816#endif
    37173817          pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3818#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3819          pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3820#endif
     3821#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
     3822         if(iVSPIdx != 0)
     3823         {
     3824           Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
     3825           cMRGMvField[ 0].setRefIdx(iIVCIdx);
     3826         }
     3827#endif
    37183828        }
    37193829#endif
     
    37383848        pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    37393849#if MERL_VSP_C0152
    3740         pcCU->setVSPIndexSubParts ( 0 ,           uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3850        pcCU->setVSPIndexSubParts ( 0,            uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3851#endif
     3852#if MERL_VSP_NBDV_RefVId_Fix_D0166
     3853        pcCU->setVSPDirSubParts   ( 0,            uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    37413854#endif
    37423855        {
     
    37993912    {
    38003913#if H3D_IVMP
     3914#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     3915      Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     3916#else
    38013917      Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     3918#endif
    38023919#if ZERO_MVD_EST
    38033920      (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartIdx, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, iNumAMVPCands, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight, uiDist );
     
    38343951      UInt uiTmpCost;
    38353952#if H3D_IVMP
     3953#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     3954      Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     3955#else
    38363956      Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     3957#endif
    38373958#if ZERO_MVD_EST
    38383959      uiTmpCost = xGetTemplateCost( pcCU, uiPartIdx, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, pcAMVPInfo->m_acMvCand[i], i, iNumAMVPCands, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight, uiDist );
     
    39674088 
    39684089#if H3D_IVMP
     4090#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     4091  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
     4092#else
    39694093  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     4094#endif
    39704095#endif
    39714096 
     
    46744799#endif
    46754800      );
     4801#if QC_ARP_D0177
     4802    m_pcEntropyCoder->encodeARPW       ( pcCU , 0 , true );
     4803#endif
    46764804#endif
    46774805#if HHI_MPI
     
    58926020    // Reload only contexts required for coding intra mode information
    58936021    m_pcRDGoOnSbacCoder->loadIntraDirModeLuma( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     6022#if PKU_QC_DEPTH_INTRA_UNI_D0195
     6023    m_pcRDGoOnSbacCoder->loadDepthMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     6024#endif
    58946025  }
    58956026 
     
    58976028 
    58986029  m_pcEntropyCoder->resetBits();
    5899   m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset);
     6030  m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset
     6031#if PKU_QC_DEPTH_INTRA_UNI_D0195
     6032    ,true
     6033#endif
     6034    );
    59006035 
    59016036  return m_pcEntropyCoder->getNumberOfWrittenBits();
     
    59546089      );
    59556090#endif
     6091#if QC_ARP_D0177
     6092    m_pcEntropyCoder->encodeARPW( pcCU , 0 , true );
     6093#endif
    59566094    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    59576095  }
     
    59776115#endif
    59786116      );
     6117#if QC_ARP_D0177
     6118    m_pcEntropyCoder->encodeARPW( pcCU , 0 , true );
     6119#endif
    59796120#endif
    59806121#if HHI_MPI
     
    63016442  Int iMaskStride = ( uiWidth<<1 ) + 1;
    63026443  piMask += iMaskStride+1;
     6444#if QC_DC_PREDICTOR_D0183
     6445  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     6446#else
    63036447  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAboveAvail, bLeftAvail );
     6448#endif
    63046449
    63056450  riDeltaDC1 = iDC1 - iPredDC1;
     
    64786623#endif
    64796624
     6625#if HHI_DELTADC_DLT_D0035
     6626  riDeltaDC1 = (Int)GetDepthValue2Idx( Clip(iPredDC1 + riDeltaDC1) ) - (Int)GetDepthValue2Idx( iPredDC1 );
     6627  riDeltaDC2 = (Int)GetDepthValue2Idx( Clip(iPredDC2 + riDeltaDC2) ) - (Int)GetDepthValue2Idx( iPredDC2 );
     6628#endif
    64806629}
    64816630#endif
     
    78628011
    78638012  // PredDC Calculation
     8013#if QC_DC_PREDICTOR_D0183
     8014  getPredDCs( pbRegion, uiWidth, piMask+iMaskStride+1, iMaskStride, iPredDC0, iPredDC1 );
     8015#else
    78648016  {
    78658017    UInt uiSum0 = 0;
     
    79018053    iPredDC1 = uiSum1 / uiCount1;
    79028054  }
     8055#endif
    79038056
    79048057  iDeltaDC0 = iDC0 - iPredDC0;
Note: See TracChangeset for help on using the changeset viewer.