Changeset 1352 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 22 Jul 2015, 03:36:39 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp
r1259 r1352 123 123 } 124 124 125 /**126 * Write rbsp_trailing_bits to bs causing it to become byte-aligned127 */128 Void writeRBSPTrailingBits(TComOutputBitstream& bs)129 {130 bs.write( 1, 1 );131 bs.writeAlignZero();132 }133 134 125 //! \} -
branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.h
r1335 r1352 84 84 85 85 Void write(std::ostream& out, OutputNALUnit& nalu); 86 Void writeRBSPTrailingBits(TComOutputBitstream& bs);87 86 88 87 inline NALUnitEBSP::NALUnitEBSP(OutputNALUnit& nalu) -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1319 r1352 216 216 */ 217 217 #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)218 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComVPS *vps, const TComSPS *sps, Bool isNested, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei) 219 219 #else 220 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps )220 Void SEIWriter::writeSEImessages(TComBitIf& bs, const SEIMessages &seiList, const TComSPS *sps, Bool isNested) 221 221 #endif 222 222 { … … 276 276 xWriteSEIpayloadData(bs, **sei, sps); 277 277 #endif 278 } 279 if (!isNested) 280 { 281 xWriteRbspTrailingBits(); 278 282 } 279 283 } … … 793 797 794 798 // 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); 797 801 #else 798 writeSEImessages(bs, sei.m_nestedSEIs, sps );802 writeSEImessages(bs, sei.m_nestedSEIs, sps, true); 799 803 #endif 800 804 } … … 1145 1149 1146 1150 // 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); 1148 1152 } 1149 1153 -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1307 r1352 51 51 52 52 #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); 54 54 #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); 56 56 #endif 57 57 … … 64 64 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 65 65 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); 66 Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);67 66 #if SVC_EXTENSION 68 67 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); … … 71 70 #else 72 71 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps); 72 #endif 73 Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei); 74 #if !SVC_EXTENSION 73 75 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps); 74 76 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps); -
branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
r1259 r1352 142 142 } 143 143 144 Void 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 144 156 #if Q0096_OVERLAY_SEI 145 157 Void SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength) -
branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h
r1259 r1352 100 100 #endif 101 101 #endif 102 Void xWriteRbspTrailingBits(); 102 103 103 104 UInt xConvertToUInt ( Int iValue ) { return ( iValue <= 0) ? -iValue<<1 : (iValue<<1)-1; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1351 r1352 369 369 } // loop over PPS flags 370 370 } // pps_extension_present_flag is non-zero 371 xWriteRbspTrailingBits(); 371 372 } 372 373 … … 780 781 } 781 782 } 783 xWriteRbspTrailingBits(); 782 784 } 783 785 … … 891 893 #else 892 894 WRITE_FLAG( 0, "vps_extension_flag" ); 893 #endif 895 #endif 896 894 897 //future extensions here.. 895 896 return; 898 xWriteRbspTrailingBits(); 897 899 } 898 900 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1344 r1352 231 231 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 232 232 m_pcEntropyCoder->encodeVPS(vps); 233 writeRBSPTrailingBits(nalu.m_Bitstream);234 233 accessUnit.push_back(new NALUnitEBSP(nalu)); 235 234 return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8; … … 253 252 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 254 253 m_pcEntropyCoder->encodeSPS(sps); 255 writeRBSPTrailingBits(nalu.m_Bitstream);256 254 accessUnit.push_back(new NALUnitEBSP(nalu)); 257 255 return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8; … … 280 278 #else 281 279 m_pcEntropyCoder->encodePPS(pps); 282 #endif 283 writeRBSPTrailingBits(nalu.m_Bitstream); 280 #endif 284 281 accessUnit.push_back(new NALUnitEBSP(nalu)); 285 282 return (Int)(accessUnit.back()->m_nalUnitData.str().size()) * 8; … … 312 309 #if O0164_MULTI_LAYER_HRD 313 310 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); 315 312 #else 316 313 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 320 316 auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu)); 321 317 auPos++; … … 339 335 #if O0164_MULTI_LAYER_HRD 340 336 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); 342 338 #else 343 339 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 347 342 auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu)); 348 343 auPos++; … … 2577 2572 OutputNALUnit nalu(NAL_UNIT_PPS, 0, m_layerId); 2578 2573 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 ); 2581 2575 accessUnit.push_back(new NALUnitEBSP(nalu)); 2582 2576 }
Note: See TracChangeset for help on using the changeset viewer.