Changeset 953 in SHVCSoftware


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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  }
  • 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)
  • 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;
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r952 r953  
    4646#define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
    4747#define FIX_CONF_MODE                    1
     48#define FIX_NON_OUTPUT_LAYER             1
    4849#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
    4950#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-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r952 r953  
    127127  m_confModeFlag = false;
    128128#endif
     129#if FIX_NON_OUTPUT_LAYER
     130  m_isOutputLayerFlag = false;
     131#endif
    129132}
    130133
     
    569572  // Execute Deblock + Cleanup
    570573  m_cGopDecoder.filterPicture(pcPic);
     574
     575#if FIX_NON_OUTPUT_LAYER
     576  if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false )
     577  {
     578    pcPic->setOutputMark( false );
     579  }
     580#endif
    571581
    572582  TComSlice::sortPicList( m_cListPic ); // sorting for application output
     
    29132923  CommonDecoderParams* params = this->getCommonDecoderParams();
    29142924
     2925#if !FIX_CONF_MODE
    29152926  assert( params->getTargetLayerId() < vps->getMaxLayers() );
     2927#endif
    29162928
    29172929  if( params->getValueCheckedFlag() )
     
    30163028  Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx );
    30173029  params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) );
     3030#endif
     3031#if FIX_NON_OUTPUT_LAYER
     3032  // Check if the current layer is an output layer
     3033  for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++)
     3034  {
     3035    if( vps->getOutputLayerFlag( targetOlsIdx, i ) )
     3036    {
     3037      this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true;
     3038    }
     3039  }
    30183040#endif
    30193041}
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r924 r953  
    171171  std::vector<TComPic>   m_confListPic;         //  Dynamic buffer for storing pictures for conformance purposes
    172172#endif
     173#if FIX_NON_OUTPUT_LAYER
     174  Bool m_isOutputLayerFlag;
     175#endif
    173176public:
    174177#if POC_RESET_RESTRICTIONS
Note: See TracChangeset for help on using the changeset viewer.