Changeset 442 in SHVCSoftware for trunk/source/Lib/TLibEncoder/TEncSlice.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev merged: 350-351,357-360 /branches/SHM-3.1-dev (added) merged: 354-356,361-403,405-441 /trunk merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source merged: 357-360 /branches/SHM-3.1-dev/source (added) merged: 355-356,361-364,366-403,405,407-441 /trunk/source merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r345 r442 180 180 #if SVC_EXTENSION 181 181 //\param vps VPS associated with the slice 182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps )183 #else 184 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )182 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ) 183 #else 184 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, Bool isField ) 185 185 #endif 186 186 { … … 260 260 if(eSliceType!=I_SLICE) 261 261 { 262 #if REPN_FORMAT_IN_VPS 263 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 264 #else 262 265 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 266 #endif 263 267 { 264 268 dQP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset; … … 294 298 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); 295 299 Int SHIFT_QP = 12; 296 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)NumberBFrames ); 300 301 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) ); 302 297 303 #if FULL_NBIT 298 304 Int bitdepth_luma_qp_scale = 6 * (g_bitDepth - 8); … … 327 333 } 328 334 335 #if REPN_FORMAT_IN_VPS 336 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 337 #else 329 338 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 339 #endif 330 340 331 341 m_pdRdPicLambda[iDQpIdx] = dLambda; … … 400 410 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 401 411 402 #if REF_IDX_FRAMEWORK412 #if SVC_EXTENSION 403 413 if(m_pcCfg->getLayerId() > 0) 404 414 { … … 412 422 { 413 423 dQP = xGetQPValueAccordingToLambda( dLambda ); 424 #if REPN_FORMAT_IN_VPS 425 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 426 #else 414 427 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 428 #endif 415 429 } 416 430 … … 467 481 468 482 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 483 #if TEMP_SCALABILITY_FIX 484 if((eSliceType==I_SLICE) || (rpcSlice->getPOC() == 0)) 485 #else 469 486 if(eSliceType==I_SLICE) 487 #endif 470 488 { 471 489 pcPic->setTLayer(0); … … 485 503 xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() ); 486 504 487 #if SVC_EXTENSION && REF_IDX_FRAMEWORK505 #if SVC_EXTENSION 488 506 if( layerId > 0 ) 489 507 { … … 606 624 } 607 625 626 #if REPN_FORMAT_IN_VPS 627 qp = max( -pcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( recalQP + 0.5 ) ) ); 628 #else 608 629 qp = max( -pcSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( recalQP + 0.5 ) ) ); 630 #endif 609 631 610 632 m_pdRdPicLambda[deltqQpIdx] = lambda; … … 849 871 pcCU->initCU( rpcPic, uiCUAddr ); 850 872 873 #if REPN_FORMAT_IN_VPS 874 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 875 Int width = min( pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 876 #else 851 877 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 852 878 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 879 #endif 853 880 854 881 iSumHad = m_pcCuEncoder->updateLCUDataISlice(pcCU, uiCUAddr, width, height); … … 1148 1175 #endif 1149 1176 1177 #if REPN_FORMAT_IN_VPS 1178 estQP = Clip3( -pcSlice->getQpBDOffsetY(), MAX_QP, estQP ); 1179 #else 1150 1180 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1181 #endif 1151 1182 1152 1183 m_pcRdCost->setLambda(estLambda); … … 1176 1207 #if !M0036_RC_IMPROVEMENT 1177 1208 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1209 #if REPN_FORMAT_IN_VPS 1210 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1211 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->>getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1212 #else 1178 1213 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1179 1214 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1215 #endif 1180 1216 Double MAD = (Double)SAD / (Double)(height * width); 1181 1217 MAD = MAD * MAD; … … 1253 1289 #if !M0036_RC_IMPROVEMENT 1254 1290 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1291 #if REPN_FORMAT_IN_VPS 1292 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1293 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1294 #else 1255 1295 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1256 1296 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1297 #endif 1257 1298 Double MAD = (Double)SAD / (Double)(height * width); 1258 1299 MAD = MAD * MAD; … … 1919 1960 UInt uiPosX = ( uiExternalAddress % rpcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1920 1961 UInt uiPosY = ( uiExternalAddress / rpcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1962 #if REPN_FORMAT_IN_VPS 1963 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 1964 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 1965 #else 1921 1966 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1922 1967 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1968 #endif 1923 1969 while((uiPosX>=uiWidth||uiPosY>=uiHeight)&&!(uiPosX>=uiWidth&&uiPosY>=uiHeight)) 1924 1970 { … … 1942 1988 uiPosX = ( uiExternalAddress % rpcPic->getFrameWidthInCU() ) * g_uiMaxCUWidth+ g_auiRasterToPelX[ g_auiZscanToRaster[uiInternalAddress] ]; 1943 1989 uiPosY = ( uiExternalAddress / rpcPic->getFrameWidthInCU() ) * g_uiMaxCUHeight+ g_auiRasterToPelY[ g_auiZscanToRaster[uiInternalAddress] ]; 1990 #if REPN_FORMAT_IN_VPS 1991 uiWidth = pcSlice->getPicWidthInLumaSamples(); 1992 uiHeight = pcSlice->getPicHeightInLumaSamples(); 1993 #else 1944 1994 uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 1945 1995 uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 1996 #endif 1946 1997 while((uiPosX>=uiWidth||uiPosY>=uiHeight)&&!(uiPosX>=uiWidth&&uiPosY>=uiHeight)) 1947 1998 {
Note: See TracChangeset for help on using the changeset viewer.