Changeset 730 in 3DVCSoftware for branches/HTM-9.0-dev0/source/Lib/TLibEncoder


Ignore:
Timestamp:
9 Dec 2013, 17:16:03 (11 years ago)
Author:
tech
Message:

MV HEVC 6 HLS changes.

Location:
branches/HTM-9.0-dev0/source/Lib/TLibEncoder
Files:
4 edited

Legend:

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

    r724 r730  
    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 ) 
     
    792882    WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
    793883  }
    794 
    795884  for( Int i = 0; i < pcVPS->getNumViews(); i++ )
    796885  {
    797886    WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    798887  }
     888#endif
     889
    799890
    800891  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     
    805896    }
    806897  }
    807 
     898#if H_MV_6_ILDSD_O0120_26
     899  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
     900  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     901  {
     902    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     903    {
     904      WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" );
     905      pcVPS->checkSubLayersVpsMaxMinus1( i );
     906    }
     907  } 
     908  else
     909  {
     910    for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     911    {
     912      assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) );   
     913    }
     914  }
     915#endif
    808916  WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" );
    809917
     
    812920    for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
    813921    {
     922#if H_MV_6_ILDDS_O0225_30
     923      for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ )
     924      {
     925        if ( pcVPS->getDirectDependencyFlag(j,i) )
     926        {
     927          WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" );
     928        }
     929      }
     930#else
    814931      WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
     932#endif
    815933    }
    816934  }
     
    826944    {   
    827945      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
     946#if H_MV_6_PS_O0109_23
     947      pcVPS->checkProfileRefMinus1( i );     
     948#endif
    828949    }
    829950    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     
    842963  if( numOutputLayerSets > 1)
    843964  {
     965#if H_MV_6_PS_0109_25
     966    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
     967    pcVPS->checkDefaultOneTargetOutputLayerIdc();
     968#else
    844969    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
     970#endif       
    845971  } 
    846972
     973#if H_MV_6_HRD_O0217_13
     974  assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 ));
     975  assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 );
     976#endif
    847977  for( Int i = 1; i < numOutputLayerSets; i++ )
    848978  {
     
    855985      }     
    856986    }
     987#if H_MV_6_HRD_O0217_13
     988    else
     989    { // These inference rules would also be helpful in spec text
     990      assert( pcVPS->getOutputLayerSetIdxMinus1(i ) ==  i - 1 );
     991      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
     992      {             
     993        assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j ));
     994      }
     995    }
     996#endif
     997
    857998    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    858999    {     
     
    8611002  }
    8621003
     1004#if H_MV_6_GEN_0153_28
     1005  if( pcVPS->getMaxLayersMinus1() > 0 )
     1006  {
     1007    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
     1008  }
     1009#endif
     1010
    8631011  WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
    8641012  if ( pcVPS->getRepFormatIdxPresentFlag() )
     
    8691017  for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ )
    8701018  {   
     1019#if H_MV_6_PS_REP_FORM_18_19_20
     1020    TComRepFormat* curRepFormat = pcVPS->getRepFormat(i);     
     1021    TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL;
     1022    codeRepFormat( i, curRepFormat ,  prevRepFormat);
     1023#else
    8711024    TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i);     
    8721025    codeRepFormat( pcRepFormat );
     1026#endif
    8731027  }
    8741028
     
    8791033      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    8801034      {
     1035#if H_MV_6_PS_REP_FORM_18_19_20
     1036        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
     1037#else
    8811038        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" );
     1039#endif
    8821040      }
    8831041    }
     
    8851043
    8861044  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     1045#if H_MV_6_MISC_O0062_31
     1046  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1047  {
     1048    if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) )  ==  0 )
     1049    {     
     1050      WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" );
     1051    }
     1052  }
     1053#endif
     1054#if H_MV_6_HRD_O0217_13
     1055  codeDpbSize( pcVPS );
     1056#endif
     1057
     1058#if !H_MV_6_PS_O0223_29
    8871059  WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
     1060#endif
    8881061  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
    8891062
     1063#if H_MV_6_PS_O0096_21
     1064  WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" );
     1065
     1066  if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1067  { 
     1068    WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" );   
     1069  }
     1070
     1071  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1072  {
     1073    for( Int j = 0; j < i; j++ )
     1074    {
     1075      if (pcVPS->getDirectDependencyFlag( i, j) )
     1076      {       
     1077        if ( pcVPS->getDefaultDirectDependencyFlag( ) )
     1078        { 
     1079          assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) );
     1080        }
     1081        else
     1082        {
     1083          assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
     1084          WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
     1085        }
     1086      }
     1087    }
     1088  } 
     1089#else
    8901090    for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
    8911091    {
     
    8991099      }
    9001100    }
    901    
     1101#endif
    9021102    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" );
     1103#if !H_MV_6_PS_O0109_24
    9031104    WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" );
     1105#endif
    9041106
    9051107    if( pcVPS->getVpsVuiPresentFlag() )
     
    9091111    }     
    9101112}
    911 
     1113#if H_MV_6_PS_O0118_33
     1114Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
     1115{
     1116  assert( pcVideoSignalInfo );
     1117  WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" );
     1118  WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" );
     1119  WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" );
     1120  WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" );
     1121  WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" );
     1122}
     1123#endif
     1124
     1125#if H_MV_6_HRD_O0217_13
     1126Void TEncCavlc::codeDpbSize( TComVPS* vps )
     1127{
     1128  TComDpbSize* dpbSize = vps->getDpbSize();
     1129  assert ( dpbSize != 0 );
     1130
     1131  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
     1132  { 
     1133    WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
     1134
     1135    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
     1136    { 
     1137      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     1138      {
     1139        WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" );
     1140      }
     1141      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
     1142      { 
     1143        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   // Preliminary fix does not match with spec
     1144        {
     1145          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
     1146        }
     1147        WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" );
     1148        WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" );
     1149      }
     1150      else
     1151      {
     1152        if ( j > 0 )
     1153        {
     1154          for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1155          {
     1156            assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     1157          }
     1158          assert( dpbSize->getMaxVpsNumReorderPics      ( i, j ) ==  dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
     1159          assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) ==  dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) );
     1160        }
     1161      }
     1162    }       
     1163  } 
     1164}
     1165#endif
     1166
     1167#if H_MV_6_PS_REP_FORM_18_19_20
     1168Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat )
     1169#else
    9121170Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat )
     1171#endif
    9131172{
    9141173  assert( pcRepFormat );
    9151174
    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   }
     1175#if H_MV_6_PS_REP_FORM_18_19_20
    9221176  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
    9231177  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     1178  WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" );
     1179 
     1180  pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i );
     1181
     1182  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
     1183  { 
     1184#endif
     1185  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
     1186
     1187  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1188  {
     1189    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
     1190  }
     1191#if !H_MV_6_PS_REP_FORM_18_19_20
     1192  WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ),  16, "pic_width_vps_in_luma_samples" );
     1193  WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" );
     1194#endif
    9241195  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    9251196  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
     1197#if H_MV_6_PS_REP_FORM_18_19_20
     1198  }
     1199  else
     1200  {
     1201    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true );
     1202  }
     1203#endif
    9261204}
    9271205
     
    9331211
    9341212  assert( pcVPSVUI );
     1213
     1214#if H_MV_6_PS_O0223_29
     1215  WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" );
     1216  if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() )
     1217  { 
     1218    WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
     1219  }
     1220#endif
    9351221
    9361222  WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
     
    9641250  }
    9651251
     1252#if H_MV_6_O0226_37
     1253  WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
     1254  if( !pcVPSVUI->getTilesNotInUseFlag() )
     1255  {     
     1256    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1257    {
     1258      WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" );
     1259      if( pcVPSVUI->getTilesInUseFlag( i ) ) 
     1260      {
     1261        WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" );
     1262      }
     1263    } 
     1264
     1265    for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1266    {
     1267      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
     1268      { 
     1269        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1270        if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
     1271        {
     1272          WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
     1273        }
     1274      } 
     1275    }
     1276  } 
     1277
     1278  WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" );
     1279
     1280  if( !pcVPSVUI->getWppNotInUseFlag( ) )
     1281  {
     1282    for( Int i = 0; i  <=  pcVPS->getMaxLayersMinus1(); i++ ) 
     1283    {
     1284      WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" );
     1285    }
     1286  }
     1287#else
    9661288  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    9671289  {
     
    9711293    }
    9721294  }
    973 
     1295#endif
    9741296  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
    9751297
     
    9921314    }
    9931315  }
    994 }
     1316#if H_MV_6_PS_O0118_33
     1317  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
     1318  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     1319  {
     1320    WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" );
     1321  }
     1322  else
     1323  {
     1324    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1325  }
     1326
     1327  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
     1328  {
     1329    assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL );
     1330    TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i );
     1331    codeVideoSignalInfo( curVideoSignalInfo );     
     1332  }
     1333
     1334  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
     1335  {
     1336    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1337    {
     1338      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
     1339      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
     1340    }
     1341  }
     1342  else
     1343  {
     1344    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1345    {
     1346      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) );
     1347    }
     1348  }
     1349#endif
     1350#if H_MV_6_HRD_O0164_15
     1351  WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
     1352  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     1353  {
     1354    codeVpsVuiBspHrdParameters( pcVPS );
     1355  }
     1356#endif
     1357}
     1358#if H_MV_6_HRD_O0164_15
     1359Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS )
     1360{
     1361  assert( pcVPS );
     1362
     1363  TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     1364
     1365  assert( pcVPSVUI );
     1366
     1367  TComVpsVuiBspHrdParameters*  vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters();
     1368
     1369  assert ( vpsVuiBspHrdP );
     1370
     1371 
     1372  WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" );
     1373  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
     1374  { 
     1375    if( i > 0 )
     1376    {
     1377      WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" );
     1378    }
     1379    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i );
     1380    codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() );     
     1381  } 
     1382  for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ )
     1383  { 
     1384    WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" );
     1385    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 
     1386    {
     1387      for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 
     1388      {
     1389        if( pcVPS->getLayerIdIncludedFlag( h ,j ) )
     1390        {
     1391          WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
     1392        }
     1393        else
     1394        {
     1395          vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec
     1396        }
     1397      }
     1398    }
     1399    vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h );
     1400
     1401    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
     1402    { 
     1403      WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" );
     1404      for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ )
     1405      {
     1406        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
     1407        { 
     1408          WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" );
     1409          WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
     1410        } 
     1411      }
     1412    } 
     1413  } 
     1414
     1415#endif
     1416
    9951417#endif
    9961418
     
    11151537#if H_MV   
    11161538    Int esb = 0;  //Don't use i, otherwise will shadow something below
     1539#if !H_MV_6_RALS_O0149_11
    11171540    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    11181541    {
     
    11201543      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
    11211544    }
     1545#endif
    11221546
    11231547    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     
    11261550      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
    11271551    }
     1552
     1553#if H_MV_6_RALS_O0149_11
     1554    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1555    {
     1556      esb++;
     1557      WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" );
     1558    }
     1559    pcSlice->checkCrossLayerBlaFlag( );
     1560
     1561    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     1562    {
     1563      esb++;
     1564      WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" );
     1565    }
     1566#endif
     1567
     1568
    11281569
    11291570    for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     
    11481589    //   colour_plane_id                                      u(2)
    11491590
     1591#if H_MV_6_POC_31_35_38
     1592    if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() )
     1593    {
     1594      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
     1595      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb");
     1596    }
     1597#endif
    11501598    if( !pcSlice->getIdrPicFlag() )
    11511599    {
     1600#if !H_MV_6_POC_31_35_38
    11521601      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    11531602      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     1603#endif
    11541604      TComReferencePictureSet* rps = pcSlice->getRPS();
    11551605     
     
    12651715    }
    12661716#if H_MV
     1717#if H_MV_6_ILDDS_ILREFPICS_27_34
     1718    Bool interLayerPredLayerIdcPresentFlag = false;
     1719#endif
    12671720    Int layerId = pcSlice->getLayerId();
    12681721    if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )
     
    12761729        }
    12771730        if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) )
    1278         {       
     1731        {
     1732#if H_MV_6_ILDDS_ILREFPICS_27_34
     1733          interLayerPredLayerIdcPresentFlag = true;
     1734#endif
    12791735          for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ )   
    12801736          {
     
    12841740      } 
    12851741    }
     1742#if H_MV_6_ILDDS_ILREFPICS_27_34
     1743    if ( !interLayerPredLayerIdcPresentFlag )
     1744    {
     1745      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1746      {
     1747        assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) );
     1748      }
     1749    }
     1750#endif
    12861751#endif
    12871752    if(pcSlice->getSPS()->getUseSAO())
  • branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r655 r730  
    8585  Void  codeVPS                 ( TComVPS* pcVPS );
    8686#if H_MV
    87   Void  codeVPSExtension       ( TComVPS *pcVPS );
    88   Void  codeRepFormat          ( TComRepFormat* pcRepFormat );
    89   Void  codeVPSVUI             ( TComVPS* pcVPS );
     87  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
     99  Void  codeRepFormat           ( TComRepFormat* pcRepFormat );
     100#endif
     101  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 );
  • branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r724 r730  
    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.
     
    673677    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    674678    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    675    
     679
     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   
  • branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r724 r730  
    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.