Changeset 1349 in 3DVCSoftware for branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder
- Timestamp:
- 14 Oct 2015, 04:03:38 (9 years ago)
- Location:
- branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/SEIwrite.cpp
r1344 r1349 132 132 case SEI::LAYERS_NOT_PRESENT: 133 133 xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei)); 134 break; 134 break; 135 135 #endif 136 136 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 137 137 xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei)); 138 break; 138 break; 139 139 #if NH_MV_SEI_TBD 140 140 case SEI::BSP_NESTING: 141 141 xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei)); 142 break; 142 break; 143 143 case SEI::BSP_INITIAL_ARRIVAL_TIME: 144 144 xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei)); 145 break; 145 break; 146 146 #endif 147 147 case SEI::SUB_BITSTREAM_PROPERTY: 148 148 xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei)); 149 break; 149 break; 150 150 case SEI::ALPHA_CHANNEL_INFO: 151 151 xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei)); … … 153 153 case SEI::OVERLAY_INFO: 154 154 xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei)); 155 break; 155 break; 156 156 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 157 157 xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei)); 158 break; 158 break; 159 159 #if NH_MV_SEI_TBD 160 160 case SEI::FRAME_FIELD_INFO: 161 161 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 162 break; 162 break; 163 163 #endif 164 164 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 165 165 xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei)); 166 break; 166 break; 167 167 #if SEI_DRI_F0169 168 168 case SEI::DEPTH_REPRESENTATION_INFO: 169 169 xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei)); 170 170 break; 171 #endif 171 #endif 172 172 case SEI::MULTIVIEW_SCENE_INFO: 173 173 xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei)); 174 break; 174 break; 175 175 case SEI::MULTIVIEW_ACQUISITION_INFO: 176 176 xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei)); 177 break; 177 break; 178 178 179 179 case SEI::MULTIVIEW_VIEW_POSITION: 180 180 xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei)); 181 break; 181 break; 182 182 #if NH_3D 183 183 case SEI::ALTERNATIVE_DEPTH_INFO: 184 184 xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei)); 185 break; 185 break; 186 186 #endif 187 187 #endif … … 307 307 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 308 308 { 309 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 309 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 310 310 } 311 311 } … … 445 445 { 446 446 WRITE_FLAG( sei.m_arrangementCancelFlag, "segmented_rect_frame_packing_arrangement_cancel_flag" ); 447 if( sei.m_arrangementCancelFlag == 0 ) 447 if( sei.m_arrangementCancelFlag == 0 ) 448 448 { 449 449 WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" ); … … 614 614 { 615 615 //UInt code; 616 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"); 617 617 WRITE_FLAG((sei.m_each_tile_one_tile_set_flag ? 1 : 0), "each_tile_one_tile_set_flag" ); 618 618 … … 629 629 630 630 if(sei.m_limited_tile_set_display_flag) 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 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 637 637 for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++) 638 638 { 639 WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index"); 640 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"); 641 641 } 642 642 643 643 if(!sei.m_mc_all_tiles_exact_sample_value_match_flag) 644 644 { 645 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"); 646 646 } 647 647 … … 651 651 { 652 652 WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag"); 653 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"); 654 654 } 655 655 } … … 662 662 if(sei.m_max_mcs_tier_level_idc_present_flag) 663 663 { 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"); 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"); 666 666 } 667 667 } … … 763 763 userVerticalCoefficients[2][2] = 100; 764 764 userVerticalCoefficients[2][3] = -10; 765 765 766 766 Int const iNumHorizontalFilters = 1; 767 767 Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3}; … … 832 832 { 833 833 WRITE_UVLC( sei.m_kneeId, "knee_function_id" ); 834 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 834 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 835 835 if ( !sei.m_kneeCancelFlag ) 836 836 { … … 863 863 WRITE_CODE( sei.values.whitePoint[0], 16, "white_point_x" ); 864 864 WRITE_CODE( sei.values.whitePoint[1], 16, "white_point_y" ); 865 865 866 866 WRITE_CODE( sei.values.maxLuminance, 32, "max_display_mastering_luminance" ); 867 867 WRITE_CODE( sei.values.minLuminance, 32, "min_display_mastering_luminance" ); … … 1033 1033 1034 1034 // byte alignment 1035 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 1035 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 1036 1036 { 1037 1037 WRITE_FLAG( 0, "overlay_zero_bit" ); 1038 1038 } 1039 1039 1040 1040 UChar* stmp; 1041 1041 UInt ilength; … … 1044 1044 if( sei.m_languageOverlayPresentFlag[i] ) 1045 1045 { 1046 stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() ); 1046 stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() ); 1047 1047 ilength = (UInt) sei.m_overlayLanguage[i].size(); 1048 1048 WRITE_STRING( stmp, ilength, "overlay_language" ); … … 1065 1065 } 1066 1066 WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" ); 1067 } 1067 } 1068 1068 }; 1069 1069 … … 1157 1157 { 1158 1158 UInt x_sign, x_exp, x_mantissa,x_mantissa_len; 1159 if (f < 0) 1159 if (f < 0) 1160 1160 { 1161 1161 f = f * (-1); … … 1317 1317 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1318 1318 { 1319 #if DEBUG_NH_3D_SEI 1320 printf("\n################## xWriteSEIAlternativeDepthInfo() ################\n"); 1321 #endif 1319 1322 WRITE_CODE( sei.m_depthType, 2, "depth_type" ); 1320 1323 1321 #if NH_MV_SEI_TBD1322 1324 if( sei.m_depthType == 0 ) 1323 1325 { … … 1330 1332 if( sei.m_zGvdFlag ) 1331 1333 { 1332 for( Int i = 0; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ ) 1333 { 1334 WRITE_FLAG( ( sei.m_signGvdZNearFlag[i] ? 1 : 0 ), "sign_gvd_z_near_flag" ); 1335 WRITE_CODE( sei.m_expGvdZNear[i], 7, "exp_gvd_z_near" ); 1336 WRITE_CODE( sei.m_manLenGvdZNearMinus1[i], 5, "man_len_gvd_z_near_minus1" ); 1337 WRITE_CODE( sei.m_manGvdZNear[i], getManGvdZNearLen ), "man_gvd_z_near" ); 1338 WRITE_FLAG( ( sei.m_signGvdZFarFlag[i] ? 1 : 0 ), "sign_gvd_z_far_flag" ); 1339 WRITE_CODE( sei.m_expGvdZFar[i], 7, "exp_gvd_z_far" ); 1340 WRITE_CODE( sei.m_manLenGvdZFarMinus1[i], 5, "man_len_gvd_z_far_minus1" ); 1341 WRITE_CODE( sei.m_manGvdZFar[i], getManGvdZFarLen ), "man_gvd_z_far" ); 1334 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1335 { 1336 #if DEBUG_NH_3D_SEI 1337 printf("sign_gvd_z_near_flag : sei.m_signGvdZNearFlag[%d][%d]: %u\n", i, j, sei.m_signGvdZNearFlag[i][j]); 1338 printf("exp_gvd_z_near : sei.m_expGvdZNear[%d][%d]: %u\n", i, j, sei.m_expGvdZNear[i][j]); 1339 printf("man_len_gvd_z_near_minus1 : sei.m_manLenGvdZNearMinus1[%d][%d]: %u\n", i, j, sei.m_manLenGvdZNearMinus1[i][j]); 1340 printf("man_gvd_z_near : sei.m_manGvdZNear[%d][%d]: %u\n", i, j, sei.m_manGvdZNear[i][j]); 1341 printf("sign_gvd_z_far_flag : sei.m_signGvdZFarFlag[%d][%d]: %u\n", i, j, sei.m_signGvdZFarFlag[i][j]); 1342 printf("exp_gvd_z_far : sei.m_expGvdZFar[%d][%d]: %u\n", i, j, sei.m_expGvdZFar[i][j]); 1343 printf("man_len_gvd_z_far_minus1 : sei.m_manLenGvdZFarMinus1[%d][%d]: %u\n", i, j, sei.m_manLenGvdZFarMinus1[i][j]); 1344 printf("man_gvd_z_far : sei.m_manGvdZFar[%d][%d]: %u\n", i, j, sei.m_manGvdZFar[i][j]); 1345 #endif 1346 WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" ); 1347 WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" ); 1348 WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" ); 1349 WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" ); 1350 WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" ); 1351 WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" ); 1352 WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" ); 1353 WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" ); 1342 1354 } 1343 1355 } 1344 1356 if( sei.m_intrinsicParamGvdFlag ) 1345 1357 { 1358 #if DEBUG_NH_3D_SEI 1359 printf("prec_gvd_focal_length : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength); 1360 printf("prec_gvd_principal_point : sei.m_precGvdPrincipalPoint: %u\n", sei.m_precGvdPrincipalPoint); 1361 #endif 1346 1362 WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" ); 1347 1363 WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" ); … … 1349 1365 if( sei.m_rotationGvdFlag ) 1350 1366 { 1367 #if DEBUG_NH_3D_SEI 1368 printf("prec_gvd_focal_length : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength); 1369 #endif 1351 1370 WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" ); 1352 1371 } 1353 1372 if( sei.m_translationGvdFlag ) 1354 1373 { 1374 #if DEBUG_NH_3D_SEI 1375 printf("prec_gvd_focal_length : sei.m_precGvdFocalLength: %u\n", sei.m_precGvdFocalLength); 1376 #endif 1355 1377 WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" ); 1356 1378 } 1357 for( Int i = 0 ; i <= sei.m_numConstituentViewsGvdMinus1 + 1; i++ )1379 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1358 1380 { 1359 1381 if( sei.m_intrinsicParamGvdFlag ) 1360 1382 { 1361 WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i] ? 1 : 0 ), "sign_gvd_focal_length_x" ); 1362 WRITE_CODE( sei.m_expGvdFocalLengthX[i], 6, "exp_gvd_focal_length_x" ); 1363 WRITE_CODE( sei.m_manGvdFocalLengthX[i], getManGvdFocalLengthXLen ), "man_gvd_focal_length_x" ); 1364 WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i] ? 1 : 0 ), "sign_gvd_focal_length_y" ); 1365 WRITE_CODE( sei.m_expGvdFocalLengthY[i], 6, "exp_gvd_focal_length_y" ); 1366 WRITE_CODE( sei.m_manGvdFocalLengthY[i], getManGvdFocalLengthYLen ), "man_gvd_focal_length_y" ); 1367 WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i] ? 1 : 0 ), "sign_gvd_principal_point_x" ); 1368 WRITE_CODE( sei.m_expGvdPrincipalPointX[i], 6, "exp_gvd_principal_point_x" ); 1369 WRITE_CODE( sei.m_manGvdPrincipalPointX[i], getManGvdPrincipalPointXLen ), "man_gvd_principal_point_x" ); 1370 WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i] ? 1 : 0 ), "sign_gvd_principal_point_y" ); 1371 WRITE_CODE( sei.m_expGvdPrincipalPointY[i], 6, "exp_gvd_principal_point_y" ); 1372 WRITE_CODE( sei.m_manGvdPrincipalPointY[i], getManGvdPrincipalPointYLen ), "man_gvd_principal_point_y" ); 1383 #if DEBUG_NH_3D_SEI 1384 printf("sign_gvd_focal_length_x : sei.m_signGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_signGvdFocalLengthX[i][j]); 1385 printf("exp_gvd_focal_length_x : sei.m_expGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthX[i][j]); 1386 printf("man_gvd_focal_length_x : sei.m_manGvdFocalLengthX[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthX[i][j]); 1387 printf("sign_gvd_focal_length_y : sei.m_signGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_signGvdFocalLengthY[i][j]); 1388 printf("exp_gvd_focal_length_y : sei.m_expGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_expGvdFocalLengthY[i][j]); 1389 printf("man_gvd_focal_length_y : sei.m_manGvdFocalLengthY[%d][%d]: %u\n", i, j, sei.m_manGvdFocalLengthY[i][j]); 1390 printf("sign_gvd_principal_point_x : sei.m_signGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointX[i][j]); 1391 printf("exp_gvd_principal_point_x : sei.m_expGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointX[i][j]); 1392 printf("man_gvd_principal_point_x : sei.m_manGvdPrincipalPointX[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointX[i][j]); 1393 printf("sign_gvd_principal_point_y : sei.m_signGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_signGvdPrincipalPointY[i][j]); 1394 printf("exp_gvd_principal_point_y : sei.m_expGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_expGvdPrincipalPointY[i][j]); 1395 printf("man_gvd_principal_point_y : sei.m_manGvdPrincipalPointY[%d][%d]: %u\n", i, j, sei.m_manGvdPrincipalPointY[i][j]); 1396 #endif 1397 WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" ); 1398 WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" ); 1399 WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_x" ); 1400 WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" ); 1401 WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" ); 1402 WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.m_precGvdFocalLength, "man_gvd_focal_length_y" ); 1403 WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" ); 1404 WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" ); 1405 WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_x" ); 1406 WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" ); 1407 WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" ); 1408 WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.m_precGvdPrincipalPoint, "man_gvd_principal_point_y" ); 1373 1409 } 1374 1410 if( sei.m_rotationGvdFlag ) 1375 1411 { 1376 for( Int j = 10; j <= 3; j++ ) /* row */1412 for( Int k = 0; k < 3; k++ ) // column 1377 1413 { 1378 for( Int k = 10; k <= 3; k++ ) /* column */ 1379 { 1380 WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" ); 1381 WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" ); 1382 WRITE_CODE( sei.m_manGvdR[i][j][k], getManGvdRLen ), "man_gvd_r" ); 1383 } 1414 #if DEBUG_NH_3D_SEI 1415 printf("sign_gvd_r : sei.m_signGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_signGvdR[i][j][k]); 1416 printf("exp_gvd_r : sei.m_expGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_expGvdR[i][j][k]); 1417 printf("man_gvd_r : sei.m_manGvdR[%d][%d][%d]: %u\n", i, j, k, sei.m_manGvdR[i][j][k]); 1418 #endif 1419 WRITE_FLAG( ( sei.m_signGvdR[i][j][k] ? 1 : 0 ), "sign_gvd_r" ); 1420 WRITE_CODE( sei.m_expGvdR[i][j][k], 6, "exp_gvd_r" ); 1421 WRITE_CODE( sei.m_manGvdR[i][j][k], sei.m_precGvdTranslationParam, "man_gvd_r" ); 1384 1422 } 1385 1423 } 1386 1424 if( sei.m_translationGvdFlag ) 1387 1425 { 1388 WRITE_FLAG( ( sei.m_signGvdTX[i] ? 1 : 0 ), "sign_gvd_t_x" ); 1389 WRITE_CODE( sei.m_expGvdTX[i], 6, "exp_gvd_t_x" ); 1390 WRITE_CODE( sei.m_manGvdTX[i], getManGvdTXLen ), "man_gvd_t_x" ); 1391 } 1392 } 1393 } 1394 #endif 1426 #if DEBUG_NH_3D_SEI 1427 printf("sign_gvd_t_x : sei.m_signGvdTX[%d][%d]: %u\n", i, j, sei.m_signGvdTX[i][j]); 1428 printf("exp_gvd_t_x : sei.m_expGvdTX[%d][%d]: %u\n", i, j, sei.m_expGvdTX[i][j]); 1429 printf("man_gvd_t_x : sei.m_manGvdTX[%d][%d]: %u\n", i, j, sei.m_manGvdTX[i][j]); 1430 #endif 1431 WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" ); 1432 WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" ); 1433 WRITE_CODE( sei.m_manGvdTX[i][j], sei.m_numConstituentViewsGvdMinus1, "man_gvd_t_x" ); 1434 } 1435 } 1436 } 1395 1437 1396 1438 if( sei.m_depthType == 1 ) -
branches/HTM-15.1-dev0-NICT/source/Lib/TLibEncoder/TEncGOP.cpp
r1331 r1349 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 } … … 232 232 OutputNALUnit nalu(naluType, temporalId); 233 233 #endif 234 printf("\nDEBUG: TEncGOP::xWriteSEI() call SEIWriter::writeSEImessages()\n"); 234 235 m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, sps, false); 235 236 auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu)); … … 277 278 278 279 while ( (itNalu!=accessUnit.end())&& 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 280 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 280 281 || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS 281 282 || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS … … 288 289 SEIMessages localMessages = seiMessages; 289 290 SEIMessages currentMessages; 290 291 291 292 #if ENC_DEC_TRACE 292 293 g_HLSTraceEnable = !testWrite; … … 299 300 xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 300 301 xClearSEIs(currentMessages, !testWrite); 301 302 302 303 // Buffering period SEI must always be following active parameter sets 303 304 currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD); … … 476 477 seiMessages.push_back(sei); 477 478 } 478 479 479 480 if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled) 480 481 { … … 490 491 { 491 492 SEISubBitstreamProperty *sei = new SEISubBitstreamProperty; 492 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 493 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 493 494 seiMessages.push_back(sei); 494 495 } … … 685 686 } 686 687 } 687 688 688 689 if( m_pcCfg->getPictureTimingSEIEnabled() ) 689 690 { … … 721 722 return; 722 723 } 723 // fix first 724 // fix first 724 725 UInt numNalUnits = (UInt)testAU.size(); 725 726 UInt numRBSPBytes = 0; … … 933 934 IRAPGOPid = iGOPid; 934 935 IRAPtoReorder = true; 935 swapIRAPForward = true; 936 swapIRAPForward = true; 936 937 break; 937 938 } … … 941 942 IRAPGOPid = iGOPid; 942 943 IRAPtoReorder = true; 943 swapIRAPForward = false; 944 swapIRAPForward = false; 944 945 break; 945 946 } … … 1072 1073 #endif 1073 1074 #if NH_MV 1074 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1075 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1075 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1076 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1076 1077 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid ) 1077 1078 #else … … 1176 1177 pcPic->setCurrSliceIdx(0); 1177 1178 #if NH_MV 1178 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1179 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1179 1180 #else 1180 1181 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField ); … … 1187 1188 pcSlice->setSliceIdx(0); 1188 1189 #if NH_MV 1189 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1190 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1190 1191 pcPic ->setLayerId ( getLayerId() ); 1191 pcPic ->setViewId ( getViewId() ); 1192 pcPic ->setViewId ( getViewId() ); 1192 1193 #if !NH_3D 1193 1194 pcSlice->setLayerId ( getLayerId() ); 1194 pcSlice->setViewId ( getViewId() ); 1195 pcSlice->setViewId ( getViewId() ); 1195 1196 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 1196 1197 #else 1197 pcPic ->setViewIndex ( getViewIndex() ); 1198 pcPic ->setViewIndex ( getViewIndex() ); 1198 1199 pcPic ->setIsDepth( getIsDepth() ); 1199 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1200 #endif 1201 #endif 1200 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1201 #endif 1202 #endif 1202 1203 //set default slice level flag to the same as SPS level flag 1203 1204 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 1207 1208 if( pcSlice->getSliceType() == B_SLICE ) 1208 1209 { 1209 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1210 { 1210 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1211 { 1211 1212 pcSlice->setSliceType( P_SLICE ); 1212 1213 } … … 1216 1217 if( pcSlice->getSliceType() == B_SLICE ) 1217 1218 { 1218 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1219 { 1219 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1220 { 1220 1221 pcSlice->setSliceType( I_SLICE ); 1221 1222 } … … 1231 1232 pcSlice->setSliceType(I_SLICE); 1232 1233 } 1233 1234 1234 1235 // Set the nal unit type 1235 1236 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); … … 1285 1286 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1286 1287 } 1287 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1288 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1288 1289 || (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) 1289 1290 ) … … 1294 1295 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 1295 1296 1296 if(pcSlice->getTLayer() > 0 1297 if(pcSlice->getTLayer() > 0 1297 1298 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N // Check if not a leading picture 1298 1299 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R … … 1364 1365 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1365 1366 { 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(); 1367 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1368 pcSlice->setDiscardableFlag ( false ); 1369 } 1370 1371 const TComVPS* vps = pcSlice->getVPS(); 1371 1372 #if NH_3D 1372 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1373 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1373 1374 #else 1374 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1375 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1375 1376 #endif 1376 1377 #if NH_3D 1377 pcSlice->setIvPicLists( m_ivPicLists ); 1378 pcSlice->setIvPicLists( m_ivPicLists ); 1378 1379 1379 1380 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid; 1380 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1381 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1381 1382 #else 1382 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1383 #endif 1384 1385 1386 1387 Bool interLayerPredLayerIdcPresentFlag = false; 1383 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1384 #endif 1385 1386 1387 1388 Bool interLayerPredLayerIdcPresentFlag = false; 1388 1389 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 1389 { 1390 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1390 { 1391 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1391 1392 if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 ) 1392 1393 { 1393 1394 if ( !vps->getMaxOneActiveRefLayerFlag() ) 1394 { 1395 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1395 { 1396 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1396 1397 } 1397 1398 #if NH_3D … … 1400 1401 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 1401 1402 #endif 1402 { 1403 interLayerPredLayerIdcPresentFlag = true; 1403 { 1404 interLayerPredLayerIdcPresentFlag = true; 1404 1405 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 1405 1406 { 1406 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1407 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1407 1408 } 1408 1409 } … … 1411 1412 if ( !interLayerPredLayerIdcPresentFlag ) 1412 1413 { 1413 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1414 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1414 1415 { 1415 1416 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); … … 1418 1419 1419 1420 1420 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1421 1421 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1422 1422 1423 #if NH_3D 1423 1424 if ( m_pcEncTop->decProcAnnexI() ) 1424 { 1425 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1425 { 1426 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1426 1427 if ( pcSlice->getInCmpPredAvailFlag() ) 1427 { 1428 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1428 { 1429 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1429 1430 } 1430 1431 else … … 1440 1441 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() ) ); 1441 1442 } 1442 1443 1443 1444 exit(EXIT_FAILURE); 1444 1445 } 1445 1446 } 1446 pcSlice->init3dToolParameters(); 1447 pcSlice->checkInCompPredRefLayers(); 1448 } 1447 pcSlice->init3dToolParameters(); 1448 pcSlice->checkInCompPredRefLayers(); 1449 } 1449 1450 #if NH_3D_IV_MERGE 1450 1451 // This needs to be done after initialization of 3D tool parameters. … … 1453 1454 #endif 1454 1455 1455 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1456 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1456 1457 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 1457 1458 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); … … 1462 1463 1463 1464 pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 1464 1465 1466 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1465 1466 1467 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1467 1468 #else 1468 1469 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 1470 1471 #endif 1471 1472 // Set reference list 1472 #if NH_MV 1473 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1473 #if NH_MV 1474 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1474 1475 #else 1475 1476 pcSlice->setRefPicList ( rcListPic ); … … 1483 1484 #endif 1484 1485 #if NH_3D_IC 1485 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1486 pcSlice->setICEnableNum( m_aICEnableNum ); 1486 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1487 pcSlice->setICEnableNum( m_aICEnableNum ); 1487 1488 #endif 1488 1489 … … 1491 1492 if ( pcSlice->getSliceType() == B_SLICE ) 1492 1493 { 1493 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1494 { 1495 pcSlice->setSliceType( P_SLICE ); 1494 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1495 { 1496 pcSlice->setSliceType( P_SLICE ); 1496 1497 } 1497 1498 } … … 1572 1573 1573 1574 #if NH_3D_VSO 1574 // Should be moved to TEncTop !!! 1575 // Should be moved to TEncTop !!! 1575 1576 Bool bUseVSO = m_pcEncTop->getUseVSO(); 1576 1577 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1577 1578 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1578 1579 1579 1580 pcRdCost->setUseVSO( bUseVSO ); … … 1731 1732 #endif 1732 1733 #if NH_3D 1733 pcSlice->setDepthToDisparityLUTs(); 1734 pcSlice->setDepthToDisparityLUTs(); 1734 1735 1735 1736 #endif … … 1990 1991 cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled()); 1991 1992 #if NH_3D 1992 pcPic->compressMotion(2); 1993 pcPic->compressMotion(2); 1993 1994 #else 1994 1995 pcPic->compressMotion(); … … 2065 2066 pcPic->setReconMark ( true ); 2066 2067 #if NH_MV 2067 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2068 std::vector<Int> temp; 2069 TComSlice::markCurrPic( pcPic ); 2068 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2069 std::vector<Int> temp; 2070 TComSlice::markCurrPic( pcPic ); 2070 2071 #endif 2071 2072 m_bFirst = false; … … 2104 2105 //-- all 2105 2106 #if NH_MV 2106 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2107 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2107 2108 #else 2108 2109 printf( "\n\nSUMMARY --------------------------------------------------------\n" ); … … 2412 2413 #if H_3D_VSO_SYNTH_DIST_OUT 2413 2414 } 2414 #endif 2415 #endif 2415 #endif 2416 #endif 2416 2417 /* calculate the size of the access unit, excluding: 2417 2418 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) … … 2536 2537 2537 2538 #if NH_MV 2538 assert( 0 ); // Field coding and MV need to be aligned. 2539 assert( 0 ); // Field coding and MV need to be aligned. 2539 2540 #else 2540 2541 … … 2979 2980 #if NH_MV 2980 2981 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 2981 { 2982 2982 { 2983 2983 2984 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 ) 2984 2985 { 2985 2986 return; 2986 2987 } 2987 2988 2988 2989 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid ); 2989 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2990 2991 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2992 2993 // GT: check if SliceType should be checked here. 2990 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2991 2992 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2993 2994 // GT: check if SliceType should be checked here. 2994 2995 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2995 2996 { 2996 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2997 2997 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2998 2998 2999 Int finalIdxToTempIdxMap[16]; 2999 3000 for( Int k = 0; k < 16; k++ ) … … 3009 3010 // get position in temp. list 3010 3011 Int refPicLayerId = pcSlice->getRefPicLayerId(k); 3011 Int idxInTempList = 0; 3012 Int idxInTempList = 0; 3012 3013 for (; idxInTempList < numPicsInTempList; idxInTempList++) 3013 3014 { 3014 3015 if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId ) 3015 3016 { 3016 break; 3017 break; 3017 3018 } 3018 3019 } 3019 3020 3020 3021 Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ]; 3021 3022 // Add negative from behind 3023 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3024 3022 3023 // Add negative from behind 3024 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3025 3025 3026 Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ; 3026 3027 if ( curIsModified ) 3027 3028 { 3028 isModified = true; 3029 isModified = true; 3029 3030 assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 3030 3031 } 3031 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3032 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3032 3033 } 3033 3034 } 3034 3035 3035 3036 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3036 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3037 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3037 3038 3038 3039 if( isModified ) 3039 3040 { 3040 3041 Int refIdx = 0; 3041 3042 3042 3043 for( Int i = 0; i < numPicsInFinalRefList; i++ ) 3043 3044 { 3044 if( finalIdxToTempIdxMap[i] >= 0 ) 3045 if( finalIdxToTempIdxMap[i] >= 0 ) 3045 3046 { 3046 3047 refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] ); … … 3052 3053 while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId()) ) 3053 3054 { 3054 refIdx++; 3055 refIdx++; 3055 3056 } 3056 3057 refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.