Changeset 953 in SHVCSoftware for branches/SHM-dev/source/App


Ignore:
Timestamp:
5 Jan 2015, 11:34:55 (10 years ago)
Author:
qualcomm
Message:

Fixes for conformance testing and non-output layers.

  • Value of PicOutputFlag of non-output layers was not being computed correctly. Fixed under MACRO FIX_NON_OUTPUT_LAYER
  • Some fixes for conformance testing under macro FIX_CONF_MODE.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-dev/source/App/TAppDecoder
Files:
3 edited

Legend:

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

    r952 r953  
    151151  m_tgtLayerId = nLayerNum - 1;
    152152  assert( m_tgtLayerId >= 0 );
    153   assert( m_tgtLayerId < MAX_LAYERS );
     153#if !FIX_CONF_MODE
     154  assert( m_tgtLayerId < MAX_LAYERS );  // If this is wrong, it should be caught by asserts in other locations.
     155#endif
    154156#if O0137_MAX_LAYERID
    155157  assert( m_tgtLayerId < MAX_NUM_LAYER_IDS );
     
    176178
    177179    // Decoded layer YUV files
     180#if FIX_CONF_MODE
     181    for(Int layer= 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ )
     182#else
    178183    for(UInt layer=0; layer<= m_tgtLayerId; layer++)
     184#endif
    179185    {
    180186      sprintf(fileNameSuffix, "%s-L%d.yuv", m_confPrefix.c_str(), layer);  // olsIdx is the target output layer set index.
     
    187193  this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
    188194#endif
     195#if FIX_CONF_MODE
     196  for(Int layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ )
     197  {
     198#else
    189199  for(UInt layer=0; layer<= m_tgtLayerId; layer++)
    190200  {
    191201    assert( layer < MAX_LAYERS );
     202#endif
    192203    m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str());
    193204  }
  • TabularUnified branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r952 r953  
    8282  }
    8383#if SVC_EXTENSION
     84#if FIX_CONF_MODE
     85  for(Int i = 0; i <= MAX_VPS_LAYER_ID_PLUS1-1; i++ )
     86#else
    8487  for( Int i = 0; i <= m_tgtLayerId; i++ )
     88#endif
    8589  {
    8690    if( m_pchReconFile[i] )
     
    142146  memset( loopFiltered, false, sizeof( loopFiltered ) );
    143147
     148#if FIX_CONF_MODE
     149  for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     150#else
    144151  for(UInt layer=0; layer<=m_tgtLayerId; layer++)
     152#endif
    145153  {
    146154    openedReconFile[layer] = false;
     
    353361  pcBLPic.destroy();
    354362
     363#if FIX_CONF_MODE
     364  for(UInt layer = layerIdmin; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     365#else
    355366  for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++)
     367#endif
    356368#else
    357369  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    522534  // initialize global variables
    523535  initROM();
    524 
     536#if FIX_CONF_MODE
     537  for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     538#else
    525539  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     540#endif
    526541  {
    527542    // set layer ID
     
    544559  // destroy ROM
    545560  destroyROM();
    546 
     561#if FIX_CONF_MODE
     562  for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     563#else
    547564  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     565#endif
    548566  {
    549567    if ( m_pchReconFile[layer] )
     
    570588  // initialize decoder class
    571589#if SVC_EXTENSION
     590#if FIX_CONF_MODE
     591  for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     592#else
    572593  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     594#endif
    573595  {
    574596    m_acTDecTop[layer].init();
     
    577599    m_acTDecTop[layer].setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled);
    578600#endif
     601#if FIX_CONF_MODE
     602    m_acTDecTop[layer].setNumLayer( MAX_LAYERS );
     603#else
    579604    m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 );
     605#endif
    580606#if OUTPUT_LAYER_SET_INDEX
    581607    m_acTDecTop[layer].setCommonDecoderParams( this->getCommonDecoderParams() );
     
    583609  }
    584610#if CONFORMANCE_BITSTREAM_MODE
     611#if FIX_CONF_MODE
     612  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     613#else
    585614  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    586   {
    587     m_acTDecTop[layer].setConfModeFlag( m_confModeFlag );
     615#endif
     616  {
     617    m_acTDecTop[layer].setConfModeFlag ( this->getConfModeFlag() );
    588618  }
    589619#endif
     
    13861416        fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, 16));
    13871417        fclose(fptr);
    1388 
    1389         // Output all picutres "decoded" in that layer that have POC less than the current picture
    1390         std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(pic->getLayerId()))->getConfListPic();
    1391         // Write all pictures to the file.
    1392         if( this->getDecodedYuvLayerRefresh(layerIdx) )
    1393         {
    1394           if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    1395           if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    1396 
    1397           char tempFileName[256];
    1398           strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
    1399           m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
    1400           this->setDecodedYuvLayerRefresh( layerIdx, false );
    1401         }
    1402         const Window &conf = pic->getConformanceWindow();
    1403         const Window &defDisp = m_respectDefDispWindow ? pic->getDefDisplayWindow() : Window();
    1404         Int xScal =  1, yScal = 1;
    1405 #if REPN_FORMAT_IN_VPS
    1406         UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc();
    1407         xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    1408         yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    1409 #endif
    1410         std::vector<TComPic>::iterator itPic;
    1411         for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++)
    1412         {
    1413           TComPic checkPic = *itPic;
    1414           if( checkPic.getPOC() <= pic->getPOC() )
    1415           {
    1416             TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
    1417             m_confReconFile[layerIdx].write( pPicCYuvRec,
    1418               conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    1419               conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
    1420               conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
    1421               conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
    1422             layerBuffer->erase(itPic);
    1423             itPic = layerBuffer->begin();  // Ensure doesn't go to infinite loop
    1424             if(layerBuffer->size() == 0)
    1425             {
    1426               break;
    1427             }
    1428           }
    1429         }
    1430       }
    1431       // Now to remove the pictures that have been output
    1432 #endif
     1418      }
     1419#endif
     1420
    14331421
    14341422      listOfPocsInEachLayer[layerIdx].erase( it );
     
    14481436  dpbStatus.m_numAUsNotDisplayed--;   
    14491437
     1438#if CONFORMANCE_BITSTREAM_MODE
     1439  if( this->getConfModeFlag() )
     1440  {
     1441    for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
     1442    {
     1443      Int layerIdx  = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
     1444      // Output all picutres "decoded" in that layer that have POC less than the current picture
     1445      std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerIdx))->getConfListPic();
     1446      // Write all pictures to the file.
     1447      if( this->getDecodedYuvLayerRefresh(layerIdx) )
     1448      {
     1449        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
     1450        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
     1451
     1452        char tempFileName[256];
     1453        strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
     1454        m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
     1455        this->setDecodedYuvLayerRefresh( layerIdx, false );
     1456      }
     1457
     1458      std::vector<TComPic>::iterator itPic;
     1459      for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++)
     1460      {
     1461        TComPic checkPic = *itPic;
     1462        const Window &conf = checkPic.getConformanceWindow();
     1463        const Window &defDisp = m_respectDefDispWindow ? checkPic.getDefDisplayWindow() : Window();
     1464        Int xScal =  1, yScal = 1;
     1465  #if REPN_FORMAT_IN_VPS
     1466        UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc();
     1467        xScal = TComSPS::getWinUnitX( chromaFormatIdc );
     1468        yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     1469  #endif
     1470        if( checkPic.getPOC() <= pocValue )
     1471        {
     1472          TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
     1473          m_confReconFile[layerIdx].write( pPicCYuvRec,
     1474            conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
     1475            conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     1476            conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
     1477            conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
     1478          layerBuffer->erase(itPic);
     1479          itPic = layerBuffer->begin();  // Ensure doesn't go to infinite loop
     1480          if(layerBuffer->size() == 0)
     1481          {
     1482            break;
     1483          }
     1484        }
     1485      }
     1486    }
     1487  }
     1488#endif
    14501489  // Remove the picture from the listOfPocs
    14511490  listOfPocs.erase( listOfPocs.begin() );
    14521491}
     1492
    14531493
    14541494TComVPS *TAppDecTop::findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit)
  • TabularUnified branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h

    r952 r953  
    169169#if FIX_ALIGN_BUMPING
    170170    ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) );
    171     for(Int i = 0; i < MAX_LAYERS; i++)
     171    for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
    172172    {
    173173      m_layerIdToSubDpbIdMap[i] = -1;
Note: See TracChangeset for help on using the changeset viewer.