Changeset 962 in SHVCSoftware


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

port fixes for conformance testing and non-output layers (rev 953)

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

Legend:

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

    r961 r962  
    167167  m_tgtLayerId = nLayerNum - 1;
    168168  assert( m_tgtLayerId >= 0 );
    169   assert( m_tgtLayerId < MAX_LAYERS );
     169#if !FIX_CONF_MODE
     170  assert( m_tgtLayerId < MAX_LAYERS );  // If this is wrong, it should be caught by asserts in other locations.
     171#endif
    170172#if O0137_MAX_LAYERID
    171173  assert( m_tgtLayerId < MAX_NUM_LAYER_IDS );
     
    192194
    193195    // Decoded layer YUV files
     196#if FIX_CONF_MODE
     197    for(Int layer= 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ )
     198#else
    194199    for(UInt layer=0; layer<= m_tgtLayerId; layer++)
     200#endif
    195201    {
    196202      sprintf(fileNameSuffix, "%s-L%d.yuv", m_confPrefix.c_str(), layer);  // olsIdx is the target output layer set index.
     
    203209  this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
    204210#endif
     211#if FIX_CONF_MODE
     212  for(Int layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ )
     213  {
     214#else
    205215  for(UInt layer=0; layer<= m_tgtLayerId; layer++)
    206216  {
    207217    assert( layer < MAX_LAYERS );
     218#endif
    208219    m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str());
    209220  }
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp

    r961 r962  
    8888  }
    8989#if SVC_EXTENSION
     90#if FIX_CONF_MODE
     91  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++ )
     92#else
    9093  for( Int i = 0; i <= m_tgtLayerId; i++ )
     94#endif
    9195  {
    9296    if( m_pchReconFile[i] )
     
    158162  memset( loopFiltered, false, sizeof( loopFiltered ) );
    159163
     164#if FIX_CONF_MODE
     165  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     166#else
    160167  for(UInt layer=0; layer<=m_tgtLayerId; layer++)
     168#endif
    161169  {
    162170    openedReconFile[layer] = false;
     
    397405  pcBLPic.destroy();
    398406
     407#if FIX_CONF_MODE
     408  for(UInt layer = layerIdmin; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     409#else
    399410  for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++)
     411#endif
    400412#else
    401413  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    582594  initROM();
    583595
     596#if FIX_CONF_MODE
     597  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     598#else
    584599  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     600#endif
    585601  {
    586602    // set layer ID
     
    604620  destroyROM();
    605621
     622#if FIX_CONF_MODE
     623  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     624#else
    606625  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     626#endif
    607627  {
    608628    if ( m_pchReconFile[layer] )
     
    629649  // initialize decoder class
    630650#if SVC_EXTENSION
     651#if FIX_CONF_MODE
     652  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     653#else
    631654  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     655#endif
    632656  {
    633657    m_acTDecTop[layer].init();
     
    636660    m_acTDecTop[layer].setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled);
    637661#endif
     662#if FIX_CONF_MODE
     663    m_acTDecTop[layer].setNumLayer( MAX_LAYERS );
     664#else
    638665    m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 );
     666#endif
    639667#if OUTPUT_LAYER_SET_INDEX
    640668    m_acTDecTop[layer].setCommonDecoderParams( &m_commonDecoderParams );
     
    642670  }
    643671#if CONFORMANCE_BITSTREAM_MODE
     672#if FIX_CONF_MODE
     673  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
     674#else
    644675  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
     676#endif
    645677  {
    646678    m_acTDecTop[layer].setConfModeFlag( m_confModeFlag );
     
    14831515        fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, numChar).c_str());
    14841516        fclose(fptr);
    1485 
    1486         // Output all picutres "decoded" in that layer that have POC less than the current picture
    1487         std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(pic->getLayerId()))->getConfListPic();
    1488         // Write all pictures to the file.
    1489         if( this->getDecodedYuvLayerRefresh(layerIdx) )
    1490         {
    1491           if (!m_outputBitDepth[CHANNEL_TYPE_LUMA]) { m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA]; }
    1492           if (!m_outputBitDepth[CHANNEL_TYPE_CHROMA]) { m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA]; }
    1493 
    1494           char tempFileName[256];
    1495           strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
    1496           m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
    1497           this->setDecodedYuvLayerRefresh( layerIdx, false );
    1498         }
    1499         const Window &conf = pic->getConformanceWindow();
    1500         const Window &defDisp = m_respectDefDispWindow ? pic->getDefDisplayWindow() : Window();
    1501         Int xScal =  1, yScal = 1;
    1502 #if REPN_FORMAT_IN_VPS
    1503         UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc();
    1504         xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    1505         yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    1506 #endif
    1507         std::vector<TComPic>::iterator itPic;
    1508         for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++)
    1509         {
    1510           TComPic checkPic = *itPic;
    1511           if( checkPic.getPOC() <= pic->getPOC() )
    1512           {
    1513             TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
    1514             m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert,
    1515               conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    1516               conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
    1517               conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
    1518               conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
    1519             layerBuffer->erase(itPic);
    1520             itPic = layerBuffer->begin();  // Ensure doesn't go to infinite loop
    1521             if(layerBuffer->size() == 0)
    1522             {
    1523               break;
    1524             }
    1525           }
    1526         }
    1527       }
    1528       // Now to remove the pictures that have been output
     1517      }
    15291518#endif
    15301519
     
    15431532  }
    15441533#endif
    1545   dpbStatus.m_numAUsNotDisplayed--;   
     1534  dpbStatus.m_numAUsNotDisplayed--;
     1535
     1536#if CONFORMANCE_BITSTREAM_MODE
     1537  if( m_confModeFlag )
     1538  {
     1539    for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
     1540    {
     1541      Int layerIdx  = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
     1542      // Output all picutres "decoded" in that layer that have POC less than the current picture
     1543      std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerIdx))->getConfListPic();
     1544      // Write all pictures to the file.
     1545      if( this->getDecodedYuvLayerRefresh(layerIdx) )
     1546      {
     1547        if (!m_outputBitDepth[CHANNEL_TYPE_LUMA]) { m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA]; }
     1548        if (!m_outputBitDepth[CHANNEL_TYPE_CHROMA]) { m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA]; }
     1549
     1550        char tempFileName[256];
     1551        strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
     1552        m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
     1553        this->setDecodedYuvLayerRefresh( layerIdx, false );
     1554      }
     1555
     1556      std::vector<TComPic>::iterator itPic;
     1557      for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++)
     1558      {
     1559        TComPic checkPic = *itPic;
     1560        const Window &conf = checkPic.getConformanceWindow();
     1561        const Window &defDisp = m_respectDefDispWindow ? checkPic.getDefDisplayWindow() : Window();
     1562        Int xScal = 1, yScal = 1;
     1563  #if REPN_FORMAT_IN_VPS
     1564        UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc();
     1565        xScal = TComSPS::getWinUnitX( chromaFormatIdc );
     1566        yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     1567  #endif
     1568        if( checkPic.getPOC() <= pocValue )
     1569        {
     1570          TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
     1571          m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert,
     1572            conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
     1573            conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     1574            conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
     1575            conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
     1576          layerBuffer->erase(itPic);
     1577          itPic = layerBuffer->begin();  // Ensure doesn't go to infinite loop
     1578          if(layerBuffer->size() == 0)
     1579          {
     1580            break;
     1581          }
     1582        }
     1583      }
     1584    }
     1585  }
     1586#endif
    15461587
    15471588  // Remove the picture from the listOfPocs
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.h

    r961 r962  
    171171#if FIX_ALIGN_BUMPING
    172172    ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) );
    173     for(Int i = 0; i < MAX_LAYERS; i++)
     173    for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
    174174    {
    175175      m_layerIdToSubDpbIdMap[i] = -1;
  • branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h

    r961 r962  
    4848#define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
    4949#define FIX_CONF_MODE                    1
     50#define FIX_NON_OUTPUT_LAYER             1
    5051#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
    5152#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
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.cpp

    r961 r962  
    132132  m_confModeFlag = false;
    133133#endif
     134#if FIX_NON_OUTPUT_LAYER
     135  m_isOutputLayerFlag = false;
     136#endif
    134137}
    135138
     
    473476
    474477  m_cGopDecoder.filterPicture(pcPic);
     478
     479#if FIX_NON_OUTPUT_LAYER
     480  if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false )
     481  {
     482    pcPic->setOutputMark( false );
     483  }
     484#endif
    475485
    476486  TComSlice::sortPicList( m_cListPic ); // sorting for application output
     
    29032913  CommonDecoderParams* params = this->getCommonDecoderParams();
    29042914
     2915#if !FIX_CONF_MODE
    29052916  assert( params->getTargetLayerId() < vps->getMaxLayers() );
     2917#endif
    29062918
    29072919  if( params->getValueCheckedFlag() )
     
    30063018  Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx );
    30073019  params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) );
     3020#endif
     3021#if FIX_NON_OUTPUT_LAYER
     3022  // Check if the current layer is an output layer
     3023  for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++)
     3024  {
     3025    if( vps->getOutputLayerFlag( targetOlsIdx, i ) )
     3026    {
     3027      this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true;
     3028    }
     3029  }
    30083030#endif
    30093031}
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.h

    r928 r962  
    174174  std::vector<TComPic>   m_confListPic;         //  Dynamic buffer for storing pictures for conformance purposes
    175175#endif
     176#if FIX_NON_OUTPUT_LAYER
     177  Bool m_isOutputLayerFlag;
     178#endif
    176179public:
    177180#if POC_RESET_RESTRICTIONS
Note: See TracChangeset for help on using the changeset viewer.