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

MergeMerged tags/HTM-DEV-1.0.

Location:
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
Files:
5 edited

Legend:

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

    r533 r534  
    338338  {
    339339    WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(),             "tiles_fixed_structure_flag");
     340#if H_MV
     341    if ( pcSPS->getLayerId() > 0 )
     342    {
     343      WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
     344    }
     345#endif
    340346    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
    341347    WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(),           "restricted_ref_pic_lists_flag");
     
    452458#endif
    453459  WRITE_CODE( pcSPS->getVPSId (),          4,       "sps_video_parameter_set_id" );
     460#if H_MV
     461  if ( pcSPS->getLayerId() == 0 )
     462  {
     463#endif
    454464  WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
    455465  WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
    456466  codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     467#if H_MV
     468}
     469#endif
    457470  WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
    458471  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     
    565578  WRITE_FLAG( 1, "sps_extension_flag" );
    566579  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
     580  ////   sps_extension_vui_parameters( )
     581  if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
     582  { 
     583    WRITE_UVLC( pcSPS->getNumIlpRestrictedRefLayers( ),           "num_ilp_restricted_ref_layers" );
     584    for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
     585    { 
     586      WRITE_UVLC( pcSPS->getMinSpatialSegmentOffsetPlus1( i ),    "min_spatial_segment_offset_plus1" );
     587      if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
     588      { 
     589        WRITE_FLAG( pcSPS->getCtuBasedOffsetEnabledFlag( i ),      "ctu_based_offset_enabled_flag[ i ]");
     590        if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 
     591        {
     592          WRITE_UVLC( pcSPS->getMinHorizontalCtuOffsetPlus1( i ), "min_horizontal_ctu_offset_plus1[ i ]");
     593        }
     594      } 
     595    } 
     596  } 
     597  ////   sps_extension_vui_parameters( ) END
     598  WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" );
    567599#if !H_3D
    568600  WRITE_FLAG( 0, "sps_extension2_flag" );
     
    632664  assert( pcVPS->getNumHrdParameters() <= MAX_VPS_NUM_HRD_PARAMETERS );
    633665#if H_MV
    634   assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
    635   WRITE_CODE( pcVPS->getMaxNuhLayerId(), 6,                 "vps_max_nuh_layer_id" );
     666  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
     667  WRITE_CODE( pcVPS->getVpsMaxLayerId(), 6,                 "vps_max_layer_id" ); 
     668 
     669  WRITE_UVLC( pcVPS->getVpsNumLayerSetsMinus1(),  "vps_max_num_layer_sets_minus1" );
     670  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
     671  {
     672    // Operation point set
     673    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
     674    {
    636675#else
    637676  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
    638677  WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6,     "vps_max_nuh_reserved_zero_layer_id" );
    639 #endif
     678
    640679  pcVPS->setMaxOpSets(1);
    641680  WRITE_UVLC( pcVPS->getMaxOpSets() - 1,                    "vps_max_op_sets_minus1" );
     
    643682  {
    644683    // Operation point set
    645 #if H_MV
    646     for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )
    647 #else
    648684    for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
    649 #endif
    650685    {
    651686      // Only applicable for version 1
    652687      pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );
     688#endif
    653689      WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" );
    654690    }
     
    701737  }
    702738
    703   for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ); sIdx++ )
     739  for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
    704740  {
    705741    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");   
    706742  }
    707743
     744  if ( pcVPS->getSplittingFlag() )
     745  { // Ignore old dimension id length
     746    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 );       
     747  }   
     748
     749
    708750  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
    709751
    710   // already updated to JCT3V-D0220
    711   for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ )
    712   {
    713     if ( ( layer != 0 ) && pcVPS->getVpsNuhLayerIdPresentFlag() )
    714       WRITE_CODE( pcVPS->getLayerIdInNuh( layer ), 6,          "layer_id_in_nuh[i]");
    715     for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes() ; sIdx++ )
     752  for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
     753  {
     754    if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
    716755    {     
    717       WRITE_CODE( pcVPS->getDimensionId( layer, sIdx ), pcVPS->getDimensionIdLen( sIdx ), "dimension_id[i][j]");     
    718     }
    719   }
    720 
    721   for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )
    722   {
    723     WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( layerSet ) ? 1 : 0, "vps_profile_present_flag[lsIdx]" );
    724     if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )
    725     {
    726       WRITE_UVLC( pcVPS->getProfileLayerSetRefMinus1( layerSet ), "profile_layer_set_ref_minus1[lsIdx]" );
    727     }
    728     codePTL( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers() - 1 );
    729   }
    730 
    731   WRITE_UVLC( pcVPS->getNumOutputLayerSets(),                "num_output_layer_sets" );
    732 
    733   for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )
    734   {
    735     WRITE_UVLC( pcVPS->getOutputLayerSetIdx( layerSet ),      "output_layer_set_idx[i]" );
    736     for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )
    737     {
    738       if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )
    739       {
    740         WRITE_FLAG( pcVPS->getOutputLayerFlag( layerSet, layer ) ? 1 : 0, "output_layer_flag" );
     756      WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
     757  }
     758    else
     759    {
     760      assert( pcVPS->getLayerIdInNuh( i ) == i );
     761  }
     762
     763    assert(  pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i );
     764
     765    for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     766  {
     767      if ( !pcVPS->getSplittingFlag() )
     768    {
     769        WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");     
     770      }
     771      else
     772      {
     773        assert( pcVPS->getDimensionId( i, j ) ==  pcVPS->inferDimensionId( i, j )  );
    741774      }
    742775    }
     
    750783    }
    751784  }
     785
     786  for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )
     787  {
     788    WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3,       "max_tid_il_ref_pics_plus1[i]" );
     789  }
     790
     791  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
     792  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
     793
     794  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     795  {
     796    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
     797    if( !pcVPS->getVpsProfilePresentFlag( i ) )
     798    {   
     799      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
     800    }
     801    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     802  }
     803
     804  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
     805
     806  WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
     807
     808  if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
     809  {
     810    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
     811    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 );
     812  }
     813
     814  if( numOutputLayerSets > 1)
     815  {
     816    WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" );
     817  } 
     818
     819  for( Int i = 1; i < numOutputLayerSets; i++ )
     820  {
     821    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
     822    {     
     823      WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
     824      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )
     825      {
     826        WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
     827      }     
     828    }
     829    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     830    {     
     831      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     832    }
     833  }
     834
     835  WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
     836  WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ),         "direct_dep_type_len_minus2");
     837
     838    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
     839    {
     840      for( Int j = 0; j < i; j++ )
     841      {
     842        if (pcVPS->getDirectDependencyFlag( i, j) )
     843        {       
     844          assert ( pcVPS->getDirectDependencyType( i, j ) != -1 );
     845          WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2,  "direct_dependency_type[i][j]" );
     846        }
     847      }
     848    }
     849
     850    WRITE_FLAG ( 0,                    "vps_shvc_reserved_zero_flag" );
     851
    752852#if H_3D_GEN 
    753853  WRITE_FLAG( 1,                                             "vps_extension2_flag" );
     
    811911Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
    812912{
     913#if H_MV
     914  TComVPS* vps = pcSlice->getVPS();
     915#endif
    813916#if ENC_DEC_TRACE 
    814917  xTraceSliceHeader (pcSlice);
     
    853956  if ( !pcSlice->getDependentSliceSegmentFlag() )
    854957  {
     958#if H_MV   
     959    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     960    {
     961      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
     962    }
     963
     964    for (Int i = 1; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)   
     965#else
    855966    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     967#endif
    856968    {
    857969      assert(!!"slice_reserved_undetermined_flag[]");
     
    10161128      }
    10171129    }
     1130#if H_MV
     1131    Int layerIdInVps       = pcSlice->getLayerIdInVps();
     1132    if( pcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )
     1133    {   
     1134      WRITE_FLAG( pcSlice->getInterLayerPredEnabledFlag( ) ? 1 : 0 , "inter_layer_pred_enabled_flag" );
     1135      if( pcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 )
     1136      {           
     1137        if( !vps->getMaxOneActiveRefLayerFlag()) 
     1138        {
     1139          WRITE_CODE( pcSlice->getNumInterLayerRefPicsMinus1( ), pcSlice->getNumInterLayerRefPicsMinus1Len( ), "num_inter_layer_ref_pics_minus1" );
     1140        }
     1141        for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1142        {
     1143          WRITE_CODE( pcSlice->getInterLayerPredLayerIdc( i ), pcSlice->getInterLayerPredLayerIdcLen( ), "inter_layer_pred_layer_idc" );
     1144        }
     1145      } 
     1146    }
     1147
     1148    if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0  &&  pcSlice->getNumActiveRefLayerPics() > 0 )
     1149    {
     1150      WRITE_FLAG( pcSlice->getInterLayerSamplePredOnlyFlag( ) ? 1 : 0 , "inter_layer_sample_pred_only_flag" );
     1151    }
     1152
     1153#endif
    10181154    if(pcSlice->getSPS()->getUseSAO())
    10191155    {
     
    11231259    if ( pcSlice->getEnableTMVPFlag() )
    11241260    {
     1261#if H_MV
     1262      if( pcSlice->getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 )
     1263      {
     1264        WRITE_FLAG( pcSlice->getAltCollocatedIndicationFlag( ) ? 1 : 0 , "alt_collocated_indication_flag" );
     1265      }
     1266      if( pcSlice->getAltCollocatedIndicationFlag() && pcSlice->getNumActiveMotionPredRefLayers() > 1 )
     1267      {         
     1268        WRITE_UVLC( pcSlice->getCollocatedRefLayerIdx( ), "collocated_ref_layer_idx" );
     1269      }     
     1270      else
     1271      {
     1272#endif
    11251273      if ( pcSlice->getSliceType() == B_SLICE )
    11261274      {
     
    11351283      }
    11361284    }
     1285#if H_MV
     1286    }
     1287#endif
    11371288    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
    11381289    {
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h

    r532 r534  
    7474  Int m_refIdc[MAX_NUM_REF_PICS+1];
    7575#if H_MV
    76   Int m_numInterViewRefPics;
    77   Int m_interViewRefs    [MAX_NUM_REF_PICS];
     76  Int m_numActiveRefLayerPics;
     77  Int m_interLayerPredLayerIdc [MAX_NUM_REF_PICS];
    7878  Int m_interViewRefPosL[2][MAX_NUM_REF_PICS]; 
     79  Int m_collocatedRefLayerIdx;
    7980#endif
    8081  GOPEntry()
     
    9394  , m_numRefIdc(0)
    9495#if H_MV
    95   , m_numInterViewRefPics(0)
     96  , m_numActiveRefLayerPics(0)
     97  , m_collocatedRefLayerIdx(-1)
    9698#endif
    9799  {
     
    100102    ::memset( m_refIdc,        0, sizeof(m_refIdc) );
    101103#if H_MV
    102     ::memset( m_interViewRefs,   0, sizeof(m_interViewRefs) );
     104    ::memset( m_interLayerPredLayerIdc,   0, sizeof(m_interLayerPredLayerIdc) );
    103105    ::memset( m_interViewRefPosL[0], -1, sizeof(m_interViewRefPosL[0]) );
    104106    ::memset( m_interViewRefPosL[1], -1, sizeof(m_interViewRefPosL[1]) );
     
    429431  , m_viewIndex(-1)
    430432  , m_isDepth(false)
     433  , m_bUseVSO(false)
    431434#endif
    432435#endif
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp

    r532 r534  
    502502    pcSlice->setSliceIdx(0);
    503503#if H_MV
     504    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer );
    504505    pcPic  ->setLayerId     ( getLayerId()   );
    505506    pcPic  ->setViewId      ( getViewId()    );   
     
    669670    refPicListModification->setRefPicListModificationFlagL1(0);
    670671#if H_MV
     672    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     673    {
     674      pcSlice->setDiscardableFlag           ( false );     
     675    }   
     676
     677    TComVPS*           vps = pcSlice->getVPS();
     678    Int       layerIdInVps = vps    ->getLayerIdInVps( getLayerId());
     679    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( layerIdInVps );
     680    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
     681   
     682    if ( getLayerId() > 0 && numDirectRefLayers > 0 )
     683    {         
     684      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     685      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
     686      {
     687        if ( !vps->getMaxOneActiveRefLayerFlag() )
     688        {   
     689          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
     690        }
     691        for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
     692        {
     693          pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
     694        }
     695      }
     696    }
     697    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     698   
     699    if ( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && pcSlice->getNumActiveRefLayerPics() > 0)
     700    {
     701      pcSlice->setInterLayerSamplePredOnlyFlag( gopEntry.m_numRefPics == 0 );
     702    }   
     703
    671704    pcSlice->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );
    672     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ).m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
    673     pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ).m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
    674     xSetRefPicListModificationsMvc( pcSlice, pocCurr, iGOPid );   
     705    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
     706    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
     707
     708    xSetRefPicListModificationsMv( pcSlice, iGOPid );   
     709
     710    pcSlice->setActiveMotionPredRefLayers( );
     711
     712    if ( getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 && pcSlice->getEnableTMVPFlag() &&
     713        ( pcSlice->getSliceType() == B_SLICE || pcSlice->getSliceType() == P_SLICE ))
     714    {
     715      pcSlice->setAltCollocatedIndicationFlag( gopEntry.m_collocatedRefLayerIdx >= 0 );
     716      if ( pcSlice->getNumActiveRefLayerPics() && pcSlice->getNumActiveMotionPredRefLayers() > 0 )
     717      {
     718        pcSlice->setCollocatedRefLayerIdx( gopEntry.m_collocatedRefLayerIdx );
     719      }
     720    }
     721
    675722#else
    676723    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    827874      pcSlice->setEnableTMVPFlag(0);
    828875    }
    829 
    830876#if H_MV
    831877    if( pcSlice->getIdrPicFlag() )
     
    21202166      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
    21212167      std::vector<Int> temp;
     2168      TComSlice::markCurrPic( pcPic );
    21222169      TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() );
    21232170#endif
     
    29502997#endif
    29512998#if H_MV
    2952 Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid )
     2999Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )
    29533000{
    2954   TComVPS* vps = pcSlice->getVPS();
    29553001  Int layer    = pcSlice->getLayerIdInVps( );
    29563002 
    2957   if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || vps->getNumDirectRefLayers( layer ) == 0 )
     3003  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
    29583004  {
    29593005    return;
     
    29623008  // analyze inter-view modifications
    29633009  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( layer > 0) ) ? MAX_GOP : iGOPid );
    2964 
    2965   TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     3010  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
    29663011 
    29673012  Int maxRefListSize  = pcSlice->getNumRpsCurrTempList();
    2968   Int numTemporalRefs = maxRefListSize - vps->getNumDirectRefLayers( layer );
    2969 
     3013  Int numTemporalRefs = maxRefListSize - pcSlice->getNumActiveRefLayerPics();
    29703014
    29713015  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
    29723016  {
    2973     Int numModifications = 0;
    2974    
    2975     for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )
    2976     {
    2977       numModifications +=  ( ge.m_interViewRefPosL[li][k] >= 0 ) ? 1 : 0;
    2978     }
    2979 
    2980     // set inter-view modifications
     3017    // set inter-view modifications   
     3018    Int tempList[16];
     3019    for( Int k = 0; k < 16; k++ )
     3020    {
     3021      tempList[ k ] = -1;
     3022    }
     3023
    29813024    Bool isModified = false;
    2982       Int tempList[16];
    2983       for( Int k = 0; k < 16; k++ ) { tempList[k] = -1; }
    2984 
    2985     if( (maxRefListSize > 1) && (numModifications > 0) )
    2986     {
    2987       for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )
    2988       {
    2989         if( ge.m_interViewRefPosL[li][k] >= 0 )
    2990         {
    2991           Int orgIdx    = numTemporalRefs;
     3025    if ( maxRefListSize > 1 )
     3026    {
     3027      for( Int k = 0, orgIdx = numTemporalRefs; k < ge.m_numActiveRefLayerPics; k++, orgIdx++ )
     3028      {
    29923029          Int targetIdx = ge.m_interViewRefPosL[ li ][ k ];
    2993           for( Int idx = 0; idx < vps->getNumDirectRefLayers( layer ); idx++ )
    2994           {           
    2995             Int refLayer  = vps->getLayerIdInVps( vps->getRefLayerId( layer, idx ) );         
    2996             if( ( layer + ge.m_interViewRefs[ k ]) == refLayer )
     3030
     3031        isModified = ( targetIdx != orgIdx ) && ( targetIdx >= 0  );
     3032        if ( isModified )
    29973033            {
     3034          assert( tempList[ targetIdx ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
    29983035              tempList[ targetIdx ] = orgIdx;             
    2999               isModified = ( targetIdx != orgIdx  );
    3000             }
    3001             orgIdx++;
    3002           }
    3003         }
    3004       }
    3005     }
    3006 
     3036        }
     3037      }
     3038    }
     3039
     3040    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    30073041    refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
    30083042
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.h

    r479 r534  
    221221#endif
    222222#if H_MV
    223    Void  xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid );
     223   Void  xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid );
    224224#endif
    225225#if L0386_DB_METRIC
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp

    r532 r534  
    525525#if H_MV
    526526  m_cSPS.setSPSId( getLayerIdInVps() );
     527  m_cSPS.setLayerId( getLayerId() );
    527528#endif
    528529  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
     
    746747  m_cPPS.setWPBiPred( m_useWeightedBiPred );
    747748  m_cPPS.setOutputFlagPresentFlag( false );
     749#if H_MV
     750  m_cPPS.setNumExtraSliceHeaderBits( 1 );
     751#endif
    748752  m_cPPS.setSignHideFlag(getSignHideFlag());
    749753#if L0386_DB_METRIC
Note: See TracChangeset for help on using the changeset viewer.