Ticket #1283: check_zero.patch

File check_zero.patch, 4.9 KB (added by PhuongNguyen, 10 years ago)

source code patch

  • source/Lib/TLibDecoder/TDecCAVLC.cpp

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecCAVLC.cpp,v
    retrieving revision 1.1.2.57
    diff -u -r1.1.2.57 TDecCAVLC.cpp
     
    14331433    }
    14341434  }
    14351435}
     1436Void TDecCavlc::parseRemainingBytes()
     1437{
     1438  UInt tmp;
     1439  if (m_pcBitstream->getNumBitsLeft() > 0)
     1440  {
     1441    tmp = m_pcBitstream->readByte();
     1442    assert (tmp == 0);
     1443  }
     1444}
    14361445
    14371446Void TDecCavlc::parseSkipFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    14381447{
  • source/Lib/TLibDecoder/TDecCAVLC.h

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecCAVLC.h,v
    retrieving revision 1.1.2.39
    diff -u -r1.1.2.39 TDecCAVLC.h
     
    8080  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    8181  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager);
    8282  Void  parseTerminatingBit ( UInt& ruiBit );
    83  
     83  Void  parseRemainingBytes ();
     84
    8485  Void  parseMVPIdx         ( Int& riMVPIdx );
    8586 
    8687  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • source/Lib/TLibDecoder/TDecCu.cpp

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecCu.cpp,v
    retrieving revision 1.1.2.44
    diff -u -r1.1.2.44 TDecCu.cpp
     
    171171 
    172172  if(uiIsLast)
    173173  {
     174    // check that remaining bytes are zero
     175    m_pcEntropyDecoder->decodeRemainingBytes();
    174176    if(pcSlice->isNextSliceSegment()&&!pcSlice->isNextSlice())
    175177    {
    176178      pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts);
  • source/Lib/TLibDecoder/TDecEntropy.h

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecEntropy.h,v
    retrieving revision 1.1.2.34
    diff -u -r1.1.2.34 TDecEntropy.h
     
    7171  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)       = 0;
    7272
    7373  virtual Void  parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
    74  
     74
     75  virtual Void parseRemainingBytes () = 0;
     76
    7577  virtual Void parseMVPIdx        ( Int& riMVPIdx ) = 0;
    7678 
    7779public:
     
    133135  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager);         }
    134136
    135137  Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
    136  
     138
     139  Void    decodeRemainingBytes () {m_pcEntropyDecoderIf->parseRemainingBytes();};
     140
    137141  TDecEntropyIf* getEntropyDecoder() { return m_pcEntropyDecoderIf; }
    138142 
    139143public:
  • source/Lib/TLibDecoder/TDecSbac.cpp

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecSbac.cpp,v
    retrieving revision 1.1.2.43
    diff -u -r1.1.2.43 TDecSbac.cpp
     
    190190  }
    191191}
    192192
     193Void TDecSbac::parseRemainingBytes()
     194{
     195  UInt tmp;
     196  if (m_pcBitstream->getNumBitsLeft() > 0)
     197  {
     198    tmp = m_pcBitstream->readByte();
     199    assert (tmp == 0);
     200  }
     201}
    193202
    194203Void TDecSbac::xReadUnaryMaxSymbol( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol )
    195204{
  • source/Lib/TLibDecoder/TDecSbac.h

    RCS file: /designs/cvsroot/codec_tools/hevc/HM/source/Lib/TLibDecoder/TDecSbac.h,v
    retrieving revision 1.1.2.34
    diff -u -r1.1.2.34 TDecSbac.h
     
    8080
    8181  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
    8282  Void  parseTerminatingBit       ( UInt& ruiBit );
     83  Void  parseRemainingBytes ();
    8384  Void  parseMVPIdx               ( Int& riMVPIdx          );
    8485  Void  parseSaoMaxUvlc           ( UInt& val, UInt maxSymbol );
    8586  Void  parseSaoMerge         ( UInt&  ruiVal   );