Changeset 952 in SHVCSoftware


Ignore:
Timestamp:
5 Jan 2015, 09:03:13 (10 years ago)
Author:
qualcomm
Message:

Fix for aligned bumping, ticket #38.

Fix for the ticket number #38, related to layerId and layerIdx in the code under the macro ALIGNED_BUMPING.

From: Adarsh K. Ramasubramonian <aramasub@…>

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

Legend:

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

    r932 r952  
    106106  ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)")
    107107#if SVC_EXTENSION
     108#if FIX_CONF_MODE
     109  ("LayerNum,-ls", nLayerNum, MAX_NUM_LAYER_IDS, "Number of layers to be decoded.")
     110#else
    108111  ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.")
     112#endif
    109113#if OUTPUT_LAYER_SET_INDEX
    110114  ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.")
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r932 r952  
    191191      read(nalu, nalUnit);
    192192      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  ||
     193#if FIX_CONF_MODE
     194        (nalu.m_layerId > this->getCommonDecoderParams()->getTargetLayerId()) )
     195#else
    193196        (nalu.m_layerId > m_tgtLayerId) )
     197#endif
    194198      {
    195199        bNewPicture = false;
     
    11271131    dpbStatus.m_numPicsInLayer[layerIdx]--;
    11281132#endif
     1133#if FIX_ALIGN_BUMPING
     1134    dpbStatus.m_numPicsInSubDpb[dpbStatus.m_layerIdToSubDpbIdMap[layerIdx]]--;
     1135#else
    11291136    dpbStatus.m_numPicsInSubDpb[layerIdx]--;
     1137#endif
    11301138  }
    11311139}
     
    11391147  {
    11401148    std::vector<Int>  listOfPocs;
     1149#if FIX_ALIGN_BUMPING
     1150    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1151    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1152#else
    11411153    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    11421154    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1155#endif
    11431156    DpbStatus dpbStatus;
    11441157
     
    11661179  {
    11671180    std::vector<Int>  listOfPocs;
     1181#if FIX_ALIGN_BUMPING
     1182    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1183    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1184#else
    11681185    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    11691186    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1187#endif
    11701188    DpbStatus dpbStatus;
    11711189
     
    11891207Void TAppDecTop::markAllPicturesAsErased()
    11901208{
     1209#if FIX_ALIGN_BUMPING
     1210  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1211#else
    11911212  for(Int i = 0; i < MAX_LAYERS; i++)
     1213#endif
    11921214  {
    11931215    markAllPicturesAsErased(i);
     
    12281250   
    12291251  std::vector<Int>  listOfPocs;
     1252#if FIX_ALIGN_BUMPING
     1253  std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1254  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1255#else
    12301256  std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    12311257  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1258#endif
    12321259  DpbStatus dpbStatus;
    12331260
     
    12611288  }
    12621289#else
     1290#if FIX_ALIGN_BUMPING
     1291  Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0
     1292                  ? dpbStatus.m_layerIdToSubDpbIdMap[0]
     1293                  : dpbStatus.m_layerIdToSubDpbIdMap[layerIdx];
     1294#else
    12631295  Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ? 0 : layerIdx;
     1296#endif
    12641297  findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit);
    12651298#endif
     
    12741307{   
    12751308  std::vector<Int>  listOfPocs;
     1309#if FIX_ALIGN_BUMPING
     1310  std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1311  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1312#else
    12761313  std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    12771314  std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1315#endif
    12781316  DpbStatus dpbStatus;
    12791317
     
    13071345  std::vector<int>::iterator it;
    13081346  TComList<TComPic*>::iterator iterPic;
     1347#if FIX_ALIGN_BUMPING
     1348  for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
     1349  {
     1350    Int layerIdx  = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
     1351#else
    13091352  for( Int layerIdx = 0; layerIdx < dpbStatus.m_numLayers; layerIdx++)
    13101353  {
     1354#endif
    13111355    // Check if picture with pocValue is present.
    13121356    it = find( listOfPocsInEachLayer[layerIdx].begin(), listOfPocsInEachLayer[layerIdx].end(), pocValue );
     
    13901434      listOfPocsInEachLayer[layerIdx].erase( it );
    13911435      listOfPocsPositionInEachLayer[layerIdx].erase( listOfPocsPositionInEachLayer[layerIdx].begin() + picPosition );
    1392     }
    1393   }
    1394   // Update sub-DPB status
     1436#if FIX_ALIGN_BUMPING
     1437      dpbStatus.m_numPicsInSubDpb[dpbStatus.m_layerIdToSubDpbIdMap[layerIdx]]--;
     1438#endif
     1439    }
     1440  }
     1441#if !FIX_ALIGN_BUMPING
     1442#  // Update sub-DPB status
    13951443  for( Int subDpbIdx = 0; subDpbIdx < dpbStatus.m_numSubDpbs; subDpbIdx++)
    13961444  {
    13971445    dpbStatus.m_numPicsInSubDpb[subDpbIdx]--;
    13981446  }
     1447#endif
    13991448  dpbStatus.m_numAUsNotDisplayed--;   
    14001449
     
    14391488    // Find the VPS used for the pictures
    14401489    // -------------------------------------
     1490#if FIX_ALIGN_BUMPING
     1491    for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1492#else
    14411493    for(Int i = 0; i < MAX_LAYERS; i++)
     1494#endif
    14421495    {
    14431496      if( m_acTDecTop[i].getListPic()->empty() )
     
    14871540Void TAppDecTop::emptyUnusedPicturesNotNeededForOutput()
    14881541{
     1542#if FIX_ALIGN_BUMPING
     1543  for(Int layerIdx = 0; layerIdx < MAX_VPS_LAYER_ID_PLUS1; layerIdx++)
     1544#else
    14891545  for(Int layerIdx = 0; layerIdx < MAX_LAYERS; layerIdx++)
     1546#endif
    14901547  {
    14911548    TComList <TComPic*> *pcListPic = m_acTDecTop[layerIdx].getListPic();
     
    15421599  TComVPS *vps = NULL;
    15431600  dpbStatus.init();
     1601#if FIX_ALIGN_BUMPING
     1602  for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++ )
     1603#else
    15441604  for( Int i = 0; i < MAX_LAYERS; i++ )
     1605#endif
    15451606  {
    15461607    if( m_acTDecTop[i].getListPic()->empty() )
     
    16001661  dpbStatus.m_numAUsNotDisplayed = listOfPocs.size();   // Number of AUs not displayed
    16011662  dpbStatus.m_numLayers = vps->getNumLayersInIdList( targetLsIdx );
     1663#if FIX_ALIGN_BUMPING
     1664  for(Int i = 0; i < dpbStatus.m_numLayers; i++)
     1665  {
     1666    dpbStatus.m_layerIdToSubDpbIdMap[vps->getLayerSetLayerIdList(targetLsIdx, i)] = i;
     1667    dpbStatus.m_targetDecLayerIdList[i] = vps->getLayerSetLayerIdList(targetLsIdx, i);  // Layer Id stored in a particular sub-DPB
     1668  }
     1669  dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( targetLsIdx );
     1670#else
    16021671  dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( vps->getOutputLayerSetIdx(
    16031672                                                      this->getCommonDecoderParams()->getTargetOutputLayerSetIdx() ) );
    1604 
     1673#endif
     1674
     1675#if FIX_ALIGN_BUMPING
     1676  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     1677#else
    16051678  for(Int i = 0; i < dpbStatus.m_numLayers; i++)
     1679#endif
    16061680  {
    16071681    dpbStatus.m_numPicsNotDisplayedInLayer[i] = listOfPocsInEachLayer[i].size();
     
    16191693  { // All pictures in the DPB in that layer are to be output; this means other pictures would also be output
    16201694    std::vector<Int>  listOfPocs;
     1695#if FIX_ALIGN_BUMPING
     1696    std::vector<Int>  listOfPocsInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1697    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_VPS_LAYER_ID_PLUS1];
     1698#else
    16211699    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
    16221700    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1701#endif
    16231702    DpbStatus dpbStatus;
    16241703
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h

    r924 r952  
    141141#endif
    142142  Int m_numPicsInSubDpb[MAX_LAYERS];  // Pictures marked as used_for_reference or needed for output in the sub-DPB
     143#if FIX_ALIGN_BUMPING
     144  Int m_layerIdToSubDpbIdMap[MAX_VPS_LAYER_ID_PLUS1];
     145  Int m_targetDecLayerIdList[MAX_LAYERS];
     146#endif
    143147  Bool m_maxLatencyIncrease;
    144148  Int m_maxLatencyPictures;
     
    163167    m_numSubDpbs = -1;
    164168    m_numLayers = -1;
     169#if FIX_ALIGN_BUMPING
     170    ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) );
     171    for(Int i = 0; i < MAX_LAYERS; i++)
     172    {
     173      m_layerIdToSubDpbIdMap[i] = -1;
     174    }
     175#endif
    165176  }
    166177};
  • branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h

    r905 r952  
    291291public:
    292292  CommonDecoderParams():
     293#if FIX_CONF_MODE
     294    m_targetLayerId(MAX_VPS_LAYER_ID_PLUS1)
     295#else
    293296    m_targetLayerId(0)
     297#endif
    294298    , m_targetOutputLayerSetIdx(-1)
    295299    , m_targetDecLayerIdSet(NULL)
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r951 r952  
    4545#define O0215_PHASE_ALIGNMENT_REMOVAL    1
    4646#define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
     47#define FIX_CONF_MODE                    1
    4748#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
    4849#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-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r944 r952  
    30113011
    30123012  }
     3013#if FIX_CONF_MODE
     3014  // Set correct value of targetLayerId
     3015  Int targetOlsIdx = params->getTargetOutputLayerSetIdx();
     3016  Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx );
     3017  params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) );
     3018#endif
    30133019}
    30143020#endif
Note: See TracChangeset for help on using the changeset viewer.