Changeset 497 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder
- Timestamp:
- 26 Jun 2013, 15:57:04 (12 years ago)
- Location:
- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r495 r497 691 691 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) ); 692 692 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 ); 694 695 695 696 pcSlice->setActiveMotionPredRefLayers( ); … … 2948 2949 #endif 2949 2950 #if H_MV 2950 Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt iGOPid ) 2951 { 2952 TComVPS* vps = pcSlice->getVPS(); 2951 Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ) 2952 { 2953 2953 Int layer = pcSlice->getLayerIdInVps( ); 2954 2954 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 ) 2956 2956 { 2957 2957 return; … … 2960 2960 // analyze inter-view modifications 2961 2961 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 2965 2964 Int maxRefListSize = pcSlice->getNumRpsCurrTempList(); 2966 Int numTemporalRefs = maxRefListSize - vps->getNumDirectRefLayers( layer ); 2967 2968 2965 Int numTemporalRefs = maxRefListSize - pcSlice->getNumActiveRefLayerPics(); 2966 2969 2967 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2970 2968 { 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 2979 2976 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(); 3005 2993 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3006 2994 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 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 } 3023 3011 } 3024 3012 } -
branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.h
r493 r497 221 221 #endif 222 222 #if H_MV 223 Void xSetRefPicListModificationsMv c( TComSlice* pcSlice, UInt iGOPid );223 Void xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ); 224 224 #endif 225 225 #if L0386_DB_METRIC
Note: See TracChangeset for help on using the changeset viewer.