Ignore:
Timestamp:
13 Jul 2013, 10:26:41 (11 years ago)
Author:
tech
Message:

MergeMerged tags/HTM-DEV-1.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r532 r534  
    456456  {
    457457    READ_FLAG(   uiCode, "tiles_fixed_structure_flag");               pcVUI->setTilesFixedStructureFlag(uiCode);
     458#if H_MV
     459    if ( pcSPS->getLayerId() > 0 )
     460    {
     461      READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );
     462    }
     463#endif
    458464    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    459465    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
     
    577583  UInt  uiCode;
    578584  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
     585#if H_MV
     586  if ( pcSPS->getLayerId() == 0 )
     587  {
     588#endif
    579589  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
    580590  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
     
    584594    assert( uiCode == 1 );
    585595  }
    586  
    587596  parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     597#if H_MV
     598  }
     599#endif
    588600  READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
    589601  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     
    743755#else
    744756    READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
     757    ////   sps_extension_vui_parameters( )
     758    if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
     759    { 
     760      READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
     761      for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
     762      { 
     763        READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
     764        if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
     765        { 
     766          READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
     767          if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 
     768          {
     769            READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
     770          }
     771        } 
     772      } 
     773    } 
     774
     775    ////   sps_extension_vui_parameters( ) END
     776    READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" );
    745777    READ_FLAG( uiCode, "sps_extension2_flag");
    746778    if ( uiCode )
     
    752784      }
    753785#else
     786     
    754787      UInt uiCamParPrecision = 0;
    755788      Bool bCamParSlice      = false;
     
    834867  assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 );
    835868#if H_MV
    836   assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
    837   READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" );   pcVPS->setMaxNuhLayerId( uiCode );
     869  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
     870  READ_CODE( 6, uiCode, "vps_max_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
     871
     872  READ_UVLC(    uiCode, "vps_max_num_layer_sets_minus1" );               pcVPS->setVpsNumLayerSetsMinus1( uiCode );
     873  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
     874  {
     875    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
    838876#else
    839877  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
    840878  READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" );   pcVPS->setMaxNuhReservedZeroLayerId( uiCode );
    841 #endif
     879
    842880  READ_UVLC(    uiCode, "vps_max_op_sets_minus1" );               pcVPS->setMaxOpSets( uiCode + 1 );
    843881  for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ )
    844882  {
    845883    // Operation point set
    846 #if H_MV
    847     for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )
    848 #else
    849884    for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
    850885#endif
     
    893928    READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
    894929
    895     // Parse scalability_mask[i]   
    896930    for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ )
    897931    {
     
    899933    }
    900934
    901     Int numScalabilityTypes = pcVPS->getNumScalabilityTypes();
    902 
    903     // Parse dimension_id_len_minus1[j]   
    904     for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )
     935    for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
    905936    {
    906937        READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" );       pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );
    907938    }
    908939
    909     // vps_nuh_layer_id_present_flag
     940    if ( pcVPS->getSplittingFlag() )
     941      {
     942      pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() );       
     943      }
     944
    910945    READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" );           pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );
    911946
    912     // parse layer_id_in_nuh[i] and derive LayerIdInVps
    913     // already updated to JCT3V-D0220
    914     for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ )
    915     {
    916       UInt layerIdInNuh;
    917       if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( layer != 0 ) )
    918       {
    919         READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" );                layerIdInNuh = uiCode;
     947    for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
     948    {
     949      if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
     950      {
     951        READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" );                pcVPS->setLayerIdInNuh( i, uiCode );
    920952      }
    921953      else
    922954      {
    923         layerIdInNuh = layer;
    924       }     
    925 
    926       pcVPS->setLayerIdInNuh( layer, layerIdInNuh );
    927       pcVPS->setLayerIdInVps( layerIdInNuh, layer );
    928 
    929       // parse dimension_id[i][j]
    930       for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )
    931       {
    932           READ_CODE( pcVPS->getDimensionIdLen( sIdx ), uiCode, "dimension_id[i][j]" );  pcVPS->setDimensionId( layer, sIdx, uiCode );
    933       }
    934     }
    935 
    936     for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )
    937     {
    938       READ_FLAG(  uiCode, "vps_profile_present_flag[lsIdx]" );    pcVPS->setVpsProfilePresentFlag( layerSet, uiCode == 1 ? true : false );
    939       if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )
    940       {
    941         READ_UVLC( uiCode, "profile_layer_set_ref_minus1[lsIdx]" ); pcVPS->setProfileLayerSetRefMinus1( layerSet, uiCode );
    942       }
    943 
    944       parsePTL ( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers()-1);
    945       if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )
    946       {
    947         TComPTL temp = *pcVPS->getPTL( layerSet );
    948         *pcVPS->getPTL( layerSet ) = *pcVPS->getPTL( pcVPS->getProfileLayerSetRefMinus1( layerSet ) + 1 );
    949         pcVPS->getPTL( layerSet )->copyLevelFrom( &temp );
    950       }
    951     }
    952 
    953     READ_UVLC( uiCode, "num_output_layer_sets" );                  pcVPS->setNumOutputLayerSets( uiCode );
     955        pcVPS->setLayerIdInNuh( i, i );;
     956    }
     957
     958      pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i );
    954959   
    955     for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )
    956     {
    957       READ_UVLC( uiCode, "output_layer_set_idx[i]" );              pcVPS->setOutputLayerSetIdx( layerSet, uiCode );
    958       for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )
    959       {
    960         if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )
    961         {
    962           READ_FLAG( uiCode, "output_layer_flag" );                 pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false );
    963         }
    964       }
    965     }
     960      for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     961    {
     962        if ( !pcVPS->getSplittingFlag() )
     963      {
     964          READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" );  pcVPS->setDimensionId( i, j, uiCode );
     965        }
     966        else
     967        {
     968          pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j)  );
     969        }
     970      }
     971    }
     972
    966973
    967974    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
     
    972979      }
    973980    }
    974    
     981
     982    for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )
     983    {
     984      READ_CODE( 3, uiCode,       "max_tid_il_ref_pics_plus1[i]" );      pcVPS->setMaxTidIlRefPicPlus1( i , uiCode );
     985    }
     986
     987    READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1"      );  pcVPS->setVpsNumberLayerSetsMinus1    ( uiCode );
     988    READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
     989
     990    for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     991    {
     992      READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
     993      if( !pcVPS->getVpsProfilePresentFlag( i ) )
     994      {
     995        READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
     996      }
     997      parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     998      if( !pcVPS->getVpsProfilePresentFlag( i ) )
     999      {
     1000        TComPTL temp = *pcVPS->getPTL( i );
     1001        *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );
     1002        pcVPS->getPTL( i )->copyLevelFrom( &temp );
     1003      }
     1004    }
     1005
     1006    Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
     1007
     1008    READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 );
     1009
     1010    if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
     1011    {
     1012      READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1"      ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );
     1013      numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1);
     1014    }
     1015
     1016    if( numOutputLayerSets > 1)
     1017    {
     1018      READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag(  uiCode == 1);
     1019    } 
     1020
     1021    for( Int i = 1; i < numOutputLayerSets; i++ )
     1022    {
     1023      if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
     1024      {       
     1025        READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
     1026        for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
     1027        {
     1028          READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
     1029        }       
     1030      }
     1031      if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     1032      {     
     1033        READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
     1034      }
     1035    }
     1036
     1037    READ_FLAG( uiCode , "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag( uiCode == 1 );
     1038    READ_UVLC( uiCode,  "direct_dep_type_len_minus2"); pcVPS->setDirectDepTypeLenMinus2 ( uiCode );
     1039
     1040    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
     1041    {
     1042      for( Int j = 0; j < i; j++ )
     1043      {
     1044        if (pcVPS->getDirectDependencyFlag( i, j) )
     1045        {       
     1046          READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
     1047        }
     1048      }
     1049    }
     1050
     1051    READ_FLAG ( uiCode,                    "vps_shvc_reserved_zero_flag" );
     1052
     1053#if H_3D   
    9751054    READ_FLAG( uiCode,  "vps_extension2_flag" );
    9761055    if (uiCode)
    9771056    {
    978 #if H_3D
    9791057      m_pcBitstream->readOutTrailingBits();
    9801058
     
    10391117      }
    10401118      READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    1041 #else
    1042       while ( xMoreRbspData() )
    1043       {
    1044         READ_FLAG( uiCode, "vps_extension2_data_flag");
    1045       }
    10461119#endif
    10471120    }
     
    10491122    pcVPS->checkVPSExtensionSyntax();
    10501123
    1051     pcVPS->calcIvRefLayers();
     1124    pcVPS->setRefLayers();
    10521125
    10531126#else
     
    11471220  if(!rpcSlice->getDependentSliceSegmentFlag())
    11481221  {
     1222#if H_MV   
     1223    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     1224    {
     1225      READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
     1226    }
     1227
     1228    for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)   
     1229#else
    11491230    for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     1231#endif     
    11501232    {
    11511233      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
     
    11751257      rps->setNumberOfPictures(0);
    11761258      rpcSlice->setRPS(rps);
     1259#if H_MV
     1260      rpcSlice->setEnableTMVPFlag(false);
     1261#endif
    11771262    }
    11781263    else
     
    13321417      }
    13331418    }
     1419#if H_MV
     1420    Int layerIdInVps       = rpcSlice->getLayerIdInVps();
     1421    if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )
     1422    {   
     1423      READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 );
     1424      if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 )
     1425      {           
     1426        if( !vps->getMaxOneActiveRefLayerFlag()) 
     1427        {
     1428          READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode );
     1429        }
     1430        for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ )   
     1431        {
     1432          READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( i, uiCode );
     1433        }
     1434      } 
     1435    }
     1436
     1437    rpcSlice->setActiveMotionPredRefLayers( );
     1438
     1439    if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0  &&  rpcSlice->getNumActiveRefLayerPics() > 0 )
     1440    {
     1441      READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 );
     1442    }
     1443
     1444#endif
    13341445    if(sps->getUseSAO())
    13351446    {
     
    14721583    if ( rpcSlice->getEnableTMVPFlag() )
    14731584    {
     1585#if H_MV
     1586      if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 )
     1587      {
     1588        READ_FLAG( uiCode, "alt_collocated_indication_flag" ); rpcSlice->setAltCollocatedIndicationFlag( uiCode == 1 );
     1589      }
     1590
     1591      if( rpcSlice->getAltCollocatedIndicationFlag() && rpcSlice->getNumActiveMotionPredRefLayers() > 1 )
     1592      {         
     1593        READ_UVLC( uiCode, "collocated_ref_layer_idx" ); rpcSlice->setCollocatedRefLayerIdx( uiCode );
     1594      }     
     1595      else
     1596      {
     1597#endif
    14741598      if ( rpcSlice->getSliceType() == B_SLICE )
    14751599      {
     
    14931617        rpcSlice->setColRefIdx(0);
    14941618      }
     1619#if H_MV
     1620      }
     1621#endif
    14951622    }
    14961623    if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) )
Note: See TracChangeset for help on using the changeset viewer.