Changeset 367 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/App


Ignore:
Timestamp:
3 May 2013, 17:09:57 (12 years ago)
Author:
tech
Message:

Further minor cleanups.

Location:
branches/HTM-DEV-0.1-dev/source/App
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecCfg.cpp

    r364 r367  
    4242#include "TAppCommon/program_options_lite.h"
    4343
    44 #if H_MV
    45 #include <cassert>
    46 #endif
    4744#ifdef WIN32
    4845#define strdup _strdup
     
    7875  ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)")
    7976  ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)")
    80 #if H_MV
    81   ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.")
    82 #endif
    8377  ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
    8478  ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n"
     
    157151    }
    158152  }
    159 #if H_MV
    160   else
    161   {
    162     for ( Int curLayerId = 0; curLayerId <= m_maxLayerId; curLayerId++ )
    163     {
    164       m_targetDecLayerIdSet.push_back( curLayerId );
    165     }
    166   }
    167 #endif
    168153
    169154  return true;
    170155}
    171156
    172 #if H_MV
    173 Void TAppDecCfg::xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName)
    174 {
    175   size_t iInLength     = strlen(pchInputFileName);
    176   size_t iAppendLength = strlen(pchStringToAppend);
    177 
    178   rpchOutputFileName = (Char*) malloc(iInLength+iAppendLength+1);                       
    179   Char* pCDot = strrchr(pchInputFileName,'.');         
    180   pCDot = pCDot ? pCDot : pchInputFileName + iInLength;       
    181   size_t iCharsToDot = pCDot - pchInputFileName ;
    182   size_t iCharsToEnd = iInLength - iCharsToDot;         
    183   strncpy(rpchOutputFileName                            ,  pchInputFileName            , iCharsToDot  );
    184   strncpy(rpchOutputFileName+ iCharsToDot               ,  pchStringToAppend           , iAppendLength);
    185   strncpy(rpchOutputFileName+ iCharsToDot+iAppendLength ,  pchInputFileName+iCharsToDot, iCharsToEnd  );       
    186   rpchOutputFileName[iInLength+iAppendLength] = '\0';         
    187 }
    188 #endif
    189157//! \}
  • branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecCfg.h

    r365 r367  
    5858protected:
    5959  Char*         m_pchBitstreamFile;                   ///< input bitstream file name
    60 #if H_MV
    61   Int           m_maxLayerId;                         ///< maximum nuh_layer_id decoded
    62   std::vector<Char*> m_pchReconFiles;                 ///< array of output reconstruction file name create from output reconstruction file name
    63 #endif
    6460  Char*         m_pchReconFile;                       ///< output reconstruction file name
    6561  Int           m_iSkipFrame;                         ///< counter for frames prior to the random access point to skip
     
    7369  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
    7470
    75 #if H_MV
    76   Void xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName); ///< create filenames
    77 #endif
    7871public:
    7972  TAppDecCfg()
    8073  : m_pchBitstreamFile(NULL)
    81 #if H_MV
    82   , m_maxLayerId(0)
    83   , m_pchReconFiles(NULL)
    84 #endif
    8574  , m_pchReconFile(NULL)
    8675  , m_iSkipFrame(0)
  • branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r366 r367  
    5454
    5555TAppDecTop::TAppDecTop()
    56 #if !H_MV
    5756: m_iPOCLastDisplay(-MAX_INT)
    58 #else
    59 : m_numDecoders( 0 )
    60 #endif
    6157{
    6258  ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));
    63 #if H_MV
    64   for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1;
    65 #endif
    6659}
    6760
     
    7770    m_pchBitstreamFile = NULL;
    7871  }
    79 #if H_MV
    80   for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++)
    81   {
    82     if (m_pchReconFiles[decIdx])
    83     {
    84       free (m_pchReconFiles[decIdx]);
    85       m_pchReconFiles[decIdx] = NULL;
    86     }
    87   }
    88 #endif
    8972  if (m_pchReconFile)
    9073  {
     
    10992{
    11093  Int                 poc;
    111 #if H_MV
    112   poc = -1;
    113 #endif
    11494  TComList<TComPic*>* pcListPic = NULL;
    11595
     
    126106  xCreateDecLib();
    127107  xInitDecLib  ();
    128 #if !H_MV
    129108  m_iPOCLastDisplay += m_iSkipFrame;      // set the last displayed POC correctly for skip forward.
    130109
    131110  // main decoder loop
    132111  Bool recon_opened = false; // reconstruction file not yet opened. (must be performed after SPS is seen)
    133 #else
    134   Int  pocCurrPic        = -MAX_INT;     
    135   Int  pocLastPic        = -MAX_INT;   
    136  
    137   Int  layerIdLastPic    = 0;
    138   Int  layerIdCurrPic    = 0;
    139 
    140   Int  decIdxLastPic     = 0;
    141   Int  decIdxCurrPic     = 0;
    142 
    143   Bool firstSlice        = true;
    144 #endif
    145112 
    146113  while (!!bitstreamFile)
     
    152119    streampos location = bitstreamFile.tellg();
    153120    AnnexBStats stats = AnnexBStats();
    154 #if !H_MV
    155121    Bool bPreviousPictureDecoded = false;
    156 #endif
    157122
    158123    vector<uint8_t> nalUnit;
     
    162127    // call actual decoding function
    163128    Bool bNewPicture = false;
    164 #if H_MV
    165     Bool newSliceDiffPoc   = false;
    166     Bool newSliceDiffLayer = false;
    167     Bool allLayersDecoded  = false;     
    168 #endif
    169129    if (nalUnit.empty())
    170130    {
     
    179139    {
    180140      read(nalu, nalUnit);
    181 #if H_MV     
    182       Int decIdx     = xGetDecoderIdx( nalu.m_layerId , true );
    183      
    184       if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) )
    185       {
    186         bNewPicture = false;
    187       }
    188       else
    189       {
    190         newSliceDiffLayer = nalu.isSlice() && ( nalu.m_layerId != layerIdCurrPic ) && !firstSlice;
    191         newSliceDiffPoc   = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer );
    192         // decode function only returns true when all of the following conditions are true
    193         // - poc in particular layer changes
    194         // - nalu does not belong to first slice in layer
    195         // - nalu.isSlice() == true     
    196 
    197         bNewPicture       = newSliceDiffLayer || newSliceDiffPoc;
    198 
    199         if ( nalu.isSlice() && firstSlice )
    200         {
    201           layerIdCurrPic = nalu.m_layerId;
    202           pocCurrPic     = m_tDecTop[decIdx]->getCurrPoc();
    203           decIdxCurrPic  = decIdx;
    204           firstSlice     = false;
    205         }
    206 
    207         if ( bNewPicture || !bitstreamFile )
    208         {
    209           layerIdLastPic    = layerIdCurrPic; 
    210           layerIdCurrPic    = nalu.m_layerId;
    211          
    212           pocLastPic        = pocCurrPic;
    213           pocCurrPic        = m_tDecTop[decIdx]->getCurrPoc();
    214          
    215           decIdxLastPic     = decIdxCurrPic;
    216           decIdxCurrPic     = decIdx;
    217 
    218           allLayersDecoded = ( pocCurrPic != pocLastPic );
    219         }
    220 
    221        
    222 #else
    223141      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  )
    224142      {
     
    236154      {
    237155        bNewPicture = m_cTDecTop.decode(nalu, m_iSkipFrame, m_iPOCLastDisplay);
    238 #endif
    239156        if (bNewPicture)
    240157        {
     
    247164          bytestream.reset();
    248165        }
    249 #if !H_MV
    250166        bPreviousPictureDecoded = true;
    251 #endif
    252167      }
    253168    }
    254169    if (bNewPicture || !bitstreamFile)
    255170    {
    256 #if H_MV
    257       assert( decIdxLastPic != -1 );
    258       m_tDecTop[decIdxLastPic]->endPicDecoding(poc, pcListPic, m_targetDecLayerIdSet );
    259 #else
    260171      m_cTDecTop.executeLoopFilters(poc, pcListPic);
    261 #endif
    262     }
    263 #if H_3D
    264     if ( allLayersDecoded || !bitstreamFile )
    265     {
    266       for( Int dI = 0; dI < m_numDecoders; dI++ )
    267       {
    268         TComPic* picLastCoded = m_ivPicLists.getPic( m_tDecTop[dI]->getLayerId(), pocLastPic );
    269         assert( picLastCoded != NULL );       
    270         picLastCoded->compressMotion();         
    271       }
    272     }
    273 #endif
     172    }
    274173
    275174    if( pcListPic )
    276175    {
    277 #if H_MV
    278       if ( m_pchReconFiles[decIdxLastPic] && !m_reconOpen[decIdxLastPic] )
    279 #else
    280176      if ( m_pchReconFile && !recon_opened )
    281 #endif
    282177      {
    283178        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    284179        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    285180
    286 #if H_MV
    287         m_tVideoIOYuvReconFile[decIdxLastPic]->open( m_pchReconFiles[decIdxLastPic], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
    288         m_reconOpen[decIdxLastPic] = true;
    289       }
    290       if ( bNewPicture && newSliceDiffPoc &&
    291 #else
    292181        m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
    293182        recon_opened = true;
    294183      }
    295184      if ( bNewPicture &&
    296 #endif
    297185           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    298186            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
     
    301189            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
    302190      {
    303 #if H_MV
    304         xFlushOutput( pcListPic, decIdxLastPic );
    305 #else
    306191        xFlushOutput( pcListPic );
    307 #endif
    308192      }
    309193      // write reconstruction to file
    310194      if(bNewPicture)
    311195      {
    312 #if H_MV
    313         xWriteOutput( pcListPic, decIdxLastPic, nalu.m_temporalId );
    314       }
    315     }
    316   }
    317 
    318   for(UInt decIdx = 0; decIdx < m_numDecoders; decIdx++)
    319   {
    320     xFlushOutput( m_tDecTop[decIdx]->getListPic(), decIdx );
    321   }
    322 #else
    323196        xWriteOutput( pcListPic, nalu.m_temporalId );
    324197      }
     
    329202  // delete buffers
    330203  m_cTDecTop.deletePicBuffer();
    331 #endif
    332204     
    333205  // destroy internal classes
     
    341213Void TAppDecTop::xCreateDecLib()
    342214{
    343 #if H_MV
    344   // initialize global variables
    345   initROM(); 
    346 #else
    347215  // create decoder class
    348216  m_cTDecTop.create();
    349 #endif
    350217}
    351218
    352219Void TAppDecTop::xDestroyDecLib()
    353220{
    354 #if H_MV
    355   // destroy ROM
    356   destroyROM();
    357 
    358   for(Int decIdx = 0; decIdx < m_numDecoders ; decIdx++)
    359   {
    360     if( m_tVideoIOYuvReconFile[decIdx] )
    361     {
    362       m_tVideoIOYuvReconFile[decIdx]->close();
    363       delete m_tVideoIOYuvReconFile[decIdx];
    364       m_tVideoIOYuvReconFile[decIdx] = NULL ;
    365     }
    366 
    367     if( m_tDecTop[decIdx] )
    368     {
    369       m_tDecTop[decIdx]->deletePicBuffer();
    370       m_tDecTop[decIdx]->destroy() ;
    371     }
    372     delete m_tDecTop[decIdx] ;
    373     m_tDecTop[decIdx] = NULL ;
    374   }
    375 #else
    376221  if ( m_pchReconFile )
    377222  {
     
    381226  // destroy decoder class
    382227  m_cTDecTop.destroy();
    383 #endif
    384228}
    385229
    386230Void TAppDecTop::xInitDecLib()
    387231{
    388 #if !H_MV
    389232  // initialize decoder class
    390233  m_cTDecTop.init();
    391234  m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
    392 #endif
    393235}
    394236
     
    396238    \todo            DYN_REF_FREE should be revised
    397239 */
    398 #if H_MV
    399 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, Int decIdx, Int tId )
    400 #else
    401240Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, UInt tId )
    402 #endif
    403241{
    404242  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
     
    408246  {
    409247    TComPic* pcPic = *(iterPic);
    410 #if H_MV
    411     if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx])
    412 #else
    413248    if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay)
    414 #endif
    415249    {
    416250       not_displayed++;
     
    424258    TComPic* pcPic = *(iterPic);
    425259   
    426 #if H_MV
    427     if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx]))
    428 #else
    429260    if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))
    430 #endif
    431261    {
    432262      // write to file
    433263       not_displayed--;
    434 #if H_MV
    435       if ( m_pchReconFiles[decIdx] )
    436 #else
    437264      if ( m_pchReconFile )
    438 #endif
    439265      {
    440266        const Window &conf = pcPic->getConformanceWindow();
    441267        const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    442 #if H_MV
    443         m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    444 #else
    445268        m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
    446 #endif
    447269                                       conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    448270                                       conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     
    452274     
    453275      // update POC of display order
    454 #if H_MV
    455       m_pocLastDisplay[decIdx] = pcPic->getPOC();
    456 #else
    457276      m_iPOCLastDisplay = pcPic->getPOC();
    458 #endif
    459277     
    460278      // erase non-referenced picture in the reference picture list after display
     
    484302    \todo            DYN_REF_FREE should be revised
    485303 */
    486 #if H_MV
    487 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx )
    488 #else
    489304Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic )
    490 #endif
    491305{
    492306  if(!pcListPic)
     
    505319    {
    506320      // write to file
    507 #if H_MV
    508       if ( m_pchReconFiles[decIdx] )
    509 #else
    510321      if ( m_pchReconFile )
    511 #endif
    512322      {
    513323        const Window &conf = pcPic->getConformanceWindow();
    514324        const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    515 #if H_MV
    516         m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
    517 #else
    518325        m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
    519 #endif
    520326                                       conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    521327                                       conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     
    525331     
    526332      // update POC of display order
    527 #if H_MV
    528       m_pocLastDisplay[decIdx] = pcPic->getPOC();
    529 #else
    530333      m_iPOCLastDisplay = pcPic->getPOC();
    531 #endif
    532334     
    533335      // erase non-referenced picture in the reference picture list after display
     
    549351      pcPic->setOutputMark(false);
    550352    }
    551 #if !H_MV
    552353#if !DYN_REF_FREE
    553354    if(pcPic)
     
    558359    }
    559360#endif
    560 #endif
    561361    iterPic++;
    562362  }
    563 #if H_MV
    564   m_pocLastDisplay[decIdx] = -MAX_INT;
    565 #else
    566363  pcListPic->clear();
    567364  m_iPOCLastDisplay = -MAX_INT;
    568 #endif
    569365}
    570366
     
    579375  for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++)
    580376  {
    581 #if H_MV
    582     if ( nalu->m_layerId == (*it) )
    583 #else
    584377    if ( nalu->m_reservedZero6Bits == (*it) )
    585 #endif
    586378    {
    587379      return true;
  • branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.h

    r365 r367  
    6161private:
    6262  // class interface
    63 #if H_MV
    64   TDecTop*                        m_tDecTop             [ MAX_NUM_LAYERS ];    ///< decoder classes
    65   TVideoIOYuv*                    m_tVideoIOYuvReconFile[ MAX_NUM_LAYERS ];    ///< reconstruction YUV class
    66   Int                             m_layerIdToDecIdx     [ MAX_NUM_LAYER_IDS ]; ///< maping from layer id to decoder index
    67   Int                             m_numDecoders;                               ///< number of decoder instances
    68   TComPicLists                    m_ivPicLists;                                ///< picture buffers of decoder instances
    69 #else
    7063  TDecTop                         m_cTDecTop;                     ///< decoder class
    7164  TVideoIOYuv                     m_cTVideoIOYuvReconFile;        ///< reconstruction YUV class
    72 #endif
    7365 
    7466  // for output control
    7567  Bool                            m_abDecFlag[ MAX_GOP ];         ///< decoded flag in one GOP
    76 #if H_MV
    77   Int                             m_pocLastDisplay      [ MAX_NUM_LAYERS ]; ///< last POC in display order
    78   Bool                            m_reconOpen           [ MAX_NUM_LAYERS ]; ///< reconstruction file opened
    79 #else
    8068  Int                             m_iPOCLastDisplay;              ///< last POC in display order
    81 #endif
    8269 
    8370public:
     
    9481  Void  xInitDecLib       (); ///< initialize decoder class
    9582 
    96 #if H_MV
    97   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file
    98   Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file
    99   Int   xGetDecoderIdx    ( Int layerId, Bool createFlag = false )
    100   {
    101     Int decIdx = -1;
    102     if ( m_layerIdToDecIdx[ layerId ] != -1 )
    103     {     
    104       decIdx = m_layerIdToDecIdx[ layerId ];
    105     }
    106     else
    107     {     
    108       assert ( createFlag );
    109       assert( m_numDecoders < MAX_NUM_LAYERS );
    110 
    111       decIdx = m_numDecoders;
    112      
    113       // Init decoder
    114       m_tDecTop[ decIdx ] =  new TDecTop;
    115       m_tDecTop[ decIdx ]->create();
    116       m_tDecTop[ decIdx ]->init( );
    117       m_tDecTop[ decIdx ]->setLayerId( layerId );
    118       m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
    119       m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );
    120      
    121       // append pic list of new decoder to PicLists
    122       assert( m_ivPicLists.size() == m_numDecoders );
    123       m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() );
    124 
    125       // create recon file related stuff     
    126       Char* pchTempFilename = NULL;
    127       if ( m_pchReconFile )
    128       {     
    129         Char buffer[4];     
    130         sprintf(buffer,"_%i", layerId );
    131         assert ( m_pchReconFile );
    132         xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );
    133         assert( m_pchReconFiles.size() == m_numDecoders );
    134       }
    135 
    136       m_pchReconFiles.push_back( pchTempFilename );   
    137 
    138       m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv;
    139       m_reconOpen           [ decIdx ] = false;
    140 
    141       // set others
    142       m_pocLastDisplay      [ decIdx ] = -MAX_INT;
    143       m_layerIdToDecIdx     [ layerId ] = decIdx;
    144 
    145       m_numDecoders++;
    146     };
    147     return decIdx;
    148   }
    149 #else
    15083  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic , UInt tId); ///< write YUV to file
    15184  Void  xFlushOutput      ( TComList<TComPic*>* pcListPic ); ///< flush all remaining decoded pictures to file
    152 #endif
    15385  Bool  isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet
    15486};
  • branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/decmain.cpp

    r324 r367  
    5656  // print information
    5757  fprintf( stdout, "\n" );
    58 #if H_MV
    59   fprintf( stdout, "3D-HTM Software: Decoder Version [%s] based on HM Version [%s]", NV_VERSION, HM_VERSION ); 
    60 #else
    6158  fprintf( stdout, "HM software: Decoder Version [%s]", NV_VERSION );
    62 #endif
    6359  fprintf( stdout, NVM_ONOS );
    6460  fprintf( stdout, NVM_COMPILEDBY );
  • branches/HTM-DEV-0.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r366 r367  
    6464
    6565TAppEncCfg::TAppEncCfg()
    66 #if H_MV
    67 : m_pchBitstreamFile()
    68 #else
    6966: m_pchInputFile()
    7067, m_pchBitstreamFile()
    7168, m_pchReconFile()
    72 #endif
    7369, m_pchdQPFile()
    7470, m_pColumnWidth()
     
    7672, m_scalingListFile()
    7773{
    78 #if !H_MV
    7974  m_aidQP = NULL;
    80 #endif
    8175#if J0149_TONE_MAPPING_SEI
    8276  m_startOfCodedInterval = NULL;
     
    8882TAppEncCfg::~TAppEncCfg()
    8983{
    90 #if H_MV
    91   for( Int layer = 0; layer < m_aidQP.size(); layer++ )
    92   {
    93     if ( m_aidQP[layer] != NULL )
    94     {
    95       delete[] m_aidQP[layer];
    96       m_aidQP[layer] = NULL;
    97     }
    98   }
    99   for(Int i = 0; i< m_pchInputFileList.size(); i++ )
    100   {
    101     if ( m_pchInputFileList[i] != NULL )
    102       free (m_pchInputFileList[i]);
    103   }
    104 #else
    10584  if ( m_aidQP )
    10685  {
    10786    delete[] m_aidQP;
    10887  }
    109 #endif
    11088#if J0149_TONE_MAPPING_SEI
    11189  if ( m_startOfCodedInterval )
     
    125103  }
    126104#endif
    127 #if !H_MV
    128105  free(m_pchInputFile);
    129 #endif
    130106  free(m_pchBitstreamFile);
    131 #if H_MV
    132   for(Int i = 0; i< m_pchReconFileList.size(); i++ )
    133   {
    134     if ( m_pchReconFileList[i] != NULL )
    135       free (m_pchReconFileList[i]);
    136   }
    137 #else
    138107  free(m_pchReconFile);
    139 #endif
    140108  free(m_pchdQPFile);
    141109  free(m_pColumnWidth);
    142110  free(m_pRowHeight);
    143111  free(m_scalingListFile);
    144 #if H_MV
    145   for( Int i = 0; i < m_GOPListMvc.size(); i++ )
    146   {
    147     if( m_GOPListMvc[i] )
    148     {
    149       delete[] m_GOPListMvc[i];
    150       m_GOPListMvc[i] = NULL;
    151     }
    152   }
    153 #endif
    154112}
    155113
     
    203161  }
    204162#endif
    205 #if H_MV
    206   in>>entry.m_numInterViewRefPics;
    207   for( Int i = 0; i < entry.m_numInterViewRefPics; i++ )
    208   {
    209     in>>entry.m_interViewRefs[i];
    210   }
    211   for( Int i = 0; i < entry.m_numInterViewRefPics; i++ )
    212   {
    213     in>>entry.m_interViewRefPosL[0][i];
    214   }
    215   for( Int i = 0; i < entry.m_numInterViewRefPics; i++ )
    216   {
    217     in>>entry.m_interViewRefPosL[1][i];
    218   }
    219 #endif
    220163  return in;
    221164}
     
    229172  {"main10", Profile::MAIN10},
    230173  {"main-still-picture", Profile::MAINSTILLPICTURE},
    231 #if H_MV
    232   {"main-stereo",    Profile::MAINSTEREO},
    233   {"main-multiview", Profile::MAINMULTIVIEW},
    234 #if H_3D
    235   {"main-3d"    , Profile::MAIN3D},
    236 #endif
    237 #endif
    238174};
    239175
     
    317253  Bool do_help = false;
    318254 
    319 #if !H_MV
    320255  string cfg_InputFile;
    321 #endif
    322256  string cfg_BitstreamFile;
    323 #if !H_MV
    324257  string cfg_ReconFile;
    325 #endif
    326 #if H_MV
    327   vector<Int>   cfg_dimensionLength;
    328 #if H_3D
    329   cfg_dimensionLength.push_back( 2  );  // depth
    330   cfg_dimensionLength.push_back( 32 );  // texture
    331 #else
    332   cfg_dimensionLength.push_back( 64 );
    333 #endif
    334 #endif
    335258  string cfg_dQPFile;
    336259  string cfg_ColumnWidth;
     
    356279 
    357280  // File, I/O and source parameters
    358 #if H_MV
    359   ("InputFile_%d,i_%d",       m_pchInputFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d")
    360 #else
    361281  ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
    362 #endif
    363282  ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
    364 #if H_MV
    365   ("ReconFile_%d,o_%d",       m_pchReconFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d")
    366 #else
    367283  ("ReconFile,o",           cfg_ReconFile,     string(""), "Reconstructed YUV output file name")
    368 #endif
    369 #if H_MV
    370   ("NumberOfLayers",        m_numberOfLayers     , 1,                     "Number of layers")
    371 #if !H_3D
    372   ("ScalabilityMask",       m_scalabilityMask    , 1                    , "Scalability Mask")   
    373 #else
    374   ("ScalabilityMask",       m_scalabilityMask    , 3                    , "Scalability Mask, 1: Texture 3: Texture + Depth ")   
    375 #endif 
    376   ("DimensionIdLen",        m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
    377   ("ViewId",                m_viewId             , std::vector<Int>(1,0), "View Id")
    378 #if H_3D
    379   ("DepthFlag",             m_depthFlag          , std::vector<Int>(1,0), "Depth Flag")
    380 #endif
    381   ("LayerIdInNuh",          m_layerIdInNuh       , std::vector<Int>(1,0), "LayerId in Nuh")
    382   ("SplittingFlag",         m_splittingFlag      , false                , "Splitting Flag")   
    383 #endif
    384284  ("SourceWidth,-wdt",      m_iSourceWidth,        0, "Source picture width")
    385285  ("SourceHeight,-hgt",     m_iSourceHeight,       0, "Source picture height")
     
    453353
    454354  /* Quantization parameters */
    455 #if H_MV
    456   ("QP,q",          m_fQP, std::vector<double>(1,30.0), "Qp values for each layer, if value is float, QP is switched once during encoding")
    457 #else
    458355  ("QP,q",          m_fQP,             30.0, "Qp value, if value is float, QP is switched once during encoding")
    459 #endif
    460356  ("DeltaQpRD,-dqr",m_uiDeltaQpRD,       0u, "max dQp offset for slice")
    461357  ("MaxDeltaQP,d",  m_iMaxDeltaQP,        0, "max dQp offset for block")
     
    481377 
    482378  // Deblocking filter parameters
    483 #if H_MV
    484   ("LoopFilterDisable",              m_bLoopFilterDisable,             std::vector<Bool>(1,false), "Disable Loop Filter per Layer" )
    485 #else
    486379  ("LoopFilterDisable",              m_bLoopFilterDisable,             false )
    487 #endif
    488380  ("LoopFilterOffsetInPPS",          m_loopFilterOffsetInPPS,          false )
    489381  ("LoopFilterBetaOffset_div2",      m_loopFilterBetaOffsetDiv2,           0 )
     
    498390  ("TransformSkip",            m_useTransformSkip,          false, "Intra transform skipping")
    499391  ("TransformSkipFast",        m_useTransformSkipFast,      false, "Fast intra transform skipping")
    500 #if H_MV
    501   ("SAO",                      m_bUseSAO, std::vector<Bool>(1,true), "Enable Sample Adaptive Offset per Layer")
    502 #else
    503392  ("SAO",                      m_bUseSAO,                   true,  "Enable Sample Adaptive Offset")
    504 #endif
    505393  ("MaxNumOffsetsPerPic",      m_maxNumOffsetsPerPic,       2048,  "Max number of SAO offset per picture (Default: 2048)")   
    506394  ("SAOLcuBoundary",           m_saoLcuBoundary,            false, "0: right/bottom LCU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
     
    684572  ;
    685573 
    686 #if H_MV
    687   // parse coding structure
    688   for( Int k = 0; k < MAX_NUM_LAYERS; k++ )
    689   {
    690     m_GOPListMvc.push_back( new GOPEntry[MAX_GOP + 1] );
    691     if( k == 0 )
    692     {
    693       for( Int i = 1; i < MAX_GOP + 1; i++ )
    694       {
    695         std::ostringstream cOSS;
    696         cOSS<<"Frame"<<i;
    697         opts.addOptions()( cOSS.str(), m_GOPListMvc[k][i-1], GOPEntry() );
    698       }
    699     }
    700     else
    701     {
    702       std::ostringstream cOSS1;
    703       cOSS1<<"FrameI"<<"_l"<<k;
    704       opts.addOptions()(cOSS1.str(), m_GOPListMvc[k][MAX_GOP], GOPEntry());
    705 
    706       for( Int i = 1; i < MAX_GOP + 1; i++ )
    707       {
    708         std::ostringstream cOSS2;
    709         cOSS2<<"Frame"<<i<<"_l"<<k;
    710         opts.addOptions()(cOSS2.str(), m_GOPListMvc[k][i-1], GOPEntry());
    711       }
    712     }
    713   }
    714 #else
    715574  for(Int i=1; i<MAX_GOP+1; i++) {
    716575    std::ostringstream cOSS;
     
    718577    opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry());
    719578  }
    720 #endif
    721579  po::setDefaults(opts);
    722580  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv);
     
    738596   */
    739597  /* convert std::string to c string for compatability */
    740 #if !H_MV
    741598  m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
    742 #endif
    743599  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    744 #if !H_MV
    745600  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    746 #endif
    747601  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    748602 
     
    804658    m_pRowHeight = NULL;
    805659  }
    806 #if H_MV
    807   free ( pColumnWidth );
    808   free ( pRowHeight   );
    809 #endif
    810660#if SIGNAL_BITRATE_PICRATE_IN_VPS
    811661  readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" );
     
    887737 
    888738  // allocate slice-based dQP values
    889 #if H_MV
    890   xResizeVector( m_viewId    );
    891 #if H_3D
    892   xResizeVector( m_depthFlag );
    893 #endif
    894 
    895   xResizeVector( m_fQP );
    896 
    897   for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    898   {
    899     m_aidQP.push_back( new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ] );
    900     ::memset( m_aidQP[layer], 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) );
    901 
    902     // handling of floating-point QP values
    903     // if QP is not integer, sequence is split into two sections having QP and QP+1
    904     m_iQP.push_back((Int)( m_fQP[layer] ));
    905     if ( m_iQP[layer] < m_fQP[layer] )
    906     {
    907       Int iSwitchPOC = (Int)( m_framesToBeEncoded - (m_fQP[layer] - m_iQP[layer])*m_framesToBeEncoded + 0.5 );
    908 
    909       iSwitchPOC = (Int)( (Double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize;
    910       for ( Int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ )
    911       {
    912         m_aidQP[layer][i] = 1;
    913       }
    914     }
    915   }
    916 
    917   xResizeVector( m_bLoopFilterDisable );
    918   xResizeVector( m_bUseSAO );   
    919 
    920 #else
    921739  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
    922740  ::memset( m_aidQP, 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) );
     
    935753    }
    936754  }
    937 #endif
    938755 
    939756  // reading external dQP description from file
     
    943760    if ( fpt )
    944761    {
    945 #if H_MV
    946       for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    947       {
    948 #endif
    949762      Int iValue;
    950763      Int iPOC = 0;
     
    952765      {
    953766        if ( fscanf(fpt, "%d", &iValue ) == EOF ) break;
    954 #if H_MV
    955         m_aidQP[layer][ iPOC ] = iValue;
    956         iPOC++;
    957       }
    958 #else
    959767        m_aidQP[ iPOC ] = iValue;
    960768        iPOC++;
    961 #endif
    962769      }
    963770      fclose(fpt);
     
    1125932  xConfirmPara( m_iFrameRate <= 0,                                                          "Frame rate must be more than 1" );
    1126933  xConfirmPara( m_framesToBeEncoded <= 0,                                                   "Total Number Of Frames encoded must be more than 0" );
    1127 #if H_MV
    1128   xConfirmPara( m_numberOfLayers > MAX_NUM_LAYER_IDS ,                                      "NumberOfLayers must be less than or equal to MAX_NUM_LAYER_IDS");
    1129 
    1130 
    1131   xConfirmPara( m_layerIdInNuh[0] != 0      , "LayerIdInNuh must be 0 for the first layer. ");
    1132   xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. ");
    1133  
    1134 #if H_3D
    1135   xConfirmPara( m_scalabilityMask != 1 && m_scalabilityMask != 3, "Scalability Mask must be equal to 1 or 3. ");
    1136 #else
    1137   xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. ");
    1138 #endif
    1139  
    1140   m_dimIds.push_back( m_viewId );
    1141 #if H_3D
    1142   if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )
    1143     m_dimIds.push_back( m_depthFlag );
    1144 #endif
    1145 
    1146   xConfirmPara(  m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. "   );
    1147 
    1148  for( Int dim = 0; dim < m_dimIds.size(); dim++ )
    1149  {
    1150    xConfirmPara( m_dimIds[dim].size() < m_numberOfLayers,  "DimensionId must be given for all layers and all dimensions. ");
    1151    xConfirmPara( m_dimIds[dim][0] != 0,                    "DimensionId of layer 0 must be 0 in all dimensions. " );
    1152    xConfirmPara( m_dimensionIdLen[dim] < 1 || m_dimensionIdLen[dim] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " );
    1153    for( Int i = 1; i < m_numberOfLayers; i++ )
    1154    {     
    1155      xConfirmPara(  ( m_dimIds[dim][i] < 0 ) || ( m_dimIds[dim][i] > ( ( 1 << m_dimensionIdLen[dim] ) - 1 ) )   , "DimensionId shall be in the range of 0 to 2^DimensionIdLen - 1. " );
    1156    }
    1157  }
    1158 
    1159  for( Int i = 0; i < m_numberOfLayers; i++ )
    1160  {
    1161    for( Int j = 0; j < i; j++ )
    1162    {     
    1163      Int numDiff  = 0;
    1164      Int lastDiff = -1;
    1165      for( Int dim = 0; dim < m_dimIds.size(); dim++ )
    1166      {
    1167        if ( m_dimIds[dim][i] != m_dimIds[dim][j] )
    1168        {
    1169          numDiff ++;
    1170          lastDiff = dim;
    1171        }
    1172      }
    1173 
    1174      Bool allEqual = ( numDiff == 0 );
    1175 
    1176      if ( allEqual )
    1177      {
    1178        printf( "\nError: Positions of Layers %d and %d are identical in scalability space\n", i, j);
    1179      }
    1180 
    1181      xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." );
    1182 
    1183      if ( numDiff  == 1 )
    1184      {
    1185        Bool inc = m_dimIds[ lastDiff ][ i ] > m_dimIds[ lastDiff ][ j ];
    1186        if ( !inc )
    1187        {       
    1188          printf( "\nError: Positions of Layers %d and %d is not increasing in dimension %d \n", i, j, lastDiff);       
    1189        }
    1190        xConfirmPara( !inc,  "DimensionIds shall be increasing within one dimension. " );
    1191      }
    1192    }
    1193  }
    1194 
    1195 #endif
    1196934  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
    1197935  xConfirmPara( m_iGOPSize > 1 &&  m_iGOPSize % 2,                                          "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
    1198936  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
    1199937  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2,                   "Decoding Refresh Type must be equal to 0, 1 or 2" );
    1200 #if H_MV
    1201   for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    1202   {
    1203     xConfirmPara( m_iQP[layer] <  -6 * (m_internalBitDepthY - 8) || m_iQP[layer] > 51,      "QP exceeds supported range (-QpBDOffsety to 51)" );
    1204   }
    1205 #else
    1206938  xConfirmPara( m_iQP <  -6 * (m_internalBitDepthY - 8) || m_iQP > 51,                    "QP exceeds supported range (-QpBDOffsety to 51)" );
    1207 #endif
    1208939  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -13 || m_loopFilterBetaOffsetDiv2 > 13,          "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)");
    1209940  xConfirmPara( m_loopFilterTcOffsetDiv2 < -13 || m_loopFilterTcOffsetDiv2 > 13,              "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)");
     
    1249980
    1250981#if ADAPTIVE_QP_SELECTION
    1251 #if H_MV
    1252   for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    1253   {
    1254     xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP[layer] < 0,                                     "AdaptiveQpSelection must be disabled when QP < 0.");
    1255   }
    1256 #else
    1257982  xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0,                                              "AdaptiveQpSelection must be disabled when QP < 0.");
    1258 #endif
    1259983  xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ),               "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0.");
    1260984#endif
     
    13101034  }
    13111035
    1312 #if H_MV
    1313   // validate that POC of same frame is identical across multiple layers
    1314   Bool bErrorMvePoc = false;
    1315   if( m_numberOfLayers > 1 )
    1316   {
    1317     for( Int k = 1; k < m_numberOfLayers; k++ )
    1318     {
    1319       for( Int i = 0; i < MAX_GOP; i++ )
    1320       {
    1321         if( m_GOPListMvc[k][i].m_POC != m_GOPListMvc[0][i].m_POC )
    1322         {
    1323           printf( "\nError: Frame%d_l%d POC %d is not identical to Frame%d POC\n", i, k, m_GOPListMvc[k][i].m_POC, i );
    1324           bErrorMvePoc = true;
    1325         }
    1326       }
    1327     }
    1328   }
    1329   xConfirmPara( bErrorMvePoc,  "Invalid inter-layer POC structure given" );
    1330 
    1331   // validate that baseview has no inter-view refs
    1332   Bool bErrorIvpBase = false;
    1333   for( Int i = 0; i < MAX_GOP; i++ )
    1334   {
    1335     if( m_GOPListMvc[0][i].m_numInterViewRefPics != 0 )
    1336     {
    1337       printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i );
    1338       bErrorIvpBase = true;
    1339     }
    1340   }
    1341   xConfirmPara( bErrorIvpBase, "Inter-layer refs not possible in base layer" );
    1342 
    1343   // validate inter-view refs
    1344   Bool bErrorIvpEnhV = false;
    1345   if( m_numberOfLayers > 1 )
    1346   {
    1347     for( Int k = 1; k < m_numberOfLayers; k++ )
    1348     {
    1349       for( Int i = 0; i < MAX_GOP+1; i++ )
    1350       {
    1351         for( Int j = 0; j < m_GOPListMvc[k][i].m_numInterViewRefPics; j++ )
    1352         {
    1353           Int iAbsViewId = m_GOPListMvc[k][i].m_interViewRefs[j] + k;
    1354           if( iAbsViewId < 0 || iAbsViewId >= k )
    1355           {
    1356             printf( "\nError: inter-layer ref pic %d is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefs[j], i, k );
    1357             bErrorIvpEnhV = true;
    1358           }
    1359           if( m_GOPListMvc[k][i].m_interViewRefPosL[0][j] < -1 || m_GOPListMvc[k][i].m_interViewRefPosL[0][j] > m_GOPListMvc[k][i].m_numRefPicsActive )
    1360           {
    1361             printf( "\nError: inter-layer ref pos %d on L0 is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefPosL[0][j], i, k );
    1362             bErrorIvpEnhV = true;
    1363           }
    1364           if( m_GOPListMvc[k][i].m_interViewRefPosL[1][j] < -1  || m_GOPListMvc[k][i].m_interViewRefPosL[1][j] > m_GOPListMvc[k][i].m_numRefPicsActive )
    1365           {
    1366             printf( "\nError: inter-layer ref pos %d on L1 is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefPosL[1][j], i, k );
    1367             bErrorIvpEnhV = true;
    1368           }
    1369         }
    1370         if( i == MAX_GOP ) // inter-view refs at I pic position in base view
    1371         {
    1372           if( m_GOPListMvc[k][MAX_GOP].m_sliceType != 'B' && m_GOPListMvc[k][MAX_GOP].m_sliceType != 'P' && m_GOPListMvc[k][MAX_GOP].m_sliceType != 'I' )
    1373           {
    1374             printf( "\nError: slice type of FrameI_l%d must be equal to B or P or I\n", k );
    1375             bErrorIvpEnhV = true;
    1376           }
    1377 
    1378           if( m_GOPListMvc[k][MAX_GOP].m_POC != 0 )
    1379           {
    1380             printf( "\nError: POC %d not possible for FrameI_l%d, must be 0\n", m_GOPListMvc[k][MAX_GOP].m_POC, k );
    1381             bErrorIvpEnhV = true;
    1382           }
    1383 
    1384           if( m_GOPListMvc[k][MAX_GOP].m_temporalId != 0 )
    1385           {
    1386             printf( "\nWarning: Temporal id of FrameI_l%d must be 0 (cp. I-frame in base layer)\n", k );
    1387             m_GOPListMvc[k][MAX_GOP].m_temporalId = 0;
    1388           }
    1389 
    1390           if( m_GOPListMvc[k][MAX_GOP].m_numRefPics != 0 )
    1391           {
    1392             printf( "\nWarning: temporal references not possible for FrameI_l%d\n", k );
    1393             for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numRefPics; j++ )
    1394             {
    1395               m_GOPListMvc[k][MAX_GOP].m_referencePics[j] = 0;
    1396             }
    1397             m_GOPListMvc[k][MAX_GOP].m_numRefPics = 0;
    1398           }
    1399 
    1400           if( m_GOPListMvc[k][MAX_GOP].m_interRPSPrediction )
    1401           {
    1402             printf( "\nError: inter RPS prediction not possible for FrameI_l%d, must be 0\n", k );
    1403             bErrorIvpEnhV = true;
    1404           }
    1405 
    1406           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics != 0 )
    1407           {
    1408             printf( "\nError: inter-layer prediction not possible for FrameI_l%d with slice type I, #IL_ref_pics must be 0\n", k );
    1409             bErrorIvpEnhV = true;
    1410           }
    1411 
    1412           if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics )
    1413           {
    1414             m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics;
    1415           }
    1416 
    1417           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'P' )
    1418           {
    1419             if( m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )
    1420             {
    1421               printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type P\n", k );
    1422               bErrorIvpEnhV = true;
    1423             }
    1424             else
    1425             {
    1426               for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics; j++ )
    1427               {
    1428                 if( m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j] != -1 )
    1429                 {
    1430                   printf( "\nError: inter-layer ref pos %d on L1 not possible for FrameI_l%d with slice type P\n", m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j], k );
    1431                   bErrorIvpEnhV = true;
    1432                 }
    1433               }
    1434             }
    1435           }
    1436 
    1437           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )
    1438           {
    1439             printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type B\n", k );
    1440             bErrorIvpEnhV = true;
    1441           }
    1442         }
    1443       }
    1444     }
    1445   }
    1446   xConfirmPara( bErrorIvpEnhV, "Invalid inter-layer coding structure for enhancement layers given" );
    1447 
    1448   // validate temporal coding structure
    1449   if( !bErrorMvePoc && !bErrorIvpBase && !bErrorIvpEnhV )
    1450   {
    1451     for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    1452     {
    1453       GOPEntry* m_GOPList            = m_GOPListMvc           [layer]; // It is not a member, but this name helps avoiding code duplication !!!
    1454       Int&      m_extraRPSs          = m_extraRPSsMvc         [layer]; // It is not a member, but this name helps avoiding code duplication !!!
    1455       Int&      m_maxTempLayer       = m_maxTempLayerMvc      [layer]; // It is not a member, but this name helps avoiding code duplication !!!
    1456       Int*      m_maxDecPicBuffering = m_maxDecPicBufferingMvc[layer]; // It is not a member, but this name helps avoiding code duplication !!!
    1457       Int*      m_numReorderPics     = m_numReorderPicsMvc    [layer]; // It is not a member, but this name helps avoiding code duplication !!!
    1458 #endif
    14591036  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
    14601037   * This permits the ability to omit a GOP structure specification */
     
    14901067  }
    14911068 
    1492 #if H_MV
    1493   if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) )
    1494 #else
    14951069  if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) )
    1496 #endif
    14971070  {
    14981071    for(Int i=0; i<m_iGOPSize; i++)
     
    15101083    if(m_GOPList[curGOP].m_POC<0)
    15111084    {
    1512 #if H_MV
    1513       printf("\nError: found fewer Reference Picture Sets than GOPSize for layer %d\n", layer );
    1514 #else
    15151085      printf("\nError: found fewer Reference Picture Sets than GOPSize\n");
    1516 #endif
    15171086      errorGOP=true;
    15181087    }
     
    15511120          if(!found)
    15521121          {
    1553 #if H_MV
    1554             printf("\nError: ref pic %d is not available for GOP frame %d of layer %d\n", m_GOPList[curGOP].m_referencePics[i], curGOP+1, layer);
    1555 #else
    15561122            printf("\nError: ref pic %d is not available for GOP frame %d\n",m_GOPList[curGOP].m_referencePics[i],curGOP+1);
    1557 #endif
    15581123            errorGOP=true;
    15591124          }
     
    19321497  }
    19331498#endif
    1934 #if H_MV
    1935   }
    1936   }
    1937 #endif
    19381499
    19391500#undef xConfirmPara
     
    19711532{
    19721533  printf("\n");
    1973 #if H_MV
    1974   for( Int layer = 0; layer < m_numberOfLayers; layer++)
    1975   {
    1976     printf("Input File %i                 : %s\n", layer, m_pchInputFileList[layer]);
    1977   }
    1978 #else
    19791534  printf("Input          File          : %s\n", m_pchInputFile          );
    1980 #endif
    19811535  printf("Bitstream      File          : %s\n", m_pchBitstreamFile      );
    1982 #if H_MV
    1983   for( Int layer = 0; layer < m_numberOfLayers; layer++)
    1984   {
    1985     printf("Reconstruction File %i        : %s\n", layer, m_pchReconFileList[layer]);
    1986   }
    1987 #else
    19881536  printf("Reconstruction File          : %s\n", m_pchReconFile          );
    1989 #endif
    1990 #if H_MV
    1991  xPrintParaVector( "ViewId", m_viewId );
    1992 #endif
    1993 #if H_3D
    1994  xPrintParaVector( "DepthFlag", m_depthFlag );
    1995 #endif
    1996 #if H_MV 
    1997   xPrintParaVector( "QP"               , m_fQP                );
    1998   xPrintParaVector( "LoopFilterDisable", m_bLoopFilterDisable );
    1999   xPrintParaVector( "SAO"              , m_bUseSAO            );
    2000 #endif
    20011537  printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
    20021538  printf("Internal Format              : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
     
    20101546  printf("Intra period                 : %d\n", m_iIntraPeriod );
    20111547  printf("Decoding refresh type        : %d\n", m_iDecodingRefreshType );
    2012 #if !H_MV
    20131548  printf("QP                           : %5.2f\n", m_fQP );
    2014 #endif
    20151549  printf("Max dQP signaling depth      : %d\n", m_iMaxCuDQPDepth);
    20161550
     
    20771611  }
    20781612  printf("CIP:%d ", m_bUseConstrainedIntraPred);
    2079 #if !H_MV
    20801613  printf("SAO:%d ", (m_bUseSAO)?(1):(0));
    2081 #endif
    20821614  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    20831615  printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0));
  • branches/HTM-DEV-0.1-dev/source/App/TAppEncoder/TAppEncCfg.h

    r363 r367  
    5555protected:
    5656  // file I/O
    57 #if H_MV
    58   std::vector<char*>     m_pchInputFileList;                  ///< source file names
    59 #else
    6057  Char*     m_pchInputFile;                                   ///< source file name
    61 #endif
    6258  Char*     m_pchBitstreamFile;                               ///< output bitstream file
    63 #if H_MV
    64   std::vector<char*>     m_pchReconFileList;                  ///< output reconstruction file names
    65   Int                    m_numberOfLayers;                    ///< number of Layers to Encode
    66 #else
    6759  Char*     m_pchReconFile;                                   ///< output reconstruction file
    68 #endif
    6960  // VPS specification
    70 #if H_MV
    71   std::vector< std::vector<Int> > m_dimIds;                   ///< dimension ids ( pointers to m_viewId and m_depthFlag
    72   std::vector<Int>       m_viewId;                            ///< view id
    73 #if H_3D
    74   std::vector<Int>       m_depthFlag;                         ///< depth flag
    75 #endif
    76   std::vector<Int>       m_layerIdInNuh;                      ///< layer Id in Nuh for each layer
    77   Bool                   m_splittingFlag;                     ///< Splitting Flag
    78   Int                    m_scalabilityMask;                   ///< Mask indicating scalabilities, 1: texture; 3: texture + depth                                                               
    79   std::vector<Int>       m_dimensionIdLen;                   ///< Length of scalability dimension s
    80 #endif
    8161  Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
    8262  // source specification
     
    10888  Int       m_iDecodingRefreshType;                           ///< random access type
    10989  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
    110 #if H_MV
    111   Int       m_extraRPSsMvc[MAX_NUM_LAYERS];                       ///< extra RPSs added to handle CRA for each layer
    112   std::vector< GOPEntry* >  m_GOPListMvc;                            ///< the coding structure entries from the config file for each layer
    113   Int       m_numReorderPicsMvc[MAX_NUM_LAYERS][MAX_TLAYER];      ///< total number of reorder pictures for each layer
    114   Int       m_maxDecPicBufferingMvc[MAX_NUM_LAYERS][MAX_TLAYER];  ///< total number of reference pictures needed for decoding for each layer
    115 #else
    11690  Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
    11791  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
     
    12296  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of reference pictures needed for decoding
    12397#endif
    124 #endif
    12598#if !L0034_COMBINED_LIST_CLEANUP
    12699  Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
     
    130103  Bool      m_enableAMP;
    131104  // coding quality
    132 #if H_MV
    133   std::vector<Double>  m_fQP;                                 ///< QP value of key-picture (floating point) for each layer
    134   std::vector<Int>     m_iQP;                                 ///< QP value of key-picture (integer) for each layer
    135 #else
    136105  Double    m_fQP;                                            ///< QP value of key-picture (floating point)
    137106  Int       m_iQP;                                            ///< QP value of key-picture (integer)
    138 #endif
    139107  Char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
    140 #if H_MV
    141   std::vector<Int*> m_aidQP;                                    ///< array of slice QP values for each layer
    142 #else
    143108  Int*      m_aidQP;                                          ///< array of slice QP values
    144 #endif
    145109  Int       m_iMaxDeltaQP;                                    ///< max. |delta QP|
    146110  UInt      m_uiDeltaQpRD;                                    ///< dQP range for multi-pass slice QP optimization
     
    157121  Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
    158122 
    159 #if H_MV
    160   Int       m_maxTempLayerMvc[MAX_NUM_LAYER_IDS];             ///< Max temporal layer for each layer
    161 #else
    162123  Int       m_maxTempLayer;                                  ///< Max temporal layer
    163 #endif
    164124
    165125  // coding unit (CU) definition
     
    188148  // coding tool (lossless)
    189149  Bool      m_useLossless;                                    ///< flag for using lossless coding
    190 #if H_MV
    191   std::vector<Bool> m_bUseSAO;
    192 #else
    193150  Bool      m_bUseSAO;
    194 #endif
    195151  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
    196152  Bool      m_saoLcuBoundary;                                 ///< SAO parameter estimation using non-deblocked pixels for LCU bottom and right boundary areas
    197153  Bool      m_saoLcuBasedOptimization;                        ///< SAO LCU-based optimization
    198154  // coding tools (loop filter)
    199 #if H_MV
    200   std::vector<Bool> m_bLoopFilterDisable;                     ///< flag for using deblocking filter for each layer
    201 #else
    202155  Bool      m_bLoopFilterDisable;                             ///< flag for using deblocking filter
    203 #endif
    204156  Bool      m_loopFilterOffsetInPPS;                         ///< offset for deblocking filter in 0 = slice header, 1 = PPS
    205157  Int       m_loopFilterBetaOffsetDiv2;                     ///< beta offset for deblocking filter
     
    372324  Void  xPrintParameter ();                                   ///< print configuration values
    373325  Void  xPrintUsage     ();                                   ///< print usage
    374 #if H_MV
    375   template <typename T>
    376   Void xResizeVector(  std::vector<T> & rpcVector )
    377   {
    378     for( Int layer = 0; rpcVector.size() < m_numberOfLayers; layer++ )
    379     {
    380       assert( rpcVector.size() > 0 );
    381       rpcVector.push_back( rpcVector[layer] );     
    382     }
    383 
    384 
    385     for( ; rpcVector.size() > m_numberOfLayers; )
    386     {     
    387       rpcVector.pop_back( );     
    388     }
    389 
    390   }
    391 
    392   template <typename T>
    393   Void xPrintParaVector( std::string description, std::vector<T> & rpcVector )
    394   {
    395     Int iSpace = max(1, ENC_CFG_CONSOUT_SPACE - (Int) description.length() );
    396    
    397     for ( Int i = 0; i < iSpace; i++ )
    398       description.append( " " );
    399      
    400     description.append( ":" );
    401     printf( "%s", description.c_str() );
    402 
    403     for(Int i=0;i<rpcVector.size();i++)               
    404       xPrintVectorElem( rpcVector[i] );
    405 
    406     printf("\n");
    407   }
    408  
    409   Void xPrintVectorElem( UInt   elem ) { printf(" %d"   , elem            );};
    410   Void xPrintVectorElem( Int    elem ) { printf(" %d"   , elem            );};
    411  
    412   Void xPrintVectorElem( Double elem ) { printf(" %5.2f", elem            );}; 
    413   Void xPrintVectorElem( Bool   elem ) { printf(" %d"   , ( elem ? 1 : 0 ));};
    414 #endif
    415326#if SIGNAL_BITRATE_PICRATE_IN_VPS
    416327  Int       m_bitRatePicRateMaxTLayers;                       ///< Indicates max. number of sub-layers for which bit rate is signalled.
     
    422333  Int*      m_constantPicRateIdc;                                ///< Indicates constant picture rate idc for various sub-layers
    423334#endif
    424 #if H_MV
    425   Int   getGOPSize() { return m_iGOPSize; }
    426 #endif
    427335public:
    428336  TAppEncCfg();
  • branches/HTM-DEV-0.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r366 r367  
    5757TAppEncTop::TAppEncTop()
    5858{
    59 #if !H_MV
    6059  m_iFrameRcvd = 0;
    61 #endif
    6260  m_totalBytes = 0;
    6361  m_essentialBytes = 0;
     
    7270  TComVPS vps;
    7371 
    74 #if H_MV
    75   Int maxTempLayer = -1;
    76   for (Int j = 0; j < m_numberOfLayers; j++)
    77   {
    78     maxTempLayer = max( m_maxTempLayerMvc[ j ], maxTempLayer );
    79   }
    80 
    81   vps.setMaxTLayers                       ( maxTempLayer );
    82   if ( maxTempLayer )
    83   {
    84     vps.setTemporalNestingFlag(true);
    85   }
    86   vps.setMaxLayers( m_numberOfLayers );
    87   for(Int i = 0; i < MAX_TLAYER; i++)
    88   {
    89     Int maxNumReOrderPics  = 0;
    90     Int maxDecPicBuffering = 0;
    91     for (Int j = 0; j < m_numberOfLayers; j++)
    92     {
    93       maxNumReOrderPics  = max( maxNumReOrderPics,  m_numReorderPicsMvc    [ j ][ i ] );     
    94       maxDecPicBuffering = max( maxDecPicBuffering, m_maxDecPicBufferingMvc[ j ][ i ] );     
    95     }
    96 
    97     vps.setNumReorderPics                 ( maxNumReOrderPics  ,i );
    98     vps.setMaxDecPicBuffering             ( maxDecPicBuffering ,i );
    99   }
    100 #else
    10172  vps.setMaxTLayers                       ( m_maxTempLayer );
    10273  if (m_maxTempLayer == 1)
     
    11081    vps.setMaxDecPicBuffering             ( m_maxDecPicBuffering[i], i );
    11182  }
    112 #endif
    113 #if H_MV
    114   xSetLayerIds             ( vps );   
    115   xSetDimensionIdAndLength ( vps );
    116   xSetDirectDependencyFlags( vps );
    117 
    118   for(Int layer = 0; layer < m_numberOfLayers; layer++)
    119   {
    120     m_frameRcvd                 .push_back(0);
    121     m_acTEncTopList             .push_back(new TEncTop);
    122     m_acTVideoIOYuvInputFileList.push_back(new TVideoIOYuv);
    123     m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv);
    124     m_picYuvRec                 .push_back(new TComList<TComPicYuv*>) ;
    125 
    126     m_ivPicLists.push_back( m_acTEncTopList[ layer ]->getListPic()  );
    127     TEncTop& m_cTEncTop = *m_acTEncTopList[ layer ];  // It is not a member, but this name helps avoiding code duplication !!!
    128    
    129     m_cTEncTop.setLayerIdInVps( layer );
    130     m_cTEncTop.setLayerId     ( vps.getLayerIdInNuh( layer ) );   
    131     m_cTEncTop.setViewId      ( vps.getViewId      ( layer ) );
    132 #if H_3D
    133     m_cTEncTop.setIsDepth     ( vps.getDepthId     ( layer ) != 0 );
    134 #endif
    135     m_cTEncTop.setIvPicLists  ( &m_ivPicLists );
    136 #endif
    13783  m_cTEncTop.setVPS(&vps);
    13884
     
    157103  m_cTEncTop.setDecodingRefreshType          ( m_iDecodingRefreshType );
    158104  m_cTEncTop.setGOPSize                      ( m_iGOPSize );
    159 #if H_MV
    160   m_cTEncTop.setGopList                      ( m_GOPListMvc[layer] );
    161   m_cTEncTop.setExtraRPSs                    ( m_extraRPSsMvc[layer] );
    162   for(Int i = 0; i < MAX_TLAYER; i++)
    163   {
    164     m_cTEncTop.setNumReorderPics             ( m_numReorderPicsMvc[layer][i], i );
    165     m_cTEncTop.setMaxDecPicBuffering         ( m_maxDecPicBufferingMvc[layer][i], i );
    166   }
    167 #else
    168105  m_cTEncTop.setGopList                      ( m_GOPList );
    169106  m_cTEncTop.setExtraRPSs                    ( m_extraRPSs );
     
    173110    m_cTEncTop.setMaxDecPicBuffering         ( m_maxDecPicBuffering[i], i );
    174111  }
    175 #endif
    176112  for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop )
    177113  {
    178114    m_cTEncTop.setLambdaModifier( uiLoop, m_adLambdaModifier[ uiLoop ] );
    179115  }
    180 #if H_MV
    181   m_cTEncTop.setQP                           ( m_iQP[layer] );
    182 #else
    183116  m_cTEncTop.setQP                           ( m_iQP );
    184 #endif
    185117
    186118  m_cTEncTop.setPad                          ( m_aiPad );
    187119
    188 #if H_MV
    189   m_cTEncTop.setMaxTempLayer                 ( m_maxTempLayerMvc[layer] );
    190 #else
    191120  m_cTEncTop.setMaxTempLayer                 ( m_maxTempLayer );
    192 #endif
    193121  m_cTEncTop.setUseAMP( m_enableAMP );
    194122 
     
    196124 
    197125  //====== Loop/Deblock Filter ========
    198 #if H_MV
    199   m_cTEncTop.setLoopFilterDisable            ( m_bLoopFilterDisable[layer]);
    200 #else
    201126  m_cTEncTop.setLoopFilterDisable            ( m_bLoopFilterDisable       );
    202 #endif
    203127  m_cTEncTop.setLoopFilterOffsetInPPS        ( m_loopFilterOffsetInPPS );
    204128  m_cTEncTop.setLoopFilterBetaOffset         ( m_loopFilterBetaOffsetDiv2  );
     
    227151  Int lowestQP;
    228152  lowestQP =  - 6*(g_bitDepthY - 8); // XXX: check
    229 #if H_MV
    230   if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layer] == lowestQP) && (m_useLossless == true))
    231 #else
    232153  if ((m_iMaxDeltaQP == 0 ) && (m_iQP == lowestQP) && (m_useLossless == true))
    233 #endif
    234154  {
    235155    m_bUseAdaptiveQP = false;
     
    247167  m_cTEncTop.setUseLComb                     ( m_bUseLComb    );
    248168#endif
    249 #if H_MV
    250   m_cTEncTop.setdQPs                         ( m_aidQP[layer]   );
    251 #else
    252169  m_cTEncTop.setdQPs                         ( m_aidQP        );
    253 #endif
    254170  m_cTEncTop.setUseRDOQ                      ( m_useRDOQ     );
    255171  m_cTEncTop.setUseRDOQTS                    ( m_useRDOQTS   );
     
    308224  }
    309225  m_cTEncTop.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag );
    310 #if H_MV
    311   m_cTEncTop.setUseSAO ( m_bUseSAO[layer] );
    312 #else
    313226  m_cTEncTop.setUseSAO ( m_bUseSAO );
    314 #endif
    315227  m_cTEncTop.setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
    316228
     
    460372  }
    461373#endif
    462 #if H_MV
    463   }
    464 #endif
    465374}
    466375
    467376Void TAppEncTop::xCreateLib()
    468377{
    469 #if H_MV
    470   // initialize global variables
    471   initROM();
    472 
    473   for( Int layer=0; layer < m_numberOfLayers; layer++)
    474   {
    475     m_acTVideoIOYuvInputFileList[layer]->open( m_pchInputFileList[layer],     false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
    476     m_acTVideoIOYuvInputFileList[layer]->skipFrames( m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]);
    477 
    478     if (m_pchReconFileList[layer])
    479     {
    480       m_acTVideoIOYuvReconFileList[layer]->open( m_pchReconFileList[layer], true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC);  // write mode
    481     }
    482     m_acTEncTopList[layer]->create();
    483   }
    484 #else
    485378  // Video I/O
    486379  m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
     
    492385  // Neo Decoder
    493386  m_cTEncTop.create();
    494 #endif
    495387}
    496388
    497389Void TAppEncTop::xDestroyLib()
    498390{
    499 #if H_MV
    500   // destroy ROM
    501   destroyROM();
    502 
    503   for(Int layer=0; layer<m_numberOfLayers; layer++)
    504   {
    505     m_acTVideoIOYuvInputFileList[layer]->close();
    506     m_acTVideoIOYuvReconFileList[layer]->close();
    507     delete m_acTVideoIOYuvInputFileList[layer] ;
    508     m_acTVideoIOYuvInputFileList[layer] = NULL;
    509     delete m_acTVideoIOYuvReconFileList[layer] ;
    510     m_acTVideoIOYuvReconFileList[layer] = NULL;
    511     m_acTEncTopList[layer]->deletePicBuffer();
    512     m_acTEncTopList[layer]->destroy();
    513     delete m_acTEncTopList[layer] ;
    514     m_acTEncTopList[layer] = NULL;
    515     delete m_picYuvRec[layer] ;
    516     m_picYuvRec[layer] = NULL;
    517   }
    518 #else
    519391  // Video I/O
    520392  m_cTVideoIOYuvInputFile.close();
     
    523395  // Neo Decoder
    524396  m_cTEncTop.destroy();
    525 #endif
    526397}
    527398
    528399Void TAppEncTop::xInitLib()
    529400{
    530 #if H_MV
    531   for(Int layer=0; layer<m_numberOfLayers; layer++)
    532   {
    533     m_acTEncTopList[layer]->init( );
    534   }
    535 #else
    536401  m_cTEncTop.init();
    537 #endif
    538402}
    539403
     
    568432 
    569433  // main encoder loop
    570 #if H_MV
    571   Bool  allEos = false;
    572   std::vector<Bool>  eos ;
    573   std::vector<Bool>  flush ; 
    574  
    575   Int gopSize    = 1;
    576   Int maxGopSize = 0;
    577   maxGopSize = (std::max)(maxGopSize, m_acTEncTopList[0]->getGOPSize()); 
    578  
    579   for(Int layer=0; layer < m_numberOfLayers; layer++ )
    580   {
    581     eos  .push_back( false );
    582     flush.push_back( false );
    583   }
    584 #else
    585434  Int   iNumEncoded = 0;
    586435  Bool  bEos = false;
    587 #endif
    588436 
    589437  list<AccessUnit> outputAccessUnits; ///< list of access units to write out.  is populated by the encoding process
     
    592440  pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
    593441 
    594 #if H_MV
    595   while ( !allEos )
    596   {
    597     for(Int layer=0; layer < m_numberOfLayers; layer++ )
    598     {
    599       Int frmCnt = 0;
    600       while ( !eos[layer] && !(frmCnt == gopSize))
    601       {
    602         // get buffers
    603         xGetBuffer(pcPicYuvRec, layer);
    604 
    605         // read input YUV file
    606         m_acTVideoIOYuvInputFileList[layer]->read      ( pcPicYuvOrg, m_aiPad );
    607         m_acTEncTopList             [layer]->initNewPic( pcPicYuvOrg );
    608 
    609         // increase number of received frames
    610         m_frameRcvd[layer]++;
    611        
    612         frmCnt++;
    613 
    614         eos[layer] = (m_frameRcvd[layer] == m_framesToBeEncoded);
    615         allEos = allEos|eos[layer];
    616 
    617         // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures
    618         if (m_acTVideoIOYuvInputFileList[layer]->isEof())
    619         {
    620           flush          [layer] = true;
    621           eos            [layer]   = true;
    622           m_frameRcvd    [layer]--;
    623           m_acTEncTopList[layer]->setFramesToBeEncoded(m_frameRcvd[layer]);
    624         }
    625       }
    626     }
    627     for ( Int gopId=0; gopId < gopSize; gopId++ )
    628     {
    629       for(Int layer=0; layer < m_numberOfLayers; layer++ )
    630       {
    631         Int   iNumEncoded = 0;
    632 
    633         // call encoding function for one frame         
    634         m_acTEncTopList[layer]->encode( eos[layer], flush[layer] ? 0 : pcPicYuvOrg, *m_picYuvRec[layer], outputAccessUnits, iNumEncoded, gopId );       
    635         xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, layer);
    636         outputAccessUnits.clear();
    637       }
    638 
    639     }
    640     gopSize = maxGopSize;
    641   }
    642   for(Int layer=0; layer < m_numberOfLayers; layer++ )
    643   {
    644     m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded() );
    645   }
    646 #else
    647442  while ( !bEos )
    648443  {
     
    680475
    681476  m_cTEncTop.printSummary();
    682 #endif
    683477
    684478  // delete original YUV buffer
     
    687481  pcPicYuvOrg = NULL;
    688482 
    689 #if !H_MV
    690483  // delete used buffers in encoder class
    691484  m_cTEncTop.deletePicBuffer();
    692 #endif
    693485
    694486  // delete buffers & classes
     
    701493}
    702494
    703 #if H_3D
    704 TEncTop* TAppEncTop::getTEncTopView( Int viewId, Bool isDepth )
    705 {
    706   TEncTop* encoder = NULL;
    707   for( Int layer = 0; layer < m_acTEncTopList.size(); layer++ )
    708   {
    709     if( m_acTEncTopList[layer]->getViewId()  == viewId &&
    710         m_acTEncTopList[layer]->getIsDepth() == isDepth )
    711     {
    712       encoder = m_acTEncTopList[layer];
    713       break;
    714     }
    715   }
    716   return encoder;
    717 }
    718 #endif
    719495// ====================================================================================================================
    720496// Protected member functions
     
    727503 .
    728504 */
    729 #if H_MV
    730 Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec, UInt layer)
    731 #else
    732505Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec)
    733 #endif
    734506{
    735507  assert( m_iGOPSize > 0 );
    736508 
    737509  // org. buffer
    738 #if H_MV
    739   if ( m_picYuvRec[layer]->size() == (UInt)m_iGOPSize )
    740   {
    741     rpcPicYuvRec = m_picYuvRec[layer]->popFront();
    742 #else
    743510  if ( m_cListPicYuvRec.size() == (UInt)m_iGOPSize )
    744511  {
    745512    rpcPicYuvRec = m_cListPicYuvRec.popFront();
    746 #endif
    747513
    748514  }
     
    754520
    755521  }
    756 #if H_MV
    757   m_picYuvRec[layer]->pushBack( rpcPicYuvRec );
    758 #else
    759522  m_cListPicYuvRec.pushBack( rpcPicYuvRec );
    760 #endif
    761523}
    762524
    763525Void TAppEncTop::xDeleteBuffer( )
    764526{
    765 #if H_MV
    766   for(Int layer=0; layer<m_picYuvRec.size(); layer++)
    767   {
    768     if(m_picYuvRec[layer])
    769     {
    770       TComList<TComPicYuv*>::iterator iterPicYuvRec  = m_picYuvRec[layer]->begin();
    771       Int iSize = Int( m_picYuvRec[layer]->size() );
    772 #else
    773527  TComList<TComPicYuv*>::iterator iterPicYuvRec  = m_cListPicYuvRec.begin();
    774528 
    775529  Int iSize = Int( m_cListPicYuvRec.size() );
    776 #endif
    777530
    778531  for ( Int i = 0; i < iSize; i++ )
     
    783536  }
    784537
    785 #if H_MV
    786     }
    787   }
    788 #endif 
    789538}
    790539
    791540/** \param iNumEncoded  number of encoded frames
    792541 */
    793 #if H_MV
    794 Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, std::list<AccessUnit>& accessUnits, UInt layerId)
    795 #else
    796542Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits)
    797 #endif
    798543{
    799544  Int i;
    800545 
    801 #if H_MV
    802   if( iNumEncoded > 0 )
    803   {
    804     TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end();
    805 #else
    806546  TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end();
    807547  list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin();
    808 #endif
    809548
    810549  for ( i = 0; i < iNumEncoded; i++ )
     
    816555  {
    817556    TComPicYuv*  pcPicYuvRec  = *(iterPicYuvRec++);
    818 #if H_MV
    819       if (m_pchReconFileList[layerId])
    820       {
    821         m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom );
    822       }
    823     }
    824   }
    825   if( ! accessUnits.empty() )
    826   {
    827     list<AccessUnit>::iterator aUIter;
    828     for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ )
    829     {
    830       const vector<unsigned>& stats = writeAnnexB(bitstreamFile, *aUIter);
    831       rateStatsAccum(*aUIter, stats);
    832     }
    833   }
    834 #else
    835557    if (m_pchReconFile)
    836558    {
     
    842564    rateStatsAccum(au, stats);
    843565  }
    844 #endif
    845566}
    846567
     
    888609void TAppEncTop::printRateSummary()
    889610{
    890 #if H_MV
    891   Double time = (Double) m_frameRcvd[0] / m_iFrameRate;
    892   printf("\n");
    893 #else
    894611  Double time = (Double) m_iFrameRcvd / m_iFrameRate;
    895 #endif
    896612  printf("Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time);
    897613#if VERBOSE_RATE
     
    900616}
    901617
    902 #if H_MV
    903 Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps )
    904 {   
    905   vps.setScalabilityMask( m_scalabilityMask );
    906   for( Int dim = 0; dim < m_dimIds.size(); dim++ )
    907   {
    908       vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] );
    909       for( Int layer = 1; layer < vps.getMaxLayers(); layer++ )
    910       {       
    911         vps.setDimensionId( layer, dim, m_dimIds[ dim ][ layer ] );       
    912       } 
    913   }
    914 }
    915 
    916 Void TAppEncTop::xSetDirectDependencyFlags( TComVPS& vps )
    917 {
    918   for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    919   {
    920     if( m_GOPListMvc[layer][MAX_GOP].m_POC == -1 )
    921     {
    922       continue;
    923     }
    924     for( Int i = 0; i < getGOPSize()+1; i++ )
    925     {
    926       GOPEntry ge = ( i < getGOPSize() ) ? m_GOPListMvc[layer][i] : m_GOPListMvc[layer][MAX_GOP];
    927       for( Int j = 0; j < ge.m_numInterViewRefPics; j++ )
    928       {
    929         Int interLayerRef = layer + ge.m_interViewRefs[j];
    930         vps.setDirectDependencyFlag( layer, interLayerRef, true );
    931       }
    932     }
    933   }
    934 
    935   vps.checkVPSExtensionSyntax();
    936   vps.calcIvRefLayers();
    937 }
    938 
    939 Void TAppEncTop::xSetLayerIds( TComVPS& vps )
    940 {
    941   vps.setSplittingFlag     ( m_splittingFlag );
    942 
    943   Bool nuhLayerIdPresentFlag = !( m_layerIdInNuh.size() == 1 );
    944   Int  maxNuhLayerId = nuhLayerIdPresentFlag ? xGetMax( m_layerIdInNuh ) : ( m_numberOfLayers - 1 ) ;
    945 
    946   vps.setMaxNuhLayerId( maxNuhLayerId );
    947   vps.setVpsNuhLayerIdPresentFlag( nuhLayerIdPresentFlag );
    948 
    949   for (Int layer = 0; layer < m_numberOfLayers; layer++ )
    950   {
    951     vps.setLayerIdInNuh( layer, nuhLayerIdPresentFlag ? m_layerIdInNuh[ layer ] : layer );
    952     vps.setLayerIdInVps( vps.getLayerIdInNuh( layer ), layer );
    953   }
    954 }
    955 
    956 Int TAppEncTop::xGetMax( std::vector<Int>& vec )
    957 {
    958   Int maxVec = 0;
    959   for ( Int i = 0; i < vec.size(); i++)   
    960     maxVec = max( vec[i], maxVec );
    961   return maxVec;
    962 }
    963 #endif
    964618
    965619//! \}
  • branches/HTM-DEV-0.1-dev/source/App/TAppEncoder/TAppEncTop.h

    r364 r367  
    5959private:
    6060  // class interface
    61 #if H_MV
    62   std::vector<TEncTop*>      m_acTEncTopList ;              ///< encoder class per layer
    63   std::vector<TVideoIOYuv*>  m_acTVideoIOYuvInputFileList;  ///< input YUV file
    64   std::vector<TVideoIOYuv*>  m_acTVideoIOYuvReconFileList;  ///< output reconstruction file
    65  
    66   std::vector<TComList<TComPicYuv*>*>  m_picYuvRec;         ///< list of reconstruction YUV files
    67 
    68   std::vector<Int>           m_frameRcvd;                   ///< number of received frames
    69 
    70   TComPicLists               m_ivPicLists;                  ///< picture buffers of encoder instances
    71 #else
    7261  TEncTop                    m_cTEncTop;                    ///< encoder class
    7362  TVideoIOYuv                m_cTVideoIOYuvInputFile;       ///< input YUV file
     
    7766 
    7867  Int                        m_iFrameRcvd;                  ///< number of received frames
    79 #endif
    8068
    8169  UInt m_essentialBytes;
     
    8977 
    9078  /// obtain required buffers
    91 #if H_MV
    92   Void xGetBuffer(TComPicYuv*& rpcPicYuvRec, UInt layer);
    93 #else
    9479  Void xGetBuffer(TComPicYuv*& rpcPicYuvRec);
    95 #endif
    9680
    9781  /// delete allocated buffers
     
    9983 
    10084  // file I/O
    101 #if H_MV
    102   Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, std::list<AccessUnit>& accessUnits, UInt layerId); ///< write bitstream to file
    103 #else
    10485  Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); ///< write bitstream to file
    105 #endif
    10686  void rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& stats);
    10787  void printRateSummary();
    10888 
    109 #if H_MV
    110   Void xSetLayerIds               ( TComVPS& vps ); 
    111   Void xSetDimensionIdAndLength   ( TComVPS& vps );
    112   Void xSetDirectDependencyFlags  ( TComVPS& vps );
    113   Int  xGetMax( std::vector<Int>& vec);
    114 #endif
    11589public:
    11690  TAppEncTop();
     
    11892 
    11993  Void        encode      ();                               ///< main encoding function
    120 #if H_MV
    121   TEncTop*    getTEncTopLayer(UInt layer) { return  m_acTEncTopList[layer]; }  ///< return pointer to encoder class for specific layer
    122 #if H_3D
    123   TEncTop*    getTEncTopView( Int viewId, Bool isDepth );                      ///< return pointer to encoder class for specific view Id and texture or depth
    124 #endif
    125 #else
    12694  TEncTop&    getTEncTop  ()   { return  m_cTEncTop; }      ///< return encoder class pointer reference
    127 #endif
    12895};// END CLASS DEFINITION TAppEncTop
    12996
  • branches/HTM-DEV-0.1-dev/source/App/TAppEncoder/encmain.cpp

    r364 r367  
    5757  // print information
    5858  fprintf( stdout, "\n" );
    59 #if H_MV
    60   fprintf( stdout, "3D-HTM Software: Encoder Version [%s] based on HM Version [%s]", NV_VERSION, HM_VERSION ); 
    61 #else
    6259  fprintf( stdout, "HM software: Encoder Version [%s]", NV_VERSION );
    63 #endif
    6460  fprintf( stdout, NVM_ONOS );
    6561  fprintf( stdout, NVM_COMPILEDBY );
Note: See TracChangeset for help on using the changeset viewer.