Changeset 655 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSlice.cpp
- Timestamp:
- 23 Oct 2013, 23:01:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r622 r655 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 #if KWU_RC_MADPRED_E0227 160 if(m_pcCfg->getUseRateCtrl()) 161 { 162 m_pcRateCtrl = pcEncTop->getRateCtrl(); 163 } 164 else 165 { 166 m_pcRateCtrl = NULL; 167 } 168 #else 159 169 m_pcRateCtrl = pcEncTop->getRateCtrl(); 170 #endif 160 171 } 161 172 … … 176 187 \param pPPS PPS associated with the slice 177 188 */ 178 #if H_MV5179 189 #if H_MV 180 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ) 181 #else 182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 183 #endif 184 #else 185 #if H_3D 186 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId ) 187 #else 188 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 189 #endif 190 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId, bool isField ) 191 #else 192 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, bool isField ) 190 193 #endif 191 194 { … … 195 198 rpcSlice = pcPic->getSlice(0); 196 199 197 #if H_MV 5200 #if H_MV 198 201 rpcSlice->setVPS( pVPS ); 199 202 … … 203 206 #if H_3D 204 207 rpcSlice->setIsDepth ( pVPS->getDepthId ( layerId ) != 0 ); 205 #endif206 #else207 #if H_3D208 // GT: Should also be activated for MV-HEVC at some stage209 rpcSlice->setVPS( pVPS );210 Int vpsLayerId = pVPS->getLayerIdInNuh( layerId );211 212 rpcSlice->setLayerId ( layerId );213 rpcSlice->setViewId ( pVPS->getViewId ( vpsLayerId ) );214 rpcSlice->setViewIndex ( pVPS->getViewIndex ( vpsLayerId ) );215 rpcSlice->setIsDepth ( pVPS->getDepthId ( vpsLayerId ) != 0 );216 208 #endif 217 209 #endif … … 342 334 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); 343 335 Int SHIFT_QP = 12; 344 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double) NumberBFrames);336 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) ); 345 337 #if FULL_NBIT 346 338 Int bitdepth_luma_qp_scale = 6 * (g_bitDepth - 8); … … 1125 1117 if(m_pcCfg->getUseRateCtrl()) 1126 1118 { 1119 #if KWU_RC_MADPRED_E0227 1120 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1121 { 1122 Double zn, zf, focallength, position, camshift; 1123 Double basepos; 1124 Bool bInterpolated; 1125 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1126 1127 pcEncTop->getCamParam()->xGetZNearZFar(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), zn, zf); 1128 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[0], pcSlice->getPOC(), focallength, basepos, camshift, bInterpolated); 1129 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), focallength, position, camshift, bInterpolated); 1130 1131 m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), basepos, position, focallength, zn, zf, (direction > 0 ? 1 : -1)); 1132 } 1133 #endif 1127 1134 if(m_pcRateCtrl->calculateUnitQP()) 1128 1135 { … … 1223 1230 else 1224 1231 { 1232 #if KWU_RC_MADPRED_E0227 1233 if(pcSlice->getLayerId() != 0 && m_pcCfg->getUseDepthMADPred() && !pcSlice->getIsDepth()) 1234 { 1235 Double zn, zf, focallength, position, camShift; 1236 Double basePos; 1237 Bool bInterpolated; 1238 Int direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId(); 1239 Int disparity; 1240 1241 pcEncTop->getCamParam()->xGetZNearZFar(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), zn, zf); 1242 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[0], pcSlice->getPOC(), focallength, basePos, camShift, bInterpolated); 1243 pcEncTop->getCamParam()->xGetGeometryData(pcEncTop->getCamParam()->getBaseViewNumbers()[pcSlice->getViewIndex()], pcSlice->getPOC(), focallength, position, camShift, bInterpolated); 1244 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU, 1245 basePos, position, focallength, zn, zf, (direction > 0 ? 1 : -1), &disparity ); 1246 } 1247 else 1248 { 1249 #endif 1225 1250 #if RATE_CONTROL_INTRA 1226 1251 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); … … 1239 1264 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1240 1265 #endif 1241 1266 #if KWU_RC_MADPRED_E0227 1267 } 1268 #endif 1269 #if KWU_RC_MADPRED_E0227 1270 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp ); 1271 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1272 #endif 1242 1273 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1243 1274 … … 1343 1374 if ( m_pcCfg->getUseRateCtrl() ) 1344 1375 { 1345 #if !M0036_RC_IMPROVEMENT 1376 #if !M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227 1346 1377 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1347 1378 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );
Note: See TracChangeset for help on using the changeset viewer.