Changeset 40 in 3DVCSoftware for branches/0.3-ericsson/source/Lib/TLibEncoder


Ignore:
Timestamp:
25 Mar 2012, 13:04:30 (13 years ago)
Author:
ericsson
Message:

Ericsson integration: integrated bitstream extractor; implemented NALu header according to HEVC CD, using reserved_one_5bit as layer_id_plus1

Location:
branches/0.3-ericsson/source/Lib/TLibEncoder
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCavlc.cpp

    r5 r40  
    3939
    4040#include "TEncCavlc.h"
     41#include "../TLibCommon/SEI.h"
    4142#include "SEIwrite.h"
    4243
     
    228229void TEncCavlc::codeSEI(const SEI& sei)
    229230{
     231#if BITSTREAM_EXTRACTION
     232  codeNALUnitHeader( NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, 0, sei.getLayerId() );
     233#else
    230234  codeNALUnitHeader(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST);
     235#endif
    231236  writeSEImessage(*m_pcBitIf, sei);
    232237}
     
    235240{
    236241  // uiFirstByte
     242#if BITSTREAM_EXTRACTION
     243  codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcPPS->getLayerId() );
     244#else
    237245  codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST );
     246#endif
    238247
    239248  xWriteUvlc( pcPPS->getPPSId() );
     
    249258}
    250259
     260#if BITSTREAM_EXTRACTION
     261Void TEncCavlc::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, UInt uiLayerId )
     262{
     263  // uiFirstByte
     264  xWriteCode( 0, 1);                    // forbidden_zero_flag
     265  xWriteCode( eNalRefIdc==0 ? 0:1, 1);  // nal_ref_flag
     266  xWriteCode( eNalUnitType, 6);         // nal_unit_type
     267
     268  xWriteCode( TemporalId, 3);           // temporal_id
     269  xWriteCode( uiLayerId+1, 5);          // layer_id_plus1
     270}
     271#else
    251272Void TEncCavlc::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag )
    252273{
     
    263284  }
    264285}
     286#endif
    265287
    266288Void TEncCavlc::codeSPS( TComSPS* pcSPS )
    267289{
    268290  // uiFirstByte
     291#if BITSTREAM_EXTRACTION
     292  codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSPS->getLayerId() );
     293#else
    269294  codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST );
     295#endif
    270296
    271297  // Structure
     
    385411  // here someone can add an appropriated NalRefIdc type
    386412#if DCM_DECODING_REFRESH
     413#if BITSTREAM_EXTRACTION
     414  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, pcSlice->getLayerId());
     415#else
    387416  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, true);
     417#endif
     418#else
     419#if BITSTREAM_EXTRACTION
     420  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSlice->getLayerId());
    388421#else
    389422  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST);
     423#endif
    390424#endif
    391425
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCavlc.h

    r5 r40  
    206206  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    207207 
     208#if BITSTREAM_EXTRACTION
     209  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 );
     210#else
    208211  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true );
     212#endif
    209213 
    210214  Void  codeSPS                 ( TComSPS* pcSPS );
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCfg.h

    r34 r40  
    187187  //std::vector<int>  m_aiLayerQPOffset;
    188188
     189#if BITSTREAM_EXTRACTION
     190  UInt        m_uiLayerId;
     191#endif
    189192  UInt        m_uiViewId;
    190193  Int         m_iViewOrderIdx;
     
    238241  Void      setRateGOPSize                  ( Int   i )      { m_iRateGOPSize = i; }
    239242
     243#if BITSTREAM_EXTRACTION
     244  Void      setLayerId                      ( UInt  u )      { m_uiLayerId              = u; }
     245  UInt      getLayerId                      ( )              { return m_uiLayerId; }
     246#endif
    240247  Void      setViewId                       ( UInt  u )      { m_uiViewId               = u; }
    241248  Void      setViewOrderIdx                 ( Int   i )      { m_iViewOrderIdx          = i; }
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncEntropy.h

    r5 r40  
    7272  virtual UInt  getCoeffCost          ()                = 0;
    7373 
     74#if BITSTREAM_EXTRACTION
     75  virtual Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 ) = 0;
     76#else
    7477  virtual Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true ) = 0;
     78#endif
    7579
    7680  virtual Void  codeSPS                 ( TComSPS* pcSPS )                                      = 0;
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncGOP.cpp

    r5 r40  
    639639        seiBs.create(1024);
    640640        /* write the SEI messages */
     641#if BITSTREAM_EXTRACTION
     642        sei_recon_picture_digest.setLayerId( pcSlice->getLayerId() );
     643#endif
    641644        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
    642645        m_pcEntropyCoder->setBitstream(&seiBs);
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSbac.cpp

    r34 r40  
    177177}
    178178
     179#if BITSTREAM_EXTRACTION
     180Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, UInt uiLayerId )
     181#else
    179182Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag )
     183#endif
    180184{
    181185  assert (0);
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSbac.h

    r5 r40  
    8989  //--SBAC RD
    9090 
     91#if BITSTREAM_EXTRACTION
     92  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 );
     93#else
    9194  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true );
     95#endif
    9296
    9397  Void  codeSPS                 ( TComSPS* pcSPS     );
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSlice.cpp

    r21 r40  
    149149  rpcSlice->initSlice();
    150150  rpcSlice->setPOC( pcPic->getPOC() );
     151#if BITSTREAM_EXTRACTION
     152  rpcSlice->setLayerId( m_pcCfg->getLayerId() );
     153#endif
    151154#if SONY_COLPIC_AVAILABILITY
    152155  rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());
  • branches/0.3-ericsson/source/Lib/TLibEncoder/TEncTop.cpp

    r34 r40  
    546546  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
    547547
     548#if BITSTREAM_EXTRACTION
     549  m_cSPS.setLayerId( m_uiLayerId );
     550#endif
     551
    548552  if( m_bIsDepth )
    549553  {
     
    632636Void TEncTop::xInitPPS()
    633637{
     638#if BITSTREAM_EXTRACTION
     639  m_cPPS.setLayerId( m_uiLayerId );
     640#endif
     641
    634642  m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
    635643  m_cPPS.setPPSId( ( m_uiViewId << 1 ) + ( m_bIsDepth ? 1 : 0 ) );
Note: See TracChangeset for help on using the changeset viewer.