Changeset 1321 in 3DVCSoftware for trunk/source/Lib
- Timestamp:
- 7 Sep 2015, 18:16:33 (9 years ago)
- Location:
- trunk/source/Lib
- Files:
-
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r1314 r1321 278 278 static const Int MAX_NUM_VIDEO_SIGNAL_INFO = 16 ; 279 279 static const Int MAX_NUM_SCALED_REF_LAYERS = MAX_NUM_LAYERS - 1 ; 280 static const Int MAX_NUM_PICS_RPS = 16 ; 281 static const Int MAX_NUM_REF_LAYERS = 63 ; 280 282 #endif 281 283 … … 367 369 #endif 368 370 371 #if NH_MV 372 static const std::string NALU_TYPE_STR[] = { 373 "CODED_SLICE_TRAIL_N ", // 0 374 "CODED_SLICE_TRAIL_R ", // 1 375 "CODED_SLICE_TSA_N ", // 2 376 "CODED_SLICE_TSA_R ", // 3 377 "CODED_SLICE_STSA_N ", // 4 378 "CODED_SLICE_STSA_R ", // 5 379 "CODED_SLICE_RADL_N ", // 6 380 "CODED_SLICE_RADL_R ", // 7 381 "CODED_SLICE_RASL_N ", // 8 382 "CODED_SLICE_RASL_R ", // 9 383 "RESERVED_VCL_N10 ", 384 "RESERVED_VCL_R11 ", 385 "RESERVED_VCL_N12 ", 386 "RESERVED_VCL_R13 ", 387 "RESERVED_VCL_N14 ", 388 "RESERVED_VCL_R15 ", 389 "CODED_SLICE_BLA_W_LP ", // 16 390 "CODED_SLICE_BLA_W_RADL", // 17 391 "CODED_SLICE_BLA_N_LP ", // 18 392 "CODED_SLICE_IDR_W_RADL", // 19 393 "CODED_SLICE_IDR_N_LP ", // 20 394 "CODED_SLICE_CRA ", // 21 395 "RESERVED_IRAP_VCL22 ", 396 "RESERVED_IRAP_VCL23 ", 397 "RESERVED_VCL24 ", 398 "RESERVED_VCL25 ", 399 "RESERVED_VCL26 ", 400 "RESERVED_VCL27 ", 401 "RESERVED_VCL28 ", 402 "RESERVED_VCL29 ", 403 "RESERVED_VCL30 ", 404 "RESERVED_VCL31 ", 405 "VPS ", // 32 406 "SPS ", // 33 407 "PPS ", // 34 408 "ACCESS_UNIT_DELIMITER ", // 35 409 "EOS ", // 36 410 "EOB ", // 37 411 "FILLER_DATA ", // 38 412 "PREFIX_SEI ", // 39 413 "SUFFIX_SEI ", // 40 414 "RESERVED_NVCL41 ", 415 "RESERVED_NVCL42 ", 416 "RESERVED_NVCL43 ", 417 "RESERVED_NVCL44 ", 418 "RESERVED_NVCL45 ", 419 "RESERVED_NVCL46 ", 420 "RESERVED_NVCL47 ", 421 "UNSPECIFIED_48 ", 422 "UNSPECIFIED_49 ", 423 "UNSPECIFIED_50 ", 424 "UNSPECIFIED_51 ", 425 "UNSPECIFIED_52 ", 426 "UNSPECIFIED_53 ", 427 "UNSPECIFIED_54 ", 428 "UNSPECIFIED_55 ", 429 "UNSPECIFIED_56 ", 430 "UNSPECIFIED_57 ", 431 "UNSPECIFIED_58 ", 432 "UNSPECIFIED_59 ", 433 "UNSPECIFIED_60 ", 434 "UNSPECIFIED_61 ", 435 "UNSPECIFIED_62 ", 436 "UNSPECIFIED_63 ", 437 "INVALID " 438 }; 439 #endif 369 440 370 441 #if NH_3D -
trunk/source/Lib/TLibCommon/Debug.cpp
r1313 r1321 152 152 EnvVar DebugOptionList::ForceLumaMode ("FORCE_LUMA_MODE", "0", "Force a particular intra direction for Luma (0-34)" ); 153 153 EnvVar DebugOptionList::ForceChromaMode ("FORCE_CHROMA_MODE", "0", "Force a particular intra direction for chroma (0-5)" ); 154 155 #if DEBUG_STRING 156 EnvVar DebugOptionList::DebugString_Structure ("DEBUG_STRUCTURE", " 3", "Produce output on chosen structure bit0=intra, bit1=inter");157 EnvVar DebugOptionList::DebugString_Pred ("DEBUG_PRED", " 3", "Produce output on prediction data. bit0=intra, bit1=inter");158 EnvVar DebugOptionList::DebugString_Resi ("DEBUG_RESI", " 3", "Produce output on residual data. bit0=intra, bit1=inter");159 EnvVar DebugOptionList::DebugString_Reco ("DEBUG_RECO", " 3", "Produce output on reconstructed data. bit0=intra, bit1=inter");154 155 #if DEBUG_STRING 156 EnvVar DebugOptionList::DebugString_Structure ("DEBUG_STRUCTURE", "0", "Produce output on chosen structure bit0=intra, bit1=inter"); 157 EnvVar DebugOptionList::DebugString_Pred ("DEBUG_PRED", "0", "Produce output on prediction data. bit0=intra, bit1=inter"); 158 EnvVar DebugOptionList::DebugString_Resi ("DEBUG_RESI", "0", "Produce output on residual data. bit0=intra, bit1=inter"); 159 EnvVar DebugOptionList::DebugString_Reco ("DEBUG_RECO", "0", "Produce output on reconstructed data. bit0=intra, bit1=inter"); 160 160 EnvVar DebugOptionList::DebugString_InvTran ("DEBUG_INV_QT", "0", "Produce output on inverse-quantiser and transform stages. bit0=intra, bit1=inter"); 161 161 #endif -
trunk/source/Lib/TLibCommon/NAL.h
r1313 r1321 98 98 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R; 99 99 } 100 #if NH_MV 101 Bool isIrap() 102 { 103 return m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP 104 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 105 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 106 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 107 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 108 || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA; 109 } 110 111 Bool isIdr() 112 { 113 return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 114 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP; 115 } 116 117 Bool isBla() 118 { 119 return m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP 120 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 121 || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP; 122 } 123 124 Bool isCra() 125 { 126 return m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA; 127 } 128 129 130 #endif 100 131 Bool isSei() 101 132 { … … 108 139 return ( (UInt)m_nalUnitType < 32 ); 109 140 } 141 #if NH_MV 142 Void print( ) 143 { 144 std::cout << "Type: " << NALU_TYPE_STR[m_nalUnitType] << " LayerId: " << m_nuhLayerId << " TemporalId: " << m_temporalId; 145 } 146 #endif 110 147 }; 111 148 -
trunk/source/Lib/TLibCommon/TComBitStream.cpp
r1313 r1321 41 41 #include <string.h> 42 42 #include <memory.h> 43 43 #if NH_MV 44 #include "TComRom.h" // This is only here, since ENC_DEC_TRACE is currently there. Consider removing when this has changed. 45 #endif 44 46 using namespace std; 45 47 … … 258 260 m_numBitsRead += uiNumberOfBits; 259 261 262 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 263 if ( g_traceBitsRead ) 264 { 265 Bool oldJustDoIt = g_bJustDoIt; 266 g_bJustDoIt = true; 267 writeToTraceFile( "Bits: ", m_numBitsRead, true ); 268 g_bJustDoIt = oldJustDoIt; 269 } 270 #endif 271 260 272 /* NB, bits are extracted from the MSB of each byte. */ 261 273 UInt retval = 0; -
trunk/source/Lib/TLibCommon/TComCodingStatistics.h
r1313 r1321 102 102 STATS__CABAC_BITS__3D_IC, 103 103 #endif 104 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC104 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 105 105 STATS__CABAC_BITS__DELTADC_SIGN_EP, 106 106 STATS__CABAC_BITS__DELTADC_PREFIX, … … 174 174 "CABAC_BITS__3D_IC" 175 175 #endif 176 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC176 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 177 177 ,"STATS__CABAC_BITS__DELTADC_SIGN_EP" 178 178 ,"STATS__CABAC_BITS__DELTADC_PREFIX" -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r1313 r1321 2934 2934 } 2935 2935 2936 #if NH_3D _FIX_PRUNING2936 #if NH_3D 2937 2937 Bool TComDataCU::hasEqualMotion( Int dirA, const TComMvField* mvFieldA, Int dirB, const TComMvField* mvFieldB ) 2938 2938 { … … 3046 3046 if( !iLoop && ivCandDir[0] > 0) 3047 3047 { 3048 #if NH_3D_FIX_PRUNING3049 3048 if( hasEqualMotion(tmpDir, tmpMV, m_mergCands[MRG_IVMC].m_uDir, m_mergCands[MRG_IVMC].m_cMvField )) 3050 #else3051 if(tmpDir == m_mergCands[MRG_IVMC].m_uDir && m_mergCands[MRG_IVMC].m_cMvField[0]==tmpMV[0] && m_mergCands[MRG_IVMC].m_cMvField[1]==tmpMV[1])3052 #endif3053 3049 { 3054 3050 bRemove = true; … … 3101 3097 } 3102 3098 3099 3100 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 3101 if ( g_traceMergeCandListConst ) 3102 { 3103 for (Int i = 0; i<MRG_IVSHIFT+1; i++) 3104 { 3105 m_mergCands[i].print( i ); 3106 } 3107 } 3108 #endif 3109 3110 3103 3111 Int iCount = 0; 3104 3112 TComMv cZeroMv; … … 3156 3164 pcMvFieldNeighbours[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID); 3157 3165 } 3166 3158 3167 // copy extMergeCandList to output 3159 3168 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ ) … … 3161 3170 puhInterDirNeighbours[ui] = uhInterDirNeighboursExt[ui]; 3162 3171 pcMvFieldNeighbours[ui<<1].setMvField(extMergeCandList[ui<<1].getMv(), extMergeCandList[ui<<1].getRefIdx()); 3172 3163 3173 if ( getSlice()->isInterB() ) 3174 { 3164 3175 pcMvFieldNeighbours[(ui<<1)+1].setMvField(extMergeCandList[(ui<<1)+1].getMv(), extMergeCandList[(ui<<1)+1].getRefIdx()); 3165 } 3176 } 3177 } 3178 3179 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 3180 if ( g_traceMergeCandListConst ) 3181 { 3182 std::cout << std::setfill(' ') << std::setw( 15 ) 3183 << "Num" << std::setw( 15 ) 3184 << "Dir " << std::setw( 15 ) 3185 << "L0 RefIdx" << std::setw( 15 ) 3186 << "L0 Hor" << std::setw( 15 ) 3187 << "L0 Ver" << std::setw( 15 ) 3188 << "L1 RefIdx" << std::setw( 15 ) 3189 << "L1 Hor" << std::setw( 15 ) 3190 << "L1 Ver" << std::setw( 15 ) 3191 << std::endl; 3192 3193 // copy extMergeCandList to output 3194 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ ) 3195 { 3196 UChar curDir = puhInterDirNeighbours[ui]; 3197 TComMvField& curf = pcMvFieldNeighbours[ui<<1]; 3198 TComMvField& curf2 = pcMvFieldNeighbours[(ui<<1)+1]; 3199 3200 std::cout << std::setfill(' ') << std::setw( 15 ) 3201 << ui << std::setw( 15 ) 3202 << (UInt) curDir << std::setw( 15 ) 3203 << ((curDir & 1) ? curf.getRefIdx() : MIN_INT) << std::setw( 15 ) 3204 << ((curDir & 1) ? curf.getMv().getHor() : MIN_INT) << std::setw( 15 ) 3205 << ((curDir & 1) ? curf.getMv().getVer() : MIN_INT) << std::setw( 15 ); 3206 3207 if ( getSlice()->isInterB() ) 3208 { 3209 std::cout << ((curDir & 2) ? curf2.getRefIdx() : MIN_INT) << std::setw( 15 ) 3210 << ((curDir & 1) ? curf2.getMv().getHor() : MIN_INT) << std::setw( 15 ) 3211 << ((curDir & 1) ? curf2.getMv().getVer() : MIN_INT) << std::setw( 15 ); 3212 } 3213 std::cout << std::endl; 3214 } 3215 } 3216 #endif 3166 3217 numValidMergeCand = iCount; 3167 3218 assert(iCount == getSlice()->getMaxNumMergeCand()); … … 3503 3554 continue; 3504 3555 } 3505 #if NH_3D_FIX_PRUNING3506 3556 if (hasEqualMotion( tmpDir, tmpMV, m_mergCands[MRG_A1+iCnloop].m_uDir, m_mergCands[MRG_A1+iCnloop].m_cMvField ) ) 3507 #else3508 if (tmpDir == m_mergCands[MRG_A1+iCnloop].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+iCnloop].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+iCnloop].m_cMvField[1])3509 #endif3510 3557 { 3511 3558 m_mergCands[MRG_A1+iCnloop].m_bAvailable = false; … … 3581 3628 continue; 3582 3629 } 3583 #if NH_3D_FIX_PRUNING3584 3630 if (hasEqualMotion(ivCandDir[0], tmpMV, m_mergCands[MRG_A1+i].m_uDir, m_mergCands[MRG_A1+i].m_cMvField) ) 3585 #else3586 if (ivCandDir[0] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])3587 #endif3588 3631 { 3589 3632 m_mergCands[MRG_A1+i].m_bAvailable = false; … … 3594 3637 else 3595 3638 { 3596 #if NH_3D_FIX_PRUNING3597 3639 if( hasEqualMotion( ivCandDir[0], tmpMV, m_mergCands[MRG_T].m_uDir, m_mergCands[MRG_T].m_cMvField ) ) 3598 #else3599 if (m_mergCands[MRG_T].m_bAvailable && ivCandDir[0] == m_mergCands[MRG_T].m_uDir && tmpMV[0]==m_mergCands[MRG_T].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_T].m_cMvField[1])3600 #endif3601 3640 { 3602 3641 bRemoveSpa = true; … … 3647 3686 !bARPFlag && 3648 3687 #endif 3649 #if H_3D || NH_3D_FIX_VSP3688 #if NH_3D 3650 3689 (nPSW + nPSH > 12) && 3651 3690 #endif … … 3694 3733 continue; 3695 3734 } 3696 #if NH_3D_FIX_PRUNING3697 3735 if ( hasEqualMotion(ivCandDir[1], tmpMV, m_mergCands[MRG_A1+i].m_uDir, m_mergCands[MRG_A1+i].m_cMvField) ) 3698 #else3699 if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])3700 #endif3701 3736 { 3702 3737 bRemoveSpa = true; … … 4852 4887 } 4853 4888 } 4889 #if NH_3D 4890 Void TComDataCU::printMV( ) 4891 { 4892 4893 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 4894 { 4895 std::cout << "L" << i; 4896 m_acCUMvField[i].print(m_pePredMode); 4897 } 4898 4899 } 4900 #endif 4854 4901 4855 4902 UInt TComDataCU::getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const … … 5284 5331 #if NH_3D_NBDV_REF 5285 5332 TComPic* picDepth = NULL; 5286 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 5333 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 5287 5334 #if H_3D_FCO_VSP_DONBDV_E0163 5288 5335 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); … … 5627 5674 if(!m_pcSlice->getIsDepth()) 5628 5675 { 5629 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP5676 #if NH_3D_DBBP 5630 5677 if (!getDBBPFlag(0)) 5631 5678 #else … … 5803 5850 iCurrPosY += ( iHeight >> 1 ); 5804 5851 } 5805 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP5852 #if NH_3D_DBBP 5806 5853 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5807 5854 #else … … 5878 5925 } 5879 5926 #if NH_3D_SPIVMP 5880 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP5927 #if NH_3D_DBBP 5881 5928 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5882 5929 #else -
trunk/source/Lib/TLibCommon/TComDataCU.h
r1313 r1321 601 601 #if NH_3D 602 602 Void compressMV ( Int scale ); 603 Void printMV ( ); 603 604 #else 604 605 Void compressMV (); … … 644 645 645 646 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 646 #if NH_3D _FIX_PRUNING647 #if NH_3D 647 648 Bool hasEqualMotion ( Int dirA, const TComMvField* mvFieldA, Int dirB, const TComMvField* mvFieldB ); 648 649 #endif -
trunk/source/Lib/TLibCommon/TComMotionInfo.cpp
r1313 r1321 44 44 #include "TComPic.h" 45 45 #endif 46 46 #if NH_MV 47 #include <iomanip> 48 #endif 47 49 //! \ingroup TLibCommon 48 50 //! \{ … … 377 379 } 378 380 } 381 382 #if NH_MV 383 Void TComCUMvField::print(Char* pePredMode) 384 { 385 for ( Int uiPartIdx = 0; uiPartIdx < m_uiNumPartition; uiPartIdx += 1 ) 386 { 387 PredMode predMode = static_cast<PredMode>( pePredMode[ uiPartIdx ] ); 388 389 if ( predMode == MODE_INTRA) 390 { 391 std::cout << std::setfill(' ') << "(" 392 << std::setw(3) << " " << "," 393 << std::setw(3) << " " << "," 394 << std::setw(3) << " " << ")"; 395 } 396 else 397 { 398 ; 399 std::cout << std::setfill(' ') << "(" 400 << std::setw(3) << (Int) m_piRefIdx[ uiPartIdx ] << "," 401 << std::setw(3) << m_pcMv[ uiPartIdx ].getHor() << "," 402 << std::setw(3) << m_pcMv[ uiPartIdx ].getVer() << ")"; 403 } 404 } 405 } 406 407 #if NH_3D_MLC 408 Void TComMotionCand::print( Int i ) 409 { 410 if (i == 0 ) 411 { 412 413 std::cout << std::setfill(' ') << std::setw( 15 ) 414 << "Num" << std::setw( 15 ) 415 << "Avai" << std::setw( 15 ) 416 << "Dir " << std::setw( 15 ) 417 << "L0 RefIdx" << std::setw( 15 ) 418 << "L0 Hor" << std::setw( 15 ) 419 << "L0 Ver" << std::setw( 15 ) 420 << "L1 RefIdx" << std::setw( 15 ) 421 << "L1 Hor" << std::setw( 15 ) 422 << "L1 Ver" << std::setw( 15 ) 423 << "VspFlag" << std::setw( 15 ) 424 << "SPIVMPFlag" 425 << std::endl; 426 } 427 428 std::cout << std::setfill(' ') << std::setw( 15 ) 429 << i << std::setw( 15 ) 430 << m_bAvailable << std::setw( 15 ) 431 << (UInt) m_uDir << std::setw( 15 ) 432 << ((m_uDir & 1) ? m_cMvField[0].getRefIdx() : MIN_INT) << std::setw( 15 ) 433 << ((m_uDir & 1) ? m_cMvField[0].getMv().getHor() : MIN_INT) << std::setw( 15 ) 434 << ((m_uDir & 1) ? m_cMvField[0].getMv().getVer() : MIN_INT) << std::setw( 15 ) 435 << ((m_uDir & 2) ? m_cMvField[1].getRefIdx() : MIN_INT) << std::setw( 15 ) 436 << ((m_uDir & 2) ? m_cMvField[1].getMv().getHor() : MIN_INT) << std::setw( 15 ) 437 << ((m_uDir & 2) ? m_cMvField[1].getMv().getVer() : MIN_INT) << std::setw( 15 ) 438 << m_iVspFlag << std::setw( 15 ) 439 << m_bSPIVMPFlag << std::setw( 15 ) 440 << std::endl; 441 } 442 #endif 443 #endif 379 444 //! \} -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r1313 r1321 43 43 #include "CommonDef.h" 44 44 #include "TComMv.h" 45 45 46 //! \ingroup TLibCommon 46 47 //! \{ … … 188 189 189 190 Void compress(Char* pePredMode, Int scale); 191 #if NH_MV 192 Void print (Char* pePredMode); 193 #endif 190 194 }; 191 195 … … 281 285 #endif 282 286 } 287 288 289 Void print( Int i ); 290 283 291 }; 292 293 284 294 #endif 285 295 -
trunk/source/Lib/TLibCommon/TComPic.cpp
r1313 r1321 54 54 , m_bReconstructed (false) 55 55 , m_bNeededForOutput (false) 56 #if NH_MV57 , m_bPicOutputFlag (false)58 #endif59 56 , m_uiCurrSliceIdx (0) 60 57 , m_bCheckLTMSB (false) … … 62 59 , m_layerId (0) 63 60 , m_viewId (0) 61 , m_bPicOutputFlag (false) 64 62 #if NH_3D 65 63 , m_viewIndex (0) … … 82 80 m_eRapRefList = REF_PIC_LIST_0; 83 81 m_uiRapRefIdx = 0; 82 #endif 83 #if NH_MV 84 m_isPocResettingPic = false; 85 m_hasGeneratedRefPics = false; 86 m_isFstPicOfAllLayOfPocResetPer = false; 87 m_decodingOrder = 0; 88 m_noRaslOutputFlag = false; 89 m_noClrasOutputFlag = false; 90 m_picLatencyCount = 0; 91 m_isGenerated = false; 92 m_isGeneratedCl833 = false; 93 m_activatesNewVps = false; 84 94 #endif 85 95 } … … 185 195 } 186 196 } 197 187 198 188 199 Bool TComPic::getSAOMergeAvailability(Int currAddr, Int mergeAddr) … … 231 242 232 243 #if NH_MV 233 Void TComPic::print( Bool legend ) 234 { 235 if ( legend ) 236 std::cout << std::endl << "LId" << "\t" << "POC" << "\t" << "Rec" << "\t" << "Ref" << "\t" << "LT" << "\t" << "OutMark" << "\t" << "OutFlag" << std::endl; 237 else 238 std::cout << getLayerId() << "\t" << getPOC()<< "\t" << getReconMark() << "\t" << getSlice(0)->isReferenced() << "\t" << getIsLongTerm() << "\t" << getOutputMark() << "\t" << getSlice(0)->getPicOutputFlag() <<std::endl; 239 } 240 241 TComPic* TComPicLists::getPic( Int layerIdInNuh, Int poc ) 242 { 243 TComPic* pcPic = NULL; 244 for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() && pcPic == NULL ); itL++) 245 { 246 for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() && pcPic == NULL ); itP++) 247 { 248 TComPic* currPic = (*itP); 249 if ( ( currPic->getPOC() == poc ) && ( currPic->getLayerId() == layerIdInNuh ) ) 250 { 251 pcPic = currPic ; 252 } 253 } 254 } 255 return pcPic; 244 Bool TComPic::getPocResetPeriodId() 245 { 246 return getSlice(0)->getPocResetIdc(); 247 } 248 249 Void TComPic::markAsUsedForShortTermReference() 250 { 251 getSlice(0)->setReferenced( true ); 252 setIsLongTerm( false ); 253 } 254 255 Void TComPic::markAsUsedForLongTermReference() 256 { 257 getSlice(0)->setReferenced( true ); 258 setIsLongTerm( true ); 259 } 260 261 262 Void TComPic::markAsUnusedForReference() 263 { 264 getSlice(0)->setReferenced( false ); 265 setIsLongTerm( false ); 266 } 267 268 269 Bool TComPic::getMarkedUnUsedForReference() 270 { 271 return !getSlice(0)->isReferenced( ); 272 } 273 274 275 Bool TComPic::getMarkedAsShortTerm() 276 { 277 return ( getSlice(0)->isReferenced( ) && !getIsLongTerm() ); 278 } 279 280 Void TComPic::print( Int outputLevel ) 281 { 282 if ( outputLevel== 0 ) 283 { 284 std::cout << std::endl 285 << "LId" 286 << "\t" << "POC" 287 << "\t" << "Rec" 288 << "\t" << "Ref" 289 << "\t" << "LT" 290 << "\t" << "OutMark" 291 << "\t" << "OutFlag" 292 << "\t" << "Type" 293 << "\t" << "PReFlag" 294 << std::endl; 295 } 296 else if( outputLevel == 1 ) 297 { 298 std::cout << getLayerId() 299 << "\t" << getPOC() 300 << "\t" << getReconMark() 301 << "\t" << getSlice(0)->isReferenced() 302 << "\t" << getIsLongTerm() 303 << "\t" << getOutputMark() 304 << "\t" << getSlice(0)->getPicOutputFlag() 305 << "\t" << getSlice(0)->getNalUnitTypeString() 306 << "\t" << getSlice(0)->getPocResetFlag() 307 << std::endl; 308 } 309 else if ( outputLevel == 2 ) 310 { 311 std::cout << std:: setfill(' ') 312 << " LayerId: " << std::setw(2) << getLayerId() 313 << "\t" << " POC: " << std::setw(5) << getPOC() 314 << "\t" << " Dec. Order: " << std::setw(5) << getDecodingOrder() 315 << "\t" << " Referenced: " << std::setw(1) << getSlice(0)->isReferenced() 316 << "\t" << " Pic type: " << getSlice(0)->getNalUnitTypeString() 317 << "\t" << " Generated: " << std::setw(1) << getIsGenerated() 318 << "\t" << " Gen. Ref. Pics: " << std::setw(1) << getHasGeneratedRefPics(); 319 } 320 else if ( outputLevel == 4 ) 321 { 322 std::cout << std:: setfill(' ') 323 << " LayerId: " << std::setw(2) << getLayerId() 324 << "\t" << " POC: " << std::setw(5) << getPOC() 325 << "\t" << " Referenced: " << std::setw(1) << getSlice(0)->isReferenced() << std::endl; 326 } 256 327 } 257 328 258 329 #if NH_3D 259 TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc ) 260 { 261 return getPic ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc ); 262 } 263 #endif 264 Void TComPicLists::print() 265 { 266 Bool first = true; 267 for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() ); itL++) 268 { 269 for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++) 270 { 271 if ( first ) 272 { 273 (*itP)->print( true ); 274 first = false; 275 } 276 (*itP)->print( false ); 277 } 278 } 279 } 280 281 TComPicYuv* TComPicLists::getPicYuv( Int layerIdInNuh, Int poc, Bool reconFlag ) 282 { 283 TComPic* pcPic = getPic( layerIdInNuh, poc ); 284 TComPicYuv* pcPicYuv = NULL; 285 286 if (pcPic != NULL) 287 { 288 if( reconFlag ) 289 { 290 if ( pcPic->getReconMark() ) 291 { 292 pcPicYuv = pcPic->getPicYuvRec(); 293 } 294 } 295 else 296 { 297 pcPicYuv = pcPic->getPicYuvOrg(); 298 } 299 }; 300 301 return pcPicYuv; 302 } 303 304 #if NH_3D 305 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon ) 306 { 307 Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag ); 308 return getPicYuv( layerIdInNuh, poc, recon ); 309 } 310 #if NH_3D_ARP 311 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh ) 312 { 313 TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); 314 Int iLayer = 0; 315 316 assert( layerIdInNuh < m_lists.size() ); 317 318 while( iLayer != layerIdInNuh ) 319 { 320 itL++; 321 iLayer++; 322 } 323 324 return *itL; 325 } 326 #endif 327 #endif 328 #endif // NH_MV 330 Void TComPic::printMotion() 331 { 332 TComPicSym* pPicSym = getPicSym(); 333 for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getNumberOfCtusInFrame(); uiCUAddr++ ) 334 { 335 TComDataCU* pCtu = pPicSym->getCtu(uiCUAddr); 336 std::cout << "CUAddr " << uiCUAddr << std::endl; 337 pCtu->printMV(); 338 std::cout << std::endl; 339 } 340 } 329 341 330 342 #if NH_3D_NBDV … … 437 449 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false; 438 450 Int iColViewIdx = pcCandColSlice->getViewIndex(); 451 #if H_3D_FIX_ARP_CHECK_NOT_IN_DPB 452 // The picture pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx) might not be in DPB anymore 453 // So don't access it directly. 454 Int iColRefViewIdx = pcCandColSlice->getVPS()->getViewOrderIdx( pcCandColSlice->getRefLayerId( (RefPicList)iColRefDir, iColRefIdx ) ); 455 #else 439 456 Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex(); 457 #endif 440 458 if(iColViewIdx == iColRefViewIdx) 441 459 { … … 487 505 { 488 506 if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 489 507 pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId) 490 508 { 491 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 509 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 492 510 } 493 511 } … … 504 522 } 505 523 #endif 524 #endif 525 526 Void TComAu::setPicLatencyCount( Int picLatenyCount ) 527 { 528 for(TComList<TComPic*>::iterator itP= begin(); itP!= end(); itP++) 529 { 530 (*itP)->setPicLatencyCount( picLatenyCount ); 531 } 532 } 533 534 TComPic* TComAu::getPic( Int nuhLayerId ) 535 { 536 TComPic* pic = NULL; 537 for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) 538 { 539 if ( (*itP)->getLayerId() == nuhLayerId ) 540 { 541 pic = (*itP); 542 } 543 } 544 return pic; 545 } 546 547 Void TComAu::addPic( TComPic* pic, Bool pocUnkown ) 548 { 549 if ( !empty() ) 550 { 551 if (!pocUnkown) 552 { 553 assert( pic->getPOC() == ( getPoc() )); 554 } 555 pic->setPicLatencyCount( getPicLatencyCount() ); 556 557 assert( getPic( pic->getLayerId() ) == NULL ); 558 559 // Add sorted 560 TComAu::iterator itP = begin(); 561 Bool inserted = false; 562 while( !inserted ) 563 { 564 if ( ( itP == end()) || pic->getLayerId() < (*itP)->getLayerId() ) 565 { 566 insert(itP, pic ); 567 inserted = true; 568 } 569 else 570 { 571 ++itP; 572 } 573 } 574 } 575 else 576 { 577 pushBack( pic ); 578 } 579 } 580 581 Bool TComAu::containsPic( TComPic* pic ) 582 { 583 Bool isInList = false; 584 for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (!isInList) ); itP++) 585 { 586 isInList = isInList || ( pic == (*itP)); 587 } 588 return isInList; 589 } 590 591 TComSubDpb::TComSubDpb( Int nuhLayerid ) 592 { 593 m_nuhLayerId = nuhLayerid; 594 } 595 596 TComPic* TComSubDpb::getPic( Int poc ) 597 { 598 TComPic* pic = NULL; 599 for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) 600 { 601 if ( (*itP)->getPOC() == poc ) 602 { 603 pic = (*itP); 604 } 605 } 606 return pic; 607 } 608 609 TComPic* TComSubDpb::getPicFromLsb( Int pocLsb, Int maxPicOrderCntLsb ) 610 { 611 TComPic* pic = NULL; 612 for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) 613 { 614 if ( ( (*itP)->getPOC() & ( maxPicOrderCntLsb - 1 ) ) == pocLsb ) 615 { 616 pic = (*itP); 617 } 618 } 619 return pic; 620 } 621 622 TComPic* TComSubDpb::getShortTermRefPic( Int poc ) 623 { 624 TComPic* pic = NULL; 625 for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) 626 { 627 if ( (*itP)->getPOC() == poc && (*itP)->getMarkedAsShortTerm() ) 628 { 629 pic = (*itP); 630 } 631 } 632 return pic; 633 } 634 635 TComList<TComPic*> TComSubDpb::getPicsMarkedNeedForOutput() 636 { 637 TComList<TComPic*> picsMarkedNeedForOutput; 638 639 for(TComList<TComPic*>::iterator itP= begin(); itP!= end() ; itP++ ) 640 { 641 if ( (*itP)->getOutputMark() ) 642 { 643 picsMarkedNeedForOutput.push_back( (*itP) ); 644 } 645 } 646 return picsMarkedNeedForOutput; 647 } 648 649 Void TComSubDpb::markAllAsUnusedForReference() 650 { 651 for(TComList<TComPic*>::iterator itP= begin(); itP!= end() ; itP++ ) 652 { 653 (*itP)->markAsUnusedForReference(); 654 } 655 } 656 657 Void TComSubDpb::addPic( TComPic* pic ) 658 { 659 assert( pic != NULL ); 660 assert( m_nuhLayerId == pic->getLayerId() || m_nuhLayerId == -1); 661 if ( !empty() ) 662 { 663 assert( getPic( pic->getPOC() ) == NULL ); // Don't add twice; assert( pic->getLayerId() == m_nuhLayerId ); 664 665 // Add sorted 666 TComSubDpb::iterator itP = begin(); 667 Bool inserted = false; 668 while( !inserted ) 669 { 670 if ( ( itP == end()) || pic->getPOC() < (*itP)->getPOC() ) 671 { 672 insert(itP, pic ); 673 inserted = true; 674 } 675 else 676 { 677 ++itP; 678 } 679 } 680 } 681 else 682 { 683 pushBack( pic ); 684 } 685 } 686 687 Void TComSubDpb::removePics( std::vector<TComPic*> picToRemove ) 688 { 689 for (Int i = 0; i < picToRemove.size(); i++ ) 690 { 691 if( picToRemove[i] != NULL) 692 { 693 remove( picToRemove[i] ); 694 } 695 } 696 } 697 698 Bool TComSubDpb::areAllPicsMarkedNotNeedForOutput() 699 { 700 return ( getPicsMarkedNeedForOutput().size() == 0 ); 701 } 702 703 704 TComPicLists::~TComPicLists() 705 { 706 emptyAllSubDpbs(); 707 for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end()); itL++) 708 { 709 if ( (*itL) != NULL ) 710 { 711 delete (*itL); 712 (*itL) = NULL; 713 } 714 } 715 } 716 717 Void TComPicLists::addNewPic( TComPic* pic ) 718 { 719 getSubDpb ( pic->getLayerId() , true )->addPic( pic ); 720 getAu ( pic->getPOC() , true )->addPic( pic , false ); 721 if ( m_printPicOutput ) 722 { 723 std::cout << " Add picture: "; 724 pic->print( 2 ); 725 std::cout << std::endl; 726 } 727 } 728 729 Void TComPicLists::removePic( TComPic* pic ) 730 { 731 if (pic != NULL) 732 { 733 734 TComSubDpb* curSubDpb = getSubDpb( pic->getLayerId(), false ); 735 curSubDpb->remove( pic ); 736 737 TComAu* curAu = getAu ( pic->getPOC(), false ); 738 739 if (curAu != NULL) 740 { 741 curAu->remove( pic ); 742 // Remove AU when empty. 743 if (curAu->empty() ) 744 { 745 m_aus.remove( curAu ); 746 delete curAu; 747 } 748 } 749 750 if ( m_printPicOutput ) 751 { 752 std::cout << " Remove picture: "; 753 pic->print( 2 ); 754 std::cout << std::endl; 755 } 756 757 pic->destroy(); 758 delete pic; 759 } 760 } 761 762 TComPic* TComPicLists::getPic( Int layerIdInNuh, Int poc ) 763 { 764 TComPic* pcPic = NULL; 765 TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false ); 766 if ( subDpb != NULL ) 767 { 768 pcPic = subDpb->getPic( poc ); 769 } 770 return pcPic; 771 } 772 773 TComPicYuv* TComPicLists::getPicYuv( Int layerIdInNuh, Int poc, Bool reconFlag ) 774 { 775 TComPic* pcPic = getPic( layerIdInNuh, poc ); 776 TComPicYuv* pcPicYuv = NULL; 777 778 if (pcPic != NULL) 779 { 780 if( reconFlag ) 781 { 782 if ( pcPic->getReconMark() ) 783 { 784 pcPicYuv = pcPic->getPicYuvRec(); 785 } 786 } 787 else 788 { 789 pcPicYuv = pcPic->getPicYuvOrg(); 790 } 791 }; 792 793 return pcPicYuv; 794 } 795 796 TComSubDpb* TComPicLists::getSubDpb( Int nuhLayerId, Bool create ) 797 { 798 TComSubDpb* subDpb = NULL; 799 for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() && subDpb == NULL ); itL++) 800 { 801 if ( (*itL)->getLayerId() == nuhLayerId ) 802 { 803 subDpb = (*itL); 804 } 805 } 806 if ( subDpb == NULL && create ) 807 { 808 m_subDpbs.push_back( new TComSubDpb(nuhLayerId) ); 809 } 810 return subDpb; 811 } 812 813 TComList<TComSubDpb*>* TComPicLists::getSubDpbs() 814 { 815 return (&m_subDpbs); 816 } 817 818 TComAu* TComPicLists::addAu( Int poc ) 819 { 820 TComList<TComAu*>::iterator itA = m_aus.begin(); 821 822 assert( getAu(poc, false) == NULL ); 823 Bool inserted = false; 824 while( !inserted) 825 { 826 if ( ( itA == m_aus.end()) || poc < (*itA)->getPoc() ) 827 { 828 m_aus.insert(itA, new TComAu ); 829 inserted = true; 830 --itA; 831 } 832 else 833 { 834 ++itA; 835 } 836 } 837 return (*itA); 838 } 839 840 TComAu* TComPicLists::getAu( Int poc, Bool create ) 841 { 842 TComAu* au = NULL; 843 844 for( TComList<TComAu*>::iterator itA = m_aus.begin(); ( itA != m_aus.end() && au == NULL ); itA++) 845 { 846 if ( (*itA)->getPoc() == poc ) 847 { 848 au = (*itA); 849 } 850 } 851 852 if ( au == NULL && create ) 853 { 854 au = addAu( poc ); 855 } 856 return au; 857 } 858 859 TComList<TComAu*>* TComPicLists::getAus() 860 { 861 return (&m_aus); 862 } 863 864 TComList<TComAu*> TComPicLists::getAusHavingPicsMarkedForOutput() 865 { 866 TComList<TComAu*> ausHavingPicsForOutput; 867 for(TComList<TComAu*>::iterator itA= m_aus.begin(); ( itA!=m_aus.end()); itA++) 868 { 869 Bool hasPicMarkedAsNeedForOutput = false; 870 for( TComAu::iterator itP= (*itA)->begin(); (itP!=(*itA)->end() && !hasPicMarkedAsNeedForOutput); itP++ ) 871 { 872 if( (*itP)->getOutputMark() ) 873 { 874 hasPicMarkedAsNeedForOutput = true; 875 } 876 } 877 if (hasPicMarkedAsNeedForOutput) 878 { 879 ausHavingPicsForOutput.pushBack( (*itA) ); 880 } 881 } 882 return ausHavingPicsForOutput; 883 } 884 885 Void TComPicLists::markSubDpbAsUnusedForReference( Int layerIdInNuh ) 886 { 887 TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false ); 888 markSubDpbAsUnusedForReference( *subDpb ); 889 } 890 891 Void TComPicLists::markSubDpbAsUnusedForReference( TComSubDpb& subDpb ) 892 { 893 for(TComList<TComPic*>::iterator itP=subDpb.begin(); ( itP!=subDpb.end()); itP++) 894 { 895 (*itP)->markAsUnusedForReference(); 896 } 897 } 898 899 Void TComPicLists::markAllSubDpbAsUnusedForReference() 900 { 901 for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++) 902 { 903 markSubDpbAsUnusedForReference( *(*itS) ); 904 } 905 } 906 907 Void TComPicLists::decrementPocsInSubDpb( Int nuhLayerId, Int deltaPocVal ) 908 { 909 TComSubDpb* subDpb = getSubDpb( nuhLayerId, false ); 910 911 for(TComSubDpb::iterator itP = subDpb->begin(); itP!=subDpb->end(); itP++) 912 { 913 TComPic* pic = (*itP); 914 for (Int i = 0; i < pic->getNumAllocatedSlice(); i++) 915 { 916 TComSlice* slice = pic->getSlice(i); 917 slice->setPOC( slice->getPOC() - deltaPocVal ); 918 } 919 } 920 } 921 Void TComPicLists::emptyAllSubDpbs() 922 { 923 emptySubDpbs( &m_subDpbs ); 924 } 925 926 Void TComPicLists::emptySubDpbs( TComList<TComSubDpb*>* subDpbs ) 927 { 928 assert( subDpbs != NULL ); 929 for( TComList<TComSubDpb*>::iterator itS = subDpbs->begin(); itS != subDpbs->end(); itS++ ) 930 { 931 emptySubDpb( (*itS) ); 932 } 933 } 934 935 Void TComPicLists::emptySubDpb( TComSubDpb* subDpb ) 936 { 937 if(subDpb != NULL) 938 { 939 while( !subDpb->empty() ) 940 { 941 TComPic* curPic = *(subDpb->begin()); 942 removePic( curPic ); 943 } 944 } 945 } 946 947 Void TComPicLists::emptySubDpb( Int nuhLayerId ) 948 { 949 emptySubDpb( getSubDpb( nuhLayerId , false) ); 950 } 951 952 Void TComPicLists::emptyNotNeedForOutputAndUnusedForRef() 953 { 954 for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++) 955 { 956 emptySubDpbNotNeedForOutputAndUnusedForRef( *(*itS) ); 957 } 958 } 959 960 Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( Int layerId ) 961 { 962 TComSubDpb* subDpb = getSubDpb( layerId, false ); 963 emptySubDpbNotNeedForOutputAndUnusedForRef( *subDpb ); 964 } 965 966 Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( TComSubDpb subDpb ) 967 { 968 for(TComSubDpb::iterator itP= subDpb.begin(); ( itP!=subDpb.end()); itP++) 969 { 970 TComPic* pic = (*itP); 971 if ( !pic->getOutputMark() && pic->getMarkedUnUsedForReference() ) 972 { 973 removePic( pic ); 974 } 975 } 976 } 977 978 Void TComPicLists::print() 979 { 980 Bool first = true; 981 for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() ); itL++) 982 { 983 for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++) 984 { 985 if ( first ) 986 { 987 (*itP)->print( true ); 988 first = false; 989 } 990 (*itP)->print( false ); 991 } 992 } 993 } 994 995 #if NH_3D 996 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon ) 997 { 998 Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag ); 999 return getPicYuv( layerIdInNuh, poc, recon ); 1000 } 1001 1002 TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc ) 1003 { 1004 return getPic ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc ); 1005 } 1006 1007 #endif 1008 1009 #endif 1010 1011 506 1012 507 1013 508 1014 //! \} 1015 -
trunk/source/Lib/TLibCommon/TComPic.h
r1313 r1321 54 54 /// picture class (symbol + YUV buffers) 55 55 56 57 58 #if NH_MV 59 class TComPic; 60 61 class TComDecodedRps 62 { 63 public: 64 65 TComDecodedRps() 66 { 67 m_refPicSetsCurr[0] = &m_refPicSetStCurrBefore; 68 m_refPicSetsCurr[1] = &m_refPicSetStCurrAfter ; 69 m_refPicSetsCurr[2] = &m_refPicSetLtCurr ; 70 71 m_refPicSetsLt [0] = &m_refPicSetLtCurr ; 72 m_refPicSetsLt [1] = &m_refPicSetLtFoll ; 73 74 m_refPicSetsAll [0] = &m_refPicSetStCurrBefore; 75 m_refPicSetsAll [1] = &m_refPicSetStCurrAfter ; 76 m_refPicSetsAll [2] = &m_refPicSetStFoll ; 77 m_refPicSetsAll [3] = &m_refPicSetLtCurr ; 78 m_refPicSetsAll [4] = &m_refPicSetLtFoll ; 79 }; 80 81 std::vector<Int> m_pocStCurrBefore; 82 std::vector<Int> m_pocStCurrAfter; 83 std::vector<Int> m_pocStFoll; 84 std::vector<Int> m_pocLtCurr; 85 std::vector<Int> m_pocLtFoll; 86 87 Int m_numPocStCurrBefore; 88 Int m_numPocStCurrAfter; 89 Int m_numPocStFoll; 90 Int m_numPocLtCurr; 91 Int m_numPocLtFoll; 92 93 std::vector<TComPic*> m_refPicSetStCurrBefore; 94 std::vector<TComPic*> m_refPicSetStCurrAfter; 95 std::vector<TComPic*> m_refPicSetStFoll; 96 std::vector<TComPic*> m_refPicSetLtCurr; 97 std::vector<TComPic*> m_refPicSetLtFoll; 98 99 std::vector<TComPic*>* m_refPicSetsCurr[3]; 100 std::vector<TComPic*>* m_refPicSetsLt [2]; 101 std::vector<TComPic*>* m_refPicSetsAll [5]; 102 103 // Annex F 104 Int m_numActiveRefLayerPics0; 105 Int m_numActiveRefLayerPics1; 106 107 std::vector<TComPic*> m_refPicSetInterLayer0; 108 std::vector<TComPic*> m_refPicSetInterLayer1; 109 }; 110 #endif 111 56 112 class TComPic 57 113 { … … 72 128 Bool m_bReconstructed; 73 129 Bool m_bNeededForOutput; 74 #if NH_MV 75 Bool m_bPicOutputFlag; // Semantics variable 76 #endif 130 77 131 UInt m_uiCurrSliceIdx; // Index of current slice 78 132 Bool m_bCheckLTMSB; … … 87 141 Int m_layerId; 88 142 Int m_viewId; 143 Bool m_bPicOutputFlag; // Semantics variable 144 Bool m_hasGeneratedRefPics; 145 Bool m_isPocResettingPic; 146 Bool m_isFstPicOfAllLayOfPocResetPer; 147 Int64 m_decodingOrder; 148 Bool m_noRaslOutputFlag; 149 Bool m_noClrasOutputFlag; 150 Int m_picLatencyCount; 151 Bool m_isGenerated; 152 Bool m_isGeneratedCl833; 153 Bool m_activatesNewVps; 154 TComDecodedRps m_decodedRps; 155 #endif 89 156 #if NH_3D 90 157 Int m_viewIndex; … … 92 159 Int** m_aaiCodedScale; 93 160 Int** m_aaiCodedOffset; 94 #endif95 #endif96 161 #if NH_3D_QTLPC 97 162 Bool m_bReduceBitsQTL; 98 163 #endif 99 164 #if NH_3D_NBDV 100 UInt m_uiRapRefIdx;101 RefPicList m_eRapRefList;102 Int m_iNumDdvCandPics;103 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists104 Int m_aiTexToDepRef [2][MAX_NUM_REF];105 #endif 106 165 UInt m_uiRapRefIdx; 166 RefPicList m_eRapRefList; 167 Int m_iNumDdvCandPics; 168 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists 169 Int m_aiTexToDepRef [2][MAX_NUM_REF]; 170 #endif 171 #endif 107 172 public: 108 173 TComPic(); … … 115 180 UInt getTLayer() const { return m_uiTLayer; } 116 181 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 117 #if NH_MV118 Void setLayerId ( Int layerId ) { m_layerId = layerId; }119 Int getLayerId () { return m_layerId; }120 Void setViewId ( Int viewId ) { m_viewId = viewId; }121 Int getViewId () { return m_viewId; }122 #if NH_3D123 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; }124 Int getViewIndex () { return m_viewIndex; }125 126 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }127 Bool getIsDepth () { return m_isDepth; }128 129 Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }130 Int** getCodedScale () { return m_aaiCodedScale; }131 Int** getCodedOffset() { return m_aaiCodedOffset; }132 #endif133 #endif134 #if NH_3D_QTLPC135 Bool getReduceBitsFlag () { return m_bReduceBitsQTL; }136 Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; }137 #endif138 182 139 183 Bool getUsedByCurr() const { return m_bUsedByCurr; } … … 177 221 Void setOutputMark (Bool b) { m_bNeededForOutput = b; } 178 222 Bool getOutputMark () const { return m_bNeededForOutput; } 179 #if NH_MV 180 Void setPicOutputFlag(Bool b) { m_bPicOutputFlag = b; } 181 Bool getPicOutputFlag() { return m_bPicOutputFlag ; } 182 #endif 183 #if NH_3D 184 #if NH_3D_ARP 185 Void getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ); 186 #endif 187 Void compressMotion(Int scale); 188 #else 223 224 #if !NH_3D 189 225 Void compressMotion(); 190 226 #endif … … 210 246 211 247 #if NH_MV 212 Void print( Bool legend ); 248 Void setLayerId ( Int layerId ) { m_layerId = layerId; } 249 Int getLayerId () { return m_layerId; } 250 251 Void setViewId ( Int viewId ) { m_viewId = viewId; } 252 Int getViewId () { return m_viewId; } 253 254 Void setPicOutputFlag(Bool b) { m_bPicOutputFlag = b; } 255 Bool getPicOutputFlag() { return m_bPicOutputFlag ; } 256 257 Bool getPocResetPeriodId(); 258 259 Void markAsUsedForShortTermReference(); 260 Void markAsUsedForLongTermReference(); 261 Void markAsUnusedForReference(); 262 263 Bool getMarkedUnUsedForReference(); 264 Bool getMarkedAsShortTerm(); 265 266 Void setHasGeneratedRefPics(Bool val) { m_hasGeneratedRefPics = val; } 267 Bool getHasGeneratedRefPics( ) { return m_hasGeneratedRefPics; } 268 269 Void setIsPocResettingPic(Bool val) { m_isPocResettingPic = val; } 270 Bool getIsPocResettingPic( ) { return m_isPocResettingPic; } 271 272 Void setIsFstPicOfAllLayOfPocResetPer(Bool val) { m_isFstPicOfAllLayOfPocResetPer = val; } 273 Bool getIsFstPicOfAllLayOfPocResetPer( ) { return m_isFstPicOfAllLayOfPocResetPer; } 274 275 Int64 getDecodingOrder( ) { return m_decodingOrder; } 276 Void setDecodingOrder( UInt64 val ) { m_decodingOrder = val; } 277 278 Bool getNoRaslOutputFlag() { return m_noRaslOutputFlag; } 279 Void setNoRaslOutputFlag( Bool b ) { m_noRaslOutputFlag = b; } 280 281 Bool getNoClrasOutputFlag() { return m_noClrasOutputFlag; } 282 Void setNoClrasOutputFlag( Bool b ) { m_noClrasOutputFlag = b; } 283 284 Int getPicLatencyCount() { return m_picLatencyCount; } 285 Void setPicLatencyCount( Int val ) { m_picLatencyCount = val; } 286 287 Bool getIsGenerated() const { return m_isGenerated; } 288 Void setIsGenerated( Bool b ) { m_isGenerated = b; } 289 290 Bool getIsGeneratedCl833() const { return m_isGeneratedCl833; } 291 Void setIsGeneratedCl833( Bool b ) { m_isGeneratedCl833 = b; } 292 293 Int getTemporalId( ) { return getSlice(0)->getTemporalId(); } 294 295 Bool getActivatesNewVps() { return m_activatesNewVps; } 296 Void setActivatesNewVps( Bool b ) { m_activatesNewVps = b; } 297 298 TComDecodedRps* getDecodedRps() { return &m_decodedRps; } 299 300 Bool isIrap() { return getSlice(0)->isIRAP(); } 301 Bool isBla () { return getSlice(0)->isBla (); } 302 Bool isIdr () { return getSlice(0)->isIdr (); } 303 Bool isCra () { return getSlice(0)->isCra (); } 304 Bool isSlnr () { return getSlice(0)->isSlnr (); } 305 Bool isRasl () { return getSlice(0)->isRasl (); } 306 Bool isRadl () { return getSlice(0)->isRadl (); } 307 Bool isStsa () { return getSlice(0)->isStsa (); } 308 Bool isTsa () { return getSlice(0)->isTsa (); } 309 310 Void print( Int outputLevel ); 311 312 #if NH_3D 313 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 314 Int getViewIndex () { return m_viewIndex; } 315 316 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 317 Bool getIsDepth () { return m_isDepth; } 318 319 Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } 320 Int** getCodedScale () { return m_aaiCodedScale; } 321 Int** getCodedOffset() { return m_aaiCodedOffset; } 322 323 Void compressMotion(Int scale); 324 Void printMotion( ); 325 #if NH_3D_ARP 326 Void getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ); 327 #endif 328 #if NH_3D_QTLPC 329 Bool getReduceBitsFlag () { return m_bReduceBitsQTL; } 330 Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; } 213 331 #endif 214 332 #if NH_3D_NBDV 215 Int getNumDdvCandPics() {return m_iNumDdvCandPics; } 216 Int getDisCandRefPictures(Int iColPOC); 217 Void setRapRefIdx(UInt uiRapRefIdx) {m_uiRapRefIdx = uiRapRefIdx;} 218 Void setRapRefList(RefPicList eRefPicList) {m_eRapRefList = eRefPicList;} 219 Void setNumDdvCandPics (Int i) {m_iNumDdvCandPics = i; } 220 UInt getRapRefIdx() {return m_uiRapRefIdx; } 221 RefPicList getRapRefList() {return m_eRapRefList; } 222 Void checkTemporalIVRef(); 223 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 224 Void checkTextureRef( ); 225 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 333 Int getNumDdvCandPics() { return m_iNumDdvCandPics; } 334 Int getDisCandRefPictures(Int iColPOC); 335 Void setRapRefIdx(UInt uiRapRefIdx) { m_uiRapRefIdx = uiRapRefIdx; } 336 Void setRapRefList(RefPicList eRefPicList) { m_eRapRefList = eRefPicList; } 337 Void setNumDdvCandPics (Int i) { m_iNumDdvCandPics = i; } 338 UInt getRapRefIdx() { return m_uiRapRefIdx; } 339 RefPicList getRapRefList() { return m_eRapRefList; } 340 Void checkTemporalIVRef(); 341 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 342 Void checkTextureRef( ); 343 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 344 #endif 345 #endif 226 346 #endif 227 347 … … 241 361 242 362 #if NH_MV 363 364 class TComAu : public TComList<TComPic*> 365 { 366 367 public: 368 369 Int getPoc ( ) { assert(!empty()); return back()->getPOC (); } 370 Void setPicLatencyCount( Int picLatenyCount ); 371 Int getPicLatencyCount( ) { assert(!empty()); return back()->getPicLatencyCount(); } 372 TComPic* getPic ( Int nuhLayerId ); 373 Void addPic ( TComPic* pic, Bool pocUnkown ); 374 Bool containsPic ( TComPic* pic ); 375 }; 376 377 378 class TComSubDpb : public TComList<TComPic*> 379 { 380 private: 381 Int m_nuhLayerId; 382 public: 383 TComSubDpb( Int nuhLayerid ); 384 385 Int getLayerId ( ) { return m_nuhLayerId; } 386 387 TComPic* getPic ( Int poc ); 388 TComPic* getPicFromLsb ( Int pocLsb, Int maxPicOrderCntLsb ); 389 TComPic* getShortTermRefPic ( Int poc ); 390 TComList<TComPic*> getPicsMarkedNeedForOutput ( ); 391 392 Void markAllAsUnusedForReference ( ); 393 394 Void addPic ( TComPic* pic ); 395 Void removePics ( std::vector<TComPic*> picToRemove ); 396 Bool areAllPicsMarkedNotNeedForOutput( ); 397 }; 398 243 399 class TComPicLists 244 400 { 245 401 private: 246 TComList<TComList<TComPic*>*> m_lists; 247 #if NH_3D 248 const TComVPS* m_vps; 402 TComList<TComAu* > m_aus; 403 TComList<TComSubDpb*> m_subDpbs; 404 Bool m_printPicOutput; 405 #if NH_3D 406 const TComVPS* m_vps; 249 407 #endif 250 408 public: 251 Void push_back( TComList<TComPic*>* list ) { m_lists.push_back( list ); } 252 Int size () { return (Int) m_lists.size(); } 253 #if NH_3D_ARP 254 TComList<TComPic*>* getPicList ( Int layerIdInNuh ); 255 #endif 256 TComPic* getPic ( Int layerIdInNuh, Int poc ); 257 TComPicYuv* getPicYuv( Int layerIdInNuh, Int poc, Bool recon ); 258 #if NH_3D 259 Void setVPS ( const TComVPS* vps ) { m_vps = vps; }; 260 TComPic* getPic ( Int viewIndex, Bool depthFlag, Int poc ); 261 TComPicYuv* getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon ); 409 TComPicLists() { m_printPicOutput = false; }; 410 ~TComPicLists(); 411 412 // Add and remove single pictures 413 Void addNewPic( TComPic* pic ); 414 Void removePic( TComPic* pic ); 415 416 // Get Pics 417 TComPic* getPic ( Int layerIdInNuh, Int poc ); 418 TComPicYuv* getPicYuv ( Int layerIdInNuh, Int poc, Bool recon ); 419 420 // Get and AUs and SubDPBs 421 TComSubDpb* getSubDpb ( Int nuhLayerId, Bool create ); 422 TComList<TComSubDpb*>* getSubDpbs ( ); 423 424 TComAu* addAu ( Int poc ); 425 TComAu* getAu ( Int poc, Bool create ); 426 TComList<TComAu*>* getAus ( ); 427 TComList<TComAu*> getAusHavingPicsMarkedForOutput( ); 428 429 // Mark pictures and set POCs 430 Void markSubDpbAsUnusedForReference ( Int layerIdInNuh ); 431 Void markSubDpbAsUnusedForReference ( TComSubDpb& subDpb ); 432 Void markAllSubDpbAsUnusedForReference( ); 433 Void decrementPocsInSubDpb ( Int nuhLayerId, Int deltaPocVal ); 434 435 // Empty Sub DPBs 436 Void emptyAllSubDpbs ( ); 437 Void emptySubDpbs ( TComList<TComSubDpb*>* subDpbs); 438 Void emptySubDpb ( TComSubDpb* subDpb); 439 Void emptySubDpb ( Int nuhLayerId ); 440 441 Void emptyNotNeedForOutputAndUnusedForRef ( ); 442 Void emptySubDpbNotNeedForOutputAndUnusedForRef( Int layerId ); 443 Void emptySubDpbNotNeedForOutputAndUnusedForRef( TComSubDpb subDpb ); 444 445 // For printing to std::out 446 Void setPrintPicOutput ( Bool printPicOutput ) { m_printPicOutput = printPicOutput; }; 447 Void print(); 448 449 #if NH_3D 450 Void setVPS ( const TComVPS* vps ) { m_vps = vps; }; 451 TComPic* getPic ( Int viewIndex, Bool depthFlag, Int poc ); 452 TComPicYuv* getPicYuv ( Int viewIndex, Bool depthFlag, Int poc, Bool recon ); 262 453 #endif 263 454 264 Void print( ); 265 266 }; // END CLASS DEFINITION TComPicLists 267 268 #endif 455 }; 456 457 // END CLASS DEFINITION TComPicLists 458 459 #endif 460 269 461 270 462 //! \} -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r1313 r1321 166 166 // Set border extension flag 167 167 Void setBorderExtension(Bool b) { m_bIsBorderExtended = b; } 168 #if NH_MV 169 Bool getBorderExtension( ) { return m_bIsBorderExtended; } 170 #endif 168 171 #if NH_3D 169 172 // Set Function -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r1313 r1321 562 562 Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC(); 563 563 Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC(); 564 #if NH_MV_FIX_TICKET_106 565 #if NH_MV 566 Int layerIdL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getLayerId(); 567 Int layerIdL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getLayerId(); 568 #if NH_3D_ARP 569 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && layerIdL0 == layerIdL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 570 #else 571 if(RefPOCL0 == RefPOCL1 && layerIdL0 == layerIdL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 572 #endif 573 #else 574 if(RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 575 #endif 576 #else 564 577 #if NH_3D_ARP 565 578 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) … … 567 580 if(RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 568 581 #endif 582 #endif 569 583 { 570 584 return true; … … 584 598 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 585 599 } 586 #if H_3D_ARP || NH_3D_ALIGN_SPIVMP_RP // check this!600 #if NH_3D_ARP 587 601 if( pcCU->getARPW( uiPartAddr ) != 0 ) 588 602 { … … 1302 1316 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1303 1317 pcCU->clipMv(cMv); 1318 1319 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 1320 if ( g_traceMotionInfoBeforUniPred ) 1321 { 1322 std::cout << "RefPic POC : " << pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC() << std::endl; 1323 std::cout << "RefPic Layer Id: " << pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getLayerId() << std::endl; 1324 std::cout << "RefIdx : " << iRefIdx << std::endl; 1325 std::cout << "RefPIcList : " << eRefPicList << std::endl; 1326 } 1327 #endif 1328 1304 1329 #if NH_MV 1305 1330 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); … … 1309 1334 { 1310 1335 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() ) 1311 {1336 { 1312 1337 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi ); 1313 }1314 else1315 {1338 } 1339 else 1340 { 1316 1341 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi ); 1317 1342 } 1318 } 1319 else 1320 { 1321 #endif 1322 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++) 1323 { 1324 const ComponentID compID=ComponentID(comp); 1343 } 1344 else 1345 { 1346 #endif 1347 1348 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++) 1349 { 1350 const ComponentID compID=ComponentID(comp); 1325 1351 #if NH_3D_IC 1326 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );1352 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) ); 1327 1353 xPredInterBlk(compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) 1328 1354 #if NH_3D_ARP … … 1331 1357 , bICFlag ); 1332 1358 #else 1333 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );1334 #endif 1335 }1359 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) ); 1360 #endif 1361 } 1336 1362 #if NH_3D_ARP 1337 1363 } … … 1813 1839 ) 1814 1840 { 1841 #if NH_MV 1842 assert( refPic->getBorderExtension() ); 1843 #endif 1815 1844 Int refStride = refPic->getStride(compID); 1816 1845 Int dstStride = dstPic->getStride(compID); -
trunk/source/Lib/TLibCommon/TComPrediction.h
r1313 r1321 176 176 Void combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ); 177 177 #endif 178 178 #if NH_3D 179 179 Pel predIntraGetPredValDC ( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft ); 180 180 #endif 181 181 Pel* getPredictorPtr ( const ComponentID compID, const Bool bUseFilteredPredictions ) 182 182 { -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r1313 r1321 133 133 } 134 134 135 #if NH_MV 135 136 D_PRINT_INDENT( g_traceRDCost, "Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 137 #endif 136 138 return dRdCost; 137 139 } … … 603 605 cDtParam.bitDepth = bitDepth; 604 606 605 #if NH_3D_IC_FIX606 607 cDtParam.bUseIC = false; 607 #endif608 608 #if NH_3D_SDC_INTER 609 609 cDtParam.bUseSDCMRSAD = false; … … 3685 3685 } 3686 3686 3687 #if NH_MV 3687 3688 D_PRINT_INDENT( g_traceRDCost, "VSO Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 3689 #endif 3688 3690 3689 3691 return dRdCost; -
trunk/source/Lib/TLibCommon/TComRom.cpp
r1313 r1321 222 222 #if NH_MV 223 223 #if H_MV_HLS_PTL_LIMITS 224 g_generalTierAndLevelLimits[ Level::LEVEL1 ] = TComGeneralTierAndLevelLimits( 36864, 350, INT_MIN, 16, 1, 1 );225 g_generalTierAndLevelLimits[ Level::LEVEL2 ] = TComGeneralTierAndLevelLimits( 122880, 1500, INT_MIN, 16, 1, 1 );226 g_generalTierAndLevelLimits[ Level::LEVEL2_1 ] = TComGeneralTierAndLevelLimits( 245760, 3000, INT_MIN, 20, 1, 1 );227 g_generalTierAndLevelLimits[ Level::LEVEL3 ] = TComGeneralTierAndLevelLimits( 552960, 6000, INT_MIN, 30, 2, 2 );228 g_generalTierAndLevelLimits[ Level::LEVEL3_1 ] = TComGeneralTierAndLevelLimits( 983040, 10000, INT_MIN, 40, 3, 3 );224 g_generalTierAndLevelLimits[ Level::LEVEL1 ] = TComGeneralTierAndLevelLimits( 36864, 350, MIN_INT, 16, 1, 1 ); 225 g_generalTierAndLevelLimits[ Level::LEVEL2 ] = TComGeneralTierAndLevelLimits( 122880, 1500, MIN_INT, 16, 1, 1 ); 226 g_generalTierAndLevelLimits[ Level::LEVEL2_1 ] = TComGeneralTierAndLevelLimits( 245760, 3000, MIN_INT, 20, 1, 1 ); 227 g_generalTierAndLevelLimits[ Level::LEVEL3 ] = TComGeneralTierAndLevelLimits( 552960, 6000, MIN_INT, 30, 2, 2 ); 228 g_generalTierAndLevelLimits[ Level::LEVEL3_1 ] = TComGeneralTierAndLevelLimits( 983040, 10000, MIN_INT, 40, 3, 3 ); 229 229 g_generalTierAndLevelLimits[ Level::LEVEL4 ] = TComGeneralTierAndLevelLimits( 2228224, 12000, 30000, 75, 5, 5 ); 230 230 g_generalTierAndLevelLimits[ Level::LEVEL4_1 ] = TComGeneralTierAndLevelLimits( 2228224, 20000, 50000, 75, 5, 5 ); … … 546 546 Bool g_disableNumbering = false; 547 547 Bool g_disableHLSTrace = false; 548 UInt64 g_stopAtCounter 549 Bool g_traceCopyBack 550 Bool g_decTraceDispDer 551 Bool g_decTraceMvFromMerge 552 Bool g_decTracePicOutput 548 UInt64 g_stopAtCounter = 4660; 549 Bool g_traceCopyBack = false; 550 Bool g_decTraceDispDer = false; 551 Bool g_decTraceMvFromMerge = false; 552 Bool g_decTracePicOutput = false; 553 553 Bool g_startStopTrace = false; 554 Bool g_outputPos = false;555 Bool g_traceCameraParameters 556 Bool g_encNumberOfWrittenBits = false;554 Bool g_outputPos = false; 555 Bool g_traceCameraParameters = false; 556 Bool g_encNumberOfWrittenBits = false; 557 557 Bool g_traceEncFracBits = false; 558 558 Bool g_traceIntraSearchCost = false; … … 561 561 Bool g_traceModeCheck = false; 562 562 UInt g_indent = false; 563 Bool g_decNumBitsRead = false; 564 Bool g_traceMotionInfoBeforUniPred = false; 565 Bool g_traceMergeCandListConst = false; 566 Bool g_traceBitsRead = false; 567 Bool g_traceSubPBMotion = false; 563 568 #endif 564 569 #endif … … 693 698 Bool startTrace = false; 694 699 if ( g_startStopTrace && poc == 0 && layerId == 0 ) 695 { 700 { 696 701 startTrace = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 64 ) && ( cuHeight == 64 ); 697 }702 } 698 703 if ( startTrace ) 699 704 { … … 705 710 g_traceModeCheck = true; 706 711 g_traceCopyBack = false; 707 }712 } 708 713 Bool stopTrace = false; 709 714 if ( g_startStopTrace && poc == 0 && layerId == 0 ) -
trunk/source/Lib/TLibCommon/TComRom.h
r1313 r1321 91 91 extern const UChar g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH]; 92 92 extern const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]; 93 #if NH_3D_DMM 93 94 // ==================================================================================================================== 94 95 // Depth coding modes 95 96 // ==================================================================================================================== 96 #if NH_3D_DMM97 97 extern const WedgeResolution g_dmmWedgeResolution [6]; 98 98 extern const UChar g_dmm1TabIdxBits [6]; … … 193 193 extern Bool g_traceSAOCost; 194 194 extern UInt g_indent; 195 extern Bool g_traceMotionInfoBeforUniPred; 196 extern Bool g_traceMergeCandListConst; 197 extern Bool g_traceSubPBMotion; 198 extern Bool g_traceBitsRead; 195 199 #define DTRACE_CU(x,y) writeToTraceFile( x,y, g_traceCU ); 196 200 #define DTRACE_PU(x,y) writeToTraceFile( x,y, g_tracePU ); … … 199 203 #define DTRACE_PU_S(x) writeToTraceFile( x, g_tracePU ); 200 204 #define DTRACE_TU_S(x) writeToTraceFile( x, g_traceTU ); 201 202 205 #define D_DEC_INDENT( b ) decIndent ( b ); 203 206 #define D_PRINT_INC_INDENT( b, str ) prinStrIncIndent( b, str ); 204 207 #define D_PRINT_INDENT( b, str ) printStrIndent ( b, str); 205 206 208 Void tracePSHeader ( const Char* psName, Int layerId ); 207 209 Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt ); … … 209 211 UInt64 incSymbolCounter(); 210 212 Void stopAtPos ( Int poc, Int layerId, Int cuPelX, Int cuPelY, Int cuWidth, Int cuHeight ); 211 212 213 Void printStr ( std::string str ); 213 214 Void printStrIndent ( Bool b, std::string str ); 214 215 Void prinStrIncIndent ( Bool b, std::string str ); 215 216 Void decIndent ( Bool b ); 216 217 217 template <typename T> 218 218 std::string n2s ( T Number ) … … 222 222 return ss.str(); 223 223 }; 224 225 224 #endif 226 225 #else … … 232 231 #define DTRACE_CABAC_R( x,y ) 233 232 #define DTRACE_CABAC_N 233 #if NH_MV 234 234 #define DTRACE_CU(x,y) ; 235 235 #define DTRACE_PU(x,y) ; … … 238 238 #define DTRACE_PU_S(x) ; 239 239 #define DTRACE_TU_S(x) ; 240 241 240 #define D_DEC_INDENT( b ) ; 242 241 #define D_PRINT_INC_INDENT( b, str ); 243 242 #define D_PRINT_INDENT( b, str ); 244 243 #endif 245 244 #endif 246 245 const Char* nalUnitTypeToString(NalUnitType type); -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r1313 r1321 6 6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 9 * 9 10 * Redistribution and use in source and binary forms, with or without … … 112 113 , m_encCABACTableIdx (I_SLICE) 113 114 #if NH_MV 114 , m_availableForTMVPRefFlag ( true )115 115 , m_refPicSetInterLayer0 ( NULL ) 116 116 , m_refPicSetInterLayer1 ( NULL ) … … 121 121 , m_isDepth (false) 122 122 #endif 123 #if !H_MV_HLS7_GEN123 #if NH_MV 124 124 , m_pocResetFlag (false) 125 #endif126 #if NH_MV127 125 , m_crossLayerBlaFlag (false) 128 126 #endif … … 134 132 , m_pocResetIdc (0) 135 133 , m_pocResetPeriodId (0) 134 , m_hasPocResetPeriodIdPresent (false) 136 135 , m_fullPocResetFlag (false) 137 136 , m_pocLsbVal (0) 138 , m_pocMsb ValPresentFlag(false)139 , m_pocMsb Val(0)137 , m_pocMsbCycleValPresentFlag (false) 138 , m_pocMsbCycleVal (0) 140 139 , m_pocMsbValRequiredFlag (false) 141 140 #endif … … 155 154 #endif 156 155 { 156 157 #if NH_MV 158 m_shortTermRefPicSetIdx = 0; 159 m_numLongTermSps = 0; 160 m_numLongTermPics = 0; 161 for (Int i = 0; i < MAX_NUM_PICS_RPS; i++) 162 { 163 m_ltIdxSps [i] = 0; 164 m_deltaPocMsbCycleLt[i] = 0; 165 } 166 setSliceTemporalMvpEnabledFlag( false ); 167 #endif 157 168 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 158 169 { … … 790 801 #endif 791 802 803 792 804 Int TComSlice::getNumRpsCurrTempList() const 793 805 { … … 806 818 } 807 819 #if NH_MV 808 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();820 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics(); 809 821 #endif 810 822 return numRpsCurrTempList; … … 1097 1109 m_pcVPS = pSrc->m_pcVPS; 1098 1110 #endif 1099 m_pRPS = pSrc->m_pRPS; m_iLastIDR = pSrc->m_iLastIDR; 1111 m_pRPS = pSrc->m_pRPS; 1112 m_iLastIDR = pSrc->m_iLastIDR; 1100 1113 1101 1114 m_pcPic = pSrc->m_pcPic; … … 1155 1168 #if NH_MV 1156 1169 // Additional slice header syntax elements 1157 #if !H_MV_HLS7_GEN1158 1170 m_pocResetFlag = pSrc->m_pocResetFlag; 1159 #endif1160 1171 m_discardableFlag = pSrc->m_discardableFlag; 1161 1172 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; … … 2670 2681 } 2671 2682 } 2672 #endif 2673 2683 2684 #endif 2674 2685 #endif // NH_MV 2675 2686 … … 2719 2730 , m_uiBitsForPOC ( 8) 2720 2731 , m_numLongTermRefPicSPS ( 0) 2732 #if NH_MV 2733 , m_numShortTermRefPicSets ( 0) 2734 #endif 2721 2735 , m_uiMaxTrSize ( 32) 2722 2736 , m_bUseSAO (false) … … 2750 2764 for ( Int i = 0; i < MAX_TLAYER; i++ ) 2751 2765 { 2766 #if NH_MV 2767 m_uiSpsMaxLatencyIncreasePlus1[i] = 0; 2768 #else 2752 2769 m_uiMaxLatencyIncrease[i] = 0; 2770 #endif 2753 2771 m_uiMaxDecPicBuffering[i] = 1; 2754 2772 m_numReorderPics[i] = 0; … … 3081 3099 Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder ) 3082 3100 { 3083 const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));3084 3085 3101 if ( getMultiLayerExtSpsFlag() ) 3086 3102 { 3103 const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 3087 3104 Int layerIdx = 0; 3088 3105 while (layerIdx < (Int) targetDecLayerIdList.size() ) … … 3109 3126 // This preliminary fix needs to be checked. 3110 3127 assert( getNumReorderPics( i ) == maxNumReorderPics ); 3111 assert( get MaxLatencyIncrease( i ) == maxLatencyIncreasePlus1 );3128 assert( getSpsMaxLatencyIncreasePlus1( i ) == maxLatencyIncreasePlus1 ); 3112 3129 3113 3130 } … … 3117 3134 setMaxDecPicBuffering( maxDecPicBufferingMinus1 + 1 , i); 3118 3135 setNumReorderPics ( maxNumReorderPics, i ); 3119 set MaxLatencyIncrease( maxLatencyIncreasePlus1 -1 , i);3136 setSpsMaxLatencyIncreasePlus1( maxLatencyIncreasePlus1 , i); 3120 3137 } 3121 3138 } … … 3412 3429 } 3413 3430 } 3414 3415 3431 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ) 3416 3432 { … … 3435 3451 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[li]-1); rIdx ++) 3436 3452 { 3437 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true ); 3453 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( 1 ); 3454 m_apcRefPicList[li][rIdx]->print( 0 ); 3438 3455 3439 m_apcRefPicList[li][rIdx]->print( false );3440 3456 } 3441 3457 } … … 3456 3472 m_refPicSetInterLayer1 = refPicSetInterLayer1; 3457 3473 } 3474 3475 TComPic* TComSlice::getRefPicSetInterLayer( Int setIdc, Int i ) const 3476 { 3477 TComPic* pic = NULL; 3478 if (setIdc == 0 ) 3479 { 3480 pic = (*m_refPicSetInterLayer0)[ i ]; 3481 } 3482 else if (setIdc == 1 ) 3483 { 3484 pic = (*m_refPicSetInterLayer1)[ i ]; 3485 } 3486 3487 assert( pic != NULL ); 3488 3489 return pic; 3490 } 3491 3458 3492 3459 3493 TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId ) const … … 3572 3606 #endif 3573 3607 } 3608 #endif 3574 3609 #if NH_3D_NBDV 3575 3610 Void TComSlice::setDefaultRefView() … … 3687 3722 if( iViewIdx<getViewIndex() && !bIsDepth ) 3688 3723 { 3689 setBaseViewRefPicList( ivPicLists->get PicList( iLayerId), iViewIdx );3724 setBaseViewRefPicList( ivPicLists->getSubDpb( iLayerId, false ), iViewIdx ); 3690 3725 } 3691 3726 } … … 3710 3745 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 3711 3746 { 3712 existInterViewRef = true; 3747 existInterViewRef = true; 3713 3748 } 3714 3749 } … … 3833 3868 #if NH_3D 3834 3869 Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists ) 3835 { 3870 { 3836 3871 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 3837 { 3872 { 3838 3873 for ( Int depthId = 0; depthId < 2; depthId++ ) 3839 3874 { … … 3920 3955 } 3921 3956 #endif 3922 #endif 3957 3923 3958 3924 3959 … … 3933 3968 } 3934 3969 3935 Bool TComSlice::inferPocMsb ValPresentFlag()3970 Bool TComSlice::inferPocMsbCycleValPresentFlag() 3936 3971 { 3937 3972 Bool pocMsbValPresentFlag; … … 3952 3987 } 3953 3988 3989 3990 Void TComSlice::f834decProcForRefPicListConst() 3991 { 3992 // This process is invoked at the beginning of the decoding process for each P or B slice. 3993 assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE ); 3994 3995 // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into 3996 // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B 3997 // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0. 3998 3999 // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1 4000 // are derived as follows: 4001 4002 // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr ) 4003 Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() ); 4004 4005 // and the list RefPicListTemp0 is constructed as follows: 4006 std::vector<TComPic*> refPicListTemp0; 4007 refPicListTemp0.resize((MAX_NUM_REF+1),NULL); 4008 4009 const TComDecodedRps* decRps = getPic()->getDecodedRps(); 4010 4011 const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 4012 const std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 4013 const std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 4014 4015 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 4016 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 4017 const Int numPocLtCurr = decRps->m_numPocLtCurr; 4018 4019 const Int numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0; 4020 const Int numActiveRefLayerPics1 = decRps->m_numActiveRefLayerPics1; 4021 4022 const std::vector<TComPic*>& refPicSetInterLayer0 = decRps->m_refPicSetInterLayer0; 4023 const std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 4024 4025 Int rIdx = 0; 4026 while( rIdx < numRpsCurrTempList0 ) 4027 { 4028 for(Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4029 { 4030 refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ]; 4031 } 4032 4033 for(Int i = 0; i < numActiveRefLayerPics0; rIdx++, i++ ) 4034 { 4035 refPicListTemp0[ rIdx ] = refPicSetInterLayer0[ i ]; 4036 } 4037 4038 for(Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList0; rIdx++, i++ ) // (F 65) 4039 { 4040 refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ]; 4041 } 4042 4043 for(Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4044 { 4045 refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ]; 4046 } 4047 4048 for(Int i = 0; i < numActiveRefLayerPics1; rIdx++, i++ ) 4049 { 4050 refPicListTemp0[ rIdx ] = refPicSetInterLayer1[ i ]; 4051 } 4052 } 4053 4054 // The list RefPicList0 is constructed as follows: 4055 TComRefPicListModification* rplm = getRefPicListModification(); 4056 for( rIdx = 0; rIdx <= getNumRefIdxL0ActiveMinus1(); rIdx++ ) // (F 66) 4057 { 4058 m_apcRefPicList[ 0 ][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ]; 4059 // The decoding process below slice level requires the status 4060 // of the reference pictures, when decoding the RPS. So store it here. 4061 m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm(); 4062 m_aiRefPOCList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC(); 4063 m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId(); 4064 } 4065 4066 std::vector<TComPic*> refPicListTemp1; 4067 refPicListTemp1.resize((MAX_NUM_REF+1),NULL); 4068 4069 if (getSliceType() == B_SLICE ) 4070 { 4071 // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to 4072 // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows: 4073 Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() ); 4074 4075 rIdx = 0; 4076 while( rIdx < numRpsCurrTempList1 ) 4077 { 4078 for( Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4079 { 4080 refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ]; 4081 } 4082 for( Int i = 0; i< numActiveRefLayerPics1; rIdx++, i++ ) 4083 { 4084 refPicListTemp1[ rIdx ] = refPicSetInterLayer1[ i ]; 4085 } 4086 for( Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList1; rIdx++, i++ ) // (F 67) 4087 { 4088 refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ]; 4089 } 4090 for( Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4091 { 4092 refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ]; 4093 } 4094 for( Int i = 0; i< numActiveRefLayerPics0; rIdx++, i++ ) 4095 { 4096 refPicListTemp1[ rIdx ] = refPicSetInterLayer0[ i ]; 4097 } 4098 } 4099 } 4100 4101 if (getSliceType() == B_SLICE ) 4102 { 4103 // When the slice is a B slice, the list RefPicList1 is constructed as follows: 4104 for( rIdx = 0; rIdx <= getNumRefIdxL1ActiveMinus1(); rIdx++ ) // (F 68) 4105 { 4106 m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ]; 4107 4108 // The decoding process below slice level requires the marking status 4109 // of the reference pictures, when decoding the RPS. So store it here. 4110 m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm(); 4111 m_aiRefPOCList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC(); 4112 m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId(); 4113 } 4114 } 4115 } 4116 4117 4118 Void TComSlice::cl834DecProcForRefPicListConst() 4119 { 4120 // This process is invoked at the beginning of the decoding process for each P or B slice. 4121 assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE ); 4122 4123 // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into 4124 // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B 4125 // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0. 4126 4127 // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1 4128 // are derived as follows: 4129 4130 // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr ) 4131 Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() ); 4132 4133 // and the list RefPicListTemp0 is constructed as follows: 4134 std::vector<TComPic*> refPicListTemp0; 4135 refPicListTemp0.resize((MAX_NUM_REF+1),NULL); 4136 4137 const TComDecodedRps* decRps = getPic()->getDecodedRps(); 4138 4139 const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 4140 const std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 4141 const std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 4142 4143 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 4144 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 4145 const Int numPocLtCurr = decRps->m_numPocLtCurr; 4146 4147 Int rIdx = 0; 4148 while( rIdx < numRpsCurrTempList0 ) 4149 { 4150 for(Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4151 { 4152 refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ]; 4153 } 4154 4155 for(Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList0; rIdx++, i++ ) // (8 8) 4156 { 4157 refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ]; 4158 } 4159 4160 for(Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4161 { 4162 refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ]; 4163 } 4164 } 4165 4166 // The list RefPicList0 is constructed as follows: 4167 4168 TComRefPicListModification* rplm = getRefPicListModification(); 4169 for( rIdx = 0; rIdx <= getNumRefIdxL0ActiveMinus1(); rIdx++ ) // (8-9) 4170 { 4171 m_apcRefPicList[0][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ]; 4172 4173 // The decoding process below slice level requires the marking status 4174 // of the reference pictures, when decoding the RPS. So store it here. 4175 m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm(); 4176 m_aiRefPOCList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC(); 4177 m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId(); 4178 } 4179 4180 std::vector<TComPic*> refPicListTemp1; 4181 refPicListTemp1.resize((MAX_NUM_REF+1),NULL); 4182 4183 if (getSliceType() == B_SLICE ) 4184 { 4185 // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to 4186 // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows: 4187 Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() ); 4188 4189 rIdx = 0; 4190 while( rIdx < numRpsCurrTempList1 ) 4191 { 4192 for( Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4193 { 4194 refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ]; 4195 } 4196 for( Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList1; rIdx++, i++ ) // (8-10) 4197 { 4198 refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ]; 4199 } 4200 for( Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4201 { 4202 refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ]; 4203 } 4204 } 4205 } 4206 4207 if (getSliceType() == B_SLICE ) 4208 { 4209 // When the slice is a B slice, the list RefPicList1 is constructed as follows: 4210 for( rIdx = 0; rIdx <= getNumRefIdxL1ActiveMinus1(); rIdx++ ) // (F 68) 4211 { 4212 m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ]; 4213 4214 // The decoding process below slice level requires the marking status 4215 // of the reference pictures, when decoding the RPS. So store it here. 4216 m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm(); 4217 m_aiRefPOCList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC(); 4218 m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId(); 4219 } 4220 } 4221 } 4222 4223 Int TComSlice::getNumPicTotalCurr() const 4224 { 4225 Int numPicTotalCurr = 0; 4226 #if NH_MV_FIX_NUM_POC_TOTAL_CUR 4227 if ( !isIdr() ) 4228 { 4229 const TComStRefPicSet* stRps = getStRps( getCurrRpsIdx() ); 4230 #endif 4231 for( Int i = 0; i < stRps->getNumNegativePicsVar(); i++ ) 4232 { 4233 if( stRps->getUsedByCurrPicS0Var( i ) ) 4234 { 4235 numPicTotalCurr++; 4236 } 4237 } 4238 for( Int i = 0; i < stRps->getNumPositivePicsVar(); i++) //(7 55) 4239 { 4240 if( stRps->getUsedByCurrPicS1Var(i) ) 4241 { 4242 numPicTotalCurr++; 4243 } 4244 } 4245 for( Int i = 0; i < getNumLongTermSps() + getNumLongTermPics(); i++ ) 4246 { 4247 if( getUsedByCurrPicLtVar( i ) ) 4248 { 4249 numPicTotalCurr++; 4250 } 4251 } 4252 #if NH_MV_FIX_NUM_POC_TOTAL_CUR 4253 } 4254 #endif 4255 4256 if ( decProcAnnexF() ) 4257 { 4258 numPicTotalCurr += getNumActiveRefLayerPics(); 4259 } 4260 return numPicTotalCurr; 4261 } 4262 4263 4264 4265 Int TComSlice::getPocLsbLtVar( Int i ) 4266 { 4267 Int pocLsbLtVar; 4268 if (i < getNumLongTermSps() ) 4269 { 4270 4271 pocLsbLtVar = getSPS()->getLtRefPicPocLsbSps( getLtIdxSps( i ) ); 4272 } 4273 else 4274 { 4275 pocLsbLtVar = getPocLsbLt( i ); 4276 } 4277 return pocLsbLtVar; 4278 } 4279 4280 4281 Bool TComSlice::getUsedByCurrPicLtVar( Int i ) const 4282 { 4283 Bool usedByCurrPicLtVar; 4284 if (i < getNumLongTermSps() ) 4285 { 4286 usedByCurrPicLtVar = getSPS()->getUsedByCurrPicLtSPSFlag( getLtIdxSps( i ) ); 4287 } 4288 else 4289 { 4290 usedByCurrPicLtVar = getUsedByCurrPicLtFlag( i ); 4291 } 4292 return usedByCurrPicLtVar; 4293 } 4294 4295 4296 Int TComSlice::getDeltaPocMsbCycleLtVar( Int i ) const 4297 { 4298 Int deltaPocMsbCycleVar; 4299 if (i == 0 || i == getNumLongTermSps() ) 4300 { 4301 deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ); 4302 } 4303 else 4304 { 4305 deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ) + getDeltaPocMsbCycleLtVar( i - 1 ); 4306 } 4307 return deltaPocMsbCycleVar; 4308 } 3954 4309 3955 4310 #endif … … 4074 4429 4075 4430 Void TComSlice::checkInCompPredRefLayers() 4076 { 4431 { 4077 4432 if ( getInCompPredFlag() ) 4078 4433 { 4079 4434 for (Int i = 0; i < getNumCurCmpLIds(); i++ ) 4080 { 4435 { 4081 4436 assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL ); 4082 4437 // It is a requirement of bitstream conformance that there 4083 4438 // is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture, 4084 4439 // and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ]. 4440 } 4441 } 4442 } 4443 4444 Void TComSlice::setPocsInCurrRPSs() 4445 { 4446 // Currently only needed at decoder side; 4447 m_pocsInCurrRPSs.clear(); 4448 std::vector<TComPic*>** rpsCurr = getPic()->getDecodedRps()->m_refPicSetsCurr; 4449 for (Int i = 0 ; i < 3; i++ ) 4450 { 4451 for( Int j = 0; j < rpsCurr[i]->size(); j++ ) 4452 { 4453 m_pocsInCurrRPSs.push_back( (*rpsCurr[i])[j]->getPOC() ); 4085 4454 } 4086 4455 } … … 4613 4982 4614 4983 ProfileTierLevel* curProfileTierLevel = getGeneralPTL( ); 4984 assert( curProfileTierLevel != NULL ); 4615 4985 4616 4986 if( !profilePresentFlag ) … … 4644 5014 Void TComPTL::inferSubLayerValues(Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL) 4645 5015 { 4646 assert( k == 0 || refPTL != NULL ); 4647 5016 assert( k == 0 || refPTL != NULL ); 4648 5017 for (Int i = maxNumSubLayersMinus1; i >= 0; i--) 4649 5018 { … … 4665 5034 } 4666 5035 5036 assert( refProfileTierLevel != NULL ); 4667 5037 ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i ); 5038 assert( curProfileTierLevel != NULL ); 4668 5039 if( !getSubLayerLevelPresentFlag( i ) ) 4669 5040 { … … 4883 5254 } 4884 5255 5256 5257 Int TComDpbSize::getVpsMaxLatencyPictures( Int i, Int j ) const 5258 { 5259 return getMaxVpsNumReorderPics( i, j ) + getMaxVpsLatencyIncreasePlus1(i, j) - 1; 5260 } 5261 4885 5262 Void Window::scaleOffsets( Int scal ) 4886 5263 { … … 4894 5271 } 4895 5272 } 4896 #endif 5273 5274 Void TComStRefPicSet::inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder ) 5275 { 5276 if ( getInterRefPicSetPredictionFlag() ) 5277 { 5278 // When inter_ref_pic_set_prediction_flag is equal to 1, the variables DeltaPocS0[ stRpsIdx ][ i ], UsedByCurrPicS0[ stRpsIdx ][ i ], 5279 // NumNegativePics[ stRpsIdx ], DeltaPocS1[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ] and NumPositivePics[ stRpsIdx ] are 5280 // derived as follows: 5281 5282 Int i = 0; 5283 Int refRpsIdx = getRefRpsIdx( stRpsIdx ); 5284 TComStRefPicSet* refRps = sps->getStRefPicSet( refRpsIdx ); 5285 5286 for( Int j = refRps->getNumPositivePicsVar( ) - 1; j >= 0; j-- ) 5287 { 5288 Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps(); 5289 if( dPoc < 0 && getUseDeltaFlag( refRps->getNumNegativePicsVar( ) + j ) ) 5290 { 5291 setDeltaPocS0Var ( i, dPoc ); 5292 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumNegativePicsVar( ) + j ) ); 5293 } 5294 } 5295 if( getDeltaRps() < 0 && getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) // (7 59) 5296 { 5297 setDeltaPocS0Var( i, getDeltaRps() ); 5298 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ) ); 5299 } 5300 for( Int j = 0; j < refRps->getNumNegativePicsVar(); j++ ) 5301 { 5302 Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps(); 5303 if( dPoc < 0 && getUseDeltaFlag( j ) ) 5304 { 5305 setDeltaPocS0Var( i , dPoc); 5306 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( j )) ; 5307 } 5308 } 5309 5310 setNumNegativePicsVar( i ); 5311 5312 i = 0; 5313 for( Int j = refRps->getNumNegativePicsVar() - 1; j >= 0; j-- ) 5314 { 5315 Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps(); 5316 if( dPoc > 0 && getUseDeltaFlag( j ) ) 5317 { 5318 setDeltaPocS1Var( i, dPoc ); 5319 setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( j ) ) ; 5320 } 5321 } 5322 5323 if( getDeltaRps() > 0 && getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) // (7 60) 5324 { 5325 setDeltaPocS1Var( i , getDeltaRps() ); 5326 setUsedByCurrPicS1Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() )); 5327 } 5328 5329 for( Int j = 0; j < refRps->getNumPositivePicsVar( ); j++) 5330 { 5331 Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps(); 5332 if( dPoc > 0 && getUseDeltaFlag( refRps->getNumNegativePicsVar() + j ) ) 5333 { 5334 setDeltaPocS1Var( i, dPoc); 5335 setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( refRps->getNumNegativePicsVar() + j )); 5336 } 5337 } 5338 setNumPositivePicsVar( i ); 5339 } 5340 else 5341 { 5342 // When inter_ref_pic_set_prediction_flag is equal to 0, the variables NumNegativePics[ stRpsIdx ], NumPositivePics[ stRpsIdx ], 5343 // UsedByCurrPicS0[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ], DeltaPocS0[ stRpsIdx ][ i ] and DeltaPocS1[ stRpsIdx ][ i ] 5344 // are derived as follows: 5345 5346 setNumNegativePicsVar( getNumNegativePics( ) ); // (7 61) 5347 setNumPositivePicsVar( getNumPositivePics( ) ); // (7 62) 5348 5349 for (Int i = 0 ; i < getNumNegativePics(); i++ ) 5350 { 5351 setUsedByCurrPicS0Var( i, getUsedByCurrPicS0Flag( i ) ); // (7 63) 5352 if (i == 0 ) 5353 { 5354 setDeltaPocS0Var( i , -( getDeltaPocS0Minus1( i ) + 1 )); // (7 65) 5355 } 5356 else 5357 { 5358 setDeltaPocS0Var( i , getDeltaPocS0Var( i - 1 ) - ( getDeltaPocS0Minus1( i ) + 1 )); // (7 67) 5359 } 5360 } 5361 5362 for (Int i = 0 ; i < getNumPositivePics(); i++ ) 5363 { 5364 setUsedByCurrPicS1Var( i, getUsedByCurrPicS1Flag( i ) ); // (7 64) 5365 5366 if (i == 0 ) 5367 { 5368 setDeltaPocS1Var( i , getDeltaPocS1Minus1( i ) + 1 ); // (7 66) 5369 } 5370 else 5371 { 5372 setDeltaPocS1Var( i , getDeltaPocS1Var( i - 1 ) + ( getDeltaPocS1Minus1( i ) + 1 )); // (7 68) 5373 } 5374 } 5375 } 5376 } 5377 5378 #endif -
trunk/source/Lib/TLibCommon/TComSlice.h
r1313 r1321 53 53 class TComTrQuant; 54 54 #if NH_MV 55 class TComDecodedRps; 55 56 class TComPicLists; 56 57 class TComVPS; … … 68 69 69 70 /// Reference Picture Set class 71 72 #if NH_MV 73 class TComStRefPicSet 74 { 75 // This class is currently only used by the decoder. 76 // TBD: Modify encoder to use also it. 77 78 private: 79 80 // Syntax elements: 81 82 Bool m_interRefPicSetPredictionFlag; 83 Int m_deltaIdxMinus1; 84 Bool m_deltaRpsSign; 85 Int m_absDeltaRpsMinus1; 86 Bool m_usedByCurrPicFlag [ MAX_NUM_PICS_RPS ]; 87 Bool m_useDeltaFlag [ MAX_NUM_PICS_RPS ]; 88 Int m_numNegativePics; 89 Int m_numPositivePics; 90 Int m_deltaPocS0Minus1 [ MAX_NUM_PICS_RPS ]; 91 Bool m_usedByCurrPicS0Flag[ MAX_NUM_PICS_RPS ]; 92 Int m_deltaPocS1Minus1 [ MAX_NUM_PICS_RPS ]; 93 Bool m_usedByCurrPicS1Flag[ MAX_NUM_PICS_RPS ]; 94 95 // Semantic variables: 96 Int m_deltaPocS0Var [ MAX_NUM_PICS_RPS ]; 97 Int m_deltaPocS1Var [ MAX_NUM_PICS_RPS ]; 98 Int m_usedByCurrPicS0Var [ MAX_NUM_PICS_RPS ]; 99 Int m_usedByCurrPicS1Var [ MAX_NUM_PICS_RPS ]; 100 Int m_numNegativePicsVar ; 101 Int m_numPositivePicsVar ; 102 103 public: 104 105 TComStRefPicSet( ) 106 { 107 // Set default inheritance values: 108 setInterRefPicSetPredictionFlag( false ); 109 setDeltaIdxMinus1( 0 ); 110 for (Int j = 0; j < MAX_NUM_PICS_RPS; j++) 111 { 112 setUseDeltaFlag( j, true ); 113 } 114 } 115 116 // Syntax elements: 117 Void setInterRefPicSetPredictionFlag( Bool flag ) { m_interRefPicSetPredictionFlag = flag; } 118 Bool getInterRefPicSetPredictionFlag( ) const { return m_interRefPicSetPredictionFlag; } 119 120 Void setDeltaIdxMinus1( Int val ) { m_deltaIdxMinus1 = val; } 121 Int getDeltaIdxMinus1( ) const { return m_deltaIdxMinus1; } 122 123 Void setDeltaRpsSign( Bool flag ) { m_deltaRpsSign = flag; } 124 Bool getDeltaRpsSign( ) const { return m_deltaRpsSign; } 125 126 Void setAbsDeltaRpsMinus1( Int val ) { m_absDeltaRpsMinus1 = val; } 127 Int getAbsDeltaRpsMinus1( ) const { return m_absDeltaRpsMinus1; } 128 129 Void setUsedByCurrPicFlag( Int j, Bool flag ) { m_usedByCurrPicFlag[j] = flag; } 130 Bool getUsedByCurrPicFlag( Int j ) const { return m_usedByCurrPicFlag[j]; } 131 132 Void setUseDeltaFlag( Int j, Bool flag ) { m_useDeltaFlag[j] = flag; } 133 Bool getUseDeltaFlag( Int j ) const { return m_useDeltaFlag[j]; } 134 135 Void setNumNegativePics( Int val ) { m_numNegativePics = val; } 136 Int getNumNegativePics( ) const { return m_numNegativePics; } 137 138 Void setNumPositivePics( Int val ) { m_numPositivePics = val; } 139 Int getNumPositivePics( ) const { return m_numPositivePics; } 140 141 Void setDeltaPocS0Minus1( Int i, Int val ) { m_deltaPocS0Minus1[i] = val; } 142 Int getDeltaPocS0Minus1( Int i ) const { return m_deltaPocS0Minus1[i]; } 143 144 Void setUsedByCurrPicS0Flag( Int i, Bool flag ) { m_usedByCurrPicS0Flag[i] = flag; } 145 Bool getUsedByCurrPicS0Flag( Int i ) const { return m_usedByCurrPicS0Flag[i]; } 146 147 Void setDeltaPocS1Minus1( Int i, Int val ) { m_deltaPocS1Minus1[i] = val; } 148 Int getDeltaPocS1Minus1( Int i ) const { return m_deltaPocS1Minus1[i]; } 149 150 Void setUsedByCurrPicS1Flag( Int i, Bool flag ) { m_usedByCurrPicS1Flag[i] = flag; } 151 Bool getUsedByCurrPicS1Flag( Int i ) const { return m_usedByCurrPicS1Flag[i]; } 152 153 // Semantics variables: 154 Int getRefRpsIdx(Int stRpsIdx ) const { return ( stRpsIdx - (getDeltaIdxMinus1() + 1) ); } 155 Int getDeltaRps() const { return ( ( 1 - 2 * getDeltaRpsSign() ) * ( getAbsDeltaRpsMinus1() + 1 ) ); } 156 Int getNumDeltaPocs() const { return ( getNumNegativePicsVar() + getNumPositivePicsVar()); } 157 158 Void setNumNegativePicsVar( Int val ) { m_numNegativePicsVar = val; } 159 Int getNumNegativePicsVar( ) const { return m_numNegativePicsVar; } 160 161 Void setNumPositivePicsVar( Int val ) { m_numPositivePicsVar = val; } 162 Int getNumPositivePicsVar( ) const { return m_numPositivePicsVar; } 163 164 Void setDeltaPocS0Var( Int i, Int val ) { m_deltaPocS0Var[i] = val; } 165 Int getDeltaPocS0Var( Int i ) const { return m_deltaPocS0Var[i]; } 166 167 Void setUsedByCurrPicS0Var( Int i, Bool flag ) { m_usedByCurrPicS0Var[i] = flag; } 168 Bool getUsedByCurrPicS0Var( Int i ) const { return m_usedByCurrPicS0Var[i]; } 169 170 Void setDeltaPocS1Var( Int i, Int val ) { m_deltaPocS1Var[i] = val; } 171 Int getDeltaPocS1Var( Int i ) const { return m_deltaPocS1Var[i]; } 172 173 Void setUsedByCurrPicS1Var( Int i, Bool flag ) { m_usedByCurrPicS1Var[i] = flag; } 174 Bool getUsedByCurrPicS1Var( Int i ) const { return m_usedByCurrPicS1Var[i]; } 175 176 Void inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder ); 177 }; 178 179 #endif 180 70 181 class TComReferencePictureSet 71 182 { … … 302 413 { 303 414 ProfileTierLevel m_generalPTL; 415 #if !NH_MV 304 416 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) 305 417 Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; 306 418 Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; 419 #else 420 ProfileTierLevel m_subLayerPTL [MAX_TLAYER]; // However, highest index is 6, so we need one more. 421 Bool m_subLayerProfilePresentFlag [MAX_TLAYER]; 422 Bool m_subLayerLevelPresentFlag [MAX_TLAYER]; 423 #endif 307 424 308 425 public: … … 804 921 805 922 Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; } 806 Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) const { return m_maxVpsLatencyIncreasePlus1[i][j]; } 923 Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) const { return m_maxVpsLatencyIncreasePlus1[i][j]; } 924 Int getVpsMaxLatencyPictures ( Int i, Int j ) const; 807 925 }; 808 926 #endif … … 901 1019 Int m_defaultDirectDependencyType; 902 1020 903 #if H_MV_HLS7_GEN904 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS];905 #endif906 1021 Bool m_vpsVuiPresentFlag; 907 1022 TComVPSVUI m_vpsVUI; 908 #if !H_MV_HLS7_GEN909 1023 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; 910 #endif911 1024 912 1025 // VPS EXTENSION SEMANTICS VARIABLES … … 1119 1232 Void setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val ) { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ] = val; } 1120 1233 Int getLayerSetIdxForOlsMinus1( Int outLayerSetIdx ) const { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; } 1121 #if NH_MV_FIX_TICKET_1051122 1234 Int getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx ) const { return gCeilLog2( getNumLayerSets() - 1 ); } 1123 #else1124 Int getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx ) const { return gCeilLog2( getNumLayerSets() ); }1125 #endif1126 1235 1127 1236 Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } … … 1803 1912 1804 1913 TComRPSList m_RPSList; 1914 #if NH_MV 1915 std::vector<TComStRefPicSet> m_stRefPicSets; 1916 #endif 1805 1917 Bool m_bLongTermRefsPresent; 1806 1918 Bool m_TMVPFlagsPresent; … … 1825 1937 UInt m_uiBitsForPOC; 1826 1938 UInt m_numLongTermRefPicSPS; 1939 #if NH_MV 1940 Int m_numShortTermRefPicSets; 1941 #endif 1827 1942 UInt m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; 1828 1943 Bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS]; … … 1838 1953 TComScalingList m_scalingList; 1839 1954 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 1955 #if NH_MV 1956 UInt m_uiSpsMaxLatencyIncreasePlus1[MAX_TLAYER]; 1957 // Calling a member m_uiMaxLatencyIncrease although it is m_uiMaxLatencyIncreasePlus1 is really bad style. 1958 #else 1840 1959 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 1960 #endif 1841 1961 1842 1962 Bool m_useStrongIntraSmoothing; … … 1911 2031 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 1912 2032 2033 #if NH_MV 2034 UInt getNumLongTermRefPicsSps() const { return m_numLongTermRefPicSPS; } 2035 #endif 2036 1913 2037 UInt getNumLongTermRefPicSPS() const { return m_numLongTermRefPicSPS; } 1914 2038 Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } … … 1939 2063 Void setBitsForPOC( UInt u ) { m_uiBitsForPOC = u; } 1940 2064 UInt getBitsForPOC() const { return m_uiBitsForPOC; } 2065 #if NH_MV 2066 UInt getMaxPicOrderCntLsb() const { return (1 << ( getLog2MaxPicOrderCntLsbMinus4() + 4) ); } 2067 Int getLog2MaxPicOrderCntLsbMinus4() const { return (getBitsForPOC() - 4); } 2068 #endif 1941 2069 Bool getUseAMP() const { return m_useAMP; } 1942 2070 Void setUseAMP( Bool b ) { m_useAMP = b; } … … 1954 2082 const TComRPSList* getRPSList() const { return &m_RPSList; } 1955 2083 TComRPSList* getRPSList() { return &m_RPSList; } 2084 #if NH_MV 2085 Void initStRefPicSets( ) { m_stRefPicSets.resize( getNumShortTermRefPicSets() ); } 2086 TComStRefPicSet* getStRefPicSet( Int i ) { return &(m_stRefPicSets[i]); } 2087 const TComStRefPicSet* getStRefPicSet( Int i ) const { return &(m_stRefPicSets[i]); } 2088 Bool getLongTermRefPicsPresentFlag() const { return m_bLongTermRefsPresent; } 2089 Void setLongTermRefPicsPresentFlag(Bool b) { m_bLongTermRefsPresent=b; } 2090 #else 1956 2091 Bool getLongTermRefsPresent() const { return m_bLongTermRefsPresent; } 1957 2092 Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } 2093 #endif 1958 2094 Bool getTMVPFlagsPresent() const { return m_TMVPFlagsPresent; } 1959 2095 Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } 2096 #if NH_MV 2097 Bool getSpsTemporalMvpEnabledFlag() const { return m_TMVPFlagsPresent; } 2098 #endif 1960 2099 // physical transform 1961 2100 Void setMaxTrSize( UInt u ) { m_uiMaxTrSize = u; } … … 1988 2127 Void setPCMFilterDisableFlag( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } 1989 2128 Bool getPCMFilterDisableFlag() const { return m_bPCMFilterDisableFlag; } 1990 2129 #if NH_MV 2130 Void setNumShortTermRefPicSets( Int val ) { m_numShortTermRefPicSets = val; } 2131 Int getNumShortTermRefPicSets( )const { return m_numShortTermRefPicSets; } 2132 #endif 1991 2133 Bool getScalingListFlag() const { return m_scalingListEnabledFlag; } 1992 2134 Void setScalingListFlag( Bool b ) { m_scalingListEnabledFlag = b; } … … 1998 2140 UInt getMaxDecPicBuffering(UInt tlayer) const { return m_uiMaxDecPicBuffering[tlayer]; } 1999 2141 Void setMaxDecPicBuffering( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } 2142 #if NH_MV 2143 UInt getSpsMaxDecPicBufferingMinus1(UInt tlayer) const { return m_uiMaxDecPicBuffering[tlayer] -1 ; } 2144 UInt getSpsMaxLatencyIncreasePlus1(UInt tlayer) const { return m_uiSpsMaxLatencyIncreasePlus1[tlayer]; } 2145 Void setSpsMaxLatencyIncreasePlus1( UInt ui , UInt tlayer) { m_uiSpsMaxLatencyIncreasePlus1[tlayer] = ui; } 2146 Int getSpsMaxLatencyPictures( Int i ) const { return ( getSpsMaxNumReorderPics(i) + getSpsMaxLatencyIncreasePlus1(i)-1); } 2147 #else 2000 2148 UInt getMaxLatencyIncrease(UInt tlayer) const { return m_uiMaxLatencyIncrease[tlayer]; } 2001 2149 Void setMaxLatencyIncrease( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } 2150 #endif 2151 2152 #if NH_MV 2153 Int getSpsMaxNumReorderPics(Int i ) const { return getNumReorderPics( i ); } 2154 #endif 2002 2155 2003 2156 Void setUseStrongIntraSmoothing(Bool bVal) { m_useStrongIntraSmoothing = bVal; } … … 2133 2286 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; } 2134 2287 #if NH_MV 2135 // Why not a listIdx for all members, would avoid code duplication??2288 2136 2289 Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } 2137 2290 UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } 2138 2291 Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_refPicListModificationFlagL0 : m_refPicListModificationFlagL1 ) = flag; } 2139 2292 Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_refPicListModificationFlagL0 : m_refPicListModificationFlagL1; } 2293 2294 Int getListEntryL0( Int i) const { assert(i<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[i]; } 2295 Int getListEntryL1( Int i) const { assert(i<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[i]; } 2296 2297 Int getListEntryLXLen( Int numPicTotalCur ) const { return gCeilLog2( numPicTotalCur ); } 2298 2299 Void setListEntryL0( Int i, Int val ) { m_RefPicSetIdxL0[i] = val; } 2300 Void setListEntryL1( Int i, Int val ) { m_RefPicSetIdxL1[i] = val; } 2301 2302 2140 2303 #endif 2141 2304 }; … … 2470 2633 private: 2471 2634 // Bitstream writing 2635 #if NH_MV 2636 Bool m_firstSliceSegmentInPicFlag; 2637 #endif 2472 2638 Bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE]; 2473 2639 Int m_iPPSId; ///< picture parameter set ID … … 2475 2641 #if NH_MV 2476 2642 Int m_slicePicOrderCntLsb; 2643 Bool m_shortTermRefPicSetSpsFlag; 2644 Int m_shortTermRefPicSetIdx; 2645 Int m_numLongTermSps; 2646 Int m_numLongTermPics; 2647 Int m_ltIdxSps [MAX_NUM_PICS_RPS]; 2648 Int m_pocLsbLt [MAX_NUM_PICS_RPS]; 2649 Bool m_usedByCurrPicLtFlag [MAX_NUM_PICS_RPS]; 2650 Bool m_deltaPocMsbPresentFlag [MAX_NUM_PICS_RPS]; 2651 Int m_deltaPocMsbCycleLt [MAX_NUM_PICS_RPS]; 2652 Bool m_sliceTemporalMvpEnabledFlag; 2653 TComStRefPicSet m_stRefPicSet; 2477 2654 #endif 2478 2655 Int m_iPOC; … … 2510 2687 Int m_aiRefPOCList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; 2511 2688 #if NH_MV 2512 Int m_aiRefLayerIdList[2][MAX_NUM_REF+1];2689 Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; 2513 2690 #endif 2514 2691 Bool m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; … … 2570 2747 SliceType m_encCABACTableIdx; // Used to transmit table selection across slices. 2571 2748 #if NH_MV 2572 Bool m_availableForTMVPRefFlag; 2573 #endif 2574 2575 #if NH_MV 2749 2576 2750 std::vector<TComPic*>* m_refPicSetInterLayer0; 2577 2751 std::vector<TComPic*>* m_refPicSetInterLayer1; … … 2584 2758 2585 2759 // Additional slice header syntax elements 2586 #if !H_MV_HLS7_GEN2587 2760 Bool m_pocResetFlag; 2588 #endif 2761 2589 2762 Bool m_crossLayerBlaFlag; 2590 2763 Bool m_discardableFlag; … … 2596 2769 Int m_pocResetIdc; 2597 2770 Int m_pocResetPeriodId; 2771 2772 Bool m_hasPocResetPeriodIdPresent; 2773 DecodingProcess m_decodingProcess; 2774 DecodingProcess m_decProcPocAndRps; 2598 2775 Bool m_fullPocResetFlag; 2599 2776 Int m_pocLsbVal; 2600 Bool m_pocMsb ValPresentFlag;2601 Int m_pocMsb Val;2777 Bool m_pocMsbCycleValPresentFlag; 2778 Int m_pocMsbCycleVal; 2602 2779 Bool m_pocMsbValRequiredFlag; 2603 2780 … … 2676 2853 Void setSlicePicOrderCntLsb( Int i ) { m_slicePicOrderCntLsb = i; } 2677 2854 Int getSlicePicOrderCntLsb( ) const { return m_slicePicOrderCntLsb; } 2855 2856 Bool getFirstSliceSegementInPicFlag() const { return m_firstSliceSegmentInPicFlag; } 2857 Void setFirstSliceSegementInPicFlag(Bool val) { m_firstSliceSegmentInPicFlag = val; } 2678 2858 #endif 2679 2859 Bool getPicOutputFlag() const { return m_PicOutputFlag; } … … 2734 2914 Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } 2735 2915 Void setARPStepNum( TComPicLists*ivPicLists ); 2916 Void setPocsInCurrRPSs( ); 2917 2736 2918 TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } 2737 2919 UInt getARPStepNum( ) { return m_nARPStepNum; } … … 2746 2928 Bool getMvdL1ZeroFlag() const { return m_bLMvdL1Zero; } 2747 2929 Int getNumRpsCurrTempList() const; 2930 #if NH_MV 2931 Int getNumPicTotalCurr() const; 2932 #endif 2748 2933 Int getList1IdxToList0Idx( Int list1Idx ) const { return m_list1IdxToList0Idx[list1Idx]; } 2749 2934 Void setReferenced(Bool b) { m_bRefenced = b; } … … 2753 2938 Void setNalUnitType( NalUnitType e ) { m_eNalUnitType = e; } 2754 2939 NalUnitType getNalUnitType() const { return m_eNalUnitType; } 2940 #if NH_MV 2941 std::string getNalUnitTypeString( ) { return NALU_TYPE_STR[ getNalUnitType() ]; }; 2942 #endif 2755 2943 Bool getRapPicFlag() const; 2756 2944 Bool getIdrPicFlag() const { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2757 2945 Bool isIRAP() const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2946 #if NH_MV 2947 Bool isBla() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); } 2948 Bool isIdr() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ); } 2949 Bool isCra() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ); } 2950 2951 Bool isSlnr() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 2952 getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 2953 getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 2954 getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 2955 getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || 2956 getNalUnitType() == NAL_UNIT_RESERVED_VCL_N10 || 2957 getNalUnitType() == NAL_UNIT_RESERVED_VCL_N12 || 2958 getNalUnitType() == NAL_UNIT_RESERVED_VCL_N14 ); } 2959 2960 Bool isRasl() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N ); } 2961 Bool isRadl() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ); } 2962 Bool isStsa() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ); } 2963 Bool isTsa() const { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ); } 2964 2965 Bool decProcClause8() const { return ( m_decodingProcess == CLAUSE_8 ); } 2966 Bool decProcAnnexF() const { return ( decProcAnnexG() || decProcAnnexH() || decProcAnnexI() ) ; } 2967 Bool decProcAnnexG() const { return ( m_decodingProcess == ANNEX_G || decProcAnnexI() ); } 2968 Bool decProcAnnexH() const { return ( m_decodingProcess == ANNEX_H ); } 2969 Bool decProcAnnexI() const { return ( m_decodingProcess == ANNEX_I ); } 2970 Int getCurrRpsIdx() const { return ( getShortTermRefPicSetSpsFlag() ? getShortTermRefPicSetIdx() : getSPS()->getNumShortTermRefPicSets() ) ;} 2971 2972 #endif 2973 2974 2758 2975 Void checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2759 2976 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled); … … 2774 2991 Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } 2775 2992 Void setNumRefIdx( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } 2993 #if NH_MV 2994 Int getNumRefIdxL0ActiveMinus1() const { return ( getNumRefIdx(REF_PIC_LIST_0) -1); } 2995 Int getNumRefIdxL1ActiveMinus1() const { return ( getNumRefIdx(REF_PIC_LIST_1) -1); } 2996 #endif 2776 2997 Void setPic( TComPic* p ) { m_pcPic = p; } 2777 2998 Void setDepth( Int iDepth ) { m_iDepth = iDepth; } … … 2827 3048 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 2828 3049 #if NH_MV 2829 Int getTemporalId ( ){ return (Int) m_uiTLayer; }3050 Int getTemporalId( ) const { return (Int) m_uiTLayer; } 2830 3051 #endif 2831 3052 … … 2836 3057 #if NH_MV 2837 3058 Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); 3059 Void f834decProcForRefPicListConst(); 3060 Void cl834DecProcForRefPicListConst(); 3061 2838 3062 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); 2839 3063 static Void markCurrPic ( TComPic* currPic ); … … 2852 3076 Void setNoRaslOutputFlag( Bool val ) { m_noRaslOutputFlag = val; } 2853 3077 Bool getNoRaslOutputFlag() const { return m_noRaslOutputFlag; } 3078 2854 3079 2855 3080 Void setHandleCraAsBlaFlag( Bool val ) { m_handleCraAsBlaFlag = val; } … … 2915 3140 Bool getLFCrossSliceBoundaryFlag() { return m_LFCrossSliceBoundaryFlag; } 2916 3141 3142 #if NH_MV 3143 Void setShortTermRefPicSetSpsFlag( Bool flag ) { m_shortTermRefPicSetSpsFlag = flag; } 3144 Bool getShortTermRefPicSetSpsFlag( ) const { return m_shortTermRefPicSetSpsFlag; } 3145 3146 Int getShortTermRefPicSetIdxLen() const { return gCeilLog2( getSPS()->getNumShortTermRefPicSets() ); } 3147 Void setShortTermRefPicSetIdx( Int val ) { m_shortTermRefPicSetIdx = val; } 3148 Int getShortTermRefPicSetIdx( ) const { return m_shortTermRefPicSetIdx; } 3149 3150 Void setNumLongTermSps( Int val ) { m_numLongTermSps = val; } 3151 Int getNumLongTermSps( ) const { return m_numLongTermSps; } 3152 3153 Void setNumLongTermPics( Int val ) { m_numLongTermPics = val; } 3154 Int getNumLongTermPics( ) const { return m_numLongTermPics; } 3155 3156 Int getLtIdxSpsLen() const { return gCeilLog2( getSPS()->getNumLongTermRefPicsSps() ); } 3157 Void setLtIdxSps( Int i, Int val ) { m_ltIdxSps[i] = val; } 3158 Int getLtIdxSps( Int i ) const { return m_ltIdxSps[i]; } 3159 3160 Int getPocLsbLtLen() const { return (getSPS()->getLog2MaxPicOrderCntLsbMinus4()+ 4); } 3161 Void setPocLsbLt( Int i, Int val ) { m_pocLsbLt[i] = val; } 3162 Int getPocLsbLt( Int i ) const { return m_pocLsbLt[i]; } 3163 3164 Void setUsedByCurrPicLtFlag( Int i, Bool flag ) { m_usedByCurrPicLtFlag[i] = flag; } 3165 Bool getUsedByCurrPicLtFlag( Int i ) const { return m_usedByCurrPicLtFlag[i]; } 3166 3167 Void setDeltaPocMsbPresentFlag( Int i, Bool flag ) { m_deltaPocMsbPresentFlag[i] = flag; } 3168 Bool getDeltaPocMsbPresentFlag( Int i ) const { return m_deltaPocMsbPresentFlag[i]; } 3169 3170 Void setDeltaPocMsbCycleLt( Int i, Int val ) { m_deltaPocMsbCycleLt[i] = val; } 3171 Int getDeltaPocMsbCycleLt( Int i ) const { return m_deltaPocMsbCycleLt[i]; } 3172 3173 Void setSliceTemporalMvpEnabledFlag( Bool flag ) { m_enableTMVPFlag = flag; } 3174 Bool getSliceTemporalMvpEnabledFlag( ) const { return m_enableTMVPFlag; } 3175 3176 TComStRefPicSet* getLocalStRps( ) { return &m_stRefPicSet; }; 3177 const TComStRefPicSet* getStRps( Int stRpsIdx ) const { return ( (stRpsIdx == getSPS()->getNumShortTermRefPicSets()) ? &m_stRefPicSet : getSPS()->getStRefPicSet( stRpsIdx ) ); }; 3178 3179 #endif 3180 2917 3181 Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } 2918 3182 Bool getEnableTMVPFlag() { return m_enableTMVPFlag; } … … 2922 3186 2923 3187 #if NH_MV 2924 Void setAvailableForTMVPRefFlag( Bool b ) { m_availableForTMVPRefFlag = b; }2925 Bool getAvailableForTMVPRefFlag() { return m_availableForTMVPRefFlag; }2926 2927 3188 Void setLayerId ( Int layerId ) { m_layerId = layerId; } 2928 3189 Int getLayerId () const { return m_layerId; } … … 2932 3193 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 2933 3194 Int getViewIndex () const { return m_viewIndex; } 3195 3196 Void setDecodingProcess ( DecodingProcess decProc ) { m_decodingProcess = decProc; } 3197 3198 2934 3199 #if NH_3D 2935 3200 #if NH_3D_TMVP … … 2986 3251 Void checkCrossLayerBlaFlag ( ) const ; 2987 3252 2988 #if !H_MV_HLS7_GEN3253 #if NH_MV 2989 3254 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2990 3255 Bool getPocResetFlag( ) const { return m_pocResetFlag; } … … 3010 3275 Void checkPocResetIdc( ) const { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) ) || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); } 3011 3276 3277 3012 3278 Void setPocResetPeriodId( Int val ) { m_pocResetPeriodId = val; } 3013 3279 Int getPocResetPeriodId( ) const { return m_pocResetPeriodId; } … … 3020 3286 Void checkPocLsbVal( ) const { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) ) || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); } 3021 3287 3288 #if NH_MV 3289 Void setHasPocResetPeriodIdPresent( Bool val ) { m_hasPocResetPeriodIdPresent = val; } 3290 Bool getHasPocResetPeriodIdPresent( ) const { return m_hasPocResetPeriodIdPresent; } 3291 3292 Void setPocMsbCycleValPresentFlag( Bool flag ) { m_pocMsbCycleValPresentFlag = flag; } 3293 Bool getPocMsbCycleValPresentFlag( ) const { return m_pocMsbCycleValPresentFlag; } 3294 3295 Void setPocMsbCycleVal( Int val ) { m_pocMsbCycleVal = val; } 3296 Int getPocMsbCycleVal( ) const { return m_pocMsbCycleVal; } 3297 3298 Int getPocLsbLtVar(Int i); 3299 Bool getUsedByCurrPicLtVar(Int i) const; 3300 Int getDeltaPocMsbCycleLtVar( Int i ) const; 3301 3302 #else 3022 3303 Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; } 3023 3304 Bool getPocMsbValPresentFlag( ) const { return m_pocMsbValPresentFlag; } … … 3025 3306 Void setPocMsbVal( Int val ) { m_pocMsbVal = val; } 3026 3307 Int getPocMsbVal( ) const { return m_pocMsbVal; } 3308 #endif 3309 3027 3310 3028 3311 Bool getCraOrBlaPicFlag() const { return ( getCraPicFlag() || getBlaPicFlag() ); } 3029 3312 Bool getPocMsbValRequiredFlag() const { return ( getCraOrBlaPicFlag() && ( getVPS()->getVpsPocLsbAlignedFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 ) ); } 3030 3313 3031 UInt getPocLsbValLen() const { return getSPS()->getBitsForPOC(); }; //log2_max_pic_order_cnt_lsb_minus4 + 4 3314 UInt getPocLsbValLen() const { return getSPS()->getBitsForPOC(); }; //log2_max_pic_order_cnt_lsb_minus4 + 4 3032 3315 3033 3316 Bool getBlaPicFlag() const … … 3069 3352 Void deriveInCmpPredAndCpAvailFlag( ); 3070 3353 Void init3dToolParameters(); 3071 Void checkInCompPredRefLayers(); ;3354 Void checkInCompPredRefLayers(); 3072 3355 3073 3356 Bool getIvMvPredFlag ( ) { return m_ivMvPredFlag ; }; … … 3095 3378 #endif 3096 3379 #endif 3380 #if NH_MV 3381 TComPic* getRefPicSetInterLayer( Int setIdc, Int i ) const; 3382 #endif 3383 3097 3384 // Inference 3385 #if NH_MV 3386 Bool inferPocMsbCycleValPresentFlag(); 3387 #else 3098 3388 Bool inferPocMsbValPresentFlag(); 3389 #endif 3099 3390 #endif 3100 3391 protected: -
trunk/source/Lib/TLibCommon/TypeDef.h
r1313 r1321 61 61 #define NH_3D ( HEVC_EXT == 2) 62 62 ///////////////////////////////////////////////////////////////////////////////////////// 63 /////////////////////////////////// FIXES /////////////////////////////////// 64 ///////////////////////////////////////////////////////////////////////////////////////// 65 #if NH_MV 66 #define NH_MV_FIX_TICKET_106 1 // Identical motion check. 67 #define NH_MV_FIX_NO_REF_PICS_CHECK 1 // !!SPEC!! 68 #define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 69 #define NH_MV_FIX_NUM_POC_TOTAL_CUR 1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!! 70 #endif 71 #if NH_3D 72 #define H_3D_FIX_ARP_CHECK_NOT_IN_DPB 1 73 #endif 74 ///////////////////////////////////////////////////////////////////////////////////////// 63 75 /////////////////////////////////// MAJOR DEFINES /////////////////////////////////// 64 76 ///////////////////////////////////////////////////////////////////////////////////////// 65 77 #if NH_MV 66 #define NH_MV_FIX_TICKET_105 1 // layer_set_idx_for_ols_minus1 length67 #define NH_MV_FIX_TICKET_100 1 // Extra slice header bits68 78 #define H_MV_ENC_DEC_TRAC 1 //< CU/PU level tracking 69 #define H_MV_ENC_DEC_TRAC_FIX 1 // by SHARP70 79 #if NH_3D 71 // FIXES72 #define NH_3D_FIX_TICKET_98 1 // Writing of depth intra skip flag73 #define NH_3D_FIX_TICKET_101 ( 1 && NH_3D_VER141_DEC_COMP_FLAG ) // Camera parameters for depth74 #define NH_3D_DIS_FIX 175 #define NH_3D_ENC_DEPTH_FIX 1 // Fix Intra TU coding.76 #define NH_3D_INTRA_SDC_RD_FIX 1 // Fix in RD- decision of intra SDC.77 #define NH_3D_DLT_FIX 1 // Fixes numbers of parsed DLTs78 #define NH_3D_VER141_DEC_COMP_FLAG 0 // Makes decoding of this version compatible to HTM-14.1 by re-introducing HTM-14.1 bugs.79 #define NH_3D_ALIGN_SPIVMP_DBBP 1 // Further alignment of DBBP and SBP motion80 #define NH_3D_ALIGN_SPIVMP_RP 1 // Alignment of DBBP and RP81 #define NH_3D_FIX_VSP 182 #define NH_3D_VSO 183 #define NH_3D_NBDV 184 #define NH_3D_TMVP 1 // QC_TMVP_C004785 // Sony_M2363986 // H_3D_TMVP_SCALING_FIX_K0053 1 // QC/CY for K005387 #define NH_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D006088 // Unifying rounding offset, for IC part, JCT3V-D013589 // SHARP_ILLUCOMP_REFINE_E004690 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E016891 // LGE_IC_CTX_F0160 //JCT3V-F016092 // SEC_ONLY_TEXTURE_IC_F015193 // MTK_IC_FLAG_CABAC_SIMP_G006194 // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G012195 // MTK_LOW_LATENCY_IC_ENCODING_H0086 Low-latency IC encoding in JCT3V-H008696 // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX 1 // Remove the global variables used in JCT3V-H008697 // SEC_IC_NEIGHBOR_CLIP_I0080 // Clipping of neighboring sample position, JCT3V-I008098 // LGE_CHROMA_IC_J0050_J003499 #define NH_3D_IC_FIX 1 // Fix uninitialized value in cDtParam.bUseIC (it happened on intra block)100 #define NH_3D_FULL_PEL_DEPTH_MAP_MV_ACC 1 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC101 #define NH_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068102 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units103 // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055104 #define NH_3D_NBDV_REF 1105 #define NH_3D_MLC 1106 #define NH_3D_FIX_PRUNING 1107 #define NH_3D_VSP 1108 #define NH_3D_IV_MERGE 1109 #define NH_3D_SPIVMP 1110 80 #define NH_3D_INTEGER_MV_DEPTH 1 111 #define NH_3D_TEXT_MERGE 1112 #define NH_3D_DBBP 1113 #define BUF_FIX 1114 #define NH_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177115 // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108116 // SHARP_ARP_REF_CHECK_F0105 ARP reference picture selection and DPB check117 // LGE_ARP_CTX_F0161 JCT3V-F0161118 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061119 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053120 // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085121 // QC_I0051_ARP_SIMP122 // SHARP_ARP_CHROMA_I0104123 // MTK_I0072_IVARP_SCALING_FIX124 // SEC_ARP_VIEW_REF_CHECK_J0037 Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1125 // SEC_ARP_REM_ENC_RESTRICT_K0035 Removal of encoder restriction of ARP, JCT3V-K0035126 #define NH_3D_DMM 1 // Depth modeling modes127 #define NH_3D_DLT 1 // Depth Lookup Table128 #define NH_3D_SDC_INTRA 1 // Segment-wise DC Coding method for INTRA129 #define NH_3D_SDC_INTER 1 // Segment-wise DC Coding method for INTER130 81 #define NH_3D_ENC_DEPTH 1 // Encoder optimizations for depth, incl. 131 82 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 … … 133 84 // HHI_DMM4_ENC_I0066 134 85 // H_3D_FAST_DEPTH_INTRA 135 #define NH_3D_DIS 1136 86 #define NH_3D_FAST_TEXTURE_ENCODING 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 137 #endif 138 #if H_3D 139 #define H_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068 87 #define NH_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 88 // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108 89 // SHARP_ARP_REF_CHECK_F0105 ARP reference picture selection and DPB check 90 // LGE_ARP_CTX_F0161 JCT3V-F0161 91 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 92 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 93 // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085 94 // QC_I0051_ARP_SIMP 95 // SHARP_ARP_CHROMA_I0104 96 // MTK_I0072_IVARP_SCALING_FIX 97 // SEC_ARP_VIEW_REF_CHECK_J0037 Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1 98 // SEC_ARP_REM_ENC_RESTRICT_K0035 Removal of encoder restriction of ARP, JCT3V-K0035 99 #define NH_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068 140 100 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 141 101 // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055 142 #define H_3D_VSO 1 // VSO, View synthesis optimization, includes:102 #define NH_3D_VSO 1 // VSO, View synthesis optimization, includes: 143 103 // HHI_VSO 144 104 // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization … … 146 106 // LGE_WVSO_A0119 147 107 // SCU_HS_VSD_BUGFIX_IMPROV_G0163 148 #define H_3D_NBDV 1 // Neighboring block disparity derivation108 #define NH_3D_NBDV 1 // Neighboring block disparity derivation 149 109 // QC_JCT3V-A0097 150 110 // LGE_DVMCP_A0126 … … 162 122 // MTK_TEXTURE_MRGCAND_BUGFIX_E0182 Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 163 123 // LGE_SIMP_DISP_AVAIL_J0041 // Use 2 status for disparity availability - DISP_AVAILABLE and DISP_NONE 164 #define H_3D_IC1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060124 #define NH_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 165 125 // Unifying rounding offset, for IC part, JCT3V-D0135 166 126 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC … … 176 136 // LGE_CHROMA_IC_J0050_J0034 177 137 #if NH_3D_NBDV 178 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation138 #define NH_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation 179 139 // MTK_D0156 180 140 // MERL_D0166: Reference view selection in NBDV & Bi-VSP … … 184 144 // SEC_VER_DONBDV_H0103 Vertical DV Restriction for DoNBDV 185 145 #endif 186 #define H_3D_VSP 1 // View synthesis prediction146 #define NH_3D_VSP 1 // View synthesis prediction 187 147 // MERL_C0152: Basic VSP 188 148 // MERL_D0166: Reference view selection in NBDV & Bi-VSP … … 202 162 // MTK_MRG_LIST_SIZE_CLEANUP_J0059 1 // Include VSP for deriving merge candidate list size, JCT3V-J0059 203 163 // SEC_A1_BASED_VSP_J0039 1 // Removal of redundant VSP in Merge list 204 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate 164 #define NH_3D_MLC 1 165 #define NH_3D_IV_MERGE 1 // Inter-view motion merge candidate 205 166 // HHI_INTER_VIEW_MOTION_PRED 206 167 // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction … … 209 170 // MTK_INTERVIEW_MERGE_A0049 , second part 210 171 // QC_AMVP_MRG_UNIFY_IVCAN_C0051 211 // TEXTURE MERGING CANDIDATE , JCT3V-C0137212 172 // QC_INRIA_MTK_MRG_E0126 213 173 // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate 214 // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode215 174 // MTK_NBDV_IVREF_FIX_G0067 , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067 216 175 // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074 … … 225 184 // SEC_SIMP_SHIFTED_DV_I0086 Simplification of Shifted DV candidate, JCT3V-I0086 226 185 // SEC_SHIFTED_IVMC_POS_K0036 Position Derivation for Shifted-IVMC, JCT3V-K0036 227 #define H_3D_TMVP 1 // QC_TMVP_C0047 186 #define NH_3D_TEXT_MERGE 1 187 // TEXTURE MERGING CANDIDATE , JCT3V-C0137 188 // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode 189 #define NH_3D_TMVP 1 // QC_TMVP_C0047 228 190 // Sony_M23639 229 191 // H_3D_TMVP_SCALING_FIX_K0053 1 // QC/CY for K0053 230 #define H_3D_DIM 1 // DIM, Depth intra modes, includes: 192 #define NH_3D_DMM 1 // Depth modeling modes 193 // HHI_DMM_PRED_TEX 231 194 // HHI_DMM_WEDGE_INTRA 232 // HHI_DMM_PRED_TEX233 195 // FIX_WEDGE_NOFLOAT_D0036 234 196 // LGE_EDGE_INTRA_A0070 235 197 // LGE_DMM3_SIMP_C0044 236 198 // QC_DC_PREDICTOR_D0183 199 // LGE_CONCATENATE_D0141 200 // PKU_QC_DEPTH_INTRA_UNI_D0195 201 // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs 202 // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode 203 // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal 204 // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 Removal of overlap between DMM3 and DMM1 205 // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs 206 // HHI_DIM_PREDSAMP_FIX_F0171 207 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes 208 // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135 Use only one context for CABAC of dim_not_present_flag 209 // QC_SIMP_DELTADC_CODING_H0131 Simplify detaDC entropy coding 210 // MTK_DMM_SIMP_CODE_H0092 Remove CABAC context for DMM1 mode coding 211 // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113 212 // HS_DMM_SIGNALLING_I0120 213 // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110 214 // MTK_DMM_SIM_J0035 215 // SHARP_DMM_CLEAN_K0042 1 // Generate DMM pattern with rotation 216 #define NH_3D_DLT 1 // Depth Lookup Table 237 217 // HHI_DELTADC_DLT_D0035 238 // PKU_QC_DEPTH_INTRA_UNI_D0195 218 // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159 219 // SEC_NO_RESI_DLT_H0105 220 // MTK_DLT_CODING_FIX_H0091 221 // H_3D_DELTA_DLT 222 // RWTH_DLT_CLIP_I0057 223 // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup 224 #define NH_3D_SDC_INTRA 1 // Segment-wise DC Coding method for INTRA 225 #define NH_3D_SDC_INTER 1 // Segment-wise DC Coding method for INTER 239 226 // RWTH_SDC_DLT_B0036 240 227 // INTEL_SDC64_D0193 241 228 // RWTH_SDC_CTX_SIMPL_D0032 242 // LGE_CONCATENATE_D0141243 229 // FIX_SDC_ENC_RD_WVSO_D0163 244 230 // MTK_SAMPLE_BASED_SDC_D0110 245 // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs246 // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode247 231 // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC 248 // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal249 232 // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC 250 // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 Removal of overlap between DMM3 and DMM1251 // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159252 // HHI_DIM_PREDSAMP_FIX_F0171253 // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs254 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes255 233 // Unify intra SDC and inter SDC 256 234 // QC_GENERIC_SDC_G0122 Generalize SDC to all depth intra modes … … 259 237 // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split 260 238 // HS_DMM_SDC_PREDICTOR_UNIFY_H0108 Unification of DMM and SDC predictor derivation 261 // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135 Use only one context for CABAC of dim_not_present_flag262 // QC_SIMP_DELTADC_CODING_H0131 Simplify detaDC entropy coding263 // MTK_DMM_SIMP_CODE_H0092 Remove CABAC context for DMM1 mode coding264 // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113265 239 // MTK_SDC_FLAG_FIX_H0095 Remove conditional check of PCM flag based on SDC flag, JCTVC-H0095 266 // SEC_NO_RESI_DLT_H0105267 // MTK_DLT_CODING_FIX_H0091268 // HS_DMM_SIGNALLING_I0120269 // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110270 240 // FAST_SDC_OFFSET_DECISION_I0084 271 241 // SEPARATE_FLAG_I0085 272 // H_3D_DELTA_DLT273 // RWTH_DLT_CLIP_I0057274 // MTK_DMM_SIM_J0035275 242 // MTK_J0033 276 // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup277 // SHARP_DMM_CLEAN_K0042 1 // Generate DMM pattern with rotation278 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding279 243 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 280 244 // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates 281 #define H_3D_INTER_SDC_FIX 1 282 #define H_3D_SPIVMP 1 // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction 245 #define NH_3D_SPIVMP 1 // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction 283 246 // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 284 247 // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate 285 248 // Simplification on Sub-PU level temporal interview motion prediction 286 249 // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133 287 #define H_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging250 #define NH_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging 288 251 // MTK_DBBP_AMP_REM_H0072 289 252 // RWTH_DBBP_NO_SPU_H0057 … … 298 261 // RWTH_DBBP_NO_SATD_K0028 299 262 // HS_DBBP_CLEAN_K0048 300 #define H_3D_DDD 1 // Disparity derived depth coding 301 // LGE_DDD_REMOVAL_J0042_J0030 DDD removal 302 #define H_3D_DIS 1 // Depth intra skip 263 #define NH_3D_DIS 1 // Depth intra skip 303 264 // SEC_DEPTH_INTRA_SKIP_MODE_K0033 Depth intra skip mode 304 265 #define H_3D_FCO 0 // Flexible coding order for 3D 305 #define H_3D_FAST_INTRA_SDC 1 // I0123306 266 // OTHERS 307 267 // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170 308 #define H_3D_FAST_TEXTURE_ENCODING 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173309 268 // MTK_FAST_TEXTURE_ENCODING_E0173 310 #if H_3D_DIM311 #define H_3D_FAST_DEPTH_INTRA 1 // Fast DMM Selection312 // SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX313 #endif314 269 //HLS 315 270 // HHI_DEPENDENCY_SIGNALLING_I1_J0107 … … 321 276 // H_3D_DIRECT_DEP_TYPE 322 277 // Rate Control 323 #define KWU_FIX_URQ 1278 #define KWU_FIX_URQ 0 324 279 #define KWU_RC_VIEWRC_E0227 0 ///< JCT3V-E0227, view-wise target bitrate allocation 325 280 #define KWU_RC_MADPRED_E0227 0 ///< JCT3V-E0227, inter-view MAD prediction 326 #endif // H_3D281 #endif // NH_3D 327 282 ///////////////////////////////////////////////////////////////////////////////////////// 328 283 /////////////////////////////////// DERIVED DEFINES /////////////////////////////////// … … 349 304 #if NH_3D_ARP 350 305 #define H_3D_ARP_WFNR 3 351 #endif352 ///// ***** DEPTH INTRA MODES *********353 #if H_3D_DIM354 // HHI_DMM4_ENC_I0066355 #define H_3D_DIM_DMM 1 // Depth Modeling Modes356 #define H_3D_DIM_SDC 1 // Simplified Depth Coding method357 #define H_3D_DIM_DLT 1 // Depth Lookup Table358 #define H_3D_DIM_ENC 1 // Depth Intra encoder optimizations, includes:359 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160360 // LG_ZEROINTRADEPTHRESI_A0087361 306 #endif 362 307 ///////////////////////////////////////////////////////////////////////////////////// … … 389 334 // TBD: Check if integration is necessary. 390 335 #define H_MV_HLS_PTL_LIMITS 0 391 #define H_MV_HLS7_GEN 0 // General changes (not tested)392 // POC393 // #define H_MV_HLS_7_POC_P0041_3 0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above)394 // #define H_MV_HLS_7_POC_P0041_FIXES 0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture.395 // #define H_MV_HLS_7_POC_P0056_4 0 // (POC/P0056/layer tree poc) #4 Proposal 1: If the POC reset approach is adopted as the basis for multi-layer POC derivation, it is proposed to derive the POC anchor picture from the previous TID0 picture (that is not a RASL picture, a RADL picture or a sub-layer non-reference picture and not with discardable_flag equal to 1) of the current layer or any of its reference layer. This is asserted to improve loss resilience and reduce bit rate overhead. Decision: Adopt Proposal 1 (with the suggested modifications Ewith text provided as P0297).396 // SEI related397 //#define H_MV_HLS_8_SEI_NODOC_53 0 // #53 (SEI /NODOC/Added Multiview view position SEI message) Plain copy from AVC.398 //#define H_MV_HLS_8_SEI_NODOC_52 0 // #52 (SEI /NODOC/Added Multiview acquisition information SEI) Plain copy from AVC.399 //#define H_MV_HLS_8_SEI_NODOC_51 0 // #51 (SEI /NODOC/Added Multiview scene information SEI message)400 //#define H_MV_HLS_8_SEI_Q0189_35 0 // #35 (SEI /Q0189/SEI message for indicating constraints on TMVP) Proposal 2.3, SEI message for indicating constraints on TMVP401 //#define H_MV_HLS_8_EDF_Q0116_29 0 // #29 (ED.FIX /Q0116/Recovery point SEI) , consider adding a note regarding how random accessibility is affected by the recovery point SEI message402 //#define H_MV_HLS_8_GEN_Q0183_23 0 // #23 (GEN /Q0183/SEI clean-ups) numerous small clean-ups on SEI messages.403 //#define H_MV_HLS_8_MIS_Q0247_49 0 // #49 (MISC /Q0247/frame-field information SEI message)404 //#define H_MV_HLS_8_MIS_Q0189_34 0 // #34 (MISC /Q0189/slice temporal mvp enabled flag) Proposal 2.2, clarification of semantics of slice temporal mvp enabled flag405 //#define H_MV_HLS_8_EDF_Q0081_01 0 // #1 (ED.FIX /Q0081/alpha channel persist) On reuse of alpha planes in auxiliary pictures. It was asked why there would not be a presumption that the alpha channel content would simply persist, without needing the flag to indicate it. Decision (Ed.): Delegated to editors to clarify, as necessary, that the alpha channel content persists until cancelled or updated in output order.406 //#define H_MV_HLS_8_SEI_Q0253_37 0 // #37 (SEI /Q0253/layer not present), modified semantics of layers not present SEI message to correct bug introduced during editing407 //#define H_MV_HLS_8_SEI_Q0045_11 0 // #11 (SEI /Q0045/Overlay) Proposal for an SEI message on selectable overlays. Decision: Adopt (modified for variable-length strings).408 //#define H_MV_HLS_7_SEI_P0133_28 0 // (SEI/P0133/Recovery point SEI) #28 Decision: Adopt change to recover point semantics only (-v3)409 //#define H_MV_HLS_7_SEI_P0123_25 0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture.410 // DPB411 //#define H_MV_HLS_8_HRD_Q0102_09 0 // #9 (HRD /Q0102/NoOutputOfPriorPicsFlag) It was suggested that also the separate_colour_plane_flag should affect inference of NoOutputOfPriorPicsFlag. Decision (Ed.): Agreed (affects RExt text).412 //#define H_MV_HLS_8_DBP_Q0154_38 0 // #38 (DBP /Q0154/VPS DPB) Proposal in C.5.2.1: Add in the decoding process that when a new VPS is activated, all pictures in the DPB are marked as unused for reference413 //#define H_MV_HLS_8_HRD_Q0154_10 0 // #10 (HRD /Q0154/DPB Flushing and parameters) On picture flushing and DPB parameters Decision: Adopted (some details to be discussed further in BoG).414 //#define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution415 // OTHERS416 //#define H_MV_HLS_8_HSB_Q0041_03 0 // #3 (HS /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows ?// #define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution417 //#define H_MV_HLS_8_MIS_Q0078_24 0 // #24 (MISC /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.418 //#define H_MV_HLS_7_HRD_P0138_6 0 // (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.419 336 ///////////////////////////////////////////////////////////////////////////////////////// 420 337 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// … … 871 788 #define NUM_SAO_BO_CLASSES_LOG2 5 872 789 #define NUM_SAO_BO_CLASSES (1<<NUM_SAO_BO_CLASSES_LOG2) 790 #if NH_MV 791 enum DecodingProcess 792 { 793 INVALID, 794 CLAUSE_8, 795 ANNEX_C, 796 ANNEX_F, 797 ANNEX_G, 798 ANNEX_H, 799 ANNEX_I 800 }; 801 #endif 873 802 namespace Profile 874 803 { … … 1017 946 AUX_ID = 3, 1018 947 }; 948 enum DecProcPart 949 { 950 START_PIC, 951 FINALIZE_PIC 952 }; 1019 953 #endif 1020 954 #if NH_3D -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1313 r1321 66 66 fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n"); 67 67 } 68 69 Void xTraceSliceHeader () 70 { 71 fprintf( g_hTrace, "=========== Slice ===========\n"); 72 } 73 68 74 #endif 69 75 #endif … … 85 91 // ==================================================================================================================== 86 92 93 #if NH_MV 94 Void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComStRefPicSet* stRps, Int stRpsIdx ) 95 { 96 UInt uiCode; 97 if( stRpsIdx != 0 ) 98 { 99 READ_FLAG( uiCode, "inter_ref_pic_set_prediction_flag" ); stRps->setInterRefPicSetPredictionFlag( uiCode == 1 ); 100 } 101 if( stRps->getInterRefPicSetPredictionFlag() ) 102 { 103 if( stRpsIdx == sps->getNumShortTermRefPicSets() ) 104 { 105 READ_UVLC( uiCode, "delta_idx_minus1" ); stRps->setDeltaIdxMinus1( uiCode ); 106 } 107 READ_FLAG( uiCode, "delta_rps_sign" ); stRps->setDeltaRpsSign( uiCode == 1 ); 108 READ_UVLC( uiCode, "abs_delta_rps_minus1" ); stRps->setAbsDeltaRpsMinus1( uiCode ); 109 for( Int j = 0; j <= sps->getStRefPicSet( stRps->getRefRpsIdx( stRpsIdx ) )->getNumDeltaPocs() ; j++ ) 110 { 111 READ_FLAG( uiCode, "used_by_curr_pic_flag" ); stRps->setUsedByCurrPicFlag( j, uiCode == 1 ); 112 if( !stRps->getUsedByCurrPicFlag( j ) ) 113 { 114 READ_FLAG( uiCode, "use_delta_flag" ); stRps->setUseDeltaFlag( j, uiCode == 1 ); 115 } 116 } 117 } 118 else 119 { 120 READ_UVLC( uiCode, "num_negative_pics" ); stRps->setNumNegativePics( uiCode ); 121 READ_UVLC( uiCode, "num_positive_pics" ); stRps->setNumPositivePics( uiCode ); 122 for( Int i = 0; i < stRps->getNumNegativePics( ); i++ ) 123 { 124 READ_UVLC( uiCode, "delta_poc_s0_minus1" ); stRps->setDeltaPocS0Minus1( i, uiCode ); 125 READ_FLAG( uiCode, "used_by_curr_pic_s0_flag" ); stRps->setUsedByCurrPicS0Flag( i, uiCode == 1 ); 126 } 127 for( Int i = 0; i < stRps->getNumPositivePics( ); i++ ) 128 { 129 READ_UVLC( uiCode, "delta_poc_s1_minus1" ); stRps->setDeltaPocS1Minus1( i, uiCode ); 130 READ_FLAG( uiCode, "used_by_curr_pic_s1_flag" ); stRps->setUsedByCurrPicS1Flag( i, uiCode == 1 ); 131 } 132 } 133 stRps->inferRps( stRpsIdx, sps, false ); 134 } 135 #else 87 136 Void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet* rps, Int idx ) 88 137 { … … 180 229 #endif 181 230 } 231 #endif 182 232 183 233 Void TDecCavlc::parsePPS(TComPPS* pcPPS) … … 507 557 { 508 558 READ_CODE(6, uiCode, "pps_depth_layers_minus1"); 509 #if NH_3D_VER141_DEC_COMP_FLAG510 pcDLT->setNumDepthViews( uiCode );511 #else512 559 pcDLT->setNumDepthViews( uiCode+1 ); 513 #endif514 560 515 561 READ_CODE(4, uiCode, "pps_bit_depth_for_depth_layers_minus8"); 516 562 pcDLT->setDepthViewBitDepth( (uiCode+8) ); 517 563 518 #if NH_3D_DLT_FIX519 564 for( Int i = 0; i <= pcDLT->getNumDepthViews()-1; i++ ) 520 #else521 for( Int i = 0; i <= pcDLT->getNumDepthViews(); i++ )522 #endif523 565 { 524 566 Int layerId = pcDLT->getDepthIdxToLayerId(i); … … 866 908 #if NH_MV 867 909 pcSPS->getPTL()->inferGeneralValues ( true, 0, NULL ); 868 pcSPS->getPTL()->inferSubLayerValues( pcSPS->get MaxTLayers() - 1, 0, NULL );910 pcSPS->getPTL()->inferSubLayerValues( pcSPS->getSpsMaxSubLayersMinus1(), 0, NULL ); 869 911 } 870 912 #endif … … 972 1014 pcSPS->setNumReorderPics(uiCode, i); 973 1015 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 1016 #if NH_MV 1017 pcSPS->setSpsMaxLatencyIncreasePlus1( uiCode, i ); 1018 #else 974 1019 pcSPS->setMaxLatencyIncrease( uiCode, i ); 1020 #endif 975 1021 976 1022 if (!subLayerOrderingInfoPresentFlag) … … 980 1026 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 981 1027 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 1028 #if NH_MV 1029 pcSPS->setSpsMaxLatencyIncreasePlus1(pcSPS->getSpsMaxLatencyIncreasePlus1(0), i); 1030 #else 982 1031 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 1032 #endif 983 1033 } 984 1034 break; … … 1053 1103 1054 1104 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" ); 1105 1055 1106 assert(uiCode <= 64); 1107 #if NH_MV 1108 pcSPS->setNumShortTermRefPicSets( uiCode ); 1109 pcSPS->initStRefPicSets(); 1110 1111 for(Int i=0; i< pcSPS->getNumShortTermRefPicSets(); i++ ) 1112 { 1113 parseShortTermRefPicSet(pcSPS,pcSPS->getStRefPicSet(i),i); 1114 } 1115 1116 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcSPS->setLongTermRefPicsPresentFlag(uiCode); 1117 if (pcSPS->getLongTermRefPicsPresentFlag() ) 1118 #else 1056 1119 pcSPS->createRPSList(uiCode); 1057 1120 … … 1064 1127 parseShortTermRefPicSet(pcSPS,rps,i); 1065 1128 } 1129 1066 1130 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcSPS->setLongTermRefsPresent(uiCode); 1067 1131 if (pcSPS->getLongTermRefsPresent()) 1132 #endif 1068 1133 { 1069 1134 READ_UVLC( uiCode, "num_long_term_ref_pics_sps" ); … … 2149 2214 #endif 2150 2215 2216 #if NH_MV 2217 Void TDecCavlc::parseFirstSliceSegmentInPicFlag(TComSlice* pcSlice ) 2218 { 2219 #if ENC_DEC_TRACE 2220 #if NH_MV 2221 tracePSHeader( "Slice", pcSlice->getLayerId() ); 2222 #else 2223 xTraceSliceHeader(); 2224 #endif 2225 #endif 2226 2227 UInt uiCode; 2228 READ_FLAG( uiCode, "first_slice_segment_in_pic_flag" ); 2229 pcSlice->setFirstSliceSegementInPicFlag( uiCode ); 2230 } 2231 2232 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager ) 2233 #else 2151 2234 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC) 2235 #endif 2152 2236 { 2153 2237 UInt uiCode; 2154 2238 Int iCode; 2155 2239 2240 #if !NH_MV 2156 2241 #if ENC_DEC_TRACE 2157 #if NH_MV2158 tracePSHeader( "Slice", pcSlice->getLayerId() );2159 #else2160 2242 xTraceSliceHeader(); 2161 2243 #endif … … 2167 2249 #endif 2168 2250 2251 #if NH_MV 2252 // This has been parsed before in parseFirstSliceSegmentFlag(TComSlice* pcSlice ) 2253 UInt firstSliceSegmentInPic = pcSlice->getFirstSliceSegementInPicFlag(); 2254 #else 2169 2255 UInt firstSliceSegmentInPic; 2170 2256 READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" ); 2257 #endif 2171 2258 if( pcSlice->getRapPicFlag()) 2172 2259 { … … 2184 2271 vps = parameterSetManager->getVPS(sps->getVPSId()); 2185 2272 assert( vps != NULL ); 2273 2186 2274 m_decTop->initFromActiveVps( vps ); 2275 2276 if ( !m_decTop->getIsInOwnTargetDecLayerIdList() ) 2277 { 2278 return; 2279 } 2280 2281 pcSlice->setDecodingProcess( m_decTop->getDecodingProcess() ); 2187 2282 Int targetOlsIdx = m_decTop->getTargetOlsIdx(); 2188 2283 … … 2241 2336 pcSlice->setSliceSegmentCurStartCtuTsAddr( sliceSegmentAddress );// this is actually a Raster-Scan (RS) address, but we do not have the RS->TS conversion table defined yet. 2242 2337 pcSlice->setSliceSegmentCurEndCtuTsAddr(numCTUs); // Set end as the last CTU of the picture. 2243 2244 #if NH_MV2245 UInt slicePicOrderCntLsb = 0;2246 #endif2247 2338 2248 2339 … … 2303 2394 2304 2395 #if NH_MV 2305 Int iPOClsb = slicePicOrderCntLsb; // Needed later2306 2396 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 2307 2397 { 2308 READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb"); 2309 } 2310 pcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb ); 2311 2312 Bool picOrderCntMSBZeroFlag = false; 2313 2314 // as in HM code. However are all cases for IRAP picture with NoRaslOutputFlag equal to 1 covered?? 2315 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ); 2316 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 2317 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ); 2318 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || pcSlice->getIdrPicFlag(); 2319 2320 // TBD picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getLayerId() > 0 && !rpcSlice->getFirstPicInLayerDecodedFlag() ); 2321 2322 Int picOrderCntMSB = 0; 2323 2324 if ( !picOrderCntMSBZeroFlag ) 2325 { 2326 Int prevPicOrderCnt = prevTid0POC; 2327 Int maxPicOrderCntLsb = 1 << sps->getBitsForPOC(); 2328 Int prevPicOrderCntLsb = prevPicOrderCnt & (maxPicOrderCntLsb - 1); 2329 Int prevPicOrderCntMsb = prevPicOrderCnt - prevPicOrderCntLsb; 2330 2331 if( ( slicePicOrderCntLsb < prevPicOrderCntLsb ) && ( ( prevPicOrderCntLsb - slicePicOrderCntLsb ) >= ( maxPicOrderCntLsb / 2 ) ) ) 2332 { 2333 picOrderCntMSB = prevPicOrderCntMsb + maxPicOrderCntLsb; 2334 } 2335 else if( (slicePicOrderCntLsb > prevPicOrderCntLsb ) && ( (slicePicOrderCntLsb - prevPicOrderCntLsb ) > ( maxPicOrderCntLsb / 2 ) ) ) 2336 { 2337 picOrderCntMSB = prevPicOrderCntMsb - maxPicOrderCntLsb; 2338 } 2339 else 2340 { 2341 picOrderCntMSB = prevPicOrderCntMsb; 2342 } 2343 } 2344 2345 pcSlice->setPOC( picOrderCntMSB + slicePicOrderCntLsb ); 2346 if ( pcSlice->getPocResetFlag() ) 2347 { 2348 pcSlice->setPocBeforeReset ( pcSlice->getPOC() ); 2349 pcSlice->setPOC ( 0 ); 2350 } 2351 #endif 2352 2353 if( pcSlice->getIdrPicFlag() ) 2354 { 2355 #if !NH_MV 2356 pcSlice->setPOC(0); 2357 #endif 2358 TComReferencePictureSet* rps = pcSlice->getLocalRPS(); 2359 (*rps)=TComReferencePictureSet(); 2360 pcSlice->setRPS(rps); 2361 #if NH_MV 2362 pcSlice->setEnableTMVPFlag(false); 2363 #endif 2364 } 2398 READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb"); pcSlice->setSlicePicOrderCntLsb( uiCode ); 2399 } 2365 2400 else 2366 2401 { 2367 #if !NH_MV 2368 READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb"); 2369 Int iPOClsb = uiCode; 2370 Int iPrevPOC = prevTid0POC; 2371 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); 2372 Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1); 2373 Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb; 2374 Int iPOCmsb; 2375 if( ( iPOClsb < iPrevPOClsb ) && ( ( iPrevPOClsb - iPOClsb ) >= ( iMaxPOClsb / 2 ) ) ) 2376 { 2377 iPOCmsb = iPrevPOCmsb + iMaxPOClsb; 2378 } 2379 else if( (iPOClsb > iPrevPOClsb ) && ( (iPOClsb - iPrevPOClsb ) > ( iMaxPOClsb / 2 ) ) ) 2380 { 2381 iPOCmsb = iPrevPOCmsb - iMaxPOClsb; 2382 } 2383 else 2384 { 2385 iPOCmsb = iPrevPOCmsb; 2386 } 2387 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2388 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 2389 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 2390 { 2391 // For BLA picture types, POCmsb is set to 0. 2392 iPOCmsb = 0; 2393 } 2394 pcSlice->setPOC (iPOCmsb+iPOClsb); 2395 #endif 2396 TComReferencePictureSet* rps; 2397 rps = pcSlice->getLocalRPS(); 2398 (*rps)=TComReferencePictureSet(); 2399 2400 pcSlice->setRPS(rps); 2401 READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" ); 2402 if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header 2403 { 2404 parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets()); 2405 #if NH_MV 2406 if ( !rps->getInterRPSPrediction( ) ) 2407 { // check sum of num_positive_pics and num_negative_pics 2408 rps->checkMaxNumPics( 2409 vps->getVpsExtensionFlag(), 2410 MAX_INT, // To be replaced by MaxDbpSize 2411 pcSlice->getLayerId(), 2412 sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 ); 2413 } 2414 #endif 2415 2416 } 2417 else // use reference to short-term reference picture set in PPS 2418 { 2419 Int numBits = 0; 2420 while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets()) 2421 { 2422 numBits++; 2423 } 2424 if (numBits > 0) 2425 { 2426 READ_CODE( numBits, uiCode, "short_term_ref_pic_set_idx"); 2427 } 2428 else 2429 { 2430 uiCode = 0; 2431 2432 } 2433 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); 2434 } 2435 if(sps->getLongTermRefsPresent()) 2436 { 2437 Int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); 2438 UInt numOfLtrp = 0; 2439 UInt numLtrpInSPS = 0; 2440 if (sps->getNumLongTermRefPicSPS() > 0) 2441 { 2442 READ_UVLC( uiCode, "num_long_term_sps"); 2443 numLtrpInSPS = uiCode; 2444 numOfLtrp += numLtrpInSPS; 2445 rps->setNumberOfLongtermPictures(numOfLtrp); 2446 } 2447 Int bitsForLtrpInSPS = 0; 2448 while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS)) 2449 { 2450 bitsForLtrpInSPS++; 2451 } 2452 READ_UVLC( uiCode, "num_long_term_pics"); rps->setNumberOfLongtermPictures(uiCode); 2453 numOfLtrp += uiCode; 2454 rps->setNumberOfLongtermPictures(numOfLtrp); 2455 Int maxPicOrderCntLSB = 1 << sps->getBitsForPOC(); 2456 Int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0; 2457 for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++) 2458 { 2459 Int pocLsbLt; 2460 if (k < numLtrpInSPS) 2402 pcSlice->setSlicePicOrderCntLsb( 0 ); 2403 } 2404 2405 if( pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_N_LP ) 2406 { 2407 READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" ); pcSlice->setShortTermRefPicSetSpsFlag( uiCode == 1 ); 2408 if( !pcSlice->getShortTermRefPicSetSpsFlag() ) 2409 { 2410 parseShortTermRefPicSet( sps, pcSlice->getLocalStRps( ), sps->getNumShortTermRefPicSets() ); 2411 } 2412 else if( sps->getNumShortTermRefPicSets() > 1 ) 2413 { 2414 READ_CODE( pcSlice->getShortTermRefPicSetIdxLen() , uiCode, "short_term_ref_pic_set_idx" ); pcSlice->setShortTermRefPicSetIdx( uiCode ); 2415 } 2416 if( sps->getLongTermRefPicsPresentFlag() ) 2417 { 2418 if( sps->getNumLongTermRefPicsSps() > 0 ) 2419 { 2420 READ_UVLC( uiCode, "num_long_term_sps" ); pcSlice->setNumLongTermSps( uiCode ); 2421 } 2422 READ_UVLC( uiCode, "num_long_term_pics" ); pcSlice->setNumLongTermPics( uiCode ); 2423 for( Int i = 0; i < pcSlice->getNumLongTermSps() + pcSlice->getNumLongTermPics( ); i++ ) 2424 { 2425 if( i < pcSlice->getNumLongTermSps() ) 2461 2426 { 2462 uiCode = 0; 2463 if (bitsForLtrpInSPS > 0) 2427 if( sps->getNumLongTermRefPicsSps() > 1 ) 2464 2428 { 2465 READ_CODE( bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]");2429 READ_CODE( pcSlice->getLtIdxSpsLen() , uiCode, "lt_idx_sps" ); pcSlice->setLtIdxSps( i, uiCode ); 2466 2430 } 2467 Bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode);2468 2469 pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode);2470 rps->setUsed(j,usedByCurrFromSPS);2471 2431 } 2472 2432 else 2473 2433 { 2474 READ_CODE( sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;2475 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag" ); rps->setUsed(j,uiCode);2434 READ_CODE( pcSlice->getPocLsbLtLen() , uiCode, "poc_lsb_lt" ); pcSlice->setPocLsbLt( i, uiCode ); 2435 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag" ); pcSlice->setUsedByCurrPicLtFlag( i, uiCode == 1 ); 2476 2436 } 2477 READ_FLAG(uiCode,"delta_poc_msb_present_flag"); 2478 Bool mSBPresentFlag = uiCode ? true : false; 2479 if(mSBPresentFlag) 2437 READ_FLAG( uiCode, "delta_poc_msb_present_flag" ); pcSlice->setDeltaPocMsbPresentFlag( i, uiCode == 1 ); 2438 if( pcSlice->getDeltaPocMsbPresentFlag( i ) ) 2480 2439 { 2481 READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" ); 2482 Bool deltaFlag = false; 2483 // First LTRP || First LTRP from SH 2484 if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) ) 2485 { 2486 deltaFlag = true; 2487 } 2488 if(deltaFlag) 2489 { 2490 deltaPocMSBCycleLT = uiCode; 2491 } 2492 else 2493 { 2494 deltaPocMSBCycleLT = uiCode + prevDeltaMSB; 2495 } 2496 2497 Int pocLTCurr = pcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 2498 - iPOClsb + pocLsbLt; 2499 rps->setPOC (j, pocLTCurr); 2500 rps->setDeltaPOC(j, - pcSlice->getPOC() + pocLTCurr); 2501 rps->setCheckLTMSBPresent(j,true); 2440 READ_UVLC( uiCode, "delta_poc_msb_cycle_lt" ); pcSlice->setDeltaPocMsbCycleLt( i, uiCode ); 2502 2441 } 2503 else 2504 { 2442 } 2443 } 2444 if( sps->getSpsTemporalMvpEnabledFlag() ) 2445 { 2446 READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" ); pcSlice->setSliceTemporalMvpEnabledFlag( uiCode == 1 ); 2447 } 2448 } 2449 #else 2450 if( pcSlice->getIdrPicFlag() ) 2451 { 2452 pcSlice->setPOC(0); 2453 TComReferencePictureSet* rps = pcSlice->getLocalRPS(); 2454 (*rps)=TComReferencePictureSet(); 2455 pcSlice->setRPS(rps); 2456 } 2457 else 2458 { 2459 READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb"); 2460 Int iPOClsb = uiCode; 2461 Int iPrevPOC = prevTid0POC; 2462 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); 2463 Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1); 2464 Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb; 2465 Int iPOCmsb; 2466 if( ( iPOClsb < iPrevPOClsb ) && ( ( iPrevPOClsb - iPOClsb ) >= ( iMaxPOClsb / 2 ) ) ) 2467 { 2468 iPOCmsb = iPrevPOCmsb + iMaxPOClsb; 2469 } 2470 else if( (iPOClsb > iPrevPOClsb ) && ( (iPOClsb - iPrevPOClsb ) > ( iMaxPOClsb / 2 ) ) ) 2471 { 2472 iPOCmsb = iPrevPOCmsb - iMaxPOClsb; 2473 } 2474 else 2475 { 2476 iPOCmsb = iPrevPOCmsb; 2477 } 2478 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2479 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 2480 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 2481 { 2482 // For BLA picture types, POCmsb is set to 0. 2483 iPOCmsb = 0; 2484 } 2485 pcSlice->setPOC (iPOCmsb+iPOClsb); 2486 2487 TComReferencePictureSet* rps; 2488 rps = pcSlice->getLocalRPS(); 2489 (*rps)=TComReferencePictureSet(); 2490 2491 pcSlice->setRPS(rps); 2492 READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" ); 2493 if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header 2494 { 2495 parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets()); 2496 } 2497 else // use reference to short-term reference picture set in PPS 2498 { 2499 Int numBits = 0; 2500 while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets()) 2501 { 2502 numBits++; 2503 } 2504 if (numBits > 0) 2505 { 2506 READ_CODE( numBits, uiCode, "short_term_ref_pic_set_idx"); 2507 } 2508 else 2509 { 2510 uiCode = 0; 2511 } 2512 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); 2513 } 2514 if(sps->getLongTermRefsPresent()) 2515 { 2516 Int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); 2517 UInt numOfLtrp = 0; 2518 UInt numLtrpInSPS = 0; 2519 if (sps->getNumLongTermRefPicSPS() > 0) 2520 { 2521 READ_UVLC( uiCode, "num_long_term_sps"); 2522 numLtrpInSPS = uiCode; 2523 numOfLtrp += numLtrpInSPS; 2524 rps->setNumberOfLongtermPictures(numOfLtrp); 2525 } 2526 Int bitsForLtrpInSPS = 0; 2527 while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS)) 2528 { 2529 bitsForLtrpInSPS++; 2530 } 2531 READ_UVLC( uiCode, "num_long_term_pics"); rps->setNumberOfLongtermPictures(uiCode); 2532 numOfLtrp += uiCode; 2533 rps->setNumberOfLongtermPictures(numOfLtrp); 2534 Int maxPicOrderCntLSB = 1 << sps->getBitsForPOC(); 2535 Int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0; 2536 for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++) 2537 { 2538 Int pocLsbLt; 2539 if (k < numLtrpInSPS) 2540 { 2541 uiCode = 0; 2542 if (bitsForLtrpInSPS > 0) 2543 { 2544 READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]"); 2545 } 2546 Bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode); 2547 2548 pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode); 2549 rps->setUsed(j,usedByCurrFromSPS); 2550 } 2551 else 2552 { 2553 READ_CODE(sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode; 2554 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 2555 } 2556 READ_FLAG(uiCode,"delta_poc_msb_present_flag"); 2557 Bool mSBPresentFlag = uiCode ? true : false; 2558 if(mSBPresentFlag) 2559 { 2560 READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" ); 2561 Bool deltaFlag = false; 2562 // First LTRP || First LTRP from SH 2563 if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) ) 2564 { 2565 deltaFlag = true; 2566 } 2567 if(deltaFlag) 2568 { 2569 deltaPocMSBCycleLT = uiCode; 2570 } 2571 else 2572 { 2573 deltaPocMSBCycleLT = uiCode + prevDeltaMSB; 2574 } 2575 2576 Int pocLTCurr = pcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 2577 - iPOClsb + pocLsbLt; 2578 rps->setPOC (j, pocLTCurr); 2579 rps->setDeltaPOC(j, - pcSlice->getPOC() + pocLTCurr); 2580 rps->setCheckLTMSBPresent(j,true); 2581 } 2582 else 2583 { 2505 2584 rps->setPOC (j, pocLsbLt); 2506 2585 rps->setDeltaPOC(j, - pcSlice->getPOC() + pocLsbLt); 2507 rps->setCheckLTMSBPresent(j,false); 2508 2509 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 2510 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) 2511 { 2512 deltaPocMSBCycleLT = 0; 2513 } 2514 } 2515 prevDeltaMSB = deltaPocMSBCycleLT; 2516 } 2517 offset += rps->getNumberOfLongtermPictures(); 2518 rps->setNumberOfPictures(offset); 2519 } 2520 #if NH_MV 2521 if ( !rps->getInterRPSPrediction( ) ) 2522 { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics 2523 rps->checkMaxNumPics( 2524 vps->getVpsExtensionFlag(), 2525 MAX_INT, // To be replaced by MaxDbpsize 2526 pcSlice->getLayerId(), 2527 sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 ); 2528 } 2529 #endif 2530 2531 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2532 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 2533 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 2534 { 2535 // In the case of BLA picture types, rps data is read from slice header but ignored 2536 rps = pcSlice->getLocalRPS(); 2537 (*rps)=TComReferencePictureSet(); 2538 pcSlice->setRPS(rps); 2539 } 2540 if (sps->getTMVPFlagsPresent()) 2541 { 2542 #if NH_MV 2543 READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" ); 2544 #else 2545 READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" ); 2546 #endif 2547 pcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false ); 2548 } 2549 else 2550 { 2551 pcSlice->setEnableTMVPFlag(false); 2552 } 2553 } 2586 rps->setCheckLTMSBPresent(j,false); 2587 2588 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 2589 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) 2590 { 2591 deltaPocMSBCycleLT = 0; 2592 } 2593 } 2594 prevDeltaMSB = deltaPocMSBCycleLT; 2595 } 2596 offset += rps->getNumberOfLongtermPictures(); 2597 rps->setNumberOfPictures(offset); 2598 } 2599 2600 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2601 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 2602 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 2603 { 2604 // In the case of BLA picture types, rps data is read from slice header but ignored 2605 rps = pcSlice->getLocalRPS(); 2606 (*rps)=TComReferencePictureSet(); 2607 pcSlice->setRPS(rps); 2608 } 2609 if (sps->getTMVPFlagsPresent()) 2610 { 2611 READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" ); 2612 pcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false ); 2613 } 2614 else 2615 { 2616 pcSlice->setEnableTMVPFlag(false); 2617 } 2618 } 2619 #endif 2620 2554 2621 #if NH_MV 2555 2622 Bool interLayerPredLayerIdcPresentFlag = false; … … 2649 2716 } 2650 2717 // } 2718 #if NH_MV 2719 2720 const Int numPicTotalCurr = pcSlice->getNumPicTotalCurr(); 2721 if( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) 2722 { 2723 if( pps->getListsModificationPresentFlag() && numPicTotalCurr > 1 ) 2724 { 2725 TComRefPicListModification* rplMod = pcSlice->getRefPicListModification(); 2726 READ_FLAG( uiCode, "ref_pic_list_modification_flag_l0" ); rplMod->setRefPicListModificationFlagL0( uiCode == 1 ); 2727 if( rplMod->getRefPicListModificationFlagL0() ) 2728 { 2729 for( Int i = 0; i <= pcSlice->getNumRefIdxL0ActiveMinus1( ); i++ ) 2730 { 2731 READ_CODE( rplMod->getListEntryLXLen( numPicTotalCurr ) , uiCode, "list_entry_l0" ); rplMod->setListEntryL0( i, uiCode ); 2732 } 2733 } 2734 2735 if( pcSlice->getSliceType() == B_SLICE ) 2736 { 2737 READ_FLAG( uiCode, "ref_pic_list_modification_flag_l1" ); rplMod->setRefPicListModificationFlagL1( uiCode == 1 ); 2738 if( rplMod->getRefPicListModificationFlagL1() ) 2739 { 2740 for( Int i = 0; i <= pcSlice->getNumRefIdxL1ActiveMinus1( ); i++ ) 2741 { 2742 READ_CODE( rplMod->getListEntryLXLen( numPicTotalCurr ), uiCode, "list_entry_l1" ); rplMod->setListEntryL1( i, uiCode ); 2743 } 2744 } 2745 } 2746 } 2747 } 2748 #else 2651 2749 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 2652 2750 if(!pcSlice->isIntra()) … … 2735 2833 refPicListModification->setRefPicListModificationFlagL1(0); 2736 2834 } 2835 #endif 2836 2737 2837 if (pcSlice->isInterB()) 2738 2838 { … … 2898 2998 { 2899 2999 Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() ); 2900 #if NH_3D_FIX_TICKET_1012901 3000 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 2902 #else2903 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )2904 #endif2905 3001 { 2906 3002 for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ ) … … 2952 3048 pcSlice->checkPocResetIdc(); 2953 3049 3050 #if NH_MV 3051 if ( pcSlice->getVPS()->getPocLsbNotPresentFlag(pcSlice->getLayerId()) && pcSlice->getSlicePicOrderCntLsb() > 0 ) 3052 #else 2954 3053 if ( pcSlice->getVPS()->getPocLsbNotPresentFlag(pcSlice->getLayerId()) && slicePicOrderCntLsb > 0 ) 3054 #endif 2955 3055 { 2956 3056 assert( pcSlice->getPocResetIdc() != 2 ); … … 2959 3059 if( pcSlice->getPocResetIdc() != 0 ) 2960 3060 { 2961 READ_CODE( 6, uiCode, "poc_reset_period_id" ); pcSlice->setPocResetPeriodId( uiCode ); 3061 READ_CODE( 6, uiCode, "poc_reset_period_id" ); pcSlice->setPocResetPeriodId( uiCode ); 3062 pcSlice->setHasPocResetPeriodIdPresent( true ); 2962 3063 } 2963 3064 else 2964 3065 { 2965 3066 // TODO Copy poc_reset_period from earlier picture 3067 #if NH_MV 3068 pcSlice->setHasPocResetPeriodIdPresent( false); 3069 #else 2966 3070 pcSlice->setPocResetPeriodId( 0 ); 3071 #endif 2967 3072 } 2968 3073 … … 2972 3077 READ_CODE( pcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); pcSlice->setPocLsbVal( uiCode ); 2973 3078 } 2974 pcSlice->checkPocLsbVal(); 2975 2976 // Derive the value of PocMs8bValRequiredFlag 3079 pcSlice->checkPocLsbVal(); 2977 3080 2978 3081 if( !pcSlice->getPocMsbValRequiredFlag() && pcSlice->getVPS()->getVpsPocLsbAlignedFlag() ) 2979 3082 { 3083 #if NH_MV 3084 READ_FLAG( uiCode, "poc_msb_cycle_val_present_flag" ); pcSlice->setPocMsbCycleValPresentFlag( uiCode == 1 ); 3085 #else 2980 3086 READ_FLAG( uiCode, "poc_msb_val_present_flag" ); pcSlice->setPocMsbValPresentFlag( uiCode == 1 ); 3087 #endif 2981 3088 } 2982 3089 else 2983 3090 { 3091 #if NH_MV 3092 pcSlice->setPocMsbCycleValPresentFlag( pcSlice->inferPocMsbCycleValPresentFlag( ) ); 3093 #else 2984 3094 pcSlice->setPocMsbValPresentFlag( pcSlice->inferPocMsbValPresentFlag( ) ); 3095 #endif 2985 3096 } 2986 3097 2987 3098 3099 #if NH_MV 3100 if( pcSlice->getPocMsbCycleValPresentFlag() ) 3101 #else 2988 3102 if( pcSlice->getPocMsbValPresentFlag() ) 2989 { 3103 #endif 3104 { 3105 #if NH_MV 3106 READ_UVLC( uiCode, "poc_msb_val" ); pcSlice->setPocMsbCycleVal( uiCode ); 3107 #else 2990 3108 READ_UVLC( uiCode, "poc_msb_val" ); pcSlice->setPocMsbVal( uiCode ); 3109 #endif 2991 3110 } 2992 3111 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r1313 r1321 64 64 protected: 65 65 66 #if NH_MV 67 Void parseShortTermRefPicSet (TComSPS* pcSPS, TComStRefPicSet* pcRPS, Int stRpsIdx ); 68 #else 66 69 Void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); 70 #endif 67 71 68 72 #if NH_MV … … 104 108 Void parseProfileTier (ProfileTierLevel *ptl, const Bool bIsSubLayer); 105 109 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 110 #if NH_MV 111 Void parseFirstSliceSegmentInPicFlag( TComSlice* pcSlice ); 112 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager ); 113 #else 106 114 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC); 115 #endif 116 107 117 Void parseTerminatingBit ( UInt& ruiBit ); 108 118 Void parseRemainingBytes ( Bool noTrailingBytesExpected ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r1313 r1321 531 531 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 532 532 } 533 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 534 if ( g_traceSubPBMotion ) 535 { 536 std::cout << std::setfill(' ') << std::setw( 15 ) 537 << "Num" << std::setw( 15 ) 538 << "Dir " << std::setw( 15 ) 539 << "L0 RefIdx" << std::setw( 15 ) 540 << "L0 Hor" << std::setw( 15 ) 541 << "L0 Ver" << std::setw( 15 ) 542 << "L1 RefIdx" << std::setw( 15 ) 543 << "L1 Hor" << std::setw( 15 ) 544 << "L1 Ver" << std::setw( 15 ) 545 << std::endl; 546 547 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 548 { 549 UChar dir = puhInterDirSP[iPartitionIdx]; 550 TComMvField& mv0 = pcMvFieldSP [2*iPartitionIdx]; 551 TComMvField& mv1 = pcMvFieldSP [2*iPartitionIdx+1]; 552 553 std::cout << std::setfill(' ') << std::setw( 15 ) 554 << iPartitionIdx << std::setw( 15 ) 555 << (UInt) dir << std::setw( 15 ) 556 << ((dir & 1) ? mv0.getRefIdx() : MIN_INT) << std::setw( 15 ) 557 << ((dir & 1) ? mv0.getMv().getHor() : MIN_INT) << std::setw( 15 ) 558 << ((dir & 1) ? mv0.getMv().getVer() : MIN_INT) << std::setw( 15 ) 559 << ((dir & 2) ? mv1.getRefIdx() : MIN_INT) << std::setw( 15 ) 560 << ((dir & 2) ? mv1.getMv().getHor() : MIN_INT) << std::setw( 15 ) 561 << ((dir & 2) ? mv1.getMv().getVer() : MIN_INT) << std::setw( 15 ) 562 << std::endl; 563 } 564 } 565 #endif 533 566 } 534 567 delete[] pcMvFieldSP; … … 779 812 const ChromaFormat chFmt = rTu.GetChromaFormat(); 780 813 814 DEBUG_STRING_NEW(sTemp) 781 815 if ( pcCU->getDISType(uiAbsPartIdx) == 0 ) 782 816 { … … 1271 1305 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT); 1272 1306 1307 DEBUG_STRING_NEW(sTemp) 1273 1308 m_pcPrediction->initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) ); 1274 1309 … … 1321 1356 1322 1357 //===== init pattern for luma prediction ===== 1323 1358 DEBUG_STRING_NEW(sTemp) 1324 1359 m_pcPrediction->initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp) ); 1325 1360 -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r1313 r1321 238 238 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 239 239 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 240 241 #if NH_3D_MLC 240 242 //#if H_3D_IV_MERGE 241 #if NH_3D_MLC242 243 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 243 244 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 651 652 #endif 652 653 } 653 } 654 } 654 655 #if NH_3D_IC 655 656 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r1313 r1321 67 67 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 68 68 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 69 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC) = 0; 69 #if NH_MV 70 virtual Void parseFirstSliceSegmentInPicFlag( TComSlice* pcSlice ) = 0; 71 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager ) = 0; 72 #else 73 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC) = 0; 74 #endif 70 75 71 76 virtual Void parseTerminatingBit ( UInt& ruilsLast ) = 0; … … 156 161 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 157 162 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 163 #if NH_MV 164 Void decodeFirstSliceSegmentInPicFlag ( TComSlice* pcSlice ) { m_pcEntropyDecoderIf->parseFirstSliceSegmentInPicFlag( pcSlice ); } 165 #endif 166 #if NH_MV 167 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager ) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager); } 168 #else 158 169 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager, prevTid0POC); } 170 #endif 159 171 Void decodeTerminatingBit ( UInt& ruiIsLast ) { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast); } 160 172 Void decodeRemainingBytes( Bool noTrailingBytesExpected ) { m_pcEntropyDecoderIf->parseRemainingBytes(noTrailingBytesExpected); } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r1313 r1321 80 80 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 81 81 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 82 #if NH_MV 83 Void parseFirstSliceSegmentInPicFlag( TComSlice* /*pcSlice*/ ) {} 84 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/ ) {} 85 #else 82 86 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/, const Int /*prevTid0POC*/) {} 87 #endif 83 88 Void parseTerminatingBit ( UInt& ruiBit ); 84 89 Void parseRemainingBytes ( Bool noTrailingBytesExpected); -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r1313 r1321 35 35 \brief decoder class 36 36 */ 37 38 37 #include "NALread.h" 39 38 #include "TDecTop.h" … … 127 126 } 128 127 } 129 130 131 132 128 133 129 Void … … 290 286 } 291 287 292 293 #if !NH_3D_FIX_TICKET_101294 #if NH_3D_IV_MERGE295 Void296 CamParsCollector::copyCamParamForSlice( TComSlice* pcSlice )297 {298 if( m_bCamParsVaryOverTime )299 {300 pcSlice->setCamparaSlice( m_aaiCodedScale, m_aaiCodedOffset );301 }302 }303 #endif304 #endif305 306 307 288 Void 308 289 CamParsCollector::xOutput( Int iPOC ) … … 351 332 TDecTop::TDecTop() 352 333 : m_iMaxRefPicNum(0) 334 #if !NH_MV 353 335 , m_associatedIRAPType(NAL_UNIT_INVALID) 354 , m_pocCRA(0) 336 , m_pocCRA(0) 355 337 , m_pocRandomAccess(MAX_INT) 356 338 , m_cListPic() 357 #if !NH_MV358 339 , m_parameterSetManager() 359 340 #endif … … 373 354 , m_cSAO() 374 355 , m_pcPic(NULL) 356 #if !NH_MV 375 357 , m_prevPOC(MAX_INT) 376 358 , m_prevTid0POC(0) … … 383 365 , m_isNoOutputPriorPics(false) 384 366 , m_craNoRaslOutputFlag(false) 367 #endif 385 368 #if O0043_BEST_EFFORT_DECODING 386 369 , m_forceDecodeBitDepth(8) 387 370 #endif 388 371 , m_pDecodedSEIOutputStream(NULL) 372 #if !NH_MV 389 373 , m_warningMessageSkipPicture(false) 374 #endif 390 375 , m_prefixSEINALUs() 376 { 377 #if !NH_MV 378 #if ENC_DEC_TRACE 379 if (g_hTrace == NULL) 380 { 381 g_hTrace = fopen( "TraceDec.txt", "wb" ); 382 } 383 g_bJustDoIt = g_bEncDecTraceDisable; 384 g_nSymbolCounter = 0; 385 #endif 386 #endif 387 388 #if NH_MV 389 m_layerId = 0; 390 m_viewId = 0; 391 392 #if NH_3D 393 m_viewIndex = 0; 394 m_isDepth = false; 395 m_pcCamParsCollector = 0; 396 #endif 397 398 m_decodingProcess = CLAUSE_8; 399 m_targetOlsIdx = -1; 400 m_smallestLayerId = -1; 401 m_isInOwnTargetDecLayerIdList = 0; 402 m_prevPicOrderCnt = 0; 403 m_pocDecrementedInDpbFlag = NULL; 404 m_firstPicInLayerDecodedFlag = NULL; 405 m_lastPresentPocResetIdc = NULL; 406 407 m_prevIrapPoc = MIN_INT; 408 m_prevIrapDecodingOrder = MIN_INT; 409 m_prevStsaDecOrder = MIN_INT; 410 m_prevStsaTemporalId = MIN_INT; 411 #endif 412 } 413 414 TDecTop::~TDecTop() 391 415 { 392 416 #if ENC_DEC_TRACE 393 417 #if NH_MV 394 if ( g_hTrace == NULL )395 {396 #endif397 if (g_hTrace == NULL)398 {399 g_hTrace = fopen( "TraceDec.txt", "wb" );400 }401 g_bJustDoIt = g_bEncDecTraceDisable;402 g_nSymbolCounter = 0;403 #if NH_MV404 }405 #endif406 #endif407 #if NH_MV408 m_isLastNALWasEos = false;409 m_layerId = 0;410 m_viewId = 0;411 #if NH_3D412 m_viewIndex = 0;413 m_isDepth = false;414 m_pcCamParsCollector = 0;415 #endif416 #if NH_MV417 m_targetOlsIdx = -1;418 #endif419 #endif420 421 }422 423 TDecTop::~TDecTop()424 {425 #if ENC_DEC_TRACE426 #if H_MV_ENC_DEC_TRAC_FIX427 418 if (g_hTrace != stdout && g_hTrace != NULL) 419 { 420 fclose( g_hTrace ); 421 g_hTrace = NULL; 422 } 428 423 #else 429 424 if (g_hTrace != stdout) 430 #endif431 425 { 432 426 fclose( g_hTrace ); 433 #if H_MV_ENC_DEC_TRAC_FIX 434 g_hTrace = NULL; 435 #endif 436 } 427 } 428 #endif 437 429 #endif 438 430 while (!m_prefixSEINALUs.empty()) … … 452 444 Void TDecTop::destroy() 453 445 { 446 447 #if NH_MV 448 m_cSAO.destroy(); 449 m_cLoopFilter. destroy(); 450 #endif 451 454 452 m_cGopDecoder.destroy(); 455 453 … … 474 472 } 475 473 474 #if !NH_MV 476 475 Void TDecTop::deletePicBuffer ( ) 477 476 { 477 478 478 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 479 479 Int iSize = Int( m_cListPic.size() ); … … 482 482 { 483 483 TComPic* pcPic = *(iterPic++); 484 #if NH_MV485 if( pcPic )486 {487 #endif488 484 pcPic->destroy(); 489 485 490 486 delete pcPic; 491 487 pcPic = NULL; 492 #if NH_MV493 }494 #endif495 488 } 496 489 … … 499 492 m_cLoopFilter. destroy(); 500 493 501 #if !NH_MV502 494 // destroy ROM 503 495 destroyROM(); 504 #endif505 496 } 506 497 507 498 Void TDecTop::xGetNewPicBuffer ( const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer ) 508 499 { 509 #if NH_MV510 if ( getLayerId() == 0 )511 {512 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded513 }514 else515 {516 //GTCIC517 //m_iMaxRefPicNum = pcSlice->getVPS()->getMaxDecPicBuffering(pcSlice->getTLayer());518 #if H_MV_HLS7_GEN519 TComVPS* vps = pcSlice->getVPS();520 TComDpbSize* dpbSize = vps->getDpbSize();521 Int lsIdx = vps->olsIdxToLsIdx( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?522 Int layerIdx = vps->getIdxInLayerSet ( lsIdx, getLayerId() );523 Int subDpbIdx = dpbSize->getSubDpbAssigned( lsIdx, layerIdx );524 m_iMaxRefPicNum = dpbSize->getMaxVpsDecPicBufferingMinus1(getTargetOutputLayerSetIdx(), subDpbIdx , vps->getSubLayersVpsMaxMinus1( vps->getLayerIdInVps( getLayerId() ) ) + 1 ) + 1 ;525 #endif526 }527 #else528 500 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 529 #endif530 501 if (m_cListPic.size() < (UInt)m_iMaxRefPicNum) 531 502 { … … 547 518 { 548 519 rpcPic->setOutputMark(false); 549 #if NH_MV550 rpcPic->setPicOutputFlag(false);551 #endif552 520 bBufferIsAvailable = true; 553 521 break; … … 557 525 { 558 526 rpcPic->setOutputMark(false); 559 #if NH_MV560 rpcPic->setPicOutputFlag(false);561 #endif562 527 rpcPic->setReconMark( false ); 563 528 rpcPic->getPicYuvRec()->setBorderExtension( false ); … … 577 542 rpcPic->create ( sps, pps, true); 578 543 } 579 #if NH_MV 580 Void TDecTop::endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet ) 581 #else 544 582 545 Void TDecTop::executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic) 583 #endif584 546 { 585 547 if (!m_pcPic) … … 599 561 rpcListPic = &m_cListPic; 600 562 m_cCuDecoder.destroy(); 601 #if NH_MV602 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );603 TComSlice::markCurrPic( pcPic );604 #endif605 563 m_bFirstSliceInPicture = true; 606 607 564 return; 608 565 } … … 623 580 { 624 581 pcPicTmp->setOutputMark(false); 625 #if NH_MV626 pcPicTmp->setPicOutputFlag(false);627 #endif628 582 } 629 583 } … … 673 627 } 674 628 } 675 676 629 #endif 630 631 632 #if NH_MV 633 Void TDecTop::activatePSsAndInitPicOrSlice( TComPic* newPic ) 634 { 635 if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() ) 636 { 637 assert( newPic != NULL ); 638 639 #else 677 640 Void TDecTop::xActivateParameterSets() 678 641 { 679 642 if (m_bFirstSliceInPicture) 680 643 { 644 #endif 681 645 const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value 682 646 assert (pps != 0); … … 690 654 const TComVPS* vps = m_parameterSetManager.getVPS(sps->getVPSId()); 691 655 assert (vps != 0); 692 if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) ) 656 // TBD: check the condition on m_firstPicInLayerDecodedFlag 657 if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP() || !m_firstPicInLayerDecodedFlag[m_layerId] , m_layerId ) ) 693 658 #else 694 659 if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) … … 700 665 701 666 #if NH_MV 702 // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0 703 if ( vps->getVpsNumRepFormatsMinus1() == 0 ) 704 { 705 //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0. 706 assert( sps->getUpdateRepFormatFlag() == false ); 707 } 708 sps->checkRpsMaxNumPics( vps, getLayerId() ); 709 710 // It is a requirement of bitstream conformance that, when the SPS is referred to by 711 // any current picture that belongs to an independent non-base layer, the value of 712 // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0. 713 714 if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 ) 715 { 716 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 717 } 667 if ( decProcAnnexG() ) 668 { 669 // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0 670 if ( vps->getVpsNumRepFormatsMinus1() == 0 ) 671 { 672 //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0. 673 assert( sps->getUpdateRepFormatFlag() == false ); 674 } 675 sps->checkRpsMaxNumPics( vps, getLayerId() ); 676 677 // It is a requirement of bitstream conformance that, when the SPS is referred to by 678 // any current picture that belongs to an independent non-base layer, the value of 679 // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0. 680 681 if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 ) 682 { 683 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 684 } 685 } 718 686 #endif 719 687 … … 734 702 735 703 // Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use. 704 #if !NH_MV 736 705 xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer()); 706 737 707 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 738 # if NH_MV739 m_ apcSlicePilot->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );708 #else 709 m_pcPic = newPic; 740 710 #endif 741 711 … … 752 722 753 723 #if NH_MV 724 pSlice->setPic( m_pcPic ); 754 725 vps=pSlice->getVPS(); 755 726 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. … … 803 774 else 804 775 { 776 #if NH_MV 777 assert( m_pcPic != NULL ); 778 assert( newPic == NULL ); 779 #endif 805 780 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice 806 781 m_pcPic->allocateNewSlice(); … … 828 803 829 804 // Check if any new SEI has arrived 830 if(!m_SEIs.empty()) 831 { 832 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 833 SEIMessages &picSEI = m_pcPic->getSEIs(); 834 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 835 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 836 deleteSEIs(m_SEIs); 837 } 838 } 839 } 805 if(!m_SEIs.empty()) 806 { 807 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 808 SEIMessages &picSEI = m_pcPic->getSEIs(); 809 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 810 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 811 deleteSEIs(m_SEIs); 812 } 813 } 814 } 815 840 816 Void TDecTop::xParsePrefixSEIsForUnknownVCLNal() 841 817 { … … 865 841 } 866 842 867 868 #if NH_MV 869 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 870 { 871 assert( nalu.m_nuhLayerId == m_layerId ); 843 #if !NH_MV 844 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 845 { 846 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 847 // it is not associated with picture, sps or pps structures. 848 if (m_bFirstSliceInPicture) 849 { 872 850 #else 873 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 874 { 875 #endif 851 Void TDecTop::decodeSliceHeader(InputNALUnit &nalu ) 852 { 853 // Initialize entropy decoder 854 m_cEntropyDecoder.setEntropyDecoder (&m_cCavlcDecoder); 855 m_cEntropyDecoder.setBitstream (&(nalu.getBitstream())); 856 857 assert( nalu.m_nuhLayerId == m_layerId ); 876 858 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 877 // it is not associated with picture, sps or pps structures. 878 879 if (m_bFirstSliceInPicture) 880 { 859 // it is not associated with picture, sps or pps structures. 860 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 861 m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot ); 862 if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() ) 863 { 864 #endif 881 865 m_uiSliceIdx = 0; 882 866 } … … 889 873 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); 890 874 Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 891 892 893 894 875 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 876 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 877 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 878 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N); 895 879 m_apcSlicePilot->setTemporalLayerNonReferenceFlag(nonReferenceFlag); 880 #if !NH_MV 896 881 m_apcSlicePilot->setReferenced(true); // Putting this as true ensures that picture is referenced the first time it is in an RPS 882 #endif 897 883 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 898 884 #if NH_MV 885 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager ); 886 #else 899 887 #if ENC_DEC_TRACE 900 888 const UInt64 originalSymbolCount = g_nSymbolCounter; 901 889 #endif 890 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager, m_prevTid0POC); 891 #endif 902 892 903 893 #if NH_MV 904 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 905 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 906 #endif 907 908 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager, m_prevTid0POC); 909 894 } 895 #else 910 896 // set POC for dependent slices in skipped pictures 911 897 if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped) … … 915 901 916 902 xUpdatePreviousTid0POC(m_apcSlicePilot); 917 918 903 m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA); 919 904 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 920 #if NH_MV 921 const TComVPS* vps = m_apcSlicePilot->getVPS(); 922 Int layerId = nalu.m_nuhLayerId; 923 setViewId ( vps->getViewId ( layerId ) ); 924 #if NH_3D 925 setViewIndex( vps->getViewIndex( layerId ) ); 926 setIsDepth ( vps->getDepthId ( layerId ) == 1 ); 927 m_ivPicLists->setVPS( vps ); 928 #endif 929 #endif 905 930 906 931 907 //For inference of NoOutputOfPriorPicsFlag 932 908 if (m_apcSlicePilot->getRapPicFlag()) 933 909 { 934 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||910 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 935 911 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 936 912 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) 937 {938 m_apcSlicePilot->setNoRaslOutputFlag(true);939 }913 { 914 m_apcSlicePilot->setNoRaslOutputFlag(true); 915 } 940 916 //the inference for NoOutputPriorPicsFlag 941 917 if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag()) … … 948 924 else 949 925 { 950 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 926 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 951 927 } 952 928 … … 974 950 } 975 951 } 976 952 977 953 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 978 954 { … … 985 961 xUpdatePreviousTid0POC(m_apcSlicePilot); 986 962 } 987 #if NH_MV988 xCeckNoClrasOutput();989 #endif990 963 991 964 // Skip pictures due to random access 992 993 #if NH_MV994 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay, vps))995 #else996 965 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 997 #endif998 966 { 999 967 m_prevSliceSkipped = true; 1000 968 m_skippedPOC = m_apcSlicePilot->getPOC(); 1001 #if NH_MV1002 sliceSkippedFlag = true;1003 #endif1004 969 return false; 1005 970 } … … 1009 974 m_prevSliceSkipped = true; 1010 975 m_skippedPOC = m_apcSlicePilot->getPOC(); 1011 #if NH_MV1012 sliceSkippedFlag = true;1013 #endif1014 976 return false; 1015 977 } … … 1030 992 { 1031 993 m_prevPOC = m_apcSlicePilot->getPOC(); 994 1032 995 #if ENC_DEC_TRACE 1033 996 //rewind the trace counter since we didn't actually decode the slice … … 1038 1001 m_prevPOC = m_apcSlicePilot->getPOC(); 1039 1002 } 1040 #if NH_MV1041 if ( newLayerFlag )1042 {1043 return false;1044 }1045 #if ENC_DEC_TRACE1046 #if H_MV_ENC_DEC_TRAC1047 // parse remainder of SH1048 g_disableHLSTrace = false;1049 #endif1050 #endif1051 #endif1052 1053 #if NH_MV1054 // This part needs further testing !1055 if ( m_apcSlicePilot->getPocResetFlag() )1056 {1057 xResetPocInPicBuffer();1058 }1059 1060 if ( m_apcSlicePilot->getTLayer() == 0 && m_apcSlicePilot->getEnableTMVPFlag() == 0 )1061 {1062 //update all pics in the DPB such that they cannot be used for TMPV ref1063 TComList<TComPic*>::iterator iterRefPic = m_cListPic.begin();1064 while( iterRefPic != m_cListPic.end() )1065 {1066 TComPic *refPic = *iterRefPic;1067 if( ( refPic->getLayerId() == m_apcSlicePilot->getLayerId() ) && refPic->getReconMark() )1068 {1069 for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--)1070 {1071 1072 TComSlice *refSlice = refPic->getSlice(i);1073 refSlice->setAvailableForTMVPRefFlag( false );1074 }1075 }1076 iterRefPic++;1077 }1078 }1079 m_apcSlicePilot->setAvailableForTMVPRefFlag( true );1080 #endif1081 1003 1082 1004 //detect lost reference picture and insert copy of earlier frame. … … 1093 1015 m_prevPOC = m_apcSlicePilot->getPOC(); 1094 1016 } 1095 1096 1017 // actual decoding starts here 1097 1018 xActivateParameterSets(); … … 1103 1024 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1104 1025 1105 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1106 // Now, having set up the maps, convert them to the correct form. 1107 pcSlice->setSliceSegmentCurStartCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()) ); 1108 pcSlice->setSliceSegmentCurEndCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurEndCtuTsAddr()) ); 1109 if(!pcSlice->getDependentSliceSegmentFlag()) 1110 { 1111 pcSlice->setSliceCurStartCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurStartCtuTsAddr())); 1112 pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr())); 1113 } 1114 1115 m_pcPic->setTLayer(nalu.m_temporalId); 1026 #endif 1116 1027 1117 1028 #if NH_MV 1118 //Check Multiview Main profile constraint in G.11.1.1 1119 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1120 // for the layer with nuh_layer_id equal to i in subBitstream, 1121 // inter_view_mv_vert_constraint_flag shall be equal to 1 1122 // in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer. 1123 if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN 1029 Void TDecTop::decodeSliceSegment(InputNALUnit &nalu ) 1030 { 1031 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1032 1033 if ( m_pcPic->getHasGeneratedRefPics() ) 1034 { 1035 if ( pcSlice->getFirstSliceSegementInPicFlag() ) 1036 { 1037 std::cout << std:: setfill(' ') 1038 << "Layer " << std::setw(2) << m_pcPic->getLayerId() 1039 << " POC " << std::setw(4) << m_pcPic->getPOC() 1040 << " Reference pictures missing. Skipping picture." << std::endl; 1041 } 1042 } 1043 else 1044 { 1045 //Check Multiview Main profile constraint in G.11.1.1 1046 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1047 // for the layer with nuh_layer_id equal to i in subBitstream, 1048 // inter_view_mv_vert_constraint_flag shall be equal to 1 1049 // in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer. 1050 if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN 1124 1051 && 1125 1052 pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 1126 ) 1127 { 1128 assert( pcSlice->getSPS()->getInterViewMvVertConstraintFlag()==1 ); 1129 } 1130 #endif 1131 #if NH_MV 1132 m_pcPic->setLayerId( nalu.m_nuhLayerId ); 1133 m_pcPic->setViewId ( getViewId() ); 1053 ) 1054 { 1055 assert( pcSlice->getSPS()->getInterViewMvVertConstraintFlag()==1 ); 1056 } 1057 1058 m_pcPic->setLayerId( nalu.m_nuhLayerId ); 1059 m_pcPic->setViewId ( getViewId() ); 1134 1060 #if NH_3D 1135 m_pcPic->setViewIndex( getViewIndex() ); 1136 m_pcPic->setIsDepth ( getIsDepth () ); 1137 pcSlice->setIvPicLists( m_ivPicLists ); 1138 #endif 1139 #endif 1140 1141 if (!pcSlice->getDependentSliceSegmentFlag()) 1142 { 1143 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); 1144 // Set reference list 1145 #if NH_MV 1146 std::vector< TComPic* > tempRefPicLists[2]; 1147 std::vector< Bool > usedAsLongTerm [2]; 1148 Int numPocTotalCurr; 1149 1150 pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr); 1151 pcSlice->setRefPicList ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 1061 m_pcPic->setViewIndex( getViewIndex() ); 1062 m_pcPic->setIsDepth ( getIsDepth () ); 1063 pcSlice->setIvPicLists( m_dpb ); 1064 #endif 1065 #endif 1066 1067 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1068 // Now, having set up the maps, convert them to the correct form. 1069 pcSlice->setSliceSegmentCurStartCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()) ); 1070 pcSlice->setSliceSegmentCurEndCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurEndCtuTsAddr()) ); 1071 if(!pcSlice->getDependentSliceSegmentFlag()) 1072 { 1073 pcSlice->setSliceCurStartCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurStartCtuTsAddr())); 1074 pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr())); 1075 } 1076 1077 m_pcPic->setTLayer(nalu.m_temporalId); 1078 1079 1080 if (!pcSlice->getDependentSliceSegmentFlag()) 1081 { 1082 #if !NH_MV 1083 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); 1084 // Set reference list 1085 pcSlice->setRefPicList( m_cListPic, true ); 1086 #else 1087 if (pcSlice->getSliceType() != I_SLICE ) 1088 { 1089 if( m_decProcPocAndRps == ANNEX_F ) 1090 { 1091 pcSlice->f834decProcForRefPicListConst(); 1092 } 1093 else if ( m_decProcPocAndRps == CLAUSE_8 ) 1094 { 1095 pcSlice->cl834DecProcForRefPicListConst(); 1096 } 1097 else 1098 { 1099 assert( false ); 1100 } 1101 } 1152 1102 #if NH_3D_NBDV 1153 pcSlice->setDefaultRefView();1103 pcSlice->setDefaultRefView(); 1154 1104 #endif 1155 1105 #if NH_3D_ARP 1156 pcSlice->setARPStepNum(m_ivPicLists); 1157 #endif 1158 #else 1159 pcSlice->setRefPicList( m_cListPic, true ); 1160 #endif 1161 1162 #if NH_3D 1163 pcSlice->checkInCompPredRefLayers(); 1164 #if NH_3D_IV_MERGE 1165 #if H_3D_FCO 1166 //assert( !getIsDepth() ); 1167 #else 1168 assert( !getIsDepth() || ( pcSlice->getTexturePic() != 0 ) ); 1169 #endif 1170 #endif 1171 #endif 1172 #if NH_MV 1173 if( m_layerId > 0 && !pcSlice->isIntra() && pcSlice->getEnableTMVPFlag() ) 1174 { 1175 TComPic* refPic = pcSlice->getRefPic(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx()); 1176 1177 assert ( refPic ); 1178 assert ( refPic->getPicSym()->getSlice(0)->getAvailableForTMVPRefFlag() == true ); 1179 } 1180 #endif 1181 1182 // For generalized B 1183 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) 1184 if (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0) 1185 { 1186 Int iNumRefIdx = pcSlice->getNumRefIdx(REF_PIC_LIST_0); 1187 pcSlice->setNumRefIdx ( REF_PIC_LIST_1, iNumRefIdx ); 1188 1189 for (Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++) 1190 { 1191 pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx); 1192 } 1193 } 1194 if (!pcSlice->isIntra()) 1195 { 1196 Bool bLowDelay = true; 1197 Int iCurrPOC = pcSlice->getPOC(); 1198 Int iRefIdx = 0; 1199 1200 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_0) && bLowDelay; iRefIdx++) 1201 { 1202 if ( pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx)->getPOC() > iCurrPOC ) 1106 pcSlice->setPocsInCurrRPSs(); 1107 pcSlice->setARPStepNum(m_dpb); 1108 #endif 1109 #endif 1110 1111 // For generalized B 1112 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) 1113 if (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0) 1114 { 1115 Int iNumRefIdx = pcSlice->getNumRefIdx(REF_PIC_LIST_0); 1116 pcSlice->setNumRefIdx ( REF_PIC_LIST_1, iNumRefIdx ); 1117 1118 for (Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++) 1203 1119 { 1204 bLowDelay = false;1120 pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx); 1205 1121 } 1206 1122 } 1207 if (pcSlice->isInterB()) 1208 { 1209 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; iRefIdx++) 1123 if (!pcSlice->isIntra()) 1124 { 1125 Bool bLowDelay = true; 1126 Int iCurrPOC = pcSlice->getPOC(); 1127 Int iRefIdx = 0; 1128 1129 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_0) && bLowDelay; iRefIdx++) 1210 1130 { 1211 if ( pcSlice->getRefPic(REF_PIC_LIST_ 1, iRefIdx)->getPOC() > iCurrPOC )1131 if ( pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx)->getPOC() > iCurrPOC ) 1212 1132 { 1213 1133 bLowDelay = false; 1214 1134 } 1215 1135 } 1216 } 1217 1218 pcSlice->setCheckLDC(bLowDelay); 1219 } 1220 1221 //--------------- 1222 pcSlice->setRefPOCList(); 1136 if (pcSlice->isInterB()) 1137 { 1138 for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; iRefIdx++) 1139 { 1140 if ( pcSlice->getRefPic(REF_PIC_LIST_1, iRefIdx)->getPOC() > iCurrPOC ) 1141 { 1142 bLowDelay = false; 1143 } 1144 } 1145 } 1146 1147 pcSlice->setCheckLDC(bLowDelay); 1148 } 1149 1150 //--------------- 1151 pcSlice->setRefPOCList(); 1223 1152 #if NH_3D_TMVP 1224 if(pcSlice->getLayerId()) 1225 { 1226 pcSlice->generateAlterRefforTMVP(); 1227 } 1228 #endif 1229 } 1230 1231 m_pcPic->setCurrSliceIdx(m_uiSliceIdx); 1232 if(pcSlice->getSPS()->getScalingListFlag()) 1233 { 1234 TComScalingList scalingList; 1235 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1236 { 1237 scalingList = pcSlice->getPPS()->getScalingList(); 1238 } 1239 else if (pcSlice->getSPS()->getScalingListPresentFlag()) 1240 { 1241 scalingList = pcSlice->getSPS()->getScalingList(); 1153 if(pcSlice->getLayerId()) 1154 { 1155 pcSlice->generateAlterRefforTMVP(); 1156 } 1157 #endif 1158 } 1159 1160 m_pcPic->setCurrSliceIdx(m_uiSliceIdx); 1161 if(pcSlice->getSPS()->getScalingListFlag()) 1162 { 1163 TComScalingList scalingList; 1164 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1165 { 1166 scalingList = pcSlice->getPPS()->getScalingList(); 1167 } 1168 else if (pcSlice->getSPS()->getScalingListPresentFlag()) 1169 { 1170 scalingList = pcSlice->getSPS()->getScalingList(); 1171 } 1172 else 1173 { 1174 scalingList.setDefaultScalingList(); 1175 } 1176 m_cTrQuant.setScalingListDec(scalingList); 1177 m_cTrQuant.setUseScalingList(true); 1242 1178 } 1243 1179 else 1244 1180 { 1245 scalingList.setDefaultScalingList(); 1246 } 1247 m_cTrQuant.setScalingListDec(scalingList); 1248 m_cTrQuant.setUseScalingList(true); 1249 } 1250 else 1251 { 1252 const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] = 1253 { 1181 const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] = 1182 { 1254 1183 pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_LUMA), 1255 1184 pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA) 1256 }; 1257 m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getSPS()->getBitDepths()); 1258 m_cTrQuant.setUseScalingList(false); 1259 } 1260 1261 #if !NH_3D_FIX_TICKET_101 1262 #if NH_3D_IV_MERGE 1263 #if H_3D_FCO 1264 if( !pcSlice->getIsDepth() && m_pcCamParsCollector ) 1185 }; 1186 m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getSPS()->getBitDepths()); 1187 m_cTrQuant.setUseScalingList(false); 1188 } 1189 1190 #if NH_3D 1191 if ( decProcAnnexI() ) 1192 { 1193 pcSlice->checkInCompPredRefLayers(); 1194 } 1195 #endif 1196 1197 // Decode a picture 1198 m_cGopDecoder.decompressSlice(&(nalu.getBitstream()), m_pcPic); 1199 1200 #if NH_3D 1201 if( m_pcCamParsCollector ) 1202 { 1203 m_pcCamParsCollector->setSlice( pcSlice ); 1204 } 1205 #endif 1206 1207 #if !NH_MV 1208 m_bFirstSliceInPicture = false; 1265 1209 #else 1266 if( pcSlice->getIsDepth() && m_pcCamParsCollector ) 1267 #endif 1268 { 1269 m_pcCamParsCollector->copyCamParamForSlice( pcSlice ); 1270 } 1271 #endif 1272 #endif 1273 // Decode a picture 1274 m_cGopDecoder.decompressSlice(&(nalu.getBitstream()), m_pcPic); 1275 1276 #if NH_3D 1277 if( m_pcCamParsCollector ) 1278 { 1279 m_pcCamParsCollector->setSlice( pcSlice ); 1280 } 1281 #endif 1282 1283 m_bFirstSliceInPicture = false; 1210 } 1211 #endif 1284 1212 m_uiSliceIdx++; 1285 1213 1214 #if !NH_MV 1286 1215 return false; 1287 } 1216 #endif 1217 } 1218 1288 1219 1289 1220 Void TDecTop::xDecodeVPS(const std::vector<UChar> &naluData) … … 1333 1264 1334 1265 #if NH_MV 1335 Bool TDecTop::decode (InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag)1266 Bool TDecTop::decodeNonVclNalu(InputNALUnit& nalu ) 1336 1267 #else 1337 1268 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) … … 1354 1285 case NAL_UNIT_VPS: 1355 1286 xDecodeVPS(nalu.getBitstream().getFifo()); 1356 #if NH_MV1357 m_isLastNALWasEos = false;1358 #endif1359 1287 return false; 1360 1288 … … 1373 1301 1374 1302 case NAL_UNIT_SUFFIX_SEI: 1375 #if NH_MV1376 if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )1377 {1378 assert( m_isLastNALWasEos == false );1379 }1380 #endif1381 1303 if (m_pcPic) 1382 1304 { … … 1410 1332 case NAL_UNIT_CODED_SLICE_RASL_R: 1411 1333 #if NH_MV 1412 if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N || 1413 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N || 1414 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N || 1415 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1416 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ) 1417 { 1418 assert( m_isLastNALWasEos == false ); 1419 } 1420 else 1421 { 1422 m_isLastNALWasEos = false; 1423 } 1424 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag ); 1334 assert( false ); 1335 return 1; 1425 1336 #else 1426 1337 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1429 1340 1430 1341 case NAL_UNIT_EOS: 1431 #if NH_MV 1432 assert( m_isLastNALWasEos == false ); 1433 //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything. 1434 if (nalu.m_nuhLayerId > 0) 1435 { 1436 printf( "\nThis bitstream has EOS with non-zero layer id.\n" ); 1437 return false; 1438 } 1439 m_isLastNALWasEos = true; 1440 #endif 1342 #if !NH_MV 1441 1343 m_associatedIRAPType = NAL_UNIT_INVALID; 1442 1344 m_pocCRA = 0; … … 1445 1347 m_prevSliceSkipped = false; 1446 1348 m_skippedPOC = 0; 1349 #endif 1447 1350 return false; 1448 1351 … … 1465 1368 fdReader.parseFillerData(&(nalu.getBitstream()),size); 1466 1369 printf ("Note: found NAL_UNIT_FILLER_DATA with %u bytes payload.\n", size); 1467 #if NH_MV1468 assert( m_isLastNALWasEos == false );1469 #endif1470 1370 return false; 1471 1371 } … … 1528 1428 } 1529 1429 1430 #if !NH_MV 1530 1431 /** Function for checking if picture should be skipped because of association with a previous BLA picture 1531 1432 * \param iPOCLastDisplay POC of last picture displayed … … 1558 1459 * access point there is no guarantee that the decoder will not crash. 1559 1460 */ 1560 #if NH_MV1561 Bool TDecTop::isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay, const TComVPS* vps)1562 #else1563 1461 Bool TDecTop::isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay ) 1564 #endif1565 1462 { 1566 1463 if (iSkipFrame) … … 1569 1466 return true; 1570 1467 } 1571 #if NH_MV1572 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet.1573 #else1574 1468 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1575 #endif1576 1469 { 1577 1470 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1581 1474 { 1582 1475 1583 #if NH_MV1584 if ( xAllRefLayersInitilized( vps ) )1585 {1586 m_layerInitilizedFlag[ m_layerId ] = true;1587 m_pocRandomAccess = m_apcSlicePilot->getPOC();1588 }1589 else1590 {1591 return true;1592 }1593 #else1594 1476 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1595 1477 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1596 #endif1597 1478 } 1598 1479 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1599 1480 { 1600 #if NH_MV1601 if ( xAllRefLayersInitilized( vps) )1602 {1603 m_layerInitilizedFlag[ m_layerId ] = true;1604 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.1605 }1606 else1607 {1608 return true;1609 }1610 #else1611 1481 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1612 #endif1613 1482 } 1614 1483 else 1615 1484 { 1616 #if NH_MV1617 static Bool warningMessage[MAX_NUM_LAYERS];1618 static Bool warningInitFlag = false;1619 1620 if (!warningInitFlag)1621 {1622 for ( Int i = 0; i < MAX_NUM_LAYERS; i++)1623 {1624 warningMessage[i] = true;1625 }1626 warningInitFlag = true;1627 }1628 1629 if ( warningMessage[getLayerId()] )1630 {1631 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() );1632 warningMessage[m_layerId] = false;1633 }1634 #else1635 1485 if(!m_warningMessageSkipPicture) 1636 1486 { … … 1638 1488 m_warningMessageSkipPicture = true; 1639 1489 } 1640 #endif1641 1490 return true; 1642 1491 } … … 1649 1498 } 1650 1499 // if we reach here, then the picture is not skipped. 1651 #if NH_MV 1652 return !m_layerInitilizedFlag[ getLayerId() ]; 1500 return false; 1501 } 1502 1653 1503 #else 1654 return false; 1655 #endif 1656 } 1657 #if NH_MV 1658 TComPic* TDecTop::getPic( Int poc ) 1659 { 1660 xGetPic( m_layerId, poc ); 1661 TComList<TComPic*>* listPic = getListPic(); 1662 TComPic* pcPic = NULL; 1663 for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++) 1664 { 1665 if( (*it)->getPOC() == poc ) 1666 { 1667 pcPic = *it ; 1668 break ; 1669 } 1670 } 1671 return pcPic; 1672 } 1673 1674 TComPic* TDecTop::xGetPic( Int layerId, Int poc ) 1504 1505 Int TDecTop::preDecodePoc( Bool firstPicInLayerDecodedFlag, Bool isFstPicOfAllLayOfPocResetPer, Bool isPocResettingPicture ) 1506 { 1507 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1508 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1509 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1510 1511 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1512 1513 TComSlice* slice = m_apcSlicePilot; 1514 const Int nuhLayerId = slice->getLayerId(); 1515 const TComVPS* vps = slice->getVPS(); 1516 const TComSPS* sps = slice->getSPS(); 1517 1518 Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 1519 1520 if ( isFstPicOfAllLayOfPocResetPer ) 1521 { 1522 // When the current picture is the first picture among all layers of a POC resetting period, 1523 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1524 pocDecrementedInDpbFlag = false; 1525 } 1526 1527 // The variable pocResettingFlag is derived as follows: 1528 Bool pocResettingFlag; 1529 if ( isPocResettingPicture ) 1530 { 1531 //- If the current picture is a POC resetting picture, the following applies: 1532 if( vps->getVpsPocLsbAlignedFlag() ) 1533 { 1534 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1535 pocResettingFlag = true; 1536 } 1537 else if ( pocDecrementedInDpbFlag ) 1538 { 1539 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1540 pocResettingFlag = false; 1541 } 1542 else 1543 { 1544 // - Otherwise, pocResettingFlag is set equal to 1. 1545 pocResettingFlag = true; 1546 } 1547 } 1548 else 1549 { 1550 // - Otherwise, pocResettingFlag is set equal to 0. 1551 pocResettingFlag = false; 1552 } 1553 1554 Int picOrderCntMsb; 1555 Int picOrderCntVal; 1556 1557 // Depending on pocResettingFlag, the following applies: 1558 if ( pocResettingFlag ) 1559 { 1560 //- The PicOrderCntVal of the current picture is derived as follows: 1561 if( slice->getPocResetIdc() == 1 ) 1562 { 1563 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 1564 } 1565 else if (slice->getPocResetIdc() == 2 ) 1566 { 1567 picOrderCntVal = 0; 1568 } 1569 else 1570 { 1571 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 1572 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1573 } 1574 } 1575 else 1576 { 1577 //- Otherwise (pocResettingFlag is equal to 0), the following applies: 1578 //- The PicOrderCntVal of the current picture is derived as follows: 1579 1580 if( slice->getPocMsbCycleValPresentFlag() ) 1581 { 1582 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 1583 } 1584 else if( !firstPicInLayerDecodedFlag || 1585 slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 1586 { 1587 picOrderCntMsb = 0; // (F 62) 1588 } 1589 else 1590 { 1591 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 1592 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 1593 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 1594 } 1595 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1596 } 1597 return picOrderCntVal; 1598 } 1599 1600 Void TDecTop::inferPocResetPeriodId() 1601 { 1602 // Infer PocResetPeriodId 1603 // When not present, the value of poc_reset_period_id is inferred as follows: 1604 1605 if ( !m_apcSlicePilot->getHasPocResetPeriodIdPresent() ) 1606 { 1607 if ( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] != MIN_INT ) 1608 { 1609 // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 1610 // of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 1611 // poc_reset_period_id of picA. 1612 1613 m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 1614 } 1615 else 1616 { 1617 //- Otherwise, the value of poc_reset_period_id is inferred to be equal to 0. 1618 m_apcSlicePilot->setPocResetPeriodId( 0 ); 1619 } 1620 } 1621 else 1622 { 1623 m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 1624 } 1625 } 1626 1627 1628 Void TDecTop::decodePocAndRps( ) 1675 1629 { 1676 return m_ivPicLists->getPic( layerId, poc ) ; 1677 } 1678 1679 Void TDecTop::xResetPocInPicBuffer() 1680 { 1681 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1682 while (iterPic != m_cListPic.end()) 1683 { 1684 TComPic* pic = *(iterPic++); 1685 if ( pic->getReconMark() ) 1686 { 1687 for( Int i = 0; i < pic->getNumAllocatedSlice(); i++) 1688 { 1689 TComSlice* slice = pic->getSlice( i ); 1690 slice->setPOC ( slice->getPOC() - m_apcSlicePilot->getPocBeforeReset() ); 1691 } 1692 } 1693 } 1694 } 1695 1696 Void TDecTop::xCeckNoClrasOutput() 1697 { 1698 // This part needs further testing! 1699 if ( getLayerId() == 0 ) 1630 assert( m_uiSliceIdx == 0 ); 1631 Int nuhLayerId = m_pcPic->getLayerId(); 1632 if ( m_decProcPocAndRps == CLAUSE_8 ) 1633 { 1634 // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0 1635 1636 // Variables and functions relating to picture order count are derived as 1637 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1638 // segment of a picture. 1639 x831DecProcForPicOrderCount( ); 1640 1641 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1642 // pictures may be marked as "unused for reference" or "used for long-term 1643 // reference". This needs to be invoked only for the first slice segment of a 1644 // picture. 1645 x832DecProcForRefPicSet ( false ); 1646 } 1647 else if( m_decProcPocAndRps == ANNEX_F ) 1648 { 1649 // F.8.1.3 Common decoding process for a coded picture 1650 1651 if (nuhLayerId == 0 ) 1652 { 1653 // F.8.1.4 Decoding process for a coded picture with nuh_layer_id equal to 1654 // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3 1655 1656 // Variables and functions relating to picture order count are derived as 1657 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1658 // segment of a picture. 1659 xF831DecProcForPicOrderCount( ); 1660 1661 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1662 // pictures may be marked as "unused for reference" or "used for long-term 1663 // reference". This needs to be invoked only for the first slice segment of a 1664 // picture. 1665 xF832DecProcForRefPicSet( ); 1666 } 1667 else 1668 { 1669 // F.8.1.5 Decoding process for starting the decoding of a coded picture with 1670 // nuh_layer_id greater than 0 1671 1672 // Variables and functions relating to picture order count are derived in clause F.8.3.1. 1673 // This needs to be invoked only for the first slice segment of a picture. It is a requirement 1674 // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 1675 // same value during and at the end of decoding of the access unit 1676 xF831DecProcForPicOrderCount( ); 1677 1678 // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 1679 // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 1680 // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 1681 // This needs to be invoked only for the first slice segment of a picture. 1682 xF832DecProcForRefPicSet( ); 1683 } 1684 } 1685 else 1686 { 1687 assert( false ); 1688 } 1689 } 1690 1691 Void TDecTop::genUnavailableRefPics( ) 1692 { 1693 assert( m_uiSliceIdx == 0 ); 1694 Int nuhLayerId = m_pcPic->getLayerId(); 1695 if ( m_decProcPocAndRps == CLAUSE_8 ) 1696 { 1697 // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0 1698 1699 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1700 { 1701 // When the current picture is a BLA picture or is a CRA picture 1702 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1703 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1704 // which needs to be invoked only for the first slice segment of a picture. 1705 x8331GenDecProcForGenUnavilRefPics(); 1706 } 1707 } 1708 else if( m_decProcPocAndRps == ANNEX_F ) 1709 { 1710 // F.8.1.3 Common decoding process for a coded picture 1711 1712 if (nuhLayerId == 0 ) 1713 { 1714 // F.8.1.4 Decoding process for a coded picture with nuh_layer_id equal to 1715 // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3 1716 1717 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1718 { 1719 // When the current picture is a BLA picture or is a CRA picture 1720 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1721 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1722 // which needs to be invoked only for the first slice segment of a picture. 1723 xF833DecProcForGenUnavRefPics(); 1724 } 1725 #if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1726 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 1727 decRps->m_numActiveRefLayerPics0 = 0; 1728 decRps->m_numActiveRefLayerPics1 = 0; 1729 #endif 1730 } 1731 else 1732 { 1733 // F.8.1.5 Decoding process for starting the decoding of a coded picture with 1734 // nuh_layer_id greater than 0 1735 1736 if ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] ) 1737 { 1738 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 1739 // unavailable reference pictures for pictures first in decoding order within a layer specified in 1740 // clause F.8.1.7 is invoked, which needs to be invoked only for the first slice segment of a picture. 1741 xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay(); 1742 } 1743 1744 if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && ( m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1745 { 1746 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 1747 // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 1748 // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 1749 // segment of a picture. 1750 xF833DecProcForGenUnavRefPics(); 1751 } 1752 1753 if ( decProcAnnexG() ) 1754 { 1755 // G.1.2 --> G.1.3 1756 xG813DecProcForInterLayerRefPicSet(); 1757 } 1758 } 1759 } 1760 else 1761 { 1762 assert( false ); 1763 } 1764 1765 xCheckUnavailableRefPics(); 1766 } 1767 Void TDecTop::executeLoopFilters( ) 1768 { 1769 assert( m_pcPic != NULL ); 1770 if ( !m_pcPic->getHasGeneratedRefPics() && !m_pcPic->getIsGenerated() ) 1771 { 1772 m_cGopDecoder.filterPicture( m_pcPic ); 1773 } 1774 m_cCuDecoder.destroy(); 1775 } 1776 1777 Void TDecTop::finalizePic() 1778 { 1779 if( m_pcPic->isIrap() ) 1780 { 1781 m_prevIrapPoc = m_pcPic->getPOC(); 1782 m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 1783 } 1784 if( m_pcPic->isStsa() ) 1785 { 1786 m_prevStsaDecOrder = m_pcPic->getDecodingOrder(); 1787 m_prevStsaTemporalId = m_pcPic->getTemporalId() ; 1788 } 1789 } 1790 1791 1792 Void TDecTop::initFromActiveVps( const TComVPS* vps ) 1793 { 1794 setViewId ( vps->getViewId ( getLayerId() ) ); 1795 #if NH_3D 1796 setViewIndex( vps->getViewIndex( getLayerId() ) ); 1797 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 ); 1798 #endif 1799 1800 if ( !vps->getVpsExtensionFlag() ) 1801 { 1802 m_decodingProcess = CLAUSE_8; 1803 m_isInOwnTargetDecLayerIdList = ( getLayerId() == 0 ); 1804 } 1805 else 1806 { 1807 if ( m_targetOlsIdx == -1 ) 1808 { 1809 // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1810 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1811 } 1812 1813 Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1814 1815 if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && vps->getVpsBaseLayerInternalFlag() ) 1816 { 1817 m_smallestLayerId = 0; 1818 } 1819 else if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && !vps->getVpsBaseLayerInternalFlag() ) 1820 { 1821 m_smallestLayerId = 0; 1822 } 1823 else if ( targetDecLayerSetIdx > vps->getVpsNumLayerSetsMinus1() && vps->getNumLayersInIdList( targetDecLayerSetIdx) == 1 ) 1824 { 1825 1826 // m_smallestLayerId = 0; 1827 // For now don't do change of layer id here. 1828 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1829 } 1830 else 1831 { 1832 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1833 } 1834 1835 1836 // Set profile 1837 Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1838 Int lIdx = -1; 1839 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ) ; j++ ) 1840 { 1841 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 1842 { 1843 lIdx = j; 1844 break; 1845 } 1846 } 1847 m_isInOwnTargetDecLayerIdList = (lIdx != -1); 1848 1849 if ( m_isInOwnTargetDecLayerIdList ) 1850 { 1851 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1852 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1853 1854 if ( profileIdc == 6 ) 1855 { 1856 m_decodingProcess = ANNEX_G; 1857 } 1858 else if (profileIdc == 7 ) 1859 { 1860 m_decodingProcess = ANNEX_H; 1861 } 1862 else if (profileIdc == 8 ) 1863 { 1864 m_decodingProcess = ANNEX_I; 1865 } 1866 } 1867 } 1868 } 1869 1870 1871 Bool TDecTop::getFirstSliceSegementInPicFlag() 1872 { 1873 return m_apcSlicePilot->getFirstSliceSegementInPicFlag(); 1874 } 1875 1876 Void TDecTop::x831DecProcForPicOrderCount() 1877 { 1878 ///////////////////////////////////////////////////// 1879 // 8.3.1 Decoding process for picture order count // 1880 ///////////////////////////////////////////////////// 1881 1882 // Output of this process is PicOrderCntVal, the picture order count of the current picture. 1883 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1884 // motion vector prediction, and for decoder conformance checking (see clause C.5). 1885 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1886 1887 const TComSlice* curSlice = m_pcPic->getSlice(0); 1888 1889 Int prevPicOrderCntLsb = MIN_INT; 1890 Int prevPicOrderCntMsb = MIN_INT; 1891 if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1892 { 1893 // When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 1894 // the variables prevPicOrderCntLsb and prevPicOrderCntMsb are derived as follows: 1895 1896 // - Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 1897 // a RADL picture or an SLNR picture. 1898 1899 // - The variable prevPicOrderCntLsb is set equal to slice_pic_order_cnt_lsb of prevTid0Pic. 1900 prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 1901 1902 // - The variable prevPicOrderCntMsb is set equal to PicOrderCntMsb of prevTid0Pic. 1903 prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 1904 } 1905 1906 // The variable PicOrderCntMsb of the current picture is derived as follows: 1907 1908 Int slicePicOrderCntLsb = curSlice->getSlicePicOrderCntLsb(); 1909 1910 Int picOrderCntMsb; 1911 1912 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 1913 { 1914 //- If the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, PicOrderCntMsb is set equal to 0. 1915 picOrderCntMsb = 0; 1916 } 1917 else 1918 { 1919 Int maxPicOrderCntLsb = curSlice->getSPS()->getMaxPicOrderCntLsb(); 1920 1921 // - Otherwise, PicOrderCntMsb is derived as follows: 1922 1923 if( ( slicePicOrderCntLsb < prevPicOrderCntLsb ) && 1924 ( ( prevPicOrderCntLsb - slicePicOrderCntLsb ) >= ( maxPicOrderCntLsb / 2 ) ) ) 1925 { 1926 picOrderCntMsb = prevPicOrderCntMsb + maxPicOrderCntLsb; // (8 1) 1927 } 1928 else if( (slicePicOrderCntLsb > prevPicOrderCntLsb ) && 1929 ( ( slicePicOrderCntLsb - prevPicOrderCntLsb ) > ( maxPicOrderCntLsb / 2 ) ) ) 1930 { 1931 picOrderCntMsb = prevPicOrderCntMsb - maxPicOrderCntLsb; 1932 } 1933 else 1934 { 1935 picOrderCntMsb = prevPicOrderCntMsb; 1936 } 1937 } 1938 1939 //PicOrderCntVal is derived as follows: 1940 Int picOrderCntVal = picOrderCntMsb + slicePicOrderCntLsb; // (8 2) 1941 1942 // NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 1943 // pictures and prevPicOrderCntLsb and prevPicOrderCntMsb are both set equal to 0. 1944 1945 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 1946 1947 // Update prevTid0Pic 1948 // Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, a RADL picture or an SLNR picture. 1949 if( curSlice->getTemporalId() == 0 && !m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() ) 1950 { 1951 m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb; 1952 m_prevTid0PicPicOrderCntMsb = picOrderCntMsb; 1953 } 1954 } 1955 1956 Void TDecTop::xF831DecProcForPicOrderCount() 1957 { 1958 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1959 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1960 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1961 1962 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1963 1964 const TComSlice* slice = m_pcPic->getSlice(0); 1965 const Int nuhLayerId = m_pcPic->getLayerId(); 1966 const TComVPS* vps = slice->getVPS(); 1967 const TComSPS* sps = slice->getSPS(); 1968 if ( m_pcPic->getIsFstPicOfAllLayOfPocResetPer() ) 1969 { 1970 // When the current picture is the first picture among all layers of a POC resetting period, 1971 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1972 for (Int i = 0; i <= 62; i++) 1973 { 1974 m_pocDecrementedInDpbFlag[ i ] = 0; 1975 } 1976 } 1977 1978 // The variable pocResettingFlag is derived as follows: 1979 Bool pocResettingFlag; 1980 if (m_pcPic->getIsPocResettingPic() ) 1981 { 1982 //- If the current picture is a POC resetting picture, the following applies: 1983 if( vps->getVpsPocLsbAlignedFlag() ) 1984 { 1985 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1986 pocResettingFlag = true; 1987 } 1988 else if ( m_pocDecrementedInDpbFlag[ nuhLayerId ] ) 1989 { 1990 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1991 pocResettingFlag = false; 1992 } 1993 else 1994 { 1995 // - Otherwise, pocResettingFlag is set equal to 1. 1996 pocResettingFlag = true; 1997 } 1998 } 1999 else 2000 { 2001 // - Otherwise, pocResettingFlag is set equal to 0. 2002 pocResettingFlag = false; 2003 } 2004 2005 // The list affectedLayerList is derived as follows: 2006 std::vector<Int> affectedLayerList; 2007 if (! vps->getVpsPocLsbAlignedFlag() ) 2008 { 2009 //- If vps_poc_lsb_aligned_flag is equal to 0, affectedLayerList consists of the nuh_layer_id of the current picture. 2010 affectedLayerList.push_back( nuhLayerId ); 2011 } 2012 else 2013 { 2014 // - Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 2015 // equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 2016 // inclusive, where currNuhLayerId is the nuh_layer_id value of the current picture. 2017 affectedLayerList.push_back( nuhLayerId ); 2018 Int currNuhLayerId = nuhLayerId; 2019 for (Int j = 0; j <= vps->getNumPredictedLayers( currNuhLayerId )-1; j++ ) 2020 { 2021 affectedLayerList.push_back( vps->getIdPredictedLayer(currNuhLayerId, j ) ); 2022 } 2023 } 2024 2025 Int picOrderCntMsb; 2026 Int picOrderCntVal; 2027 2028 // Depending on pocResettingFlag, the following applies: 2029 if ( pocResettingFlag ) 2030 { 2031 //- If pocResettingFlag is equal to 1, the following applies: 2032 if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] ) 2033 { 2034 //- The variables pocMsbDelta, pocLsbDelta and DeltaPocVal are derived as follows: 2035 Int pocMsbDelta; 2036 Int pocLsbDelta; 2037 Int deltaPocVal; 2038 2039 { 2040 Int pocLsbVal; 2041 Int prevPicOrderCntLsb; 2042 Int prevPicOrderCntMsb; 2043 2044 if( slice->getPocResetIdc() == 3 ) 2045 { 2046 pocLsbVal = slice->getPocLsbVal(); 2047 } 2048 else 2049 { 2050 pocLsbVal = slice->getSlicePicOrderCntLsb(); 2051 } 2052 2053 if( slice->getPocMsbCycleValPresentFlag() ) 2054 { 2055 pocMsbDelta = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); // (F 60) 2056 } 2057 else 2058 { 2059 prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2060 prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2061 2062 pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2063 } 2064 2065 if( slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() ) ) 2066 { 2067 pocLsbDelta = pocLsbVal; 2068 } 2069 else 2070 { 2071 pocLsbDelta = 0; 2072 } 2073 deltaPocVal = pocMsbDelta + pocLsbDelta; 2074 } 2075 2076 //- The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 2077 // and that is equal to any value in affectedLayerList is decremented by DeltaPocVal. 2078 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) 2079 { 2080 if ( !m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] ) 2081 { 2082 m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 2083 } 2084 } 2085 2086 //- PocDecrementedInDPBFlag[ nuhLayerId ] is set equal to 1 for each value of nuhLayerId included in affectedLayerList. 2087 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) 2088 { 2089 m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 2090 } 2091 } 2092 2093 //- The PicOrderCntVal of the current picture is derived as follows: 2094 if( slice->getPocResetIdc() == 1 ) 2095 { 2096 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 2097 } 2098 else if (slice->getPocResetIdc() == 2 ) 2099 { 2100 picOrderCntVal = 0; 2101 } 2102 else 2103 { 2104 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 2105 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2106 } 2107 } 2108 else 2109 { 2110 //- Otherwise (pocResettingFlag is equal to 0), the following applies: 2111 //- The PicOrderCntVal of the current picture is derived as follows: 2112 2113 if( slice->getPocMsbCycleValPresentFlag() ) 2114 { 2115 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 2116 } 2117 else if( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] || 2118 slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 2119 { 2120 picOrderCntMsb = 0; // (F 62) 2121 } 2122 else 2123 { 2124 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2125 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2126 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2127 } 2128 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2129 } 2130 2131 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 2132 2133 for (Int lId = 0; lId < (Int) affectedLayerList.size(); lId++ ) 2134 { 2135 // The value of PrevPicOrderCnt[ lId ] for each of the lId values included in affectedLayerList is derived as follows: 2136 2137 if (!m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() && slice->getTemporalId() == 0 && !slice->getDiscardableFlag() ) 2138 { 2139 //- If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 2140 // has TemporalId equal to 0 and discardable_flag equal to 0, PrevPicOrderCnt[ lId ] is set equal to PicOrderCntVal. 2141 m_prevPicOrderCnt = picOrderCntVal; 2142 } 2143 else if ( slice->getPocResetIdc() == 3 && ( 2144 ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 2145 ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 2146 ) ) 2147 { 2148 // - Otherwise, when poc_reset_idc is equal to 3 and one of the following conditions is true, PrevPicOrderCnt[ lId ] is set equal to ( full_poc_reset_flag ? 0 : poc_lsb_val ): 2149 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0. 2150 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is a POC resetting picture. 2151 m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 2152 } 2153 } 2154 } 2155 2156 Int TDecTop::xGetCurrMsb( Int cl, Int pl, Int pm, Int ml ) 2157 { 2158 Int currMsb; 2159 if ((pl - cl) >= (ml/ 2)) 2160 { 2161 currMsb = pm + ml; 2162 } 2163 else if ( (cl - pl) > (ml / 2)) 2164 { 2165 currMsb = pm - ml; 2166 } 2167 else 2168 { 2169 currMsb = pm; 2170 } 2171 2172 return currMsb; 2173 } 2174 2175 2176 2177 Void TDecTop::x832DecProcForRefPicSet( Bool annexFModifications ) 2178 { 2179 /////////////////////////////////////////////////////////////////////////////////////// 2180 // 8.3.2 8.3.2 Decoding process for reference picture set 2181 /////////////////////////////////////////////////////////////////////////////////////// 2182 2183 TComSlice* slice = m_pcPic->getSlice( 0 ); 2184 const TComSPS* sps = slice->getSPS(); 2185 // This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 2186 // to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 2187 // This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 2188 // "used for long-term reference". 2189 2190 // The variable currPicLayerId is set equal to nuh_layer_id of the current picture. 2191 Int currPicLayerId = m_pcPic->getLayerId(); 2192 Int picOrderCntVal = m_pcPic->getPOC(); 2193 2194 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 2195 { 2196 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 2197 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 2198 // DPB (if any) are marked as "unused for reference". 2199 m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 2200 } 2201 // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 2202 // their PicOrderCntVal values or their slice_pic_order_cnt_lsb values. 2203 2204 // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 2205 // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 2206 // NumPocLtCurr and NumPocLtFoll number of elements, respectively. The five lists and the five variables are derived as follows: 2207 2208 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2209 2210 std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore; 2211 std::vector<Int>& pocStCurrAfter = decRps->m_pocStCurrAfter; 2212 std::vector<Int>& pocStFoll = decRps->m_pocStFoll; 2213 std::vector<Int>& pocLtCurr = decRps->m_pocLtCurr; 2214 std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 2215 2216 Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 2217 Int& numPocStCurrAfter = decRps->m_numPocStCurrAfter; 2218 Int& numPocStFoll = decRps->m_numPocStFoll; 2219 Int& numPocLtCurr = decRps->m_numPocLtCurr; 2220 Int& numPocLtFoll = decRps->m_numPocLtFoll; 2221 2222 std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 2223 2224 if (m_pcPic->isIdr() ) 2225 { 2226 // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 2227 // PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 2228 // NumPocStCurrAfter, NumPocStFoll, NumPocLtCurr and NumPocLtFoll are all set equal to 0. 2229 2230 pocStCurrBefore.clear(); 2231 pocStCurrAfter .clear(); 2232 pocStFoll .clear(); 2233 pocLtCurr .clear(); 2234 pocLtFoll .clear(); 2235 numPocStCurrBefore = 0; 2236 numPocStCurrAfter = 0; 2237 numPocStFoll = 0; 2238 numPocLtCurr = 0; 2239 numPocLtFoll = 0; 2240 } 2241 else 2242 { 2243 const TComStRefPicSet* stRps = slice->getStRps( slice->getCurrRpsIdx() ); 2244 // - Otherwise, the following applies: 2245 2246 Int j = 0; 2247 Int k = 0; 2248 for( Int i = 0; i < stRps->getNumNegativePicsVar() ; i++ ) 2249 { 2250 if( stRps->getUsedByCurrPicS0Var( i ) ) 2251 { 2252 pocStCurrBefore.push_back( picOrderCntVal + stRps->getDeltaPocS0Var( i ) ); j++; 2253 } 2254 else 2255 { 2256 pocStFoll .push_back( picOrderCntVal + stRps->getDeltaPocS0Var( i ) ); k++; 2257 } 2258 } 2259 numPocStCurrBefore = j; 2260 2261 j = 0; 2262 for (Int i = 0; i < stRps->getNumPositivePicsVar(); i++ ) 2263 { 2264 if (stRps->getUsedByCurrPicS1Var( i ) ) 2265 { 2266 pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 2267 } 2268 else 2269 { 2270 pocStFoll .push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); k++; 2271 } 2272 } 2273 numPocStCurrAfter = j; 2274 numPocStFoll = k; // (8 5) 2275 2276 2277 j = 0; 2278 k = 0; 2279 for( Int i = 0; i < slice->getNumLongTermSps( ) + slice->getNumLongTermPics(); i++ ) 2280 { 2281 Int pocLt = slice->getPocLsbLtVar( i ); 2282 if( slice->getDeltaPocMsbPresentFlag( i ) ) 2283 { 2284 pocLt += picOrderCntVal - slice->getDeltaPocMsbCycleLtVar( i ) * sps->getMaxPicOrderCntLsb() - 2285 ( picOrderCntVal & ( sps->getMaxPicOrderCntLsb() - 1 ) ); 2286 } 2287 2288 if( slice->getUsedByCurrPicLtVar(i)) 2289 { 2290 pocLtCurr.push_back( pocLt ); 2291 currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 2292 } 2293 else 2294 { 2295 pocLtFoll.push_back( pocLt ); 2296 follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 2297 } 2298 } 2299 numPocLtCurr = j; 2300 numPocLtFoll = k; 2301 } 2302 2303 assert(numPocStCurrAfter == pocStCurrAfter .size() ); 2304 assert(numPocStCurrBefore == pocStCurrBefore .size() ); 2305 assert(numPocStFoll == pocStFoll .size() ); 2306 assert(numPocLtCurr == pocLtCurr .size() ); 2307 assert(numPocLtFoll == pocLtFoll .size() ); 2308 2309 // where PicOrderCntVal is the picture order count of the current picture as specified in clause 8.3.1. 2310 2311 // NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 2312 // indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 2313 // where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 2314 // in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 2315 // the short-term RPS of the current picture is directly signalled in the slice header. 2316 2317 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2318 { 2319 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 2320 // it is a requirement of bitstream conformance that the following conditions apply: 2321 if ( currDeltaPocMsbPresentFlag[i] ) 2322 { 2323 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2324 // for which PocLtCurr[ i ] is equal to PocStCurrBefore[ j ]. 2325 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) 2326 { 2327 assert(!( pocLtCurr[ i ] == pocStCurrBefore[ j ] ) ); 2328 } 2329 2330 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2331 // for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 2332 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2333 { 2334 assert(!( pocLtCurr[ i ] == pocStCurrAfter[ j ] ) ); 2335 } 2336 2337 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2338 // for which PocLtCurr[ i ] is equal to PocStFoll[ j ]. 2339 for (Int j = 0; j <= numPocStFoll - 1; j++ ) 2340 { 2341 assert(!( pocLtCurr[ i ] == pocStFoll[ j ] ) ); 2342 } 2343 2344 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2345 // where j is not equal to i, for which PocLtCurr[ i ] is equal to PocLtCurr[ j ]. 2346 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2347 { 2348 if ( i != j ) 2349 { 2350 assert(!( pocLtCurr[ i ] == pocLtCurr[ j ] ) ); 2351 } 2352 } 2353 } 2354 } 2355 2356 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2357 { 2358 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 2359 // it is a requirement of bitstream conformance that the following conditions apply: 2360 if ( follDeltaPocMsbPresentFlag[i] ) 2361 { 2362 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2363 // for which PocLtFoll[ i ] is equal to PocStCurrBefore[ j ]. 2364 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) 2365 { 2366 assert(!( pocLtFoll[ i ] == pocStCurrBefore[ j ] ) ); 2367 } 2368 2369 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2370 // for which PocLtFoll[ i ] is equal to PocStCurrAfter[ j ]. 2371 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2372 { 2373 assert(!( pocLtFoll[ i ] == pocStCurrAfter[ j ] ) ); 2374 } 2375 2376 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2377 // for which PocLtFoll[ i ] is equal to PocStFoll[ j ]. 2378 for (Int j = 0; j <= numPocStFoll - 1; j++ ) 2379 { 2380 assert(!( pocLtFoll[ i ] == pocStFoll[ j ] ) ); 2381 } 2382 2383 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2384 // where j is not equal to i, for which PocLtFoll[ i ] is equal to PocLtFoll[ j ]. 2385 for (Int j = 0; j <= numPocLtFoll - 1; j++ ) 2386 { 2387 if (j != i) 2388 { 2389 assert(!( pocLtFoll[ i ] == pocLtFoll[ j ] ) ); 2390 } 2391 } 2392 2393 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2394 // for which PocLtFoll[ i ] is equal to PocLtCurr[ j ]. 2395 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2396 { 2397 assert(!( pocLtFoll[ i ] == pocLtCurr[ j ] ) ); 2398 } 2399 } 2400 } 2401 2402 Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 2403 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2404 { 2405 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 2406 // it is a requirement of bitstream conformance that the following conditions apply: 2407 if ( currDeltaPocMsbPresentFlag[ i ] == 0 ) 2408 { 2409 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2410 // for which PocLtCurr[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2411 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) 2412 { 2413 assert(!( pocLtCurr[ i ] == ( pocStCurrBefore[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2414 } 2415 2416 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2417 // for which PocLtCurr[ i ] is equal to ( PocStCurrAfter[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2418 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2419 { 2420 assert(!( pocLtCurr[ i ] == ( pocStCurrAfter[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2421 } 2422 2423 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2424 // for which PocLtCurr[ i ] is equal to ( PocStFoll[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2425 for (Int j = 0; j <= numPocStFoll - 1; j++ ) 2426 { 2427 assert(!( pocLtCurr[ i ] == ( pocStFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2428 } 2429 2430 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2431 // where j is not equal to i, for which PocLtCurr[ i ] is equal to ( PocLtCurr[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2432 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2433 { 2434 if (j != i) 2435 { 2436 assert(!( pocLtCurr[ i ] == ( pocLtCurr[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2437 } 2438 } 2439 } 2440 } 2441 2442 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2443 { 2444 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 2445 // it is a requirement of bitstream conformance that the following conditions apply: 2446 if ( follDeltaPocMsbPresentFlag[ i ] == 0 ) 2447 { 2448 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2449 // for which PocLtFoll[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2450 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) 2451 { 2452 assert(!( pocLtFoll[ i ] == ( pocStCurrBefore[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2453 } 2454 2455 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2456 // for which PocLtFoll[ i ] is equal to ( PocStCurrAfter[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2457 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2458 { 2459 assert(!( pocLtFoll[ i ] == ( pocStCurrAfter[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2460 } 2461 2462 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2463 // for which PocLtFoll[ i ] is equal to ( PocStFoll[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2464 for (Int j = 0; j <= numPocStFoll - 1; j++ ) 2465 { 2466 assert(!( pocLtFoll[ i ] == ( pocStFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2467 } 2468 2469 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2470 // where j is not equal to i, for which PocLtFoll[ i ] is equal to ( PocLtFoll[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2471 for (Int j = 0; j <= numPocLtFoll - 1; j++ ) 2472 { 2473 if (j != i) 2474 { 2475 assert(!( pocLtFoll[ i ] == ( pocLtFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2476 } 2477 } 2478 2479 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2480 // for which PocLtFoll[ i ] is equal to ( PocLtCurr[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2481 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2482 { 2483 assert(!( pocLtFoll[ i ] == ( pocLtCurr[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2484 } 2485 } 2486 } 2487 2488 if ( !annexFModifications ) 2489 { 2490 // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 2491 2492 // It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: 2493 if ( m_pcPic->isBla() || m_pcPic->isCra() ) 2494 { 2495 // - If the current picture is a BLA or CRA picture, the value of NumPicTotalCurr shall be equal to 0. 2496 assert( slice->getNumPicTotalCurr() == 0 ); 2497 } 2498 else 2499 { 2500 // - Otherwise, 2501 if ( slice->isInterP() || slice->isInterB() ) 2502 { 2503 // when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2504 assert( slice->getNumPicTotalCurr() != 0 ); 2505 } 2506 } 2507 } 2508 2509 // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 2510 // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 2511 // referred to as the short-term RPS. RefPicSetLtCurr and RefPicSetLtFoll are collectively referred to as the long-term RPS. 2512 2513 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 2514 std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter ; 2515 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll ; 2516 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr ; 2517 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll ; 2518 2519 std::vector<TComPic*>** refPicSetsCurr = decRps->m_refPicSetsCurr ; 2520 std::vector<TComPic*>** refPicSetsLt = decRps->m_refPicSetsLt ; 2521 std::vector<TComPic*>** refPicSetsAll = decRps->m_refPicSetsAll ; 2522 // NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 2523 // used for inter prediction of the current picture and one or more pictures that follow the current picture in decoding order. 2524 // RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 2525 // picture but may be used in inter prediction for one or more pictures that follow the current picture in decoding order. 2526 2527 // The derivation process for the RPS and picture marking are performed according to the following ordered steps: 2528 // 1. The following applies: 2529 2530 TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false ); 2531 assert( refPicSetLtCurr.empty() ); 2532 for( Int i = 0; i < numPocLtCurr; i++ ) 2533 { 2534 if( !currDeltaPocMsbPresentFlag[ i ] ) 2535 { 2536 refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) ); 2537 } 2538 else 2539 { 2540 refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] )); 2541 } 2542 } 2543 2544 assert( refPicSetLtFoll.empty() ); 2545 for( Int i = 0; i < numPocLtFoll; i++ ) 2546 { 2547 if( !follDeltaPocMsbPresentFlag[ i ] ) 2548 { 2549 refPicSetLtFoll.push_back(dpb->getPicFromLsb(pocLtFoll[ i ], maxPicOrderCntLsb )); 2550 } 2551 else 2552 { 2553 refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] )); 2554 } 2555 } 2556 2557 // 2. All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 2558 // to currPicLayerId are marked as "used for long-term reference". 2559 for (Int i = 0; i < numPocLtCurr; i++) 2560 { 2561 if ( refPicSetLtCurr[i] != NULL ) 2562 { 2563 refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 2564 } 2565 } 2566 2567 for (Int i = 0; i < numPocLtFoll; i++) 2568 { 2569 if ( refPicSetLtFoll[i] != NULL ) 2570 { 2571 refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 2572 } 2573 } 2574 2575 // 3. The following applies: 2576 assert( refPicSetStCurrBefore.empty() ); 2577 for( Int i = 0; i < numPocStCurrBefore; i++ ) 2578 { 2579 refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 2580 } 2581 2582 assert( refPicSetStCurrAfter.empty() ); 2583 for( Int i = 0; i < numPocStCurrAfter; i++ ) 2584 { 2585 refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 2586 } 2587 2588 assert( refPicSetStFoll.empty() ); 2589 for( Int i = 0; i < numPocStFoll; i++ ) 2590 { 2591 refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 2592 } 2593 2594 // 4. All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 2595 // RefPicSetStCurrAfter, or RefPicSetStFoll and have nuh_layer_id equal to currPicLayerId are marked as "unused for reference". 2596 TComSubDpb picsToMark = (*dpb); 2597 for (Int j = 0; j < 5; j++ ) 2598 { 2599 picsToMark.removePics( *refPicSetsAll[j] ); 2600 } 2601 picsToMark.markAllAsUnusedForReference(); 2602 2603 // NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 2604 // the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 2605 // to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 2606 // RefPicSetStCurrBefore, RefPicSetStCurrAfter, or RefPicSetLtCurr that is equal to "no reference picture". 2607 2608 // NOTE 5 - A picture cannot be included in more than one of the five RPS lists. 2609 2610 2611 // It is a requirement of bitstream conformance that the RPS is restricted as follows: 2612 2613 2614 #if NH_MV_FIX_NO_REF_PICS_CHECK 2615 if ( !annexFModifications || m_firstPicInLayerDecodedFlag[ m_pcPic->getLayerId() ] ) 2616 { 2617 #endif 2618 for (Int j = 0; j < 3; j++ ) 2619 { 2620 // - There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 2621 // for which one or more of the following are true: 2622 2623 std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 2624 for (Int i = 0; i < currSet->size(); i++) 2625 { 2626 TComPic* pic = (*currSet)[i]; 2627 2628 // - The entry is equal to "no reference picture". 2629 assert( ! (pic == NULL ) ); 2630 2631 // - The entry is an SLNR picture and has TemporalId equal to that of the current picture. 2632 assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2633 2634 // - The entry is a picture that has TemporalId greater than that of the current picture. 2635 assert( !( pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 2636 } 2637 } 2638 #if NH_MV_FIX_NO_REF_PICS_CHECK 2639 } 2640 #endif 2641 2642 // - There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 2643 // difference between the picture order count value of the current picture and the picture order count 2644 // value of the entry is greater than or equal to 2^24. 2645 for (Int j = 0; j < 2; j++ ) 1700 2646 { 1701 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1702 1703 Bool isBLA = ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1704 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1705 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1706 1707 if ( noClrasOutputFlag ) 1708 { 1709 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1710 { 1711 m_layerInitilizedFlag[i] = false; 1712 } 1713 } 1714 } 1715 } 1716 1717 Bool TDecTop::xAllRefLayersInitilized( const TComVPS* vps ) 1718 { 1719 Bool allRefLayersInitilizedFlag = true; 1720 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1721 { 1722 Int refLayerId = vps->getIdDirectRefLayer( m_layerId, i ); 1723 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1724 } 1725 1726 return allRefLayersInitilizedFlag; 1727 } 1728 1729 1730 Void TDecTop::initFromActiveVps( const TComVPS* vps ) 1731 { 1732 if ( m_targetOlsIdx == -1 ) 1733 { 1734 // Not normative! Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1735 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1736 } 1737 #if NH_3D 1738 // Set profile 1739 Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1740 Int lIdx = -1; 1741 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ); j++ ) 1742 { 1743 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 1744 { 1745 lIdx = j; 1746 break; 1747 } 1748 } 1749 assert( lIdx != -1 ); 1750 1751 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1752 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1753 m_profileIdc = profileIdc; 1754 #endif 1755 } 2647 std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 2648 for (Int i = 0; i < ltSet->size(); i++) 2649 { 2650 TComPic* pic = (*ltSet)[i]; 2651 if( pic != NULL ) 2652 { 2653 assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 2654 } 2655 } 2656 } 2657 2658 // - When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 2659 // included in the RPS with TemporalId greater than or equal to the TemporalId of the current picture. 2660 if (m_pcPic->isTsa() ) 2661 { 2662 for (Int j = 0; j < 5; j++ ) 2663 { 2664 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2665 for (Int i = 0; i < aSet->size(); i++) 2666 { 2667 TComPic* pic = (*aSet)[i]; 2668 if( pic != NULL ) 2669 { 2670 assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 2671 } 2672 } 2673 } 2674 } 2675 2676 // - When the current picture is a step-wise temporal sub-layer access (STSA) picture, 2677 // there shall be no picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr that has 2678 // TemporalId equal to that of the current picture. 2679 if (m_pcPic->isStsa() ) 2680 { 2681 for (Int j = 0; j < 3; j++ ) 2682 { 2683 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2684 for (Int i = 0; i < cSet->size(); i++) 2685 { 2686 TComPic* pic = (*cSet)[i]; 2687 if( pic != NULL ) 2688 { 2689 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2690 } 2691 } 2692 } 2693 } 2694 2695 // - When the current picture is a picture that follows, in decoding order, an STSA picture 2696 // that has TemporalId equal to that of the current picture, there shall be no picture that has 2697 // TemporalId equal to that of the current picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2698 // or RefPicSetLtCurr that precedes the STSA picture in decoding order. 2699 if ( m_pcPic->getDecodingOrder() > m_prevStsaDecOrder && m_pcPic->getTemporalId() == m_prevStsaTemporalId ) 2700 { 2701 for (Int j = 0; j < 3; j++ ) 2702 { 2703 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2704 for (Int i = 0; i < cSet->size(); i++) 2705 { 2706 TComPic* pic = (*cSet)[i]; 2707 if( pic != NULL ) 2708 { 2709 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder ) ); 2710 } 2711 } 2712 } 2713 } 2714 2715 // - When the current picture is a CRA picture, there shall be no picture included in the RPS that 2716 // precedes, in output order or decoding order, any preceding IRAP picture in decoding order (when present). 2717 if ( m_pcPic->isCra() ) 2718 { 2719 for (Int j = 0; j < 5; j++ ) 2720 { 2721 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2722 for (Int i = 0; i < aSet->size(); i++) 2723 { 2724 // TBD check whether it sufficient to test only the last IRAP 2725 TComPic* pic = (*aSet)[i]; 2726 if( pic != NULL ) 2727 { 2728 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2729 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2730 } 2731 } 2732 } 2733 } 2734 2735 Bool isTrailingPicture = ( !m_pcPic->isIrap() ) && ( m_pcPic->getPOC() > m_prevIrapPoc ); 2736 // - When the current picture is a trailing picture, there shall be no picture in RefPicSetStCurrBefore, 2737 // RefPicSetStCurrAfter or RefPicSetLtCurr that was generated by the decoding process for generating unavailable 2738 // reference pictures as specified in clause 8.3.3. 2739 if ( isTrailingPicture ) 2740 { 2741 for (Int j = 0; j < 3; j++ ) 2742 { 2743 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2744 for (Int i = 0; i < cSet->size(); i++) 2745 { 2746 TComPic* pic = (*cSet)[i]; 2747 if( pic != NULL ) 2748 { 2749 assert( ! (pic->getIsGeneratedCl833() ) ); 2750 } 2751 } 2752 } 2753 } 2754 2755 // - When the current picture is a trailing picture, there shall be no picture in the RPS that precedes the 2756 // associated IRAP picture in output order or decoding order. 2757 if ( isTrailingPicture ) 2758 { 2759 for (Int j = 0; j < 5; j++ ) 2760 { 2761 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2762 for (Int i = 0; i < aSet->size(); i++) 2763 { 2764 // TBD check whether it sufficient to test only the last IRAP 2765 TComPic* pic = (*aSet)[i]; 2766 if( pic != NULL ) 2767 { 2768 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2769 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2770 } 2771 } 2772 } 2773 } 2774 2775 // - When the current picture is a RADL picture, there shall be no picture included in RefPicSetStCurrBefore, 2776 // RefPicSetStCurrAfter or RefPicSetLtCurr that is any of the following: 2777 if ( m_pcPic->isRadl() ) 2778 { 2779 for (Int j = 0; j < 3; j++ ) 2780 { 2781 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2782 for (Int i = 0; i < cSet->size(); i++) 2783 { 2784 TComPic* pic = (*cSet)[i]; 2785 if( pic != NULL ) 2786 { 2787 // - A RASL picture 2788 assert( ! (pic->isRasl() ) ); 2789 // - A picture that was generated by the decoding process for generating unavailable reference pictures 2790 // as specified in clause 8.3.3 2791 assert( ! (pic->getIsGeneratedCl833() ) ); 2792 // - A picture that precedes the associated IRAP picture in decoding order 2793 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2794 } 2795 } 2796 } 2797 } 2798 2799 2800 if ( sps->getTemporalIdNestingFlag() ) 2801 { 2802 // - When sps_temporal_id_nesting_flag is equal to 1, the following applies: 2803 // - Let tIdA be the value of TemporalId of the current picture picA. 2804 TComPic* picA = m_pcPic; 2805 Int tIdA = picA->getTemporalId(); 2806 // - Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 2807 // RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 2808 // has TemporalId less than tIdB, follows picB in decoding order, and precedes picA in decoding order. 2809 for (Int j = 0; j < 3; j++ ) 2810 { 2811 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2812 for (Int i = 0; i < cSet->size(); i++) 2813 { 2814 TComPic* picB = (*cSet)[i]; 2815 if( picB != NULL ) 2816 { 2817 Int tIdB = picB->getTemporalId(); 2818 2819 if (tIdB <= tIdA) 2820 { 2821 for ( TComSubDpb::iterator itP = dpb->begin(); itP != dpb->end(); itP++ ) 2822 { 2823 TComPic* picC = (*itP); 2824 assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder() ) ); 2825 } 2826 } 2827 } 2828 } 2829 } 2830 } 2831 } 2832 2833 2834 Void TDecTop::xF832DecProcForRefPicSet() 2835 { 2836 /////////////////////////////////////////////////////////////////////////////////////// 2837 // F.8.3.2 Decoding process for reference picture set 2838 /////////////////////////////////////////////////////////////////////////////////////// 2839 2840 // The specifications in clause 8.3.2 apply with the following changes: 2841 // - The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 2842 // clauses F.7.4.7.2, F.8.3.1, F.8.3.3 and F.8.3.4, respectively. 2843 2844 x832DecProcForRefPicSet( true ); 2845 2846 // - The following specifications are added: 2847 if (m_pcPic->isIrap() && m_pcPic->getLayerId() == m_smallestLayerId ) 2848 { 2849 // - When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 2850 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 2851 // as "unused for reference" when at least one of the following conditions is true: 2852 2853 if ( m_pcPic->getNoClrasOutputFlag() || m_pcPic->getActivatesNewVps() ) 2854 { 2855 // - The current picture has NoClrasOutputFlag is equal to 1. 2856 // - The current picture activates a new VPS. 2857 m_dpb->markAllSubDpbAsUnusedForReference( ); 2858 } 2859 } 2860 2861 // - It is a requirement of bitstream conformance that the RPS is restricted as follows: 2862 // - When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2863 // or RefPicSetLtCurr. 2864 2865 std::vector<TComPic*>** refPicSetsCurr = m_pcPic->getDecodedRps()->m_refPicSetsCurr; 2866 2867 if ( m_pcPic->isCra() ) 2868 { 2869 for (Int j = 0; j < 3; j++ ) 2870 { 2871 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2872 assert ( cSet->size() == 0 ); 2873 } 2874 } 2875 2876 // - The constraints specified in clause 8.3.2 on the value of NumPicTotalCurr are replaced with the following: 2877 // - It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: 2878 Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 2879 Int currPicLayerId = m_pcPic->getLayerId(); 2880 const TComVPS* vps = m_pcPic->getSlice(0)->getVPS(); 2881 2882 if ( ( m_pcPic->isBla() || m_pcPic->isCra() ) && ( (currPicLayerId == 0 ) || ( vps->getNumDirectRefLayers( currPicLayerId ) == 0 ) ) ) 2883 { 2884 assert( numPicTotalCurr == 0 ); 2885 // - If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 2886 // NumDirectRefLayers[ currPicLayerId ] is equal to 0, the value of NumPicTotalCurr shall be equal to 0. 2887 } 2888 else 2889 { 2890 // TBD: check all slices 2891 if ( m_pcPic->getSlice(0)->getSliceType() == P_SLICE || m_pcPic->getSlice(0)->getSliceType() == B_SLICE ) 2892 { 2893 // - Otherwise, when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2894 assert( numPicTotalCurr != 0 ); 2895 } 2896 } 2897 } 2898 2899 2900 Void TDecTop::xG813DecProcForInterLayerRefPicSet() 2901 { 2902 //////////////////////////////////////////////////////////////////// 2903 // G.8.1.3 Decoding process for inter-layer reference picture set // 2904 //////////////////////////////////////////////////////////////////// 2905 2906 // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 2907 // and the variables NumActiveRefLayerPics0 and NumActiveRefLayerPics1. 2908 2909 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2910 TComSlice* slice = m_pcPic->getSlice( 0 ); 2911 const TComVPS* vps = slice->getVPS(); 2912 2913 Int& numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0; 2914 Int& numActiveRefLayerPics1 = decRps->m_numActiveRefLayerPics1; 2915 2916 std::vector<TComPic*>& refPicSetInterLayer0 = decRps->m_refPicSetInterLayer0; 2917 std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 2918 2919 // The variable currLayerId is set equal to nuh_layer_id of the current picture. 2920 Int currLayerId = getLayerId(); 2921 2922 // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 2923 // are set equal to 0 and the following applies: 2924 2925 refPicSetInterLayer0.clear(); 2926 refPicSetInterLayer1.clear(); 2927 2928 numActiveRefLayerPics0 = 0; 2929 numActiveRefLayerPics1 = 0; 2930 2931 Int viewIdCurrLayerId = vps->getViewId( currLayerId ); 2932 Int viewId0 = vps->getViewId( 0 ); 2933 2934 for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ ) 2935 { 2936 Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 2937 2938 Bool refPicSet0Flag = 2939 ( ( viewIdCurrLayerId <= viewId0 && viewIdCurrLayerId <= viewIdRefPicLayerIdi ) || 2940 ( viewIdCurrLayerId >= viewId0 && viewIdCurrLayerId >= viewIdRefPicLayerIdi ) ); 2941 2942 TComPic* picX = m_dpb->getAu(slice->getPOC(), false )->getPic( slice->getRefPicLayerId( i ) ); 2943 if ( picX != NULL ) 2944 { 2945 // there is a picture picX in the DPB that is in the same access unit as the current picture and has 2946 // nuh_layer_id equal to RefPicLayerId[ i ] 2947 2948 if ( refPicSet0Flag ) 2949 { 2950 refPicSetInterLayer0.push_back( picX ); 2951 refPicSetInterLayer0[ numActiveRefLayerPics0++ ]->markAsUsedForLongTermReference(); 2952 } 2953 else 2954 { 2955 refPicSetInterLayer1.push_back( picX ); 2956 refPicSetInterLayer1[ numActiveRefLayerPics1++ ]->markAsUsedForLongTermReference(); 2957 } 2958 2959 // There shall be no picture that has discardable_flag equal to 1 in RefPicSetInterLayer0 or RefPicSetInterLayer1. 2960 assert( ! picX->getSlice(0)->getDiscardableFlag() ); 2961 2962 // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 2963 // that is a RASL picture. 2964 if ( m_pcPic->isRadl() ) 2965 { 2966 assert( ! picX->isRasl() ); 2967 } 2968 } 2969 else 2970 { 2971 if( refPicSet0Flag ) 2972 { 2973 refPicSetInterLayer0.push_back( NULL ); // "no reference picture" (G 1) 2974 numActiveRefLayerPics0++; 2975 } 2976 else 2977 { 2978 refPicSetInterLayer1.push_back( NULL ); // "no reference picture"; 2979 numActiveRefLayerPics1++; 2980 } 2981 // There shall be no entry equal to "no reference picture" in RefPicSetInterLayer0 or RefPicSetInterLayer1. 2982 assert( false ); 2983 } 2984 } 2985 } 2986 2987 2988 Void TDecTop::x8331GenDecProcForGenUnavilRefPics() 2989 { 2990 /////////////////////////////////////////////////////////////////////////////////////// 2991 // 8.3.3.1 General decoding process for generating unavailable reference pictures //// 2992 /////////////////////////////////////////////////////////////////////////////////////// 2993 2994 // This process is invoked once per coded picture when the current picture is a 2995 // BLA picture or is a CRA picture with NoRaslOutputFlag equal to 1. 2996 2997 assert( m_pcPic->isBla() || (m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ); 2998 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2999 3000 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3001 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3002 3003 const std::vector<Int>& pocStFoll = decRps->m_pocStFoll; 3004 const std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 3005 3006 const Int numPocStFoll = decRps->m_numPocStFoll; 3007 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3008 3009 // When this process is invoked, the following applies: 3010 for ( Int i = 0 ; i <= numPocStFoll - 1; i++ ) 3011 { 3012 if ( refPicSetStFoll[ i ] == NULL ) 3013 { 3014 //- For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 3015 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3016 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3017 3018 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. 3019 genPic->getSlice(0)->setPOC( pocStFoll[ i ] ); 3020 3021 //- The value of PicOutputFlag for the generated picture is set equal to 0. 3022 genPic->setPicOutputFlag( false ); 3023 3024 // - The generated picture is marked as "used for short-term reference". 3025 genPic->markAsUsedForShortTermReference(); 3026 3027 // - RefPicSetStFoll[ i ] is set to be the generated reference picture. 3028 refPicSetStFoll[ i ] = genPic; 3029 3030 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3031 genPic->setLayerId( m_pcPic-> getLayerId() ); 3032 3033 // Insert to DPB 3034 m_dpb->addNewPic( genPic ); 3035 } 3036 } 3037 3038 for ( Int i = 0 ; i <= numPocLtFoll - 1; i++ ) 3039 { 3040 if ( refPicSetLtFoll[ i ] == NULL ) 3041 { 3042 //- For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 3043 // "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3044 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3045 3046 //- The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. 3047 genPic->getSlice(0)->setPOC( pocStFoll[ i ] ); 3048 3049 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtFoll[ i ] & ( MaxPicOrderCntLsb - 1 ) ). 3050 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 3051 3052 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3053 genPic->setPicOutputFlag( false ); 3054 3055 // - The generated picture is marked as "used for long-term reference". 3056 genPic->markAsUsedForLongTermReference(); 3057 3058 // - RefPicSetLtFoll[ i ] is set to be the generated reference picture. 3059 refPicSetLtFoll[ i ] = genPic; 3060 3061 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3062 genPic->setLayerId( m_pcPic-> getLayerId() ); 3063 3064 // Insert to DPB 3065 m_dpb->addNewPic( genPic ); 3066 } 3067 } 3068 } 3069 3070 3071 TComPic* TDecTop::x8332GenOfOneUnavailPic( Bool calledFromCl8331 ) 3072 { 3073 /////////////////////////////////////////////////////////////////////////////////////// 3074 // 8.3.3.2 Generation of one unavailable picture 3075 /////////////////////////////////////////////////////////////////////////////////////// 3076 3077 TComPic* genPic = new TComPic; 3078 genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 3079 genPic->setIsGenerated( true ); 3080 genPic->setIsGeneratedCl833( calledFromCl8331 ); 3081 return genPic; 3082 } 3083 3084 3085 Void TDecTop::xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay() 3086 { 3087 /////////////////////////////////////////////////////////////////////////////////////// 3088 // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 3089 // first in decoding order within a layer 3090 /////////////////////////////////////////////////////////////////////////////////////// 3091 3092 // This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0. 3093 assert( !m_firstPicInLayerDecodedFlag[ getLayerId() ] ); 3094 3095 3096 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3097 3098 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 3099 std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 3100 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3101 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 3102 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3103 3104 3105 const std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore; 3106 const std::vector<Int>& pocStCurrAfter = decRps->m_pocStCurrAfter; 3107 const std::vector<Int>& pocStFoll = decRps->m_pocStFoll; 3108 const std::vector<Int>& pocLtCurr = decRps->m_pocLtCurr; 3109 const std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 3110 3111 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 3112 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 3113 const Int numPocStFoll = decRps->m_numPocStFoll; 3114 const Int numPocLtCurr = decRps->m_numPocLtCurr; 3115 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3116 3117 Int nuhLayerId = m_pcPic-> getLayerId(); 3118 for ( Int i = 0 ; i <= numPocStCurrBefore - 1; i++ ) 3119 { 3120 if ( refPicSetStCurrBefore[ i ] == NULL ) 3121 { 3122 //- For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 3123 // equal to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3124 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3125 3126 //- The value of PicOrderCntVal for the generated picture is set equal to PocStCurrBefore[ i ]. 3127 genPic->getSlice(0)->setPOC( pocStCurrBefore[ i ] ); 3128 3129 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3130 genPic->setPicOutputFlag( false ); 3131 3132 // - The generated picture is marked as "used for short-term reference". 3133 genPic->markAsUsedForShortTermReference(); 3134 3135 // - RefPicSetStCurrBefore[ i ] is set to be the generated reference picture. 3136 refPicSetStCurrBefore[ i ] = genPic; 3137 3138 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3139 genPic->setLayerId( nuhLayerId ); 3140 3141 // Insert to DPB 3142 m_dpb->addNewPic( genPic ); 3143 } 3144 } 3145 3146 for ( Int i = 0 ; i <= numPocStCurrAfter - 1; i++ ) 3147 { 3148 if ( refPicSetStCurrAfter[ i ] == NULL ) 3149 { 3150 // - For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 3151 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3152 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3153 3154 // - The value of PicOrderCntVal for the generated picture is set equal to PocStCurrAfter[ i ]. 3155 genPic->getSlice(0)->setPOC( pocStCurrAfter[ i ] ); 3156 3157 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3158 genPic->setPicOutputFlag( false ); 3159 3160 // - The generated picture is marked as "used for short-term reference". 3161 genPic->markAsUsedForShortTermReference(); 3162 3163 // - RefPicSetStCurrAfter[ i ] is set to be the generated reference picture. 3164 refPicSetStCurrAfter[ i ] = genPic; 3165 3166 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3167 genPic->setLayerId( nuhLayerId ); 3168 3169 // Insert to DPB 3170 m_dpb->addNewPic( genPic ); 3171 3172 } 3173 } 3174 3175 for ( Int i = 0 ; i <= numPocStFoll - 1; i++ ) 3176 { 3177 if ( refPicSetStFoll[ i ] == NULL ) 3178 { 3179 // - For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 3180 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3181 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3182 3183 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. 3184 genPic->getSlice(0)->setPOC( pocStFoll[ i ] ); 3185 3186 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3187 genPic->setPicOutputFlag( false ); 3188 3189 // - The generated picture is marked as "used for short-term reference". 3190 genPic->markAsUsedForShortTermReference(); 3191 3192 // - RefPicSetStFoll[ i ] is set to be the generated reference picture. 3193 refPicSetStFoll[ i ] = genPic; 3194 3195 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3196 genPic->setLayerId( nuhLayerId ); 3197 3198 // Insert to DPB 3199 m_dpb->addNewPic( genPic ); 3200 } 3201 } 3202 3203 Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 3204 for ( Int i = 0 ; i <= numPocLtCurr - 1; i++ ) 3205 { 3206 if ( refPicSetLtCurr[ i ] == NULL ) 3207 { 3208 // - For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 3209 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3210 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3211 3212 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtCurr[ i ]. 3213 genPic->getSlice(0)->setPOC( pocLtCurr[ i ] ); 3214 3215 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3216 // MaxPicOrderCntLsb - 1 ) ). 3217 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3218 3219 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3220 genPic->setPicOutputFlag( false ); 3221 3222 // - The generated picture is marked as "used for long-term reference". 3223 genPic->markAsUsedForLongTermReference(); 3224 3225 // - RefPicSetLtCurr[ i ] is set to be the generated reference picture. 3226 refPicSetLtCurr[ i ] = genPic; 3227 3228 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3229 genPic->setLayerId( nuhLayerId ); 3230 3231 // Insert to DPB 3232 m_dpb->addNewPic( genPic ); 3233 } 3234 } 3235 3236 for ( Int i = 0 ; i <= numPocLtFoll - 1; i++ ) 3237 { 3238 if ( refPicSetLtFoll[ i ] == NULL ) 3239 { 3240 // - For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 3241 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3242 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3243 3244 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. 3245 genPic->getSlice(0)->setPOC( pocLtFoll[ i ] ); 3246 3247 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3248 // MaxPicOrderCntLsb - 1 ) ). 3249 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3250 3251 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3252 genPic->setPicOutputFlag( false ); 3253 3254 // - The generated picture is marked as "used for long-term reference". 3255 genPic->markAsUsedForLongTermReference(); 3256 3257 // - RefPicSetLtFoll[ i ] is set to be the generated reference picture. 3258 refPicSetLtFoll[ i ] = genPic; 3259 3260 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3261 genPic->setLayerId( nuhLayerId ); 3262 3263 // Insert to DPB 3264 m_dpb->addNewPic( genPic ); 3265 } 3266 } 3267 } 3268 3269 Void TDecTop::xF833DecProcForGenUnavRefPics() 3270 { 3271 /////////////////////////////////////////////////////////////////////////////////////// 3272 // F.8.3.3 Decoding process for generating unavailable reference picture 3273 /////////////////////////////////////////////////////////////////////////////////////// 3274 3275 x8331GenDecProcForGenUnavilRefPics(); 3276 } 3277 3278 Void TDecTop::xCheckUnavailableRefPics() 3279 { 3280 std::vector<TComPic*>** refPicSetsCurr = m_pcPic->getDecodedRps()->m_refPicSetsCurr; 3281 3282 Bool hasGeneratedRefPic = false; 3283 for (Int j = 0; j < 3; j++ ) 3284 { 3285 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 3286 for (Int i = 0 ; i < cSet->size(); i++ ) 3287 { 3288 assert( (*cSet)[i] != NULL ); 3289 if ((*cSet)[i]->getIsGenerated() ) 3290 { 3291 hasGeneratedRefPic = true; 3292 } 3293 } 3294 } 3295 m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 3296 } 3297 1756 3298 #endif 1757 3299 -
trunk/source/Lib/TLibDecoder/TDecTop.h
r1313 r1321 81 81 Int**** getBaseViewShiftLUTI() { return m_aiBaseViewShiftLUT; } 82 82 83 #if !NH_3D_FIX_TICKET_10184 #if NH_3D_IV_MERGE85 Void copyCamParamForSlice( TComSlice* pcSlice );86 #endif87 #endif88 89 83 private: 90 84 Void xResetReceivedIdc( Bool overWriteFlag ); … … 182 176 { 183 177 private: 184 Int m_iMaxRefPicNum; 185 186 NalUnitType m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture 187 Int m_pocCRA; ///< POC number of the latest CRA picture 188 Int m_pocRandomAccess; ///< POC number of the random access point (the first IDR or CRA picture) 189 190 TComList<TComPic*> m_cListPic; // Dynamic buffer 191 #if NH_MV 192 Bool* m_layerInitilizedFlag; // initialization Layers 193 static ParameterSetManager m_parameterSetManager; // storage for parameter sets 194 Int m_targetOlsIdx; 195 #else 196 ParameterSetManager m_parameterSetManager; // storage for parameter sets 197 #endif 178 Int m_iMaxRefPicNum; 179 180 NalUnitType m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture 181 #if !NH_MV 182 Int m_pocCRA; ///< POC number of the latest CRA picture 183 Int m_pocRandomAccess; ///< POC number of the random access point (the first IDR or CRA picture) 184 185 TComList<TComPic*> m_cListPic; // Dynamic buffer 186 ParameterSetManager m_parameterSetManager; // storage for parameter sets 187 #endif 188 198 189 TComSlice* m_apcSlicePilot; 199 190 … … 215 206 216 207 Bool isSkipPictureForBLA(Int& iPOCLastDisplay); 217 #if NH_MV 218 Bool isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay, const TComVPS* vps); 219 #else 208 #if !NH_MV 220 209 Bool isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay); 221 210 #endif 211 222 212 TComPic* m_pcPic; 223 213 UInt m_uiSliceIdx; 214 #if !NH_MV 224 215 Int m_prevPOC; 225 216 Int m_prevTid0POC; 226 Bool m_bFirstSliceInPicture; 217 Bool m_bFirstSliceInPicture; 227 218 Bool m_bFirstSliceInSequence; 228 219 Bool m_prevSliceSkipped; … … 232 223 Bool m_isNoOutputPriorPics; 233 224 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 225 #endif 226 234 227 #if O0043_BEST_EFFORT_DECODING 235 228 UInt m_forceDecodeBitDepth; 236 229 #endif 230 231 237 232 std::ostream *m_pDecodedSEIOutputStream; 238 233 234 #if !NH_MV 239 235 Bool m_warningMessageSkipPicture; 236 #endif 237 240 238 #if NH_MV 241 Bool m_isLastNALWasEos; 242 #endif 243 244 #if NH_MV 245 // For NH_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 239 // Class interface 240 static ParameterSetManager m_parameterSetManager; // storage for parameter sets 241 TComPicLists* m_dpb; 242 #if NH_3D 243 CamParsCollector* m_pcCamParsCollector; 244 #endif 245 246 // Layer identification 246 247 Int m_layerId; 247 248 Int m_viewId; 248 TComPicLists* m_ivPicLists; 249 std::vector<TComPic*> m_refPicSetInterLayer0; 250 std::vector<TComPic*> m_refPicSetInterLayer1; 251 #if NH_3D 249 #if NH_3D 252 250 Int m_viewIndex; 253 251 Bool m_isDepth; 254 CamParsCollector* m_pcCamParsCollector; 255 Int m_profileIdc; 256 #endif 252 #endif 253 254 // Layer set 255 Int m_targetOlsIdx; 256 Int m_smallestLayerId; 257 Bool m_isInOwnTargetDecLayerIdList; 258 259 // Decoding processes 260 DecodingProcess m_decodingProcess; 261 DecodingProcess m_decProcPocAndRps; 262 263 // Decoding state 264 Bool* m_firstPicInLayerDecodedFlag; 265 266 Int m_prevPicOrderCnt; 267 Int m_prevTid0PicPicOrderCntMsb; 268 Int m_prevTid0PicSlicePicOrderCntLsb; 269 270 Int* m_lastPresentPocResetIdc; 271 Bool* m_pocDecrementedInDpbFlag; 272 273 Int m_prevIrapPoc; 274 Int64 m_prevIrapDecodingOrder; 275 Int64 m_prevStsaDecOrder; 276 Int m_prevStsaTemporalId; 257 277 #endif 258 278 … … 268 288 269 289 Void init(); 270 #if NH_MV 271 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag ); 272 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer ); 273 #else 290 #if !NH_MV 274 291 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay); 275 #endif276 292 Void deletePicBuffer(); 277 293 278 #if NH_MV279 const TComVPS* getActiveVPS() { return m_parameterSetManager.getActiveVPS( ); }280 const TComSPS* getActiveSPS() { return m_parameterSetManager.getActiveSPS( m_layerId ); }281 #endif282 283 #if NH_MV284 Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet);285 #else286 294 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 287 #endif288 295 Void checkNoOutputPriorPics (TComList<TComPic*>* rpcListPic); 289 296 290 297 Bool getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; } 291 298 Void setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; } 299 292 300 Void setFirstSliceInPicture (bool val) { m_bFirstSliceInPicture = val; } 301 293 302 Bool getFirstSliceInSequence () { return m_bFirstSliceInSequence; } 294 303 Void setFirstSliceInSequence (bool val) { m_bFirstSliceInSequence = val; } 304 #endif 305 295 306 #if O0043_BEST_EFFORT_DECODING 296 307 Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; } 297 308 #endif 309 298 310 Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; } 299 311 UInt getNumberOfChecksumErrorsDetected() const { return m_cGopDecoder.getNumberOfChecksumErrorsDetected(); } 312 300 313 #if NH_MV 301 TComPic* getPic ( Int poc ); 302 TComList<TComPic*>* getListPic () { return &m_cListPic; } 303 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; } 304 Void setLayerInitilizedFlags( Bool* val ) { m_layerInitilizedFlag = val; } 305 Void setTargetOlsIdx ( Int targetOlsIdx ) { m_targetOlsIdx = targetOlsIdx; } 306 Int getTargetOlsIdx ( ) { return m_targetOlsIdx; } 307 Int getCurrPoc () { return m_apcSlicePilot->getPOC(); } 308 Void setLayerId ( Int layer) { m_layerId = layer; } 309 Int getLayerId () { return m_layerId; } 310 Void setViewId ( Int viewId ) { m_viewId = viewId; } 311 Int getViewId () { return m_viewId; } 312 Void initFromActiveVps ( const TComVPS* vps ); 314 315 ///////////////////////// 316 // For access from TAppDecTop 317 ///////////////////////// 318 319 // Non VCL decoding 320 Bool decodeNonVclNalu ( InputNALUnit& nalu ); 321 322 // Start picture decoding 323 Int preDecodePoc ( Bool firstPicInLayerDecodedFlag, Bool isFstPicOfAllLayOfPocResetPer, Bool isPocResettingPicture ); 324 Void inferPocResetPeriodId ( ); 325 Void decodeSliceHeader ( InputNALUnit &nalu ); 326 327 // Picture decoding 328 Void activatePSsAndInitPicOrSlice( TComPic* newPic ); 329 Void decodePocAndRps ( ); 330 Void genUnavailableRefPics ( ); 331 Void decodeSliceSegment ( InputNALUnit &nalu ); 332 333 // End Picture decoding 334 Void executeLoopFilters ( ); 335 Void finalizePic( ); 336 337 ////////////////////////// 338 // For access from slice 339 ///////////////////////// 340 Void initFromActiveVps ( const TComVPS* vps ); 341 342 ////////////////////////// 343 // General access 344 ///////////////////////// 345 346 // Picture identification 347 Void setLayerId ( Int layer ) { m_layerId = layer; } 348 Int getLayerId ( ) { return m_layerId; } 349 Void setViewId ( Int viewId ) { m_viewId = viewId; } 350 Int getViewId ( ) { return m_viewId; } 313 351 #if NH_3D 314 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 315 Int getViewIndex () { return m_viewIndex; } 316 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 317 Bool getIsDepth () { return m_isDepth; } 318 Void setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; } 319 320 321 Bool decProcAnnexI() { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); } 322 #endif 352 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 353 Int getViewIndex ( ) { return m_viewIndex; } 354 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 355 Bool getIsDepth ( ) { return m_isDepth; } 356 #endif 357 358 // Classes 359 Void setDpb ( TComPicLists* picLists) { m_dpb = picLists; } 360 #if NH_3D 361 Void setCamParsCollector ( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; } 362 #endif 363 364 // Slice pilot access 365 TComSlice* getSlicePilot ( ) { return m_apcSlicePilot; } 366 367 // Decoding state 368 Bool getFirstSliceSegementInPicFlag( ); 369 Void setFirstPicInLayerDecodedFlag(Bool* val ) { m_firstPicInLayerDecodedFlag = val; } 370 Void setPocDecrementedInDPBFlag (Bool* val ) { m_pocDecrementedInDpbFlag = val; } 371 Void setLastPresentPocResetIdc (Int* val ) { m_lastPresentPocResetIdc = val; } 372 373 // Layer sets 374 Void setTargetOlsIdx ( Int targetOlsIdx ) { m_targetOlsIdx = targetOlsIdx; } 375 Int getTargetOlsIdx ( ) { return m_targetOlsIdx; } 376 Int getSmallestLayerId ( ) { return m_smallestLayerId; } 377 Bool getIsInOwnTargetDecLayerIdList() { return m_isInOwnTargetDecLayerIdList; } 378 379 // Decoding processes identification 380 Bool decProcClause8( ) { return ( m_decodingProcess == CLAUSE_8 ); } 381 Bool decProcAnnexF ( ) { return ( decProcAnnexG() || decProcAnnexH() || decProcAnnexI() ); } 382 Bool decProcAnnexG ( ) { return ( m_decodingProcess == ANNEX_G || decProcAnnexI() ); } 383 Bool decProcAnnexH ( ) { return ( m_decodingProcess == ANNEX_H ); } 384 Bool decProcAnnexI ( ) { return ( m_decodingProcess == ANNEX_I ); } 385 386 DecodingProcess getDecodingProcess ( ) const { return m_decodingProcess; } 387 Void setDecProcPocAndRps( DecodingProcess decProc ) { m_decProcPocAndRps = decProc; } 323 388 #endif 324 389 325 390 protected: 326 Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 327 Void xCreateLostPicture (Int iLostPOC); 328 391 392 #if !NH_MV 393 Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 394 Void xCreateLostPicture (Int iLostPOC); 329 395 Void xActivateParameterSets(); 330 #if NH_MV 331 TComPic* xGetPic( Int layerId, Int poc ); 332 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 333 Void xResetPocInPicBuffer(); 334 Void xCeckNoClrasOutput(); 335 336 Bool xAllRefLayersInitilized( const TComVPS* vps ); 337 #else 338 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 339 #endif 396 Bool xDecodeSlice (InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 397 #endif 398 340 399 Void xDecodeVPS(const std::vector<UChar> &naluData); 341 400 Void xDecodeSPS(const std::vector<UChar> &naluData); 342 Void xDecodePPS(const std::vector<UChar> &naluData); 401 Void xDecodePPS(const std::vector<UChar> &naluData); 402 #if !NH_MV 343 403 Void xUpdatePreviousTid0POC( TComSlice *pSlice ) { if ((pSlice->getTLayer()==0) && (pSlice->isReferenceNalu() && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) { m_prevTid0POC=pSlice->getPOC(); } } 404 #endif 344 405 345 406 Void xParsePrefixSEImessages(); 346 407 Void xParsePrefixSEIsForUnknownVCLNal(); 347 408 409 #if NH_MV 410 // POC 411 Void x831DecProcForPicOrderCount ( ); 412 Void xF831DecProcForPicOrderCount ( ); 413 Int xGetCurrMsb ( Int cl, Int pl, Int pm, Int ml ); 414 415 //RPS 416 Void x832DecProcForRefPicSet ( Bool annexFModifications ); 417 Void xF832DecProcForRefPicSet ( ); 418 Void xG813DecProcForInterLayerRefPicSet ( ); 419 420 // Unavailable Pics 421 Void x8331GenDecProcForGenUnavilRefPics ( ); 422 TComPic* x8332GenOfOneUnavailPic ( Bool calledFromCl8331 ); 423 Void xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay(); 424 Void xF833DecProcForGenUnavRefPics ( ); 425 Void xCheckUnavailableRefPics ( ); 426 #endif 427 348 428 };// END CLASS DEFINITION TDecTop 349 429 350 430 351 431 //! \} 352 353 432 #endif // __TDECTOP__ 354 433 -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
r1313 r1321 156 156 #if FAST_BIT_EST 157 157 m_fracBits = pcTEncBinCABAC->m_fracBits; 158 #if NH_MV 158 159 D_PRINT_INDENT(g_traceEncFracBits, "CopyState " + n2s(m_fracBits) ); 160 #endif 159 161 #endif 160 162 } … … 171 173 } 172 174 #if FAST_BIT_EST 175 #if NH_MV 173 176 D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits Before" + n2s(m_fracBits) ); 177 #endif 174 178 m_fracBits &= 32767; 179 #if NH_MV 175 180 D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits " + n2s(m_fracBits) ); 181 #endif 176 182 #endif 177 183 } -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
r1313 r1321 59 59 m_pcTComBitIf->write(0, UInt(m_fracBits >> 15) ); 60 60 m_fracBits &= 32767; 61 #if NH_MV 61 62 D_PRINT_INDENT( g_traceEncFracBits, "Finish " + n2s(m_fracBits) ); 63 #endif 62 64 } 63 65 … … 81 83 m_uiBinsCoded += m_binCountIncrement; 82 84 m_fracBits += rcCtxModel.getEntropyBits( binValue ); 85 #if NH_MV 83 86 D_PRINT_INDENT( g_traceEncFracBits, "EncodeBin " + n2s(m_fracBits) ); 87 #endif 84 88 85 89 rcCtxModel.update( binValue ); … … 113 117 m_uiBinsCoded += m_binCountIncrement; 114 118 m_fracBits += 32768; 115 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinEP " + n2s(m_fracBits) ); 119 #if NH_MV 120 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinEP " + n2s(m_fracBits) ); 121 #endif 116 122 } 117 123 … … 126 132 m_uiBinsCoded += numBins & -m_binCountIncrement; 127 133 m_fracBits += 32768 * numBins; 134 #if NH_MV 128 135 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinsEP " + n2s(m_fracBits) ); 136 #endif 129 137 } 130 138 … … 138 146 m_uiBinsCoded += m_binCountIncrement; 139 147 m_fracBits += ContextModel::getEntropyBitsTrm( binValue ); 148 #if NH_MV 140 149 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinTrm " + n2s(m_fracBits) ); 150 #endif 141 151 } 142 152 … … 144 154 { 145 155 m_fracBits = (m_fracBits + 32767) & (~32767); 156 #if NH_MV 146 157 D_PRINT_INDENT( g_traceEncFracBits, "Align " + n2s(m_fracBits) ); 158 #endif 147 159 } 148 160 -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r1313 r1321 40 40 #include "SEIwrite.h" 41 41 42 #if NH_ 3D42 #if NH_MV 43 43 #include "TEncTop.h" 44 44 #endif … … 53 53 { 54 54 fprintf( g_hTrace, "=========== Video Parameter Set ===========\n" ); 55 } 55 56 56 57 Void xTraceSPSHeader () … … 380 381 WRITE_CODE((pcPPS->getDLT()->getDepthViewBitDepth() - 8), 4, "pps_bit_depth_for_depth_layers_minus8"); 381 382 382 #if NH_3D_DLT_FIX383 383 for( Int i = 0; i <= pcPPS->getDLT()->getNumDepthViews()-1; i++ ) 384 #else385 for( Int i = 0; i <= pcPPS->getDLT()->getNumDepthViews(); i++ )386 #endif387 384 { 388 385 Int layerId = pcPPS->getDLT()->getDepthIdxToLayerId(i); … … 748 745 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1, "sps_max_dec_pic_buffering_minus1[i]" ); 749 746 WRITE_UVLC( pcSPS->getNumReorderPics(i), "sps_max_num_reorder_pics[i]" ); 747 #if NH_MV 748 WRITE_UVLC( pcSPS->getSpsMaxLatencyIncreasePlus1(i), "sps_max_latency_increase_plus1[i]" ); 749 #else 750 750 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase_plus1[i]" ); 751 #endif 751 752 if (!subLayerOrderingInfoPresentFlag) 752 753 { … … 814 815 codeShortTermRefPicSet( rps,false, i); 815 816 } 817 #if NH_MV 818 WRITE_FLAG( pcSPS->getLongTermRefPicsPresentFlag() ? 1 : 0, "long_term_ref_pics_present_flag" ); 819 if (pcSPS->getLongTermRefPicsPresentFlag()) 820 #else 816 821 WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_present_flag" ); 817 822 if (pcSPS->getLongTermRefsPresent()) 823 #endif 818 824 { 819 825 WRITE_UVLC(pcSPS->getNumLongTermRefPicSPS(), "num_long_term_ref_pics_sps" ); … … 1747 1753 //write slice address 1748 1754 const Int sliceSegmentRsAddress = pcSlice->getPic()->getPicSym()->getCtuTsToRsAddrMap(ctuTsAddress); 1749 1755 #if NH_MV 1756 // This should actually be done somewhere else and not in writing process. 1757 pcSlice->setFirstSliceSegementInPicFlag( sliceSegmentRsAddress==0 ); 1758 WRITE_FLAG( pcSlice->getFirstSliceSegementInPicFlag() , "first_slice_segment_in_pic_flag" ); 1759 #else 1750 1760 WRITE_FLAG( sliceSegmentRsAddress==0, "first_slice_segment_in_pic_flag" ); 1761 #endif 1751 1762 if ( pcSlice->getRapPicFlag() ) 1752 1763 { … … 1760 1771 else 1761 1772 #endif 1762 1763 1773 WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" ); 1764 1774 if ( pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag() && (sliceSegmentRsAddress!=0) ) … … 1772 1782 if ( !pcSlice->getDependentSliceSegmentFlag() ) 1773 1783 { 1774 1775 1784 #if NH_MV 1776 1785 Int esb = 0; //Don't use i, otherwise will shadow something below … … 1861 1870 } 1862 1871 } 1872 #if NH_MV 1873 if(pcSlice->getSPS()->getLongTermRefPicsPresentFlag()) 1874 #else 1863 1875 if(pcSlice->getSPS()->getLongTermRefsPresent()) 1876 #endif 1864 1877 { 1865 1878 Int numLtrpInSH = rps->getNumberOfLongtermPictures(); … … 2196 2209 Bool isDBFEnabled = (!pcSlice->getDeblockingFilterDisable()); 2197 2210 2198 if(pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))2211 if(pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled )) 2199 2212 { 2200 2213 WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag"); … … 2204 2217 { 2205 2218 Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() ); 2206 #if NH_3D_FIX_TICKET_1012207 2219 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 2208 #else2209 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )2210 #endif2211 2220 { 2212 2221 for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ ) … … 2257 2266 if( pcSlice->getPocMsbValRequiredFlag() ) 2258 2267 { 2259 pcSlice->setPocMsb ValPresentFlag( true );2268 pcSlice->setPocMsbCycleValPresentFlag( true ); 2260 2269 } 2261 2270 else 2262 2271 { 2263 pcSlice->setPocMsb ValPresentFlag( false );2264 } 2265 } 2266 2267 if( pcSlice->getPocMsb ValPresentFlag() )2272 pcSlice->setPocMsbCycleValPresentFlag( false ); 2273 } 2274 } 2275 2276 if( pcSlice->getPocMsbCycleValPresentFlag() ) 2268 2277 { 2269 2278 // Int iMaxPOClsb = 1<< pcSlice->getSPS()->getBitsForPOC(); currently unused 2270 2279 2271 2280 UInt lengthVal = 1; 2272 UInt tempVal = pcSlice->getPocMsb Val() + 1;2281 UInt tempVal = pcSlice->getPocMsbCycleVal() + 1; 2273 2282 assert ( tempVal ); 2274 2283 while( 1 != tempVal ) … … 2314 2323 if( !pcSlice->getPocMsbValRequiredFlag() && pcSlice->getVPS()->getVpsPocLsbAlignedFlag() ) 2315 2324 { 2316 WRITE_FLAG( pcSlice->getPocMsb ValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" );2325 WRITE_FLAG( pcSlice->getPocMsbCycleValPresentFlag( ) ? 1 : 0 , "poc_msb_cycle_val_present_flag" ); 2317 2326 } 2318 2327 else 2319 2328 { 2320 assert( pcSlice->getPocMsb ValPresentFlag() == pcSlice->inferPocMsbValPresentFlag( ) );2329 assert( pcSlice->getPocMsbCycleValPresentFlag() == pcSlice->inferPocMsbCycleValPresentFlag( ) ); 2321 2330 } 2322 2331 2323 if( pcSlice->getPocMsb ValPresentFlag() )2324 { 2325 WRITE_UVLC( pcSlice->getPocMsb Val( ), "poc_msb_val" );2332 if( pcSlice->getPocMsbCycleValPresentFlag() ) 2333 { 2334 WRITE_UVLC( pcSlice->getPocMsbCycleVal( ), "poc_msb_cycle_val" ); 2326 2335 } 2327 2336 … … 2347 2356 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 2348 2357 { 2349 #if !NH_MV2350 #endif2351 2358 WRITE_FLAG( pcPTL->getSubLayerProfilePresentFlag(i), "sub_layer_profile_present_flag[i]" ); 2352 #if !NH_MV2353 #endif2354 2359 WRITE_FLAG( pcPTL->getSubLayerLevelPresentFlag(i), "sub_layer_level_present_flag[i]" ); 2355 2360 } -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r1313 r1321 66 66 67 67 protected: 68 #if NH_ 3D68 #if NH_MV 69 69 TEncTop* m_encTop; 70 70 #endif … … 179 179 Void codeExplicitRdpcmMode( TComTU &rTu, const ComponentID compID ); 180 180 181 #if NH_ 3D181 #if NH_MV 182 182 TEncTop* getEncTop() { return m_encTop; }; 183 183 Void setEncTop( TEncTop* et ) { m_encTop = et; }; -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r1313 r1321 764 764 if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() ) 765 765 { 766 xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N );766 xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) ); 767 767 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 768 768 } … … 795 795 { 796 796 #if NH_3D_FAST_TEXTURE_ENCODING 797 xCheckRDCostInter( rpcBestCU, rpcTempCU DEBUG_STRING_PASS_INTO(sDebug), SIZE_NxN, bFMD );797 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug), bFMD ); 798 798 #else 799 799 … … 1096 1096 1097 1097 if((rpcBestCU->getSlice()->getSliceType() == I_SLICE) || 1098 ((!m_pcEncCfg->getDisableIntraPUsInInterSlices()) && ( // avoid very complex intra if it is unlikely1098 ((!m_pcEncCfg->getDisableIntraPUsInInterSlices()) && ( 1099 1099 (rpcBestCU->getCbf( 0, COMPONENT_Y ) != 0) || 1100 1100 ((rpcBestCU->getCbf( 0, COMPONENT_Cb ) != 0) && (numberValidComponents > COMPONENT_Cb)) || 1101 ((rpcBestCU->getCbf( 0, COMPONENT_Cr ) != 0) && (numberValidComponents > COMPONENT_Cr)) 1101 ((rpcBestCU->getCbf( 0, COMPONENT_Cr ) != 0) && (numberValidComponents > COMPONENT_Cr)) // avoid very complex intra if it is unlikely 1102 1102 #if NH_3D_ENC_DEPTH 1103 1103 || rpcBestCU->getSlice()->getIsDepth() … … 1785 1785 } 1786 1786 1787 #if NH_MV 1787 1788 D_PRINT_INC_INDENT( g_traceModeCheck, "xCheckRDCostMerge2Nx2N" ); 1789 #endif 1788 1790 1789 1791 #if NH_3D_MLC … … 1970 1972 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1971 1973 { 1974 #if NH_MV 1972 1975 D_PRINT_INC_INDENT ( g_traceModeCheck, "uiNoResidual: " + n2s( uiNoResidual) ); 1976 #endif 1973 1977 1974 1978 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) … … 1983 1987 } 1984 1988 #endif 1989 #if NH_MV 1985 1990 D_PRINT_INC_INDENT ( g_traceModeCheck, "uiMergeCand: "+ n2s(uiMergeCand) ); 1991 #endif 1986 1992 1987 1993 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) … … 2173 2179 2174 2180 xCheckDQP( rpcTempCU ); 2175 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );2181 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth DEBUG_STRING_PASS_INTO(bestStr) DEBUG_STRING_PASS_INTO(tmpStr) ); 2176 2182 } 2177 2183 } … … 2197 2203 } 2198 2204 } 2205 #if NH_MV 2199 2206 D_DEC_INDENT( g_traceModeCheck ); 2207 #endif 2200 2208 } 2201 2209 … … 2229 2237 } 2230 2238 } 2239 #if NH_MV 2231 2240 D_DEC_INDENT( g_traceModeCheck ); 2241 #endif 2232 2242 } 2233 2243 DEBUG_STRING_APPEND(sDebug, bestStr) … … 2239 2249 delete[] puhInterDirSP; 2240 2250 #endif 2251 #if NH_MV 2241 2252 D_DEC_INDENT( g_traceModeCheck ); 2253 #endif 2242 2254 } 2243 2255 … … 2265 2277 } 2266 2278 2279 #if NH_MV 2267 2280 D_PRINT_INC_INDENT(g_traceModeCheck, "xCheckRDCostInter; ePartSize:" + n2s( ePartSize) ); 2281 #endif 2268 2282 2269 2283 … … 2354 2368 { 2355 2369 #if NH_3D_ARP 2356 if( nARPWMax ) 2357 { 2358 continue; 2359 } 2360 else 2361 #endif 2362 { 2363 D_DEC_INDENT( g_traceModeCheck ); 2364 return; 2365 } 2370 if( nARPWMax ) 2371 { 2372 continue; 2373 } 2374 else 2375 #endif 2376 { 2377 #if NH_MV 2378 D_DEC_INDENT( g_traceModeCheck ); 2379 #endif 2380 return; 2381 } 2366 2382 } 2367 2383 #endif … … 2468 2484 2469 2485 xCheckDQP( rpcTempCU ); 2470 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth );2486 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest)); 2471 2487 } 2472 2488 … … 2479 2495 } 2480 2496 #endif 2497 #if NH_MV 2481 2498 D_DEC_INDENT( g_traceModeCheck ); 2499 #endif 2482 2500 } 2483 2501 … … 2683 2701 #endif 2684 2702 #if NH_3D_DIS 2685 Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )2703 Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize DEBUG_STRING_FN_DECLARE(sDebug) ) 2686 2704 { 2705 DEBUG_STRING_NEW(sTest) 2687 2706 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2688 2707 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) … … 2691 2710 } 2692 2711 2712 #if NH_MV 2693 2713 D_PRINT_INC_INDENT(g_traceModeCheck, "xCheckRDCostDIS" ); 2714 #endif 2694 2715 2695 2716 #if NH_3D_VSO // M5 … … 2753 2774 xCheckDQP( rpcTempCU ); 2754 2775 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest) ); 2776 #if NH_MV 2755 2777 D_DEC_INDENT( g_traceModeCheck ); 2778 #endif 2756 2779 } 2757 2780 #endif … … 2777 2800 } 2778 2801 } 2802 #if NH_MV 2779 2803 D_PRINT_INC_INDENT (g_traceModeCheck, "xCheckRDCostIntra; eSize: " + n2s(eSize) ); 2780 2804 #endif 2805 2781 2806 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2782 2807 #if NH_3D_VSO // M5 … … 2830 2855 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2831 2856 } 2832 #if NH_3D_DIS && !NH_3D_DIS_FIX 2857 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2858 #if NH_3D_DIS 2833 2859 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2834 2860 if(!rpcTempCU->getDISFlag(0)) 2835 2861 { 2836 2862 #endif 2837 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2838 #if NH_3D_DIS_FIX 2839 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2840 if(!rpcTempCU->getDISFlag(0)) 2841 { 2842 #endif 2843 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2844 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2845 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0 ); 2846 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2863 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2864 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2865 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0 ); 2866 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2847 2867 #if NH_3D_SDC_INTRA 2848 2868 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2849 2869 #endif 2850 2870 2851 // Encode Coefficients2852 Bool bCodeDQP = getdQPFlag();2853 Bool codeChromaQpAdjFlag = getCodeChromaQpAdjFlag();2854 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, bCodeDQP, codeChromaQpAdjFlag );2855 setCodeChromaQpAdjFlag( codeChromaQpAdjFlag );2856 setdQPFlag( bCodeDQP );2871 // Encode Coefficients 2872 Bool bCodeDQP = getdQPFlag(); 2873 Bool codeChromaQpAdjFlag = getCodeChromaQpAdjFlag(); 2874 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, bCodeDQP, codeChromaQpAdjFlag ); 2875 setCodeChromaQpAdjFlag( codeChromaQpAdjFlag ); 2876 setdQPFlag( bCodeDQP ); 2857 2877 #if NH_3D_DIS 2858 2878 } … … 2877 2897 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest)); 2878 2898 2899 #if NH_MV 2879 2900 D_DEC_INDENT( g_traceModeCheck ); 2880 } 2901 #endif 2902 } 2881 2903 2882 2904 … … 2912 2934 } 2913 2935 #endif 2914 2915 2936 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2916 2937 #if NH_3D_DIS -
trunk/source/Lib/TLibEncoder/TEncCu.h
r1313 r1321 163 163 #endif 164 164 #if NH_3D_DIS 165 Void xCheckRDCostDIS ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize );165 Void xCheckRDCostDIS ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize DEBUG_STRING_FN_DECLARE(sDebug) ); 166 166 #endif 167 167 Void xCheckRDCostIntra ( TComDataCU *&rpcBestCU, -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r1313 r1321 119 119 Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 120 120 { 121 #if NH_3D_FIX_TICKET_98122 121 if( !pcCU->getSlice()->getDepthIntraSkipFlag() ) 123 #else124 if ( !pcCU->getSlice()->getIsDepth() )125 #endif126 122 { 127 123 return; -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r1313 r1321 140 140 Void resetBits () { m_pcEntropyCoderIf->resetBits(); } 141 141 UInt getNumberOfWrittenBits () { 142 #if NH_MV 142 143 D_PRINT_INDENT(g_encNumberOfWrittenBits, "NumBits: " + n2s( m_pcEntropyCoderIf->getNumberOfWrittenBits() )) 144 #endif 143 145 return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } 144 146 Void resetEntropy (const TComSlice *pSlice) { m_pcEntropyCoderIf->resetEntropy(pSlice); } -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r1313 r1321 1428 1428 if ( gopNum == MAX_GOP) 1429 1429 { 1430 printf( "\nError: FrameI_l%d cannot enable inter-component prediction .\n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );1430 printf( "\nError: FrameI_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 1431 1431 } 1432 1432 else 1433 1433 { 1434 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction .\n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );1434 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 1435 1435 } 1436 1436 … … 1441 1441 pcSlice->checkInCompPredRefLayers(); 1442 1442 } 1443 1444 1443 #if NH_3D_IV_MERGE 1445 1444 // This needs to be done after initialization of 3D tool parameters. -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r1313 r1321 826 826 } 827 827 828 #if NH_MV 828 829 D_PRINT_INDENT( g_traceSAOCost, "SAO mode " + n2s( mode ) + " Cost: " + n2s( modeCost) ); 829 830 #endif 830 831 if(modeCost < minCost) 831 832 { -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r1313 r1321 1530 1530 ) 1531 1531 { 1532 #if NH_MV 1532 1533 D_PRINT_INC_INDENT( g_traceModeCheck, "xRecurIntraCodingLumaQT; zeroResiFlag " + n2s(zeroResiFlag) ) 1534 #endif 1533 1535 1534 1536 TComDataCU *pcCU = rTu.getCU(); … … 1713 1715 dSingleCost = 0.0; 1714 1716 #if NH_3D_ENC_DEPTH 1715 #if NH_3D_ENC_DEPTH_FIX1716 1717 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), 0, zeroResiFlag ); 1717 #else1718 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag );1719 #endif1720 1718 #else 1721 1719 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); … … 1841 1839 } 1842 1840 } 1841 #if NH_MV 1843 1842 D_DEC_INDENT( g_traceModeCheck ); 1843 #endif 1844 1844 return; 1845 1845 } … … 1888 1888 ruiDistY += uiSingleDistLuma; 1889 1889 dRDCost += dSingleCost; 1890 #if NH_MV 1890 1891 D_DEC_INDENT( g_traceModeCheck ); 1892 #endif 1891 1893 } 1892 1894 … … 1907 1909 TComTURecurse rTu(pcCU, 0); 1908 1910 const ChromaFormat chFmt = rTu.GetChromaFormat(); 1909 1911 DEBUG_STRING_NEW(sTemp) 1910 1912 if ( uiPredMode == 0 ) 1911 1913 { … … 2031 2033 TComTURecurse tuRecurseCU(pcCU, 0); 2032 2034 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT); 2033 2035 DEBUG_STRING_NEW(sTemp) 2034 2036 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) ); 2035 2037 … … 2086 2088 2087 2089 //===== init pattern for luma prediction ===== 2088 2090 DEBUG_STRING_NEW(sTemp2) 2089 2091 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) ); 2090 2092 … … 2212 2214 2213 2215 //===== determine distortion ===== 2214 #if NH_3D_INTRA_SDC_RD_FIX2215 2216 #if NH_3D_VSO 2216 2217 if( m_pcRdCost->getUseVSO() ) … … 2219 2220 } 2220 2221 else 2221 #endif2222 #else2223 #if NH_3D_VSO2224 if( m_pcRdCost->getUseVSO() )2225 {2226 if( m_pcRdCost->getUseEstimatedVSD() )2227 {2228 ruiDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );2229 }2230 else2231 {2232 ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );2233 }2234 }2235 else2236 #endif2237 2222 #endif 2238 2223 { … … 2754 2739 Bool bLumaOnly ) 2755 2740 { 2741 #if NH_MV 2756 2742 D_PRINT_INC_INDENT(g_traceModeCheck, "estIntraPredDis"); 2743 #endif 2757 2744 2758 2745 UInt uiDepth = pcCU->getDepth(0); … … 2772 2759 for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ ) 2773 2760 { 2761 #if NH_MV 2774 2762 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPredMode" + n2s(uiPredMode ) ); 2763 #endif 2775 2764 2776 2765 // set context models … … 2796 2785 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 2797 2786 } 2787 #if NH_MV 2798 2788 D_DEC_INDENT( g_traceModeCheck ); 2789 #endif 2799 2790 } 2800 2791 … … 2807 2798 //===== set distortion (rate and r-d costs are determined later) ===== 2808 2799 pcCU->getTotalDistortion() = uiBestDist; 2800 #if NH_MV 2809 2801 D_DEC_INDENT( g_traceModeCheck ); 2802 #endif 2810 2803 } 2811 2804 #endif … … 2826 2819 ) 2827 2820 { 2821 #if NH_MV 2828 2822 D_PRINT_INC_INDENT( g_traceModeCheck, "estIntraPredLumaQT"); 2823 #endif 2829 2824 2830 2825 const UInt uiDepth = pcCU->getDepth(0); … … 2882 2877 { 2883 2878 const UInt uiPartOffset=tuRecurseWithPU.GetAbsPartIdxTU(); 2879 #if NH_MV 2884 2880 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPartOffset: " + n2s(uiPartOffset ) ); 2881 #endif 2885 2882 2886 2883 // for( UInt uiPU = 0, uiPartOffset=0; uiPU < uiNumPU; uiPU++, uiPartOffset += uiQNumParts ) … … 2927 2924 m_pcRdCost->setDistParam(distParam, sps.getBitDepth(CHANNEL_TYPE_LUMA), piOrg, uiStride, piPred, uiStride, puRect.width, puRect.height, bUseHadamard); 2928 2925 2929 #if NH_3D _IC_FIX2926 #if NH_3D 2930 2927 distParam.bUseIC = false; 2931 2928 #endif … … 2940 2937 Distortion uiSad = 0; 2941 2938 #endif 2939 #if NH_MV 2942 2940 D_PRINT_INC_INDENT(g_traceModeCheck, "preTest; uiMode " + n2s(uiMode) ); 2941 #endif 2943 2942 2944 2943 const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); … … 2993 2992 2994 2993 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 2994 #if NH_MV 2995 2995 D_DEC_INDENT( g_traceModeCheck ); 2996 #endif 2996 2997 } 2997 2998 … … 3193 3194 #endif 3194 3195 3196 #if NH_MV 3195 3197 D_PRINT_INC_INDENT(g_traceModeCheck, "Test; uiOrgMode: " + n2s(uiOrgMode) ); 3198 #endif 3196 3199 3197 3200 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); … … 3395 3398 } // SDC loop 3396 3399 #endif 3400 #if NH_MV 3397 3401 D_DEC_INDENT( g_traceModeCheck ); 3402 #endif 3398 3403 } // Mode loop 3399 3404 … … 3554 3559 pcCU->setSDCFlagSubParts ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth ); 3555 3560 #endif 3561 #if NH_MV 3556 3562 D_DEC_INDENT( g_traceModeCheck ); 3563 #endif 3557 3564 } while (tuRecurseWithPU.nextSection(tuRecurseCU)); 3558 3565 … … 3583 3590 //===== set distortion (rate and r-d costs are determined later) ===== 3584 3591 pcCU->getTotalDistortion() = uiOverallDistY; 3592 #if NH_MV 3585 3593 D_DEC_INDENT( g_traceModeCheck ); 3594 #endif 3586 3595 } 3587 3596 … … 3892 3901 ) 3893 3902 { 3903 #if NH_MV 3894 3904 D_PRINT_INC_INDENT(g_traceModeCheck, "xMergeEstimation" ); 3905 #endif 3895 3906 3896 3907 UInt uiAbsPartIdx = 0; … … 4014 4025 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 4015 4026 { 4027 #if NH_MV 4016 4028 D_PRINT_INC_INDENT(g_traceModeCheck, "uiMergeCand: " + n2s(uiMergeCand) ); 4029 #endif 4017 4030 Distortion uiCostCand = std::numeric_limits<Distortion>::max(); 4018 4031 UInt uiBitsCand = 0; … … 4092 4105 uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand ); 4093 4106 4107 #if NH_MV 4094 4108 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiCostCand)); 4109 #endif 4095 4110 4096 4111 if ( uiCostCand < ruiCost ) … … 4102 4117 uiMergeIndex = uiMergeCand; 4103 4118 } 4119 #if NH_MV 4104 4120 D_DEC_INDENT( g_traceModeCheck ); 4105 } 4121 #endif 4122 } 4123 #if NH_MV 4106 4124 D_DEC_INDENT( g_traceModeCheck ); 4125 #endif 4107 4126 } 4108 4127 … … 4142 4161 { 4143 4162 4163 #if NH_MV 4144 4164 D_PRINT_INC_INDENT(g_traceModeCheck, "predInterSearch"); 4165 #endif 4145 4166 4146 4167 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) … … 4210 4231 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4211 4232 { 4233 #if NH_MV 4212 4234 D_PRINT_INC_INDENT(g_traceModeCheck, "iPartIdx: " + n2s(iPartIdx) ); 4235 #endif 4213 4236 4214 4237 Distortion uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() }; … … 4258 4281 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) 4259 4282 { 4283 #if NH_MV 4260 4284 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefList: " + n2s(iRefList) ); 4285 #endif 4261 4286 4262 4287 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); … … 4264 4289 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 4265 4290 { 4291 #if NH_MV 4266 4292 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefIdxTemp: " + n2s(iRefIdxTemp) ); 4293 #endif 4267 4294 4268 4295 uiBitsTemp = uiMbBits[iRefList]; … … 4338 4365 refIdxValidList1 = iRefIdxTemp; 4339 4366 } 4367 #if NH_MV 4340 4368 D_DEC_INDENT( g_traceModeCheck ); 4341 } 4369 #endif 4370 } 4371 #if NH_MV 4342 4372 D_DEC_INDENT( g_traceModeCheck ); 4373 #endif 4343 4374 } 4344 4375 … … 4609 4640 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 4610 4641 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 4642 #if NH_MV 4611 4643 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiMECost)); 4644 #endif 4612 4645 } 4613 4646 #else … … 4756 4789 // MC 4757 4790 motionCompensation ( pcCU, pcPredYuv, REF_PIC_LIST_X, iPartIdx ); 4791 #if NH_MV 4758 4792 D_DEC_INDENT( g_traceModeCheck ); 4793 #endif 4759 4794 } // end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4760 4795 4761 4796 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 4762 4797 4798 #if NH_MV 4763 4799 D_DEC_INDENT( g_traceModeCheck ); 4800 #endif 4764 4801 return; 4765 4802 } … … 4769 4806 Void TEncSearch::xEstimateMvPredAMVP( TComDataCU* pcCU, TComYuv* pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred, Bool bFilled, Distortion* puiDistBiP ) 4770 4807 { 4808 #if NH_MV 4771 4809 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateMvPredAMVP"); 4810 #endif 4772 4811 4773 4812 AMVPInfo* pcAMVPInfo = pcCU->getCUMvField(eRefPicList)->getAMVPInfo(); … … 4847 4886 if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1) 4848 4887 { 4888 #if NH_MV 4849 4889 D_PRINT_INC_INDENT(g_traceModeCheck, "Init"); 4890 #endif 4850 4891 4851 4892 (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight); 4852 4893 4894 #if NH_MV 4853 4895 D_DEC_INDENT( g_traceModeCheck ); 4896 #endif 4854 4897 } 4855 4898 return; … … 4867 4910 for ( i = 0 ; i < pcAMVPInfo->iN; i++) 4868 4911 { 4912 #if NH_MV 4869 4913 D_PRINT_INC_INDENT(g_traceModeCheck, "Cand i=" + n2s(i) + " X: " + n2s( pcAMVPInfo->m_acMvCand[i].getHor() ) + " Y: " + n2s( pcAMVPInfo->m_acMvCand[i].getVer() )); 4914 #endif 4870 4915 4871 4916 Distortion uiTmpCost; … … 4879 4924 } 4880 4925 4926 #if NH_MV 4881 4927 D_DEC_INDENT( g_traceModeCheck ); 4928 #endif 4882 4929 } 4883 4930 … … 4889 4936 pcCU->setMVPNumSubParts( pcAMVPInfo->iN, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr)); 4890 4937 4938 #if NH_MV 4891 4939 D_DEC_INDENT( g_traceModeCheck ); 4940 #endif 4892 4941 4893 4942 return; … … 5094 5143 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, Distortion& ruiCost, Bool bBi ) 5095 5144 { 5145 #if NH_MV 5096 5146 D_PRINT_INC_INDENT(g_traceModeCheck, "xMotionEstimation"); 5147 #endif 5097 5148 5098 5149 UInt uiPartAddr; … … 5227 5278 ruiCost = (Distortion)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); 5228 5279 5280 #if NH_MV 5229 5281 D_PRINT_INDENT(g_traceRDCost, "ME Cost:" + n2s(ruiCost) ); 5230 5282 D_DEC_INDENT ( g_traceModeCheck ); 5283 #endif 5231 5284 } 5232 5285 … … 5788 5841 Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) ) 5789 5842 { 5843 #if NH_MV 5790 5844 D_PRINT_INC_INDENT(g_traceModeCheck, "encodeResAndCalcRdInterCU; Skip residual: " + n2s(bSkipResidual)); 5845 #endif 5791 5846 5792 5847 assert ( !pcCU->isIntra(0) ); … … 5883 5938 } 5884 5939 #endif 5940 #if NH_MV 5885 5941 D_DEC_INDENT( g_traceModeCheck ); 5942 #endif 5886 5943 5887 5944 return; … … 6049 6106 } 6050 6107 #endif 6108 #if NH_MV 6051 6109 D_DEC_INDENT( g_traceModeCheck ); 6110 #endif 6052 6111 } 6053 6112 … … 6207 6266 DEBUG_STRING_FN_DECLARE(sDebug) ) 6208 6267 { 6268 #if NH_MV 6209 6269 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateInterResidualQT"); 6270 #endif 6210 6271 6211 6272 TComDataCU *pcCU = rTu.getCU(); … … 6260 6321 if( bCheckFull ) 6261 6322 { 6323 #if NH_MV 6262 6324 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckFull" ); 6325 #endif 6263 6326 6264 6327 Double minCost[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/]; … … 6349 6412 for (Int transformSkipModeId = 0; transformSkipModeId < transformSkipModesToTest; transformSkipModeId++) 6350 6413 { 6414 #if NH_MV 6351 6415 D_PRINT_INC_INDENT( g_traceModeCheck && ( transformSkipModeId > 0) , "TransformSkipModeId: " + n2s(transformSkipModeId) ); 6416 #endif 6352 6417 6353 6418 pcCU->setTransformSkipPartRange(transformSkipModeId, compID, subTUAbsPartIdx, partIdxesPerSubTU); … … 6358 6423 const Bool bUseCrossCPrediction = crossCPredictionModeId != 0; 6359 6424 6425 #if NH_MV 6360 6426 D_PRINT_INC_INDENT( g_traceModeCheck, "Zero" ); 6427 #endif 6361 6428 6362 6429 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] ); … … 6511 6578 } 6512 6579 6580 6513 6581 DEBUG_STRING_NEW(sSingleStringTest) 6514 6515 D_DEC_INDENT( g_traceModeCheck );6516 6582 #if NH_MV 6583 D_DEC_INDENT( g_traceModeCheck ); 6584 #endif 6517 6585 if( currAbsSum > 0 ) //if non-zero coefficients are present, a residual needs to be derived for further prediction 6518 6586 { 6587 #if NH_MV 6519 6588 D_PRINT_INC_INDENT(g_traceModeCheck, "NonZero"); 6589 #endif 6520 6590 6521 6591 if (isFirstMode) … … 6611 6681 currCompCost = nonCoeffCost; 6612 6682 } 6683 #if NH_MV 6613 6684 D_DEC_INDENT( g_traceModeCheck ); 6685 #endif 6614 6686 6615 6687 // evaluate … … 6689 6761 } 6690 6762 } 6763 #if NH_MV 6691 6764 D_DEC_INDENT( g_traceModeCheck ); 6765 #endif 6692 6766 } 6693 6767 … … 6700 6774 } // component loop 6701 6775 6776 #if NH_MV 6702 6777 D_PRINT_INC_INDENT(g_traceModeCheck, "Final"); 6778 #endif 6703 6779 6704 6780 for(UInt ch = 0; ch < numValidComp; ch++) … … 6758 6834 dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist ); 6759 6835 6836 #if NH_MV 6760 6837 D_DEC_INDENT( g_traceModeCheck ); 6761 6838 D_DEC_INDENT( g_traceModeCheck ); 6839 #endif 6762 6840 } // check full 6763 6841 … … 6765 6843 if( bCheckSplit ) 6766 6844 { 6845 #if NH_MV 6767 6846 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckSplit" ); 6847 #endif 6768 6848 if( bCheckFull ) 6769 6849 { … … 6935 7015 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_TEST ] ); 6936 7016 } 7017 #if NH_MV 6937 7018 D_DEC_INDENT( g_traceModeCheck ); 7019 #endif 6938 7020 } 6939 7021 else … … 6955 7037 #endif 6956 7038 } 7039 #if NH_MV 6957 7040 D_DEC_INDENT( g_traceModeCheck ); 7041 #endif 6958 7042 DEBUG_STRING_APPEND(sDebug, debug_reorder_data_inter_token[MAX_NUM_COMPONENT]) 7043 6959 7044 } 6960 7045 -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r1313 r1321 351 351 #endif 352 352 353 #if NH_3D_DMM 353 354 // ------------------------------------------------------------------------------------------------------------------- 354 355 // Depth intra search 355 356 // ------------------------------------------------------------------------------------------------------------------- 356 #if NH_3D_DMM 357 357 358 Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2, Pel defaultVal, Bool subSamp = false ); 358 359 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r1313 r1321 83 83 m_aICEnableNum = NULL; 84 84 #endif 85 #if NH_ 3D85 #if NH_MV 86 86 m_cCavlcCoder.setEncTop(this); 87 87 #endif … … 350 350 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) ); 351 351 } 352 #if NH_MV353 352 pcPicCurr->setLayerId( getLayerId()); 354 #endif355 353 #if NH_3D 356 354 pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() ); … … 361 359 Void TEncTop::deletePicBuffer() 362 360 { 361 362 #if !NH_MV 363 363 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 364 364 Int iSize = Int( m_cListPic.size() ); 365 366 365 for ( Int i = 0; i < iSize; i++ ) 367 366 { … … 372 371 pcPic = NULL; 373 372 } 373 #endif 374 374 } 375 375 … … 404 404 if( gopId == 0) 405 405 { 406 m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut);406 m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, *(m_ivPicLists->getSubDpb( getLayerId(), false )), rcListPicYuvRecOut, accessUnitsOut); 407 407 #else 408 408 if (pcPicYuvOrg != NULL) … … 434 434 #if NH_MV 435 435 } 436 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false, snrCSC, m_printFrameMSE, gopId);436 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, *(m_ivPicLists->getSubDpb(getLayerId(), false) ), rcListPicYuvRecOut, accessUnitsOut, false, false, snrCSC, m_printFrameMSE, gopId); 437 437 438 438 if( gopId + 1 == m_cGOPEncoder.getGOPSize() ) … … 574 574 // At this point, the SPS and PPS can be considered activated - they are copied to the new TComPic. 575 575 576 #if NH_MV 577 TComList<TComPic*>& cListPic = *(m_ivPicLists->getSubDpb(getLayerId(), false) ); 578 TComSlice::sortPicList(cListPic); 579 #else 576 580 TComSlice::sortPicList(m_cListPic); 577 578 581 #endif 582 583 584 #if NH_MV 585 if (cListPic.size() >= (UInt)(m_iGOPSize + getMaxDecPicBuffering(MAX_TLAYER-1) + 2) ) 586 { 587 TComList<TComPic*>::iterator iterPic = cListPic.begin(); 588 Int iSize = Int( cListPic.size() ); 589 #else 579 590 if (m_cListPic.size() >= (UInt)(m_iGOPSize + getMaxDecPicBuffering(MAX_TLAYER-1) + 2) ) 580 591 { 581 592 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 582 593 Int iSize = Int( m_cListPic.size() ); 594 #endif 583 595 for ( Int i = 0; i < iSize; i++ ) 584 596 { … … 604 616 } 605 617 618 #if NH_MV 619 cListPic.pushBack( rpcPic ); 620 #else 606 621 m_cListPic.pushBack( rpcPic ); 622 #endif 607 623 } 608 624 rpcPic->setReconMark (false); … … 1056 1072 m_cPPS.setOutputFlagPresentFlag( false ); 1057 1073 #if NH_MV 1058 #if NH_MV_FIX_TICKET_1001059 1074 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 1060 #else1061 m_cPPS.setNumExtraSliceHeaderBits( 3 );1062 #endif1063 1075 #endif 1064 1076 m_cPPS.setSignHideFlag(getSignHideFlag()); -
trunk/source/Lib/TLibEncoder/TEncTop.h
r1313 r1321 76 76 Int m_iNumPicRcvd; ///< number of received pictures 77 77 UInt m_uiNumAllPicCoded; ///< number of coded pictures 78 #if !NH_MV 78 79 TComList<TComPic*> m_cListPic; ///< dynamic list of pictures 80 #endif 79 81 80 82 #if NH_MV … … 170 172 // ------------------------------------------------------------------------------------------------------------------- 171 173 174 #if NH_MV 175 TComList<TComPic*>* getListPic () { return m_ivPicLists->getSubDpb( getLayerId(), false); } 176 #else 172 177 TComList<TComPic*>* getListPic () { return &m_cListPic; } 178 #endif 173 179 TEncSearch* getPredSearch () { return &m_cSearch; } 174 180
Note: See TracChangeset for help on using the changeset viewer.