Changeset 40 in 3DVCSoftware for branches/0.3-ericsson/source
- Timestamp:
- 25 Mar 2012, 13:04:30 (13 years ago)
- Location:
- branches/0.3-ericsson/source
- Files:
-
- 9 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-ericsson/source/App/TAppEncoder/TAppEncTop.cpp
r34 r40 145 145 #endif 146 146 147 #if BITSTREAM_EXTRACTION 148 m_acTEncTopList[iViewIdx]->setLayerId ( ( (UInt)iViewIdx ) << 1 ); 149 #endif 147 150 m_acTEncTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 148 151 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); … … 337 340 #endif 338 341 342 #if BITSTREAM_EXTRACTION 343 m_acTEncDepthTopList[iViewIdx]->setLayerId ( ( ( (UInt)iViewIdx ) << 1 ) + 1 ); 344 #endif 339 345 m_acTEncDepthTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 340 346 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); -
branches/0.3-ericsson/source/Lib/TLibCommon/SEI.h
r5 r40 41 41 class SEI 42 42 { 43 #if BITSTREAM_EXTRACTION 44 protected: 45 UInt m_uiLayerId; 46 #endif 47 43 48 public: 44 49 enum PayloadType { … … 51 56 52 57 virtual PayloadType payloadType() const = 0; 58 59 #if BITSTREAM_EXTRACTION 60 Void setLayerId ( UInt u ) { m_uiLayerId = u; } 61 UInt getLayerId () const { return m_uiLayerId; } 62 #endif 53 63 }; 54 64 -
branches/0.3-ericsson/source/Lib/TLibCommon/TComBitStream.cpp
r5 r40 61 61 m_auiSliceByteLocation = NULL; 62 62 m_uiSliceCount = 0; 63 #if BITSTREAM_EXTRACTION 64 m_apulPacketPayloadBuffer = new UInt[uiSize]; 65 m_uiPacketPayloadSize = 0; 66 #endif 63 67 } 64 68 … … 66 70 { 67 71 delete [] m_apulStreamPacketBegin; m_apulStreamPacketBegin = NULL; 72 #if BITSTREAM_EXTRACTION 73 delete [] m_apulPacketPayloadBuffer; m_apulPacketPayloadBuffer = NULL; 74 #endif 68 75 } 69 76 … … 148 155 xReadNextWord(); 149 156 } 157 158 #if BITSTREAM_EXTRACTION 159 UInt TComBitstream::reinitParsing() 160 { 161 rewindStreamPacket(); 162 memcpy( m_apulStreamPacketBegin, m_apulPacketPayloadBuffer, m_uiPacketPayloadSize ); 163 initParsing( m_uiPacketPayloadSize ); 164 return m_uiPacketPayloadSize; 165 } 166 #endif 150 167 151 168 #if LCEC_INTRA_MODE || QC_LCEC_INTER_MODE … … 319 336 UChar* pucWrite = reinterpret_cast<UChar*> (getBuffer()); 320 337 338 #if BITSTREAM_EXTRACTION 339 memcpy( m_apulPacketPayloadBuffer, m_apulStreamPacketBegin, uiBytesRead ); 340 m_uiPacketPayloadSize = uiBytesRead; 341 #endif 342 321 343 for( ; uiReadOffset < uiBytesRead; uiReadOffset++ ) 322 344 { -
branches/0.3-ericsson/source/Lib/TLibCommon/TComBitStream.h
r5 r40 85 85 UInt m_uiSliceProcessed; 86 86 87 #if BITSTREAM_EXTRACTION 88 UInt* m_apulPacketPayloadBuffer; 89 UInt m_uiPacketPayloadSize; 90 #endif 91 87 92 UInt xSwap ( UInt ui ) 88 93 { … … 164 169 165 170 void insertAt(const TComBitstream& src, unsigned pos); 171 172 #if BITSTREAM_EXTRACTION 173 UInt reinitParsing(); 174 #endif 166 175 }; 167 176 -
branches/0.3-ericsson/source/Lib/TLibCommon/TComSlice.cpp
r34 r40 66 66 m_iViewIdx = 0 ; 67 67 68 #if BITSTREAM_EXTRACTION 69 m_uiLayerId = 0; 70 #endif 71 68 72 #if SONY_COLPIC_AVAILABILITY 69 73 m_iViewOrderIdx = 0; … … 659 663 m_bUseMVI = false; 660 664 #endif 661 665 666 #if BITSTREAM_EXTRACTION 667 m_uiLayerId = 0; 668 #endif 662 669 m_uiViewId = 0; 663 670 m_iViewOrderIdx = 0; … … 698 705 TComPPS::TComPPS() 699 706 { 707 #if BITSTREAM_EXTRACTION 708 m_uiLayerId = 0; 709 #endif 700 710 #if CONSTRAINED_INTRA_PRED 701 711 m_bConstrainedIntraPred = false; -
branches/0.3-ericsson/source/Lib/TLibCommon/TComSlice.h
r34 r40 76 76 UInt m_uiMaxTrDepth; 77 77 78 #if BITSTREAM_EXTRACTION 79 UInt m_uiLayerId; 80 #endif 78 81 UInt m_uiViewId; 79 82 Int m_iViewOrderIdx; … … 311 314 TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } 312 315 #endif 316 317 #if BITSTREAM_EXTRACTION 318 Void setLayerId ( UInt u ) { m_uiLayerId = u; } 319 UInt getLayerId () { return m_uiLayerId; } 320 #endif 313 321 }; 314 322 … … 326 334 UInt m_uiPPSId; 327 335 UInt m_uiSPSId; 336 #if BITSTREAM_EXTRACTION 337 UInt m_uiLayerId; 338 #endif 328 339 329 340 public: … … 346 357 Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } 347 358 Void setWPBiPredIdc ( UInt u ) { m_uiBiPredIdc = u; } 359 #endif 360 361 #if BITSTREAM_EXTRACTION 362 Void setLayerId ( UInt u ) { m_uiLayerId = u; } 363 UInt getLayerId () { return m_uiLayerId; } 348 364 #endif 349 365 }; … … 376 392 UInt m_uiPPSId; 377 393 Int m_iPOC; 394 #if BITSTREAM_EXTRACTION 395 UInt m_uiLayerId; 396 #endif 378 397 #if SONY_COLPIC_AVAILABILITY 379 398 Int m_iViewOrderIdx; … … 540 559 Void setLambda( Double d ) { m_dLambda = d; } 541 560 Double getLambda() { return m_dLambda; } 561 562 #if BITSTREAM_EXTRACTION 563 Void setLayerId( UInt u ) { m_uiLayerId = u; } 564 UInt getLayerId() { return m_uiLayerId; } 565 #endif 542 566 543 567 Void setViewIdx(Int i) { m_iViewIdx = i; } -
branches/0.3-ericsson/source/Lib/TLibCommon/TypeDef.h
r34 r40 40 40 41 41 42 #define BITSTREAM_EXTRACTION 1 43 42 44 #define FLEX_CODING_ORDER 1 43 45 -
branches/0.3-ericsson/source/Lib/TLibDecoder/TDecCAVLC.cpp
r5 r40 82 82 // ==================================================================================================================== 83 83 84 #if BITSTREAM_EXTRACTION 85 Void TDecCavlc::parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) 86 { 87 UInt uiCode; 88 89 xReadCode ( 1, uiCode ); assert( 0 == uiCode); // forbidden_zero_bit 90 xReadCode ( 1, uiCode ); // nal_ref_flag 91 xReadCode ( 6, uiCode ); // nal_unit_type 92 eNalUnitType = (NalUnitType) uiCode; 93 94 xReadCode(3, uiCode); // temporal_id 95 TemporalId = uiCode; 96 xReadCode(5, uiCode); // layer_id_plus1 97 assert( 1 <= uiCode ); 98 uiLayerId = uiCode - 1; 99 } 100 #else 84 101 Void TDecCavlc::parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) 85 102 { … … 105 122 } 106 123 } 124 #endif 107 125 108 126 /** -
branches/0.3-ericsson/source/Lib/TLibDecoder/TDecCAVLC.h
r5 r40 182 182 #endif 183 183 184 #if BITSTREAM_EXTRACTION 185 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ); 186 #else 184 187 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ); 188 #endif 189 185 190 186 191 Void parseSPS ( TComSPS* pcSPS ); -
branches/0.3-ericsson/source/Lib/TLibDecoder/TDecEntropy.h
r5 r40 67 67 virtual Void setBitstream ( TComBitstream* p ) = 0; 68 68 69 #if BITSTREAM_EXTRACTION 70 virtual Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) = 0; 71 #else 69 72 virtual Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) = 0; 73 #endif 70 74 71 75 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; … … 147 151 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 148 152 153 #if BITSTREAM_EXTRACTION 154 Void decodeNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) 155 { m_pcEntropyDecoderIf->parseNalUnitHeader( eNalUnitType, TemporalId, uiLayerId ); } 156 #else 149 157 Void decodeNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) 150 158 { m_pcEntropyDecoderIf->parseNalUnitHeader(eNalUnitType, TemporalId, bOutputFlag ); } 151 159 #endif 152 160 153 161 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } -
branches/0.3-ericsson/source/Lib/TLibDecoder/TDecSbac.h
r5 r40 75 75 Void setMaxAlfCtrlDepth ( UInt uiMaxAlfCtrlDepth ) { m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth; } 76 76 77 #if BITSTREAM_EXTRACTION 78 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) {} 79 #else 77 80 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) {} 81 #endif 78 82 79 83 Void parseSPS ( TComSPS* pcSPS ) {} -
branches/0.3-ericsson/source/Lib/TLibDecoder/TDecTop.cpp
r34 r40 535 535 NalUnitType eNalUnitType; 536 536 UInt TemporalId; 537 538 #if BITSTREAM_EXTRACTION 539 UInt uiLayerId; 540 541 m_cEntropyDecoder.decodeNalUnitHeader(eNalUnitType, TemporalId, uiLayerId); 542 #else 537 543 Bool OutputFlag; 538 544 539 545 m_cEntropyDecoder.decodeNalUnitHeader(eNalUnitType, TemporalId, OutputFlag); 546 #endif 547 540 548 reNalUnitType = eNalUnitType; 541 549 -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCavlc.cpp
r5 r40 39 39 40 40 #include "TEncCavlc.h" 41 #include "../TLibCommon/SEI.h" 41 42 #include "SEIwrite.h" 42 43 … … 228 229 void TEncCavlc::codeSEI(const SEI& sei) 229 230 { 231 #if BITSTREAM_EXTRACTION 232 codeNALUnitHeader( NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, 0, sei.getLayerId() ); 233 #else 230 234 codeNALUnitHeader(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST); 235 #endif 231 236 writeSEImessage(*m_pcBitIf, sei); 232 237 } … … 235 240 { 236 241 // uiFirstByte 242 #if BITSTREAM_EXTRACTION 243 codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcPPS->getLayerId() ); 244 #else 237 245 codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST ); 246 #endif 238 247 239 248 xWriteUvlc( pcPPS->getPPSId() ); … … 249 258 } 250 259 260 #if BITSTREAM_EXTRACTION 261 Void 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 251 272 Void TEncCavlc::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag ) 252 273 { … … 263 284 } 264 285 } 286 #endif 265 287 266 288 Void TEncCavlc::codeSPS( TComSPS* pcSPS ) 267 289 { 268 290 // uiFirstByte 291 #if BITSTREAM_EXTRACTION 292 codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSPS->getLayerId() ); 293 #else 269 294 codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST ); 295 #endif 270 296 271 297 // Structure … … 385 411 // here someone can add an appropriated NalRefIdc type 386 412 #if DCM_DECODING_REFRESH 413 #if BITSTREAM_EXTRACTION 414 codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, pcSlice->getLayerId()); 415 #else 387 416 codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, true); 417 #endif 418 #else 419 #if BITSTREAM_EXTRACTION 420 codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSlice->getLayerId()); 388 421 #else 389 422 codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST); 423 #endif 390 424 #endif 391 425 -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCavlc.h
r5 r40 206 206 UInt getCoeffCost () { return m_uiCoeffCost; } 207 207 208 #if BITSTREAM_EXTRACTION 209 Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 ); 210 #else 208 211 Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true ); 212 #endif 209 213 210 214 Void codeSPS ( TComSPS* pcSPS ); -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncCfg.h
r34 r40 187 187 //std::vector<int> m_aiLayerQPOffset; 188 188 189 #if BITSTREAM_EXTRACTION 190 UInt m_uiLayerId; 191 #endif 189 192 UInt m_uiViewId; 190 193 Int m_iViewOrderIdx; … … 238 241 Void setRateGOPSize ( Int i ) { m_iRateGOPSize = i; } 239 242 243 #if BITSTREAM_EXTRACTION 244 Void setLayerId ( UInt u ) { m_uiLayerId = u; } 245 UInt getLayerId ( ) { return m_uiLayerId; } 246 #endif 240 247 Void setViewId ( UInt u ) { m_uiViewId = u; } 241 248 Void setViewOrderIdx ( Int i ) { m_iViewOrderIdx = i; } -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncEntropy.h
r5 r40 72 72 virtual UInt getCoeffCost () = 0; 73 73 74 #if BITSTREAM_EXTRACTION 75 virtual Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 ) = 0; 76 #else 74 77 virtual Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true ) = 0; 78 #endif 75 79 76 80 virtual Void codeSPS ( TComSPS* pcSPS ) = 0; -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncGOP.cpp
r5 r40 639 639 seiBs.create(1024); 640 640 /* write the SEI messages */ 641 #if BITSTREAM_EXTRACTION 642 sei_recon_picture_digest.setLayerId( pcSlice->getLayerId() ); 643 #endif 641 644 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 642 645 m_pcEntropyCoder->setBitstream(&seiBs); -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSbac.cpp
r34 r40 177 177 } 178 178 179 #if BITSTREAM_EXTRACTION 180 Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, UInt uiLayerId ) 181 #else 179 182 Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag ) 183 #endif 180 184 { 181 185 assert (0); -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSbac.h
r5 r40 89 89 //--SBAC RD 90 90 91 #if BITSTREAM_EXTRACTION 92 Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 ); 93 #else 91 94 Void codeNALUnitHeader ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true ); 95 #endif 92 96 93 97 Void codeSPS ( TComSPS* pcSPS ); -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncSlice.cpp
r21 r40 149 149 rpcSlice->initSlice(); 150 150 rpcSlice->setPOC( pcPic->getPOC() ); 151 #if BITSTREAM_EXTRACTION 152 rpcSlice->setLayerId( m_pcCfg->getLayerId() ); 153 #endif 151 154 #if SONY_COLPIC_AVAILABILITY 152 155 rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx()); -
branches/0.3-ericsson/source/Lib/TLibEncoder/TEncTop.cpp
r34 r40 546 546 m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); 547 547 548 #if BITSTREAM_EXTRACTION 549 m_cSPS.setLayerId( m_uiLayerId ); 550 #endif 551 548 552 if( m_bIsDepth ) 549 553 { … … 632 636 Void TEncTop::xInitPPS() 633 637 { 638 #if BITSTREAM_EXTRACTION 639 m_cPPS.setLayerId( m_uiLayerId ); 640 #endif 641 634 642 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 635 643 m_cPPS.setPPSId( ( m_uiViewId << 1 ) + ( m_bIsDepth ? 1 : 0 ) );
Note: See TracChangeset for help on using the changeset viewer.