Changeset 154 in SHVCSoftware for branches


Ignore:
Timestamp:
7 May 2013, 00:03:47 (12 years ago)
Author:
seregin
Message:

set and check for avc_base_layer_flag

Location:
branches/SHM-2.0-dev/source
Files:
9 edited

Legend:

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

    r125 r154  
    6060#if SVC_EXTENSION
    6161  Char*         m_pchReconFile [MAX_LAYERS];          ///< output reconstruction file name
    62 #if AVC_BASE
    63   Char*         m_pchBLReconFile;                     ///< input BL reconstruction file name
    64   Int           m_iBLSourceWidth;
    65   Int           m_iBLSourceHeight;
    66 #if AVC_SYNTAX
    67   Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name 
    68 #endif
    69 #endif
    7062#else
    7163  Char*         m_pchReconFile;                       ///< output reconstruction file name
    72 #endif
    73 #if SYNTAX_OUTPUT
    74   Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name
    75   Int           m_iBLSourceWidth;
    76   Int           m_iBLSourceHeight;
    77   Int           m_iBLFrames;
    7864#endif
    7965  Int           m_iSkipFrame;                         ///< counter for frames prior to the random access point to skip
     
    8672#if SVC_EXTENSION
    8773  Int           m_tgtLayerId;                        ///< target layer ID
     74#if AVC_BASE
     75  Char*         m_pchBLReconFile;                     ///< input BL reconstruction file name
     76  Int           m_iBLSourceWidth;
     77  Int           m_iBLSourceHeight;
     78#if AVC_SYNTAX
     79  Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name 
    8880#endif
     81#endif
     82#endif
     83
     84#if SYNTAX_OUTPUT
     85  Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name
     86  Int           m_iBLSourceWidth;
     87  Int           m_iBLSourceHeight;
     88  Int           m_iBLFrames;
     89#endif
     90
    8991  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    9092  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     
    103105#if SVC_EXTENSION
    104106  , m_tgtLayerId(0)
    105 #endif
    106   , m_respectDefDispWindow(0)
    107107#if AVC_BASE
    108108  , m_iBLSourceWidth(0)
     
    114114  , m_iBLFrames(0)
    115115#endif
     116#endif
     117  , m_respectDefDispWindow(0)
    116118  {}
    117119  virtual ~TAppDecCfg() {}
  • branches/SHM-2.0-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r152 r154  
    157157#if AVC_BASE
    158158  TComPic pcBLPic;
    159   if( !m_pchBLReconFile )
    160   {
    161     printf( "Wrong base layer YUV input file\n" );
    162     exit(EXIT_FAILURE);
    163   }
    164   fstream streamYUV( m_pchBLReconFile, fstream::in | fstream::binary );
    165   if( !streamYUV.good() )
    166   {
    167     printf( "Base layer YUV input reading error\n" );
    168     exit(EXIT_FAILURE);
     159  fstream streamYUV;
     160  if( m_pchBLReconFile )
     161  {
     162    streamYUV.open( m_pchBLReconFile, fstream::in | fstream::binary );
    169163  }
    170164  TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic();
     
    174168  cListPic->pushBack( &pcBLPic );
    175169#if AVC_SYNTAX
    176   if( !m_pchBLSyntaxFile )
    177   {
    178     printf( "Wrong base layer syntax file\n" );
    179     exit(EXIT_FAILURE);
    180   }
    181   fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::in | fstream::binary );
    182   if( !streamSyntaxFile.good() )
    183   {
    184     printf( "Base layer syntax input reading error\n" );
    185     exit(EXIT_FAILURE);
     170  fstream streamSyntaxFile;
     171  if( m_pchBLSyntaxFile )
     172  {
     173    streamSyntaxFile.open( m_pchBLSyntaxFile, fstream::in | fstream::binary );
    186174  }
    187175  m_acTDecTop[0].setBLSyntaxFile( &streamSyntaxFile );
  • branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r146 r154  
    343343#endif
    344344  }
     345#if AVC_BASE
     346  string  cfg_BLInputFile;
     347#endif
    345348#if AVC_SYNTAX
    346349  string  cfg_BLSyntaxFile;
     
    399402
    400403#if AVC_BASE
    401   ("InputBLFile,-ibl",        *cfg_InputFile[0],     string(""), "Base layer rec YUV input file name")
     404  ("AvcBase",                 m_avcBaseLayerFlag,     0, "AVC_BASElayer_flag")
     405  ("InputBLFile,-ibl",        cfg_BLInputFile,     string(""), "Base layer rec YUV input file name")
    402406#if AVC_SYNTAX
    403407  ("InputBLSyntaxFile,-ibs",  cfg_BLSyntaxFile,     string(""), "Base layer syntax input file name")
     
    716720  ;
    717721 
     722#if AVC_BASE
     723  if( m_avcBaseLayerFlag )
     724  {
     725    *cfg_InputFile[0] = cfg_BLInputFile;
     726  }
     727#endif
     728
    718729  for(Int i=1; i<MAX_GOP+1; i++) {
    719730    std::ostringstream cOSS;
     
    19061917#if SVC_EXTENSION
    19071918  printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
    1908   printf("AVC_BASE:%d ", AVC_BASE);
     1919#if AVC_BASE
     1920  printf("AvcBase:%d ", m_avcBaseLayerFlag ? 1 : 0);
     1921#else
     1922  printf("AvcBase:%d ", 0);
     1923#endif
    19091924#if REF_IDX_FRAMEWORK
    19101925  printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK);
  • branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncCfg.h

    r133 r154  
    6767  UInt      m_FrameSkip;                                      ///< number of skipped frames from the beginning
    6868  Int       m_framesToBeEncoded;                              ///< number of encoded frames
     69#if AVC_BASE
     70  Int       m_avcBaseLayerFlag;                               ///< AVC_BASElayer_flag
     71#endif
    6972#if AVC_SYNTAX
    70   char*     m_BLSyntaxFile;                                   ///< input syntax file
     73  Char*     m_BLSyntaxFile;                                   ///< input syntax file
    7174#endif
    7275#else
  • branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r152 r154  
    112112
    113113#if REF_IDX_MFM
     114#if AVC_BASE
     115    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));
     116#else
    114117    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);
     118#endif
    115119#endif
    116120    // set layer ID
     
    805809#if VPS_EXTN_MASK_AND_DIM_INFO
    806810  UInt i = 0, dimIdLen = 0;
     811#if AVC_BASE
     812  vps->setAvcBaseLayerFlag(m_avcBaseLayerFlag);
     813#else
    807814  vps->setAvcBaseLayerFlag(false);
     815#endif
    808816  vps->setSplittingFlag(false);
    809817  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     
    931939
    932940#if AVC_SYNTAX
    933   if( !m_BLSyntaxFile )
    934   {
    935     printf( "Wrong base layer syntax input file\n" );
    936     exit(EXIT_FAILURE);
    937   }
    938   fstream streamSyntaxFile( m_BLSyntaxFile, fstream::in | fstream::binary );
    939   if( !streamSyntaxFile.good() )
    940   {
    941     printf( "Base layer syntax input reading error\n" );
    942     exit(EXIT_FAILURE);
    943   }
    944   m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile );
     941  fstream streamSyntaxFile;
     942  if( m_acTEncTop[0].getVPS()->getAvcBaseLayerFlag() )
     943  {
     944    if( !m_BLSyntaxFile )
     945    {
     946      printf( "Wrong base layer syntax input file\n" );
     947      exit(EXIT_FAILURE);
     948    }
     949    streamSyntaxFile.open( m_BLSyntaxFile, fstream::in | fstream::binary );
     950    if( !streamSyntaxFile.good() )
     951    {
     952      printf( "Base layer syntax input reading error\n" );
     953      exit(EXIT_FAILURE);
     954    }
     955    m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile );
     956  }
    945957#endif
    946958
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp

    r149 r154  
    16121612#endif
    16131613{
    1614 
    16151614  for( Int i = 0; i < MAX_TLAYER; i++)
    16161615  {
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h

    r152 r154  
    6666#define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
    6767
    68 #define AVC_BASE                         0      ///< YUV BL reading for AVC base SVC
    6968#define REF_IDX_FRAMEWORK                1      ///< inter-layer reference framework
    7069
     
    7574#define IDR_ALIGNMENT                    1      ///< align IDR picures across layers
    7675
     76#define AVC_BASE                         1      ///< YUV BL reading for AVC base SVC
    7777#if AVC_BASE
    78 #define AVC_SYNTAX                       1      ///< Syntax reading for AVC base
     78#define AVC_SYNTAX                       0      ///< Syntax reading for AVC base
    7979#endif
    8080
     
    8282#define REF_IDX_ME_ZEROMV                1      ///< L0051: use zero motion for inter-layer reference picture (without fractional ME)
    8383#define ENCODER_FAST_MODE                1      ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
    84 #if !AVC_BASE || AVC_SYNTAX
    8584#define REF_IDX_MFM                      1      ///< L0336: motion vector mapping of inter-layer reference picture
    86 #endif
    8785
    8886#if REF_IDX_MFM
  • branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r153 r154  
    581581  {
    582582#if AVC_BASE
    583   if( m_layerId == 1 )
     583  if( m_layerId == 1 && m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
    584584  {
    585585    TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
    586586    fstream* pFile  = m_ppcTDecTop[0]->getBLReconFile();
     587#if ILP_DECODED_PICTURE
     588    UInt uiWidth    = pBLPic->getPicYuvRec()->getWidth();
     589    UInt uiHeight   = pBLPic->getPicYuvRec()->getHeight();
     590#else
    587591    const Window &conf = pBLPic->getConformanceWindow();
    588592#if ILP_DECODED_PICTURE
     
    796800    {
    797801#if AVC_BASE
    798       pcSlice->setBaseColPic ( *m_ppcTDecTop[0]->getListPic()->begin() );
     802      if( m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )
     803      {
     804        pcSlice->setBaseColPic ( *m_ppcTDecTop[0]->getListPic()->begin() );
    799805#if AVC_SYNTAX
    800       TComPic* pBLPic = pcSlice->getBaseColPic();
    801       if( pcSlice->getPOC() == 0 )
    802       {
    803         // initialize partition order.
    804         UInt* piTmp = &g_auiZscanToRaster[0];
    805         initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );
    806         initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );
    807       }     
    808       pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );
    809       pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );
    810 #endif
    811 
     806        TComPic* pBLPic = pcSlice->getBaseColPic();
     807        if( pcSlice->getPOC() == 0 )
     808        {
     809          // initialize partition order.
     810          UInt* piTmp = &g_auiZscanToRaster[0];
     811          initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );
     812          initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );
     813        }     
     814        pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );
     815        pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );
     816#endif
     817      }
     818      else
     819      {
     820#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     821        TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId );
     822#else
     823        TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );
     824#endif
     825        TComList<TComPic*> *cListPic = pcTDecTop->getListPic();
     826        pcSlice->setBaseColPic ( *cListPic, m_layerId );
     827      }
    812828#else
    813829#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     
    837853      setILRPic(pcPic);
    838854#if REF_IDX_MFM
    839       pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
     855      if( pcSlice->getSPS()->getMFMEnabledFlag() )
     856      {
     857        pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
     858      }
    840859#endif
    841860#if REF_LIST_BUGFIX
     
    10791098    case NAL_UNIT_VPS:
    10801099      xDecodeVPS();
     1100#if AVC_BASE
     1101      if( m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
     1102      {
     1103        if( !m_ppcTDecTop[0]->getBLReconFile()->good() )
     1104        {
     1105          printf( "Base layer YUV input reading error\n" );
     1106          exit(EXIT_FAILURE);
     1107        }       
     1108#if AVC_SYNTAX
     1109        if( !m_ppcTDecTop[0]->getBLSyntaxFile()->good() )
     1110        {
     1111          printf( "Base layer syntax input reading error\n" );
     1112          exit(EXIT_FAILURE);
     1113        }
     1114#endif
     1115      }
     1116      else
     1117      {
     1118        TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic();
     1119        cListPic->clear();
     1120      }
     1121#endif
    10811122      return false;
    10821123     
     
    10841125      xDecodeSPS();
    10851126#if AVC_BASE
     1127      if( m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
    10861128      {
    10871129        TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r138 r154  
    11091109    startCUAddrSliceSegmentIdx++;
    11101110#if AVC_BASE
    1111     if( m_layerId == 0 )
     1111    if( m_layerId == 0 && m_pcEncTop->getVPS()->getAvcBaseLayerFlag() )
    11121112    {
    11131113      pcPic->getPicYuvOrg()->copyToPic( pcPic->getPicYuvRec() );
     
    12251225      OutputNALUnit nalu(NAL_UNIT_VPS, 0, m_layerId);
    12261226#if AVC_BASE
    1227       if( m_layerId == 1 )
     1227      if( ( m_layerId == 1 && m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) || ( m_layerId == 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) )
    12281228#else
    12291229      if( m_layerId == 0 )
Note: See TracChangeset for help on using the changeset viewer.