Changeset 534 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 13 Jul 2013, 10:26:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r532 r534 502 502 pcSlice->setSliceIdx(0); 503 503 #if H_MV 504 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer ); 504 505 pcPic ->setLayerId ( getLayerId() ); 505 506 pcPic ->setViewId ( getViewId() ); … … 669 670 refPicListModification->setRefPicListModificationFlagL1(0); 670 671 #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 671 704 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 675 722 #else 676 723 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 827 874 pcSlice->setEnableTMVPFlag(0); 828 875 } 829 830 876 #if H_MV 831 877 if( pcSlice->getIdrPicFlag() ) … … 2120 2166 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 2121 2167 std::vector<Int> temp; 2168 TComSlice::markCurrPic( pcPic ); 2122 2169 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() ); 2123 2170 #endif … … 2950 2997 #endif 2951 2998 #if H_MV 2952 Void TEncGOP::xSetRefPicListModificationsMv c( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid )2999 Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ) 2953 3000 { 2954 TComVPS* vps = pcSlice->getVPS();2955 3001 Int layer = pcSlice->getLayerIdInVps( ); 2956 3002 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 ) 2958 3004 { 2959 3005 return; … … 2962 3008 // analyze inter-view modifications 2963 3009 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() ); 2966 3011 2967 3012 Int maxRefListSize = pcSlice->getNumRpsCurrTempList(); 2968 Int numTemporalRefs = maxRefListSize - vps->getNumDirectRefLayers( layer ); 2969 3013 Int numTemporalRefs = maxRefListSize - pcSlice->getNumActiveRefLayerPics(); 2970 3014 2971 3015 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2972 3016 { 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 2981 3024 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 { 2992 3029 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 ) 2997 3033 { 3034 assert( tempList[ targetIdx ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 2998 3035 tempList[ targetIdx ] = orgIdx; 2999 isModified = ( targetIdx != orgIdx ); 3000 } 3001 orgIdx++; 3002 } 3003 } 3004 } 3005 } 3006 3036 } 3037 } 3038 } 3039 3040 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3007 3041 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3008 3042
Note: See TracChangeset for help on using the changeset viewer.