Changeset 1352 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder


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

port rev 4430

Location:
branches/SHM-dev/source/Lib/TLibEncoder
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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.