Changeset 588 in SHVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp


Ignore:
Timestamp:
1 Feb 2014, 23:50:54 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.0-dev

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r547 r588  
    167167}
    168168
    169 #if M0043_LAYERS_PRESENT_SEI
    170 SEILayersPresent* TEncGOP::xCreateSEILayersPresent ()
     169#if LAYERS_NOT_PRESENT_SEI
     170SEILayersNotPresent* TEncGOP::xCreateSEILayersNotPresent ()
    171171{
    172172  UInt i = 0;
    173   SEILayersPresent *seiLayersPresent = new SEILayersPresent();
    174   seiLayersPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId();
    175   seiLayersPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
    176   for ( ; i < seiLayersPresent->m_vpsMaxLayers; i++)
    177   {
    178     seiLayersPresent->m_layerPresentFlag[i] = true;
     173  SEILayersNotPresent *seiLayersNotPresent = new SEILayersNotPresent();
     174  seiLayersNotPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId();
     175  seiLayersNotPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
     176  for ( ; i < seiLayersNotPresent->m_vpsMaxLayers; i++)
     177  {
     178    seiLayersNotPresent->m_layerNotPresentFlag[i] = true;
    179179  }
    180180  for ( ; i < MAX_LAYERS; i++)
    181181  {
    182     seiLayersPresent->m_layerPresentFlag[i] = false;
    183   }
    184   return seiLayersPresent;
     182    seiLayersNotPresent->m_layerNotPresentFlag[i] = false;
     183  }
     184  return seiLayersNotPresent;
    185185}
    186186#endif
     
    363363  }
    364364
    365 #if M0043_LAYERS_PRESENT_SEI
    366   if(m_pcCfg->getLayersPresentSEIEnabled())
    367   {
    368     SEILayersPresent *sei = xCreateSEILayersPresent ();
     365#if LAYERS_NOT_PRESENT_SEI
     366  if(m_pcCfg->getLayersNotPresentSEIEnabled())
     367  {
     368    SEILayersNotPresent *sei = xCreateSEILayersNotPresent ();
    369369    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    370370    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     
    690690      pcSlice->setActiveNumILRRefIdx(0);
    691691      pcSlice->setInterLayerPredEnabledFlag(false);
    692 #if M0457_COL_PICTURE_SIGNALING
    693692      pcSlice->setMFMEnabledFlag(false);
    694 #if !REMOVE_COL_PICTURE_SIGNALING
    695       pcSlice->setAltColIndicationFlag(false);
    696 #endif
    697 #endif
    698     }
    699 #endif
    700 
    701 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    702     pcSlice->setNumSamplePredRefLayers( m_pcEncTop->getNumSamplePredRefLayers() );
    703     pcSlice->setInterLayerSamplePredOnlyFlag( 0 );
    704     if( pcSlice->getNumSamplePredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 )
    705     {
    706       if( m_pcEncTop->getIlSampleOnlyPred() > 0 )
    707       {
    708         pcSlice->setInterLayerSamplePredOnlyFlag( true );
    709       }
    710693    }
    711694#endif
     
    11591142    if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
    11601143    {
    1161 #if RESTR_CHK
    11621144#if POC_RESET_FLAG
    11631145      if ( pocCurr > 0          && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL())
     
    11661148#endif
    11671149      {
    1168 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    11691150        pcSlice->setActiveNumILRRefIdx(0);
    11701151        pcSlice->setInterLayerPredEnabledFlag(0);
    1171 #else
    1172         pcSlice->setNumILRRefIdx(0);
    1173 #endif
    1174       }
    1175 #endif
    1176 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1152      }
    11771153      if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
    11781154      {
     
    11851161        pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getActiveNumILRRefIdx());
    11861162      }
    1187 #else
    1188       if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
    1189       {
    1190         pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumILRRefIdx());
    1191         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumILRRefIdx());
    1192       }
    1193       else
    1194       {
    1195         pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+pcSlice->getNumILRRefIdx());
    1196         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getNumILRRefIdx());
    1197       }
    1198 #endif
    11991163    }
    12001164#endif //SVC_EXTENSION
     
    12051169
    12061170#if SVC_EXTENSION
    1207 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1208     if ( pcSlice->getSliceType() == B_SLICE && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
    1209 #else
    12101171    if( pcSlice->getSliceType() == B_SLICE )
    1211 #endif
    12121172    {
    12131173      pcSlice->setColFromL0Flag(1-uiColDir);
     
    12241184      pcSlice->setILRPic( m_pcEncTop->getIlpList() );
    12251185#if REF_IDX_MFM
    1226 #if M0457_COL_PICTURE_SIGNALING
    12271186      if( pcSlice->getMFMEnabledFlag() )
    1228 #else
    1229       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1230 #endif
    12311187      {
    12321188        pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
    1233 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1234         pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
    1235 #endif
    12361189      }
    12371190#else
     
    12431196
    12441197#if REF_IDX_MFM
    1245 #if M0457_COL_PICTURE_SIGNALING
    1246 #if REMOVE_COL_PICTURE_SIGNALING
    12471198      if( pcSlice->getMFMEnabledFlag() )
    1248 #else
    1249       if( pcSlice->getMFMEnabledFlag() && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
    1250 #endif
    1251 #else
    1252       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1253 #endif
    12541199      {
    12551200        Bool found         = false;
     
    13081253    }
    13091254
    1310 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    1311     if (pcSlice->getSliceType() == B_SLICE && m_pcEncTop->getIlSampleOnlyPred() == 0)
    1312 #else
    13131255    if (pcSlice->getSliceType() == B_SLICE)
    1314 #endif
    13151256    {
    13161257#if !SVC_EXTENSION
     
    16171558#if O0194_WEIGHTED_PREDICTION_CGS
    16181559      // Calculate for the base layer to be used in EL as Inter layer reference
    1619       m_pcSliceEncoder->estimateILWpParam( pcSlice );
     1560      if( m_pcEncTop->getInterLayerWeightedPredFlag() )
     1561      {
     1562        m_pcSliceEncoder->estimateILWpParam( pcSlice );
     1563      }
    16201564#endif
    16211565#if AVC_SYNTAX
     
    17561700      // The following code also calculates the VPS VUI offset
    17571701#endif
     1702#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    17581703#if VPS_EXTN_OFFSET_CALC
    17591704      OutputNALUnit tempNalu(NAL_UNIT_VPS, 0, 0        ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
    17601705      m_pcEntropyCoder->setBitstream(&tempNalu.m_Bitstream);
    17611706      m_pcEntropyCoder->encodeVPS(m_pcEncTop->getVPS());  // Use to calculate the VPS extension offset
     1707#endif
    17621708#endif
    17631709      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     
    20682014            startCUAddrSliceSegmentIdx++;
    20692015          }
    2070 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING
     2016#if SVC_EXTENSION
    20712017          pcSlice->setNumMotionPredRefLayers(m_pcEncTop->getNumMotionPredRefLayers());
    20722018#endif
     
    31113057
    31123058#if SVC_EXTENSION
    3113 #if ADAPTIVE_QP_SELECTION
    3114   printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",
     3059#if ADAPTIVE_QP_SELECTION 
     3060  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, nQP %d QP %d ) %10d bits",
    31153061         pcSlice->getPOC(),
    31163062         pcSlice->getLayerId(),
    31173063         pcSlice->getTLayer(),
    31183064         c,
     3065         NaluToStr( pcSlice->getNalUnitType() ).data(),
    31193066         pcSlice->getSliceQpBase(),
    31203067         pcSlice->getSliceQp(),
    31213068         uibits );
    31223069#else
    3123   printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, QP %d ) %10d bits",
     3070  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP %d ) %10d bits",
    31243071         pcSlice->getPOC()-pcSlice->getLastIDR(),
    31253072         pcSlice->getLayerId(),
    31263073         pcSlice->getTLayer(),
    31273074         c,
     3075         NaluToStr( pcSlice->getNalUnitType() ).data().
    31283076         pcSlice->getSliceQp(),
    31293077         uibits );
     
    37503698  free(rowSAD);
    37513699}
    3752 
    3753 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    3754 TComPic* TEncGOP::getMotionPredIlp(TComSlice* pcSlice)
    3755 {
    3756   TComPic* ilpPic = NULL;
    3757   Int activeMotionPredReflayerIdx = 0;
    3758 
    3759   for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    3760   {
    3761     UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    3762     if( m_pcEncTop->getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
    3763     {
    3764       if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
    3765       {
    3766         ilpPic = m_pcEncTop->getIlpList()[refLayerIdc];
    3767         break;
    3768       }
    3769       else
    3770       {
    3771         activeMotionPredReflayerIdx++;
    3772       }
    3773     }
    3774   }
    3775 
    3776   assert(ilpPic != NULL);
    3777 
    3778   return ilpPic;
    3779 }
    3780 #endif
    3781 
    37823700//! \}
Note: See TracChangeset for help on using the changeset viewer.