Changeset 852 in 3DVCSoftware for branches/HTM-10.0-dev0/source/App/TAppEncoder
- Timestamp:
- 13 Feb 2014, 22:34:17 (11 years ago)
- Location:
- branches/HTM-10.0-dev0/source/App/TAppEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r833 r852 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 * … … 444 444 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 445 445 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 446 #if H_MV 446 447 // Coding structure parameters 447 #if H_MV448 448 ("IntraPeriod,-ip", m_iIntraPeriod,std::vector<Int>(1,-1), "Intra period in frames, (-1: only first frame), per layer") 449 449 #else 450 // Coding structure paramters 450 451 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 451 452 #endif … … 492 493 ("RDOQTS", m_useRDOQTS, true ) 493 494 ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled 1:RD-penalty 2:maximum RD-penalty") 494 // Entropy coding parameters495 ("SBACRD", m_bUseSBACRD, true, "SBAC based RD estimation")496 495 497 496 // Deblocking filter parameters … … 539 538 ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") 540 539 ("SAOLcuBoundary", m_saoLcuBoundary, false, "0: right/bottom LCU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") 541 ("SAOLcuBasedOptimization", m_saoLcuBasedOptimization, true, "0: SAO picture-based optimization, 1: SAO LCU-based optimization ")542 540 ("SliceMode", m_sliceMode, 0, "0: Disable all Recon slice limits, 1: Enforce max # of LCUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") 543 541 ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" … … 559 557 ("PCMInputBitDepthFlag", m_bPCMInputBitDepthFlag, true) 560 558 ("PCMFilterDisableFlag", m_bPCMFilterDisableFlag, false) 561 562 ("LosslessCuEnabled", m_useLossless, false)563 559 564 560 ("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices") … … 590 586 ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting") 591 587 ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting") 592 #if RATE_CONTROL_LAMBDA_DOMAIN593 588 ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) 594 589 ( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bitrate" ) 595 #if M0036_RC_IMPROVEMENT596 590 ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, 0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" ) 597 #else598 ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" )599 #endif600 591 ( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: LCU level RC; false: picture level RC" ) 601 592 ( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use LCU level separate R-lambda model" ) … … 610 601 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off") 611 602 #endif 612 #else613 ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off")614 ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate")615 ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit")616 617 #if KWU_RC_VIEWRC_E0227618 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting")619 ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off")620 #endif621 #if KWU_RC_MADPRED_E0227622 ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off")623 #endif624 #endif625 626 603 #if H_MV 627 604 … … 653 630 654 631 ("TransquantBypassEnableFlag", m_TransquantBypassEnableFlag, false, "transquant_bypass_enable_flag indicator in PPS") 655 ("CUTransquantBypassFlag Value", m_CUTransquantBypassFlagValue, false, "Fixed cu_transquant_bypass_flag value, when transquant_bypass_enable_flag is enabled")632 ("CUTransquantBypassFlagForce", m_CUTransquantBypassFlagForce, false, "Force transquant bypass mode, when transquant_bypass_enable_flag is enabled") 656 633 ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") 657 634 ("StrongIntraSmoothing,-sis", m_useStrongIntraSmoothing, true, "Enable strong intra smoothing for 32x32 blocks") … … 2021 1998 m_maxTempLayer = m_GOPList[i].m_temporalId+1; 2022 1999 } 2023 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P' , "Slice type must be equal to B or P");2000 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); 2024 2001 } 2025 2002 for(Int i=0; i<MAX_TLAYER; i++) … … 2172 2149 } 2173 2150 2174 #if RATE_CONTROL_LAMBDA_DOMAIN2175 2151 if ( m_RCEnableRateControl ) 2176 2152 { … … 2185 2161 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 2186 2162 } 2187 #else2188 if(m_enableRateCtrl)2189 {2190 Int numLCUInWidth = (m_iSourceWidth / m_uiMaxCUWidth) + (( m_iSourceWidth % m_uiMaxCUWidth ) ? 1 : 0);2191 Int numLCUInHeight = (m_iSourceHeight / m_uiMaxCUHeight)+ (( m_iSourceHeight % m_uiMaxCUHeight) ? 1 : 0);2192 Int numLCUInPic = numLCUInWidth * numLCUInHeight;2193 2194 xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" );2195 2196 #if !KWU_FIX_URQ2197 m_iMaxDeltaQP = MAX_DELTA_QP;2198 #endif2199 m_iMaxCuDQPDepth = MAX_CUDQP_DEPTH;2200 }2201 #endif2202 2163 #if H_MV 2203 2164 // VPS VUI … … 2223 2184 #endif 2224 2185 2225 xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlag Value, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0");2186 xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagForce, "CUTransquantBypassFlagForce cannot be 1 when TransquantBypassEnableFlag is 0"); 2226 2187 2227 2188 xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2"); … … 2343 2304 printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC ); 2344 2305 printf("PCM sample bit depth : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma ); 2345 #if RATE_CONTROL_LAMBDA_DOMAIN2346 2306 printf("RateControl : %d\n", m_RCEnableRateControl ); 2347 2307 if(m_RCEnableRateControl) … … 2373 2333 #endif 2374 2334 } 2375 #else2376 printf("RateControl : %d\n", m_enableRateCtrl);2377 if(m_enableRateCtrl)2378 {2379 printf("TargetBitrate : %d\n", m_targetBitrate);2380 printf("NumLCUInUnit : %d\n", m_numLCUInUnit);2381 2382 #if KWU_RC_MADPRED_E02272383 printf("Depth based MAD prediction : %d\n", m_depthMADPred);2384 #endif2385 #if KWU_RC_VIEWRC_E02272386 printf("View-wise Rate control : %d\n", m_viewWiseRateCtrl);2387 if(m_viewWiseRateCtrl)2388 {2389 2390 printf("ViewWiseTargetBits : ");2391 for (Int i = 0 ; i < m_iNumberOfViews ; i++)2392 printf("%d ", m_viewTargetBits[i]);2393 printf("\n");2394 }2395 else2396 {2397 printf("TargetBitrate : %d\n", m_targetBitrate );2398 }2399 #endif2400 }2401 #endif2402 2335 printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand); 2403 2336 #if H_3D … … 2429 2362 printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); 2430 2363 printf("HAD:%d ", m_bUseHADME ); 2431 printf("SRD:%d ", m_bUseSBACRD );2432 2364 printf("RDQ:%d ", m_useRDOQ ); 2433 2365 printf("RDQTS:%d ", m_useRDOQTS ); … … 2458 2390 #endif 2459 2391 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 2460 printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); 2461 2462 printf("LosslessCuEnabled:%d ", (m_useLossless)? 1:0 ); 2392 if (m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagForce) 2393 { 2394 printf("TransQuantBypassEnabled: =1 "); 2395 } 2396 else 2397 { 2398 printf("TransQuantBypassEnabled:%d ", (m_TransquantBypassEnableFlag)? 1:0 ); 2399 } 2463 2400 printf("WPP:%d ", (Int)m_useWeightedPred); 2464 2401 printf("WPB:%d ", (Int)m_useWeightedBiPred); -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncCfg.h
r833 r852 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 * … … 259 259 Bool m_bPCMInputBitDepthFlag; ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth. 260 260 261 // coding tool (lossless) 262 Bool m_useLossless; ///< flag for using lossless coding 261 // coding tool (SAO) 263 262 #if H_MV 264 263 std::vector<Bool> m_bUseSAO; … … 268 267 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture 269 268 Bool m_saoLcuBoundary; ///< SAO parameter estimation using non-deblocked pixels for LCU bottom and right boundary areas 270 Bool m_saoLcuBasedOptimization; ///< SAO LCU-based optimization271 269 // coding tools (loop filter) 272 270 #if H_MV … … 288 286 289 287 // coding tools (encoder-only parameters) 290 Bool m_bUseSBACRD; ///< flag for using RD optimization based on SBAC291 288 Bool m_bUseASR; ///< flag for using adaptive motion search range 292 289 Bool m_bUseHADME; ///< flag for using HAD in sub-pel ME … … 372 369 Int m_TMVPModeId; 373 370 Int m_signHideFlag; 374 #if RATE_CONTROL_LAMBDA_DOMAIN375 371 Bool m_RCEnableRateControl; ///< enable rate control or not 376 372 Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled 377 #if M0036_RC_IMPROVEMENT378 373 Int m_RCKeepHierarchicalBit; ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation 379 #else380 Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not381 #endif382 374 Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control 383 375 Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level … … 392 384 UInt m_depthMADPred; 393 385 #endif 394 #else395 Bool m_enableRateCtrl; ///< Flag for using rate control algorithm396 Int m_targetBitrate; ///< target bitrate397 Int m_numLCUInUnit; ///< Total number of LCUs in a frame should be completely divided by the NumLCUInUnit398 399 #if KWU_RC_VIEWRC_E0227400 vector<Int> m_viewTargetBits;401 Bool m_viewWiseRateCtrl; ///< Flag for using view-wise rate control402 #endif403 #if KWU_RC_MADPRED_E0227404 UInt m_depthMADPred;405 #endif406 #endif407 386 Int m_useScalingListId; ///< using quantization matrix 408 387 Char* m_scalingListFile; ///< quantization matrix file name 409 388 410 389 Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. 411 Bool m_CUTransquantBypassFlag Value; ///< if transquant_bypass_enable_flag, the fixed value to use for the per-CU cu_transquant_bypass_flag.390 Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enable_flag, then, if true, all CU transquant bypass flags will be set to true. 412 391 413 392 Bool m_recalculateQPAccordingToLambda; ///< recalculate QP value according to the lambda value -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r833 r852 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 * … … 309 309 #endif 310 310 311 Int lowestQP;312 lowestQP = - 6*(g_bitDepthY - 8); // XXX: check313 314 #if H_MV315 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layerIdInVps] == lowestQP) && (m_useLossless == true))316 #else317 if ((m_iMaxDeltaQP == 0 ) && (m_iQP == lowestQP) && (m_useLossless == true))318 #endif319 {320 m_bUseAdaptiveQP = false;321 }322 311 m_cTEncTop.setUseAdaptiveQP ( m_bUseAdaptiveQP ); 323 312 m_cTEncTop.setQPAdaptationRange ( m_iQPAdaptationRange ); 324 313 325 314 //====== Tool list ======== 326 m_cTEncTop.setUseSBACRD ( m_bUseSBACRD );327 315 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); 328 316 m_cTEncTop.setUseASR ( m_bUseASR ); 329 317 m_cTEncTop.setUseHADME ( m_bUseHADME ); 330 m_cTEncTop.setUseLossless ( m_useLossless );331 318 #if H_MV 332 319 m_cTEncTop.setdQPs ( m_aidQP[layerIdInVps] ); … … 396 383 397 384 m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); 398 m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization);399 385 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 400 386 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); … … 461 447 m_cTEncTop.setScalingListFile ( m_scalingListFile ); 462 448 m_cTEncTop.setSignHideFlag(m_signHideFlag); 463 #if RATE_CONTROL_LAMBDA_DOMAIN464 449 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 465 450 if(!m_cTEncTop.getIsDepth()) //only for texture … … 482 467 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 483 468 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 484 485 469 #if KWU_RC_MADPRED_E0227 486 470 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) 487 471 { 488 472 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0); 489 490 473 if(m_cTEncTop.getUseDepthMADPred()) 491 474 { … … 498 481 { 499 482 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl); 500 501 483 if(m_iNumberOfViews == 1) 502 484 { … … 552 534 } 553 535 #endif 554 #else555 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227556 if(!m_cTEncTop.getIsDepth()) //only for texture557 {558 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl );559 m_cTEncTop.setTargetBitrate ( m_targetBitrate );560 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit);561 }562 else563 {564 m_cTEncTop.setUseRateCtrl ( 0 );565 }566 #else567 m_cTEncTop.setUseRateCtrl ( m_enableRateCtrl );568 m_cTEncTop.setTargetBitrate ( m_targetBitrate );569 m_cTEncTop.setNumLCUInUnit ( m_numLCUInUnit);570 #endif571 572 573 #if KWU_RC_MADPRED_E0227574 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())575 {576 m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred : 0);577 578 if(m_cTEncTop.getUseDepthMADPred())579 {580 m_cTEncTop.setCamParam(&m_cCameraData);581 }582 }583 #endif584 585 #if KWU_RC_VIEWRC_E0227586 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())587 {588 m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl);589 if(m_iNumberOfViews == 1)590 {591 if(m_viewWiseRateCtrl)592 {593 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]);594 }595 else596 {597 m_cTEncTop.setTargetBitrate ( m_targetBitrate );598 }599 }600 else601 {602 if(m_viewWiseRateCtrl)603 {604 m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]);605 }606 else607 {608 if(m_iNumberOfViews == 2)609 {610 if(m_cTEncTop.getViewId() == 0)611 {612 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*80)/100 );613 }614 else if(m_cTEncTop.getViewId() == 1)615 {616 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*20)/100 );617 }618 }619 else if(m_iNumberOfViews == 3)620 {621 if(m_cTEncTop.getViewId() == 0)622 {623 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*66)/100 );624 }625 else if(m_cTEncTop.getViewId() == 1)626 {627 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 );628 }629 else if(m_cTEncTop.getViewId() == 2)630 {631 m_cTEncTop.setTargetBitrate ( (m_targetBitrate*17)/100 );632 }633 }634 else635 {636 m_cTEncTop.setTargetBitrate ( m_targetBitrate );637 }638 }639 }640 }641 #endif642 #endif643 536 m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); 644 m_cTEncTop.setCUTransquantBypassFlag Value(m_CUTransquantBypassFlagValue);537 m_cTEncTop.setCUTransquantBypassFlagForceValue(m_CUTransquantBypassFlagForce); 645 538 m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 646 539 m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); … … 932 825 } 933 826 934 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_FIX_URQ935 for(Int layer=0; layer < m_numberOfLayers; layer++ )936 {937 if(m_acTEncTopList[layer]->getUseRateCtrl() && !m_acTEncTopList[layer]->getIsDepth())938 {939 m_acTEncTopList[layer]->getRateCtrl()->updateRCGOPStatus();940 }941 }942 #endif943 944 827 gopSize = maxGopSize; 945 828 } … … 1203 1086 rateStatsAccum(au, stats); 1204 1087 } 1205 #endif 1088 #endif 1206 1089 } 1207 1090 } … … 1221 1104 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1222 1105 case NAL_UNIT_CODED_SLICE_TRAIL_N: 1223 case NAL_UNIT_CODED_SLICE_T LA_R:1106 case NAL_UNIT_CODED_SLICE_TSA_R: 1224 1107 case NAL_UNIT_CODED_SLICE_TSA_N: 1225 1108 case NAL_UNIT_CODED_SLICE_STSA_R: … … 1963 1846 } 1964 1847 #endif 1965 1966 1848 //! \} -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncTop.h
r773 r852 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 * -
branches/HTM-10.0-dev0/source/App/TAppEncoder/encmain.cpp
r608 r852 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 *
Note: See TracChangeset for help on using the changeset viewer.