Changeset 1356 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp


Ignore:
Timestamp:
27 Oct 2015, 11:33:16 (9 years ago)
Author:
tech
Message:

Merged 15.1-dev0-NICT@1355.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r1321 r1356  
    100100  m_layerId      = 0;
    101101  m_viewId       = 0;
    102   m_pocLastCoded = -1; 
     102  m_pocLastCoded = -1;
    103103#if NH_3D
    104   m_viewIndex  =   0; 
     104  m_viewIndex  =   0;
    105105  m_isDepth = false;
    106106#endif
     
    147147
    148148#if NH_MV
    149   m_ivPicLists           = pcTEncTop->getIvPicLists(); 
     149  m_ivPicLists           = pcTEncTop->getIvPicLists();
    150150  m_layerId              = pcTEncTop->getLayerId();
    151151  m_viewId               = pcTEncTop->getViewId();
     
    156156#endif
    157157#if NH_3D_IC
    158   m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
    159   m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
     158  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
     159  m_aICEnableNum         = pcTEncTop->getICEnableNum();
    160160#endif
    161161#if KWU_FIX_URQ
     
    207207#if NH_MV
    208208  if ( getLayerId() == 0 )
    209   { 
     209  {
    210210    actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
    211211  }
     
    277277
    278278  while ( (itNalu!=accessUnit.end())&&
    279     ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 
     279    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
    280280    || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
    281281    || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
     
    288288  SEIMessages localMessages = seiMessages;
    289289  SEIMessages currentMessages;
    290  
     290
    291291#if ENC_DEC_TRACE
    292292  g_HLSTraceEnable = !testWrite;
     
    299299  xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
    300300  xClearSEIs(currentMessages, !testWrite);
    301  
     301
    302302  // Buffering period SEI must always be following active parameter sets
    303303  currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
     
    328328  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
    329329  xClearSEIs(currentMessages, !testWrite);
     330
     331#if NH_MV_LAYERS_NOT_PRESENT_SEI
     332  // Layers not present SEI message
     333  currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT);
     334  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
     335  xClearSEIs(currentMessages, !testWrite);
     336#endif
    330337
    331338  // And finally everything else one by one
     
    412419Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps)
    413420{
    414 #if NH_MV
    415   OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());
    416 #else
    417421  OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
    418 #endif
     422
    419423  if(m_pcCfg->getActiveParameterSetsSEIEnabled())
    420424  {
     
    472476    seiMessages.push_back(sei);
    473477  }
    474    
     478
    475479  if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled)
    476480  {
     
    482486
    483487#if NH_MV
     488#if !NH_MV_SEI
    484489  if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) )
    485490  {
    486491    SEISubBitstreamProperty *sei = new SEISubBitstreamProperty;
    487     m_seiEncoder.initSEISubBitstreamProperty( sei, sps );   
     492    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );
    488493    seiMessages.push_back(sei);
    489494  }
     495#endif
    490496#endif
    491497}
     
    679685      }
    680686    }
    681    
     687
    682688    if( m_pcCfg->getPictureTimingSEIEnabled() )
    683689    {
     
    715721    return;
    716722  }
    717   // fix first 
     723  // fix first
    718724  UInt numNalUnits = (UInt)testAU.size();
    719725  UInt numRBSPBytes = 0;
     
    927933          IRAPGOPid = iGOPid;
    928934          IRAPtoReorder = true;
    929           swapIRAPForward = true; 
     935          swapIRAPForward = true;
    930936          break;
    931937        }
     
    935941          IRAPGOPid = iGOPid;
    936942          IRAPtoReorder = true;
    937           swapIRAPForward = false; 
     943          swapIRAPForward = false;
    938944          break;
    939945        }
     
    10661072#endif
    10671073#if NH_MV
    1068 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 
    1069                                 TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP, 
     1074Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
     1075                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
    10701076                                Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
    10711077#else
     
    11701176    pcPic->setCurrSliceIdx(0);
    11711177#if NH_MV
    1172     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );     
     1178    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );
    11731179#else
    11741180    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
     
    11811187    pcSlice->setSliceIdx(0);
    11821188#if NH_MV
    1183     pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
     1189    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    11841190    pcPic  ->setLayerId     ( getLayerId()   );
    1185     pcPic  ->setViewId      ( getViewId()    );   
     1191    pcPic  ->setViewId      ( getViewId()    );
    11861192#if !NH_3D
    11871193    pcSlice->setLayerId     ( getLayerId() );
    1188     pcSlice->setViewId      ( getViewId()  );   
     1194    pcSlice->setViewId      ( getViewId()  );
    11891195    pcSlice->setVPS         ( m_pcEncTop->getVPS() );
    11901196#else
    1191     pcPic  ->setViewIndex   ( getViewIndex() ); 
     1197    pcPic  ->setViewIndex   ( getViewIndex() );
    11921198    pcPic  ->setIsDepth( getIsDepth() );
    1193     pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );   
    1194 #endif
    1195 #endif 
     1199    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
     1200#endif
     1201#endif
    11961202    //set default slice level flag to the same as SPS level flag
    11971203    pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
     
    12011207    if( pcSlice->getSliceType() == B_SLICE )
    12021208    {
    1203       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1204       { 
     1209      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1210      {
    12051211        pcSlice->setSliceType( P_SLICE );
    12061212      }
     
    12101216    if( pcSlice->getSliceType() == B_SLICE )
    12111217    {
    1212       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 
    1213       { 
     1218      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
     1219      {
    12141220        pcSlice->setSliceType( I_SLICE );
    12151221      }
     
    12251231      pcSlice->setSliceType(I_SLICE);
    12261232    }
    1227    
     1233
    12281234    // Set the nal unit type
    12291235    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
     
    12791285    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    12801286    }
    1281     if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 
     1287    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
    12821288      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
    12831289      )
     
    12881294    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    12891295
    1290     if(pcSlice->getTLayer() > 0 
     1296    if(pcSlice->getTLayer() > 0
    12911297      &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
    12921298          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
     
    13581364    if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    13591365    {
    1360       // Some more sophisticated algorithm to determine discardable_flag might be added here. 
    1361       pcSlice->setDiscardableFlag           ( false );     
    1362     }   
    1363 
    1364     const TComVPS*           vps = pcSlice->getVPS();     
     1366      // Some more sophisticated algorithm to determine discardable_flag might be added here.
     1367      pcSlice->setDiscardableFlag           ( false );
     1368    }
     1369
     1370    const TComVPS*           vps = pcSlice->getVPS();
    13651371#if NH_3D
    1366     Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() ); 
     1372    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() );
    13671373#else
    1368     Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
     1374    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    13691375#endif
    13701376#if NH_3D
    1371     pcSlice->setIvPicLists( m_ivPicLists );         
     1377    pcSlice->setIvPicLists( m_ivPicLists );
    13721378
    13731379    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
    1374     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
     1380    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
    13751381#else
    1376     GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
    1377 #endif
    1378 
    1379 
    1380    
    1381     Bool interLayerPredLayerIdcPresentFlag = false; 
     1382    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );
     1383#endif
     1384
     1385
     1386
     1387    Bool interLayerPredLayerIdcPresentFlag = false;
    13821388    if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
    1383     {         
    1384       pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
     1389    {
     1390      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );
    13851391      if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
    13861392      {
    13871393        if ( !vps->getMaxOneActiveRefLayerFlag() )
    1388         {   
    1389           pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 
     1394        {
     1395          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
    13901396        }
    13911397#if NH_3D
     
    13941400        if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
    13951401#endif
    1396         {       
    1397           interLayerPredLayerIdcPresentFlag = true; 
     1402        {
     1403          interLayerPredLayerIdcPresentFlag = true;
    13981404          for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
    13991405          {
    1400             pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 
     1406            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
    14011407          }
    14021408        }
     
    14051411    if ( !interLayerPredLayerIdcPresentFlag )
    14061412    {
    1407       for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
     1413      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )
    14081414      {
    14091415        pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
     
    14121418
    14131419
    1414     assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
    1415    
     1420    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
     1421
    14161422#if NH_3D
    14171423    if ( m_pcEncTop->decProcAnnexI() )
    1418     {   
    1419       pcSlice->deriveInCmpPredAndCpAvailFlag( ); 
     1424    {
     1425      pcSlice->deriveInCmpPredAndCpAvailFlag( );
    14201426      if ( pcSlice->getInCmpPredAvailFlag() )
    1421       {     
    1422         pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
     1427      {
     1428        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
    14231429      }
    14241430      else
     
    14341440            printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
    14351441          }
    1436          
     1442
    14371443          exit(EXIT_FAILURE);
    14381444        }
    14391445      }
    1440       pcSlice->init3dToolParameters(); 
    1441       pcSlice->checkInCompPredRefLayers(); 
    1442     }   
     1446      pcSlice->init3dToolParameters();
     1447      pcSlice->checkInCompPredRefLayers();
     1448    }
    14431449#if NH_3D_IV_MERGE
    14441450    // This needs to be done after initialization of 3D tool parameters.
     
    14471453#endif
    14481454
    1449     pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
     1455    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    14501456    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
    14511457    pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     
    14561462
    14571463    pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    1458    
    1459 
    1460     xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );   
     1464
     1465
     1466    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );
    14611467#else
    14621468    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
     
    14641470#endif
    14651471    //  Set reference list
    1466 #if NH_MV   
    1467     pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 
     1472#if NH_MV
     1473    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
    14681474#else
    14691475    pcSlice->setRefPicList ( rcListPic );
     
    14771483#endif
    14781484#if NH_3D_IC
    1479     pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
    1480     pcSlice->setICEnableNum( m_aICEnableNum );         
     1485    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
     1486    pcSlice->setICEnableNum( m_aICEnableNum );
    14811487#endif
    14821488
     
    14851491    if ( pcSlice->getSliceType() == B_SLICE )
    14861492    {
    1487       if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
    1488       { 
    1489         pcSlice->setSliceType( P_SLICE ); 
     1493      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
     1494      {
     1495        pcSlice->setSliceType( P_SLICE );
    14901496      }
    14911497    }
     
    15661572
    15671573#if NH_3D_VSO
    1568   // Should be moved to TEncTop !!! 
     1574  // Should be moved to TEncTop !!!
    15691575  Bool bUseVSO = m_pcEncTop->getUseVSO();
    1570  
    1571   TComRdCost* pcRdCost = m_pcEncTop->getRdCost();   
     1576
     1577  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();
    15721578
    15731579  pcRdCost->setUseVSO( bUseVSO );
     
    17251731#endif
    17261732#if NH_3D
    1727       pcSlice->setDepthToDisparityLUTs(); 
     1733      pcSlice->setDepthToDisparityLUTs();
    17281734
    17291735#endif
     
    18351841    xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice);
    18361842
     1843#if NH_MV_SEI
     1844    m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice );
     1845#endif
     1846
    18371847    /* use the main bitstream buffer for storing the marshalled picture */
    18381848    m_pcEntropyCoder->setBitstream(NULL);
     
    19801990    cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled());
    19811991#if NH_3D
    1982       pcPic->compressMotion(2); 
     1992      pcPic->compressMotion(2);
    19831993#else
    19841994    pcPic->compressMotion();
     
    20552065    pcPic->setReconMark   ( true );
    20562066#if NH_MV
    2057       TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    2058       std::vector<Int> temp; 
    2059       TComSlice::markCurrPic( pcPic ); 
     2067      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     2068      std::vector<Int> temp;
     2069      TComSlice::markCurrPic( pcPic );
    20602070#endif
    20612071    m_bFirst = false;
     
    20942104  //-- all
    20952105#if NH_MV
    2096   printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );   
     2106  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
    20972107#else
    20982108  printf( "\n\nSUMMARY --------------------------------------------------------\n" );
     
    24022412#if H_3D_VSO_SYNTH_DIST_OUT
    24032413}
    2404 #endif 
    2405 #endif 
     2414#endif
     2415#endif
    24062416  /* calculate the size of the access unit, excluding:
    24072417   *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
     
    25262536
    25272537#if  NH_MV
    2528   assert( 0 ); // Field coding and MV need to be aligned. 
     2538  assert( 0 ); // Field coding and MV need to be aligned.
    25292539#else
    25302540
     
    29692979#if NH_MV
    29702980Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
    2971 { 
    2972  
     2981{
     2982
    29732983  if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
    29742984  {
    29752985    return;
    29762986  }
    2977  
     2987
    29782988  GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
    2979   assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 
    2980 
    2981   Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList(); 
    2982 
    2983   // GT: check if SliceType should be checked here. 
     2989  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
     2990
     2991  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();
     2992
     2993  // GT: check if SliceType should be checked here.
    29842994  for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
    29852995  {
    2986     Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 
    2987            
     2996    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
     2997
    29882998    Int finalIdxToTempIdxMap[16];
    29892999    for( Int k = 0; k < 16; k++ )
     
    29993009        // get position in temp. list
    30003010        Int refPicLayerId = pcSlice->getRefPicLayerId(k);
    3001         Int idxInTempList = 0; 
     3011        Int idxInTempList = 0;
    30023012        for (; idxInTempList < numPicsInTempList; idxInTempList++)
    30033013        {
    30043014          if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
    30053015          {
    3006             break; 
     3016            break;
    30073017          }
    30083018        }
    30093019
    30103020        Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
    3011        
    3012         // Add negative from behind 
    3013         idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 
    3014        
     3021
     3022        // Add negative from behind
     3023        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
     3024
    30153025        Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
    30163026        if ( curIsModified )
    30173027        {
    3018           isModified = true; 
     3028          isModified = true;
    30193029          assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
    30203030        }
    3021         finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;             
     3031        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;
    30223032      }
    30233033    }
    30243034
    30253035    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    3026     refPicListModification->setRefPicListModificationFlagL( li, isModified ); 
     3036    refPicListModification->setRefPicListModificationFlagL( li, isModified );
    30273037
    30283038    if( isModified )
    30293039    {
    30303040      Int refIdx = 0;
    3031      
     3041
    30323042      for( Int i = 0; i < numPicsInFinalRefList; i++ )
    30333043      {
    3034         if( finalIdxToTempIdxMap[i] >= 0 ) 
     3044        if( finalIdxToTempIdxMap[i] >= 0 )
    30353045        {
    30363046          refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
     
    30423052          while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
    30433053          {
    3044             refIdx++; 
     3054            refIdx++;
    30453055          }
    30463056          refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.