Ignore:
Timestamp:
24 Jan 2013, 19:24:16 (11 years ago)
Author:
tech
Message:

C0034: No quantization and fast encoder search for DMM delta DC values (HHI_DMM_DELTADC_Q1_C0034)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev1-HHI/source/Lib/TLibEncoder/TEncSearch.cpp

    r210 r226  
    65646564    Int iFullDeltaDC2 = riDeltaDC2;
    65656565
     6566#if HHI_DMM_DELTADC_Q1_C0034
     6567#else
    65666568    xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC1 );
    65676569    xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC2 );
     6570#endif
    65686571
    65696572    Dist uiBestDist     = RDO_DIST_MAX;
     
    65786581    uiDeltaDC2Max += (uiDeltaDC2Max>>1);
    65796582
     6583#if HHI_DMM_DELTADC_Q1_C0034
     6584    // limit search range to [0, IBDI_MAX]
     6585    if( iFullDeltaDC1 <  0 && uiDeltaDC1Max >                abs(iPredDC1) ) { uiDeltaDC1Max =                abs(iPredDC1); }
     6586    if( iFullDeltaDC1 >= 0 && uiDeltaDC1Max > g_uiIBDI_MAX - abs(iPredDC1) ) { uiDeltaDC1Max = g_uiIBDI_MAX - abs(iPredDC1); }
     6587
     6588    if( iFullDeltaDC2 <  0 && uiDeltaDC2Max >                abs(iPredDC2) ) { uiDeltaDC2Max =                abs(iPredDC2); }
     6589    if( iFullDeltaDC2 >= 0 && uiDeltaDC2Max > g_uiIBDI_MAX - abs(iPredDC2) ) { uiDeltaDC2Max = g_uiIBDI_MAX - abs(iPredDC2); }
     6590
     6591    // init dist with original DCs
     6592    assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iDC1, iDC2 );
     6593
     6594    Dist uiOrgDist = RDO_DIST_MAX;
     6595#if SAIT_VSO_EST_A0033
     6596    if ( m_pcRdCost->getUseEstimatedVSD() )
     6597    {         
     6598      TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
     6599      TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
     6600      uiOrgDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
     6601#if LGE_WVSO_A0119
     6602      if ( m_pcRdCost->getUseWVSO() )
     6603      {   
     6604        Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6605        Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
     6606        Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6607        uiOrgDist = (iDWeight * iD + iVSDWeight * (Dist) uiOrgDist) / ( iDWeight + iVSDWeight);
     6608      }
     6609#endif // LGE_WVSO_A0119
     6610    }
     6611    else       
     6612#endif // SAIT_VSO_EST_A0033
     6613    {       
     6614      uiOrgDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
     6615#if LGE_WVSO_A0119
     6616      if ( m_pcRdCost->getUseWVSO() )
     6617      {   
     6618        Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6619        Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     6620        Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6621        uiOrgDist = (iDWeight * iD + iVSOWeight * (Dist) uiOrgDist) / ( iDWeight + iVSOWeight);
     6622      }
     6623#endif // LGE_WVSO_A0119
     6624    }
     6625    uiBestDist     = uiOrgDist;
     6626    uiBestQStepDC1 = abs(iFullDeltaDC1);
     6627    uiBestQStepDC2 = abs(iFullDeltaDC2);
     6628
     6629    // coarse search with step size 4
     6630    for( UInt uiQStepDC1 = 0; uiQStepDC1 < uiDeltaDC1Max; uiQStepDC1 += 4 )
     6631    {
     6632      Int iTestDC1 = Clip( iPredDC1 + ((Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1)) );
     6633      for( UInt uiQStepDC2 = 0; uiQStepDC2 < uiDeltaDC2Max; uiQStepDC2 += 4 )
     6634      {
     6635        Int iTestDC2 = Clip( iPredDC2 + ((Int)(uiQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1)) );
     6636
     6637        assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 );
     6638
     6639        Dist uiAct4Dist = RDO_DIST_MAX;
     6640#if SAIT_VSO_EST_A0033
     6641        if ( m_pcRdCost->getUseEstimatedVSD() )
     6642        {         
     6643          TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
     6644          TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
     6645          uiAct4Dist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
     6646#if LGE_WVSO_A0119
     6647          if ( m_pcRdCost->getUseWVSO() )
     6648          {   
     6649            Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6650            Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
     6651            Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6652            uiAct4Dist = (iDWeight * iD + iVSDWeight * (Dist) uiAct4Dist) / ( iDWeight + iVSDWeight);
     6653          }
     6654#endif // LGE_WVSO_A0119
     6655        }
     6656        else       
     6657#endif // SAIT_VSO_EST_A0033
     6658        {       
     6659          uiAct4Dist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
     6660#if LGE_WVSO_A0119
     6661          if ( m_pcRdCost->getUseWVSO() )
     6662          {   
     6663            Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6664            Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     6665            Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6666            uiAct4Dist = (iDWeight * iD + iVSOWeight * (Dist) uiAct4Dist) / ( iDWeight + iVSOWeight);
     6667          }
     6668#endif // LGE_WVSO_A0119
     6669        }
     6670
     6671        if( uiAct4Dist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     6672        {
     6673          uiBestDist     = uiAct4Dist;
     6674          uiBestQStepDC1 = uiQStepDC1;
     6675          uiBestQStepDC2 = uiQStepDC2;
     6676        }
     6677      }
     6678    }
     6679
     6680    // refinement +-3
     6681    for( UInt uiQStepDC1 = (UInt)max(0, ((Int)uiBestQStepDC1-3)); uiQStepDC1 <= (uiBestQStepDC1+3); uiQStepDC1++ )
     6682    {
     6683      Int iTestDC1 = Clip( iPredDC1 + ((Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1)) );
     6684      for( UInt uiQStepDC2 = (UInt)max(0, ((Int)uiBestQStepDC2-3)); uiQStepDC2 <= (uiBestQStepDC2+3); uiQStepDC2++ )
     6685      {
     6686        Int iTestDC2 = Clip( iPredDC2 + ((Int)(uiQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1)) );
     6687
     6688        assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 );
     6689
     6690        Dist uiActDist = RDO_DIST_MAX;
     6691#if SAIT_VSO_EST_A0033
     6692        if ( m_pcRdCost->getUseEstimatedVSD() )
     6693        {         
     6694          TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
     6695          TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
     6696          uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
     6697#if LGE_WVSO_A0119
     6698          if ( m_pcRdCost->getUseWVSO() )
     6699          {   
     6700            Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6701            Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
     6702            Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6703            uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight);
     6704          }
     6705#endif // LGE_WVSO_A0119
     6706        }
     6707        else       
     6708#endif // SAIT_VSO_EST_A0033
     6709        {       
     6710          uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
     6711#if LGE_WVSO_A0119
     6712          if ( m_pcRdCost->getUseWVSO() )
     6713          {   
     6714            Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6715            Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     6716            Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
     6717            uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight);
     6718          }
     6719#endif // LGE_WVSO_A0119
     6720        }
     6721
     6722        if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     6723        {
     6724          uiBestDist     = uiActDist;
     6725          uiBestQStepDC1 = uiQStepDC1;
     6726          uiBestQStepDC2 = uiQStepDC2;
     6727        }
     6728      }
     6729    }
     6730#else
    65806731    for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
    65816732    {
     
    66336784      }
    66346785    }
    6635 
     6786#endif
    66366787    iFullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1);
    66376788    iFullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1);
     6789#if HHI_DMM_DELTADC_Q1_C0034
     6790#else
    66386791    xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC1 );
    66396792    xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC2 );
     6793#endif
    66406794    riDeltaDC1 = iFullDeltaDC1;
    66416795    riDeltaDC2 = iFullDeltaDC2;
     
    66436797#endif
    66446798
     6799#if HHI_DMM_DELTADC_Q1_C0034
     6800#else
    66456801  xDeltaDCQuantScaleDown( pcCU, riDeltaDC1 );
    66466802  xDeltaDCQuantScaleDown( pcCU, riDeltaDC2 );
     6803#endif
    66476804}
    66486805#endif
Note: See TracChangeset for help on using the changeset viewer.