Changeset 494 in SHVCSoftware for trunk/source/App/TAppEncoder/TAppEncTop.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk ¶
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev (added) merged: 444-493
- Property svn:mergeinfo changed
-
trunk/source ¶
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev/source (added) merged: 445-471,473-479,481-486,488-493
- Property svn:mergeinfo changed
-
TabularUnified trunk/source/App/TAppEncoder/TAppEncTop.cpp ¶
r442 r494 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 98 98 // Auto generation of the format index 99 99 if( m_acLayerCfg[layer].getRepFormatIdx() == -1 ) 100 { 101 // Currently only picture width and height are considred. It has to be updated if different chroma format and bit-depth will are used. 100 { 102 101 Bool found = false; 103 102 for( UInt idx = 0; idx < layer; idx++ ) 104 103 { 105 if( m_acLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight() ) 104 if( m_acLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight() 105 #if AUXILIARY_PICTURES 106 && m_acLayerCfg[layer].getChromaFormatIDC() == m_acLayerCfg[idx].getChromaFormatIDC() 107 #endif 108 #if O0194_DIFFERENT_BITDEPTH_EL_BL 109 && m_acLayerCfg[layer].m_internalBitDepthY == m_acLayerCfg[idx].m_internalBitDepthY && m_acLayerCfg[layer].m_internalBitDepthC == m_acLayerCfg[idx].m_internalBitDepthC 110 #endif 111 ) 106 112 { 107 113 found = true; … … 117 123 } 118 124 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 125 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 120 126 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 121 127 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); … … 141 147 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 142 148 { 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 149 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 144 150 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 145 151 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 152 #if AUXILIARY_PICTURES 153 repFormat->setChromaFormatVpsIdc ( m_acLayerCfg[mapIdxToLayer[idx]].getChromaFormatIDC() ); 154 #else 146 155 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 156 #endif 147 157 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 158 #if O0194_DIFFERENT_BITDEPTH_EL_BL 159 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY(mapIdxToLayer[idx]) ); // Need modification to change for each layer 160 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC(mapIdxToLayer[idx]) ); // Need modification to change for each layer 161 #else 148 162 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer 149 163 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 164 #endif 150 165 } 151 166 delete [] mapIdxToLayer; … … 153 168 for(UInt layer=0; layer<m_numLayers; layer++) 154 169 { 170 #if O0194_DIFFERENT_BITDEPTH_EL_BL 171 //1 172 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 173 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 174 175 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 176 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 177 178 // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic" 179 g_bitDepthYLayer[layer] = g_bitDepthY; 180 g_bitDepthCLayer[layer] = g_bitDepthC; 181 #endif 155 182 //m_acTEncTop[layer].setVPS(&vps); 156 183 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); … … 187 214 #endif 188 215 #endif 189 // set layer ID 190 m_acTEncTop[layer].setLayerId ( layer ); 216 // set layer ID 217 m_acTEncTop[layer].setLayerId ( layer ); 191 218 m_acTEncTop[layer].setNumLayer ( m_numLayers ); 192 219 m_acTEncTop[layer].setLayerEnc(m_apcTEncTop); … … 196 223 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType ); 197 224 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 198 #if FINAL_RPL_CHANGE_N0082199 m_acTEncTop[layer].setGopList ( m_acLayerCfg[layer].m_GOPListLayer );200 #else201 225 m_acTEncTop[layer].setGopList ( m_GOPList ); 202 #endif 226 203 227 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs ); 204 228 for(Int i = 0; i < MAX_TLAYER; i++) … … 220 244 if (layer<m_numLayers-1) 221 245 { 222 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 223 } 224 #endif 246 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 247 } 248 #endif 225 249 #if VPS_EXTN_DIRECT_REF_LAYERS 226 250 if(layer) … … 241 265 else 242 266 { 243 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 267 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 244 268 for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++) 245 269 { 246 270 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 247 271 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 248 } 272 } 249 273 } 250 274 if(m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1) … … 257 281 else 258 282 { 259 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 283 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 260 284 for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++) 261 285 { 262 286 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 263 287 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true); 264 } 288 } 265 289 } 266 290 Int numDirectRefLayers = 0; … … 283 307 else 284 308 { 285 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 309 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 286 310 for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++) 287 311 { … … 304 328 else 305 329 { 306 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 330 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 307 331 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 308 332 { … … 358 382 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 359 383 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 384 #if LAYER_CTB 385 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 386 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 387 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 388 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 389 #else 360 390 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 361 391 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 362 392 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 363 393 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 394 #endif 364 395 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 365 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 396 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 366 397 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 367 398 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); … … 383 414 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 384 415 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 416 #if O0194_WEIGHTED_PREDICTION_CGS 417 if (layer!=0) 418 { 419 // Enable weighted prediction for enhancement layer 420 m_acTEncTop[layer].setUseWP ( true ); 421 m_acTEncTop[layer].setWPBiPred ( true ); 422 } 423 #endif 385 424 //====== Parallel Merge Estimation ======== 386 425 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); … … 393 432 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 394 433 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 434 #if LAYER_CTB 435 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1); 436 #else 395 437 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 438 #endif 396 439 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 397 440 { … … 417 460 m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary); 418 461 m_acTEncTop[layer].setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 419 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 420 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 462 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 463 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 421 464 422 465 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 483 526 if(uiTilesCount == 1) 484 527 { 485 m_bLFCrossTileBoundaryFlag = true; 528 m_bLFCrossTileBoundaryFlag = true; 486 529 } 487 530 m_acTEncTop[layer].setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 519 562 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 520 563 m_acTEncTop[layer].setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 521 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 564 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 522 565 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 523 566 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); … … 550 593 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 551 594 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 552 #if SCALED_REF_LAYER_OFFSETS553 595 if( layer > 0 ) 554 596 { … … 557 599 { 558 600 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 559 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 560 } 561 } 562 #endif 601 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 602 } 603 } 563 604 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 564 605 m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange ); 565 606 #endif 607 #if AUXILIARY_PICTURES 608 m_acTEncTop[layer].setChromaFormatIDC( m_acLayerCfg[layer].m_chromaFormatIDC ); 609 #endif 566 610 } 567 611 } 568 #else 612 #else //SVC_EXTENSION 569 613 Void TAppEncTop::xInitLibCfg() 570 614 { … … 671 715 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 672 716 m_cTEncTop.setUseFastEnc ( m_bUseFastEnc ); 673 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 717 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 674 718 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 675 719 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); … … 725 769 m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); 726 770 m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 727 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 728 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 771 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 772 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 729 773 730 774 m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 783 827 if(uiTilesCount == 1) 784 828 { 785 m_bLFCrossTileBoundaryFlag = true; 829 m_bLFCrossTileBoundaryFlag = true; 786 830 } 787 831 m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 809 853 m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 810 854 m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 811 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 855 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 812 856 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 813 857 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); … … 840 884 m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 841 885 } 842 #endif 886 #endif //SVC_EXTENSION 843 887 844 888 Void TAppEncTop::xCreateLib() … … 851 895 for(UInt layer=0; layer<m_numLayers; layer++) 852 896 { 897 #if O0194_DIFFERENT_BITDEPTH_EL_BL 898 //2 899 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 900 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 901 902 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 903 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 904 #endif 905 #if LAYER_CTB 906 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 907 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 908 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 909 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 910 #endif 911 #if O0194_DIFFERENT_BITDEPTH_EL_BL 912 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepthY, m_acLayerCfg[layer].m_inputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // read mode 913 #else 853 914 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 915 #endif 854 916 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1]); 855 917 856 918 if (!m_acLayerCfg[layer].getReconFile().empty()) 857 919 { 920 #if O0194_DIFFERENT_BITDEPTH_EL_BL 921 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepthY, m_acLayerCfg[layer].m_outputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // write mode 922 #else 858 923 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // write mode 924 #endif 859 925 } 860 926 861 927 m_acTEncTop[layer].create(); 862 928 } 863 #else 929 #else //SVC_EXTENSION 864 930 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 865 931 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); … … 870 936 // Neo Decoder 871 937 m_cTEncTop.create(); 872 #endif 938 #endif //SVC_EXTENSION 873 939 } 874 940 … … 882 948 for(UInt layer=0; layer<m_numLayers; layer++) 883 949 { 950 #if LAYER_CTB 951 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 952 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 953 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 954 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 955 #endif 956 884 957 m_acTVideoIOYuvInputFile[layer].close(); 885 958 m_acTVideoIOYuvReconFile[layer].close(); … … 887 960 m_acTEncTop[layer].destroy(); 888 961 } 889 #else 962 #else //SVC_EXTENSION 890 963 m_cTVideoIOYuvInputFile.close(); 891 964 m_cTVideoIOYuvReconFile.close(); … … 893 966 // Neo Decoder 894 967 m_cTEncTop.destroy(); 895 #endif 968 #endif //SVC_EXTENSION 896 969 } 897 970 … … 901 974 for(UInt layer=0; layer<m_numLayers; layer++) 902 975 { 976 #if O0194_DIFFERENT_BITDEPTH_EL_BL 977 //3 978 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 979 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 980 981 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 982 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 983 #endif 984 #if LAYER_CTB 985 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 986 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 987 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 988 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 989 990 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 991 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 992 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 993 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 994 #endif 903 995 m_acTEncTop[layer].init(isFieldCoding); 904 996 } … … 915 1007 for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 916 1008 { 1009 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1010 //4 1011 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1012 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1013 1014 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1015 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1016 #endif 917 1017 vps->setLayerIdIncludedFlag(true, setId, layerId); 918 1018 } … … 930 1030 vps->setScalabilityMask(i, false); 931 1031 } 932 if(m_numLayers > 1) 1032 if(m_numLayers > 1) 933 1033 { 934 1034 Int scalabilityTypes = 0; … … 938 1038 scalabilityTypes += m_scalabilityMask[i]; 939 1039 } 1040 #if AUXILIARY_PICTURES 1041 assert( scalabilityTypes <= 2 ); 1042 #else 940 1043 assert( scalabilityTypes == 1 ); 1044 #endif 941 1045 vps->setNumScalabilityTypes(scalabilityTypes); 942 1046 } … … 959 1063 vps->setDimensionId(i, 0, i); 960 1064 } 1065 #if AUXILIARY_PICTURES 1066 if (m_scalabilityMask[3]) 1067 { 1068 UInt maxAuxId = 0; 1069 UInt auxDimIdLen = 0; 1070 for(i = 1; i < vps->getMaxLayers(); i++) 1071 { 1072 if (m_acLayerCfg[i].getAuxId() > maxAuxId) 1073 { 1074 maxAuxId = m_acLayerCfg[i].getAuxId(); 1075 } 1076 } 1077 while((1 << auxDimIdLen) < (maxAuxId + 1)) 1078 { 1079 auxDimIdLen++; 1080 } 1081 vps->setDimensionIdLen(1, auxDimIdLen); 1082 for(i = 1; i < vps->getMaxLayers(); i++) 1083 { 1084 vps->setDimensionId(i, 1, m_acLayerCfg[i].getAuxId()); 1085 } 1086 } 1087 #endif 961 1088 #endif 962 1089 #if N0120_MAX_TID_REF_PRESENT_FLAG 963 1090 #if N0120_MAX_TID_REF_CFG 964 1091 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 965 #else 1092 #else 966 1093 vps->setMaxTidRefPresentFlag(true); 1094 #endif 1095 if (vps->getMaxTidRefPresentFlag()) 1096 { 1097 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ ) 1098 { 1099 #if N0120_MAX_TID_REF_CFG 1100 #if O0225_MAX_TID_FOR_REF_LAYERS 1101 for( Int j = i+1; j <= MAX_VPS_LAYER_ID_PLUS1 - 1; j++) 1102 { 1103 vps->setMaxTidIlRefPicsPlus1(i, j, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1104 } 1105 #else 1106 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 967 1107 #endif 968 if (vps->getMaxTidRefPresentFlag()) 1108 #else 1109 #if O0225_MAX_TID_FOR_REF_LAYERS 1110 for( Int j = i+1; j <= MAX_VPS_LAYER_ID_PLUS1 - 1; j++) 1111 { 1112 vps->setMaxTidIlRefPicsPlus1(i, j, vps->getMaxTLayers()+1); 1113 } 1114 #else 1115 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1); 1116 #endif 1117 #endif 1118 } 1119 } 1120 else 969 1121 { 970 1122 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ ) 971 1123 { 972 #if N0120_MAX_TID_REF_CFG 973 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 974 #else 975 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1); 1124 #if O0225_MAX_TID_FOR_REF_LAYERS 1125 for( Int j = i+1; j <= MAX_VPS_LAYER_ID_PLUS1 - 1; j++) 1126 { 1127 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1128 } 1129 #else 1130 vps->setMaxTidIlRefPicsPlus1(i, 7); 976 1131 #endif 977 1132 } 978 1133 } 979 else 980 { 981 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ ) 982 { 983 vps->setMaxTidIlRefPicsPlus1(i, 7); 984 } 985 } 986 #endif 1134 #endif 987 1135 #if ILP_SSH_SIG 1136 #if ILP_SSH_SIG_FIX 1137 vps->setIlpSshSignalingEnabledFlag(false); 1138 #else 988 1139 vps->setIlpSshSignalingEnabledFlag(true); 1140 #endif 989 1141 #endif 990 1142 #if VPS_EXTN_PROFILE_INFO … … 998 1150 #endif 999 1151 // Target output layer 1000 #if VPS_PROFILE_OUTPUT_LAYERS 1001 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1002 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1152 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1153 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1003 1154 vps->setDefaultOneTargetOutputLayerFlag(true); 1004 1155 for(i = 1; i < vps->getNumLayerSets(); i++) 1005 1156 { 1006 1157 vps->setProfileLevelTierIdx(i, i); 1007 vps->setOutputLayerSetIdx(i, i); 1008 } 1009 #else 1010 vps->setNumOutputLayerSets(1); 1011 Int lsIdx = 1; 1012 vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set 1013 #endif 1158 vps->setOutputLayerSetIdx(i, i); 1159 } 1160 1014 1161 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1015 1162 { 1016 // Include the highest layer as output layer 1163 // Include the highest layer as output layer 1017 1164 for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++) 1018 1165 { … … 1073 1220 #endif 1074 1221 #endif 1075 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1076 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1077 #endif 1078 #if N0147_IRAP_ALIGN_FLAG 1079 vps->setCrossLayerIrapAlignFlag(true); 1222 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1223 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1224 #endif 1225 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1226 for(i = 1; i< vps->getMaxLayers(); i++) 1227 { 1228 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1229 { 1230 vps->setPocLsbNotPresentFlag(i, false); 1231 } 1232 } 1233 #endif 1234 #if N0147_IRAP_ALIGN_FLAG 1235 vps->setCrossLayerIrapAlignFlag(true); 1080 1236 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1081 1237 { … … 1083 1239 { 1084 1240 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1085 { 1241 { 1086 1242 if(m_acTEncTop[layerCtr].getIntraPeriod() != m_acTEncTop[refLayerCtr].getIntraPeriod()) 1087 1243 { … … 1097 1253 vps->setCrossLayerIrapAlignFlag(false); 1098 1254 } 1099 #endif 1255 #endif 1100 1256 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1101 1257 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); 1102 1258 #endif 1259 #if !VPS_EXTN_OFFSET_CALC 1103 1260 #if VPS_EXTN_OFFSET 1104 1261 // to be updated according to the current semantics 1105 1262 vps->setExtensionOffset( 0xffff ); 1106 1263 #endif 1264 #endif 1265 1266 #if O0215_PHASE_ALIGNMENT 1267 vps->setPhaseAlignFlag( m_phaseAlignFlag ); 1268 #endif 1269 1107 1270 #else //SVC_EXTENSION 1108 1271 m_cTEncTop.init(isFieldCoding); … … 1148 1311 for(UInt layer=0; layer<m_numLayers; layer++) 1149 1312 { 1313 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1314 //5 1315 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1316 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1317 1318 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1319 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1320 #endif 1150 1321 // allocate original YUV buffer 1151 1322 pcPicYuvOrg[layer] = new TComPicYuv; … … 1153 1324 { 1154 1325 #if SVC_UPSAMPLING 1326 #if LAYER_CTB 1327 #if AUXILIARY_PICTURES 1328 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1329 #else 1330 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1331 #endif 1332 #else 1333 #if AUXILIARY_PICTURES 1334 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1335 #else 1155 1336 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1337 #endif 1338 #endif 1156 1339 #else 1157 1340 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1161 1344 { 1162 1345 #if SVC_UPSAMPLING 1346 #if LAYER_CTB 1347 #if AUXILIARY_PICTURES 1348 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1349 #else 1350 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1351 #endif 1352 #else 1353 #if AUXILIARY_PICTURES 1354 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1355 #else 1163 1356 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1357 #endif 1358 #endif 1164 1359 #else 1165 1360 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1190 1385 while ( !bEos ) 1191 1386 { 1192 // Read enough frames 1387 // Read enough frames 1193 1388 Bool bFramesReadyToCode = false; 1194 1389 while(!bFramesReadyToCode) … … 1196 1391 for(UInt layer=0; layer<m_numLayers; layer++) 1197 1392 { 1393 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1394 //6 1395 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1396 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1397 1398 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1399 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1400 #endif 1401 #if LAYER_CTB 1402 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1403 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1404 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1405 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1406 #endif 1407 1198 1408 // get buffers 1199 1409 xGetBuffer(pcPicYuvRec, layer); … … 1201 1411 // read input YUV file 1202 1412 m_acTVideoIOYuvInputFile[layer].read( pcPicYuvOrg[layer], m_acLayerCfg[layer].getPad() ); 1413 1414 #if AUXILIARY_PICTURES 1415 if (m_acLayerCfg[layer].getChromaFormatIDC() == CHROMA_400) 1416 { 1417 pcPicYuvOrg[layer]->convertToMonochrome(); 1418 } 1419 #endif 1203 1420 1204 1421 if(layer == m_numLayers-1) … … 1257 1474 #endif 1258 1475 1259 // loop through frames in one GOP 1476 // loop through frames in one GOP 1260 1477 for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ ) 1261 1478 { … … 1263 1480 for(UInt layer=0; layer<m_numLayers; layer++) 1264 1481 { 1482 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1483 //7 1484 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1485 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1486 1487 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1488 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1489 #endif 1490 #if LAYER_CTB 1491 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1492 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1493 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1494 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1495 1496 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 1497 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 1498 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 1499 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1500 #endif 1265 1501 // call encoding function for one frame 1266 1502 if ( m_isField ) … … 1288 1524 for(UInt layer=0; layer<m_numLayers; layer++) 1289 1525 { 1526 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1527 //8 1528 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1529 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1530 1531 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1532 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1533 #endif 1290 1534 // write bistream to file if necessary 1291 1535 iNumEncoded = m_acTEncTop[layer].getNumPicRcvd(); … … 1528 1772 1529 1773 #if SVC_UPSAMPLING 1774 #if LAYER_CTB 1775 #if AUXILIARY_PICTURES 1776 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1777 #else 1778 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1779 #endif 1780 #else 1781 #if AUXILIARY_PICTURES 1782 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1783 #else 1530 1784 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1785 #endif 1786 #endif 1531 1787 #else 1532 1788 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1551 1807 delete pcPicYuvRec; pcPicYuvRec = NULL; 1552 1808 } 1553 } 1809 } 1554 1810 } 1555 1811 … … 1602 1858 #endif 1603 1859 { 1604 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1860 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1605 1861 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1606 1862 } … … 1622 1878 for ( i = 0; i < iNumEncoded/2; i++ ) 1623 1879 #endif 1624 { 1880 { 1625 1881 const AccessUnit& auTop = *(iterBitstream++); 1626 1882 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop);
Note: See TracChangeset for help on using the changeset viewer.