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


Ignore:
Timestamp:
10 Dec 2013, 13:50:12 (11 years ago)
Author:
tech
Message:

Merged HTM-9.0-dev0@731. (MV-HEVC 6 HLS)

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

Legend:

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

    r724 r738  
    280280  }
    281281  WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(),            "video_signal_type_present_flag");
     282#if H_MV_6_PS_O0118_33
     283  assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() );
     284#endif
    282285  if (pcVUI->getVideoSignalTypePresentFlag())
    283286  {
     
    443446  {
    444447    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
     448#if H_MV_6_PS_REP_FORM_18_19_20   
     449    if ( pcSPS->getUpdateRepFormatFlag() )
     450    {
     451      WRITE_CODE( pcSPS->getSpsRepFormatIdx( ), 8, "sps_rep_format_idx" );
     452    }
     453  }
     454  else
     455  {
     456#else
    445457  }
    446458
    447459  if ( pcSPS->getUpdateRepFormatFlag() )
    448460  {
     461#endif
    449462#endif
    450463  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     
    472485  }
    473486#if H_MV
     487#if H_MV_6_PS_REP_FORM_18_19_20
     488  if ( pcSPS->getLayerId() == 0 )
     489#else
    474490  if ( pcSPS->getUpdateRepFormatFlag() )
     491#endif
    475492  {
    476493#endif
     
    577594  WRITE_FLAG( 0, "sps_extension_flag" );
    578595#else
     596#if H_MV_6_PSEM_O0142_3
     597  WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" );
     598
     599  if ( pcSPS->getSpsExtensionFlag() )
     600  {
     601    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
     602    {
     603      WRITE_FLAG( pcSPS->getSpsExtensionTypeFlag( i ) ? 1 : 0 , "sps_extension_type_flag" );
     604#if H_3D
     605      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D );
     606#else
     607      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV );
     608#endif
     609    } 
     610
     611    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
     612    {
     613      codeSPSExtension( pcSPS );
     614    }
     615
     616#if H_3D
     617    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
     618    {
     619      codeSPSExtension2( pcSPS, viewIndex, depthFlag );
     620    }
     621#endif
     622  }
     623#else
    579624  WRITE_FLAG( 1, "sps_extension_flag" );
    580625  codeSPSExtension( pcSPS );
     
    587632#endif 
    588633#endif
     634#endif
    589635}
    590636
     
    593639{
    594640  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
     641
     642#if !H_MV_6_SHVC_O0098_36
    595643  WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );
     644#else
     645  WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" );
     646
     647  for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++)
     648  {   
     649    WRITE_CODE( pcSPS->getScaledRefLayerId( i ), 6, "scaled_ref_layer_id" );
     650
     651    Int j = pcSPS->getScaledRefLayerId( i );
     652   
     653    WRITE_SVLC( pcSPS->getScaledRefLayerLeftOffset( j ), "scaled_ref_layer_left_offset" );
     654    WRITE_SVLC( pcSPS->getScaledRefLayerTopOffset( j ), "scaled_ref_layer_top_offset" );
     655    WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" );
     656    WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
     657  }
     658#endif 
    596659}
    597660#endif
     
    740803{
    741804  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
     805#if H_MV_6_PS_O0109_24
     806  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
     807  if ( pcVPS->getVpsVuiPresentFlag() )
     808  { 
     809#endif
    742810  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
     811#if H_MV_6_PS_O0109_24
     812  }
     813#endif
    743814  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    744815 
     
    786857  }
    787858
     859
     860#if H_MV_6_PS_O0109_22
     861    WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
     862   
     863    if ( pcVPS->getViewIdLen( ) > 0 )
     864    {   
     865      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
     866      {
     867        WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" );
     868      }
     869    }
     870    else
     871    {
     872      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
     873      {
     874        assert( pcVPS->getViewIdVal( i ) == 0 );
     875      }
     876    }
     877#else
    788878  // GT spec says: trac #39
    789879  // if ( pcVPS->getNumViews() > 1 ) 
     
    797887    WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    798888  }
     889#endif
     890
    799891
    800892  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     
    805897    }
    806898  }
    807 
     899#if H_MV_6_ILDSD_O0120_26
     900  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
     901  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     902  {
     903    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     904    {
     905      WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" );
     906      pcVPS->checkSubLayersVpsMaxMinus1( i );
     907    }
     908  } 
     909  else
     910  {
     911    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     912    {
     913      assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) );   
     914    }
     915  }
     916#endif
    808917  WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" );
    809918
     
    812921    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    813922    {
     923#if H_MV_6_ILDDS_O0225_30
     924      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
     925      {
     926        if ( pcVPS->getDirectDependencyFlag(j,i) )
     927        {
     928          WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" );
     929        }
     930      }
     931#else
    814932      WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
     933#endif
    815934    }
    816935  }
     
    826945    {   
    827946      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
     947#if H_MV_6_PS_O0109_23
     948      pcVPS->checkProfileRefMinus1( i );     
     949#endif
    828950    }
    829951    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     
    842964  if( numOutputLayerSets > 1)
    843965  {
     966#if H_MV_6_PS_0109_25
     967    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
     968    pcVPS->checkDefaultOneTargetOutputLayerIdc();
     969#else
    844970    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
     971#endif       
    845972  } 
    846973
     974#if H_MV_6_HRD_O0217_13
     975  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
     976  assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 );
     977#endif
    847978  for( Int i = 1; i < numOutputLayerSets; i++ )
    848979  {
     
    855986      }     
    856987    }
     988#if H_MV_6_HRD_O0217_13
     989    else
     990    { // These inference rules would also be helpful in spec text
     991      assert( pcVPS->getOutputLayerSetIdxMinus1(i ) ==  i - 1 );
     992      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
     993      {             
     994        assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j ));
     995      }
     996    }
     997#endif
     998
    857999    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    8581000    {     
     
    8611003  }
    8621004
     1005#if H_MV_6_GEN_0153_28
     1006  if( pcVPS->getMaxLayersMinus1() > 0 )
     1007  {
     1008    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
     1009  }
     1010#endif
     1011
    8631012  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
    8641013  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    8691018  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    8701019  {   
     1020#if H_MV_6_PS_REP_FORM_18_19_20
     1021    TComRepFormat* curRepFormat = pcVPS->getRepFormat(i);     
     1022    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
     1023    codeRepFormat( i, curRepFormat ,  prevRepFormat);
     1024#else
    8711025    TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);     
    8721026    codeRepFormat( pcRepFormat );
     1027#endif
    8731028  }
    8741029
     
    8791034      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    8801035      {
     1036#if H_MV_6_PS_REP_FORM_18_19_20
     1037        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
     1038#else
    8811039        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );
     1040#endif
    8821041      }
    8831042    }
     
    8851044
    8861045  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     1046#if H_MV_6_MISC_O0062_31
     1047  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1048  {
     1049    if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) )  ==  0 )
     1050    {     
     1051      WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" );
     1052    }
     1053  }
     1054#endif
     1055#if H_MV_6_HRD_O0217_13
     1056  codeDpbSize( pcVPS );
     1057#endif
     1058
     1059#if !H_MV_6_PS_O0223_29
    8871060  WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
     1061#endif
    8881062  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
    8891063
     1064#if H_MV_6_PS_O0096_21
     1065  WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" );
     1066
     1067  if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1068  { 
     1069    WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" );   
     1070  }
     1071
     1072  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1073  {
     1074    for( Int j = 0; j < i; j++ )
     1075    {
     1076      if (pcVPS->getDirectDependencyFlag( i, j) )
     1077      {       
     1078        if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1079        { 
     1080          assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) );
     1081        }
     1082        else
     1083        {
     1084          assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
     1085          WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
     1086        }
     1087      }
     1088    }
     1089  } 
     1090#else
    8901091    for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    8911092    {
     
    8991100      }
    9001101    }
    901    
     1102#endif
    9021103    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" );
     1104#if !H_MV_6_PS_O0109_24
    9031105    WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );
     1106#endif
    9041107
    9051108    if( pcVPS->getVpsVuiPresentFlag() )
     
    9091112    }     
    9101113}
    911 
     1114#if H_MV_6_PS_O0118_33
     1115Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
     1116{
     1117  assert( pcVideoSignalInfo );
     1118  WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" );
     1119  WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" );
     1120  WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" );
     1121  WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" );
     1122  WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" );
     1123}
     1124#endif
     1125
     1126#if H_MV_6_HRD_O0217_13
     1127Void TEncCavlc::codeDpbSize( TComVPS* vps )
     1128{
     1129  TComDpbSize* dpbSize = vps->getDpbSize();
     1130  assert ( dpbSize != 0 );
     1131
     1132  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
     1133  { 
     1134    WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
     1135
     1136    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
     1137    { 
     1138      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     1139      {
     1140        WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" );
     1141      }
     1142      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
     1143      { 
     1144        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   // Preliminary fix does not match with spec
     1145        {
     1146          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
     1147        }
     1148        WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" );
     1149        WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" );
     1150      }
     1151      else
     1152      {
     1153        if ( j > 0 )
     1154        {
     1155          for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1156          {
     1157            assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     1158          }
     1159          assert( dpbSize->getMaxVpsNumReorderPics      ( i, j ) ==  dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
     1160          assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) ==  dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) );
     1161        }
     1162      }
     1163    }       
     1164  } 
     1165}
     1166#endif
     1167
     1168#if H_MV_6_PS_REP_FORM_18_19_20
     1169Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
     1170#else
    9121171Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )
     1172#endif
    9131173{
    9141174  assert( pcRepFormat );
    9151175
    916   WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
    917 
    918   if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
    919   {
    920     WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
    921   }
     1176#if H_MV_6_PS_REP_FORM_18_19_20
    9221177  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    9231178  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     1179  WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" );
     1180 
     1181  pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i );
     1182
     1183  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
     1184  { 
     1185#endif
     1186  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
     1187
     1188  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1189  {
     1190    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
     1191  }
     1192#if !H_MV_6_PS_REP_FORM_18_19_20
     1193  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
     1194  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     1195#endif
    9241196  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    9251197  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
     1198#if H_MV_6_PS_REP_FORM_18_19_20
     1199  }
     1200  else
     1201  {
     1202    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true );
     1203  }
     1204#endif
    9261205}
    9271206
     
    9331212
    9341213  assert( pcVPSVUI );
     1214
     1215#if H_MV_6_PS_O0223_29
     1216  WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" );
     1217  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     1218  { 
     1219    WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
     1220  }
     1221#endif
    9351222
    9361223  WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
     
    9641251  }
    9651252
     1253#if H_MV_6_O0226_37
     1254  WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
     1255  if( !pcVPSVUI->getTilesNotInUseFlag() )
     1256  {     
     1257    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1258    {
     1259      WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" );
     1260      if( pcVPSVUI->getTilesInUseFlag( i ) ) 
     1261      {
     1262        WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" );
     1263      }
     1264    } 
     1265
     1266    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1267    {
     1268      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     1269      { 
     1270        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1271        if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
     1272        {
     1273          WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
     1274        }
     1275      } 
     1276    }
     1277  } 
     1278
     1279  WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" );
     1280
     1281  if( !pcVPSVUI->getWppNotInUseFlag( ) )
     1282  {
     1283    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1284    {
     1285      WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" );
     1286    }
     1287  }
     1288#else
    9661289  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    9671290  {
     
    9711294    }
    9721295  }
    973 
     1296#endif
    9741297  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
    9751298
     
    9921315    }
    9931316  }
    994 }
     1317#if H_MV_6_PS_O0118_33
     1318  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
     1319  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     1320  {
     1321    WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" );
     1322  }
     1323  else
     1324  {
     1325    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1326  }
     1327
     1328  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
     1329  {
     1330    assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL );
     1331    TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i );
     1332    codeVideoSignalInfo( curVideoSignalInfo );     
     1333  }
     1334
     1335  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
     1336  {
     1337    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1338    {
     1339      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
     1340      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
     1341    }
     1342}
     1343  else
     1344  {
     1345    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1346    {
     1347      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) );
     1348    }
     1349  }
     1350#endif
     1351#if H_MV_6_HRD_O0164_15
     1352  WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
     1353  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     1354  {
     1355    codeVpsVuiBspHrdParameters( pcVPS );
     1356  }
     1357#endif
     1358}
     1359#if H_MV_6_HRD_O0164_15
     1360Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS )
     1361{
     1362  assert( pcVPS );
     1363
     1364  TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     1365
     1366  assert( pcVPSVUI );
     1367
     1368  TComVpsVuiBspHrdParameters*  vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters();
     1369
     1370  assert ( vpsVuiBspHrdP );
     1371
     1372 
     1373  WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" );
     1374  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
     1375  { 
     1376    if( i > 0 )
     1377    {
     1378      WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" );
     1379    }
     1380    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i );
     1381    codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() );     
     1382  } 
     1383  for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ )
     1384  { 
     1385    WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" );
     1386    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
     1387    {
     1388      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
     1389      {
     1390        if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
     1391        {
     1392          WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
     1393        }
     1394        else
     1395        {
     1396          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
     1397        }
     1398      }
     1399    }
     1400    vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h );
     1401
     1402    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
     1403    { 
     1404      WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" );
     1405      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1406      {
     1407        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
     1408        { 
     1409          WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" );
     1410          WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
     1411        } 
     1412      }
     1413    } 
     1414  } 
     1415
     1416#endif
     1417
    9951418#endif
    9961419
     
    11151538#if H_MV   
    11161539    Int esb = 0;  //Don't use i, otherwise will shadow something below
     1540#if !H_MV_6_RALS_O0149_11
    11171541    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    11181542    {
     
    11201544      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    11211545    }
     1546#endif
    11221547
    11231548    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     
    11261551      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
    11271552    }
     1553
     1554#if H_MV_6_RALS_O0149_11
     1555    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1556    {
     1557      esb++;
     1558      WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
     1559    }
     1560    pcSlice->checkCrossLayerBlaFlag( );
     1561
     1562    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1563    {
     1564      esb++;
     1565      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
     1566    }
     1567#endif
     1568
     1569
    11281570
    11291571    for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     
    11481590    //   colour_plane_id                                      u(2)
    11491591
     1592#if H_MV_6_POC_31_35_38
     1593    if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() )
     1594    {
     1595      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
     1596      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb");
     1597    }
     1598#endif
    11501599    if( !pcSlice->getIdrPicFlag() )
    11511600    {
     1601#if !H_MV_6_POC_31_35_38
    11521602      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    11531603      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     1604#endif
    11541605      TComReferencePictureSet* rps = pcSlice->getRPS();
    11551606     
     
    12651716    }
    12661717#if H_MV
     1718#if H_MV_6_ILDDS_ILREFPICS_27_34
     1719    Bool interLayerPredLayerIdcPresentFlag = false;
     1720#endif
    12671721    Int layerId = pcSlice->getLayerId();
    12681722    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     
    12771731        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    12781732        {       
     1733#if H_MV_6_ILDDS_ILREFPICS_27_34
     1734          interLayerPredLayerIdcPresentFlag = true;
     1735#endif
    12791736          for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ )   
    12801737          {
     
    12841741      } 
    12851742    }
     1743#if H_MV_6_ILDDS_ILREFPICS_27_34
     1744    if ( !interLayerPredLayerIdcPresentFlag )
     1745    {
     1746      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1747      {
     1748        assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) );
     1749      }
     1750    }
     1751#endif
    12861752#endif
    12871753    if(pcSlice->getSPS()->getUseSAO())
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r655 r738  
    8686#if H_MV
    8787  Void  codeVPSExtension       ( TComVPS *pcVPS );
     88#if H_MV_6_PS_O0118_33
     89  Void  codeVideoSignalInfo     ( TComVideoSignalInfo* pcVideoSignalInfo );
     90#endif
     91
     92#if H_MV_6_HRD_O0217_13
     93  Void  codeDpbSize   ( TComVPS* vps );
     94#endif
     95
     96#if H_MV_6_PS_REP_FORM_18_19_20
     97  Void  codeRepFormat           ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat );
     98#else
    8899  Void  codeRepFormat          ( TComRepFormat* pcRepFormat );
     100#endif
    89101  Void  codeVPSVUI             ( TComVPS* pcVPS );
     102#if H_MV_6_HRD_O0164_15
     103  Void  codeVpsVuiBspHrdParameters( TComVPS* pcVPS );
     104#endif
    90105#endif
    91106  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r724 r738  
    664664    refPicListModification->setRefPicListModificationFlagL1(0);
    665665#if H_MV
     666#if H_MV_6_RALS_O0149_11
     667    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     668#else
    666669    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 )
     670#endif
    667671    {
    668672      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     
    674678    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    675679   
     680#if H_MV_6_ILDDS_ILREFPICS_27_34
     681    Bool interLayerPredLayerIdcPresentFlag = false;
     682#endif
    676683    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    677684    {         
     
    685692        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    686693        {       
     694#if H_MV_6_ILDDS_ILREFPICS_27_34
     695          interLayerPredLayerIdcPresentFlag = true;
     696#endif
    687697          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    688698          {
     
    692702      }
    693703    }
     704#if H_MV_6_ILDDS_ILREFPICS_27_34
     705    if ( !interLayerPredLayerIdcPresentFlag )
     706    {
     707      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     708      {
     709        pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
     710      }
     711    }
     712#endif
     713
     714
    694715    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
    695716   
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r724 r738  
    719719
    720720#if H_MV 
     721#if H_MV_6_PS_REP_FORM_18_19_20
     722  m_cSPS.setUpdateRepFormatFlag           ( false );   
     723#else
    721724  m_cSPS.setUpdateRepFormatFlag           ( m_layerId == 0 );   
     725#endif
    722726  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
    723727  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
     728#if H_MV_6_PSEM_O0142_3
     729  m_cSPS.setSpsExtensionFlag              ( true );
     730  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_MV ,true );
     731#if H_3D
     732  m_cSPS.setSpsExtensionTypeFlag          ( PS_EX_T_3D ,true );
     733#endif
     734#endif
    724735#endif
    725736  m_cSPS.setPicWidthInLumaSamples         ( m_iSourceWidth      );
     
    808819    pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
    809820    pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
     821#if H_MV_6_PS_O0118_33
     822    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 );
     823#else
    810824    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
     825#endif
    811826    pcVUI->setVideoFormat(getVideoFormat());
    812827    pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
     
    922937  m_cPPS.setOutputFlagPresentFlag( false );
    923938#if H_MV
     939#if H_MV_6_RALS_O0149_11
     940  m_cPPS.setNumExtraSliceHeaderBits( 3 );
     941#else
    924942  m_cPPS.setNumExtraSliceHeaderBits( 2 );
     943#endif
    925944#endif
    926945  m_cPPS.setSignHideFlag(getSignHideFlag());
Note: See TracChangeset for help on using the changeset viewer.