Changeset 815 in SHVCSoftware for trunk/source/Lib/TLibDecoder/SEIread.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/SEIread.cpp
r713 r815 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if P0050_KNEE_FUNCTION_SEI 96 case SEI::KNEE_FUNCTION_INFO: 97 fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n"); 98 break; 99 #endif 95 100 #if Q0074_SEI_COLOR_MAPPING 96 101 case SEI::COLOR_MAPPING_INFO: … … 129 134 case SEI::BSP_HRD: 130 135 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 136 break; 137 #endif 138 #if Q0078_ADD_LAYER_SETS 139 case SEI::OUTPUT_LAYER_SET_NESTING: 140 fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n"); 141 break; 142 case SEI::VPS_REWRITING: 143 fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n"); 131 144 break; 132 145 #endif … … 285 298 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 286 299 break; 300 #if P0050_KNEE_FUNCTION_SEI 301 case SEI::KNEE_FUNCTION_INFO: 302 sei = new SEIKneeFunctionInfo; 303 xParseSEIKneeFunctionInfo((SEIKneeFunctionInfo&) *sei, payloadSize); 304 break; 305 #endif 287 306 #if Q0074_SEI_COLOR_MAPPING 288 307 case SEI::COLOR_MAPPING_INFO: … … 345 364 sei = new SEIBspHrd; 346 365 xParseSEIBspHrd((SEIBspHrd&) *sei, sps, *nestingSei); 366 break; 367 #endif 368 #if Q0078_ADD_LAYER_SETS 369 case SEI::OUTPUT_LAYER_SET_NESTING: 370 sei = new SEIOutputLayerSetNesting; 371 #if LAYERS_NOT_PRESENT_SEI 372 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, vps, sps); 373 #else 374 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, sps); 375 #endif 376 break; 377 case SEI::VPS_REWRITING: 378 sei = new SEIVPSRewriting; 379 xParseSEIVPSRewriting((SEIVPSRewriting&)*sei); 380 break; 381 #endif 382 #if Q0189_TMVP_CONSTRAINTS 383 case SEI::TMVP_CONSTRAINTS: 384 sei = new SEITMVPConstrains; 385 xParseSEITMVPConstraints((SEITMVPConstrains&) *sei, payloadSize); 386 break; 387 #endif 388 #if Q0247_FRAME_FIELD_INFO 389 case SEI::FRAME_FIELD_INFO: 390 sei = new SEIFrameFieldInfo; 391 xParseSEIFrameFieldInfo ((SEIFrameFieldInfo&) *sei, payloadSize); 347 392 break; 348 393 #endif … … 849 894 } 850 895 896 #if P0050_KNEE_FUNCTION_SEI 897 Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt /*payloadSize*/){ 898 Int i; 899 UInt val; 900 READ_UVLC( val, "knee_function_id" ); sei.m_kneeId = val; 901 READ_FLAG( val, "knee_function_cancel_flag" ); sei.m_kneeCancelFlag = val; 902 if ( !sei.m_kneeCancelFlag ) 903 { 904 READ_FLAG( val, "knee_function_persistence_flag" ); sei.m_kneePersistenceFlag = val; 905 READ_FLAG( val, "mapping_flag" ); sei.m_kneeMappingFlag = val; 906 READ_CODE( 32, val, "input_d_range" ); sei.m_kneeInputDrange = val; 907 READ_CODE( 32, val, "input_disp_luminance" ); sei.m_kneeInputDispLuminance = val; 908 READ_CODE( 32, val, "output_d_range" ); sei.m_kneeOutputDrange = val; 909 READ_CODE( 32, val, "output_disp_luminance" ); sei.m_kneeOutputDispLuminance = val; 910 READ_UVLC( val, "num_knee_points_minus1" ); sei.m_kneeNumKneePointsMinus1 = val; 911 assert( sei.m_kneeNumKneePointsMinus1 > 0 ); 912 sei.m_kneeInputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 913 sei.m_kneeOutputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 914 for(i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ ) 915 { 916 READ_CODE( 10, val, "input_knee_point" ); sei.m_kneeInputKneePoint[i] = val; 917 READ_CODE( 10, val, "output_knee_point" ); sei.m_kneeOutputKneePoint[i] = val; 918 } 919 } 920 } 921 #endif 922 851 923 #if Q0074_SEI_COLOR_MAPPING 852 924 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) … … 960 1032 } 961 1033 1034 #if Q0189_TMVP_CONSTRAINTS 1035 Void SEIReader::xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize) 1036 { 1037 UInt uiCode; 1038 READ_UVLC( uiCode, "prev_pics_not_used_flag" ); sei.prev_pics_not_used_flag = uiCode; 1039 READ_UVLC( uiCode, "no_intra_layer_col_pic_flag" ); sei.no_intra_layer_col_pic_flag = uiCode; 1040 xParseByteAlign(); 1041 } 1042 #endif 1043 1044 #if Q0247_FRAME_FIELD_INFO 1045 Void SEIReader::xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize) 1046 { 1047 UInt code; 1048 READ_CODE( 4, code, "ffinfo_pic_struct" ); sei.m_ffinfo_picStruct = code; 1049 READ_CODE( 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfo_sourceScanType = code; 1050 READ_FLAG( code, "ffinfo_duplicate_flag" ); sei.m_ffinfo_duplicateFlag = ( code == 1 ? true : false ); 1051 xParseByteAlign(); 1052 } 1053 #endif 1054 962 1055 #if LAYERS_NOT_PRESENT_SEI 963 1056 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) … … 1209 1302 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 1210 1303 READ_UVLC( uiCode, "num_sei_bitstream_partitions_minus1[i]"); sei.m_seiNumBitstreamPartitionsMinus1[lsIdx] = uiCode; 1211 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1212 { 1213 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1304 #if HRD_BPB 1305 Int chkPart=0; 1306 #endif 1307 UInt i; 1308 for(i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1309 { 1310 #if HRD_BPB 1311 UInt nl=0; UInt j; 1312 for(j = 0; j < sei.m_vpsMaxLayers; j++) 1214 1313 { 1215 1314 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1216 1315 { 1316 nl++; 1317 } 1318 } 1319 for (j = 0; j < nl; j++) 1320 { 1321 #else 1322 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1323 { 1324 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1325 { 1326 #endif 1217 1327 READ_FLAG( uiCode, "sei_layer_in_bsp_flag[lsIdx][i][j]" ); sei.m_seiLayerInBspFlag[lsIdx][i][j] = uiCode; 1218 1328 } 1219 } 1220 } 1329 #if !HRD_BPB 1330 } 1331 #endif 1332 #if HRD_BPB 1333 chkPart+=sei.m_seiLayerInBspFlag[lsIdx][i][j]; 1334 #endif 1335 } 1336 #if HRD_BPB 1337 assert(chkPart<=1); 1338 #endif 1339 #if HRD_BPB 1340 if(sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]==0) 1341 { 1342 Int chkPartition1=0; Int chkPartition2=0; 1343 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1344 { 1345 if( sei.m_layerIdIncludedFlag[lsIdx][j] ) 1346 { 1347 chkPartition1+=sei.m_seiLayerInBspFlag[lsIdx][0][j]; 1348 chkPartition2++; 1349 } 1350 } 1351 assert(chkPartition1!=chkPartition2); 1352 } 1353 #endif 1354 1221 1355 READ_UVLC( uiCode, "sei_num_bsp_sched_combinations_minus1[i]"); sei.m_seiNumBspSchedCombinationsMinus1[lsIdx] = uiCode; 1222 for ( UInti = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++)1356 for (i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 1223 1357 { 1224 1358 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 1225 1359 { 1226 1360 READ_UVLC( uiCode, "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); sei.m_seiBspCombHrdIdx[lsIdx][i][j] = uiCode; 1361 #if HRD_BPB 1362 assert(uiCode <= sei.m_seiNumBspHrdParametersMinus1); 1363 #endif 1227 1364 READ_UVLC( uiCode, "sei_bsp_comb_sched_idx[lsIdx][i][j]"); sei.m_seiBspCombScheddx[lsIdx][i][j] = uiCode; 1365 #if HRD_BPB 1366 assert(uiCode <= sei.hrd->getCpbCntMinus1( sps->getMaxTLayers()-1 )); 1367 #endif 1368 1228 1369 } 1229 1370 } … … 1307 1448 #endif 1308 1449 1450 #if Q0078_ADD_LAYER_SETS 1451 1452 #if LAYERS_NOT_PRESENT_SEI 1453 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 1454 #else 1455 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComSPS *sps) 1456 #endif 1457 { 1458 UInt uiCode; 1459 SEIMessages seis; 1460 1461 READ_FLAG(uiCode, "ols_flag"); sei.m_olsFlag = uiCode; 1462 READ_UVLC(uiCode, "num_ols_indices_minus1"); sei.m_numOlsIndicesMinus1 = uiCode; 1463 1464 for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++) 1465 { 1466 READ_UVLC(uiCode, "ols_idx[i]"); sei.m_olsIdx[i] = uiCode; 1467 } 1468 1469 // byte alignment 1470 while (m_pcBitstream->getNumBitsRead() % 8 != 0) 1471 { 1472 UInt code; 1473 READ_FLAG(code, "ols_nesting_zero_bit"); 1474 } 1475 1476 sei.m_callerOwnsSEIs = false; 1477 1478 // read nested SEI messages 1479 do { 1480 #if O0164_MULTI_LAYER_HRD 1481 #if LAYERS_NOT_PRESENT_SEI 1482 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1483 #else 1484 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1485 #endif 1486 #else 1487 #if LAYERS_NOT_PRESENT_SEI 1488 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1489 #else 1490 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1491 #endif 1492 #endif 1493 } while (m_pcBitstream->getNumBitsLeft() > 8); 1494 1495 } 1496 1497 Void SEIReader::xParseSEIVPSRewriting(SEIVPSRewriting &sei) 1498 { 1499 } 1500 1501 #endif 1502 1309 1503 #endif //SVC_EXTENSION 1310 1504
Note: See TracChangeset for help on using the changeset viewer.