Changeset 622 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 11 Sep 2013, 14:40:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r608 r622 471 471 pcPic->setCurrSliceIdx(0); 472 472 473 474 #if H_MV5 475 #if H_MV 476 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() ); 477 #else 478 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 479 #endif 480 #else 473 481 #if H_3D 474 482 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), getLayerId() ); 475 483 #else 476 484 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 485 #endif 477 486 #endif 478 487 pcSlice->setLastIDR(m_iLastIDR); 479 488 pcSlice->setSliceIdx(0); 480 489 #if H_MV 490 #if H_MV5 491 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 492 #else 481 493 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer ); 494 #endif 482 495 pcPic ->setLayerId ( getLayerId() ); 483 496 pcPic ->setViewId ( getViewId() ); … … 642 655 refPicListModification->setRefPicListModificationFlagL1(0); 643 656 #if H_MV 657 #if H_MV5 658 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 ) 659 { 660 // Some more sophisticated algorithm to determine discardable_flag might be added here. 661 pcSlice->setDiscardableFlag ( false ); 662 } 663 664 TComVPS* vps = pcSlice->getVPS(); 665 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 666 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 667 668 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && 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 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 678 { 679 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 680 { 681 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 682 } 683 } 684 } 685 } 686 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 687 688 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 689 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 690 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 691 692 std::vector< TComPic* > tempRefPicLists[2]; 693 std::vector< Bool > usedAsLongTerm [2]; 694 Int numPocTotalCurr; 695 696 pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 697 698 699 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 700 #else 644 701 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 645 702 { … … 692 749 } 693 750 751 #endif 694 752 #else 695 753 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 702 760 703 761 // Set reference list 762 #if H_MV5 763 #if H_MV 764 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 765 #else 766 pcSlice->setRefPicList ( rcListPic ); 767 #endif 768 769 #if H_3D_ARP 770 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh 771 pcSlice->setARPStepNum(); 772 if(pcSlice->getARPStepNum() > 1) 773 { 774 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ ) 775 { 776 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 777 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 778 if( iViewIdx<getViewIndex() && !bIsDepth ) 779 { 780 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx ); 781 } 782 } 783 } 784 #endif 785 #else 704 786 #if H_MV 705 787 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer ); … … 722 804 pcSlice->setRefPicList ( rcListPic ); 723 805 #endif 724 806 #endif 725 807 #if H_3D 726 808 pcSlice->setIvPicLists( m_ivPicLists ); … … 1816 1898 digestStr = digestToString(sei_recon_picture_digest.digest, 4); 1817 1899 } 1900 #if H_MV_FIX_LID_PIC_HASH_SEI_T40 1901 OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer(), getLayerId() ); 1902 #else 1818 1903 OutputNALUnit nalu(NAL_UNIT_SUFFIX_SEI, pcSlice->getTLayer()); 1904 #endif 1819 1905 1820 1906 /* write the SEI messages */ … … 2080 2166 pcPic->setReconMark ( true ); 2081 2167 #if H_MV 2168 #if H_MV5 2169 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2170 #else 2082 2171 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 2172 #endif 2083 2173 std::vector<Int> temp; 2084 2174 TComSlice::markCurrPic( pcPic ); … … 2912 3002 2913 3003 #if H_MV 3004 #if H_MV5 3005 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 3006 { 3007 3008 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 ) 3009 { 3010 return; 3011 } 3012 3013 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid ); 3014 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 3015 3016 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 3017 3018 // GT: check if SliceType should be checked here. 3019 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 3020 { 3021 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 3022 3023 Int finalIdxToTempIdxMap[16]; 3024 for( Int k = 0; k < 16; k++ ) 3025 { 3026 finalIdxToTempIdxMap[ k ] = -1; 3027 } 3028 3029 Bool isModified = false; 3030 if ( numPicsInTempList > 1 ) 3031 { 3032 for( Int k = 0; k < pcSlice->getNumActiveRefLayerPics(); k++ ) 3033 { 3034 // get position in temp. list 3035 Int refPicLayerId = pcSlice->getRefPicLayerId(k); 3036 Int idxInTempList = 0; 3037 for (; idxInTempList < numPicsInTempList; idxInTempList++) 3038 { 3039 if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId ) 3040 { 3041 break; 3042 } 3043 } 3044 3045 Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ]; 3046 3047 // Add negative from behind 3048 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3049 3050 Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ; 3051 if ( curIsModified ) 3052 { 3053 isModified = true; 3054 assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 3055 } 3056 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3057 } 3058 } 3059 3060 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3061 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3062 3063 if( isModified ) 3064 { 3065 Int refIdx = 0; 3066 3067 for( Int i = 0; i < numPicsInFinalRefList; i++ ) 3068 { 3069 if( finalIdxToTempIdxMap[i] >= 0 ) 3070 { 3071 refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] ); 3072 } 3073 else 3074 { 3075 ///* Fill gaps with temporal references */// 3076 // Forward inter layer reference pictures 3077 while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId()) ) 3078 { 3079 refIdx++; 3080 } 3081 refPicListModification->setRefPicSetIdxL( li, i, refIdx ); 3082 refIdx++; 3083 } 3084 } 3085 } 3086 } 3087 } 3088 #else 2914 3089 Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ) 2915 3090 { … … 2975 3150 } 2976 3151 #endif 3152 #endif 2977 3153 //! \}
Note: See TracChangeset for help on using the changeset viewer.