Changeset 54 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder


Ignore:
Timestamp:
2 Mar 2013, 09:25:00 (12 years ago)
Author:
seregin
Message:

port simulcast

Location:
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/NALread.cpp

    r51 r54  
    100100  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
    101101  nalu.m_reservedZero6Bits = bs.read(6);       // nuh_reserved_zero_6bits
     102#if SVC_EXTENSION
     103  nalu.m_layerId = nalu.m_reservedZero6Bits;
     104#else
    102105  assert(nalu.m_reservedZero6Bits == 0);
     106#endif
    103107  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
    104108
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r51 r54  
    697697  }
    698698  READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" );            pcSPS->setTMVPFlagsPresent(uiCode);
    699 
     699#if REF_IDX_MFM
     700  if(pcSPS->getLayerId() > 0)
     701  {
     702    READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" );
     703    pcSPS->setMFMEnabledFlag( uiCode ? true : false );
     704    assert(pcSPS->getMFMEnabledFlag());
     705  }
     706#endif
    700707  READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" );  pcSPS->setUseStrongIntraSmoothing(uiCode);
    701708
     
    19271934}
    19281935
     1936#if INTRA_BL
     1937Void TDecCavlc::parseIntraBLFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     1938{
     1939  assert(0);
     1940}
     1941#endif
     1942
    19291943//! \}
    19301944
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.h

    r51 r54  
    120120  Void updateContextTables  ( SliceType /*eSliceType*/, Int /*iQp*/ ) { return; }
    121121
     122#if INTRA_BL
     123  Void parseIntraBLFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     124#endif
     125
    122126  Void xParsePredWeightTable ( TComSlice* pcSlice );
    123127  Void  parseScalingList               ( TComScalingList* scalingList );
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCu.cpp

    r51 r54  
    3737
    3838#include "TDecCu.h"
     39#if SVC_EXTENSION
     40#include "TDecTop.h"
     41#endif
     42
    3943
    4044//! \ingroup TLibDecoder
     
    5660}
    5761
     62#if SVC_EXTENSION
     63Void TDecCu::init(TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, UInt layerId)
     64{
     65  m_pcEntropyDecoder  = pcEntropyDecoder;
     66  m_pcTrQuant         = pcTrQuant;
     67  m_pcPrediction      = pcPrediction;
     68  m_ppcTDecTop = ppcDecTop;
     69  m_layerId = layerId;
     70
     71  for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ )
     72  {
     73    m_ppcCU     [ui]->setLayerId(layerId);
     74  }
     75}
     76#else
    5877Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction)
    5978{
     
    6281  m_pcPrediction      = pcPrediction;
    6382}
     83#endif
    6484
    6585/**
     
    128148
    129149  // start from the top level CU
     150#if SVC_EXTENSION
     151  pcCU->setLayerId(m_layerId);
     152#endif
    130153  xDecodeCU( pcCU, 0, 0, ruiIsLast);
    131154}
     
    311334    return;
    312335  }
     336#if INTRA_BL
     337  m_pcEntropyDecoder->decodeIntraBLFlag( pcCU, uiAbsPartIdx, 0, uiDepth );
     338  if ( pcCU->isIntraBL( uiAbsPartIdx ) )
     339  {
     340    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     341  }
     342  else
     343  {
     344#endif
    313345
    314346  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
     
    325357    }
    326358  }
     359#if INTRA_BL
     360  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
     361  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
     362  }
     363#endif
    327364
    328365  UInt uiCurrWidth      = pcCU->getWidth ( uiAbsPartIdx );
    329366  UInt uiCurrHeight     = pcCU->getHeight( uiAbsPartIdx );
    330367 
     368#if !INTRA_BL
    331369  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
    332370  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
     371#endif
    333372 
    334373  // Coefficient decoding
     
    401440      xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
    402441      break;
     442#if INTRA_BL
     443    case MODE_INTRA_BL:
     444#if NO_RESIDUAL_FLAG_FOR_BLPRED
     445      xReconIntraBL( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     446#else
     447      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     448#endif
     449      break;
     450#endif
    403451    default:
    404452      assert(0);
     
    468516 
    469517  //===== get prediction signal =====
     518#if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
     519  if(pcCU->isIntraBL ( uiAbsPartIdx ) )
     520  {
     521    pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride );
     522  }
     523  else
     524#endif
    470525  m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    471526 
     
    552607 
    553608  //===== get prediction signal =====
     609#if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
     610  if(pcCU->isIntraBL ( uiAbsPartIdx ) )
     611  {
     612    pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId );
     613  }
     614  else
     615#endif
    554616  {
    555617    if( uiChromaPredMode == DM_CHROMA_IDX )
     
    869931}
    870932
     933#if NO_RESIDUAL_FLAG_FOR_BLPRED
     934Void
     935TDecCu::xReconIntraBL( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     936{
     937  m_ppcYuvReco[uiDepth]->copyFromPicLuma  ( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, pcCU->getWidth(0), pcCU->getHeight(0));
     938  m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 0);
     939  m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 1);
     940
     941  // inter recon
     942  xDecodeInterTexture( pcCU, 0, uiDepth );
     943
     944  // clip for only non-zero cbp case
     945  if  ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) )
     946  {
     947    m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );
     948  }
     949  else
     950  {
     951    m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));
     952  }
     953}
     954#endif
     955
    871956//! \}
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCu.h

    r51 r54  
    4949//! \ingroup TLibDecoder
    5050//! \{
     51#if SVC_EXTENSION
     52class TDecTop;
     53#endif
    5154
    5255// ====================================================================================================================
     
    6972
    7073  Bool                m_bDecodeDQP;
     74#if SVC_EXTENSION
     75  TDecTop**           m_ppcTDecTop;
     76  UInt                m_layerId;   
     77#endif
     78 
     79#if INTRA_BL
     80  TComPicYuv*         m_pcPicYuvRecBase;       ///< reconstructed base layer
     81#endif
    7182 
    7283public:
     
    7586 
    7687  /// initialize access channels
     88#if SVC_EXTENSION
     89  Void  init                    ( TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, UInt layerId );
     90#else
    7791  Void  init                    ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction );
     92#endif
    7893 
    7994  /// create internal buffers
     
    89104  Void  decompressCU            ( TComDataCU* pcCU );
    90105 
     106#if SVC_EXTENSION
     107  TDecTop*   getLayerDec        ( UInt LayerId )  { return m_ppcTDecTop[LayerId]; }
     108#if INTRA_BL
     109  Void  setBaseRecPic           ( TComPicYuv* p ) { m_pcPicYuvRecBase = p; }
     110#endif
     111#endif
    91112protected:
    92113 
     
    101122  Void  xIntraRecLumaBlk        ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv );
    102123  Void  xIntraRecChromaBlk      ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv, UInt uiChromaId );
     124#if NO_RESIDUAL_FLAG_FOR_BLPRED
     125  Void  xReconIntraBL           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     126#endif
    103127 
    104128  Void  xReconPCM               ( TComDataCU* pcCU, UInt uiDepth );
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecEntropy.cpp

    r51 r54  
    5858}
    5959
     60#if INTRA_BL
     61Void TDecEntropy::decodeIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     62{
     63  m_pcEntropyDecoderIf->parseIntraBLFlag( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth );
     64}
     65#endif
     66
    6067/** decode merge flag
    6168 * \param pcSubCU
     
    104111Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
    105112{
     113#if INTRA_BL
     114  if( pcCU->isIntraBL( uiAbsPartIdx ) )                                 // Do nothing for Intra BL mode.
     115  {
     116    return;
     117  }
     118#endif
    106119  if( pcCU->isIntra( uiAbsPartIdx ) )                                 // If it is Intra mode, encode intra prediction mode.
    107120  {
     
    175188      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    176189      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
     190#if REF_IDX_FRAMEWORK  // HM bug fix
     191      if(uiPartIdx)
     192      {
     193        for(UInt ui=0; ui<uiMergeIndex+1; ui++)
     194        {
     195          cMvFieldNeighbours[(ui<<1)].setMvField(TComMv(), NOT_VALID);
     196          cMvFieldNeighbours[(ui<<1)+1].setMvField(TComMv(), NOT_VALID);
     197        }
     198      }
     199#endif
    177200      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )
    178201      {
     
    437460   
    438461    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
     462#if INTRA_BL
     463#if NO_RESIDUAL_FLAG_FOR_BLPRED
     464    if( ( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx)) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     465#else
     466    if( ( !pcCU->isIntra(uiAbsPartIdx) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     467#endif
     468#else
    439469    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     470#endif
    440471    {
    441472      pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth );
     
    535566  UInt uiChromaOffset = uiLumaOffset>>2;
    536567 
     568#if NO_RESIDUAL_FLAG_FOR_BLPRED
     569  if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) )
     570#else
    537571  if( pcCU->isIntra(uiAbsPartIdx) )
     572#endif
    538573  {
    539574  }
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecEntropy.h

    r51 r54  
    102102  virtual Void parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0;
    103103  virtual Void parseTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType) = 0;
     104
     105#if INTRA_BL
     106  virtual Void parseIntraBLFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) = 0;
     107#endif
     108
    104109  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
    105110 
     
    157162  Void updateContextTables    ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); }
    158163 
     164#if INTRA_BL
     165  Void decodeIntraBLFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     166#endif
    159167 
    160168private:
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecGop.cpp

    r51 r54  
    4343#include "libmd5/MD5.h"
    4444#include "TLibCommon/SEI.h"
     45#if SVC_EXTENSION
     46#include "TDecTop.h"
     47#endif
    4548
    4649#include <time.h>
     
    6770}
    6871
     72#if SVC_EXTENSION
     73Void TDecGop::create(UInt layerId)
     74{
     75  m_layerId = layerId;
     76}
     77#else
    6978Void TDecGop::create()
    7079{
    7180 
    7281}
    73 
     82#endif
    7483
    7584Void TDecGop::destroy()
    7685{
    7786}
    78 
     87#if SVC_EXTENSION
     88Void TDecGop::init(TDecTop**               ppcDecTop,
     89                   TDecEntropy*            pcEntropyDecoder,
     90#else
    7991Void TDecGop::init( TDecEntropy*            pcEntropyDecoder,
     92#endif
    8093                   TDecSbac*               pcSbacDecoder,
    8194                   TDecBinCABAC*           pcBinCABAC,
     
    93106  m_pcLoopFilter          = pcLoopFilter;
    94107  m_pcSAO  = pcSAO;
     108#if SVC_EXTENSION   
     109  m_ppcTDecTop            = ppcDecTop;
     110#endif
    95111}
    96112
     
    210226
    211227  //-- For time output for each slice
     228#if SVC_EXTENSION
     229  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
     230                                                    rpcPic->getLayerId(),
     231                                                    pcSlice->getTLayer(),
     232                                                    c,
     233                                                    pcSlice->getSliceQp() );
     234#else
    212235  printf("\nPOC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
    213236                                                    pcSlice->getTLayer(),
    214237                                                    c,
    215238                                                    pcSlice->getSliceQp() );
    216 
     239#endif
    217240  m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;
    218241  printf ("[DT %6.3f] ", m_dDecTime );
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecGop.h

    r51 r54  
    8787  std::vector<Bool> m_LFCrossSliceBoundaryFlag;
    8888
     89#if SVC_EXTENSION
     90  UInt                  m_layerId;
     91  TDecTop**             m_ppcTDecTop;
     92#endif
    8993public:
    9094  TDecGop();
    9195  virtual ~TDecGop();
    9296 
     97#if SVC_EXTENSION
     98Void  init      ( TDecTop**               ppcDecTop,
     99                  TDecEntropy*            pcEntropyDecoder,
     100#else
    93101  Void  init    ( TDecEntropy*            pcEntropyDecoder,
     102#endif
    94103                 TDecSbac*               pcSbacDecoder,
    95104                 TDecBinCABAC*           pcBinCABAC,
     
    99108                 TComSampleAdaptiveOffset* pcSAO
    100109                 );
     110#if SVC_EXTENSION
     111  Void  create  (UInt layerId);
     112#else
    101113  Void  create  ();
     114#endif
    102115  Void  destroy ();
    103116  Void  decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic );
     
    105118
    106119  void setDecodedPictureHashSEIEnabled(Int enabled) { m_decodedPictureHashSEIEnabled = enabled; }
     120#if SVC_EXTENSION
     121  TDecTop*   getLayerDec(UInt LayerId)  { return m_ppcTDecTop[LayerId]; }
     122#endif
    107123
    108124};
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSbac.cpp

    r51 r54  
    7777, m_cTransformSkipSCModel     ( 1,             2,               NUM_TRANSFORMSKIP_FLAG_CTX    , m_contextModels + m_numContextModels, m_numContextModels)
    7878, m_CUTransquantBypassFlagSCModel( 1,          1,               NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
     79#if INTRA_BL
     80, m_cIntraBLPredFlagSCModel   (1,              1,               NUM_INTRA_BL_PRED_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     81#endif
    7982{
    8083  assert( m_numContextModels <= MAX_NUM_CTX_MOD );
     
    135138
    136139  m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
     140#if INTRA_BL
     141  m_cIntraBLPredFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRA_BL_PRED_FLAG );
     142#endif
    137143  m_cTransformSkipSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    138144  m_CUTransquantBypassFlagSCModel.initBuffer( sliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
     
    179185  m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
    180186  m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
     187#if INTRA_BL
     188  m_cIntraBLPredFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_BL_PRED_FLAG );
     189#endif
    181190  m_cTransformSkipSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    182191  m_CUTransquantBypassFlagSCModel.initBuffer( eSliceType, iQp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
     
    431440}
    432441
     442#if INTRA_BL
     443Void TDecSbac::parseIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     444{
     445  if( pcCU->getLayerId() == 0 )
     446  {
     447    return;
     448  }
     449
     450  UInt uiSymbol = 0;
     451
     452  UInt uiCtxIntraBL = pcCU->getCtxIntraBLFlag( uiAbsPartIdx ) ;
     453  m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraBLPredFlagSCModel.get( 0, 0, uiCtxIntraBL ));
     454  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     455  DTRACE_CABAC_T( "\tIntrBLFlag" );
     456  DTRACE_CABAC_T( "\tuiSymbol: ");
     457  DTRACE_CABAC_V( uiSymbol );
     458  DTRACE_CABAC_T( "\n");
     459
     460  if ( uiSymbol )
     461  {
     462    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     463    pcCU->setPredModeSubParts( MODE_INTRA_BL, uiAbsPartIdx, uiDepth );
     464    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
     465    pcCU->setLumaIntraDirSubParts ( DC_IDX, uiAbsPartIdx, uiDepth );   
     466  }
     467}
     468#endif
     469
    433470/** parse merge flag
    434471 * \param pcCU
     
    521558  PartSize eMode;
    522559 
     560#if INTRA_BL
     561  if ( pcCU->isIntraBL( uiAbsPartIdx ) )
     562  {
     563    assert( 0 );
     564  }
     565#endif
    523566  if ( pcCU->isIntra( uiAbsPartIdx ) )
    524567  {
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSbac.h

    r51 r54  
    131131  Void  parseScalingList ( TComScalingList* /*scalingList*/ ) {}
    132132
     133#if INTRA_BL
     134  Void parseIntraBLFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     135#endif
    133136private:
    134137  UInt m_uiLastDQpNonZero;
     
    167170  ContextModel3DBuffer m_cTransformSkipSCModel;
    168171  ContextModel3DBuffer m_CUTransquantBypassFlagSCModel;
     172#if INTRA_BL
     173  ContextModel3DBuffer m_cIntraBLPredFlagSCModel;
     174#endif
    169175};
    170176
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.cpp

    r51 r54  
    100100}
    101101
    102 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)
     102#if SVC_EXTENSION
     103Void TDecSlice::init(TDecTop** ppcDecTop,TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)
    103104{
    104105  m_pcEntropyDecoder  = pcEntropyDecoder;
    105106  m_pcCuDecoder       = pcCuDecoder;
    106 }
     107  m_ppcTDecTop        = ppcDecTop;
     108}
     109#else
     110Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)
     111{
     112  m_pcEntropyDecoder  = pcEntropyDecoder;
     113  m_pcCuDecoder       = pcCuDecoder;
     114}
     115#endif
    107116
    108117Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
     
    184193  UInt uiTileLCUX;
    185194  Int iNumSubstreamsPerTile = 1; // if independent.
     195#if INTRA_BL
     196  m_pcCuDecoder->setBaseRecPic( rpcPic->getLayerId() > 0 ? rpcPic->getFullPelBaseRec() : NULL);
     197#endif
    186198  Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag();
    187199  uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr();
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.h

    r51 r54  
    7272  TDecBinCABAC*   m_pcBufferLowLatBinCABACs;
    7373  std::vector<TDecSbac*> CTXMem;
     74#if SVC_EXTENSION
     75  TDecTop**       m_ppcTDecTop;
     76#endif
    7477 
    7578public:
     
    7780  virtual ~TDecSlice();
    7881 
     82#if SVC_EXTENSION 
     83  Void  init              ( TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder );
     84#else
    7985  Void  init              ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder );
     86#endif
    8087  Void  create            ();
    8188  Void  destroy           ();
     
    8491  Void      initCtxMem(  UInt i );
    8592  Void      setCtxMem( TDecSbac* sb, Int b )   { CTXMem[b] = sb; }
     93#if SVC_EXTENSION
     94  TDecTop*  getLayerDec   ( UInt LayerId )  { return m_ppcTDecTop[LayerId]; } 
     95#endif
    8696};
    8797
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp

    r51 r54  
    3939#include "TDecTop.h"
    4040
     41#if SVC_EXTENSION
     42ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder;  // storage for parameter sets
     43UInt  TDecTop::m_prevPOC = MAX_UINT;
     44UInt  TDecTop::m_uiPrevLayerId = MAX_UINT;
     45Bool  TDecTop::m_bFirstSliceInSequence = true;
     46#endif
     47
    4148//! \ingroup TLibDecoder
    4249//! \{
     
    5461  m_prevRAPisBLA = false;
    5562  m_pocRandomAccess = MAX_INT;         
     63#if !SVC_EXTENSION
    5664  m_prevPOC                = MAX_INT;
     65#endif
    5766  m_bFirstSliceInPicture    = true;
     67#if !SVC_EXTENSION
    5868  m_bFirstSliceInSequence   = true;
     69#endif
     70#if SVC_EXTENSION
     71  m_layerId = 0;
     72#if AVC_BASE
     73  m_pBLReconFile = NULL;
     74#endif
     75#endif
     76#if REF_IDX_FRAMEWORK
     77  memset(m_cIlpPic, 0, sizeof(m_cIlpPic));
     78#endif
     79#if AVC_SYNTAX || SYNTAX_OUTPUT
     80  m_pBLSyntaxFile = NULL;
     81#endif
     82
    5983}
    6084
     
    6892Void TDecTop::create()
    6993{
     94#if SVC_EXTENSION
     95  m_cGopDecoder.create( m_layerId );
     96#else
    7097  m_cGopDecoder.create();
     98#endif
    7199  m_apcSlicePilot = new TComSlice;
    72100  m_uiSliceIdx = 0;
     
    81109 
    82110  m_cSliceDecoder.destroy();
     111#if REF_IDX_FRAMEWORK
     112  for(Int i=0; i<MAX_NUM_REF; i++)
     113  {
     114    if(m_cIlpPic[i])
     115    {
     116      //m_cIlpPic[i]->setPicYuvRec(NULL);
     117      m_cIlpPic[i]->destroy();
     118      delete m_cIlpPic[i];
     119      m_cIlpPic[i] = NULL;
     120    }
     121  }   
     122#endif
    83123}
    84124
    85125Void TDecTop::init()
    86126{
     127#if !SVC_EXTENSION
    87128  // initialize ROM
    88129  initROM();
     130#endif
     131#if SVC_EXTENSION
     132  m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO);
     133  m_cSliceDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cCuDecoder );
     134#else
    89135  m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO);
    90136  m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder );
     137#endif
    91138  m_cEntropyDecoder.init(&m_cPrediction);
    92139}
     140
     141#if REF_IDX_FRAMEWORK
     142Void TDecTop::xInitILRP(TComSPS *pcSPS)
     143{
     144  if(m_layerId>0)
     145  {
     146    if (m_cIlpPic[0] == NULL)
     147    {
     148      for (Int j=0; j<1/*MAX_NUM_REF*/; j++)
     149      {
     150        m_cIlpPic[j] = new  TComPic;
     151        //m_cIlpPic[j]->createWithOutYuv(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true);
     152#if SVC_UPSAMPLING
     153        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSPS, true);
     154#else
     155        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
     156#endif
     157#if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || REF_IDX_MFM
     158        m_cIlpPic[j]->setIsILR(true);
     159#endif
     160        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++)
     161        {
     162          m_cIlpPic[j]->getPicSym()->getCU(i)->initCU(m_cIlpPic[j], i);
     163        }
     164      }
     165    }
     166  }
     167}
     168
     169Void TDecTop::setILRPic(TComPic *pcPic)
     170{
     171  if(m_cIlpPic[0])
     172  {
     173    //m_cIlpPic[0]->setPicYuvRec(pcPic->getFullPelBaseRec());
     174    m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec());
     175    m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC());
     176    m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false);
     177    m_cIlpPic[0]->getPicYuvRec()->extendPicBorder();
     178  }
     179}
     180#endif
    93181
    94182Void TDecTop::deletePicBuffer ( )
     
    100188  {
    101189    TComPic* pcPic = *(iterPic++);
     190#if SVC_EXTENSION
     191    if( pcPic )
     192    {
     193      pcPic->destroy();
     194
     195      delete pcPic;
     196      pcPic = NULL;
     197    }
     198#else
    102199    pcPic->destroy();
    103200   
    104201    delete pcPic;
    105202    pcPic = NULL;
     203#endif
    106204  }
    107205 
     
    110208  m_cLoopFilter.        destroy();
    111209 
     210#if !SVC_EXTENSION
    112211  // destroy ROM
    113212  destroyROM();
     213#endif
    114214}
    115215
     
    129229  {
    130230    rpcPic = new TComPic();
     231
     232#if SVC_EXTENSION //Temporal solution, should be modified
     233    if(m_layerId > 0)
     234    {
     235      TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 );
     236      //TComPic*                      pcPic = *(pcTDecTopBase->getListPic()->begin());
     237      TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec();
     238      if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() )
     239      {
     240        rpcPic->setSpatialEnhLayerFlag( true );
     241      }
     242    }
     243#endif
    131244   
     245#if SVC_UPSAMPLING
     246    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     247                     conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     248#else
    132249    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    133250                     conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     251#endif
    134252    rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    135253    m_cListPic.pushBack( rpcPic );
     
    152270    if ( rpcPic->getSlice( 0 )->isReferenced() == false  && rpcPic->getOutputMark() == false)
    153271    {
     272#if !SVC_EXTENSION
    154273      rpcPic->setOutputMark(false);
     274#endif
    155275      rpcPic->setReconMark( false );
    156276      rpcPic->getPicYuvRec()->setBorderExtension( false );
     
    168288  }
    169289  rpcPic->destroy();
     290
     291#if SVC_UPSAMPLING
     292  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     293                   conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     294
     295#else
    170296  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    171297                   conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     298#endif
    172299  rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    173300}
     
    187314  m_cGopDecoder.filterPicture(pcPic);
    188315
     316#if SYNTAX_OUTPUT
     317  pcPic->wrireBLSyntax( getBLSyntaxFile(), SYNTAX_BYTES );
     318#endif
    189319  TComSlice::sortPicList( m_cListPic ); // sorting for application output
    190320  poc                 = pcPic->getSlice(m_uiSliceIdx-1)->getPOC();
     
    202332  cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    203333  cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
     334#if SET_SLICE_LAYER_ID
     335  cFillSlice.initSlice( m_parameterSetManagerDecoder.getFirstSPS()->getLayerId() );
     336#else
    204337  cFillSlice.initSlice();
     338#endif
    205339  TComPic *cFillPic;
    206340  xGetNewPicBuffer(&cFillSlice,cFillPic);
    207341  cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    208342  cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
     343#if SET_SLICE_LAYER_ID
     344  cFillPic->getSlice(0)->initSlice( cFillPic->getLayerId() );
     345#else
    209346  cFillPic->getSlice(0)->initSlice();
     347#endif
    210348 
    211349  TComList<TComPic*>::iterator iterPic = m_cListPic.begin();
     
    256394  assert (sps != 0);
    257395
     396#if SVC_EXTENSION
     397  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->getIdrPicFlag(), m_apcSlicePilot->getLayerId() ))
     398#else
    258399  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->getIdrPicFlag()))
     400#endif
    259401  {
    260402    printf ("Parameter set activation failed!");
     
    283425}
    284426
     427#if SVC_EXTENSION
     428Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )
     429#else
    285430Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
     431#endif
    286432{
    287433  TComPic*&   pcPic         = m_pcPic;
     434#if SET_SLICE_LAYER_ID
     435  m_apcSlicePilot->initSlice( nalu.m_layerId );
     436#else
    288437  m_apcSlicePilot->initSlice();
     438#endif
    289439
    290440  if (m_bFirstSliceInPicture)
     
    324474
    325475  // exit when a new picture is found
     476#if SVC_EXTENSION
     477  bNewPOC = (m_apcSlicePilot->getPOC()!= m_prevPOC);
     478  if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence )
     479  {
     480    m_prevPOC = m_apcSlicePilot->getPOC();
     481    curLayerId = m_uiPrevLayerId;
     482    m_uiPrevLayerId = m_layerId;
     483    return true;
     484  }
     485#else
    326486  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence)
    327487  {
     
    333493    m_prevPOC = m_apcSlicePilot->getPOC();
    334494  }
     495#endif
    335496  // actual decoding starts here
    336497  xActivateParameterSets();
     
    339500  {
    340501    m_prevPOC = m_apcSlicePilot->getPOC();
     502#if SVC_EXTENSION
     503    curLayerId = m_layerId;
     504    m_uiPrevLayerId = m_layerId;
     505#endif
    341506  }
    342507  m_bFirstSliceInSequence = false;
     
    349514  if (m_bFirstSliceInPicture)
    350515  {
     516#if AVC_BASE
     517  if( m_layerId == 1 )
     518  {
     519    TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     520    fstream* pFile  = m_ppcTDecTop[0]->getBLReconFile();
     521    UInt uiWidth    = pBLPic->getPicYuvRec()->getWidth() - pBLPic->getPicYuvRec()->getPicCropLeftOffset() - pBLPic->getPicYuvRec()->getPicCropRightOffset();;
     522    UInt uiHeight   = pBLPic->getPicYuvRec()->getHeight() - pBLPic->getPicYuvRec()->getPicCropTopOffset() - pBLPic->getPicYuvRec()->getPicCropBottomOffset();
     523       
     524    if( pFile->good() )
     525    {
     526      UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2;
     527
     528      pFile->seekg((UInt)uiPos, ios::beg );
     529
     530      Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr();
     531      UInt uiStride = pBLPic->getPicYuvRec()->getStride();
     532      for( Int i = 0; i < uiHeight; i++ )
     533      {
     534        for( Int j = 0; j < uiWidth; j++ )
     535        {
     536          pPel[j] = pFile->get();
     537        }
     538        pPel += uiStride;
     539      }
     540
     541      pPel = pBLPic->getPicYuvRec()->getCbAddr();
     542      uiStride = pBLPic->getPicYuvRec()->getCStride();
     543      for( Int i = 0; i < uiHeight/2; i++ )
     544      {
     545        for( Int j = 0; j < uiWidth/2; j++ )
     546        {
     547          pPel[j] = pFile->get();
     548        }
     549        pPel += uiStride;
     550      }
     551
     552      pPel = pBLPic->getPicYuvRec()->getCrAddr();
     553      uiStride = pBLPic->getPicYuvRec()->getCStride();
     554      for( Int i = 0; i < uiHeight/2; i++ )
     555      {
     556        for( Int j = 0; j < uiWidth/2; j++ )
     557        {
     558          pPel[j] = pFile->get();
     559        }
     560        pPel += uiStride;
     561      }
     562    }
     563  }
     564#endif
     565
    351566    // Buffer initialize for prediction.
    352567    m_cPrediction.initTempBuff();
     
    361576    // Recursive structure
    362577    m_cCuDecoder.create ( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight );
     578#if SVC_EXTENSION
     579    m_cCuDecoder.init   ( m_ppcTDecTop,&m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, curLayerId );
     580#else
    363581    m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
     582#endif
    364583    m_cTrQuant.init     ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize());
    365584
     
    483702  pcPic->setTLayer(nalu.m_temporalId);
    484703
     704#if SVC_EXTENSION
     705  pcPic->setLayerId(nalu.m_layerId);
     706  pcSlice->setLayerId(nalu.m_layerId);
     707#endif
     708
    485709  if (bNextSlice)
    486710  {
    487711    pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA );
     712#if !REF_IDX_FRAMEWORK || AVC_SYNTAX
    488713    // Set reference list
    489714    pcSlice->setRefPicList( m_cListPic );
     715#endif
     716
     717#if SVC_EXTENSION   
     718    if(m_layerId > 0)
     719    {
     720#if AVC_BASE
     721      pcSlice->setBaseColPic ( *m_ppcTDecTop[0]->getListPic()->begin() );
     722#if AVC_SYNTAX
     723      TComPic* pBLPic = pcSlice->getBaseColPic();
     724      if( pcSlice->getPOC() == 0 )
     725      {
     726        // initialize partition order.
     727        UInt* piTmp = &g_auiZscanToRaster[0];
     728        initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );
     729        initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );
     730      }     
     731      pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );
     732      pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );
     733#endif
     734
     735#else
     736      TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );
     737      TComList<TComPic*> *cListPic = pcTDecTop->getListPic();
     738      pcSlice->setBaseColPic ( *cListPic, m_layerId );
     739#endif
     740#if SVC_UPSAMPLING
     741      if ( pcPic->isSpatialEnhLayer())
     742      {   
     743        m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
     744      }
     745      else
     746      {
     747        pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() );
     748      }
     749      pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() );
     750#endif
     751    }
     752#endif
     753
     754#if REF_IDX_FRAMEWORK
     755#if !AVC_SYNTAX
     756    // Set reference list
     757    pcSlice->setRefPicList( m_cListPic );
     758#endif
     759    if(m_layerId > 0)
     760    {
     761      setILRPic(pcPic);
     762#if REF_IDX_MFM
     763      pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
     764#endif
     765
     766      pcSlice->addRefPicList ( m_cIlpPic,
     767                               1,
     768                               ((pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) &&
     769                                (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ? 0: -1);
     770    }
     771#endif
    490772
    491773    // For generalized B
     
    590872{
    591873  TComSPS* sps = new TComSPS();
     874#if SVC_EXTENSION
     875  sps->setLayerId(m_layerId);
     876#endif
    592877  m_cEntropyDecoder.decodeSPS( sps );
    593878  m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
     879#if REF_IDX_MFM
     880  m_pcSPS = sps;
     881  setMFMEnabledFlag(sps->getMFMEnabledFlag());
     882#endif
     883#if REF_IDX_FRAMEWORK
     884  if(m_numLayer>0)
     885  {
     886    xInitILRP(sps);
     887  }
     888#endif
    594889}
    595890
     
    637932}
    638933
     934#if SVC_EXTENSION
     935Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC)
     936#else
    639937Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay)
     938#endif
    640939{
    641940  // Initialize entropy decoder
     
    651950    case NAL_UNIT_SPS:
    652951      xDecodeSPS();
     952#if AVC_BASE
     953      {
     954        TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     955        if( nalu.m_layerId == 1 && pBLPic->getPicYuvRec() == NULL )
     956        {
     957#if SVC_UPSAMPLING
     958#if AVC_SYNTAX
     959          TComSPS* sps = new TComSPS();
     960          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, sps, true);
     961#else
     962          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL, true);
     963#endif
     964#else
     965          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
     966#endif
     967        }
     968      }
     969#endif
    653970      return false;
    654971
     
    678995    case NAL_UNIT_CODED_SLICE_RASL_N:
    679996    case NAL_UNIT_CODED_SLICE_TFD:
     997#if SVC_EXTENSION
     998      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, curLayerId, bNewPOC);
     999#else
    6801000      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
     1001#endif
    6811002      break;
    6821003    default:
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.h

    r51 r54  
    7272
    7373  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
     74#if SVC_EXTENSION
     75  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     76#else
    7477  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     78#endif
     79
     80#if REF_IDX_MFM
     81  TComSPS*               m_pcSPS;
     82  Bool                   m_bMFMEnabledFlag;
     83#endif
     84
    7585  TComSlice*              m_apcSlicePilot;
    7686 
     
    95105  TComPic*                m_pcPic;
    96106  UInt                    m_uiSliceIdx;
     107#if !SVC_EXTENSION
    97108  Int                     m_prevPOC;
     109#endif
    98110  Bool                    m_bFirstSliceInPicture;
     111#if !SVC_EXTENSION
    99112  Bool                    m_bFirstSliceInSequence;
     113#endif
     114
     115#if SVC_EXTENSION
     116  static UInt             m_prevPOC;        // POC of the previous slice
     117  static UInt             m_uiPrevLayerId;  // LayerId of the previous slice
     118  static Bool             m_bFirstSliceInSequence;
     119  UInt                    m_layerId;     
     120  UInt                    m_numLayer;
     121  TDecTop**               m_ppcTDecTop;
     122#if AVC_BASE
     123  fstream*                m_pBLReconFile;
     124  Int                     m_iBLSourceWidth;
     125  Int                     m_iBLSourceHeight;
     126#endif
     127#endif
     128#if AVC_SYNTAX || SYNTAX_OUTPUT
     129  fstream*               m_pBLSyntaxFile;
     130#endif
     131#if REF_IDX_FRAMEWORK
     132  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
     133#endif
    100134
    101135public:
     
    109143
    110144  Void  init();
     145#if SVC_EXTENSION
     146  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
     147#else
    111148  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
     149#endif
    112150 
    113151  Void  deletePicBuffer();
    114152
    115153  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     154
     155#if SVC_EXTENSION
     156  UInt      getLayerId            () { return m_layerId;              }
     157  Void      setLayerId            (UInt layer) { m_layerId = layer; }
     158  UInt      getNumLayer           () { return m_numLayer;             }
     159  Void      setNumLayer           (UInt uiNum)   { m_numLayer = uiNum;  }
     160  TComList<TComPic*>*      getListPic() { return &m_cListPic; }
     161  Void                setLayerDec(TDecTop **p)    { m_ppcTDecTop = p; }
     162  TDecTop*            getLayerDec(UInt layer)   { return m_ppcTDecTop[layer]; }
     163#if AVC_BASE
     164  Void      setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; }
     165  fstream*  getBLReconFile() { return m_pBLReconFile; }
     166  Void      setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; }
     167  Int       getBLWidth() { return  m_iBLSourceWidth; }
     168  Int       getBLHeight() { return  m_iBLSourceHeight; }
     169#endif
     170#endif
     171#if AVC_SYNTAX || SYNTAX_OUTPUT
     172  Void      setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; }
     173  fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; }
     174#endif
     175#if REF_IDX_FRAMEWORK
     176  Void      xInitILRP(TComSPS *pcSPS);
     177  Void      setILRPic(TComPic *pcPic);
     178#endif
     179#if REF_IDX_MFM
     180  TComSPS*  getSPS()                       {return m_pcSPS;}
     181  Void      setMFMEnabledFlag(Bool flag)   {m_bMFMEnabledFlag = flag;}
     182  Bool      getMFMEnabledFlag()            {return m_bMFMEnabledFlag;}
     183#endif
    116184
    117185protected:
     
    120188
    121189  Void      xActivateParameterSets();
     190#if SVC_EXTENSION
     191  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
     192#else
    122193  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
     194#endif
    123195  Void      xDecodeVPS();
    124196  Void      xDecodeSPS();
Note: See TracChangeset for help on using the changeset viewer.