Changeset 821 in SHVCSoftware for branches/SHM-dev


Ignore:
Timestamp:
8 Jul 2014, 06:07:59 (10 years ago)
Author:
seregin
Message:

move RefPicList copying and MFM derivation into ILR picture function

Location:
branches/SHM-dev/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r820 r821  
    516516#endif
    517517
    518 #if SVC_EXTENSION
    519   for( i = 0; i < m_activeNumILRRefIdx; i++ )
    520   {
    521     UInt refLayerIdc = m_interLayerPredLayerIdc[i];
    522     //inter-layer reference picture
    523 #if O0225_MAX_TID_FOR_REF_LAYERS
    524     Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId(),m_layerId) : 0;
    525 #else
    526     Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;
    527 #endif
    528     if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=  maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
    529     {
    530 #if REF_IDX_MFM
    531       if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && getMFMEnabledFlag())
    532       {
    533         ilpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcBaseColPic[refLayerIdc] );
    534       }
    535       else
    536       {
    537         ilpPic[refLayerIdc]->initUpsampledMvField();
    538       }
    539 #endif
    540       ilpPic[refLayerIdc]->setIsLongTerm(1);
    541     }
    542   }
    543 #endif
    544518  // ref_pic_list_init
    545519  TComPic*  rpsCurrList0[MAX_NUM_REF+1];
     
    38953869#endif
    38963870
    3897 #if REF_IDX_MFM
    3898 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic** pcRefPicRL )
    3899 {
    3900   for( UInt i = 0; i < m_activeNumILRRefIdx; i++ )
    3901   {
    3902     UInt refLayerIdc = m_interLayerPredLayerIdc[i];
    3903 
    3904     TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc];
    3905 
    3906     //set reference picture POC of each ILP reference
    3907     Int thePoc = ilpPic[refLayerIdc]->getPOC();
    3908     assert(thePoc == pcRefPicBL->getPOC());
    3909 
    3910     ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL );
    3911 
    3912     //copy layer id from the reference layer   
    3913     ilpPic[refLayerIdc]->setLayerId( pcRefPicBL->getLayerId() );
    3914 
    3915     //copy slice type from the reference layer
    3916     ilpPic[refLayerIdc]->getSlice(0)->setSliceType( pcRefPicBL->getSlice(0)->getSliceType() );
    3917 
    3918     //copy "used for reference"
    3919     ilpPic[refLayerIdc]->getSlice(0)->setReferenced( pcRefPicBL->getSlice(0)->isReferenced() );
    3920 
    3921     for( Int refList = 0; refList < 2; refList++ )
    3922     {
    3923       RefPicList refPicList = RefPicList( refList );
    3924 
    3925       //set reference POC of ILP
    3926       ilpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList));
    3927       assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0);
    3928       assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF);
    3929 
    3930       //initialize reference POC of ILP
    3931       for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++)
    3932       {
    3933         ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx);
    3934         ilpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx);
    3935       }
    3936 
    3937       for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++)
    3938       {
    3939         ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx);
    3940         ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx);
    3941       }
    3942 
    3943       //copy reference pictures' marking from the reference layer
    3944       for(Int j = 0; j < MAX_NUM_REF + 1; j++)
    3945       {
    3946         ilpPic[refLayerIdc]->getSlice(0)->setIsUsedAsLongTerm(refList, j, pcRefPicBL->getSlice(0)->getIsUsedAsLongTerm(refList, j));
    3947       }
    3948     }
    3949   }
    3950   return;
    3951 }
    3952 #endif
    3953 
    39543871Void TComSlice::setILRPic(TComPic **pcIlpPic)
    39553872{
     
    39603877    if( pcIlpPic[refLayerIdc] )
    39613878    {
    3962       pcIlpPic[refLayerIdc]->copyUpsampledPictureYuv( m_pcPic->getFullPelBaseRec( refLayerIdc ), pcIlpPic[refLayerIdc]->getPicYuvRec() );
     3879      TComPic* pcRefPicBL = m_pcBaseColPic[refLayerIdc];
     3880
     3881      pcIlpPic[refLayerIdc]->copyUpsampledPictureYuv( m_pcPic->getFullPelBaseRec( refLayerIdc ), pcIlpPic[refLayerIdc]->getPicYuvRec() );     
     3882      pcIlpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL );
     3883
     3884      //set reference picture POC of each ILP reference
    39633885      pcIlpPic[refLayerIdc]->getSlice(0)->setPOC( m_iPOC );
    3964       pcIlpPic[refLayerIdc]->setLayerId( m_pcBaseColPic[refLayerIdc]->getLayerId() ); //set reference layerId
     3886
     3887      //set temporal Id
     3888      pcIlpPic[refLayerIdc]->getSlice(0)->setTLayer( m_uiTLayer );
     3889
     3890      //copy layer id from the reference layer
     3891      pcIlpPic[refLayerIdc]->setLayerId( pcRefPicBL->getLayerId() );
     3892
    39653893      pcIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension( false );
    39663894      pcIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder();
     
    39693897        pcIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId( pcIlpPic[refLayerIdc]->getLayerId() );
    39703898      }
    3971     }
    3972   }
    3973 }
    3974 
     3899      pcIlpPic[refLayerIdc]->setIsLongTerm(1);
     3900
     3901#if REF_IDX_MFM
     3902      if( m_bMFMEnabledFlag && !(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) )
     3903      {
     3904        //set reference picture POC of each ILP reference
     3905        assert( pcIlpPic[refLayerIdc]->getPOC() == pcRefPicBL->getPOC() );
     3906
     3907        //copy slice type from the reference layer
     3908        pcIlpPic[refLayerIdc]->getSlice(0)->setSliceType( pcRefPicBL->getSlice(0)->getSliceType() );
     3909
     3910        //copy "used for reference"
     3911        pcIlpPic[refLayerIdc]->getSlice(0)->setReferenced( pcRefPicBL->getSlice(0)->isReferenced() );
     3912
     3913        for( Int refList = 0; refList < 2; refList++ )
     3914        {
     3915          RefPicList refPicList = RefPicList( refList );
     3916
     3917          //set reference POC of ILP
     3918          pcIlpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList));
     3919          assert(pcIlpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0);
     3920          assert(pcIlpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF);
     3921
     3922          //initialize reference POC of ILP
     3923          for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++)
     3924          {
     3925            pcIlpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx);
     3926            pcIlpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx);
     3927          }
     3928
     3929          for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++)
     3930          {
     3931            pcIlpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx);
     3932            pcIlpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx);
     3933          }
     3934
     3935          //copy reference pictures' marking from the reference layer
     3936          for(Int j = 0; j < MAX_NUM_REF + 1; j++)
     3937          {
     3938            pcIlpPic[refLayerIdc]->getSlice(0)->setIsUsedAsLongTerm(refList, j, pcRefPicBL->getSlice(0)->getIsUsedAsLongTerm(refList, j));
     3939          }
     3940        }
     3941
     3942        pcIlpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcBaseColPic[refLayerIdc] );
     3943      }
     3944      else
     3945      {
     3946        pcIlpPic[refLayerIdc]->initUpsampledMvField();
     3947      }
     3948#endif
     3949
     3950#if O0225_MAX_TID_FOR_REF_LAYERS
     3951      Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1( pcIlpPic[refLayerIdc]->getSlice(0)->getLayerId(), m_layerId );
     3952#else
     3953      Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1( pcIlpPic[refLayerIdc]->getSlice(0)->getLayerId() );
     3954#endif
     3955      assert( (Int)pcIlpPic[refLayerIdc]->getSlice(0)->getTLayer() < maxTidIlRefPicsPlus1 || ( !maxTidIlRefPicsPlus1 && pcIlpPic[refLayerIdc]->getSlice(0)->getRapPicFlag() ) );
     3956
     3957    }
     3958  }
     3959}
    39753960#endif //SVC_EXTENSION
    39763961
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r820 r821  
    24102410  Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
    24112411
    2412 #if REF_IDX_MFM
    2413   Void      setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL);
    2414 #endif
    2415 
    24162412  Int       getActiveNumILRRefIdx     ( )               { return  m_activeNumILRRefIdx; }
    24172413  Void      setActiveNumILRRefIdx     ( Int i )         { m_activeNumILRRefIdx = i;     } 
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r820 r821  
    19321932
    19331933#if REF_IDX_MFM
    1934       if( pcSlice->getMFMEnabledFlag() )
    1935       {
    1936         pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
    1937       }
    19381934      pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
    19391935    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r820 r821  
    16991699    if(m_layerId ==  0 || ( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 ) )
    17001700    {
    1701       pcSlice->setRefPicList( rcListPic);
     1701      pcSlice->setRefPicList( rcListPic );
    17021702    }
    17031703
     
    17051705    {
    17061706      pcSlice->setILRPic( m_pcEncTop->getIlpList() );
    1707 #if REF_IDX_MFM
    1708       if( pcSlice->getMFMEnabledFlag() )
    1709       {
    1710         pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
    1711       }
    1712 #else
     1707#if !REF_IDX_MFM
    17131708      //  Set reference list
    17141709      pcSlice->setRefPicList ( rcListPic );
Note: See TracChangeset for help on using the changeset viewer.