Changeset 1386 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncTop.cpp
- Timestamp:
- 13 Nov 2015, 16:29:39 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r1356 r1386 147 147 #if NH_3D 148 148 xSetCamPara ( vps ); 149 #endif 150 #if NH_3D_VSO 149 151 m_ivPicLists.setVPS ( &vps ); 150 152 #endif … … 186 188 for (Int d = 0; d < 2; d++) 187 189 { 188 m_sps3dExtension.setIv MvPredFlag ( d, m_ivMvPredFlag[d] );189 m_sps3dExtension.setIvMvScal ingFlag ( d, m_ivMvScalingFlag[d] );190 m_sps3dExtension.setIvDiMcEnabledFlag ( d, m_ivMvPredFlag[d] ); 191 m_sps3dExtension.setIvMvScalEnabledFlag ( d, m_ivMvScalingFlag[d] ); 190 192 if (d == 0 ) 191 193 { 192 m_sps3dExtension.setLog2 SubPbSizeMinus3 ( d, m_log2SubPbSizeMinus3 );193 m_sps3dExtension.setIvResPred Flag ( d, m_ivResPredFlag );194 m_sps3dExtension.setDepthRef inementFlag ( d, m_depthRefinementFlag );195 m_sps3dExtension.setV iewSynthesisPredFlag ( d, m_viewSynthesisPredFlag );196 m_sps3dExtension.setD epthBasedBlkPartFlag ( d, m_depthBasedBlkPartFlag );194 m_sps3dExtension.setLog2IvmcSubPbSizeMinus3 ( d, m_log2SubPbSizeMinus3 ); 195 m_sps3dExtension.setIvResPredEnabledFlag ( d, m_ivResPredFlag ); 196 m_sps3dExtension.setDepthRefEnabledFlag ( d, m_depthRefinementFlag ); 197 m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag ); 198 m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag ); 197 199 } 198 200 else 199 201 { 200 m_sps3dExtension.set MpiFlag ( d, m_mpiFlag );201 m_sps3dExtension.setLog2 MpiSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);202 m_sps3dExtension.setIntraContour Flag ( d, m_intraContourFlag );203 m_sps3dExtension.setIntra SdcWedgeFlag ( d, m_intraSdcFlag || m_intraWedgeFlag );204 m_sps3dExtension.set QtPredFlag ( d, m_qtPredFlag );205 m_sps3dExtension.setInter SdcFlag ( d, m_interSdcFlag );206 m_sps3dExtension.set DepthIntraSkipFlag ( d, m_depthIntraSkipFlag );202 m_sps3dExtension.setTexMcEnabledFlag ( d, m_mpiFlag ); 203 m_sps3dExtension.setLog2TexmcSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3); 204 m_sps3dExtension.setIntraContourEnabledFlag ( d, m_intraContourFlag ); 205 m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag ( d, m_intraSdcFlag || m_intraWedgeFlag ); 206 m_sps3dExtension.setCqtCuPartPredEnabledFlag ( d, m_qtPredFlag ); 207 m_sps3dExtension.setInterDcOnlyEnabledFlag ( d, m_interSdcFlag ); 208 m_sps3dExtension.setSkipIntraEnabledFlag ( d, m_depthIntraSkipFlag ); 207 209 } 208 210 } … … 276 278 m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); 277 279 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); 278 #if NH_3D 279 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; 280 m_cTEncTop.setIsDepth ( isDepth ); 280 #if NH_3D_VSO 281 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; 282 Bool isAuxDepth = ( vps.getAuxId ( layerId ) == 2 ) ; // TBD: define 2 as AUX_DEPTH 283 m_cTEncTop.setIsDepth ( isDepth ); 284 m_cTEncTop.setIsAuxDepth ( isAuxDepth ); 281 285 //====== Camera Parameters ========= 282 286 m_cTEncTop.setCameraParameters ( &m_cCameraData ); 283 #if NH_3D_VSO284 287 //====== VSO ========= 285 288 m_cTEncTop.setRenderModelParameters ( &m_cRenModStrParser ); 286 m_cTEncTop.setForceLambdaScaleVSO ( isDepth ? m_bForceLambdaScaleVSO : false );287 m_cTEncTop.setLambdaScaleVSO ( isDepth ? m_dLambdaScaleVSO : 1 );288 m_cTEncTop.setVSOMode ( isDepth ? m_uiVSOMode : 0 );289 290 m_cTEncTop.setAllowNegDist ( isDepth ? m_bAllowNegDist : false );289 m_cTEncTop.setForceLambdaScaleVSO ( isDepth || isAuxDepth ? m_bForceLambdaScaleVSO : false ); 290 m_cTEncTop.setLambdaScaleVSO ( isDepth || isAuxDepth ? m_dLambdaScaleVSO : 1 ); 291 m_cTEncTop.setVSOMode ( isDepth || isAuxDepth ? m_uiVSOMode : 0 ); 292 293 m_cTEncTop.setAllowNegDist ( isDepth || isAuxDepth ? m_bAllowNegDist : false ); 291 294 292 295 // SAIT_VSO_EST_A0033 293 m_cTEncTop.setUseEstimatedVSD ( isDepth ? m_bUseEstimatedVSD : false );296 m_cTEncTop.setUseEstimatedVSD ( isDepth || isAuxDepth ? m_bUseEstimatedVSD : false ); 294 297 295 298 // LGE_WVSO_A0119 296 m_cTEncTop.setUseWVSO ( isDepth ? m_bUseWVSO : false );297 m_cTEncTop.setVSOWeight ( isDepth ? m_iVSOWeight : 0 );298 m_cTEncTop.setVSDWeight ( isDepth ? m_iVSDWeight : 0 );299 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 );299 m_cTEncTop.setUseWVSO ( isDepth || isAuxDepth ? m_bUseWVSO : false ); 300 m_cTEncTop.setVSOWeight ( isDepth || isAuxDepth ? m_iVSOWeight : 0 ); 301 m_cTEncTop.setVSDWeight ( isDepth || isAuxDepth ? m_iVSDWeight : 0 ); 302 m_cTEncTop.setDWeight ( isDepth || isAuxDepth ? m_iDWeight : 0 ); 300 303 #endif // H_3D_VSO 304 #if NH_3D 301 305 #if NH_3D_IC 302 306 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC ); … … 308 312 m_cTEncTop.setUseSDC ( isDepth ? m_intraSdcFlag : false ); 309 313 m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); 310 m_cTEncTop.setUseQTL ( isDepth ? m_bUseQTL : false ); 314 #endif 315 #if NH_3D_QTL 316 m_cTEncTop.setUseQTL ( isDepth || isAuxDepth ? m_bUseQTL : false ); 317 #endif 318 #if NH_3D 311 319 m_cTEncTop.setSps3dExtension ( m_sps3dExtension ); 312 320 #endif // NH_3D … … 378 386 m_cTEncTop.setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] ); 379 387 } 388 m_cTEncTop.setIntraLambdaModifier ( m_adIntraLambdaModifier ); 389 m_cTEncTop.setIntraQpFactor ( m_dIntraQpFactor ); 390 380 391 #if NH_MV 381 392 m_cTEncTop.setQP ( m_iQP[layerIdInVps] ); … … 385 396 386 397 m_cTEncTop.setPad ( m_aiPad ); 387 398 m_cTEncTop.setAccessUnitDelimiter ( m_AccessUnitDelimiter ); 388 399 #if NH_MV 389 400 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layerIdInVps] ); … … 408 419 //====== Motion search ======== 409 420 m_cTEncTop.setDisableIntraPUsInInterSlices ( m_bDisableIntraPUsInInterSlices ); 410 m_cTEncTop.set FastSearch ( m_iFastSearch);421 m_cTEncTop.setMotionEstimationSearchMethod ( m_motionEstimationSearchMethod ); 411 422 m_cTEncTop.setSearchRange ( m_iSearchRange ); 412 423 m_cTEncTop.setBipredSearchRange ( m_bipredSearchRange ); 413 424 m_cTEncTop.setClipForBiPredMeEnabled ( m_bClipForBiPredMeEnabled ); 414 425 m_cTEncTop.setFastMEAssumingSmootherMVEnabled ( m_bFastMEAssumingSmootherMVEnabled ); 426 m_cTEncTop.setMinSearchWindow ( m_minSearchWindow ); 427 m_cTEncTop.setRestrictMESampling ( m_bRestrictMESampling ); 415 428 416 429 #if NH_MV … … 439 452 m_cTEncTop.setExtendedPrecisionProcessingFlag ( m_extendedPrecisionProcessingFlag ); 440 453 m_cTEncTop.setHighPrecisionOffsetsEnabledFlag ( m_highPrecisionOffsetsEnabledFlag ); 454 455 m_cTEncTop.setWeightedPredictionMethod( m_weightedPredictionMethod ); 456 441 457 //====== Tool list ======== 442 458 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); … … 463 479 m_cTEncTop.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 464 480 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 465 m_cTEncTop.set UseFastEnc ( m_bUseFastEnc);481 m_cTEncTop.setFastInterSearchMode ( m_fastInterSearchMode ); 466 482 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 467 483 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); … … 513 529 514 530 //====== Slice ======== 515 m_cTEncTop.setSliceMode ( (SliceConstraint)m_sliceMode );531 m_cTEncTop.setSliceMode ( m_sliceMode ); 516 532 m_cTEncTop.setSliceArgument ( m_sliceArgument ); 517 533 518 534 //====== Dependent Slice ======== 519 m_cTEncTop.setSliceSegmentMode ( (SliceConstraint)m_sliceSegmentMode );535 m_cTEncTop.setSliceSegmentMode ( m_sliceSegmentMode ); 520 536 m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument ); 521 537 … … 540 556 541 557 m_cTEncTop.setIntraSmoothingDisabledFlag (!m_enableIntraReferenceSmoothing ); 542 m_cTEncTop.setDecodedPictureHashSEI Enabled ( m_decodedPictureHashSEIEnabled);558 m_cTEncTop.setDecodedPictureHashSEIType ( m_decodedPictureHashSEIType ); 543 559 m_cTEncTop.setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); 544 560 m_cTEncTop.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); … … 571 587 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 572 588 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 573 m_cTEncTop.setChroma SamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled );574 m_cTEncTop.setChroma SamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc );575 m_cTEncTop.setChroma SamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc );589 m_cTEncTop.setChromaResamplingFilterHintEnabled ( m_chromaResamplingFilterSEIenabled ); 590 m_cTEncTop.setChromaResamplingHorFilterIdc ( m_chromaResamplingHorFilterIdc ); 591 m_cTEncTop.setChromaResamplingVerFilterIdc ( m_chromaResamplingVerFilterIdc ); 576 592 m_cTEncTop.setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 577 593 m_cTEncTop.setFramePackingArrangementSEIType ( m_framePackingSEIType ); … … 590 606 m_cTEncTop.setSOPDescriptionSEIEnabled ( m_SOPDescriptionSEIEnabled ); 591 607 m_cTEncTop.setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 592 #if NH_MV593 #if !NH_MV_SEI594 m_cTEncTop.setSubBitstreamPropSEIEnabled ( m_subBistreamPropSEIEnabled );595 if( m_subBistreamPropSEIEnabled )596 {597 m_cTEncTop.setNumAdditionalSubStreams ( m_sbPropNumAdditionalSubStreams );598 m_cTEncTop.setSubBitstreamMode ( m_sbPropSubBitstreamMode );599 m_cTEncTop.setOutputLayerSetIdxToVps ( m_sbPropOutputLayerSetIdxToVps );600 m_cTEncTop.setHighestSublayerId ( m_sbPropHighestSublayerId );601 m_cTEncTop.setAvgBitRate ( m_sbPropAvgBitRate );602 m_cTEncTop.setMaxBitRate ( m_sbPropMaxBitRate );603 }604 #endif605 #endif606 607 608 m_cTEncTop.setTMCTSSEIEnabled ( m_tmctsSEIEnabled ); 608 609 m_cTEncTop.setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled ); … … 623 624 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 624 625 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 626 m_cTEncTop.setColourRemapInfoSEIFileRoot ( m_colourRemapSEIFileRoot ); 625 627 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 626 628 627 #if NH_MV _SEI629 #if NH_MV 628 630 m_cTEncTop.setSeiMessages ( &m_seiMessages ); 629 631 #endif … … 644 646 } 645 647 m_cTEncTop.setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag ); 646 m_cTEncTop.set WaveFrontSynchro ( m_iWaveFrontSynchro);648 m_cTEncTop.setEntropyCodingSyncEnabledFlag ( m_entropyCodingSyncEnabledFlag ); 647 649 m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); 648 650 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 649 m_cTEncTop.setScalingListFile ( m_scalingListFile);651 m_cTEncTop.setScalingListFileName ( m_scalingListFileName ); 650 652 m_cTEncTop.setSignHideFlag ( m_signHideFlag); 651 653 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 … … 669 671 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 670 672 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 673 #if U0132_TARGET_BITS_SATURATION 674 m_cTEncTop.setCpbSaturationEnabled ( m_RCCpbSaturationEnabled ); 675 m_cTEncTop.setCpbSize ( m_RCCpbSize ); 676 m_cTEncTop.setInitialCpbFullness ( m_RCInitialCpbFullness ); 677 #endif 678 671 679 #if KWU_RC_MADPRED_E0227 672 680 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) … … 796 804 TEncTop* pcEncTop = m_acTEncTopList[ layer ]; 797 805 Int iViewNum = pcEncTop->getViewIndex(); 798 Int iContent = pcEncTop->getIsDepth() ? 1 : 0;806 Int iContent = pcEncTop->getIsDepth() || pcEncTop->getIsAuxDepth() ? 1 : 0; 799 807 Int iNumOfModels = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent); 800 808 … … 843 851 #else 844 852 // Video I/O 845 m_cTVideoIOYuvInputFile.open( m_ pchInputFile, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode853 m_cTVideoIOYuvInputFile.open( m_inputFileName, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 846 854 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 847 855 848 if ( m_pchReconFile)849 { 850 m_cTVideoIOYuvReconFile.open(m_ pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode856 if (!m_reconFileName.empty()) 857 { 858 m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode 851 859 } 852 860 … … 917 925 Void TAppEncTop::encode() 918 926 { 919 fstream bitstreamFile(m_ pchBitstreamFile, fstream::binary | fstream::out);927 fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out); 920 928 if (!bitstreamFile) 921 929 { 922 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_ pchBitstreamFile);930 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str()); 923 931 exit(EXIT_FAILURE); 924 932 } … … 1028 1036 for ( Int gopId=0; gopId < gopSize; gopId++ ) 1029 1037 { 1030 #if NH_3D 1038 #if NH_3D_VSO 1031 1039 UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); 1032 1040 if ( iNextPoc < m_framesToBeEncoded ) … … 1150 1158 printRateSummary(); 1151 1159 1152 #if H_3D_REN_MAX_DEV_OUT1160 #if NH_3D_REN_MAX_DEV_OUT 1153 1161 Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation(); 1154 1162 … … 1295 1303 } 1296 1304 #else 1297 if ( m_pchReconFile)1305 if (!m_reconFileName.empty()) 1298 1306 { 1299 1307 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); … … 1352 1360 } 1353 1361 #else 1354 if ( m_pchReconFile)1362 if (!m_reconFileName.empty()) 1355 1363 { 1356 1364 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, … … 1670 1678 if( m_depthFlag[ curLayerIdInVps ] && ( m_mpiFlag|| m_qtPredFlag || m_intraContourFlag ) ) 1671 1679 { 1672 Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false );1680 Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false, 0 ); 1673 1681 if ( nuhLayerIdTex == refLayerIdInNuh ) 1674 1682 { … … 1696 1704 for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++ ) 1697 1705 { 1698 Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true );1706 Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true, 0 ); 1699 1707 if ( nuhLayerIdDep == refLayerIdInNuh ) 1700 1708 { … … 2063 2071 vps.setLayerIdIncludedFlag( false, lsIdx, layerId ); 2064 2072 } 2065 for ( Int i = 0; i < m_layerId sInSets[lsIdx].size(); i++)2073 for ( Int i = 0; i < m_layerIdxInVpsInSets[lsIdx].size(); i++) 2066 2074 { 2067 vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerId sInSets[lsIdx][i] ) );2075 vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdxInVpsInSets[lsIdx][i] ) ); 2068 2076 } 2069 2077 }
Note: See TracChangeset for help on using the changeset viewer.