Changeset 1391 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 4 Aug 2015, 03:15:00 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1369 r1391 108 108 Int m_framesToBeEncoded; 109 109 Double m_adLambdaModifier[ MAX_TLAYER ]; 110 std::vector<Double> m_adIntraLambdaModifier; 111 Double m_dIntraQpFactor; ///< Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) )) 110 112 111 113 Bool m_printMSEBasedSequencePSNR; … … 597 599 Int getSourceHeight () { return m_iSourceHeight; } 598 600 Int getFramesToBeEncoded () { return m_framesToBeEncoded; } 599 Void setLambdaModifier ( UInt uiIndex, Double dValue ) { m_adLambdaModifier[ uiIndex ] = dValue; } 600 Double getLambdaModifier ( UInt uiIndex ) const { return m_adLambdaModifier[ uiIndex ]; } 601 602 //====== Lambda Modifiers ======== 603 Void setLambdaModifier ( UInt uiIndex, Double dValue ) { m_adLambdaModifier[ uiIndex ] = dValue; } 604 Double getLambdaModifier ( UInt uiIndex ) const { return m_adLambdaModifier[ uiIndex ]; } 605 Void setIntraLambdaModifier ( const std::vector<Double> &dValue ) { m_adIntraLambdaModifier = dValue; } 606 const std::vector<Double>& getIntraLambdaModifier() const { return m_adIntraLambdaModifier; } 607 Void setIntraQpFactor ( Double dValue ) { m_dIntraQpFactor = dValue; } 608 Double getIntraQpFactor () const { return m_dIntraQpFactor; } 601 609 602 610 //==== Coding Structure ======== -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1390 r1391 236 236 */ 237 237 238 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iGOPid, TComSlice*& rpcSlice,Bool isField )238 Void TEncSlice::initEncSlice( TComPic* pcPic, const Int pocLast, const Int pocCurr, const Int iGOPid, TComSlice*& rpcSlice, const Bool isField ) 239 239 { 240 240 Double dQP; … … 377 377 Int SHIFT_QP = 12; 378 378 379 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) );380 381 379 #if FULL_NBIT 382 380 #if SVC_EXTENSION … … 396 394 if ( eSliceType==I_SLICE ) 397 395 { 398 dQPFactor=0.57*dLambda_scale; 399 } 396 if (m_pcCfg->getIntraQpFactor()>=0.0 && m_pcCfg->getGOPEntry(iGOPid).m_sliceType != I_SLICE) 397 { 398 dQPFactor=m_pcCfg->getIntraQpFactor(); 399 } 400 else 401 { 402 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? NumberBFrames/2 : NumberBFrames) ); 403 404 dQPFactor=0.57*dLambda_scale; 405 } 406 } 407 400 408 dLambda = dQPFactor*pow( 2.0, qp_temp/3.0 ); 401 409 … … 431 439 iQP = m_piRdPicQp [0]; 432 440 433 if( rpcSlice->getSliceType( ) != I_SLICE ) 434 { 435 dLambda *= m_pcCfg->getLambdaModifier( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 436 } 441 const Int temporalId=m_pcCfg->getGOPEntry(iGOPid).m_temporalId; 442 const std::vector<Double> &intraLambdaModifiers=m_pcCfg->getIntraLambdaModifier(); 443 444 Double lambdaModifier; 445 if( rpcSlice->getSliceType( ) != I_SLICE || intraLambdaModifiers.empty()) 446 { 447 lambdaModifier = m_pcCfg->getLambdaModifier( temporalId ); 448 } 449 else 450 { 451 lambdaModifier = intraLambdaModifiers[ (temporalId < intraLambdaModifiers.size()) ? temporalId : (intraLambdaModifiers.size()-1) ]; 452 } 453 454 dLambda *= lambdaModifier; 437 455 438 456 #if JCTVC_M0259_LAMBDAREFINEMENT … … 524 542 rpcSlice->setDepth ( depth ); 525 543 526 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId );544 pcPic->setTLayer( temporalId ); 527 545 if(eSliceType==I_SLICE) 528 546 { -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.h
r1389 r1391 120 120 121 121 /// preparation of slice encoding (reference marking, QP and lambda) 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr,123 Int iGOPid, TComSlice*& rpcSlice,Bool isField );122 Void initEncSlice ( TComPic* pcPic, const Int pocLast, const Int pocCurr, 123 const Int iGOPid, TComSlice*& rpcSlice, const Bool isField ); 124 124 Void resetQP ( TComPic* pic, Int sliceQP, Double lambda ); 125 125 // compress and encode slice
Note: See TracChangeset for help on using the changeset viewer.