Changeset 1328 in 3DVCSoftware
- Timestamp:
- 14 Sep 2015, 19:41:29 (9 years ago)
- Location:
- branches/HTM-15.1-dev0
- Files:
-
- 19 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-15.1-dev0/cfg/MV-HEVC/fullCfg.cfg
r1313 r1328 307 307 RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP 308 308 309 310 #============== SEI ================================ 311 SeiCfgFileName_0 : 312 SeiCfgFileName_1 : 313 SeiCfgFileName_2 : 314 SeiCfgFileName_3 : 315 SeiCfgFileName_4 : 316 SeiCfgFileName_5 : 317 SeiCfgFileName_6 : 318 SeiCfgFileName_7 : 319 SeiCfgFileName_8 : 320 SeiCfgFileName_9 : 321 SeiCfgFileName_10 : 322 309 323 ### DO NOT ADD ANYTHING BELOW THIS LINE ### 310 324 ### DO NOT DELETE THE EMPTY LINE BELOW ### -
branches/HTM-15.1-dev0/source/App/TAppDecoder/TAppDecCfg.cpp
r1321 r1328 109 109 ("ForceDecodeBitDepth", m_forceDecodeBitDepth, 0U, "Force the decoder to operate at a particular bit-depth (best effort decoding)") 110 110 #endif 111 #if NH_MV_SEI 112 ("OutputDecodedSEIMessagesFilename,m", m_outputDecodedSEIMessagesFilename, string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n") 113 #else 111 114 ("OutputDecodedSEIMessagesFilename", m_outputDecodedSEIMessagesFilename, string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n") 115 #endif 112 116 ("ClipOutputVideoToRec709Range", m_bClipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving") 113 117 ; -
branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r1313 r1328 223 223 } 224 224 225 226 #if NH_MV_SEI 227 Void TAppEncCfg::xParseSeiCfg() 228 { 229 for (Int i = 0; i < MAX_NUM_SEIS; i++) 230 { 231 if ( m_seiCfgFileNames[i] != NULL ) 232 { 233 Int payloadType; 234 po::Options opts; 235 236 opts.addOptions()("PayloadType", payloadType,-1, "Payload Type"); 237 po::setDefaults(opts); 238 239 po::ErrorReporter err; 240 err.output_on_unknow_parameter = false; 241 po::parseConfigFile( opts, m_seiCfgFileNames[i], err ); 242 SEI* sei = SEI::getNewSEIMessage( (SEI::PayloadType) payloadType ); 243 assert( sei != NULL ); 244 245 sei->setupFromCfgFile( m_seiCfgFileNames[i] ); 246 247 m_seiMessages.push_back( sei ); 248 } 249 } 250 } 251 #endif 252 225 253 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input 226 254 { … … 854 882 #endif 855 883 ("DimensionIdLen", m_dimensionIdLen , cfg_dimensionLength , "Number of bits used to store dimensions Id") 856 ("ViewOrderIndex", m_viewOrderIndex , std::vector<Int>(1,0),"View Order Index per layer")857 ("ViewId", m_viewId , std::vector<Int>(1,0),"View Id per View Order Index")858 ("AuxId", m_auxId , std::vector<Int>(1,0),"AuxId per layer")884 ("ViewOrderIndex", m_viewOrderIndex , IntAry1d(1,0), "View Order Index per layer") 885 ("ViewId", m_viewId , IntAry1d(1,0), "View Id per View Order Index") 886 ("AuxId", m_auxId , IntAry1d(1,0), "AuxId per layer") 859 887 #if NH_3D 860 ("DepthFlag", m_depthFlag , std::vector<Int>(1,0),"Depth Flag")861 #endif 862 ("TargetEncLayerIdList", m_targetEncLayerIdList, std::vector<Int>(0,0),"LayerIds in Nuh to be encoded")863 ("LayerIdInNuh", m_layerIdInNuh , std::vector<Int>(1,0),"LayerId in Nuh")888 ("DepthFlag", m_depthFlag , IntAry1d(1,0), "Depth Flag") 889 #endif 890 ("TargetEncLayerIdList", m_targetEncLayerIdList , IntAry1d(0,0), "LayerIds in Nuh to be encoded") 891 ("LayerIdInNuh", m_layerIdInNuh , IntAry1d(1,0), "LayerId in Nuh") 864 892 ("SplittingFlag", m_splittingFlag , false , "Splitting Flag") 865 893 866 894 // Layer Sets + Output Layer Sets + Profile Tier Level 867 895 ("VpsNumLayerSets", m_vpsNumLayerSets , 1 , "Number of layer sets") 868 ("LayerIdsInSet_%d" , m_layerIdsInSets , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set")896 ("LayerIdsInSet_%d" , m_layerIdsInSets , IntAry1d(1,0) , MAX_VPS_OP_SETS_PLUS1 , "LayerIds of Layer set") 869 897 ("NumAddLayerSets" , m_numAddLayerSets , 0 , "NumAddLayerSets ") 870 ("HighestLayerIdxPlus1_%d" , m_highestLayerIdxPlus1, std::vector< Int >(0,0) ,MAX_VPS_NUM_ADD_LAYER_SETS,"HighestLayerIdxPlus1")898 ("HighestLayerIdxPlus1_%d" , m_highestLayerIdxPlus1 , IntAry1d(0,0) , MAX_VPS_NUM_ADD_LAYER_SETS , "HighestLayerIdxPlus1") 871 899 ("DefaultTargetOutputLayerIdc" , m_defaultOutputLayerIdc , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet") 872 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 873 874 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 875 ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 876 ("AltOutputLayerFlag", m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag") 900 ("OutputLayerSetIdx" , m_outputLayerSetIdx , IntAry1d(0,0) , "Indices of layer sets used as additional output layer sets") 901 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , IntAry1d(0,0) , MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 902 ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet , IntAry1d(0,0) , MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 903 ("AltOutputLayerFlag" , m_altOutputLayerFlag , BoolAry1d(1,0), "Alt output layer flag") 877 904 878 ("ProfileTierLevelIdx_%d" , m_profileTierLevelIdx, std::vector<Int>(0), MAX_NUM_LAYERS,"Indices to profile level tier for ols")905 ("ProfileTierLevelIdx_%d" , m_profileTierLevelIdx , IntAry1d(0) , MAX_NUM_LAYERS, "Indices to profile level tier for ols") 879 906 // Layer dependencies 880 ("DirectRefLayers_%d" , m_directRefLayers , std::vector<Int>(0,0), MAX_NUM_LAYERS,"LayerIdx in VPS of direct reference layers")881 ("DependencyTypes_%d" , m_dependencyTypes , std::vector<Int>(0,0), MAX_NUM_LAYERS,"Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion")907 ("DirectRefLayers_%d" , m_directRefLayers , IntAry1d(0,0), MAX_NUM_LAYERS, "LayerIdx in VPS of direct reference layers") 908 ("DependencyTypes_%d" , m_dependencyTypes , IntAry1d(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion") 882 909 #endif 883 910 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") … … 1143 1170 ("BitRatePresentFlag" , m_bitRatePresentFlag , BoolAry1d(1,0) ,MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set") 1144 1171 ("PicRatePresentFlag" , m_picRatePresentFlag , BoolAry1d(1,0) ,MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set") 1145 ("AvgBitRate" , m_avgBitRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "AvgBitRate per sub layer for the N-th layer set")1146 ("MaxBitRate" , m_maxBitRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "MaxBitRate per sub layer for the N-th layer set")1147 ("ConstantPicRateIdc" , m_constantPicRateIdc , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")1148 ("AvgPicRate" , m_avgPicRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate per sub layer for the N-th layer set")1172 ("AvgBitRate" , m_avgBitRate , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgBitRate per sub layer for the N-th layer set") 1173 ("MaxBitRate" , m_maxBitRate , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "MaxBitRate per sub layer for the N-th layer set") 1174 ("ConstantPicRateIdc" , m_constantPicRateIdc , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set") 1175 ("AvgPicRate" , m_avgPicRate , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgPicRate per sub layer for the N-th layer set") 1149 1176 ("TilesNotInUseFlag" , m_tilesNotInUseFlag , true , "TilesNotInUseFlag ") 1150 1177 ("TilesInUseFlag" , m_tilesInUseFlag , BoolAry1d(1,false) , "TilesInUseFlag ") … … 1154 1181 ("TileBoundariesAlignedFlag" , m_tileBoundariesAlignedFlag , BoolAry1d(1,0) ,MAX_NUM_LAYERS , "TileBoundariesAlignedFlag per direct reference for the N-th layer") 1155 1182 ("IlpRestrictedRefLayersFlag" , m_ilpRestrictedRefLayersFlag , false , "IlpRestrictedRefLayersFlag") 1156 ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1 , std::vector< Int >(1,0) ,MAX_NUM_LAYERS , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")1183 ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer") 1157 1184 ("CtuBasedOffsetEnabledFlag" , m_ctuBasedOffsetEnabledFlag , BoolAry1d(1,0) ,MAX_NUM_LAYERS , "CtuBasedOffsetEnabledFlag per direct reference for the N-th layer") 1158 ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int >(1,0) ,MAX_NUM_LAYERS , "MinHorizontalCtuOffsetPlus1 per direct reference for the N-th layer")1185 ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS , "MinHorizontalCtuOffsetPlus1 per direct reference for the N-th layer") 1159 1186 ("SingleLayerForNonIrapFlag", m_singleLayerForNonIrapFlag, false , "SingleLayerForNonIrapFlag") 1160 1187 ("HigherLayerIrapSkipFlag" , m_higherLayerIrapSkipFlag , false , "HigherLayerIrapSkipFlag ") … … 1305 1332 ("SEIMasteringDisplayWhitePoint", cfg_DisplayWhitePointCode, cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)") 1306 1333 #if NH_MV 1334 #if !NH_MV_SEI 1307 1335 ("SubBitstreamPropSEIEnabled", m_subBistreamPropSEIEnabled, false ,"Enable signaling of sub-bitstream property SEI message") 1308 1336 ("SEISubBitstreamNumAdditionalSubStreams", m_sbPropNumAdditionalSubStreams,0 ,"Number of substreams for which additional information is signalled") 1309 ("SEISubBitstreamSubBitstreamMode", m_sbPropSubBitstreamMode, std::vector< Int >(1,0) ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)") 1310 ("SEISubBitstreamOutputLayerSetIdxToVps", m_sbPropOutputLayerSetIdxToVps, std::vector< Int >(1,0) ,"Specifies output layer set index of the i-th sub-bitstream ") 1311 ("SEISubBitstreamHighestSublayerId", m_sbPropHighestSublayerId, std::vector< Int >(1,0) ,"Specifies highest TemporalId of the i-th sub-bitstream") 1312 ("SEISubBitstreamAvgBitRate", m_sbPropAvgBitRate, std::vector< Int >(1,0) ,"Specifies average bit rate of the i-th sub-bitstream") 1313 ("SEISubBitstreamMaxBitRate", m_sbPropMaxBitRate, std::vector< Int >(1,0) ,"Specifies maximum bit rate of the i-th sub-bitstream") 1314 1337 ("SEISubBitstreamSubBitstreamMode", m_sbPropSubBitstreamMode, IntAry1d (1,0) ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)") 1338 ("SEISubBitstreamOutputLayerSetIdxToVps", m_sbPropOutputLayerSetIdxToVps, IntAry1d (1,0) ,"Specifies output layer set index of the i-th sub-bitstream ") 1339 ("SEISubBitstreamHighestSublayerId", m_sbPropHighestSublayerId, IntAry1d (1,0) ,"Specifies highest TemporalId of the i-th sub-bitstream") 1340 ("SEISubBitstreamAvgBitRate", m_sbPropAvgBitRate, IntAry1d (1,0) ,"Specifies average bit rate of the i-th sub-bitstream") 1341 ("SEISubBitstreamMaxBitRate", m_sbPropMaxBitRate, IntAry1d (1,0) ,"Specifies maximum bit rate of the i-th sub-bitstream") 1342 #else 1343 ("SeiCfgFileName_%d", m_seiCfgFileNames, (Char *) 0 , MAX_NUM_SEIS , "SEI cfg file name %d") 1344 #endif 1315 1345 ("OutputVpsInfo", m_outputVpsInfo, false ,"Output information about the layer dependencies and layer sets") 1316 1346 #endif … … 1923 1953 } 1924 1954 1955 #if NH_MV_SEI 1956 xParseSeiCfg(); 1957 #endif 1925 1958 if( m_masteringDisplay.colourVolumeSEIEnabled ) 1926 1959 { … … 3295 3328 } 3296 3329 } 3330 #if !NH_MV_SEI 3297 3331 // Check input parameters for Sub-bitstream property SEI message 3298 3332 if( m_subBistreamPropSEIEnabled ) … … 3312 3346 } 3313 3347 } 3348 #endif 3314 3349 #endif 3315 3350 -
branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.h
r1313 r1328 77 77 // VPS specification 78 78 IntAry2d m_dimIds; ///< dimension ids ( pointers to m_viewId and m_depthFlag 79 std::vector<Int>m_viewId; ///< view id80 std::vector<Int>m_viewOrderIndex; ///< view order index81 std::vector<Int>m_auxId; ///< auxiliary id79 IntAry1d m_viewId; ///< view id 80 IntAry1d m_viewOrderIndex; ///< view order index 81 IntAry1d m_auxId; ///< auxiliary id 82 82 #if NH_3D 83 std::vector<Int>m_depthFlag; ///< depth flag84 #endif 85 std::vector<Int>m_targetEncLayerIdList; ///< layer Ids in Nuh to be encoded86 std::vector<Int>m_layerIdInNuh; ///< layer Id in Nuh for each layer83 IntAry1d m_depthFlag; ///< depth flag 84 #endif 85 IntAry1d m_targetEncLayerIdList; ///< layer Ids in Nuh to be encoded 86 IntAry1d m_layerIdInNuh; ///< layer Id in Nuh for each layer 87 87 Bool m_splittingFlag; ///< Splitting Flag 88 88 Int m_scalabilityMask; ///< Mask indicating scalabilities, 1: texture; 3: texture + depth 89 std::vector<Int>m_dimensionIdLen; ///< Length of scalability dimension s89 IntAry1d m_dimensionIdLen; ///< Length of scalability dimension s 90 90 91 91 // layer sets … … 95 95 IntAry2d m_highestLayerIdxPlus1; ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored) 96 96 Int m_defaultOutputLayerIdc; ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet 97 std::vector<Int>m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets97 IntAry1d m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 98 98 IntAry2d m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 99 99 IntAry2d m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets 100 100 IntAry2d m_profileTierLevelIdx; ///< Indices of of profile, per layer in layer set 101 std::vector<Bool>m_altOutputLayerFlag; ///< Alt output layer flag101 BoolAry1d m_altOutputLayerFlag; ///< Alt output layer flag 102 102 103 103 // Dependencies … … 112 112 Bool m_bitRatePresentVpsFlag; 113 113 Bool m_picRatePresentVpsFlag; 114 std::vector< std::vector<Bool > >m_bitRatePresentFlag;115 std::vector< std::vector<Bool > >m_picRatePresentFlag;116 std::vector< std::vector<Int > >m_avgBitRate;117 std::vector< std::vector<Int > >m_maxBitRate;118 std::vector< std::vector<Int > >m_constantPicRateIdc;119 std::vector< std::vector<Int > >m_avgPicRate;114 BoolAry2d m_bitRatePresentFlag; 115 BoolAry2d m_picRatePresentFlag; 116 IntAry2d m_avgBitRate; 117 IntAry2d m_maxBitRate; 118 IntAry2d m_constantPicRateIdc; 119 IntAry2d m_avgPicRate; 120 120 Bool m_tilesNotInUseFlag; 121 121 BoolAry1d m_tilesInUseFlag; … … 124 124 BoolAry1d m_wppInUseFlag; 125 125 126 std::vector< std::vector<Bool > >m_tileBoundariesAlignedFlag;126 BoolAry2d m_tileBoundariesAlignedFlag; 127 127 Bool m_ilpRestrictedRefLayersFlag; 128 std::vector< std::vector<Int > >m_minSpatialSegmentOffsetPlus1;129 std::vector< std::vector<Bool > >m_ctuBasedOffsetEnabledFlag;130 std::vector< std::vector<Int > >m_minHorizontalCtuOffsetPlus1;128 IntAry2d m_minSpatialSegmentOffsetPlus1; 129 BoolAry2d m_ctuBasedOffsetEnabledFlag; 130 IntAry2d m_minHorizontalCtuOffsetPlus1; 131 131 Bool m_singleLayerForNonIrapFlag; 132 132 Bool m_higherLayerIrapSkipFlag; … … 195 195 // coding structure 196 196 #if NH_MV 197 std::vector<Int>m_iIntraPeriod; ///< period of I-slice (random access period)197 IntAry1d m_iIntraPeriod; ///< period of I-slice (random access period) 198 198 #else 199 199 Int m_iIntraPeriod; ///< period of I-slice (random access period) … … 256 256 #endif 257 257 TComSEIMasteringDisplay m_masteringDisplay; 258 #if NH_MV_SEI 259 std::vector<char*> m_seiCfgFileNames; ///< SEI message files. 260 SEIMessages m_seiMessages; ///< Buffer for SEI messages. 261 #endif 258 262 259 263 Bool m_bUseAdaptiveQP; ///< Flag for enabling QP adaptation based on a psycho-visual model … … 509 513 UInt m_summaryVerboseness; ///< Specifies the level of the verboseness of the text output. 510 514 #if NH_MV 515 #if !NH_MV_SEI 511 516 Bool m_subBistreamPropSEIEnabled; 512 517 Int m_sbPropNumAdditionalSubStreams; 513 std::vector<Int> m_sbPropSubBitstreamMode; 514 std::vector<Int> m_sbPropOutputLayerSetIdxToVps; 515 std::vector<Int> m_sbPropHighestSublayerId; 516 std::vector<Int> m_sbPropAvgBitRate; 517 std::vector<Int> m_sbPropMaxBitRate; 518 IntAry1d m_sbPropSubBitstreamMode; 519 IntAry1d m_sbPropOutputLayerSetIdxToVps; 520 IntAry1d m_sbPropHighestSublayerId; 521 IntAry1d m_sbPropAvgBitRate; 522 IntAry1d m_sbPropMaxBitRate; 523 #endif 518 524 Bool m_outputVpsInfo; 519 525 #endif … … 654 660 Void xPrintVectorElem( Double elem ) { printf(" %5.2f", elem );}; 655 661 Void xPrintVectorElem( Bool elem ) { printf(" %d" , ( elem ? 1 : 0 ));}; 662 #if NH_MV_SEI 663 Void xParseSeiCfg(); 664 #endif 656 665 #endif 657 666 #if NH_MV -
branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r1321 r1328 591 591 m_cTEncTop.setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 592 592 #if NH_MV 593 #if !NH_MV_SEI 593 594 m_cTEncTop.setSubBitstreamPropSEIEnabled ( m_subBistreamPropSEIEnabled ); 594 595 if( m_subBistreamPropSEIEnabled ) … … 601 602 m_cTEncTop.setMaxBitRate ( m_sbPropMaxBitRate ); 602 603 } 604 #endif 603 605 #endif 604 606 … … 622 624 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 623 625 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 626 627 #if NH_MV_SEI 628 m_cTEncTop.setSeiMessages ( &m_seiMessages ); 629 #endif 624 630 625 631 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); -
branches/HTM-15.1-dev0/source/Lib/TAppCommon/program_options_lite.cpp
r1313 r1328 111 111 } 112 112 113 #if NH_MV_SEI 114 static void setOptions(Options::NamesPtrList& opt_list, const std::vector<int> idcs, const string& value, ErrorReporter& error_reporter) 115 #else 113 116 static void setOptions(Options::NamesPtrList& opt_list, const string& value, ErrorReporter& error_reporter) 117 #endif 114 118 { 115 119 /* multiple options may be registered for the same name: … … 117 121 for (Options::NamesPtrList::iterator it = opt_list.begin(); it != opt_list.end(); ++it) 118 122 { 123 #if NH_MV_SEI 124 Bool doParsing = (*it)->opt->checkDim( idcs, error_reporter ); 125 if ( doParsing ) 126 { 127 (*it)->opt->parse(value, idcs, error_reporter); 128 } 129 130 #else 119 131 (*it)->opt->parse(value, error_reporter); 132 #endif 120 133 } 121 134 } … … 277 290 bool OptionWriter::storePair(bool allow_long, bool allow_short, const string& name, const string& value) 278 291 { 292 #if NH_MV_SEI 293 std::vector<int> idcs; 294 295 std::size_t pos_underscore = name.find("_" ); 296 std::size_t pos_last_underscore_plus1 = pos_underscore+1; 297 std::size_t pos_first_underscore = pos_underscore; 298 299 while ( pos_underscore != string::npos ) 300 { 301 pos_underscore = name.find("_", pos_last_underscore_plus1 ); 302 size_t subStrlen = ( pos_underscore == string::npos ) ? string::npos : ( pos_underscore - pos_last_underscore_plus1 ); 303 string idx_str = name.substr( pos_last_underscore_plus1, subStrlen ); 304 idcs.push_back( atoi( idx_str.c_str())); 305 pos_last_underscore_plus1 = pos_underscore + 1; 306 } 307 308 string name_idcs = name.substr(0, pos_first_underscore ); 309 for (size_t i = 0; i < idcs.size(); i++ ) 310 { 311 name_idcs += "_%d"; 312 } 313 314 bool found_idcs = false; 315 Options::NamesMap::iterator opt_it_idcs; 316 #endif 279 317 bool found = false; 280 318 Options::NamesMap::iterator opt_it; … … 286 324 found = true; 287 325 } 326 #if NH_MV_SEI 327 if ( idcs.size() > 0 ) 328 { 329 opt_it_idcs = opts.opt_long_map.find(name_idcs); 330 if (opt_it_idcs != opts.opt_long_map.end() ) 331 { 332 assert( !found ); 333 found = true; 334 found_idcs = true; 335 opt_it = opt_it_idcs; 336 } 337 } 338 #endif 288 339 } 289 340 … … 296 347 found = true; 297 348 } 298 } 299 349 #if NH_MV_SEI 350 if ( idcs.size() > 0 ) 351 { 352 opt_it = opts.opt_short_map.find(name); 353 if (opt_it != opts.opt_short_map.end()) 354 { 355 assert( !found ); 356 found = true; 357 found_idcs = true; 358 opt_it = opt_it_idcs; 359 } 360 } 361 #endif 362 } 363 364 #if NH_MV_SEI 365 if ( !found_idcs ) 366 { 367 idcs.clear(); 368 } 369 #endif 300 370 if (!found) 301 371 { 372 #if NH_MV_SEI 373 if (error_reporter.output_on_unknow_parameter ) 374 { 375 #endif 376 302 377 error_reporter.error(where()) 303 378 << "Unknown option `" << name << "' (value:`" << value << "')\n"; 379 #if NH_MV_SEI 380 } 381 #endif 304 382 return false; 305 383 } 306 384 385 #if NH_MV_SEI 386 setOptions((*opt_it).second, idcs, value, error_reporter); 387 #else 307 388 setOptions((*opt_it).second, value, error_reporter); 389 #endif 308 390 return true; 309 391 } -
branches/HTM-15.1-dev0/source/Lib/TAppCommon/program_options_lite.h
r1313 r1328 78 78 struct ErrorReporter 79 79 { 80 #if NH_MV_SEI 81 ErrorReporter() : is_errored(0), output_on_unknow_parameter(true) {} 82 #else 80 83 ErrorReporter() : is_errored(0) {} 84 #endif 81 85 virtual ~ErrorReporter() {} 82 86 virtual std::ostream& error(const std::string& where); 83 87 virtual std::ostream& warn(const std::string& where); 84 88 bool is_errored; 89 #if NH_MV_SEI 90 bool output_on_unknow_parameter; 91 #endif 85 92 }; 86 93 … … 98 105 { 99 106 #if NH_MV 107 #if NH_MV_SEI 108 OptionBase(const std::string& name, const std::string& desc, bool duplicate = false, std::vector< int > maxdim = std::vector< int >(0) ) 109 : opt_string(name), opt_desc(desc), opt_duplicate(duplicate), max_dim( maxdim ) 110 #else 100 111 OptionBase(const std::string& name, const std::string& desc, bool duplicate = false) 101 112 : opt_string(name), opt_desc(desc), opt_duplicate(duplicate) 113 #endif 102 114 #else 103 115 OptionBase(const std::string& name, const std::string& desc) … … 109 121 110 122 /* parse argument arg, to obtain a value for the option */ 123 #if NH_MV_SEI 124 virtual void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&) = 0; 125 126 bool checkDim( std::vector< int > dims, ErrorReporter& err ) 127 { 128 bool doParsing = true; 129 if ( dims.size() != max_dim.size() ) 130 { 131 err.error(" ") << "Number of indices of `" << opt_string << "' not matching. Should be " << max_dim.size() << std::endl; 132 doParsing = false; 133 } 134 135 for (size_t i = 0 ; i < dims.size(); i++ ) 136 { 137 if ( dims[i] >= max_dim[i] ) 138 { 139 if (err.output_on_unknow_parameter ) 140 { 141 err.warn(" ") << "Index " << i << " of " << opt_string << " should be less than " << max_dim[i] << std::endl; 142 doParsing = false; 143 } 144 } 145 } 146 return doParsing; 147 } 148 149 void xParseVec( const std::string& arg, BoolAry1d& storage ) 150 { 151 char* pcNextStart = (char*) arg.data(); 152 char* pcEnd = pcNextStart + arg.length(); 153 154 char* pcOldStart = 0; 155 156 size_t iIdx = 0; 157 158 while (pcNextStart < pcEnd) 159 { 160 if ( iIdx < storage.size() ) 161 { 162 storage[iIdx] = (strtol(pcNextStart, &pcNextStart,10) != 0); 163 } 164 else 165 { 166 storage.push_back(strtol(pcNextStart, &pcNextStart,10) != 0) ; 167 } 168 iIdx++; 169 170 if ( errno == ERANGE || (pcNextStart == pcOldStart) ) 171 { 172 std::cerr << "Error Parsing Bools: `" << arg << "'" << std::endl; 173 exit(EXIT_FAILURE); 174 }; 175 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++; 176 pcOldStart = pcNextStart; 177 } 178 } 179 180 void xParseVec( const std::string& arg, IntAry1d& storage ) 181 { 182 storage.clear(); 183 184 char* pcNextStart = (char*) arg.data(); 185 char* pcEnd = pcNextStart + arg.length(); 186 187 char* pcOldStart = 0; 188 189 size_t iIdx = 0; 190 191 192 while (pcNextStart < pcEnd) 193 { 194 195 if ( iIdx < storage.size() ) 196 { 197 storage[iIdx] = (int) strtol(pcNextStart, &pcNextStart,10); 198 } 199 else 200 { 201 storage.push_back( (int) strtol(pcNextStart, &pcNextStart,10)) ; 202 } 203 iIdx++; 204 if ( errno == ERANGE || (pcNextStart == pcOldStart) ) 205 { 206 std::cerr << "Error Parsing Integers: `" << arg << "'" << std::endl; 207 exit(EXIT_FAILURE); 208 }; 209 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++; 210 pcOldStart = pcNextStart; 211 } 212 } 213 #else 111 214 virtual void parse(const std::string& arg, ErrorReporter&) = 0; 215 #endif 112 216 /* set the argument to the default value */ 113 217 virtual void setDefault() = 0; … … 117 221 #if NH_MV 118 222 bool opt_duplicate; 223 #if NH_MV_SEI 224 std::vector<int> max_dim; 225 #endif 119 226 #endif 120 227 }; … … 125 232 { 126 233 #if NH_MV 234 #if NH_MV_SEI 235 Option(const std::string& name, T& storage, T default_val, const std::string& desc, bool duplicate = false, std::vector< int > maxdim = std::vector< int >(0) ) 236 : OptionBase(name, desc, duplicate, maxdim), opt_storage(storage), opt_default_val(default_val) 237 #else 127 238 Option(const std::string& name, T& storage, T default_val, const std::string& desc, bool duplicate = false) 128 239 : OptionBase(name, desc, duplicate), opt_storage(storage), opt_default_val(default_val) 240 #endif 129 241 #else 130 242 Option(const std::string& name, T& storage, T default_val, const std::string& desc) … … 133 245 {} 134 246 247 #if NH_MV_SEI 248 void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&); 249 #else 135 250 void parse(const std::string& arg, ErrorReporter&); 251 #endif 136 252 137 253 void setDefault() … … 147 263 template<typename T> 148 264 inline void 265 #if NH_MV_SEI 266 Option<T>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&) 267 #else 149 268 Option<T>::parse(const std::string& arg, ErrorReporter&) 150 { 269 #endif 270 { 271 #if NH_MV_SEI 272 assert( idcs.size() == 0 ); 273 #endif 274 151 275 std::istringstream arg_ss (arg,std::istringstream::in); 152 276 arg_ss.exceptions(std::ios::failbit); … … 165 289 template<> 166 290 inline void 291 #if NH_MV_SEI 292 Option<std::string>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&) 293 #else 167 294 Option<std::string>::parse(const std::string& arg, ErrorReporter&) 168 { 295 #endif 296 { 297 #if NH_MV_SEI 298 assert( idcs.size() == 0 ); 299 #endif 169 300 opt_storage = arg; 170 301 } … … 173 304 template<> 174 305 inline void 306 #if NH_MV_SEI 307 Option<char*>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&) 308 #else 175 309 Option<char*>::parse(const std::string& arg, ErrorReporter&) 176 { 310 #endif 311 { 312 #if NH_MV_SEI 313 assert( idcs.size() == 0 ); 314 #endif 177 315 opt_storage = arg.empty() ? NULL : strdup(arg.c_str()) ; 178 316 } 317 318 #if !NH_MV_SEI 179 319 180 320 template<> … … 198 338 } 199 339 } 200 340 #endif 201 341 202 342 template<> 203 343 inline void 344 #if NH_MV_SEI 345 Option< std::vector<double> >::parse(const std::string& arg, const std::vector< int > & idcs, ErrorReporter&) 346 #else 204 347 Option< std::vector<double> >::parse(const std::string& arg, ErrorReporter&) 205 { 348 #endif 349 { 350 #if NH_MV_SEI 351 assert( idcs.size() == 0 ); 352 #endif 206 353 char* pcNextStart = (char*) arg.data(); 207 354 char* pcEnd = pcNextStart + arg.length(); … … 236 383 } 237 384 385 386 #if NH_MV_SEI 387 template<> 388 inline void 389 Option< IntAry1d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err) 390 { 391 xParseVec( arg, opt_storage ); 392 }; 393 394 template<> 395 inline void 396 Option< IntAry2d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&) 397 { 398 xParseVec( arg, opt_storage[ idcs[0] ] ); 399 }; 400 401 template<> 402 inline void 403 Option< IntAry3d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&) 404 { 405 xParseVec ( arg, opt_storage[ idcs[0] ][ idcs[1] ] ); 406 }; 407 #else 238 408 template<> 239 409 inline void … … 272 442 } 273 443 } 274 275 444 #endif 445 446 #if NH_MV_SEI 447 448 template<> 449 inline void 450 Option< std::vector< char*> >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err ) 451 { 452 453 opt_storage[ idcs[ 0 ] ] = arg.empty() ? NULL : strdup(arg.c_str()) ; 454 }; 455 456 template<> 457 inline void 458 Option< BoolAry1d >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err) 459 { 460 xParseVec( arg, opt_storage ); 461 }; 462 463 template<> 464 inline void 465 Option< BoolAry2d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err) 466 { 467 xParseVec( arg, opt_storage[ idcs[0] ] ); 468 }; 469 470 template<> 471 inline void 472 Option< BoolAry3d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err ) 473 { 474 xParseVec( arg, opt_storage[idcs[0]][idcs[1]] ); 475 }; 476 #else 276 477 template<> 277 478 inline void … … 307 508 } 308 509 #endif 510 #endif 309 511 /** Option class for argument handling using a user provided function */ 310 512 struct OptionFunc : public OptionBase … … 316 518 {} 317 519 520 #if NH_MV_SEI 521 void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& error_reporter) 522 #else 318 523 void parse(const std::string& arg, ErrorReporter& error_reporter) 524 #endif 319 525 { 320 526 func(parent, arg, error_reporter); … … 388 594 operator()(const std::string& name, std::vector<T>& storage, T default_val, unsigned uiMaxNum, const std::string& desc = "" ) 389 595 { 596 #if NH_MV_SEI 597 std::vector<T> defVal; 598 defVal.resize( uiMaxNum, default_val ); 599 std::vector< int > maxSize; 600 maxSize.push_back( uiMaxNum ); 601 parent.addOption(new Option< std::vector<T> >( name, storage, defVal, desc, false, maxSize )); 602 603 return *this; 604 } 605 template<typename T> 606 OptionSpecific& 607 operator()(const std::string& name, std::vector< std::vector<T> >& storage, T default_val, unsigned uiMaxNumDim1, unsigned uiMaxNumDim2, const std::string& desc = "" ) 608 { 609 std::vector< std::vector<T> > defVal; 610 defVal.resize(uiMaxNumDim1); 611 for ( unsigned int idxDim1 = 0; idxDim1 < uiMaxNumDim1; idxDim1++ ) 612 { 613 defVal[ idxDim1 ].resize(uiMaxNumDim2, default_val ); 614 } 615 616 std::vector< int > maxSize; 617 maxSize.push_back( uiMaxNumDim1 ); 618 maxSize.push_back( uiMaxNumDim2 ); 619 620 parent.addOption(new Option< std::vector< std::vector<T> > >( name, storage, defVal, desc, false, maxSize )); 621 return *this; 622 } 623 #else 390 624 std::string cNameBuffer; 391 625 std::string cDescBuffer; … … 415 649 return *this; 416 650 } 651 #endif 417 652 #endif 418 653 /** -
branches/HTM-15.1-dev0/source/Lib/TLibCommon/CommonDef.h
r1322 r1328 173 173 #if NH_MV 174 174 static const Int MAX_NUM_LAYER_IDS = 63; 175 #if NH_MV_SEI 176 static const Int MAX_NUM_SEIS = 1000; 177 #endif 175 178 #else 176 179 static const Int MAX_NUM_LAYER_IDS = 64; … … 280 283 static const Int MAX_NUM_PICS_RPS = 16 ; 281 284 static const Int MAX_NUM_REF_LAYERS = 63 ; 285 #if NH_MV_SEI 286 static IntAry1d getRangeVec( Int rngStart, Int rngEnd ) { IntAry1d rng; for (Int i = rngStart; i<=rngEnd; i++) rng.push_back(i); return rng; }; 287 static const IntAry1d IDR_NAL_UNIT_TYPES = getRangeVec( NAL_UNIT_CODED_SLICE_IDR_W_RADL, NAL_UNIT_CODED_SLICE_IDR_N_LP ); 288 static const IntAry1d IRAP_NAL_UNIT_TYPES = getRangeVec( NAL_UNIT_CODED_SLICE_BLA_W_LP , NAL_UNIT_CODED_SLICE_CRA ); 289 290 #endif 282 291 #endif 283 292 -
branches/HTM-15.1-dev0/source/Lib/TLibCommon/SEI.cpp
r1313 r1328 32 32 */ 33 33 34 /** \file SEI.cpp34 /** \file #SEI.cpp 35 35 \brief helper functions for SEI handling 36 36 */ … … 38 38 #include "CommonDef.h" 39 39 #include "SEI.h" 40 #if NH_MV_SEI 41 #include "TComSlice.h" 42 #endif 40 43 41 44 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType) … … 150 153 case SEI::CHROMA_SAMPLING_FILTER_HINT: return "Chroma sampling filter hint"; 151 154 #if NH_MV 152 case SEI::SUB_BITSTREAM_PROPERTY: return "Sub-bitstream property SEI message"; 155 case SEI::COLOUR_REMAPPING_INFO: return "Colour remapping information"; 156 case SEI::DEINTERLACED_FIELD_IDENTIFICATION: return "Deinterlaced field identification"; 157 case SEI::LAYERS_NOT_PRESENT: return "Layers not present"; 158 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: return "Inter-layer constrained tile sets"; 159 case SEI::BSP_NESTING: return "Bitstream partition nesting"; 160 case SEI::BSP_INITIAL_ARRIVAL_TIME: return "Bitstream partition initial arrival time"; 161 case SEI::SUB_BITSTREAM_PROPERTY: return "Sub-bitstream property"; 162 case SEI::ALPHA_CHANNEL_INFO: return "Alpha channel information"; 163 case SEI::OVERLAY_INFO: return "Overlay information" ; 164 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: return "Temporal motion vector prediction constraints"; 165 case SEI::FRAME_FIELD_INFO: return "Frame-field information"; 166 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return "3D reference displays information"; 167 case SEI::DEPTH_REPRESENTATION_INFO: return "Depth representation information"; 168 case SEI::MULTIVIEW_SCENE_INFO: return "Multiview scene information"; 169 case SEI::MULTIVIEW_ACQUISITION_INFO: return "Multiview acquisition information"; 170 case SEI::MULTIVIEW_VIEW_POSITION: return "Multiview view position"; 171 #if NH_3D 172 case SEI::ALTERNATIVE_DEPTH_INFO: return "Alternative depth information"; 173 #endif 153 174 #endif 154 175 default: return "Unknown"; 155 176 } 156 177 } 178 179 #if NH_MV_SEI 180 SEI::SEI() 181 { 182 m_scalNestSeiContThisSei = NULL; 183 } 184 185 SEI* SEI::getNewSEIMessage(SEI::PayloadType payloadType) 186 { 187 switch (payloadType) 188 { 189 #if NH_MV_SEI_TBD 190 ////////////////////////////////////////////////////////////////////////// 191 // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages. 192 ////////////////////////////////////////////////////////////////////////// 193 194 case SEI::BUFFERING_PERIOD: return new SEIBufferingPeriod; 195 case SEI::PICTURE_TIMING: return new SEIPictureTiming; 196 case SEI::PAN_SCAN_RECT: return new SEIPanScanRectangle; // not currently decoded 197 case SEI::FILLER_PAYLOAD: return new SEIFillerPaylod; // not currently decoded 198 case SEI::USER_DATA_REGISTERED_ITU_T_T35: return new SEIUserDataRegistered; // not currently decoded 199 case SEI::USER_DATA_UNREGISTERED: return new SEIuserDataUnregistered; 200 case SEI::RECOVERY_POINT: return new SEIRecoveryPoint; 201 case SEI::SCENE_INFO: return new SEISceneInformation; // not currently decoded 202 case SEI::FULL_FRAME_SNAPSHOT: return new SEIPictureSnapshot; // not currently decoded 203 case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return new SEIProgressiveRefinementSegmentStart; // not currently decoded 204 case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END: return new SEIProgressiveRefinementSegmentEnd; // not currently decoded 205 case SEI::FILM_GRAIN_CHARACTERISTICS: return new SEIFilmGrainCharacteristics; // not currently decoded 206 case SEI::POST_FILTER_HINT: return new SEIPostFilterHint; // not currently decoded 207 case SEI::TONE_MAPPING_INFO: return new SEIToneMappingInfo; 208 case SEI::KNEE_FUNCTION_INFO: return new SEIKneeFunctionInfo; 209 case SEI::FRAME_PACKING: return new SEIFramePacking; 210 case SEI::DISPLAY_ORIENTATION: return new SEIDisplayOrientation; 211 case SEI::SOP_DESCRIPTION: return new SEISOPDescription; 212 case SEI::ACTIVE_PARAMETER_SETS: return new SEIActiveParameterSets; 213 case SEI::DECODING_UNIT_INFO: return new SEIDecodingUnitInfo; 214 case SEI::TEMPORAL_LEVEL0_INDEX: return new SEITemporalLevel0Index 215 case SEI::DECODED_PICTURE_HASH: return new SEIDecodedPictureHash; 216 case SEI::SCALABLE_NESTING: return new SEIScalableNesting; 217 case SEI::REGION_REFRESH_INFO: return new SEIRegionRefreshInfo; 218 case SEI::NO_DISPLAY: return new SEINoDisplay; 219 case SEI::TIME_CODE: return new SEITimeCode; 220 case SEI::MASTERING_DISPLAY_COLOUR_VOLUME: return new SEIMasteringDisplayColourVolume; 221 case SEI::SEGM_RECT_FRAME_PACKING: return new SEISegmentedRectFramePacking; 222 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: return new SEITempMotionConstrainedTileSets; 223 case SEI::CHROMA_SAMPLING_FILTER_HINT: return new SEIChromaSamplingFilterHint 224 #endif 225 #if NH_MV_SEI 226 #if NH_MV_SEI_TBD 227 case SEI::LAYERS_NOT_PRESENT : return new SEILayersNotPresent; 228 #endif 229 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS : return new SEIInterLayerConstrainedTileSets; 230 #if NH_MV_SEI_TBD 231 case SEI::BSP_NESTING : return new SEIBspNesting; 232 case SEI::BSP_INITIAL_ARRIVAL_TIME : return new SEIBspInitialArrivalTime; 233 #endif 234 case SEI::SUB_BITSTREAM_PROPERTY : return new SEISubBitstreamProperty; 235 #if NH_MV_SEI_TBD 236 case SEI::ALPHA_CHANNEL_INFO : return new SEIAlphaChannelInfo; 237 case SEI::OVERLAY_INFO : return new SEIOverlayInfo; 238 #endif 239 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS : return new SEITemporalMvPredictionConstraints; 240 #if NH_MV_SEI_TBD 241 case SEI::FRAME_FIELD_INFO : return new SEIFrameFieldInfo; 242 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return new SEIThreeDimensionalReferenceDisplaysInfo; 243 case SEI::DEPTH_REPRESENTATION_INFO : return new SEIDepthRepresentationInfo; 244 #endif 245 case SEI::MULTIVIEW_SCENE_INFO : return new SEIMultiviewSceneInfo; 246 case SEI::MULTIVIEW_ACQUISITION_INFO : return new SEIMultiviewAcquisitionInfo; 247 case SEI::MULTIVIEW_VIEW_POSITION : return new SEIMultiviewViewPosition; 248 #if NH_MV_SEI_TBD 249 #if NH_3D 250 case SEI::ALTERNATIVE_DEPTH_INFO : return new SEIAlternativeDepthInfo; 251 #endif 252 #endif 253 #endif 254 default: assert( false ); return NULL; 255 } 256 } 257 258 Void SEI::setupFromSlice ( const TComSlice* slice ) 259 { 260 xPrintCfgErrorIntro(); 261 std::cout << getSEIMessageString( payloadType() ) << "Setup by the encoder is currently not possible. Using the default SEI cfg-file." << std::endl; 262 } 263 264 SEI* SEI::getCopy() const 265 { 266 assert( 0 ); 267 return NULL; 268 } 269 270 Void SEI::setupFromCfgFile( const Char* cfgFile ) 271 { 272 assert( false ); 273 } 274 275 Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const 276 { 277 Bool insertSeiHere = true; 278 if( !m_applicableLayerIds.empty() ) 279 { 280 insertSeiHere = insertSeiHere && ( std::find( m_applicableLayerIds.begin(), m_applicableLayerIds.end(), curLayerId) != m_applicableLayerIds.end() ) ; 281 } 282 if( !m_applicablePocs .empty() ) 283 { 284 insertSeiHere = insertSeiHere && ( std::find( m_applicablePocs .begin(), m_applicablePocs .end(), curPoc ) != m_applicablePocs .end() ) ; 285 } 286 if( !m_applicableTids .empty() ) 287 { 288 insertSeiHere = insertSeiHere && ( std::find( m_applicableTids .begin(), m_applicableTids .end(), curTid ) != m_applicableTids .end() ) ; 289 } 290 if( !m_applicableVclNaluTypes.empty() ) 291 { 292 insertSeiHere = insertSeiHere && ( std::find( m_applicableVclNaluTypes.begin(), m_applicableVclNaluTypes.end(), curNaluType) != m_applicableVclNaluTypes.end() ) ; 293 } 294 return insertSeiHere; 295 } 296 297 Bool SEI::checkCfg( const TComSlice* slice ) 298 { 299 assert( false ); 300 return true; 301 } 302 303 Void SEI::xPrintCfgErrorIntro() 304 { 305 std::cout << "Error in configuration of " << getSEIMessageString( payloadType() ) << " SEI: "; 306 } 307 308 Void SEI::xCheckCfgRange( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName ) 309 { 310 if ( val < minVal || val > maxVal ) 311 { 312 xPrintCfgErrorIntro(); 313 std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl; 314 wrongConfig = true; 315 } 316 } 317 318 Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs, 319 IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, 320 Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder) 321 { 322 opts.addOptions() 323 ("PayloadType" , m_payloadType , -1 , "Payload Type" ) 324 ("ApplicableLayerIds" , m_applicableLayerIds , defAppLayerIds , "LayerIds of layers to which the SEI is added. (all when empty)") 325 ("ApplicablePocs" , m_applicablePocs , deftApplicablePocs , "POCs of pictures to which the SEI is added. (all when empty)") 326 ("ApplicableTids" , m_applicableTids , defAppTids , "TIds of pictures to which the SEI is added. (all when empty)") 327 ("ApplicableVclNaluTypes" , m_applicableVclNaluTypes , defAppVclNaluTypes , "NaluUnitTypes of picture to which the SEI is added. (all when empty)") 328 ("SeiNaluId" , m_seiNaluId , defSeiNaluId , "Identifies to which NAL unit the SEI is added." ) 329 ("PositionInSeiNalu" , m_positionInSeiNalu , defPositionInSeiNalu , "Identifies the position within the NAL unit.") 330 ("ModifyByEncoder" , m_modifyByEncoder , defModifyByEncoder , "0: Use payload as specified in cfg file 1: Modify SEI by encoder"); 331 } 332 333 Void SEI::xCheckCfg( Bool& wrongConfig, Bool cond, const Char* errStr ) 334 { 335 if ( !cond ) 336 { 337 xPrintCfgErrorIntro(); 338 std::cout << errStr << std::endl; 339 wrongConfig = true; 340 } 341 } 342 343 344 #if NH_MV_SEI_TBD 345 Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile) 346 { 347 // Set default values 348 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 349 350 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 351 defAppLayerIds .push_back( TBD ); 352 defAppPocs .push_back( TBD ); 353 defAppTids .push_back( TBD ); 354 defAppVclNaluTypes.push_back( TBD ); 355 356 Int defSeiNaluId = 0; 357 Int defPositionInSeiNalu = 0; 358 Bool defModifyByEncoder = TBD; 359 360 // Setup config file options 361 po::Options opts; 362 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 363 364 opts.addOptions() 365 ("LnpSeiActiveVpsId" , m_lnpSeiActiveVpsId , 0 , "LnpSeiActiveVpsId" ) 366 ("LayerNotPresentFlag" , m_layerNotPresentFlag , BoolAry1d(1,0) , "LayerNotPresentFlag" ) 367 ; 368 369 po::setDefaults(opts); 370 371 // Parse the cfg file 372 po::ErrorReporter err; 373 po::parseConfigFile( opts, cfgFile, err ); 374 }; 375 376 Bool SEILayersNotPresent::checkCfg( const TComSlice* slice ) 377 { 378 // Check config values 379 Bool wrongConfig = false; 380 381 // TBD: Add constraints on presence of SEI here. 382 xCheckCfg ( wrongConfig, TBD , "TBD" ); 383 xCheckCfg ( wrongConfig, TBD , "TBD" ); 384 385 // TBD: Modify constraints according to the SEI semantics. 386 xCheckCfgRange( wrongConfig, m_lnpSeiActiveVpsId , MINVAL , MAXVAL, "lnp_sei_active_vps_id" ); 387 xCheckCfgRange( wrongConfig, m_layerNotPresentFlag[i] , MINVAL , MAXVAL, "layer_not_present_flag" ); 388 389 return wrongConfig; 390 }; 391 392 Void SEILayersNotPresent::setupFromSlice ( const TComSlice* slice ) 393 { 394 sei.m_lnpSeiActiveVpsId = TBD ; 395 for( Int i = 0; i <= MaxLayersMinus1; i++ ) 396 { 397 sei.m_layerNotPresentFlag[i] = TBD ; 398 } 399 }; 400 #endif 401 402 403 Void SEIInterLayerConstrainedTileSets::setupFromCfgFile(const Char* cfgFile) 404 { 405 // Set default values 406 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 407 408 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 409 defAppLayerIds .empty( ); 410 defAppPocs .push_back( 0 ); 411 defAppTids .empty( ); 412 defAppVclNaluTypes.empty( ); 413 414 Int defSeiNaluId = 0; 415 Int defPositionInSeiNalu = 0; 416 Bool defModifyByEncoder = false; 417 418 // Setup config file options 419 po::Options opts; 420 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 421 422 const Int maxNumTileInSet = 100; 423 424 opts.addOptions() 425 ("IlAllTilesExactSampleValueMatchFlag", m_ilAllTilesExactSampleValueMatchFlag, false , "IlAllTilesExactSampleValueMatchFlag") 426 ("IlOneTilePerTileSetFlag" , m_ilOneTilePerTileSetFlag , false , "IlOneTilePerTileSetFlag" ) 427 ("IlNumSetsInMessageMinus1" , m_ilNumSetsInMessageMinus1 , 0 , "IlNumSetsInMessageMinus1" ) 428 ("SkippedTileSetPresentFlag" , m_skippedTileSetPresentFlag , false , "SkippedTileSetPresentFlag" ) 429 ("IlctsId" , m_ilctsId , IntAry1d (256,0) , "IlctsId" ) 430 ("IlNumTileRectsInSetMinus1" , m_ilNumTileRectsInSetMinus1 , IntAry1d (256,0) , "IlNumTileRectsInSetMinus1" ) 431 ("IlTopLeftTileIndex_%d" , m_ilTopLeftTileIndex , IntAry1d (maxNumTileInSet,0), 256, "IlTopLeftTileIndex" ) 432 ("IlBottomRightTileIndex_%d" , m_ilBottomRightTileIndex , IntAry1d (maxNumTileInSet,0), 256, "IlBottomRightTileIndex" ) 433 ("IlcIdc" , m_ilcIdc , IntAry1d (256,0) , "IlcIdc" ) 434 ("IlExactSampleValueMatchFlag" , m_ilExactSampleValueMatchFlag , BoolAry1d(256,0) , "IlExactSampleValueMatchFlag" ) 435 ("AllTilesIlcIdc" , m_allTilesIlcIdc , 0 , "AllTilesIlcIdc" ) 436 ; 437 438 po::setDefaults(opts); 439 440 // Parse the cfg file 441 po::ErrorReporter err; 442 po::parseConfigFile( opts, cfgFile, err ); 443 }; 444 445 Bool SEIInterLayerConstrainedTileSets::checkCfg( const TComSlice* slice ) 446 { 447 // Check config values 448 Bool wrongConfig = false; 449 const TComPPS* pps = slice->getPPS(); 450 451 // Currently only the active PPS checked. 452 xCheckCfg ( wrongConfig, pps->getTilesEnabledFlag() , "The inter-layer constrained tile sets SEI message shall not be present for the layer with nuh_layer_id equal to targetLayerId when tiles_enabled_flag is equal to 0 for any PPS that is active for the pictures of the CLVS of the layer with nuh_layer_id equal to targetLayerId." ); 453 454 if ( m_ilOneTilePerTileSetFlag ) 455 { 456 xCheckCfg( wrongConfig, ( pps->getNumTileColumnsMinus1() + 1 ) * ( pps->getNumTileRowsMinus1() + 1 ) <= 256, "It is a requirement of bitstream conformance that when il_one_tile_per_tile_set_flag is equal to 1, the value of ( num_tile_columns_minus1 + 1 ) * ( num_tile_rows_minus1 + 1 ) shall be less than or equal to 256." ); 457 } 458 Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1; 459 460 for (Int i = 0 ; i < numSignificantSets; i++) 461 { 462 xCheckCfgRange( wrongConfig, m_ilctsId[i] , 0 , (1 << 30) - 1, "ilcts_id" ); 463 } 464 465 return wrongConfig; 466 }; 467 #if NH_MV_SEI_TBD 468 469 Void SEIBspNesting::setupFromSlice ( const TComSlice* slice ) 470 { 471 sei.m_seiOlsIdx = TBD ; 472 sei.m_seiPartitioningSchemeIdx = TBD ; 473 sei.m_bspIdx = TBD ; 474 while( !ByteaLigned(() ) ); 475 { 476 sei.m_bspNestingZeroBit = TBD ; 477 } 478 sei.m_numSeisInBspMinus1 = TBD ; 479 for( Int i = 0; i <= NumSeisInBspMinus1( ); i++ ) 480 { 481 SeiMessage(() ); 482 } 483 }; 484 485 Void SEIBspNesting::setupFromCfgFile(const Char* cfgFile) 486 { 487 // Set default values 488 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 489 490 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 491 defAppLayerIds .push_back( TBD ); 492 defAppPocs .push_back( TBD ); 493 defAppTids .push_back( TBD ); 494 defAppVclNaluTypes.push_back( TBD ); 495 496 Int defSeiNaluId = 0; 497 Int defPositionInSeiNalu = 0; 498 Bool defModifyByEncoder = TBD; 499 500 // Setup config file options 501 po::Options opts; 502 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 503 504 opts.addOptions() 505 ("SeiOlsIdx" , m_seiOlsIdx , 0 , "SeiOlsIdx" ) 506 ("SeiPartitioningSchemeIdx" , m_seiPartitioningSchemeIdx , 0 , "SeiPartitioningSchemeIdx" ) 507 ("BspIdx" , m_bspIdx , 0 , "BspIdx" ) 508 ("BspNestingZeroBit" , m_bspNestingZeroBit , 0 , "BspNestingZeroBit" ) 509 ("NumSeisInBspMinus1" , m_numSeisInBspMinus1 , 0 , "NumSeisInBspMinus1" ) 510 ; 511 512 po::setDefaults(opts); 513 514 // Parse the cfg file 515 po::ErrorReporter err; 516 po::parseConfigFile( opts, cfgFile, err ); 517 }; 518 519 Bool SEIBspNesting::checkCfg( const TComSlice* slice ) 520 { 521 // Check config values 522 Bool wrongConfig = false; 523 524 // TBD: Add constraints on presence of SEI here. 525 xCheckCfg ( wrongConfig, TBD , "TBD" ); 526 xCheckCfg ( wrongConfig, TBD , "TBD" ); 527 528 // TBD: Modify constraints according to the SEI semantics. 529 xCheckCfgRange( wrongConfig, m_seiOlsIdx , MINVAL , MAXVAL, "sei_ols_idx" ); 530 xCheckCfgRange( wrongConfig, m_seiPartitioningSchemeIdx , MINVAL , MAXVAL, "sei_partitioning_scheme_idx" ); 531 xCheckCfgRange( wrongConfig, m_bspIdx , MINVAL , MAXVAL, "bsp_idx" ); 532 xCheckCfgRange( wrongConfig, m_bspNestingZeroBit , MINVAL , MAXVAL, "bsp_nesting_zero_bit "); 533 xCheckCfgRange( wrongConfig, m_numSeisInBspMinus1 , MINVAL , MAXVAL, "num_seis_in_bsp_minus1" ); 534 535 return wrongConfig; 536 537 }; 538 539 Void SEIBspInitialArrivalTime::setupFromSlice ( const TComSlice* slice ) 540 { 541 psIdx = SeiPartitioningSchemeIdx(); 542 if( nalInitialArrivalDelayPresent ) 543 { 544 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 545 { 546 sei.m_nalInitialArrivalDelay[i] = TBD ; 547 } 548 } 549 if( vclInitialArrivalDelayPresent ) 550 { 551 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 552 { 553 sei.m_vclInitialArrivalDelay[i] = TBD ; 554 } 555 } 556 }; 557 558 Void SEIBspInitialArrivalTime::setupFromCfgFile(const Char* cfgFile) 559 { 560 // Set default values 561 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 562 563 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 564 defAppLayerIds .push_back( TBD ); 565 defAppPocs .push_back( TBD ); 566 defAppTids .push_back( TBD ); 567 defAppVclNaluTypes.push_back( TBD ); 568 569 Int defSeiNaluId = 0; 570 Int defPositionInSeiNalu = 0; 571 Bool defModifyByEncoder = TBD; 572 573 // Setup config file options 574 po::Options opts; 575 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 576 577 opts.addOptions() 578 ("NalInitialArrivalDelay" , m_nalInitialArrivalDelay , IntAry1d (1,0) , "NalInitialArrivalDelay" ) 579 ("VclInitialArrivalDelay" , m_vclInitialArrivalDelay , IntAry1d (1,0) , "VclInitialArrivalDelay" ) 580 ; 581 582 po::setDefaults(opts); 583 584 // Parse the cfg file 585 po::ErrorReporter err; 586 po::parseConfigFile( opts, cfgFile, err ); 587 }; 588 589 Bool SEIBspInitialArrivalTime::checkCfg( const TComSlice* slice ) 590 { 591 // Check config values 592 Bool wrongConfig = false; 593 594 // TBD: Add constraints on presence of SEI here. 595 xCheckCfg ( wrongConfig, TBD , "TBD" ); 596 xCheckCfg ( wrongConfig, TBD , "TBD" ); 597 598 // TBD: Modify constraints according to the SEI semantics. 599 xCheckCfgRange( wrongConfig, m_nalInitialArrivalDelay[i] , MINVAL , MAXVAL, "nal_initial_arrival_delay" ); 600 xCheckCfgRange( wrongConfig, m_vclInitialArrivalDelay[i] , MINVAL , MAXVAL, "vcl_initial_arrival_delay" ); 601 602 return wrongConfig; 603 604 }; 605 #endif 606 607 Void SEISubBitstreamProperty::setupFromCfgFile(const Char* cfgFile) 608 { 609 // Set default values 610 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 611 612 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 613 defAppLayerIds .push_back( 0 ); 614 defAppPocs .push_back( 0 ); 615 defAppTids .push_back( 0 ); 616 defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES; 617 618 Int defSeiNaluId = 0; 619 Int defPositionInSeiNalu = 0; 620 Bool defModifyByEncoder = false; 621 622 // Setup config file options 623 po::Options opts; 624 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 625 626 opts.addOptions() 627 ("SbPropertyActiveVpsId" , m_sbPropertyActiveVpsId , 0 , "SbPropertyActiveVpsId" ) 628 ("NumAdditionalSubStreamsMinus1" , m_numAdditionalSubStreamsMinus1 , 0 , "NumAdditionalSubStreamsMinus1" ) 629 ("SubBitstreamMode" , m_subBitstreamMode , IntAry1d (1,0) , "SubBitstreamMode" ) 630 ("OlsIdxToVps" , m_olsIdxToVps , IntAry1d (1,0) , "OlsIdxToVps" ) 631 ("HighestSublayerId" , m_highestSublayerId , IntAry1d (1,0) , "HighestSublayerId" ) 632 ("AvgSbPropertyBitRate" , m_avgSbPropertyBitRate , IntAry1d (1,0) , "AvgSbPropertyBitRate" ) 633 ("MaxSbPropertyBitRate" , m_maxSbPropertyBitRate , IntAry1d (1,0) , "MaxSbPropertyBitRate" ) 634 ; 635 636 po::setDefaults(opts); 637 638 // Parse the cfg file 639 po::ErrorReporter err; 640 po::parseConfigFile( opts, cfgFile, err ); 641 }; 642 643 Bool SEISubBitstreamProperty::checkCfg( const TComSlice* slice ) 644 { 645 // Check config values 646 Bool wrongConfig = false; 647 648 // For the current encoder, the initial IRAP access unit has always POC zero. 649 xCheckCfg ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0), "When present, the sub-bitstream property SEI message shall be associated with an initial IRAP access unit and the information provided by the SEI messages applies to the bitstream corresponding to the CVS containing the associated initial IRAP access unit."); 650 651 Bool sizeNotCorrect = 652 ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_subBitstreamMode .size() ) 653 || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_olsIdxToVps .size() ) 654 || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_highestSublayerId .size() ) 655 || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_avgSbPropertyBitRate.size() ) 656 || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_maxSbPropertyBitRate.size() ); 657 658 xCheckCfg( wrongConfig, !sizeNotCorrect, "Some parameters of some sub-bitstream not provided." ); 659 xCheckCfg( wrongConfig, slice->getVPS()->getVPSId() == m_sbPropertyActiveVpsId, "The value of sb_property_active_vps_id shall be equal to the value of vps_video_parameter_set_id of the active VPS referred to by the VCL NAL units of the associated access unit." ); 660 661 xCheckCfgRange( wrongConfig, m_numAdditionalSubStreamsMinus1 , 0 , (1 << 10) - 1 , "num_additional_sub_streams_minus1"); 662 663 if ( !sizeNotCorrect ) 664 { 665 for (Int i = 0; i <= m_numAdditionalSubStreamsMinus1; i++ ) 666 { 667 xCheckCfgRange( wrongConfig, m_subBitstreamMode[i] , 0 , 1 , "sub_bitstream_mode" ); 668 xCheckCfgRange( wrongConfig, m_olsIdxToVps[i] , 0 , slice->getVPS()->getNumOutputLayerSets()-1 , "ols_idx_to_vps" ); 669 } 670 } 671 return wrongConfig; 672 }; 673 674 Void SEISubBitstreamProperty::resizeArrays( ) 675 { 676 m_subBitstreamMode .resize( m_numAdditionalSubStreamsMinus1 + 1); 677 m_olsIdxToVps .resize( m_numAdditionalSubStreamsMinus1 + 1); 678 m_highestSublayerId .resize( m_numAdditionalSubStreamsMinus1 + 1); 679 m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 680 m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 681 } 682 683 #if NH_MV_SEI_TBD 684 685 Void SEIAlphaChannelInfo::setupFromSlice ( const TComSlice* slice ) 686 { 687 sei.m_alphaChannelCancelFlag = TBD ; 688 if( !sei.m_alphaChannelCancelFlag ) 689 { 690 sei.m_alphaChannelUseIdc = TBD ; 691 sei.m_alphaChannelBitDepthMinus8 = TBD ; 692 sei.m_alphaTransparentValue = TBD ; 693 sei.m_alphaOpaqueValue = TBD ; 694 sei.m_alphaChannelIncrFlag = TBD ; 695 sei.m_alphaChannelClipFlag = TBD ; 696 if( sei.m_alphaChannelClipFlag ) 697 { 698 sei.m_alphaChannelClipTypeFlag = TBD ; 699 } 700 } 701 }; 702 703 Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile) 704 { 705 // Set default values 706 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 707 708 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 709 defAppLayerIds .push_back( TBD ); 710 defAppPocs .push_back( TBD ); 711 defAppTids .push_back( TBD ); 712 defAppVclNaluTypes.push_back( TBD ); 713 714 Int defSeiNaluId = 0; 715 Int defPositionInSeiNalu = 0; 716 Bool defModifyByEncoder = TBD; 717 718 // Setup config file options 719 po::Options opts; 720 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 721 722 opts.addOptions() 723 ("AlphaChannelCancelFlag" , m_alphaChannelCancelFlag , false , "AlphaChannelCancelFlag" ) 724 ("AlphaChannelUseIdc" , m_alphaChannelUseIdc , 0 , "AlphaChannelUseIdc" ) 725 ("AlphaChannelBitDepthMinus8" , m_alphaChannelBitDepthMinus8 , 0 , "AlphaChannelBitDepthMinus8" ) 726 ("AlphaTransparentValue" , m_alphaTransparentValue , 0 , "AlphaTransparentValue" ) 727 ("AlphaOpaqueValue" , m_alphaOpaqueValue , 0 , "AlphaOpaqueValue" ) 728 ("AlphaChannelIncrFlag" , m_alphaChannelIncrFlag , false , "AlphaChannelIncrFlag" ) 729 ("AlphaChannelClipFlag" , m_alphaChannelClipFlag , false , "AlphaChannelClipFlag" ) 730 ("AlphaChannelClipTypeFlag" , m_alphaChannelClipTypeFlag , false , "AlphaChannelClipTypeFlag" ) 731 ; 732 733 po::setDefaults(opts); 734 735 // Parse the cfg file 736 po::ErrorReporter err; 737 po::parseConfigFile( opts, cfgFile, err ); 738 739 }; 740 741 Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice ) 742 { 743 // Check config values 744 Bool wrongConfig = false; 745 746 // TBD: Add constraints on presence of SEI here. 747 xCheckCfg ( wrongConfig, TBD , "TBD" ); 748 xCheckCfg ( wrongConfig, TBD , "TBD" ); 749 750 // TBD: Modify constraints according to the SEI semantics. 751 xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag , MINVAL , MAXVAL, "alpha_channel_cancel_flag" ); 752 xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc , MINVAL , MAXVAL, "alpha_channel_use_idc"); 753 xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8 , MINVAL , MAXVAL, "alpha_channel_bit_depth_minus8" ); 754 xCheckCfgRange( wrongConfig, m_alphaTransparentValue , MINVAL , MAXVAL, "alpha_transparent_value" ); 755 xCheckCfgRange( wrongConfig, m_alphaOpaqueValue , MINVAL , MAXVAL, "alpha_opaque_value" ); 756 xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag , MINVAL , MAXVAL, "alpha_channel_incr_flag" ); 757 xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag , MINVAL , MAXVAL, "alpha_channel_clip_flag" ); 758 xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag , MINVAL , MAXVAL, "alpha_channel_clip_type_flag" ); 759 760 return wrongConfig; 761 762 }; 763 764 Void SEIOverlayInfo::setupFromSlice ( const TComSlice* slice ) 765 { 766 sei.m_overlayInfoCancelFlag = TBD ; 767 if( !sei.m_overlayInfoCancelFlag ) 768 { 769 sei.m_overlayContentAuxIdMinus128 = TBD ; 770 sei.m_overlayLabelAuxIdMinus128 = TBD ; 771 sei.m_overlayAlphaAuxIdMinus128 = TBD ; 772 sei.m_overlayElementLabelValueLengthMinus8 = TBD ; 773 sei.m_numOverlaysMinus1 = TBD ; 774 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 775 { 776 sei.m_overlayIdx[i] = TBD ; 777 sei.m_languageOverlayPresentFlag[i] = TBD ; 778 sei.m_overlayContentLayerId[i] = TBD ; 779 sei.m_overlayLabelPresentFlag[i] = TBD ; 780 if( sei.m_overlayLabelPresentFlag( i ) ) 781 { 782 sei.m_overlayLabelLayerId[i] = TBD ; 783 } 784 sei.m_overlayAlphaPresentFlag[i] = TBD ; 785 if( sei.m_overlayAlphaPresentFlag( i ) ) 786 { 787 sei.m_overlayAlphaLayerId[i] = TBD ; 788 } 789 if( sei.m_overlayLabelPresentFlag( i ) ) 790 { 791 sei.m_numOverlayElementsMinus1[i] = TBD ; 792 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 793 { 794 sei.m_overlayElementLabelMin[i][j] = TBD ; 795 sei.m_overlayElementLabelMax[i][j] = TBD ; 796 } 797 } 798 } 799 while( !ByteaLigned(() ) ); 800 { 801 sei.m_overlayZeroBit = TBD ; 802 } 803 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 804 { 805 if( sei.m_languageOverlayPresentFlag( i ) ) 806 { 807 sei.m_overlayLanguage[i] = TBD ; 808 } 809 sei.m_overlayName[i] = TBD ; 810 if( sei.m_overlayLabelPresentFlag( i ) ) 811 { 812 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 813 { 814 sei.m_overlayElementName[i][j] = TBD ; 815 } 816 } 817 } 818 sei.m_overlayInfoPersistenceFlag = TBD ; 819 } 820 }; 821 822 Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile) 823 { 824 // Set default values 825 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 826 827 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 828 defAppLayerIds .push_back( TBD ); 829 defAppPocs .push_back( TBD ); 830 defAppTids .push_back( TBD ); 831 defAppVclNaluTypes.push_back( TBD ); 832 833 Int defSeiNaluId = 0; 834 Int defPositionInSeiNalu = 0; 835 Bool defModifyByEncoder = TBD; 836 837 // Setup config file options 838 po::Options opts; 839 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 840 841 opts.addOptions() 842 ("OverlayInfoCancelFlag" , m_overlayInfoCancelFlag , false , "OverlayInfoCancelFlag" ) 843 ("OverlayContentAuxIdMinus128" , m_overlayContentAuxIdMinus128 , 0 , "OverlayContentAuxIdMinus128" ) 844 ("OverlayLabelAuxIdMinus128" , m_overlayLabelAuxIdMinus128 , 0 , "OverlayLabelAuxIdMinus128" ) 845 ("OverlayAlphaAuxIdMinus128" , m_overlayAlphaAuxIdMinus128 , 0 , "OverlayAlphaAuxIdMinus128" ) 846 ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0 , "OverlayElementLabelValueLengthMinus8") 847 ("NumOverlaysMinus1" , m_numOverlaysMinus1 , 0 , "NumOverlaysMinus1" ) 848 ("OverlayIdx" , m_overlayIdx , IntAry1d (1,0) , "OverlayIdx" ) 849 ("LanguageOverlayPresentFlag" , m_languageOverlayPresentFlag , BoolAry1d(1,0) , "LanguageOverlayPresentFlag" ) 850 ("OverlayContentLayerId" , m_overlayContentLayerId , IntAry1d (1,0) , "OverlayContentLayerId" ) 851 ("OverlayLabelPresentFlag" , m_overlayLabelPresentFlag , BoolAry1d(1,0) , "OverlayLabelPresentFlag" ) 852 ("OverlayLabelLayerId" , m_overlayLabelLayerId , IntAry1d (1,0) , "OverlayLabelLayerId" ) 853 ("OverlayAlphaPresentFlag" , m_overlayAlphaPresentFlag , BoolAry1d(1,0) , "OverlayAlphaPresentFlag" ) 854 ("OverlayAlphaLayerId" , m_overlayAlphaLayerId , IntAry1d (1,0) , "OverlayAlphaLayerId" ) 855 ("NumOverlayElementsMinus1" , m_numOverlayElementsMinus1 , IntAry1d (1,0) , "NumOverlayElementsMinus1" ) 856 ("OverlayElementLabelMin_%d" , m_overlayElementLabelMin , IntAry1d (1,0) ,ADDNUM , "OverlayElementLabelMin" ) 857 ("OverlayElementLabelMax_%d" , m_overlayElementLabelMax , IntAry1d (1,0) ,ADDNUM , "OverlayElementLabelMax" ) 858 ("OverlayZeroBit" , m_overlayZeroBit , 0 , "OverlayZeroBit" ) 859 ("OverlayLanguage" , m_overlayLanguage , IntAry1d (1,0) , "OverlayLanguage" ) 860 ("OverlayName" , m_overlayName , IntAry1d (1,0) , "OverlayName" ) 861 ("OverlayElementName_%d" , m_overlayElementName , IntAry1d (1,0) ,ADDNUM , "OverlayElementName" ) 862 ("OverlayInfoPersistenceFlag" , m_overlayInfoPersistenceFlag , false , "OverlayInfoPersistenceFlag" ) 863 ; 864 865 po::setDefaults(opts); 866 867 // Parse the cfg file 868 po::ErrorReporter err; 869 po::parseConfigFile( opts, cfgFile, err ); 870 }; 871 872 Bool SEIOverlayInfo::checkCfg( const TComSlice* slice ) 873 { 874 // Check config values 875 Bool wrongConfig = false; 876 877 // TBD: Add constraints on presence of SEI here. 878 xCheckCfg ( wrongConfig, TBD , "TBD" ); 879 xCheckCfg ( wrongConfig, TBD , "TBD" ); 880 881 // TBD: Modify constraints according to the SEI semantics. 882 xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag , MINVAL , MAXVAL, "overlay_info_cancel_flag" ); 883 xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128 , MINVAL , MAXVAL, "overlay_content_aux_id_minus128" ); 884 xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128 , MINVAL , MAXVAL, "overlay_label_aux_id_minus128" ); 885 xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128 , MINVAL , MAXVAL, "overlay_alpha_aux_id_minus128" ); 886 xCheckCfgRange( wrongConfig, m_overlayElementLabelValueLengthMinus8, MINVAL , MAXVAL, "overlay_element_label_value_length_minus8"); 887 xCheckCfgRange( wrongConfig, m_numOverlaysMinus1 , MINVAL , MAXVAL, "num_overlays_minus1" ); 888 xCheckCfgRange( wrongConfig, m_overlayIdx[i] , MINVAL , MAXVAL, "overlay_idx" ); 889 xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i] , MINVAL , MAXVAL, "language_overlay_present_flag" ); 890 xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i] , MINVAL , MAXVAL, "overlay_content_layer_id" ); 891 xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i] , MINVAL , MAXVAL, "overlay_label_present_flag" ); 892 xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i] , MINVAL , MAXVAL, "overlay_label_layer_id" ); 893 xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i] , MINVAL , MAXVAL, "overlay_alpha_present_flag" ); 894 xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i] , MINVAL , MAXVAL, "overlay_alpha_layer_id" ); 895 xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i] , MINVAL , MAXVAL, "num_overlay_elements_minus1" ); 896 xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j] , MINVAL , MAXVAL, "overlay_element_label_min" ); 897 xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , MINVAL , MAXVAL, "overlay_element_label_max" ); 898 xCheckCfgRange( wrongConfig, m_overlayZeroBit , MINVAL , MAXVAL, "overlay_zero_bit" ); 899 xCheckCfgRange( wrongConfig, m_overlayLanguage[i] , MINVAL , MAXVAL, "overlay_language" ); 900 xCheckCfgRange( wrongConfig, m_overlayName[i] , MINVAL , MAXVAL, "overlay_name" ); 901 xCheckCfgRange( wrongConfig, m_overlayElementName[i][j] , MINVAL , MAXVAL, "overlay_element_name" ); 902 xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag , MINVAL , MAXVAL, "overlay_info_persistence_flag" ); 903 904 return wrongConfig; 905 906 }; 907 #endif 908 909 Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile) 910 { 911 // Set default values 912 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 913 914 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 915 defAppLayerIds .clear ( ); 916 defAppPocs .push_back( 0 ); 917 defAppTids .push_back( 0 ); 918 defAppVclNaluTypes.clear ( ); 919 920 Int defSeiNaluId = 0; 921 Int defPositionInSeiNalu = 0; 922 Bool defModifyByEncoder = false; 923 924 // Setup config file options 925 po::Options opts; 926 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 927 928 opts.addOptions() 929 ("PrevPicsNotUsedFlag" , m_prevPicsNotUsedFlag , false, "PrevPicsNotUsedFlag" ) 930 ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" ) 931 ; 932 933 po::setDefaults(opts); 934 935 // Parse the cfg file 936 po::ErrorReporter err; 937 po::parseConfigFile( opts, cfgFile, err ); 938 }; 939 940 Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice ) 941 { 942 // Check config values 943 Bool wrongConfig = false; 944 945 xCheckCfg ( wrongConfig, slice->getTemporalId() == 0 , "The temporal motion vector prediction constraints SEI message may be present in an access unit with TemporalId equal to 0 and shall not be present in an access unit with TemporalId greater than 0." ); 946 947 return wrongConfig; 948 }; 949 950 #if NH_MV_SEI_TBD 951 Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile) 952 { 953 // Set default values 954 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 955 956 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 957 defAppLayerIds .push_back( TBD ); 958 defAppPocs .push_back( TBD ); 959 defAppTids .push_back( TBD ); 960 defAppVclNaluTypes.push_back( TBD ); 961 962 Int defSeiNaluId = 0; 963 Int defPositionInSeiNalu = 0; 964 Bool defModifyByEncoder = false; 965 966 // Setup config file options 967 po::Options opts; 968 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 969 970 opts.addOptions() 971 ("FfinfoPicStruct" , m_ffinfoPicStruct , 0 , "FfinfoPicStruct" ) 972 ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0 , "FfinfoSourceScanType") 973 ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" ) 974 ; 975 976 po::setDefaults(opts); 977 978 // Parse the cfg file 979 po::ErrorReporter err; 980 po::parseConfigFile( opts, cfgFile, err ); 981 }; 982 983 984 Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice ) 985 { 986 // Check config values 987 Bool wrongConfig = false; 988 989 // TBD: Add constraints on presence of SEI here. 990 xCheckCfg ( wrongConfig, TBD , "TBD" ); 991 xCheckCfg ( wrongConfig, TBD , "TBD" ); 992 993 // TBD: Modify constraints according to the SEI semantics. 994 xCheckCfgRange( wrongConfig, m_ffinfoPicStruct , MINVAL , MAXVAL, "ffinfo_pic_struct" ); 995 xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType , MINVAL , MAXVAL, "ffinfo_source_scan_type" ); 996 xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag , MINVAL , MAXVAL, "ffinfo_duplicate_flag" ); 997 998 return wrongConfig; 999 1000 }; 1001 1002 Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromSlice ( const TComSlice* slice ) 1003 { 1004 sei.m_precRefDisplayWidth = TBD ; 1005 sei.m_refViewingDistanceFlag = TBD ; 1006 if( sei.m_refViewingDistanceFlag ) 1007 { 1008 sei.m_precRefViewingDist = TBD ; 1009 } 1010 sei.m_numRefDisplaysMinus1 = TBD ; 1011 for( Int i = 0; i <= NumRefDisplaysMinus1( ); i++ ) 1012 { 1013 sei.m_leftViewId[i] = TBD ; 1014 sei.m_rightViewId[i] = TBD ; 1015 sei.m_exponentRefDisplayWidth[i] = TBD ; 1016 sei.m_mantissaRefDisplayWidth[i] = TBD ; 1017 if( sei.m_refViewingDistanceFlag ) 1018 { 1019 sei.m_exponentRefViewingDistance[i] = TBD ; 1020 sei.m_mantissaRefViewingDistance[i] = TBD ; 1021 } 1022 sei.m_additionalShiftPresentFlag[i] = TBD ; 1023 if( sei.m_additionalShiftPresentFlag( i ) ) 1024 { 1025 sei.m_numSampleShiftPlus512[i] = TBD ; 1026 } 1027 } 1028 sei.m_threeDimensionalReferenceDisplaysExtensionFlag = TBD ; 1029 }; 1030 1031 Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile) 1032 { 1033 // Set default values 1034 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1035 1036 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1037 defAppLayerIds .push_back( TBD ); 1038 defAppPocs .push_back( TBD ); 1039 defAppTids .push_back( TBD ); 1040 defAppVclNaluTypes.push_back( TBD ); 1041 1042 Int defSeiNaluId = 0; 1043 Int defPositionInSeiNalu = 0; 1044 Bool defModifyByEncoder = TBD; 1045 1046 // Setup config file options 1047 po::Options opts; 1048 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1049 1050 opts.addOptions() 1051 ("PrecRefDisplayWidth" , m_precRefDisplayWidth , 0 , "PrecRefDisplayWidth" ) 1052 ("RefViewingDistanceFlag" , m_refViewingDistanceFlag , false , "RefViewingDistanceFlag" ) 1053 ("PrecRefViewingDist" , m_precRefViewingDist , 0 , "PrecRefViewingDist" ) 1054 ("NumRefDisplaysMinus1" , m_numRefDisplaysMinus1 , 0 , "NumRefDisplaysMinus1" ) 1055 ("LeftViewId" , m_leftViewId , IntAry1d (1,0) , "LeftViewId" ) 1056 ("RightViewId" , m_rightViewId , IntAry1d (1,0) , "RightViewId" ) 1057 ("ExponentRefDisplayWidth" , m_exponentRefDisplayWidth , IntAry1d (1,0) , "ExponentRefDisplayWidth" ) 1058 ("MantissaRefDisplayWidth" , m_mantissaRefDisplayWidth , IntAry1d (1,0) , "MantissaRefDisplayWidth" ) 1059 ("ExponentRefViewingDistance" , m_exponentRefViewingDistance , IntAry1d (1,0) , "ExponentRefViewingDistance" ) 1060 ("MantissaRefViewingDistance" , m_mantissaRefViewingDistance , IntAry1d (1,0) , "MantissaRefViewingDistance" ) 1061 ("AdditionalShiftPresentFlag" , m_additionalShiftPresentFlag , BoolAry1d(1,0) , "AdditionalShiftPresentFlag" ) 1062 ("NumSampleShiftPlus512" , m_numSampleShiftPlus512 , IntAry1d (1,0) , "NumSampleShiftPlus512" ) 1063 ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false , "ThreeDimensionalReferenceDisplaysExtensionFlag") 1064 ; 1065 1066 po::setDefaults(opts); 1067 1068 // Parse the cfg file 1069 po::ErrorReporter err; 1070 po::parseConfigFile( opts, cfgFile, err ); 1071 }; 1072 1073 Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice ) 1074 { 1075 // Check config values 1076 Bool wrongConfig = false; 1077 1078 // TBD: Add constraints on presence of SEI here. 1079 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1080 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1081 1082 // TBD: Modify constraints according to the SEI semantics. 1083 xCheckCfgRange( wrongConfig, m_precRefDisplayWidth , MINVAL , MAXVAL, "prec_ref_display_width" ); 1084 xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag , MINVAL , MAXVAL, "ref_viewing_distance_flag" ); 1085 xCheckCfgRange( wrongConfig, m_precRefViewingDist , MINVAL , MAXVAL, "prec_ref_viewing_dist" ); 1086 xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1 , MINVAL , MAXVAL, "num_ref_displays_minus1" ); 1087 xCheckCfgRange( wrongConfig, m_leftViewId[i] , MINVAL , MAXVAL, "left_view_id" ); 1088 xCheckCfgRange( wrongConfig, m_rightViewId[i] , MINVAL , MAXVAL, "right_view_id" ); 1089 xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i] , MINVAL , MAXVAL, "exponent_ref_display_width" ); 1090 xCheckCfgRange( wrongConfig, m_mantissaRefDisplayWidth[i] , MINVAL , MAXVAL, "mantissa_ref_display_width" ); 1091 xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i] , MINVAL , MAXVAL, "exponent_ref_viewing_distance" ); 1092 xCheckCfgRange( wrongConfig, m_mantissaRefViewingDistance[i] , MINVAL , MAXVAL, "mantissa_ref_viewing_distance" ); 1093 xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i] , MINVAL , MAXVAL, "additional_shift_present_flag" ); 1094 xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i] , MINVAL , MAXVAL, "num_sample_shift_plus512" ); 1095 xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, MINVAL , MAXVAL, "three_dimensional_reference_displays_extension_flag"); 1096 1097 return wrongConfig; 1098 1099 }; 1100 1101 Void SEIDepthRepresentationInfo::setupFromSlice ( const TComSlice* slice ) 1102 { 1103 sei.m_zNearFlag = TBD ; 1104 sei.m_zFarFlag = TBD ; 1105 sei.m_dMinFlag = TBD ; 1106 sei.m_dMaxFlag = TBD ; 1107 sei.m_depthRepresentationType = TBD ; 1108 if( sei.m_dMinFlag | | sei.m_dMaxFlag ) 1109 { 1110 sei.m_disparityRefViewId = TBD ; 1111 } 1112 if( sei.m_zNearFlag ) 1113 { 1114 DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen ); 1115 } 1116 if( sei.m_zFarFlag ) 1117 { 1118 DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen ); 1119 } 1120 if( sei.m_dMinFlag ) 1121 { 1122 DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen ); 1123 } 1124 if( sei.m_dMaxFlag ) 1125 { 1126 DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen ); 1127 } 1128 if( sei.m_depthRepresentationType = = 3 ) 1129 { 1130 sei.m_depthNonlinearRepresentationNumMinus1 = TBD ; 1131 for( Int i = 1; i <= sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ ) 1132 { 1133 DepthNonlinearRepresentationModel( i ); 1134 } 1135 } 1136 }; 1137 1138 Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile) 1139 { 1140 // Set default values 1141 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1142 1143 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1144 defAppLayerIds .push_back( TBD ); 1145 defAppPocs .push_back( TBD ); 1146 defAppTids .push_back( TBD ); 1147 defAppVclNaluTypes.push_back( TBD ); 1148 1149 Int defSeiNaluId = 0; 1150 Int defPositionInSeiNalu = 0; 1151 Bool defModifyByEncoder = TBD; 1152 1153 // Setup config file options 1154 po::Options opts; 1155 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1156 1157 opts.addOptions() 1158 ("ZNearFlag" , m_zNearFlag , false , "ZNearFlag" ) 1159 ("ZFarFlag" , m_zFarFlag , false , "ZFarFlag" ) 1160 ("DMinFlag" , m_dMinFlag , false , "DMinFlag" ) 1161 ("DMaxFlag" , m_dMaxFlag , false , "DMaxFlag" ) 1162 ("DepthRepresentationType" , m_depthRepresentationType , 0 , "DepthRepresentationType" ) 1163 ("DisparityRefViewId" , m_disparityRefViewId , 0 , "DisparityRefViewId" ) 1164 ("DepthNonlinearRepresentationNumMinus1", m_depthNonlinearRepresentationNumMinus1, 0 , "DepthNonlinearRepresentationNumMinus1") 1165 ; 1166 1167 po::setDefaults(opts); 1168 1169 // Parse the cfg file 1170 po::ErrorReporter err; 1171 po::parseConfigFile( opts, cfgFile, err ); 1172 }; 1173 1174 Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice ) 1175 { 1176 // Check config values 1177 Bool wrongConfig = false; 1178 1179 // TBD: Add constraints on presence of SEI here. 1180 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1181 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1182 1183 // TBD: Modify constraints according to the SEI semantics. 1184 xCheckCfgRange( wrongConfig, m_zNearFlag , MINVAL , MAXVAL, "z_near_flag" ); 1185 xCheckCfgRange( wrongConfig, m_zFarFlag , MINVAL , MAXVAL, "z_far_flag" ); 1186 xCheckCfgRange( wrongConfig, m_dMinFlag , MINVAL , MAXVAL, "d_min_flag" ); 1187 xCheckCfgRange( wrongConfig, m_dMaxFlag , MINVAL , MAXVAL, "d_max_flag" ); 1188 xCheckCfgRange( wrongConfig, m_depthRepresentationType , MINVAL , MAXVAL, "depth_representation_type" ); 1189 xCheckCfgRange( wrongConfig, m_disparityRefViewId , MINVAL , MAXVAL, "disparity_ref_view_id" ); 1190 xCheckCfgRange( wrongConfig, m_depthNonlinearRepresentationNumMinus1, MINVAL , MAXVAL, "depth_nonlinear_representation_num_minus1"); 1191 1192 return wrongConfig; 1193 }; 1194 1195 Void SEIDepthRepInfoElement::setupFromSlice ( const TComSlice* slice ) 1196 { 1197 sei.m_daSignFlag = TBD ; 1198 sei.m_daExponent = TBD ; 1199 sei.m_daMantissaLenMinus1 = TBD ; 1200 sei.m_daMantissa = TBD ; 1201 }; 1202 1203 Void SEIDepthRepInfoElement::setupFromCfgFile(const Char* cfgFile) 1204 { 1205 // Set default values 1206 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1207 1208 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1209 defAppLayerIds .push_back( TBD ); 1210 defAppPocs .push_back( TBD ); 1211 defAppTids .push_back( TBD ); 1212 defAppVclNaluTypes.push_back( TBD ); 1213 1214 Int defSeiNaluId = 0; 1215 Int defPositionInSeiNalu = 0; 1216 Bool defModifyByEncoder = TBD; 1217 1218 // Setup config file options 1219 po::Options opts; 1220 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1221 1222 opts.addOptions() 1223 ("DaSignFlag" , m_daSignFlag , false , "DaSignFlag" ) 1224 ("DaExponent" , m_daExponent , 0 , "DaExponent" ) 1225 ("DaMantissaLenMinus1" , m_daMantissaLenMinus1 , 0 , "DaMantissaLenMinus1" ) 1226 ("DaMantissa" , m_daMantissa , 0 , "DaMantissa" ) 1227 ; 1228 1229 po::setDefaults(opts); 1230 1231 // Parse the cfg file 1232 po::ErrorReporter err; 1233 po::parseConfigFile( opts, cfgFile, err ); 1234 }; 1235 1236 Bool SEIDepthRepInfoElement::checkCfg( const TComSlice* slice ) 1237 { 1238 // Check config values 1239 Bool wrongConfig = false; 1240 1241 // TBD: Add constraints on presence of SEI here. 1242 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1243 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1244 1245 // TBD: Modify constraints according to the SEI semantics. 1246 xCheckCfgRange( wrongConfig, m_daSignFlag , MINVAL , MAXVAL, "da_sign_flag" ); 1247 xCheckCfgRange( wrongConfig, m_daExponent , MINVAL , MAXVAL, "da_exponent" ); 1248 xCheckCfgRange( wrongConfig, m_daMantissaLenMinus1 , MINVAL , MAXVAL, "da_mantissa_len_minus1" ); 1249 xCheckCfgRange( wrongConfig, m_daMantissa , MINVAL , MAXVAL, "da_mantissa" ); 1250 1251 return wrongConfig; 1252 }; 1253 #endif 1254 1255 Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile) 1256 { 1257 // Set default values 1258 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1259 1260 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1261 defAppLayerIds .clear(); 1262 defAppPocs .clear(); 1263 defAppTids .push_back( 0 ); 1264 defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES; 1265 1266 Int defSeiNaluId = 0; 1267 Int defPositionInSeiNalu = 0; 1268 Bool defModifyByEncoder = false; 1269 1270 // Setup config file options 1271 po::Options opts; 1272 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1273 1274 opts.addOptions() 1275 ("MinDisparity" , m_minDisparity , 0 , "MinDisparity" ) 1276 ("MaxDisparityRange" , m_maxDisparityRange , 0 , "MaxDisparityRange" ) 1277 ; 1278 1279 po::setDefaults(opts); 1280 1281 // Parse the cfg file 1282 po::ErrorReporter err; 1283 po::parseConfigFile( opts, cfgFile, err ); 1284 }; 1285 1286 1287 Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice ) 1288 { 1289 // Check config values 1290 Bool wrongConfig = false; 1291 1292 xCheckCfg ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." ); 1293 1294 xCheckCfgRange( wrongConfig, m_minDisparity , -1024 , 1023, "min_disparity" ); 1295 xCheckCfgRange( wrongConfig, m_maxDisparityRange , 0 , 2047, "max_disparity_range" ); 1296 1297 return wrongConfig; 1298 1299 }; 1300 1301 Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile) 1302 { 1303 // Set default values 1304 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1305 1306 defAppLayerIds .clear(); 1307 defAppPocs .push_back( 0 ); 1308 defAppTids .push_back( 0 ); 1309 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 1310 1311 1312 Int defSeiNaluId = 0; 1313 Int defPositionInSeiNalu = 0; 1314 Bool defModifyByEncoder = false; 1315 1316 // Setup config file options 1317 po::Options opts; 1318 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1319 1320 opts.addOptions() 1321 ("IntrinsicParamFlag" , m_intrinsicParamFlag , false , "IntrinsicParamFlag" ) 1322 ("ExtrinsicParamFlag" , m_extrinsicParamFlag , false , "ExtrinsicParamFlag" ) 1323 ("IntrinsicParamsEqualFlag" , m_intrinsicParamsEqualFlag , false , "IntrinsicParamsEqualFlag" ) 1324 ("PrecFocalLength" , m_precFocalLength , 0 , "PrecFocalLength" ) 1325 ("PrecPrincipalPoint" , m_precPrincipalPoint , 0 , "PrecPrincipalPoint" ) 1326 ("PrecSkewFactor" , m_precSkewFactor , 0 , "PrecSkewFactor" ) 1327 ("SignFocalLengthX" , m_signFocalLengthX , BoolAry1d(1,0) , "SignFocalLengthX" ) 1328 ("ExponentFocalLengthX" , m_exponentFocalLengthX , IntAry1d (1,0) , "ExponentFocalLengthX" ) 1329 ("MantissaFocalLengthX" , m_mantissaFocalLengthX , IntAry1d (1,0) , "MantissaFocalLengthX" ) 1330 ("SignFocalLengthY" , m_signFocalLengthY , BoolAry1d(1,0) , "SignFocalLengthY" ) 1331 ("ExponentFocalLengthY" , m_exponentFocalLengthY , IntAry1d (1,0) , "ExponentFocalLengthY" ) 1332 ("MantissaFocalLengthY" , m_mantissaFocalLengthY , IntAry1d (1,0) , "MantissaFocalLengthY" ) 1333 ("SignPrincipalPointX" , m_signPrincipalPointX , BoolAry1d(1,0) , "SignPrincipalPointX" ) 1334 ("ExponentPrincipalPointX" , m_exponentPrincipalPointX , IntAry1d (1,0) , "ExponentPrincipalPointX" ) 1335 ("MantissaPrincipalPointX" , m_mantissaPrincipalPointX , IntAry1d (1,0) , "MantissaPrincipalPointX" ) 1336 ("SignPrincipalPointY" , m_signPrincipalPointY , BoolAry1d(1,0) , "SignPrincipalPointY" ) 1337 ("ExponentPrincipalPointY" , m_exponentPrincipalPointY , IntAry1d (1,0) , "ExponentPrincipalPointY" ) 1338 ("MantissaPrincipalPointY" , m_mantissaPrincipalPointY , IntAry1d (1,0) , "MantissaPrincipalPointY" ) 1339 ("SignSkewFactor" , m_signSkewFactor , BoolAry1d(1,0) , "SignSkewFactor" ) 1340 ("ExponentSkewFactor" , m_exponentSkewFactor , IntAry1d (1,0) , "ExponentSkewFactor" ) 1341 ("MantissaSkewFactor" , m_mantissaSkewFactor , IntAry1d (1,0) , "MantissaSkewFactor" ) 1342 ("PrecRotationParam" , m_precRotationParam , 0 , "PrecRotationParam" ) 1343 ("PrecTranslationParam" , m_precTranslationParam , 0 , "PrecTranslationParam" ) 1344 ("SignR_%d_%d" , m_signR , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3 , "SignR" ) 1345 ("ExponentR_%d_%d" , m_exponentR , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3 , "ExponentR" ) 1346 ("MantissaR_%d_%d" , m_mantissaR , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3 , "MantissaR" ) 1347 ("SignT_%d" , m_signT , BoolAry1d(3,0) ,MAX_NUM_LAYERS , "SignT" ) 1348 ("ExponentT_%d" , m_exponentT , IntAry1d (3,0) ,MAX_NUM_LAYERS , "ExponentT" ) 1349 ("MantissaT_%d" , m_mantissaT , IntAry1d (3,0) ,MAX_NUM_LAYERS , "MantissaT" ) 1350 ; 1351 1352 po::setDefaults(opts); 1353 1354 // Parse the cfg file 1355 po::ErrorReporter err; 1356 po::parseConfigFile( opts, cfgFile, err ); 1357 }; 1358 1359 UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const 1360 { 1361 return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] ); 1362 } 1363 1364 Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice ) 1365 { 1366 // Check config values 1367 Bool wrongConfig = false; 1368 1369 // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes. 1370 xCheckCfg ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0) , "When present, the multiview acquisition information SEI message that applies to the current layer shall be included in an access unit that contains an IRAP picture that is the first picture of a CLVS of the current layer." ); 1371 1372 xCheckCfgRange( wrongConfig, m_precFocalLength , 0, 31, "prec_focal_length" ); 1373 xCheckCfgRange( wrongConfig, m_precPrincipalPoint , 0, 31, "prec_principle_point" ); 1374 xCheckCfgRange( wrongConfig, m_precSkewFactor , 0, 31, "prec_skew_factor" ); 1375 1376 for (Int i = 0; i <= getNumViewsMinus1(); i++ ) 1377 { 1378 xCheckCfgRange( wrongConfig, m_exponentFocalLengthX [ i ], 0, 62, "exponent_focal_length_x" ); 1379 xCheckCfgRange( wrongConfig, m_exponentFocalLengthY [ i ], 0, 62, "exponent_focal_length_y" ); 1380 xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x"); 1381 xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y"); 1382 xCheckCfgRange( wrongConfig, m_exponentSkewFactor [ i ], 0, 62, "exponent_skew_factor" ); 1383 } 1384 1385 xCheckCfgRange( wrongConfig, m_precRotationParam , 0, 31, "prec_focal_length" ); 1386 xCheckCfgRange( wrongConfig, m_precTranslationParam , 0, 31, "prec_focal_length" ); 1387 1388 for (Int i = 0; i <= getNumViewsMinus1(); i++ ) 1389 { 1390 for (Int j = 0; j <= 2; j++) 1391 { 1392 xCheckCfgRange( wrongConfig, m_exponentT[i][j] , 0, 62, "exponent_skew_factor" ); 1393 for (Int k = 0; k <= 2; k++ ) 1394 { 1395 xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y"); 1396 } 1397 } 1398 } 1399 1400 return wrongConfig; 1401 1402 }; 1403 1404 UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const 1405 { 1406 return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ] ); 1407 } 1408 1409 1410 UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const 1411 { 1412 return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ] ); 1413 } 1414 1415 UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const 1416 { 1417 return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] ); 1418 } 1419 1420 UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const 1421 { 1422 return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] ); 1423 } 1424 1425 UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const 1426 { 1427 return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] ); 1428 } 1429 1430 UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const 1431 { 1432 return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] ); 1433 } 1434 UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const 1435 { 1436 UInt len; 1437 if( expo == 0 ) 1438 { 1439 len = std::max(0, prec - 30 ); 1440 } 1441 else 1442 { 1443 len = std::max( 0, expo + prec - 31 ); 1444 } 1445 1446 assert( val >= 0 ); 1447 assert( val <= ( ( 1 << len )- 1) ); 1448 return len; 1449 } 1450 1451 Void SEIMultiviewViewPosition::setupFromSlice ( const TComSlice* slice ) 1452 { 1453 const TComVPS* vps = slice->getVPS(); 1454 m_numViewsMinus1 = vps->getNumViews() - 1; 1455 m_viewPosition.resize( m_numViewsMinus1 + 1 ); 1456 for (Int i = 0; i <= m_numViewsMinus1; i++ ) 1457 { 1458 // Assuming that view ids indicate the position 1459 m_viewPosition[i] = vps->getViewIdVal( i ); 1460 } 1461 } 1462 1463 Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile) 1464 { 1465 // Set default values 1466 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1467 1468 defAppLayerIds .push_back( 0 ); 1469 defAppPocs .push_back( 0 ); 1470 defAppTids .push_back( 0 ); 1471 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 1472 1473 Int defSeiNaluId = 0; 1474 Int defPositionInSeiNalu = 0; 1475 Bool defModifyByEncoder = true; 1476 1477 // Setup config file options 1478 po::Options opts; 1479 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1480 1481 opts.addOptions() 1482 ("NumViewsMinus1" , m_numViewsMinus1 , 0 , "NumViewsMinus1") 1483 ("ViewPosition" , m_viewPosition , IntAry1d (1,0) , "ViewPosition" ); 1484 ; 1485 1486 po::setDefaults(opts); 1487 1488 // Parse the cfg file 1489 po::ErrorReporter err; 1490 po::parseConfigFile( opts, cfgFile, err ); 1491 }; 1492 1493 Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice ) 1494 { 1495 // Check config values 1496 Bool wrongConfig = false; 1497 1498 // TBD: Add constraints on presence of SEI here. 1499 xCheckCfg ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit." ); 1500 1501 // TBD: Modify constraints according to the SEI semantics. 1502 xCheckCfgRange( wrongConfig, m_numViewsMinus1 , 0 , 62, "num_views_minus1"); 1503 for(Int i = 0; i <= m_numViewsMinus1; i++) 1504 { 1505 xCheckCfgRange( wrongConfig, m_viewPosition[i] , 0 , 62, "view_position"); 1506 } 1507 1508 return wrongConfig; 1509 1510 }; 1511 1512 #if NH_MV_SEI_TBD 1513 Void SEIAlternativeDepthInfo::setupFromSlice ( const TComSlice* slice ) 1514 { 1515 sei.m_alternativeDepthInfoCancelFlag = TBD ; 1516 if( sei.m_alternativeDepthInfoCancelFlag = = 0 ) 1517 { 1518 sei.m_depthType = TBD ; 1519 if( sei.m_depthType = = 0 ) 1520 { 1521 sei.m_numConstituentViewsGvdMinus1 = TBD ; 1522 sei.m_depthPresentGvdFlag = TBD ; 1523 sei.m_zGvdFlag = TBD ; 1524 sei.m_intrinsicParamGvdFlag = TBD ; 1525 sei.m_rotationGvdFlag = TBD ; 1526 sei.m_translationGvdFlag = TBD ; 1527 if( sei.m_zGvdFlag ) 1528 { 1529 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1530 { 1531 sei.m_signGvdZNearFlag[i] = TBD ; 1532 sei.m_expGvdZNear[i] = TBD ; 1533 sei.m_manLenGvdZNearMinus1[i] = TBD ; 1534 sei.m_manGvdZNear[i] = TBD ; 1535 sei.m_signGvdZFarFlag[i] = TBD ; 1536 sei.m_expGvdZFar[i] = TBD ; 1537 sei.m_manLenGvdZFarMinus1[i] = TBD ; 1538 sei.m_manGvdZFar[i] = TBD ; 1539 } 1540 } 1541 if( sei.m_intrinsicParamGvdFlag ) 1542 { 1543 sei.m_precGvdFocalLength = TBD ; 1544 sei.m_precGvdPrincipalPoint = TBD ; 1545 } 1546 if( sei.m_rotationGvdFlag ) 1547 { 1548 sei.m_precGvdRotationParam = TBD ; 1549 } 1550 if( sei.m_translationGvdFlag ) 1551 { 1552 sei.m_precGvdTranslationParam = TBD ; 1553 } 1554 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1555 { 1556 if( sei.m_intrinsicParamGvdFlag ) 1557 { 1558 sei.m_signGvdFocalLengthX[i] = TBD ; 1559 sei.m_expGvdFocalLengthX[i] = TBD ; 1560 sei.m_manGvdFocalLengthX[i] = TBD ; 1561 sei.m_signGvdFocalLengthY[i] = TBD ; 1562 sei.m_expGvdFocalLengthY[i] = TBD ; 1563 sei.m_manGvdFocalLengthY[i] = TBD ; 1564 sei.m_signGvdPrincipalPointX[i] = TBD ; 1565 sei.m_expGvdPrincipalPointX[i] = TBD ; 1566 sei.m_manGvdPrincipalPointX[i] = TBD ; 1567 sei.m_signGvdPrincipalPointY[i] = TBD ; 1568 sei.m_expGvdPrincipalPointY[i] = TBD ; 1569 sei.m_manGvdPrincipalPointY[i] = TBD ; 1570 } 1571 if( sei.m_rotationGvdFlag ) 1572 { 1573 for( Int j = 10; j <= 3; j++ ) /* row */ 1574 { 1575 for( Int k = 10; k <= 3; k++ ) /* column */ 1576 { 1577 sei.m_signGvdR[i][j][k] = TBD ; 1578 sei.m_expGvdR[i][j][k] = TBD ; 1579 sei.m_manGvdR[i][j][k] = TBD ; 1580 } 1581 } 1582 } 1583 if( sei.m_translationGvdFlag ) 1584 { 1585 sei.m_signGvdTX[i] = TBD ; 1586 sei.m_expGvdTX[i] = TBD ; 1587 sei.m_manGvdTX[i] = TBD ; 1588 } 1589 } 1590 } 1591 if( sei.m_depthType = = 1 ) 1592 { 1593 sei.m_minOffsetXInt = TBD ; 1594 sei.m_minOffsetXFrac = TBD ; 1595 sei.m_maxOffsetXInt = TBD ; 1596 sei.m_maxOffsetXFrac = TBD ; 1597 sei.m_offsetYPresentFlag = TBD ; 1598 if( sei.m_offsetYPresentFlag ) 1599 { 1600 sei.m_minOffsetYInt = TBD ; 1601 sei.m_minOffsetYFrac = TBD ; 1602 sei.m_maxOffsetYInt = TBD ; 1603 sei.m_maxOffsetYFrac = TBD ; 1604 } 1605 sei.m_warpMapSizePresentFlag = TBD ; 1606 if( sei.m_warpMapSizePresentFlag ) 1607 { 1608 sei.m_warpMapWidthMinus2 = TBD ; 1609 sei.m_warpMapHeightMinus2 = TBD ; 1610 } 1611 } 1612 } 1613 }; 1614 Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile) 1615 { 1616 // Set default values 1617 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1618 1619 defAppLayerIds .push_back( TBD ); 1620 defAppPocs .push_back( TBD ); 1621 defAppTids .push_back( TBD ); 1622 defAppVclNaluTypes.push_back( TBD ); 1623 1624 Int defSeiNaluId = 0; 1625 Int defPositionInSeiNalu = 0; 1626 Bool defModifyByEncoder = TBD; 1627 1628 // Setup config file options 1629 po::Options opts; 1630 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1631 1632 opts.addOptions() 1633 ("AlternativeDepthInfoCancelFlag" , m_alternativeDepthInfoCancelFlag , false , "AlternativeDepthInfoCancelFlag" ) 1634 ("DepthType" , m_depthType , 0 , "DepthType" ) 1635 ("NumConstituentViewsGvdMinus1" , m_numConstituentViewsGvdMinus1 , 0 , "NumConstituentViewsGvdMinus1" ) 1636 ("DepthPresentGvdFlag" , m_depthPresentGvdFlag , false , "DepthPresentGvdFlag" ) 1637 ("ZGvdFlag" , m_zGvdFlag , false , "ZGvdFlag" ) 1638 ("IntrinsicParamGvdFlag" , m_intrinsicParamGvdFlag , false , "IntrinsicParamGvdFlag" ) 1639 ("RotationGvdFlag" , m_rotationGvdFlag , false , "RotationGvdFlag" ) 1640 ("TranslationGvdFlag" , m_translationGvdFlag , false , "TranslationGvdFlag" ) 1641 ("SignGvdZNearFlag" , m_signGvdZNearFlag , BoolAry1d(1,0) , "SignGvdZNearFlag" ) 1642 ("ExpGvdZNear" , m_expGvdZNear , IntAry1d (1,0) , "ExpGvdZNear" ) 1643 ("ManLenGvdZNearMinus1" , m_manLenGvdZNearMinus1 , IntAry1d (1,0) , "ManLenGvdZNearMinus1" ) 1644 ("ManGvdZNear" , m_manGvdZNear , IntAry1d (1,0) , "ManGvdZNear" ) 1645 ("SignGvdZFarFlag" , m_signGvdZFarFlag , BoolAry1d(1,0) , "SignGvdZFarFlag" ) 1646 ("ExpGvdZFar" , m_expGvdZFar , IntAry1d (1,0) , "ExpGvdZFar" ) 1647 ("ManLenGvdZFarMinus1" , m_manLenGvdZFarMinus1 , IntAry1d (1,0) , "ManLenGvdZFarMinus1" ) 1648 ("ManGvdZFar" , m_manGvdZFar , IntAry1d (1,0) , "ManGvdZFar" ) 1649 ("PrecGvdFocalLength" , m_precGvdFocalLength , 0 , "PrecGvdFocalLength" ) 1650 ("PrecGvdPrincipalPoint" , m_precGvdPrincipalPoint , 0 , "PrecGvdPrincipalPoint" ) 1651 ("PrecGvdRotationParam" , m_precGvdRotationParam , 0 , "PrecGvdRotationParam" ) 1652 ("PrecGvdTranslationParam" , m_precGvdTranslationParam , 0 , "PrecGvdTranslationParam" ) 1653 ("SignGvdFocalLengthX" , m_signGvdFocalLengthX , BoolAry1d(1,0) , "SignGvdFocalLengthX" ) 1654 ("ExpGvdFocalLengthX" , m_expGvdFocalLengthX , IntAry1d (1,0) , "ExpGvdFocalLengthX" ) 1655 ("ManGvdFocalLengthX" , m_manGvdFocalLengthX , IntAry1d (1,0) , "ManGvdFocalLengthX" ) 1656 ("SignGvdFocalLengthY" , m_signGvdFocalLengthY , BoolAry1d(1,0) , "SignGvdFocalLengthY" ) 1657 ("ExpGvdFocalLengthY" , m_expGvdFocalLengthY , IntAry1d (1,0) , "ExpGvdFocalLengthY" ) 1658 ("ManGvdFocalLengthY" , m_manGvdFocalLengthY , IntAry1d (1,0) , "ManGvdFocalLengthY" ) 1659 ("SignGvdPrincipalPointX" , m_signGvdPrincipalPointX , BoolAry1d(1,0) , "SignGvdPrincipalPointX" ) 1660 ("ExpGvdPrincipalPointX" , m_expGvdPrincipalPointX , IntAry1d (1,0) , "ExpGvdPrincipalPointX" ) 1661 ("ManGvdPrincipalPointX" , m_manGvdPrincipalPointX , IntAry1d (1,0) , "ManGvdPrincipalPointX" ) 1662 ("SignGvdPrincipalPointY" , m_signGvdPrincipalPointY , BoolAry1d(1,0) , "SignGvdPrincipalPointY" ) 1663 ("ExpGvdPrincipalPointY" , m_expGvdPrincipalPointY , IntAry1d (1,0) , "ExpGvdPrincipalPointY" ) 1664 ("ManGvdPrincipalPointY" , m_manGvdPrincipalPointY , IntAry1d (1,0) , "ManGvdPrincipalPointY" ) 1665 ("SignGvdR" , m_signGvdR , BoolAry1d(1,0) ,ADDNUM ,ADDNUM , "SignGvdR" ) 1666 ("ExpGvdR" , m_expGvdR , IntAry1d (1,0) ,ADDNUM ,ADDNUM , "ExpGvdR" ) 1667 ("ManGvdR" , m_manGvdR , IntAry1d (1,0) ,ADDNUM ,ADDNUM , "ManGvdR" ) 1668 ("SignGvdTX" , m_signGvdTX , BoolAry1d(1,0) , "SignGvdTX" ) 1669 ("ExpGvdTX" , m_expGvdTX , IntAry1d (1,0) , "ExpGvdTX" ) 1670 ("ManGvdTX" , m_manGvdTX , IntAry1d (1,0) , "ManGvdTX" ) 1671 ("MinOffsetXInt" , m_minOffsetXInt , 0 , "MinOffsetXInt" ) 1672 ("MinOffsetXFrac" , m_minOffsetXFrac , 0 , "MinOffsetXFrac" ) 1673 ("MaxOffsetXInt" , m_maxOffsetXInt , 0 , "MaxOffsetXInt" ) 1674 ("MaxOffsetXFrac" , m_maxOffsetXFrac , 0 , "MaxOffsetXFrac" ) 1675 ("OffsetYPresentFlag" , m_offsetYPresentFlag , false , "OffsetYPresentFlag" ) 1676 ("MinOffsetYInt" , m_minOffsetYInt , 0 , "MinOffsetYInt" ) 1677 ("MinOffsetYFrac" , m_minOffsetYFrac , 0 , "MinOffsetYFrac" ) 1678 ("MaxOffsetYInt" , m_maxOffsetYInt , 0 , "MaxOffsetYInt" ) 1679 ("MaxOffsetYFrac" , m_maxOffsetYFrac , 0 , "MaxOffsetYFrac" ) 1680 ("WarpMapSizePresentFlag" , m_warpMapSizePresentFlag , false , "WarpMapSizePresentFlag" ) 1681 ("WarpMapWidthMinus2" , m_warpMapWidthMinus2 , 0 , "WarpMapWidthMinus2" ) 1682 ("WarpMapHeightMinus2" , m_warpMapHeightMinus2 , 0 , "WarpMapHeightMinus2" ) 1683 ; 1684 1685 po::setDefaults(opts); 1686 1687 // Parse the cfg file 1688 po::ErrorReporter err; 1689 po::parseConfigFile( opts, cfgFile, err ); 1690 }; 1691 1692 Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice ) 1693 { 1694 // Check config values 1695 Bool wrongConfig = false; 1696 1697 // TBD: Add constraints on presence of SEI here. 1698 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1699 xCheckCfg ( wrongConfig, TBD , "TBD" ); 1700 1701 // TBD: Modify constraints according to the SEI semantics. 1702 xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , MINVAL , MAXVAL, "alternative_depth_info_cancel_flag"); 1703 xCheckCfgRange( wrongConfig, m_depthType , MINVAL , MAXVAL, "depth_type" ); 1704 xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1 , MINVAL , MAXVAL, "num_constituent_views_gvd_minus1 "); 1705 xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag , MINVAL , MAXVAL, "depth_present_gvd_flag" ); 1706 xCheckCfgRange( wrongConfig, m_zGvdFlag , MINVAL , MAXVAL, "z_gvd_flag" ); 1707 xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag , MINVAL , MAXVAL, "intrinsic_param_gvd_flag" ); 1708 xCheckCfgRange( wrongConfig, m_rotationGvdFlag , MINVAL , MAXVAL, "rotation_gvd_flag" ); 1709 xCheckCfgRange( wrongConfig, m_translationGvdFlag , MINVAL , MAXVAL, "translation_gvd_flag" ); 1710 xCheckCfgRange( wrongConfig, m_signGvdZNearFlag[i] , MINVAL , MAXVAL, "sign_gvd_z_near_flag" ); 1711 xCheckCfgRange( wrongConfig, m_expGvdZNear[i] , MINVAL , MAXVAL, "exp_gvd_z_near" ); 1712 xCheckCfgRange( wrongConfig, m_manLenGvdZNearMinus1[i] , MINVAL , MAXVAL, "man_len_gvd_z_near_minus1" ); 1713 xCheckCfgRange( wrongConfig, m_manGvdZNear[i] , MINVAL , MAXVAL, "man_gvd_z_near" ); 1714 xCheckCfgRange( wrongConfig, m_signGvdZFarFlag[i] , MINVAL , MAXVAL, "sign_gvd_z_far_flag" ); 1715 xCheckCfgRange( wrongConfig, m_expGvdZFar[i] , MINVAL , MAXVAL, "exp_gvd_z_far" ); 1716 xCheckCfgRange( wrongConfig, m_manLenGvdZFarMinus1[i] , MINVAL , MAXVAL, "man_len_gvd_z_far_minus1" ); 1717 xCheckCfgRange( wrongConfig, m_manGvdZFar[i] , MINVAL , MAXVAL, "man_gvd_z_far" ); 1718 xCheckCfgRange( wrongConfig, m_precGvdFocalLength , MINVAL , MAXVAL, "prec_gvd_focal_length" ); 1719 xCheckCfgRange( wrongConfig, m_precGvdPrincipalPoint , MINVAL , MAXVAL, "prec_gvd_principal_point" ); 1720 xCheckCfgRange( wrongConfig, m_precGvdRotationParam , MINVAL , MAXVAL, "prec_gvd_rotation_param" ); 1721 xCheckCfgRange( wrongConfig, m_precGvdTranslationParam , MINVAL , MAXVAL, "prec_gvd_translation_param" ); 1722 xCheckCfgRange( wrongConfig, m_signGvdFocalLengthX[i] , MINVAL , MAXVAL, "sign_gvd_focal_length_x" ); 1723 xCheckCfgRange( wrongConfig, m_expGvdFocalLengthX[i] , MINVAL , MAXVAL, "exp_gvd_focal_length_x" ); 1724 xCheckCfgRange( wrongConfig, m_manGvdFocalLengthX[i] , MINVAL , MAXVAL, "man_gvd_focal_length_x" ); 1725 xCheckCfgRange( wrongConfig, m_signGvdFocalLengthY[i] , MINVAL , MAXVAL, "sign_gvd_focal_length_y" ); 1726 xCheckCfgRange( wrongConfig, m_expGvdFocalLengthY[i] , MINVAL , MAXVAL, "exp_gvd_focal_length_y" ); 1727 xCheckCfgRange( wrongConfig, m_manGvdFocalLengthY[i] , MINVAL , MAXVAL, "man_gvd_focal_length_y" ); 1728 xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointX[i] , MINVAL , MAXVAL, "sign_gvd_principal_point_x" ); 1729 xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointX[i] , MINVAL , MAXVAL, "exp_gvd_principal_point_x" ); 1730 xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointX[i] , MINVAL , MAXVAL, "man_gvd_principal_point_x" ); 1731 xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointY[i] , MINVAL , MAXVAL, "sign_gvd_principal_point_y" ); 1732 xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointY[i] , MINVAL , MAXVAL, "exp_gvd_principal_point_y" ); 1733 xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointY[i] , MINVAL , MAXVAL, "man_gvd_principal_point_y" ); 1734 xCheckCfgRange( wrongConfig, m_signGvdR[i][j][k] , MINVAL , MAXVAL, "sign_gvd_r" ); 1735 xCheckCfgRange( wrongConfig, m_expGvdR[i][j][k] , MINVAL , MAXVAL, "exp_gvd_r" ); 1736 xCheckCfgRange( wrongConfig, m_manGvdR[i][j][k] , MINVAL , MAXVAL, "man_gvd_r" ); 1737 xCheckCfgRange( wrongConfig, m_signGvdTX[i] , MINVAL , MAXVAL, "sign_gvd_t_x" ); 1738 xCheckCfgRange( wrongConfig, m_expGvdTX[i] , MINVAL , MAXVAL, "exp_gvd_t_x" ); 1739 xCheckCfgRange( wrongConfig, m_manGvdTX[i] , MINVAL , MAXVAL, "man_gvd_t_x" ); 1740 xCheckCfgRange( wrongConfig, m_minOffsetXInt , MINVAL , MAXVAL, "min_offset_x_int" ); 1741 xCheckCfgRange( wrongConfig, m_minOffsetXFrac , MINVAL , MAXVAL, "min_offset_x_frac" ); 1742 xCheckCfgRange( wrongConfig, m_maxOffsetXInt , MINVAL , MAXVAL, "max_offset_x_int" ); 1743 xCheckCfgRange( wrongConfig, m_maxOffsetXFrac , MINVAL , MAXVAL, "max_offset_x_frac" ); 1744 xCheckCfgRange( wrongConfig, m_offsetYPresentFlag , MINVAL , MAXVAL, "offset_y_present_flag" ); 1745 xCheckCfgRange( wrongConfig, m_minOffsetYInt , MINVAL , MAXVAL, "min_offset_y_int" ); 1746 xCheckCfgRange( wrongConfig, m_minOffsetYFrac , MINVAL , MAXVAL, "min_offset_y_frac" ); 1747 xCheckCfgRange( wrongConfig, m_maxOffsetYInt , MINVAL , MAXVAL, "max_offset_y_int" ); 1748 xCheckCfgRange( wrongConfig, m_maxOffsetYFrac , MINVAL , MAXVAL, "max_offset_y_frac" ); 1749 xCheckCfgRange( wrongConfig, m_warpMapSizePresentFlag , MINVAL , MAXVAL, "warp_map_size_present_flag" ); 1750 xCheckCfgRange( wrongConfig, m_warpMapWidthMinus2 , MINVAL , MAXVAL, "warp_map_width_minus2" ); 1751 xCheckCfgRange( wrongConfig, m_warpMapHeightMinus2 , MINVAL , MAXVAL, "warp_map_height_minus2" ); 1752 1753 return wrongConfig; 1754 1755 }; 1756 #endif 1757 1758 #endif -
branches/HTM-15.1-dev0/source/Lib/TLibCommon/SEI.h
r1313 r1328 42 42 #include "CommonDef.h" 43 43 #include "libmd5/MD5.h" 44 45 46 #if NH_MV_SEI 47 #include "TAppCommon/program_options_lite.h" 48 using namespace std; 49 namespace po = df::program_options_lite; 50 #endif 51 44 52 //! \ingroup TLibCommon 45 53 //! \{ 46 54 class TComSPS; 55 #if NH_MV_SEI 56 class TComSlice; 57 class SEIScalableNesting; 58 #endif 47 59 48 60 /** … … 84 96 CHROMA_SAMPLING_FILTER_HINT = 140, 85 97 KNEE_FUNCTION_INFO = 141 86 #if NH_MV 87 ,SUB_BITSTREAM_PROPERTY = 164 98 #if NH_MV_SEI 99 ,COLOUR_REMAPPING_INFO = 142, 100 DEINTERLACED_FIELD_IDENTIFICATION = 143, 101 LAYERS_NOT_PRESENT = 160, 102 INTER_LAYER_CONSTRAINED_TILE_SETS = 161, 103 BSP_NESTING = 162, 104 BSP_INITIAL_ARRIVAL_TIME = 163, 105 SUB_BITSTREAM_PROPERTY = 164, 106 ALPHA_CHANNEL_INFO = 165, 107 OVERLAY_INFO = 166, 108 TEMPORAL_MV_PREDICTION_CONSTRAINTS = 167, 109 FRAME_FIELD_INFO = 168, 110 THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO = 176, 111 DEPTH_REPRESENTATION_INFO = 177, 112 MULTIVIEW_SCENE_INFO = 178, 113 MULTIVIEW_ACQUISITION_INFO = 179, 114 MULTIVIEW_VIEW_POSITION = 180 115 #if NH_3D 116 , ALTERNATIVE_DEPTH_INFO = 181 117 #endif 88 118 #endif 89 119 90 120 }; 91 121 92 SEI() {} 122 SEI(); 123 93 124 virtual ~SEI() {} 94 95 static const Char *getSEIMessageString(SEI::PayloadType payloadType); 96 125 virtual SEI* getCopy( ) const; 126 static const Char *getSEIMessageString(SEI::PayloadType payloadType ); 97 127 virtual PayloadType payloadType() const = 0; 128 129 #if NH_MV_SEI 130 static SEI* getNewSEIMessage ( SEI::PayloadType payloadType ); 131 Bool insertSei ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const; 132 133 134 virtual Void setupFromSlice ( const TComSlice* slice ); 135 virtual Void setupFromCfgFile ( const Char* cfgFile ); 136 virtual Bool checkCfg ( const TComSlice* slice ); 137 138 Void xPrintCfgErrorIntro(); 139 Void xCheckCfgRange ( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName ); 140 Void xCheckCfg ( Bool& wrongConfig, Bool cond, const Char* errStr ); 141 Void xAddGeneralOpts ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, 142 Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder ); 143 // Filters where to insert SEI in the bitstream. 144 // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used. 145 IntAry1d m_applicableLayerIds; 146 IntAry1d m_applicablePocs; 147 IntAry1d m_applicableTids; 148 IntAry1d m_applicableVclNaluTypes; 149 150 Int m_payloadType; // Payload type 151 Int m_seiNaluId; // Identifies to which NAL unit the SEI is added. 152 Int m_positionInSeiNalu; // Identifies the order within the NAL unit 153 Bool m_modifyByEncoder; // Don't use the SEI cfg-file, but let let the encoder setup the NALU. 154 155 SEIScalableNesting* m_scalNestSeiContThisSei; // Pointer to scalable nesting SEI containing the SEI. When NULL, the SEI is not nested. 156 #endif 98 157 }; 99 158 … … 473 532 474 533 #if NH_MV 534 #if !NH_MV_SEI 475 535 class SEISubBitstreamProperty : public SEI 476 536 { … … 489 549 std::vector<Int> m_maxBitRate; 490 550 }; 551 #endif 491 552 #endif 492 553 … … 598 659 }; 599 660 600 #endif 601 661 #if NH_MV_SEI 662 #if NH_MV_SEI_TBD 663 class SEILayersNotPresent : public SEI 664 { 665 public: 666 PayloadType payloadType( ) const { return LAYERS_NOT_PRESENT; } 667 SEILayersNotPresent ( ) { }; 668 ~SEILayersNotPresent( ) { }; 669 SEI* getCopy( ) const { return new SEILayersNotPresent(*this); }; 670 671 Void setupFromCfgFile( const Char* cfgFile ); 672 Void setupFromSlice ( const TComSlice* slice ); 673 Bool checkCfg ( const TComSlice* slice ); 674 675 Int m_lnpSeiActiveVpsId; 676 BoolAry1d m_layerNotPresentFlag; 677 }; 678 #endif 679 680 class SEIInterLayerConstrainedTileSets : public SEI 681 { 682 public: 683 PayloadType payloadType( ) const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } 684 SEIInterLayerConstrainedTileSets ( ) { }; 685 ~SEIInterLayerConstrainedTileSets( ) { }; 686 SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); }; 687 688 Void setupFromCfgFile( const Char* cfgFile ); 689 Bool checkCfg ( const TComSlice* slice ); 690 691 Bool m_ilAllTilesExactSampleValueMatchFlag; 692 Bool m_ilOneTilePerTileSetFlag; 693 Int m_ilNumSetsInMessageMinus1; 694 Bool m_skippedTileSetPresentFlag; 695 IntAry1d m_ilctsId; 696 IntAry1d m_ilNumTileRectsInSetMinus1; 697 IntAry2d m_ilTopLeftTileIndex; 698 IntAry2d m_ilBottomRightTileIndex; 699 IntAry1d m_ilcIdc; 700 BoolAry1d m_ilExactSampleValueMatchFlag; 701 Int m_allTilesIlcIdc; 702 703 Void resizeDimI( Int sizeDimI ) 704 { 705 m_ilctsId .resize( sizeDimI ); 706 m_ilNumTileRectsInSetMinus1 .resize( sizeDimI ); 707 m_ilTopLeftTileIndex .resize( sizeDimI ); 708 m_ilBottomRightTileIndex .resize( sizeDimI ); 709 m_ilcIdc .resize( sizeDimI ); 710 m_ilExactSampleValueMatchFlag.resize( sizeDimI ); 711 } 712 713 Void resizeDimJ( Int i, Int sizeDimJ ) 714 { 715 m_ilTopLeftTileIndex [i].resize( sizeDimJ ); 716 m_ilBottomRightTileIndex[i].resize( sizeDimJ ); 717 } 718 719 }; 720 721 #if NH_MV_TBD 722 class SEIBspNesting : public SEI 723 { 724 public: 725 PayloadType payloadType( ) const { return BSP_NESTING; } 726 SEIBspNesting ( ) { }; 727 ~SEIBspNesting( ) { }; 728 SEI* getCopy( ) const { return new SEIBspNesting(*this); }; 729 730 Void setupFromCfgFile( const Char* cfgFile ); 731 Void setupFromSlice ( const TComSlice* slice ); 732 Bool checkCfg ( const TComSlice* slice ); 733 734 Int m_seiOlsIdx; 735 Int m_seiPartitioningSchemeIdx; 736 Int m_bspIdx; 737 Int m_bspNestingZeroBit; 738 Int m_numSeisInBspMinus1; 739 }; 740 741 class SEIBspInitialArrivalTime : public SEI 742 { 743 public: 744 PayloadType payloadType( ) const { return BSP_INITIAL_ARRIVAL_TIME; } 745 SEIBspInitialArrivalTime ( ) { }; 746 ~SEIBspInitialArrivalTime( ) { }; 747 SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); }; 748 749 Void setupFromCfgFile( const Char* cfgFile ); 750 Void setupFromSlice ( const TComSlice* slice ); 751 Bool checkCfg ( const TComSlice* slice ); 752 753 IntAry1d m_nalInitialArrivalDelay; 754 IntAry1d m_vclInitialArrivalDelay; 755 }; 756 #endif 757 758 class SEISubBitstreamProperty : public SEI 759 { 760 public: 761 PayloadType payloadType( ) const { return SUB_BITSTREAM_PROPERTY; } 762 SEISubBitstreamProperty ( ) { }; 763 ~SEISubBitstreamProperty( ) { }; 764 SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); }; 765 766 Void setupFromCfgFile( const Char* cfgFile ); 767 Bool checkCfg ( const TComSlice* slice ); 768 Void resizeArrays ( ); 769 770 Int m_sbPropertyActiveVpsId; 771 Int m_numAdditionalSubStreamsMinus1; 772 IntAry1d m_subBitstreamMode; 773 IntAry1d m_olsIdxToVps; 774 IntAry1d m_highestSublayerId; 775 IntAry1d m_avgSbPropertyBitRate; 776 IntAry1d m_maxSbPropertyBitRate; 777 }; 778 779 #if NH_MV_SEI_TBD 780 class SEIAlphaChannelInfo : public SEI 781 { 782 public: 783 PayloadType payloadType( ) const { return ALPHA_CHANNEL_INFO; } 784 SEIAlphaChannelInfo ( ) { }; 785 ~SEIAlphaChannelInfo( ) { }; 786 SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); }; 787 788 Void setupFromCfgFile( const Char* cfgFile ); 789 Void setupFromSlice ( const TComSlice* slice ); 790 Bool checkCfg ( const TComSlice* slice ); 791 792 Bool m_alphaChannelCancelFlag; 793 Int m_alphaChannelUseIdc; 794 Int m_alphaChannelBitDepthMinus8; 795 Int m_alphaTransparentValue; 796 Int m_alphaOpaqueValue; 797 Bool m_alphaChannelIncrFlag; 798 Bool m_alphaChannelClipFlag; 799 Bool m_alphaChannelClipTypeFlag; 800 }; 801 802 class SEIOverlayInfo : public SEI 803 { 804 public: 805 PayloadType payloadType( ) const { return OVERLAY_INFO; } 806 SEIOverlayInfo ( ) { }; 807 ~SEIOverlayInfo( ) { }; 808 SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; 809 810 Void setupFromCfgFile( const Char* cfgFile ); 811 Void setupFromSlice ( const TComSlice* slice ); 812 Bool checkCfg ( const TComSlice* slice ); 813 814 Bool m_overlayInfoCancelFlag; 815 Int m_overlayContentAuxIdMinus128; 816 Int m_overlayLabelAuxIdMinus128; 817 Int m_overlayAlphaAuxIdMinus128; 818 Int m_overlayElementLabelValueLengthMinus8; 819 Int m_numOverlaysMinus1; 820 IntAry1d m_overlayIdx; 821 BoolAry1d m_languageOverlayPresentFlag; 822 IntAry1d m_overlayContentLayerId; 823 BoolAry1d m_overlayLabelPresentFlag; 824 IntAry1d m_overlayLabelLayerId; 825 BoolAry1d m_overlayAlphaPresentFlag; 826 IntAry1d m_overlayAlphaLayerId; 827 IntAry1d m_numOverlayElementsMinus1; 828 IntAry2d m_overlayElementLabelMin; 829 IntAry2d m_overlayElementLabelMax; 830 Int m_overlayZeroBit; 831 IntAry1d m_overlayLanguage; 832 IntAry1d m_overlayName; 833 IntAry2d m_overlayElementName; 834 Bool m_overlayInfoPersistenceFlag; 835 }; 836 837 #endif 838 839 class SEITemporalMvPredictionConstraints : public SEI 840 { 841 public: 842 PayloadType payloadType( ) const { return TEMPORAL_MV_PREDICTION_CONSTRAINTS; } 843 SEITemporalMvPredictionConstraints ( ) { }; 844 ~SEITemporalMvPredictionConstraints( ) { }; 845 SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); }; 846 847 Void setupFromCfgFile( const Char* cfgFile ); 848 Bool checkCfg ( const TComSlice* slice ); 849 850 Bool m_prevPicsNotUsedFlag; 851 Bool m_noIntraLayerColPicFlag; 852 }; 853 854 #if NH_MV_SEI_TBD 855 class SEIFrameFieldInfo : public SEI 856 { 857 public: 858 PayloadType payloadType( ) const { return FRAME_FIELD_INFO; } 859 SEIFrameFieldInfo ( ) { }; 860 ~SEIFrameFieldInfo( ) { }; 861 SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); }; 862 863 Void setupFromCfgFile( const Char* cfgFile ); 864 Void setupFromSlice ( const TComSlice* slice ); 865 Bool checkCfg ( const TComSlice* slice ); 866 867 Int m_ffinfoPicStruct; 868 Int m_ffinfoSourceScanType; 869 Bool m_ffinfoDuplicateFlag; 870 }; 871 872 class SEIThreeDimensionalReferenceDisplaysInfo : public SEI 873 { 874 public: 875 PayloadType payloadType( ) const { return THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO; } 876 SEIThreeDimensionalReferenceDisplaysInfo ( ) { }; 877 ~SEIThreeDimensionalReferenceDisplaysInfo( ) { }; 878 SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); }; 879 880 Void setupFromCfgFile( const Char* cfgFile ); 881 Void setupFromSlice ( const TComSlice* slice ); 882 Bool checkCfg ( const TComSlice* slice ); 883 884 Int m_precRefDisplayWidth; 885 Bool m_refViewingDistanceFlag; 886 Int m_precRefViewingDist; 887 Int m_numRefDisplaysMinus1; 888 IntAry1d m_leftViewId; 889 IntAry1d m_rightViewId; 890 IntAry1d m_exponentRefDisplayWidth; 891 IntAry1d m_mantissaRefDisplayWidth; 892 IntAry1d m_exponentRefViewingDistance; 893 IntAry1d m_mantissaRefViewingDistance; 894 BoolAry1d m_additionalShiftPresentFlag; 895 IntAry1d m_numSampleShiftPlus512; 896 Bool m_threeDimensionalReferenceDisplaysExtensionFlag; 897 }; 898 899 class SEIDepthRepresentationInfo : public SEI 900 { 901 public: 902 PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; } 903 SEIDepthRepresentationInfo ( ) { }; 904 ~SEIDepthRepresentationInfo( ) { }; 905 SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); }; 906 907 Void setupFromCfgFile( const Char* cfgFile ); 908 Void setupFromSlice ( const TComSlice* slice ); 909 Bool checkCfg ( const TComSlice* slice ); 910 911 Bool m_zNearFlag; 912 Bool m_zFarFlag; 913 Bool m_dMinFlag; 914 Bool m_dMaxFlag; 915 Int m_depthRepresentationType; 916 Int m_disparityRefViewId; 917 Int m_depthNonlinearRepresentationNumMinus1; 918 }; 919 920 class SEIDepthRepInfoElement : public SEI 921 { 922 public: 923 PayloadType payloadType( ) const { return DEPTH_REP_INFO_ELEMENT; } 924 SEIDepthRepInfoElement ( ) { }; 925 ~SEIDepthRepInfoElement( ) { }; 926 SEI* getCopy( ) const { return new SEIDepthRepInfoElement(*this); }; 927 928 Void setupFromCfgFile( const Char* cfgFile ); 929 Void setupFromSlice ( const TComSlice* slice ); 930 Bool checkCfg ( const TComSlice* slice ); 931 932 Bool m_daSignFlag; 933 Int m_daExponent; 934 Int m_daMantissaLenMinus1; 935 Int m_daMantissa; 936 }; 937 #endif 938 939 class SEIMultiviewSceneInfo : public SEI 940 { 941 public: 942 PayloadType payloadType( ) const { return MULTIVIEW_SCENE_INFO; } 943 SEIMultiviewSceneInfo ( ) { }; 944 ~SEIMultiviewSceneInfo( ) { }; 945 SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); }; 946 947 Void setupFromCfgFile( const Char* cfgFile ); 948 Bool checkCfg ( const TComSlice* slice ); 949 950 Int m_minDisparity; 951 Int m_maxDisparityRange; 952 }; 953 954 955 class SEIMultiviewAcquisitionInfo : public SEI 956 { 957 public: 958 PayloadType payloadType( ) const { return MULTIVIEW_ACQUISITION_INFO; } 959 SEIMultiviewAcquisitionInfo ( ) { }; 960 ~SEIMultiviewAcquisitionInfo( ) { }; 961 SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); }; 962 963 Void setupFromCfgFile( const Char* cfgFile ); 964 Bool checkCfg ( const TComSlice* slice ); 965 966 Int getNumViewsMinus1( ) const 967 { 968 Int numViewsMinus1; 969 if( m_scalNestSeiContThisSei != NULL ) 970 { 971 numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1; 972 } 973 else 974 { 975 numViewsMinus1 = 0; 976 } 977 return numViewsMinus1; 978 } 979 980 Void resizeArrays( ) 981 { 982 Int numViews = getNumViewsMinus1() + 1; 983 m_signFocalLengthX .resize( numViews ); 984 m_exponentFocalLengthX .resize( numViews ); 985 m_mantissaFocalLengthX .resize( numViews ); 986 m_signFocalLengthY .resize( numViews ); 987 m_exponentFocalLengthY .resize( numViews ); 988 m_mantissaFocalLengthY .resize( numViews ); 989 m_signPrincipalPointX .resize( numViews ); 990 m_exponentPrincipalPointX.resize( numViews ); 991 m_mantissaPrincipalPointX.resize( numViews ); 992 m_signPrincipalPointY .resize( numViews ); 993 m_exponentPrincipalPointY.resize( numViews ); 994 m_mantissaPrincipalPointY.resize( numViews ); 995 m_signSkewFactor .resize( numViews ); 996 m_exponentSkewFactor .resize( numViews ); 997 m_mantissaSkewFactor .resize( numViews ); 998 999 m_signR .resize( numViews ); 1000 m_exponentR .resize( numViews ); 1001 m_mantissaR .resize( numViews ); 1002 m_signT .resize( numViews ); 1003 m_exponentT .resize( numViews ); 1004 m_mantissaT .resize( numViews ); 1005 1006 for( Int i = 0; i < numViews ; i++ ) 1007 { 1008 m_signR [i].resize( 3 ); 1009 m_exponentR[i].resize( 3 ); 1010 m_mantissaR[i].resize( 3 ); 1011 m_signT [i].resize( 3 ); 1012 m_exponentT[i].resize( 3 ); 1013 m_mantissaT[i].resize( 3 ); 1014 1015 for (Int j = 0; j < 3; j++) 1016 { 1017 m_signR [i][j].resize( 3 ); 1018 m_exponentR[i][j].resize( 3 ); 1019 m_mantissaR[i][j].resize( 3 ); 1020 } 1021 } 1022 } 1023 1024 UInt getMantissaFocalLengthXLen ( Int i ) const ; 1025 UInt getMantissaFocalLengthYLen ( Int i ) const ; 1026 UInt getMantissaPrincipalPointXLen( Int i ) const ; 1027 UInt getMantissaPrincipalPointYLen( Int i ) const ; 1028 UInt getMantissaSkewFactorLen ( Int i ) const ; 1029 UInt getMantissaRLen ( Int i, Int j, Int k ) const ; 1030 UInt getMantissaTLen ( Int i, Int j ) const ; 1031 1032 Bool m_intrinsicParamFlag; 1033 Bool m_extrinsicParamFlag; 1034 Bool m_intrinsicParamsEqualFlag; 1035 Int m_precFocalLength; 1036 Int m_precPrincipalPoint; 1037 Int m_precSkewFactor; 1038 BoolAry1d m_signFocalLengthX; 1039 IntAry1d m_exponentFocalLengthX; 1040 IntAry1d m_mantissaFocalLengthX; 1041 BoolAry1d m_signFocalLengthY; 1042 IntAry1d m_exponentFocalLengthY; 1043 IntAry1d m_mantissaFocalLengthY; 1044 BoolAry1d m_signPrincipalPointX; 1045 IntAry1d m_exponentPrincipalPointX; 1046 IntAry1d m_mantissaPrincipalPointX; 1047 BoolAry1d m_signPrincipalPointY; 1048 IntAry1d m_exponentPrincipalPointY; 1049 IntAry1d m_mantissaPrincipalPointY; 1050 BoolAry1d m_signSkewFactor; 1051 IntAry1d m_exponentSkewFactor; 1052 IntAry1d m_mantissaSkewFactor; 1053 Int m_precRotationParam; 1054 Int m_precTranslationParam; 1055 BoolAry3d m_signR; 1056 IntAry3d m_exponentR; 1057 IntAry3d m_mantissaR; 1058 BoolAry2d m_signT; 1059 IntAry2d m_exponentT; 1060 IntAry2d m_mantissaT; 1061 private: 1062 UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 1063 }; 1064 1065 1066 1067 class SEIMultiviewViewPosition : public SEI 1068 { 1069 public: 1070 PayloadType payloadType( ) const { return MULTIVIEW_VIEW_POSITION; } 1071 SEIMultiviewViewPosition ( ) { }; 1072 ~SEIMultiviewViewPosition( ) { }; 1073 SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); }; 1074 1075 Void setupFromCfgFile( const Char* cfgFile ); 1076 Void setupFromSlice ( const TComSlice* slice ); 1077 Bool checkCfg ( const TComSlice* slice ); 1078 1079 Int m_numViewsMinus1; 1080 IntAry1d m_viewPosition; 1081 }; 1082 1083 #if NH_MV_SEI_TBD 1084 class SEIAlternativeDepthInfo : public SEI 1085 { 1086 public: 1087 PayloadType payloadType( ) const { return ALTERNATIVE_DEPTH_INFO; } 1088 SEIAlternativeDepthInfo ( ) { }; 1089 ~SEIAlternativeDepthInfo( ) { }; 1090 SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); }; 1091 1092 Void setupFromCfgFile( const Char* cfgFile ); 1093 Void setupFromSlice ( const TComSlice* slice ); 1094 Bool checkCfg ( const TComSlice* slice ); 1095 1096 Bool m_alternativeDepthInfoCancelFlag; 1097 Int m_depthType; 1098 Int m_numConstituentViewsGvdMinus1; 1099 Bool m_depthPresentGvdFlag; 1100 Bool m_zGvdFlag; 1101 Bool m_intrinsicParamGvdFlag; 1102 Bool m_rotationGvdFlag; 1103 Bool m_translationGvdFlag; 1104 BoolAry1d m_signGvdZNearFlag; 1105 IntAry1d m_expGvdZNear; 1106 IntAry1d m_manLenGvdZNearMinus1; 1107 IntAry1d m_manGvdZNear; 1108 BoolAry1d m_signGvdZFarFlag; 1109 IntAry1d m_expGvdZFar; 1110 IntAry1d m_manLenGvdZFarMinus1; 1111 IntAry1d m_manGvdZFar; 1112 Int m_precGvdFocalLength; 1113 Int m_precGvdPrincipalPoint; 1114 Int m_precGvdRotationParam; 1115 Int m_precGvdTranslationParam; 1116 BoolAry1d m_signGvdFocalLengthX; 1117 IntAry1d m_expGvdFocalLengthX; 1118 IntAry1d m_manGvdFocalLengthX; 1119 BoolAry1d m_signGvdFocalLengthY; 1120 IntAry1d m_expGvdFocalLengthY; 1121 IntAry1d m_manGvdFocalLengthY; 1122 BoolAry1d m_signGvdPrincipalPointX; 1123 IntAry1d m_expGvdPrincipalPointX; 1124 IntAry1d m_manGvdPrincipalPointX; 1125 BoolAry1d m_signGvdPrincipalPointY; 1126 IntAry1d m_expGvdPrincipalPointY; 1127 IntAry1d m_manGvdPrincipalPointY; 1128 BoolAry3d m_signGvdR; 1129 IntAry3d m_expGvdR; 1130 IntAry3d m_manGvdR; 1131 BoolAry1d m_signGvdTX; 1132 IntAry1d m_expGvdTX; 1133 IntAry1d m_manGvdTX; 1134 Int m_minOffsetXInt; 1135 Int m_minOffsetXFrac; 1136 Int m_maxOffsetXInt; 1137 Int m_maxOffsetXFrac; 1138 Bool m_offsetYPresentFlag; 1139 Int m_minOffsetYInt; 1140 Int m_minOffsetYFrac; 1141 Int m_maxOffsetYInt; 1142 Int m_maxOffsetYFrac; 1143 Bool m_warpMapSizePresentFlag; 1144 Int m_warpMapWidthMinus2; 1145 Int m_warpMapHeightMinus2; 1146 }; 1147 #endif 1148 1149 #endif 1150 1151 #endif 602 1152 //! \} -
branches/HTM-15.1-dev0/source/Lib/TLibCommon/TypeDef.h
r1321 r1328 61 61 #define NH_3D ( HEVC_EXT == 2) 62 62 ///////////////////////////////////////////////////////////////////////////////////////// 63 /////////////////////////////////// FIXES ///////////////////////////////////63 /////////////////////////////////// FIXES AND INTEGRATIONS //////////////////////// 64 64 ///////////////////////////////////////////////////////////////////////////////////////// 65 65 #if NH_MV 66 #define NH_MV_SEI_TBD 0 67 #define NH_MV_SEI 1 66 68 #define NH_MV_FIX_TICKET_106 1 // Identical motion check. 67 69 #define NH_MV_FIX_NO_REF_PICS_CHECK 1 // !!SPEC!! -
branches/HTM-15.1-dev0/source/Lib/TLibDecoder/SEIread.cpp
r1313 r1328 99 99 } 100 100 101 #if NH_MV_SEI 102 inline Void SEIReader::output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize) 103 #else 101 104 static inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize) 105 #endif 102 106 { 103 107 if (pDecodedMessageOutputStream) … … 105 109 std::string seiMessageHdr(SEI::getSEIMessageString(sei.payloadType())); seiMessageHdr+=" SEI message"; 106 110 (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw(seiMessageHdr.size()) << "-" << std::setfill(' ') << "\n" << seiMessageHdr << " (" << payloadSize << " bytes)"<< "\n"; 111 #if NH_MV_SEI 112 (*pDecodedMessageOutputStream) << std::setfill(' ') << "LayerId: " << m_layerId << std::setw(2) << " Picture: " << m_decOrder << std::setw( 5 ) << std::endl; 113 #endif 107 114 } 108 115 } … … 277 284 xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream); 278 285 break; 279 #if NH_MV286 #if !NH_MV_SEI 280 287 case SEI::SUB_BITSTREAM_PROPERTY: 281 288 sei = new SEISubBitstreamProperty; 282 289 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream ); 283 290 break; 291 #else 292 #if NH_MV_TBD 293 case SEI::LAYERS_NOT_PRESENT: 294 sei = new SEILayersNotPresent; 295 xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, pDecodedMessageOutputStream ); 296 break; 297 #endif 298 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 299 sei = new SEIInterLayerConstrainedTileSets; 300 xParseSEIInterLayerConstrainedTileSets((SEIInterLayerConstrainedTileSets&) *sei, payloadSize, pDecodedMessageOutputStream ); 301 break; 302 #if NH_MV_TBD 303 case SEI::BSP_NESTING: 304 sei = new SEIBspNesting; 305 xParseSEIBspNesting((SEIBspNesting&) *sei, payloadSize, pDecodedMessageOutputStream ); 306 break; 307 case SEI::BSP_INITIAL_ARRIVAL_TIME: 308 sei = new SEIBspInitialArrivalTime; 309 xParseSEIBspInitialArrivalTime((SEIBspInitialArrivalTime&) *sei, payloadSize, pDecodedMessageOutputStream ); 310 break; 311 #endif 312 case SEI::SUB_BITSTREAM_PROPERTY: 313 sei = new SEISubBitstreamProperty; 314 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream ); 315 break; 316 #if NH_MV_SEI_TBD 317 case SEI::ALPHA_CHANNEL_INFO: 318 sei = new SEIAlphaChannelInfo; 319 xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 320 break; 321 case SEI::OVERLAY_INFO: 322 sei = new SEIOverlayInfo; 323 xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 324 break; 325 #endif 326 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 327 sei = new SEITemporalMvPredictionConstraints; 328 xParseSEITemporalMvPredictionConstraints((SEITemporalMvPredictionConstraints&) *sei, payloadSize, pDecodedMessageOutputStream ); 329 break; 330 #if NH_MV_SEI_TBD 331 case SEI::FRAME_FIELD_INFO: 332 sei = new SEIFrameFieldInfo; 333 xParseSEIFrameFieldInfo((SEIFrameFieldInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 334 break; 335 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 336 sei = new SEIThreeDimensionalReferenceDisplaysInfo; 337 xParseSEIThreeDimensionalReferenceDisplaysInfo((SEIThreeDimensionalReferenceDisplaysInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 338 break; 339 case SEI::DEPTH_REPRESENTATION_INFO: 340 sei = new SEIDepthRepresentationInfo; 341 xParseSEIDepthRepresentationInfo((SEIDepthRepresentationInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 342 break; 343 #endif 344 case SEI::MULTIVIEW_SCENE_INFO: 345 sei = new SEIMultiviewSceneInfo; 346 xParseSEIMultiviewSceneInfo((SEIMultiviewSceneInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 347 break; 348 349 case SEI::MULTIVIEW_ACQUISITION_INFO: 350 sei = new SEIMultiviewAcquisitionInfo; 351 xParseSEIMultiviewAcquisitionInfo((SEIMultiviewAcquisitionInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 352 break; 353 354 case SEI::MULTIVIEW_VIEW_POSITION: 355 sei = new SEIMultiviewViewPosition; 356 xParseSEIMultiviewViewPosition((SEIMultiviewViewPosition&) *sei, payloadSize, pDecodedMessageOutputStream ); 357 break; 358 #if NH_MV_TBD 359 case SEI::ALTERNATIVE_DEPTH_INFO: 360 sei = new SEIAlternativeDepthInfo; 361 xParseSEIAlternativeDepthInfo((SEIAlternativeDepthInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 362 break; 363 #endif 284 364 #endif 285 365 default: … … 857 937 858 938 #if NH_MV 939 #if !NH_MV_SEI 859 940 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 860 941 { … … 883 964 sei.m_maxBitRate.resize( sei.m_numAdditionalSubStreams ); 884 965 } 966 #endif 885 967 #endif 886 968 … … 1101 1183 } 1102 1184 1185 #if NH_MV_SEI_TBD 1186 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1187 { 1188 UInt code; 1189 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1190 1191 sei_read_code( pDecodedMessageOutputStream, 4, code, "lnp_sei_active_vps_id" ); sei.m_lnpSeiActiveVpsId = code; 1192 for( Int i = 0; i <= MaxLayersMinus1; i++ ) 1193 { 1194 sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" ); sei.m_layerNotPresentFlag[i] = (code == 1); 1195 } 1196 }; 1197 #endif 1198 1199 Void SEIReader::xParseSEIInterLayerConstrainedTileSets(SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1200 { 1201 UInt code; 1202 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1203 1204 sei_read_flag( pDecodedMessageOutputStream, code, "il_all_tiles_exact_sample_value_match_flag" ); sei.m_ilAllTilesExactSampleValueMatchFlag = (code == 1); 1205 sei_read_flag( pDecodedMessageOutputStream, code, "il_one_tile_per_tile_set_flag" ); sei.m_ilOneTilePerTileSetFlag = (code == 1); 1206 if( !sei.m_ilOneTilePerTileSetFlag ) 1207 { 1208 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_sets_in_message_minus1" ); sei.m_ilNumSetsInMessageMinus1 = code; 1209 if( sei.m_ilNumSetsInMessageMinus1 ) 1210 { 1211 sei_read_flag( pDecodedMessageOutputStream, code, "skipped_tile_set_present_flag" ); sei.m_skippedTileSetPresentFlag = (code == 1); 1212 } 1213 Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1; 1214 1215 sei.resizeDimI( numSignificantSets ); 1216 for( Int i = 0; i < numSignificantSets; i++ ) 1217 { 1218 sei_read_uvlc( pDecodedMessageOutputStream, code, "ilcts_id" ); sei.m_ilctsId [i] = code; 1219 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_tile_rects_in_set_minus1" ); sei.m_ilNumTileRectsInSetMinus1[i] = code; 1220 1221 sei.resizeDimJ( i, sei.m_ilNumTileRectsInSetMinus1[ i ] + 1 ); 1222 for( Int j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ ) 1223 { 1224 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_top_left_tile_index" ); sei.m_ilTopLeftTileIndex [i][j] = code; 1225 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_bottom_right_tile_index" ); sei.m_ilBottomRightTileIndex[i][j] = code; 1226 } 1227 sei_read_code( pDecodedMessageOutputStream, 2, code, "ilc_idc" ); sei.m_ilcIdc[i] = code; 1228 if ( !sei.m_ilAllTilesExactSampleValueMatchFlag ) 1229 { 1230 sei_read_flag( pDecodedMessageOutputStream, code, "il_exact_sample_value_match_flag" ); sei.m_ilExactSampleValueMatchFlag[i] = (code == 1); 1231 } 1232 } 1233 } 1234 else 1235 { 1236 sei_read_code( pDecodedMessageOutputStream, 2, code, "all_tiles_ilc_idc" ); sei.m_allTilesIlcIdc = code; 1237 } 1238 }; 1239 1240 #if NH_MV_SEI_TBD 1241 Void SEIReader::xParseSEIBspNesting(SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1242 { 1243 UInt code; 1244 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1245 1246 sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_ols_idx" ); sei.m_seiOlsIdx = code; 1247 sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_partitioning_scheme_idx" ); sei.m_seiPartitioningSchemeIdx = code; 1248 sei_read_uvlc( pDecodedMessageOutputStream, code, "bsp_idx" ); sei.m_bspIdx = code; 1249 while( !ByteaLigned(() ) ); 1250 { 1251 sei_read_code( pDecodedMessageOutputStream, *equalto0*/u1, code, "bsp_nesting_zero_bit" ); sei.m_bspNestingZeroBit = code; 1252 } 1253 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_seis_in_bsp_minus1" ); sei.m_numSeisInBspMinus1 = code; 1254 for( Int i = 0; i <= NumSeisInBspMinus1( ); i++ ) 1255 { 1256 SeiMessage(() ); 1257 } 1258 }; 1259 1260 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1261 { 1262 UInt code; 1263 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1264 1265 psIdx = SeiPartitioningSchemeIdx(); 1266 if( nalInitialArrivalDelayPresent ) 1267 { 1268 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 1269 { 1270 sei_read_code( pDecodedMessageOutputStream, getNalInitialArrivalDelayLen ), code, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = code; 1271 } 1272 } 1273 if( vclInitialArrivalDelayPresent ) 1274 { 1275 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 1276 { 1277 sei_read_code( pDecodedMessageOutputStream, getVclInitialArrivalDelayLen ), code, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = code; 1278 } 1279 } 1280 }; 1281 #endif 1282 1283 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1284 { 1285 UInt code; 1286 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1287 1288 sei_read_code( pDecodedMessageOutputStream, 4, code, "sb_property_active_vps_id" ); sei.m_sbPropertyActiveVpsId = code; 1289 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_additional_sub_streams_minus1" ); sei.m_numAdditionalSubStreamsMinus1 = code; 1290 sei.resizeArrays( ); 1291 for( Int i = 0; i <= sei.m_numAdditionalSubStreamsMinus1; i++ ) 1292 { 1293 sei_read_code( pDecodedMessageOutputStream, 2, code, "sub_bitstream_mode" ); sei.m_subBitstreamMode[i] = code; 1294 sei_read_uvlc( pDecodedMessageOutputStream, code, "ols_idx_to_vps" ); sei.m_olsIdxToVps[i] = code; 1295 sei_read_code( pDecodedMessageOutputStream, 3, code, "highest_sublayer_id" ); sei.m_highestSublayerId[i] = code; 1296 sei_read_code( pDecodedMessageOutputStream, 16, code, "avg_sb_property_bit_rate" ); sei.m_avgSbPropertyBitRate[i] = code; 1297 sei_read_code( pDecodedMessageOutputStream, 16, code, "max_sb_property_bit_rate" ); sei.m_maxSbPropertyBitRate[i] = code; 1298 } 1299 }; 1300 1301 #if NH_MV_SEI_TBD 1302 Void SEIReader::xParseSEIAlphaChannelInfo(SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1303 { 1304 UInt code; 1305 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1306 1307 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_cancel_flag" ); sei.m_alphaChannelCancelFlag = (code == 1); 1308 if( !sei.m_alphaChannelCancelFlag ) 1309 { 1310 sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_use_idc" ); sei.m_alphaChannelUseIdc = code; 1311 sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_bit_depth_minus8" ); sei.m_alphaChannelBitDepthMinus8 = code; 1312 sei_read_code( pDecodedMessageOutputStream, getAlphaTransparentValueLen ), code, "alpha_transparent_value" ); sei.m_alphaTransparentValue = code; 1313 sei_read_code( pDecodedMessageOutputStream, getAlphaOpaqueValueLen ), code, "alpha_opaque_value" ); sei.m_alphaOpaqueValue = code; 1314 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_incr_flag" ); sei.m_alphaChannelIncrFlag = (code == 1); 1315 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_flag" ); sei.m_alphaChannelClipFlag = (code == 1); 1316 if( sei.m_alphaChannelClipFlag ) 1317 { 1318 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_type_flag" ); sei.m_alphaChannelClipTypeFlag = (code == 1); 1319 } 1320 } 1321 }; 1322 1323 Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1324 { 1325 UInt code; 1326 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1327 1328 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_cancel_flag" ); sei.m_overlayInfoCancelFlag = (code == 1); 1329 if( !sei.m_overlayInfoCancelFlag ) 1330 { 1331 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_content_aux_id_minus128" ); sei.m_overlayContentAuxIdMinus128 = code; 1332 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_label_aux_id_minus128" ); sei.m_overlayLabelAuxIdMinus128 = code; 1333 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_alpha_aux_id_minus128" ); sei.m_overlayAlphaAuxIdMinus128 = code; 1334 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_element_label_value_length_minus8" ); sei.m_overlayElementLabelValueLengthMinus8 = code; 1335 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlays_minus1" ); sei.m_numOverlaysMinus1 = code; 1336 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 1337 { 1338 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_idx" ); sei.m_overlayIdx[i] = code; 1339 sei_read_flag( pDecodedMessageOutputStream, code, "language_overlay_present_flag" ); sei.m_languageOverlayPresentFlag[i] = (code == 1); 1340 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_content_layer_id" ); sei.m_overlayContentLayerId[i] = code; 1341 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_label_present_flag" ); sei.m_overlayLabelPresentFlag[i] = (code == 1); 1342 if( sei.m_overlayLabelPresentFlag( i ) ) 1343 { 1344 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_label_layer_id" ); sei.m_overlayLabelLayerId[i] = code; 1345 } 1346 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_alpha_present_flag" ); sei.m_overlayAlphaPresentFlag[i] = (code == 1); 1347 if( sei.m_overlayAlphaPresentFlag( i ) ) 1348 { 1349 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_alpha_layer_id" ); sei.m_overlayAlphaLayerId[i] = code; 1350 } 1351 if( sei.m_overlayLabelPresentFlag( i ) ) 1352 { 1353 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlay_elements_minus1" ); sei.m_numOverlayElementsMinus1[i] = code; 1354 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 1355 { 1356 sei_read_code( pDecodedMessageOutputStream, getOverlayElementLabelMinLen ), code, "overlay_element_label_min" ); sei.m_overlayElementLabelMin[i][j] = code; 1357 sei_read_code( pDecodedMessageOutputStream, getOverlayElementLabelMaxLen ), code, "overlay_element_label_max" ); sei.m_overlayElementLabelMax[i][j] = code; 1358 } 1359 } 1360 } 1361 while( !ByteaLigned(() ) ); 1362 { 1363 sei_read_code( pDecodedMessageOutputStream, *equalto0*/f1, code, "overlay_zero_bit" ); sei.m_overlayZeroBit = code; 1364 } 1365 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 1366 { 1367 if( sei.m_languageOverlayPresentFlag( i ) ) 1368 { 1369 sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_language" ); sei.m_overlayLanguage[i] = code; 1370 } 1371 sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_name" ); sei.m_overlayName[i] = code; 1372 if( sei.m_overlayLabelPresentFlag( i ) ) 1373 { 1374 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 1375 { 1376 sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_element_name" ); sei.m_overlayElementName[i][j] = code; 1377 } 1378 } 1379 } 1380 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = (code == 1); 1381 } 1382 }; 1383 #endif 1384 1385 Void SEIReader::xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1386 { 1387 UInt code; 1388 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1389 1390 sei_read_flag( pDecodedMessageOutputStream, code, "prev_pics_not_used_flag" ); sei.m_prevPicsNotUsedFlag = (code == 1); 1391 sei_read_flag( pDecodedMessageOutputStream, code, "no_intra_layer_col_pic_flag" ); sei.m_noIntraLayerColPicFlag = (code == 1); 1392 }; 1393 1394 #if NH_MV_SEI_TBD 1395 Void SEIReader::xParseSEIFrameFieldInfo(SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1396 { 1397 UInt code; 1398 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1399 1400 sei_read_code( pDecodedMessageOutputStream, 4, code, "ffinfo_pic_struct" ); sei.m_ffinfoPicStruct = code; 1401 sei_read_code( pDecodedMessageOutputStream, 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfoSourceScanType = code; 1402 sei_read_flag( pDecodedMessageOutputStream, code, "ffinfo_duplicate_flag" ); sei.m_ffinfoDuplicateFlag = (code == 1); 1403 }; 1404 1405 Void SEIReader::xParseSEIThreeDimensionalReferenceDisplaysInfo(SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1406 { 1407 UInt code; 1408 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1409 1410 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_display_width" ); sei.m_precRefDisplayWidth = code; 1411 sei_read_flag( pDecodedMessageOutputStream, code, "ref_viewing_distance_flag" ); sei.m_refViewingDistanceFlag = (code == 1); 1412 if( sei.m_refViewingDistanceFlag ) 1413 { 1414 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_viewing_dist" ); sei.m_precRefViewingDist = code; 1415 } 1416 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_ref_displays_minus1" ); sei.m_numRefDisplaysMinus1 = code; 1417 for( Int i = 0; i <= NumRefDisplaysMinus1( ); i++ ) 1418 { 1419 sei_read_uvlc( pDecodedMessageOutputStream, code, "left_view_id" ); sei.m_leftViewId[i] = code; 1420 sei_read_uvlc( pDecodedMessageOutputStream, code, "right_view_id" ); sei.m_rightViewId[i] = code; 1421 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_display_width" ); sei.m_exponentRefDisplayWidth[i] = code; 1422 sei_read_code( pDecodedMessageOutputStream, getMantissaRefDisplayWidthLen ), code, "mantissa_ref_display_width" ); sei.m_mantissaRefDisplayWidth[i] = code; 1423 if( sei.m_refViewingDistanceFlag ) 1424 { 1425 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_viewing_distance" ); sei.m_exponentRefViewingDistance[i] = code; 1426 sei_read_code( pDecodedMessageOutputStream, getMantissaRefViewingDistanceLen ), code, "mantissa_ref_viewing_distance" ); sei.m_mantissaRefViewingDistance[i] = code; 1427 } 1428 sei_read_flag( pDecodedMessageOutputStream, code, "additional_shift_present_flag" ); sei.m_additionalShiftPresentFlag[i] = (code == 1); 1429 if( sei.m_additionalShiftPresentFlag( i ) ) 1430 { 1431 sei_read_code( pDecodedMessageOutputStream, 10, code, "num_sample_shift_plus512" ); sei.m_numSampleShiftPlus512[i] = code; 1432 } 1433 } 1434 sei_read_flag( pDecodedMessageOutputStream, code, "three_dimensional_reference_displays_extension_flag" ); sei.m_threeDimensionalReferenceDisplaysExtensionFlag = (code == 1); 1435 }; 1436 1437 Void SEIReader::xParseSEIDepthRepresentationInfo(SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1438 { 1439 UInt code; 1440 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1441 1442 sei_read_flag( pDecodedMessageOutputStream, code, "z_near_flag" ); sei.m_zNearFlag = (code == 1); 1443 sei_read_flag( pDecodedMessageOutputStream, code, "z_far_flag" ); sei.m_zFarFlag = (code == 1); 1444 sei_read_flag( pDecodedMessageOutputStream, code, "d_min_flag" ); sei.m_dMinFlag = (code == 1); 1445 sei_read_flag( pDecodedMessageOutputStream, code, "d_max_flag" ); sei.m_dMaxFlag = (code == 1); 1446 sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_representation_type" ); sei.m_depthRepresentationType = code; 1447 if( sei.m_dMinFlag | | sei.m_dMaxFlag ) 1448 { 1449 sei_read_uvlc( pDecodedMessageOutputStream, code, "disparity_ref_view_id" ); sei.m_disparityRefViewId = code; 1450 } 1451 if( sei.m_zNearFlag ) 1452 { 1453 DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen ); 1454 } 1455 if( sei.m_zFarFlag ) 1456 { 1457 DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen ); 1458 } 1459 if( sei.m_dMinFlag ) 1460 { 1461 DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen ); 1462 } 1463 if( sei.m_dMaxFlag ) 1464 { 1465 DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen ); 1466 } 1467 if( sei.m_depthRepresentationType == 3 ) 1468 { 1469 sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_nonlinear_representation_num_minus1" ); sei.m_depthNonlinearRepresentationNumMinus1 = code; 1470 for( Int i = 1; i <= sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ ) 1471 { 1472 DepthNonlinearRepresentationModel( i ); 1473 } 1474 } 1475 }; 1476 1477 Void SEIReader::xParseSEIDepthRepInfoElement(SEIDepthRepInfoElement& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1478 { 1479 UInt code; 1480 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1481 1482 sei_read_flag( pDecodedMessageOutputStream, code, "da_sign_flag" ); sei.m_daSignFlag = (code == 1); 1483 sei_read_code( pDecodedMessageOutputStream, 7, code, "da_exponent" ); sei.m_daExponent = code; 1484 sei_read_code( pDecodedMessageOutputStream, 5, code, "da_mantissa_len_minus1" ); sei.m_daMantissaLenMinus1 = code; 1485 sei_read_code( pDecodedMessageOutputStream, getDaMantissaLen ), code, "da_mantissa" ); sei.m_daMantissa = code; 1486 }; 1487 #endif 1488 Void SEIReader::xParseSEIMultiviewSceneInfo(SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1489 { 1490 UInt code; 1491 Int sCode; 1492 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1493 1494 sei_read_svlc( pDecodedMessageOutputStream, sCode, "min_disparity" ) ; sei.m_minDisparity = sCode; 1495 sei_read_uvlc( pDecodedMessageOutputStream, code , "max_disparity_range" ); sei.m_maxDisparityRange = code; 1496 }; 1497 1498 Void SEIReader::xParseSEIMultiviewAcquisitionInfo(SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1499 { 1500 UInt code; 1501 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1502 1503 sei.resizeArrays( ); 1504 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_flag" ); sei.m_intrinsicParamFlag = (code == 1); 1505 sei_read_flag( pDecodedMessageOutputStream, code, "extrinsic_param_flag" ); sei.m_extrinsicParamFlag = (code == 1); 1506 if( sei.m_intrinsicParamFlag ) 1507 { 1508 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_params_equal_flag" ); sei.m_intrinsicParamsEqualFlag = (code == 1); 1509 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_focal_length" ); sei.m_precFocalLength = code ; 1510 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_principal_point" ); sei.m_precPrincipalPoint = code ; 1511 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_skew_factor" ); sei.m_precSkewFactor = code ; 1512 1513 for( Int i = 0; i <= ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ ) 1514 { 1515 sei_read_flag( pDecodedMessageOutputStream, code, "sign_focal_length_x" ); sei.m_signFocalLengthX [i] = (code == 1); 1516 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_focal_length_x" ); sei.m_exponentFocalLengthX [i] = code ; 1517 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthXLen ( i ), code, "mantissa_focal_length_x" ); sei.m_mantissaFocalLengthX [i] = code ; 1518 sei_read_flag( pDecodedMessageOutputStream, code, "sign_focal_length_y" ); sei.m_signFocalLengthY [i] = (code == 1); 1519 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_focal_length_y" ); sei.m_exponentFocalLengthY [i] = code ; 1520 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthYLen ( i ), code, "mantissa_focal_length_y" ); sei.m_mantissaFocalLengthY [i] = code ; 1521 sei_read_flag( pDecodedMessageOutputStream, code, "sign_principal_point_x" ); sei.m_signPrincipalPointX [i] = (code == 1); 1522 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_principal_point_x" ); sei.m_exponentPrincipalPointX[i] = code ; 1523 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointXLen( i ), code, "mantissa_principal_point_x" ); sei.m_mantissaPrincipalPointX[i] = code ; 1524 sei_read_flag( pDecodedMessageOutputStream, code, "sign_principal_point_y" ); sei.m_signPrincipalPointY [i] = (code == 1); 1525 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_principal_point_y" ); sei.m_exponentPrincipalPointY[i] = code ; 1526 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointYLen( i ), code, "mantissa_principal_point_y" ); sei.m_mantissaPrincipalPointY[i] = code ; 1527 sei_read_flag( pDecodedMessageOutputStream, code, "sign_skew_factor" ); sei.m_signSkewFactor [i] = (code == 1); 1528 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_skew_factor" ); sei.m_exponentSkewFactor [i] = code ; 1529 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaSkewFactorLen ( i ), code, "mantissa_skew_factor" ); sei.m_mantissaSkewFactor [i] = code ; 1530 } 1531 } 1532 if( sei.m_extrinsicParamFlag ) 1533 { 1534 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_rotation_param" ); sei.m_precRotationParam = code; 1535 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_translation_param" ); sei.m_precTranslationParam = code; 1536 1537 for( Int i = 0; i <= sei.getNumViewsMinus1(); i++ ) 1538 { 1539 for( Int j = 0; j <= 2; j++ ) /* row */ 1540 { 1541 for( Int k = 0; k <= 2; k++ ) /* column */ 1542 { 1543 sei_read_flag( pDecodedMessageOutputStream, code, "sign_r" ); sei.m_signR [i][j][k] = (code == 1); 1544 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_r" ); sei.m_exponentR[i][j][k] = code ; 1545 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaRLen( i, j, k ), code, "mantissa_r" ); sei.m_mantissaR[i][j][k] = code ; 1546 } 1547 sei_read_flag( pDecodedMessageOutputStream, code, "sign_t" ); sei.m_signT [i][j] = (code == 1); 1548 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_t" ); sei.m_exponentT[i][j] = code ; 1549 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaTLen( i, j ), code, "mantissa_t" ); sei.m_mantissaT[i][j] = code ; 1550 } 1551 } 1552 } 1553 }; 1554 1555 1556 1557 Void SEIReader::xParseSEIMultiviewViewPosition(SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1558 { 1559 UInt code; 1560 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1561 1562 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_views_minus1" ); sei.m_numViewsMinus1 = code; 1563 sei.m_viewPosition.resize( sei.m_numViewsMinus1 + 1 ); 1564 for( Int i = 0; i <= sei.m_numViewsMinus1; i++ ) 1565 { 1566 sei_read_uvlc( pDecodedMessageOutputStream, code, "view_position" ); sei.m_viewPosition[i] = code; 1567 } 1568 }; 1569 1570 #if NH_MV_SEI_TBD 1571 Void SEIReader::xParseSEIAlternativeDepthInfo(SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1572 { 1573 UInt code; 1574 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1575 1576 sei_read_flag( pDecodedMessageOutputStream, code, "alternative_depth_info_cancel_flag" ); sei.m_alternativeDepthInfoCancelFlag = (code == 1); 1577 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1578 { 1579 sei_read_code( pDecodedMessageOutputStream, 2, code, "depth_type" ); sei.m_depthType = code; 1580 if( sei.m_depthType == 0 ) 1581 { 1582 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_constituent_views_gvd_minus1" ); sei.m_numConstituentViewsGvdMinus1 = code; 1583 sei_read_flag( pDecodedMessageOutputStream, code, "depth_present_gvd_flag" ); sei.m_depthPresentGvdFlag = (code == 1); 1584 sei_read_flag( pDecodedMessageOutputStream, code, "z_gvd_flag" ); sei.m_zGvdFlag = (code == 1); 1585 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_gvd_flag" ); sei.m_intrinsicParamGvdFlag = (code == 1); 1586 sei_read_flag( pDecodedMessageOutputStream, code, "rotation_gvd_flag" ); sei.m_rotationGvdFlag = (code == 1); 1587 sei_read_flag( pDecodedMessageOutputStream, code, "translation_gvd_flag" ); sei.m_translationGvdFlag = (code == 1); 1588 if( sei.m_zGvdFlag ) 1589 { 1590 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1591 { 1592 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i] = (code == 1); 1593 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i] = code; 1594 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i] = code; 1595 sei_read_code( pDecodedMessageOutputStream, getManGvdZNearLen ), code, "man_gvd_z_near" ); sei.m_manGvdZNear[i] = code; 1596 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i] = (code == 1); 1597 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i] = code; 1598 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i] = code; 1599 sei_read_code( pDecodedMessageOutputStream, getManGvdZFarLen ), code, "man_gvd_z_far" ); sei.m_manGvdZFar[i] = code; 1600 } 1601 } 1602 if( sei.m_intrinsicParamGvdFlag ) 1603 { 1604 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_focal_length" ); sei.m_precGvdFocalLength = code; 1605 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_principal_point" ); sei.m_precGvdPrincipalPoint = code; 1606 } 1607 if( sei.m_rotationGvdFlag ) 1608 { 1609 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_rotation_param" ); sei.m_precGvdRotationParam = code; 1610 } 1611 if( sei.m_translationGvdFlag ) 1612 { 1613 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_translation_param" ); sei.m_precGvdTranslationParam = code; 1614 } 1615 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1616 { 1617 if( sei.m_intrinsicParamGvdFlag ) 1618 { 1619 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i] = (code == 1); 1620 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i] = code; 1621 sei_read_code( pDecodedMessageOutputStream, getManGvdFocalLengthXLen ), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i] = code; 1622 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i] = (code == 1); 1623 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i] = code; 1624 sei_read_code( pDecodedMessageOutputStream, getManGvdFocalLengthYLen ), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i] = code; 1625 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i] = (code == 1); 1626 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i] = code; 1627 sei_read_code( pDecodedMessageOutputStream, getManGvdPrincipalPointXLen ), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i] = code; 1628 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i] = (code == 1); 1629 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i] = code; 1630 sei_read_code( pDecodedMessageOutputStream, getManGvdPrincipalPointYLen ), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i] = code; 1631 } 1632 if( sei.m_rotationGvdFlag ) 1633 { 1634 for( Int j = 10; j <= 3; j++ ) /* row */ 1635 { 1636 for( Int k = 10; k <= 3; k++ ) /* column */ 1637 { 1638 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r" ); sei.m_signGvdR[i][j][k] = (code == 1); 1639 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r" ); sei.m_expGvdR[i][j][k] = code; 1640 sei_read_code( pDecodedMessageOutputStream, getManGvdRLen ), code, "man_gvd_r" ); sei.m_manGvdR[i][j][k] = code; 1641 } 1642 } 1643 } 1644 if( sei.m_translationGvdFlag ) 1645 { 1646 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i] = (code == 1); 1647 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i] = code; 1648 sei_read_code( pDecodedMessageOutputStream, getManGvdTXLen ), code, "man_gvd_t_x" ); sei.m_manGvdTX[i] = code; 1649 } 1650 } 1651 } 1652 if( sei.m_depthType == 1 ) 1653 { 1654 sei_read_svlc( pDecodedMessageOutputStream, code, "min_offset_x_int" ); sei.m_minOffsetXInt = code; 1655 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_x_frac" ); sei.m_minOffsetXFrac = code; 1656 sei_read_svlc( pDecodedMessageOutputStream, code, "max_offset_x_int" ); sei.m_maxOffsetXInt = code; 1657 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_x_frac" ); sei.m_maxOffsetXFrac = code; 1658 sei_read_flag( pDecodedMessageOutputStream, code, "offset_y_present_flag" ); sei.m_offsetYPresentFlag = (code == 1); 1659 if( sei.m_offsetYPresentFlag ) 1660 { 1661 sei_read_svlc( pDecodedMessageOutputStream, code, "min_offset_y_int" ); sei.m_minOffsetYInt = code; 1662 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_y_frac" ); sei.m_minOffsetYFrac = code; 1663 sei_read_svlc( pDecodedMessageOutputStream, code, "max_offset_y_int" ); sei.m_maxOffsetYInt = code; 1664 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_y_frac" ); sei.m_maxOffsetYFrac = code; 1665 } 1666 sei_read_flag( pDecodedMessageOutputStream, code, "warp_map_size_present_flag" ); sei.m_warpMapSizePresentFlag = (code == 1); 1667 if( sei.m_warpMapSizePresentFlag ) 1668 { 1669 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_width_minus2" ); sei.m_warpMapWidthMinus2 = code; 1670 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_height_minus2" ); sei.m_warpMapHeightMinus2 = code; 1671 } 1672 } 1673 } 1674 }; 1675 #endif 1676 1103 1677 //! \} -
branches/HTM-15.1-dev0/source/Lib/TLibDecoder/SEIread.h
r1313 r1328 57 57 virtual ~SEIReader() {}; 58 58 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 59 #if NH_MV_SEI 60 Void setLayerId ( Int layerId ) { m_layerId = layerId; }; 61 Void setDecOrder ( Int64 decOrder ) { m_decOrder = decOrder; }; 62 #endif 59 63 protected: 60 64 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); … … 81 85 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 82 86 #if NH_MV 87 #if !NH_MV_SEI 83 88 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei , UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 84 89 Void xResizeSubBitstreamPropertySeiArrays (SEISubBitstreamProperty &sei); 90 #endif 91 #endif 92 #if NH_MV_SEI_TBD 93 Void xParseSEILayersNotPresent (SEILayersNotPresent& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 94 #endif 95 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 96 #if NH_MV_SEI_TBD 97 Void xParseSEIBspNesting (SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 98 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 99 #endif 100 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 101 #if NH_MV_SEI_TBD 102 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 103 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 104 #endif 105 Void xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 106 #if NH_MV_SEI_TBD 107 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 108 Void xParseSEIThreeDimensionalReferenceDisplaysInfo (SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 109 Void xParseSEIDepthRepresentationInfo (SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 110 111 Void xParseSEIDepthRepInfoElement (SEIDepthRepInfoElement& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 112 #endif 113 Void xParseSEIMultiviewSceneInfo (SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 114 115 Void xParseSEIMultiviewAcquisitionInfo (SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 116 117 #if NH_MV_SEI 118 Void xParseSEIMultiviewViewPosition (SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 119 #endif 120 #if NH_MV_SEI_TBD 121 Void xParseSEIAlternativeDepthInfo (SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 85 122 #endif 86 123 … … 89 126 Void sei_read_svlc(std::ostream *pOS, Int& ruiCode, const Char *pSymbolName); 90 127 Void sei_read_flag(std::ostream *pOS, UInt& ruiCode, const Char *pSymbolName); 128 #if NH_MV_SEI 129 inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize); 130 private: 131 Int m_layerId; 132 Int64 m_decOrder; 133 #endif 91 134 }; 92 135 -
branches/HTM-15.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r1321 r1328 684 684 } 685 685 } 686 #if NH_MV_SEI 687 m_seiReader.setLayerId ( newPic->getLayerId ( ) ); 688 m_seiReader.setDecOrder( newPic->getDecodingOrder( ) ); 689 #endif 686 690 #endif 687 691 -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/SEIEncoder.cpp
r1313 r1328 465 465 466 466 #if NH_MV 467 #if !NH_MV_SEI 467 468 Void SEIEncoder::initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps) 468 469 { … … 476 477 seiSubBitstreamProperty->m_maxBitRate = m_pcCfg->getMaxBitRate(); 477 478 } 479 #else 480 Void SEIEncoder::createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice ) 481 { 482 const SEIMessages* seiMessageCfg = m_pcCfg->getSeiMessages(); 483 484 for( SEIMessages::const_iterator itS = seiMessageCfg->begin(); itS != seiMessageCfg->end(); itS++ ) 485 { 486 const SEI* curSei = (*itS); 487 SEI* newSei; 488 if ( curSei->insertSei( slice->getLayerId(), slice->getPOC(), slice->getTemporalId(), slice->getNalUnitType() ) ) 489 { 490 newSei = curSei->getCopy( ) ; 491 492 if ( curSei->m_modifyByEncoder ) 493 { 494 newSei->setupFromSlice ( slice ); 495 } 496 497 if ( newSei ->checkCfg( slice ) ) 498 { 499 std::cout << "--> Omit sending SEI." << std::endl; 500 delete newSei; 501 } 502 else 503 { 504 seiMessage.push_back(newSei); 505 } 506 507 } 508 } 509 } 478 510 #endif 511 #endif 479 512 480 513 //! \} -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/SEIEncoder.h
r1313 r1328 86 86 Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice); 87 87 #if NH_MV 88 #if !NH_MV_SEI 88 89 Void initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps); 90 #else 91 Void createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice );; 92 #endif 89 93 #endif 90 94 private: -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/SEIwrite.cpp
r1313 r1328 122 122 break; 123 123 #if NH_MV 124 #if !NH_MV_SEI 124 125 case SEI::SUB_BITSTREAM_PROPERTY: 125 126 xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei)); 126 127 break; 127 128 #endif 129 #endif 130 #if NH_MV_SEI 131 #if NH_MV_SEI_TBD 132 case SEI::LAYERS_NOT_PRESENT: 133 xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei)); 134 break; 135 #endif 136 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 137 xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei)); 138 break; 139 #if NH_MV_SEI_TBD 140 case SEI::BSP_NESTING: 141 xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei)); 142 break; 143 case SEI::BSP_INITIAL_ARRIVAL_TIME: 144 xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei)); 145 break; 146 #endif 147 case SEI::SUB_BITSTREAM_PROPERTY: 148 xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei)); 149 break; 150 #if NH_MV_SEI_TBD 151 case SEI::ALPHA_CHANNEL_INFO: 152 xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei)); 153 break; 154 case SEI::OVERLAY_INFO: 155 xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei)); 156 break; 157 #endif 158 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 159 xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei)); 160 break; 161 #if NH_MV_SEI_TBD 162 case SEI::FRAME_FIELD_INFO: 163 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 164 break; 165 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 166 xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei)); 167 break; 168 case SEI::DEPTH_REPRESENTATION_INFO: 169 xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei)); 170 break; 171 #endif 172 case SEI::MULTIVIEW_SCENE_INFO: 173 xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei)); 174 break; 175 case SEI::MULTIVIEW_ACQUISITION_INFO: 176 xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei)); 177 break; 178 179 case SEI::MULTIVIEW_VIEW_POSITION: 180 xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei)); 181 break; 182 #if NH_MV_SEI_TBD 183 case SEI::ALTERNATIVE_DEPTH_INFO: 184 xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei)); 185 break; 186 #endif 187 #endif 188 128 189 129 190 default: … … 748 809 749 810 #if NH_MV 811 #if !NH_MV_SEI 750 812 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei) 751 813 { … … 764 826 xWriteByteAlign(); 765 827 } 828 #endif 766 829 #endif 767 830 … … 818 881 } 819 882 883 #if NH_MV_SEI_TBD 884 Void SEIWriter::xWriteSEILayersNotPresent( const SEILayersNotPresent& sei) 885 { 886 WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" ); 887 for( Int i = 0; i <= MaxLayersMinus1; i++ ) 888 { 889 WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" ); 890 } 891 }; 892 #endif 893 894 895 896 Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets( const SEIInterLayerConstrainedTileSets& sei) 897 { 898 WRITE_FLAG( ( sei.m_ilAllTilesExactSampleValueMatchFlag ? 1 : 0 ), "il_all_tiles_exact_sample_value_match_flag" ); 899 WRITE_FLAG( ( sei.m_ilOneTilePerTileSetFlag ? 1 : 0 ), "il_one_tile_per_tile_set_flag" ); 900 if( !sei.m_ilOneTilePerTileSetFlag ) 901 { 902 WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" ); 903 if( sei.m_ilNumSetsInMessageMinus1 ) 904 { 905 WRITE_FLAG( ( sei.m_skippedTileSetPresentFlag ? 1 : 0 ), "skipped_tile_set_present_flag" ); 906 } 907 Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1; 908 for( Int i = 0; i < numSignificantSets; i++ ) 909 { 910 WRITE_UVLC( sei.m_ilctsId[i], "ilcts_id" ); 911 WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" ); 912 for( Int j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ ) 913 { 914 WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j], "il_top_left_tile_index" ); 915 WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" ); 916 } 917 WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" ); 918 if ( !sei.m_ilAllTilesExactSampleValueMatchFlag ) 919 { 920 WRITE_FLAG( ( sei.m_ilExactSampleValueMatchFlag[i] ? 1 : 0 ), "il_exact_sample_value_match_flag" ); 921 } 922 } 923 } 924 else 925 { 926 WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" ); 927 } 928 }; 929 930 #if NH_MV_SEI_TBD 931 Void SEIWriter::xWriteSEIBspNesting( const SEIBspNesting& sei) 932 { 933 WRITE_UVLC( sei.m_seiOlsIdx, "sei_ols_idx" ); 934 WRITE_UVLC( sei.m_seiPartitioningSchemeIdx, "sei_partitioning_scheme_idx" ); 935 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); 936 while( !ByteaLigned(() ) ); 937 { 938 WRITE_CODE( sei.m_bspNestingZeroBit, *equalto0*/u1, "bsp_nesting_zero_bit" ); 939 } 940 WRITE_UVLC( sei.m_numSeisInBspMinus1, "num_seis_in_bsp_minus1" ); 941 for( Int i = 0; i <= NumSeisInBspMinus1( ); i++ ) 942 { 943 SeiMessage(() ); 944 } 945 }; 946 947 Void SEIWriter::xWriteSEIBspInitialArrivalTime( const SEIBspInitialArrivalTime& sei) 948 { 949 psIdx = SeiPartitioningSchemeIdx(); 950 if( nalInitialArrivalDelayPresent ) 951 { 952 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 953 { 954 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], getNalInitialArrivalDelayLen ), "nal_initial_arrival_delay" ); 955 } 956 } 957 if( vclInitialArrivalDelayPresent ) 958 { 959 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 960 { 961 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], getVclInitialArrivalDelayLen ), "vcl_initial_arrival_delay" ); 962 } 963 } 964 }; 965 #endif 966 Void SEIWriter::xWriteSEISubBitstreamProperty( const SEISubBitstreamProperty& sei) 967 { 968 WRITE_CODE( sei.m_sbPropertyActiveVpsId, 4, "sb_property_active_vps_id" ); 969 WRITE_UVLC( sei.m_numAdditionalSubStreamsMinus1, "num_additional_sub_streams_minus1" ); 970 for( Int i = 0; i <= sei.m_numAdditionalSubStreamsMinus1; i++ ) 971 { 972 WRITE_CODE( sei.m_subBitstreamMode [i], 2, "sub_bitstream_mode" ); 973 WRITE_UVLC( sei.m_olsIdxToVps [i], "ols_idx_to_vps" ); 974 WRITE_CODE( sei.m_highestSublayerId [i], 3, "highest_sublayer_id" ); 975 WRITE_CODE( sei.m_avgSbPropertyBitRate[i], 16, "avg_sb_property_bit_rate" ); 976 WRITE_CODE( sei.m_maxSbPropertyBitRate[i], 16, "max_sb_property_bit_rate" ); 977 } 978 }; 979 #if NH_MV_SEI_TBD 980 Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei) 981 { 982 WRITE_FLAG( ( sei.m_alphaChannelCancelFlag ? 1 : 0 ), "alpha_channel_cancel_flag" ); 983 if( !sei.m_alphaChannelCancelFlag ) 984 { 985 WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" ); 986 WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" ); 987 WRITE_CODE( sei.m_alphaTransparentValue, getAlphaTransparentValueLen ), "alpha_transparent_value" ); 988 WRITE_CODE( sei.m_alphaOpaqueValue, getAlphaOpaqueValueLen ), "alpha_opaque_value" ); 989 WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" ); 990 WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" ); 991 if( sei.m_alphaChannelClipFlag ) 992 { 993 WRITE_FLAG( ( sei.m_alphaChannelClipTypeFlag ? 1 : 0 ), "alpha_channel_clip_type_flag" ); 994 } 995 } 996 }; 997 998 Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei) 999 { 1000 WRITE_FLAG( ( sei.m_overlayInfoCancelFlag ? 1 : 0 ), "overlay_info_cancel_flag" ); 1001 if( !sei.m_overlayInfoCancelFlag ) 1002 { 1003 WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" ); 1004 WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" ); 1005 WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" ); 1006 WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" ); 1007 WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" ); 1008 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 1009 { 1010 WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" ); 1011 WRITE_FLAG( ( sei.m_languageOverlayPresentFlag[i] ? 1 : 0 ), "language_overlay_present_flag" ); 1012 WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id" ); 1013 WRITE_FLAG( ( sei.m_overlayLabelPresentFlag[i] ? 1 : 0 ), "overlay_label_present_flag" ); 1014 if( sei.m_overlayLabelPresentFlag( i ) ) 1015 { 1016 WRITE_CODE( sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id" ); 1017 } 1018 WRITE_FLAG( ( sei.m_overlayAlphaPresentFlag[i] ? 1 : 0 ), "overlay_alpha_present_flag" ); 1019 if( sei.m_overlayAlphaPresentFlag( i ) ) 1020 { 1021 WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" ); 1022 } 1023 if( sei.m_overlayLabelPresentFlag( i ) ) 1024 { 1025 WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1" ); 1026 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 1027 { 1028 WRITE_CODE( sei.m_overlayElementLabelMin[i][j], getOverlayElementLabelMinLen ), "overlay_element_label_min" ); 1029 WRITE_CODE( sei.m_overlayElementLabelMax[i][j], getOverlayElementLabelMaxLen ), "overlay_element_label_max" ); 1030 } 1031 } 1032 } 1033 while( !ByteaLigned(() ) ); 1034 { 1035 WRITE_CODE( sei.m_overlayZeroBit, *equalto0*/f1, "overlay_zero_bit" ); 1036 } 1037 for( Int i = 0; i <= NumOverlaysMinus1( ); i++ ) 1038 { 1039 if( sei.m_languageOverlayPresentFlag( i ) ) 1040 { 1041 WRITE_CODE( sei.m_overlayLanguage[i], tv, "overlay_language" ); 1042 } 1043 WRITE_CODE( sei.m_overlayName[i], tv, "overlay_name" ); 1044 if( sei.m_overlayLabelPresentFlag( i ) ) 1045 { 1046 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1( i ); j++ ) 1047 { 1048 WRITE_CODE( sei.m_overlayElementName[i][j], tv, "overlay_element_name" ); 1049 } 1050 } 1051 } 1052 WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" ); 1053 } 1054 }; 1055 #endif 1056 1057 Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei) 1058 { 1059 WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag ? 1 : 0 ), "prev_pics_not_used_flag" ); 1060 WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" ); 1061 }; 1062 1063 #if NH_MV_SEI_TBD 1064 Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei) 1065 { 1066 WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" ); 1067 WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" ); 1068 WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" ); 1069 }; 1070 1071 Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei) 1072 { 1073 WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" ); 1074 WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" ); 1075 if( sei.m_refViewingDistanceFlag ) 1076 { 1077 WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" ); 1078 } 1079 WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" ); 1080 for( Int i = 0; i <= NumRefDisplaysMinus1( ); i++ ) 1081 { 1082 WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" ); 1083 WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" ); 1084 WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" ); 1085 WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], getMantissaRefDisplayWidthLen ), "mantissa_ref_display_width" ); 1086 if( sei.m_refViewingDistanceFlag ) 1087 { 1088 WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" ); 1089 WRITE_CODE( sei.m_mantissaRefViewingDistance[i], getMantissaRefViewingDistanceLen ), "mantissa_ref_viewing_distance" ); 1090 } 1091 WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" ); 1092 if( sei.m_additionalShiftPresentFlag( i ) ) 1093 { 1094 WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" ); 1095 } 1096 } 1097 WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" ); 1098 }; 1099 1100 Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei) 1101 { 1102 WRITE_FLAG( ( sei.m_zNearFlag ? 1 : 0 ), "z_near_flag" ); 1103 WRITE_FLAG( ( sei.m_zFarFlag ? 1 : 0 ), "z_far_flag" ); 1104 WRITE_FLAG( ( sei.m_dMinFlag ? 1 : 0 ), "d_min_flag" ); 1105 WRITE_FLAG( ( sei.m_dMaxFlag ? 1 : 0 ), "d_max_flag" ); 1106 WRITE_UVLC( sei.m_depthRepresentationType, "depth_representation_type" ); 1107 if( sei.m_dMinFlag | | sei.m_dMaxFlag ) 1108 { 1109 WRITE_UVLC( sei.m_disparityRefViewId, "disparity_ref_view_id" ); 1110 } 1111 if( sei.m_zNearFlag ) 1112 { 1113 DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen ); 1114 } 1115 if( sei.m_zFarFlag ) 1116 { 1117 DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen ); 1118 } 1119 if( sei.m_dMinFlag ) 1120 { 1121 DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen ); 1122 } 1123 if( sei.m_dMaxFlag ) 1124 { 1125 DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen ); 1126 } 1127 if( sei.m_depthRepresentationType == 3 ) 1128 { 1129 WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1, "depth_nonlinear_representation_num_minus1" ); 1130 for( Int i = 1; i <= sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ ) 1131 { 1132 DepthNonlinearRepresentationModel( i ); 1133 } 1134 } 1135 }; 1136 1137 Void SEIWriter::xWriteSEIDepthRepInfoElement( const SEIDepthRepInfoElement& sei) 1138 { 1139 WRITE_FLAG( ( sei.m_daSignFlag ? 1 : 0 ), "da_sign_flag" ); 1140 WRITE_CODE( sei.m_daExponent, 7, "da_exponent" ); 1141 WRITE_CODE( sei.m_daMantissaLenMinus1, 5, "da_mantissa_len_minus1" ); 1142 WRITE_CODE( sei.m_daMantissa, getDaMantissaLen ), "da_mantissa" ); 1143 }; 1144 1145 #endif 1146 Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei) 1147 { 1148 WRITE_SVLC( sei.m_minDisparity , "min_disparity" ); 1149 WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" ); 1150 }; 1151 1152 1153 Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei) 1154 { 1155 WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" ); 1156 WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" ); 1157 if( sei.m_intrinsicParamFlag ) 1158 { 1159 WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" ); 1160 WRITE_UVLC( sei.m_precFocalLength , "prec_focal_length" ); 1161 WRITE_UVLC( sei.m_precPrincipalPoint , "prec_principal_point" ); 1162 WRITE_UVLC( sei.m_precSkewFactor , "prec_skew_factor" ); 1163 1164 for( Int i = 0; i <= ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ ) 1165 { 1166 WRITE_FLAG( ( sei.m_signFocalLengthX [i] ? 1 : 0 ), "sign_focal_length_x" ); 1167 WRITE_CODE( sei.m_exponentFocalLengthX [i] , 6 , "exponent_focal_length_x" ); 1168 WRITE_CODE( sei.m_mantissaFocalLengthX [i] , sei.getMantissaFocalLengthXLen( i ), "mantissa_focal_length_x" ); 1169 WRITE_FLAG( ( sei.m_signFocalLengthY [i] ? 1 : 0 ), "sign_focal_length_y" ); 1170 WRITE_CODE( sei.m_exponentFocalLengthY [i] , 6 , "exponent_focal_length_y" ); 1171 WRITE_CODE( sei.m_mantissaFocalLengthY [i] , sei.getMantissaFocalLengthYLen( i ), "mantissa_focal_length_y" ); 1172 WRITE_FLAG( ( sei.m_signPrincipalPointX [i] ? 1 : 0 ), "sign_principal_point_x" ); 1173 WRITE_CODE( sei.m_exponentPrincipalPointX[i] , 6, "exponent_principal_point_x" ); 1174 WRITE_CODE( sei.m_mantissaPrincipalPointX[i] , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" ); 1175 WRITE_FLAG( ( sei.m_signPrincipalPointY [i] ? 1 : 0 ), "sign_principal_point_y" ); 1176 WRITE_CODE( sei.m_exponentPrincipalPointY[i] , 6, "exponent_principal_point_y" ); 1177 WRITE_CODE( sei.m_mantissaPrincipalPointY[i] , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" ); 1178 WRITE_FLAG( ( sei.m_signSkewFactor [i] ? 1 : 0 ), "sign_skew_factor" ); 1179 WRITE_CODE( sei.m_exponentSkewFactor [i] , 6, "exponent_skew_factor" ); 1180 WRITE_CODE( sei.m_mantissaSkewFactor [i] , sei.getMantissaSkewFactorLen( i ) , "mantissa_skew_factor" ); 1181 } 1182 } 1183 if( sei.m_extrinsicParamFlag ) 1184 { 1185 WRITE_UVLC( sei.m_precRotationParam , "prec_rotation_param" ); 1186 WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" ); 1187 for( Int i = 0; i <= sei.getNumViewsMinus1(); i++ ) 1188 { 1189 for( Int j = 0; j <= 2; j++ ) /* row */ 1190 { 1191 for( Int k = 0; k <= 2; k++ ) /* column */ 1192 { 1193 WRITE_FLAG( ( sei.m_signR [i][j][k] ? 1 : 0 ), "sign_r" ); 1194 WRITE_CODE( sei.m_exponentR[i][j][k] , 6, "exponent_r" ); 1195 WRITE_CODE( sei.m_mantissaR[i][j][k] , sei.getMantissaRLen( i,j,k ) , "mantissa_r" ); 1196 } 1197 WRITE_FLAG( ( sei.m_signT [i][j] ? 1 : 0 ), "sign_t" ); 1198 WRITE_CODE( sei.m_exponentT[i][j] , 6, "exponent_t" ); 1199 WRITE_CODE( sei.m_mantissaT[i][j] , sei.getMantissaTLen( i,j ),"mantissa_t" ); 1200 } 1201 } 1202 } 1203 }; 1204 1205 1206 #if NH_MV_SEI 1207 Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei) 1208 { 1209 WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" ); 1210 for( Int i = 0; i <= sei.m_numViewsMinus1; i++ ) 1211 { 1212 WRITE_UVLC( sei.m_viewPosition[i], "view_position" ); 1213 } 1214 }; 1215 #endif 1216 1217 #if NH_MV_SEI_TBD 1218 Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei) 1219 { 1220 WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" ); 1221 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1222 { 1223 WRITE_CODE( sei.m_depthType, 2, "depth_type" ); 1224 if( sei.m_depthType == 0 ) 1225 { 1226 WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" ); 1227 WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" ); 1228 WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" ); 1229 WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" ); 1230 WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" ); 1231 WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" ); 1232 if( sei.m_zGvdFlag ) 1233 { 1234 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1235 { 1236 WRITE_FLAG( ( sei.m_signGvdZNearFlag[i] ? 1 : 0 ), "sign_gvd_z_near_flag" ); 1237 WRITE_CODE( sei.m_expGvdZNear[i], 7, "exp_gvd_z_near" ); 1238 WRITE_CODE( sei.m_manLenGvdZNearMinus1[i], 5, "man_len_gvd_z_near_minus1" ); 1239 WRITE_CODE( sei.m_manGvdZNear[i], getManGvdZNearLen ), "man_gvd_z_near" ); 1240 WRITE_FLAG( ( sei.m_signGvdZFarFlag[i] ? 1 : 0 ), "sign_gvd_z_far_flag" ); 1241 WRITE_CODE( sei.m_expGvdZFar[i], 7, "exp_gvd_z_far" ); 1242 WRITE_CODE( sei.m_manLenGvdZFarMinus1[i], 5, "man_len_gvd_z_far_minus1" ); 1243 WRITE_CODE( sei.m_manGvdZFar[i], getManGvdZFarLen ), "man_gvd_z_far" ); 1244 } 1245 } 1246 if( sei.m_intrinsicParamGvdFlag ) 1247 { 1248 WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" ); 1249 WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" ); 1250 } 1251 if( sei.m_rotationGvdFlag ) 1252 { 1253 WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" ); 1254 } 1255 if( sei.m_translationGvdFlag ) 1256 { 1257 WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" ); 1258 } 1259 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1260 { 1261 if( sei.m_intrinsicParamGvdFlag ) 1262 { 1263 WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i] ? 1 : 0 ), "sign_gvd_focal_length_x" ); 1264 WRITE_CODE( sei.m_expGvdFocalLengthX[i], 6, "exp_gvd_focal_length_x" ); 1265 WRITE_CODE( sei.m_manGvdFocalLengthX[i], getManGvdFocalLengthXLen ), "man_gvd_focal_length_x" ); 1266 WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i] ? 1 : 0 ), "sign_gvd_focal_length_y" ); 1267 WRITE_CODE( sei.m_expGvdFocalLengthY[i], 6, "exp_gvd_focal_length_y" ); 1268 WRITE_CODE( sei.m_manGvdFocalLengthY[i], getManGvdFocalLengthYLen ), "man_gvd_focal_length_y" ); 1269 WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i] ? 1 : 0 ), "sign_gvd_principal_point_x" ); 1270 WRITE_CODE( sei.m_expGvdPrincipalPointX[i], 6, "exp_gvd_principal_point_x" ); 1271 WRITE_CODE( sei.m_manGvdPrincipalPointX[i], getManGvdPrincipalPointXLen ), "man_gvd_principal_point_x" ); 1272 WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i] ? 1 : 0 ), "sign_gvd_principal_point_y" ); 1273 WRITE_CODE( sei.m_expGvdPrincipalPointY[i], 6, "exp_gvd_principal_point_y" ); 1274 WRITE_CODE( sei.m_manGvdPrincipalPointY[i], getManGvdPrincipalPointYLen ), "man_gvd_principal_point_y" ); 1275 } 1276 if( sei.m_rotationGvdFlag ) 1277 { 1278 for( Int j = 10; j <= 3; j++ ) /* row */ 1279 { 1280 for( Int k = 10; k <= 3; k++ ) /* column */ 1281 { 1282 WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" ); 1283 WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" ); 1284 WRITE_CODE( sei.m_manGvdR[i][j][k], getManGvdRLen ), "man_gvd_r" ); 1285 } 1286 } 1287 } 1288 if( sei.m_translationGvdFlag ) 1289 { 1290 WRITE_FLAG( ( sei.m_signGvdTX[i] ? 1 : 0 ), "sign_gvd_t_x" ); 1291 WRITE_CODE( sei.m_expGvdTX[i], 6, "exp_gvd_t_x" ); 1292 WRITE_CODE( sei.m_manGvdTX[i], getManGvdTXLen ), "man_gvd_t_x" ); 1293 } 1294 } 1295 } 1296 if( sei.m_depthType == 1 ) 1297 { 1298 WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" ); 1299 WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" ); 1300 WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" ); 1301 WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" ); 1302 WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" ); 1303 if( sei.m_offsetYPresentFlag ) 1304 { 1305 WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" ); 1306 WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" ); 1307 WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" ); 1308 WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" ); 1309 } 1310 WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" ); 1311 if( sei.m_warpMapSizePresentFlag ) 1312 { 1313 WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" ); 1314 WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" ); 1315 } 1316 } 1317 } 1318 }; 1319 1320 #endif 1321 820 1322 //! \} -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/SEIwrite.h
r1313 r1328 72 72 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps); 73 73 #if NH_MV 74 #if !NH_MV_SEI 74 75 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 76 #endif 75 77 #endif 76 78 Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei); … … 81 83 Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei); 82 84 85 #if NH_MV_SEI 86 #if NH_MV_SEI_TBD 87 Void xWriteSEILayersNotPresent ( const SEILayersNotPresent& sei); 88 #endif 89 Void xWriteSEIInterLayerConstrainedTileSets ( const SEIInterLayerConstrainedTileSets& sei); 90 #if NH_MV_SEI_TBD 91 Void xWriteSEIBspNesting ( const SEIBspNesting& sei); 92 Void xWriteSEIBspInitialArrivalTime ( const SEIBspInitialArrivalTime& sei); 93 #endif 94 Void xWriteSEISubBitstreamProperty ( const SEISubBitstreamProperty& sei); 95 #if NH_MV_SEI_TBD 96 Void xWriteSEIAlphaChannelInfo ( const SEIAlphaChannelInfo& sei); 97 Void xWriteSEIOverlayInfo ( const SEIOverlayInfo& sei); 98 #endif 99 Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei); 100 #if NH_MV_SEI_TBD 101 Void xWriteSEIFrameFieldInfo ( const SEIFrameFieldInfo& sei); 102 Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei); 103 Void xWriteSEIDepthRepresentationInfo ( const SEIDepthRepresentationInfo& sei); 104 Void xWriteSEIDepthRepInfoElement ( const SEIDepthRepInfoElement& sei); 105 #endif 106 Void xWriteSEIMultiviewSceneInfo ( const SEIMultiviewSceneInfo& sei); 107 Void xWriteSEIMultiviewAcquisitionInfo ( const SEIMultiviewAcquisitionInfo& sei); 108 Void xWriteSEIMultiviewViewPosition ( const SEIMultiviewViewPosition& sei); 109 #if NH_MV_SEI_TBD 110 Void xWriteSEIAlternativeDepthInfo ( const SEIAlternativeDepthInfo& sei); 111 #endif 83 112 Void xWriteByteAlign(); 84 113 }; 114 #endif 85 115 86 116 //! \} -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/TEncCfg.h
r1313 r1328 49 49 #include "TAppCommon/TAppComCamPara.h" 50 50 #include "TLibRenderer/TRenModSetupStrParser.h" 51 #endif 52 53 #if NH_MV 54 #include "TLibCommon/SEI.h" 51 55 #endif 52 56 … … 350 354 Int* m_kneeSEIOutputKneePoint; 351 355 TComSEIMasteringDisplay m_masteringDisplay; 356 #if NH_MV_SEI 357 SEIMessages* m_seiMessages; 358 #endif 352 359 //====== Weighted Prediction ======== 353 360 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 432 439 433 440 #if NH_MV 441 #if !NH_MV_SEI 434 442 Bool m_subBistreamPropSEIEnabled; 435 443 Int m_numAdditionalSubStreams; … … 439 447 std::vector<Int> m_avgBitRate; 440 448 std::vector<Int> m_maxBitRate; 449 #endif 441 450 #endif 442 451 … … 933 942 const TComSEIMasteringDisplay &getMasteringDisplaySEI() const { return m_masteringDisplay; } 934 943 #if NH_MV 944 #if NH_MV_SEI 945 Void setSeiMessages(SEIMessages *p) { m_seiMessages = p; } 946 const SEIMessages* getSeiMessages() { return m_seiMessages; } 947 #else 935 948 Bool getSubBitstreamPropSEIEnabled() { return m_subBistreamPropSEIEnabled;} 936 949 Void setSubBitstreamPropSEIEnabled(Bool x) { m_subBistreamPropSEIEnabled = x;} … … 958 971 Int getMaxBitRate(Int idx) { return m_maxBitRate[idx];} 959 972 Void setMaxBitRate(std::vector<Int> &x) { m_maxBitRate = x;} 960 973 #endif 961 974 #endif 962 975 -
branches/HTM-15.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r1321 r1328 412 412 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps) 413 413 { 414 #if NH_MV415 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());416 #else417 414 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 418 #endif 415 419 416 if(m_pcCfg->getActiveParameterSetsSEIEnabled()) 420 417 { … … 482 479 483 480 #if NH_MV 481 #if !NH_MV_SEI 484 482 if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) ) 485 483 { … … 488 486 seiMessages.push_back(sei); 489 487 } 488 #endif 490 489 #endif 491 490 } … … 1835 1834 xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice); 1836 1835 1836 #if NH_MV_SEI 1837 m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice ); 1838 #endif 1839 1837 1840 /* use the main bitstream buffer for storing the marshalled picture */ 1838 1841 m_pcEntropyCoder->setBitstream(NULL); -
branches/HTM-15.1-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h
r1313 r1328 87 87 ); 88 88 89 std::vector<Int>*getSynthViews() { return &m_aiAllSynthViewNums; }90 std::vector<Int>*getBaseViews() { return &m_aiAllBaseViewIdx; }89 IntAry1d* getSynthViews() { return &m_aiAllSynthViewNums; } 90 IntAry1d* getBaseViews() { return &m_aiAllBaseViewIdx; } 91 91 92 92 TRenModSetupStrParser(); … … 95 95 96 96 private: 97 std::vector< std::vector<Int > >m_aaaiBaseViewsIdx [2];98 std::vector< std::vector<Int > >m_aaaiVideoDistMode [2];99 std::vector< std::vector<Int > >m_aaaiDepthDistMode [2];100 std::vector< std::vector<Int > >m_aaaiModelNums [2];101 std::vector< std::vector<Int > >m_aaaiSynthViewNums [2];102 std::vector< std::vector<Bool> >m_aaabOrgRef [2];103 std::vector< std::vector<Bool> >m_aaabExtrapolate [2];104 std::vector< std::vector<Int > >m_aaaiBlendMode [2];97 IntAry2d m_aaaiBaseViewsIdx [2]; 98 IntAry2d m_aaaiVideoDistMode [2]; 99 IntAry2d m_aaaiDepthDistMode [2]; 100 IntAry2d m_aaaiModelNums [2]; 101 IntAry2d m_aaaiSynthViewNums [2]; 102 BoolAry2d m_aaabOrgRef [2]; 103 BoolAry2d m_aaabExtrapolate [2]; 104 IntAry2d m_aaaiBlendMode [2]; 105 105 106 std::vector<Int>m_aiAllBaseViewIdx;107 std::vector<Int>m_aiAllSynthViewNums;106 IntAry1d m_aiAllBaseViewIdx; 107 IntAry1d m_aiAllSynthViewNums; 108 108 109 109 Bool m_bCurrentViewSet;
Note: See TracChangeset for help on using the changeset viewer.