Changeset 1377 in SHVCSoftware
- Timestamp:
- 23 Jul 2015, 01:02:36 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r1323 r1377 92 92 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name") 93 93 #if SVC_EXTENSION 94 ("ReconFileL%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"95 "YUV writing is skipped if omitted")94 ("ReconFileL%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n" 95 "YUV writing is skipped if omitted") 96 96 #if AVC_BASE 97 ("BLReconFile,-ibl", cfg_BLReconFile, string(""), "BL reconstructed YUV input file name")98 #endif 99 ("TargetLayerId,-lid", targetLayerId, -1, "Target layer id")100 ("LayerNum,-ls", layerNum, MAX_NUM_LAYER_IDS, "Target layer id") // Legacy option101 ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.")102 #if CONFORMANCE_BITSTREAM_MODE 103 ("ConformanceBitstremMode,-confMode", m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated")104 ("ConformanceMetadataPrefix, -confPrefix", cfg_confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")97 ("BLReconFile,-ibl", cfg_BLReconFile, string(""), "BL reconstructed YUV input file name") 98 #endif 99 ("TargetLayerId,-lid", targetLayerId, -1, "Target layer id") 100 ("LayerNum,-ls", layerNum, MAX_NUM_LAYER_IDS, "Target layer id") // Legacy option 101 ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.") 102 #if CONFORMANCE_BITSTREAM_MODE 103 ("ConformanceBitstremMode,-confMode", m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated") 104 ("ConformanceMetadataPrefix, -confPrefix", cfg_confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'") 105 105 #endif 106 106 #else -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1375 r1377 122 122 , m_elRapSliceBEnabled(0) 123 123 { 124 for(UInt layer=0; layer<MAX_LAYERS; layer++) 125 { 126 m_acLayerCfg[layer].setAppEncCfg(this); 127 } 124 memset( m_apcLayerCfg, NULL, sizeof(m_apcLayerCfg) ); 128 125 memset( m_scalabilityMask, 0, sizeof(m_scalabilityMask) ); 129 126 } … … 186 183 { 187 184 #if SVC_EXTENSION 188 for(Int layer = 0; layer < MAX_LAYERS; layer++) 189 { 190 if( m_acLayerCfg[layer].m_numSamplePredRefLayers > 0 ) 191 { 192 delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds; 193 m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; 194 } 195 if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) 196 { 197 delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds; 198 m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; 199 } 200 if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) 201 { 202 delete [] m_acLayerCfg[layer].m_predLayerIds; 203 m_acLayerCfg[layer].m_predLayerIds = NULL; 185 for( Int layer = 0; layer < m_numLayers; layer++ ) 186 { 187 if( m_apcLayerCfg[layer]->m_numSamplePredRefLayers > 0 ) 188 { 189 delete [] m_apcLayerCfg[layer]->m_samplePredRefLayerIds; 190 m_apcLayerCfg[layer]->m_samplePredRefLayerIds = NULL; 191 } 192 if( m_apcLayerCfg[layer]->m_numMotionPredRefLayers > 0 ) 193 { 194 delete [] m_apcLayerCfg[layer]->m_motionPredRefLayerIds; 195 m_apcLayerCfg[layer]->m_motionPredRefLayerIds = NULL; 196 } 197 if( m_apcLayerCfg[layer]->m_numActiveRefLayers > 0 ) 198 { 199 delete [] m_apcLayerCfg[layer]->m_predLayerIds; 200 m_apcLayerCfg[layer]->m_predLayerIds = NULL; 201 } 202 if( m_apcLayerCfg[layer] ) 203 { 204 delete m_apcLayerCfg[layer]; 205 m_apcLayerCfg[layer] = NULL; 204 206 } 205 207 } … … 752 754 // ==================================================================================================================== 753 755 756 #if SVC_EXTENSION 757 /** \param argc number of arguments 758 \param argv array of arguments 759 \retval true when success 760 */ 761 Bool TAppEncCfg::parseCfgNumLayersAndInit( Int argc, Char* argv[] ) 762 { 763 po::Options opts; 764 opts.addOptions() 765 ("c", po::parseConfigFile, "configuration file name") 766 ("NumLayers", m_numLayers, 1, "Number of layers to code") 767 ; 768 769 po::setDefaults(opts); 770 po::ErrorReporter err; 771 err.verbose = false; 772 po::scanArgv(opts, argc, (const Char**) argv, err); 773 774 if( m_numLayers <= 0 ) 775 { 776 printf("Wrong number of layers %d\n", m_numLayers); 777 return false; 778 } 779 780 for( Int layer = 0; layer < m_numLayers; layer++ ) 781 { 782 m_apcLayerCfg[layer] = new TAppEncLayerCfg; 783 m_apcLayerCfg[layer]->setAppEncCfg(this); 784 } 785 786 return true; 787 } 788 #endif 789 754 790 /** \param argc number of arguments 755 791 \param argv array of arguments … … 866 902 Int* cfg_layerPTLIdx[MAX_VPS_LAYER_IDX_PLUS1]; 867 903 868 for( UInt layer = 0; layer < MAX_LAYERS; layer++ )869 { 870 cfg_InputFile[layer] = &m_a cLayerCfg[layer].m_cInputFile;871 cfg_ReconFile[layer] = &m_a cLayerCfg[layer].m_cReconFile;872 cfg_fQP[layer] = &m_a cLayerCfg[layer].m_fQP;904 for( UInt layer = 0; layer < m_numLayers; layer++ ) 905 { 906 cfg_InputFile[layer] = &m_apcLayerCfg[layer]->m_cInputFile; 907 cfg_ReconFile[layer] = &m_apcLayerCfg[layer]->m_cReconFile; 908 cfg_fQP[layer] = &m_apcLayerCfg[layer]->m_fQP; 873 909 #if Q0074_COLOUR_REMAPPING_SEI 874 cfg_colourRemapSEIFileRoot[layer] = &m_a cLayerCfg[layer].m_colourRemapSEIFileRoot;875 #endif 876 cfg_repFormatIdx[layer] = &m_a cLayerCfg[layer].m_repFormatIdx;877 cfg_layerId[layer] = &m_a cLayerCfg[layer].m_layerId;878 cfg_SourceWidth[layer] = &m_a cLayerCfg[layer].m_iSourceWidth;879 cfg_SourceHeight[layer] = &m_a cLayerCfg[layer].m_iSourceHeight;880 cfg_FrameRate[layer] = &m_a cLayerCfg[layer].m_iFrameRate;881 cfg_IntraPeriod[layer] = &m_a cLayerCfg[layer].m_iIntraPeriod;882 cfg_conformanceMode[layer] = &m_a cLayerCfg[layer].m_conformanceMode;883 cfg_confWinLeft[layer] = &m_a cLayerCfg[layer].m_confWinLeft;884 cfg_confWinRight[layer] = &m_a cLayerCfg[layer].m_confWinRight;885 cfg_confWinTop[layer] = &m_a cLayerCfg[layer].m_confWinTop;886 cfg_confWinBottom[layer] = &m_a cLayerCfg[layer].m_confWinBottom;887 cfg_aiPadX[layer] = &m_a cLayerCfg[layer].m_aiPad[0];888 cfg_aiPadY[layer] = &m_a cLayerCfg[layer].m_aiPad[1];889 cfg_useExtendedPrecision[layer] = &m_a cLayerCfg[layer].m_extendedPrecisionProcessingFlag;890 891 cfg_maxCuDQPDepth[layer] = &m_a cLayerCfg[layer].m_iMaxCuDQPDepth;910 cfg_colourRemapSEIFileRoot[layer] = &m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot; 911 #endif 912 cfg_repFormatIdx[layer] = &m_apcLayerCfg[layer]->m_repFormatIdx; 913 cfg_layerId[layer] = &m_apcLayerCfg[layer]->m_layerId; 914 cfg_SourceWidth[layer] = &m_apcLayerCfg[layer]->m_iSourceWidth; 915 cfg_SourceHeight[layer] = &m_apcLayerCfg[layer]->m_iSourceHeight; 916 cfg_FrameRate[layer] = &m_apcLayerCfg[layer]->m_iFrameRate; 917 cfg_IntraPeriod[layer] = &m_apcLayerCfg[layer]->m_iIntraPeriod; 918 cfg_conformanceMode[layer] = &m_apcLayerCfg[layer]->m_conformanceMode; 919 cfg_confWinLeft[layer] = &m_apcLayerCfg[layer]->m_confWinLeft; 920 cfg_confWinRight[layer] = &m_apcLayerCfg[layer]->m_confWinRight; 921 cfg_confWinTop[layer] = &m_apcLayerCfg[layer]->m_confWinTop; 922 cfg_confWinBottom[layer] = &m_apcLayerCfg[layer]->m_confWinBottom; 923 cfg_aiPadX[layer] = &m_apcLayerCfg[layer]->m_aiPad[0]; 924 cfg_aiPadY[layer] = &m_apcLayerCfg[layer]->m_aiPad[1]; 925 cfg_useExtendedPrecision[layer] = &m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag; 926 927 cfg_maxCuDQPDepth[layer] = &m_apcLayerCfg[layer]->m_iMaxCuDQPDepth; 892 928 893 929 // coding unit (CU) definition 894 cfg_uiMaxCUWidth[layer] = &m_a cLayerCfg[layer].m_uiMaxCUWidth;895 cfg_uiMaxCUHeight[layer] = &m_a cLayerCfg[layer].m_uiMaxCUHeight;896 cfg_uiMaxCUDepth[layer] = &m_a cLayerCfg[layer].m_uiMaxCUDepth;930 cfg_uiMaxCUWidth[layer] = &m_apcLayerCfg[layer]->m_uiMaxCUWidth; 931 cfg_uiMaxCUHeight[layer] = &m_apcLayerCfg[layer]->m_uiMaxCUHeight; 932 cfg_uiMaxCUDepth[layer] = &m_apcLayerCfg[layer]->m_uiMaxCUDepth; 897 933 898 934 // transfom unit (TU) definition. 899 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_a cLayerCfg[layer].m_uiQuadtreeTULog2MaxSize;900 cfg_uiQuadtreeTULog2MinSize[layer] = &m_a cLayerCfg[layer].m_uiQuadtreeTULog2MinSize;901 902 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_a cLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;903 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_a cLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;904 905 cfg_numSamplePredRefLayers [layer] = &m_a cLayerCfg[layer].m_numSamplePredRefLayers;935 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MaxSize; 936 cfg_uiQuadtreeTULog2MinSize[layer] = &m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MinSize; 937 938 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthInter; 939 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthIntra; 940 941 cfg_numSamplePredRefLayers [layer] = &m_apcLayerCfg[layer]->m_numSamplePredRefLayers; 906 942 cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer]; 907 cfg_numMotionPredRefLayers [layer] = &m_a cLayerCfg[layer].m_numMotionPredRefLayers;943 cfg_numMotionPredRefLayers [layer] = &m_apcLayerCfg[layer]->m_numMotionPredRefLayers; 908 944 cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer]; 909 cfg_numActiveRefLayers [layer] = &m_a cLayerCfg[layer].m_numActiveRefLayers;945 cfg_numActiveRefLayers [layer] = &m_apcLayerCfg[layer]->m_numActiveRefLayers; 910 946 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; 911 947 912 cfg_numRefLayerLocationOffsets [layer] = &m_a cLayerCfg[layer].m_numRefLayerLocationOffsets;913 cfg_waveFrontSynchro[layer] = &m_a cLayerCfg[layer].m_waveFrontSynchro;914 for(Int i = 0; i < MAX_LAYERS; i++)948 cfg_numRefLayerLocationOffsets [layer] = &m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; 949 cfg_waveFrontSynchro[layer] = &m_apcLayerCfg[layer]->m_waveFrontSynchro; 950 for(Int i = 0; i < m_numLayers; i++) 915 951 { 916 952 cfg_refLocationOffsetLayerIdPtr [layer] = &cfg_refLocationOffsetLayerId[layer]; … … 932 968 } 933 969 #if RC_SHVC_HARMONIZATION 934 cfg_RCEnableRateControl[layer] = &m_a cLayerCfg[layer].m_RCEnableRateControl;935 cfg_RCTargetBitRate[layer] = &m_a cLayerCfg[layer].m_RCTargetBitrate;936 cfg_RCKeepHierarchicalBit[layer] = &m_a cLayerCfg[layer].m_RCKeepHierarchicalBit;937 cfg_RCLCULevelRC[layer] = &m_a cLayerCfg[layer].m_RCLCULevelRC;938 cfg_RCUseLCUSeparateModel[layer] = &m_a cLayerCfg[layer].m_RCUseLCUSeparateModel;939 cfg_RCInitialQP[layer] = &m_a cLayerCfg[layer].m_RCInitialQP;940 cfg_RCForceIntraQP[layer] = &m_a cLayerCfg[layer].m_RCForceIntraQP;941 #endif 942 943 cfg_InputBitDepth [CHANNEL_TYPE_LUMA][layer] = &m_a cLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_LUMA];944 cfg_InternalBitDepth[CHANNEL_TYPE_LUMA][layer] = &m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA];945 cfg_OutputBitDepth [CHANNEL_TYPE_LUMA][layer] = &m_a cLayerCfg[layer].m_outputBitDepth[CHANNEL_TYPE_LUMA];946 cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA][layer] = &m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];947 cfg_InputBitDepth [CHANNEL_TYPE_CHROMA][layer] = &m_a cLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_CHROMA];948 cfg_OutputBitDepth [CHANNEL_TYPE_CHROMA][layer] = &m_a cLayerCfg[layer].m_outputBitDepth[CHANNEL_TYPE_CHROMA];949 950 cfg_maxTidIlRefPicsPlus1[layer] = &m_a cLayerCfg[layer].m_maxTidIlRefPicsPlus1;970 cfg_RCEnableRateControl[layer] = &m_apcLayerCfg[layer]->m_RCEnableRateControl; 971 cfg_RCTargetBitRate[layer] = &m_apcLayerCfg[layer]->m_RCTargetBitrate; 972 cfg_RCKeepHierarchicalBit[layer] = &m_apcLayerCfg[layer]->m_RCKeepHierarchicalBit; 973 cfg_RCLCULevelRC[layer] = &m_apcLayerCfg[layer]->m_RCLCULevelRC; 974 cfg_RCUseLCUSeparateModel[layer] = &m_apcLayerCfg[layer]->m_RCUseLCUSeparateModel; 975 cfg_RCInitialQP[layer] = &m_apcLayerCfg[layer]->m_RCInitialQP; 976 cfg_RCForceIntraQP[layer] = &m_apcLayerCfg[layer]->m_RCForceIntraQP; 977 #endif 978 979 cfg_InputBitDepth [CHANNEL_TYPE_LUMA][layer] = &m_apcLayerCfg[layer]->m_inputBitDepth[CHANNEL_TYPE_LUMA]; 980 cfg_InternalBitDepth[CHANNEL_TYPE_LUMA][layer] = &m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA]; 981 cfg_OutputBitDepth [CHANNEL_TYPE_LUMA][layer] = &m_apcLayerCfg[layer]->m_outputBitDepth[CHANNEL_TYPE_LUMA]; 982 cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA][layer] = &m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 983 cfg_InputBitDepth [CHANNEL_TYPE_CHROMA][layer] = &m_apcLayerCfg[layer]->m_inputBitDepth[CHANNEL_TYPE_CHROMA]; 984 cfg_OutputBitDepth [CHANNEL_TYPE_CHROMA][layer] = &m_apcLayerCfg[layer]->m_outputBitDepth[CHANNEL_TYPE_CHROMA]; 985 986 cfg_maxTidIlRefPicsPlus1[layer] = &m_apcLayerCfg[layer]->m_maxTidIlRefPicsPlus1; 951 987 #if AUXILIARY_PICTURES 952 cfg_auxId[layer] = &m_a cLayerCfg[layer].m_auxId;953 #endif 954 cfg_layerSwitchOffBegin[layer] = &m_a cLayerCfg[layer].m_layerSwitchOffBegin;955 cfg_layerSwitchOffEnd[layer] = &m_a cLayerCfg[layer].m_layerSwitchOffEnd;956 cfg_layerPTLIdx[layer] = &m_a cLayerCfg[layer].m_layerPTLIdx;988 cfg_auxId[layer] = &m_apcLayerCfg[layer]->m_auxId; 989 #endif 990 cfg_layerSwitchOffBegin[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffBegin; 991 cfg_layerSwitchOffEnd[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffEnd; 992 cfg_layerPTLIdx[layer] = &m_apcLayerCfg[layer]->m_layerPTLIdx; 957 993 } 958 994 … … 1064 1100 // File, I/O and source parameters 1065 1101 #if SVC_EXTENSION 1066 ("InputFile%d,-i%d", cfg_InputFile, string(""), MAX_LAYERS, "original YUV input file name for layer %d")1067 ("ReconFile%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "reconstruction YUV input file name for layer %d")1068 ("LayerConfig%d,-lc%d", cfg_LayerCfgFile, string(""), MAX_LAYERS, "layer %d configuration file name")1069 ("SourceWidth%d,-wdt%d", cfg_SourceWidth, 0, MAX_LAYERS, "Source picture width for layer %d")1070 ("SourceHeight%d,-hgt%d", cfg_SourceHeight, 0, MAX_LAYERS, "Source picture height for layer %d")1071 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d")1072 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, 1073 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS")1074 ("LayerId%d", cfg_layerId, -1, MAX_LAYERS, "Layer id")1075 1076 ("NumSamplePredRefLayers%d", cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers")1077 ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs")1078 ("NumMotionPredRefLayers%d", cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers")1079 ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs")1080 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers")1081 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs")1082 1083 ("NumLayers", m_numLayers, 1084 1085 ("NumLayerSets", m_numLayerSets, 1086 ("NumLayerInIdList%d", cfg_numLayerInIdList, 1087 ("LayerSetLayerIdList%d", 1088 ("NumAddLayerSets", m_numAddLayerSets, 1089 ("NumHighestLayerIdx%d", 1090 ("HighestLayerIdx%d", 1091 1092 ("DefaultTargetOutputLayerIdc", m_defaultTargetOutputLayerIdc, 1093 ("NumOutputLayerSets", m_numOutputLayerSets, 1094 ("NumOutputLayersInOutputLayerSet", cfg_numOutputLayersInOutputLayerSet, 1095 ("ListOfOutputLayers%d", 1096 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, 1102 ("InputFile%d,-i%d", cfg_InputFile, string(""), m_numLayers, "original YUV input file name for layer %d") 1103 ("ReconFile%d,-o%d", cfg_ReconFile, string(""), m_numLayers, "reconstruction YUV input file name for layer %d") 1104 ("LayerConfig%d,-lc%d", cfg_LayerCfgFile, string(""), m_numLayers, "layer %d configuration file name") 1105 ("SourceWidth%d,-wdt%d", cfg_SourceWidth, 0, m_numLayers, "Source picture width for layer %d") 1106 ("SourceHeight%d,-hgt%d", cfg_SourceHeight, 0, m_numLayers, "Source picture height for layer %d") 1107 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, m_numLayers, "Frame rate for layer %d") 1108 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, Double(1.0), MAX_TLAYER, "Lambda modifier for temporal layer %d") 1109 ("RepFormatIdx%d", cfg_repFormatIdx, -1, m_numLayers, "Index to the representation format structure used from the VPS") 1110 ("LayerId%d", cfg_layerId, -1, m_numLayers, "Layer id") 1111 1112 ("NumSamplePredRefLayers%d", cfg_numSamplePredRefLayers, -1, m_numLayers, "Number of sample prediction reference layers") 1113 ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), m_numLayers, "sample pred reference layer IDs") 1114 ("NumMotionPredRefLayers%d", cfg_numMotionPredRefLayers, -1, m_numLayers, "Number of motion prediction reference layers") 1115 ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), m_numLayers, "motion pred reference layer IDs") 1116 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, m_numLayers, "Number of active reference layers") 1117 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), m_numLayers, "inter-layer prediction layer IDs") 1118 1119 ("NumLayers", m_numLayers, 1, "Number of layers to code") 1120 1121 ("NumLayerSets", m_numLayerSets, 1, "Number of layer sets") 1122 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set") 1123 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set") 1124 ("NumAddLayerSets", m_numAddLayerSets, 0, "Number of additional layer sets") 1125 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx") 1126 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set") 1127 1128 ("DefaultTargetOutputLayerIdc", m_defaultTargetOutputLayerIdc, 1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers") 1129 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") 1130 ("NumOutputLayersInOutputLayerSet", cfg_numOutputLayersInOutputLayerSet, string(""), 1, "List containing number of output layers in the output layer sets") 1131 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]") 1132 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, string(""), 1, "Corresponding layer set index, only for non-default output layer sets") 1097 1133 #if AUXILIARY_PICTURES 1098 ("AuxId%d", cfg_auxId, 0, MAX_LAYERS, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh")1099 #endif 1100 ("ExtendedPrecision%d", cfg_useExtendedPrecision, false, MAX_LAYERS, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)")1101 ("ConformanceMode%d", cfg_conformanceMode, 0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")1102 ("ConfLeft%d", cfg_confWinLeft, 0, MAX_LAYERS, "Deprecated alias of ConfWinLeft")1103 ("ConfRight%d", cfg_confWinRight, 0, MAX_LAYERS, "Deprecated alias of ConfWinRight")1104 ("ConfTop%d", cfg_confWinTop, 0, MAX_LAYERS, "Deprecated alias of ConfWinTop")1105 ("ConfBottom%d", cfg_confWinBottom, 0, MAX_LAYERS, "Deprecated alias of ConfWinBottom")1106 ("ConfWinLeft%d", cfg_confWinLeft, 0, MAX_LAYERS, "Left offset for window conformance mode 3")1107 ("ConfWinRight%d", cfg_confWinRight, 0, MAX_LAYERS, "Right offset for window conformance mode 3")1108 ("ConfWinTop%d", cfg_confWinTop, 0, MAX_LAYERS, "Top offset for window conformance mode 3")1109 ("ConfWinBottom%d", cfg_confWinBottom, 0, MAX_LAYERS, "Bottom offset for window conformance mode 3")1110 ("HorizontalPadding%d,-pdx%d", cfg_aiPadX, 0, MAX_LAYERS, "Horizontal source padding for conformance window mode 2")1111 ("VerticalPadding%d,-pdy%d", cfg_aiPadY, 0, MAX_LAYERS, "Vertical source padding for conformance window mode 2")1112 ("ScalabilityMask1", m_scalabilityMask[VIEW_ORDER_INDEX], 1113 ("ScalabilityMask2", m_scalabilityMask[SCALABILITY_ID], 1134 ("AuxId%d", cfg_auxId, 0, m_numLayers, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") 1135 #endif 1136 ("ExtendedPrecision%d", cfg_useExtendedPrecision, false, m_numLayers, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)") 1137 ("ConformanceMode%d", cfg_conformanceMode, 0, m_numLayers, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 1138 ("ConfLeft%d", cfg_confWinLeft, 0, m_numLayers, "Deprecated alias of ConfWinLeft") 1139 ("ConfRight%d", cfg_confWinRight, 0, m_numLayers, "Deprecated alias of ConfWinRight") 1140 ("ConfTop%d", cfg_confWinTop, 0, m_numLayers, "Deprecated alias of ConfWinTop") 1141 ("ConfBottom%d", cfg_confWinBottom, 0, m_numLayers, "Deprecated alias of ConfWinBottom") 1142 ("ConfWinLeft%d", cfg_confWinLeft, 0, m_numLayers, "Left offset for window conformance mode 3") 1143 ("ConfWinRight%d", cfg_confWinRight, 0, m_numLayers, "Right offset for window conformance mode 3") 1144 ("ConfWinTop%d", cfg_confWinTop, 0, m_numLayers, "Top offset for window conformance mode 3") 1145 ("ConfWinBottom%d", cfg_confWinBottom, 0, m_numLayers, "Bottom offset for window conformance mode 3") 1146 ("HorizontalPadding%d,-pdx%d", cfg_aiPadX, 0, m_numLayers, "Horizontal source padding for conformance window mode 2") 1147 ("VerticalPadding%d,-pdy%d", cfg_aiPadY, 0, m_numLayers, "Vertical source padding for conformance window mode 2") 1148 ("ScalabilityMask1", m_scalabilityMask[VIEW_ORDER_INDEX], 0, "scalability_mask[1] (multiview)") 1149 ("ScalabilityMask2", m_scalabilityMask[SCALABILITY_ID], 1, "scalability_mask[2] (scalable)" ) 1114 1150 #if AUXILIARY_PICTURES 1115 ("ScalabilityMask3", m_scalabilityMask[AUX_ID], 1116 #endif 1117 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name")1118 ("NumRefLocationOffsets%d", cfg_numRefLayerLocationOffsets, 0, MAX_LAYERS, "Number of reference layer offset sets ")1119 ("RefLocationOffsetLayerId%d", cfg_refLocationOffsetLayerIdPtr, string(""), MAX_LAYERS, "Layer ID of reference location offset")1120 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"1151 ("ScalabilityMask3", m_scalabilityMask[AUX_ID], 0, "scalability_mask[3] (auxiliary pictures)" ) 1152 #endif 1153 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 1154 ("NumRefLocationOffsets%d", cfg_numRefLayerLocationOffsets, 0, m_numLayers, "Number of reference layer offset sets ") 1155 ("RefLocationOffsetLayerId%d", cfg_refLocationOffsetLayerIdPtr, string(""), m_numLayers, "Layer ID of reference location offset") 1156 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), m_numLayers, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" 1121 1157 " top-left luma sample of the EL picture, in units of two luma samples") 1122 ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of top-left luma sample of scaled base layer picture with respect to"1158 ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffsetPtr, string(""), m_numLayers, "Vertical offset of top-left luma sample of scaled base layer picture with respect to" 1123 1159 " top-left luma sample of the EL picture, in units of two luma samples") 1124 ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to"1160 ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffsetPtr, string(""), m_numLayers, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to" 1125 1161 " bottom-right luma sample of the EL picture, in units of two luma samples") 1126 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"1162 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), m_numLayers, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 1127 1163 " bottom-right luma sample of the EL picture, in units of two luma samples") 1128 ("ScaledRefLayerOffsetPresentFlag%d", cfg_scaledRefLayerOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of scaled reference layer offsets")1129 ("RefRegionOffsetPresentFlag%d", cfg_refRegionOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of reference region offsets")1130 ("RefRegionLeftOffset%d", cfg_refRegionLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of ref region with respect to"1164 ("ScaledRefLayerOffsetPresentFlag%d", cfg_scaledRefLayerOffsetPresentFlagPtr,string(""), m_numLayers, "presense flag of scaled reference layer offsets") 1165 ("RefRegionOffsetPresentFlag%d", cfg_refRegionOffsetPresentFlagPtr,string(""), m_numLayers, "presense flag of reference region offsets") 1166 ("RefRegionLeftOffset%d", cfg_refRegionLeftOffsetPtr, string(""), m_numLayers, "Horizontal offset of top-left luma sample of ref region with respect to" 1131 1167 " top-left luma sample of the BL picture, in units of two luma samples") 1132 ("RefRegionTopOffset%d", cfg_refRegionTopOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of top-left luma sample of ref region with respect to"1168 ("RefRegionTopOffset%d", cfg_refRegionTopOffsetPtr, string(""), m_numLayers, "Vertical offset of top-left luma sample of ref region with respect to" 1133 1169 " top-left luma sample of the BL picture, in units of two luma samples") 1134 ("RefRegionRightOffset%d", cfg_refRegionRightOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of bottom-right luma sample of ref region with respect to"1170 ("RefRegionRightOffset%d", cfg_refRegionRightOffsetPtr, string(""), m_numLayers, "Horizontal offset of bottom-right luma sample of ref region with respect to" 1135 1171 " bottom-right luma sample of the BL picture, in units of two luma samples") 1136 ("RefRegionBottomOffset%d", cfg_refRegionBottomOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of ref region with respect to"1172 ("RefRegionBottomOffset%d", cfg_refRegionBottomOffsetPtr, string(""), m_numLayers, "Vertical offset of bottom-right luma sample of ref region with respect to" 1137 1173 " bottom-right luma sample of the BL picture, in units of two luma samples") 1138 ("ResamplePhaseSetPresentFlag%d", cfg_resamplePhaseSetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of resample phase set")1139 ("PhaseHorLuma%d", cfg_phaseHorLumaPtr, string(""), MAX_LAYERS, "luma shift in the horizontal direction used in resampling proces")1140 ("PhaseVerLuma%d", cfg_phaseVerLumaPtr, string(""), MAX_LAYERS, "luma shift in the vertical direction used in resampling proces")1141 ("PhaseHorChroma%d", cfg_phaseHorChromaPtr, string(""), MAX_LAYERS, "chroma shift in the horizontal direction used in resampling proces")1142 ("PhaseVerChroma%d", cfg_phaseVerChromaPtr, string(""), MAX_LAYERS, "chroma shift in the vertical direction used in resampling proces")1174 ("ResamplePhaseSetPresentFlag%d", cfg_resamplePhaseSetPresentFlagPtr,string(""), m_numLayers, "presense flag of resample phase set") 1175 ("PhaseHorLuma%d", cfg_phaseHorLumaPtr, string(""), m_numLayers, "luma shift in the horizontal direction used in resampling proces") 1176 ("PhaseVerLuma%d", cfg_phaseVerLumaPtr, string(""), m_numLayers, "luma shift in the vertical direction used in resampling proces") 1177 ("PhaseHorChroma%d", cfg_phaseHorChromaPtr, string(""), m_numLayers, "chroma shift in the horizontal direction used in resampling proces") 1178 ("PhaseVerChroma%d", cfg_phaseVerChromaPtr, string(""), m_numLayers, "chroma shift in the vertical direction used in resampling proces") 1143 1179 #if Q0074_COLOUR_REMAPPING_SEI 1144 ("SEIColourRemappingInfoFileRoot%d", cfg_colourRemapSEIFileRoot, string(""), MAX_LAYERS, "Colour Remapping Information SEI parameters file name for layer %d")1145 #endif 1146 ("InputBitDepth%d", cfg_InputBitDepth[CHANNEL_TYPE_LUMA], 8, MAX_LAYERS, "Bit-depth of input file for layer %d")1147 ("InternalBitDepth%d", cfg_InternalBitDepth[CHANNEL_TYPE_LUMA], 0, MAX_LAYERS, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d "1180 ("SEIColourRemappingInfoFileRoot%d", cfg_colourRemapSEIFileRoot, string(""), m_numLayers, "Colour Remapping Information SEI parameters file name for layer %d") 1181 #endif 1182 ("InputBitDepth%d", cfg_InputBitDepth[CHANNEL_TYPE_LUMA], 8, m_numLayers, "Bit-depth of input file for layer %d") 1183 ("InternalBitDepth%d", cfg_InternalBitDepth[CHANNEL_TYPE_LUMA], 0, m_numLayers, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d " 1148 1184 " If different to InputBitDepth, source data will be converted") 1149 ("OutputBitDepth%d", cfg_OutputBitDepth[CHANNEL_TYPE_LUMA], 0, MAX_LAYERS, "Bit-depth of output file (default:InternalBitDepth)")1150 ("InputBitDepthC%d", cfg_InputBitDepth[CHANNEL_TYPE_CHROMA], 0, MAX_LAYERS, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d")1151 ("InternalBitDepthC%d", cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA], 0, MAX_LAYERS, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d")1152 ("OutputBitDepthC%d", cfg_OutputBitDepth[CHANNEL_TYPE_CHROMA], 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")1185 ("OutputBitDepth%d", cfg_OutputBitDepth[CHANNEL_TYPE_LUMA], 0, m_numLayers, "Bit-depth of output file (default:InternalBitDepth)") 1186 ("InputBitDepthC%d", cfg_InputBitDepth[CHANNEL_TYPE_CHROMA], 0, m_numLayers, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d") 1187 ("InternalBitDepthC%d", cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA],0, m_numLayers, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d") 1188 ("OutputBitDepthC%d", cfg_OutputBitDepth[CHANNEL_TYPE_CHROMA], 0, m_numLayers, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 1153 1189 1154 1190 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, false, "max_tid_ref_present_flag (0: not present, 1: present) " ) 1155 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 7, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction")1191 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 7, m_numLayers, "allowed maximum temporal_id for inter-layer prediction") 1156 1192 ("CrossLayerPictureTypeAlignFlag", m_crossLayerPictureTypeAlignFlag, true, "align picture type across layers" ) 1157 1193 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 1158 1194 ("CrossLayerAlignedIdrOnlyFlag", m_crossLayerAlignedIdrOnlyFlag, true, "only idr for IRAP across layers" ) 1159 ("InterLayerWeightedPred", m_useInterLayerWeightedPred, 1195 ("InterLayerWeightedPred", m_useInterLayerWeightedPred, false, "enable IL WP parameters estimation at encoder" ) 1160 1196 #if AVC_BASE 1161 ("NonHEVCBase,-nonhevc", m_nonHEVCBaseLayerFlag, 1162 ("InputBLFile,-ibl", cfg_BLInputFile, 1197 ("NonHEVCBase,-nonhevc", m_nonHEVCBaseLayerFlag, 0, "BL is available but not internal") 1198 ("InputBLFile,-ibl", cfg_BLInputFile, string(""), "Base layer rec YUV input file name") 1163 1199 #endif 1164 1200 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") … … 1234 1270 ("IntraConstraintFlag", tmpIntraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1235 1271 ("OnePictureOnlyConstraintFlag", tmpOnePictureOnlyConstraintFlag, false, "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1236 ("LowerBitRateConstraintFlag", tmpLowerBitRateConstraintFlag, 1237 1238 ("ProfileCompatibility%d", 1239 ("ProgressiveSource%d", 1240 ("InterlacedSource%d", 1241 ("NonPackedSource%d", 1242 ("FrameOnly%d", 1272 ("LowerBitRateConstraintFlag", tmpLowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 1273 1274 ("ProfileCompatibility%d", m_profileCompatibility, Profile::NONE, (MAX_NUM_LAYER_IDS + 1), "Compatible profile to be used when encoding") 1275 ("ProgressiveSource%d", m_progressiveSourceFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that source is progressive") 1276 ("InterlacedSource%d", m_interlacedSourceFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that source is interlaced") 1277 ("NonPackedSource%d", m_nonPackedConstraintFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that source does not contain frame packing") 1278 ("FrameOnly%d", m_frameOnlyConstraintFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that the bitstream contains only frames") 1243 1279 1244 ("LayerPTLIndex%d", cfg_layerPTLIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Index of PTL for each layer")1245 ("ListOfProfileTierLevelOls%d", 1280 ("LayerPTLIndex%d", cfg_layerPTLIdx, 0, m_numLayers, "Index of PTL for each layer") 1281 ("ListOfProfileTierLevelOls%d", cfg_listOfLayerPTLOfOlss, string(""), MAX_VPS_OUTPUT_LAYER_SETS_PLUS1, "PTL Index for each layer in each OLS except the first OLS. The PTL index for layer in the first OLS is set to 1") 1246 1282 1247 1283 // Unit definition parameters 1248 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width")1249 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height")1284 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, m_numLayers, "Maximum CU width") 1285 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, m_numLayers, "Maximum CU height") 1250 1286 // todo: remove defaults from MaxCUSize 1251 ("MaxCUSize%d,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size")1252 ("MaxCUSize%d,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size")1253 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth")1254 1255 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 5u, MAX_LAYERS, "Maximum TU size in logarithm base 2")1256 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")1287 ("MaxCUSize%d,s", cfg_uiMaxCUWidth, 64u, m_numLayers, "Maximum CU size") 1288 ("MaxCUSize%d,s", cfg_uiMaxCUHeight, 64u, m_numLayers, "Maximum CU size") 1289 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, m_numLayers, "CU depth") 1290 1291 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 5u, m_numLayers, "Maximum TU size in logarithm base 2") 1292 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, m_numLayers, "Minimum TU size in logarithm base 2") 1257 1293 1258 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 3u, MAX_LAYERS, "Depth of TU tree for intra CUs")1259 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 3u, MAX_LAYERS, "Depth of TU tree for inter CUs")1294 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 3u, m_numLayers, "Depth of TU tree for intra CUs") 1295 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 3u, m_numLayers, "Depth of TU tree for inter CUs") 1260 1296 #else 1261 1297 ("Profile", extendedProfile, NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none") … … 1291 1327 // Coding structure paramters 1292 1328 #if SVC_EXTENSION 1293 ("IntraPeriod%d,-ip%d", cfg_IntraPeriod, -1, MAX_LAYERS, "intra period in frames for layer %d, (-1: only first frame)")1329 ("IntraPeriod%d,-ip%d", cfg_IntraPeriod, -1, m_numLayers, "intra period in frames for layer %d, (-1: only first frame)") 1294 1330 #else 1295 1331 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") … … 1310 1346 1311 1347 #if SVC_EXTENSION 1312 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d")1348 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") 1313 1349 #else 1314 1350 // Mode decision parameters … … 1325 1361 /* Quantization parameters */ 1326 1362 #if SVC_EXTENSION 1327 ("QP%d,-q%d", cfg_fQP, 30.0, MAX_LAYERS, "Qp value for layer %d, if value is float, QP is switched once during encoding")1363 ("QP%d,-q%d", cfg_fQP, 30.0, m_numLayers, "Qp value for layer %d, if value is float, QP is switched once during encoding") 1328 1364 #else 1329 1365 ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding") … … 1332 1368 ("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block") 1333 1369 #if SVC_EXTENSION 1334 ("MaxCuDQPDepth%d,-dqd", cfg_maxCuDQPDepth, 0, MAX_LAYERS, "max depth for a minimum CuDQP")1370 ("MaxCuDQPDepth%d,-dqd", cfg_maxCuDQPDepth, 0, m_numLayers, "max depth for a minimum CuDQP") 1335 1371 #else 1336 1372 ("MaxCuDQPDepth,-dqd", m_iMaxCuDQPDepth, 0, "max depth for a minimum CuDQP") … … 1413 1449 ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") 1414 1450 //deprecated copies of renamed tile parameters 1415 ("UniformSpacingIdc", m_tileUniformSpacingFlag, false, 1451 ("UniformSpacingIdc", m_tileUniformSpacingFlag, false, "deprecated alias of TileUniformSpacing") 1416 1452 ("ColumnWidthArray", cfg_ColumnWidth, cfg_ColumnWidth, "deprecated alias of TileColumnWidthArray") 1417 1453 ("RowHeightArray", cfg_RowHeight, cfg_RowHeight, "deprecated alias of TileRowHeightArray") 1418 1454 1419 ("TileUniformSpacing", m_tileUniformSpacingFlag, false, 1420 ("NumTileColumnsMinus1", m_numTileColumnsMinus1, 0, 1421 ("NumTileRowsMinus1", m_numTileRowsMinus1, 0, 1455 ("TileUniformSpacing", m_tileUniformSpacingFlag, false, "Indicates that tile columns and rows are distributed uniformly") 1456 ("NumTileColumnsMinus1", m_numTileColumnsMinus1, 0, "Number of tile columns in a picture minus 1") 1457 ("NumTileRowsMinus1", m_numTileRowsMinus1, 0, "Number of rows in a picture minus 1") 1422 1458 ("TileColumnWidthArray", cfg_ColumnWidth, cfg_ColumnWidth, "Array containing tile column width values in units of CTU") 1423 1459 ("TileRowHeightArray", cfg_RowHeight, cfg_RowHeight, "Array containing tile row height values in units of CTU") 1424 1460 ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") 1425 1461 #if SVC_EXTENSION 1426 ("WaveFrontSynchro%d", cfg_waveFrontSynchro, 0, MAX_LAYERS,"0: no synchro; 1 synchro with TR; 2 TRR etc")1462 ("WaveFrontSynchro%d", cfg_waveFrontSynchro, 0, m_numLayers, "0: no synchro; 1 synchro with TR; 2 TRR etc") 1427 1463 #else 1428 1464 ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with top-right-right") … … 1448 1484 #endif 1449 1485 #if RC_SHVC_HARMONIZATION 1450 ("RateControl%d", cfg_RCEnableRateControl, false, MAX_LAYERS, "Rate control: enable rate control for layer %d")1451 ("TargetBitrate%d", cfg_RCTargetBitRate, 0, MAX_LAYERS, "Rate control: target bitrate for layer %d")1452 ("KeepHierarchicalBit%d", cfg_RCKeepHierarchicalBit, false, MAX_LAYERS, "Rate control: keep hierarchical bit allocation for layer %d")1453 ("LCULevelRateControl%d", cfg_RCLCULevelRC, true, MAX_LAYERS, "Rate control: LCU level RC")1454 ("RCLCUSeparateModel%d", cfg_RCUseLCUSeparateModel, true, MAX_LAYERS, "Rate control: Use LCU level separate R-lambda model")1455 ("InitialQP%d", cfg_RCInitialQP, 0, MAX_LAYERS, "Rate control: initial QP")1456 ("RCForceIntraQP%d", cfg_RCForceIntraQP, false, MAX_LAYERS, "Rate control: force intra QP to be equal to initial QP")1486 ("RateControl%d", cfg_RCEnableRateControl, false, m_numLayers, "Rate control: enable rate control for layer %d") 1487 ("TargetBitrate%d", cfg_RCTargetBitRate, 0, m_numLayers, "Rate control: target bitrate for layer %d") 1488 ("KeepHierarchicalBit%d", cfg_RCKeepHierarchicalBit, false, m_numLayers, "Rate control: keep hierarchical bit allocation for layer %d") 1489 ("LCULevelRateControl%d", cfg_RCLCULevelRC, true, m_numLayers, "Rate control: LCU level RC") 1490 ("RCLCUSeparateModel%d", cfg_RCUseLCUSeparateModel, true, m_numLayers, "Rate control: Use LCU level separate R-lambda model") 1491 ("InitialQP%d", cfg_RCInitialQP, 0, m_numLayers, "Rate control: initial QP") 1492 ("RCForceIntraQP%d", cfg_RCForceIntraQP, false, m_numLayers, "Rate control: force intra QP to be equal to initial QP") 1457 1493 #else 1458 1494 ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) … … 1676 1712 ("SEITemporalMotionVectorPredictionConstraints", m_TMVPConstraintsSEIEnabled, 0, "Control generation of TMVP constrants SEI message") 1677 1713 #endif 1678 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)")1679 ("LayerSwitchOffBegin%d", cfg_layerSwitchOffBegin, 0, MAX_LAYERS, "Switch layer %d off after given poc")1680 ("LayerSwitchOffEnd%d", cfg_layerSwitchOffEnd, 0, MAX_LAYERS, "Switch layer %d on at given poc")1681 ("SkipPictureAtArcSwitch", m_skipPictureAtArcSwitch, false, "Code the higher layer picture in ARC up-switching as a skip picture. (0: disable)")1714 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") 1715 ("LayerSwitchOffBegin%d", cfg_layerSwitchOffBegin, 0, m_numLayers, "Switch layer %d off after given poc") 1716 ("LayerSwitchOffEnd%d", cfg_layerSwitchOffEnd, 0, m_numLayers, "Switch layer %d on at given poc") 1717 ("SkipPictureAtArcSwitch", m_skipPictureAtArcSwitch, false, "Code the higher layer picture in ARC up-switching as a skip picture. (0: disable)") 1682 1718 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1683 ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message")1684 ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets")1685 ("TileSetsArray", cfg_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ")1686 #endif 1687 ("AltOutputLayerFlag", m_altOutputLayerFlag, false, "Specifies the value of alt_output_layer_flag in VPS extension")1688 ("CrossLayerBLAFlag", m_crossLayerBLAFlag, false, "Specifies the value of cross_layer_bla_flag in VPS")1719 ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message") 1720 ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets") 1721 ("TileSetsArray", cfg_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ") 1722 #endif 1723 ("AltOutputLayerFlag", m_altOutputLayerFlag, false, "Specifies the value of alt_output_layer_flag in VPS extension") 1724 ("CrossLayerBLAFlag", m_crossLayerBLAFlag, false, "Specifies the value of cross_layer_bla_flag in VPS") 1689 1725 #if CGS_3D_ASYMLUT 1690 ("CGS", m_nCGSFlag, 0, "whether CGS is enabled")1691 ("CGSMaxOctantDepth", m_nCGSMaxOctantDepth, 1, "max octant depth")1692 ("CGSMaxYPartNumLog", m_nCGSMaxYPartNumLog2, 2, "max Y part number ")1693 ("CGSLUTBit", m_nCGSLUTBit, 12, "bit depth of CGS LUT")1694 ("CGSAdaptC", m_nCGSAdaptiveChroma, 1, "adaptive chroma partition (only for the case of two chroma partitions)")1726 ("CGS", m_nCGSFlag, 0, "whether CGS is enabled") 1727 ("CGSMaxOctantDepth", m_nCGSMaxOctantDepth, 1, "max octant depth") 1728 ("CGSMaxYPartNumLog", m_nCGSMaxYPartNumLog2, 2, "max Y part number ") 1729 ("CGSLUTBit", m_nCGSLUTBit, 12, "bit depth of CGS LUT") 1730 ("CGSAdaptC", m_nCGSAdaptiveChroma, 1, "adaptive chroma partition (only for the case of two chroma partitions)") 1695 1731 #if R0179_ENC_OPT_3DLUT_SIZE 1696 ("CGSSizeRDO", m_nCGSLutSizeRDO, 0, "RDOpt selection of best table size (effective when large maximum table size such as 8x8x8 is used)")1697 #endif 1698 #endif 1699 ("InheritCodingStruct%d", m_inheritCodingStruct, 0, MAX_LAYERS, "Predicts the GOP structure of one layer for another layer")1732 ("CGSSizeRDO", m_nCGSLutSizeRDO, 0, "RDOpt selection of best table size (effective when large maximum table size such as 8x8x8 is used)") 1733 #endif 1734 #endif 1735 ("InheritCodingStruct%d", m_inheritCodingStruct, 0, m_numLayers, "Predicts the GOP structure of one layer for another layer") 1700 1736 #endif //SVC_EXTENSION 1701 1737 ; … … 1709 1745 1710 1746 #if SVC_EXTENSION 1711 for (Int i=1; i< MAX_LAYERS; i++)1747 for (Int i=1; i<m_numLayers; i++) 1712 1748 { 1713 1749 for(Int j=1; j<MAX_GOP+1; j++) … … 1725 1761 1726 1762 #if SVC_EXTENSION 1727 for (Int i=1; i< MAX_LAYERS; i++)1763 for (Int i=1; i<m_numLayers; i++) 1728 1764 { 1729 1765 if(m_inheritCodingStruct[i] == 0) … … 1795 1831 { 1796 1832 #if SVC_EXTENSION 1797 for(Int layer = 0; layer < MAX_LAYERS; layer++)1833 for(Int layer = 0; layer < m_numLayers; layer++) 1798 1834 { 1799 1835 //Frame height 1800 m_a cLayerCfg[layer].m_iSourceHeightOrg = m_acLayerCfg[layer].m_iSourceHeight;1836 m_apcLayerCfg[layer]->m_iSourceHeightOrg = m_apcLayerCfg[layer]->m_iSourceHeight; 1801 1837 //Field height 1802 m_a cLayerCfg[layer].m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight >> 1;1838 m_apcLayerCfg[layer]->m_iSourceHeight = m_apcLayerCfg[layer]->m_iSourceHeight >> 1; 1803 1839 } 1804 1840 #else … … 1870 1906 /* rules for input, output and internal bitdepths as per help text */ 1871 1907 #if SVC_EXTENSION 1872 for( Int layer = 0; layer < MAX_LAYERS; layer++ )1873 { 1874 if( m_a cLayerCfg[layer].m_layerId < 0 )1875 { 1876 m_a cLayerCfg[layer].m_layerId = layer;1877 } 1878 1879 m_a cLayerCfg[layer].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] = m_acLayerCfg[layer].m_inputBitDepth [CHANNEL_TYPE_LUMA ];1880 m_a cLayerCfg[layer].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ];1881 1882 if (m_a cLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_LUMA ] == 0) { m_acLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_LUMA ] = m_acLayerCfg[layer].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ]; }1883 if (m_a cLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_acLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_LUMA ]; }1884 if (m_a cLayerCfg[layer].m_inputBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_acLayerCfg[layer].m_inputBitDepth [CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_inputBitDepth [CHANNEL_TYPE_LUMA ]; }1885 if (m_a cLayerCfg[layer].m_outputBitDepth [CHANNEL_TYPE_LUMA ] == 0) { m_acLayerCfg[layer].m_outputBitDepth [CHANNEL_TYPE_LUMA ] = m_acLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_LUMA ]; }1886 if (m_a cLayerCfg[layer].m_outputBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_acLayerCfg[layer].m_outputBitDepth [CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth [CHANNEL_TYPE_CHROMA]; }1887 1888 m_a cLayerCfg[layer].m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);1889 m_a cLayerCfg[layer].m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_acLayerCfg[layer].m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));1890 1891 m_a cLayerCfg[layer].m_highPrecisionOffsetsEnabledFlag = false;1892 m_a cLayerCfg[layer].m_extendedPrecisionProcessingFlag = false;1893 1894 if( m_a cLayerCfg[layer].m_layerSwitchOffBegin < m_acLayerCfg[layer].m_layerSwitchOffEnd )1895 { 1896 if( m_iGOPSize > 0 && (m_a cLayerCfg[layer].m_layerSwitchOffBegin % m_iGOPSize) != 0 )1908 for( Int layer = 0; layer < m_numLayers; layer++ ) 1909 { 1910 if( m_apcLayerCfg[layer]->m_layerId < 0 ) 1911 { 1912 m_apcLayerCfg[layer]->m_layerId = layer; 1913 } 1914 1915 m_apcLayerCfg[layer]->m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] = m_apcLayerCfg[layer]->m_inputBitDepth [CHANNEL_TYPE_LUMA ]; 1916 m_apcLayerCfg[layer]->m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layer]->m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ]; 1917 1918 if (m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_LUMA ] == 0) { m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_LUMA ] = m_apcLayerCfg[layer]->m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ]; } 1919 if (m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_LUMA ]; } 1920 if (m_apcLayerCfg[layer]->m_inputBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_apcLayerCfg[layer]->m_inputBitDepth [CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layer]->m_inputBitDepth [CHANNEL_TYPE_LUMA ]; } 1921 if (m_apcLayerCfg[layer]->m_outputBitDepth [CHANNEL_TYPE_LUMA ] == 0) { m_apcLayerCfg[layer]->m_outputBitDepth [CHANNEL_TYPE_LUMA ] = m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_LUMA ]; } 1922 if (m_apcLayerCfg[layer]->m_outputBitDepth [CHANNEL_TYPE_CHROMA] == 0) { m_apcLayerCfg[layer]->m_outputBitDepth [CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layer]->m_internalBitDepth [CHANNEL_TYPE_CHROMA]; } 1923 1924 m_apcLayerCfg[layer]->m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat); 1925 m_apcLayerCfg[layer]->m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_apcLayerCfg[layer]->m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat))); 1926 1927 m_apcLayerCfg[layer]->m_highPrecisionOffsetsEnabledFlag = false; 1928 m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag = false; 1929 1930 if( m_apcLayerCfg[layer]->m_layerSwitchOffBegin < m_apcLayerCfg[layer]->m_layerSwitchOffEnd ) 1931 { 1932 if( m_iGOPSize > 0 && (m_apcLayerCfg[layer]->m_layerSwitchOffBegin % m_iGOPSize) != 0 ) 1897 1933 { 1898 1934 printf("LayerSwitchOffBegin%d: Must be multiple of GOP size.\n", layer); 1899 1935 exit(EXIT_FAILURE); 1900 1936 } 1901 if( m_a cLayerCfg[layer].m_iIntraPeriod > 0 && (m_acLayerCfg[layer].m_layerSwitchOffEnd % m_acLayerCfg[layer].m_iIntraPeriod) != 0 )1937 if( m_apcLayerCfg[layer]->m_iIntraPeriod > 0 && (m_apcLayerCfg[layer]->m_layerSwitchOffEnd % m_apcLayerCfg[layer]->m_iIntraPeriod) != 0 ) 1902 1938 { 1903 1939 printf("LayerSwitchOffEnd%d: Must be IRAP picture.\n", layer); … … 1906 1942 } 1907 1943 1908 m_a cLayerCfg[layer].m_bitDepthConstraint = tmpBitDepthConstraint;1909 m_a cLayerCfg[layer].m_intraConstraintFlag = tmpIntraConstraintFlag;1910 m_a cLayerCfg[layer].m_lowerBitRateConstraintFlag = tmpLowerBitRateConstraintFlag;1944 m_apcLayerCfg[layer]->m_bitDepthConstraint = tmpBitDepthConstraint; 1945 m_apcLayerCfg[layer]->m_intraConstraintFlag = tmpIntraConstraintFlag; 1946 m_apcLayerCfg[layer]->m_lowerBitRateConstraintFlag = tmpLowerBitRateConstraintFlag; 1911 1947 1912 1948 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 1913 1949 { 1914 m_a cLayerCfg[layer].m_log2SaoOffsetScale[channelType] = 0;1950 m_apcLayerCfg[layer]->m_log2SaoOffsetScale[channelType] = 0; 1915 1951 } 1916 1952 1917 Int layerPTLIdx = m_a cLayerCfg[layer].m_layerPTLIdx;1953 Int layerPTLIdx = m_apcLayerCfg[layer]->m_layerPTLIdx; 1918 1954 1919 1955 if( extendedProfile[layerPTLIdx] >= 1000 && extendedProfile[layerPTLIdx] <= 2316 ) … … 1921 1957 m_profileList[layerPTLIdx] = Profile::MAINREXT; 1922 1958 1923 if( m_a cLayerCfg[layer].m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0)1959 if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0) 1924 1960 { 1925 1961 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 1926 1962 exit(EXIT_FAILURE); 1927 1963 } 1928 m_a cLayerCfg[layer].m_bitDepthConstraint = (extendedProfile[layerPTLIdx]%100);1929 m_a cLayerCfg[layer].m_intraConstraintFlag = (extendedProfile[layerPTLIdx]>=2000);1964 m_apcLayerCfg[layer]->m_bitDepthConstraint = (extendedProfile[layerPTLIdx]%100); 1965 m_apcLayerCfg[layer]->m_intraConstraintFlag = (extendedProfile[layerPTLIdx]>=2000); 1930 1966 switch ((extendedProfile[layerPTLIdx]/100)%10) 1931 1967 { … … 1948 1984 if( m_profileList[layerPTLIdx] == Profile::HIGHTHROUGHPUTREXT ) 1949 1985 { 1950 if( m_a cLayerCfg[layer].m_bitDepthConstraint == 0 ) m_acLayerCfg[layer].m_bitDepthConstraint = 16;1951 m_a cLayerCfg[layer].m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat);1986 if( m_apcLayerCfg[layer]->m_bitDepthConstraint == 0 ) m_apcLayerCfg[layer]->m_bitDepthConstraint = 16; 1987 m_apcLayerCfg[layer]->m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat); 1952 1988 } 1953 1989 else if( m_profileList[layerPTLIdx] == Profile::MAINREXT ) 1954 1990 { 1955 if( m_a cLayerCfg[layer].m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0 )1991 if( m_apcLayerCfg[layer]->m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0 ) 1956 1992 { 1957 1993 // produce a valid combination, if possible. … … 1964 2000 m_log2MaxTransformSkipBlockSize!=2; 1965 2001 const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0; 1966 const Bool bUsingExtendedPrecision = m_a cLayerCfg[layer].m_extendedPrecisionProcessingFlag;1967 m_a cLayerCfg[layer].m_chromaFormatConstraint = NUM_CHROMA_FORMAT;2002 const Bool bUsingExtendedPrecision = m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag; 2003 m_apcLayerCfg[layer]->m_chromaFormatConstraint = NUM_CHROMA_FORMAT; 1968 2004 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 1969 2005 bUsingChromaQPAdjustment, 1970 2006 bUsingExtendedPrecision, 1971 m_a cLayerCfg[layer].m_intraConstraintFlag,1972 m_a cLayerCfg[layer].m_bitDepthConstraint,1973 m_a cLayerCfg[layer].m_chromaFormatConstraint,1974 m_a cLayerCfg[layer].m_chromaFormatIDC==CHROMA_400 ? m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]),1975 m_a cLayerCfg[layer].m_chromaFormatIDC);1976 } 1977 else if( m_a cLayerCfg[layer].m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0)2007 m_apcLayerCfg[layer]->m_intraConstraintFlag, 2008 m_apcLayerCfg[layer]->m_bitDepthConstraint, 2009 m_apcLayerCfg[layer]->m_chromaFormatConstraint, 2010 m_apcLayerCfg[layer]->m_chromaFormatIDC==CHROMA_400 ? m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]), 2011 m_apcLayerCfg[layer]->m_chromaFormatIDC); 2012 } 2013 else if( m_apcLayerCfg[layer]->m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0) 1978 2014 { 1979 2015 fprintf(stderr, "Error: The bit depth and chroma format constraints must either both be specified or both be configured automatically\n"); … … 1982 2018 else 1983 2019 { 1984 m_a cLayerCfg[layer].m_chromaFormatConstraint = numberToChromaFormat(tmpConstraintChromaFormat);2020 m_apcLayerCfg[layer]->m_chromaFormatConstraint = numberToChromaFormat(tmpConstraintChromaFormat); 1985 2021 } 1986 2022 } 1987 2023 else 1988 2024 { 1989 m_a cLayerCfg[layer].m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_acLayerCfg[layer].m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat);1990 m_a cLayerCfg[layer].m_bitDepthConstraint = (m_profileList[layerPTLIdx] == Profile::MAIN10 || m_profileList[layerPTLIdx] == Profile::SCALABLEMAIN10) ? 10 : 8;2025 m_apcLayerCfg[layer]->m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_apcLayerCfg[layer]->m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat); 2026 m_apcLayerCfg[layer]->m_bitDepthConstraint = (m_profileList[layerPTLIdx] == Profile::MAIN10 || m_profileList[layerPTLIdx] == Profile::SCALABLEMAIN10) ? 10 : 8; 1991 2027 } 1992 2028 } … … 2115 2151 2116 2152 #if SVC_EXTENSION 2117 for(Int layer = 0; layer < MAX_LAYERS; layer++)2153 for(Int layer = 0; layer < m_numLayers; layer++) 2118 2154 { 2119 2155 // If number of scaled ref. layer offsets is non-zero, at least one of the offsets should be specified 2120 if(m_a cLayerCfg[layer].m_numRefLayerLocationOffsets)2156 if(m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets) 2121 2157 { 2122 2158 assert( strcmp(cfg_refLocationOffsetLayerId[layer].c_str(), "")); … … 2147 2183 if(strcmp(cfg_refLocationOffsetLayerId[layer].c_str(), "")) 2148 2184 { 2149 cfgStringToArray( &tempArray, cfg_refLocationOffsetLayerId[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefLocationOffsetLayerId");2185 cfgStringToArray( &tempArray, cfg_refLocationOffsetLayerId[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefLocationOffsetLayerId"); 2150 2186 if(tempArray) 2151 2187 { 2152 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2188 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2153 2189 { 2154 m_a cLayerCfg[layer].m_refLocationOffsetLayerId[i] = tempArray[i];2190 m_apcLayerCfg[layer]->m_refLocationOffsetLayerId[i] = tempArray[i]; 2155 2191 } 2156 2192 delete [] tempArray; tempArray = NULL; … … 2161 2197 if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(), "")) 2162 2198 { 2163 cfgStringToArray( &tempArray, cfg_scaledRefLayerOffsetPresentFlag[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "ScaledRefLayerOffsetPresentFlag");2199 cfgStringToArray( &tempArray, cfg_scaledRefLayerOffsetPresentFlag[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "ScaledRefLayerOffsetPresentFlag"); 2164 2200 if(tempArray) 2165 2201 { 2166 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2202 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2167 2203 { 2168 m_a cLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] = tempArray[i];2204 m_apcLayerCfg[layer]->m_scaledRefLayerOffsetPresentFlag[i] = tempArray[i]; 2169 2205 } 2170 2206 delete [] tempArray; tempArray = NULL; … … 2175 2211 if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "")) 2176 2212 { 2177 cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "LeftOffset");2213 cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "LeftOffset"); 2178 2214 if(tempArray) 2179 2215 { 2180 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2216 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2181 2217 { 2182 m_a cLayerCfg[layer].m_scaledRefLayerLeftOffset[i] = tempArray[i];2218 m_apcLayerCfg[layer]->m_scaledRefLayerLeftOffset[i] = tempArray[i]; 2183 2219 } 2184 2220 delete [] tempArray; tempArray = NULL; … … 2189 2225 if(strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "")) 2190 2226 { 2191 cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "TopOffset");2227 cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "TopOffset"); 2192 2228 if(tempArray) 2193 2229 { 2194 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2230 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2195 2231 { 2196 m_a cLayerCfg[layer].m_scaledRefLayerTopOffset[i] = tempArray[i];2232 m_apcLayerCfg[layer]->m_scaledRefLayerTopOffset[i] = tempArray[i]; 2197 2233 } 2198 2234 delete [] tempArray; tempArray = NULL; … … 2203 2239 if(strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "")) 2204 2240 { 2205 cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RightOffset");2241 cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RightOffset"); 2206 2242 if(tempArray) 2207 2243 { 2208 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2244 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2209 2245 { 2210 m_a cLayerCfg[layer].m_scaledRefLayerRightOffset[i] = tempArray[i];2246 m_apcLayerCfg[layer]->m_scaledRefLayerRightOffset[i] = tempArray[i]; 2211 2247 } 2212 2248 delete [] tempArray; tempArray = NULL; … … 2217 2253 if(strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(), "")) 2218 2254 { 2219 cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "BottomOffset");2255 cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "BottomOffset"); 2220 2256 if(tempArray) 2221 2257 { 2222 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2258 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2223 2259 { 2224 m_a cLayerCfg[layer].m_scaledRefLayerBottomOffset[i] = tempArray[i];2260 m_apcLayerCfg[layer]->m_scaledRefLayerBottomOffset[i] = tempArray[i]; 2225 2261 } 2226 2262 delete [] tempArray; tempArray = NULL; … … 2231 2267 if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(), "")) 2232 2268 { 2233 cfgStringToArray( &tempArray, cfg_refRegionOffsetPresentFlag[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionOffsetPresentFlag");2269 cfgStringToArray( &tempArray, cfg_refRegionOffsetPresentFlag[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefRegionOffsetPresentFlag"); 2234 2270 if(tempArray) 2235 2271 { 2236 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2272 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2237 2273 { 2238 m_a cLayerCfg[layer].m_refRegionOffsetPresentFlag[i] = tempArray[i];2274 m_apcLayerCfg[layer]->m_refRegionOffsetPresentFlag[i] = tempArray[i]; 2239 2275 } 2240 2276 delete [] tempArray; tempArray = NULL; … … 2245 2281 if(strcmp(cfg_refRegionLeftOffset[layer].c_str(), "")) 2246 2282 { 2247 cfgStringToArray( &tempArray, cfg_refRegionLeftOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionLeftOffset");2283 cfgStringToArray( &tempArray, cfg_refRegionLeftOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefRegionLeftOffset"); 2248 2284 if(tempArray) 2249 2285 { 2250 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2286 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2251 2287 { 2252 m_a cLayerCfg[layer].m_refRegionLeftOffset[i] = tempArray[i];2288 m_apcLayerCfg[layer]->m_refRegionLeftOffset[i] = tempArray[i]; 2253 2289 } 2254 2290 delete [] tempArray; tempArray = NULL; … … 2259 2295 if(strcmp(cfg_refRegionTopOffset[layer].c_str(), "")) 2260 2296 { 2261 cfgStringToArray( &tempArray, cfg_refRegionTopOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionTopOffset");2297 cfgStringToArray( &tempArray, cfg_refRegionTopOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefRegionTopOffset"); 2262 2298 if(tempArray) 2263 2299 { 2264 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2300 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2265 2301 { 2266 m_a cLayerCfg[layer].m_refRegionTopOffset[i] = tempArray[i];2302 m_apcLayerCfg[layer]->m_refRegionTopOffset[i] = tempArray[i]; 2267 2303 } 2268 2304 delete [] tempArray; tempArray = NULL; … … 2273 2309 if(strcmp(cfg_refRegionRightOffset[layer].c_str(), "")) 2274 2310 { 2275 cfgStringToArray( &tempArray, cfg_refRegionRightOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionRightOffset");2311 cfgStringToArray( &tempArray, cfg_refRegionRightOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefRegionRightOffset"); 2276 2312 if(tempArray) 2277 2313 { 2278 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2314 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2279 2315 { 2280 m_a cLayerCfg[layer].m_refRegionRightOffset[i] = tempArray[i];2316 m_apcLayerCfg[layer]->m_refRegionRightOffset[i] = tempArray[i]; 2281 2317 } 2282 2318 delete [] tempArray; tempArray = NULL; … … 2287 2323 if(strcmp(cfg_refRegionBottomOffset[layer].c_str(), "")) 2288 2324 { 2289 cfgStringToArray( &tempArray, cfg_refRegionBottomOffset[layer], m_a cLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionBottomOffset");2325 cfgStringToArray( &tempArray, cfg_refRegionBottomOffset[layer], m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets, "RefRegionBottomOffset"); 2290 2326 if(tempArray) 2291 2327 { 2292 for(Int i = 0; i < m_a cLayerCfg[layer].m_numRefLayerLocationOffsets; i++)2328 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 2293 2329 { 2294 m_a cLayerCfg[layer].m_refRegionBottomOffset[i] = tempArray[i];2330 m_apcLayerCfg[layer]->m_refRegionBottomOffset[i] = tempArray[i]; 2295 2331 } 2296 2332 delete [] tempArray; tempArray = NULL; … … 2298 2334 } 2299 2335 2300 Int numPhaseSet = m_a cLayerCfg[layer].m_numRefLayerLocationOffsets;2336 Int numPhaseSet = m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; 2301 2337 2302 2338 // Presense Flag // … … 2308 2344 for(Int i = 0; i < numPhaseSet; i++) 2309 2345 { 2310 m_a cLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] = tempArray[i];2346 m_apcLayerCfg[layer]->m_resamplePhaseSetPresentFlag[i] = tempArray[i]; 2311 2347 } 2312 2348 delete [] tempArray; tempArray = NULL; … … 2322 2358 for(Int i = 0; i < numPhaseSet; i++) 2323 2359 { 2324 m_a cLayerCfg[layer].m_phaseHorLuma[i] = tempArray[i];2360 m_apcLayerCfg[layer]->m_phaseHorLuma[i] = tempArray[i]; 2325 2361 } 2326 2362 delete [] tempArray; tempArray = NULL; … … 2336 2372 for(Int i = 0; i < numPhaseSet; i++) 2337 2373 { 2338 m_a cLayerCfg[layer].m_phaseVerLuma[i] = tempArray[i];2374 m_apcLayerCfg[layer]->m_phaseVerLuma[i] = tempArray[i]; 2339 2375 } 2340 2376 delete [] tempArray; tempArray = NULL; … … 2350 2386 for(Int i = 0; i < numPhaseSet; i++) 2351 2387 { 2352 m_a cLayerCfg[layer].m_phaseHorChroma[i] = tempArray[i];2388 m_apcLayerCfg[layer]->m_phaseHorChroma[i] = tempArray[i]; 2353 2389 } 2354 2390 delete [] tempArray; tempArray = NULL; … … 2364 2400 for(Int i = 0; i < numPhaseSet; i++) 2365 2401 { 2366 m_a cLayerCfg[layer].m_phaseVerChroma[i] = tempArray[i];2402 m_apcLayerCfg[layer]->m_phaseVerChroma[i] = tempArray[i]; 2367 2403 } 2368 2404 delete [] tempArray; tempArray = NULL; … … 2371 2407 2372 2408 Char* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str()); 2373 if( m_a cLayerCfg[layer].m_numSamplePredRefLayers > 0 )2409 if( m_apcLayerCfg[layer]->m_numSamplePredRefLayers > 0 ) 2374 2410 { 2375 2411 char *samplePredRefLayerId; 2376 2412 int i=0; 2377 m_a cLayerCfg[layer].m_samplePredRefLayerIds = new Int[m_acLayerCfg[layer].m_numSamplePredRefLayers];2413 m_apcLayerCfg[layer]->m_samplePredRefLayerIds = new Int[m_apcLayerCfg[layer]->m_numSamplePredRefLayers]; 2378 2414 samplePredRefLayerId = strtok(pSamplePredRefLayerIds, " ,-"); 2379 2415 while(samplePredRefLayerId != NULL) 2380 2416 { 2381 if( i >= m_a cLayerCfg[layer].m_numSamplePredRefLayers )2417 if( i >= m_apcLayerCfg[layer]->m_numSamplePredRefLayers ) 2382 2418 { 2383 2419 printf( "NumSamplePredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 2384 2420 exit( EXIT_FAILURE ); 2385 2421 } 2386 *( m_a cLayerCfg[layer].m_samplePredRefLayerIds + i ) = atoi( samplePredRefLayerId );2422 *( m_apcLayerCfg[layer]->m_samplePredRefLayerIds + i ) = atoi( samplePredRefLayerId ); 2387 2423 samplePredRefLayerId = strtok(NULL, " ,-"); 2388 2424 i++; 2389 2425 } 2390 if( i < m_a cLayerCfg[layer].m_numSamplePredRefLayers )2426 if( i < m_apcLayerCfg[layer]->m_numSamplePredRefLayers ) 2391 2427 { 2392 2428 printf( "NumSamplePredRefLayers%d: The width of some columns is not defined.\n", layer ); … … 2396 2432 else 2397 2433 { 2398 m_a cLayerCfg[layer].m_samplePredRefLayerIds = NULL;2434 m_apcLayerCfg[layer]->m_samplePredRefLayerIds = NULL; 2399 2435 } 2400 2436 … … 2406 2442 2407 2443 Char* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str()); 2408 if( m_a cLayerCfg[layer].m_numMotionPredRefLayers > 0 )2444 if( m_apcLayerCfg[layer]->m_numMotionPredRefLayers > 0 ) 2409 2445 { 2410 2446 char *motionPredRefLayerId; 2411 2447 int i=0; 2412 m_a cLayerCfg[layer].m_motionPredRefLayerIds = new Int[m_acLayerCfg[layer].m_numMotionPredRefLayers];2448 m_apcLayerCfg[layer]->m_motionPredRefLayerIds = new Int[m_apcLayerCfg[layer]->m_numMotionPredRefLayers]; 2413 2449 motionPredRefLayerId = strtok(pMotionPredRefLayerIds, " ,-"); 2414 2450 while(motionPredRefLayerId != NULL) 2415 2451 { 2416 if( i >= m_a cLayerCfg[layer].m_numMotionPredRefLayers )2452 if( i >= m_apcLayerCfg[layer]->m_numMotionPredRefLayers ) 2417 2453 { 2418 2454 printf( "NumMotionPredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 2419 2455 exit( EXIT_FAILURE ); 2420 2456 } 2421 *( m_a cLayerCfg[layer].m_motionPredRefLayerIds + i ) = atoi( motionPredRefLayerId );2457 *( m_apcLayerCfg[layer]->m_motionPredRefLayerIds + i ) = atoi( motionPredRefLayerId ); 2422 2458 motionPredRefLayerId = strtok(NULL, " ,-"); 2423 2459 i++; 2424 2460 } 2425 if( i < m_a cLayerCfg[layer].m_numMotionPredRefLayers )2461 if( i < m_apcLayerCfg[layer]->m_numMotionPredRefLayers ) 2426 2462 { 2427 2463 printf( "NumMotionPredRefLayers%d: The width of some columns is not defined.\n", layer ); … … 2431 2467 else 2432 2468 { 2433 m_a cLayerCfg[layer].m_motionPredRefLayerIds = NULL;2469 m_apcLayerCfg[layer]->m_motionPredRefLayerIds = NULL; 2434 2470 } 2435 2471 … … 2441 2477 2442 2478 Char* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str()); 2443 if( m_a cLayerCfg[layer].m_numActiveRefLayers > 0 )2479 if( m_apcLayerCfg[layer]->m_numActiveRefLayers > 0 ) 2444 2480 { 2445 2481 char *refLayerId; 2446 2482 int i=0; 2447 m_a cLayerCfg[layer].m_predLayerIds = new Int[m_acLayerCfg[layer].m_numActiveRefLayers];2483 m_apcLayerCfg[layer]->m_predLayerIds = new Int[m_apcLayerCfg[layer]->m_numActiveRefLayers]; 2448 2484 refLayerId = strtok(pPredLayerIds, " ,-"); 2449 2485 while(refLayerId != NULL) 2450 2486 { 2451 if( i >= m_a cLayerCfg[layer].m_numActiveRefLayers )2487 if( i >= m_apcLayerCfg[layer]->m_numActiveRefLayers ) 2452 2488 { 2453 2489 printf( "NumActiveRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 2454 2490 exit( EXIT_FAILURE ); 2455 2491 } 2456 *( m_a cLayerCfg[layer].m_predLayerIds + i ) = atoi( refLayerId );2492 *( m_apcLayerCfg[layer]->m_predLayerIds + i ) = atoi( refLayerId ); 2457 2493 refLayerId = strtok(NULL, " ,-"); 2458 2494 i++; 2459 2495 } 2460 if( i < m_a cLayerCfg[layer].m_numActiveRefLayers )2496 if( i < m_apcLayerCfg[layer]->m_numActiveRefLayers ) 2461 2497 { 2462 2498 printf( "NumActiveRefLayers%d: The width of some columns is not defined.\n", layer ); … … 2466 2502 else 2467 2503 { 2468 m_a cLayerCfg[layer].m_predLayerIds = NULL;2504 m_apcLayerCfg[layer]->m_predLayerIds = NULL; 2469 2505 } 2470 2506 … … 2474 2510 pPredLayerIds = NULL; 2475 2511 } 2476 } //for(Int layer = 0; layer < MAX_LAYERS; layer++)2512 } //for(Int layer = 0; layer < m_numLayers; layer++) 2477 2513 2478 2514 for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++) … … 2919 2955 { 2920 2956 UInt uiAddCUDepth = 0; 2921 while( (m_a cLayerCfg[layerIdx].m_uiMaxCUWidth>>m_acLayerCfg[layerIdx].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize + uiAddCUDepth ) ) )2957 while( (m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth>>m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth) > ( 1 << ( m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MinSize + uiAddCUDepth ) ) ) 2922 2958 { 2923 2959 uiAddCUDepth++; 2924 2960 } 2925 2961 2926 m_a cLayerCfg[layerIdx].m_uiMaxTotalCUDepth = m_acLayerCfg[layerIdx].m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_acLayerCfg[layerIdx].m_chromaFormatIDC, m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.2927 m_a cLayerCfg[layerIdx].m_uiLog2DiffMaxMinCodingBlockSize = m_acLayerCfg[layerIdx].m_uiMaxCUDepth - 1;2962 m_apcLayerCfg[layerIdx]->m_uiMaxTotalCUDepth = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_apcLayerCfg[layerIdx]->m_chromaFormatIDC, m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2963 m_apcLayerCfg[layerIdx]->m_uiLog2DiffMaxMinCodingBlockSize = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth - 1; 2928 2964 } 2929 2965 #else … … 2952 2988 Void TAppEncCfg::xCheckParameter(UInt layerIdx) 2953 2989 { 2954 Bool m_extendedPrecisionProcessingFlag = m_a cLayerCfg[layerIdx].m_extendedPrecisionProcessingFlag;2955 Bool m_highPrecisionOffsetsEnabledFlag = m_a cLayerCfg[layerIdx].m_highPrecisionOffsetsEnabledFlag;2956 ChromaFormat m_chromaFormatIDC = m_a cLayerCfg[layerIdx].m_chromaFormatIDC;2957 ChromaFormat m_chromaFormatConstraint = m_a cLayerCfg[layerIdx].m_chromaFormatConstraint;2958 ChromaFormat m_InputChromaFormatIDC = m_a cLayerCfg[layerIdx].m_InputChromaFormatIDC;2959 2960 Int m_inputBitDepth[] = {m_a cLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA]};2961 Int m_internalBitDepth[] = {m_a cLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};2962 Int m_MSBExtendedBitDepth[] = {m_a cLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};2963 2964 m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] = m_a cLayerCfg[layerIdx].m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA];2965 m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] = m_a cLayerCfg[layerIdx].m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA];2966 2967 Int layerPTLIdx = m_a cLayerCfg[layerIdx].m_layerPTLIdx;2990 Bool m_extendedPrecisionProcessingFlag = m_apcLayerCfg[layerIdx]->m_extendedPrecisionProcessingFlag; 2991 Bool m_highPrecisionOffsetsEnabledFlag = m_apcLayerCfg[layerIdx]->m_highPrecisionOffsetsEnabledFlag; 2992 ChromaFormat m_chromaFormatIDC = m_apcLayerCfg[layerIdx]->m_chromaFormatIDC; 2993 ChromaFormat m_chromaFormatConstraint = m_apcLayerCfg[layerIdx]->m_chromaFormatConstraint; 2994 ChromaFormat m_InputChromaFormatIDC = m_apcLayerCfg[layerIdx]->m_InputChromaFormatIDC; 2995 2996 Int m_inputBitDepth[] = {m_apcLayerCfg[layerIdx]->m_inputBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layerIdx]->m_inputBitDepth[CHANNEL_TYPE_CHROMA]}; 2997 Int m_internalBitDepth[] = {m_apcLayerCfg[layerIdx]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layerIdx]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]}; 2998 Int m_MSBExtendedBitDepth[] = {m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]}; 2999 3000 m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] = m_apcLayerCfg[layerIdx]->m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA]; 3001 m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layerIdx]->m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA]; 3002 3003 Int layerPTLIdx = m_apcLayerCfg[layerIdx]->m_layerPTLIdx; 2968 3004 Profile::Name m_profile = m_profileList[layerPTLIdx]; 2969 UInt m_bitDepthConstraint = m_a cLayerCfg[layerIdx].m_bitDepthConstraint;2970 Bool m_intraConstraintFlag = m_a cLayerCfg[layerIdx].m_intraConstraintFlag;2971 Bool m_lowerBitRateConstraintFlag = m_a cLayerCfg[layerIdx].m_lowerBitRateConstraintFlag;2972 Bool m_onePictureOnlyConstraintFlag = m_a cLayerCfg[layerIdx].m_onePictureOnlyConstraintFlag;3005 UInt m_bitDepthConstraint = m_apcLayerCfg[layerIdx]->m_bitDepthConstraint; 3006 Bool m_intraConstraintFlag = m_apcLayerCfg[layerIdx]->m_intraConstraintFlag; 3007 Bool m_lowerBitRateConstraintFlag = m_apcLayerCfg[layerIdx]->m_lowerBitRateConstraintFlag; 3008 Bool m_onePictureOnlyConstraintFlag = m_apcLayerCfg[layerIdx]->m_onePictureOnlyConstraintFlag; 2973 3009 #else 2974 3010 Void TAppEncCfg::xCheckParameter() … … 3323 3359 * This permits the ability to omit a GOP structure specification */ 3324 3360 #if SVC_EXTENSION 3325 if( m_a cLayerCfg[0].m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 )3361 if( m_apcLayerCfg[0]->m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 ) 3326 3362 { 3327 3363 m_GOPList[0] = GOPEntry(); … … 3337 3373 } 3338 3374 3339 if (m_a cLayerCfg[layerIdx].m_iIntraPeriod == 1 && m_EhGOPList[layerIdx][0].m_POC == -1) {3375 if (m_apcLayerCfg[layerIdx]->m_iIntraPeriod == 1 && m_EhGOPList[layerIdx][0].m_POC == -1) { 3340 3376 m_EhGOPList[layerIdx][0] = GOPEntry(); 3341 3377 m_EhGOPList[layerIdx][0].m_QPFactor = 1; … … 3406 3442 3407 3443 // verify layer configuration parameters 3408 if(m_a cLayerCfg[layerIdx].xCheckParameter(m_isField))3444 if(m_apcLayerCfg[layerIdx]->xCheckParameter(m_isField)) 3409 3445 { 3410 3446 printf("\nError: invalid configuration parameter found in layer %d \n", layerIdx); … … 3413 3449 3414 3450 // verify layer configuration parameters 3415 Int m_iIntraPeriod = m_a cLayerCfg[layerIdx].m_iIntraPeriod;3451 Int m_iIntraPeriod = m_apcLayerCfg[layerIdx]->m_iIntraPeriod; 3416 3452 #endif 3417 3453 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) ) … … 3726 3762 for(UInt layer=0; layer<m_numLayers; layer++) 3727 3763 { 3728 if ( (m_a cLayerCfg[layer].m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) )3764 if ( (m_apcLayerCfg[layer]->m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) ) 3729 3765 { 3730 3766 for(Int i=0; i<m_iGOPSize; i++) … … 4018 4054 4019 4055 #if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers 4020 Int m_iSourceWidth = m_a cLayerCfg[layerIdx].m_iSourceWidth;4021 Int m_iSourceHeight = m_a cLayerCfg[layerIdx].m_iSourceHeight;4022 Int m_uiMaxCUWidth = m_a cLayerCfg[layerIdx].m_uiMaxCUWidth;4023 Int m_uiMaxCUHeight = m_a cLayerCfg[layerIdx].m_uiMaxCUHeight;4056 Int m_iSourceWidth = m_apcLayerCfg[layerIdx]->m_iSourceWidth; 4057 Int m_iSourceHeight = m_apcLayerCfg[layerIdx]->m_iSourceHeight; 4058 Int m_uiMaxCUWidth = m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth; 4059 Int m_uiMaxCUHeight = m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight; 4024 4060 4025 4061 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 4026 Int m_iWaveFrontSynchro = m_a cLayerCfg[layerIdx].m_waveFrontSynchro;4062 Int m_iWaveFrontSynchro = m_apcLayerCfg[layerIdx]->m_waveFrontSynchro; 4027 4063 xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); 4028 4064 #endif … … 4157 4193 4158 4194 #if RC_SHVC_HARMONIZATION 4159 if ( m_a cLayerCfg[layerIdx].m_RCEnableRateControl )4160 { 4161 if ( m_a cLayerCfg[layerIdx].m_RCForceIntraQP )4162 { 4163 if ( m_a cLayerCfg[layerIdx].m_RCInitialQP == 0 )4195 if ( m_apcLayerCfg[layerIdx]->m_RCEnableRateControl ) 4196 { 4197 if ( m_apcLayerCfg[layerIdx]->m_RCForceIntraQP ) 4198 { 4199 if ( m_apcLayerCfg[layerIdx]->m_RCInitialQP == 0 ) 4164 4200 { 4165 4201 printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" ); 4166 m_a cLayerCfg[layerIdx].m_RCForceIntraQP = false;4202 m_apcLayerCfg[layerIdx]->m_RCForceIntraQP = false; 4167 4203 } 4168 4204 } … … 4210 4246 4211 4247 #if SVC_EXTENSION 4212 xConfirmPara( (m_a cLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" );4248 xConfirmPara( (m_apcLayerCfg[0]->m_numSamplePredRefLayers != 0) && (m_apcLayerCfg[0]->m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 4213 4249 // NOTE: m_numSamplePredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4214 4250 if( layerIdx > 0 ) 4215 4251 { 4216 xConfirmPara(m_a cLayerCfg[layerIdx].m_numSamplePredRefLayers > layerIdx, "Cannot reference more layers than before current layer");4217 for(Int i = 0; i < m_a cLayerCfg[layerIdx].m_numSamplePredRefLayers; i++)4218 { 4219 xConfirmPara(m_a cLayerCfg[layerIdx].m_samplePredRefLayerIds[i] > m_acLayerCfg[layerIdx].m_layerId, "Cannot reference higher layers");4220 xConfirmPara(m_a cLayerCfg[layerIdx].m_samplePredRefLayerIds[i] == m_acLayerCfg[layerIdx].m_layerId, "Cannot reference the current layer itself");4221 } 4222 } 4223 xConfirmPara( (m_a cLayerCfg[0].m_numMotionPredRefLayers != 0) && (m_acLayerCfg[0].m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" );4252 xConfirmPara(m_apcLayerCfg[layerIdx]->m_numSamplePredRefLayers > layerIdx, "Cannot reference more layers than before current layer"); 4253 for(Int i = 0; i < m_apcLayerCfg[layerIdx]->m_numSamplePredRefLayers; i++) 4254 { 4255 xConfirmPara(m_apcLayerCfg[layerIdx]->m_samplePredRefLayerIds[i] > m_apcLayerCfg[layerIdx]->m_layerId, "Cannot reference higher layers"); 4256 xConfirmPara(m_apcLayerCfg[layerIdx]->m_samplePredRefLayerIds[i] == m_apcLayerCfg[layerIdx]->m_layerId, "Cannot reference the current layer itself"); 4257 } 4258 } 4259 xConfirmPara( (m_apcLayerCfg[0]->m_numMotionPredRefLayers != 0) && (m_apcLayerCfg[0]->m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 4224 4260 // NOTE: m_numMotionPredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4225 4261 if( layerIdx > 0 ) 4226 4262 { 4227 xConfirmPara(m_a cLayerCfg[layerIdx].m_numMotionPredRefLayers > layerIdx, "Cannot reference more layers than before current layer");4228 for(Int i = 0; i < m_a cLayerCfg[layerIdx].m_numMotionPredRefLayers; i++)4229 { 4230 xConfirmPara(m_a cLayerCfg[layerIdx].m_motionPredRefLayerIds[i] > m_acLayerCfg[layerIdx].m_layerId, "Cannot reference higher layers");4231 xConfirmPara(m_a cLayerCfg[layerIdx].m_motionPredRefLayerIds[i] == m_acLayerCfg[layerIdx].m_layerId, "Cannot reference the current layer itself");4232 } 4233 } 4234 4235 xConfirmPara( (m_a cLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" );4263 xConfirmPara(m_apcLayerCfg[layerIdx]->m_numMotionPredRefLayers > layerIdx, "Cannot reference more layers than before current layer"); 4264 for(Int i = 0; i < m_apcLayerCfg[layerIdx]->m_numMotionPredRefLayers; i++) 4265 { 4266 xConfirmPara(m_apcLayerCfg[layerIdx]->m_motionPredRefLayerIds[i] > m_apcLayerCfg[layerIdx]->m_layerId, "Cannot reference higher layers"); 4267 xConfirmPara(m_apcLayerCfg[layerIdx]->m_motionPredRefLayerIds[i] == m_apcLayerCfg[layerIdx]->m_layerId, "Cannot reference the current layer itself"); 4268 } 4269 } 4270 4271 xConfirmPara( (m_apcLayerCfg[0]->m_numActiveRefLayers != 0) && (m_apcLayerCfg[0]->m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 4236 4272 // NOTE: m_numActiveRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4237 4273 if( layerIdx > 0 ) … … 4242 4278 predEnabledFlag[refLayer] = false; 4243 4279 } 4244 for(Int i = 0; i < m_a cLayerCfg[layerIdx].m_numSamplePredRefLayers; i++)4245 { 4246 predEnabledFlag[m_a cLayerCfg[layerIdx].m_samplePredRefLayerIds[i]] = true;4247 } 4248 for(Int i = 0; i < m_a cLayerCfg[layerIdx].m_numMotionPredRefLayers; i++)4249 { 4250 predEnabledFlag[m_a cLayerCfg[layerIdx].m_motionPredRefLayerIds[i]] = true;4280 for(Int i = 0; i < m_apcLayerCfg[layerIdx]->m_numSamplePredRefLayers; i++) 4281 { 4282 predEnabledFlag[m_apcLayerCfg[layerIdx]->m_samplePredRefLayerIds[i]] = true; 4283 } 4284 for(Int i = 0; i < m_apcLayerCfg[layerIdx]->m_numMotionPredRefLayers; i++) 4285 { 4286 predEnabledFlag[m_apcLayerCfg[layerIdx]->m_motionPredRefLayerIds[i]] = true; 4251 4287 } 4252 4288 Int numDirectRefLayers = 0; … … 4255 4291 if (predEnabledFlag[refLayer] == true) numDirectRefLayers++; 4256 4292 } 4257 xConfirmPara(m_a cLayerCfg[layerIdx].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");4258 for(Int i = 0; i < m_a cLayerCfg[layerIdx].m_numActiveRefLayers; i++)4259 { 4260 xConfirmPara(m_a cLayerCfg[layerIdx].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");4293 xConfirmPara(m_apcLayerCfg[layerIdx]->m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 4294 for(Int i = 0; i < m_apcLayerCfg[layerIdx]->m_numActiveRefLayers; i++) 4295 { 4296 xConfirmPara(m_apcLayerCfg[layerIdx]->m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers"); 4261 4297 } 4262 4298 } … … 4265 4301 { 4266 4302 xConfirmPara(m_numLayers != 2, "Adaptive resolution change works with 2 layers only"); 4267 xConfirmPara(m_a cLayerCfg[1].m_iIntraPeriod == 0 || (m_adaptiveResolutionChange % m_acLayerCfg[1].m_iIntraPeriod) != 0, "Adaptive resolution change must happen at enhancement layer RAP picture");4303 xConfirmPara(m_apcLayerCfg[1]->m_iIntraPeriod == 0 || (m_adaptiveResolutionChange % m_apcLayerCfg[1]->m_iIntraPeriod) != 0, "Adaptive resolution change must happen at enhancement layer RAP picture"); 4268 4304 } 4269 4305 … … 4280 4316 if( layerIdx < MAX_LAYERS-1 ) 4281 4317 { 4282 xConfirmPara(m_a cLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7");4318 xConfirmPara(m_apcLayerCfg[layerIdx]->m_maxTidIlRefPicsPlus1 < 0 || m_apcLayerCfg[layerIdx]->m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 4283 4319 } 4284 4320 #if AUXILIARY_PICTURES 4285 4321 if( layerIdx < MAX_LAYERS-1 ) 4286 4322 { 4287 xConfirmPara(m_a cLayerCfg[layerIdx].m_auxId < 0 || m_acLayerCfg[layerIdx].m_auxId > 2, "AuxId must be in range 0 to 2");4323 xConfirmPara(m_apcLayerCfg[layerIdx]->m_auxId < 0 || m_apcLayerCfg[layerIdx]->m_auxId > 2, "AuxId must be in range 0 to 2"); 4288 4324 } 4289 4325 #endif … … 4341 4377 { 4342 4378 printf("=== Layer %d settings === \n", layer); 4343 m_a cLayerCfg[layer].xPrintParameter();4379 m_apcLayerCfg[layer]->xPrintParameter(); 4344 4380 printf("\n"); 4345 4381 } … … 4704 4740 { 4705 4741 Int *tempArray = NULL; 4706 numEntries = MAX_LAYERS;4742 numEntries = m_numLayers; 4707 4743 // For all layer sets 4708 4744 cfgStringToArrayNumEntries(&tempArray, cfgString, numEntries, logString); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1375 r1377 60 60 // file I/O 61 61 #if SVC_EXTENSION 62 TAppEncLayerCfg m_acLayerCfg[MAX_LAYERS];62 TAppEncLayerCfg* m_apcLayerCfg[MAX_LAYERS]; 63 63 Int m_layerId; 64 64 Int m_numLayers; ///< number of layers … … 551 551 552 552 #if SVC_EXTENSION 553 Bool parseCfgNumLayersAndInit( Int argc, Char* argv[] ); ///< parse configuration file to to get number of layers and allocate memory 553 554 Int getNumFrameToBeEncoded() { return m_framesToBeEncoded; } 554 555 Int getNumLayer() { return m_numLayers; } … … 559 560 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } 560 561 561 UInt getInternalBitDepth(Int iLayer, ChannelType type) { return m_acLayerCfg[iLayer].m_internalBitDepth[type];}562 Bool getPCMInputBitDepthFlag() { return m_bPCMInputBitDepthFlag; }562 UInt getInternalBitDepth(Int layer, ChannelType type) { return m_apcLayerCfg[layer]->m_internalBitDepth[type];} 563 Bool getPCMInputBitDepthFlag() { return m_bPCMInputBitDepthFlag; } 563 564 564 565 Int getDecodingRefreshType() { return m_iDecodingRefreshType; } 565 Int getWaveFrontSynchro(Int layerIdx) { return m_a cLayerCfg[layerIdx].m_waveFrontSynchro;}566 Int getWaveFrontSynchro(Int layerIdx) { return m_apcLayerCfg[layerIdx]->m_waveFrontSynchro; } 566 567 Void getDirFilename(string& filename, string& dir, const string path); 567 568 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1376 r1377 64 64 m_essentialBytes = 0; 65 65 #if SVC_EXTENSION 66 for(UInt layer=0; layer < MAX_LAYERS; layer++) 67 { 68 m_apcTEncTop[layer] = &m_acTEncTop[layer]; 69 } 66 memset( m_apcTVideoIOYuvInputFile, NULL, sizeof(m_apcTVideoIOYuvInputFile) ); 67 memset( m_apcTVideoIOYuvReconFile, NULL, sizeof(m_apcTVideoIOYuvReconFile) ); 68 memset( m_apcTEncTop, NULL, sizeof(m_apcTEncTop) ); 70 69 #endif 71 70 } … … 75 74 } 76 75 77 #if SVC_EXTENSION78 76 Void TAppEncTop::xInitLibCfg() 79 77 { 80 TComVPS* vps = m_acTEncTop[0].getVPS(); 81 82 vps->setVpsPocLsbAlignedFlag(false); 83 84 vps->setMaxTLayers ( m_maxTempLayer ); 78 #if SVC_EXTENSION 79 TComVPS& vps = *m_apcTEncTop[0]->getVPS(); 80 #else 81 TComVPS vps; 82 #endif 83 84 vps.setMaxTLayers ( m_maxTempLayer ); 85 85 if (m_maxTempLayer == 1) 86 86 { 87 vps->setTemporalNestingFlag(true); 88 } 87 vps.setTemporalNestingFlag(true); 88 } 89 vps.setMaxLayers ( 1 ); 89 90 for(Int i = 0; i < MAX_TLAYER; i++) 90 91 { 91 vps->setNumReorderPics ( m_numReorderPics[i], i ); 92 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 93 } 92 vps.setNumReorderPics ( m_numReorderPics[i], i ); 93 vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 94 } 95 96 #if !SVC_EXTENSION 97 m_cTEncTop.setVPS(&vps); 98 #endif 99 100 #if SVC_EXTENSION 101 vps.setVpsPocLsbAlignedFlag(false); 94 102 95 103 Int maxRepFormatIdx = -1; … … 98 106 { 99 107 // Auto generation of the format index 100 if( m_a cLayerCfg[layer].getRepFormatIdx() == -1 )108 if( m_apcLayerCfg[layer]->getRepFormatIdx() == -1 ) 101 109 { 102 110 Bool found = false; 103 111 for( UInt idx = 0; idx < layer; idx++ ) 104 112 { 105 if( m_a cLayerCfg[layer].getSourceWidth() == m_acLayerCfg[idx].getSourceWidth() && m_acLayerCfg[layer].getSourceHeight() == m_acLayerCfg[idx].getSourceHeight()113 if( m_apcLayerCfg[layer]->getSourceWidth() == m_apcLayerCfg[idx]->getSourceWidth() && m_apcLayerCfg[layer]->getSourceHeight() == m_apcLayerCfg[idx]->getSourceHeight() 106 114 #if AUXILIARY_PICTURES 107 && m_a cLayerCfg[layer].getChromaFormatIDC() == m_acLayerCfg[idx].getChromaFormatIDC()108 #endif 109 && m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA] == m_acLayerCfg[idx].m_internalBitDepth[CHANNEL_TYPE_LUMA] && m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA] == m_acLayerCfg[idx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]115 && m_apcLayerCfg[layer]->getChromaFormatIDC() == m_apcLayerCfg[idx]->getChromaFormatIDC() 116 #endif 117 && m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA] == m_apcLayerCfg[idx]->m_internalBitDepth[CHANNEL_TYPE_LUMA] && m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA] == m_apcLayerCfg[idx]->m_internalBitDepth[CHANNEL_TYPE_CHROMA] 110 118 ) 111 119 { … … 119 127 } 120 128 121 m_a cLayerCfg[layer].setRepFormatIdx( formatIdx );122 } 123 124 assert( m_a cLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" );125 126 vps ->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() );127 128 maxRepFormatIdx = std::max( m_a cLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx );129 } 130 131 assert( vps ->getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one.129 m_apcLayerCfg[layer]->setRepFormatIdx( formatIdx ); 130 } 131 132 assert( m_apcLayerCfg[layer]->getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 133 134 vps.setVpsRepFormatIdx( layer, m_apcLayerCfg[layer]->getRepFormatIdx() ); 135 136 maxRepFormatIdx = std::max( m_apcLayerCfg[layer]->getRepFormatIdx(), maxRepFormatIdx ); 137 } 138 139 assert( vps.getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one. 132 140 133 141 Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1]; … … 140 148 for(layer=0; layer < m_numLayers; layer++) 141 149 { 142 if( vps ->getVpsRepFormatIdx(layer) == i )150 if( vps.getVpsRepFormatIdx(layer) == i ) 143 151 { 144 152 mapIdxToLayer[i] = layer; … … 149 157 } 150 158 151 vps ->setVpsNumRepFormats ( maxRepFormatIdx + 1 );159 vps.setVpsNumRepFormats ( maxRepFormatIdx + 1 ); 152 160 153 161 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 154 vps ->setRepFormatIdxPresentFlag ( vps->getVpsNumRepFormats() > 1 ? true : false );155 156 for(UInt idx=0; idx < vps ->getVpsNumRepFormats(); idx++)157 { 158 RepFormat *repFormat = vps ->getVpsRepFormat( idx );162 vps.setRepFormatIdxPresentFlag ( vps.getVpsNumRepFormats() > 1 ? true : false ); 163 164 for(UInt idx=0; idx < vps.getVpsNumRepFormats(); idx++) 165 { 166 RepFormat *repFormat = vps.getVpsRepFormat( idx ); 159 167 repFormat->setChromaAndBitDepthVpsPresentFlag ( true ); 160 168 if (idx==0) … … 163 171 } 164 172 165 repFormat->setPicWidthVpsInLumaSamples ( m_a cLayerCfg[mapIdxToLayer[idx]].getSourceWidth() );166 repFormat->setPicHeightVpsInLumaSamples ( m_a cLayerCfg[mapIdxToLayer[idx]].getSourceHeight() );173 repFormat->setPicWidthVpsInLumaSamples ( m_apcLayerCfg[mapIdxToLayer[idx]]->getSourceWidth() ); 174 repFormat->setPicHeightVpsInLumaSamples ( m_apcLayerCfg[mapIdxToLayer[idx]]->getSourceHeight() ); 167 175 #if AUXILIARY_PICTURES 168 repFormat->setChromaFormatVpsIdc ( m_a cLayerCfg[mapIdxToLayer[idx]].getChromaFormatIDC() );176 repFormat->setChromaFormatVpsIdc ( m_apcLayerCfg[mapIdxToLayer[idx]]->getChromaFormatIDC() ); 169 177 #else 170 178 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 … … 175 183 repFormat->setBitDepthVpsChroma ( getInternalBitDepth(mapIdxToLayer[idx], CHANNEL_TYPE_CHROMA) ); // Need modification to change for each layer 176 184 177 repFormat->getConformanceWindowVps().setWindow ( m_a cLayerCfg[mapIdxToLayer[idx]].m_confWinLeft,178 m_a cLayerCfg[mapIdxToLayer[idx]].m_confWinRight,179 m_a cLayerCfg[mapIdxToLayer[idx]].m_confWinTop,180 m_a cLayerCfg[mapIdxToLayer[idx]].m_confWinBottom );181 182 m_a cTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch( m_skipPictureAtArcSwitch );185 repFormat->getConformanceWindowVps().setWindow ( m_apcLayerCfg[mapIdxToLayer[idx]]->m_confWinLeft, 186 m_apcLayerCfg[mapIdxToLayer[idx]]->m_confWinRight, 187 m_apcLayerCfg[mapIdxToLayer[idx]]->m_confWinTop, 188 m_apcLayerCfg[mapIdxToLayer[idx]]->m_confWinBottom ); 189 190 m_apcTEncTop[mapIdxToLayer[idx]]->setSkipPictureAtArcSwitch ( m_skipPictureAtArcSwitch ); 183 191 } 184 192 … … 186 194 187 195 //Populate PTL in VPS 188 TComVPS *pVPS = m_acTEncTop[0].getVPS();189 196 for( Int ii = 0; ii < m_numPTLInfo; ii++ ) 190 197 { 191 pVPS->getPTL(ii)->getGeneralPTL()->setLevelIdc(m_levelList[ii]);192 pVPS->getPTL(ii)->getGeneralPTL()->setTierFlag(m_levelTierList[ii]);193 pVPS->getPTL(ii)->getGeneralPTL()->setProfileIdc(m_profileList[ii]);194 pVPS->getPTL(ii)->getGeneralPTL()->setProfileCompatibilityFlag(m_profileCompatibility[ii], 1);195 pVPS->getPTL(ii)->getGeneralPTL()->setProgressiveSourceFlag(m_progressiveSourceFlagList[ii]);196 pVPS->getPTL(ii)->getGeneralPTL()->setInterlacedSourceFlag(m_interlacedSourceFlagList[ii]);197 pVPS->getPTL(ii)->getGeneralPTL()->setNonPackedConstraintFlag(m_nonPackedConstraintFlagList[ii]);198 pVPS->getPTL(ii)->getGeneralPTL()->setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlagList[ii]);199 } 200 pVPS->setNumProfileTierLevel(m_numPTLInfo);198 vps.getPTL(ii)->getGeneralPTL()->setLevelIdc(m_levelList[ii]); 199 vps.getPTL(ii)->getGeneralPTL()->setTierFlag(m_levelTierList[ii]); 200 vps.getPTL(ii)->getGeneralPTL()->setProfileIdc(m_profileList[ii]); 201 vps.getPTL(ii)->getGeneralPTL()->setProfileCompatibilityFlag(m_profileCompatibility[ii], 1); 202 vps.getPTL(ii)->getGeneralPTL()->setProgressiveSourceFlag(m_progressiveSourceFlagList[ii]); 203 vps.getPTL(ii)->getGeneralPTL()->setInterlacedSourceFlag(m_interlacedSourceFlagList[ii]); 204 vps.getPTL(ii)->getGeneralPTL()->setNonPackedConstraintFlag(m_nonPackedConstraintFlagList[ii]); 205 vps.getPTL(ii)->getGeneralPTL()->setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlagList[ii]); 206 } 207 vps.setNumProfileTierLevel(m_numPTLInfo); 201 208 202 209 std::vector<Int> myvector; 203 vps ->getProfileLevelTierIdx()->resize(m_numOutputLayerSets);210 vps.getProfileLevelTierIdx()->resize(m_numOutputLayerSets); 204 211 for( Int ii = 0; ii < m_numOutputLayerSets; ii++ ) 205 212 { … … 208 215 for( std::vector<Int>::iterator it = myvector.begin() ; it != myvector.end(); ++it ) 209 216 { 210 pVPS->addProfileLevelTierIdx(ii, it[0]);217 vps.addProfileLevelTierIdx(ii, it[0]); 211 218 } 212 219 } … … 214 221 assert( m_numLayers <= MAX_LAYERS ); 215 222 216 for(UInt layer=0; layer<m_numLayers; layer++) 217 { 223 for( UInt layer=0; layer < m_numLayers; layer++ ) 224 { 225 TEncTop& m_cTEncTop = *m_apcTEncTop[layer]; 218 226 //1 219 m_acTEncTop[layer].setInterLayerWeightedPredFlag ( m_useInterLayerWeightedPred ); 220 221 Int layerPTLIdx = m_acLayerCfg[layer].m_layerPTLIdx; 222 m_acTEncTop[layer].setProfile ( m_profileList[layerPTLIdx] ); 223 m_acTEncTop[layer].setLevel ( m_levelTierList[layerPTLIdx], m_levelList[layerPTLIdx] ); 224 m_acTEncTop[layer].setProgressiveSourceFlag ( m_progressiveSourceFlagList[layerPTLIdx] ); 225 m_acTEncTop[layer].setInterlacedSourceFlag ( m_interlacedSourceFlagList[layerPTLIdx] ); 226 m_acTEncTop[layer].setNonPackedConstraintFlag ( m_nonPackedConstraintFlagList[layerPTLIdx] ); 227 m_acTEncTop[layer].setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlagList[layerPTLIdx] ); 228 m_acTEncTop[layer].setBitDepthConstraintValue ( m_acLayerCfg[layer].m_bitDepthConstraint ); 229 m_acTEncTop[layer].setChromaFormatConstraintValue ( m_acLayerCfg[layer].m_chromaFormatConstraint ); 230 m_acTEncTop[layer].setIntraConstraintFlag ( m_acLayerCfg[layer].m_intraConstraintFlag ); 231 m_acTEncTop[layer].setOnePictureOnlyConstraintFlag ( m_acLayerCfg[layer].m_onePictureOnlyConstraintFlag ); 232 m_acTEncTop[layer].setLowerBitRateConstraintFlag ( m_acLayerCfg[layer].m_lowerBitRateConstraintFlag ); 233 234 m_acTEncTop[layer].setPrintMSEBasedSequencePSNR ( m_printMSEBasedSequencePSNR); 235 m_acTEncTop[layer].setPrintFrameMSE ( m_printFrameMSE); 236 m_acTEncTop[layer].setPrintSequenceMSE ( m_printSequenceMSE); 237 m_acTEncTop[layer].setCabacZeroWordPaddingEnabled ( m_cabacZeroWordPaddingEnabled ); 238 239 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); 240 m_acTEncTop[layer].setFrameSkip ( m_FrameSkip ); 241 m_acTEncTop[layer].setSourceWidth ( m_acLayerCfg[layer].getSourceWidth() ); 242 m_acTEncTop[layer].setSourceHeight ( m_acLayerCfg[layer].getSourceHeight() ); 243 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom ); 244 m_acTEncTop[layer].setFramesToBeEncoded ( m_framesToBeEncoded ); 245 246 #if AVC_BASE 247 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 248 #else 249 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) ); 250 #endif 227 m_cTEncTop.setInterLayerWeightedPredFlag ( m_useInterLayerWeightedPred ); 228 m_cTEncTop.setMFMEnabledFlag ( layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_apcLayerCfg[layer]->getNumMotionPredRefLayers()); 251 229 252 230 // set layer ID 253 m_acTEncTop[layer].setLayerId ( m_acLayerCfg[layer].m_layerId ); 254 m_acTEncTop[layer].setNumLayer ( m_numLayers ); 255 m_acTEncTop[layer].setLayerEnc ( m_apcTEncTop ); 256 257 //====== Coding Structure ======== 258 m_acTEncTop[layer].setIntraPeriod ( m_acLayerCfg[layer].m_iIntraPeriod ); 259 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType ); 260 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 261 262 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 263 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs[layer] ); 264 265 for(Int i = 0; i < MAX_TLAYER; i++) 266 { 267 m_acTEncTop[layer].setNumReorderPics ( m_numReorderPics[i], i ); 268 m_acTEncTop[layer].setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 269 } 270 for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop ) 271 { 272 m_acTEncTop[layer].setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] ); 273 } 274 m_acTEncTop[layer].setQP ( m_acLayerCfg[layer].getIntQP() ); 275 276 m_acTEncTop[layer].setPad ( m_acLayerCfg[layer].getPad() ); 277 278 if (layer== 0) 279 { 280 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 281 } 282 else 283 { 284 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] ); 285 } 286 287 m_acTEncTop[layer].setUseAMP( m_enableAMP ); 231 m_cTEncTop.setLayerId ( m_apcLayerCfg[layer]->m_layerId ); 232 m_cTEncTop.setNumLayer ( m_numLayers ); 233 m_cTEncTop.setLayerEnc ( m_apcTEncTop ); 288 234 289 235 if( layer < m_numLayers - 1 ) 290 236 { 291 m_ acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1());237 m_cTEncTop.setMaxTidIlRefPicsPlus1 ( m_apcLayerCfg[layer]->getMaxTidIlRefPicsPlus1()); 292 238 } 293 239 … … 296 242 UInt prevLayerIdx = 0; 297 243 UInt prevLayerId = 0; 298 if (m_a cLayerCfg[layer].getNumActiveRefLayers() > 0)299 { 300 prevLayerIdx = m_a cLayerCfg[layer].getPredLayerIdx(m_acLayerCfg[layer].getNumActiveRefLayers() - 1);301 prevLayerId = m_ acTEncTop[layer].getRefLayerId(prevLayerIdx);244 if (m_apcLayerCfg[layer]->getNumActiveRefLayers() > 0) 245 { 246 prevLayerIdx = m_apcLayerCfg[layer]->getPredLayerIdx(m_apcLayerCfg[layer]->getNumActiveRefLayers() - 1); 247 prevLayerId = m_cTEncTop.getRefLayerId(prevLayerIdx); 302 248 } 303 249 for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++) 304 250 { 305 m_ acTEncTop[layer].setSamplePredEnabledFlag (i, false);306 m_ acTEncTop[layer].setMotionPredEnabledFlag (i, false);307 } 308 if(m_a cLayerCfg[layer].getNumSamplePredRefLayers() == -1)251 m_cTEncTop.setSamplePredEnabledFlag (i, false); 252 m_cTEncTop.setMotionPredEnabledFlag (i, false); 253 } 254 if(m_apcLayerCfg[layer]->getNumSamplePredRefLayers() == -1) 309 255 { 310 256 // Not included in the configuration file; assume that each layer depends on previous layer 311 m_ acTEncTop[layer].setNumSamplePredRefLayers (1); // One sample pred ref. layer312 m_ acTEncTop[layer].setSamplePredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer313 m_ acTEncTop[layer].setSamplePredEnabledFlag (prevLayerIdx, true);257 m_cTEncTop.setNumSamplePredRefLayers (1); // One sample pred ref. layer 258 m_cTEncTop.setSamplePredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer 259 m_cTEncTop.setSamplePredEnabledFlag (prevLayerIdx, true); 314 260 } 315 261 else 316 262 { 317 m_ acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() );318 for( Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++)319 { 320 m_ acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i));321 } 322 } 323 if( m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1)263 m_cTEncTop.setNumSamplePredRefLayers ( m_apcLayerCfg[layer]->getNumSamplePredRefLayers() ); 264 for( Int i = 0; i < m_cTEncTop.getNumSamplePredRefLayers(); i++ ) 265 { 266 m_cTEncTop.setSamplePredRefLayerId ( i, m_apcLayerCfg[layer]->getSamplePredRefLayerId(i)); 267 } 268 } 269 if( m_apcLayerCfg[layer]->getNumMotionPredRefLayers() == -1) 324 270 { 325 271 // Not included in the configuration file; assume that each layer depends on previous layer 326 m_ acTEncTop[layer].setNumMotionPredRefLayers (1); // One motion pred ref. layer327 m_ acTEncTop[layer].setMotionPredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer328 m_ acTEncTop[layer].setMotionPredEnabledFlag (prevLayerIdx, true);272 m_cTEncTop.setNumMotionPredRefLayers (1); // One motion pred ref. layer 273 m_cTEncTop.setMotionPredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer 274 m_cTEncTop.setMotionPredEnabledFlag (prevLayerIdx, true); 329 275 } 330 276 else 331 277 { 332 m_ acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() );333 for( Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++)334 { 335 m_ acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i));278 m_cTEncTop.setNumMotionPredRefLayers ( m_apcLayerCfg[layer]->getNumMotionPredRefLayers() ); 279 for( Int i = 0; i < m_cTEncTop.getNumMotionPredRefLayers(); i++ ) 280 { 281 m_cTEncTop.setMotionPredRefLayerId ( i, m_apcLayerCfg[layer]->getMotionPredRefLayerId(i)); 336 282 } 337 283 } … … 340 286 assert( layer < MAX_LAYERS ); 341 287 342 for (Int i = 0; i < m_a cLayerCfg[layer].m_layerId; i++)288 for (Int i = 0; i < m_apcLayerCfg[layer]->m_layerId; i++) 343 289 { 344 290 Int refLayerId = -1; 345 291 346 for( Int layerIdc = 0; layerIdc < m_ acTEncTop[layer].getNumSamplePredRefLayers(); layerIdc++ )347 { 348 if( m_a cLayerCfg[layer].getSamplePredRefLayerId(layerIdc) == i )292 for( Int layerIdc = 0; layerIdc < m_cTEncTop.getNumSamplePredRefLayers(); layerIdc++ ) 293 { 294 if( m_apcLayerCfg[layer]->getSamplePredRefLayerId(layerIdc) == i ) 349 295 { 350 296 refLayerId = i; 351 m_ acTEncTop[layer].setSamplePredEnabledFlag( numDirectRefLayers, true );297 m_cTEncTop.setSamplePredEnabledFlag( numDirectRefLayers, true ); 352 298 break; 353 299 } 354 300 } 355 301 356 for( Int layerIdc = 0; layerIdc < m_ acTEncTop[layer].getNumMotionPredRefLayers(); layerIdc++ )357 { 358 if( m_a cLayerCfg[layer].getMotionPredRefLayerId(layerIdc) == i )302 for( Int layerIdc = 0; layerIdc < m_cTEncTop.getNumMotionPredRefLayers(); layerIdc++ ) 303 { 304 if( m_apcLayerCfg[layer]->getMotionPredRefLayerId(layerIdc) == i ) 359 305 { 360 306 refLayerId = i; 361 m_ acTEncTop[layer].setMotionPredEnabledFlag( numDirectRefLayers, true );307 m_cTEncTop.setMotionPredEnabledFlag( numDirectRefLayers, true ); 362 308 break; 363 309 } … … 366 312 if( refLayerId >= 0 ) 367 313 { 368 m_ acTEncTop[layer].setRefLayerId ( numDirectRefLayers, refLayerId );314 m_cTEncTop.setRefLayerId ( numDirectRefLayers, refLayerId ); 369 315 numDirectRefLayers++; 370 316 } 371 317 } 372 318 373 m_ acTEncTop[layer].setNumDirectRefLayers ( numDirectRefLayers );374 375 if(m_a cLayerCfg[layer].getNumActiveRefLayers() == -1)376 { 377 m_ acTEncTop[layer].setNumActiveRefLayers ( m_acTEncTop[layer].getNumDirectRefLayers() );378 for( Int i = 0; i < m_ acTEncTop[layer].getNumActiveRefLayers(); i++ )379 { 380 m_ acTEncTop[layer].setPredLayerIdx(i, i);319 m_cTEncTop.setNumDirectRefLayers ( numDirectRefLayers ); 320 321 if(m_apcLayerCfg[layer]->getNumActiveRefLayers() == -1) 322 { 323 m_cTEncTop.setNumActiveRefLayers ( m_cTEncTop.getNumDirectRefLayers() ); 324 for( Int i = 0; i < m_cTEncTop.getNumActiveRefLayers(); i++ ) 325 { 326 m_cTEncTop.setPredLayerIdx(i, i); 381 327 } 382 328 } 383 329 else 384 330 { 385 m_ acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() );386 for(Int i = 0; i < m_ acTEncTop[layer].getNumActiveRefLayers(); i++)387 { 388 m_ acTEncTop[layer].setPredLayerIdx ( i, m_acLayerCfg[layer].getPredLayerIdx(i));331 m_cTEncTop.setNumActiveRefLayers ( m_apcLayerCfg[layer]->getNumActiveRefLayers() ); 332 for(Int i = 0; i < m_cTEncTop.getNumActiveRefLayers(); i++) 333 { 334 m_cTEncTop.setPredLayerIdx ( i, m_apcLayerCfg[layer]->getPredLayerIdx(i)); 389 335 } 390 336 } … … 393 339 { 394 340 assert( layer == 0 ); 395 m_acTEncTop[layer].setNumDirectRefLayers(0); 396 } 397 398 //===== Slice ======== 399 400 //====== Loop/Deblock Filter ======== 401 m_acTEncTop[layer].setLoopFilterDisable ( m_bLoopFilterDisable ); 402 m_acTEncTop[layer].setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS ); 403 m_acTEncTop[layer].setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); 404 m_acTEncTop[layer].setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 405 m_acTEncTop[layer].setDeblockingFilterMetric ( m_DeblockingFilterMetric ); 406 407 //====== Motion search ======== 408 m_acTEncTop[layer].setDisableIntraPUsInInterSlices ( m_bDisableIntraPUsInInterSlices ); 409 m_acTEncTop[layer].setFastSearch ( m_iFastSearch ); 410 m_acTEncTop[layer].setSearchRange ( m_iSearchRange ); 411 m_acTEncTop[layer].setBipredSearchRange ( m_bipredSearchRange ); 412 m_acTEncTop[layer].setClipForBiPredMeEnabled ( m_bClipForBiPredMeEnabled ); 413 m_acTEncTop[layer].setFastMEAssumingSmootherMVEnabled ( m_bFastMEAssumingSmootherMVEnabled ); 414 415 //====== Quality control ======== 416 m_acTEncTop[layer].setMaxDeltaQP ( m_iMaxDeltaQP ); 417 m_acTEncTop[layer].setMaxCuDQPDepth ( m_acLayerCfg[layer].m_iMaxCuDQPDepth ); 418 m_acTEncTop[layer].setDiffCuChromaQpOffsetDepth ( m_diffCuChromaQpOffsetDepth ); 419 m_acTEncTop[layer].setChromaCbQpOffset ( m_cbQpOffset ); 420 m_acTEncTop[layer].setChromaCrQpOffset ( m_crQpOffset ); 421 422 m_acTEncTop[layer].setChromaFormatIdc ( m_acLayerCfg[layer].m_chromaFormatIDC ); 423 424 #if ADAPTIVE_QP_SELECTION 425 m_acTEncTop[layer].setUseAdaptQpSelect ( m_bUseAdaptQpSelect ); 426 #endif 427 428 m_acTEncTop[layer].setUseAdaptiveQP ( m_bUseAdaptiveQP ); 429 m_acTEncTop[layer].setQPAdaptationRange ( m_iQPAdaptationRange ); 430 m_acTEncTop[layer].setExtendedPrecisionProcessingFlag ( m_acLayerCfg[layer].m_extendedPrecisionProcessingFlag ); 431 m_acTEncTop[layer].setHighPrecisionOffsetsEnabledFlag ( m_acLayerCfg[layer].m_highPrecisionOffsetsEnabledFlag ); 432 433 //====== Tool list ======== 434 m_acTEncTop[layer].setDeltaQpRD ( m_uiDeltaQpRD ); 435 m_acTEncTop[layer].setFastDeltaQp ( m_bFastDeltaQP ); 436 m_acTEncTop[layer].setUseASR ( m_bUseASR ); 437 m_acTEncTop[layer].setUseHADME ( m_bUseHADME ); 438 m_acTEncTop[layer].setdQPs ( m_acLayerCfg[layer].getdQPs() ); 439 m_acTEncTop[layer].setUseRDOQ ( m_useRDOQ ); 440 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 441 #if T0196_SELECTIVE_RDOQ 442 m_acTEncTop[layer].setUseSelectiveRDOQ ( m_useSelectiveRDOQ ); 443 #endif 444 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 445 m_acTEncTop[layer].setMaxCUWidth ( m_acLayerCfg[layer].m_uiMaxCUWidth ); 446 m_acTEncTop[layer].setMaxCUHeight ( m_acLayerCfg[layer].m_uiMaxCUHeight ); 447 m_acTEncTop[layer].setMaxTotalCUDepth ( m_acLayerCfg[layer].m_uiMaxTotalCUDepth ); 448 m_acTEncTop[layer].setLog2DiffMaxMinCodingBlockSize ( m_acLayerCfg[layer].m_uiLog2DiffMaxMinCodingBlockSize ); 449 450 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 451 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 452 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 453 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 454 455 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 456 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 457 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 458 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); 459 m_acTEncTop[layer].setUseEarlySkipDetection ( m_useEarlySkipDetection ); 460 m_acTEncTop[layer].setCrossComponentPredictionEnabledFlag ( m_crossComponentPredictionEnabledFlag ); 461 m_acTEncTop[layer].setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); 462 m_acTEncTop[layer].setLog2SaoOffsetScale ( CHANNEL_TYPE_LUMA , m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] ); 463 m_acTEncTop[layer].setLog2SaoOffsetScale ( CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] ); 464 m_acTEncTop[layer].setUseTransformSkip ( m_useTransformSkip ); 465 m_acTEncTop[layer].setUseTransformSkipFast ( m_useTransformSkipFast ); 466 m_acTEncTop[layer].setTransformSkipRotationEnabledFlag ( m_transformSkipRotationEnabledFlag ); 467 m_acTEncTop[layer].setTransformSkipContextEnabledFlag ( m_transformSkipContextEnabledFlag ); 468 m_acTEncTop[layer].setPersistentRiceAdaptationEnabledFlag ( m_persistentRiceAdaptationEnabledFlag ); 469 m_acTEncTop[layer].setCabacBypassAlignmentEnabledFlag ( m_cabacBypassAlignmentEnabledFlag ); 470 m_acTEncTop[layer].setLog2MaxTransformSkipBlockSize ( m_log2MaxTransformSkipBlockSize ); 471 for (UInt signallingModeIndex = 0; signallingModeIndex < NUMBER_OF_RDPCM_SIGNALLING_MODES; signallingModeIndex++) 472 { 473 m_acTEncTop[layer].setRdpcmEnabledFlag ( RDPCMSignallingMode(signallingModeIndex), m_rdpcmEnabledFlag[signallingModeIndex]); 474 } 475 m_acTEncTop[layer].setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); 476 m_acTEncTop[layer].setFastUDIUseMPMEnabled ( m_bFastUDIUseMPMEnabled ); 477 m_acTEncTop[layer].setFastMEForGenBLowDelayEnabled ( m_bFastMEForGenBLowDelayEnabled ); 478 m_acTEncTop[layer].setUseBLambdaForNonKeyLowDelayPictures ( m_bUseBLambdaForNonKeyLowDelayPictures ); 479 m_acTEncTop[layer].setPCMLog2MinSize ( m_uiPCMLog2MinSize); 480 m_acTEncTop[layer].setUsePCM ( m_usePCM ); 481 482 for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++ ) 483 { 484 m_acTEncTop[layer].setBitDepth ((ChannelType)channelType, m_acLayerCfg[layer].m_internalBitDepth[channelType]); 485 m_acTEncTop[layer].setPCMBitDepth ((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_MSBExtendedBitDepth[channelType] : m_acLayerCfg[layer].m_internalBitDepth[channelType]); 486 } 487 m_acTEncTop[layer].setPCMLog2MaxSize ( m_pcmLog2MaxSize); 488 m_acTEncTop[layer].setMaxNumMergeCand ( m_maxNumMergeCand ); 489 490 491 //====== Weighted Prediction ======== 492 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 493 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 494 #if FAST_INTRA_SHVC 495 m_acTEncTop[layer].setUseFastIntraScalable ( m_useFastIntraScalable ); 496 #endif 497 498 if( layer != 0 && m_useInterLayerWeightedPred ) 499 { 500 // Enable weighted prediction for enhancement layer 501 m_acTEncTop[layer].setUseWP ( true ); 502 m_acTEncTop[layer].setWPBiPred ( true ); 503 } 504 505 //====== Parallel Merge Estimation ======== 506 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); 507 508 //====== Slice ======== 509 m_acTEncTop[layer].setSliceMode ( (SliceConstraint) m_sliceMode ); 510 m_acTEncTop[layer].setSliceArgument ( m_sliceArgument ); 511 512 //====== Dependent Slice ======== 513 m_acTEncTop[layer].setSliceSegmentMode ( (SliceConstraint) m_sliceSegmentMode ); 514 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 515 516 if(m_sliceMode == NO_SLICES ) 517 { 518 m_bLFCrossSliceBoundaryFlag = true; 519 } 520 521 m_acTEncTop[layer].setLFCrossSliceBoundaryFlag ( m_bLFCrossSliceBoundaryFlag ); 522 m_acTEncTop[layer].setUseSAO ( m_bUseSAO ); 523 m_acTEncTop[layer].setTestSAODisableAtPictureLevel ( m_bTestSAODisableAtPictureLevel ); 524 m_acTEncTop[layer].setSaoEncodingRate ( m_saoEncodingRate ); 525 m_acTEncTop[layer].setSaoEncodingRateChroma ( m_saoEncodingRateChroma ); 526 m_acTEncTop[layer].setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic ); 527 528 m_acTEncTop[layer].setSaoCtuBoundary ( m_saoCtuBoundary ); 529 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 530 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 531 532 m_acTEncTop[layer].setIntraSmoothingDisabledFlag (!m_enableIntraReferenceSmoothing ); 533 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled ( m_decodedPictureHashSEIEnabled ); 534 m_acTEncTop[layer].setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); 535 m_acTEncTop[layer].setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); 536 m_acTEncTop[layer].setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled ); 537 m_acTEncTop[layer].setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 538 m_acTEncTop[layer].setTMISEIToneMapId ( m_toneMapId ); 539 m_acTEncTop[layer].setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 540 m_acTEncTop[layer].setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 541 m_acTEncTop[layer].setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 542 m_acTEncTop[layer].setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 543 m_acTEncTop[layer].setTMISEIModelID ( m_toneMapModelId ); 544 m_acTEncTop[layer].setTMISEIMinValue ( m_toneMapMinValue ); 545 m_acTEncTop[layer].setTMISEIMaxValue ( m_toneMapMaxValue ); 546 m_acTEncTop[layer].setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 547 m_acTEncTop[layer].setTMISEISigmoidWidth ( m_sigmoidWidth ); 548 m_acTEncTop[layer].setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 549 m_acTEncTop[layer].setTMISEINumPivots ( m_numPivots ); 550 m_acTEncTop[layer].setTMISEICodedPivotValue ( m_codedPivotValue ); 551 m_acTEncTop[layer].setTMISEITargetPivotValue ( m_targetPivotValue ); 552 m_acTEncTop[layer].setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 553 m_acTEncTop[layer].setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 554 m_acTEncTop[layer].setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 555 m_acTEncTop[layer].setTMISEIExposureIndexValue ( m_exposureIndexValue ); 556 m_acTEncTop[layer].setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 557 m_acTEncTop[layer].setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 558 m_acTEncTop[layer].setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 559 m_acTEncTop[layer].setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 560 m_acTEncTop[layer].setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 561 m_acTEncTop[layer].setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 562 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 563 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 564 m_acTEncTop[layer].setChromaSamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled ); 565 m_acTEncTop[layer].setChromaSamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc ); 566 m_acTEncTop[layer].setChromaSamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc ); 567 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 568 m_acTEncTop[layer].setFramePackingArrangementSEIType ( m_framePackingSEIType ); 569 m_acTEncTop[layer].setFramePackingArrangementSEIId ( m_framePackingSEIId ); 570 m_acTEncTop[layer].setFramePackingArrangementSEIQuincunx ( m_framePackingSEIQuincunx ); 571 m_acTEncTop[layer].setFramePackingArrangementSEIInterpretation ( m_framePackingSEIInterpretation ); 572 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIEnabled ( m_segmentedRectFramePackingSEIEnabled ); 573 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEICancel ( m_segmentedRectFramePackingSEICancel ); 574 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIType ( m_segmentedRectFramePackingSEIType ); 575 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIPersistence( m_segmentedRectFramePackingSEIPersistence ); 576 m_acTEncTop[layer].setDisplayOrientationSEIAngle ( m_displayOrientationSEIAngle ); 577 m_acTEncTop[layer].setTemporalLevel0IndexSEIEnabled ( m_temporalLevel0IndexSEIEnabled ); 578 m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled ( m_gradualDecodingRefreshInfoEnabled ); 579 m_acTEncTop[layer].setNoDisplaySEITLayer ( m_noDisplaySEITLayer ); 580 m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled ( m_decodingUnitInfoSEIEnabled ); 581 m_acTEncTop[layer].setSOPDescriptionSEIEnabled ( m_SOPDescriptionSEIEnabled ); 582 m_acTEncTop[layer].setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 583 m_acTEncTop[layer].setTMCTSSEIEnabled ( m_tmctsSEIEnabled ); 584 m_acTEncTop[layer].setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled ); 585 m_acTEncTop[layer].setNumberOfTimeSets ( m_timeCodeSEINumTs ); 586 for(Int i = 0; i < m_timeCodeSEINumTs; i++) 587 { 588 m_acTEncTop[layer].setTimeSet(m_timeSetArray[i], i); 589 } 590 m_acTEncTop[layer].setKneeSEIEnabled ( m_kneeSEIEnabled ); 591 m_acTEncTop[layer].setKneeSEIId ( m_kneeSEIId ); 592 m_acTEncTop[layer].setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 593 m_acTEncTop[layer].setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 594 m_acTEncTop[layer].setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 595 m_acTEncTop[layer].setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 596 m_acTEncTop[layer].setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 597 m_acTEncTop[layer].setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 598 m_acTEncTop[layer].setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 599 m_acTEncTop[layer].setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 600 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 601 m_acTEncTop[layer].setMasteringDisplaySEI ( m_masteringDisplay ); 602 #if P0123_ALPHA_CHANNEL_SEI 603 m_acTEncTop[layer].setAlphaSEIEnabled ( m_alphaSEIEnabled ); 604 m_acTEncTop[layer].setAlphaCancelFlag ( m_alphaCancelFlag ); 605 m_acTEncTop[layer].setAlphaUseIdc ( m_alphaUseIdc ); 606 m_acTEncTop[layer].setAlphaBitDepthMinus8 ( m_alphaBitDepthMinus8 ); 607 m_acTEncTop[layer].setAlphaTransparentValue ( m_alphaTransparentValue ); 608 m_acTEncTop[layer].setAlphaOpaqueValue ( m_alphaOpaqueValue ); 609 m_acTEncTop[layer].setAlphaIncrementFlag ( m_alphaIncrementFlag ); 610 m_acTEncTop[layer].setAlphaClipFlag ( m_alphaClipFlag ); 611 m_acTEncTop[layer].setAlphaClipTypeFlag ( m_alphaClipTypeFlag ); 612 #endif 613 #if Q0096_OVERLAY_SEI 614 m_acTEncTop[layer].setOverlaySEIEnabled ( m_overlaySEIEnabled ); 615 m_acTEncTop[layer].setOverlaySEICancelFlag ( m_overlayInfoCancelFlag ); 616 m_acTEncTop[layer].setOverlaySEIContentAuxIdMinus128 ( m_overlayContentAuxIdMinus128 ); 617 m_acTEncTop[layer].setOverlaySEILabelAuxIdMinus128 ( m_overlayLabelAuxIdMinus128 ); 618 m_acTEncTop[layer].setOverlaySEIAlphaAuxIdMinus128 ( m_overlayAlphaAuxIdMinus128 ); 619 m_acTEncTop[layer].setOverlaySEIElementLabelValueLengthMinus8 ( m_overlayElementLabelValueLengthMinus8 ); 620 m_acTEncTop[layer].setOverlaySEINumOverlaysMinus1 ( m_numOverlaysMinus1 ); 621 m_acTEncTop[layer].setOverlaySEIIdx ( m_overlayIdx ); 622 m_acTEncTop[layer].setOverlaySEILanguagePresentFlag ( m_overlayLanguagePresentFlag ); 623 m_acTEncTop[layer].setOverlaySEIContentLayerId ( m_overlayContentLayerId ); 624 m_acTEncTop[layer].setOverlaySEILabelPresentFlag ( m_overlayLabelPresentFlag ); 625 m_acTEncTop[layer].setOverlaySEILabelLayerId ( m_overlayLabelLayerId ); 626 m_acTEncTop[layer].setOverlaySEIAlphaPresentFlag ( m_overlayAlphaPresentFlag ); 627 m_acTEncTop[layer].setOverlaySEIAlphaLayerId ( m_overlayAlphaLayerId ); 628 m_acTEncTop[layer].setOverlaySEINumElementsMinus1 ( m_numOverlayElementsMinus1 ); 629 m_acTEncTop[layer].setOverlaySEIElementLabelMin ( m_overlayElementLabelMin ); 630 m_acTEncTop[layer].setOverlaySEIElementLabelMax ( m_overlayElementLabelMax ); 631 m_acTEncTop[layer].setOverlaySEILanguage ( m_overlayLanguage ); 632 m_acTEncTop[layer].setOverlaySEIName ( m_overlayName ); 633 m_acTEncTop[layer].setOverlaySEIElementName ( m_overlayElementName ); 634 m_acTEncTop[layer].setOverlaySEIPersistenceFlag ( m_overlayInfoPersistenceFlag ); 635 #endif 636 #if Q0074_COLOUR_REMAPPING_SEI 637 m_acTEncTop[layer].setCRISEIFileRoot ( const_cast<Char*>(m_acLayerCfg[layer].m_colourRemapSEIFileRoot.c_str()) ); 638 #endif 639 #if LAYERS_NOT_PRESENT_SEI 640 m_acTEncTop[layer].setLayersNotPresentSEIEnabled ( m_layersNotPresentSEIEnabled ); 641 #endif 642 #if Q0189_TMVP_CONSTRAINTS 643 m_acTEncTop[layer].setTMVPConstraintsSEIEnabled ( m_TMVPConstraintsSEIEnabled); 644 #endif 645 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 646 m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled ); 647 m_acTEncTop[layer].setIlNumSetsInMessage ( m_ilNumSetsInMessage ); 648 m_acTEncTop[layer].setSkippedTileSetPresentFlag ( m_skippedTileSetPresentFlag ); 649 m_acTEncTop[layer].setTopLeftTileIndex ( m_topLeftTileIndex ); 650 m_acTEncTop[layer].setBottomRightTileIndex ( m_bottomRightTileIndex ); 651 m_acTEncTop[layer].setIlcIdc ( m_ilcIdc ); 652 #endif 653 m_acTEncTop[layer].setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 654 m_acTEncTop[layer].setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 655 m_acTEncTop[layer].setNumRowsMinus1 ( m_numTileRowsMinus1 ); 656 if(!m_tileUniformSpacingFlag) 657 { 658 m_acTEncTop[layer].setColumnWidth ( m_tileColumnWidth ); 659 m_acTEncTop[layer].setRowHeight ( m_tileRowHeight ); 660 } 661 m_acTEncTop[layer].xCheckGSParameters(); 662 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 663 if(uiTilesCount == 1) 664 { 665 m_bLFCrossTileBoundaryFlag = true; 666 } 667 m_acTEncTop[layer].setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag ); 668 m_acTEncTop[layer].setWaveFrontSynchro ( m_acLayerCfg[layer].m_waveFrontSynchro ); 669 m_acTEncTop[layer].setTMVPModeId ( m_TMVPModeId ); 670 m_acTEncTop[layer].setUseScalingListId ( m_useScalingListId ); 671 m_acTEncTop[layer].setScalingListFile ( m_scalingListFile ); 672 m_acTEncTop[layer].setSignHideFlag ( m_signHideFlag ); 673 #if RC_SHVC_HARMONIZATION 674 m_acTEncTop[layer].setUseRateCtrl ( m_acLayerCfg[layer].getRCEnableRateControl() ); 675 m_acTEncTop[layer].setTargetBitrate ( m_acLayerCfg[layer].getRCTargetBitrate() ); 676 m_acTEncTop[layer].setKeepHierBit ( m_acLayerCfg[layer].getRCKeepHierarchicalBit() ); 677 m_acTEncTop[layer].setLCULevelRC ( m_acLayerCfg[layer].getRCLCULevelRC() ); 678 m_acTEncTop[layer].setUseLCUSeparateModel ( m_acLayerCfg[layer].getRCUseLCUSeparateModel() ); 679 m_acTEncTop[layer].setInitialQP ( m_acLayerCfg[layer].getRCInitialQP() ); 680 m_acTEncTop[layer].setForceIntraQP ( m_acLayerCfg[layer].getRCForceIntraQP() ); 681 #else 682 m_acTEncTop[layer].setUseRateCtrl ( m_RCEnableRateControl ); 683 m_acTEncTop[layer].setTargetBitrate ( m_RCTargetBitrate ); 684 m_acTEncTop[layer].setKeepHierBit ( m_RCKeepHierarchicalBit ); 685 m_acTEncTop[layer].setLCULevelRC ( m_RCLCULevelRC ); 686 m_acTEncTop[layer].setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); 687 m_acTEncTop[layer].setInitialQP ( m_RCInitialQP ); 688 m_acTEncTop[layer].setForceIntraQP ( m_RCForceIntraQP ); 689 #endif 690 m_acTEncTop[layer].setTransquantBypassEnableFlag ( m_TransquantBypassEnableFlag ); 691 m_acTEncTop[layer].setCUTransquantBypassFlagForceValue ( m_CUTransquantBypassFlagForce ); 692 m_acTEncTop[layer].setCostMode ( m_costMode ); 693 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda ( m_recalculateQPAccordingToLambda ); 694 m_acTEncTop[layer].setUseStrongIntraSmoothing ( m_useStrongIntraSmoothing ); 695 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 696 m_acTEncTop[layer].setVuiParametersPresentFlag ( m_vuiParametersPresentFlag ); 697 m_acTEncTop[layer].setAspectRatioInfoPresentFlag ( m_aspectRatioInfoPresentFlag); 698 m_acTEncTop[layer].setAspectRatioIdc ( m_aspectRatioIdc ); 699 m_acTEncTop[layer].setSarWidth ( m_sarWidth ); 700 m_acTEncTop[layer].setSarHeight ( m_sarHeight ); 701 m_acTEncTop[layer].setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag ); 702 m_acTEncTop[layer].setOverscanAppropriateFlag ( m_overscanAppropriateFlag ); 703 m_acTEncTop[layer].setVideoSignalTypePresentFlag ( m_videoSignalTypePresentFlag ); 704 m_acTEncTop[layer].setVideoFormat ( m_videoFormat ); 705 m_acTEncTop[layer].setVideoFullRangeFlag ( m_videoFullRangeFlag ); 706 m_acTEncTop[layer].setColourDescriptionPresentFlag ( m_colourDescriptionPresentFlag ); 707 m_acTEncTop[layer].setColourPrimaries ( m_colourPrimaries ); 708 m_acTEncTop[layer].setTransferCharacteristics ( m_transferCharacteristics ); 709 m_acTEncTop[layer].setMatrixCoefficients ( m_matrixCoefficients ); 710 m_acTEncTop[layer].setChromaLocInfoPresentFlag ( m_chromaLocInfoPresentFlag ); 711 m_acTEncTop[layer].setChromaSampleLocTypeTopField ( m_chromaSampleLocTypeTopField ); 712 m_acTEncTop[layer].setChromaSampleLocTypeBottomField ( m_chromaSampleLocTypeBottomField ); 713 m_acTEncTop[layer].setNeutralChromaIndicationFlag ( m_neutralChromaIndicationFlag ); 714 m_acTEncTop[layer].setDefaultDisplayWindow ( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); 715 m_acTEncTop[layer].setFrameFieldInfoPresentFlag ( m_frameFieldInfoPresentFlag ); 716 m_acTEncTop[layer].setPocProportionalToTimingFlag ( m_pocProportionalToTimingFlag ); 717 m_acTEncTop[layer].setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); 718 m_acTEncTop[layer].setBitstreamRestrictionFlag ( m_bitstreamRestrictionFlag ); 719 m_acTEncTop[layer].setTilesFixedStructureFlag ( m_tilesFixedStructureFlag ); 720 m_acTEncTop[layer].setMotionVectorsOverPicBoundariesFlag ( m_motionVectorsOverPicBoundariesFlag ); 721 m_acTEncTop[layer].setMinSpatialSegmentationIdc ( m_minSpatialSegmentationIdc ); 722 m_acTEncTop[layer].setMaxBytesPerPicDenom ( m_maxBytesPerPicDenom ); 723 m_acTEncTop[layer].setMaxBitsPerMinCuDenom ( m_maxBitsPerMinCuDenom ); 724 m_acTEncTop[layer].setLog2MaxMvLengthHorizontal ( m_log2MaxMvLengthHorizontal ); 725 m_acTEncTop[layer].setLog2MaxMvLengthVertical ( m_log2MaxMvLengthVertical ); 726 m_acTEncTop[layer].setElRapSliceTypeB (layer == 0? 0 : m_elRapSliceBEnabled); 727 m_acTEncTop[layer].setEfficientFieldIRAPEnabled ( m_bEfficientFieldIRAPEnabled ); 728 m_acTEncTop[layer].setHarmonizeGopFirstFieldCoupleEnabled ( m_bHarmonizeGopFirstFieldCoupleEnabled ); 729 730 m_acTEncTop[layer].setSummaryOutFilename ( m_summaryOutFilename ); 731 m_acTEncTop[layer].setSummaryPicFilenameBase ( m_summaryPicFilenameBase ); 732 m_acTEncTop[layer].setSummaryVerboseness ( m_summaryVerboseness ); 341 m_cTEncTop.setNumDirectRefLayers(0); 342 } 733 343 734 344 if( layer > 0 ) 735 345 { 736 346 #if AUXILIARY_PICTURES 737 Int subWidthC = ( m_a cLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;738 Int subHeightC = ( m_a cLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1;347 Int subWidthC = ( m_apcLayerCfg[layer]->m_chromaFormatIDC == CHROMA_420 || m_apcLayerCfg[layer]->m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1; 348 Int subHeightC = ( m_apcLayerCfg[layer]->m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1; 739 349 #else 740 350 Int subWidthC = 2; 741 351 Int subHeightC = 2; 742 352 #endif 743 m_acTEncTop[layer].setNumRefLayerLocationOffsets ( m_acLayerCfg[layer].m_numRefLayerLocationOffsets ); 744 for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++) 745 { 746 m_acTEncTop[layer].setRefLocationOffsetLayerId (i, m_acLayerCfg[layer].m_refLocationOffsetLayerId[i]); 747 m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] ); 748 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 749 subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 750 751 Int rlSubWidthC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1; 752 Int rlSubHeightC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1; 753 754 m_acTEncTop[layer].setRefRegionOffsetPresentFlag ( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] ); 755 m_acTEncTop[layer].getRefLayerWindow(i).setWindow ( rlSubWidthC * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC * m_acLayerCfg[layer].m_refRegionRightOffset[i], 756 rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i], rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]); 757 m_acTEncTop[layer].setResamplePhaseSetPresentFlag ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] ); 758 m_acTEncTop[layer].setPhaseHorLuma ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] ); 759 m_acTEncTop[layer].setPhaseVerLuma ( i, m_acLayerCfg[layer].m_phaseVerLuma[i] ); 760 m_acTEncTop[layer].setPhaseHorChroma ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] ); 761 m_acTEncTop[layer].setPhaseVerChroma ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] ); 762 } 763 } 764 765 m_acTEncTop[layer].setAdaptiveResolutionChange ( m_adaptiveResolutionChange ); 766 m_acTEncTop[layer].setLayerSwitchOffBegin ( m_acLayerCfg[layer].m_layerSwitchOffBegin ); 767 m_acTEncTop[layer].setLayerSwitchOffEnd ( m_acLayerCfg[layer].m_layerSwitchOffEnd ); 768 #if AUXILIARY_PICTURES 769 m_acTEncTop[layer].setChromaFormatIDC ( m_acLayerCfg[layer].m_chromaFormatIDC ); 770 #endif 771 m_acTEncTop[layer].setAltOuputLayerFlag ( m_altOutputLayerFlag ); 772 m_acTEncTop[layer].setCrossLayerBLAFlag ( m_crossLayerBLAFlag ); 353 m_cTEncTop.setNumRefLayerLocationOffsets ( m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets ); 354 for(Int i = 0; i < m_apcLayerCfg[layer]->m_numRefLayerLocationOffsets; i++) 355 { 356 m_cTEncTop.setRefLocationOffsetLayerId ( i, m_apcLayerCfg[layer]->m_refLocationOffsetLayerId[i]); 357 m_cTEncTop.setScaledRefLayerOffsetPresentFlag ( i, m_apcLayerCfg[layer]->m_scaledRefLayerOffsetPresentFlag[i] ); 358 m_cTEncTop.getScaledRefLayerWindow(i).setWindow ( subWidthC * m_apcLayerCfg[layer]->m_scaledRefLayerLeftOffset[i], subWidthC * m_apcLayerCfg[layer]->m_scaledRefLayerRightOffset[i], 359 subHeightC * m_apcLayerCfg[layer]->m_scaledRefLayerTopOffset[i], subHeightC * m_apcLayerCfg[layer]->m_scaledRefLayerBottomOffset[i]); 360 361 Int rlSubWidthC = ( m_apcLayerCfg[i]->m_chromaFormatIDC == CHROMA_420 || m_apcLayerCfg[i]->m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1; 362 Int rlSubHeightC = ( m_apcLayerCfg[i]->m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1; 363 364 m_cTEncTop.setRefRegionOffsetPresentFlag ( i, m_apcLayerCfg[layer]->m_refRegionOffsetPresentFlag[i] ); 365 m_cTEncTop.getRefLayerWindow(i).setWindow ( rlSubWidthC * m_apcLayerCfg[layer]->m_refRegionLeftOffset[i], rlSubWidthC * m_apcLayerCfg[layer]->m_refRegionRightOffset[i], 366 rlSubHeightC * m_apcLayerCfg[layer]->m_refRegionTopOffset[i], rlSubHeightC * m_apcLayerCfg[layer]->m_refRegionBottomOffset[i]); 367 m_cTEncTop.setResamplePhaseSetPresentFlag ( i, m_apcLayerCfg[layer]->m_resamplePhaseSetPresentFlag[i] ); 368 m_cTEncTop.setPhaseHorLuma ( i, m_apcLayerCfg[layer]->m_phaseHorLuma[i] ); 369 m_cTEncTop.setPhaseVerLuma ( i, m_apcLayerCfg[layer]->m_phaseVerLuma[i] ); 370 m_cTEncTop.setPhaseHorChroma ( i, m_apcLayerCfg[layer]->m_phaseHorChroma[i] ); 371 m_cTEncTop.setPhaseVerChroma ( i, m_apcLayerCfg[layer]->m_phaseVerChroma[i] ); 372 } 373 } 374 375 m_cTEncTop.setAdaptiveResolutionChange ( m_adaptiveResolutionChange ); 376 m_cTEncTop.setLayerSwitchOffBegin ( m_apcLayerCfg[layer]->m_layerSwitchOffBegin ); 377 m_cTEncTop.setLayerSwitchOffEnd ( m_apcLayerCfg[layer]->m_layerSwitchOffEnd ); 378 m_cTEncTop.setChromaFormatIDC ( m_apcLayerCfg[layer]->m_chromaFormatIDC ); 379 m_cTEncTop.setAltOuputLayerFlag ( m_altOutputLayerFlag ); 380 m_cTEncTop.setCrossLayerBLAFlag ( m_crossLayerBLAFlag ); 773 381 #if CGS_3D_ASYMLUT 774 m_ acTEncTop[layer].setCGSFlag ( layer == 0 ? 0 : m_nCGSFlag );775 m_ acTEncTop[layer].setCGSMaxOctantDepth ( m_nCGSMaxOctantDepth );776 m_ acTEncTop[layer].setCGSMaxYPartNumLog2 ( m_nCGSMaxYPartNumLog2 );777 m_ acTEncTop[layer].setCGSLUTBit ( m_nCGSLUTBit );778 m_ acTEncTop[layer].setCGSAdaptChroma ( m_nCGSAdaptiveChroma );382 m_cTEncTop.setCGSFlag ( layer == 0 ? 0 : m_nCGSFlag ); 383 m_cTEncTop.setCGSMaxOctantDepth ( m_nCGSMaxOctantDepth ); 384 m_cTEncTop.setCGSMaxYPartNumLog2 ( m_nCGSMaxYPartNumLog2 ); 385 m_cTEncTop.setCGSLUTBit ( m_nCGSLUTBit ); 386 m_cTEncTop.setCGSAdaptChroma ( m_nCGSAdaptiveChroma ); 779 387 #if R0179_ENC_OPT_3DLUT_SIZE 780 m_acTEncTop[layer].setCGSLutSizeRDO ( m_nCGSLutSizeRDO ); 781 #endif 782 #endif 783 m_acTEncTop[layer].setNumAddLayerSets ( m_numAddLayerSets ); 784 } 785 } 786 #else //SVC_EXTENSION 787 Void TAppEncTop::xInitLibCfg() 788 { 789 TComVPS vps; 790 791 vps.setMaxTLayers ( m_maxTempLayer ); 792 if (m_maxTempLayer == 1) 793 { 794 vps.setTemporalNestingFlag(true); 795 } 796 vps.setMaxLayers ( 1 ); 797 for(Int i = 0; i < MAX_TLAYER; i++) 798 { 799 vps.setNumReorderPics ( m_numReorderPics[i], i ); 800 vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 801 } 802 m_cTEncTop.setVPS(&vps); 388 m_cTEncTop.setCGSLutSizeRDO ( m_nCGSLutSizeRDO ); 389 #endif 390 #endif 391 m_cTEncTop.setNumAddLayerSets ( m_numAddLayerSets ); 392 393 #if P0123_ALPHA_CHANNEL_SEI 394 m_cTEncTop.setAlphaSEIEnabled ( m_alphaSEIEnabled ); 395 m_cTEncTop.setAlphaCancelFlag ( m_alphaCancelFlag ); 396 m_cTEncTop.setAlphaUseIdc ( m_alphaUseIdc ); 397 m_cTEncTop.setAlphaBitDepthMinus8 ( m_alphaBitDepthMinus8 ); 398 m_cTEncTop.setAlphaTransparentValue ( m_alphaTransparentValue ); 399 m_cTEncTop.setAlphaOpaqueValue ( m_alphaOpaqueValue ); 400 m_cTEncTop.setAlphaIncrementFlag ( m_alphaIncrementFlag ); 401 m_cTEncTop.setAlphaClipFlag ( m_alphaClipFlag ); 402 m_cTEncTop.setAlphaClipTypeFlag ( m_alphaClipTypeFlag ); 403 #endif 404 #if Q0096_OVERLAY_SEI 405 m_cTEncTop.setOverlaySEIEnabled ( m_overlaySEIEnabled ); 406 m_cTEncTop.setOverlaySEICancelFlag ( m_overlayInfoCancelFlag ); 407 m_cTEncTop.setOverlaySEIContentAuxIdMinus128 ( m_overlayContentAuxIdMinus128 ); 408 m_cTEncTop.setOverlaySEILabelAuxIdMinus128 ( m_overlayLabelAuxIdMinus128 ); 409 m_cTEncTop.setOverlaySEIAlphaAuxIdMinus128 ( m_overlayAlphaAuxIdMinus128 ); 410 m_cTEncTop.setOverlaySEIElementLabelValueLengthMinus8 ( m_overlayElementLabelValueLengthMinus8 ); 411 m_cTEncTop.setOverlaySEINumOverlaysMinus1 ( m_numOverlaysMinus1 ); 412 m_cTEncTop.setOverlaySEIIdx ( m_overlayIdx ); 413 m_cTEncTop.setOverlaySEILanguagePresentFlag ( m_overlayLanguagePresentFlag ); 414 m_cTEncTop.setOverlaySEIContentLayerId ( m_overlayContentLayerId ); 415 m_cTEncTop.setOverlaySEILabelPresentFlag ( m_overlayLabelPresentFlag ); 416 m_cTEncTop.setOverlaySEILabelLayerId ( m_overlayLabelLayerId ); 417 m_cTEncTop.setOverlaySEIAlphaPresentFlag ( m_overlayAlphaPresentFlag ); 418 m_cTEncTop.setOverlaySEIAlphaLayerId ( m_overlayAlphaLayerId ); 419 m_cTEncTop.setOverlaySEINumElementsMinus1 ( m_numOverlayElementsMinus1 ); 420 m_cTEncTop.setOverlaySEIElementLabelMin ( m_overlayElementLabelMin ); 421 m_cTEncTop.setOverlaySEIElementLabelMax ( m_overlayElementLabelMax ); 422 m_cTEncTop.setOverlaySEILanguage ( m_overlayLanguage ); 423 m_cTEncTop.setOverlaySEIName ( m_overlayName ); 424 m_cTEncTop.setOverlaySEIElementName ( m_overlayElementName ); 425 m_cTEncTop.setOverlaySEIPersistenceFlag ( m_overlayInfoPersistenceFlag ); 426 #endif 427 #if Q0189_TMVP_CONSTRAINTS 428 m_cTEncTop.setTMVPConstraintsSEIEnabled ( m_TMVPConstraintsSEIEnabled); 429 #endif 430 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 431 m_cTEncTop.setInterLayerConstrainedTileSetsSEIEnabled ( m_interLayerConstrainedTileSetsSEIEnabled ); 432 m_cTEncTop.setIlNumSetsInMessage ( m_ilNumSetsInMessage ); 433 m_cTEncTop.setSkippedTileSetPresentFlag ( m_skippedTileSetPresentFlag ); 434 m_cTEncTop.setTopLeftTileIndex ( m_topLeftTileIndex ); 435 m_cTEncTop.setBottomRightTileIndex ( m_bottomRightTileIndex ); 436 m_cTEncTop.setIlcIdc ( m_ilcIdc ); 437 #endif 438 439 Int layerPTLIdx = m_apcLayerCfg[layer]->m_layerPTLIdx; 440 441 Profile::Name m_profile = m_profileList[layerPTLIdx]; 442 Level::Tier m_levelTier = m_levelTierList[layerPTLIdx]; 443 Level::Name m_level = m_levelList[layerPTLIdx]; 444 UInt m_bitDepthConstraint = m_apcLayerCfg[layer]->m_bitDepthConstraint; 445 ChromaFormat m_chromaFormatConstraint = m_apcLayerCfg[layer]->m_chromaFormatConstraint; 446 Bool m_intraConstraintFlag = m_apcLayerCfg[layer]->m_intraConstraintFlag; 447 Bool m_onePictureOnlyConstraintFlag = m_apcLayerCfg[layer]->m_onePictureOnlyConstraintFlag; 448 Bool m_lowerBitRateConstraintFlag = m_apcLayerCfg[layer]->m_lowerBitRateConstraintFlag; 449 Bool m_progressiveSourceFlag = m_progressiveSourceFlagList[layerPTLIdx]; 450 Bool m_interlacedSourceFlag = m_interlacedSourceFlagList[layerPTLIdx]; 451 Bool m_nonPackedConstraintFlag = m_nonPackedConstraintFlagList[layerPTLIdx]; 452 Bool m_frameOnlyConstraintFlag = m_frameOnlyConstraintFlagList[layerPTLIdx]; 453 454 Int m_iFrameRate = m_apcLayerCfg[layer]->getFrameRate(); 455 Int m_iSourceWidth = m_apcLayerCfg[layer]->getSourceWidth(); 456 Int m_iSourceHeight = m_apcLayerCfg[layer]->getSourceHeight(); 457 Int m_confWinLeft = m_apcLayerCfg[layer]->m_confWinLeft; 458 Int m_confWinRight = m_apcLayerCfg[layer]->m_confWinRight; 459 Int m_confWinTop = m_apcLayerCfg[layer]->m_confWinTop; 460 Int m_confWinBottom = m_apcLayerCfg[layer]->m_confWinBottom; 461 462 Int m_iIntraPeriod = m_apcLayerCfg[layer]->m_iIntraPeriod; 463 Int m_iQP = m_apcLayerCfg[layer]->getIntQP(); 464 Int *m_aiPad = m_apcLayerCfg[layer]->getPad(); 465 466 Int m_iMaxCuDQPDepth = m_apcLayerCfg[layer]->m_iMaxCuDQPDepth; 467 ChromaFormat m_chromaFormatIDC = m_apcLayerCfg[layer]->m_chromaFormatIDC; 468 Bool m_extendedPrecisionProcessingFlag = m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag; 469 Bool m_highPrecisionOffsetsEnabledFlag = m_apcLayerCfg[layer]->m_highPrecisionOffsetsEnabledFlag; 470 Int *m_aidQP = m_apcLayerCfg[layer]->getdQPs(); 471 472 UInt m_uiMaxCUWidth = m_apcLayerCfg[layer]->m_uiMaxCUWidth; 473 UInt m_uiMaxCUHeight = m_apcLayerCfg[layer]->m_uiMaxCUHeight; 474 UInt m_uiMaxTotalCUDepth = m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth; 475 UInt m_uiLog2DiffMaxMinCodingBlockSize = m_apcLayerCfg[layer]->m_uiLog2DiffMaxMinCodingBlockSize; 476 UInt m_uiQuadtreeTULog2MaxSize = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MaxSize; 477 UInt m_uiQuadtreeTULog2MinSize = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MinSize; 478 UInt m_uiQuadtreeTUMaxDepthInter = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthInter; 479 UInt m_uiQuadtreeTUMaxDepthIntra = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthIntra; 480 481 Int m_iWaveFrontSynchro = m_apcLayerCfg[layer]->m_waveFrontSynchro; 482 Bool m_RCEnableRateControl = m_apcLayerCfg[layer]->getRCEnableRateControl(); 483 Int m_RCTargetBitrate = m_apcLayerCfg[layer]->getRCTargetBitrate(); 484 Bool m_RCKeepHierarchicalBit = m_apcLayerCfg[layer]->getRCKeepHierarchicalBit(); 485 Bool m_RCLCULevelRC = m_apcLayerCfg[layer]->getRCLCULevelRC(); 486 Bool m_RCUseLCUSeparateModel = m_apcLayerCfg[layer]->getRCUseLCUSeparateModel(); 487 Int m_RCInitialQP = m_apcLayerCfg[layer]->getRCInitialQP(); 488 Bool m_RCForceIntraQP = m_apcLayerCfg[layer]->getRCForceIntraQP(); 489 #endif 803 490 804 491 m_cTEncTop.setProfile ( m_profile); … … 830 517 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); 831 518 m_cTEncTop.setGOPSize ( m_iGOPSize ); 519 #if SVC_EXTENSION 520 m_cTEncTop.setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 521 m_cTEncTop.setExtraRPSs ( m_extraRPSs[layer] ); 522 #else 832 523 m_cTEncTop.setGopList ( m_GOPList ); 833 524 m_cTEncTop.setExtraRPSs ( m_extraRPSs ); 525 #endif 526 834 527 for(Int i = 0; i < MAX_TLAYER; i++) 835 528 { … … 845 538 m_cTEncTop.setPad ( m_aiPad ); 846 539 540 #if SVC_EXTENSION 541 m_cTEncTop.setMaxTempLayer ( layer ? m_EhMaxTempLayer[layer] : m_maxTempLayer ); 542 #else 847 543 m_cTEncTop.setMaxTempLayer ( m_maxTempLayer ); 544 #endif 848 545 m_cTEncTop.setUseAMP( m_enableAMP ); 849 546 … … 907 604 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); 908 605 m_cTEncTop.setUseEarlySkipDetection ( m_useEarlySkipDetection ); 909 #if FAST_INTRA_SHVC910 m_cTEncTop.setUseFastIntraScalable ( m_useFastIntraScalable );911 #endif912 606 m_cTEncTop.setCrossComponentPredictionEnabledFlag ( m_crossComponentPredictionEnabledFlag ); 913 607 m_cTEncTop.setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); … … 935 629 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 936 630 { 631 #if SVC_EXTENSION 632 m_cTEncTop.setBitDepth((ChannelType)channelType, m_apcLayerCfg[layer]->m_internalBitDepth[channelType]); 633 m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_apcLayerCfg[layer]->m_MSBExtendedBitDepth[channelType] : m_apcLayerCfg[layer]->m_internalBitDepth[channelType]); 634 #else 937 635 m_cTEncTop.setBitDepth((ChannelType)channelType, m_internalBitDepth[channelType]); 938 636 m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType]); 637 #endif 939 638 } 940 639 … … 1042 741 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 1043 742 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 1044 #if Q0074_COLOUR_REMAPPING_SEI 1045 m_cTEncTop.setCRISEIFileRoot ( const_cast<Char*>(m_colourRemapSEIFileRoot.c_str()) ); 1046 #endif 1047 #if LAYERS_NOT_PRESENT_SEI 1048 m_cTEncTop.setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled ); 1049 #endif 743 1050 744 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 1051 745 m_cTEncTop.setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); … … 1117 811 m_cTEncTop.setSummaryPicFilenameBase ( m_summaryPicFilenameBase ); 1118 812 m_cTEncTop.setSummaryVerboseness ( m_summaryVerboseness ); 813 814 #if FAST_INTRA_SHVC 815 m_cTEncTop.setUseFastIntraScalable ( m_useFastIntraScalable ); 816 #endif 817 #if Q0074_COLOUR_REMAPPING_SEI 818 #if SVC_EXTENSION 819 m_cTEncTop.setCRISEIFileRoot ( const_cast<Char*>(m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot.c_str()) ); 820 #else 821 m_cTEncTop.setCRISEIFileRoot ( const_cast<Char*>(m_colourRemapSEIFileRoot.c_str()) ); 822 #endif 823 #endif 824 #if LAYERS_NOT_PRESENT_SEI 825 m_cTEncTop.setLayersNotPresentSEIEnabled ( m_layersNotPresentSEIEnabled ); 826 #endif 827 828 829 #if SVC_EXTENSION 830 if( layer != 0 && m_useInterLayerWeightedPred ) 831 { 832 // Enable weighted prediction for enhancement layer 833 m_cTEncTop.setUseWP ( true ); 834 m_cTEncTop.setWPBiPred ( true ); 835 } 836 837 } 838 #endif 1119 839 } 1120 #endif //SVC_EXTENSION1121 840 1122 841 Void TAppEncTop::xCreateLib() … … 1131 850 //2 1132 851 // Video I/O 1133 m_a cTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepth, m_acLayerCfg[layer].m_MSBExtendedBitDepth, m_acLayerCfg[layer].m_internalBitDepth ); // read mode1134 m_a cTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1], m_acLayerCfg[layer].m_InputChromaFormatIDC);1135 1136 if( !m_a cLayerCfg[layer].getReconFile().empty() )1137 { 1138 m_a cTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepth, m_acLayerCfg[layer].m_MSBExtendedBitDepth, m_acLayerCfg[layer].m_internalBitDepth ); // write mode852 m_apcTVideoIOYuvInputFile[layer]->open( (Char *)m_apcLayerCfg[layer]->getInputFile().c_str(), false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // read mode 853 m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_FrameSkip, m_apcLayerCfg[layer]->getSourceWidth() - m_apcLayerCfg[layer]->getPad()[0], m_apcLayerCfg[layer]->getSourceHeight() - m_apcLayerCfg[layer]->getPad()[1], m_apcLayerCfg[layer]->m_InputChromaFormatIDC); 854 855 if( !m_apcLayerCfg[layer]->getReconFile().empty() ) 856 { 857 m_apcTVideoIOYuvReconFile[layer]->open((Char *)m_apcLayerCfg[layer]->getReconFile().c_str(), true, m_apcLayerCfg[layer]->m_outputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // write mode 1139 858 } 1140 859 1141 860 // Neo Decoder 1142 m_a cTEncTop[layer].create();861 m_apcTEncTop[layer]->create(); 1143 862 } 1144 863 #else //SVC_EXTENSION … … 1164 883 destroyROM(); 1165 884 1166 for(UInt layer=0; layer<m_numLayers; layer++) 1167 { 1168 #if LAYER_CTB 1169 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1170 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1171 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1172 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1173 #endif 1174 1175 m_acTVideoIOYuvInputFile[layer].close(); 1176 m_acTVideoIOYuvReconFile[layer].close(); 1177 1178 m_acTEncTop[layer].destroy(); 885 for( UInt layer=0; layer < m_numLayers; layer++ ) 886 { 887 if( m_apcTVideoIOYuvInputFile[layer] ) 888 { 889 m_apcTVideoIOYuvInputFile[layer]->close(); 890 delete m_apcTVideoIOYuvInputFile[layer]; 891 m_apcTVideoIOYuvInputFile[layer] = NULL; 892 } 893 894 if( m_apcTVideoIOYuvReconFile[layer] ) 895 { 896 m_apcTVideoIOYuvReconFile[layer]->close(); 897 delete m_apcTVideoIOYuvReconFile[layer]; 898 m_apcTVideoIOYuvReconFile[layer] = NULL; 899 } 900 901 if( m_apcTEncTop[layer] ) 902 { 903 m_apcTEncTop[layer]->destroy(); 904 delete m_apcTEncTop[layer]; 905 m_apcTEncTop[layer] = NULL; 906 } 1179 907 } 1180 908 #else //SVC_EXTENSION … … 1190 918 { 1191 919 #if SVC_EXTENSION 1192 TComVPS* vps = m_a cTEncTop[0].getVPS();1193 m_a cTEncTop[0].getVPS()->setMaxLayers( m_numLayers );920 TComVPS* vps = m_apcTEncTop[0]->getVPS(); 921 m_apcTEncTop[0]->getVPS()->setMaxLayers( m_numLayers ); 1194 922 1195 923 UInt i = 0, dimIdLen = 0; … … 1205 933 for(i = 1; i < vps->getMaxLayers(); i++) 1206 934 { 1207 vps->setLayerIdInNuh(i, m_a cLayerCfg[i].m_layerId);935 vps->setLayerIdInNuh(i, m_apcLayerCfg[i]->m_layerId); 1208 936 vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i); 1209 937 vps->setDimensionId(i, 0, i); 1210 938 1211 if( m_a cLayerCfg[i].m_layerId != i )939 if( m_apcLayerCfg[i]->m_layerId != i ) 1212 940 { 1213 941 vps->setNuhLayerIdPresentFlag(true); … … 1224 952 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1225 953 #endif 1226 m_a cTEncTop[layer].init(isFieldCoding);954 m_apcTEncTop[layer]->init(isFieldCoding); 1227 955 } 1228 956 1229 957 // Set max-layer ID 1230 vps->setMaxLayerId( m_a cLayerCfg[m_numLayers - 1].m_layerId );958 vps->setMaxLayerId( m_apcLayerCfg[m_numLayers - 1]->m_layerId ); 1231 959 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1232 960 … … 1338 1066 for(i = 1; i < vps->getMaxLayers(); i++) 1339 1067 { 1340 if (m_a cLayerCfg[i].getAuxId() > maxAuxId)1341 { 1342 maxAuxId = m_a cLayerCfg[i].getAuxId();1068 if (m_apcLayerCfg[i]->getAuxId() > maxAuxId) 1069 { 1070 maxAuxId = m_apcLayerCfg[i]->getAuxId(); 1343 1071 } 1344 1072 } … … 1350 1078 for(i = 1; i < vps->getMaxLayers(); i++) 1351 1079 { 1352 vps->setDimensionId(i, auxId, m_a cLayerCfg[i].getAuxId());1080 vps->setDimensionId(i, auxId, m_apcLayerCfg[i]->getAuxId()); 1353 1081 } 1354 1082 } … … 1369 1097 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1370 1098 { 1371 vps->setMaxTidIlRefPicsPlus1(i, j, m_a cTEncTop[i].getMaxTidIlRefPicsPlus1());1099 vps->setMaxTidIlRefPicsPlus1(i, j, m_apcTEncTop[i]->getMaxTidIlRefPicsPlus1()); 1372 1100 } 1373 1101 } … … 1394 1122 Int numDirectRefLayers = 0; 1395 1123 1396 vps->setNumDirectRefLayers(layerId, m_a cTEncTop[layerCtr].getNumDirectRefLayers());1124 vps->setNumDirectRefLayers(layerId, m_apcTEncTop[layerCtr]->getNumDirectRefLayers()); 1397 1125 maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerId)); 1398 1126 1399 1127 for (i = 0; i < vps->getNumDirectRefLayers(layerId); i++) 1400 1128 { 1401 vps->setRefLayerId(layerId, i, m_a cTEncTop[layerCtr].getRefLayerId(i));1129 vps->setRefLayerId(layerId, i, m_apcTEncTop[layerCtr]->getRefLayerId(i)); 1402 1130 } 1403 1131 // Set direct dependency flag … … 1409 1137 for (i = 0; i < vps->getNumDirectRefLayers(layerId); i++) 1410 1138 { 1411 vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdxInVps(m_a cTEncTop[layerCtr].getRefLayerId(i)), true);1139 vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdxInVps(m_apcTEncTop[layerCtr]->getRefLayerId(i)), true); 1412 1140 } 1413 1141 // prediction indications … … 1417 1145 if (vps->getDirectDependencyFlag(layerCtr, refLayerCtr)) 1418 1146 { 1419 assert(m_a cTEncTop[layerCtr].getSamplePredEnabledFlag(numDirectRefLayers) || m_acTEncTop[layerCtr].getMotionPredEnabledFlag(numDirectRefLayers));1420 vps->setDirectDependencyType(layerCtr, refLayerCtr, ((m_a cTEncTop[layerCtr].getSamplePredEnabledFlag(numDirectRefLayers) ? 1 : 0) |1421 (m_a cTEncTop[layerCtr].getMotionPredEnabledFlag(numDirectRefLayers) ? 2 : 0)) - 1);1147 assert(m_apcTEncTop[layerCtr]->getSamplePredEnabledFlag(numDirectRefLayers) || m_apcTEncTop[layerCtr]->getMotionPredEnabledFlag(numDirectRefLayers)); 1148 vps->setDirectDependencyType(layerCtr, refLayerCtr, ((m_apcTEncTop[layerCtr]->getSamplePredEnabledFlag(numDirectRefLayers) ? 1 : 0) | 1149 (m_apcTEncTop[layerCtr]->getMotionPredEnabledFlag(numDirectRefLayers) ? 2 : 0)) - 1); 1422 1150 1423 1151 if (!isDefaultDirectDependencyTypeSet) … … 1535 1263 { 1536 1264 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set 1537 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_a cTEncTop[vps->getLayerIdxInVps(layerId)].getMaxDecPicBuffering(j) - 1 );1538 maxNumReorderPics = std::max( maxNumReorderPics, m_a cTEncTop[vps->getLayerIdxInVps(layerId)].getNumReorderPics(j));1265 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_apcTEncTop[vps->getLayerIdxInVps(layerId)]->getMaxDecPicBuffering(j) - 1 ); 1266 maxNumReorderPics = std::max( maxNumReorderPics, m_apcTEncTop[vps->getLayerIdxInVps(layerId)]->getNumReorderPics(j)); 1539 1267 } 1540 1268 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); … … 1572 1300 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1573 1301 { 1574 if(m_a cTEncTop[layerCtr].getIntraPeriod() != m_acTEncTop[refLayerCtr].getIntraPeriod())1302 if(m_apcTEncTop[layerCtr]->getIntraPeriod() != m_apcTEncTop[refLayerCtr]->getIntraPeriod()) 1575 1303 { 1576 1304 vps->setCrossLayerIrapAlignFlag(false); … … 1590 1318 // VPS VUI BSP HRD parameters 1591 1319 vps->setVpsVuiBspHrdPresentFlag(false); 1592 TEncTop *pcCfg = &m_acTEncTop[0];1320 TEncTop *pcCfg = m_apcTEncTop[0]; 1593 1321 if( pcCfg->getBufferingPeriodSEIEnabled() ) 1594 1322 { … … 1603 1331 1604 1332 UInt layerIdx = j; 1605 TEncTop *pcCfgLayer = &m_acTEncTop[layerIdx];1333 TEncTop *pcCfgLayer = m_apcTEncTop[layerIdx]; 1606 1334 1607 1335 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1608 1336 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1609 1337 1610 UInt uiWidthInCU = ( iPicWidth % m_a cLayerCfg[layerIdx].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerIdx].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerIdx].m_uiMaxCUWidth;1611 UInt uiHeightInCU = ( iPicHeight % m_a cLayerCfg[layerIdx].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight;1612 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_a cLayerCfg[layerIdx].m_uiMaxCUDepth << 1);1338 UInt uiWidthInCU = ( iPicWidth % m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth ) ? iPicWidth / m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth + 1 : iPicWidth / m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth; 1339 UInt uiHeightInCU = ( iPicHeight % m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight ) ? iPicHeight / m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight + 1 : iPicHeight / m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight; 1340 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth << 1); 1613 1341 1614 1342 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; … … 1689 1417 } 1690 1418 1419 // allocated memory 1420 for( Int layer = 0; layer < m_numLayers; layer++ ) 1421 { 1422 m_apcTVideoIOYuvInputFile[layer] = new TVideoIOYuv; 1423 m_apcTVideoIOYuvReconFile[layer] = new TVideoIOYuv; 1424 m_apcTEncTop[layer] = new TEncTop; 1425 } 1426 1691 1427 TComPicYuv* pcPicYuvOrg [MAX_LAYERS]; 1692 1428 TComPicYuv* pcPicYuvRec = NULL; … … 1715 1451 if( m_isField ) 1716 1452 { 1717 pcPicYuvOrg[layer]->create( m_a cLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );1718 acPicYuvTrueOrg[layer].create( m_a cLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );1453 pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeightOrg(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL ); 1454 acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeightOrg(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL ); 1719 1455 } 1720 1456 else 1721 1457 { 1722 pcPicYuvOrg[layer]->create( m_a cLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );1723 acPicYuvTrueOrg[layer].create( m_a cLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );1458 pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL ); 1459 acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL ); 1724 1460 } 1725 1461 } … … 1735 1471 { 1736 1472 //6 1737 #if LAYER_CTB1738 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer];1739 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];1740 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer];1741 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer];1742 #endif1743 1744 1473 // get buffers 1745 1474 xGetBuffer(pcPicYuvRec, layer); 1746 1475 1747 1476 // read input YUV file 1748 m_a cTVideoIOYuvInputFile[layer].read( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], ipCSC, m_acLayerCfg[layer].getPad(), m_acLayerCfg[layer].getInputChromaFormat(), m_bClipInputVideoToRec709Range );1477 m_apcTVideoIOYuvInputFile[layer]->read( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], ipCSC, m_apcLayerCfg[layer]->getPad(), m_apcLayerCfg[layer]->getInputChromaFormat(), m_bClipInputVideoToRec709Range ); 1749 1478 1750 1479 #if AUXILIARY_PICTURES 1751 if( m_a cLayerCfg[layer].getChromaFormatIDC() == CHROMA_400 || (m_apcTEncTop[0]->getVPS()->getScalabilityMask(AUX_ID) && (m_acLayerCfg[layer].getAuxId() == AUX_ALPHA || m_acLayerCfg[layer].getAuxId() == AUX_DEPTH)) )1752 { 1753 pcPicYuvOrg[layer]->convertToMonochrome(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1480 if( m_apcLayerCfg[layer]->getChromaFormatIDC() == CHROMA_400 || (m_apcTEncTop[0]->getVPS()->getScalabilityMask(AUX_ID) && (m_apcLayerCfg[layer]->getAuxId() == AUX_ALPHA || m_apcLayerCfg[layer]->getAuxId() == AUX_DEPTH)) ) 1481 { 1482 pcPicYuvOrg[layer]->convertToMonochrome(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1754 1483 } 1755 1484 #endif … … 1765 1494 if ( m_isField ) 1766 1495 { 1767 m_a cTEncTop[layer].encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], m_isTopFieldFirst );1496 m_apcTEncTop[layer]->encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], m_isTopFieldFirst ); 1768 1497 } 1769 1498 else 1770 1499 { 1771 m_a cTEncTop[layer].encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer] );1772 } 1773 } 1774 1775 bFramesReadyToCode = !(!bFirstFrame && ( m_a cTEncTop[m_numLayers-1].getNumPicRcvd() != m_iGOPSize && m_iGOPSize ) && !bEos );1500 m_apcTEncTop[layer]->encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer] ); 1501 } 1502 } 1503 1504 bFramesReadyToCode = !(!bFirstFrame && ( m_apcTEncTop[m_numLayers-1]->getNumPicRcvd() != m_iGOPSize && m_iGOPSize ) && !bEos ); 1776 1505 } 1777 1506 Bool flush = 0; 1778 1507 // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures 1779 if (m_a cTVideoIOYuvInputFile[m_numLayers-1].isEof())1508 if (m_apcTVideoIOYuvInputFile[m_numLayers-1]->isEof()) 1780 1509 { 1781 1510 flush = true; 1782 1511 bEos = true; 1783 1512 m_iFrameRcvd--; 1784 m_a cTEncTop[m_numLayers-1].setFramesToBeEncoded(m_iFrameRcvd);1513 m_apcTEncTop[m_numLayers-1]->setFramesToBeEncoded(m_iFrameRcvd); 1785 1514 } 1786 1515 1787 1516 #if RC_SHVC_HARMONIZATION 1788 for( UInt layer=0; layer<m_numLayers; layer++)1789 { 1790 if ( m_acTEncTop[layer].getUseRateCtrl() )1791 { 1792 (m_acTEncTop[layer].getRateCtrl())->initRCGOP(m_acTEncTop[layer].getNumPicRcvd());1517 for( UInt layer=0; layer<m_numLayers; layer++ ) 1518 { 1519 if( m_apcTEncTop[layer]->getUseRateCtrl() ) 1520 { 1521 m_apcTEncTop[layer]->getRateCtrl()->initRCGOP(m_apcTEncTop[layer]->getNumPicRcvd()); 1793 1522 } 1794 1523 } … … 1824 1553 if ( m_isField ) 1825 1554 { 1826 m_a cTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst );1555 m_apcTEncTop[layer]->encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst ); 1827 1556 } 1828 1557 else 1829 1558 { 1830 m_a cTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP );1559 m_apcTEncTop[layer]->encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 1831 1560 } 1832 1561 } … … 1867 1596 for(UInt layer=0; layer<m_numLayers; layer++) 1868 1597 { 1869 if ( m_a cTEncTop[layer].getUseRateCtrl() )1870 { 1871 (m_a cTEncTop[layer].getRateCtrl())->destroyRCGOP();1598 if ( m_apcTEncTop[layer]->getUseRateCtrl() ) 1599 { 1600 (m_apcTEncTop[layer]->getRateCtrl())->destroyRCGOP(); 1872 1601 } 1873 1602 } … … 1879 1608 //8 1880 1609 // write bistream to file if necessary 1881 iNumEncoded = m_a cTEncTop[layer].getNumPicRcvd();1610 iNumEncoded = m_apcTEncTop[layer]->getNumPicRcvd(); 1882 1611 if ( iNumEncoded > 0 ) 1883 1612 { … … 1885 1614 iTotalNumEncoded += iNumEncoded; 1886 1615 } 1887 m_a cTEncTop[layer].setNumPicRcvd( 0 );1616 m_apcTEncTop[layer]->setNumPicRcvd( 0 ); 1888 1617 } 1889 1618 … … 1921 1650 1922 1651 // delete used buffers in encoder class 1923 m_a cTEncTop[layer].deletePicBuffer();1652 m_apcTEncTop[layer]->deletePicBuffer(); 1924 1653 acPicYuvTrueOrg[layer].destroy(); 1925 1654 } … … 1943 1672 for(layer = 0; layer < m_numLayers; layer++) 1944 1673 { 1945 m_apcTEncTop[layer]->getAnalyzeAll()->setFrmRate( m_a cLayerCfg[layer].getFrameRate() * rateMultiplier );1946 m_apcTEncTop[layer]->getAnalyzeI()->setFrmRate( m_a cLayerCfg[layer].getFrameRate() * rateMultiplier );1947 m_apcTEncTop[layer]->getAnalyzeP()->setFrmRate( m_a cLayerCfg[layer].getFrameRate() * rateMultiplier );1948 m_apcTEncTop[layer]->getAnalyzeB()->setFrmRate( m_a cLayerCfg[layer].getFrameRate() * rateMultiplier );1674 m_apcTEncTop[layer]->getAnalyzeAll()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier ); 1675 m_apcTEncTop[layer]->getAnalyzeI()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier ); 1676 m_apcTEncTop[layer]->getAnalyzeP()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier ); 1677 m_apcTEncTop[layer]->getAnalyzeB()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier ); 1949 1678 } 1950 1679 … … 1953 1682 for(layer = 0; layer < m_numLayers; layer++) 1954 1683 { 1955 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1956 m_apcTEncTop[layer]->getAnalyzeAll()->printOut('a', m_a cLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);1684 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1685 m_apcTEncTop[layer]->getAnalyzeAll()->printOut('a', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1957 1686 } 1958 1687 … … 1960 1689 for(layer = 0; layer < m_numLayers; layer++) 1961 1690 { 1962 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1963 m_apcTEncTop[layer]->getAnalyzeI()->printOut('i', m_a cLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);1691 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1692 m_apcTEncTop[layer]->getAnalyzeI()->printOut('i', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1964 1693 } 1965 1694 … … 1967 1696 for(layer = 0; layer < m_numLayers; layer++) 1968 1697 { 1969 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1970 m_apcTEncTop[layer]->getAnalyzeP()->printOut('p', m_a cLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);1698 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1699 m_apcTEncTop[layer]->getAnalyzeP()->printOut('p', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1971 1700 } 1972 1701 … … 1974 1703 for(layer = 0; layer < m_numLayers; layer++) 1975 1704 { 1976 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1977 m_apcTEncTop[layer]->getAnalyzeB()->printOut('b', m_a cLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);1705 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1706 m_apcTEncTop[layer]->getAnalyzeB()->printOut('b', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 1978 1707 } 1979 1708 … … 1982 1711 if (!m_apcTEncTop[layer]->getSummaryOutFilename().empty()) 1983 1712 { 1984 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1985 1986 m_apcTEncTop[layer]->getAnalyzeAll()->printSummary(m_a cLayerCfg[layer].getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());1713 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1714 1715 m_apcTEncTop[layer]->getAnalyzeAll()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename()); 1987 1716 } 1988 1717 } … … 1992 1721 if (!m_apcTEncTop[layer]->getSummaryPicFilenameBase().empty()) 1993 1722 { 1994 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1995 1996 m_apcTEncTop[layer]->getAnalyzeI()->printSummary(m_a cLayerCfg[layer].getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"I.txt");1997 m_apcTEncTop[layer]->getAnalyzeP()->printSummary(m_a cLayerCfg[layer].getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"P.txt");1998 m_apcTEncTop[layer]->getAnalyzeB()->printSummary(m_a cLayerCfg[layer].getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"B.txt");1723 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1724 1725 m_apcTEncTop[layer]->getAnalyzeI()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"I.txt"); 1726 m_apcTEncTop[layer]->getAnalyzeP()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"P.txt"); 1727 m_apcTEncTop[layer]->getAnalyzeB()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"B.txt"); 1999 1728 } 2000 1729 } … … 2004 1733 for(layer = 0; layer < m_numLayers; layer++) 2005 1734 { 2006 const BitDepths bitDepths(m_a cLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);1735 const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 2007 1736 TEncAnalyze *analyze = m_apcTEncTop[layer]->getAnalyzeAllin(); 2008 1737 2009 1738 //-- interlaced summary 2010 analyze->setFrmRate( m_a cLayerCfg[layer].getFrameRate());1739 analyze->setFrmRate( m_apcLayerCfg[layer]->getFrameRate()); 2011 1740 analyze->setBits(m_apcTEncTop[layer]->getAnalyzeB()->getBits()); 2012 1741 // prior to the above statement, the interlace analyser does not contain the correct total number of bits. 2013 1742 2014 1743 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 2015 analyze->printOut('a', m_a cLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);1744 analyze->printOut('a', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer); 2016 1745 2017 1746 if (!m_apcTEncTop[layer]->getSummaryOutFilename().empty()) 2018 1747 { 2019 analyze->printSummary(m_a cLayerCfg[layer].getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());1748 analyze->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename()); 2020 1749 } 2021 1750 } … … 2170 1899 rpcPicYuvRec = new TComPicYuv; 2171 1900 2172 rpcPicYuvRec->create( m_a cLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );1901 rpcPicYuvRec->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL ); 2173 1902 } 2174 1903 m_acListPicYuvRec[layer].pushBack( rpcPicYuvRec ); … … 2194 1923 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded) 2195 1924 { 2196 ChromaFormat chromaFormatIdc = m_a cLayerCfg[layer].getChromaFormatIDC();1925 ChromaFormat chromaFormatIdc = m_apcLayerCfg[layer]->getChromaFormatIDC(); 2197 1926 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 2198 1927 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); … … 2216 1945 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 2217 1946 2218 if( !m_a cLayerCfg[layer].getReconFile().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() )2219 { 2220 m_a cTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,2221 m_a cLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, NUM_CHROMA_FORMAT, m_isTopFieldFirst );1947 if( !m_apcLayerCfg[layer]->getReconFile().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() ) 1948 { 1949 m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal, 1950 m_apcLayerCfg[layer]->getConfWinTop() * yScal, m_apcLayerCfg[layer]->getConfWinBottom() * yScal, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 2222 1951 } 2223 1952 } … … 2237 1966 { 2238 1967 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 2239 if( !m_a cLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed() )2240 { 2241 m_a cTVideoIOYuvReconFile[layer].write( pcPicYuvRec, ipCSC, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,2242 m_a cLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal,1968 if( !m_apcLayerCfg[layer]->getReconFile().empty() && pcPicYuvRec->isReconstructed() ) 1969 { 1970 m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRec, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal, 1971 m_apcLayerCfg[layer]->getConfWinTop() * yScal, m_apcLayerCfg[layer]->getConfWinBottom() * yScal, 2243 1972 NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range ); 2244 1973 } … … 2431 2160 { 2432 2161 #if SVC_EXTENSION 2433 Double time = (Double) m_iFrameRcvd / m_a cLayerCfg[m_numLayers-1].getFrameRate();2162 Double time = (Double) m_iFrameRcvd / m_apcLayerCfg[m_numLayers-1]->getFrameRate(); 2434 2163 #else 2435 2164 Double time = (Double) m_iFrameRcvd / m_iFrameRate; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.h
r1292 r1377 60 60 // class interface 61 61 #if SVC_EXTENSION 62 TEncTop m_acTEncTop [MAX_LAYERS]; ///< encoder class 63 TEncTop* m_apcTEncTop [MAX_LAYERS]; ///< encoder pointer class 64 TVideoIOYuv m_acTVideoIOYuvInputFile [MAX_LAYERS]; ///< input YUV file 65 TVideoIOYuv m_acTVideoIOYuvReconFile [MAX_LAYERS]; ///< output reconstruction file 62 TEncTop* m_apcTEncTop[MAX_LAYERS]; ///< encoder pointer class 63 TVideoIOYuv* m_apcTVideoIOYuvInputFile[MAX_LAYERS]; ///< input YUV file 64 TVideoIOYuv* m_apcTVideoIOYuvReconFile[MAX_LAYERS]; ///< output reconstruction file 66 65 67 66 TComList<TComPicYuv*> m_acListPicYuvRec [MAX_LAYERS]; ///< list of reconstruction YUV files … … 114 113 Void encode (); ///< main encoding function 115 114 #if SVC_EXTENSION 116 TEncTop& getTEncTop (UInt layer) { return m_acTEncTop[layer]; } ///< return encoder class pointer reference115 TEncTop& getTEncTop (UInt layer) { return *m_apcTEncTop[layer]; } ///< return encoder class pointer reference 117 116 #else 118 117 TEncTop& getTEncTop () { return m_cTEncTop; } ///< return encoder class pointer reference -
branches/SHM-dev/source/App/TAppEncoder/encmain.cpp
r1259 r1377 72 72 try 73 73 { 74 #if SVC_EXTENSION 75 // parse number of layers first to allocate memory in the buffers 76 if(!cTAppEncTop.parseCfgNumLayersAndInit( argc, argv )) 77 { 78 cTAppEncTop.destroy(); 79 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 80 EnvVar::printEnvVar(); 81 #endif 82 return 1; 83 } 84 #endif 85 74 86 if(!cTAppEncTop.parseCfg( argc, argv )) 75 87 { -
branches/SHM-dev/source/Lib/TAppCommon/program_options_lite.cpp
r1301 r1377 294 294 if (!found) 295 295 { 296 #if 1 //SVC_EXTENSION 297 if( error_reporter.verbose ) 298 #endif 296 299 error_reporter.error(where()) 297 300 << "Unknown option `" << name << "' (value:`" << value << "')\n"; -
branches/SHM-dev/source/Lib/TAppCommon/program_options_lite.h
r1301 r1377 66 66 struct ErrorReporter 67 67 { 68 ErrorReporter() : is_errored(0) {} 68 ErrorReporter() 69 : is_errored(0) 70 #if 1 //SVC_EXTENSION 71 , verbose(true) 72 #endif 73 {} 69 74 virtual ~ErrorReporter() {} 70 75 virtual std::ostream& error(const std::string& where); 71 76 virtual std::ostream& warn(const std::string& where); 72 77 bool is_errored; 78 #if 1 //SVC_EXTENSION 79 bool verbose; 80 #endif 73 81 }; 74 82 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1353 r1377 56 56 switch (type) 57 57 { 58 case NAL_UNIT_CODED_SLICE_TRAIL_R: return " TRAIL_R"; 59 case NAL_UNIT_CODED_SLICE_TRAIL_N: return " TRAIL_N"; 60 case NAL_UNIT_CODED_SLICE_TSA_R: return " TSA_R"; 61 case NAL_UNIT_CODED_SLICE_TSA_N: return " TSA_N"; 62 case NAL_UNIT_CODED_SLICE_STSA_R: return " STSA_R"; 63 case NAL_UNIT_CODED_SLICE_STSA_N: return " STSA_N"; 64 case NAL_UNIT_CODED_SLICE_BLA_W_LP: return " BLA_W_LP"; 65 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: return "BLA_W_RADL"; 66 case NAL_UNIT_CODED_SLICE_BLA_N_LP: return " BLA_N_LP"; 67 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL"; 68 case NAL_UNIT_CODED_SLICE_IDR_N_LP: return " IDR_N_LP"; 69 case NAL_UNIT_CODED_SLICE_CRA: return " CRA"; 70 case NAL_UNIT_CODED_SLICE_RADL_R: return " RADL_R"; 71 case NAL_UNIT_CODED_SLICE_RADL_N: return " RADL_N"; 72 case NAL_UNIT_CODED_SLICE_RASL_R: return " RASL_R"; 73 case NAL_UNIT_CODED_SLICE_RASL_N: return " RASL_N"; 74 case NAL_UNIT_VPS: return " VPS"; 75 case NAL_UNIT_SPS: return " SPS"; 76 case NAL_UNIT_PPS: return " PPS"; 77 case NAL_UNIT_ACCESS_UNIT_DELIMITER: return " AUD"; 78 case NAL_UNIT_EOS: return " EOS"; 79 case NAL_UNIT_EOB: return " EOB"; 80 case NAL_UNIT_FILLER_DATA: return " FILLER"; 81 case NAL_UNIT_PREFIX_SEI: return " SEI"; 82 case NAL_UNIT_SUFFIX_SEI: return " SEI"; 83 default: return " UNK"; 84 } 85 #else 86 switch (type) 87 { 58 88 case NAL_UNIT_CODED_SLICE_TRAIL_R: return "TRAIL_R"; 59 89 case NAL_UNIT_CODED_SLICE_TRAIL_N: return "TRAIL_N"; … … 82 112 case NAL_UNIT_SUFFIX_SEI: return "Suffix SEI"; 83 113 default: return "UNK"; 84 }85 #else86 switch (type)87 {88 case NAL_UNIT_CODED_SLICE_TRAIL_R: return " TRAIL_R";89 case NAL_UNIT_CODED_SLICE_TRAIL_N: return " TRAIL_N";90 case NAL_UNIT_CODED_SLICE_TSA_R: return " TSA_R";91 case NAL_UNIT_CODED_SLICE_TSA_N: return " TSA_N";92 case NAL_UNIT_CODED_SLICE_STSA_R: return " STSA_R";93 case NAL_UNIT_CODED_SLICE_STSA_N: return " STSA_N";94 case NAL_UNIT_CODED_SLICE_BLA_W_LP: return " BLA_W_LP";95 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: return "BLA_W_RADL";96 case NAL_UNIT_CODED_SLICE_BLA_N_LP: return " BLA_N_LP";97 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL";98 case NAL_UNIT_CODED_SLICE_IDR_N_LP: return " IDR_N_LP";99 case NAL_UNIT_CODED_SLICE_CRA: return " CRA";100 case NAL_UNIT_CODED_SLICE_RADL_R: return " RADL_R";101 case NAL_UNIT_CODED_SLICE_RADL_N: return " RADL_N";102 case NAL_UNIT_CODED_SLICE_RASL_R: return " RASL_R";103 case NAL_UNIT_CODED_SLICE_RASL_N: return " RASL_N";104 case NAL_UNIT_VPS: return " VPS";105 case NAL_UNIT_SPS: return " SPS";106 case NAL_UNIT_PPS: return " PPS";107 case NAL_UNIT_ACCESS_UNIT_DELIMITER: return " AUD";108 case NAL_UNIT_EOS: return " EOS";109 case NAL_UNIT_EOB: return " EOB";110 case NAL_UNIT_FILLER_DATA: return " FILLER";111 case NAL_UNIT_PREFIX_SEI: return " SEI";112 case NAL_UNIT_SUFFIX_SEI: return " SEI";113 default: return " UNK";114 114 } 115 115 #endif -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1366 r1377 40 40 41 41 #if SVC_EXTENSION 42 UInt TDecTop::m_prevPOC = MAX_UINT;43 UInt TDecTop::m_uiPrevLayerId = MAX_UINT;44 Bool TDecTop::m_bFirstSliceInSequence = true;45 Bool TDecTop::m_checkPocRestrictionsForCurrAu 46 Int TDecTop::m_pocResetIdcOrCurrAu 47 Bool TDecTop::m_baseLayerIdrFlag 48 Bool TDecTop::m_baseLayerPicPresentFlag 49 Bool TDecTop::m_baseLayerIrapFlag 50 Bool TDecTop::m_nonBaseIdrPresentFlag 51 Int TDecTop::m_nonBaseIdrType 52 Bool TDecTop::m_picNonIdrWithRadlPresentFlag 53 Bool TDecTop::m_picNonIdrNoLpPresentFlag 54 Int TDecTop::m_crossLayerPocResetPeriodId 55 Int TDecTop::m_crossLayerPocResetIdc 42 UInt TDecTop::m_prevPOC = MAX_UINT; 43 UInt TDecTop::m_uiPrevLayerId = MAX_UINT; 44 Bool TDecTop::m_bFirstSliceInSequence = true; 45 Bool TDecTop::m_checkPocRestrictionsForCurrAu = false; 46 Int TDecTop::m_pocResetIdcOrCurrAu = -1; 47 Bool TDecTop::m_baseLayerIdrFlag = false; 48 Bool TDecTop::m_baseLayerPicPresentFlag = false; 49 Bool TDecTop::m_baseLayerIrapFlag = false; 50 Bool TDecTop::m_nonBaseIdrPresentFlag = false; 51 Int TDecTop::m_nonBaseIdrType = -1; 52 Bool TDecTop::m_picNonIdrWithRadlPresentFlag = false; 53 Bool TDecTop::m_picNonIdrNoLpPresentFlag = false; 54 Int TDecTop::m_crossLayerPocResetPeriodId = -1; 55 Int TDecTop::m_crossLayerPocResetIdc = -1; 56 56 #endif 57 57 … … 2579 2579 || pps.getCGSFlag() > 0 2580 2580 #endif 2581 #if LAYER_CTB2582 || pcTDecTopBase->getActiveSPS()->getMaxCUWidth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUWidth() || pcTDecTopBase->getActiveSPS()->getMaxCUHeight() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUHeight() || pcTDecTopBase->getActiveSPS()->getMaxCUDepth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUDepth()2583 #endif2584 2581 ) 2585 2582 { -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1372 r1377 743 743 || m_cPPS.getCGSFlag() > 0 744 744 #endif 745 #if LAYER_CTB746 || pcEncTopBase->getSPS()->getMaxCUWidth() != m_cSPS.getMaxCUWidth() || pcEncTopBase->getSPS()->getMaxCUHeight() != m_cSPS.getMaxCUHeight() || pcEncTopBase->getSPS()->getMaxCUDepth() != m_cSPS.getMaxCUDepth()747 #endif748 745 ) 749 746 { … … 792 789 #if CGS_3D_ASYMLUT 793 790 || m_cPPS.getCGSFlag() > 0 794 #endif795 #if LAYER_CTB796 || pcEncTopBase->getSPS()->getMaxCUWidth() != m_cSPS.getMaxCUWidth() || pcEncTopBase->getSPS()->getMaxCUHeight() != m_cSPS.getMaxCUHeight() || pcEncTopBase->getSPS()->getMaxCUDepth() != m_cSPS.getMaxCUDepth()797 791 #endif 798 792 )
Note: See TracChangeset for help on using the changeset viewer.