Changeset 961 in SHVCSoftware


Ignore:
Timestamp:
6 Jan 2015, 04:21:12 (10 years ago)
Author:
seregin
Message:

port the fix for ticket #38

Location:
branches/SHM-upgrade/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecCfg.cpp

    r933 r961  
    102102#endif
    103103#endif
     104#if FIX_CONF_MODE
     105  ("LayerNum,-ls", nLayerNum, MAX_NUM_LAYER_IDS, "Number of layers to be decoded.")
     106#else
    104107  ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.")
     108#endif
    105109#if OUTPUT_LAYER_SET_INDEX
    106110  ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.")
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp

    r933 r961  
    214214      read(nalu, nalUnit);
    215215      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  ||
     216#if FIX_CONF_MODE
     217        (nalu.m_layerId > this->getCommonDecoderParams()->getTargetLayerId()) )
     218#else
    216219        (nalu.m_layerId > m_tgtLayerId) )
     220#endif
    217221      {
    218222        bNewPicture = false;
     
    12231227    dpbStatus.m_numPicsInLayer[layerIdx]--;
    12241228#endif
     1229#if FIX_ALIGN_BUMPING
     1230    dpbStatus.m_numPicsInSubDpb[dpbStatus.m_layerIdToSubDpbIdMap[layerIdx]]--;
     1231#else
    12251232    dpbStatus.m_numPicsInSubDpb[layerIdx]--;
     1233#endif
    12261234  }
    12271235}
     
    12351243  {
    12361244    std::vector<Int>  listOfPocs;
     1245#if FIX_ALIGN_BUMPING
     1246    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1247    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1248#else
    12371249    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    12381250    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1251#endif
    12391252    DpbStatus dpbStatus;
    12401253
     
    12621275  {
    12631276    std::vector<Int>  listOfPocs;
     1277#if FIX_ALIGN_BUMPING
     1278    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1279    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1280#else
    12641281    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    12651282    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1283#endif
    12661284    DpbStatus dpbStatus;
    12671285
     
    12851303Void TAppDecTop::markAllPicturesAsErased()
    12861304{
     1305#if FIX_ALIGN_BUMPING
     1306  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1307#else
    12871308  for(Int i = 0; i < MAX_LAYERS; i++)
     1309#endif
    12881310  {
    12891311    markAllPicturesAsErased(i);
     
    13241346   
    13251347  std::vector<Int>  listOfPocs;
     1348#if FIX_ALIGN_BUMPING
     1349  std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1350  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1351#else
    13261352  std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    13271353  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1354#endif
    13281355  DpbStatus dpbStatus;
    13291356
     
    13571384  }
    13581385#else
     1386#if FIX_ALIGN_BUMPING
     1387  Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0
     1388                  ? dpbStatus.m_layerIdToSubDpbIdMap[0]
     1389                  : dpbStatus.m_layerIdToSubDpbIdMap[layerIdx];
     1390#else
    13591391  Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ? 0 : layerIdx;
     1392#endif
    13601393  findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit);
    13611394#endif
     
    13701403{   
    13711404  std::vector<Int>  listOfPocs;
     1405#if FIX_ALIGN_BUMPING
     1406  std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1407  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1408#else
    13721409  std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    13731410  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1411#endif
    13741412  DpbStatus dpbStatus;
    13751413
     
    14031441  std::vector<int>::iterator it;
    14041442  TComList<TComPic*>::iterator iterPic;
     1443#if FIX_ALIGN_BUMPING
     1444  for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
     1445  {
     1446    Int layerIdx  = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
     1447#else
    14051448  for( Int layerIdx = 0; layerIdx < dpbStatus.m_numLayers; layerIdx++)
    14061449  {
     1450#endif
    14071451    // Check if picture with pocValue is present.
    14081452    it = find( listOfPocsInEachLayer[layerIdx].begin(), listOfPocsInEachLayer[layerIdx].end(), pocValue );
     
    14871531      listOfPocsInEachLayer[layerIdx].erase( it );
    14881532      listOfPocsPositionInEachLayer[layerIdx].erase( listOfPocsPositionInEachLayer[layerIdx].begin() + picPosition );
    1489     }
    1490   }
     1533#if FIX_ALIGN_BUMPING
     1534      dpbStatus.m_numPicsInSubDpb[dpbStatus.m_layerIdToSubDpbIdMap[layerIdx]]--;
     1535#endif
     1536    }
     1537  }
     1538#if !FIX_ALIGN_BUMPING
    14911539  // Update sub-DPB status
    14921540  for( Int subDpbIdx = 0; subDpbIdx < dpbStatus.m_numSubDpbs; subDpbIdx++)
     
    14941542    dpbStatus.m_numPicsInSubDpb[subDpbIdx]--;
    14951543  }
     1544#endif
    14961545  dpbStatus.m_numAUsNotDisplayed--;   
    14971546
     
    15361585    // Find the VPS used for the pictures
    15371586    // -------------------------------------
     1587#if FIX_ALIGN_BUMPING
     1588    for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1589#else
    15381590    for(Int i = 0; i < MAX_LAYERS; i++)
     1591#endif
    15391592    {
    15401593      if( m_acTDecTop[i].getListPic()->empty() )
     
    15841637Void TAppDecTop::emptyUnusedPicturesNotNeededForOutput()
    15851638{
     1639#if FIX_ALIGN_BUMPING
     1640  for(Int layerIdx = 0; layerIdx < MAX_VPS_LAYER_ID_PLUS1; layerIdx++)
     1641#else
    15861642  for(Int layerIdx = 0; layerIdx < MAX_LAYERS; layerIdx++)
     1643#endif
    15871644  {
    15881645    TComList <TComPic*> *pcListPic = m_acTDecTop[layerIdx].getListPic();
     
    16391696  TComVPS *vps = NULL;
    16401697  dpbStatus.init();
     1698#if FIX_ALIGN_BUMPING
     1699  for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++ )
     1700#else
    16411701  for( Int i = 0; i < MAX_LAYERS; i++ )
     1702#endif
    16421703  {
    16431704    if( m_acTDecTop[i].getListPic()->empty() )
     
    16971758  dpbStatus.m_numAUsNotDisplayed = listOfPocs.size();   // Number of AUs not displayed
    16981759  dpbStatus.m_numLayers = vps->getNumLayersInIdList( targetLsIdx );
     1760#if FIX_ALIGN_BUMPING
     1761  for(Int i = 0; i < dpbStatus.m_numLayers; i++)
     1762  {
     1763    dpbStatus.m_layerIdToSubDpbIdMap[vps->getLayerSetLayerIdList(targetLsIdx, i)] = i;
     1764    dpbStatus.m_targetDecLayerIdList[i] = vps->getLayerSetLayerIdList(targetLsIdx, i);  // Layer Id stored in a particular sub-DPB
     1765  }
     1766  dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( targetLsIdx );
     1767#else
    16991768  dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( vps->getOutputLayerSetIdx(
    17001769                                                      this->getCommonDecoderParams()->getTargetOutputLayerSetIdx() ) );
    1701 
     1770#endif
     1771
     1772#if FIX_ALIGN_BUMPING
     1773  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1774#else
    17021775  for(Int i = 0; i < dpbStatus.m_numLayers; i++)
     1776#endif
    17031777  {
    17041778    dpbStatus.m_numPicsNotDisplayedInLayer[i] = listOfPocsInEachLayer[i].size();
     
    17161790  { // All pictures in the DPB in that layer are to be output; this means other pictures would also be output
    17171791    std::vector<Int>  listOfPocs;
     1792#if FIX_ALIGN_BUMPING
     1793    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1794    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1795#else
    17181796    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    17191797    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1798#endif
    17201799    DpbStatus dpbStatus;
    17211800
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.h

    r928 r961  
    143143#endif
    144144  Int m_numPicsInSubDpb[MAX_LAYERS];  // Pictures marked as used_for_reference or needed for output in the sub-DPB
     145#if FIX_ALIGN_BUMPING
     146  Int m_layerIdToSubDpbIdMap[MAX_VPS_LAYER_ID_PLUS1];
     147  Int m_targetDecLayerIdList[MAX_LAYERS];
     148#endif
    145149  Bool m_maxLatencyIncrease;
    146150  Int m_maxLatencyPictures;
     
    165169    m_numSubDpbs = -1;
    166170    m_numLayers = -1;
     171#if FIX_ALIGN_BUMPING
     172    ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) );
     173    for(Int i = 0; i < MAX_LAYERS; i++)
     174    {
     175      m_layerIdToSubDpbIdMap[i] = -1;
     176    }
     177#endif
    167178  }
    168179};
  • branches/SHM-upgrade/source/Lib/TLibCommon/CommonDef.h

    r916 r961  
    311311  Int m_targetLayerId;
    312312  Int m_targetOutputLayerSetIdx;
    313   std::vector<Int> *m_targetDecLayerIdSet; 
     313  std::vector<Int> *m_targetDecLayerIdSet;
    314314  Bool m_valueCheckedFlag;
    315315  Int m_highestTId;
    316316public:
    317   CommonDecoderParams():
     317  CommonDecoderParams():
     318#if FIX_CONF_MODE
     319    m_targetLayerId(MAX_VPS_LAYER_ID_PLUS1)
     320#else
    318321    m_targetLayerId(0)
     322#endif
    319323    , m_targetOutputLayerSetIdx(-1)
    320324    , m_targetDecLayerIdSet(NULL)
  • branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h

    r959 r961  
    4747#define O0215_PHASE_ALIGNMENT_REMOVAL    1
    4848#define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
     49#define FIX_CONF_MODE                    1
    4950#define SIGNALLING_BITRATE_PICRATE_FIX   1      ///< Fix for signalling of bitrate and picture rate info in VPS VUI to be more aligned to JCTVC-R1008
    5051#define INFERENCE_POC_MSB_VAL_PRESENT    1      ///< JCTVC-Q0146 -- poc_msb_val_present_flag shall be equal to 0 when slice_header_extension_length is (inferred to be ) equal to 0
     
    9899                                                ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS
    99100#define ALIGNED_BUMPING                  1      ///< JCTVC-P0192: Align bumping of pictures in an AU
     101#define FIX_ALIGN_BUMPING                1
    100102#define O0109_O0199_FLAGS_TO_VUI         1      ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui
    101103#define O0109_VIEW_ID_LEN                1      ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.cpp

    r947 r961  
    30013001
    30023002  }
     3003#if FIX_CONF_MODE
     3004  // Set correct value of targetLayerId
     3005  Int targetOlsIdx = params->getTargetOutputLayerSetIdx();
     3006  Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx );
     3007  params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) );
     3008#endif
    30033009}
    30043010#endif
Note: See TracChangeset for help on using the changeset viewer.