Ignore:
Timestamp:
24 Jun 2013, 21:36:38 (11 years ago)
Author:
tech
Message:

Incorporated further encoder parameters.

File:
1 edited

Legend:

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

    r491 r493  
    655655    refPicListModification->setRefPicListModificationFlagL1(0);
    656656#if H_MV
     657
     658    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     659    {
     660      pcSlice->setDiscardableFlag           ( false );     
     661    }   
     662
     663    TComVPS*           vps = pcSlice->getVPS();
     664    Int       layerIdInVps = vps    ->getLayerIdInVps( getLayerId());
     665    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( layerIdInVps );
     666    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
     667   
     668    if ( getLayerId() > 0 && numDirectRefLayers > 0 )
     669    {         
     670      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     671      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
     672      {
     673        if ( !vps->getMaxOneActiveRefLayerFlag() )
     674        {   
     675          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
     676        }
     677        for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
     678        {
     679          pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
     680        }
     681      }
     682    }
     683    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     684   
     685    if ( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && pcSlice->getNumActiveRefLayerPics() > 0)
     686    {
     687      pcSlice->setInterLayerSamplePredOnlyFlag( gopEntry.m_numRefPics == 0 );
     688    }   
     689
    657690    pcSlice->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );
    658     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() ) ) );
    659     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() ) ) );
    660     xSetRefPicListModificationsMvc( pcSlice, pocCurr, iGOPid );   
     691    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
     692    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
     693    xSetRefPicListModificationsMvc( pcSlice, iGOPid );   
     694
     695    pcSlice->setActiveMotionPredRefLayers( );
     696
     697    if ( getLayerId() > 0 && pcSlice->getNumActiveMotionPredRefLayers() > 0 && pcSlice->getEnableTMVPFlag() &&
     698        ( pcSlice->getSliceType() == B_SLICE || pcSlice->getSliceType() == P_SLICE ))
     699    {
     700      pcSlice->setAltCollocatedIndicationFlag( gopEntry.m_collocatedRefLayerIdx >= 0 );
     701      if ( pcSlice->getNumActiveRefLayerPics() && pcSlice->getNumActiveMotionPredRefLayers() > 0 )
     702      {
     703        pcSlice->setCollocatedRefLayerIdx( gopEntry.m_collocatedRefLayerIdx );
     704      }
     705    }
     706
    661707#else
    662708    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    28962942#endif
    28972943#if H_MV
    2898 Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid )
     2944Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt iGOPid )
    28992945{
    29002946  TComVPS* vps = pcSlice->getVPS();
     
    29192965    Int numModifications = 0;
    29202966   
    2921     for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )
     2967    for( Int k = 0; k < ge.m_numActiveRefLayerPics; k++ )
    29222968    {
    29232969      numModifications +=  ( ge.m_interViewRefPosL[li][k] >= 0 ) ? 1 : 0;
     
    29312977    if( (maxRefListSize > 1) && (numModifications > 0) )
    29322978    {
    2933       for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )
     2979      for( Int k = 0; k < ge.m_numActiveRefLayerPics; k++ )
    29342980      {
    29352981        if( ge.m_interViewRefPosL[li][k] >= 0 )
     
    29402986          {           
    29412987            Int refLayer  = vps->getLayerIdInVps( vps->getRefLayerId( layer, idx ) );         
    2942             if( ( layer + ge.m_interViewRefs[ k ]) == refLayer )
     2988            if( ( layer + ge.m_interLayerPredLayerIdc[ k ]) == refLayer )
    29432989            {
    29442990              tempList[ targetIdx ] = orgIdx;             
Note: See TracChangeset for help on using the changeset viewer.