Changeset 837 in 3DVCSoftware for branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncTop.cpp
- Timestamp:
- 8 Feb 2014, 00:23:11 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0rc1-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r773 r837 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2013, ITU/ISO/IEC6 * Copyright (c) 2010-2014, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 106 106 if (m_bUseSAO) 107 107 { 108 m_cEncSAO.setSaoLcuBoundary(getSaoLcuBoundary()); 109 m_cEncSAO.setSaoLcuBasedOptimization(getSaoLcuBasedOptimization()); 110 m_cEncSAO.setMaxNumOffsetsPerPic(getMaxNumOffsetsPerPic()); 111 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight ); 112 m_cEncSAO.createEncBuffer(); 108 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 109 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 110 m_cEncSAO.createEncData(getSaoLcuBoundary()); 111 #else 112 m_cEncSAO.createEncData(); 113 #endif 113 114 } 114 115 #if ADAPTIVE_QP_SELECTION … … 120 121 m_cLoopFilter. create( g_uiMaxCUDepth ); 121 122 122 #if RATE_CONTROL_LAMBDA_DOMAIN123 123 if ( m_RCEnableRateControl ) 124 124 { … … 131 131 #endif 132 132 } 133 #else134 #if KWU_FIX_URQ135 if(m_enableRateCtrl)136 #endif137 m_cRateCtrl.create(getIntraPeriod(), getGOPSize(), getFrameRate(), getTargetBitrate(), getQP(), getNumLCUInUnit(), getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight);138 #endif139 // if SBAC-based RD optimization is used140 if( m_bUseSBACRD )141 {142 133 m_pppcRDSbacCoder = new TEncSbac** [g_uiMaxCUDepth+1]; 143 134 #if FAST_BIT_EST … … 168 159 } 169 160 } 170 }171 161 172 162 /** … … 195 185 m_pcSbacCoders[ui].init( &m_pcBinCoderCABACs[ui] ); 196 186 } 197 if( m_bUseSBACRD ) 198 { 187 199 188 m_ppppcRDSbacCoders = new TEncSbac*** [iNumSubstreams]; 200 189 m_ppppcBinCodersCABAC = new TEncBinCABAC***[iNumSubstreams]; … … 218 207 } 219 208 } 220 }221 209 222 210 Void TEncTop::destroy () … … 228 216 if (m_cSPS.getUseSAO()) 229 217 { 218 m_cEncSAO.destroyEncData(); 230 219 m_cEncSAO.destroy(); 231 m_cEncSAO.destroyEncBuffer();232 220 } 233 221 m_cLoopFilter. destroy(); 234 222 m_cRateCtrl. destroy(); 235 // SBAC RD 236 if( m_bUseSBACRD ) 237 { 223 238 224 Int iDepth; 239 225 for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) … … 276 262 delete[] m_ppppcRDSbacCoders; 277 263 delete[] m_ppppcBinCodersCABAC; 278 }279 264 delete[] m_pcSbacCoders; 280 265 delete[] m_pcBinCoderCABACs; … … 439 424 #endif 440 425 441 #if RATE_CONTROL_LAMBDA_DOMAIN442 426 if ( m_RCEnableRateControl ) 443 427 { 444 428 m_cRateCtrl.initRCGOP( m_iNumPicRcvd ); 445 429 } 446 #endif447 448 430 #if H_MV 449 431 } … … 457 439 #endif 458 440 459 #if RATE_CONTROL_LAMBDA_DOMAIN460 441 if ( m_RCEnableRateControl ) 461 442 { 462 443 m_cRateCtrl.destroyRCGOP(); 463 444 } 464 #endif465 445 466 446 iNumEncoded = m_iNumPicRcvd; … … 510 490 TComPic *pcTopField; 511 491 xGetNewPicBuffer( pcTopField ); 512 pcTopField->getPicSym()->allocSaoParam(&m_cEncSAO);513 492 pcTopField->setReconMark (false); 514 493 … … 532 511 Pel * pcTopFieldV = pcTopField->getPicYuvOrg()->getCrAddr(); 533 512 534 // compute image characteristics535 if ( getUseAdaptiveQP() )536 {537 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) );538 }539 540 513 /* -- Defield -- */ 541 514 … … 546 519 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcTopFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 547 520 521 // compute image characteristics 522 if ( getUseAdaptiveQP() ) 523 { 524 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcTopField ) ); 525 } 548 526 } 549 527 … … 562 540 TComPic* pcBottomField; 563 541 xGetNewPicBuffer( pcBottomField ); 564 pcBottomField->getPicSym()->allocSaoParam(&m_cEncSAO);565 542 pcBottomField->setReconMark (false); 566 543 567 TComPicYuv* rpcPicYuvRec = new TComPicYuv;544 TComPicYuv* rpcPicYuvRec; 568 545 if ( rcListPicYuvRecOut.size() == (UInt)m_iGOPSize ) 569 546 { … … 572 549 else 573 550 { 551 rpcPicYuvRec = new TComPicYuv; 574 552 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 575 553 } … … 595 573 Pel * pcBottomFieldV = pcBottomField->getPicYuvOrg()->getCrAddr(); 596 574 597 // Compute image characteristics598 if ( getUseAdaptiveQP() )599 {600 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) );601 }602 603 575 /* -- Defield -- */ 604 576 … … 609 581 separateFields(PicBufV + nPadChroma + (nStride >> 1)*nPadChroma, pcBottomFieldV, nStride >> 1, nWidth >> 1, nHeight >> 1, isTop); 610 582 583 // Compute image characteristics 584 if ( getUseAdaptiveQP() ) 585 { 586 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcBottomField ) ); 587 } 611 588 } 612 589 … … 624 601 m_uiNumAllPicCoded += iNumEncoded; 625 602 } 626 #endif627 628 629 603 630 604 // ==================================================================================================================== … … 671 645 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 672 646 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 673 }674 if (getUseSAO())675 {676 rpcPic->getPicSym()->allocSaoParam(&m_cEncSAO);677 647 } 678 648 m_cListPic.pushBack( rpcPic ); … … 760 730 761 731 m_cSPS.setTMVPFlagsPresent(false); 762 m_cSPS.setUseLossless ( m_useLossless );763 732 764 733 m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); … … 794 763 m_cSPS.setMaxTLayers( m_maxTempLayer ); 795 764 m_cSPS.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false ); 796 for ( i = 0; i < m _cSPS.getMaxTLayers(); i++ )765 for ( i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ ) 797 766 { 798 767 m_cSPS.setMaxDecPicBuffering(m_maxDecPicBuffering[i], i); … … 860 829 m_cPPS.setSPSId( getLayerIdInVps() ); 861 830 #endif 862 863 831 #if H_3D 864 832 m_cPPS.setDLT( getDLT() ); 865 833 #endif 866 867 834 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 868 835 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; 869 836 870 Int lowestQP = - m_cSPS.getQpBDOffsetY();871 872 if(getUseLossless())873 {874 if ((getMaxCuDQPDepth() == 0) && (getMaxDeltaQP() == 0 ) && (getQP() == lowestQP) )875 {876 bUseDQP = false;877 }878 else879 {880 bUseDQP = true;881 }882 }883 else884 {885 if(bUseDQP == false)886 {887 837 if((getMaxDeltaQP() != 0 )|| getUseAdaptiveQP()) 888 838 { 889 839 bUseDQP = true; 890 840 } 891 }892 }893 841 894 842 if(bUseDQP) … … 905 853 } 906 854 907 #if RATE_CONTROL_LAMBDA_DOMAIN908 855 if ( m_RCEnableRateControl ) 909 856 { … … 912 859 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); 913 860 } 914 #endif915 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ916 if ( m_enableRateCtrl )917 {918 m_cPPS.setUseDQP(true);919 m_cPPS.setMaxCuDQPDepth( 0 );920 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );921 }922 #endif923 861 924 862 m_cPPS.setChromaCbQpOffset( m_chromaCbQpOffset );
Note: See TracChangeset for help on using the changeset viewer.