Ignore:
Timestamp:
21 Jun 2013, 18:58:29 (11 years ago)
Author:
tech
Message:

Incorporated VPS syntax elements. Intermediate version.

File:
1 edited

Legend:

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

    r446 r488  
    623623  assert( pcVPS->getNumHrdParameters() <= MAX_VPS_NUM_HRD_PARAMETERS );
    624624#if H_MV
    625   assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
    626   WRITE_CODE( pcVPS->getMaxNuhLayerId(), 6,                 "vps_max_nuh_layer_id" );
     625  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
     626  WRITE_CODE( pcVPS->getVpsMaxLayerId(), 6,                 "vps_max_layer_id" );
    627627#else
    628628  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
     
    635635    // Operation point set
    636636#if H_MV
    637     for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )
     637    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
    638638#else
    639639    for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
     
    685685
    686686  WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
    687   WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
     687  WRITE_FLAG( pcVPS->getSplittingFlag()    ? 1 : 0,          "splitting_flag" );
     688
     689  for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
     690  {
     691    WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0,   "scalability_mask[i]" );
     692  }
     693
     694  for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
     695  {
     696    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");   
     697  }
     698
     699  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
    688700 
    689   for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
    690   {
    691     WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0,   "scalability_mask[i]" );
    692   }
    693 
    694   for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ); sIdx++ )
    695   {
    696     WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");   
    697   }
    698 
    699   WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
    700 
    701   // already updated to JCT3V-D0220
    702   for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ )
    703   {
    704     if ( ( layer != 0 ) && pcVPS->getVpsNuhLayerIdPresentFlag() )
    705       WRITE_CODE( pcVPS->getLayerIdInNuh( layer ), 6,          "layer_id_in_nuh[i]");
    706     for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes() ; sIdx++ )
    707     {     
    708       WRITE_CODE( pcVPS->getDimensionId( layer, sIdx ), pcVPS->getDimensionIdLen( sIdx ), "dimension_id[i][j]");     
    709     }
    710   }
    711 
    712   for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )
    713   {
    714     WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( layerSet ) ? 1 : 0, "vps_profile_present_flag[lsIdx]" );
    715     if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )
    716     {
    717       WRITE_UVLC( pcVPS->getProfileLayerSetRefMinus1( layerSet ), "profile_layer_set_ref_minus1[lsIdx]" );
    718     }
    719     codePTL( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers() - 1 );
    720   }
    721 
    722   WRITE_UVLC( pcVPS->getNumOutputLayerSets(),                "num_output_layer_sets" );
    723 
    724   for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )
    725   {
    726     WRITE_UVLC( pcVPS->getOutputLayerSetIdx( layerSet ),      "output_layer_set_idx[i]" );
    727     for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )
    728     {
    729       if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )
    730       {
    731         WRITE_FLAG( pcVPS->getOutputLayerFlag( layerSet, layer ) ? 1 : 0, "output_layer_flag" );
     701  for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
     702  {
     703    if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
     704    {
     705      WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
     706    }
     707
     708    if ( !pcVPS->getSplittingFlag() )
     709    {   
     710      for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     711      {     
     712        WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");     
    732713      }
    733714    }
     
    741722    }
    742723  }
    743   WRITE_FLAG( 0,                                             "vps_extension2_flag" );
     724
     725  for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )
     726  {
     727    WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
     728  }
     729
     730  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
     731  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
     732
     733  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     734  {
     735    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
     736    if( !pcVPS->getVpsProfilePresentFlag( i ) )
     737    {   
     738      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
     739    }
     740
     741    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     742  }
     743
     744  Int numOutputLayerSets = pcVPS->getNumOutputLayerSets();
     745
     746  WRITE_FLAG( pcVPS->getVpsMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
     747
     748  if ( pcVPS->getVpsMoreOutputLayerSetsThanDefaultFlag( ) )
     749  {
     750    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
     751    numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1( );
     752  }
     753
     754  if( numOutputLayerSets > 1)
     755  {
     756    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
     757  } 
     758
     759  for( Int i = 1; i < numOutputLayerSets; i++ )
     760  {
     761    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
     762    {
     763      Int lsIdx = pcVPS->getOutputLayerSetIdxMinus1( i ) + 1;
     764      WRITE_UVLC( lsIdx,      "output_layer_set_idx[i]" );
     765
     766      for( Int j = 0; j <= pcVPS->getNumLayersInIdList( j ); j++ )
     767      {
     768        //WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
     769      }
     770
     771      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     772    }
     773  }
     774
     775  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     776  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
     777
     778    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
     779    {
     780      for( Int j = 0; j < i; j++ )
     781      {
     782        WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
     783      }
     784    }
     785
     786    WRITE_FLAG ( 0,                    "vps_shvc_reserved_zero_flag" );
     787#if H_3D
     788    WRITE_FLAG( 0,                     "vps_extension2_flag" );
     789#endif
    744790#else
    745791  WRITE_FLAG( 0,                     "vps_extension_flag" );
    746792#endif
    747  
     793
    748794  //future extensions here..
    749  
     795
    750796  return;
    751797}
Note: See TracChangeset for help on using the changeset viewer.