Changeset 497 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0


Ignore:
Timestamp:
26 Jun 2013, 15:57:04 (11 years ago)
Author:
tech
Message:

Fixes to RefPicList modification.

Location:
branches/HTM-DEV-0.3-dev0/source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r483 r497  
    152152  Int  pocCurrPic        = -MAX_INT;     
    153153  Int  pocLastPic        = -MAX_INT;   
    154  
    155   Int  layerIdLastPic    = 0;
     154
    156155  Int  layerIdCurrPic    = 0;
    157156
     
    230229        if ( bNewPicture || !bitstreamFile )
    231230        {
    232           layerIdLastPic    = layerIdCurrPic; 
    233231          layerIdCurrPic    = nalu.m_layerId;
    234232         
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r496 r497  
    517517  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
    518518
    519 #if H_MV
    520  
    521   Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + getNumActiveRefLayerPics( );
     519#if H_MV 
     520  Int numPocTotalCurr = ( getInterRefEnabledInRPLFlag() ? ( NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr ) : 0 ) + getNumActiveRefLayerPics( );
    522521  assert( numPocTotalCurr == getNumRpsCurrTempList() );
    523522#else
     
    613612  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
    614613
     614#if H_MV
     615  Int numPocSt = getInterRefEnabledInRPLFlag( ) ?  (NumPocStCurr0 + NumPocStCurr1) : 0;
     616
     617  for (Int li = 0; li < 2; li++)
     618  {
     619    if ( m_eSliceType == P_SLICE && li == 1 )
     620    {
     621      m_aiNumRefIdx[1] = 0;
     622      ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
     623    }
     624    else
     625    {
     626      for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)
     627      {
     628        Bool listModified             =                m_RefPicListModification.getRefPicListModificationFlagL( li );
     629        Int orgIdx                    = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr);
     630
     631        m_apcRefPicList    [li][rIdx] = ( li == 0 )  ? rpsCurrList0[ orgIdx  ] : rpsCurrList1[ orgIdx  ];
     632        m_bIsUsedAsLongTerm[li][rIdx] = ( orgIdx >= numPocSt ) ;
     633      }
     634    }
     635  }
     636#else
     637
    615638  for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++)
    616639  {
     
    633656    }
    634657  }
     658#endif
    635659}
    636660
     
    669693  }
    670694#if H_MV
    671   numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
     695  numRpsCurrTempList = ( getInterRefEnabledInRPLFlag() ? numRpsCurrTempList : 0 ) + getNumActiveRefLayerPics();
    672696#endif
    673697  return numRpsCurrTempList;
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h

    r495 r497  
    12661266#if H_MV
    12671267  // Why not an listIdx for all members, would avoid code duplication??
    1268   Void       setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; };
    1269   Void       setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0  ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag;  }; 
     1268  Void       setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; }
     1269  UInt       getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; }
     1270  Void       setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0  ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag;  }
     1271  Bool       getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; }
    12701272#endif
    12711273};
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r495 r497  
    691691    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
    692692    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );
    693     xSetRefPicListModificationsMvc( pcSlice, iGOPid );   
     693
     694    xSetRefPicListModificationsMv( pcSlice, iGOPid );   
    694695
    695696    pcSlice->setActiveMotionPredRefLayers( );
     
    29482949#endif
    29492950#if H_MV
    2950 Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt iGOPid )
    2951 {
    2952   TComVPS* vps = pcSlice->getVPS();
     2951Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )
     2952{   
    29532953  Int layer    = pcSlice->getLayerIdInVps( );
    29542954 
    2955   if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || vps->getNumDirectRefLayers( layer ) == 0 )
     2955  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
    29562956  {
    29572957    return;
     
    29602960  // analyze inter-view modifications
    29612961  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( layer > 0) ) ? MAX_GOP : iGOPid );
    2962 
    2963   TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    2964  
     2962  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
     2963
    29652964  Int maxRefListSize  = pcSlice->getNumRpsCurrTempList();
    2966   Int numTemporalRefs = maxRefListSize - vps->getNumDirectRefLayers( layer );
    2967 
    2968 
     2965  Int numTemporalRefs = maxRefListSize - pcSlice->getNumActiveRefLayerPics();
     2966 
    29692967  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
    29702968  {
    2971     Int numModifications = 0;
    2972    
    2973     for( Int k = 0; k < ge.m_numActiveRefLayerPics; k++ )
    2974     {
    2975       numModifications +=  ( ge.m_interViewRefPosL[li][k] >= 0 ) ? 1 : 0;
    2976     }
    2977 
    2978     // set inter-view modifications
     2969    // set inter-view modifications   
     2970    Int tempList[16];
     2971    for( Int k = 0; k < 16; k++ )
     2972    {
     2973      tempList[ k ] = -1;
     2974    }
     2975
    29792976    Bool isModified = false;
    2980       Int tempList[16];
    2981       for( Int k = 0; k < 16; k++ ) { tempList[k] = -1; }
    2982 
    2983     if( (maxRefListSize > 1) && (numModifications > 0) )
    2984     {
    2985       for( Int k = 0; k < ge.m_numActiveRefLayerPics; k++ )
    2986       {
    2987         if( ge.m_interViewRefPosL[li][k] >= 0 )
    2988         {
    2989           Int orgIdx    = numTemporalRefs;
    2990           Int targetIdx = ge.m_interViewRefPosL[ li ][ k ];
    2991           for( Int idx = 0; idx < vps->getNumDirectRefLayers( layer ); idx++ )
    2992           {           
    2993             Int refLayer  = vps->getLayerIdInVps( vps->getRefLayerId( layer, idx ) );         
    2994             if( ( layer + ge.m_interLayerPredLayerIdc[ k ]) == refLayer )
    2995             {
    2996               tempList[ targetIdx ] = orgIdx;             
    2997               isModified = ( targetIdx != orgIdx  );
    2998             }
    2999             orgIdx++;
    3000           }
    3001         }
    3002       }
    3003     }
    3004 
     2977    if ( maxRefListSize > 1 )
     2978    {     
     2979      for( Int k = 0, orgIdx = numTemporalRefs; k < ge.m_numActiveRefLayerPics; k++, orgIdx++ )
     2980      {
     2981        Int targetIdx = ge.m_interViewRefPosL[ li ][ k ];
     2982
     2983        isModified = ( targetIdx != orgIdx ) && ( targetIdx >= 0  );
     2984        if ( isModified )
     2985        {
     2986          assert( tempList[ targetIdx ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
     2987          tempList[ targetIdx ] = orgIdx;             
     2988        }
     2989      }     
     2990    }
     2991
     2992    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    30052993    refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
    30062994
    3007       if( isModified )
    3008       {
    3009         Int temporalRefIdx = 0;
    3010         for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )
    3011         {
    3012           if( tempList[i] >= 0 )
    3013           {
    3014             refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );
    3015           }
    3016           else
    3017           {
    3018             refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );
    3019             temporalRefIdx++;
    3020           }
    3021         }
    3022       }
     2995    if( isModified )
     2996    {
     2997      Int temporalRefIdx = 0;
     2998      for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )
     2999      {
     3000        if( tempList[i] >= 0 )
     3001        {
     3002          refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );
     3003        }
     3004        else
     3005        {
     3006          refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );
     3007          temporalRefIdx++;
     3008        }
     3009      }
     3010    }
    30233011  }
    30243012}
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.h

    r493 r497  
    221221#endif
    222222#if H_MV
    223    Void  xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt iGOPid );
     223   Void  xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid );
    224224#endif
    225225#if L0386_DB_METRIC
Note: See TracChangeset for help on using the changeset viewer.