Changeset 1093 in SHVCSoftware for branches/SHM-dev/source


Ignore:
Timestamp:
2 Jul 2015, 21:00:14 (9 years ago)
Author:
seregin
Message:

cleanup macros: POC_RESET_RPS, PREVTID0_POC_RESET, POC_RESET_FLAG

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

Legend:

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

    r1092 r1093  
    126126, m_bMFMEnabledFlag               ( false )
    127127#endif
    128 #if POC_RESET_FLAG
    129 , m_bPocResetFlag                 ( false )
    130 #endif
    131128, m_bDiscardableFlag              ( false )
    132129#if O0149_CROSS_LAYER_BLA_FLAG
     
    320317    pcPic = *(iterPic);
    321318  }
    322 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER
     319#if POC_RESET_IDC_DECODER
    323320  assert( pcPic->getSlice(0)->isReferenced() );
    324321#endif
     
    350347      }
    351348     
    352 #if POC_RESET_RPS
    353       if( ((!pocHasMsb) && ((poc & (pocCycle-1)) == picPoc)) || ( pocHasMsb && (poc == picPoc)) )
    354 #else
    355349      if (poc == picPoc)
    356 #endif     
    357350      {
    358351        if(pcPic->getIsLongTerm())
     
    41584151    return false;
    41594152  }       
    4160 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER
    41614153#if POC_RESET_IDC_DECODER
    41624154  TComPic* pic = xGetRefPic( rcListPic, getPOC() );
    4163 #else
    4164   TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC );
    4165 #endif
    41664155
    41674156  if( pic )
     
    41844173TComPic* TComSlice::getBaseColPic(  TComList<TComPic*>& rcListPic )
    41854174{
    4186 #if POC_RESET_FLAG
    4187   return xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC );
    4188 #else
    41894175  return xGetRefPic( rcListPic, m_iPOC );
    4190 #endif
    41914176}
    41924177#endif
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1092 r1093  
    23312331  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    23322332  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_IDX_PLUS1];
    2333 #if POC_RESET_FLAG
    2334   Bool        m_bPocResetFlag;
    2335   Int         m_pocValueBeforeReset;
    2336 #endif 
    23372333  Bool        m_bDiscardableFlag;
    23382334#if O0149_CROSS_LAYER_BLA_FLAG
     
    24782474
    24792475#if SVC_EXTENSION
    2480 #if PREVTID0_POC_RESET
    2481   Void      adjustPrevTid0POC      (Int adj)             { m_prevTid0POC=m_prevTid0POC-adj; }
    2482 #endif
    24832476#if POC_RESET_IDC_DECODER
    24842477  Void      setPrevTid0POC( Int x ) { m_prevTid0POC = x; }
     
    26762669                                  || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); }
    26772670#endif
    2678 #if POC_RESET_FLAG
    2679   Bool      getPocResetFlag  ()                              { return m_bPocResetFlag;       }
    2680   Void      setPocResetFlag  (Bool b)                        { m_bPocResetFlag = b;          }
    2681   Int       getPocValueBeforeReset ()                        { return m_pocValueBeforeReset; }
    2682   Void      setPocValueBeforeReset (Int x)                   { m_pocValueBeforeReset = x ;   }
    2683 #endif
    26842671  Bool      getDiscardableFlag  ()                           { return m_bDiscardableFlag;    }
    26852672  Void      setDiscardableFlag  (Bool b)                     { m_bDiscardableFlag = b;       }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1090 r1093  
    134134#endif
    135135#define O0194_WEIGHTED_PREDICTION_CGS    1      ///< JCTVC-O0194: Weighted prediction for colour gamut scalability
    136 #define POC_RESET_FLAG                   0      ///< JCTVC-N0244: POC reset flag for  layer pictures.
    137 #define POC_RESET_IDC                    1      ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG
     136#define POC_RESET_IDC                    1      ///< JCTVC-P0041: Include poc_reset_idc and related derivation
    138137#if POC_RESET_IDC
    139138#define POC_RESET_IDC_SIGNALLING         1      ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements
     
    158157#define SCALINGLIST_INFERRING            1      ///< JCTVC-N0371: inter-layer scaling list
    159158#define O0142_CONDITIONAL_SPS_EXTENSION  1      ///< JCTVC-O0142: Conditional SPS extension
    160 #if POC_RESET_FLAG
    161 #define PREVTID0_POC_RESET               1      ///< JCTVC-O0117 Modification of the PicOrderCntVal of prevTid0Pic
    162 #define POC_RESET_RPS                    1      ///< JCTVC-O0117 Modification to the decoding process for rps
    163 #endif
    164159
    165160#define P0297_VPS_POC_LSB_ALIGNED_FLAG   1      ///< JCTVC-P0297: vps_poc_lsb_aligned_flag for cross-layer POC anchor picture derivation
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1092 r1093  
    12421242  {
    12431243#if SVC_EXTENSION
    1244 #if POC_RESET_FLAG
    1245     Int iBits = 0;
    1246     if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    1247     {
    1248       READ_FLAG(uiCode, "poc_reset_flag");      pcSlice->setPocResetFlag( uiCode ? true : false );
    1249       iBits++;
    1250     }
    1251     if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    1252     {
    1253 #if DISCARDABLE_PIC_RPS
    1254       READ_FLAG(uiCode, "discardable_flag"); pcSlice->setDiscardableFlag( uiCode ? true : false );
    1255 #else
    1256       READ_FLAG(uiCode, "discardable_flag"); // ignored
    1257 #endif
    1258       iBits++;
    1259     }
    1260 #if O0149_CROSS_LAYER_BLA_FLAG
    1261     if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    1262     {
    1263       READ_FLAG(uiCode, "cross_layer_bla_flag");  pcSlice->setCrossLayerBLAFlag( uiCode ? true : false );
    1264       iBits++;
    1265     }
    1266 #endif
    1267     for (; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)
    1268     {
    1269       READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    1270     }
    1271 #else
    12721244#if CROSS_LAYER_BLA_FLAG_FIX
    12731245    Int iBits = 0;
     
    13061278      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    13071279    }
    1308 #endif
    13091280#else //SVC_EXTENSION
    13101281    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1092 r1093  
    736736
    737737#if SVC_EXTENSION
    738 #if POC_RESET_FLAG
    739 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )
    740 #else
    741738Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )
    742 #endif
    743739#else
    744740Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
     
    13391335  m_bFirstSliceInSequence = false;
    13401336  m_bFirstSliceInBitstream  = false;
    1341 #if POC_RESET_FLAG
    1342   // This operation would do the following:
    1343   // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
    1344   // 2. Update the value of m_pocCRA.
    1345   // 3. Reset the POC values at the decoder for the current picture to be zero.
    1346   // 4. update value of POCLastDisplay
    1347   if( m_apcSlicePilot->getPocResetFlag() )
    1348   {
    1349     if( m_apcSlicePilot->getSliceIdx() == 0 )
    1350     {
    1351       Int pocAdjustValue = m_apcSlicePilot->getPOC();
    1352 
    1353 #if PREVTID0_POC_RESET
    1354       m_apcSlicePilot->adjustPrevTid0POC(pocAdjustValue);
    1355 #endif
    1356       // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre
    1357       TComList<TComPic*>::iterator  iterPic = m_cListPic.begin(); 
    1358 
    1359       // Iterate through all picture in DPB
    1360       while( iterPic != m_cListPic.end() )
    1361       {
    1362         TComPic *dpbPic = *iterPic;
    1363         // Check if the picture pointed to by iterPic is either used for reference or
    1364         // needed for output, are in the same layer, and not the current picture.
    1365         if( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
    1366             &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() )
    1367               && ( dpbPic->getReconMark() )
    1368           )
    1369         {
    1370           for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
    1371           {
    1372 
    1373             TComSlice *slice = dpbPic->getSlice(i);
    1374             TComReferencePictureSet *rps = slice->getRPS();
    1375             slice->setPOC( slice->getPOC() - pocAdjustValue );
    1376 
    1377             // Also adjust the POC value stored in the RPS of each such slice
    1378             for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
    1379             {
    1380               rps->setPOC( j, rps->getPOC(j) - pocAdjustValue );
    1381             }
    1382             // Also adjust the value of refPOC
    1383             for(Int k = 0; k < 2; k++)  // For List 0 and List 1
    1384             {
    1385               RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    1386               for(Int j = 0; j < slice->getNumRefIdx(list); j++)
    1387               {
    1388                 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j);
    1389               }
    1390             }
    1391           }
    1392         }
    1393         iterPic++;
    1394       }
    1395       // Update the value of pocCRA
    1396       m_pocCRA -= pocAdjustValue;
    1397       // Update value of POCLastDisplay
    1398       iPOCLastDisplay -= pocAdjustValue;
    1399     }
    1400     // Reset current poc for current slice and RPS
    1401     m_apcSlicePilot->setPOC( 0 );
    1402   }
    1403 #endif
     1337
    14041338  // Alignment of TSA and STSA pictures across AU
    14051339#if !Q0108_TSA_STSA
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r1089 r1093  
    312312  Void      xActivateParameterSets();
    313313#if SVC_EXTENSION
    314 #if POC_RESET_FLAG
    315   Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
    316 #else
    317314  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
    318 #endif
    319315  Void      xSetSpatialEnhLayerFlag(TComSlice* slice, TComPic* pic);
    320316#else
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1090 r1093  
    975975  {
    976976#if SVC_EXTENSION
    977 #if POC_RESET_FLAG
    978     Int iBits = 0;
    979     if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )
    980     {
    981       WRITE_FLAG( pcSlice->getPocResetFlag(), "poc_reset_flag" );
    982       iBits++;
    983     }
    984     if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )
    985     {
    986       assert(!!"discardable_flag");
    987       WRITE_FLAG(pcSlice->getDiscardableFlag(), "discardable_flag");
    988       iBits++;
    989     }
    990 #if O0149_CROSS_LAYER_BLA_FLAG
    991     if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )
    992     {
    993       assert(!!"cross_layer_bla_flag");
    994       WRITE_FLAG(pcSlice->getCrossLayerBLAFlag(), "cross_layer_bla_flag");
    995       iBits++;
    996     }
    997 #endif
    998     for ( ; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)
    999     {
    1000       assert(!!"slice_reserved_undetermined_flag[]");
    1001       WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    1002     }
    1003 #else
    1004977#if CROSS_LAYER_BLA_FLAG_FIX
    1005978    Int iBits = 0;
     
    10401013      WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    10411014    }
    1042 #endif
    10431015#else //SVC_EXTENSION
    10441016    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     
    10661038#endif
    10671039    {
    1068 #if POC_RESET_FLAG
    1069       Int picOrderCntLSB;
    1070       if( !pcSlice->getPocResetFlag() )
    1071       {
    1072         picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    1073       }
    1074       else
    1075       {
    1076         picOrderCntLSB = (pcSlice->getPocValueBeforeReset()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    1077       }
    1078 #else
    10791040#if POC_RESET_IDC_ENCODER
    10801041      Int picOrderCntLSB;
     
    10891050#else
    10901051      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);
    1091 #endif
    10921052#endif
    10931053      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1090 r1093  
    11441144
    11451145#if SVC_EXTENSION
    1146 #if POC_RESET_FLAG
    1147     if( !pcSlice->getPocResetFlag() ) // For picture that are not reset, we should adjust the value of POC calculated from the configuration files.
    1148     {
    1149       // Subtract POC adjustment value until now.
    1150       pcSlice->setPOC( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() );
    1151     }
    1152     else
    1153     {
    1154       // Check if this is the first slice in the picture
    1155       // In the encoder, the POC values are copied along with copySliceInfo, so we only need
    1156       // to do this for the first slice.
    1157       Int pocAdjustValue = pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue();
    1158       if( pcSlice->getSliceIdx() == 0 )
    1159       {
    1160         TComList<TComPic*>::iterator  iterPic = rcListPic.begin(); 
    1161 
    1162         // Iterate through all picture in DPB
    1163         while( iterPic != rcListPic.end() )
    1164         {             
    1165           TComPic *dpbPic = *iterPic;
    1166           if( dpbPic->getPOC() == pocCurr )
    1167           {
    1168             if( dpbPic->getReconMark() )
    1169             {
    1170               assert( !( dpbPic->getSlice(0)->isReferenced() ) && !( dpbPic->getOutputMark() ) );
    1171             }
    1172           }
    1173           // Check if the picture pointed to by iterPic is either used for reference or
    1174           // needed for output, are in the same layer, and not the current picture.
    1175           if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
    1176               && */ ( dpbPic->getLayerId() == pcSlice->getLayerId() )
    1177               && ( dpbPic->getReconMark() )
    1178             )
    1179           {
    1180             for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
    1181             {
    1182               TComSlice *slice = dpbPic->getSlice(i);
    1183               TComReferencePictureSet *rps = slice->getRPS();
    1184               slice->setPOC( dpbPic->getSlice(i)->getPOC() - pocAdjustValue );
    1185 
    1186               // Also adjust the POC value stored in the RPS of each such slice
    1187               for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
    1188               {
    1189                 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue );
    1190               }
    1191               // Also adjust the value of refPOC
    1192               for(Int k = 0; k < 2; k++)  // For List 0 and List 1
    1193               {
    1194                 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    1195                 for(Int j = 0; j < slice->getNumRefIdx(list); j++)
    1196                 {
    1197                   slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j);
    1198                 }
    1199               }
    1200             }
    1201           }
    1202           iterPic++;
    1203         }
    1204         m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue );
    1205       }
    1206       pcSlice->setPocValueBeforeReset( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue );
    1207       pcSlice->setPOC( 0 );
    1208     }
    1209 #endif
    12101146#if POC_RESET_IDC_ENCODER
    12111147    pcSlice->setPocValueBeforeReset( pocCurr );
     
    18931829    if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
    18941830    {
    1895 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     1831#if POC_RESET_IDC_ENCODER
    18961832      if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL())
    18971833#else
     
    23022238
    23032239      Int sliceQP = m_pcCfg->getInitialQP();
    2304 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     2240#if POC_RESET_IDC_ENCODER
    23052241      if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified
    23062242#else
     
    27202656      }
    27212657      pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<Double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the .
    2722 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     2658#if POC_RESET_IDC_ENCODER
    27232659      pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded;
    27242660#else
     
    28682804      SEIRecoveryPoint sei_recovery_point;
    28692805      sei_recovery_point.m_recoveryPocCnt    = 0;
    2870 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     2806#if POC_RESET_IDC_ENCODER
    28712807      sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false);
    28722808#else
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1090 r1093  
    8585#endif
    8686  m_numRefLayerLocationOffsets = 0;
    87 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     87#if POC_RESET_IDC_ENCODER
    8888  m_pocAdjustmentValue     = 0;
    8989#endif
     
    10651065  m_cPPS.setPPSId( m_iPPSIdCnt );
    10661066  m_cPPS.setSPSId( m_iSPSIdCnt );
    1067 #if POC_RESET_FLAG
    1068   m_cPPS.setNumExtraSliceHeaderBits( 2 );
    1069 #endif
    10701067#if O0149_CROSS_LAYER_BLA_FLAG
    10711068  if (m_crossLayerBLAFlag)
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1090 r1093  
    137137  Int                     m_phaseVerChroma[MAX_LAYERS];
    138138  Int                     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
    139 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     139#if POC_RESET_IDC_ENCODER
    140140  Int                     m_pocAdjustmentValue;
    141141#endif
     
    262262  TEncTop*  getRefLayerEnc(UInt refLayerIdx);
    263263#endif
    264 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
     264#if POC_RESET_IDC_ENCODER
    265265  Int       getPocAdjustmentValue()      { return m_pocAdjustmentValue;}
    266266  Void      setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x;   }
Note: See TracChangeset for help on using the changeset viewer.