Changeset 622 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
11 Sep 2013, 14:40:25 (11 years ago)
Author:
tech
Message:

Merged 8.0-dev0@621 (MV-HEVC 5 HLS).

Location:
trunk/source/Lib/TLibEncoder
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r608 r622  
    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" );
     
    848974    } 
    849975  }
    850 #if H_3D_TMVP
    851976  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
    852 #endif
    853977#else
    854978  WRITE_FLAG( 0,                                             "vps_extension2_flag" );
     
    862986  return;
    863987}
     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
    8641323
    8651324Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
     
    9111370  {
    9121371#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
    9131388    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    9141389    {
     
    9171392
    9181393    for (Int i = 1; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)   
     1394#endif
    9191395#else
    9201396    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     
    10541530    }
    10551531#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
    10561553    Int layerIdInVps       = pcSlice->getLayerIdInVps();
    10571554    if( pcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )
     
    10761573    }
    10771574
     1575#endif
    10781576#endif
    10791577    if(pcSlice->getSPS()->getUseSAO())
     
    11801678    if ( pcSlice->getEnableTMVPFlag() )
    11811679    {
     1680#if !H_MV5
    11821681#if H_MV
    11831682      if( pcSlice->getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 )
     
    11921691      {
    11931692#endif
     1693#endif
    11941694      if ( pcSlice->getSliceType() == B_SLICE )
    11951695      {
     
    12041704      }
    12051705    }
     1706#if !H_MV5
    12061707#if H_MV
    12071708    }
     1709#endif
    12081710#endif
    12091711    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r608 r622  
    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
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r608 r622  
    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; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r608 r622  
    416416
    417417  Bool    bTrySplitDQP  = true;
    418 #if MTK_VSP_FIX_ALIGN_WD_E0172
     418#if H_3D_VSP
    419419  DisInfo DvInfo;
    420420  DvInfo.bDV = false;
     
    530530
    531531#if H_3D_NBDV
    532 #if !MTK_VSP_FIX_ALIGN_WD_E0172
    533       DisInfo DvInfo;
    534       DvInfo.bDV = false;
    535       DvInfo.m_acNBDV.setZero();
    536       DvInfo.m_aVIdxCan = 0;
    537 #if H_3D_NBDV_REF
    538       DvInfo.m_acDoNBDV.setZero();
    539 #endif
    540 #endif
    541532      if( rpcTempCU->getSlice()->getSliceType() != I_SLICE )
    542533      {
     
    598589          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
    599590#endif
    600 #if MTK_VSP_FIX_ALIGN_WD_E0172
     591#if H_3D_VSP
    601592          rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    602593#endif
     
    611602#endif
    612603        rpcTempCU->initEstData( uiDepth, iQP );
    613 #if MTK_VSP_FIX_ALIGN_WD_E0172
     604#if H_3D_VSP
    614605        rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    615606#endif
     
    638629            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );
    639630#endif
    640 #if MTK_VSP_FIX_ALIGN_WD_E0172
     631#if H_3D_VSP
    641632            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    642633#endif
     
    725716#endif
    726717                rpcTempCU->initEstData( uiDepth, iQP );
    727 #if MTK_VSP_FIX_ALIGN_WD_E0172
     718#if H_3D_VSP
    728719                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    729720#endif
     
    745736#endif
    746737            rpcTempCU->initEstData( uiDepth, iQP );
    747 #if MTK_VSP_FIX_ALIGN_WD_E0172
     738#if H_3D_VSP
    748739            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    749740#endif
     
    765756#endif
    766757            rpcTempCU->initEstData( uiDepth, iQP );
    767 #if MTK_VSP_FIX_ALIGN_WD_E0172
     758#if H_3D_VSP
    768759            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    769760#endif
     
    804795#endif
    805796                rpcTempCU->initEstData( uiDepth, iQP );
    806 #if MTK_VSP_FIX_ALIGN_WD_E0172
     797#if H_3D_VSP
    807798                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    808799#endif
     
    824815#endif
    825816                rpcTempCU->initEstData( uiDepth, iQP );
    826 #if MTK_VSP_FIX_ALIGN_WD_E0172
     817#if H_3D_VSP
    827818                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    828819#endif
     
    848839#endif
    849840                rpcTempCU->initEstData( uiDepth, iQP );
    850 #if MTK_VSP_FIX_ALIGN_WD_E0172
     841#if H_3D_VSP
    851842                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    852843#endif
     
    868859#endif
    869860                rpcTempCU->initEstData( uiDepth, iQP );
    870 #if MTK_VSP_FIX_ALIGN_WD_E0172
     861#if H_3D_VSP
    871862                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    872863#endif
     
    894885#endif
    895886                rpcTempCU->initEstData( uiDepth, iQP );
    896 #if MTK_VSP_FIX_ALIGN_WD_E0172
     887#if H_3D_VSP
    897888                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    898889#endif
     
    914905#endif
    915906                rpcTempCU->initEstData( uiDepth, iQP );
    916 #if MTK_VSP_FIX_ALIGN_WD_E0172
     907#if H_3D_VSP
    917908                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    918909#endif
     
    934925#endif
    935926                rpcTempCU->initEstData( uiDepth, iQP );
    936 #if MTK_VSP_FIX_ALIGN_WD_E0172
     927#if H_3D_VSP
    937928                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    938929#endif
     
    954945#endif
    955946                rpcTempCU->initEstData( uiDepth, iQP );
    956 #if MTK_VSP_FIX_ALIGN_WD_E0172
     947#if H_3D_VSP
    957948                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    958949#endif
     
    968959              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
    969960              rpcTempCU->initEstData( uiDepth, iQP );
    970 #if MTK_VSP_FIX_ALIGN_WD_E0172
     961#if H_3D_VSP
    971962              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    972963#endif
    973964              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
    974965              rpcTempCU->initEstData( uiDepth, iQP );
    975 #if MTK_VSP_FIX_ALIGN_WD_E0172
     966#if H_3D_VSP
    976967              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    977968#endif
     
    983974              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
    984975              rpcTempCU->initEstData( uiDepth, iQP );
    985 #if MTK_VSP_FIX_ALIGN_WD_E0172
     976#if H_3D_VSP
    986977              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    987978#endif
    988979              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
    989980              rpcTempCU->initEstData( uiDepth, iQP );
    990 #if MTK_VSP_FIX_ALIGN_WD_E0172
     981#if H_3D_VSP
    991982              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    992983#endif
     
    17611752  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    17621753  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1763 #if MTK_VSP_FIX_ALIGN_WD_E0172
    17641754  InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    17651755  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
    1766 #else
    1767 #if MTK_VSP_FIX_E0172
    1768   Int vspDir[MRG_MAX_NUM_CANDS_MEM];
    1769   memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1770   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand );
    1771 #else
    1772   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
    1773 #endif
    1774 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172
    17751756#else
    17761757  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    18401821#if H_3D_VSP
    18411822          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
    1842 #if MTK_VSP_FIX_ALIGN_WD_E0172
    18431823          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
    1844 #endif
    1845 #if MTK_VSP_FIX_E0172
    1846           rpcTempCU->setVSPDirSubParts( vspDir[uiMergeCand], 0, 0, uhDepth );
    1847 #endif
    18481824#endif
    18491825          rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r608 r622  
    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 );         
     
    18161898          digestStr = digestToString(sei_recon_picture_digest.digest, 4);
    18171899        }
     1900#if H_MV_FIX_LID_PIC_HASH_SEI_T40
     1901        OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer(), getLayerId() );
     1902#else
    18181903        OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer());
     1904#endif
    18191905
    18201906        /* write the SEI messages */
     
    20802166      pcPic->setReconMark   ( true );
    20812167#if H_MV
     2168#if H_MV5
     2169      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     2170#else
    20822171      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
     2172#endif
    20832173      std::vector<Int> temp;
    20842174      TComSlice::markCurrPic( pcPic );
     
    29123002
    29133003#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
    29143089Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )
    29153090{
     
    29753150}
    29763151#endif
     3152#endif
    29773153//! \}
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r608 r622  
    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 );
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r608 r622  
    9595#if H_3D_DIM_DMM
    9696, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    97 #if !SEC_DMM2_E0146
     97#if !SEC_DMM2_E0146_HHIFIX
    9898, m_cDmm2DataSCModel          ( 1,             1,               NUM_DMM2_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    9999#endif
     
    177177#if H_3D_DIM_DMM
    178178  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    179 #if !SEC_DMM2_E0146
     179#if !SEC_DMM2_E0146_HHIFIX
    180180  m_cDmm2DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );
    181181#endif
     
    268268#if H_3D_DIM_DMM
    269269      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
    270 #if !SEC_DMM2_E0146
     270#if !SEC_DMM2_E0146_HHIFIX
    271271      curCost += m_cDmm2DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM2_DATA );
    272272#endif
     
    340340#if H_3D_DIM_DMM
    341341  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    342 #if !SEC_DMM2_E0146
     342#if !SEC_DMM2_E0146_HHIFIX
    343343  m_cDmm2DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );
    344344#endif
     
    549549}
    550550
    551 #if !SEC_DMM2_E0146
     551#if !SEC_DMM2_E0146_HHIFIX
    552552Void TEncSbac::xCodeDmm2Offset( Int iOffset )
    553553{
     
    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);
     
    12261240      xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    12271241    } break;
    1228 #if !SEC_DMM2_E0146
     1242#if !SEC_DMM2_E0146_HHIFIX
    12291243  case( DMM2_IDX ):
    12301244    {
     
    12851299#else
    12861300#if LGE_SDC_REMOVE_DC_E0158
    1287 #if SEC_DMM2_E0146
     1301#if SEC_DMM2_E0146_HHIFIX
    12881302  UInt codeWordTable[3][7] =    {{0, 0, 0, 2, 0,6, 7},{0, 2, 3, 4, 5, 6, 7},{0, 1, 0, 0, 0, 0, 0}};
    12891303  UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{2, 3, 3, 3, 3, 3, 3},{1, 1, 0, 0, 0, 0, 0}};
     
    12931307#endif
    12941308#else
    1295 #if SEC_DMM2_E0146
     1309#if SEC_DMM2_E0146_HHIFIX
    12961310  UInt codeWordTable[3][8] =    {{0, 0, 0, 2, 0,6, 0, 7},{0, 2, 3, 4, 5, 6, 14, 15},{0, 2, 0, 0, 0, 0, 3, 0}};
    12971311  UInt codeWordLenTable[3][8] = {{0, 1, 0, 2, 0,3, 0, 3},{2, 3, 3, 3, 3, 3,  4,  4},{1, 2, 0, 0, 0, 0, 2, 0}};
     
    13181332    case DMM3_IDX: codeIdx = 5; break;
    13191333#if LGE_SDC_REMOVE_DC_E0158
    1320 #if SEC_DMM2_E0146
     1334#if SEC_DMM2_E0146_HHIFIX
    13211335    case  RBC_IDX: codeIdx = 6; break;
    13221336#else
     
    13251339#endif
    13261340#else
    1327 #if SEC_DMM2_E0146
     1341#if SEC_DMM2_E0146_HHIFIX
    13281342    case  RBC_IDX: codeIdx = 7; break;
    13291343#else
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r608 r622  
    121121#if H_3D_DIM_DMM
    122122  Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
    123 #if !SEC_DMM2_E0146
     123#if !SEC_DMM2_E0146_HHIFIX
    124124  Void  xCodeDmm2Offset      ( Int iOffset );
    125125#endif
     
    256256#if H_3D_DIM_DMM
    257257  ContextModel3DBuffer m_cDmm1DataSCModel;
    258 #if !SEC_DMM2_E0146
     258#if !SEC_DMM2_E0146_HHIFIX
    259259  ContextModel3DBuffer m_cDmm2DataSCModel;
    260260#endif
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r608 r622  
    28512851    {
    28522852
    2853 #if SCU_HS_FAST_DEPTH_INTRA_E0238
     2853#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
    28542854      Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
    28552855      Int  varThreshold = (Int)( threshold * threshold - 8 );
     
    28572857#endif
    28582858
    2859 
    28602859#if H_3D_DIM_DMM
    28612860      if( m_pcEncCfg->getUseDMM()
    2862 #if SCU_HS_FAST_DEPTH_INTRA_E0238
    2863          && (uiRdModeList[0] != 0 || varCU >= varThreshold)
     2861#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
     2862         && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
    28642863#endif
    28652864        )
     
    28782877              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    28792878            } break;
    2880 #if !SEC_DMM2_E0146
     2879#if !SEC_DMM2_E0146_HHIFIX
    28812880          case( DMM2_IDX ):
    28822881            {
     
    28932892          case( DMM3_IDX ):
    28942893            {
    2895 #if LGE_PKU_DMM3_OVERLAP_E0159
     2894#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
    28962895              TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
    28972896              TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() );
     
    29032902#endif
    29042903              UInt uiIntraTabIdx = 0;
     2904#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
     2905              xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir );
     2906#else
    29052907              xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx );
     2908#endif
    29062909              pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );
    29072910              pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth );
    29082911              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
    2909 #if LGE_PKU_DMM3_OVERLAP_E0159
     2912#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
    29102913              }
    29112914#endif
     
    29382941#if H_3D_DIM_RBC
    29392942      if( m_pcEncCfg->getUseRBC()
    2940 #if SCU_HS_FAST_DEPTH_INTRA_E0238
    2941           && (uiRdModeList[0] != 0 || varCU >= varThreshold)
     2943#if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
     2944          && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
    29422945#endif
    29432946        )
     
    36003603#if H_3D_VSP
    36013604                                 , Int* vspFlag
    3602 #if MTK_VSP_FIX_ALIGN_WD_E0172
    36033605                                 , InheritedVSPDisInfo*  inheritedVSPDisInfo
    3604 #endif
    3605 #if MTK_VSP_FIX_E0172
    3606                                  , Int* vspDir
    3607 #endif
    36083606#endif
    36093607                                 , Int& numValidMergeCand
     
    36253623#if H_3D_VSP
    36263624                                   , vspFlag
    3627 #if MTK_VSP_FIX_ALIGN_WD_E0172
    36283625                                   , inheritedVSPDisInfo
    3629 #endif
    3630 #if MTK_VSP_FIX_E0172
    3631                                    , vspDir
    3632 #endif
    36333626#endif
    36343627                                   , numValidMergeCand
     
    36423635#if H_3D_VSP
    36433636                                 , vspFlag
    3644 #if MTK_VSP_FIX_ALIGN_WD_E0172
    36453637                                 , inheritedVSPDisInfo
    3646 #endif
    3647 #if MTK_VSP_FIX_E0172
    3648                                  , vspDir
    3649 #endif
    36503638#endif
    36513639                                 , numValidMergeCand
    36523640                                 );
    36533641  }
    3654 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172
     3642#if H_3D_VSP
    36553643  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand );
    36563644#else
    36573645  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    36583646#endif
     3647
    36593648
    36603649  ruiCost = MAX_UINT;
     
    36723661#if H_3D_VSP
    36733662      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3674 #if MTK_VSP_FIX_ALIGN_WD_E0172
    36753663      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3676 #endif
    3677 #if MTK_VSP_FIX_E0172
    3678       pcCU->setVSPDirSubParts( vspDir[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3679 #endif
    36803664#endif
    36813665
     
    37073691 * \returns Void
    37083692 */
    3709 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172
     3693#if H_3D_VSP
    37103694Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand )
    37113695#else
     
    37173701    for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand )
    37183702    {
    3719 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172
     3703#if H_3D_VSP
    37203704      if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) )
    37213705#else
     
    38483832#if H_3D_VSP
    38493833    pcCU->setVSPFlagSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
    3850 #if MTK_VSP_FIX_E0172
    3851     pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
    3852 #endif
    38533834#endif
    38543835   
     
    43464327      Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    43474328      memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    4348 #if MTK_VSP_FIX_ALIGN_WD_E0172
    43494329      InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    43504330      UInt uiAbsPartIdx = 0;
     
    43544334      DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx);
    43554335#endif
    4356 #if MTK_VSP_FIX_E0172
    4357       Int vspDir[MRG_MAX_NUM_CANDS_MEM];
    4358       memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    4359 #endif
    4360 #endif
    43614336
    43624337      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours
    43634338#if H_3D_VSP
    43644339                      , vspFlag
    4365 #if MTK_VSP_FIX_ALIGN_WD_E0172
    43664340                      , inheritedVSPDisInfo
    4367 #endif
    4368 #if MTK_VSP_FIX_E0172
    4369                       , vspDir
    4370 #endif
    43714341#endif
    43724342                      , numValidMergeCand
     
    43794349#if H_3D_VSP
    43804350        pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4381 #if MTK_VSP_FIX_ALIGN_WD_E0172
    43824351        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4383 #endif
    4384 #if MTK_VSP_FIX_E0172
    4385         pcCU->setVSPDirSubParts( vspDir[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4386 #endif
    43874352#endif
    43884353        pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     
    44074372#if H_3D_VSP
    44084373        pcCU->setVSPFlagSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4409 #if MTK_VSP_FIX_ALIGN_WD_E0172
    44104374        pcCU->setDvInfoSubParts(OriginalDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4411 #endif
    4412 #if MTK_VSP_FIX_E0172
    4413         pcCU->setVSPDirSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    4414 #endif
    44154375#endif
    44164376        {
     
    73617321}
    73627322
    7363 #if !SEC_DMM2_E0146
     7323#if !SEC_DMM2_E0146_HHIFIX
    73647324Void TEncSearch::xSearchDmm2Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
    73657325{
     
    74297389#endif
    74307390
    7431 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx )
     7391#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
     7392Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir )
    74327393{
    74337394  ruiTabIdx       = 0;
     
    74467407  Pel refDC1 = 0; Pel refDC2 = 0;
    74477408
     7409  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
     7410  std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2];
     7411  for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
     7412  {
     7413    UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
     7414    TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx));
     7415    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
     7416    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
     7417
     7418    UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );
     7419    if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     7420    {
     7421      uiBestDist     = uiActDist;
     7422      ruiTabIdx      = uiIdx;
     7423      ruiIntraTabIdx = uiIdxW;
     7424    }
     7425  }
     7426  cPredYuv.destroy();
     7427}
     7428#else
     7429Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx )
     7430{
     7431  ruiTabIdx       = 0;
     7432  ruiIntraTabIdx  = 0;
     7433
     7434  // local pred buffer
     7435  TComYuv cPredYuv;
     7436  cPredYuv.create( uiWidth, uiHeight );
     7437  cPredYuv.clear();
     7438  Pel* piPred = cPredYuv.getLumaAddr();
     7439  UInt uiPredStride = cPredYuv.getStride();
     7440
     7441  // wedge search
     7442  UInt uiBestDist = MAX_UINT;
     7443  WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     7444  Pel refDC1 = 0; Pel refDC2 = 0;
     7445
    74487446  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
    74497447  assert( pcPicTex != NULL );
     
    74967494  cPredYuv.destroy();
    74977495}
     7496#endif
    74987497#endif
    74997498#if H_3D_DIM_RBC
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r608 r622  
    352352  Void xSearchDmmDeltaDCs         ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );
    353353  Void xSearchDmm1Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
    354 #if !SEC_DMM2_E0146
     354#if !SEC_DMM2_E0146_HHIFIX
    355355  Void xSearchDmm2Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd );
    356356#endif
     357#if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX
     358  Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );
     359#else
    357360  Void xSearchDmm3Wedge           ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx );
     361#endif
    358362#endif
    359363#if H_3D_DIM_RBC
     
    427431#if H_3D_VSP
    428432                                  , Int* vspFlag
    429 #if MTK_VSP_FIX_ALIGN_WD_E0172
    430433                                  , InheritedVSPDisInfo*  inheritedVSPDisInfo
    431 #endif
    432 #if MTK_VSP_FIX_E0172
    433                                   , Int* vspDir
    434 #endif
    435434#endif
    436435                                  , Int& numValidMergeCand
     
    441440                                    TComMvField*    mvFieldNeighbours,
    442441                                    UChar*          interDirNeighbours,
    443 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172
     442#if H_3D_VSP
    444443                                    Int* vspFlag,
    445444#endif
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r608 r622  
    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 );
  • trunk/source/Lib/TLibEncoder/TEncSlice.h

    r608 r622  
    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
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r608 r622  
    515515  // mark it should be extended
    516516  rpcPic->getPicYuvRec()->setBorderExtension(false);
     517
     518#if H_MV
    517519  rpcPic->getPicYuvOrg()->setBorderExtension(false);
     520#endif
    518521}
    519522
     
    548551   * that chooses the actual compatibility based upon options */
    549552
     553#if H_MV5
     554#if H_MV 
     555  m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
     556  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
     557  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
     558#endif
     559#endif
    550560  m_cSPS.setPicWidthInLumaSamples         ( m_iSourceWidth      );
    551561  m_cSPS.setPicHeightInLumaSamples        ( m_iSourceHeight     );
     
    670680{
    671681#if H_MV
     682#if H_MV5
     683  m_cPPS.setLayerId( getLayerId() );
     684  if( getVPS()->getNumDirectRefLayers( getLayerId() ) > 0 )
     685#else
    672686  if( getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) > 0 )
     687#endif
    673688  {
    674689    m_cPPS.setListsModificationPresentFlag( true );
     
    736751  m_cPPS.setOutputFlagPresentFlag( false );
    737752#if H_MV
     753#if H_MV5
     754  m_cPPS.setNumExtraSliceHeaderBits( 2 );
     755#else
    738756  m_cPPS.setNumExtraSliceHeaderBits( 1 );
    739757#endif
     758#endif
    740759  m_cPPS.setSignHideFlag(getSignHideFlag());
    741 #if L0386_DB_METRIC
    742   if ( getDeblockingFilterMetric() )
    743   {
    744     m_cPPS.setDeblockingFilterControlPresentFlag (true);
    745     m_cPPS.setDeblockingFilterOverrideEnabledFlag(true);
    746     m_cPPS.setPicDisableDeblockingFilterFlag(false);
    747     m_cPPS.setDeblockingFilterBetaOffsetDiv2(0);
    748     m_cPPS.setDeblockingFilterTcOffsetDiv2(0);
    749   }
    750   else
    751   {
    752760  m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent );
    753   }
    754 #else
    755   m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent );
    756 #endif
    757761  m_cPPS.setLog2ParallelMergeLevelMinus2   (m_log2ParallelMergeLevelMinus2 );
    758762  m_cPPS.setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG);
Note: See TracChangeset for help on using the changeset viewer.