Changeset 54 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder
- Timestamp:
- 2 Mar 2013, 09:25:00 (12 years ago)
- Location:
- branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/NALread.cpp
r51 r54 100 100 nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type 101 101 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits 102 #if SVC_EXTENSION 103 nalu.m_layerId = nalu.m_reservedZero6Bits; 104 #else 102 105 assert(nalu.m_reservedZero6Bits == 0); 106 #endif 103 107 nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1 104 108 -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp
r51 r54 697 697 } 698 698 READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" ); pcSPS->setTMVPFlagsPresent(uiCode); 699 699 #if REF_IDX_MFM 700 if(pcSPS->getLayerId() > 0) 701 { 702 READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" ); 703 pcSPS->setMFMEnabledFlag( uiCode ? true : false ); 704 assert(pcSPS->getMFMEnabledFlag()); 705 } 706 #endif 700 707 READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" ); pcSPS->setUseStrongIntraSmoothing(uiCode); 701 708 … … 1927 1934 } 1928 1935 1936 #if INTRA_BL 1937 Void TDecCavlc::parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1938 { 1939 assert(0); 1940 } 1941 #endif 1942 1929 1943 //! \} 1930 1944 -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.h
r51 r54 120 120 Void updateContextTables ( SliceType /*eSliceType*/, Int /*iQp*/ ) { return; } 121 121 122 #if INTRA_BL 123 Void parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 124 #endif 125 122 126 Void xParsePredWeightTable ( TComSlice* pcSlice ); 123 127 Void parseScalingList ( TComScalingList* scalingList ); -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCu.cpp
r51 r54 37 37 38 38 #include "TDecCu.h" 39 #if SVC_EXTENSION 40 #include "TDecTop.h" 41 #endif 42 39 43 40 44 //! \ingroup TLibDecoder … … 56 60 } 57 61 62 #if SVC_EXTENSION 63 Void TDecCu::init(TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, UInt layerId) 64 { 65 m_pcEntropyDecoder = pcEntropyDecoder; 66 m_pcTrQuant = pcTrQuant; 67 m_pcPrediction = pcPrediction; 68 m_ppcTDecTop = ppcDecTop; 69 m_layerId = layerId; 70 71 for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ ) 72 { 73 m_ppcCU [ui]->setLayerId(layerId); 74 } 75 } 76 #else 58 77 Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction) 59 78 { … … 62 81 m_pcPrediction = pcPrediction; 63 82 } 83 #endif 64 84 65 85 /** … … 128 148 129 149 // start from the top level CU 150 #if SVC_EXTENSION 151 pcCU->setLayerId(m_layerId); 152 #endif 130 153 xDecodeCU( pcCU, 0, 0, ruiIsLast); 131 154 } … … 311 334 return; 312 335 } 336 #if INTRA_BL 337 m_pcEntropyDecoder->decodeIntraBLFlag( pcCU, uiAbsPartIdx, 0, uiDepth ); 338 if ( pcCU->isIntraBL( uiAbsPartIdx ) ) 339 { 340 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 341 } 342 else 343 { 344 #endif 313 345 314 346 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); … … 325 357 } 326 358 } 359 #if INTRA_BL 360 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 361 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 362 } 363 #endif 327 364 328 365 UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx ); 329 366 UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx ); 330 367 368 #if !INTRA_BL 331 369 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 332 370 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 371 #endif 333 372 334 373 // Coefficient decoding … … 401 440 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 402 441 break; 442 #if INTRA_BL 443 case MODE_INTRA_BL: 444 #if NO_RESIDUAL_FLAG_FOR_BLPRED 445 xReconIntraBL( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 446 #else 447 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 448 #endif 449 break; 450 #endif 403 451 default: 404 452 assert(0); … … 468 516 469 517 //===== get prediction signal ===== 518 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 519 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 520 { 521 pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride ); 522 } 523 else 524 #endif 470 525 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 471 526 … … 552 607 553 608 //===== get prediction signal ===== 609 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 610 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 611 { 612 pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId ); 613 } 614 else 615 #endif 554 616 { 555 617 if( uiChromaPredMode == DM_CHROMA_IDX ) … … 869 931 } 870 932 933 #if NO_RESIDUAL_FLAG_FOR_BLPRED 934 Void 935 TDecCu::xReconIntraBL( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 936 { 937 m_ppcYuvReco[uiDepth]->copyFromPicLuma ( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, pcCU->getWidth(0), pcCU->getHeight(0)); 938 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 0); 939 m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(), pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 1); 940 941 // inter recon 942 xDecodeInterTexture( pcCU, 0, uiDepth ); 943 944 // clip for only non-zero cbp case 945 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) ) 946 { 947 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); 948 } 949 else 950 { 951 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 952 } 953 } 954 #endif 955 871 956 //! \} -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCu.h
r51 r54 49 49 //! \ingroup TLibDecoder 50 50 //! \{ 51 #if SVC_EXTENSION 52 class TDecTop; 53 #endif 51 54 52 55 // ==================================================================================================================== … … 69 72 70 73 Bool m_bDecodeDQP; 74 #if SVC_EXTENSION 75 TDecTop** m_ppcTDecTop; 76 UInt m_layerId; 77 #endif 78 79 #if INTRA_BL 80 TComPicYuv* m_pcPicYuvRecBase; ///< reconstructed base layer 81 #endif 71 82 72 83 public: … … 75 86 76 87 /// initialize access channels 88 #if SVC_EXTENSION 89 Void init ( TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, UInt layerId ); 90 #else 77 91 Void init ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction ); 92 #endif 78 93 79 94 /// create internal buffers … … 89 104 Void decompressCU ( TComDataCU* pcCU ); 90 105 106 #if SVC_EXTENSION 107 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; } 108 #if INTRA_BL 109 Void setBaseRecPic ( TComPicYuv* p ) { m_pcPicYuvRecBase = p; } 110 #endif 111 #endif 91 112 protected: 92 113 … … 101 122 Void xIntraRecLumaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv ); 102 123 Void xIntraRecChromaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv, UInt uiChromaId ); 124 #if NO_RESIDUAL_FLAG_FOR_BLPRED 125 Void xReconIntraBL ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 126 #endif 103 127 104 128 Void xReconPCM ( TComDataCU* pcCU, UInt uiDepth ); -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecEntropy.cpp
r51 r54 58 58 } 59 59 60 #if INTRA_BL 61 Void TDecEntropy::decodeIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 62 { 63 m_pcEntropyDecoderIf->parseIntraBLFlag( pcCU, uiAbsPartIdx, uiPartIdx, uiDepth ); 64 } 65 #endif 66 60 67 /** decode merge flag 61 68 * \param pcSubCU … … 104 111 Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) 105 112 { 113 #if INTRA_BL 114 if( pcCU->isIntraBL( uiAbsPartIdx ) ) // Do nothing for Intra BL mode. 115 { 116 return; 117 } 118 #endif 106 119 if( pcCU->isIntra( uiAbsPartIdx ) ) // If it is Intra mode, encode intra prediction mode. 107 120 { … … 175 188 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 176 189 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 190 #if REF_IDX_FRAMEWORK // HM bug fix 191 if(uiPartIdx) 192 { 193 for(UInt ui=0; ui<uiMergeIndex+1; ui++) 194 { 195 cMvFieldNeighbours[(ui<<1)].setMvField(TComMv(), NOT_VALID); 196 cMvFieldNeighbours[(ui<<1)+1].setMvField(TComMv(), NOT_VALID); 197 } 198 } 199 #endif 177 200 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 178 201 { … … 437 460 438 461 pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 462 #if INTRA_BL 463 #if NO_RESIDUAL_FLAG_FOR_BLPRED 464 if( ( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx)) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 465 #else 466 if( ( !pcCU->isIntra(uiAbsPartIdx) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 467 #endif 468 #else 439 469 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 470 #endif 440 471 { 441 472 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth ); … … 535 566 UInt uiChromaOffset = uiLumaOffset>>2; 536 567 568 #if NO_RESIDUAL_FLAG_FOR_BLPRED 569 if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) ) 570 #else 537 571 if( pcCU->isIntra(uiAbsPartIdx) ) 572 #endif 538 573 { 539 574 } -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecEntropy.h
r51 r54 102 102 virtual Void parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 103 103 virtual Void parseTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType) = 0; 104 105 #if INTRA_BL 106 virtual Void parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) = 0; 107 #endif 108 104 109 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 105 110 … … 157 162 Void updateContextTables ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); } 158 163 164 #if INTRA_BL 165 Void decodeIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 166 #endif 159 167 160 168 private: -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecGop.cpp
r51 r54 43 43 #include "libmd5/MD5.h" 44 44 #include "TLibCommon/SEI.h" 45 #if SVC_EXTENSION 46 #include "TDecTop.h" 47 #endif 45 48 46 49 #include <time.h> … … 67 70 } 68 71 72 #if SVC_EXTENSION 73 Void TDecGop::create(UInt layerId) 74 { 75 m_layerId = layerId; 76 } 77 #else 69 78 Void TDecGop::create() 70 79 { 71 80 72 81 } 73 82 #endif 74 83 75 84 Void TDecGop::destroy() 76 85 { 77 86 } 78 87 #if SVC_EXTENSION 88 Void TDecGop::init(TDecTop** ppcDecTop, 89 TDecEntropy* pcEntropyDecoder, 90 #else 79 91 Void TDecGop::init( TDecEntropy* pcEntropyDecoder, 92 #endif 80 93 TDecSbac* pcSbacDecoder, 81 94 TDecBinCABAC* pcBinCABAC, … … 93 106 m_pcLoopFilter = pcLoopFilter; 94 107 m_pcSAO = pcSAO; 108 #if SVC_EXTENSION 109 m_ppcTDecTop = ppcDecTop; 110 #endif 95 111 } 96 112 … … 210 226 211 227 //-- For time output for each slice 228 #if SVC_EXTENSION 229 printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(), 230 rpcPic->getLayerId(), 231 pcSlice->getTLayer(), 232 c, 233 pcSlice->getSliceQp() ); 234 #else 212 235 printf("\nPOC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(), 213 236 pcSlice->getTLayer(), 214 237 c, 215 238 pcSlice->getSliceQp() ); 216 239 #endif 217 240 m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; 218 241 printf ("[DT %6.3f] ", m_dDecTime ); -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecGop.h
r51 r54 87 87 std::vector<Bool> m_LFCrossSliceBoundaryFlag; 88 88 89 #if SVC_EXTENSION 90 UInt m_layerId; 91 TDecTop** m_ppcTDecTop; 92 #endif 89 93 public: 90 94 TDecGop(); 91 95 virtual ~TDecGop(); 92 96 97 #if SVC_EXTENSION 98 Void init ( TDecTop** ppcDecTop, 99 TDecEntropy* pcEntropyDecoder, 100 #else 93 101 Void init ( TDecEntropy* pcEntropyDecoder, 102 #endif 94 103 TDecSbac* pcSbacDecoder, 95 104 TDecBinCABAC* pcBinCABAC, … … 99 108 TComSampleAdaptiveOffset* pcSAO 100 109 ); 110 #if SVC_EXTENSION 111 Void create (UInt layerId); 112 #else 101 113 Void create (); 114 #endif 102 115 Void destroy (); 103 116 Void decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic ); … … 105 118 106 119 void setDecodedPictureHashSEIEnabled(Int enabled) { m_decodedPictureHashSEIEnabled = enabled; } 120 #if SVC_EXTENSION 121 TDecTop* getLayerDec(UInt LayerId) { return m_ppcTDecTop[LayerId]; } 122 #endif 107 123 108 124 }; -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSbac.cpp
r51 r54 77 77 , m_cTransformSkipSCModel ( 1, 2, NUM_TRANSFORMSKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 78 78 , m_CUTransquantBypassFlagSCModel( 1, 1, NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels) 79 #if INTRA_BL 80 , m_cIntraBLPredFlagSCModel (1, 1, NUM_INTRA_BL_PRED_CTX , m_contextModels + m_numContextModels, m_numContextModels) 81 #endif 79 82 { 80 83 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 135 138 136 139 m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 140 #if INTRA_BL 141 m_cIntraBLPredFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRA_BL_PRED_FLAG ); 142 #endif 137 143 m_cTransformSkipSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG ); 138 144 m_CUTransquantBypassFlagSCModel.initBuffer( sliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG ); … … 179 185 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 180 186 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 187 #if INTRA_BL 188 m_cIntraBLPredFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_BL_PRED_FLAG ); 189 #endif 181 190 m_cTransformSkipSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG ); 182 191 m_CUTransquantBypassFlagSCModel.initBuffer( eSliceType, iQp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG ); … … 431 440 } 432 441 442 #if INTRA_BL 443 Void TDecSbac::parseIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 444 { 445 if( pcCU->getLayerId() == 0 ) 446 { 447 return; 448 } 449 450 UInt uiSymbol = 0; 451 452 UInt uiCtxIntraBL = pcCU->getCtxIntraBLFlag( uiAbsPartIdx ) ; 453 m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraBLPredFlagSCModel.get( 0, 0, uiCtxIntraBL )); 454 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 455 DTRACE_CABAC_T( "\tIntrBLFlag" ); 456 DTRACE_CABAC_T( "\tuiSymbol: "); 457 DTRACE_CABAC_V( uiSymbol ); 458 DTRACE_CABAC_T( "\n"); 459 460 if ( uiSymbol ) 461 { 462 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 463 pcCU->setPredModeSubParts( MODE_INTRA_BL, uiAbsPartIdx, uiDepth ); 464 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 465 pcCU->setLumaIntraDirSubParts ( DC_IDX, uiAbsPartIdx, uiDepth ); 466 } 467 } 468 #endif 469 433 470 /** parse merge flag 434 471 * \param pcCU … … 521 558 PartSize eMode; 522 559 560 #if INTRA_BL 561 if ( pcCU->isIntraBL( uiAbsPartIdx ) ) 562 { 563 assert( 0 ); 564 } 565 #endif 523 566 if ( pcCU->isIntra( uiAbsPartIdx ) ) 524 567 { -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSbac.h
r51 r54 131 131 Void parseScalingList ( TComScalingList* /*scalingList*/ ) {} 132 132 133 #if INTRA_BL 134 Void parseIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 135 #endif 133 136 private: 134 137 UInt m_uiLastDQpNonZero; … … 167 170 ContextModel3DBuffer m_cTransformSkipSCModel; 168 171 ContextModel3DBuffer m_CUTransquantBypassFlagSCModel; 172 #if INTRA_BL 173 ContextModel3DBuffer m_cIntraBLPredFlagSCModel; 174 #endif 169 175 }; 170 176 -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.cpp
r51 r54 100 100 } 101 101 102 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) 102 #if SVC_EXTENSION 103 Void TDecSlice::init(TDecTop** ppcDecTop,TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) 103 104 { 104 105 m_pcEntropyDecoder = pcEntropyDecoder; 105 106 m_pcCuDecoder = pcCuDecoder; 106 } 107 m_ppcTDecTop = ppcDecTop; 108 } 109 #else 110 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) 111 { 112 m_pcEntropyDecoder = pcEntropyDecoder; 113 m_pcCuDecoder = pcCuDecoder; 114 } 115 #endif 107 116 108 117 Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders) … … 184 193 UInt uiTileLCUX; 185 194 Int iNumSubstreamsPerTile = 1; // if independent. 195 #if INTRA_BL 196 m_pcCuDecoder->setBaseRecPic( rpcPic->getLayerId() > 0 ? rpcPic->getFullPelBaseRec() : NULL); 197 #endif 186 198 Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 187 199 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr(); -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.h
r51 r54 72 72 TDecBinCABAC* m_pcBufferLowLatBinCABACs; 73 73 std::vector<TDecSbac*> CTXMem; 74 #if SVC_EXTENSION 75 TDecTop** m_ppcTDecTop; 76 #endif 74 77 75 78 public: … … 77 80 virtual ~TDecSlice(); 78 81 82 #if SVC_EXTENSION 83 Void init ( TDecTop** ppcDecTop, TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder ); 84 #else 79 85 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder ); 86 #endif 80 87 Void create (); 81 88 Void destroy (); … … 84 91 Void initCtxMem( UInt i ); 85 92 Void setCtxMem( TDecSbac* sb, Int b ) { CTXMem[b] = sb; } 93 #if SVC_EXTENSION 94 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; } 95 #endif 86 96 }; 87 97 -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp
r51 r54 39 39 #include "TDecTop.h" 40 40 41 #if SVC_EXTENSION 42 ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder; // storage for parameter sets 43 UInt TDecTop::m_prevPOC = MAX_UINT; 44 UInt TDecTop::m_uiPrevLayerId = MAX_UINT; 45 Bool TDecTop::m_bFirstSliceInSequence = true; 46 #endif 47 41 48 //! \ingroup TLibDecoder 42 49 //! \{ … … 54 61 m_prevRAPisBLA = false; 55 62 m_pocRandomAccess = MAX_INT; 63 #if !SVC_EXTENSION 56 64 m_prevPOC = MAX_INT; 65 #endif 57 66 m_bFirstSliceInPicture = true; 67 #if !SVC_EXTENSION 58 68 m_bFirstSliceInSequence = true; 69 #endif 70 #if SVC_EXTENSION 71 m_layerId = 0; 72 #if AVC_BASE 73 m_pBLReconFile = NULL; 74 #endif 75 #endif 76 #if REF_IDX_FRAMEWORK 77 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 78 #endif 79 #if AVC_SYNTAX || SYNTAX_OUTPUT 80 m_pBLSyntaxFile = NULL; 81 #endif 82 59 83 } 60 84 … … 68 92 Void TDecTop::create() 69 93 { 94 #if SVC_EXTENSION 95 m_cGopDecoder.create( m_layerId ); 96 #else 70 97 m_cGopDecoder.create(); 98 #endif 71 99 m_apcSlicePilot = new TComSlice; 72 100 m_uiSliceIdx = 0; … … 81 109 82 110 m_cSliceDecoder.destroy(); 111 #if REF_IDX_FRAMEWORK 112 for(Int i=0; i<MAX_NUM_REF; i++) 113 { 114 if(m_cIlpPic[i]) 115 { 116 //m_cIlpPic[i]->setPicYuvRec(NULL); 117 m_cIlpPic[i]->destroy(); 118 delete m_cIlpPic[i]; 119 m_cIlpPic[i] = NULL; 120 } 121 } 122 #endif 83 123 } 84 124 85 125 Void TDecTop::init() 86 126 { 127 #if !SVC_EXTENSION 87 128 // initialize ROM 88 129 initROM(); 130 #endif 131 #if SVC_EXTENSION 132 m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 133 m_cSliceDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cCuDecoder ); 134 #else 89 135 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 90 136 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder ); 137 #endif 91 138 m_cEntropyDecoder.init(&m_cPrediction); 92 139 } 140 141 #if REF_IDX_FRAMEWORK 142 Void TDecTop::xInitILRP(TComSPS *pcSPS) 143 { 144 if(m_layerId>0) 145 { 146 if (m_cIlpPic[0] == NULL) 147 { 148 for (Int j=0; j<1/*MAX_NUM_REF*/; j++) 149 { 150 m_cIlpPic[j] = new TComPic; 151 //m_cIlpPic[j]->createWithOutYuv(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true); 152 #if SVC_UPSAMPLING 153 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSPS, true); 154 #else 155 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 156 #endif 157 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || REF_IDX_MFM 158 m_cIlpPic[j]->setIsILR(true); 159 #endif 160 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) 161 { 162 m_cIlpPic[j]->getPicSym()->getCU(i)->initCU(m_cIlpPic[j], i); 163 } 164 } 165 } 166 } 167 } 168 169 Void TDecTop::setILRPic(TComPic *pcPic) 170 { 171 if(m_cIlpPic[0]) 172 { 173 //m_cIlpPic[0]->setPicYuvRec(pcPic->getFullPelBaseRec()); 174 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 175 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 176 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 177 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); 178 } 179 } 180 #endif 93 181 94 182 Void TDecTop::deletePicBuffer ( ) … … 100 188 { 101 189 TComPic* pcPic = *(iterPic++); 190 #if SVC_EXTENSION 191 if( pcPic ) 192 { 193 pcPic->destroy(); 194 195 delete pcPic; 196 pcPic = NULL; 197 } 198 #else 102 199 pcPic->destroy(); 103 200 104 201 delete pcPic; 105 202 pcPic = NULL; 203 #endif 106 204 } 107 205 … … 110 208 m_cLoopFilter. destroy(); 111 209 210 #if !SVC_EXTENSION 112 211 // destroy ROM 113 212 destroyROM(); 213 #endif 114 214 } 115 215 … … 129 229 { 130 230 rpcPic = new TComPic(); 231 232 #if SVC_EXTENSION //Temporal solution, should be modified 233 if(m_layerId > 0) 234 { 235 TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 ); 236 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 237 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 238 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() ) 239 { 240 rpcPic->setSpatialEnhLayerFlag( true ); 241 } 242 } 243 #endif 131 244 245 #if SVC_UPSAMPLING 246 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 247 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 248 #else 132 249 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 133 250 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 251 #endif 134 252 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 135 253 m_cListPic.pushBack( rpcPic ); … … 152 270 if ( rpcPic->getSlice( 0 )->isReferenced() == false && rpcPic->getOutputMark() == false) 153 271 { 272 #if !SVC_EXTENSION 154 273 rpcPic->setOutputMark(false); 274 #endif 155 275 rpcPic->setReconMark( false ); 156 276 rpcPic->getPicYuvRec()->setBorderExtension( false ); … … 168 288 } 169 289 rpcPic->destroy(); 290 291 #if SVC_UPSAMPLING 292 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 293 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 294 295 #else 170 296 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 171 297 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 298 #endif 172 299 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 173 300 } … … 187 314 m_cGopDecoder.filterPicture(pcPic); 188 315 316 #if SYNTAX_OUTPUT 317 pcPic->wrireBLSyntax( getBLSyntaxFile(), SYNTAX_BYTES ); 318 #endif 189 319 TComSlice::sortPicList( m_cListPic ); // sorting for application output 190 320 poc = pcPic->getSlice(m_uiSliceIdx-1)->getPOC(); … … 202 332 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 203 333 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 334 #if SET_SLICE_LAYER_ID 335 cFillSlice.initSlice( m_parameterSetManagerDecoder.getFirstSPS()->getLayerId() ); 336 #else 204 337 cFillSlice.initSlice(); 338 #endif 205 339 TComPic *cFillPic; 206 340 xGetNewPicBuffer(&cFillSlice,cFillPic); 207 341 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 208 342 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 343 #if SET_SLICE_LAYER_ID 344 cFillPic->getSlice(0)->initSlice( cFillPic->getLayerId() ); 345 #else 209 346 cFillPic->getSlice(0)->initSlice(); 347 #endif 210 348 211 349 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); … … 256 394 assert (sps != 0); 257 395 396 #if SVC_EXTENSION 397 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->getIdrPicFlag(), m_apcSlicePilot->getLayerId() )) 398 #else 258 399 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->getIdrPicFlag())) 400 #endif 259 401 { 260 402 printf ("Parameter set activation failed!"); … … 283 425 } 284 426 427 #if SVC_EXTENSION 428 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 429 #else 285 430 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 431 #endif 286 432 { 287 433 TComPic*& pcPic = m_pcPic; 434 #if SET_SLICE_LAYER_ID 435 m_apcSlicePilot->initSlice( nalu.m_layerId ); 436 #else 288 437 m_apcSlicePilot->initSlice(); 438 #endif 289 439 290 440 if (m_bFirstSliceInPicture) … … 324 474 325 475 // exit when a new picture is found 476 #if SVC_EXTENSION 477 bNewPOC = (m_apcSlicePilot->getPOC()!= m_prevPOC); 478 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 479 { 480 m_prevPOC = m_apcSlicePilot->getPOC(); 481 curLayerId = m_uiPrevLayerId; 482 m_uiPrevLayerId = m_layerId; 483 return true; 484 } 485 #else 326 486 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence) 327 487 { … … 333 493 m_prevPOC = m_apcSlicePilot->getPOC(); 334 494 } 495 #endif 335 496 // actual decoding starts here 336 497 xActivateParameterSets(); … … 339 500 { 340 501 m_prevPOC = m_apcSlicePilot->getPOC(); 502 #if SVC_EXTENSION 503 curLayerId = m_layerId; 504 m_uiPrevLayerId = m_layerId; 505 #endif 341 506 } 342 507 m_bFirstSliceInSequence = false; … … 349 514 if (m_bFirstSliceInPicture) 350 515 { 516 #if AVC_BASE 517 if( m_layerId == 1 ) 518 { 519 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 520 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 521 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - pBLPic->getPicYuvRec()->getPicCropLeftOffset() - pBLPic->getPicYuvRec()->getPicCropRightOffset();; 522 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - pBLPic->getPicYuvRec()->getPicCropTopOffset() - pBLPic->getPicYuvRec()->getPicCropBottomOffset(); 523 524 if( pFile->good() ) 525 { 526 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 527 528 pFile->seekg((UInt)uiPos, ios::beg ); 529 530 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); 531 UInt uiStride = pBLPic->getPicYuvRec()->getStride(); 532 for( Int i = 0; i < uiHeight; i++ ) 533 { 534 for( Int j = 0; j < uiWidth; j++ ) 535 { 536 pPel[j] = pFile->get(); 537 } 538 pPel += uiStride; 539 } 540 541 pPel = pBLPic->getPicYuvRec()->getCbAddr(); 542 uiStride = pBLPic->getPicYuvRec()->getCStride(); 543 for( Int i = 0; i < uiHeight/2; i++ ) 544 { 545 for( Int j = 0; j < uiWidth/2; j++ ) 546 { 547 pPel[j] = pFile->get(); 548 } 549 pPel += uiStride; 550 } 551 552 pPel = pBLPic->getPicYuvRec()->getCrAddr(); 553 uiStride = pBLPic->getPicYuvRec()->getCStride(); 554 for( Int i = 0; i < uiHeight/2; i++ ) 555 { 556 for( Int j = 0; j < uiWidth/2; j++ ) 557 { 558 pPel[j] = pFile->get(); 559 } 560 pPel += uiStride; 561 } 562 } 563 } 564 #endif 565 351 566 // Buffer initialize for prediction. 352 567 m_cPrediction.initTempBuff(); … … 361 576 // Recursive structure 362 577 m_cCuDecoder.create ( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight ); 578 #if SVC_EXTENSION 579 m_cCuDecoder.init ( m_ppcTDecTop,&m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, curLayerId ); 580 #else 363 581 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 582 #endif 364 583 m_cTrQuant.init ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize()); 365 584 … … 483 702 pcPic->setTLayer(nalu.m_temporalId); 484 703 704 #if SVC_EXTENSION 705 pcPic->setLayerId(nalu.m_layerId); 706 pcSlice->setLayerId(nalu.m_layerId); 707 #endif 708 485 709 if (bNextSlice) 486 710 { 487 711 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA ); 712 #if !REF_IDX_FRAMEWORK || AVC_SYNTAX 488 713 // Set reference list 489 714 pcSlice->setRefPicList( m_cListPic ); 715 #endif 716 717 #if SVC_EXTENSION 718 if(m_layerId > 0) 719 { 720 #if AVC_BASE 721 pcSlice->setBaseColPic ( *m_ppcTDecTop[0]->getListPic()->begin() ); 722 #if AVC_SYNTAX 723 TComPic* pBLPic = pcSlice->getBaseColPic(); 724 if( pcSlice->getPOC() == 0 ) 725 { 726 // initialize partition order. 727 UInt* piTmp = &g_auiZscanToRaster[0]; 728 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 729 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 730 } 731 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice ); 732 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 733 #endif 734 735 #else 736 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 737 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 738 pcSlice->setBaseColPic ( *cListPic, m_layerId ); 739 #endif 740 #if SVC_UPSAMPLING 741 if ( pcPic->isSpatialEnhLayer()) 742 { 743 m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() ); 744 } 745 else 746 { 747 pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() ); 748 } 749 pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() ); 750 #endif 751 } 752 #endif 753 754 #if REF_IDX_FRAMEWORK 755 #if !AVC_SYNTAX 756 // Set reference list 757 pcSlice->setRefPicList( m_cListPic ); 758 #endif 759 if(m_layerId > 0) 760 { 761 setILRPic(pcPic); 762 #if REF_IDX_MFM 763 pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic()); 764 #endif 765 766 pcSlice->addRefPicList ( m_cIlpPic, 767 1, 768 ((pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) && 769 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ? 0: -1); 770 } 771 #endif 490 772 491 773 // For generalized B … … 590 872 { 591 873 TComSPS* sps = new TComSPS(); 874 #if SVC_EXTENSION 875 sps->setLayerId(m_layerId); 876 #endif 592 877 m_cEntropyDecoder.decodeSPS( sps ); 593 878 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 879 #if REF_IDX_MFM 880 m_pcSPS = sps; 881 setMFMEnabledFlag(sps->getMFMEnabledFlag()); 882 #endif 883 #if REF_IDX_FRAMEWORK 884 if(m_numLayer>0) 885 { 886 xInitILRP(sps); 887 } 888 #endif 594 889 } 595 890 … … 637 932 } 638 933 934 #if SVC_EXTENSION 935 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC) 936 #else 639 937 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) 938 #endif 640 939 { 641 940 // Initialize entropy decoder … … 651 950 case NAL_UNIT_SPS: 652 951 xDecodeSPS(); 952 #if AVC_BASE 953 { 954 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 955 if( nalu.m_layerId == 1 && pBLPic->getPicYuvRec() == NULL ) 956 { 957 #if SVC_UPSAMPLING 958 #if AVC_SYNTAX 959 TComSPS* sps = new TComSPS(); 960 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, sps, true); 961 #else 962 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL, true); 963 #endif 964 #else 965 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 966 #endif 967 } 968 } 969 #endif 653 970 return false; 654 971 … … 678 995 case NAL_UNIT_CODED_SLICE_RASL_N: 679 996 case NAL_UNIT_CODED_SLICE_TFD: 997 #if SVC_EXTENSION 998 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, curLayerId, bNewPOC); 999 #else 680 1000 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); 1001 #endif 681 1002 break; 682 1003 default: -
branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.h
r51 r54 72 72 73 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 74 #if SVC_EXTENSION 75 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 76 #else 74 77 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 78 #endif 79 80 #if REF_IDX_MFM 81 TComSPS* m_pcSPS; 82 Bool m_bMFMEnabledFlag; 83 #endif 84 75 85 TComSlice* m_apcSlicePilot; 76 86 … … 95 105 TComPic* m_pcPic; 96 106 UInt m_uiSliceIdx; 107 #if !SVC_EXTENSION 97 108 Int m_prevPOC; 109 #endif 98 110 Bool m_bFirstSliceInPicture; 111 #if !SVC_EXTENSION 99 112 Bool m_bFirstSliceInSequence; 113 #endif 114 115 #if SVC_EXTENSION 116 static UInt m_prevPOC; // POC of the previous slice 117 static UInt m_uiPrevLayerId; // LayerId of the previous slice 118 static Bool m_bFirstSliceInSequence; 119 UInt m_layerId; 120 UInt m_numLayer; 121 TDecTop** m_ppcTDecTop; 122 #if AVC_BASE 123 fstream* m_pBLReconFile; 124 Int m_iBLSourceWidth; 125 Int m_iBLSourceHeight; 126 #endif 127 #endif 128 #if AVC_SYNTAX || SYNTAX_OUTPUT 129 fstream* m_pBLSyntaxFile; 130 #endif 131 #if REF_IDX_FRAMEWORK 132 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 133 #endif 100 134 101 135 public: … … 109 143 110 144 Void init(); 145 #if SVC_EXTENSION 146 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 147 #else 111 148 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay); 149 #endif 112 150 113 151 Void deletePicBuffer(); 114 152 115 153 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 154 155 #if SVC_EXTENSION 156 UInt getLayerId () { return m_layerId; } 157 Void setLayerId (UInt layer) { m_layerId = layer; } 158 UInt getNumLayer () { return m_numLayer; } 159 Void setNumLayer (UInt uiNum) { m_numLayer = uiNum; } 160 TComList<TComPic*>* getListPic() { return &m_cListPic; } 161 Void setLayerDec(TDecTop **p) { m_ppcTDecTop = p; } 162 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 163 #if AVC_BASE 164 Void setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; } 165 fstream* getBLReconFile() { return m_pBLReconFile; } 166 Void setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; } 167 Int getBLWidth() { return m_iBLSourceWidth; } 168 Int getBLHeight() { return m_iBLSourceHeight; } 169 #endif 170 #endif 171 #if AVC_SYNTAX || SYNTAX_OUTPUT 172 Void setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; } 173 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 174 #endif 175 #if REF_IDX_FRAMEWORK 176 Void xInitILRP(TComSPS *pcSPS); 177 Void setILRPic(TComPic *pcPic); 178 #endif 179 #if REF_IDX_MFM 180 TComSPS* getSPS() {return m_pcSPS;} 181 Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} 182 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} 183 #endif 116 184 117 185 protected: … … 120 188 121 189 Void xActivateParameterSets(); 190 #if SVC_EXTENSION 191 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 192 #else 122 193 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 194 #endif 123 195 Void xDecodeVPS(); 124 196 Void xDecodeSPS();
Note: See TracChangeset for help on using the changeset viewer.