Changeset 1356 in 3DVCSoftware for trunk/source/Lib
- Timestamp:
- 27 Oct 2015, 11:33:16 (9 years ago)
- Location:
- trunk/source/Lib
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TAppCommon/program_options_lite.cpp
r1313 r1356 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 } -
trunk/source/Lib/TAppCommon/program_options_lite.h
r1313 r1356 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 #if SEI_DRI_F0169 408 template<> 409 inline void 410 Option< std::vector< std::vector<double> > >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&) 411 { 412 // xParseVec ( arg, opt_storage[ idcs[0] ] ); 413 char* pcNextStart = (char*) arg.data(); 414 char* pcEnd = pcNextStart + arg.length(); 415 416 char* pcOldStart = 0; 417 418 size_t iIdx = 0; 419 420 while (pcNextStart < pcEnd) 421 { 422 errno = 0; 423 424 if ( iIdx < opt_storage[idcs[0]].size() ) 425 { 426 opt_storage[idcs[0]][iIdx] = strtod(pcNextStart, &pcNextStart); 427 } 428 else 429 { 430 opt_storage[idcs[0]].push_back( strtod(pcNextStart, &pcNextStart)) ; 431 } 432 iIdx++; 433 434 if ( errno == ERANGE || (pcNextStart == pcOldStart) ) 435 { 436 std::cerr << "Error Parsing Doubles: `" << arg << "'" << std::endl; 437 exit(EXIT_FAILURE); 438 }; 439 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++; 440 pcOldStart = pcNextStart; 441 442 } 443 444 445 } 446 #endif 447 #else 238 448 template<> 239 449 inline void … … 272 482 } 273 483 } 274 275 484 #endif 485 486 #if NH_MV_SEI 487 488 template<> 489 inline void 490 Option< StringAry1d >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err ) 491 { 492 493 opt_storage[ idcs[ 0 ] ] = arg; 494 }; 495 496 template<> 497 inline void 498 Option< StringAry2d >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err ) 499 { 500 501 opt_storage[idcs[0]][idcs[1]] = arg; 502 }; 503 504 505 template<> 506 inline void 507 Option< std::vector< char*> >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err ) 508 { 509 510 opt_storage[ idcs[ 0 ] ] = arg.empty() ? NULL : strdup(arg.c_str()) ; 511 }; 512 513 template<> 514 inline void 515 Option< BoolAry1d >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err) 516 { 517 xParseVec( arg, opt_storage ); 518 }; 519 520 template<> 521 inline void 522 Option< BoolAry2d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err) 523 { 524 xParseVec( arg, opt_storage[ idcs[0] ] ); 525 }; 526 527 template<> 528 inline void 529 Option< BoolAry3d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err ) 530 { 531 xParseVec( arg, opt_storage[idcs[0]][idcs[1]] ); 532 }; 533 #else 276 534 template<> 277 535 inline void … … 307 565 } 308 566 #endif 567 #endif 309 568 /** Option class for argument handling using a user provided function */ 310 569 struct OptionFunc : public OptionBase … … 316 575 {} 317 576 577 #if NH_MV_SEI 578 void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& error_reporter) 579 #else 318 580 void parse(const std::string& arg, ErrorReporter& error_reporter) 581 #endif 319 582 { 320 583 func(parent, arg, error_reporter); … … 388 651 operator()(const std::string& name, std::vector<T>& storage, T default_val, unsigned uiMaxNum, const std::string& desc = "" ) 389 652 { 653 #if NH_MV_SEI 654 std::vector<T> defVal; 655 defVal.resize( uiMaxNum, default_val ); 656 std::vector< int > maxSize; 657 maxSize.push_back( uiMaxNum ); 658 parent.addOption(new Option< std::vector<T> >( name, storage, defVal, desc, false, maxSize )); 659 660 return *this; 661 } 662 663 template<typename T> 664 OptionSpecific& 665 operator()(const std::string& name, std::vector< std::vector<T> >& storage, T default_val, unsigned uiMaxNumDim1, unsigned uiMaxNumDim2, const std::string& desc = "" ) 666 { 667 std::vector< std::vector<T> > defVal; 668 defVal.resize(uiMaxNumDim1); 669 for ( unsigned int idxDim1 = 0; idxDim1 < uiMaxNumDim1; idxDim1++ ) 670 { 671 defVal[ idxDim1 ].resize(uiMaxNumDim2, default_val ); 672 } 673 674 std::vector< int > maxSize; 675 maxSize.push_back( uiMaxNumDim1 ); 676 maxSize.push_back( uiMaxNumDim2 ); 677 678 parent.addOption(new Option< std::vector< std::vector<T> > >( name, storage, defVal, desc, false, maxSize )); 679 return *this; 680 } 681 #else 390 682 std::string cNameBuffer; 391 683 std::string cDescBuffer; … … 415 707 return *this; 416 708 } 709 #endif 417 710 #endif 418 711 /** -
trunk/source/Lib/TLibCommon/CommonDef.h
r1322 r1356 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 -
trunk/source/Lib/TLibCommon/SEI.cpp
r1313 r1356 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_LAYERS_NOT_PRESENT_SEI 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 case SEI::ALPHA_CHANNEL_INFO : return new SEIAlphaChannelInfo; 236 case SEI::OVERLAY_INFO : return new SEIOverlayInfo; 237 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS : return new SEITemporalMvPredictionConstraints; 238 #if NH_MV_SEI_TBD 239 case SEI::FRAME_FIELD_INFO : return new SEIFrameFieldInfo; 240 #endif 241 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return new SEIThreeDimensionalReferenceDisplaysInfo; 242 #if SEI_DRI_F0169 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_3D 249 case SEI::ALTERNATIVE_DEPTH_INFO : return new SEIAlternativeDepthInfo; 250 #endif 251 #endif 252 default: assert( false ); return NULL; 253 } 254 } 255 256 Void SEI::setupFromSlice ( const TComSlice* slice ) 257 { 258 xPrintCfgErrorIntro(); 259 std::cout << getSEIMessageString( payloadType() ) << "Setup by the encoder is currently not possible. Using the default SEI cfg-file." << std::endl; 260 } 261 262 SEI* SEI::getCopy() const 263 { 264 assert( 0 ); 265 return NULL; 266 } 267 268 Void SEI::setupFromCfgFile( const Char* cfgFile ) 269 { 270 assert( false ); 271 } 272 273 Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const 274 { 275 Bool insertSeiHere = true; 276 if( !m_applicableLayerIds.empty() ) 277 { 278 insertSeiHere = insertSeiHere && ( std::find( m_applicableLayerIds.begin(), m_applicableLayerIds.end(), curLayerId) != m_applicableLayerIds.end() ) ; 279 } 280 if( !m_applicablePocs .empty() ) 281 { 282 insertSeiHere = insertSeiHere && ( std::find( m_applicablePocs .begin(), m_applicablePocs .end(), curPoc ) != m_applicablePocs .end() ) ; 283 } 284 if( !m_applicableTids .empty() ) 285 { 286 insertSeiHere = insertSeiHere && ( std::find( m_applicableTids .begin(), m_applicableTids .end(), curTid ) != m_applicableTids .end() ) ; 287 } 288 if( !m_applicableVclNaluTypes.empty() ) 289 { 290 insertSeiHere = insertSeiHere && ( std::find( m_applicableVclNaluTypes.begin(), m_applicableVclNaluTypes.end(), curNaluType) != m_applicableVclNaluTypes.end() ) ; 291 } 292 return insertSeiHere; 293 } 294 295 Bool SEI::checkCfg( const TComSlice* slice ) 296 { 297 assert( false ); 298 return true; 299 } 300 301 Void SEI::xPrintCfgErrorIntro() 302 { 303 std::cout << "Error in configuration of " << getSEIMessageString( payloadType() ) << " SEI: "; 304 } 305 306 Void SEI::xCheckCfgRange( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName ) 307 { 308 if ( val < minVal || val > maxVal ) 309 { 310 xPrintCfgErrorIntro(); 311 std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl; 312 wrongConfig = true; 313 } 314 } 315 316 Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs, 317 IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, 318 Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder) 319 { 320 opts.addOptions() 321 ("PayloadType" , m_payloadType , -1 , "Payload Type" ) 322 ("ApplicableLayerIds" , m_applicableLayerIds , defAppLayerIds , "LayerIds of layers to which the SEI is added. (all when empty)") 323 ("ApplicablePocs" , m_applicablePocs , deftApplicablePocs , "POCs of pictures to which the SEI is added. (all when empty)") 324 ("ApplicableTids" , m_applicableTids , defAppTids , "TIds of pictures to which the SEI is added. (all when empty)") 325 ("ApplicableVclNaluTypes" , m_applicableVclNaluTypes , defAppVclNaluTypes , "NaluUnitTypes of picture to which the SEI is added. (all when empty)") 326 ("SeiNaluId" , m_seiNaluId , defSeiNaluId , "Identifies to which NAL unit the SEI is added." ) 327 ("PositionInSeiNalu" , m_positionInSeiNalu , defPositionInSeiNalu , "Identifies the position within the NAL unit.") 328 ("ModifyByEncoder" , m_modifyByEncoder , defModifyByEncoder , "0: Use payload as specified in cfg file 1: Modify SEI by encoder"); 329 } 330 331 Void SEI::xCheckCfg( Bool& wrongConfig, Bool cond, const Char* errStr ) 332 { 333 if ( !cond ) 334 { 335 xPrintCfgErrorIntro(); 336 std::cout << errStr << std::endl; 337 wrongConfig = true; 338 } 339 } 340 341 342 #if NH_MV_LAYERS_NOT_PRESENT_SEI 343 Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile) 344 { 345 // Set default values 346 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 347 348 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 349 // This SEI message doesn't need to be added by default to any Layer / POC / NAL Unit / T Layer. Not sure if empty is right. 350 defAppLayerIds .empty( ); 351 defAppPocs .empty( ); 352 defAppTids .empty( ); 353 defAppVclNaluTypes.empty( ); 354 355 Int defSeiNaluId = 0; 356 Int defPositionInSeiNalu = 0; 357 Bool defModifyByEncoder = false; //0: Use payload as specified in cfg file 1: Modify SEI by encoder 358 359 // Setup config file options 360 po::Options opts; 361 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 362 363 opts.addOptions() 364 ("LnpSeiActiveVpsId" , m_lnpSeiActiveVpsId , 0 , "LnpSeiActiveVpsId" ) //Why? 365 ("LayerNotPresentFlag" , m_layerNotPresentFlag , BoolAry1d(1,0) , "LayerNotPresentFlag" ) 366 ; 367 368 po::setDefaults(opts); 369 370 // Parse the cfg file 371 po::ErrorReporter err; 372 po::parseConfigFile( opts, cfgFile, err ); 373 m_lnpSeiMaxLayers = (UInt) m_layerNotPresentFlag.size(); 374 }; 375 376 Bool SEILayersNotPresent::checkCfg( const TComSlice* slice ) 377 { 378 // Check config values 379 Bool wrongConfig = false; 380 // 381 const TComVPS* vps = slice->getVPS(); 382 // // TBD: Add constraints on presence of SEI here. 383 xCheckCfg ( wrongConfig, m_lnpSeiActiveVpsId == vps->getVPSId(), "The value of lnp_sei_active_vps_id shall be equal to the value of vps_video_parameter_set_id of the active VPS for the VCL NAL units of the access unit containing the SEI message." ); 384 xCheckCfg ( wrongConfig, m_lnpSeiMaxLayers == vps->getMaxLayersMinus1(), "The number of LayerNotPresent flags shall be equal to vpsMaxLayersMinus1." ); 385 386 387 for (Int i = 0; i < vps->getMaxLayersMinus1(); i++) 388 { 389 if ( m_layerNotPresentFlag[ i ] && i < vps->getMaxLayersMinus1() ) 390 { 391 for (Int j = 0; j < vps->getNumPredictedLayers( vps->getLayerIdInNuh( j ) - 1 ); j++ ) 392 { 393 xCheckCfg ( wrongConfig, m_layerNotPresentFlag[ vps->getLayerIdInVps( vps->getIdPredictedLayer( vps->getLayerIdInNuh(i),j) )], "When layer_not_present_flag[ i ] is equal to 1 and i is less than MaxLayersMinus1, layer_not_present_flag[ LayerIdxInVps[ IdPredictedLayer[ layer_id_in_nuh[ i ] ][ j ] ] ] shall be equal to 1 for all values of j in the range of 0 to NumPredictedLayers[ layer_id_in_nuh[ i ] ] - 1, inclusive." ); 394 } 395 } 396 } 397 398 return wrongConfig; 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 Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile) 684 { 685 // Set default values 686 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 687 688 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 689 defAppLayerIds .clear(); 690 defAppPocs .push_back( 0 ); 691 defAppTids .push_back( 0 ); 692 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 693 694 Int defSeiNaluId = 0; 695 Int defPositionInSeiNalu = 0; 696 Bool defModifyByEncoder = false; 697 698 // Setup config file options 699 po::Options opts; 700 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 701 702 opts.addOptions() 703 ("AlphaChannelCancelFlag" , m_alphaChannelCancelFlag , false , "AlphaChannelCancelFlag" ) 704 ("AlphaChannelUseIdc" , m_alphaChannelUseIdc , 0 , "AlphaChannelUseIdc" ) 705 ("AlphaChannelBitDepthMinus8" , m_alphaChannelBitDepthMinus8 , 0 , "AlphaChannelBitDepthMinus8" ) 706 ("AlphaTransparentValue" , m_alphaTransparentValue , 0 , "AlphaTransparentValue" ) 707 ("AlphaOpaqueValue" , m_alphaOpaqueValue , 255 , "AlphaOpaqueValue" ) 708 ("AlphaChannelIncrFlag" , m_alphaChannelIncrFlag , false , "AlphaChannelIncrFlag" ) 709 ("AlphaChannelClipFlag" , m_alphaChannelClipFlag , false , "AlphaChannelClipFlag" ) 710 ("AlphaChannelClipTypeFlag" , m_alphaChannelClipTypeFlag , false , "AlphaChannelClipTypeFlag" ) 711 ; 712 713 po::setDefaults(opts); 714 715 // Parse the cfg file 716 po::ErrorReporter err; 717 po::parseConfigFile( opts, cfgFile, err ); 718 719 }; 720 721 Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice ) 722 { 723 // Check config values 724 Bool wrongConfig = false; 725 726 int maxInterpretationValue = (1 << (m_alphaChannelBitDepthMinus8+9)) - 1; 727 xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag , 0 , 1, "alpha_channel_cancel_flag" ); 728 xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc , 0 , 7, "alpha_channel_use_idc"); 729 xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8 , 0 , 7, "alpha_channel_bit_depth_minus8" ); 730 xCheckCfgRange( wrongConfig, m_alphaTransparentValue , 0 , maxInterpretationValue, "alpha_transparent_value" ); 731 xCheckCfgRange( wrongConfig, m_alphaOpaqueValue , 0 , maxInterpretationValue, "alpha_opaque_value" ); 732 xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag , 0 , 1, "alpha_channel_incr_flag" ); 733 xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag , 0 , 1, "alpha_channel_clip_flag" ); 734 xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag , 0 , 1, "alpha_channel_clip_type_flag" ); 735 736 return wrongConfig; 737 738 }; 739 740 SEIOverlayInfo::SEIOverlayInfo ( ) 741 : m_numOverlaysMax(16) 742 , m_numOverlayElementsMax(256) 743 , m_numStringBytesMax(256) //incl. null termination byte 744 { }; 745 746 Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile) 747 { 748 // Set default values 749 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 750 751 // Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 752 defAppLayerIds .clear(); 753 defAppPocs .push_back( 0 ); 754 defAppTids .push_back( 0 ); 755 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 756 757 Int defSeiNaluId = 0; 758 Int defPositionInSeiNalu = 0; 759 Bool defModifyByEncoder = false; 760 761 // Setup config file options 762 po::Options opts; 763 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 764 765 opts.addOptions() 766 ("OverlayInfoCancelFlag" , m_overlayInfoCancelFlag , false , "OverlayInfoCancelFlag" ) 767 ("OverlayContentAuxIdMinus128" , m_overlayContentAuxIdMinus128 , 0 , "OverlayContentAuxIdMinus128" ) 768 ("OverlayLabelAuxIdMinus128" , m_overlayLabelAuxIdMinus128 , 0 , "OverlayLabelAuxIdMinus128" ) 769 ("OverlayAlphaAuxIdMinus128" , m_overlayAlphaAuxIdMinus128 , 0 , "OverlayAlphaAuxIdMinus128" ) 770 ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0 , "OverlayElementLabelValueLengthMinus8") 771 ("NumOverlaysMinus1" , m_numOverlaysMinus1 , 0 , "NumOverlaysMinus1" ) 772 ("OverlayIdx" , m_overlayIdx , IntAry1d (16,0) , "OverlayIdx" ) 773 ("LanguageOverlayPresentFlag" , m_languageOverlayPresentFlag , BoolAry1d(16,0) , "LanguageOverlayPresentFlag" ) 774 ("OverlayContentLayerId" , m_overlayContentLayerId , IntAry1d (16,0) , "OverlayContentLayerId" ) 775 ("OverlayLabelPresentFlag" , m_overlayLabelPresentFlag , BoolAry1d(16,0) , "OverlayLabelPresentFlag" ) 776 ("OverlayLabelLayerId" , m_overlayLabelLayerId , IntAry1d (16,0) , "OverlayLabelLayerId" ) 777 ("OverlayAlphaPresentFlag" , m_overlayAlphaPresentFlag , BoolAry1d(16,0) , "OverlayAlphaPresentFlag" ) 778 ("OverlayAlphaLayerId" , m_overlayAlphaLayerId , IntAry1d (16,0) , "OverlayAlphaLayerId" ) 779 ("NumOverlayElementsMinus1" , m_numOverlayElementsMinus1 , IntAry1d (16,0) , "NumOverlayElementsMinus1" ) 780 ("OverlayElementLabelMin_%d" , m_overlayElementLabelMin , IntAry1d (256,0) ,16 , "OverlayElementLabelMin" ) 781 ("OverlayElementLabelMax_%d" , m_overlayElementLabelMax , IntAry1d (256,0) ,16 , "OverlayElementLabelMax" ) 782 ("OverlayLanguage_%d" , m_overlayLanguage , std::string(""), 16 , "OverlayLanguage" ) 783 ("OverlayName_%d" , m_overlayName , std::string(""), 16 , "OverlayName" ) 784 ("OverlayElementName_%d_%d" , m_overlayElementName , std::string(""), 256 ,16 , "OverlayElementName" ) 785 ("OverlayInfoPersistenceFlag" , m_overlayInfoPersistenceFlag , false , "OverlayInfoPersistenceFlag" ) 786 ; 787 788 po::setDefaults(opts); 789 790 // Parse the cfg file 791 po::ErrorReporter err; 792 po::parseConfigFile( opts, cfgFile, err ); 793 }; 794 795 796 Bool SEIOverlayInfo::checkCfg( const TComSlice* slice ) 797 { 798 // Check config values 799 Bool wrongConfig = false; 800 801 xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag , 0 , 1, "overlay_info_cancel_flag" ); 802 xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128 , 0 , 31, "overlay_content_aux_id_minus128" ); 803 xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128 , 0 , 31, "overlay_label_aux_id_minus128" ); 804 xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128 , 0 , 31, "overlay_alpha_aux_id_minus128" ); 805 xCheckCfgRange( wrongConfig, m_numOverlaysMinus1 , 0 , m_numOverlaysMax-1, "num_overlays_minus1" ); 806 for (Int i=0 ; i<=m_numOverlaysMinus1 ; ++i) 807 { 808 xCheckCfgRange( wrongConfig, m_overlayIdx[i] , 0 , 255, "overlay_idx" ); 809 xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i] , 0 , 1, "language_overlay_present_flag" ); 810 xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i] , 0 , 1, "overlay_label_present_flag" ); 811 xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i] , 0 , 1, "overlay_alpha_present_flag" ); 812 xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i] , 0 , 63, "overlay_content_layer_id" ); 813 xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i] , 0 , 63, "overlay_label_layer_id" ); 814 xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i] , 0 , 63, "overlay_alpha_layer_id" ); 815 xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i] , 0 , m_numOverlayElementsMax-1, "num_overlay_elements_minus1" ); 816 for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; ++j) 817 { 818 Int maxLabelMinMaxValue = ( 1 << ( m_overlayElementLabelValueLengthMinus8 + 8 ) )-1; 819 xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_min" ); 820 xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_max" ); 821 } 822 } 823 xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag , 0 , 1, "overlay_info_persistence_flag" ); 824 825 return wrongConfig; 826 827 }; 828 829 830 Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile) 831 { 832 // Set default values 833 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 834 835 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 836 defAppLayerIds .clear ( ); 837 defAppPocs .push_back( 0 ); 838 defAppTids .push_back( 0 ); 839 defAppVclNaluTypes.clear ( ); 840 841 Int defSeiNaluId = 0; 842 Int defPositionInSeiNalu = 0; 843 Bool defModifyByEncoder = false; 844 845 // Setup config file options 846 po::Options opts; 847 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 848 849 opts.addOptions() 850 ("PrevPicsNotUsedFlag" , m_prevPicsNotUsedFlag , false, "PrevPicsNotUsedFlag" ) 851 ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" ) 852 ; 853 854 po::setDefaults(opts); 855 856 // Parse the cfg file 857 po::ErrorReporter err; 858 po::parseConfigFile( opts, cfgFile, err ); 859 }; 860 861 Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice ) 862 { 863 // Check config values 864 Bool wrongConfig = false; 865 866 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." ); 867 868 return wrongConfig; 869 }; 870 871 #if NH_MV_SEI_TBD 872 Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile) 873 { 874 // Set default values 875 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 876 877 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 878 defAppLayerIds .push_back( TBD ); 879 defAppPocs .push_back( TBD ); 880 defAppTids .push_back( TBD ); 881 defAppVclNaluTypes.push_back( TBD ); 882 883 Int defSeiNaluId = 0; 884 Int defPositionInSeiNalu = 0; 885 Bool defModifyByEncoder = false; 886 887 // Setup config file options 888 po::Options opts; 889 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 890 891 opts.addOptions() 892 ("FfinfoPicStruct" , m_ffinfoPicStruct , 0 , "FfinfoPicStruct" ) 893 ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0 , "FfinfoSourceScanType") 894 ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" ) 895 ; 896 897 po::setDefaults(opts); 898 899 // Parse the cfg file 900 po::ErrorReporter err; 901 po::parseConfigFile( opts, cfgFile, err ); 902 }; 903 904 905 Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice ) 906 { 907 // Check config values 908 Bool wrongConfig = false; 909 910 // TBD: Add constraints on presence of SEI here. 911 xCheckCfg ( wrongConfig, TBD , "TBD" ); 912 xCheckCfg ( wrongConfig, TBD , "TBD" ); 913 914 // TBD: Modify constraints according to the SEI semantics. 915 xCheckCfgRange( wrongConfig, m_ffinfoPicStruct , MINVAL , MAXVAL, "ffinfo_pic_struct" ); 916 xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType , MINVAL , MAXVAL, "ffinfo_source_scan_type" ); 917 xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag , MINVAL , MAXVAL, "ffinfo_duplicate_flag" ); 918 919 return wrongConfig; 920 921 }; 922 #endif 923 924 Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile) 925 { 926 // Set default values 927 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 928 929 // Default values for which layers, POCS, Tids or Nalu types the SEI should be sent. 930 defAppLayerIds .push_back( 0 ); 931 defAppPocs .push_back( 0 ); 932 defAppTids .push_back( 0 ); 933 defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES; 934 935 Int defSeiNaluId = 0; 936 Int defPositionInSeiNalu = 0; 937 Bool defModifyByEncoder = 0; 938 939 // Setup config file options 940 po::Options opts; 941 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 942 943 opts.addOptions() 944 ("PrecRefDisplayWidth" , m_precRefDisplayWidth , 0 , "PrecRefDisplayWidth" ) 945 ("RefViewingDistanceFlag" , m_refViewingDistanceFlag , false , "RefViewingDistanceFlag" ) 946 ("PrecRefViewingDist" , m_precRefViewingDist , 0 , "PrecRefViewingDist" ) 947 ("NumRefDisplaysMinus1" , m_numRefDisplaysMinus1 , 0 , "NumRefDisplaysMinus1" ) 948 ("LeftViewId" , m_leftViewId , IntAry1d (1,0) , "LeftViewId" ) 949 ("RightViewId" , m_rightViewId , IntAry1d (1,0) , "RightViewId" ) 950 ("ExponentRefDisplayWidth" , m_exponentRefDisplayWidth , IntAry1d (1,0) , "ExponentRefDisplayWidth" ) 951 ("MantissaRefDisplayWidth" , m_mantissaRefDisplayWidth , IntAry1d (1,0) , "MantissaRefDisplayWidth" ) 952 ("ExponentRefViewingDistance" , m_exponentRefViewingDistance , IntAry1d (1,0) , "ExponentRefViewingDistance" ) 953 ("MantissaRefViewingDistance" , m_mantissaRefViewingDistance , IntAry1d (1,0) , "MantissaRefViewingDistance" ) 954 ("AdditionalShiftPresentFlag" , m_additionalShiftPresentFlag , BoolAry1d(1,0) , "AdditionalShiftPresentFlag" ) 955 ("NumSampleShiftPlus512" , m_numSampleShiftPlus512 , IntAry1d (1,0) , "NumSampleShiftPlus512" ) 956 ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false , "ThreeDimensionalReferenceDisplaysExtensionFlag") 957 ; 958 959 po::setDefaults(opts); 960 961 // Parse the cfg file 962 po::ErrorReporter err; 963 po::parseConfigFile( opts, cfgFile, err ); 964 }; 965 966 967 UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceDisplayWidthLen( Int i ) const 968 { 969 return xGetSyntaxElementLen( m_exponentRefDisplayWidth[i], m_precRefDisplayWidth, m_mantissaRefDisplayWidth[ i ] ); 970 } 971 972 UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceViewingDistanceLen( Int i ) const 973 { 974 return xGetSyntaxElementLen( m_exponentRefViewingDistance[i], m_precRefViewingDist, m_mantissaRefViewingDistance[ i ] ); 975 } 976 977 UInt SEIThreeDimensionalReferenceDisplaysInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const 978 { 979 UInt len; 980 if( expo == 0 ) 981 { 982 len = std::max(0, prec - 30 ); 983 } 984 else 985 { 986 len = std::max( 0, expo + prec - 31 ); 987 } 988 989 assert( val >= 0 ); 990 assert( val <= ( ( 1 << len )- 1) ); 991 return len; 992 } 993 994 Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice ) 995 { 996 // Check config values 997 Bool wrongConfig = false; 998 999 // The 3D reference display SEI should preferably be sent along with the multiview acquisition SEI. For now the multiview acquisition SEI is restricted to POC = 0, so 3D reference displays SEI is restricted to POC = 0 as well. 1000 xCheckCfg ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0) , "The 3D reference displays SEI message currently is associated with an access unit that contains an IRAP picture." ); 1001 1002 xCheckCfgRange( wrongConfig, m_precRefDisplayWidth , 0 , 31, "prec_ref_display_width" ); 1003 xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag , 0 , 1, "ref_viewing_distance_flag"); 1004 xCheckCfgRange( wrongConfig, m_precRefViewingDist , 0 , 31, "prec_ref_viewing_dist" ); 1005 xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1 , 0 , 31, "num_ref_displays_minus1" ); 1006 1007 for (Int i = 0; i <= getNumRefDisplaysMinus1(); i++ ) 1008 { 1009 xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i] , 0 , 62, "exponent_ref_display_width" ); 1010 xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i] , 0 , 62, "exponent_ref_viewing_distance"); 1011 xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i] , 0 , 1, "additional_shift_present_flag" ); 1012 xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i] , 0 , 1023, "num_sample_shift_plus512" ); 1013 } 1014 xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, 0 , 1, "three_dimensional_reference_displays_extension_flag"); 1015 1016 return wrongConfig; 1017 1018 }; 1019 1020 #if SEI_DRI_F0169 1021 Void SEIDepthRepresentationInfo::setupFromSlice ( const TComSlice* slice ) 1022 { 1023 1024 m_currLayerID=slice->getLayerIdInVps(); 1025 }; 1026 1027 Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile) 1028 { 1029 // Set default values 1030 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1031 1032 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1033 //defAppLayerIds .push_back( TBD ); 1034 defAppPocs .push_back( 0 ); 1035 //defAppTids .push_back( TBD ); 1036 //defAppVclNaluTypes.push_back( TBD ); 1037 1038 Int defSeiNaluId = 0; 1039 Int defPositionInSeiNalu = 0; 1040 Bool defModifyByEncoder = true; 1041 1042 // Setup config file options 1043 po::Options opts; 1044 1045 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1046 1047 opts.addOptions() 1048 ("ZNear_%d" , m_zNear , std::vector<double>(0,0) , MAX_NUM_LAYERS , "ZNear" ) 1049 ("ZFar_%d" , m_zFar , std::vector<double>(0,0) , MAX_NUM_LAYERS , "ZFar" ) 1050 ("DMin_%d" , m_dMin , std::vector<double>(0,0) , MAX_NUM_LAYERS , "DMin" ) 1051 ("DMax_%d" , m_dMax , std::vector<double>(0,0) , MAX_NUM_LAYERS , "DMax" ) 1052 ("DepthRepresentationInfoSeiPresentFlag_%d", m_depthRepresentationInfoSeiPresentFlag, BoolAry1d(1,0), MAX_NUM_LAYERS, "DepthRepresentationInfoSeiPresentFlag") 1053 ("DepthRepresentationType_%d" , m_depthRepresentationType , IntAry1d(0,0), MAX_NUM_LAYERS, "DepthRepresentationType" ) 1054 ("DisparityRefViewId_%d" , m_disparityRefViewId , IntAry1d(0,0), MAX_NUM_LAYERS, "DisparityRefViewId" ) 1055 ("DepthNonlinearRepresentationNumMinus1_%d", m_depthNonlinearRepresentationNumMinus1, IntAry1d(0,0), MAX_NUM_LAYERS, "DepthNonlinearRepresentationNumMinus1") 1056 ("DepthNonlinearRepresentationModel_%d" , m_depth_nonlinear_representation_model , IntAry1d(0,0), MAX_NUM_LAYERS, "DepthNonlinearRepresentationModel") ; 1057 1058 1059 po::setDefaults(opts); 1060 1061 // Parse the cfg file 1062 po::ErrorReporter err; 1063 po::parseConfigFile( opts, cfgFile, err ); 1064 1065 1066 for(int i=0;i<MAX_NUM_LAYERS;i++) 1067 { 1068 if (m_zNear[i].size()>0) 1069 { 1070 m_zNearFlag.push_back(true); 1071 } 1072 else 1073 { 1074 m_zNearFlag.push_back(false); 1075 } 1076 1077 if (m_zFar[i].size()>0) 1078 { 1079 m_zFarFlag.push_back(true); 1080 } 1081 else 1082 { 1083 m_zFarFlag.push_back(false); 1084 } 1085 1086 if (m_dMin[i].size()>0) 1087 { 1088 m_dMinFlag.push_back(true); 1089 } 1090 else 1091 { 1092 m_dMinFlag.push_back(false); 1093 } 1094 1095 if (m_dMax[i].size()>0) 1096 { 1097 m_dMaxFlag.push_back(true); 1098 } 1099 else 1100 { 1101 m_dMaxFlag.push_back(false); 1102 } 1103 1104 1105 if (m_depthRepresentationInfoSeiPresentFlag[i][0]) 1106 { 1107 if ( m_depthRepresentationType[i].size()<=0 ) 1108 { 1109 printf("DepthRepresentationType_%d must be present for layer %d\n",i,i ); 1110 return; 1111 } 1112 1113 if ( m_depthRepresentationType[i][0]<0 ) 1114 { 1115 printf("DepthRepresentationType_%d must be equal to or greater than 0\n",i ); 1116 return; 1117 } 1118 1119 if (m_dMinFlag[i] || m_dMaxFlag[i]) 1120 { 1121 if (m_disparityRefViewId[i].size()<=0) 1122 { 1123 printf("DisparityRefViewId_%d must be present for layer %d\n",i,i ); 1124 assert(false); 1125 return; 1126 } 1127 if (m_disparityRefViewId[i][0]<0) 1128 { 1129 printf("DisparityRefViewId_%d must be equal to or greater than 0\n",i ); 1130 assert(false); 1131 return; 1132 } 1133 } 1134 1135 if (m_depthRepresentationType[i][0]==3) 1136 { 1137 if (m_depthNonlinearRepresentationNumMinus1[i].size()<=0) 1138 { 1139 printf("DepthNonlinearRepresentationNumMinus1_%d must be present for layer %d\n",i,i ); 1140 assert(false); 1141 return; 1142 } 1143 if (m_depthNonlinearRepresentationNumMinus1[i][0]<0) 1144 { 1145 printf("DepthNonlinearRepresentationNumMinus1_%d must be equal to or greater than 0\n",i ); 1146 assert(false); 1147 return; 1148 } 1149 1150 if (m_depth_nonlinear_representation_model[i].size() != m_depthNonlinearRepresentationNumMinus1[i][0]+1) 1151 { 1152 printf("the number of values in Depth_nonlinear_representation_model must be equal to DepthNonlinearRepresentationNumMinus1+1 in layer %d\n",i ); 1153 assert(false); 1154 return; 1155 } 1156 } 1157 } 1158 } 1159 1160 assert(m_zNearFlag.size()==MAX_NUM_LAYERS); 1161 assert(m_zFarFlag.size()==MAX_NUM_LAYERS); 1162 assert(m_dMinFlag.size()==MAX_NUM_LAYERS); 1163 assert(m_dMaxFlag.size()==MAX_NUM_LAYERS); 1164 } 1165 1166 Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice ) 1167 { 1168 // Check config values 1169 Bool wrongConfig = false; 1170 assert(m_currLayerID>=0); 1171 1172 if (m_depthRepresentationInfoSeiPresentFlag[m_currLayerID][0]==false) 1173 { 1174 printf("DepthRepresentationInfoSeiPresentFlag_%d should be equal to 1 when ApplicableLayerIds is empty or ApplicableLayerIds contains %d\n",m_currLayerID,slice->getLayerId()); 1175 assert(false); 1176 } 1177 // TBD: Add constraints on presence of SEI here. 1178 xCheckCfg ( wrongConfig, m_depthRepresentationType[m_currLayerID][0] >=0 , "depth_representation_type must be equal to or greater than 0" ); 1179 if ( m_dMaxFlag[m_currLayerID] || m_dMinFlag[m_currLayerID]) 1180 { 1181 xCheckCfg( wrongConfig , m_disparityRefViewId[m_currLayerID][0]>=0, "disparity_ref_view_id must be equal to or greater than 0 when d_min or d_max are present"); 1182 } 1183 1184 if (m_depthRepresentationType[m_currLayerID][0]==3) 1185 { 1186 xCheckCfg(wrongConfig , m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]>=0, "depth_nonlinear_representation_num_minus1 must be greater than or equal to 0"); 1187 1188 if (m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]>=0) 1189 { 1190 xCheckCfg( wrongConfig , m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]+1 == m_depth_nonlinear_representation_model[m_currLayerID].size() ,"the number of values in depth_nonlinear_representation_model must be equal to depth_nonlinear_representation_num_minus1+1"); 1191 } 1192 1193 } 1194 1195 return wrongConfig; 1196 } 1197 #endif 1198 1199 Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile) 1200 { 1201 // Set default values 1202 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1203 1204 // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 1205 defAppLayerIds .clear(); 1206 defAppPocs .clear(); 1207 defAppTids .push_back( 0 ); 1208 defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES; 1209 1210 Int defSeiNaluId = 0; 1211 Int defPositionInSeiNalu = 0; 1212 Bool defModifyByEncoder = false; 1213 1214 // Setup config file options 1215 po::Options opts; 1216 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1217 1218 opts.addOptions() 1219 ("MinDisparity" , m_minDisparity , 0 , "MinDisparity" ) 1220 ("MaxDisparityRange" , m_maxDisparityRange , 0 , "MaxDisparityRange" ) 1221 ; 1222 1223 po::setDefaults(opts); 1224 1225 // Parse the cfg file 1226 po::ErrorReporter err; 1227 po::parseConfigFile( opts, cfgFile, err ); 1228 }; 1229 1230 1231 Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice ) 1232 { 1233 // Check config values 1234 Bool wrongConfig = false; 1235 1236 xCheckCfg ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." ); 1237 1238 xCheckCfgRange( wrongConfig, m_minDisparity , -1024 , 1023, "min_disparity" ); 1239 xCheckCfgRange( wrongConfig, m_maxDisparityRange , 0 , 2047, "max_disparity_range" ); 1240 1241 return wrongConfig; 1242 1243 }; 1244 1245 Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile) 1246 { 1247 // Set default values 1248 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1249 1250 defAppLayerIds .clear(); 1251 defAppPocs .push_back( 0 ); 1252 defAppTids .push_back( 0 ); 1253 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 1254 1255 1256 Int defSeiNaluId = 0; 1257 Int defPositionInSeiNalu = 0; 1258 Bool defModifyByEncoder = false; 1259 1260 // Setup config file options 1261 po::Options opts; 1262 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1263 1264 opts.addOptions() 1265 ("IntrinsicParamFlag" , m_intrinsicParamFlag , false , "IntrinsicParamFlag" ) 1266 ("ExtrinsicParamFlag" , m_extrinsicParamFlag , false , "ExtrinsicParamFlag" ) 1267 ("IntrinsicParamsEqualFlag" , m_intrinsicParamsEqualFlag , false , "IntrinsicParamsEqualFlag" ) 1268 ("PrecFocalLength" , m_precFocalLength , 0 , "PrecFocalLength" ) 1269 ("PrecPrincipalPoint" , m_precPrincipalPoint , 0 , "PrecPrincipalPoint" ) 1270 ("PrecSkewFactor" , m_precSkewFactor , 0 , "PrecSkewFactor" ) 1271 ("SignFocalLengthX" , m_signFocalLengthX , BoolAry1d(1,0) , "SignFocalLengthX" ) 1272 ("ExponentFocalLengthX" , m_exponentFocalLengthX , IntAry1d (1,0) , "ExponentFocalLengthX" ) 1273 ("MantissaFocalLengthX" , m_mantissaFocalLengthX , IntAry1d (1,0) , "MantissaFocalLengthX" ) 1274 ("SignFocalLengthY" , m_signFocalLengthY , BoolAry1d(1,0) , "SignFocalLengthY" ) 1275 ("ExponentFocalLengthY" , m_exponentFocalLengthY , IntAry1d (1,0) , "ExponentFocalLengthY" ) 1276 ("MantissaFocalLengthY" , m_mantissaFocalLengthY , IntAry1d (1,0) , "MantissaFocalLengthY" ) 1277 ("SignPrincipalPointX" , m_signPrincipalPointX , BoolAry1d(1,0) , "SignPrincipalPointX" ) 1278 ("ExponentPrincipalPointX" , m_exponentPrincipalPointX , IntAry1d (1,0) , "ExponentPrincipalPointX" ) 1279 ("MantissaPrincipalPointX" , m_mantissaPrincipalPointX , IntAry1d (1,0) , "MantissaPrincipalPointX" ) 1280 ("SignPrincipalPointY" , m_signPrincipalPointY , BoolAry1d(1,0) , "SignPrincipalPointY" ) 1281 ("ExponentPrincipalPointY" , m_exponentPrincipalPointY , IntAry1d (1,0) , "ExponentPrincipalPointY" ) 1282 ("MantissaPrincipalPointY" , m_mantissaPrincipalPointY , IntAry1d (1,0) , "MantissaPrincipalPointY" ) 1283 ("SignSkewFactor" , m_signSkewFactor , BoolAry1d(1,0) , "SignSkewFactor" ) 1284 ("ExponentSkewFactor" , m_exponentSkewFactor , IntAry1d (1,0) , "ExponentSkewFactor" ) 1285 ("MantissaSkewFactor" , m_mantissaSkewFactor , IntAry1d (1,0) , "MantissaSkewFactor" ) 1286 ("PrecRotationParam" , m_precRotationParam , 0 , "PrecRotationParam" ) 1287 ("PrecTranslationParam" , m_precTranslationParam , 0 , "PrecTranslationParam" ) 1288 ("SignR_%d_%d" , m_signR , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3 , "SignR" ) 1289 ("ExponentR_%d_%d" , m_exponentR , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3 , "ExponentR" ) 1290 ("MantissaR_%d_%d" , m_mantissaR , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3 , "MantissaR" ) 1291 ("SignT_%d" , m_signT , BoolAry1d(3,0) ,MAX_NUM_LAYERS , "SignT" ) 1292 ("ExponentT_%d" , m_exponentT , IntAry1d (3,0) ,MAX_NUM_LAYERS , "ExponentT" ) 1293 ("MantissaT_%d" , m_mantissaT , IntAry1d (3,0) ,MAX_NUM_LAYERS , "MantissaT" ) 1294 ; 1295 1296 po::setDefaults(opts); 1297 1298 // Parse the cfg file 1299 po::ErrorReporter err; 1300 po::parseConfigFile( opts, cfgFile, err ); 1301 }; 1302 1303 UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const 1304 { 1305 return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] ); 1306 } 1307 1308 Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice ) 1309 { 1310 // Check config values 1311 Bool wrongConfig = false; 1312 1313 // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes. 1314 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." ); 1315 1316 xCheckCfgRange( wrongConfig, m_precFocalLength , 0, 31, "prec_focal_length" ); 1317 xCheckCfgRange( wrongConfig, m_precPrincipalPoint , 0, 31, "prec_principle_point" ); 1318 xCheckCfgRange( wrongConfig, m_precSkewFactor , 0, 31, "prec_skew_factor" ); 1319 1320 for (Int i = 0; i <= getNumViewsMinus1(); i++ ) 1321 { 1322 xCheckCfgRange( wrongConfig, m_exponentFocalLengthX [ i ], 0, 62, "exponent_focal_length_x" ); 1323 xCheckCfgRange( wrongConfig, m_exponentFocalLengthY [ i ], 0, 62, "exponent_focal_length_y" ); 1324 xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x"); 1325 xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y"); 1326 xCheckCfgRange( wrongConfig, m_exponentSkewFactor [ i ], 0, 62, "exponent_skew_factor" ); 1327 } 1328 1329 xCheckCfgRange( wrongConfig, m_precRotationParam , 0, 31, "prec_focal_length" ); 1330 xCheckCfgRange( wrongConfig, m_precTranslationParam , 0, 31, "prec_focal_length" ); 1331 1332 for (Int i = 0; i <= getNumViewsMinus1(); i++ ) 1333 { 1334 for (Int j = 0; j <= 2; j++) 1335 { 1336 xCheckCfgRange( wrongConfig, m_exponentT[i][j] , 0, 62, "exponent_skew_factor" ); 1337 for (Int k = 0; k <= 2; k++ ) 1338 { 1339 xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y"); 1340 } 1341 } 1342 } 1343 1344 return wrongConfig; 1345 1346 }; 1347 1348 UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const 1349 { 1350 return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ] ); 1351 } 1352 1353 1354 UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const 1355 { 1356 return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ] ); 1357 } 1358 1359 UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const 1360 { 1361 return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] ); 1362 } 1363 1364 UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const 1365 { 1366 return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] ); 1367 } 1368 1369 UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const 1370 { 1371 return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] ); 1372 } 1373 1374 UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const 1375 { 1376 return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] ); 1377 } 1378 UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const 1379 { 1380 UInt len; 1381 if( expo == 0 ) 1382 { 1383 len = std::max(0, prec - 30 ); 1384 } 1385 else 1386 { 1387 len = std::max( 0, expo + prec - 31 ); 1388 } 1389 1390 assert( val >= 0 ); 1391 assert( val <= ( ( 1 << len )- 1) ); 1392 return len; 1393 } 1394 1395 Void SEIMultiviewViewPosition::setupFromSlice ( const TComSlice* slice ) 1396 { 1397 const TComVPS* vps = slice->getVPS(); 1398 m_numViewsMinus1 = vps->getNumViews() - 1; 1399 m_viewPosition.resize( m_numViewsMinus1 + 1 ); 1400 for (Int i = 0; i <= m_numViewsMinus1; i++ ) 1401 { 1402 // Assuming that view ids indicate the position 1403 m_viewPosition[i] = vps->getViewIdVal( i ); 1404 } 1405 } 1406 1407 Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile) 1408 { 1409 // Set default values 1410 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1411 1412 defAppLayerIds .push_back( 0 ); 1413 defAppPocs .push_back( 0 ); 1414 defAppTids .push_back( 0 ); 1415 defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 1416 1417 Int defSeiNaluId = 0; 1418 Int defPositionInSeiNalu = 0; 1419 Bool defModifyByEncoder = true; 1420 1421 // Setup config file options 1422 po::Options opts; 1423 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1424 1425 opts.addOptions() 1426 ("NumViewsMinus1" , m_numViewsMinus1 , 0 , "NumViewsMinus1") 1427 ("ViewPosition" , m_viewPosition , IntAry1d (1,0) , "ViewPosition" ); 1428 ; 1429 1430 po::setDefaults(opts); 1431 1432 // Parse the cfg file 1433 po::ErrorReporter err; 1434 po::parseConfigFile( opts, cfgFile, err ); 1435 }; 1436 1437 Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice ) 1438 { 1439 // Check config values 1440 Bool wrongConfig = false; 1441 1442 // TBD: Add constraints on presence of SEI here. 1443 xCheckCfg ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit." ); 1444 1445 // TBD: Modify constraints according to the SEI semantics. 1446 xCheckCfgRange( wrongConfig, m_numViewsMinus1 , 0 , 62, "num_views_minus1"); 1447 for(Int i = 0; i <= m_numViewsMinus1; i++) 1448 { 1449 xCheckCfgRange( wrongConfig, m_viewPosition[i] , 0 , 62, "view_position"); 1450 } 1451 1452 return wrongConfig; 1453 1454 }; 1455 1456 1457 #if NH_3D 1458 Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile) 1459 { 1460 // Set default values 1461 IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 1462 1463 defAppLayerIds .clear(); 1464 defAppPocs .clear(); 1465 defAppTids .clear(); 1466 defAppVclNaluTypes.clear(); 1467 1468 Int defSeiNaluId = 0; 1469 Int defPositionInSeiNalu = 0; 1470 Bool defModifyByEncoder = false; 1471 1472 // Setup config file options 1473 po::Options opts; 1474 xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 1475 1476 opts.addOptions() 1477 ("AlternativeDepthInfoCancelFlag" , m_alternativeDepthInfoCancelFlag , false , "AlternativeDepthInfoCancelFlag" ) 1478 ("DepthType" , m_depthType , 1 , "DepthType" ) 1479 ("NumConstituentViewsGvdMinus1" , m_numConstituentViewsGvdMinus1 , 1 , "NumConstituentViewsGvdMinus1" ) 1480 ("DepthPresentGvdFlag" , m_depthPresentGvdFlag , false , "DepthPresentGvdFlag" ) 1481 ("ZGvdFlag" , m_zGvdFlag , false , "ZGvdFlag" ) 1482 ("IntrinsicParamGvdFlag" , m_intrinsicParamGvdFlag , false , "IntrinsicParamGvdFlag" ) 1483 ("RotationGvdFlag" , m_rotationGvdFlag , false , "RotationGvdFlag" ) 1484 ("TranslationGvdFlag" , m_translationGvdFlag , false , "TranslationGvdFlag" ) 1485 ("SignGvdZNearFlag_%d" , m_signGvdZNearFlag , BoolAry1d(3,0), 3 , "SignGvdZNearFlag" ) 1486 ("ExpGvdZNear_%d" , m_expGvdZNear , IntAry1d (3,0), 3 , "ExpGvdZNear" ) 1487 ("ManLenGvdZNearMinus1_%d" , m_manLenGvdZNearMinus1 , IntAry1d (3,0), 3 , "ManLenGvdZNearMinus1" ) 1488 ("ManGvdZNear_%d" , m_manGvdZNear , IntAry1d (3,0), 3 , "ManGvdZNear" ) 1489 ("SignGvdZFarFlag_%d" , m_signGvdZFarFlag , BoolAry1d(3,0), 3 , "SignGvdZFarFlag" ) 1490 ("ExpGvdZFar_%d" , m_expGvdZFar , IntAry1d (3,0), 3 , "ExpGvdZFar" ) 1491 ("ManLenGvdZFarMinus1_%d" , m_manLenGvdZFarMinus1 , IntAry1d (3,0), 3 , "ManLenGvdZFarMinus1" ) 1492 ("ManGvdZFar_%d" , m_manGvdZFar , IntAry1d (3,0), 3 , "ManGvdZFar" ) 1493 ("PrecGvdFocalLength" , m_precGvdFocalLength , 18 , "PrecGvdFocalLength" ) 1494 ("PrecGvdPrincipalPoint" , m_precGvdPrincipalPoint , 18 , "PrecGvdPrincipalPoint" ) 1495 ("PrecGvdRotationParam" , m_precGvdRotationParam , 18 , "PrecGvdRotationParam" ) 1496 ("PrecGvdTranslationParam" , m_precGvdTranslationParam , 18 , "PrecGvdTranslationParam" ) 1497 ("SignGvdFocalLengthX_%d" , m_signGvdFocalLengthX , BoolAry1d(3,0), 3 ,"SignGvdFocalLengthX" ) 1498 ("ExpGvdFocalLengthX_%d" , m_expGvdFocalLengthX , IntAry1d (3,0), 3 ,"ExpGvdFocalLengthX" ) 1499 ("ManGvdFocalLengthX_%d" , m_manGvdFocalLengthX , IntAry1d (3,0), 3 ,"ManGvdFocalLengthX" ) 1500 ("SignGvdFocalLengthY_%d" , m_signGvdFocalLengthY , BoolAry1d(3,0), 3 ,"SignGvdFocalLengthY" ) 1501 ("ExpGvdFocalLengthY_%d" , m_expGvdFocalLengthY , IntAry1d (3,0), 3 ,"ExpGvdFocalLengthY" ) 1502 ("ManGvdFocalLengthY_%d" , m_manGvdFocalLengthY , IntAry1d (3,0), 3 ,"ManGvdFocalLengthY" ) 1503 ("SignGvdPrincipalPointX_%d" , m_signGvdPrincipalPointX , BoolAry1d(3,0), 3 ,"SignGvdPrincipalPointX" ) 1504 ("ExpGvdPrincipalPointX_%d" , m_expGvdPrincipalPointX , IntAry1d (3,0), 3 ,"ExpGvdPrincipalPointX" ) 1505 ("ManGvdPrincipalPointX_%d" , m_manGvdPrincipalPointX , IntAry1d (3,0), 3 ,"ManGvdPrincipalPointX" ) 1506 ("SignGvdPrincipalPointY_%d" , m_signGvdPrincipalPointY , BoolAry1d(3,0), 3 ,"SignGvdPrincipalPointY" ) 1507 ("ExpGvdPrincipalPointY_%d" , m_expGvdPrincipalPointY , IntAry1d (3,0), 3 ,"ExpGvdPrincipalPointY" ) 1508 ("ManGvdPrincipalPointY_%d" , m_manGvdPrincipalPointY , IntAry1d (3,0), 3 ,"ManGvdPrincipalPointY" ) 1509 ("SignGvdR00_%d" , m_signGvdR00 , BoolAry1d(3,0), 3 ,"SignGvdR00" ) 1510 ("ExpGvdR00_%d" , m_expGvdR00 , IntAry1d (3,0), 3 ,"ExpGvdR00" ) 1511 ("ManGvdR00_%d" , m_manGvdR00 , IntAry1d (3,0), 3 ,"ManGvdR00" ) 1512 ("SignGvdR01_%d" , m_signGvdR01 , BoolAry1d(3,0), 3 ,"SignGvdR01" ) 1513 ("ExpGvdR01_%d" , m_expGvdR01 , IntAry1d (3,0), 3 ,"ExpGvdR01" ) 1514 ("ManGvdR01_%d" , m_manGvdR01 , IntAry1d (3,0), 3 ,"ManGvdR01" ) 1515 ("SignGvdR02_%d" , m_signGvdR02 , BoolAry1d(3,0), 3 ,"SignGvdR02" ) 1516 ("ExpGvdR02_%d" , m_expGvdR02 , IntAry1d (3,0), 3 ,"ExpGvdR02" ) 1517 ("ManGvdR02_%d" , m_manGvdR02 , IntAry1d (3,0), 3 ,"ManGvdR02" ) 1518 ("SignGvdR10_%d" , m_signGvdR10 , BoolAry1d(3,0), 3 ,"SignGvdR10" ) 1519 ("ExpGvdR10_%d" , m_expGvdR10 , IntAry1d (3,0), 3 ,"ExpGvdR10" ) 1520 ("ManGvdR10_%d" , m_manGvdR10 , IntAry1d (3,0), 3 ,"ManGvdR10" ) 1521 ("SignGvdR11_%d" , m_signGvdR11 , BoolAry1d(3,0), 3 ,"SignGvdR11" ) 1522 ("ExpGvdR11_%d" , m_expGvdR11 , IntAry1d (3,0), 3 ,"ExpGvdR11" ) 1523 ("ManGvdR11_%d" , m_manGvdR11 , IntAry1d (3,0), 3 ,"ManGvdR11" ) 1524 ("SignGvdR12_%d" , m_signGvdR12 , BoolAry1d(3,0), 3 ,"SignGvdR12" ) 1525 ("ExpGvdR12_%d" , m_expGvdR12 , IntAry1d (3,0), 3 ,"ExpGvdR12" ) 1526 ("ManGvdR12_%d" , m_manGvdR12 , IntAry1d (3,0), 3 ,"ManGvdR12" ) 1527 ("SignGvdR20_%d" , m_signGvdR20 , BoolAry1d(3,0), 3 ,"SignGvdR20" ) 1528 ("ExpGvdR20_%d" , m_expGvdR20 , IntAry1d (3,0), 3 ,"ExpGvdR20" ) 1529 ("ManGvdR20_%d" , m_manGvdR20 , IntAry1d (3,0), 3 ,"ManGvdR20" ) 1530 ("SignGvdR21_%d" , m_signGvdR21 , BoolAry1d(3,0), 3 ,"SignGvdR21" ) 1531 ("ExpGvdR21_%d" , m_expGvdR21 , IntAry1d (3,0), 3 ,"ExpGvdR21" ) 1532 ("ManGvdR21_%d" , m_manGvdR21 , IntAry1d (3,0), 3 ,"ManGvdR21" ) 1533 ("SignGvdR22_%d" , m_signGvdR22 , BoolAry1d(3,0), 3 ,"SignGvdR22" ) 1534 ("ExpGvdR22_%d" , m_expGvdR22 , IntAry1d (3,0), 3 ,"ExpGvdR22" ) 1535 ("ManGvdR22_%d" , m_manGvdR22 , IntAry1d (3,0), 3 ,"ManGvdR22" ) 1536 ("SignGvdTX_%d" , m_signGvdTX , BoolAry1d(3,0), 3 ,"SignGvdTX" ) 1537 ("ExpGvdTX_%d" , m_expGvdTX , IntAry1d (3,0), 3 ,"ExpGvdTX" ) 1538 ("ManGvdTX_%d" , m_manGvdTX , IntAry1d (3,0), 3 ,"ManGvdTX" ) 1539 ("MinOffsetXInt" , m_minOffsetXInt , 0 , "MinOffsetXInt" ) 1540 ("MinOffsetXFrac" , m_minOffsetXFrac , 0 , "MinOffsetXFrac" ) 1541 ("MaxOffsetXInt" , m_maxOffsetXInt , 0 , "MaxOffsetXInt" ) 1542 ("MaxOffsetXFrac" , m_maxOffsetXFrac , 0 , "MaxOffsetXFrac" ) 1543 ("OffsetYPresentFlag" , m_offsetYPresentFlag , false , "OffsetYPresentFlag" ) 1544 ("MinOffsetYInt" , m_minOffsetYInt , 0 , "MinOffsetYInt" ) 1545 ("MinOffsetYFrac" , m_minOffsetYFrac , 0 , "MinOffsetYFrac" ) 1546 ("MaxOffsetYInt" , m_maxOffsetYInt , 0 , "MaxOffsetYInt" ) 1547 ("MaxOffsetYFrac" , m_maxOffsetYFrac , 0 , "MaxOffsetYFrac" ) 1548 ("WarpMapSizePresentFlag" , m_warpMapSizePresentFlag , false , "WarpMapSizePresentFlag" ) 1549 ("WarpMapWidthMinus2" , m_warpMapWidthMinus2 , 0 , "WarpMapWidthMinus2" ) 1550 ("WarpMapHeightMinus2" , m_warpMapHeightMinus2 , 0 , "WarpMapHeightMinus2" ) 1551 ; 1552 1553 po::setDefaults(opts); 1554 1555 // Parse the cfg file 1556 po::ErrorReporter err; 1557 po::parseConfigFile( opts, cfgFile, err ); 1558 }; 1559 Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice ) 1560 { 1561 // Check config values 1562 Bool wrongConfig = false; 1563 1564 1565 xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , 0 , 1, "alternative_depth_info_cancel_flag"); 1566 xCheckCfgRange( wrongConfig, m_depthType , 0 , 1, "depth_type" ); 1567 1568 xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1 , 1 , 1, "num_constituent_views_gvd_minus1 "); // 1: 3 views only, cuurent. 1569 xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag , 0 , 1, "depth_present_gvd_flag" ); 1570 xCheckCfgRange( wrongConfig, m_zGvdFlag , 0 , 1, "z_gvd_flag" ); 1571 xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag , 0 , 1, "intrinsic_param_gvd_flag" ); 1572 xCheckCfgRange( wrongConfig, m_rotationGvdFlag , 0 , 1, "rotation_gvd_flag" ); 1573 xCheckCfgRange( wrongConfig, m_translationGvdFlag , 0 , 1, "translation_gvd_flag" ); 1574 1575 return wrongConfig; 1576 1577 }; 1578 1579 UInt SEIAlternativeDepthInfo::getManGvdFocalLengthXLen ( Int i, int j ) const 1580 { 1581 UInt rval; 1582 rval = xGetSyntaxElementLen( m_expGvdFocalLengthX[i][j], m_precGvdFocalLength, m_manGvdFocalLengthX[i][j] ); 1583 if (rval == 0) 1584 return m_precGvdFocalLength; 1585 else 1586 return rval; 1587 }; 1588 1589 UInt SEIAlternativeDepthInfo::getManGvdFocalLengthYLen ( Int i, int j ) const 1590 { 1591 UInt rval; 1592 rval = xGetSyntaxElementLen( m_expGvdFocalLengthY[i][j], m_precGvdFocalLength, m_manGvdFocalLengthY[i][j] ); 1593 if (rval == 0) 1594 return m_precGvdFocalLength; 1595 else 1596 return rval; 1597 }; 1598 1599 UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointXLen ( Int i, int j ) const 1600 { 1601 UInt rval; 1602 rval = xGetSyntaxElementLen( m_expGvdPrincipalPointX[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointX[i][j] ); 1603 if (rval == 0) 1604 return m_precGvdPrincipalPoint; 1605 else 1606 return rval; 1607 }; 1608 1609 UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointYLen ( Int i, int j ) const 1610 { 1611 UInt rval; 1612 rval = xGetSyntaxElementLen( m_expGvdPrincipalPointY[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointY[i][j] ); 1613 if (rval == 0) 1614 return m_precGvdPrincipalPoint; 1615 else 1616 return rval; 1617 }; 1618 1619 UInt SEIAlternativeDepthInfo::getManGvdTXLen ( Int i, int j ) const 1620 { 1621 UInt rval; 1622 rval = xGetSyntaxElementLen( m_expGvdTX[i][j], m_precGvdTranslationParam, m_manGvdTX[i][j] ); 1623 if (rval == 0) 1624 return m_precGvdTranslationParam; 1625 else 1626 return rval; 1627 }; 1628 1629 UInt SEIAlternativeDepthInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const 1630 { 1631 UInt len; 1632 if( expo == 0 ) 1633 { 1634 len = std::max(0, prec - 30 ); 1635 } 1636 else 1637 { 1638 len = std::max( 0, expo + prec - 31 ); 1639 } 1640 1641 assert( val >= 0 ); 1642 assert( val <= ( ( 1 << len )- 1) ); 1643 return len; 1644 } 1645 1646 #endif 1647 1648 #endif -
trunk/source/Lib/TLibCommon/SEI.h
r1313 r1356 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 88 117 #endif 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 … … 155 214 Bool m_noParameterSetUpdateFlag; 156 215 Int numSpsIdsMinus1; 157 std::vector<Int> activeSeqParameterSetId; 216 std::vector<Int> activeSeqParameterSetId; 158 217 }; 159 218 … … 468 527 SEIMasteringDisplayColourVolume() {} 469 528 virtual ~SEIMasteringDisplayColourVolume(){} 470 529 471 530 TComSEIMasteringDisplay values; 472 531 }; 473 532 474 533 #if NH_MV 534 #if !NH_MV_SEI 475 535 class SEISubBitstreamProperty : public SEI 476 536 { … … 490 550 }; 491 551 #endif 552 #endif 492 553 493 554 typedef std::list<SEI*> SEIMessages; … … 550 611 551 612 public: 552 Int m_mcts_id; 613 Int m_mcts_id; 553 614 Bool m_display_tile_set_flag; 554 615 Int m_num_tile_rects_in_set; //_minus1; … … 598 659 }; 599 660 661 #if NH_MV_SEI 662 #if NH_MV_LAYERS_NOT_PRESENT_SEI 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 Bool checkCfg ( const TComSlice* slice ); 673 674 Int m_lnpSeiActiveVpsId; 675 UInt m_lnpSeiMaxLayers; 676 BoolAry1d m_layerNotPresentFlag; 677 678 Void resizeDimI( Int sizeDimI ) 679 { 680 m_layerNotPresentFlag.resize( sizeDimI ); 681 } 682 }; 600 683 #endif 601 684 685 class SEIInterLayerConstrainedTileSets : public SEI 686 { 687 public: 688 PayloadType payloadType( ) const { return INTER_LAYER_CONSTRAINED_TILE_SETS; } 689 SEIInterLayerConstrainedTileSets ( ) { }; 690 ~SEIInterLayerConstrainedTileSets( ) { }; 691 SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); }; 692 693 Void setupFromCfgFile( const Char* cfgFile ); 694 Bool checkCfg ( const TComSlice* slice ); 695 696 Bool m_ilAllTilesExactSampleValueMatchFlag; 697 Bool m_ilOneTilePerTileSetFlag; 698 Int m_ilNumSetsInMessageMinus1; 699 Bool m_skippedTileSetPresentFlag; 700 IntAry1d m_ilctsId; 701 IntAry1d m_ilNumTileRectsInSetMinus1; 702 IntAry2d m_ilTopLeftTileIndex; 703 IntAry2d m_ilBottomRightTileIndex; 704 IntAry1d m_ilcIdc; 705 BoolAry1d m_ilExactSampleValueMatchFlag; 706 Int m_allTilesIlcIdc; 707 708 Void resizeDimI( Int sizeDimI ) 709 { 710 m_ilctsId .resize( sizeDimI ); 711 m_ilNumTileRectsInSetMinus1 .resize( sizeDimI ); 712 m_ilTopLeftTileIndex .resize( sizeDimI ); 713 m_ilBottomRightTileIndex .resize( sizeDimI ); 714 m_ilcIdc .resize( sizeDimI ); 715 m_ilExactSampleValueMatchFlag.resize( sizeDimI ); 716 } 717 718 Void resizeDimJ( Int i, Int sizeDimJ ) 719 { 720 m_ilTopLeftTileIndex [i].resize( sizeDimJ ); 721 m_ilBottomRightTileIndex[i].resize( sizeDimJ ); 722 } 723 724 }; 725 726 #if NH_MV_TBD 727 class SEIBspNesting : public SEI 728 { 729 public: 730 PayloadType payloadType( ) const { return BSP_NESTING; } 731 SEIBspNesting ( ) { }; 732 ~SEIBspNesting( ) { }; 733 SEI* getCopy( ) const { return new SEIBspNesting(*this); }; 734 735 Void setupFromCfgFile( const Char* cfgFile ); 736 Void setupFromSlice ( const TComSlice* slice ); 737 Bool checkCfg ( const TComSlice* slice ); 738 739 Int m_seiOlsIdx; 740 Int m_seiPartitioningSchemeIdx; 741 Int m_bspIdx; 742 Int m_bspNestingZeroBit; 743 Int m_numSeisInBspMinus1; 744 }; 745 746 class SEIBspInitialArrivalTime : public SEI 747 { 748 public: 749 PayloadType payloadType( ) const { return BSP_INITIAL_ARRIVAL_TIME; } 750 SEIBspInitialArrivalTime ( ) { }; 751 ~SEIBspInitialArrivalTime( ) { }; 752 SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); }; 753 754 Void setupFromCfgFile( const Char* cfgFile ); 755 Void setupFromSlice ( const TComSlice* slice ); 756 Bool checkCfg ( const TComSlice* slice ); 757 758 IntAry1d m_nalInitialArrivalDelay; 759 IntAry1d m_vclInitialArrivalDelay; 760 }; 761 #endif 762 763 class SEISubBitstreamProperty : public SEI 764 { 765 public: 766 PayloadType payloadType( ) const { return SUB_BITSTREAM_PROPERTY; } 767 SEISubBitstreamProperty ( ) { }; 768 ~SEISubBitstreamProperty( ) { }; 769 SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); }; 770 771 Void setupFromCfgFile( const Char* cfgFile ); 772 Bool checkCfg ( const TComSlice* slice ); 773 Void resizeArrays ( ); 774 775 Int m_sbPropertyActiveVpsId; 776 Int m_numAdditionalSubStreamsMinus1; 777 IntAry1d m_subBitstreamMode; 778 IntAry1d m_olsIdxToVps; 779 IntAry1d m_highestSublayerId; 780 IntAry1d m_avgSbPropertyBitRate; 781 IntAry1d m_maxSbPropertyBitRate; 782 }; 783 784 class SEIAlphaChannelInfo : public SEI 785 { 786 public: 787 PayloadType payloadType( ) const { return ALPHA_CHANNEL_INFO; } 788 SEIAlphaChannelInfo ( ) { }; 789 ~SEIAlphaChannelInfo( ) { }; 790 SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); }; 791 792 Void setupFromCfgFile( const Char* cfgFile ); 793 Bool checkCfg ( const TComSlice* slice ); 794 795 Bool m_alphaChannelCancelFlag; 796 Int m_alphaChannelUseIdc; 797 Int m_alphaChannelBitDepthMinus8; 798 Int m_alphaTransparentValue; 799 Int m_alphaOpaqueValue; 800 Bool m_alphaChannelIncrFlag; 801 Bool m_alphaChannelClipFlag; 802 Bool m_alphaChannelClipTypeFlag; 803 }; 804 805 class SEIOverlayInfo : public SEI 806 { 807 public: 808 PayloadType payloadType( ) const { return OVERLAY_INFO; } 809 SEIOverlayInfo ( ); 810 ~SEIOverlayInfo( ) { }; 811 SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; 812 813 Void setupFromCfgFile( const Char* cfgFile ); 814 Bool checkCfg ( const TComSlice* slice ); 815 816 const Int m_numOverlaysMax; 817 const Int m_numOverlayElementsMax; 818 const Int m_numStringBytesMax; //incl. null termination byte 819 820 Bool m_overlayInfoCancelFlag; 821 Int m_overlayContentAuxIdMinus128; 822 Int m_overlayLabelAuxIdMinus128; 823 Int m_overlayAlphaAuxIdMinus128; 824 Int m_overlayElementLabelValueLengthMinus8; 825 Int m_numOverlaysMinus1; 826 IntAry1d m_overlayIdx; 827 BoolAry1d m_languageOverlayPresentFlag; 828 IntAry1d m_overlayContentLayerId; 829 BoolAry1d m_overlayLabelPresentFlag; 830 IntAry1d m_overlayLabelLayerId; 831 BoolAry1d m_overlayAlphaPresentFlag; 832 IntAry1d m_overlayAlphaLayerId; 833 IntAry1d m_numOverlayElementsMinus1; 834 IntAry2d m_overlayElementLabelMin; 835 IntAry2d m_overlayElementLabelMax; 836 StringAry1d m_overlayLanguage; 837 StringAry1d m_overlayName; 838 StringAry2d m_overlayElementName; 839 Bool m_overlayInfoPersistenceFlag; 840 }; 841 842 class SEITemporalMvPredictionConstraints : public SEI 843 { 844 public: 845 PayloadType payloadType( ) const { return TEMPORAL_MV_PREDICTION_CONSTRAINTS; } 846 SEITemporalMvPredictionConstraints ( ) { }; 847 ~SEITemporalMvPredictionConstraints( ) { }; 848 SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); }; 849 850 Void setupFromCfgFile( const Char* cfgFile ); 851 Bool checkCfg ( const TComSlice* slice ); 852 853 Bool m_prevPicsNotUsedFlag; 854 Bool m_noIntraLayerColPicFlag; 855 }; 856 857 #if NH_MV_SEI_TBD 858 class SEIFrameFieldInfo : public SEI 859 { 860 public: 861 PayloadType payloadType( ) const { return FRAME_FIELD_INFO; } 862 SEIFrameFieldInfo ( ) { }; 863 ~SEIFrameFieldInfo( ) { }; 864 SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); }; 865 866 Void setupFromCfgFile( const Char* cfgFile ); 867 Void setupFromSlice ( const TComSlice* slice ); 868 Bool checkCfg ( const TComSlice* slice ); 869 870 Int m_ffinfoPicStruct; 871 Int m_ffinfoSourceScanType; 872 Bool m_ffinfoDuplicateFlag; 873 }; 874 #endif 875 876 class SEIThreeDimensionalReferenceDisplaysInfo : public SEI 877 { 878 public: 879 PayloadType payloadType( ) const { return THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO; } 880 SEIThreeDimensionalReferenceDisplaysInfo ( ) { }; 881 ~SEIThreeDimensionalReferenceDisplaysInfo( ) { }; 882 SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); }; 883 884 Void setupFromCfgFile( const Char* cfgFile ); 885 Bool checkCfg ( const TComSlice* slice ); 886 887 Int getNumRefDisplaysMinus1( ) const 888 { 889 return m_numRefDisplaysMinus1; 890 } 891 892 Int m_precRefDisplayWidth; 893 Bool m_refViewingDistanceFlag; 894 Int m_precRefViewingDist; 895 Int m_numRefDisplaysMinus1; 896 IntAry1d m_leftViewId; 897 IntAry1d m_rightViewId; 898 IntAry1d m_exponentRefDisplayWidth; 899 IntAry1d m_mantissaRefDisplayWidth; 900 IntAry1d m_exponentRefViewingDistance; 901 IntAry1d m_mantissaRefViewingDistance; 902 BoolAry1d m_additionalShiftPresentFlag; 903 IntAry1d m_numSampleShiftPlus512; 904 Bool m_threeDimensionalReferenceDisplaysExtensionFlag; 905 906 Void resizeArrays( ) 907 { 908 Int numReferenceDiaplays = getNumRefDisplaysMinus1() + 1; 909 910 m_leftViewId .resize( numReferenceDiaplays ); 911 m_rightViewId .resize( numReferenceDiaplays ); 912 m_exponentRefDisplayWidth .resize( numReferenceDiaplays ); 913 m_mantissaRefDisplayWidth .resize( numReferenceDiaplays ); 914 m_exponentRefViewingDistance .resize( numReferenceDiaplays ); 915 m_mantissaRefViewingDistance .resize( numReferenceDiaplays ); 916 m_additionalShiftPresentFlag .resize( numReferenceDiaplays ); 917 m_numSampleShiftPlus512 .resize( numReferenceDiaplays ); 918 } 919 920 UInt getMantissaReferenceDisplayWidthLen ( Int i ) const ; 921 UInt getMantissaReferenceViewingDistanceLen ( Int i ) const ; 922 private: 923 UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 924 }; 925 926 #if SEI_DRI_F0169 927 class SEIDepthRepresentationInfo : public SEI 928 { 929 public: 930 PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; } 931 SEIDepthRepresentationInfo ( ) 932 { 933 m_currLayerID=-1; 934 }; 935 ~SEIDepthRepresentationInfo( ) { }; 936 SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); }; 937 938 Void setupFromCfgFile( const Char* cfgFile ); 939 Void setupFromSlice ( const TComSlice* slice ); 940 Bool checkCfg ( const TComSlice* slice ); 941 Void clear() 942 { 943 int i; 944 m_zNearFlag.clear(); 945 m_zFarFlag.clear(); 946 m_dMinFlag.clear(); 947 m_dMaxFlag.clear(); 948 949 for(i=0;i<m_zNear.size();i++) 950 m_zNear[i].clear(); 951 m_zNear.clear(); 952 953 for(i=0;i<m_zFar.size();i++) 954 m_zFar[i].clear(); 955 m_zFar.clear(); 956 957 for(i=0;i<m_dMin.size();i++) 958 m_dMin[i].clear(); 959 m_dMin.clear(); 960 961 for(i=0;i<m_dMax.size();i++) 962 m_dMax[i].clear(); 963 m_dMax.clear(); 964 965 for(i=0;i<m_depthRepresentationType.size();i++) 966 m_depthRepresentationType[i].clear(); 967 m_depthRepresentationType.clear(); 968 969 for(i=0;i<m_disparityRefViewId.size();i++) 970 m_disparityRefViewId[i].clear(); 971 m_disparityRefViewId.clear(); 972 973 for(i=0;i<m_depthNonlinearRepresentationNumMinus1.size();i++) 974 m_depthNonlinearRepresentationNumMinus1[i].clear(); 975 m_depthNonlinearRepresentationNumMinus1.clear(); 976 977 for(i=0;i<m_depth_nonlinear_representation_model.size();i++) 978 m_depth_nonlinear_representation_model[i].clear(); 979 m_depth_nonlinear_representation_model.clear(); 980 981 } 982 Int m_currLayerID; 983 BoolAry1d m_zNearFlag; 984 BoolAry1d m_zFarFlag; 985 BoolAry1d m_dMinFlag; 986 BoolAry1d m_dMaxFlag; 987 BoolAry2d m_depthRepresentationInfoSeiPresentFlag; 988 std::vector< std::vector<Double> > m_zNear,m_zFar,m_dMin,m_dMax; 989 990 IntAry2d m_depthRepresentationType; 991 IntAry2d m_disparityRefViewId; 992 IntAry2d m_depthNonlinearRepresentationNumMinus1; 993 IntAry2d m_depth_nonlinear_representation_model; 994 }; 995 #endif 996 997 class SEIMultiviewSceneInfo : public SEI 998 { 999 public: 1000 PayloadType payloadType( ) const { return MULTIVIEW_SCENE_INFO; } 1001 SEIMultiviewSceneInfo ( ) { }; 1002 ~SEIMultiviewSceneInfo( ) { }; 1003 SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); }; 1004 1005 Void setupFromCfgFile( const Char* cfgFile ); 1006 Bool checkCfg ( const TComSlice* slice ); 1007 1008 Int m_minDisparity; 1009 Int m_maxDisparityRange; 1010 }; 1011 1012 1013 class SEIMultiviewAcquisitionInfo : public SEI 1014 { 1015 public: 1016 PayloadType payloadType( ) const { return MULTIVIEW_ACQUISITION_INFO; } 1017 SEIMultiviewAcquisitionInfo ( ) { }; 1018 ~SEIMultiviewAcquisitionInfo( ) { }; 1019 SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); }; 1020 1021 Void setupFromCfgFile( const Char* cfgFile ); 1022 Bool checkCfg ( const TComSlice* slice ); 1023 1024 Int getNumViewsMinus1( ) const 1025 { 1026 Int numViewsMinus1; 1027 if( m_scalNestSeiContThisSei != NULL ) 1028 { 1029 numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1; 1030 } 1031 else 1032 { 1033 numViewsMinus1 = 0; 1034 } 1035 return numViewsMinus1; 1036 } 1037 1038 Void resizeArrays( ) 1039 { 1040 Int numViews = getNumViewsMinus1() + 1; 1041 m_signFocalLengthX .resize( numViews ); 1042 m_exponentFocalLengthX .resize( numViews ); 1043 m_mantissaFocalLengthX .resize( numViews ); 1044 m_signFocalLengthY .resize( numViews ); 1045 m_exponentFocalLengthY .resize( numViews ); 1046 m_mantissaFocalLengthY .resize( numViews ); 1047 m_signPrincipalPointX .resize( numViews ); 1048 m_exponentPrincipalPointX.resize( numViews ); 1049 m_mantissaPrincipalPointX.resize( numViews ); 1050 m_signPrincipalPointY .resize( numViews ); 1051 m_exponentPrincipalPointY.resize( numViews ); 1052 m_mantissaPrincipalPointY.resize( numViews ); 1053 m_signSkewFactor .resize( numViews ); 1054 m_exponentSkewFactor .resize( numViews ); 1055 m_mantissaSkewFactor .resize( numViews ); 1056 1057 m_signR .resize( numViews ); 1058 m_exponentR .resize( numViews ); 1059 m_mantissaR .resize( numViews ); 1060 m_signT .resize( numViews ); 1061 m_exponentT .resize( numViews ); 1062 m_mantissaT .resize( numViews ); 1063 1064 for( Int i = 0; i < numViews ; i++ ) 1065 { 1066 m_signR [i].resize( 3 ); 1067 m_exponentR[i].resize( 3 ); 1068 m_mantissaR[i].resize( 3 ); 1069 m_signT [i].resize( 3 ); 1070 m_exponentT[i].resize( 3 ); 1071 m_mantissaT[i].resize( 3 ); 1072 1073 for (Int j = 0; j < 3; j++) 1074 { 1075 m_signR [i][j].resize( 3 ); 1076 m_exponentR[i][j].resize( 3 ); 1077 m_mantissaR[i][j].resize( 3 ); 1078 } 1079 } 1080 } 1081 1082 UInt getMantissaFocalLengthXLen ( Int i ) const ; 1083 UInt getMantissaFocalLengthYLen ( Int i ) const ; 1084 UInt getMantissaPrincipalPointXLen( Int i ) const ; 1085 UInt getMantissaPrincipalPointYLen( Int i ) const ; 1086 UInt getMantissaSkewFactorLen ( Int i ) const ; 1087 UInt getMantissaRLen ( Int i, Int j, Int k ) const ; 1088 UInt getMantissaTLen ( Int i, Int j ) const ; 1089 1090 Bool m_intrinsicParamFlag; 1091 Bool m_extrinsicParamFlag; 1092 Bool m_intrinsicParamsEqualFlag; 1093 Int m_precFocalLength; 1094 Int m_precPrincipalPoint; 1095 Int m_precSkewFactor; 1096 BoolAry1d m_signFocalLengthX; 1097 IntAry1d m_exponentFocalLengthX; 1098 IntAry1d m_mantissaFocalLengthX; 1099 BoolAry1d m_signFocalLengthY; 1100 IntAry1d m_exponentFocalLengthY; 1101 IntAry1d m_mantissaFocalLengthY; 1102 BoolAry1d m_signPrincipalPointX; 1103 IntAry1d m_exponentPrincipalPointX; 1104 IntAry1d m_mantissaPrincipalPointX; 1105 BoolAry1d m_signPrincipalPointY; 1106 IntAry1d m_exponentPrincipalPointY; 1107 IntAry1d m_mantissaPrincipalPointY; 1108 BoolAry1d m_signSkewFactor; 1109 IntAry1d m_exponentSkewFactor; 1110 IntAry1d m_mantissaSkewFactor; 1111 Int m_precRotationParam; 1112 Int m_precTranslationParam; 1113 BoolAry3d m_signR; 1114 IntAry3d m_exponentR; 1115 IntAry3d m_mantissaR; 1116 BoolAry2d m_signT; 1117 IntAry2d m_exponentT; 1118 IntAry2d m_mantissaT; 1119 private: 1120 UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 1121 }; 1122 1123 1124 1125 class SEIMultiviewViewPosition : public SEI 1126 { 1127 public: 1128 PayloadType payloadType( ) const { return MULTIVIEW_VIEW_POSITION; } 1129 SEIMultiviewViewPosition ( ) { }; 1130 ~SEIMultiviewViewPosition( ) { }; 1131 SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); }; 1132 1133 Void setupFromCfgFile( const Char* cfgFile ); 1134 Void setupFromSlice ( const TComSlice* slice ); 1135 Bool checkCfg ( const TComSlice* slice ); 1136 1137 Int m_numViewsMinus1; 1138 IntAry1d m_viewPosition; 1139 }; 1140 1141 #if NH_3D 1142 class SEIAlternativeDepthInfo : public SEI 1143 { 1144 public: 1145 PayloadType payloadType( ) const { return ALTERNATIVE_DEPTH_INFO; } 1146 SEIAlternativeDepthInfo ( ) { }; 1147 ~SEIAlternativeDepthInfo( ) { }; 1148 SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); }; 1149 1150 Void setupFromCfgFile( const Char* cfgFile ); 1151 Bool checkCfg ( const TComSlice* slice ); 1152 1153 UInt getManGvdFocalLengthXLen ( Int i, Int j ) const; 1154 UInt getManGvdFocalLengthYLen ( Int i, Int j ) const; 1155 UInt getManGvdPrincipalPointXLen ( Int i, Int j ) const; 1156 UInt getManGvdPrincipalPointYLen ( Int i, Int j ) const; 1157 //UInt getManGvdRLen ( Int i, int j ) const; 1158 UInt getManGvdTXLen ( Int i, Int j ) const; 1159 UInt xGetSyntaxElementLen ( Int expo, Int prec, Int val ) const; 1160 1161 Void resizeArrays( ) 1162 { 1163 const Int numViews = 3; // getNumConstituentViewsGvdMinus1() + 1; 1164 1165 m_signGvdZNearFlag.resize(3); 1166 m_expGvdZNear.resize(3); 1167 m_manLenGvdZNearMinus1.resize(3); 1168 m_manGvdZNear.resize(3); 1169 m_signGvdZFarFlag.resize(3); 1170 m_expGvdZFar.resize(3); 1171 m_manLenGvdZFarMinus1.resize(3); 1172 m_manGvdZFar.resize(3); 1173 1174 m_signGvdFocalLengthX.resize(3); 1175 m_expGvdFocalLengthX.resize(3); 1176 m_manGvdFocalLengthX.resize(3); 1177 m_signGvdFocalLengthY.resize(3); 1178 m_expGvdFocalLengthY.resize(3); 1179 m_manGvdFocalLengthY.resize(3); 1180 m_signGvdPrincipalPointX.resize(3); 1181 m_expGvdPrincipalPointX.resize(3); 1182 m_manGvdPrincipalPointX.resize(3); 1183 m_signGvdPrincipalPointY.resize(3); 1184 m_expGvdPrincipalPointY.resize(3); 1185 m_manGvdPrincipalPointY.resize(3); 1186 1187 m_signGvdR00.resize(3); 1188 m_expGvdR00.resize(3); 1189 m_manGvdR00.resize(3); 1190 m_signGvdR01.resize(3); 1191 m_expGvdR01.resize(3); 1192 m_manGvdR01.resize(3); 1193 m_signGvdR02.resize(3); 1194 m_expGvdR02.resize(3); 1195 m_manGvdR02.resize(3); 1196 m_signGvdR10.resize(3); 1197 m_expGvdR10.resize(3); 1198 m_manGvdR10.resize(3); 1199 m_signGvdR11.resize(3); 1200 m_expGvdR11.resize(3); 1201 m_manGvdR11.resize(3); 1202 m_signGvdR12.resize(3); 1203 m_expGvdR12.resize(3); 1204 m_manGvdR12.resize(3); 1205 m_signGvdR20.resize(3); 1206 m_expGvdR20.resize(3); 1207 m_manGvdR20.resize(3); 1208 m_signGvdR21.resize(3); 1209 m_expGvdR21.resize(3); 1210 m_manGvdR21.resize(3); 1211 m_signGvdR22.resize(3); 1212 m_expGvdR22.resize(3); 1213 m_manGvdR22.resize(3); 1214 1215 m_signGvdTX.resize(3); 1216 m_expGvdTX.resize(3); 1217 m_manGvdTX.resize(3); 1218 1219 for( Int i = 0; i < numViews; i++ ) 1220 { 1221 m_signGvdZNearFlag[i].resize(3); 1222 m_expGvdZNear[i].resize(3); 1223 m_manLenGvdZNearMinus1[i].resize(3); 1224 m_manGvdZNear[i].resize(3); 1225 m_signGvdZFarFlag[i].resize(3); 1226 m_expGvdZFar[i].resize(3); 1227 m_manLenGvdZFarMinus1[i].resize(3); 1228 m_manGvdZFar[i].resize(3); 1229 1230 m_signGvdFocalLengthX[i].resize(3); 1231 m_expGvdFocalLengthX[i].resize(3); 1232 m_manGvdFocalLengthX[i].resize(3); 1233 m_signGvdFocalLengthY[i].resize(3); 1234 m_expGvdFocalLengthY[i].resize(3); 1235 m_manGvdFocalLengthY[i].resize(3); 1236 m_signGvdPrincipalPointX[i].resize(3); 1237 m_expGvdPrincipalPointX[i].resize(3); 1238 m_manGvdPrincipalPointX[i].resize(3); 1239 m_signGvdPrincipalPointY[i].resize(3); 1240 m_expGvdPrincipalPointY[i].resize(3); 1241 m_manGvdPrincipalPointY[i].resize(3); 1242 1243 m_signGvdR00[i].resize(3); 1244 m_expGvdR00[i].resize(3); 1245 m_manGvdR00[i].resize(3); 1246 m_signGvdR01[i].resize(3); 1247 m_expGvdR01[i].resize(3); 1248 m_manGvdR01[i].resize(3); 1249 m_signGvdR02[i].resize(3); 1250 m_expGvdR02[i].resize(3); 1251 m_manGvdR02[i].resize(3); 1252 m_signGvdR10[i].resize(3); 1253 m_expGvdR10[i].resize(3); 1254 m_manGvdR10[i].resize(3); 1255 m_signGvdR11[i].resize(3); 1256 m_expGvdR11[i].resize(3); 1257 m_manGvdR11[i].resize(3); 1258 m_signGvdR12[i].resize(3); 1259 m_expGvdR12[i].resize(3); 1260 m_manGvdR12[i].resize(3); 1261 m_signGvdR20[i].resize(3); 1262 m_expGvdR20[i].resize(3); 1263 m_manGvdR20[i].resize(3); 1264 m_signGvdR21[i].resize(3); 1265 m_expGvdR21[i].resize(3); 1266 m_manGvdR21[i].resize(3); 1267 m_signGvdR22[i].resize(3); 1268 m_expGvdR22[i].resize(3); 1269 m_manGvdR22[i].resize(3); 1270 1271 m_signGvdTX[i].resize(3); 1272 m_expGvdTX[i].resize(3); 1273 m_manGvdTX[i].resize(3); 1274 } 1275 1276 } 1277 1278 Bool m_alternativeDepthInfoCancelFlag; 1279 Int m_depthType; 1280 Int m_numConstituentViewsGvdMinus1; 1281 Bool m_depthPresentGvdFlag; 1282 Bool m_zGvdFlag; 1283 Bool m_intrinsicParamGvdFlag; 1284 Bool m_rotationGvdFlag; 1285 Bool m_translationGvdFlag; 1286 BoolAry2d m_signGvdZNearFlag; 1287 IntAry2d m_expGvdZNear; 1288 IntAry2d m_manLenGvdZNearMinus1; 1289 IntAry2d m_manGvdZNear; 1290 BoolAry2d m_signGvdZFarFlag; 1291 IntAry2d m_expGvdZFar; 1292 IntAry2d m_manLenGvdZFarMinus1; 1293 IntAry2d m_manGvdZFar; 1294 Int m_precGvdFocalLength; 1295 Int m_precGvdPrincipalPoint; 1296 Int m_precGvdRotationParam; 1297 Int m_precGvdTranslationParam; 1298 BoolAry2d m_signGvdFocalLengthX; 1299 IntAry2d m_expGvdFocalLengthX; 1300 IntAry2d m_manGvdFocalLengthX; 1301 BoolAry2d m_signGvdFocalLengthY; 1302 IntAry2d m_expGvdFocalLengthY; 1303 IntAry2d m_manGvdFocalLengthY; 1304 BoolAry2d m_signGvdPrincipalPointX; 1305 IntAry2d m_expGvdPrincipalPointX; 1306 IntAry2d m_manGvdPrincipalPointX; 1307 BoolAry2d m_signGvdPrincipalPointY; 1308 IntAry2d m_expGvdPrincipalPointY; 1309 IntAry2d m_manGvdPrincipalPointY; 1310 1311 BoolAry2d m_signGvdR00; 1312 IntAry2d m_expGvdR00; 1313 IntAry2d m_manGvdR00; 1314 BoolAry2d m_signGvdR01; 1315 IntAry2d m_expGvdR01; 1316 IntAry2d m_manGvdR01; 1317 BoolAry2d m_signGvdR02; 1318 IntAry2d m_expGvdR02; 1319 IntAry2d m_manGvdR02; 1320 BoolAry2d m_signGvdR10; 1321 IntAry2d m_expGvdR10; 1322 IntAry2d m_manGvdR10; 1323 BoolAry2d m_signGvdR11; 1324 IntAry2d m_expGvdR11; 1325 IntAry2d m_manGvdR11; 1326 BoolAry2d m_signGvdR12; 1327 IntAry2d m_expGvdR12; 1328 IntAry2d m_manGvdR12; 1329 BoolAry2d m_signGvdR20; 1330 IntAry2d m_expGvdR20; 1331 IntAry2d m_manGvdR20; 1332 BoolAry2d m_signGvdR21; 1333 IntAry2d m_expGvdR21; 1334 IntAry2d m_manGvdR21; 1335 BoolAry2d m_signGvdR22; 1336 IntAry2d m_expGvdR22; 1337 IntAry2d m_manGvdR22; 1338 1339 BoolAry2d m_signGvdTX; 1340 IntAry2d m_expGvdTX; 1341 IntAry2d m_manGvdTX; 1342 1343 Int m_minOffsetXInt; 1344 Int m_minOffsetXFrac; 1345 Int m_maxOffsetXInt; 1346 Int m_maxOffsetXFrac; 1347 Bool m_offsetYPresentFlag; 1348 Int m_minOffsetYInt; 1349 Int m_minOffsetYFrac; 1350 Int m_maxOffsetYInt; 1351 Int m_maxOffsetYFrac; 1352 Bool m_warpMapSizePresentFlag; 1353 Int m_warpMapWidthMinus2; 1354 Int m_warpMapHeightMinus2; 1355 }; 1356 1357 #endif 1358 #endif 1359 1360 #endif 602 1361 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r1321 r1356 5466 5466 } 5467 5467 5468 #if NH_3D_FIX_NBDV_COL 5469 // The picture pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx) might not be in DPB anymore 5470 // So don't access it directly. 5471 iColRefViewIdx = pColCU->getSlice()->getVPS()->getViewOrderIdx( pColCU->getSlice()->getRefLayerId( eColRefPicList, iColRefIdx ) ); 5472 #else 5468 5473 iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewIndex(); 5474 #endif 5475 5469 5476 5470 5477 if ( iColViewIdx == iColRefViewIdx ) // temporal vector -
trunk/source/Lib/TLibCommon/TypeDef.h
r1321 r1356 43 43 //! \{ 44 44 ///////////////////////////////////////////////////////////////////////////////////////// 45 ///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// 45 ///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// 46 46 ///////////////////////////////////////////////////////////////////////////////////////// 47 47 /* HEVC_EXT might be defined by compiler/makefile options. 48 Linux makefiles support the following settings: 49 make -> HEVC_EXT not defined 48 Linux makefiles support the following settings: 49 make -> HEVC_EXT not defined 50 50 make HEVC_EXT=0 -> NH_MV=0 H_3D=0 --> plain HM 51 make HEVC_EXT=1 -> NH_MV=1 H_3D=0 --> MV only 52 make HEVC_EXT=2 -> NH_MV=1 H_3D=1 --> full 3D 51 make HEVC_EXT=1 -> NH_MV=1 H_3D=0 --> MV only 52 make HEVC_EXT=2 -> NH_MV=1 H_3D=1 --> full 3D 53 53 */ 54 54 #ifndef HEVC_EXT … … 56 56 #endif 57 57 #if ( HEVC_EXT < 0 )||( HEVC_EXT > 2 ) 58 #error HEVC_EXT must be in the range of 0 to 2, inclusive. 58 #error HEVC_EXT must be in the range of 0 to 2, inclusive. 59 59 #endif 60 60 #define NH_MV ( HEVC_EXT != 0) 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_FIX_TICKET_106 1 // Identical motion check. 67 #define NH_MV_FIX_NO_REF_PICS_CHECK 1 // !!SPEC!! 68 #define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 66 #define NH_MV_SEI_TBD 0 67 #define NH_MV_SEI 1 68 #define NH_MV_FIX_TICKET_106 1 // Identical motion check. 69 #define NH_MV_FIX_NO_REF_PICS_CHECK 1 // !!SPEC!! 70 #define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 69 71 #define NH_MV_FIX_NUM_POC_TOTAL_CUR 1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!! 72 #define NH_MV_LAYERS_NOT_PRESENT_SEI 1 // Layers not present SEI message JCTMV-M0043 73 #if NH_MV_SEI 74 #define SEI_DRI_F0169 1 75 #endif 70 76 #endif 71 77 #if NH_3D 72 78 #define H_3D_FIX_ARP_CHECK_NOT_IN_DPB 1 79 #define NH_3D_FIX_NBDV_COL 1 73 80 #endif 74 81 ///////////////////////////////////////////////////////////////////////////////////////// 75 /////////////////////////////////// MAJOR DEFINES /////////////////////////////////// 82 /////////////////////////////////// MAJOR DEFINES /////////////////////////////////// 76 83 ///////////////////////////////////////////////////////////////////////////////////////// 77 84 #if NH_MV … … 90 97 // LGE_ARP_CTX_F0161 JCT3V-F0161 91 98 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 92 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 99 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 93 100 // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085 94 // QC_I0051_ARP_SIMP 95 // SHARP_ARP_CHROMA_I0104 101 // QC_I0051_ARP_SIMP 102 // SHARP_ARP_CHROMA_I0104 96 103 // MTK_I0072_IVARP_SCALING_FIX 97 104 // SEC_ARP_VIEW_REF_CHECK_J0037 Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1 98 105 // SEC_ARP_REM_ENC_RESTRICT_K0035 Removal of encoder restriction of ARP, JCT3V-K0035 99 106 #define NH_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068 100 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 107 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 101 108 // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055 102 #define NH_3D_VSO 1 // VSO, View synthesis optimization, includes: 109 #define NH_3D_VSO 1 // VSO, View synthesis optimization, includes: 103 110 // HHI_VSO 104 111 // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization … … 106 113 // LGE_WVSO_A0119 107 114 // SCU_HS_VSD_BUGFIX_IMPROV_G0163 108 #define NH_3D_NBDV 1 // Neighboring block disparity derivation 109 // QC_JCT3V-A0097 115 #define NH_3D_NBDV 1 // Neighboring block disparity derivation 116 // QC_JCT3V-A0097 110 117 // LGE_DVMCP_A0126 111 // LGE_DVMCP_MEM_REDUCTION_B0135 118 // LGE_DVMCP_MEM_REDUCTION_B0135 112 119 // QC_SIMPLE_NBDV_B0047 113 120 // FIX_LGE_DVMCP_B0133 114 121 // QC_NBDV_LDB_FIX_C0055 115 122 // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097 116 // MTK_SIMPLIFY_DVTC_C0135 123 // MTK_SIMPLIFY_DVTC_C0135 117 124 // QC_CU_NBDV_D0181 118 125 // SEC_DEFAULT_DV_D0112 … … 154 161 // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208 155 162 // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208 156 // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 163 // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 157 164 // SHARP_VSP_BLOCK_IN_AMP_F0102 VSP partitioning for AMP 158 165 // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss 159 // LGE_SHARP_VSP_INHERIT_F0104 166 // LGE_SHARP_VSP_INHERIT_F0104 160 167 // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP 161 168 // Restricted bi-prediction for VSP … … 164 171 #define NH_3D_MLC 1 165 172 #define NH_3D_IV_MERGE 1 // Inter-view motion merge candidate 166 // HHI_INTER_VIEW_MOTION_PRED 173 // HHI_INTER_VIEW_MOTION_PRED 167 174 // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction 168 175 // QC_MRG_CANS_B0048 , JCT3V-B0048, B0086, B0069 169 176 // OL_DISMV_POS_B0069 , different pos for disparity MV candidate, B0069 170 177 // MTK_INTERVIEW_MERGE_A0049 , second part 171 // QC_AMVP_MRG_UNIFY_IVCAN_C0051 172 // QC_INRIA_MTK_MRG_E0126 178 // QC_AMVP_MRG_UNIFY_IVCAN_C0051 179 // QC_INRIA_MTK_MRG_E0126 173 180 // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate 174 181 // MTK_NBDV_IVREF_FIX_G0067 , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067 … … 187 194 // TEXTURE MERGING CANDIDATE , JCT3V-C0137 188 195 // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode 189 #define NH_3D_TMVP 1 // QC_TMVP_C0047 196 #define NH_3D_TMVP 1 // QC_TMVP_C0047 190 197 // Sony_M23639 191 198 // H_3D_TMVP_SCALING_FIX_K0053 1 // QC/CY for K0053 … … 207 214 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes 208 215 // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135 Use only one context for CABAC of dim_not_present_flag 209 // QC_SIMP_DELTADC_CODING_H0131 Simplify detaDC entropy coding 216 // QC_SIMP_DELTADC_CODING_H0131 Simplify detaDC entropy coding 210 217 // MTK_DMM_SIMP_CODE_H0092 Remove CABAC context for DMM1 mode coding 211 218 // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113 212 219 // HS_DMM_SIGNALLING_I0120 213 // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110 220 // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110 214 221 // MTK_DMM_SIM_J0035 215 // SHARP_DMM_CLEAN_K0042 1 // Generate DMM pattern with rotation 222 // SHARP_DMM_CLEAN_K0042 1 // Generate DMM pattern with rotation 216 223 #define NH_3D_DLT 1 // Depth Lookup Table 217 224 // HHI_DELTADC_DLT_D0035 218 225 // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159 219 // SEC_NO_RESI_DLT_H0105 220 // MTK_DLT_CODING_FIX_H0091 226 // SEC_NO_RESI_DLT_H0105 227 // MTK_DLT_CODING_FIX_H0091 221 228 // H_3D_DELTA_DLT 222 229 // RWTH_DLT_CLIP_I0057 223 // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup 230 // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup 224 231 #define NH_3D_SDC_INTRA 1 // Segment-wise DC Coding method for INTRA 225 #define NH_3D_SDC_INTER 1 // Segment-wise DC Coding method for INTER 232 #define NH_3D_SDC_INTER 1 // Segment-wise DC Coding method for INTER 226 233 // RWTH_SDC_DLT_B0036 227 234 // INTEL_SDC64_D0193 … … 249 256 // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133 250 257 #define NH_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging 251 // MTK_DBBP_AMP_REM_H0072 252 // RWTH_DBBP_NO_SPU_H0057 253 // SEC_DBBP_FILTERING_H0104 254 // MTK_DBBP_SIGNALING_H0094 255 // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 258 // MTK_DBBP_AMP_REM_H0072 259 // RWTH_DBBP_NO_SPU_H0057 260 // SEC_DBBP_FILTERING_H0104 261 // MTK_DBBP_SIGNALING_H0094 262 // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 256 263 // SEC_DBBP_EXPLICIT_SIG_I0077 Remove the partition derivation and signal dbbp_flag only when the partition mode is 2NxN/Nx2N, JCT3V-I0077 257 264 // Disallow DBBP in 8x8 CU, JCT3V-I0078 … … 261 268 // RWTH_DBBP_NO_SATD_K0028 262 269 // HS_DBBP_CLEAN_K0048 263 #define NH_3D_DIS 1 // Depth intra skip 270 #define NH_3D_DIS 1 // Depth intra skip 264 271 // SEC_DEPTH_INTRA_SKIP_MODE_K0033 Depth intra skip mode 265 272 #define H_3D_FCO 0 // Flexible coding order for 3D … … 272 279 // HHI_VPS_3D_EXTENSION_I3_J0107 273 280 // HHI_INTER_COMP_PRED_K0052 274 // HHI_RES_PRED_K0052 275 // HHI_CAM_PARA_K0052 276 // H_3D_DIRECT_DEP_TYPE 281 // HHI_RES_PRED_K0052 282 // HHI_CAM_PARA_K0052 283 // H_3D_DIRECT_DEP_TYPE 277 284 // Rate Control 278 285 #define KWU_FIX_URQ 0 … … 281 288 #endif // NH_3D 282 289 ///////////////////////////////////////////////////////////////////////////////////////// 283 /////////////////////////////////// DERIVED DEFINES /////////////////////////////////// 290 /////////////////////////////////// DERIVED DEFINES /////////////////////////////////// 284 291 ///////////////////////////////////////////////////////////////////////////////////////// 285 292 #if NH_3D … … 288 295 #endif 289 296 ///// ***** VIEW SYNTHESIS OPTIMIZAION ********* 290 #if NH_3D_VSO 297 #if NH_3D_VSO 291 298 #define H_3D_VSO_DIST_INT 1 // Allow negative synthesized view distortion change 292 #define H_3D_VSO_COLOR_PLANES 1 // Compute VSO distortion on color planes 299 #define H_3D_VSO_COLOR_PLANES 1 // Compute VSO distortion on color planes 293 300 #define H_3D_VSO_EARLY_SKIP 1 // LGE_VSO_EARLY_SKIP_A0093, A0093 modification 4 294 301 #define H_3D_VSO_RM_ASSERTIONS 0 // Output VSO assertions … … 332 339 /////////////////////////////////// MV_HEVC HLS ////////////////////////////// 333 340 ///////////////////////////////////////////////////////////////////////////////// 334 // TBD: Check if integration is necessary. 341 // TBD: Check if integration is necessary. 335 342 #define H_MV_HLS_PTL_LIMITS 0 336 343 ///////////////////////////////////////////////////////////////////////////////////////// … … 485 492 typedef UInt Distortion; ///< distortion measurement 486 493 #endif 487 #if NH_MV 494 #if NH_MV 495 typedef std::vector< std::string > StringAry1d; 496 typedef std::vector< StringAry1d > StringAry2d; 488 497 typedef std::vector< Int > IntAry1d; 489 typedef std::vector< IntAry1d > IntAry2d; 490 typedef std::vector< IntAry2d > IntAry3d; 491 typedef std::vector< IntAry3d > IntAry4d; 492 typedef std::vector< IntAry4d > IntAry5d; 498 typedef std::vector< IntAry1d > IntAry2d; 499 typedef std::vector< IntAry2d > IntAry3d; 500 typedef std::vector< IntAry3d > IntAry4d; 501 typedef std::vector< IntAry4d > IntAry5d; 493 502 typedef std::vector< Bool > BoolAry1d; 494 typedef std::vector< BoolAry1d > BoolAry2d; 495 typedef std::vector< BoolAry2d > BoolAry3d; 496 typedef std::vector< BoolAry3d > BoolAry4d; 497 typedef std::vector< BoolAry4d > BoolAry5d; 503 typedef std::vector< BoolAry1d > BoolAry2d; 504 typedef std::vector< BoolAry2d > BoolAry3d; 505 typedef std::vector< BoolAry3d > BoolAry4d; 506 typedef std::vector< BoolAry4d > BoolAry5d; 498 507 #endif 499 508 #if NH_3D_VSO … … 504 513 #if H_3D_VSO_DIST_INT 505 514 typedef Int64 Dist; ///< RDO distortion 506 typedef Int64 Dist64; 515 typedef Int64 Dist64; 507 516 #define RDO_DIST_MIN MIN_INT 508 517 #define RDO_DIST_MAX MAX_INT 509 518 #else 510 519 typedef UInt Dist; ///< RDO distortion 511 typedef UInt64 Dist; 520 typedef UInt64 Dist; 512 521 #define RDO_DIST_MIN 0 513 522 #define RDO_DIST_MAX MAX_UINT … … 797 806 ANNEX_G, 798 807 ANNEX_H, 799 ANNEX_I 808 ANNEX_I 800 809 }; 801 810 #endif … … 813 822 ,MULTIVIEWMAIN = 6, 814 823 #if NH_3D 815 MAIN3D = 8, 824 MAIN3D = 8, 816 825 #endif 817 826 #endif … … 941 950 enum ScalabilityType 942 951 { 943 DEPTH_ID = 0, 952 DEPTH_ID = 0, 944 953 VIEW_ORDER_INDEX = 1, 945 954 DEPENDENCY_ID = 2, -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r1313 r1356 99 99 } 100 100 101 Void SEIReader::sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName) 102 { 103 READ_STRING(uiBufSize, pucCode, ruiLength, pSymbolName); 104 if (pOS) 105 { 106 (*pOS) << " " << pSymbolName << ": " << (const char*) pucCode << "\n"; 107 } 108 } 109 110 #if NH_MV_SEI 111 inline Void SEIReader::output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize) 112 #else 101 113 static inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize) 114 #endif 102 115 { 103 116 if (pDecodedMessageOutputStream) … … 105 118 std::string seiMessageHdr(SEI::getSEIMessageString(sei.payloadType())); seiMessageHdr+=" SEI message"; 106 119 (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw(seiMessageHdr.size()) << "-" << std::setfill(' ') << "\n" << seiMessageHdr << " (" << payloadSize << " bytes)"<< "\n"; 120 #if NH_MV_SEI 121 (*pDecodedMessageOutputStream) << std::setfill(' ') << "LayerId: " << m_layerId << std::setw(2) << " Picture: " << m_decOrder << std::setw( 5 ) << std::endl; 122 #endif 107 123 } 108 124 } … … 117 133 * unmarshal a single SEI message from bitstream bs 118 134 */ 135 #if NH_MV_LAYERS_NOT_PRESENT_SEI 136 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 137 #else 119 138 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 139 #endif 120 140 { 121 141 setBitstream(bs); … … 124 144 do 125 145 { 146 #if NH_MV_LAYERS_NOT_PRESENT_SEI 147 xReadSEImessage(seis, nalUnitType, vps, sps, pDecodedMessageOutputStream); 148 #else 126 149 xReadSEImessage(seis, nalUnitType, sps, pDecodedMessageOutputStream); 127 150 #endif 128 151 /* SEI messages are an integer number of bytes, something has failed 129 152 * in the parsing if bitstream not byte-aligned */ … … 135 158 } 136 159 160 #if NH_MV_LAYERS_NOT_PRESENT_SEI 161 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 162 #else 137 163 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 164 #endif 138 165 { 139 166 #if ENC_DEC_TRACE … … 254 281 case SEI::SCALABLE_NESTING: 255 282 sei = new SEIScalableNesting; 283 #if NH_MV_LAYERS_NOT_PRESENT_SEI 284 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream); 285 #else 256 286 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream); 287 #endif 257 288 break; 258 289 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: … … 277 308 xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream); 278 309 break; 279 #if NH_MV310 #if !NH_MV_SEI 280 311 case SEI::SUB_BITSTREAM_PROPERTY: 281 312 sei = new SEISubBitstreamProperty; 282 313 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream ); 283 314 break; 315 #else 316 #if NH_MV_LAYERS_NOT_PRESENT_SEI 317 case SEI::LAYERS_NOT_PRESENT: 318 if (!vps) 319 { 320 printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring."); 321 } 322 else 323 { 324 sei = new SEILayersNotPresent; 325 xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps, pDecodedMessageOutputStream); 326 } 327 break; 328 #endif 329 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 330 sei = new SEIInterLayerConstrainedTileSets; 331 xParseSEIInterLayerConstrainedTileSets((SEIInterLayerConstrainedTileSets&) *sei, payloadSize, pDecodedMessageOutputStream ); 332 break; 333 #if NH_MV_TBD 334 case SEI::BSP_NESTING: 335 sei = new SEIBspNesting; 336 xParseSEIBspNesting((SEIBspNesting&) *sei, payloadSize, pDecodedMessageOutputStream ); 337 break; 338 case SEI::BSP_INITIAL_ARRIVAL_TIME: 339 sei = new SEIBspInitialArrivalTime; 340 xParseSEIBspInitialArrivalTime((SEIBspInitialArrivalTime&) *sei, payloadSize, pDecodedMessageOutputStream ); 341 break; 342 #endif 343 case SEI::SUB_BITSTREAM_PROPERTY: 344 sei = new SEISubBitstreamProperty; 345 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream ); 346 break; 347 case SEI::ALPHA_CHANNEL_INFO: 348 sei = new SEIAlphaChannelInfo; 349 xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 350 break; 351 case SEI::OVERLAY_INFO: 352 sei = new SEIOverlayInfo; 353 xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 354 break; 355 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 356 sei = new SEITemporalMvPredictionConstraints; 357 xParseSEITemporalMvPredictionConstraints((SEITemporalMvPredictionConstraints&) *sei, payloadSize, pDecodedMessageOutputStream ); 358 break; 359 #if NH_MV_SEI_TBD 360 case SEI::FRAME_FIELD_INFO: 361 sei = new SEIFrameFieldInfo; 362 xParseSEIFrameFieldInfo((SEIFrameFieldInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 363 break; 364 #endif 365 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 366 sei = new SEIThreeDimensionalReferenceDisplaysInfo; 367 xParseSEIThreeDimensionalReferenceDisplaysInfo((SEIThreeDimensionalReferenceDisplaysInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 368 break; 369 #if SEI_DRI_F0169 370 case SEI::DEPTH_REPRESENTATION_INFO: 371 sei = new SEIDepthRepresentationInfo; 372 xParseSEIDepthRepresentationInfo((SEIDepthRepresentationInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 373 break; 374 #endif 375 case SEI::MULTIVIEW_SCENE_INFO: 376 sei = new SEIMultiviewSceneInfo; 377 xParseSEIMultiviewSceneInfo((SEIMultiviewSceneInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 378 break; 379 380 case SEI::MULTIVIEW_ACQUISITION_INFO: 381 sei = new SEIMultiviewAcquisitionInfo; 382 xParseSEIMultiviewAcquisitionInfo((SEIMultiviewAcquisitionInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 383 break; 384 385 case SEI::MULTIVIEW_VIEW_POSITION: 386 sei = new SEIMultiviewViewPosition; 387 xParseSEIMultiviewViewPosition((SEIMultiviewViewPosition&) *sei, payloadSize, pDecodedMessageOutputStream ); 388 break; 389 #if NH_3D 390 case SEI::ALTERNATIVE_DEPTH_INFO: 391 sei = new SEIAlternativeDepthInfo; 392 xParseSEIAlternativeDepthInfo((SEIAlternativeDepthInfo&) *sei, payloadSize, pDecodedMessageOutputStream ); 393 break; 394 #endif 284 395 #endif 285 396 default: … … 455 566 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 456 567 { 457 UInt val; 568 UInt val; 458 569 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 459 570 … … 805 916 } 806 917 918 #if NH_MV_LAYERS_NOT_PRESENT_SEI 919 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 920 #else 807 921 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 922 #endif 808 923 { 809 924 UInt uiCode; … … 847 962 do 848 963 { 964 #if NH_MV_LAYERS_NOT_PRESENT_SEI 965 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, pDecodedMessageOutputStream); 966 #else 849 967 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, pDecodedMessageOutputStream); 968 #endif 850 969 } while (m_pcBitstream->getNumBitsLeft() > 8); 851 970 … … 857 976 858 977 #if NH_MV 978 #if !NH_MV_SEI 859 979 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 860 980 { … … 872 992 sei_read_code( pDecodedMessageOutputStream, 16, code, "avg_bit_rate[i]" ); sei.m_avgBitRate[i] = code; 873 993 sei_read_code( pDecodedMessageOutputStream, 16, code, "max_bit_rate[i]" ); sei.m_maxBitRate[i] = code; 874 } 994 } 875 995 } 876 996 … … 883 1003 sei.m_maxBitRate.resize( sei.m_numAdditionalSubStreams ); 884 1004 } 1005 #endif 885 1006 #endif 886 1007 … … 1101 1222 } 1102 1223 1224 #if NH_MV_LAYERS_NOT_PRESENT_SEI 1225 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 1226 { 1227 UInt code; 1228 1229 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1230 sei_read_code( pDecodedMessageOutputStream, 4, code, "lnp_sei_active_vps_id" ); sei.m_lnpSeiActiveVpsId = code; 1231 assert(vps->getVPSId() == sei.m_lnpSeiActiveVpsId); 1232 1233 sei.m_lnpSeiMaxLayers = vps->getMaxLayersMinus1() + 1; 1234 sei.resizeDimI(sei.m_lnpSeiMaxLayers); 1235 for (Int i = 0; i < sei.m_lnpSeiMaxLayers; i++) 1236 { 1237 sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" ); 1238 sei.m_layerNotPresentFlag[i] = (code == 1); 1239 } 1240 }; 1241 #endif 1242 1243 Void SEIReader::xParseSEIInterLayerConstrainedTileSets(SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1244 { 1245 UInt code; 1246 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1247 1248 sei_read_flag( pDecodedMessageOutputStream, code, "il_all_tiles_exact_sample_value_match_flag" ); sei.m_ilAllTilesExactSampleValueMatchFlag = (code == 1); 1249 sei_read_flag( pDecodedMessageOutputStream, code, "il_one_tile_per_tile_set_flag" ); sei.m_ilOneTilePerTileSetFlag = (code == 1); 1250 if( !sei.m_ilOneTilePerTileSetFlag ) 1251 { 1252 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_sets_in_message_minus1" ); sei.m_ilNumSetsInMessageMinus1 = code; 1253 if( sei.m_ilNumSetsInMessageMinus1 ) 1254 { 1255 sei_read_flag( pDecodedMessageOutputStream, code, "skipped_tile_set_present_flag" ); sei.m_skippedTileSetPresentFlag = (code == 1); 1256 } 1257 Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1; 1258 1259 sei.resizeDimI( numSignificantSets ); 1260 for( Int i = 0; i < numSignificantSets; i++ ) 1261 { 1262 sei_read_uvlc( pDecodedMessageOutputStream, code, "ilcts_id" ); sei.m_ilctsId [i] = code; 1263 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_tile_rects_in_set_minus1" ); sei.m_ilNumTileRectsInSetMinus1[i] = code; 1264 1265 sei.resizeDimJ( i, sei.m_ilNumTileRectsInSetMinus1[ i ] + 1 ); 1266 for( Int j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ ) 1267 { 1268 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_top_left_tile_index" ); sei.m_ilTopLeftTileIndex [i][j] = code; 1269 sei_read_uvlc( pDecodedMessageOutputStream, code, "il_bottom_right_tile_index" ); sei.m_ilBottomRightTileIndex[i][j] = code; 1270 } 1271 sei_read_code( pDecodedMessageOutputStream, 2, code, "ilc_idc" ); sei.m_ilcIdc[i] = code; 1272 if ( !sei.m_ilAllTilesExactSampleValueMatchFlag ) 1273 { 1274 sei_read_flag( pDecodedMessageOutputStream, code, "il_exact_sample_value_match_flag" ); sei.m_ilExactSampleValueMatchFlag[i] = (code == 1); 1275 } 1276 } 1277 } 1278 else 1279 { 1280 sei_read_code( pDecodedMessageOutputStream, 2, code, "all_tiles_ilc_idc" ); sei.m_allTilesIlcIdc = code; 1281 } 1282 }; 1283 1284 #if NH_MV_SEI_TBD 1285 Void SEIReader::xParseSEIBspNesting(SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1286 { 1287 UInt code; 1288 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1289 1290 sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_ols_idx" ); sei.m_seiOlsIdx = code; 1291 sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_partitioning_scheme_idx" ); sei.m_seiPartitioningSchemeIdx = code; 1292 sei_read_uvlc( pDecodedMessageOutputStream, code, "bsp_idx" ); sei.m_bspIdx = code; 1293 while( !ByteaLigned(() ) ); 1294 { 1295 sei_read_code( pDecodedMessageOutputStream, *equalto0*/u1, code, "bsp_nesting_zero_bit" ); sei.m_bspNestingZeroBit = code; 1296 } 1297 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_seis_in_bsp_minus1" ); sei.m_numSeisInBspMinus1 = code; 1298 for( Int i = 0; i <= NumSeisInBspMinus1( ); i++ ) 1299 { 1300 SeiMessage(() ); 1301 } 1302 }; 1303 1304 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1305 { 1306 UInt code; 1307 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1308 1309 psIdx = SeiPartitioningSchemeIdx(); 1310 if( nalInitialArrivalDelayPresent ) 1311 { 1312 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 1313 { 1314 sei_read_code( pDecodedMessageOutputStream, getNalInitialArrivalDelayLen ), code, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = code; 1315 } 1316 } 1317 if( vclInitialArrivalDelayPresent ) 1318 { 1319 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 1320 { 1321 sei_read_code( pDecodedMessageOutputStream, getVclInitialArrivalDelayLen ), code, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = code; 1322 } 1323 } 1324 }; 1325 #endif 1326 1327 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1328 { 1329 UInt code; 1330 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1331 1332 sei_read_code( pDecodedMessageOutputStream, 4, code, "sb_property_active_vps_id" ); sei.m_sbPropertyActiveVpsId = code; 1333 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_additional_sub_streams_minus1" ); sei.m_numAdditionalSubStreamsMinus1 = code; 1334 sei.resizeArrays( ); 1335 for( Int i = 0; i <= sei.m_numAdditionalSubStreamsMinus1; i++ ) 1336 { 1337 sei_read_code( pDecodedMessageOutputStream, 2, code, "sub_bitstream_mode" ); sei.m_subBitstreamMode[i] = code; 1338 sei_read_uvlc( pDecodedMessageOutputStream, code, "ols_idx_to_vps" ); sei.m_olsIdxToVps[i] = code; 1339 sei_read_code( pDecodedMessageOutputStream, 3, code, "highest_sublayer_id" ); sei.m_highestSublayerId[i] = code; 1340 sei_read_code( pDecodedMessageOutputStream, 16, code, "avg_sb_property_bit_rate" ); sei.m_avgSbPropertyBitRate[i] = code; 1341 sei_read_code( pDecodedMessageOutputStream, 16, code, "max_sb_property_bit_rate" ); sei.m_maxSbPropertyBitRate[i] = code; 1342 } 1343 }; 1344 1345 Void SEIReader::xParseSEIAlphaChannelInfo(SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1346 { 1347 UInt code; 1348 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1349 1350 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_cancel_flag" ); sei.m_alphaChannelCancelFlag = (code == 1); 1351 if( !sei.m_alphaChannelCancelFlag ) 1352 { 1353 sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_use_idc" ); sei.m_alphaChannelUseIdc = code; 1354 sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_bit_depth_minus8" ); sei.m_alphaChannelBitDepthMinus8 = code; 1355 sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_transparent_value" ); sei.m_alphaTransparentValue = code; 1356 sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_opaque_value" ); sei.m_alphaOpaqueValue = code; 1357 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_incr_flag" ); sei.m_alphaChannelIncrFlag = (code == 1); 1358 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_flag" ); sei.m_alphaChannelClipFlag = (code == 1); 1359 if( sei.m_alphaChannelClipFlag ) 1360 { 1361 sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_type_flag" ); sei.m_alphaChannelClipTypeFlag = (code == 1); 1362 } 1363 } 1364 }; 1365 1366 Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1367 { 1368 UInt code; 1369 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1370 1371 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_cancel_flag" ); sei.m_overlayInfoCancelFlag = (code == 1); 1372 if( !sei.m_overlayInfoCancelFlag ) 1373 { 1374 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_content_aux_id_minus128" ); sei.m_overlayContentAuxIdMinus128 = code; 1375 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_label_aux_id_minus128" ); sei.m_overlayLabelAuxIdMinus128 = code; 1376 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_alpha_aux_id_minus128" ); sei.m_overlayAlphaAuxIdMinus128 = code; 1377 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_element_label_value_length_minus8" ); sei.m_overlayElementLabelValueLengthMinus8 = code; 1378 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlays_minus1" ); sei.m_numOverlaysMinus1 = code; 1379 1380 sei.m_overlayIdx.resize( sei.m_numOverlaysMinus1+1 ); 1381 sei.m_languageOverlayPresentFlag.resize( sei.m_numOverlaysMinus1+1 ); 1382 sei.m_overlayContentLayerId.resize ( sei.m_numOverlaysMinus1+1 ); 1383 sei.m_overlayLabelPresentFlag.resize ( sei.m_numOverlaysMinus1+1 ); 1384 sei.m_overlayLabelLayerId.resize ( sei.m_numOverlaysMinus1+1 ); 1385 sei.m_overlayAlphaPresentFlag.resize ( sei.m_numOverlaysMinus1+1 ); 1386 sei.m_overlayAlphaLayerId.resize ( sei.m_numOverlaysMinus1+1 ); 1387 sei.m_numOverlayElementsMinus1.resize ( sei.m_numOverlaysMinus1+1 ); 1388 sei.m_overlayElementLabelMin.resize ( sei.m_numOverlaysMinus1+1 ); 1389 sei.m_overlayElementLabelMax.resize ( sei.m_numOverlaysMinus1+1 ); 1390 for( Int i = 0; i <= sei.m_numOverlaysMinus1; i++ ) 1391 { 1392 sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_idx" ); sei.m_overlayIdx[i] = code; 1393 sei_read_flag( pDecodedMessageOutputStream, code, "language_overlay_present_flag" ); sei.m_languageOverlayPresentFlag[i] = (code == 1); 1394 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_content_layer_id" ); sei.m_overlayContentLayerId[i] = code; 1395 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_label_present_flag" ); sei.m_overlayLabelPresentFlag[i] = (code == 1); 1396 if( sei.m_overlayLabelPresentFlag[i] ) 1397 { 1398 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_label_layer_id" ); sei.m_overlayLabelLayerId[i] = code; 1399 } 1400 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_alpha_present_flag" ); sei.m_overlayAlphaPresentFlag[i] = (code == 1); 1401 if( sei.m_overlayAlphaPresentFlag[i] ) 1402 { 1403 sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_alpha_layer_id" ); sei.m_overlayAlphaLayerId[i] = code; 1404 } 1405 if( sei.m_overlayLabelPresentFlag[i] ) 1406 { 1407 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlay_elements_minus1" ); sei.m_numOverlayElementsMinus1[i] = code; 1408 sei.m_overlayElementLabelMin[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1409 sei.m_overlayElementLabelMax[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1410 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1[i]; j++ ) 1411 { 1412 sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_min" ); sei.m_overlayElementLabelMin[i][j] = code; 1413 sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_max" ); sei.m_overlayElementLabelMax[i][j] = code; 1414 } 1415 } 1416 } 1417 1418 // byte alignment 1419 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1420 { 1421 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_zero_bit" ); 1422 assert( code==0 ); 1423 } 1424 1425 UChar* sval = new UChar[sei.m_numStringBytesMax]; 1426 UInt slen; 1427 sei.m_overlayLanguage .resize( sei.m_numOverlaysMinus1 + 1 ); 1428 sei.m_overlayName .resize( sei.m_numOverlaysMinus1 + 1 ); 1429 sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1 + 1 ); 1430 for( Int i = 0; i <= sei.m_numOverlaysMinus1; i++ ) 1431 { 1432 if( sei.m_languageOverlayPresentFlag[i] ) 1433 { 1434 sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_language"); 1435 sei.m_overlayLanguage[i] = std::string((const char*) sval); 1436 } 1437 sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_name"); 1438 sei.m_overlayName[i] = std::string((const char*) sval); 1439 if( sei.m_overlayLabelPresentFlag[i] ) 1440 { 1441 sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1442 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1[i]; j++ ) 1443 { 1444 sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_element_name"); 1445 sei.m_overlayElementName[i][j] = std::string((const char*) sval); 1446 } 1447 } 1448 } 1449 delete [] sval; 1450 sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = (code == 1); 1451 } 1452 }; 1453 1454 Void SEIReader::xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1455 { 1456 UInt code; 1457 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1458 1459 sei_read_flag( pDecodedMessageOutputStream, code, "prev_pics_not_used_flag" ); sei.m_prevPicsNotUsedFlag = (code == 1); 1460 sei_read_flag( pDecodedMessageOutputStream, code, "no_intra_layer_col_pic_flag" ); sei.m_noIntraLayerColPicFlag = (code == 1); 1461 }; 1462 1463 #if NH_MV_SEI_TBD 1464 Void SEIReader::xParseSEIFrameFieldInfo(SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1465 { 1466 UInt code; 1467 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1468 1469 sei_read_code( pDecodedMessageOutputStream, 4, code, "ffinfo_pic_struct" ); sei.m_ffinfoPicStruct = code; 1470 sei_read_code( pDecodedMessageOutputStream, 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfoSourceScanType = code; 1471 sei_read_flag( pDecodedMessageOutputStream, code, "ffinfo_duplicate_flag" ); sei.m_ffinfoDuplicateFlag = (code == 1); 1472 }; 1473 #endif 1474 1475 Void SEIReader::xParseSEIThreeDimensionalReferenceDisplaysInfo(SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1476 { 1477 UInt code; 1478 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1479 1480 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_display_width" ); sei.m_precRefDisplayWidth = code; 1481 sei_read_flag( pDecodedMessageOutputStream, code, "ref_viewing_distance_flag" ); sei.m_refViewingDistanceFlag = (code == 1); 1482 if( sei.m_refViewingDistanceFlag ) 1483 { 1484 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_viewing_dist" ); sei.m_precRefViewingDist = code; 1485 } 1486 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_ref_displays_minus1" ); sei.m_numRefDisplaysMinus1 = code; 1487 sei.resizeArrays( ); 1488 for( Int i = 0; i <= sei.getNumRefDisplaysMinus1( ); i++ ) 1489 { 1490 sei_read_uvlc( pDecodedMessageOutputStream, code, "left_view_id" ); sei.m_leftViewId[i] = code; 1491 sei_read_uvlc( pDecodedMessageOutputStream, code, "right_view_id" ); sei.m_rightViewId[i] = code; 1492 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_display_width" ); sei.m_exponentRefDisplayWidth[i] = code; 1493 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceDisplayWidthLen(i), code, "mantissa_ref_display_width" ); sei.m_mantissaRefDisplayWidth[i] = code ; 1494 if( sei.m_refViewingDistanceFlag ) 1495 { 1496 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_viewing_distance" ); sei.m_exponentRefViewingDistance[i] = code; 1497 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceViewingDistanceLen(i), code, "mantissa_ref_viewing_distance" ); sei.m_mantissaRefViewingDistance[i] = code; 1498 } 1499 sei_read_flag( pDecodedMessageOutputStream, code, "additional_shift_present_flag" ); sei.m_additionalShiftPresentFlag[i] = (code == 1); 1500 if( sei.m_additionalShiftPresentFlag[i] ) 1501 { 1502 sei_read_code( pDecodedMessageOutputStream, 10, code, "num_sample_shift_plus512" ); sei.m_numSampleShiftPlus512[i] = code; 1503 } 1504 } 1505 sei_read_flag( pDecodedMessageOutputStream, code, "three_dimensional_reference_displays_extension_flag" ); sei.m_threeDimensionalReferenceDisplaysExtensionFlag = (code == 1); 1506 }; 1507 1508 #if SEI_DRI_F0169 1509 Void SEIReader::xParseSEIDepthRepInfoElement(double& f,std::ostream *pDecodedMessageOutputStream) 1510 { 1511 UInt val; 1512 UInt x_sign,x_mantissa_len,x_mantissa; 1513 Int x_exp; 1514 1515 sei_read_flag(pDecodedMessageOutputStream, val,"da_sign_flag"); x_sign = val ? 1 : 0 ; 1516 sei_read_code(pDecodedMessageOutputStream, 7, val, "da_exponent" ); x_exp = val-31; 1517 sei_read_code(pDecodedMessageOutputStream, 5, val, "da_mantissa_len_minus1" ); x_mantissa_len = val+1; 1518 sei_read_code(pDecodedMessageOutputStream, x_mantissa_len, val, "da_mantissa" ); x_mantissa = val; 1519 if (x_mantissa_len>=16) 1520 { 1521 f =1.0 + (x_mantissa*1.0)/(1u<<(x_mantissa_len-16))/(256.0*256.0 ); 1522 }else 1523 { 1524 f =1.0 + (x_mantissa*1.0)/(1u<<x_mantissa_len); 1525 } 1526 double m=1.0; 1527 int i; 1528 if (x_exp<0) 1529 { 1530 for(i=0;i<-x_exp;i++) 1531 m = m * 2; 1532 1533 f = f/m; 1534 } 1535 else 1536 { 1537 for(i=0;i<x_exp;i++) 1538 m = m * 2; 1539 1540 f= f * m; 1541 } 1542 if (x_sign==1) 1543 { 1544 f= -f; 1545 } 1546 }; 1547 1548 Void SEIReader::xParseSEIDepthRepresentationInfo(SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1549 { 1550 UInt code; 1551 double zNear,zFar,dMin,dMax; 1552 bool zNearFlag,zFarFlag,dMinFlag,dMaxFlag; 1553 int depth_representation_type,disparityRefViewId,depthNonlinearRepresentationNumMinus1; 1554 std::vector<int> DepthNonlinearRepresentationModel; 1555 1556 sei.clear(); 1557 1558 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1559 1560 sei_read_flag( pDecodedMessageOutputStream, code, "z_near_flag" ); zNearFlag = (code == 1); 1561 sei_read_flag( pDecodedMessageOutputStream, code, "z_far_flag" ); zFarFlag = (code == 1); 1562 sei_read_flag( pDecodedMessageOutputStream, code, "d_min_flag" ); dMinFlag = (code == 1); 1563 sei_read_flag( pDecodedMessageOutputStream, code, "d_max_flag" ); dMaxFlag = (code == 1); 1564 sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_representation_type" ); depth_representation_type = code; 1565 1566 sei.m_zNearFlag.push_back(zNearFlag); 1567 sei.m_zFarFlag.push_back(zFarFlag); 1568 sei.m_dMinFlag.push_back(dMinFlag); 1569 sei.m_dMaxFlag.push_back(dMaxFlag); 1570 1571 sei.m_depthRepresentationType.push_back(IntAry1d(1,depth_representation_type)); 1572 1573 if( dMinFlag || dMaxFlag ) 1574 { 1575 sei_read_uvlc( pDecodedMessageOutputStream, code, "disparity_ref_view_id" ); disparityRefViewId = code; 1576 sei.m_disparityRefViewId.push_back(IntAry1d(1,disparityRefViewId)); 1577 } 1578 if( zNearFlag ) 1579 { 1580 xParseSEIDepthRepInfoElement(zNear , pDecodedMessageOutputStream); 1581 sei.m_zNear.push_back(std::vector<double>(1,zNear)); 1582 } 1583 if( zFarFlag ) 1584 { 1585 xParseSEIDepthRepInfoElement(zFar , pDecodedMessageOutputStream); 1586 sei.m_zFar.push_back(std::vector<double>(1,zFar)); 1587 } 1588 if( dMinFlag ) 1589 { 1590 xParseSEIDepthRepInfoElement(dMin , pDecodedMessageOutputStream); 1591 sei.m_dMin.push_back(std::vector<double>(1,dMin)); 1592 } 1593 if( dMaxFlag ) 1594 { 1595 xParseSEIDepthRepInfoElement(dMax , pDecodedMessageOutputStream); 1596 sei.m_dMax.push_back(std::vector<double>(1,dMax)); 1597 } 1598 if( depth_representation_type == 3 ) 1599 { 1600 sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_nonlinear_representation_num_minus1" ); depthNonlinearRepresentationNumMinus1 = code; 1601 sei.m_depthNonlinearRepresentationNumMinus1.push_back(IntAry1d(1,depthNonlinearRepresentationNumMinus1)); 1602 for( Int i = 1; i <= depthNonlinearRepresentationNumMinus1 + 1; i++ ) 1603 { 1604 sei_read_uvlc(pDecodedMessageOutputStream,code,"DepthNonlinearRepresentationModel" ) ; 1605 DepthNonlinearRepresentationModel.push_back(code); 1606 } 1607 1608 sei.m_depth_nonlinear_representation_model.push_back(DepthNonlinearRepresentationModel); 1609 } 1610 } 1611 #endif 1612 Void SEIReader::xParseSEIMultiviewSceneInfo(SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1613 { 1614 UInt code; 1615 Int sCode; 1616 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1617 1618 sei_read_svlc( pDecodedMessageOutputStream, sCode, "min_disparity" ) ; sei.m_minDisparity = sCode; 1619 sei_read_uvlc( pDecodedMessageOutputStream, code , "max_disparity_range" ); sei.m_maxDisparityRange = code; 1620 }; 1621 1622 Void SEIReader::xParseSEIMultiviewAcquisitionInfo(SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1623 { 1624 UInt code; 1625 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1626 1627 sei.resizeArrays( ); 1628 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_flag" ); sei.m_intrinsicParamFlag = (code == 1); 1629 sei_read_flag( pDecodedMessageOutputStream, code, "extrinsic_param_flag" ); sei.m_extrinsicParamFlag = (code == 1); 1630 if( sei.m_intrinsicParamFlag ) 1631 { 1632 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_params_equal_flag" ); sei.m_intrinsicParamsEqualFlag = (code == 1); 1633 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_focal_length" ); sei.m_precFocalLength = code ; 1634 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_principal_point" ); sei.m_precPrincipalPoint = code ; 1635 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_skew_factor" ); sei.m_precSkewFactor = code ; 1636 1637 for( Int i = 0; i <= ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ ) 1638 { 1639 sei_read_flag( pDecodedMessageOutputStream, code, "sign_focal_length_x" ); sei.m_signFocalLengthX [i] = (code == 1); 1640 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_focal_length_x" ); sei.m_exponentFocalLengthX [i] = code ; 1641 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthXLen ( i ), code, "mantissa_focal_length_x" ); sei.m_mantissaFocalLengthX [i] = code ; 1642 sei_read_flag( pDecodedMessageOutputStream, code, "sign_focal_length_y" ); sei.m_signFocalLengthY [i] = (code == 1); 1643 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_focal_length_y" ); sei.m_exponentFocalLengthY [i] = code ; 1644 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthYLen ( i ), code, "mantissa_focal_length_y" ); sei.m_mantissaFocalLengthY [i] = code ; 1645 sei_read_flag( pDecodedMessageOutputStream, code, "sign_principal_point_x" ); sei.m_signPrincipalPointX [i] = (code == 1); 1646 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_principal_point_x" ); sei.m_exponentPrincipalPointX[i] = code ; 1647 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointXLen( i ), code, "mantissa_principal_point_x" ); sei.m_mantissaPrincipalPointX[i] = code ; 1648 sei_read_flag( pDecodedMessageOutputStream, code, "sign_principal_point_y" ); sei.m_signPrincipalPointY [i] = (code == 1); 1649 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_principal_point_y" ); sei.m_exponentPrincipalPointY[i] = code ; 1650 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointYLen( i ), code, "mantissa_principal_point_y" ); sei.m_mantissaPrincipalPointY[i] = code ; 1651 sei_read_flag( pDecodedMessageOutputStream, code, "sign_skew_factor" ); sei.m_signSkewFactor [i] = (code == 1); 1652 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_skew_factor" ); sei.m_exponentSkewFactor [i] = code ; 1653 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaSkewFactorLen ( i ), code, "mantissa_skew_factor" ); sei.m_mantissaSkewFactor [i] = code ; 1654 } 1655 } 1656 if( sei.m_extrinsicParamFlag ) 1657 { 1658 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_rotation_param" ); sei.m_precRotationParam = code; 1659 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_translation_param" ); sei.m_precTranslationParam = code; 1660 1661 for( Int i = 0; i <= sei.getNumViewsMinus1(); i++ ) 1662 { 1663 for( Int j = 0; j <= 2; j++ ) /* row */ 1664 { 1665 for( Int k = 0; k <= 2; k++ ) /* column */ 1666 { 1667 sei_read_flag( pDecodedMessageOutputStream, code, "sign_r" ); sei.m_signR [i][j][k] = (code == 1); 1668 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_r" ); sei.m_exponentR[i][j][k] = code ; 1669 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaRLen( i, j, k ), code, "mantissa_r" ); sei.m_mantissaR[i][j][k] = code ; 1670 } 1671 sei_read_flag( pDecodedMessageOutputStream, code, "sign_t" ); sei.m_signT [i][j] = (code == 1); 1672 sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_t" ); sei.m_exponentT[i][j] = code ; 1673 sei_read_code( pDecodedMessageOutputStream, sei.getMantissaTLen( i, j ), code, "mantissa_t" ); sei.m_mantissaT[i][j] = code ; 1674 } 1675 } 1676 } 1677 }; 1678 1679 1680 1681 Void SEIReader::xParseSEIMultiviewViewPosition(SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1682 { 1683 UInt code; 1684 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1685 1686 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_views_minus1" ); sei.m_numViewsMinus1 = code; 1687 sei.m_viewPosition.resize( sei.m_numViewsMinus1 + 1 ); 1688 for( Int i = 0; i <= sei.m_numViewsMinus1; i++ ) 1689 { 1690 sei_read_uvlc( pDecodedMessageOutputStream, code, "view_position" ); sei.m_viewPosition[i] = code; 1691 } 1692 }; 1693 1694 #if NH_3D 1695 Void SEIReader::xParseSEIAlternativeDepthInfo(SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1696 { 1697 UInt code; 1698 Int scode; 1699 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1700 1701 sei.resizeArrays( ); 1702 sei_read_flag( pDecodedMessageOutputStream, code, "alternative_depth_info_cancel_flag" ); sei.m_alternativeDepthInfoCancelFlag = (code == 1); 1703 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1704 { 1705 sei_read_code( pDecodedMessageOutputStream, 2, code, "depth_type" ); sei.m_depthType = code; 1706 if( sei.m_depthType == 0 ) 1707 { 1708 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_constituent_views_gvd_minus1" ); sei.m_numConstituentViewsGvdMinus1 = code; 1709 sei_read_flag( pDecodedMessageOutputStream, code, "depth_present_gvd_flag" ); sei.m_depthPresentGvdFlag = (code == 1); 1710 sei_read_flag( pDecodedMessageOutputStream, code, "z_gvd_flag" ); sei.m_zGvdFlag = (code == 1); 1711 sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_gvd_flag" ); sei.m_intrinsicParamGvdFlag = (code == 1); 1712 sei_read_flag( pDecodedMessageOutputStream, code, "rotation_gvd_flag" ); sei.m_rotationGvdFlag = (code == 1); 1713 sei_read_flag( pDecodedMessageOutputStream, code, "translation_gvd_flag" ); sei.m_translationGvdFlag = (code == 1); 1714 if( sei.m_zGvdFlag ) 1715 { 1716 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1717 { 1718 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i][j] = (code == 1); 1719 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i][j] = code; 1720 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i][j] = code; 1721 sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZNearMinus1[i][j]+1, code, "man_gvd_z_near" ); sei.m_manGvdZNear[i][j] = code; 1722 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i][j] = (code == 1); 1723 sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i][j] = code; 1724 sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i][j] = code; 1725 sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZFarMinus1[i][j]+1, code, "man_gvd_z_far" ); sei.m_manGvdZFar[i][j] = code; 1726 } 1727 } 1728 if( sei.m_intrinsicParamGvdFlag ) 1729 { 1730 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_focal_length" ); sei.m_precGvdFocalLength = code; 1731 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_principal_point" ); sei.m_precGvdPrincipalPoint = code; 1732 } 1733 if( sei.m_rotationGvdFlag ) 1734 { 1735 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_rotation_param" ); sei.m_precGvdRotationParam = code; 1736 } 1737 if( sei.m_translationGvdFlag ) 1738 { 1739 sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_translation_param" ); sei.m_precGvdTranslationParam = code; 1740 } 1741 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1742 { 1743 if( sei.m_intrinsicParamGvdFlag ) 1744 { 1745 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i][j] = (code == 1); 1746 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i][j] = code; 1747 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthXLen(i,j), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code; 1748 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i][j] = (code == 1); 1749 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i][j] = code; 1750 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthYLen(i,j), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code; 1751 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i][j] = (code == 1); 1752 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i][j] = code; 1753 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointXLen(i,j), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code; 1754 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i][j] = (code == 1); 1755 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i][j] = code; 1756 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointYLen(i,j), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code; 1757 } 1758 if( sei.m_rotationGvdFlag ) 1759 { 1760 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r00" ); sei.m_signGvdR00[i][j] = (code == 1); 1761 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r00" ); sei.m_expGvdR00[i][j] = code; 1762 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r00" ); sei.m_manGvdR00[i][j] = code; 1763 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r01" ); sei.m_signGvdR01[i][j] = (code == 1); 1764 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r01" ); sei.m_expGvdR01[i][j] = code; 1765 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r01" ); sei.m_manGvdR01[i][j] = code; 1766 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r02" ); sei.m_signGvdR02[i][j] = (code == 1); 1767 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r02" ); sei.m_expGvdR02[i][j] = code; 1768 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r02" ); sei.m_manGvdR02[i][j] = code; 1769 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r10" ); sei.m_signGvdR10[i][j] = (code == 1); 1770 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r10" ); sei.m_expGvdR10[i][j] = code; 1771 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r10" ); sei.m_manGvdR10[i][j] = code; 1772 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r11" ); sei.m_signGvdR11[i][j] = (code == 1); 1773 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r11" ); sei.m_expGvdR11[i][j] = code; 1774 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r11" ); sei.m_manGvdR11[i][j] = code; 1775 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r12" ); sei.m_signGvdR12[i][j] = (code == 1); 1776 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r12" ); sei.m_expGvdR12[i][j] = code; 1777 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r12" ); sei.m_manGvdR12[i][j] = code; 1778 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r20" ); sei.m_signGvdR20[i][j] = (code == 1); 1779 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r20" ); sei.m_expGvdR20[i][j] = code; 1780 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r20" ); sei.m_manGvdR20[i][j] = code; 1781 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r21" ); sei.m_signGvdR21[i][j] = (code == 1); 1782 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r21" ); sei.m_expGvdR21[i][j] = code; 1783 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r21" ); sei.m_manGvdR21[i][j] = code; 1784 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r22" ); sei.m_signGvdR22[i][j] = (code == 1); 1785 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r22" ); sei.m_expGvdR22[i][j] = code; 1786 sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r22" ); sei.m_manGvdR22[i][j] = code; 1787 //sei_read_code( pDecodedMessageOutputStream, sei.getManGvdRLen(i,j,k), code, "man_gvd_r" ); sei.m_manGvdR[i][j] = code; 1788 } 1789 if( sei.m_translationGvdFlag ) 1790 { 1791 sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i][j] = (code == 1); 1792 sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i][j] = code; 1793 sei_read_code( pDecodedMessageOutputStream, sei.getManGvdTXLen(i,j), code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code; 1794 } 1795 } 1796 } 1797 1798 if( sei.m_depthType == 1 ) 1799 { 1800 sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_x_int" ); sei.m_minOffsetXInt = scode; 1801 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_x_frac" ); sei.m_minOffsetXFrac = code; 1802 sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_x_int" ); sei.m_maxOffsetXInt = scode; 1803 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_x_frac" ); sei.m_maxOffsetXFrac = code; 1804 sei_read_flag( pDecodedMessageOutputStream, code, "offset_y_present_flag" ); sei.m_offsetYPresentFlag = (code == 1); 1805 if( sei.m_offsetYPresentFlag ) 1806 { 1807 sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_y_int" ); sei.m_minOffsetYInt = scode; 1808 sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_y_frac" ); sei.m_minOffsetYFrac = code; 1809 sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_y_int" ); sei.m_maxOffsetYInt = scode; 1810 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_y_frac" ); sei.m_maxOffsetYFrac = code; 1811 } 1812 sei_read_flag( pDecodedMessageOutputStream, code, "warp_map_size_present_flag" ); sei.m_warpMapSizePresentFlag = (code == 1); 1813 if( sei.m_warpMapSizePresentFlag ) 1814 { 1815 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_width_minus2" ); sei.m_warpMapWidthMinus2 = code; 1816 sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_height_minus2" ); sei.m_warpMapHeightMinus2 = code; 1817 } 1818 } 1819 } 1820 }; 1821 #endif 1822 1103 1823 //! \} -
trunk/source/Lib/TLibDecoder/SEIread.h
r1313 r1356 56 56 SEIReader() {}; 57 57 virtual ~SEIReader() {}; 58 #if NH_MV_LAYERS_NOT_PRESENT_SEI 59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 60 #else 58 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 62 #endif 63 #if NH_MV_SEI 64 Void setLayerId ( Int layerId ) { m_layerId = layerId; }; 65 Void setDecOrder ( Int64 decOrder ) { m_decOrder = decOrder; }; 66 #endif 59 67 protected: 68 #if NH_MV_LAYERS_NOT_PRESENT_SEI 69 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 70 #else 60 71 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 72 #endif 61 73 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 62 74 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); … … 74 86 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 75 87 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 88 #if NH_MV_LAYERS_NOT_PRESENT_SEI 89 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 90 #else 76 91 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 92 #endif 77 93 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 78 94 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); … … 81 97 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 82 98 #if NH_MV 99 #if !NH_MV_SEI 83 100 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei , UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 84 101 Void xResizeSubBitstreamPropertySeiArrays (SEISubBitstreamProperty &sei); 102 #endif 103 #endif 104 #if NH_MV_LAYERS_NOT_PRESENT_SEI 105 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps ,std::ostream *pDecodedMessageOutputStream); 106 #endif 107 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 108 #if NH_MV_SEI_TBD 109 Void xParseSEIBspNesting (SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 110 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 111 #endif 112 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 113 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 114 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 115 Void xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 116 #if NH_MV_SEI_TBD 117 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 118 #endif 119 Void xParseSEIThreeDimensionalReferenceDisplaysInfo (SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 120 #if SEI_DRI_F0169 121 Void xParseSEIDepthRepInfoElement (double &f,std::ostream *pDecodedMessageOutputStream); 122 Void xParseSEIDepthRepresentationInfo (SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 123 #endif 124 Void xParseSEIMultiviewSceneInfo (SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 125 126 Void xParseSEIMultiviewAcquisitionInfo (SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 127 128 #if NH_MV_SEI 129 Void xParseSEIMultiviewViewPosition (SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 130 #endif 131 #if NH_3D 132 Void xParseSEIAlternativeDepthInfo (SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 85 133 #endif 86 134 … … 89 137 Void sei_read_svlc(std::ostream *pOS, Int& ruiCode, const Char *pSymbolName); 90 138 Void sei_read_flag(std::ostream *pOS, UInt& ruiCode, const Char *pSymbolName); 139 Void sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName); 140 #if NH_MV_SEI 141 inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize); 142 private: 143 Int m_layerId; 144 Int64 m_decOrder; 145 #endif 91 146 }; 92 147 -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r1313 r1356 152 152 } 153 153 154 Void SyntaxElementParser::xReadStringTr (UInt buSize, UChar *pValue, UInt& rLength, const Char *pSymbolName) 155 { 156 #if RExt__DECODER_DEBUG_BIT_STATISTICS 157 xReadString (buSize, pValue, rLength, pSymbolName); 158 #else 159 xReadString(buSize, pValue, rLength); 160 #endif 161 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 162 fprintf( g_hTrace, "%-50s st(v=%d) : %s\n", pSymbolName, rLength, pValue ); 163 fflush ( g_hTrace ); 164 } 165 154 166 Void xTraceAccessUnitDelimiter () 155 167 { … … 269 281 } 270 282 283 #if RExt__DECODER_DEBUG_BIT_STATISTICS 284 Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength, const Char *pSymbolName) 285 #else 286 Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength) 287 #endif 288 { 289 assert( m_pcBitstream->getNumBitsRead() % 8 == 0 ); //always start reading at a byte-aligned position 290 UInt val; 291 UInt i; 292 for (i=0 ; i<bufSize ; ++i ) 293 { 294 m_pcBitstream->readByte( val ); 295 pVal[i] = val; 296 if ( val == 0) 297 { 298 break; 299 } 300 } 301 rLength = i; 302 assert( pVal[rLength] == 0 ); 303 } 304 271 305 Void SyntaxElementParser::xReadRbspTrailingBits() 272 306 { -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.h
r1313 r1356 49 49 #define READ_SVLC( code, name) xReadSvlcTr ( code, name ) 50 50 #define READ_FLAG( code, name) xReadFlagTr ( code, name ) 51 #define READ_STRING(bufSize, code, length, name) xReadStringTr ( bufSize, code, length, name ) 51 52 52 53 #else … … 58 59 #define READ_SVLC( code, name) xReadSvlc ( code, name ) 59 60 #define READ_FLAG( code, name) xReadFlag ( code, name ) 61 #define READ_STRING(bufSize, code, length, name) xReadString ( bufSize, code, length, name ) 60 62 61 63 #else … … 65 67 #define READ_SVLC( code, name) xReadSvlc ( code ) 66 68 #define READ_FLAG( code, name) xReadFlag ( code ) 69 #define READ_STRING(bufSize, code, length, name) xReadString ( bufSize, code, length ) 67 70 68 71 #endif … … 92 95 Void xReadSvlc ( Int& val, const Char *pSymbolName ); 93 96 Void xReadFlag ( UInt& val, const Char *pSymbolName ); 97 Void xReadString ( UInt bufSize, UChar *val, UInt& length, const Char *pSymbolName); 94 98 #else 95 99 Void xReadCode ( UInt length, UInt& val ); … … 97 101 Void xReadSvlc ( Int& val ); 98 102 Void xReadFlag ( UInt& val ); 103 Void xReadString ( UInt bufSize, UChar *val, UInt& length); 99 104 #endif 100 105 #if ENC_DEC_TRACE … … 103 108 Void xReadSvlcTr ( Int& rValue, const Char *pSymbolName); 104 109 Void xReadFlagTr ( UInt& rValue, const Char *pSymbolName); 110 Void xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName); 105 111 #endif 106 112 public: -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r1321 r1356 59 59 m_iLog2Precision = LOG2_DISP_PREC_LUT; 60 60 m_uiBitDepthForLUT = 8; // fixed 61 m_receivedIdc = NULL; 62 m_vps = NULL; 61 m_receivedIdc = NULL; 62 m_vps = NULL; 63 63 } 64 64 … … 75 75 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 76 76 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 77 xDeleteArray( m_receivedIdc, m_vps->getNumViews() ); 77 if ( m_receivedIdc != NULL ) 78 { 79 xDeleteArray( m_receivedIdc, m_vps->getNumViews() ); 80 } 78 81 } 79 82 … … 84 87 assert( !isInitialized() ); // Only one initialization currently supported 85 88 m_bInitialized = true; 86 m_vps = vps; 87 m_bCamParsVaryOverTime = false; 88 m_lastPoc = -1; 89 m_firstReceivedPoc = -2; 89 m_vps = vps; 90 m_bCamParsVaryOverTime = false; 91 m_lastPoc = -1; 92 m_firstReceivedPoc = -2; 90 93 91 94 for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++) 92 95 { 93 Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 94 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps ); 95 } 96 97 assert( m_receivedIdc == NULL ); 98 m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 96 Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 97 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps ); 98 } 99 100 assert( m_receivedIdc == NULL ); 101 m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 99 102 for (Int i = 0; i < m_vps->getNumViews(); i++) 100 103 { 101 m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 102 } 103 104 xResetReceivedIdc( true ); 104 m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 105 } 106 107 xResetReceivedIdc( true ); 105 108 106 109 for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ ) 107 110 { 108 if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 111 if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 109 112 { 110 113 for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ ) 111 { 114 { 112 115 if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) ) 113 116 { 114 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = -1; 117 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = -1; 115 118 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale (voiInVps) [ baseVoiInVps ]; 116 119 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset (voiInVps) [ baseVoiInVps ]; 117 120 118 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = -1; 121 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = -1; 119 122 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ]; 120 123 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ]; … … 131 134 { 132 135 for (Int i = 0; i < m_vps->getNumViews(); i++) 133 { 136 { 134 137 for (Int j = 0; j < m_vps->getNumViews(); j++) 135 138 { 136 139 if ( overWriteFlag || ( m_receivedIdc[i][j] != -1 ) ) 137 140 { 138 m_receivedIdc[i][j] = 0; 139 } 141 m_receivedIdc[i][j] = 0; 142 } 140 143 } 141 144 } … … 171 174 } 172 175 173 Void 176 Void 174 177 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 175 178 { … … 234 237 if( m_firstReceivedPoc == -2 ) 235 238 { 236 m_firstReceivedPoc = curPoc; 237 } 238 239 Bool newPocFlag = ( m_lastPoc != curPoc ); 239 m_firstReceivedPoc = curPoc; 240 } 241 242 Bool newPocFlag = ( m_lastPoc != curPoc ); 240 243 241 244 if ( newPocFlag ) 242 { 245 { 243 246 if( m_lastPoc != -1 ) 244 247 { … … 246 249 } 247 250 248 xResetReceivedIdc( false ); 251 xResetReceivedIdc( false ); 249 252 m_lastPoc = pcSlice->getPOC(); 250 253 } 251 254 252 UInt voiInVps = m_vps->getVoiInVps(pcSlice->getViewIndex()); 255 UInt voiInVps = m_vps->getVoiInVps(pcSlice->getViewIndex()); 253 256 if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here 254 { 257 { 255 258 for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ ) 256 { 259 { 257 260 if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) ) 258 261 { 259 262 if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 ) 260 { 263 { 261 264 AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] ); 262 265 AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] ); 263 266 } 264 267 else 265 { 266 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = 1; 268 { 269 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = 1; 267 270 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedScale () [ baseVoiInVps ]; 268 271 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedOffset() [ baseVoiInVps ]; … … 270 273 } 271 274 if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 ) 272 { 275 { 273 276 AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale () [ baseVoiInVps ] ); 274 277 AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset () [ baseVoiInVps ] ); 275 278 } 276 279 else 277 { 278 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = 1; 280 { 281 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = 1; 279 282 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedScale () [ baseVoiInVps ]; 280 283 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedOffset () [ baseVoiInVps ]; … … 283 286 } 284 287 } 285 } 288 } 286 289 } 287 290 … … 295 298 fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx ViewIdVal\n" ); 296 299 fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" ); 297 300 298 301 for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ ) 299 302 { … … 315 318 { 316 319 if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 ) 317 { 320 { 318 321 fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n", 319 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 320 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 322 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 323 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 321 324 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() ); 322 } 325 } 323 326 } 324 327 } … … 334 337 #if !NH_MV 335 338 , m_associatedIRAPType(NAL_UNIT_INVALID) 336 , m_pocCRA(0) 339 , m_pocCRA(0) 337 340 , m_pocRandomAccess(MAX_INT) 338 341 , m_cListPic() … … 426 429 fclose( g_hTrace ); 427 430 } 428 #endif 431 #endif 429 432 #endif 430 433 while (!m_prefixSEINALUs.empty()) … … 465 468 #endif 466 469 #if NH_MV 467 m_cCavlcDecoder.setDecTop( this ); 470 m_cCavlcDecoder.setDecTop( this ); 468 471 #endif 469 472 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); … … 653 656 #if NH_MV 654 657 const TComVPS* vps = m_parameterSetManager.getVPS(sps->getVPSId()); 655 assert (vps != 0); 656 // TBD: check the condition on m_firstPicInLayerDecodedFlag 658 assert (vps != 0); 659 // TBD: check the condition on m_firstPicInLayerDecodedFlag 657 660 if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP() || !m_firstPicInLayerDecodedFlag[m_layerId] , m_layerId ) ) 658 661 #else … … 671 674 { 672 675 //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0. 673 assert( sps->getUpdateRepFormatFlag() == false ); 674 } 675 sps->checkRpsMaxNumPics( vps, getLayerId() ); 676 677 // It is a requirement of bitstream conformance that, when the SPS is referred to by 678 // any current picture that belongs to an independent non-base layer, the value of 676 assert( sps->getUpdateRepFormatFlag() == false ); 677 } 678 sps->checkRpsMaxNumPics( vps, getLayerId() ); 679 680 // It is a requirement of bitstream conformance that, when the SPS is referred to by 681 // any current picture that belongs to an independent non-base layer, the value of 679 682 // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0. 680 683 681 684 if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 ) 682 { 683 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 684 } 685 } 685 { 686 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 687 } 688 } 689 #if NH_MV_SEI 690 m_seiReader.setLayerId ( newPic->getLayerId ( ) ); 691 m_seiReader.setDecOrder( newPic->getDecodingOrder( ) ); 692 #endif 686 693 #endif 687 694 … … 707 714 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 708 715 #else 709 m_pcPic = newPic; 716 m_pcPic = newPic; 710 717 #endif 711 718 … … 723 730 #if NH_MV 724 731 pSlice->setPic( m_pcPic ); 725 vps=pSlice->getVPS(); 732 vps=pSlice->getVPS(); 726 733 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 727 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) ); 734 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) ); 728 735 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 729 736 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) ); … … 775 782 { 776 783 #if NH_MV 777 assert( m_pcPic != NULL ); 778 assert( newPic == NULL ); 784 assert( m_pcPic != NULL ); 785 assert( newPic == NULL ); 779 786 #endif 780 787 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice … … 832 839 InputNALUnit &nalu=*m_prefixSEINALUs.front(); 833 840 #if NH_MV 841 #if NH_MV_LAYERS_NOT_PRESENT_SEI 842 m_seiReader.parseSEImessage(&(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream); 843 #else 834 844 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 845 #endif 835 846 #else 836 847 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); … … 855 866 m_cEntropyDecoder.setBitstream (&(nalu.getBitstream())); 856 867 857 assert( nalu.m_nuhLayerId == m_layerId ); 868 assert( nalu.m_nuhLayerId == m_layerId ); 858 869 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 859 870 // it is not associated with picture, sps or pps structures. 860 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 861 m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot ); 871 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 872 m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot ); 862 873 if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() ) 863 874 { 864 #endif 875 #endif 865 876 m_uiSliceIdx = 0; 866 877 } … … 908 919 if (m_apcSlicePilot->getRapPicFlag()) 909 920 { 910 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 921 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 911 922 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 912 923 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) … … 924 935 else 925 936 { 926 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 937 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 927 938 } 928 939 … … 950 961 } 951 962 } 952 963 953 964 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 954 965 { … … 1044 1055 { 1045 1056 //Check Multiview Main profile constraint in G.11.1.1 1046 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1047 // for the layer with nuh_layer_id equal to i in subBitstream, 1048 // inter_view_mv_vert_constraint_flag shall be equal to 1 1057 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1058 // for the layer with nuh_layer_id equal to i in subBitstream, 1059 // inter_view_mv_vert_constraint_flag shall be equal to 1 1049 1060 // in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer. 1050 1061 if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN 1051 1062 && 1052 pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 1063 pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 1053 1064 ) 1054 1065 { … … 1061 1072 m_pcPic->setViewIndex( getViewIndex() ); 1062 1073 m_pcPic->setIsDepth ( getIsDepth () ); 1063 pcSlice->setIvPicLists( m_dpb ); 1064 #endif 1065 #endif 1066 1074 pcSlice->setIvPicLists( m_dpb ); 1075 #endif 1076 #endif 1077 1067 1078 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1068 1079 // Now, having set up the maps, convert them to the correct form. … … 1097 1108 else 1098 1109 { 1099 assert( false ); 1110 assert( false ); 1100 1111 } 1101 1112 } … … 1104 1115 #endif 1105 1116 #if NH_3D_ARP 1106 pcSlice->setPocsInCurrRPSs(); 1117 pcSlice->setPocsInCurrRPSs(); 1107 1118 pcSlice->setARPStepNum(m_dpb); 1108 #endif 1119 #endif 1109 1120 #endif 1110 1121 … … 1191 1202 if ( decProcAnnexI() ) 1192 1203 { 1193 pcSlice->checkInCompPredRefLayers(); 1204 pcSlice->checkInCompPredRefLayers(); 1194 1205 } 1195 1206 #endif … … 1230 1241 TComSPS* sps = new TComSPS(); 1231 1242 #if NH_MV 1232 sps->setLayerId( getLayerId() ); 1243 sps->setLayerId( getLayerId() ); 1233 1244 #endif 1234 1245 #if O0043_BEST_EFFORT_DECODING … … 1246 1257 TComPPS* pps = new TComPPS(); 1247 1258 #if NH_MV 1248 pps->setLayerId( getLayerId() ); 1259 pps->setLayerId( getLayerId() ); 1249 1260 #endif 1250 1261 #if NH_3D_DLT … … 1304 1315 { 1305 1316 #if NH_MV 1306 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 1317 #if NH_MV_LAYERS_NOT_PRESENT_SEI 1318 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream); 1319 #else 1320 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 1321 #endif 1307 1322 #else 1308 1323 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); … … 1332 1347 case NAL_UNIT_CODED_SLICE_RASL_R: 1333 1348 #if NH_MV 1334 assert( false ); 1335 return 1; 1349 assert( false ); 1350 return 1; 1336 1351 #else 1337 1352 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1506 1521 { 1507 1522 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1508 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1523 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1509 1524 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1510 1525 … … 1513 1528 TComSlice* slice = m_apcSlicePilot; 1514 1529 const Int nuhLayerId = slice->getLayerId(); 1515 const TComVPS* vps = slice->getVPS(); 1516 const TComSPS* sps = slice->getSPS(); 1517 1518 Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 1530 const TComVPS* vps = slice->getVPS(); 1531 const TComSPS* sps = slice->getSPS(); 1532 1533 Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 1519 1534 1520 1535 if ( isFstPicOfAllLayOfPocResetPer ) 1521 1536 { 1522 // When the current picture is the first picture among all layers of a POC resetting period, 1537 // When the current picture is the first picture among all layers of a POC resetting period, 1523 1538 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1524 pocDecrementedInDpbFlag = false; 1539 pocDecrementedInDpbFlag = false; 1525 1540 } 1526 1541 1527 1542 // The variable pocResettingFlag is derived as follows: 1528 Bool pocResettingFlag; 1543 Bool pocResettingFlag; 1529 1544 if ( isPocResettingPicture ) 1530 1545 { 1531 //- If the current picture is a POC resetting picture, the following applies: 1546 //- If the current picture is a POC resetting picture, the following applies: 1532 1547 if( vps->getVpsPocLsbAlignedFlag() ) 1533 1548 { 1534 1549 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1535 pocResettingFlag = true; 1550 pocResettingFlag = true; 1536 1551 } 1537 1552 else if ( pocDecrementedInDpbFlag ) 1538 1553 { 1539 1554 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1540 pocResettingFlag = false; 1555 pocResettingFlag = false; 1541 1556 } 1542 1557 else 1543 1558 { 1544 1559 // - Otherwise, pocResettingFlag is set equal to 1. 1545 pocResettingFlag = true; 1560 pocResettingFlag = true; 1546 1561 } 1547 1562 } … … 1549 1564 { 1550 1565 // - Otherwise, pocResettingFlag is set equal to 0. 1551 pocResettingFlag = false; 1552 } 1553 1554 Int picOrderCntMsb; 1555 Int picOrderCntVal; 1566 pocResettingFlag = false; 1567 } 1568 1569 Int picOrderCntMsb; 1570 Int picOrderCntVal; 1556 1571 1557 1572 // Depending on pocResettingFlag, the following applies: … … 1561 1576 if( slice->getPocResetIdc() == 1 ) 1562 1577 { 1563 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 1564 } 1565 else if (slice->getPocResetIdc() == 2 ) 1566 { 1567 picOrderCntVal = 0; 1578 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 1579 } 1580 else if (slice->getPocResetIdc() == 2 ) 1581 { 1582 picOrderCntVal = 0; 1568 1583 } 1569 1584 else 1570 1585 { 1571 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 1572 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1586 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 1587 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1573 1588 } 1574 1589 } … … 1580 1595 if( slice->getPocMsbCycleValPresentFlag() ) 1581 1596 { 1582 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 1597 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 1583 1598 } 1584 1599 else if( !firstPicInLayerDecodedFlag || … … 1586 1601 { 1587 1602 picOrderCntMsb = 0; // (F 62) 1588 } 1603 } 1589 1604 else 1590 1605 { 1591 1606 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 1592 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 1593 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 1594 } 1595 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1596 } 1607 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 1608 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 1609 } 1610 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1611 } 1597 1612 return picOrderCntVal; 1598 1613 } … … 1607 1622 if ( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] != MIN_INT ) 1608 1623 { 1609 // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 1610 // of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 1624 // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 1625 // of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 1611 1626 // poc_reset_period_id of picA. 1612 1627 1613 m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 1628 m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 1614 1629 } 1615 1630 else 1616 1631 { 1617 1632 //- Otherwise, the value of poc_reset_period_id is inferred to be equal to 0. 1618 m_apcSlicePilot->setPocResetPeriodId( 0 ); 1633 m_apcSlicePilot->setPocResetPeriodId( 0 ); 1619 1634 } 1620 1635 } 1621 1636 else 1622 1637 { 1623 m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 1638 m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 1624 1639 } 1625 1640 } … … 1627 1642 1628 1643 Void TDecTop::decodePocAndRps( ) 1629 { 1644 { 1630 1645 assert( m_uiSliceIdx == 0 ); 1631 1646 Int nuhLayerId = m_pcPic->getLayerId(); … … 1634 1649 // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0 1635 1650 1636 // Variables and functions relating to picture order count are derived as 1637 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1651 // Variables and functions relating to picture order count are derived as 1652 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1638 1653 // segment of a picture. 1639 1654 x831DecProcForPicOrderCount( ); 1640 1655 1641 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1642 // pictures may be marked as "unused for reference" or "used for long-term 1643 // reference". This needs to be invoked only for the first slice segment of a 1656 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1657 // pictures may be marked as "unused for reference" or "used for long-term 1658 // reference". This needs to be invoked only for the first slice segment of a 1644 1659 // picture. 1645 1660 x832DecProcForRefPicSet ( false ); … … 1654 1669 // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3 1655 1670 1656 // Variables and functions relating to picture order count are derived as 1657 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1671 // Variables and functions relating to picture order count are derived as 1672 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1658 1673 // segment of a picture. 1659 1674 xF831DecProcForPicOrderCount( ); 1660 1675 1661 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1662 // pictures may be marked as "unused for reference" or "used for long-term 1663 // reference". This needs to be invoked only for the first slice segment of a 1676 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1677 // pictures may be marked as "unused for reference" or "used for long-term 1678 // reference". This needs to be invoked only for the first slice segment of a 1664 1679 // picture. 1665 1680 xF832DecProcForRefPicSet( ); … … 1670 1685 // nuh_layer_id greater than 0 1671 1686 1672 // Variables and functions relating to picture order count are derived in clause F.8.3.1. 1673 // This needs to be invoked only for the first slice segment of a picture. It is a requirement 1674 // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 1687 // Variables and functions relating to picture order count are derived in clause F.8.3.1. 1688 // This needs to be invoked only for the first slice segment of a picture. It is a requirement 1689 // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 1675 1690 // same value during and at the end of decoding of the access unit 1676 1691 xF831DecProcForPicOrderCount( ); 1677 1692 1678 // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 1679 // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 1680 // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 1693 // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 1694 // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 1695 // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 1681 1696 // This needs to be invoked only for the first slice segment of a picture. 1682 1697 xF832DecProcForRefPicSet( ); … … 1685 1700 else 1686 1701 { 1687 assert( false ); 1702 assert( false ); 1688 1703 } 1689 1704 } 1690 1705 1691 1706 Void TDecTop::genUnavailableRefPics( ) 1692 { 1707 { 1693 1708 assert( m_uiSliceIdx == 0 ); 1694 1709 Int nuhLayerId = m_pcPic->getLayerId(); … … 1699 1714 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1700 1715 { 1701 // When the current picture is a BLA picture or is a CRA picture 1702 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1703 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1716 // When the current picture is a BLA picture or is a CRA picture 1717 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1718 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1704 1719 // which needs to be invoked only for the first slice segment of a picture. 1705 x8331GenDecProcForGenUnavilRefPics(); 1720 x8331GenDecProcForGenUnavilRefPics(); 1706 1721 } 1707 1722 } … … 1717 1732 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1718 1733 { 1719 // When the current picture is a BLA picture or is a CRA picture 1720 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1721 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1734 // When the current picture is a BLA picture or is a CRA picture 1735 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1736 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1722 1737 // which needs to be invoked only for the first slice segment of a picture. 1723 xF833DecProcForGenUnavRefPics(); 1738 xF833DecProcForGenUnavRefPics(); 1724 1739 } 1725 1740 #if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1726 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 1741 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 1727 1742 decRps->m_numActiveRefLayerPics0 = 0; 1728 decRps->m_numActiveRefLayerPics1 = 0; 1743 decRps->m_numActiveRefLayerPics1 = 0; 1729 1744 #endif 1730 1745 } … … 1736 1751 if ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] ) 1737 1752 { 1738 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 1739 // unavailable reference pictures for pictures first in decoding order within a layer specified in 1753 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 1754 // unavailable reference pictures for pictures first in decoding order within a layer specified in 1740 1755 // clause F.8.1.7 is invoked, which needs to be invoked only for the first slice segment of a picture. 1741 1756 xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay(); … … 1744 1759 if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && ( m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1745 1760 { 1746 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 1747 // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 1748 // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 1761 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 1762 // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 1763 // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 1749 1764 // segment of a picture. 1750 xF833DecProcForGenUnavRefPics(); 1765 xF833DecProcForGenUnavRefPics(); 1751 1766 } 1752 1767 … … 1760 1775 else 1761 1776 { 1762 assert( false ); 1763 } 1764 1765 xCheckUnavailableRefPics(); 1777 assert( false ); 1778 } 1779 1780 xCheckUnavailableRefPics(); 1766 1781 } 1767 1782 Void TDecTop::executeLoopFilters( ) 1768 1783 { 1769 assert( m_pcPic != NULL ); 1784 assert( m_pcPic != NULL ); 1770 1785 if ( !m_pcPic->getHasGeneratedRefPics() && !m_pcPic->getIsGenerated() ) 1771 1786 { … … 1779 1794 if( m_pcPic->isIrap() ) 1780 1795 { 1781 m_prevIrapPoc = m_pcPic->getPOC(); 1782 m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 1796 m_prevIrapPoc = m_pcPic->getPOC(); 1797 m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 1783 1798 } 1784 1799 if( m_pcPic->isStsa() ) … … 1791 1806 1792 1807 Void TDecTop::initFromActiveVps( const TComVPS* vps ) 1793 { 1794 setViewId ( vps->getViewId ( getLayerId() ) ); 1808 { 1809 setViewId ( vps->getViewId ( getLayerId() ) ); 1795 1810 #if NH_3D 1796 setViewIndex( vps->getViewIndex( getLayerId() ) ); 1797 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 ); 1811 setViewIndex( vps->getViewIndex( getLayerId() ) ); 1812 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 ); 1798 1813 #endif 1799 1814 1800 1815 if ( !vps->getVpsExtensionFlag() ) 1801 1816 { 1802 m_decodingProcess = CLAUSE_8; 1817 m_decodingProcess = CLAUSE_8; 1803 1818 m_isInOwnTargetDecLayerIdList = ( getLayerId() == 0 ); 1804 1819 } 1805 1820 else 1806 { 1821 { 1807 1822 if ( m_targetOlsIdx == -1 ) 1808 1823 { 1809 // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1810 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1811 } 1812 1813 Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1824 // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1825 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1826 } 1827 1828 Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1814 1829 1815 1830 if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && vps->getVpsBaseLayerInternalFlag() ) 1816 1831 { 1817 m_smallestLayerId = 0; 1832 m_smallestLayerId = 0; 1818 1833 } 1819 1834 else if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && !vps->getVpsBaseLayerInternalFlag() ) 1820 1835 { 1821 m_smallestLayerId = 0; 1836 m_smallestLayerId = 0; 1822 1837 } 1823 1838 else if ( targetDecLayerSetIdx > vps->getVpsNumLayerSetsMinus1() && vps->getNumLayersInIdList( targetDecLayerSetIdx) == 1 ) 1824 1839 { 1825 1826 // m_smallestLayerId = 0; 1827 // For now don't do change of layer id here. 1828 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1840 1841 // m_smallestLayerId = 0; 1842 // For now don't do change of layer id here. 1843 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1829 1844 } 1830 1845 else 1831 1846 { 1832 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1847 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1833 1848 } 1834 1849 … … 1836 1851 // Set profile 1837 1852 Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1838 Int lIdx = -1; 1853 Int lIdx = -1; 1839 1854 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ) ; j++ ) 1840 1855 { 1841 1856 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 1842 { 1843 lIdx = j; 1844 break; 1845 } 1846 } 1847 m_isInOwnTargetDecLayerIdList = (lIdx != -1); 1857 { 1858 lIdx = j; 1859 break; 1860 } 1861 } 1862 m_isInOwnTargetDecLayerIdList = (lIdx != -1); 1848 1863 1849 1864 if ( m_isInOwnTargetDecLayerIdList ) 1850 1865 { 1851 1866 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1852 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1867 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1853 1868 1854 1869 if ( profileIdc == 6 ) … … 1881 1896 1882 1897 // Output of this process is PicOrderCntVal, the picture order count of the current picture. 1883 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1898 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1884 1899 // motion vector prediction, and for decoder conformance checking (see clause C.5). 1885 1900 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1886 1901 1887 const TComSlice* curSlice = m_pcPic->getSlice(0); 1888 1889 Int prevPicOrderCntLsb = MIN_INT; 1890 Int prevPicOrderCntMsb = MIN_INT; 1891 if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1892 { 1893 // When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 1902 const TComSlice* curSlice = m_pcPic->getSlice(0); 1903 1904 Int prevPicOrderCntLsb = MIN_INT; 1905 Int prevPicOrderCntMsb = MIN_INT; 1906 if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1907 { 1908 // When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 1894 1909 // the variables prevPicOrderCntLsb and prevPicOrderCntMsb are derived as follows: 1895 1910 1896 // - Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 1911 // - Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 1897 1912 // a RADL picture or an SLNR picture. 1898 1913 1899 1914 // - The variable prevPicOrderCntLsb is set equal to slice_pic_order_cnt_lsb of prevTid0Pic. 1900 prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 1915 prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 1901 1916 1902 1917 // - The variable prevPicOrderCntMsb is set equal to PicOrderCntMsb of prevTid0Pic. 1903 prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 1904 } 1905 1906 // The variable PicOrderCntMsb of the current picture is derived as follows: 1907 1918 prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 1919 } 1920 1921 // The variable PicOrderCntMsb of the current picture is derived as follows: 1922 1908 1923 Int slicePicOrderCntLsb = curSlice->getSlicePicOrderCntLsb(); 1909 1924 1910 Int picOrderCntMsb; 1925 Int picOrderCntMsb; 1911 1926 1912 1927 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 1913 1928 { 1914 1929 //- If the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, PicOrderCntMsb is set equal to 0. 1915 picOrderCntMsb = 0; 1930 picOrderCntMsb = 0; 1916 1931 } 1917 1932 else 1918 1933 { 1919 Int maxPicOrderCntLsb = curSlice->getSPS()->getMaxPicOrderCntLsb(); 1934 Int maxPicOrderCntLsb = curSlice->getSPS()->getMaxPicOrderCntLsb(); 1920 1935 1921 1936 // - Otherwise, PicOrderCntMsb is derived as follows: … … 1933 1948 else 1934 1949 { 1935 picOrderCntMsb = prevPicOrderCntMsb; 1936 } 1937 } 1938 1950 picOrderCntMsb = prevPicOrderCntMsb; 1951 } 1952 } 1953 1939 1954 //PicOrderCntVal is derived as follows: 1940 1955 Int picOrderCntVal = picOrderCntMsb + slicePicOrderCntLsb; // (8 2) 1941 1956 1942 // NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 1957 // NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 1943 1958 // pictures and prevPicOrderCntLsb and prevPicOrderCntMsb are both set equal to 0. 1944 1959 1945 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 1960 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 1946 1961 1947 1962 // Update prevTid0Pic … … 1949 1964 if( curSlice->getTemporalId() == 0 && !m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() ) 1950 1965 { 1951 m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb; 1952 m_prevTid0PicPicOrderCntMsb = picOrderCntMsb; 1966 m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb; 1967 m_prevTid0PicPicOrderCntMsb = picOrderCntMsb; 1953 1968 } 1954 1969 } … … 1957 1972 { 1958 1973 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1959 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1974 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1960 1975 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1961 1976 1962 1977 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1963 1978 1964 const TComSlice* slice = m_pcPic->getSlice(0); 1965 const Int nuhLayerId = m_pcPic->getLayerId(); 1966 const TComVPS* vps = slice->getVPS(); 1967 const TComSPS* sps = slice->getSPS(); 1979 const TComSlice* slice = m_pcPic->getSlice(0); 1980 const Int nuhLayerId = m_pcPic->getLayerId(); 1981 const TComVPS* vps = slice->getVPS(); 1982 const TComSPS* sps = slice->getSPS(); 1968 1983 if ( m_pcPic->getIsFstPicOfAllLayOfPocResetPer() ) 1969 1984 { 1970 // When the current picture is the first picture among all layers of a POC resetting period, 1985 // When the current picture is the first picture among all layers of a POC resetting period, 1971 1986 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1972 1987 for (Int i = 0; i <= 62; i++) 1973 1988 { 1974 m_pocDecrementedInDpbFlag[ i ] = 0; 1989 m_pocDecrementedInDpbFlag[ i ] = 0; 1975 1990 } 1976 1991 } 1977 1992 1978 1993 // The variable pocResettingFlag is derived as follows: 1979 Bool pocResettingFlag; 1994 Bool pocResettingFlag; 1980 1995 if (m_pcPic->getIsPocResettingPic() ) 1981 1996 { 1982 //- If the current picture is a POC resetting picture, the following applies: 1997 //- If the current picture is a POC resetting picture, the following applies: 1983 1998 if( vps->getVpsPocLsbAlignedFlag() ) 1984 1999 { 1985 2000 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1986 pocResettingFlag = true; 2001 pocResettingFlag = true; 1987 2002 } 1988 2003 else if ( m_pocDecrementedInDpbFlag[ nuhLayerId ] ) 1989 2004 { 1990 2005 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1991 pocResettingFlag = false; 2006 pocResettingFlag = false; 1992 2007 } 1993 2008 else 1994 2009 { 1995 2010 // - Otherwise, pocResettingFlag is set equal to 1. 1996 pocResettingFlag = true; 2011 pocResettingFlag = true; 1997 2012 } 1998 2013 } … … 2000 2015 { 2001 2016 // - Otherwise, pocResettingFlag is set equal to 0. 2002 pocResettingFlag = false; 2017 pocResettingFlag = false; 2003 2018 } 2004 2019 2005 2020 // The list affectedLayerList is derived as follows: 2006 std::vector<Int> affectedLayerList; 2021 std::vector<Int> affectedLayerList; 2007 2022 if (! vps->getVpsPocLsbAlignedFlag() ) 2008 2023 { 2009 2024 //- If vps_poc_lsb_aligned_flag is equal to 0, affectedLayerList consists of the nuh_layer_id of the current picture. 2010 affectedLayerList.push_back( nuhLayerId ); 2025 affectedLayerList.push_back( nuhLayerId ); 2011 2026 } 2012 2027 else 2013 2028 { 2014 // - Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 2015 // equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 2029 // - Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 2030 // equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 2016 2031 // inclusive, where currNuhLayerId is the nuh_layer_id value of the current picture. 2017 affectedLayerList.push_back( nuhLayerId ); 2018 Int currNuhLayerId = nuhLayerId; 2032 affectedLayerList.push_back( nuhLayerId ); 2033 Int currNuhLayerId = nuhLayerId; 2019 2034 for (Int j = 0; j <= vps->getNumPredictedLayers( currNuhLayerId )-1; j++ ) 2020 2035 { … … 2022 2037 } 2023 2038 } 2024 2025 Int picOrderCntMsb; 2026 Int picOrderCntVal; 2039 2040 Int picOrderCntMsb; 2041 Int picOrderCntVal; 2027 2042 2028 2043 // Depending on pocResettingFlag, the following applies: … … 2033 2048 { 2034 2049 //- The variables pocMsbDelta, pocLsbDelta and DeltaPocVal are derived as follows: 2035 Int pocMsbDelta; 2036 Int pocLsbDelta; 2037 Int deltaPocVal; 2038 2039 { 2040 Int pocLsbVal; 2041 Int prevPicOrderCntLsb; 2042 Int prevPicOrderCntMsb; 2050 Int pocMsbDelta; 2051 Int pocLsbDelta; 2052 Int deltaPocVal; 2053 2054 { 2055 Int pocLsbVal; 2056 Int prevPicOrderCntLsb; 2057 Int prevPicOrderCntMsb; 2043 2058 2044 2059 if( slice->getPocResetIdc() == 3 ) 2045 2060 { 2046 pocLsbVal = slice->getPocLsbVal(); 2047 } 2061 pocLsbVal = slice->getPocLsbVal(); 2062 } 2048 2063 else 2049 2064 { 2050 pocLsbVal = slice->getSlicePicOrderCntLsb(); 2065 pocLsbVal = slice->getSlicePicOrderCntLsb(); 2051 2066 } 2052 2067 … … 2054 2069 { 2055 2070 pocMsbDelta = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); // (F 60) 2056 }2057 else2058 {2059 prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );2060 prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;2061 2062 pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );2063 }2064 2065 if( slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() ) )2066 {2067 pocLsbDelta = pocLsbVal;2068 2071 } 2069 2072 else 2070 2073 { 2071 pocLsbDelta = 0; 2074 prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2075 prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2076 2077 pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2072 2078 } 2073 deltaPocVal = pocMsbDelta + pocLsbDelta; 2074 } 2075 2076 //- The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 2079 2080 if( slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() ) ) 2081 { 2082 pocLsbDelta = pocLsbVal; 2083 } 2084 else 2085 { 2086 pocLsbDelta = 0; 2087 } 2088 deltaPocVal = pocMsbDelta + pocLsbDelta; 2089 } 2090 2091 //- The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 2077 2092 // and that is equal to any value in affectedLayerList is decremented by DeltaPocVal. 2078 2093 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) … … 2080 2095 if ( !m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] ) 2081 2096 { 2082 m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 2097 m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 2083 2098 } 2084 2099 } … … 2087 2102 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) 2088 2103 { 2089 m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 2090 } 2091 } 2104 m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 2105 } 2106 } 2092 2107 2093 2108 //- The PicOrderCntVal of the current picture is derived as follows: 2094 2109 if( slice->getPocResetIdc() == 1 ) 2095 2110 { 2096 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 2097 } 2098 else if (slice->getPocResetIdc() == 2 ) 2099 { 2100 picOrderCntVal = 0; 2111 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 2112 } 2113 else if (slice->getPocResetIdc() == 2 ) 2114 { 2115 picOrderCntVal = 0; 2101 2116 } 2102 2117 else 2103 2118 { 2104 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 2105 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2119 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 2120 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2106 2121 } 2107 2122 } … … 2110 2125 //- Otherwise (pocResettingFlag is equal to 0), the following applies: 2111 2126 //- The PicOrderCntVal of the current picture is derived as follows: 2112 2127 2113 2128 if( slice->getPocMsbCycleValPresentFlag() ) 2114 2129 { 2115 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 2130 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 2116 2131 } 2117 2132 else if( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] || … … 2119 2134 { 2120 2135 picOrderCntMsb = 0; // (F 62) 2121 } 2136 } 2122 2137 else 2123 2138 { 2124 2139 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2125 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2126 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2127 } 2128 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2129 } 2130 2131 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 2132 2140 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2141 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2142 } 2143 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2144 } 2145 2146 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 2147 2133 2148 for (Int lId = 0; lId < (Int) affectedLayerList.size(); lId++ ) 2134 { 2149 { 2135 2150 // The value of PrevPicOrderCnt[ lId ] for each of the lId values included in affectedLayerList is derived as follows: 2136 2151 2137 2152 if (!m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() && slice->getTemporalId() == 0 && !slice->getDiscardableFlag() ) 2138 2153 { 2139 //- If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 2154 //- If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 2140 2155 // has TemporalId equal to 0 and discardable_flag equal to 0, PrevPicOrderCnt[ lId ] is set equal to PicOrderCntVal. 2141 m_prevPicOrderCnt = picOrderCntVal; 2156 m_prevPicOrderCnt = picOrderCntVal; 2142 2157 } 2143 2158 else if ( slice->getPocResetIdc() == 3 && ( 2144 ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 2145 ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 2159 ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 2160 ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 2146 2161 ) ) 2147 2162 { … … 2149 2164 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0. 2150 2165 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is a POC resetting picture. 2151 m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 2166 m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 2152 2167 } 2153 2168 } … … 2156 2171 Int TDecTop::xGetCurrMsb( Int cl, Int pl, Int pm, Int ml ) 2157 2172 { 2158 Int currMsb; 2173 Int currMsb; 2159 2174 if ((pl - cl) >= (ml/ 2)) 2160 2175 { … … 2163 2178 else if ( (cl - pl) > (ml / 2)) 2164 2179 { 2165 currMsb = pm - ml; 2180 currMsb = pm - ml; 2166 2181 } 2167 2182 else 2168 2183 { 2169 currMsb = pm; 2170 } 2171 2172 return currMsb; 2173 } 2184 currMsb = pm; 2185 } 2186 2187 return currMsb; 2188 } 2174 2189 2175 2190 … … 2181 2196 /////////////////////////////////////////////////////////////////////////////////////// 2182 2197 2183 TComSlice* slice = m_pcPic->getSlice( 0 ); 2184 const TComSPS* sps = slice->getSPS(); 2185 // This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 2186 // to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 2187 // This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 2198 TComSlice* slice = m_pcPic->getSlice( 0 ); 2199 const TComSPS* sps = slice->getSPS(); 2200 // This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 2201 // to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 2202 // This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 2188 2203 // "used for long-term reference". 2189 2204 2190 2205 // The variable currPicLayerId is set equal to nuh_layer_id of the current picture. 2191 Int currPicLayerId = m_pcPic->getLayerId(); 2192 Int picOrderCntVal = m_pcPic->getPOC(); 2206 Int currPicLayerId = m_pcPic->getLayerId(); 2207 Int picOrderCntVal = m_pcPic->getPOC(); 2193 2208 2194 2209 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 2195 { 2196 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 2197 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 2210 { 2211 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 2212 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 2198 2213 // DPB (if any) are marked as "unused for reference". 2199 m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 2200 } 2201 // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 2214 m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 2215 } 2216 // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 2202 2217 // their PicOrderCntVal values or their slice_pic_order_cnt_lsb values. 2203 2218 2204 // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 2205 // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 2219 // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 2220 // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 2206 2221 // NumPocLtCurr and NumPocLtFoll number of elements, respectively. The five lists and the five variables are derived as follows: 2207 2208 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2222 2223 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2209 2224 2210 2225 std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore; … … 2214 2229 std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 2215 2230 2216 Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 2231 Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 2217 2232 Int& numPocStCurrAfter = decRps->m_numPocStCurrAfter; 2218 2233 Int& numPocStFoll = decRps->m_numPocStFoll; 2219 2234 Int& numPocLtCurr = decRps->m_numPocLtCurr; 2220 Int& numPocLtFoll = decRps->m_numPocLtFoll; 2221 2222 std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 2235 Int& numPocLtFoll = decRps->m_numPocLtFoll; 2236 2237 std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 2223 2238 2224 2239 if (m_pcPic->isIdr() ) 2225 2240 { 2226 // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 2227 // PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 2241 // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 2242 // PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 2228 2243 // NumPocStCurrAfter, NumPocStFoll, NumPocLtCurr and NumPocLtFoll are all set equal to 0. 2229 2244 … … 2233 2248 pocLtCurr .clear(); 2234 2249 pocLtFoll .clear(); 2235 numPocStCurrBefore = 0; 2236 numPocStCurrAfter = 0; 2237 numPocStFoll = 0; 2238 numPocLtCurr = 0; 2239 numPocLtFoll = 0; 2250 numPocStCurrBefore = 0; 2251 numPocStCurrAfter = 0; 2252 numPocStFoll = 0; 2253 numPocLtCurr = 0; 2254 numPocLtFoll = 0; 2240 2255 } 2241 2256 else … … 2244 2259 // - Otherwise, the following applies: 2245 2260 2246 Int j = 0; 2247 Int k = 0; 2261 Int j = 0; 2262 Int k = 0; 2248 2263 for( Int i = 0; i < stRps->getNumNegativePicsVar() ; i++ ) 2249 2264 { … … 2257 2272 } 2258 2273 } 2259 numPocStCurrBefore = j; 2260 2261 j = 0; 2274 numPocStCurrBefore = j; 2275 2276 j = 0; 2262 2277 for (Int i = 0; i < stRps->getNumPositivePicsVar(); i++ ) 2263 2278 { 2264 2279 if (stRps->getUsedByCurrPicS1Var( i ) ) 2265 2280 { 2266 pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 2281 pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 2267 2282 } 2268 2283 else … … 2275 2290 2276 2291 2277 j = 0; 2278 k = 0; 2292 j = 0; 2293 k = 0; 2279 2294 for( Int i = 0; i < slice->getNumLongTermSps( ) + slice->getNumLongTermPics(); i++ ) 2280 2295 { 2281 Int pocLt = slice->getPocLsbLtVar( i ); 2296 Int pocLt = slice->getPocLsbLtVar( i ); 2282 2297 if( slice->getDeltaPocMsbPresentFlag( i ) ) 2283 2298 { … … 2286 2301 } 2287 2302 2288 if( slice->getUsedByCurrPicLtVar(i)) 2303 if( slice->getUsedByCurrPicLtVar(i)) 2289 2304 { 2290 2305 pocLtCurr.push_back( pocLt ); 2291 currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 2292 } 2306 currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 2307 } 2293 2308 else 2294 2309 { 2295 2310 pocLtFoll.push_back( pocLt ); 2296 follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 2311 follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 2297 2312 } 2298 2313 } … … 2303 2318 assert(numPocStCurrAfter == pocStCurrAfter .size() ); 2304 2319 assert(numPocStCurrBefore == pocStCurrBefore .size() ); 2305 assert(numPocStFoll == pocStFoll .size() ); 2306 assert(numPocLtCurr == pocLtCurr .size() ); 2320 assert(numPocStFoll == pocStFoll .size() ); 2321 assert(numPocLtCurr == pocLtCurr .size() ); 2307 2322 assert(numPocLtFoll == pocLtFoll .size() ); 2308 2323 2309 2324 // where PicOrderCntVal is the picture order count of the current picture as specified in clause 8.3.1. 2310 2325 2311 // NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 2312 // indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 2313 // where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 2314 // in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 2326 // NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 2327 // indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 2328 // where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 2329 // in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 2315 2330 // the short-term RPS of the current picture is directly signalled in the slice header. 2316 2331 2317 2332 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2318 2333 { 2319 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 2334 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 2320 2335 // it is a requirement of bitstream conformance that the following conditions apply: 2321 2336 if ( currDeltaPocMsbPresentFlag[i] ) 2322 2337 { 2323 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2338 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2324 2339 // for which PocLtCurr[ i ] is equal to PocStCurrBefore[ j ]. 2325 2340 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2328 2343 } 2329 2344 2330 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2331 // for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 2345 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2346 // for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 2332 2347 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2333 2348 { … … 2335 2350 } 2336 2351 2337 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2352 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2338 2353 // for which PocLtCurr[ i ] is equal to PocStFoll[ j ]. 2339 2354 for (Int j = 0; j <= numPocStFoll - 1; j++ ) … … 2342 2357 } 2343 2358 2344 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2359 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2345 2360 // where j is not equal to i, for which PocLtCurr[ i ] is equal to PocLtCurr[ j ]. 2346 2361 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2347 2362 { 2348 2363 if ( i != j ) 2349 { 2364 { 2350 2365 assert(!( pocLtCurr[ i ] == pocLtCurr[ j ] ) ); 2351 2366 } … … 2356 2371 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2357 2372 { 2358 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 2373 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 2359 2374 // it is a requirement of bitstream conformance that the following conditions apply: 2360 2375 if ( follDeltaPocMsbPresentFlag[i] ) 2361 2376 { 2362 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2377 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2363 2378 // for which PocLtFoll[ i ] is equal to PocStCurrBefore[ j ]. 2364 2379 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2367 2382 } 2368 2383 2369 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2384 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2370 2385 // for which PocLtFoll[ i ] is equal to PocStCurrAfter[ j ]. 2371 2386 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) … … 2374 2389 } 2375 2390 2376 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2391 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2377 2392 // for which PocLtFoll[ i ] is equal to PocStFoll[ j ]. 2378 2393 for (Int j = 0; j <= numPocStFoll - 1; j++ ) … … 2381 2396 } 2382 2397 2383 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2398 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2384 2399 // where j is not equal to i, for which PocLtFoll[ i ] is equal to PocLtFoll[ j ]. 2385 2400 for (Int j = 0; j <= numPocLtFoll - 1; j++ ) … … 2391 2406 } 2392 2407 2393 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2408 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2394 2409 // for which PocLtFoll[ i ] is equal to PocLtCurr[ j ]. 2395 2410 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) … … 2400 2415 } 2401 2416 2402 Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 2417 Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 2403 2418 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2404 2419 { 2405 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 2420 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 2406 2421 // it is a requirement of bitstream conformance that the following conditions apply: 2407 2422 if ( currDeltaPocMsbPresentFlag[ i ] == 0 ) 2408 2423 { 2409 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2424 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2410 2425 // for which PocLtCurr[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2411 2426 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2442 2457 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2443 2458 { 2444 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 2459 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 2445 2460 // it is a requirement of bitstream conformance that the following conditions apply: 2446 2461 if ( follDeltaPocMsbPresentFlag[ i ] == 0 ) … … 2474 2489 { 2475 2490 assert(!( pocLtFoll[ i ] == ( pocLtFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2476 } 2491 } 2477 2492 } 2478 2493 … … 2487 2502 2488 2503 if ( !annexFModifications ) 2489 { 2490 // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 2504 { 2505 // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 2491 2506 2492 2507 // It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: … … 2494 2509 { 2495 2510 // - If the current picture is a BLA or CRA picture, the value of NumPicTotalCurr shall be equal to 0. 2496 assert( slice->getNumPicTotalCurr() == 0 ); 2511 assert( slice->getNumPicTotalCurr() == 0 ); 2497 2512 } 2498 2513 else 2499 2514 { 2500 // - Otherwise, 2515 // - Otherwise, 2501 2516 if ( slice->isInterP() || slice->isInterB() ) 2502 2517 { 2503 2518 // when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2504 assert( slice->getNumPicTotalCurr() != 0 ); 2505 } 2506 } 2507 } 2508 2509 // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 2510 // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 2519 assert( slice->getNumPicTotalCurr() != 0 ); 2520 } 2521 } 2522 } 2523 2524 // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 2525 // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 2511 2526 // referred to as the short-term RPS. RefPicSetLtCurr and RefPicSetLtFoll are collectively referred to as the long-term RPS. 2512 2527 … … 2516 2531 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr ; 2517 2532 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll ; 2518 2533 2519 2534 std::vector<TComPic*>** refPicSetsCurr = decRps->m_refPicSetsCurr ; 2520 2535 std::vector<TComPic*>** refPicSetsLt = decRps->m_refPicSetsLt ; 2521 2536 std::vector<TComPic*>** refPicSetsAll = decRps->m_refPicSetsAll ; 2522 // NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 2537 // NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 2523 2538 // used for inter prediction of the current picture and one or more pictures that follow the current picture in decoding order. 2524 // RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 2539 // RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 2525 2540 // picture but may be used in inter prediction for one or more pictures that follow the current picture in decoding order. 2526 2541 … … 2528 2543 // 1. The following applies: 2529 2544 2530 TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false ); 2545 TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false ); 2531 2546 assert( refPicSetLtCurr.empty() ); 2532 for( Int i = 0; i < numPocLtCurr; i++ ) 2533 { 2534 if( !currDeltaPocMsbPresentFlag[ i ] ) 2535 { 2536 refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) ); 2547 for( Int i = 0; i < numPocLtCurr; i++ ) 2548 { 2549 if( !currDeltaPocMsbPresentFlag[ i ] ) 2550 { 2551 refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) ); 2537 2552 } 2538 2553 else 2539 2554 { 2540 refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] )); 2541 } 2555 refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] )); 2556 } 2542 2557 } 2543 2558 … … 2551 2566 else 2552 2567 { 2553 refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] )); 2568 refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] )); 2554 2569 } 2555 2570 } 2556 2557 // 2. All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 2571 2572 // 2. All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 2558 2573 // to currPicLayerId are marked as "used for long-term reference". 2559 2574 for (Int i = 0; i < numPocLtCurr; i++) … … 2561 2576 if ( refPicSetLtCurr[i] != NULL ) 2562 2577 { 2563 refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 2564 } 2578 refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 2579 } 2565 2580 } 2566 2581 … … 2569 2584 if ( refPicSetLtFoll[i] != NULL ) 2570 2585 { 2571 refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 2572 } 2586 refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 2587 } 2573 2588 } 2574 2589 … … 2577 2592 for( Int i = 0; i < numPocStCurrBefore; i++ ) 2578 2593 { 2579 refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 2594 refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 2580 2595 } 2581 2596 … … 2583 2598 for( Int i = 0; i < numPocStCurrAfter; i++ ) 2584 2599 { 2585 refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 2600 refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 2586 2601 } 2587 2602 … … 2589 2604 for( Int i = 0; i < numPocStFoll; i++ ) 2590 2605 { 2591 refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 2592 } 2593 2594 // 4. All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 2606 refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 2607 } 2608 2609 // 4. All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 2595 2610 // RefPicSetStCurrAfter, or RefPicSetStFoll and have nuh_layer_id equal to currPicLayerId are marked as "unused for reference". 2596 TComSubDpb picsToMark = (*dpb); 2611 TComSubDpb picsToMark = (*dpb); 2597 2612 for (Int j = 0; j < 5; j++ ) 2598 2613 { 2599 picsToMark.removePics( *refPicSetsAll[j] ); 2600 } 2601 picsToMark.markAllAsUnusedForReference(); 2602 2603 // NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 2604 // the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 2605 // to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 2614 picsToMark.removePics( *refPicSetsAll[j] ); 2615 } 2616 picsToMark.markAllAsUnusedForReference(); 2617 2618 // NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 2619 // the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 2620 // to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 2606 2621 // RefPicSetStCurrBefore, RefPicSetStCurrAfter, or RefPicSetLtCurr that is equal to "no reference picture". 2607 2622 2608 2623 // NOTE 5 - A picture cannot be included in more than one of the five RPS lists. 2609 2624 2610 2625 2611 2626 // It is a requirement of bitstream conformance that the RPS is restricted as follows: 2612 2627 … … 2614 2629 #if NH_MV_FIX_NO_REF_PICS_CHECK 2615 2630 if ( !annexFModifications || m_firstPicInLayerDecodedFlag[ m_pcPic->getLayerId() ] ) 2616 { 2631 { 2617 2632 #endif 2618 2633 for (Int j = 0; j < 3; j++ ) 2619 2634 { 2620 // - There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 2635 // - There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 2621 2636 // for which one or more of the following are true: 2622 2637 2623 std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 2638 std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 2624 2639 for (Int i = 0; i < currSet->size(); i++) 2625 2640 { 2626 TComPic* pic = (*currSet)[i]; 2641 TComPic* pic = (*currSet)[i]; 2627 2642 2628 2643 // - The entry is equal to "no reference picture". 2629 assert( ! (pic == NULL ) ); 2644 assert( ! (pic == NULL ) ); 2630 2645 2631 2646 // - The entry is an SLNR picture and has TemporalId equal to that of the current picture. 2632 assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2647 assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2633 2648 2634 2649 // - The entry is a picture that has TemporalId greater than that of the current picture. 2635 assert( !( pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 2636 } 2650 assert( !( pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 2651 } 2637 2652 } 2638 2653 #if NH_MV_FIX_NO_REF_PICS_CHECK 2639 2654 } 2640 2655 #endif 2641 2642 // - There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 2643 // difference between the picture order count value of the current picture and the picture order count 2656 2657 // - There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 2658 // difference between the picture order count value of the current picture and the picture order count 2644 2659 // value of the entry is greater than or equal to 2^24. 2645 2660 for (Int j = 0; j < 2; j++ ) 2646 { 2647 std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 2661 { 2662 std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 2648 2663 for (Int i = 0; i < ltSet->size(); i++) 2649 2664 { 2650 TComPic* pic = (*ltSet)[i]; 2665 TComPic* pic = (*ltSet)[i]; 2651 2666 if( pic != NULL ) 2652 2667 { 2653 assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 2654 } 2655 } 2656 } 2657 2658 // - When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 2668 assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 2669 } 2670 } 2671 } 2672 2673 // - When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 2659 2674 // included in the RPS with TemporalId greater than or equal to the TemporalId of the current picture. 2660 2675 if (m_pcPic->isTsa() ) 2661 2676 { 2662 2677 for (Int j = 0; j < 5; j++ ) 2663 { 2664 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2678 { 2679 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2665 2680 for (Int i = 0; i < aSet->size(); i++) 2666 2681 { 2667 TComPic* pic = (*aSet)[i]; 2682 TComPic* pic = (*aSet)[i]; 2668 2683 if( pic != NULL ) 2669 2684 { 2670 assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 2685 assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 2671 2686 } 2672 2687 } … … 2674 2689 } 2675 2690 2676 // - When the current picture is a step-wise temporal sub-layer access (STSA) picture, 2691 // - When the current picture is a step-wise temporal sub-layer access (STSA) picture, 2677 2692 // there shall be no picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr that has 2678 2693 // TemporalId equal to that of the current picture. … … 2680 2695 { 2681 2696 for (Int j = 0; j < 3; j++ ) 2682 { 2683 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2697 { 2698 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2684 2699 for (Int i = 0; i < cSet->size(); i++) 2685 2700 { 2686 TComPic* pic = (*cSet)[i]; 2701 TComPic* pic = (*cSet)[i]; 2687 2702 if( pic != NULL ) 2688 2703 { 2689 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2704 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2690 2705 } 2691 2706 } … … 2700 2715 { 2701 2716 for (Int j = 0; j < 3; j++ ) 2702 { 2703 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2717 { 2718 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2704 2719 for (Int i = 0; i < cSet->size(); i++) 2705 2720 { 2706 TComPic* pic = (*cSet)[i]; 2721 TComPic* pic = (*cSet)[i]; 2707 2722 if( pic != NULL ) 2708 2723 { 2709 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder ) ); 2724 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder ) ); 2710 2725 } 2711 2726 } 2712 2727 } 2713 2728 } 2714 2729 2715 2730 // - When the current picture is a CRA picture, there shall be no picture included in the RPS that 2716 2731 // precedes, in output order or decoding order, any preceding IRAP picture in decoding order (when present). … … 2718 2733 { 2719 2734 for (Int j = 0; j < 5; j++ ) 2720 { 2721 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2735 { 2736 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2722 2737 for (Int i = 0; i < aSet->size(); i++) 2723 2738 { 2724 2739 // TBD check whether it sufficient to test only the last IRAP 2725 TComPic* pic = (*aSet)[i]; 2740 TComPic* pic = (*aSet)[i]; 2726 2741 if( pic != NULL ) 2727 { 2728 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2729 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2742 { 2743 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2744 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2730 2745 } 2731 2746 } 2732 2747 } 2733 2748 } 2734 2749 2735 2750 Bool isTrailingPicture = ( !m_pcPic->isIrap() ) && ( m_pcPic->getPOC() > m_prevIrapPoc ); 2736 2751 // - When the current picture is a trailing picture, there shall be no picture in RefPicSetStCurrBefore, … … 2740 2755 { 2741 2756 for (Int j = 0; j < 3; j++ ) 2742 { 2743 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2757 { 2758 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2744 2759 for (Int i = 0; i < cSet->size(); i++) 2745 2760 { 2746 TComPic* pic = (*cSet)[i]; 2761 TComPic* pic = (*cSet)[i]; 2747 2762 if( pic != NULL ) 2748 2763 { 2749 assert( ! (pic->getIsGeneratedCl833() ) ); 2764 assert( ! (pic->getIsGeneratedCl833() ) ); 2750 2765 } 2751 2766 } … … 2758 2773 { 2759 2774 for (Int j = 0; j < 5; j++ ) 2760 { 2761 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2775 { 2776 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2762 2777 for (Int i = 0; i < aSet->size(); i++) 2763 2778 { 2764 2779 // TBD check whether it sufficient to test only the last IRAP 2765 TComPic* pic = (*aSet)[i]; 2780 TComPic* pic = (*aSet)[i]; 2766 2781 if( pic != NULL ) 2767 { 2768 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2769 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2782 { 2783 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2784 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2770 2785 } 2771 2786 } … … 2778 2793 { 2779 2794 for (Int j = 0; j < 3; j++ ) 2780 { 2781 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2795 { 2796 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2782 2797 for (Int i = 0; i < cSet->size(); i++) 2783 { 2784 TComPic* pic = (*cSet)[i]; 2798 { 2799 TComPic* pic = (*cSet)[i]; 2785 2800 if( pic != NULL ) 2786 { 2801 { 2787 2802 // - A RASL picture 2788 assert( ! (pic->isRasl() ) ); 2789 // - A picture that was generated by the decoding process for generating unavailable reference pictures 2803 assert( ! (pic->isRasl() ) ); 2804 // - A picture that was generated by the decoding process for generating unavailable reference pictures 2790 2805 // as specified in clause 8.3.3 2791 assert( ! (pic->getIsGeneratedCl833() ) ); 2806 assert( ! (pic->getIsGeneratedCl833() ) ); 2792 2807 // - A picture that precedes the associated IRAP picture in decoding order 2793 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2808 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2794 2809 } 2795 2810 } 2796 2811 } 2797 2812 } 2798 2799 2813 2814 2800 2815 if ( sps->getTemporalIdNestingFlag() ) 2801 2816 { 2802 2817 // - When sps_temporal_id_nesting_flag is equal to 1, the following applies: 2803 2818 // - Let tIdA be the value of TemporalId of the current picture picA. 2804 TComPic* picA = m_pcPic; 2819 TComPic* picA = m_pcPic; 2805 2820 Int tIdA = picA->getTemporalId(); 2806 // - Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 2807 // RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 2821 // - Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 2822 // RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 2808 2823 // has TemporalId less than tIdB, follows picB in decoding order, and precedes picA in decoding order. 2809 2824 for (Int j = 0; j < 3; j++ ) 2810 { 2811 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2825 { 2826 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2812 2827 for (Int i = 0; i < cSet->size(); i++) 2813 2828 { 2814 TComPic* picB = (*cSet)[i]; 2829 TComPic* picB = (*cSet)[i]; 2815 2830 if( picB != NULL ) 2816 2831 { 2817 Int tIdB = picB->getTemporalId(); 2832 Int tIdB = picB->getTemporalId(); 2818 2833 2819 2834 if (tIdB <= tIdA) … … 2821 2836 for ( TComSubDpb::iterator itP = dpb->begin(); itP != dpb->end(); itP++ ) 2822 2837 { 2823 TComPic* picC = (*itP); 2824 assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder() ) ); 2838 TComPic* picC = (*itP); 2839 assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder() ) ); 2825 2840 } 2826 2841 } … … 2828 2843 } 2829 2844 } 2830 } 2845 } 2831 2846 } 2832 2847 … … 2839 2854 2840 2855 // The specifications in clause 8.3.2 apply with the following changes: 2841 // - The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 2856 // - The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 2842 2857 // clauses F.7.4.7.2, F.8.3.1, F.8.3.3 and F.8.3.4, respectively. 2843 2858 2844 x832DecProcForRefPicSet( true ); 2859 x832DecProcForRefPicSet( true ); 2845 2860 2846 2861 // - The following specifications are added: 2847 2862 if (m_pcPic->isIrap() && m_pcPic->getLayerId() == m_smallestLayerId ) 2848 2863 { 2849 // - When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 2850 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 2864 // - When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 2865 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 2851 2866 // as "unused for reference" when at least one of the following conditions is true: 2852 2867 … … 2860 2875 2861 2876 // - It is a requirement of bitstream conformance that the RPS is restricted as follows: 2862 // - When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2877 // - When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2863 2878 // or RefPicSetLtCurr. 2864 2879 … … 2867 2882 if ( m_pcPic->isCra() ) 2868 2883 { 2869 for (Int j = 0; j < 3; j++ ) 2870 { 2871 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2872 assert ( cSet->size() == 0 ); 2884 for (Int j = 0; j < 3; j++ ) 2885 { 2886 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2887 assert ( cSet->size() == 0 ); 2873 2888 } 2874 2889 } … … 2876 2891 // - The constraints specified in clause 8.3.2 on the value of NumPicTotalCurr are replaced with the following: 2877 2892 // - It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: 2878 Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 2879 Int currPicLayerId = m_pcPic->getLayerId(); 2880 const TComVPS* vps = m_pcPic->getSlice(0)->getVPS(); 2893 Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 2894 Int currPicLayerId = m_pcPic->getLayerId(); 2895 const TComVPS* vps = m_pcPic->getSlice(0)->getVPS(); 2881 2896 2882 2897 if ( ( m_pcPic->isBla() || m_pcPic->isCra() ) && ( (currPicLayerId == 0 ) || ( vps->getNumDirectRefLayers( currPicLayerId ) == 0 ) ) ) 2883 { 2884 assert( numPicTotalCurr == 0 ); 2885 // - If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 2898 { 2899 assert( numPicTotalCurr == 0 ); 2900 // - If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 2886 2901 // NumDirectRefLayers[ currPicLayerId ] is equal to 0, the value of NumPicTotalCurr shall be equal to 0. 2887 2902 } … … 2892 2907 { 2893 2908 // - Otherwise, when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2894 assert( numPicTotalCurr != 0 ); 2909 assert( numPicTotalCurr != 0 ); 2895 2910 } 2896 2911 } … … 2904 2919 //////////////////////////////////////////////////////////////////// 2905 2920 2906 // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 2921 // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 2907 2922 // and the variables NumActiveRefLayerPics0 and NumActiveRefLayerPics1. 2908 2923 2909 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2910 TComSlice* slice = m_pcPic->getSlice( 0 ); 2911 const TComVPS* vps = slice->getVPS(); 2924 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2925 TComSlice* slice = m_pcPic->getSlice( 0 ); 2926 const TComVPS* vps = slice->getVPS(); 2912 2927 2913 2928 Int& numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0; … … 2915 2930 2916 2931 std::vector<TComPic*>& refPicSetInterLayer0 = decRps->m_refPicSetInterLayer0; 2917 std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 2932 std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 2918 2933 2919 2934 // The variable currLayerId is set equal to nuh_layer_id of the current picture. 2920 Int currLayerId = getLayerId(); 2921 2922 // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 2935 Int currLayerId = getLayerId(); 2936 2937 // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 2923 2938 // are set equal to 0 and the following applies: 2924 2939 2925 refPicSetInterLayer0.clear(); 2926 refPicSetInterLayer1.clear(); 2927 2928 numActiveRefLayerPics0 = 0; 2929 numActiveRefLayerPics1 = 0; 2930 2931 Int viewIdCurrLayerId = vps->getViewId( currLayerId ); 2940 refPicSetInterLayer0.clear(); 2941 refPicSetInterLayer1.clear(); 2942 2943 numActiveRefLayerPics0 = 0; 2944 numActiveRefLayerPics1 = 0; 2945 2946 Int viewIdCurrLayerId = vps->getViewId( currLayerId ); 2932 2947 Int viewId0 = vps->getViewId( 0 ); 2933 2948 2934 for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ ) 2935 { 2936 Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 2949 for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ ) 2950 { 2951 Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 2937 2952 2938 2953 Bool refPicSet0Flag = … … 2944 2959 { 2945 2960 // there is a picture picX in the DPB that is in the same access unit as the current picture and has 2946 // nuh_layer_id equal to RefPicLayerId[ i ] 2961 // nuh_layer_id equal to RefPicLayerId[ i ] 2947 2962 2948 2963 if ( refPicSet0Flag ) … … 2960 2975 assert( ! picX->getSlice(0)->getDiscardableFlag() ); 2961 2976 2962 // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 2977 // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 2963 2978 // that is a RASL picture. 2964 2979 if ( m_pcPic->isRadl() ) … … 2992 3007 /////////////////////////////////////////////////////////////////////////////////////// 2993 3008 2994 // This process is invoked once per coded picture when the current picture is a 3009 // This process is invoked once per coded picture when the current picture is a 2995 3010 // BLA picture or is a CRA picture with NoRaslOutputFlag equal to 1. 2996 3011 2997 3012 assert( m_pcPic->isBla() || (m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ); 2998 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3013 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2999 3014 3000 3015 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3001 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3016 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3002 3017 3003 3018 const std::vector<Int>& pocStFoll = decRps->m_pocStFoll; … … 3005 3020 3006 3021 const Int numPocStFoll = decRps->m_numPocStFoll; 3007 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3022 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3008 3023 3009 3024 // When this process is invoked, the following applies: … … 3012 3027 if ( refPicSetStFoll[ i ] == NULL ) 3013 3028 { 3014 //- For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 3029 //- For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 3015 3030 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3016 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3031 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3017 3032 3018 3033 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. 3019 3034 genPic->getSlice(0)->setPOC( pocStFoll[ i ] ); 3020 3035 3021 //- The value of PicOutputFlag for the generated picture is set equal to 0. 3022 genPic->setPicOutputFlag( false ); 3036 //- The value of PicOutputFlag for the generated picture is set equal to 0. 3037 genPic->setPicOutputFlag( false ); 3023 3038 3024 3039 // - The generated picture is marked as "used for short-term reference". … … 3029 3044 3030 3045 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3031 genPic->setLayerId( m_pcPic-> getLayerId() ); 3046 genPic->setLayerId( m_pcPic-> getLayerId() ); 3032 3047 3033 3048 // Insert to DPB 3034 m_dpb->addNewPic( genPic ); 3049 m_dpb->addNewPic( genPic ); 3035 3050 } 3036 3051 } … … 3040 3055 if ( refPicSetLtFoll[ i ] == NULL ) 3041 3056 { 3042 //- For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 3057 //- For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 3043 3058 // "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3044 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3059 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3045 3060 3046 3061 //- The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. … … 3048 3063 3049 3064 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtFoll[ i ] & ( MaxPicOrderCntLsb - 1 ) ). 3050 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 3051 3052 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3053 genPic->setPicOutputFlag( false ); 3065 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 3066 3067 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3068 genPic->setPicOutputFlag( false ); 3054 3069 3055 3070 // - The generated picture is marked as "used for long-term reference". … … 3060 3075 3061 3076 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3062 genPic->setLayerId( m_pcPic-> getLayerId() ); 3077 genPic->setLayerId( m_pcPic-> getLayerId() ); 3063 3078 3064 3079 // Insert to DPB 3065 m_dpb->addNewPic( genPic ); 3080 m_dpb->addNewPic( genPic ); 3066 3081 } 3067 3082 } … … 3075 3090 /////////////////////////////////////////////////////////////////////////////////////// 3076 3091 3077 TComPic* genPic = new TComPic; 3078 genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 3079 genPic->setIsGenerated( true ); 3080 genPic->setIsGeneratedCl833( calledFromCl8331 ); 3092 TComPic* genPic = new TComPic; 3093 genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 3094 genPic->setIsGenerated( true ); 3095 genPic->setIsGeneratedCl833( calledFromCl8331 ); 3081 3096 return genPic; 3082 3097 } … … 3086 3101 { 3087 3102 /////////////////////////////////////////////////////////////////////////////////////// 3088 // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 3103 // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 3089 3104 // first in decoding order within a layer 3090 3105 /////////////////////////////////////////////////////////////////////////////////////// 3091 3106 3092 // This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0. 3107 // This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0. 3093 3108 assert( !m_firstPicInLayerDecodedFlag[ getLayerId() ] ); 3094 3109 3095 3110 3096 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3097 3098 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 3111 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3112 3113 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 3099 3114 std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 3100 3115 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3101 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 3102 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3116 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 3117 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3103 3118 3104 3119 … … 3109 3124 const std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 3110 3125 3111 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 3126 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 3112 3127 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 3113 3128 const Int numPocStFoll = decRps->m_numPocStFoll; 3114 3129 const Int numPocLtCurr = decRps->m_numPocLtCurr; 3115 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3116 3117 Int nuhLayerId = m_pcPic-> getLayerId(); 3130 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3131 3132 Int nuhLayerId = m_pcPic-> getLayerId(); 3118 3133 for ( Int i = 0 ; i <= numPocStCurrBefore - 1; i++ ) 3119 3134 { 3120 3135 if ( refPicSetStCurrBefore[ i ] == NULL ) 3121 3136 { 3122 //- For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 3137 //- For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 3123 3138 // equal to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3124 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3139 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3125 3140 3126 3141 //- The value of PicOrderCntVal for the generated picture is set equal to PocStCurrBefore[ i ]. … … 3128 3143 3129 3144 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3130 genPic->setPicOutputFlag( false ); 3145 genPic->setPicOutputFlag( false ); 3131 3146 3132 3147 // - The generated picture is marked as "used for short-term reference". … … 3137 3152 3138 3153 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3139 genPic->setLayerId( nuhLayerId ); 3154 genPic->setLayerId( nuhLayerId ); 3140 3155 3141 3156 // Insert to DPB 3142 m_dpb->addNewPic( genPic ); 3157 m_dpb->addNewPic( genPic ); 3143 3158 } 3144 3159 } … … 3148 3163 if ( refPicSetStCurrAfter[ i ] == NULL ) 3149 3164 { 3150 // - For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 3165 // - For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 3151 3166 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3152 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3167 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3153 3168 3154 3169 // - The value of PicOrderCntVal for the generated picture is set equal to PocStCurrAfter[ i ]. … … 3156 3171 3157 3172 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3158 genPic->setPicOutputFlag( false ); 3173 genPic->setPicOutputFlag( false ); 3159 3174 3160 3175 // - The generated picture is marked as "used for short-term reference". … … 3165 3180 3166 3181 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3167 genPic->setLayerId( nuhLayerId ); 3182 genPic->setLayerId( nuhLayerId ); 3168 3183 3169 3184 // Insert to DPB 3170 m_dpb->addNewPic( genPic ); 3185 m_dpb->addNewPic( genPic ); 3171 3186 3172 3187 } … … 3177 3192 if ( refPicSetStFoll[ i ] == NULL ) 3178 3193 { 3179 // - For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 3194 // - For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 3180 3195 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3181 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3196 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3182 3197 3183 3198 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. … … 3185 3200 3186 3201 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3187 genPic->setPicOutputFlag( false ); 3202 genPic->setPicOutputFlag( false ); 3188 3203 3189 3204 // - The generated picture is marked as "used for short-term reference". … … 3194 3209 3195 3210 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3196 genPic->setLayerId( nuhLayerId ); 3211 genPic->setLayerId( nuhLayerId ); 3197 3212 3198 3213 // Insert to DPB 3199 m_dpb->addNewPic( genPic ); 3200 } 3201 } 3202 3203 Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 3214 m_dpb->addNewPic( genPic ); 3215 } 3216 } 3217 3218 Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 3204 3219 for ( Int i = 0 ; i <= numPocLtCurr - 1; i++ ) 3205 3220 { 3206 3221 if ( refPicSetLtCurr[ i ] == NULL ) 3207 3222 { 3208 // - For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 3223 // - For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 3209 3224 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3210 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3225 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3211 3226 3212 3227 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtCurr[ i ]. 3213 3228 genPic->getSlice(0)->setPOC( pocLtCurr[ i ] ); 3214 3229 3215 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3230 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3216 3231 // MaxPicOrderCntLsb - 1 ) ). 3217 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3232 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3218 3233 3219 3234 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3220 genPic->setPicOutputFlag( false ); 3235 genPic->setPicOutputFlag( false ); 3221 3236 3222 3237 // - The generated picture is marked as "used for long-term reference". … … 3227 3242 3228 3243 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3229 genPic->setLayerId( nuhLayerId ); 3244 genPic->setLayerId( nuhLayerId ); 3230 3245 3231 3246 // Insert to DPB 3232 m_dpb->addNewPic( genPic ); 3247 m_dpb->addNewPic( genPic ); 3233 3248 } 3234 3249 } … … 3238 3253 if ( refPicSetLtFoll[ i ] == NULL ) 3239 3254 { 3240 // - For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 3255 // - For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 3241 3256 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3242 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3257 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3243 3258 3244 3259 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. 3245 3260 genPic->getSlice(0)->setPOC( pocLtFoll[ i ] ); 3246 3261 3247 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3262 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3248 3263 // MaxPicOrderCntLsb - 1 ) ). 3249 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3264 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3250 3265 3251 3266 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3252 genPic->setPicOutputFlag( false ); 3267 genPic->setPicOutputFlag( false ); 3253 3268 3254 3269 // - The generated picture is marked as "used for long-term reference". … … 3259 3274 3260 3275 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3261 genPic->setLayerId( nuhLayerId ); 3276 genPic->setLayerId( nuhLayerId ); 3262 3277 3263 3278 // Insert to DPB 3264 m_dpb->addNewPic( genPic ); 3279 m_dpb->addNewPic( genPic ); 3265 3280 } 3266 3281 } … … 3280 3295 std::vector<TComPic*>** refPicSetsCurr = m_pcPic->getDecodedRps()->m_refPicSetsCurr; 3281 3296 3282 Bool hasGeneratedRefPic = false; 3283 for (Int j = 0; j < 3; j++ ) 3284 { 3285 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 3297 Bool hasGeneratedRefPic = false; 3298 for (Int j = 0; j < 3; j++ ) 3299 { 3300 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 3286 3301 for (Int i = 0 ; i < cSet->size(); i++ ) 3287 3302 { … … 3289 3304 if ((*cSet)[i]->getIsGenerated() ) 3290 3305 { 3291 hasGeneratedRefPic = true; 3292 } 3293 } 3294 } 3295 m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 3306 hasGeneratedRefPic = true; 3307 } 3308 } 3309 } 3310 m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 3296 3311 } 3297 3312 -
trunk/source/Lib/TLibEncoder/SEIEncoder.cpp
r1313 r1356 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 //! \} -
trunk/source/Lib/TLibEncoder/SEIEncoder.h
r1313 r1356 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: -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r1313 r1356 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_LAYERS_NOT_PRESENT_SEI 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 case SEI::ALPHA_CHANNEL_INFO: 151 xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei)); 152 break; 153 case SEI::OVERLAY_INFO: 154 xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei)); 155 break; 156 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 157 xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei)); 158 break; 159 #if NH_MV_SEI_TBD 160 case SEI::FRAME_FIELD_INFO: 161 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 162 break; 163 #endif 164 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 165 xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei)); 166 break; 167 #if SEI_DRI_F0169 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_3D 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: … … 246 307 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 247 308 { 248 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 309 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 249 310 } 250 311 } … … 384 445 { 385 446 WRITE_FLAG( sei.m_arrangementCancelFlag, "segmented_rect_frame_packing_arrangement_cancel_flag" ); 386 if( sei.m_arrangementCancelFlag == 0 ) 447 if( sei.m_arrangementCancelFlag == 0 ) 387 448 { 388 449 WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" ); … … 553 614 { 554 615 //UInt code; 555 WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 616 WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 556 617 WRITE_FLAG((sei.m_each_tile_one_tile_set_flag ? 1 : 0), "each_tile_one_tile_set_flag" ); 557 618 … … 568 629 569 630 if(sei.m_limited_tile_set_display_flag) 570 { 571 WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 572 } 573 574 WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 575 631 { 632 WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 633 } 634 635 WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 636 576 637 for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++) 577 638 { 578 WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index"); 579 WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 639 WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index"); 640 WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 580 641 } 581 642 582 643 if(!sei.m_mc_all_tiles_exact_sample_value_match_flag) 583 644 { 584 WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 645 WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 585 646 } 586 647 … … 590 651 { 591 652 WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag"); 592 WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8, "mcts_level_idc"); 653 WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8, "mcts_level_idc"); 593 654 } 594 655 } … … 601 662 if(sei.m_max_mcs_tier_level_idc_present_flag) 602 663 { 603 WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 604 WRITE_CODE( sei.m_max_mcts_level_idc, 8, "max_mcts_level_idc"); 664 WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 665 WRITE_CODE( sei.m_max_mcts_level_idc, 8, "max_mcts_level_idc"); 605 666 } 606 667 } … … 702 763 userVerticalCoefficients[2][2] = 100; 703 764 userVerticalCoefficients[2][3] = -10; 704 765 705 766 Int const iNumHorizontalFilters = 1; 706 767 Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3}; … … 748 809 749 810 #if NH_MV 811 #if !NH_MV_SEI 750 812 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei) 751 813 { … … 765 827 } 766 828 #endif 829 #endif 767 830 768 831 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei) 769 832 { 770 833 WRITE_UVLC( sei.m_kneeId, "knee_function_id" ); 771 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 834 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 772 835 if ( !sei.m_kneeCancelFlag ) 773 836 { … … 800 863 WRITE_CODE( sei.values.whitePoint[0], 16, "white_point_x" ); 801 864 WRITE_CODE( sei.values.whitePoint[1], 16, "white_point_y" ); 802 865 803 866 WRITE_CODE( sei.values.maxLuminance, 32, "max_display_mastering_luminance" ); 804 867 WRITE_CODE( sei.values.minLuminance, 32, "min_display_mastering_luminance" ); … … 818 881 } 819 882 883 #if NH_MV_LAYERS_NOT_PRESENT_SEI 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 < sei.m_lnpSeiMaxLayers; 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 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, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" ); 988 WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "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 <= sei.m_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], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_min" ); 1029 WRITE_CODE( sei.m_overlayElementLabelMax[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_max" ); 1030 } 1031 } 1032 } 1033 1034 // byte alignment 1035 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 1036 { 1037 WRITE_FLAG( 0, "overlay_zero_bit" ); 1038 } 1039 1040 UChar* stmp; 1041 UInt ilength; 1042 for( Int i = 0; i <= sei.m_numOverlaysMinus1; i++ ) 1043 { 1044 if( sei.m_languageOverlayPresentFlag[i] ) 1045 { 1046 stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() ); 1047 ilength = (UInt) sei.m_overlayLanguage[i].size(); 1048 WRITE_STRING( stmp, ilength, "overlay_language" ); 1049 free(stmp); 1050 } 1051 stmp = (UChar*) strdup( sei.m_overlayName[i].c_str() ); 1052 ilength = (UInt) sei.m_overlayName[i].size(); 1053 WRITE_STRING( stmp, ilength, "overlay_name" ); 1054 free(stmp); 1055 if( sei.m_overlayLabelPresentFlag[i] ) 1056 { 1057 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1[i]; j++ ) 1058 { 1059 stmp = (UChar*) strdup( sei.m_overlayElementName[i][j].c_str() ); 1060 ilength = (UInt) sei.m_overlayElementName[i][j].size(); 1061 WRITE_STRING( stmp, ilength, "overlay_element_name" ); 1062 free(stmp); 1063 } 1064 } 1065 } 1066 WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" ); 1067 } 1068 }; 1069 1070 Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei) 1071 { 1072 WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag ? 1 : 0 ), "prev_pics_not_used_flag" ); 1073 WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" ); 1074 }; 1075 1076 #if NH_MV_SEI_TBD 1077 Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei) 1078 { 1079 WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" ); 1080 WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" ); 1081 WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" ); 1082 }; 1083 #endif 1084 1085 Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei) 1086 { 1087 WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" ); 1088 WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" ); 1089 if( sei.m_refViewingDistanceFlag ) 1090 { 1091 WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" ); 1092 } 1093 WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" ); 1094 for( Int i = 0; i <= sei.getNumRefDisplaysMinus1( ); i++ ) 1095 { 1096 WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" ); 1097 WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" ); 1098 WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" ); 1099 WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" ); 1100 if( sei.m_refViewingDistanceFlag ) 1101 { 1102 WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" ); 1103 WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" ); 1104 } 1105 WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" ); 1106 if( sei.m_additionalShiftPresentFlag[i] ) 1107 { 1108 WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" ); 1109 } 1110 } 1111 WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" ); 1112 }; 1113 1114 #if SEI_DRI_F0169 1115 Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei) 1116 { 1117 1118 assert(sei.m_currLayerID>=0); 1119 1120 WRITE_FLAG( ( sei.m_zNearFlag[sei.m_currLayerID] ? 1 : 0 ), "z_near_flag" ); 1121 WRITE_FLAG( ( sei.m_zFarFlag[sei.m_currLayerID] ? 1 : 0 ), "z_far_flag" ); 1122 WRITE_FLAG( ( sei.m_dMinFlag[sei.m_currLayerID] ? 1 : 0 ), "d_min_flag" ); 1123 WRITE_FLAG( ( sei.m_dMaxFlag[sei.m_currLayerID] ? 1 : 0 ), "d_max_flag" ); 1124 WRITE_UVLC( sei.m_depthRepresentationType[sei.m_currLayerID][0], "depth_representation_type" ); 1125 if( sei.m_dMinFlag[sei.m_currLayerID] || sei.m_dMaxFlag[sei.m_currLayerID] ) 1126 { 1127 WRITE_UVLC( sei.m_disparityRefViewId[sei.m_currLayerID][0], "disparity_ref_view_id" ); 1128 } 1129 if( sei.m_zNearFlag[sei.m_currLayerID] ) 1130 { 1131 xWriteSEIDepthRepInfoElement(sei.m_zNear[sei.m_currLayerID][0]); 1132 } 1133 if( sei.m_zFarFlag[sei.m_currLayerID] ) 1134 { 1135 xWriteSEIDepthRepInfoElement(sei.m_zFar[sei.m_currLayerID][0]); 1136 } 1137 if( sei.m_dMinFlag[sei.m_currLayerID] ) 1138 { 1139 xWriteSEIDepthRepInfoElement(sei.m_dMin[sei.m_currLayerID][0]); 1140 } 1141 if( sei.m_dMaxFlag[sei.m_currLayerID] ) 1142 { 1143 xWriteSEIDepthRepInfoElement(sei.m_dMax[sei.m_currLayerID][0]); 1144 } 1145 1146 if (sei.m_depthRepresentationType[sei.m_currLayerID][0] == 3) 1147 { 1148 WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0], "depth_nonlinear_representation_num_minus1" ); 1149 for( Int i = 1; i <= sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0] + 1; i++ ) 1150 { 1151 WRITE_UVLC(sei.m_depth_nonlinear_representation_model[sei.m_currLayerID][i-1],"depth_nonlinear_representation_model[ i ]"); 1152 } 1153 } 1154 } 1155 1156 Void SEIWriter::xWriteSEIDepthRepInfoElement( double f) 1157 { 1158 UInt x_sign, x_exp, x_mantissa,x_mantissa_len; 1159 if (f < 0) 1160 { 1161 f = f * (-1); 1162 x_sign = 1; 1163 } 1164 else 1165 { 1166 x_sign = 0; 1167 } 1168 int exponent=0; 1169 if(f >= 1) 1170 { 1171 while(f>=2) 1172 { 1173 exponent++; 1174 f = f/2; 1175 } 1176 } 1177 else 1178 { 1179 while (f<1) 1180 { 1181 exponent++; 1182 f = f*2; 1183 } 1184 exponent=-exponent; 1185 } 1186 1187 int i; 1188 f = f -1; 1189 double s = 1; 1190 char s_mantissa[32]; 1191 double thr=1.0/(4.0*(1<<30)); 1192 1193 if (f>=thr) 1194 { 1195 for(i=0;i<32;i++) 1196 { 1197 s /= 2; 1198 if(f>=s) 1199 { 1200 f = f-s; 1201 s_mantissa[i]=1; 1202 1203 if (f<thr) 1204 break; 1205 } 1206 else 1207 { 1208 s_mantissa[i]=0; 1209 } 1210 } 1211 1212 if (i<32) 1213 x_mantissa_len=i+1; 1214 else 1215 x_mantissa_len=32; 1216 1217 x_mantissa=0; 1218 1219 for(i=0;i<x_mantissa_len;i++) 1220 { 1221 if (s_mantissa[i]==1) 1222 x_mantissa += (1u)<<(x_mantissa_len-1-i) ; 1223 } 1224 1225 } 1226 else 1227 { 1228 x_mantissa=0; 1229 x_mantissa_len=1; 1230 } 1231 1232 assert(exponent>=-31 && exponent<= (1<<7)-32); 1233 x_exp=exponent+31; 1234 1235 WRITE_FLAG( x_sign, "da_sign_flag" ); 1236 WRITE_CODE( x_exp, 7 , "da_exponent" ); 1237 WRITE_CODE( x_mantissa_len-1, 5 , "da_mantissa_len_minus1" ); 1238 WRITE_CODE( x_mantissa, x_mantissa_len , "da_mantissa" ); 1239 1240 }; 1241 #endif 1242 Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei) 1243 { 1244 WRITE_SVLC( sei.m_minDisparity , "min_disparity" ); 1245 WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" ); 1246 }; 1247 1248 1249 Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei) 1250 { 1251 WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" ); 1252 WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" ); 1253 if( sei.m_intrinsicParamFlag ) 1254 { 1255 WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" ); 1256 WRITE_UVLC( sei.m_precFocalLength , "prec_focal_length" ); 1257 WRITE_UVLC( sei.m_precPrincipalPoint , "prec_principal_point" ); 1258 WRITE_UVLC( sei.m_precSkewFactor , "prec_skew_factor" ); 1259 1260 for( Int i = 0; i <= ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ ) 1261 { 1262 WRITE_FLAG( ( sei.m_signFocalLengthX [i] ? 1 : 0 ), "sign_focal_length_x" ); 1263 WRITE_CODE( sei.m_exponentFocalLengthX [i] , 6 , "exponent_focal_length_x" ); 1264 WRITE_CODE( sei.m_mantissaFocalLengthX [i] , sei.getMantissaFocalLengthXLen( i ), "mantissa_focal_length_x" ); 1265 WRITE_FLAG( ( sei.m_signFocalLengthY [i] ? 1 : 0 ), "sign_focal_length_y" ); 1266 WRITE_CODE( sei.m_exponentFocalLengthY [i] , 6 , "exponent_focal_length_y" ); 1267 WRITE_CODE( sei.m_mantissaFocalLengthY [i] , sei.getMantissaFocalLengthYLen( i ), "mantissa_focal_length_y" ); 1268 WRITE_FLAG( ( sei.m_signPrincipalPointX [i] ? 1 : 0 ), "sign_principal_point_x" ); 1269 WRITE_CODE( sei.m_exponentPrincipalPointX[i] , 6, "exponent_principal_point_x" ); 1270 WRITE_CODE( sei.m_mantissaPrincipalPointX[i] , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" ); 1271 WRITE_FLAG( ( sei.m_signPrincipalPointY [i] ? 1 : 0 ), "sign_principal_point_y" ); 1272 WRITE_CODE( sei.m_exponentPrincipalPointY[i] , 6, "exponent_principal_point_y" ); 1273 WRITE_CODE( sei.m_mantissaPrincipalPointY[i] , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" ); 1274 WRITE_FLAG( ( sei.m_signSkewFactor [i] ? 1 : 0 ), "sign_skew_factor" ); 1275 WRITE_CODE( sei.m_exponentSkewFactor [i] , 6, "exponent_skew_factor" ); 1276 WRITE_CODE( sei.m_mantissaSkewFactor [i] , sei.getMantissaSkewFactorLen( i ) , "mantissa_skew_factor" ); 1277 } 1278 } 1279 if( sei.m_extrinsicParamFlag ) 1280 { 1281 WRITE_UVLC( sei.m_precRotationParam , "prec_rotation_param" ); 1282 WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" ); 1283 for( Int i = 0; i <= sei.getNumViewsMinus1(); i++ ) 1284 { 1285 for( Int j = 0; j <= 2; j++ ) /* row */ 1286 { 1287 for( Int k = 0; k <= 2; k++ ) /* column */ 1288 { 1289 WRITE_FLAG( ( sei.m_signR [i][j][k] ? 1 : 0 ), "sign_r" ); 1290 WRITE_CODE( sei.m_exponentR[i][j][k] , 6, "exponent_r" ); 1291 WRITE_CODE( sei.m_mantissaR[i][j][k] , sei.getMantissaRLen( i,j,k ) , "mantissa_r" ); 1292 } 1293 WRITE_FLAG( ( sei.m_signT [i][j] ? 1 : 0 ), "sign_t" ); 1294 WRITE_CODE( sei.m_exponentT[i][j] , 6, "exponent_t" ); 1295 WRITE_CODE( sei.m_mantissaT[i][j] , sei.getMantissaTLen( i,j ),"mantissa_t" ); 1296 } 1297 } 1298 } 1299 }; 1300 1301 1302 #if NH_MV_SEI 1303 Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei) 1304 { 1305 WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" ); 1306 for( Int i = 0; i <= sei.m_numViewsMinus1; i++ ) 1307 { 1308 WRITE_UVLC( sei.m_viewPosition[i], "view_position" ); 1309 } 1310 }; 1311 #endif 1312 1313 #if NH_3D 1314 Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei) 1315 { 1316 WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" ); 1317 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1318 { 1319 WRITE_CODE( sei.m_depthType, 2, "depth_type" ); 1320 1321 if( sei.m_depthType == 0 ) 1322 { 1323 WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" ); 1324 WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" ); 1325 WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" ); 1326 WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" ); 1327 WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" ); 1328 WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" ); 1329 if( sei.m_zGvdFlag ) 1330 { 1331 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1332 { 1333 WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" ); 1334 WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" ); 1335 WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" ); 1336 WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" ); 1337 WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" ); 1338 WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" ); 1339 WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" ); 1340 WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" ); 1341 } 1342 } 1343 if( sei.m_intrinsicParamGvdFlag ) 1344 { 1345 WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" ); 1346 WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" ); 1347 } 1348 if( sei.m_rotationGvdFlag ) 1349 { 1350 WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" ); 1351 } 1352 if( sei.m_translationGvdFlag ) 1353 { 1354 WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" ); 1355 } 1356 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1357 { 1358 if( sei.m_intrinsicParamGvdFlag ) 1359 { 1360 WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" ); 1361 WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" ); 1362 WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" ); 1363 WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" ); 1364 WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" ); 1365 WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" ); 1366 WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" ); 1367 WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" ); 1368 WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" ); 1369 WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" ); 1370 WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" ); 1371 WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" ); 1372 } 1373 if( sei.m_rotationGvdFlag ) 1374 { 1375 WRITE_FLAG( ( sei.m_signGvdR00[i][j] ? 1 : 0 ), "sign_gvd_r00" ); 1376 WRITE_CODE( sei.m_expGvdR00[i][j], 6, "exp_gvd_r00" ); 1377 WRITE_CODE( sei.m_manGvdR00[i][j], sei.m_precGvdRotationParam, "man_gvd_r00" ); 1378 WRITE_FLAG( ( sei.m_signGvdR01[i][j] ? 1 : 0 ), "sign_gvd_r01" ); 1379 WRITE_CODE( sei.m_expGvdR01[i][j], 6, "exp_gvd_r01" ); 1380 WRITE_CODE( sei.m_manGvdR01[i][j], sei.m_precGvdRotationParam, "man_gvd_r01" ); 1381 WRITE_FLAG( ( sei.m_signGvdR02[i][j] ? 1 : 0 ), "sign_gvd_r02" ); 1382 WRITE_CODE( sei.m_expGvdR02[i][j], 6, "exp_gvd_r02" ); 1383 WRITE_CODE( sei.m_manGvdR02[i][j], sei.m_precGvdRotationParam, "man_gvd_r02" ); 1384 WRITE_FLAG( ( sei.m_signGvdR10[i][j] ? 1 : 0 ), "sign_gvd_r10" ); 1385 WRITE_CODE( sei.m_expGvdR10[i][j], 6, "exp_gvd_r10" ); 1386 WRITE_CODE( sei.m_manGvdR10[i][j], sei.m_precGvdRotationParam, "man_gvd_r10" ); 1387 WRITE_FLAG( ( sei.m_signGvdR11[i][j] ? 1 : 0 ), "sign_gvd_r11" ); 1388 WRITE_CODE( sei.m_expGvdR11[i][j], 6, "exp_gvd_r11" ); 1389 WRITE_CODE( sei.m_manGvdR11[i][j], sei.m_precGvdRotationParam, "man_gvd_r11" ); 1390 WRITE_FLAG( ( sei.m_signGvdR12[i][j] ? 1 : 0 ), "sign_gvd_r12" ); 1391 WRITE_CODE( sei.m_expGvdR12[i][j], 6, "exp_gvd_r12" ); 1392 WRITE_CODE( sei.m_manGvdR12[i][j], sei.m_precGvdRotationParam, "man_gvd_r12" ); 1393 WRITE_FLAG( ( sei.m_signGvdR20[i][j] ? 1 : 0 ), "sign_gvd_r20" ); 1394 WRITE_CODE( sei.m_expGvdR20[i][j], 6, "exp_gvd_r20" ); 1395 WRITE_CODE( sei.m_manGvdR20[i][j], sei.m_precGvdRotationParam, "man_gvd_r20" ); 1396 WRITE_FLAG( ( sei.m_signGvdR21[i][j] ? 1 : 0 ), "sign_gvd_r21" ); 1397 WRITE_CODE( sei.m_expGvdR21[i][j], 6, "exp_gvd_r21" ); 1398 WRITE_CODE( sei.m_manGvdR21[i][j], sei.m_precGvdRotationParam, "man_gvd_r21" ); 1399 WRITE_FLAG( ( sei.m_signGvdR22[i][j] ? 1 : 0 ), "sign_gvd_r22" ); 1400 WRITE_CODE( sei.m_expGvdR22[i][j], 6, "exp_gvd_r22" ); 1401 WRITE_CODE( sei.m_manGvdR22[i][j], sei.m_precGvdRotationParam, "man_gvd_r22" ); 1402 } 1403 if( sei.m_translationGvdFlag ) 1404 { 1405 WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" ); 1406 WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" ); 1407 WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" ); 1408 } 1409 } 1410 } 1411 1412 if( sei.m_depthType == 1 ) 1413 { 1414 WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" ); 1415 WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" ); 1416 WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" ); 1417 WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" ); 1418 WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" ); 1419 if( sei.m_offsetYPresentFlag ) 1420 { 1421 WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" ); 1422 WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" ); 1423 WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" ); 1424 WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" ); 1425 } 1426 WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" ); 1427 if( sei.m_warpMapSizePresentFlag ) 1428 { 1429 WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" ); 1430 WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" ); 1431 } 1432 } 1433 } 1434 }; 1435 #endif 1436 1437 820 1438 //! \} -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r1313 r1356 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_LAYERS_NOT_PRESENT_SEI 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 Void xWriteSEIAlphaChannelInfo ( const SEIAlphaChannelInfo& sei); 96 Void xWriteSEIOverlayInfo ( const SEIOverlayInfo& sei); 97 Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei); 98 #if NH_MV_SEI_TBD 99 Void xWriteSEIFrameFieldInfo ( const SEIFrameFieldInfo& sei); 100 #endif 101 Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei); 102 #if SEI_DRI_F0169 103 Void xWriteSEIDepthRepInfoElement ( double f); 104 Void xWriteSEIDepthRepresentationInfo ( const SEIDepthRepresentationInfo& sei); 105 #endif 106 Void xWriteSEIMultiviewSceneInfo ( const SEIMultiviewSceneInfo& sei); 107 Void xWriteSEIMultiviewAcquisitionInfo ( const SEIMultiviewAcquisitionInfo& sei); 108 Void xWriteSEIMultiviewViewPosition ( const SEIMultiviewViewPosition& sei); 109 #if NH_3D 110 Void xWriteSEIAlternativeDepthInfo ( const SEIAlternativeDepthInfo& sei); 111 #endif 83 112 Void xWriteByteAlign(); 84 113 }; 114 #endif 85 115 86 116 //! \} -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
r1313 r1356 127 127 } 128 128 129 Void SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName) 130 { 131 xWriteString(value, length); 132 if( g_HLSTraceEnable ) 133 { 134 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 135 fprintf( g_hTrace, "%-50s st(v=%d) : %s\n", pSymbolName, length, value ); 136 } 137 } 138 129 139 #endif 130 140 … … 166 176 } 167 177 178 Void SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength) 179 { 180 assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 ); 181 for (Int i=0 ; i<uiLength; i++) 182 { 183 m_pcBitIf->write( sCode[i], 8 ); 184 } 185 m_pcBitIf->write( 0, 8 ); //zero-termination byte 186 } 187 168 188 Void SyntaxElementWriter::xWriteRbspTrailingBits() 169 189 { -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
r1313 r1356 56 56 #define WRITE_SVLC( value, name) xWriteSvlcTr ( value, name ) 57 57 #define WRITE_FLAG( value, name) xWriteFlagTr ( value, name ) 58 #define WRITE_STRING( value, length, name) xWriteStringTr( value, length, name ) 58 59 59 60 #else … … 63 64 #define WRITE_SVLC( value, name) xWriteSvlc ( value ) 64 65 #define WRITE_FLAG( value, name) xWriteFlag ( value ) 66 #define WRITE_STRING( value, length, name) xWriteString( value, length ) 65 67 66 68 #endif … … 82 84 Void xWriteSvlc ( Int iCode ); 83 85 Void xWriteFlag ( UInt uiCode ); 86 Void xWriteString ( UChar* sCode, UInt uiLength); 84 87 #if ENC_DEC_TRACE 85 88 Void xWriteCodeTr ( UInt value, UInt length, const Char *pSymbolName); … … 87 90 Void xWriteSvlcTr ( Int value, const Char *pSymbolName); 88 91 Void xWriteFlagTr ( UInt value, const Char *pSymbolName); 92 Void xWriteStringTr ( UChar* value, UInt length, const Char *pSymbolName); 89 93 #endif 90 94 Void xWriteRbspTrailingBits(); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r1313 r1356 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 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r1321 r1356 100 100 m_layerId = 0; 101 101 m_viewId = 0; 102 m_pocLastCoded = -1; 102 m_pocLastCoded = -1; 103 103 #if NH_3D 104 m_viewIndex = 0; 104 m_viewIndex = 0; 105 105 m_isDepth = false; 106 106 #endif … … 147 147 148 148 #if NH_MV 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 150 150 m_layerId = pcTEncTop->getLayerId(); 151 151 m_viewId = pcTEncTop->getViewId(); … … 156 156 #endif 157 157 #if NH_3D_IC 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 160 160 #endif 161 161 #if KWU_FIX_URQ … … 207 207 #if NH_MV 208 208 if ( getLayerId() == 0 ) 209 { 209 { 210 210 actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS()); 211 211 } … … 277 277 278 278 while ( (itNalu!=accessUnit.end())&& 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 280 280 || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS 281 281 || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS … … 288 288 SEIMessages localMessages = seiMessages; 289 289 SEIMessages currentMessages; 290 290 291 291 #if ENC_DEC_TRACE 292 292 g_HLSTraceEnable = !testWrite; … … 299 299 xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 300 300 xClearSEIs(currentMessages, !testWrite); 301 301 302 302 // Buffering period SEI must always be following active parameter sets 303 303 currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD); … … 328 328 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 329 329 xClearSEIs(currentMessages, !testWrite); 330 331 #if NH_MV_LAYERS_NOT_PRESENT_SEI 332 // Layers not present SEI message 333 currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT); 334 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 335 xClearSEIs(currentMessages, !testWrite); 336 #endif 330 337 331 338 // And finally everything else one by one … … 412 419 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps) 413 420 { 414 #if NH_MV415 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());416 #else417 421 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 418 #endif 422 419 423 if(m_pcCfg->getActiveParameterSetsSEIEnabled()) 420 424 { … … 472 476 seiMessages.push_back(sei); 473 477 } 474 478 475 479 if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled) 476 480 { … … 482 486 483 487 #if NH_MV 488 #if !NH_MV_SEI 484 489 if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) ) 485 490 { 486 491 SEISubBitstreamProperty *sei = new SEISubBitstreamProperty; 487 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 492 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 488 493 seiMessages.push_back(sei); 489 494 } 495 #endif 490 496 #endif 491 497 } … … 679 685 } 680 686 } 681 687 682 688 if( m_pcCfg->getPictureTimingSEIEnabled() ) 683 689 { … … 715 721 return; 716 722 } 717 // fix first 723 // fix first 718 724 UInt numNalUnits = (UInt)testAU.size(); 719 725 UInt numRBSPBytes = 0; … … 927 933 IRAPGOPid = iGOPid; 928 934 IRAPtoReorder = true; 929 swapIRAPForward = true; 935 swapIRAPForward = true; 930 936 break; 931 937 } … … 935 941 IRAPGOPid = iGOPid; 936 942 IRAPtoReorder = true; 937 swapIRAPForward = false; 943 swapIRAPForward = false; 938 944 break; 939 945 } … … 1066 1072 #endif 1067 1073 #if NH_MV 1068 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1069 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1074 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1075 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1070 1076 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid ) 1071 1077 #else … … 1170 1176 pcPic->setCurrSliceIdx(0); 1171 1177 #if NH_MV 1172 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1178 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1173 1179 #else 1174 1180 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField ); … … 1181 1187 pcSlice->setSliceIdx(0); 1182 1188 #if NH_MV 1183 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1189 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1184 1190 pcPic ->setLayerId ( getLayerId() ); 1185 pcPic ->setViewId ( getViewId() ); 1191 pcPic ->setViewId ( getViewId() ); 1186 1192 #if !NH_3D 1187 1193 pcSlice->setLayerId ( getLayerId() ); 1188 pcSlice->setViewId ( getViewId() ); 1194 pcSlice->setViewId ( getViewId() ); 1189 1195 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 1190 1196 #else 1191 pcPic ->setViewIndex ( getViewIndex() ); 1197 pcPic ->setViewIndex ( getViewIndex() ); 1192 1198 pcPic ->setIsDepth( getIsDepth() ); 1193 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1194 #endif 1195 #endif 1199 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1200 #endif 1201 #endif 1196 1202 //set default slice level flag to the same as SPS level flag 1197 1203 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 1201 1207 if( pcSlice->getSliceType() == B_SLICE ) 1202 1208 { 1203 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1204 { 1209 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1210 { 1205 1211 pcSlice->setSliceType( P_SLICE ); 1206 1212 } … … 1210 1216 if( pcSlice->getSliceType() == B_SLICE ) 1211 1217 { 1212 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1213 { 1218 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1219 { 1214 1220 pcSlice->setSliceType( I_SLICE ); 1215 1221 } … … 1225 1231 pcSlice->setSliceType(I_SLICE); 1226 1232 } 1227 1233 1228 1234 // Set the nal unit type 1229 1235 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); … … 1279 1285 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1280 1286 } 1281 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1287 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1282 1288 || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 1283 1289 ) … … 1288 1294 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 1289 1295 1290 if(pcSlice->getTLayer() > 0 1296 if(pcSlice->getTLayer() > 0 1291 1297 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N // Check if not a leading picture 1292 1298 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R … … 1358 1364 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1359 1365 { 1360 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1361 pcSlice->setDiscardableFlag ( false ); 1362 } 1363 1364 const TComVPS* vps = pcSlice->getVPS(); 1366 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1367 pcSlice->setDiscardableFlag ( false ); 1368 } 1369 1370 const TComVPS* vps = pcSlice->getVPS(); 1365 1371 #if NH_3D 1366 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1372 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1367 1373 #else 1368 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1374 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1369 1375 #endif 1370 1376 #if NH_3D 1371 pcSlice->setIvPicLists( m_ivPicLists ); 1377 pcSlice->setIvPicLists( m_ivPicLists ); 1372 1378 1373 1379 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid; 1374 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1380 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1375 1381 #else 1376 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1377 #endif 1378 1379 1380 1381 Bool interLayerPredLayerIdcPresentFlag = false; 1382 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1383 #endif 1384 1385 1386 1387 Bool interLayerPredLayerIdcPresentFlag = false; 1382 1388 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 1383 { 1384 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1389 { 1390 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1385 1391 if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 ) 1386 1392 { 1387 1393 if ( !vps->getMaxOneActiveRefLayerFlag() ) 1388 { 1389 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1394 { 1395 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1390 1396 } 1391 1397 #if NH_3D … … 1394 1400 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 1395 1401 #endif 1396 { 1397 interLayerPredLayerIdcPresentFlag = true; 1402 { 1403 interLayerPredLayerIdcPresentFlag = true; 1398 1404 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 1399 1405 { 1400 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1406 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1401 1407 } 1402 1408 } … … 1405 1411 if ( !interLayerPredLayerIdcPresentFlag ) 1406 1412 { 1407 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1413 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1408 1414 { 1409 1415 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); … … 1412 1418 1413 1419 1414 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1415 1420 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1421 1416 1422 #if NH_3D 1417 1423 if ( m_pcEncTop->decProcAnnexI() ) 1418 { 1419 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1424 { 1425 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1420 1426 if ( pcSlice->getInCmpPredAvailFlag() ) 1421 { 1422 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1427 { 1428 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1423 1429 } 1424 1430 else … … 1434 1440 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 1435 1441 } 1436 1442 1437 1443 exit(EXIT_FAILURE); 1438 1444 } 1439 1445 } 1440 pcSlice->init3dToolParameters(); 1441 pcSlice->checkInCompPredRefLayers(); 1442 } 1446 pcSlice->init3dToolParameters(); 1447 pcSlice->checkInCompPredRefLayers(); 1448 } 1443 1449 #if NH_3D_IV_MERGE 1444 1450 // This needs to be done after initialization of 3D tool parameters. … … 1447 1453 #endif 1448 1454 1449 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1455 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1450 1456 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 1451 1457 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); … … 1456 1462 1457 1463 pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 1458 1459 1460 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1464 1465 1466 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1461 1467 #else 1462 1468 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 1464 1470 #endif 1465 1471 // Set reference list 1466 #if NH_MV 1467 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1472 #if NH_MV 1473 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1468 1474 #else 1469 1475 pcSlice->setRefPicList ( rcListPic ); … … 1477 1483 #endif 1478 1484 #if NH_3D_IC 1479 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1480 pcSlice->setICEnableNum( m_aICEnableNum ); 1485 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1486 pcSlice->setICEnableNum( m_aICEnableNum ); 1481 1487 #endif 1482 1488 … … 1485 1491 if ( pcSlice->getSliceType() == B_SLICE ) 1486 1492 { 1487 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1488 { 1489 pcSlice->setSliceType( P_SLICE ); 1493 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1494 { 1495 pcSlice->setSliceType( P_SLICE ); 1490 1496 } 1491 1497 } … … 1566 1572 1567 1573 #if NH_3D_VSO 1568 // Should be moved to TEncTop !!! 1574 // Should be moved to TEncTop !!! 1569 1575 Bool bUseVSO = m_pcEncTop->getUseVSO(); 1570 1571 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1576 1577 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1572 1578 1573 1579 pcRdCost->setUseVSO( bUseVSO ); … … 1725 1731 #endif 1726 1732 #if NH_3D 1727 pcSlice->setDepthToDisparityLUTs(); 1733 pcSlice->setDepthToDisparityLUTs(); 1728 1734 1729 1735 #endif … … 1835 1841 xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice); 1836 1842 1843 #if NH_MV_SEI 1844 m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice ); 1845 #endif 1846 1837 1847 /* use the main bitstream buffer for storing the marshalled picture */ 1838 1848 m_pcEntropyCoder->setBitstream(NULL); … … 1980 1990 cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled()); 1981 1991 #if NH_3D 1982 pcPic->compressMotion(2); 1992 pcPic->compressMotion(2); 1983 1993 #else 1984 1994 pcPic->compressMotion(); … … 2055 2065 pcPic->setReconMark ( true ); 2056 2066 #if NH_MV 2057 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2058 std::vector<Int> temp; 2059 TComSlice::markCurrPic( pcPic ); 2067 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2068 std::vector<Int> temp; 2069 TComSlice::markCurrPic( pcPic ); 2060 2070 #endif 2061 2071 m_bFirst = false; … … 2094 2104 //-- all 2095 2105 #if NH_MV 2096 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2106 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2097 2107 #else 2098 2108 printf( "\n\nSUMMARY --------------------------------------------------------\n" ); … … 2402 2412 #if H_3D_VSO_SYNTH_DIST_OUT 2403 2413 } 2404 #endif 2405 #endif 2414 #endif 2415 #endif 2406 2416 /* calculate the size of the access unit, excluding: 2407 2417 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) … … 2526 2536 2527 2537 #if NH_MV 2528 assert( 0 ); // Field coding and MV need to be aligned. 2538 assert( 0 ); // Field coding and MV need to be aligned. 2529 2539 #else 2530 2540 … … 2969 2979 #if NH_MV 2970 2980 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 2971 { 2972 2981 { 2982 2973 2983 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 ) 2974 2984 { 2975 2985 return; 2976 2986 } 2977 2987 2978 2988 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid ); 2979 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2980 2981 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2982 2983 // GT: check if SliceType should be checked here. 2989 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2990 2991 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2992 2993 // GT: check if SliceType should be checked here. 2984 2994 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2985 2995 { 2986 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2987 2996 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2997 2988 2998 Int finalIdxToTempIdxMap[16]; 2989 2999 for( Int k = 0; k < 16; k++ ) … … 2999 3009 // get position in temp. list 3000 3010 Int refPicLayerId = pcSlice->getRefPicLayerId(k); 3001 Int idxInTempList = 0; 3011 Int idxInTempList = 0; 3002 3012 for (; idxInTempList < numPicsInTempList; idxInTempList++) 3003 3013 { 3004 3014 if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId ) 3005 3015 { 3006 break; 3016 break; 3007 3017 } 3008 3018 } 3009 3019 3010 3020 Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ]; 3011 3012 // Add negative from behind 3013 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3014 3021 3022 // Add negative from behind 3023 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3024 3015 3025 Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ; 3016 3026 if ( curIsModified ) 3017 3027 { 3018 isModified = true; 3028 isModified = true; 3019 3029 assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 3020 3030 } 3021 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3031 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3022 3032 } 3023 3033 } 3024 3034 3025 3035 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3026 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3036 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3027 3037 3028 3038 if( isModified ) 3029 3039 { 3030 3040 Int refIdx = 0; 3031 3041 3032 3042 for( Int i = 0; i < numPicsInFinalRefList; i++ ) 3033 3043 { 3034 if( finalIdxToTempIdxMap[i] >= 0 ) 3044 if( finalIdxToTempIdxMap[i] >= 0 ) 3035 3045 { 3036 3046 refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] ); … … 3042 3052 while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId()) ) 3043 3053 { 3044 refIdx++; 3054 refIdx++; 3045 3055 } 3046 3056 refPicListModification->setRefPicSetIdxL( li, i, refIdx ); -
trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h
r1313 r1356 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.