Ignore:
Timestamp:
30 Mar 2012, 18:57:41 (12 years ago)
Author:
poznan-univ
Message:

some bug fix on high level syntax
fixed some compiler warning issues under windows and linux

File:
1 edited

Legend:

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

    r41 r48  
    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
     
    326352  xWriteFlag( pcSPS->getUseSAO() ? 1 : 0);
    327353#endif
     354  if( pcSPS->getViewId() || pcSPS->isDepth() )
     355  {
     356    xWriteFlag( 0 ); // inverse of RBSP stop bit (for backwards compatible extension)
    328357#if POZNAN_DBMP
    329358          xWriteFlag( pcSPS->getDBMP() );
     
    332361          xWriteFlag( pcSPS->getUseCUSkip() );
    333362#endif
    334 
    335   if( pcSPS->getViewId() || pcSPS->isDepth() )
    336   {
    337     xWriteFlag( 0 ); // inverse of RBSP stop bit (for backwards compatible extension)
    338363    if( pcSPS->isDepth() )
    339364    {
     
    341366      xWriteUvlc( pcSPS->getViewId() );
    342367      xWriteSvlc( pcSPS->getViewOrderIdx() );
     368#if FLEXCO_CAMPARAM_IN_DEPTH
     369      if ( pcSPS->getViewId() != 0)
     370      {
     371        xWriteUvlc( pcSPS->getCamParPrecision() );
     372        xWriteFlag( pcSPS->hasCamParInSliceHeader() ? 1 : 0 );
     373        if( !pcSPS->hasCamParInSliceHeader() )
     374        {
     375          for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ )
     376          {
     377            xWriteSvlc( pcSPS->getCodedScale    ()[ uiId ] );
     378            xWriteSvlc( pcSPS->getCodedOffset   ()[ uiId ] );
     379            xWriteSvlc( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ] );
     380            xWriteSvlc( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ] );
     381          }
     382        }
     383      }
     384#endif
    343385#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    344386      xWriteFlag( pcSPS->getUseDMM() ? 1 : 0 );
     
    408450  // here someone can add an appropriated NalRefIdc type
    409451#if DCM_DECODING_REFRESH
     452#if BITSTREAM_EXTRACTION
     453  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, pcSlice->getLayerId());
     454#else
    410455  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, true);
     456#endif
     457#else
     458#if BITSTREAM_EXTRACTION
     459  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSlice->getLayerId());
    411460#else
    412461  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST);
     462#endif
    413463#endif
    414464
     
    784834    {
    785835#if POZNAN_DBMP
    786           if(bDBMPAvailable)
    787           {
    788                   if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
    789                   else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
    790                   else uiModIdx = uiIdx;
    791           }
    792           else uiModIdx = uiIdx;
    793           if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
    794           {
     836            if(bDBMPAvailable)
     837            {
     838                    if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
     839                    else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
     840                    else uiModIdx = uiIdx;
     841            }
     842            else uiModIdx = uiIdx;
     843            if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
     844            {
    795845        uiNumCand++;
    796846      }
Note: See TracChangeset for help on using the changeset viewer.