Changeset 618 in 3DVCSoftware for branches/HTM-8.0-dev0/source/Lib/TLibEncoder


Ignore:
Timestamp:
9 Sep 2013, 23:15:14 (12 years ago)
Author:
tech
Message:

Incorporated:

  • MV-HEVC 5 HLS
  • Cleanups
  • Further ENC_DEC trace functionalities.
  • Update cfg files.
Location:
branches/HTM-8.0-dev0/source/Lib/TLibEncoder
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r615 r618  
    229229    }
    230230  }
     231#if H_MV5
     232#if H_MV
     233  if ( pcPPS->getLayerId() > 0 )
     234  {
     235    WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
     236  }
     237
     238  if( pcPPS->getPpsInferScalingListFlag( ) )
     239  {
     240    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     241  }
     242  else
     243  { 
     244#endif 
     245#endif
    231246  WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
    232247  if( pcPPS->getScalingListPresentFlag() )
     
    237252    codeScalingList( m_pcSlice->getScalingList() );
    238253  }
     254#if H_MV5
     255#if H_MV
     256  }
     257#endif
     258#endif
    239259  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
    240260  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
     
    319339  {
    320340    WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(),             "tiles_fixed_structure_flag");
     341#if !H_MV5
    321342#if H_MV
    322343    if ( pcSPS->getLayerId() > 0 )
     
    324345      WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
    325346    }
     347#endif
    326348#endif
    327349    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
     
    429451#endif
    430452  WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
     453#if H_MV5
     454#if H_MV
     455  if ( pcSPS->getLayerId() > 0 )
     456  {
     457    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
     458  }
     459
     460  if ( pcSPS->getUpdateRepFormatFlag() )
     461  {
     462#endif
     463#endif
    431464  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
    432465  assert(pcSPS->getChromaFormatIdc () == 1);
     
    439472  WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (),   "pic_width_in_luma_samples" );
    440473  WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(),   "pic_height_in_luma_samples" );
     474#if H_MV5
     475#if H_MV
     476  }
     477#endif
     478#endif
    441479  Window conf = pcSPS->getConformanceWindow();
    442480
     
    449487    WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
    450488  }
    451 
     489#if H_MV5
     490#if H_MV
     491  if ( pcSPS->getUpdateRepFormatFlag() )
     492  {
     493#endif
     494#endif
    452495  WRITE_UVLC( pcSPS->getBitDepthY() - 8,             "bit_depth_luma_minus8" );
    453496  WRITE_UVLC( pcSPS->getBitDepthC() - 8,             "bit_depth_chroma_minus8" );
    454 
     497#if H_MV5
     498#if H_MV
     499  }
     500#endif
     501#endif
    455502  WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
    456503
     
    478525  if(pcSPS->getScalingListFlag())
    479526  {
     527#if H_MV5
     528#if H_MV
     529    if ( pcSPS->getLayerId() > 0 )
     530    {   
     531      WRITE_FLAG( pcSPS->getSpsInferScalingListFlag( ) ? 1 : 0 , "sps_infer_scaling_list_flag" );
     532    }
     533
     534    if ( pcSPS->getSpsInferScalingListFlag() )
     535    {
     536      WRITE_CODE( pcSPS->getSpsScalingListRefLayerId( ), 6, "sps_scaling_list_ref_layer_id" );
     537    }
     538    else
     539    {   
     540#endif
     541#endif
    480542    WRITE_FLAG( pcSPS->getScalingListPresentFlag() ? 1 : 0,                          "sps_scaling_list_data_present_flag" );
    481543    if(pcSPS->getScalingListPresentFlag())
     
    486548      codeScalingList( m_pcSlice->getScalingList() );
    487549    }
     550#if H_MV5
     551#if H_MV
     552    }
     553#endif
     554#endif
    488555  }
    489556  WRITE_FLAG( pcSPS->getUseAMP() ? 1 : 0,                                            "amp_enabled_flag" );
     
    531598  }
    532599
     600#if !H_MV5
    533601#if H_MV
    534602  WRITE_FLAG( 1, "sps_extension_flag" );
     
    586654#endif
    587655}
     656#else
     657#if !H_MV
     658  WRITE_FLAG( 0, "sps_extension_flag" );
     659#else
     660  WRITE_FLAG( 1, "sps_extension_flag" );
     661  codeSPSExtension( pcSPS );
     662#if !H_3D
     663  WRITE_FLAG( 0, "sps_extension2_flag" );
     664#else
     665  WRITE_FLAG( 1, "sps_extension2_flag" );
     666  codeSPSExtension2( pcSPS, viewIndex, depthFlag );
     667  WRITE_FLAG( 0, "sps_extension3_flag" );
     668#endif 
     669#endif
     670}
     671
     672#if H_MV
     673Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS )
     674{
     675  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
     676  WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );
     677}
     678#endif
     679
     680#if H_3D
     681Void TEncCavlc::codeSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
     682{
     683#if H_3D_QTLPC
     684//GT: This has to go to VPS
     685if( depthFlag )
     686{
     687  WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");
     688  WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
     689}
     690#endif
     691  if (!depthFlag )
     692  {
     693    WRITE_UVLC( pcSPS->getCamParPrecision(), "cp_precision" );
     694    WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "cp_in_slice_header_flag" );
     695    if( !pcSPS->hasCamParInSliceHeader() )
     696    {
     697      for( UInt uiIndex = 0; uiIndex < viewIndex; uiIndex++ )
     698      {
     699        WRITE_SVLC( pcSPS->getCodedScale    ()[ uiIndex ],                                      "cp_scale" );
     700        WRITE_SVLC( pcSPS->getCodedOffset   ()[ uiIndex ],                                      "cp_off" );
     701        WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiIndex ] + pcSPS->getCodedScale ()[ uiIndex ], "cp_inv_scale_plus_scale" );
     702        WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiIndex ] + pcSPS->getCodedOffset()[ uiIndex ], "cp_inv_off_plus_off" );
     703      }
     704    }
     705  }
     706}
     707#endif
     708#endif
    588709
    589710Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     
    592713  WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
    593714#if H_MV
     715#if H_MV5
     716  WRITE_CODE( pcVPS->getMaxLayersMinus1(),       6,        "vps_max_layers_minus1" );
     717#else
    594718  WRITE_CODE( pcVPS->getMaxLayers() - 1,            6,        "vps_max_layers_minus1" );
     719#endif
    595720#else
    596721  WRITE_CODE( 0,                                    6,        "vps_reserved_zero_6bits" );
     
    675800    }
    676801  }
     802#if !H_MV5
    677803#if H_MV
    678804  WRITE_FLAG( 1,                                             "vps_extension_flag" );
     
    860986  return;
    861987}
     988#else
     989#if H_MV
     990  WRITE_FLAG( 1,                     "vps_extension_flag" );
     991  m_pcBitIf->writeAlignOne();
     992  codeVPSExtension( pcVPS );                           
     993#if H_3D
     994  WRITE_FLAG( 1,                     "vps_extension2_flag" );
     995  m_pcBitIf->writeAlignOne();     
     996  codeVPSExtension2( pcVPS );
     997  WRITE_FLAG( 0,                     "vps_extension3_flag" );
     998#else
     999  WRITE_FLAG( 0,                     "vps_extension2_flag" );
     1000#endif
     1001#else
     1002  WRITE_FLAG( 0,                     "vps_extension_flag" );
     1003#endif
     1004  //future extensions here..
     1005}
     1006
     1007#endif
     1008
     1009
     1010#if H_MV5
     1011#if H_MV
     1012Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS )
     1013{
     1014  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
     1015  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
     1016  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
     1017 
     1018  for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
     1019  {
     1020    WRITE_FLAG( pcVPS->getScalabilityMaskFlag( type ) ? 1 : 0,   "scalability_mask_flag[i]" );
     1021  }
     1022
     1023  for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
     1024  {
     1025    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");   
     1026  }
     1027
     1028  if ( pcVPS->getSplittingFlag() )
     1029  { // Ignore old dimension id length
     1030    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 );       
     1031  }   
     1032
     1033  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
     1034
     1035  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1036  {
     1037    if ( pcVPS->getVpsNuhLayerIdPresentFlag() )
     1038    {     
     1039      WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
     1040  }
     1041    else
     1042    {
     1043      assert( pcVPS->getLayerIdInNuh( i ) == i );
     1044  }
     1045
     1046    assert(  pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i );
     1047
     1048    for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     1049    {
     1050      if ( !pcVPS->getSplittingFlag() )
     1051      {
     1052        WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");     
     1053      }
     1054      else
     1055      {
     1056        assert( pcVPS->getDimensionId( i, j ) ==  pcVPS->inferDimensionId( i, j )  );
     1057      }
     1058    }
     1059  }
     1060
     1061  // GT spec says: trac #39
     1062  // if ( pcVPS->getNumViews() > 1 ) 
     1063  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
     1064  {
     1065    WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
     1066  }
     1067
     1068  for( Int i = 0; i < pcVPS->getNumViews(); i++ )
     1069  {
     1070    WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
     1071  }
     1072
     1073  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1074  {
     1075    for( Int j = 0; j < i; j++ )
     1076    {
     1077      WRITE_FLAG( pcVPS->getDirectDependencyFlag( i, j ),    "direct_dependency_flag[i][j]" );
     1078    }
     1079  }
     1080
     1081  WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" );
     1082
     1083  if ( pcVPS->getMaxTidRefPresentFlag() )
     1084  {   
     1085    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     1086    {
     1087      WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
     1088    }
     1089  }
     1090
     1091  WRITE_FLAG( pcVPS->getAllRefLayersActiveFlag( ) ? 1 : 0 , "all_ref_layers_active_flag" );
     1092  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
     1093  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
     1094
     1095  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     1096  {
     1097    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
     1098    if( !pcVPS->getVpsProfilePresentFlag( i ) )
     1099    {   
     1100      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
     1101    }
     1102    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     1103  }
     1104
     1105  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
     1106
     1107  WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
     1108
     1109  if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
     1110  {
     1111    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
     1112    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 );
     1113  }
     1114
     1115  if( numOutputLayerSets > 1)
     1116  {
     1117    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
     1118  } 
     1119
     1120  for( Int i = 1; i < numOutputLayerSets; i++ )
     1121  {
     1122    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
     1123    {     
     1124      WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
     1125      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )
     1126      {
     1127        WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
     1128      }     
     1129    }
     1130    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     1131    {     
     1132      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     1133    }
     1134  }
     1135
     1136  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
     1137  if ( pcVPS->getRepFormatIdxPresentFlag() )
     1138  {
     1139    WRITE_CODE( pcVPS->getVpsNumRepFormatsMinus1( ), 4, "vps_num_rep_formats_minus1" );
     1140  }
     1141
     1142  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
     1143  {   
     1144    TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);     
     1145    codeRepFormat( pcRepFormat );
     1146  }
     1147
     1148  if( pcVPS->getRepFormatIdxPresentFlag() )
     1149  {
     1150    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1151    {
     1152      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
     1153      {
     1154        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );
     1155      }
     1156    }
     1157  }
     1158
     1159  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     1160  WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
     1161  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
     1162
     1163    for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1164    {
     1165      for( Int j = 0; j < i; j++ )
     1166      {
     1167        if (pcVPS->getDirectDependencyFlag( i, j) )
     1168        {       
     1169          assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
     1170          WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
     1171        }
     1172      }
     1173    }
     1174   
     1175    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" );
     1176    WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );
     1177
     1178    if( pcVPS->getVpsVuiPresentFlag() )
     1179    {
     1180      m_pcBitIf->writeAlignOne();  // vps_vui_alignment_bit_equal_to_one
     1181      codeVPSVUI( pcVPS );
     1182    }     
     1183}
     1184
     1185Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )
     1186{
     1187  assert( pcRepFormat );
     1188
     1189  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
     1190
     1191  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1192  {
     1193    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
     1194  }
     1195  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
     1196  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     1197  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
     1198  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
     1199}
     1200
     1201Void TEncCavlc::codeVPSVUI( TComVPS* pcVPS )
     1202{
     1203  assert( pcVPS );
     1204
     1205  TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     1206
     1207  assert( pcVPSVUI );
     1208
     1209  WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
     1210  WRITE_FLAG( pcVPSVUI->getPicRatePresentVpsFlag( ) ? 1 : 0 , "pic_rate_present_vps_flag" );
     1211  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
     1212  {
     1213    for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
     1214    {
     1215      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     1216      {
     1217        if( pcVPSVUI->getBitRatePresentVpsFlag( ) )
     1218        {
     1219          WRITE_FLAG( pcVPSVUI->getBitRatePresentFlag( i, j ) ? 1 : 0 , "bit_rate_present_flag" );
     1220        }
     1221        if( pcVPSVUI->getBitRatePresentVpsFlag( )  )
     1222        {
     1223          WRITE_FLAG( pcVPSVUI->getPicRatePresentFlag( i, j ) ? 1 : 0 , "pic_rate_present_flag" );
     1224        }
     1225        if( pcVPSVUI->getBitRatePresentFlag( i, j ) )
     1226        {
     1227          WRITE_CODE( pcVPSVUI->getAvgBitRate( i, j ), 16, "avg_bit_rate" );
     1228          WRITE_CODE( pcVPSVUI->getMaxBitRate( i, j ), 16, "max_bit_rate" );
     1229        }
     1230        if( pcVPSVUI->getPicRatePresentFlag( i, j ) )
     1231        {
     1232          WRITE_CODE( pcVPSVUI->getConstantPicRateIdc( i, j ), 2, "constant_pic_rate_idc" );
     1233          WRITE_CODE( pcVPSVUI->getAvgPicRate( i, j ), 16, "avg_pic_rate" );
     1234        }
     1235      }
     1236    }
     1237  }
     1238
     1239  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1240  {
     1241    for( Int  j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
     1242    {
     1243      WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
     1244    }
     1245  }
     1246
     1247  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
     1248
     1249  if( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) )
     1250  {
     1251    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1252    {
     1253      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
     1254      {
     1255        WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
     1256        if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 )
     1257        {
     1258          WRITE_FLAG( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ? 1 : 0 , "ctu_based_offset_enabled_flag" );
     1259          if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) )
     1260          {
     1261            WRITE_UVLC( pcVPSVUI->getMinHorizontalCtuOffsetPlus1( i, j ), "min_horizontal_ctu_offset_plus1" );
     1262          }
     1263        }
     1264      }
     1265    }
     1266  }
     1267}
     1268#endif
     1269
     1270#if H_3D
     1271Void TEncCavlc::codeVPSExtension2( TComVPS* pcVPS )
     1272{
     1273  for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1274  {
     1275    if (i!= 0)
     1276    {
     1277      if ( !( pcVPS->getDepthId( i ) == 1 ) )
     1278      {
     1279#if H_3D_IV_MERGE
     1280        WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
     1281#endif
     1282#if H_3D_ARP
     1283        WRITE_FLAG( pcVPS->getUseAdvRP             ( i ) ? 1 : 0,  "iv_res_pred_flag[i]"  );
     1284#endif
     1285#if H_3D_NBDV_REF
     1286        WRITE_FLAG( pcVPS->getDepthRefinementFlag  ( i ) ? 1 : 0 , "depth_refinement_flag[i]");
     1287#endif
     1288#if H_3D_VSP
     1289        WRITE_FLAG( pcVPS->getViewSynthesisPredFlag( i ) ? 1 : 0 , "view_synthesis_pred_flag[i]");
     1290#endif
     1291      }         
     1292      else
     1293      {
     1294        WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
     1295        //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
     1296#if H_3D_DIM_DLT
     1297        if( pcVPS->getVpsDepthModesFlag( i ) )
     1298        {
     1299          WRITE_FLAG( pcVPS->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" );
     1300        }
     1301        if( pcVPS->getUseDLTFlag( i ) )
     1302        {
     1303          // code mapping
     1304          WRITE_UVLC(pcVPS->getNumDepthValues(i), "num_depth_values_in_dlt[i]");
     1305          for(Int d=0; d<pcVPS->getNumDepthValues(i); d++)
     1306          {
     1307            WRITE_UVLC( pcVPS->idx2DepthValue(i, d), "dlt_depth_value[i][d]" );
     1308          }
     1309        }       
     1310#endif
     1311#if LGE_INTER_SDC_E0156
     1312        WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
     1313#endif
     1314      }
     1315    } 
     1316  }
     1317#if H_3D_TMVP
     1318  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
     1319#endif
     1320}
     1321#endif
     1322#endif
    8621323
    8631324Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
     
    9091370  {
    9101371#if H_MV   
     1372#if H_MV5
     1373    Int esb = 0;  //Don't use i, otherwise will shadow something below
     1374    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1375    {
     1376      esb++;
     1377      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
     1378    }
     1379
     1380    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1381    {
     1382      esb++;
     1383      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
     1384    }
     1385
     1386    for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     1387#else
    9111388    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    9121389    {
     
    9151392
    9161393    for (Int i = 1; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)   
     1394#endif
    9171395#else
    9181396    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     
    10521530    }
    10531531#if H_MV
     1532#if H_MV5
     1533    Int layerId = pcSlice->getLayerId();
     1534    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     1535    {   
     1536      WRITE_FLAG( pcSlice->getInterLayerPredEnabledFlag( ) ? 1 : 0 , "inter_layer_pred_enabled_flag" );
     1537      if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 )
     1538      {           
     1539        if( !vps->getMaxOneActiveRefLayerFlag()) 
     1540        {
     1541          WRITE_CODE( pcSlice->getNumInterLayerRefPicsMinus1( ), pcSlice->getNumInterLayerRefPicsMinus1Len( ), "num_inter_layer_ref_pics_minus1" );
     1542        }
     1543        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
     1544        {       
     1545          for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ )   
     1546          {
     1547            WRITE_CODE( pcSlice->getInterLayerPredLayerIdc( idx ), pcSlice->getInterLayerPredLayerIdcLen( ), "inter_layer_pred_layer_idc" );
     1548          }
     1549        }
     1550      } 
     1551    }
     1552#else
    10541553    Int layerIdInVps       = pcSlice->getLayerIdInVps();
    10551554    if( pcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )
     
    10741573    }
    10751574
     1575#endif
    10761576#endif
    10771577    if(pcSlice->getSPS()->getUseSAO())
     
    11781678    if ( pcSlice->getEnableTMVPFlag() )
    11791679    {
     1680#if !H_MV5
    11801681#if H_MV
    11811682      if( pcSlice->getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 )
     
    11901691      {
    11911692#endif
     1693#endif
    11921694      if ( pcSlice->getSliceType() == B_SLICE )
    11931695      {
     
    12021704      }
    12031705    }
     1706#if !H_MV5
    12041707#if H_MV
    12051708    }
     1709#endif
    12061710#endif
    12071711    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r608 r618  
    8484  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    8585  Void  codeVPS                 ( TComVPS* pcVPS );
     86#if H_MV5
     87#if H_MV
     88  Void  codeVPSExtension       ( TComVPS *pcVPS );
     89  Void  codeRepFormat          ( TComRepFormat* pcRepFormat );
     90  Void  codeVPSVUI             ( TComVPS* pcVPS );
     91#endif
     92#endif
    8693  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
     94#if H_MV5
     95#if H_MV
     96  Void  codeSPSExtension        ( TComSPS* pcSPS );
     97#endif
     98#endif
    8799#if H_3D
     100#if H_MV5
     101  Void  codeVPSExtension2       ( TComVPS* pcVPS );
     102  Void  codeSPSExtension2       ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag  );
     103#endif
    88104  Void  codeSPS                 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag );
    89105#else
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r608 r618  
    7777  Int m_interLayerPredLayerIdc [MAX_NUM_REF_PICS];
    7878  Int m_interViewRefPosL[2][MAX_NUM_REF_PICS]; 
     79#if !H_MV5
    7980  Int m_collocatedRefLayerIdx;
     81#endif
    8082#endif
    8183  GOPEntry()
     
    9597#if H_MV
    9698  , m_numActiveRefLayerPics(0)
     99#if !H_MV5
    97100  , m_collocatedRefLayerIdx(-1)
     101#endif
    98102#endif
    99103  {
     
    357361  Int       m_layerIdInVps;
    358362  Int       m_viewId;
     363#if H_MV5
     364  Int       m_viewIndex;
     365#endif
    359366#endif
    360367
    361368#if H_3D
     369#if !H_MV5
    362370  Int       m_viewIndex;
     371#endif
    363372  Bool      m_isDepth;
    364373
     
    417426  , m_layerIdInVps(-1)
    418427  , m_viewId(-1)
     428#if H_MV5
     429  , m_viewIndex(-1)
     430#endif
    419431#if H_3D
     432#if !H_MV5
    420433  , m_viewIndex(-1)
     434#endif
    421435  , m_isDepth(false)
    422436  , m_bUseVSO(false)
     
    451465  Void      setViewId                        ( Int viewId  )      { m_viewId  = viewId;  }
    452466  Int       getViewId                        ()                   { return m_viewId;    }
    453 #if H_3D
     467#if H_MV5
    454468  Void      setViewIndex                     ( Int viewIndex  )   { m_viewIndex  = viewIndex;  }
    455469  Int       getViewIndex                     ()                   { return m_viewIndex;    }
     470#endif
     471#if H_3D
     472#if !H_MV5
     473  Void      setViewIndex                     ( Int viewIndex  )   { m_viewIndex  = viewIndex;  }
     474  Int       getViewIndex                     ()                   { return m_viewIndex;    }
     475#endif
    456476  Void      setIsDepth                       ( Bool isDepth )   { m_isDepth = isDepth; }
    457477  Bool      getIsDepth                       ()                 { return m_isDepth; }
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r616 r618  
    471471    pcPic->setCurrSliceIdx(0);
    472472
     473
     474#if H_MV5
     475#if H_MV
     476    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() );     
     477#else
     478    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     479#endif
     480#else
    473481#if H_3D
    474482    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() );     
    475483#else
    476484    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     485#endif
    477486#endif
    478487    pcSlice->setLastIDR(m_iLastIDR);
    479488    pcSlice->setSliceIdx(0);
    480489#if H_MV
     490#if H_MV5
     491    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
     492#else
    481493    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer );
     494#endif
    482495    pcPic  ->setLayerId     ( getLayerId()   );
    483496    pcPic  ->setViewId      ( getViewId()    );   
     
    642655    refPicListModification->setRefPicListModificationFlagL1(0);
    643656#if H_MV
     657#if H_MV5
     658    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 )
     659    {
     660      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     661      pcSlice->setDiscardableFlag           ( false );     
     662    }   
     663
     664    TComVPS*           vps = pcSlice->getVPS();     
     665    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
     666    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
     667   
     668    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
     669    {         
     670      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     671      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
     672      {
     673        if ( !vps->getMaxOneActiveRefLayerFlag() )
     674        {   
     675          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
     676        }
     677        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
     678        {       
     679          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
     680          {
     681            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
     682          }
     683        }
     684      }
     685    }
     686    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     687   
     688    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     689    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     690    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     691
     692    std::vector< TComPic* >    tempRefPicLists[2];
     693    std::vector< Bool     >    usedAsLongTerm [2];
     694    Int       numPocTotalCurr;
     695
     696    pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
     697   
     698
     699    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );   
     700#else
    644701    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    645702    {
     
    692749    }
    693750
     751#endif
    694752#else
    695753    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    702760
    703761    //  Set reference list
     762#if H_MV5
     763#if H_MV   
     764    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
     765#else
     766    pcSlice->setRefPicList ( rcListPic );
     767#endif
     768 
     769#if H_3D_ARP
     770    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
     771    pcSlice->setARPStepNum();
     772    if(pcSlice->getARPStepNum() > 1)
     773    {
     774      for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ )
     775      {
     776        Int  iViewIdx =   pcSlice->getVPS()->getViewIndex(iLayerId);
     777        Bool bIsDepth = ( pcSlice->getVPS()->getDepthId  ( iLayerId ) == 1 );
     778        if( iViewIdx<getViewIndex() && !bIsDepth )
     779        {
     780          pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx );
     781        }
     782      }
     783    }
     784#endif
     785#else
    704786#if H_MV   
    705787    pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer );
     
    722804    pcSlice->setRefPicList ( rcListPic );
    723805#endif
    724 
     806#endif
    725807#if H_3D
    726808    pcSlice->setIvPicLists( m_ivPicLists );         
     
    20842166      pcPic->setReconMark   ( true );
    20852167#if H_MV
     2168#if H_MV5
     2169      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     2170#else
    20862171      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
     2172#endif
    20872173      std::vector<Int> temp;
    20882174      TComSlice::markCurrPic( pcPic );
     
    29163002
    29173003#if H_MV
     3004#if H_MV5
     3005Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
     3006{
     3007 
     3008  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
     3009  {
     3010    return;
     3011  }
     3012 
     3013  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
     3014  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
     3015
     3016  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList(); 
     3017
     3018  // GT: check if SliceType should be checked here.
     3019  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
     3020  {
     3021    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
     3022           
     3023    Int finalIdxToTempIdxMap[16];
     3024    for( Int k = 0; k < 16; k++ )
     3025    {
     3026      finalIdxToTempIdxMap[ k ] = -1;
     3027    }
     3028
     3029    Bool isModified = false;
     3030    if ( numPicsInTempList > 1 )
     3031    {
     3032      for( Int k = 0; k < pcSlice->getNumActiveRefLayerPics(); k++ )
     3033      {
     3034        // get position in temp. list
     3035        Int refPicLayerId = pcSlice->getRefPicLayerId(k);
     3036        Int idxInTempList = 0;
     3037        for (; idxInTempList < numPicsInTempList; idxInTempList++)
     3038        {
     3039          if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
     3040          {
     3041            break;
     3042          }
     3043        }
     3044
     3045        Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
     3046       
     3047        // Add negative from behind
     3048        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
     3049       
     3050        Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
     3051        if ( curIsModified )
     3052        {
     3053          isModified = true;
     3054          assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
     3055        }
     3056        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;             
     3057      }
     3058    }
     3059
     3060    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     3061    refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
     3062
     3063    if( isModified )
     3064    {
     3065      Int refIdx = 0;
     3066     
     3067      for( Int i = 0; i < numPicsInFinalRefList; i++ )
     3068      {
     3069        if( finalIdxToTempIdxMap[i] >= 0 )
     3070        {
     3071          refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
     3072        }
     3073        else
     3074        {
     3075          ///* Fill gaps with temporal references *///
     3076          // Forward inter layer reference pictures
     3077          while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
     3078          {
     3079            refIdx++;
     3080          }
     3081          refPicListModification->setRefPicSetIdxL( li, i, refIdx );
     3082          refIdx++;
     3083        }
     3084      }
     3085    }
     3086  }
     3087}
     3088#else
    29183089Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )
    29193090{
     
    29793150}
    29803151#endif
     3152#endif
    29813153//! \}
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncGOP.h

    r608 r618  
    9999#if H_MV
    100100  TComPicLists*           m_ivPicLists;
     101#if H_MV5
     102  std::vector<TComPic*>   m_refPicSetInterLayer0;
     103  std::vector<TComPic*>   m_refPicSetInterLayer1;
     104#else
    101105  std::vector<TComPic*>   m_refPicSetInterLayer;
     106#endif
    102107
    103108  Int                     m_pocLastCoded;
     
    211216  }
    212217#if H_MV
     218#if H_MV5
     219   Void  xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid );
     220#else
    213221   Void  xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid );
     222#endif
    214223#endif
    215224  Void dblMetric( TComPic* pcPic, UInt uiNumSlices );
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r612 r618  
    649649  // residual flag
    650650  m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) );
     651#if H_MV_ENC_DEC_TRAC
     652  DTRACE_CU("sdc_residual_flag[i]", uiResidual)
     653#endif 
    651654 
    652655  if (uiResidual)
     
    654657    // encode sign bit of residual
    655658    m_pcBinIf->encodeBinEP( uiSign );
     659#if H_MV_ENC_DEC_TRAC
     660    DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
     661#endif
    656662   
    657663#if H_3D_DIM_DLT
     
    664670    // encode residual magnitude
    665671    uiAbsIdx -= 1;
     672
     673#if H_MV_ENC_DEC_TRAC
     674    DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx)
     675#endif
     676
    666677    // prefix part
    667678    if ( uiAbsIdx == 0 )
     679    {
    668680      m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
     681    }
    669682    else
    670683    {
     
    679692      }
    680693      if ( uiAbsIdx < uiPrefixThreshold )
     694      {
    681695        m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
    682       // suffix part
     696      }     
    683697      else
    684       {
     698      { // suffix part
    685699        uiAbsIdx -= uiPrefixThreshold;
    686700        UInt uiSuffixLength = numBitsForValue(uiNumDepthValues - uiPrefixThreshold);
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSlice.cpp

    r608 r618  
    176176 \param pPPS          PPS associated with the slice
    177177 */
     178#if H_MV5
     179#if H_MV
     180Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId )
     181#else
     182Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )
     183#endif
     184#else
    178185#if H_3D
    179186Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId )
    180187#else
    181188Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )
     189#endif
    182190#endif
    183191{
     
    186194 
    187195  rpcSlice = pcPic->getSlice(0);
     196
     197#if H_MV5
     198  rpcSlice->setVPS( pVPS );
     199
     200  rpcSlice->setLayerId     ( layerId );
     201  rpcSlice->setViewId      ( pVPS->getViewId      ( layerId ) );   
     202  rpcSlice->setViewIndex   ( pVPS->getViewIndex   ( layerId ) );
     203#if H_3D
     204  rpcSlice->setIsDepth     ( pVPS->getDepthId     ( layerId ) != 0 );   
     205#endif
     206#else
    188207#if H_3D
    189208  // GT: Should also be activated for MV-HEVC at some stage
     
    195214  rpcSlice->setViewIndex   ( pVPS->getViewIndex   ( vpsLayerId ) );
    196215  rpcSlice->setIsDepth     ( pVPS->getDepthId     ( vpsLayerId ) != 0 );   
     216#endif
    197217#endif
    198218  rpcSlice->setSPS( pSPS );
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncSlice.h

    r608 r618  
    116116 
    117117  /// preparation of slice encoding (reference marking, QP and lambda)
     118#if H_MV5
     119#if H_MV
     120  Void    initEncSlice        ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
     121                                Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS, Int layerId );
     122#else
     123  Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
     124                                Int iGOPid,   TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );
     125#endif
     126#else
    118127#if H_3D
    119128  Void    initEncSlice        ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
     
    122131  Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
    123132                                Int iGOPid,   TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );
     133#endif
    124134#endif
    125135#if RATE_CONTROL_LAMBDA_DOMAIN
  • TabularUnified branches/HTM-8.0-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r608 r618  
    548548   * that chooses the actual compatibility based upon options */
    549549
     550#if H_MV5
     551#if H_MV 
     552  m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
     553  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
     554  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
     555#endif
     556#endif
    550557  m_cSPS.setPicWidthInLumaSamples         ( m_iSourceWidth      );
    551558  m_cSPS.setPicHeightInLumaSamples        ( m_iSourceHeight     );
     
    670677{
    671678#if H_MV
     679#if H_MV5
     680  m_cPPS.setLayerId( getLayerId() );
     681  if( getVPS()->getNumDirectRefLayers( getLayerId() ) > 0 )
     682#else
    672683  if( getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) > 0 )
     684#endif
    673685  {
    674686    m_cPPS.setListsModificationPresentFlag( true );
     
    736748  m_cPPS.setOutputFlagPresentFlag( false );
    737749#if H_MV
     750#if H_MV5
     751  m_cPPS.setNumExtraSliceHeaderBits( 2 );
     752#else
    738753  m_cPPS.setNumExtraSliceHeaderBits( 1 );
     754#endif
    739755#endif
    740756  m_cPPS.setSignHideFlag(getSignHideFlag());
Note: See TracChangeset for help on using the changeset viewer.