Ignore:
Timestamp:
14 Oct 2013, 20:13:58 (11 years ago)
Author:
kwu-htm
Message:

"JCT3V-E0227 : Inter-view MAD prediction for 3D multi-view video" is integrated by KWU. Configuration has changed by adding rate control for URQ and the integrated view-wise target bitrate allocation and inter-view MAD prediction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp

    r622 r635  
    103103 
    104104  m_bEncodeDQP = false;
    105 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
     105#if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227
    106106  m_LCUPredictionSAD = 0;
    107107  m_addSADDepth      = 0;
    108108  m_temporalSAD      = 0;
     109  m_spatialSAD       = 0;
    109110#endif
    110111
     
    241242 
    242243  m_bUseSBACRD        = pcEncTop->getUseSBACRD();
    243   m_pcRateCtrl        = pcEncTop->getRateCtrl();
     244  if(!pcEncTop->getIsDepth())
     245    m_pcRateCtrl        = pcEncTop->getRateCtrl();
     246  else
     247  {
     248    m_pcRateCtrl = NULL;
     249  }
    244250}
    245251
     
    256262  m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
    257263
    258 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
     264#if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227
    259265  m_addSADDepth      = 0;
    260266  m_LCUPredictionSAD = 0;
    261267  m_temporalSAD      = 0;
     268  m_spatialSAD       = 0;
    262269#endif
    263270
     
    464471
    465472#if RATE_CONTROL_LAMBDA_DOMAIN
    466   if ( m_pcEncCfg->getUseRateCtrl() )
     473  if ( m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth() )
    467474  {
    468475    iMinQP = m_pcRateCtrl->getRCQP();
     
    470477  }
    471478#else
    472   if(m_pcEncCfg->getUseRateCtrl())
     479  if(m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth())
    473480  {
    474481    Int qp = m_pcRateCtrl->getUnitQP();
     
    671678    }
    672679
    673 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
     680#if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227
    674681    if ( uiDepth <= m_addSADDepth )
    675682    {
    676683      m_LCUPredictionSAD += m_temporalSAD;
    677684      m_addSADDepth = uiDepth;
     685    }
     686#endif
     687#if !RATE_CONTROL_LAMBDA_DOMAIN
     688    if(m_pcEncCfg->getUseRateCtrl())
     689    {
     690      Int qp = m_pcRateCtrl->getUnitQP();
     691      iMinQP  = Clip3( MIN_QP, MAX_QP, qp);
     692      iMaxQP  = Clip3( MIN_QP, MAX_QP, qp);
    678693    }
    679694#endif
     
    10121027          {
    10131028            xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     1029#if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227
     1030            if ( uiDepth <= m_addSADDepth )
     1031            {
     1032              m_LCUPredictionSAD += m_spatialSAD;
     1033              m_addSADDepth = uiDepth;
     1034            }
     1035#endif
    10141036            rpcTempCU->initEstData( uiDepth, iQP );
    10151037            if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     
    11461168  }
    11471169#if RATE_CONTROL_LAMBDA_DOMAIN
    1148   if ( m_pcEncCfg->getUseRateCtrl() )
     1170  if ( m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth() )
    11491171  {
    11501172    iMinQP = m_pcRateCtrl->getRCQP();
     
    11521174  }
    11531175#else
    1154   if(m_pcEncCfg->getUseRateCtrl())
     1176  if(m_pcEncCfg->getUseRateCtrl() && !m_pcEncCfg->getIsDepth())
    11551177  {
    11561178    Int qp = m_pcRateCtrl->getUnitQP();
     
    21022124#endif
    21032125
    2104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
     2126#if RATE_CONTROL_LAMBDA_DOMAIN  && !M0036_RC_IMPROVEMENT
     2127#if KWU_RC_MADPRED_E0227
    21052128  if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
     2129  {
     2130    UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(),
     2131      m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(),
     2132      rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) );
     2133    m_temporalSAD = (Int)SAD;
     2134  }
     2135#endif
     2136#endif
     2137#if !RATE_CONTROL_LAMBDA_DOMAIN  && KWU_RC_MADPRED_E0227
     2138  if ( m_pcEncCfg->getUseRateCtrl() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
    21062139  {
    21072140    UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(),
     
    22352268  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    22362269 
     2270#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
     2271#if KWU_RC_MADPRED_E0227
     2272  UChar uhDepth = rpcTempCU->getDepth( 0 );
     2273  if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
     2274  {
     2275    UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(),
     2276      m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(),
     2277      rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) );
     2278    m_spatialSAD = (Int)SAD;
     2279  }
     2280#endif
     2281#endif
     2282#if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227
     2283  UChar uhDepth = rpcTempCU->getDepth( 0 );
     2284  if ( m_pcEncCfg->getUseRateCtrl() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
     2285  {
     2286    UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(),
     2287      m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(),
     2288      rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) );
     2289    m_spatialSAD = (Int)SAD;
     2290  }
     2291#endif
    22372292  xCheckDQP( rpcTempCU );
    22382293  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
Note: See TracChangeset for help on using the changeset viewer.