Changeset 635 in 3DVCSoftware for branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
- Timestamp:
- 14 Oct 2013, 20:13:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
r622 r635 157 157 m_pdRdPicQp = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 158 158 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; 160 163 } 161 164 … … 321 324 } 322 325 #if !RATE_CONTROL_LAMBDA_DOMAIN 323 if ( m_pcCfg->getUseRateCtrl() )326 if ( m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 324 327 { 325 328 dQP = m_pcRateCtrl->getFrameQP(rpcSlice->isReferenced(), rpcSlice->getPOC()); … … 1123 1126 #endif 1124 1127 #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 1127 1145 if(m_pcRateCtrl->calculateUnitQP()) 1128 1146 { … … 1223 1241 else 1224 1242 { 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 1225 1261 #if RATE_CONTROL_INTRA 1226 1262 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); … … 1239 1275 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1240 1276 #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 1242 1284 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1243 1285 … … 1341 1383 #if TICKET_1090_FIX 1342 1384 #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 1346 1388 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1347 1389 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); … … 1406 1448 m_uiPicDist += pcCU->getTotalDistortion(); 1407 1449 #if !RATE_CONTROL_LAMBDA_DOMAIN 1408 if(m_pcCfg->getUseRateCtrl() )1450 if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 1409 1451 { 1410 1452 m_pcRateCtrl->updateLCUData(pcCU, pcCU->getTotalBits(), pcCU->getQP(0)); … … 1427 1469 xRestoreWPparam( pcSlice ); 1428 1470 #if !RATE_CONTROL_LAMBDA_DOMAIN 1429 if(m_pcCfg->getUseRateCtrl() )1471 if(m_pcCfg->getUseRateCtrl() && !m_pcCfg->getIsDepth()) 1430 1472 { 1431 1473 m_pcRateCtrl->updateFrameData(m_uiPicTotalBits);
Note: See TracChangeset for help on using the changeset viewer.