Ignore:
Timestamp:
14 Oct 2013, 20:13:58 (12 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/TEncSlice.cpp

    r622 r635  
    157157  m_pdRdPicQp         = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 );
    158158  m_piRdPicQp         = (Int*   )xMalloc( Int,    m_pcCfg->getDeltaQpRD() * 2 + 1 );
    159   m_pcRateCtrl        = pcEncTop->getRateCtrl();
     159  if(m_pcCfg->getUseRateCtrl())
     160    m_pcRateCtrl        = pcEncTop->getRateCtrl();
     161  else
     162    m_pcRateCtrl        = NULL;
    160163}
    161164
     
    321324  }
    322325#if !RATE_CONTROL_LAMBDA_DOMAIN
    323   if ( m_pcCfg->getUseRateCtrl())
     326  if ( m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth())
    324327  {
    325328    dQP = m_pcRateCtrl->getFrameQP(rpcSlice->isReferenced(), rpcSlice->getPOC());
     
    11231126#endif
    11241127#if !RATE_CONTROL_LAMBDA_DOMAIN
    1125     if(m_pcCfg->getUseRateCtrl())
    1126     {
     1128    if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth())
     1129    {
     1130#if KWU_RC_MADPRED_E0227
     1131      if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth())
     1132      {
     1133        double Zn, Zf, FocalLength, Position, CamShift;
     1134        double BasePos;
     1135        bool bInterpolated;
     1136        Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId();
     1137
     1138        pcEncTop->getCamParam()->RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
     1139        pcEncTop->getCamParam()->RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
     1140        pcEncTop->getCamParam()->RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
     1141
     1142        m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1));
     1143      }
     1144#endif
    11271145      if(m_pcRateCtrl->calculateUnitQP())
    11281146      {
     
    12231241        else
    12241242        {
     1243#if KWU_RC_MADPRED_E0227
     1244          if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth())
     1245          {
     1246            double Zn, Zf, FocalLength, Position, CamShift;
     1247            double BasePos;
     1248            bool bInterpolated;
     1249            Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId();
     1250            Int iDisparity;
     1251
     1252            pcEncTop->getCamParam()->RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
     1253            pcEncTop->getCamParam()->RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
     1254            pcEncTop->getCamParam()->RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
     1255            bpp       = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU,
     1256                            BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1), &iDisparity );
     1257          }
     1258          else
     1259          {
     1260#endif
    12251261#if RATE_CONTROL_INTRA
    12261262          bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType());
     
    12391275          estQP     = m_pcRateCtrl->getRCPic()->getLCUEstQP    ( estLambda, pcSlice->getSliceQp() );
    12401276#endif
    1241 
     1277#if KWU_RC_MADPRED_E0227
     1278          }
     1279#endif
     1280#if KWU_RC_MADPRED_E0227
     1281          estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp );
     1282          estQP     = m_pcRateCtrl->getRCPic()->getLCUEstQP    ( estLambda, pcSlice->getSliceQp() );
     1283#endif
    12421284          estQP     = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP );
    12431285
     
    13411383#if TICKET_1090_FIX
    13421384#if RATE_CONTROL_LAMBDA_DOMAIN
    1343       if ( m_pcCfg->getUseRateCtrl() )
    1344       {
    1345 #if !M0036_RC_IMPROVEMENT
     1385      if ( m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth() )
     1386      {
     1387#if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227
    13461388        UInt SAD    = m_pcCuEncoder->getLCUPredictionSAD();
    13471389        Int height  = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );
     
    14061448    m_uiPicDist      += pcCU->getTotalDistortion();
    14071449#if !RATE_CONTROL_LAMBDA_DOMAIN
    1408     if(m_pcCfg->getUseRateCtrl())
     1450    if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth())
    14091451    {
    14101452      m_pcRateCtrl->updateLCUData(pcCU, pcCU->getTotalBits(), pcCU->getQP(0));
     
    14271469  xRestoreWPparam( pcSlice );
    14281470#if !RATE_CONTROL_LAMBDA_DOMAIN
    1429   if(m_pcCfg->getUseRateCtrl())
     1471  if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth())
    14301472  {
    14311473    m_pcRateCtrl->updateFrameData(m_uiPicTotalBits);
Note: See TracChangeset for help on using the changeset viewer.