Changeset 1352 in SHVCSoftware


Ignore:
Timestamp:
22 Jul 2015, 03:36:39 (9 years ago)
Author:
seregin
Message:

port rev 4430

Location:
branches/SHM-dev/source/Lib
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitCounter.h

    r1259 r1352  
    6363
    6464  Void        write                 ( UInt /*uiBits*/, UInt uiNumberOfBits )  { m_uiBitCounter += uiNumberOfBits; }
    65   Void        resetBits             ()                                    { m_uiBitCounter = 0;               }
    66   UInt getNumberOfWrittenBits() const { return m_uiBitCounter; }
     65  Void        resetBits             ()                                        { m_uiBitCounter = 0;               }
     66  UInt        getNumberOfWrittenBits() const                                  { return m_uiBitCounter; }
     67  Int         getNumBitsUntilByteAligned() const                              { return (8 - m_uiBitCounter) & 0x7;}
     68
    6769};
    6870
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h

    r1319 r1352  
    6363  virtual Void        write                 ( UInt uiBits, UInt uiNumberOfBits )  = 0;
    6464  virtual Void        resetBits             ()                                    = 0;
    65   virtual UInt getNumberOfWrittenBits() const = 0;
     65  virtual UInt        getNumberOfWrittenBits() const = 0;
     66  virtual Int         getNumBitsUntilByteAligned() const = 0;
    6667  virtual ~TComBitIf() {}
    6768};
     
    130131   * achieve byte alignment.
    131132   */
    132   Int getNumBitsUntilByteAligned() { return (8 - m_num_held_bits) & 0x7; }
     133  Int getNumBitsUntilByteAligned() const { return (8 - m_num_held_bits) & 0x7; }
    133134
    134135  /**
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1319 r1352  
    139139  while (m_pcBitstream->getNumBitsLeft() > 8);
    140140
    141   UInt rbspTrailingBits;
    142   sei_read_code(NULL, 8, rbspTrailingBits, "rbsp_trailing_bits");
    143   assert(rbspTrailingBits == 0x80);
     141  xReadRbspTrailingBits();
    144142}
    145143
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1351 r1352  
    492492    }
    493493  }
     494  xReadRbspTrailingBits();
    494495}
    495496
     
    10261027    }
    10271028  }
     1029
     1030  xReadRbspTrailingBits();
    10281031}
    10291032
     
    11781181#endif
    11791182
    1180   return;
     1183  xReadRbspTrailingBits();
    11811184}
    11821185
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp

    r1259 r1352  
    123123}
    124124
    125 /**
    126  * Write rbsp_trailing_bits to bs causing it to become byte-aligned
    127  */
    128 Void writeRBSPTrailingBits(TComOutputBitstream& bs)
    129 {
    130   bs.write( 1, 1 );
    131   bs.writeAlignZero();
    132 }
    133 
    134125//! \}
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.h

    r1335 r1352  
    8484
    8585Void write(std::ostream& out, OutputNALUnit& nalu);
    86 Void writeRBSPTrailingBits(TComOutputBitstream& bs);
    8786
    8887inline NALUnitEBSP::NALUnitEBSP(OutputNALUnit& nalu)
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r1319 r1352  
    216216 */
    217217#if O0164_MULTI_LAYER_HRD
    218 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
     218Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComVPS *vps, const TComSPS *sps, Bool isNested, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
    219219#else
    220 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps)
     220Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps, Bool isNested)
    221221#endif
    222222{
     
    276276    xWriteSEIpayloadData(bs, **sei, sps);
    277277#endif
     278  }
     279  if (!isNested)
     280  {
     281    xWriteRbspTrailingBits();
    278282  }
    279283}
     
    793797
    794798  // write nested SEI messages
    795 #if O0164_MULTI_LAYER_HRD 
    796   writeSEImessages(bs, sei.m_nestedSEIs, vps, sps, &sei);
     799#if O0164_MULTI_LAYER_HRD
     800  writeSEImessages(bs, sei.m_nestedSEIs, vps, sps, true, &sei);
    797801#else
    798   writeSEImessages(bs, sei.m_nestedSEIs, sps);
     802  writeSEImessages(bs, sei.m_nestedSEIs, sps, true);
    799803#endif
    800804}
     
    11451149 
    11461150  // write nested SEI messages
    1147   writeSEImessages(bs, sei.m_nestedSEIs, vps, sps, &nestingSei, &sei);
     1151  writeSEImessages(bs, sei.m_nestedSEIs, vps, sps, true, &nestingSei, &sei);
    11481152}
    11491153
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h

    r1307 r1352  
    5151
    5252#if O0164_MULTI_LAYER_HRD
    53   Void writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);
     53  Void writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComVPS *vps, const TComSPS *sps, Bool isNested, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);
    5454#else
    55   Void writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps);
     55  Void writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps, Bool isNested);
    5656#endif
    5757
     
    6464  Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
    6565  Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
    66   Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
    6766#if SVC_EXTENSION
    6867  Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps);
     
    7170#else
    7271  Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps);
     72#endif
     73  Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
     74#if !SVC_EXTENSION
    7375  Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps);
    7476  Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps);
  • branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp

    r1259 r1352  
    142142}
    143143
     144Void SyntaxElementWriter::xWriteRbspTrailingBits()
     145{
     146  WRITE_FLAG( 1, "rbsp_stop_one_bit");
     147  Int cnt = 0;
     148  while (m_pcBitIf->getNumBitsUntilByteAligned())
     149  {
     150    WRITE_FLAG( 0, "rbsp_alignment_zero_bit");
     151    cnt++;
     152  }
     153  assert(cnt<8);
     154}
     155
    144156#if Q0096_OVERLAY_SEI
    145157Void  SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength)
  • branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h

    r1259 r1352  
    100100#endif
    101101#endif
     102  Void xWriteRbspTrailingBits();
    102103
    103104  UInt  xConvertToUInt        ( Int iValue ) {  return ( iValue <= 0) ? -iValue<<1 : (iValue<<1)-1; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1351 r1352  
    369369    } // loop over PPS flags
    370370  } // pps_extension_present_flag is non-zero
     371  xWriteRbspTrailingBits();
    371372}
    372373
     
    780781    }
    781782  }
     783  xWriteRbspTrailingBits();
    782784}
    783785
     
    891893#else
    892894  WRITE_FLAG( 0,                     "vps_extension_flag" );
    893 #endif 
     895#endif   
     896
    894897  //future extensions here..
    895 
    896   return;
     898  xWriteRbspTrailingBits();
    897899}
    898900
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1344 r1352  
    231231  m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    232232  m_pcEntropyCoder->encodeVPS(vps);
    233   writeRBSPTrailingBits(nalu.m_Bitstream);
    234233  accessUnit.push_back(new NALUnitEBSP(nalu));
    235234  return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
     
    253252  m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    254253  m_pcEntropyCoder->encodeSPS(sps);
    255   writeRBSPTrailingBits(nalu.m_Bitstream);
    256254  accessUnit.push_back(new NALUnitEBSP(nalu));
    257255  return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
     
    280278#else
    281279  m_pcEntropyCoder->encodePPS(pps);
    282 #endif
    283   writeRBSPTrailingBits(nalu.m_Bitstream);
     280#endif 
    284281  accessUnit.push_back(new NALUnitEBSP(nalu));
    285282  return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
     
    312309#if O0164_MULTI_LAYER_HRD
    313310  OutputNALUnit nalu(naluType, temporalId, sps->getLayerId());
    314   m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, vps, sps, nestingSei, bspNestingSei);
     311  m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, vps, sps, false, nestingSei, bspNestingSei);
    315312#else
    316313  OutputNALUnit nalu(naluType, temporalId);
    317   m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, sps);
    318 #endif
    319   writeRBSPTrailingBits(nalu.m_Bitstream);
     314  m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, sps, false);
     315#endif 
    320316  auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu));
    321317  auPos++;
     
    339335#if O0164_MULTI_LAYER_HRD
    340336    OutputNALUnit nalu(naluType, temporalId, sps->getLayerId());
    341     m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, vps, sps, nestingSei, bspNestingSei);
     337    m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, vps, sps, false, nestingSei, bspNestingSei);
    342338#else
    343339    OutputNALUnit nalu(naluType, temporalId);
    344     m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, sps);
    345 #endif
    346     writeRBSPTrailingBits(nalu.m_Bitstream);
     340    m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, sps, false);
     341#endif
    347342    auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu));
    348343    auPos++;
     
    25772572      OutputNALUnit nalu(NAL_UNIT_PPS, 0, m_layerId);
    25782573      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    2579       m_pcEntropyCoder->encodePPS(pcSlice->getPPS() , &m_Enc3DAsymLUTPPS );
    2580       writeRBSPTrailingBits(nalu.m_Bitstream);
     2574      m_pcEntropyCoder->encodePPS(pcSlice->getPPS() , &m_Enc3DAsymLUTPPS );     
    25812575      accessUnit.push_back(new NALUnitEBSP(nalu));
    25822576    }
Note: See TracChangeset for help on using the changeset viewer.