Changeset 815 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 30 Jun 2014, 06:13:06 (11 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r713 r815 58 58 #if SVC_EXTENSION 59 59 #include <vector> 60 #define NV_VERSION "6. 0(HM-14.0)" ///< Current software version60 #define NV_VERSION "6.1 (HM-14.0)" ///< Current software version 61 61 #else 62 62 #define NV_VERSION "14.0" ///< Current software version -
trunk/source/Lib/TLibCommon/SEI.h
r713 r815 37 37 #include <cstring> 38 38 39 #if Q0078_ADD_LAYER_SETS 40 #include "TLibCommon/NAL.h" 41 #endif 42 39 43 //! \ingroup TLibCommon 40 44 //! \{ … … 66 70 POST_FILTER_HINT = 22, 67 71 TONE_MAPPING_INFO = 23, 72 #if P0050_KNEE_FUNCTION_SEI 73 KNEE_FUNCTION_INFO = 24, 74 #endif 68 75 FRAME_PACKING = 45, 69 76 DISPLAY_ORIENTATION = 47, … … 91 98 #if Q0074_SEI_COLOR_MAPPING 92 99 COLOR_MAPPING_INFO = 143, 100 #endif 101 #if Q0078_ADD_LAYER_SETS 102 OUTPUT_LAYER_SET_NESTING = 144, 103 VPS_REWRITING = 145, 104 #endif 105 #if Q0189_TMVP_CONSTRAINTS 106 TMVP_CONSTRAINTS = 146, 107 #endif 108 #if Q0247_FRAME_FIELD_INFO 109 FRAME_FIELD_INFO = 147, 93 110 #endif 94 111 }; … … 407 424 Int m_extendedWhiteLevelLumaCodeValue; 408 425 }; 409 426 #if P0050_KNEE_FUNCTION_SEI 427 class SEIKneeFunctionInfo : public SEI 428 { 429 public: 430 PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } 431 SEIKneeFunctionInfo() {} 432 virtual ~SEIKneeFunctionInfo() {} 433 434 Int m_kneeId; 435 Bool m_kneeCancelFlag; 436 Bool m_kneePersistenceFlag; 437 Bool m_kneeMappingFlag; 438 Int m_kneeInputDrange; 439 Int m_kneeInputDispLuminance; 440 Int m_kneeOutputDrange; 441 Int m_kneeOutputDispLuminance; 442 Int m_kneeNumKneePointsMinus1; 443 std::vector<Int> m_kneeInputKneePoint; 444 std::vector<Int> m_kneeOutputKneePoint; 445 }; 446 #endif 410 447 #if Q0074_SEI_COLOR_MAPPING 411 448 class SEIColorMappingInfo : public SEI … … 486 523 #endif 487 524 525 #if Q0189_TMVP_CONSTRAINTS 526 class SEITMVPConstrains : public SEI 527 { 528 public: 529 PayloadType payloadType() const { return TMVP_CONSTRAINTS; } 530 531 SEITMVPConstrains() 532 : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) 533 {} 534 535 virtual ~SEITMVPConstrains() 536 { 537 } 538 539 UInt prev_pics_not_used_flag; 540 UInt no_intra_layer_col_pic_flag; 541 }; 542 #endif 543 544 #if Q0247_FRAME_FIELD_INFO 545 class SEIFrameFieldInfo: public SEI 546 { 547 public: 548 PayloadType payloadType() const { return FRAME_FIELD_INFO; } 549 550 SEIFrameFieldInfo() 551 : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) 552 {} 553 554 virtual ~SEIFrameFieldInfo() 555 { 556 } 557 558 UInt m_ffinfo_picStruct; 559 UInt m_ffinfo_sourceScanType; 560 Bool m_ffinfo_duplicateFlag; 561 }; 562 563 #endif 564 488 565 typedef std::list<SEI*> SEIMessages; 489 566 … … 583 660 }; 584 661 662 #if Q0078_ADD_LAYER_SETS 663 class SEIOutputLayerSetNesting : public SEI 664 { 665 public: 666 PayloadType payloadType() const { return OUTPUT_LAYER_SET_NESTING; } 667 668 SEIOutputLayerSetNesting() {} 669 virtual ~SEIOutputLayerSetNesting() 670 { 671 if (!m_callerOwnsSEIs) 672 { 673 deleteSEIs(m_nestedSEIs); 674 } 675 } 676 677 Bool m_olsFlag; 678 UInt m_numOlsIndicesMinus1; 679 UInt m_olsIdx[1024]; 680 Bool m_callerOwnsSEIs; 681 SEIMessages m_nestedSEIs; 682 }; 683 684 class SEIVPSRewriting : public SEI 685 { 686 public: 687 PayloadType payloadType() const { return VPS_REWRITING; } 688 689 SEIVPSRewriting() {} 690 virtual ~SEIVPSRewriting() {} 691 692 NALUnit* nalu; 693 }; 694 #endif 695 585 696 //! \} -
trunk/source/Lib/TLibCommon/TCom3DAsymLUT.cpp
r713 r815 44 44 45 45 if( m_pCuboid != NULL ) 46 { 46 47 destroy(); 48 } 47 49 xAllocate3DArray( m_pCuboid , m_nYSize , m_nUSize , m_nVSize ); 48 50 } … … 88 90 89 91 // alignment padding 90 pU += (nWidth>>1); 91 pV += (nWidth>>1); 92 for( Int y = 0 ; y < (nHeight>>1) ; y ++ ) 93 { 94 *pU = pU[-1]; 95 *pV = pV[-1]; 96 pU += nStrideC; 97 pV += nStrideC; 98 } 99 memcpy(pU-(nWidth>>1), pU-(nWidth>>1)-nStrideC, ((nWidth>>1)+1)*sizeof(Pel)); 100 memcpy(pV-(nWidth>>1), pV-(nWidth>>1)-nStrideC, ((nWidth>>1)+1)*sizeof(Pel)); 101 pU = pcPic->getCbAddr(); 102 pV = pcPic->getCrAddr(); 92 pcPic->setBorderExtension( false ); 93 pcPic->extendPicBorder(); 103 94 104 95 Pel iMaxValY = (1<<getOutputBitDepthY())-1; -
trunk/source/Lib/TLibCommon/TCom3DAsymLUT.h
r713 r815 100 100 p[0] = new T*[xSize*ySize]; 101 101 for( Int x = 1 ; x < xSize ; x++ ) 102 { 102 103 p[x] = p[x-1] + ySize; 104 } 103 105 p[0][0] = new T[xSize*ySize*zSize]; 104 106 for( Int x = 0 ; x < xSize ; x++ ) 105 107 { 106 108 for( Int y = 0 ; y < ySize ; y++ ) 109 { 107 110 p[x][y] = p[0][0] + x * ySize * zSize + y * zSize; 111 } 108 112 } 109 113 } … … 117 121 { 118 122 if( p[0][0] != NULL ) 123 { 119 124 delete [] p[0][0]; 125 } 120 126 delete [] p[0]; 121 127 } -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r713 r815 3517 3517 #endif 3518 3518 3519 #if N0139_POSITION_ROUNDING_OFFSET 3519 #if REF_IDX_MFM 3520 // offset for collocated block in the motion mapping 3520 3521 if( iMotionMapping == 1 ) 3521 3522 { 3523 Bool unequalPictureSizeFlag = g_posScalingFactor[refLayerIdc][0] != 65536 || g_posScalingFactor[refLayerIdc][1] != 65536; //the condition should be updated according to the WD. 3524 3522 3525 // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check. 3523 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3524 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3526 if( unequalPictureSizeFlag ) 3527 { 3528 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3529 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3530 } 3531 else 3532 { 3533 iBX += 4; 3534 iBY += 4; 3535 } 3525 3536 } 3526 3537 #endif … … 3637 3648 { 3638 3649 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3639 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 3650 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0); 3651 3652 if(refPic->isILR(m_layerId)) 3640 3653 { 3641 3654 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3655 3656 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3657 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3658 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() ); 3642 3659 } 3643 3660 } … … 3645 3662 { 3646 3663 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3647 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 3664 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1); 3665 3666 if(refPic->isILR(m_layerId)) 3648 3667 { 3649 3668 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3669 3670 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3671 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3672 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() ); 3650 3673 } 3651 3674 } -
trunk/source/Lib/TLibCommon/TComPic.cpp
r595 r815 72 72 { 73 73 } 74 #if SVC_ UPSAMPLING74 #if SVC_EXTENSION 75 75 #if AUXILIARY_PICTURES 76 76 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 184 184 185 185 deleteSEIs(m_SEIs); 186 #if SVC_EXTENSION && SVC_UPSAMPLING186 #if SVC_EXTENSION 187 187 for( Int i = 0; i < MAX_LAYERS; i++ ) 188 188 { -
trunk/source/Lib/TLibCommon/TComPic.h
r713 r815 92 92 Int m_nFrameBit; 93 93 #endif 94 94 #if POC_RESET_IDC_DECODER 95 Bool m_currAuFlag; 96 #endif 95 97 public: 96 98 TComPic(); 97 99 virtual ~TComPic(); 98 100 101 #if SVC_EXTENSION 99 102 #if AUXILIARY_PICTURES 100 #if SVC_UPSAMPLING101 103 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 102 104 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 103 105 #else 104 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,105 Int *numReorderPics, Bool bIsVirtual = false );106 #endif107 #else108 #if SVC_UPSAMPLING109 106 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 110 107 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 108 #endif 111 109 #else 112 110 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 113 Int *numReorderPics, Bool bIsVirtual = false ); 114 #endif 115 #endif 111 Int *numReorderPics, Bool bIsVirtual = false ); 112 #endif //SVC_EXTENSION 113 116 114 virtual Void destroy(); 117 115 … … 202 200 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 203 201 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM 204 Bool isILR( UInt currLayerId ) { return ( getIsLongTerm()&& m_layerId < currLayerId ); }202 Bool isILR( UInt currLayerId ) { return ( m_bIsLongTerm && m_layerId < currLayerId ); } 205 203 #endif 206 204 #if REF_IDX_MFM … … 227 225 Int getFrameBit() { return m_nFrameBit; } 228 226 #endif 227 #if POC_RESET_IDC_DECODER 228 Bool isCurrAu() { return m_currAuFlag; } 229 Void setCurrAuFlag(Bool x) {m_currAuFlag = x; } 230 #endif 229 231 };// END CLASS DEFINITION TComPic 230 232 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r713 r815 67 67 { 68 68 } 69 70 #if SVC_EXTENSION 69 71 #if AUXILIARY_PICTURES 70 #if SVC_UPSAMPLING71 72 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 72 73 #else 73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )74 #endif75 #else76 #if SVC_UPSAMPLING77 74 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 75 #endif 78 76 #else 79 77 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 80 78 #endif 81 #endif82 79 { 83 80 m_iPicWidth = iPicWidth; 84 81 m_iPicHeight = iPicHeight; 85 82 86 #if SVC_ UPSAMPLING83 #if SVC_EXTENSION 87 84 if(pcSps != NULL) 88 85 { … … 369 366 } 370 367 368 #if SVC_EXTENSION 369 Void TComPicYuv::dump( Char* pFileName, Bool bAdd, Int bitDepth ) 370 { 371 FILE* pFile; 372 if (!bAdd) 373 { 374 pFile = fopen (pFileName, "wb"); 375 } 376 else 377 { 378 pFile = fopen (pFileName, "ab"); 379 } 380 381 if( bitDepth == 8 ) 382 { 383 dump( pFileName, bAdd ); 384 return; 385 } 386 387 Int x, y; 388 UChar uc; 389 390 Pel* piY = getLumaAddr(); 391 Pel* piCb = getCbAddr(); 392 Pel* piCr = getCrAddr(); 393 394 for ( y = 0; y < m_iPicHeight; y++ ) 395 { 396 for ( x = 0; x < m_iPicWidth; x++ ) 397 { 398 uc = piY[x] & 0xff; 399 fwrite( &uc, sizeof(UChar), 1, pFile ); 400 uc = (piY[x] >> 8) & 0xff; 401 fwrite( &uc, sizeof(UChar), 1, pFile ); 402 } 403 piY += getStride(); 404 } 405 406 for ( y = 0; y < m_iPicHeight >> 1; y++ ) 407 { 408 for ( x = 0; x < m_iPicWidth >> 1; x++ ) 409 { 410 uc = piCb[x] & 0xff; 411 fwrite( &uc, sizeof(UChar), 1, pFile ); 412 uc = (piCb[x] >> 8) & 0xff; 413 fwrite( &uc, sizeof(UChar), 1, pFile ); 414 } 415 piCb += getCStride(); 416 } 417 418 for ( y = 0; y < m_iPicHeight >> 1; y++ ) 419 { 420 for ( x = 0; x < m_iPicWidth >> 1; x++ ) 421 { 422 uc = piCr[x] & 0xff; 423 fwrite( &uc, sizeof(UChar), 1, pFile ); 424 uc = (piCr[x] >> 8) & 0xff; 425 fwrite( &uc, sizeof(UChar), 1, pFile ); 426 } 427 piCr += getCStride(); 428 } 429 430 fclose(pFile); 431 } 432 433 #endif 371 434 372 435 //! \} -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r595 r815 42 42 #include "CommonDef.h" 43 43 #include "TComRom.h" 44 #if SVC_ UPSAMPLING44 #if SVC_EXTENSION 45 45 #include "TComSlice.h" 46 46 #endif … … 94 94 ChromaFormat m_chromaFormatIDC; ////< Chroma Format 95 95 #endif 96 #if SVC_UPSAMPLING97 96 Window m_conformanceWindow; 98 #endif99 97 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 100 98 Bool m_isReconstructed; … … 112 110 // Memory management 113 111 // ------------------------------------------------------------------------------------------------ 112 #if SVC_EXTENSION 114 113 #if AUXILIARY_PICTURES 115 #if SVC_UPSAMPLING116 114 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 117 115 #else 118 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth );119 #endif120 #else121 #if SVC_UPSAMPLING122 116 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 117 #endif 123 118 #else 124 119 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 125 #endif 126 #endif 120 #endif //SVC_EXTENSION 127 121 128 122 Void destroy (); … … 187 181 #if SVC_EXTENSION 188 182 Void setHeight ( Int iPicHeight ) { m_iPicHeight = iPicHeight; } 189 #if SVC_UPSAMPLING190 183 Window& getConformanceWindow() { return m_conformanceWindow; } 191 184 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 192 #endif193 185 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 194 186 Void setReconstructed(Bool x) { m_isReconstructed = x; } … … 199 191 Void convertToMonochrome(); 200 192 #endif 193 Void dump( Char* pFileName, Bool bAdd, Int bitDepth ); 201 194 #endif //SVC_EXTENSION 202 195 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r713 r815 487 487 pcCU->clipMv(cMv); 488 488 489 #if SVC_EXTENSION 490 if( pcCU->getLayerId() > 0 ) 491 { 492 TComPic* refPic = pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx); 493 494 if( refPic->isILR(pcCU->getLayerId()) ) 495 { 496 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 497 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 498 assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), refPic->getLayerId() ) ); 499 489 500 #if REF_IDX_ME_ZEROMV 490 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) == false ); 501 // It is a requirement of bitstream conformance that the variables mvLX[ 0 ] and mvLX[ 1 ] shall be equal to 0 if the value of refIdxLX corresponds to an inter-layer reference picture. 502 assert( cMv.getHor() == 0 && cMv.getVer() == 0 ); 503 #endif 504 } 505 506 } 491 507 #endif 492 508 … … 765 781 } 766 782 767 #if SVC_ UPSAMPLING783 #if SVC_EXTENSION 768 784 #if O0215_PHASE_ALIGNMENT 769 785 #if O0194_JOINT_US_BITSHIFT … … 791 807 #endif 792 808 #endif 793 #endif 809 #endif //SVC_EXTENSION 794 810 //! \} -
trunk/source/Lib/TLibCommon/TComPrediction.h
r713 r815 48 48 #include "TComWeightPrediction.h" 49 49 50 #if SVC_ UPSAMPLING50 #if SVC_EXTENSION 51 51 #include "TComUpsampleFilter.h" 52 52 #endif … … 72 72 73 73 TComInterpolationFilter m_if; 74 75 #if SVC_UPSAMPLING76 TComUpsampleFilter m_cUsf;77 #endif78 74 79 75 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample … … 94 90 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 95 91 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 92 93 #if SVC_EXTENSION 94 TComUpsampleFilter m_cUsf; 95 #endif 96 96 97 97 public: … … 118 118 119 119 #if SVC_EXTENSION 120 #if SVC_UPSAMPLING121 120 #if O0215_PHASE_ALIGNMENT 122 121 #if O0194_JOINT_US_BITSHIFT … … 132 131 #endif 133 132 #endif 134 #endif135 133 #endif //SVC_EXTENSION 136 134 }; -
trunk/source/Lib/TLibCommon/TComRom.cpp
r595 r815 527 527 { 528 528 case NAL_UNIT_CODED_SLICE_TRAIL_N: 529 return "TRAIL_N"; 529 530 case NAL_UNIT_CODED_SLICE_TRAIL_R: 530 return "TRAIL ";531 return "TRAIL_R"; 531 532 532 533 case NAL_UNIT_CODED_SLICE_TSA_N: 534 return " TSA_N"; 533 535 case NAL_UNIT_CODED_SLICE_TSA_R: 534 return " TSA ";536 return " TSA_R"; 535 537 536 538 case NAL_UNIT_CODED_SLICE_STSA_N: 539 return " STSA_N"; 537 540 case NAL_UNIT_CODED_SLICE_STSA_R: 538 return " STSA ";541 return " STSA_R"; 539 542 540 543 case NAL_UNIT_CODED_SLICE_RADL_N: 544 return " RADL_N"; 541 545 case NAL_UNIT_CODED_SLICE_RADL_R: 542 return " RADL ";546 return " RADL_R"; 543 547 544 548 case NAL_UNIT_CODED_SLICE_RASL_N: 549 return " RASL_N"; 545 550 case NAL_UNIT_CODED_SLICE_RASL_R: 546 return " RASL ";551 return " RASL_R"; 547 552 548 553 case NAL_UNIT_CODED_SLICE_BLA_W_LP: 549 554 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: 550 555 case NAL_UNIT_CODED_SLICE_BLA_N_LP: 551 return " BLA";556 return " BLA"; 552 557 553 558 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: 554 559 case NAL_UNIT_CODED_SLICE_IDR_N_LP: 555 return " IDR";560 return " IDR"; 556 561 557 562 case NAL_UNIT_CODED_SLICE_CRA: 558 return " CRA";563 return " CRA"; 559 564 560 565 default: 561 return " ";566 return " "; 562 567 }; 563 568 } -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r713 r815 125 125 , m_pocMsbValPresentFlag ( false ) 126 126 #endif 127 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 128 , m_picOrderCntLsb (0) 129 #endif 127 130 #endif //SVC_EXTENSION 128 131 { … … 200 203 m_numEntryPointOffsets = 0; 201 204 m_enableTMVPFlag = true; 205 #if POC_RESET_IDC_SIGNALLING 206 m_pocResetIdc = 0; 207 m_pocResetPeriodId = 0; 208 m_fullPocResetFlag = false; 209 m_pocLsbVal = 0; 210 m_pocMsbVal = 0; 211 m_pocMsbValRequiredFlag = false; 212 m_pocMsbValPresentFlag = false; 213 #endif 214 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 215 m_picOrderCntLsb = 0; 216 #endif 202 217 } 203 218 … … 223 238 } 224 239 #endif 225 240 #if POC_RESET_IDC_DECODER 241 Bool TComSlice::getRaslPicFlag () 242 { 243 return getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R 244 || getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N; 245 } 246 Bool TComSlice::getRadlPicFlag () 247 { 248 return getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R 249 || getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N; 250 } 251 #endif 252 #if POC_RESET_IDC_ENCODER 253 Void TComSlice::decrementRefPocValues(Int const decrementValue) 254 { 255 for(Int listNum = 0; listNum < 2; listNum++) 256 { 257 RefPicList dpbPicSliceList = (listNum == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 258 for(Int listIdx = 0; listIdx < getNumRefIdx( dpbPicSliceList ); listIdx++) 259 { 260 setRefPOC( getRefPOC(dpbPicSliceList, listIdx) - decrementValue, 261 dpbPicSliceList, 262 listIdx 263 ); 264 } 265 } 266 } 267 Int TComSlice::getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ) 268 { 269 if( prevLsb - currLsb >= (maxLsbVal >> 1) ) 270 { 271 return prevMsb + maxLsbVal; 272 } 273 else if( currLsb - prevLsb > (maxLsbVal >> 1) ) 274 { 275 return prevMsb - maxLsbVal; 276 } 277 else 278 { 279 return prevMsb; 280 } 281 } 282 #endif 226 283 /** 227 284 - allocate table to contain substream sizes to be written to the slice header. … … 279 336 while ( iterPic != rcListPic.end() ) 280 337 { 338 #if POC_RESET_IDC_ENCODER 339 if( (pcPic->getPOC() == poc) && (pcPic->getSlice(0)->isReferenced()) ) 340 #else 281 341 if(pcPic->getPOC() == poc) 342 #endif 282 343 { 283 344 break; … … 293 354 pcPic = *(iterPic); 294 355 } 295 #if POC_RESET_FLAG 356 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER 296 357 assert( pcPic->getSlice(0)->isReferenced() ); 297 358 #endif … … 512 573 } 513 574 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 514 #if SCALABILITY_MASK_E0104 515 if( m_pcVPS->getScalabilityMask(2) ) 516 #else 517 if( m_pcVPS->getScalabilityMask(1) ) 518 #endif 575 if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) 519 576 { 520 577 Int numResampler = 0; … … 550 607 #endif 551 608 #if O0194_DIFFERENT_BITDEPTH_EL_BL 552 Int sameBitDepth = g_bitDepthYLayer[m_layerId] - g_bitDepthYLayer[refLayerId] + g_bitDepthCLayer[m_layerId] - g_bitDepthCLayer[refLayerId];553 554 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepth 609 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 610 611 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepths 555 612 #if Q0048_CGS_3D_ASYMLUT 556 613 || getPPS()->getCGSFlag() … … 775 832 #endif 776 833 777 #if N0147_IRAP_ALIGN_FLAG778 834 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0); 779 835 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 0); 780 #else781 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1);782 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 1);783 #endif784 836 785 837 //set L0 inter-layer reference picture modification 786 838 #if RPL_INIT_N0316_N0082 787 839 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 840 841 if( m_activeNumILRRefIdx > 1 ) 842 { 843 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 844 } 788 845 #else 789 846 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true; 790 847 #endif 791 #if N0147_IRAP_ALIGN_FLAG792 848 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 ); 793 #endif794 849 refPicListModification->setRefPicListModificationFlagL0(hasModification); 795 850 if(hasModification) … … 799 854 refPicListModification->setRefPicSetIdxL0(i, i); 800 855 } 856 801 857 if(m_aiNumRefIdx[REF_PIC_LIST_0] > numberOfRpsCurrTempList) 802 858 { 803 859 // repeat last ref pic when the number of active ref idx are more than RPS entries 804 860 for (Int i = numberOfRpsCurrTempList; i < m_aiNumRefIdx[REF_PIC_LIST_0]; i ++) 805 861 { … … 809 865 else 810 866 { 811 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 867 // number of ILRPs included into the reference picture list with the list modification 868 Int includeNumILRP = min( max(1, m_aiNumRefIdx[REF_PIC_LIST_0]-numberOfPocBeforeCurr), m_activeNumILRRefIdx); 869 870 for(Int i = includeNumILRP; i > 0; i-- ) 812 871 { 813 872 #if RPL_INIT_N0316_N0082 814 873 if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0]) 815 874 { 816 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr );875 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + includeNumILRP - i); 817 876 } 818 877 else 819 878 { 820 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr );879 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + includeNumILRP - i); 821 880 for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++) 822 881 { 823 refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx); 882 assert( j + includeNumILRP < numberOfRpsCurrTempList ); 883 refPicListModification->setRefPicSetIdxL0(j, j + includeNumILRP); 824 884 } 825 885 } … … 832 892 833 893 //set L1 inter-layer reference picture modification 834 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] == numberOfRpsCurrTempList) ? false : true; 835 #if N0147_IRAP_ALIGN_FLAG 894 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true; 836 895 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 ); 837 #endif838 896 839 897 refPicListModification->setRefPicListModificationFlagL1(hasModification); … … 854 912 else 855 913 { 856 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 914 Int includeNumILRP = min(m_aiNumRefIdx[REF_PIC_LIST_1], m_activeNumILRRefIdx); 915 916 for(Int i = includeNumILRP; i > 0; i-- ) 857 917 { 858 918 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i); … … 1088 1148 rpcPic->setCurrSliceIdx(0); 1089 1149 #if NO_CLRAS_OUTPUT_FLAG 1150 #if POC_RESET_IDC_ENCODER 1090 1151 if (noClrasOutputFlag) 1091 1152 { 1153 rpcPic->getSlice(0)->setReferenced(false); // all layers // TODO. This does not mark all layers 1154 } 1155 else 1156 { 1157 if (rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false); // only current layer 1158 } 1159 #else 1160 if (noClrasOutputFlag) 1161 { 1092 1162 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); // all layers 1093 1163 } … … 1096 1166 if (rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false); // only current layer 1097 1167 } 1168 #endif 1098 1169 #else 1099 1170 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); … … 1101 1172 iterPic++; 1102 1173 } 1174 #if POC_RESET_IDC_ENCODER 1175 this->getPic()->getSlice(0)->setReferenced(true); // Mark the current picture back as refererced. 1176 #endif 1103 1177 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1104 1178 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 1329 1403 } 1330 1404 1331 1405 #if POC_RESET_IDC_ENCODER 1406 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset) 1407 #else 1332 1408 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic) 1409 #endif 1333 1410 { 1334 1411 TComPic* rpcPic; … … 1419 1496 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1420 1497 { 1498 #if POC_RESET_IDC_ENCODER 1499 if( usePocBeforeReset ) 1500 { 1501 assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset()); 1502 } 1503 else 1504 { 1505 assert(rpcPic->getPOC() < this->getPOC()); 1506 } 1507 #else 1421 1508 assert(rpcPic->getPOC() < this->getPOC()); 1509 #endif 1422 1510 } 1423 1511 } … … 1437 1525 if(this->getAssociatedIRAPPOC() != rpcPic->getPOC()) 1438 1526 { 1527 #if POC_RESET_IDC_ENCODER 1528 if( usePocBeforeReset ) 1529 { 1530 assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset()); 1531 } 1532 else 1533 { 1534 assert(rpcPic->getPOC() < this->getPOC()); 1535 } 1536 #else 1439 1537 assert(rpcPic->getPOC() < this->getPOC()); 1538 #endif 1440 1539 } 1441 1540 } … … 1454 1553 // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB 1455 1554 // rpcPic would violate the constraint if it was a trailing picture 1555 #if POC_RESET_IDC_ENCODER 1556 if( usePocBeforeReset ) 1557 { 1558 assert(rpcPic->getPOC() <= this->getAssociatedIrapPocBeforeReset()); 1559 } 1560 else 1561 { 1562 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1563 } 1564 #else 1456 1565 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1566 #endif 1457 1567 } 1458 1568 } … … 1760 1870 if(isAvailable == 0) 1761 1871 { 1872 #if !UNAVAILABLE_PIC_BUGFIX 1762 1873 if (this->getPOC() + pReferencePictureSet->getDeltaPOC(i) >= pocRandomAccess) 1874 #endif 1763 1875 { 1764 1876 if(!pReferencePictureSet->getUsed(i) ) … … 1781 1893 } 1782 1894 #if ALLOW_RECOVERY_POINT_AS_RAP 1895 #if UNAVAILABLE_PIC_BUGFIX 1896 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1897 #else 1783 1898 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1899 #endif 1784 1900 { 1785 1901 atLeastOneUnabledByRecoveryPoint = 1; … … 2025 2141 if ( layerId == 0 ) 2026 2142 { 2027 retVal = sps->getPicWidthInLumaSamples(); 2143 if( vps->getAvcBaseLayerFlag() ) 2144 { 2145 retVal = vps->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples(); 2146 } 2147 else 2148 { 2149 retVal = sps->getPicWidthInLumaSamples(); 2150 } 2028 2151 } 2029 2152 else … … 2051 2174 if( layerId == 0 ) 2052 2175 { 2053 retVal = sps->getPicHeightInLumaSamples(); 2176 if( vps->getAvcBaseLayerFlag() ) 2177 { 2178 retVal = vps->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples(); 2179 } 2180 else 2181 { 2182 retVal = sps->getPicHeightInLumaSamples(); 2183 } 2054 2184 } 2055 2185 else … … 2207 2337 , m_bTemporalIdNestingFlag (false) 2208 2338 , m_numHrdParameters ( 0) 2209 #if !VPS_RENAME2210 , m_maxNuhReservedZeroLayerId ( 0)2211 #endif2212 2339 , m_hrdParameters (NULL) 2213 2340 , m_hrdOpSetIdx (NULL) 2214 2341 , m_cprmsPresentFlag (NULL) 2215 #if VPS_RENAME2216 2342 , m_maxLayerId (0) 2217 2343 , m_numLayerSets (0) 2218 #endif2219 2344 #if VPS_EXTN_OP_LAYER_SETS 2220 2345 , m_numOutputLayerSets (0) … … 2234 2359 #endif 2235 2360 #endif 2236 #if VPS_VUI_BITRATE_PICRATE2237 2361 , m_bitRatePresentVpsFlag (false) 2238 2362 , m_picRatePresentVpsFlag (false) 2239 #endif2240 2363 #if REPN_FORMAT_IN_VPS 2241 2364 #if Q0195_REP_FORMAT_CLEANUP … … 2311 2434 m_crossLayerPictureTypeAlignFlag = true; 2312 2435 #endif 2313 #if N0147_IRAP_ALIGN_FLAG2314 2436 m_crossLayerIrapAlignFlag = true; 2315 #endif2316 2437 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2317 2438 m_crossLayerAlignedIdrOnlyFlag = false; 2318 2439 #endif 2319 #if N0120_MAX_TID_REF_PRESENT_FLAG2320 2440 m_maxTidRefPresentFlag = true; 2321 #endif2322 2441 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 2323 2442 { … … 2336 2455 ::memset(m_loopFilterNotAcrossTilesFlag, 0, sizeof(m_loopFilterNotAcrossTilesFlag)); 2337 2456 #endif 2338 #if TILE_BOUNDARY_ALIGNED_FLAG2339 2457 ::memset(m_tileBoundariesAlignedFlag, 0, sizeof(m_tileBoundariesAlignedFlag)); 2340 #endif2341 2458 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2342 2459 m_wppNotInUseFlag = true; … … 2363 2480 } 2364 2481 #endif 2365 #if VPS_VUI_BITRATE_PICRATE2366 2482 ::memset(m_bitRatePresentFlag, 0, sizeof(m_bitRatePresentFlag)); 2367 2483 ::memset(m_picRatePresentFlag, 0, sizeof(m_picRatePresentFlag)); … … 2370 2486 ::memset(m_constPicRateIdc , 0, sizeof(m_constPicRateIdc) ); 2371 2487 ::memset(m_avgPicRate , 0, sizeof(m_avgPicRate) ); 2372 #endif2373 2488 #if REPN_FORMAT_IN_VPS 2374 2489 ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) ); … … 2485 2600 } 2486 2601 } 2487 #if TILE_BOUNDARY_ALIGNED_FLAG 2602 2488 2603 if (m_tilesNotInUseFlag) 2489 2604 { … … 2496 2611 } 2497 2612 } 2498 #endif 2499 } 2500 #endif 2613 } 2614 #endif 2615 2501 2616 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2502 2617 Void TComVPS::setWppNotInUseFlag(Bool x) … … 2526 2641 } 2527 2642 2528 Void TComVPS::setNumRefLayers(Int currLayerId) 2529 { 2643 Void TComVPS::setNumRefLayers() 2644 { 2645 memset( m_numberRefLayers, 0, sizeof( m_numberRefLayers ) ); 2646 2530 2647 for (Int i = 0; i < m_uiMaxLayers; i++) 2531 2648 { … … 2538 2655 } 2539 2656 } 2657 #endif 2658 2659 #if Q0078_ADD_LAYER_SETS 2660 Void TComVPS::setPredictedLayerIds() 2661 { 2662 for (UInt i = 0; i < getMaxLayers() - 1; i++) 2663 { 2664 UInt iNuhLId = getLayerIdInNuh(i); 2665 UInt predIdx = 0; 2666 for (UInt j = iNuhLId + 1; j < MAX_NUM_LAYER_IDS; j++) 2667 { 2668 if (getRecursiveRefLayerFlag(j, iNuhLId)) 2669 { 2670 setPredictedLayerId(i, predIdx, j); 2671 predIdx++; 2672 } 2673 } 2674 setNumPredictedLayers(iNuhLId, predIdx); 2675 } 2676 } 2677 2678 Void TComVPS::setTreePartitionLayerIdList() 2679 { 2680 Bool countedLayerIdxFlag[MAX_NUM_LAYER_IDS]; 2681 2682 for (UInt i = 0; i <= getMaxLayers() - 1; i++) 2683 { 2684 countedLayerIdxFlag[i] = false; 2685 } 2686 2687 Int numIndependentLayers = 0; 2688 2689 for (UInt i = 0; i <= getMaxLayers() - 1; i++) 2690 { 2691 UInt iNuhLId = getLayerIdInNuh(i); 2692 if (getNumDirectRefLayers(iNuhLId) == 0) 2693 { 2694 setTreePartitionLayerId(numIndependentLayers, 0, iNuhLId); 2695 setNumLayersInTreePartition(numIndependentLayers, 1); 2696 for (UInt j = 0; j < getNumPredictedLayers(iNuhLId); j++) 2697 { 2698 if (!countedLayerIdxFlag[getLayerIdInVps(iNuhLId)]) 2699 { 2700 setTreePartitionLayerId(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers), getPredictedLayerId(iNuhLId, j)); 2701 setNumLayersInTreePartition(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers) + 1); 2702 countedLayerIdxFlag[getLayerIdInVps(getPredictedLayerId(iNuhLId, j))] = true; 2703 } 2704 } 2705 numIndependentLayers++; 2706 } 2707 } 2708 2709 setNumIndependentLayers(numIndependentLayers); 2710 } 2711 2712 void TComVPS::setLayerIdIncludedFlagsForAddLayerSets() 2713 { 2714 for (UInt i = 0; i < getNumAddLayerSets(); i++) 2715 { 2716 for (UInt j = 1; j < getNumIndependentLayers(); j++) 2717 { 2718 Int layerNum = 0; 2719 Int lsIdx = getVpsNumLayerSetsMinus1() + 1 + i; 2720 for (Int layerId = 0; layerId < MAX_VPS_LAYER_ID_PLUS1; layerId++) 2721 { 2722 setLayerIdIncludedFlag(false, lsIdx, layerId); 2723 } 2724 for (Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++) 2725 { 2726 for (Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1(i, j); layerCnt++) 2727 { 2728 setLayerSetLayerIdList(lsIdx, layerNum, getTreePartitionLayerId(treeIdx, layerCnt)); 2729 setLayerIdIncludedFlag(true, lsIdx, getTreePartitionLayerId(treeIdx, layerCnt)); 2730 layerNum++; 2731 } 2732 } 2733 setNumLayersInIdList(lsIdx, layerNum); 2734 } 2735 } 2736 } 2737 2540 2738 #endif 2541 2739 … … 2701 2899 return -1; // Layer not found 2702 2900 } 2901 #endif 2703 2902 #if O0164_MULTI_LAYER_HRD 2704 2903 Void TComVPS::setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) … … 2780 2979 } 2781 2980 #endif 2981 #if RESOLUTION_BASED_DPB 2782 2982 // RepFormat Assignment operator 2783 2983 RepFormat& RepFormat::operator= (const RepFormat &other) … … 2851 3051 #if SVC_EXTENSION 2852 3052 , m_layerId ( 0 ) 3053 , m_extensionFlag ( false ) 2853 3054 , m_numScaledRefLayerOffsets ( 0 ) 2854 3055 #if REPN_FORMAT_IN_VPS … … 2905 3106 2906 3107 TimingInfo *timingInfo = vui->getTimingInfo(); 2907 #if TIMING_INFO_NONZERO_LAYERID_SPS2908 if( getLayerId()> 0 )3108 #if SVC_EXTENSION 3109 if( m_layerId > 0 ) 2909 3110 { 2910 3111 timingInfo->setTimingInfoPresentFlag( false ); 3112 return; 3113 } 3114 #endif 3115 3116 timingInfo->setTimingInfoPresentFlag( true ); 3117 switch( frameRate ) 3118 { 3119 case 24: 3120 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 3121 break; 3122 case 25: 3123 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 3124 break; 3125 case 30: 3126 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 3127 break; 3128 case 50: 3129 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 3130 break; 3131 case 60: 3132 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 3133 break; 3134 default: 3135 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 3136 break; 3137 } 3138 3139 Bool rateCnt = ( bitRate > 0 ); 3140 hrd->setNalHrdParametersPresentFlag( rateCnt ); 3141 hrd->setVclHrdParametersPresentFlag( rateCnt ); 3142 3143 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 3144 3145 if( hrd->getSubPicCpbParamsPresentFlag() ) 3146 { 3147 hrd->setTickDivisorMinus2( 100 - 2 ); // 3148 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 3149 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 3150 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2911 3151 } 2912 3152 else 2913 3153 { 2914 #endif 2915 timingInfo->setTimingInfoPresentFlag( true ); 2916 switch( frameRate ) 2917 { 2918 case 24: 2919 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 2920 break; 2921 case 25: 2922 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 2923 break; 2924 case 30: 2925 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 2926 break; 2927 case 50: 2928 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 2929 break; 2930 case 60: 2931 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 2932 break; 2933 default: 2934 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 2935 break; 2936 } 2937 2938 Bool rateCnt = ( bitRate > 0 ); 2939 hrd->setNalHrdParametersPresentFlag( rateCnt ); 2940 hrd->setVclHrdParametersPresentFlag( rateCnt ); 2941 2942 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 2943 2944 if( hrd->getSubPicCpbParamsPresentFlag() ) 2945 { 2946 hrd->setTickDivisorMinus2( 100 - 2 ); // 2947 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 2948 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 2949 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2950 } 2951 else 2952 { 2953 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 2954 } 2955 2956 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 2957 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2958 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2959 2960 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 2961 if( randomAccess ) 2962 { 2963 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 2964 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 2965 } 2966 else 2967 { 2968 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 2969 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 2970 } 2971 2972 /* 2973 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 2974 */ 2975 Int i, j; 2976 UInt birateValue, cpbSizeValue; 2977 UInt ducpbSizeValue; 2978 UInt duBitRateValue = 0; 2979 2980 for( i = 0; i < MAX_TLAYER; i ++ ) 2981 { 2982 hrd->setFixedPicRateFlag( i, 1 ); 2983 hrd->setPicDurationInTcMinus1( i, 0 ); 2984 hrd->setLowDelayHrdFlag( i, 0 ); 2985 hrd->setCpbCntMinus1( i, 0 ); 2986 2987 birateValue = bitRate; 2988 cpbSizeValue = bitRate; // 1 second 2989 ducpbSizeValue = bitRate/numDU; 2990 duBitRateValue = bitRate; 2991 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 2992 { 2993 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 2994 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 2995 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 2996 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 2997 2998 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 2999 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 3000 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 3001 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 3002 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 3003 } 3004 } 3005 #if TIMING_INFO_NONZERO_LAYERID_SPS 3006 } 3007 #endif 3154 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 3155 } 3156 3157 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 3158 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 3159 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 3160 3161 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 3162 if( randomAccess ) 3163 { 3164 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 3165 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 3166 } 3167 else 3168 { 3169 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 3170 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 3171 } 3172 3173 /* 3174 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 3175 */ 3176 Int i, j; 3177 UInt birateValue, cpbSizeValue; 3178 UInt ducpbSizeValue; 3179 UInt duBitRateValue = 0; 3180 3181 for( i = 0; i < MAX_TLAYER; i ++ ) 3182 { 3183 hrd->setFixedPicRateFlag( i, 1 ); 3184 hrd->setPicDurationInTcMinus1( i, 0 ); 3185 hrd->setLowDelayHrdFlag( i, 0 ); 3186 hrd->setCpbCntMinus1( i, 0 ); 3187 3188 birateValue = bitRate; 3189 cpbSizeValue = bitRate; // 1 second 3190 ducpbSizeValue = bitRate/numDU; 3191 duBitRateValue = bitRate; 3192 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 3193 { 3194 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 3195 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 3196 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 3197 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 3198 3199 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 3200 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 3201 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 3202 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 3203 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 3204 } 3205 } 3008 3206 } 3009 3207 const Int TComSPS::m_winUnitX[]={1,2,2,1}; … … 3061 3259 , m_listsModificationPresentFlag( 0) 3062 3260 , m_numExtraSliceHeaderBits(0) 3261 #if SVC_EXTENSION 3262 , m_extensionFlag(false) 3063 3263 #if SCALINGLIST_INFERRING 3264 , m_layerId(0) 3064 3265 , m_inferScalingListFlag ( false ) 3065 3266 , m_scalingListRefLayerId ( 0 ) … … 3068 3269 , m_pocResetInfoPresentFlag (false) 3069 3270 #endif 3271 #if Q0048_CGS_3D_ASYMLUT 3272 , m_nCGSFlag(0) 3273 , m_nCGSOutputBitDepthY(0) 3274 , m_nCGSOutputBitDepthC(0) 3275 #endif 3276 #endif //SVC_EXTENSION 3070 3277 { 3071 3278 m_scalingList = new TComScalingList; … … 3698 3905 return false; 3699 3906 } 3700 #if POC_RESET_FLAG 3907 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER 3908 #if POC_RESET_IDC_DECODER 3909 TComPic* pic = xGetRefPic( rcListPic, getPOC() ); 3910 #else 3701 3911 TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC ); 3912 #endif 3702 3913 3703 3914 if( pic ) … … 3712 3923 return true; 3713 3924 #else 3714 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3925 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3926 return true; 3715 3927 #endif 3716 3928 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r713 r815 140 140 141 141 Void create (Int numberOfEntries); 142 Void destroy 142 Void destroy(); 143 143 144 144 … … 469 469 470 470 UInt m_numHrdParameters; 471 #if ! VPS_RENAME471 #if !SVC_EXTENSION 472 472 UInt m_maxNuhReservedZeroLayerId; 473 473 #endif … … 484 484 #if SVC_EXTENSION 485 485 #if DERIVE_LAYER_ID_LIST_VARIABLES 486 #if Q0078_ADD_LAYER_SETS 487 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 488 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 489 #else 486 490 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 487 491 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 492 #endif 488 493 #endif 489 494 #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED … … 492 497 #endif 493 498 #endif 494 #if VPS_RENAME495 499 UInt m_maxLayerId; 496 500 UInt m_numLayerSets; 501 #if Q0078_ADD_LAYER_SETS 502 UInt m_vpsNumLayerSetsMinus1; 503 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 504 #else 497 505 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 498 506 #endif … … 514 522 UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS 515 523 #endif 516 #if ILP_SSH_SIG 524 #if BITRATE_PICRATE_SIGNALLING 525 #if Q0078_ADD_LAYER_SETS 526 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 527 #else 528 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1]; 529 #endif 530 #endif 531 517 532 Bool m_ilpSshSignalingEnabledFlag; 518 #endif519 533 #if VPS_EXTN_PROFILE_INFO 520 534 // Profile-tier-level signalling related … … 529 543 // Target output layer signalling related 530 544 UInt m_numOutputLayerSets; 545 #if Q0078_ADD_LAYER_SETS 546 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 547 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 548 #else 531 549 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1]; 532 550 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 551 #endif 533 552 #endif 534 553 #if VPS_EXTN_DIRECT_REF_LAYERS … … 565 584 Bool m_crossLayerPictureTypeAlignFlag; 566 585 #endif 567 #if N0147_IRAP_ALIGN_FLAG568 586 Bool m_crossLayerIrapAlignFlag; 569 #endif570 587 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 571 588 Bool m_crossLayerAlignedIdrOnlyFlag; … … 576 593 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 577 594 #endif 578 #if N0120_MAX_TID_REF_PRESENT_FLAG579 595 Bool m_maxTidRefPresentFlag; 580 #endif581 596 #if VPS_TSLAYERS 582 597 Bool m_maxTSLayersPresentFlag; … … 594 609 Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_ID_PLUS1]; 595 610 #endif 596 #if TILE_BOUNDARY_ALIGNED_FLAG597 611 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 598 #endif599 612 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 600 613 Bool m_wppNotInUseFlag; … … 616 629 Int m_vpsTransChar[16]; 617 630 Int m_vpsMatCoeff[16]; 618 #endif 619 #if VPS_VUI_BITRATE_PICRATE 631 #endif 632 620 633 Bool m_bitRatePresentVpsFlag; 621 634 Bool m_picRatePresentVpsFlag; … … 626 639 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 627 640 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 628 #endif629 641 630 642 #if P0312_VERT_PHASE_ADJ … … 633 645 634 646 #if P0300_ALT_OUTPUT_LAYER_FLAG 647 #if Q0078_ADD_LAYER_SETS 648 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 649 #else 635 650 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1]; 651 #endif 636 652 #else 637 653 #if O0153_ALT_OUTPUT_LAYER_FLAG … … 661 677 Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer 662 678 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 679 #endif 680 #if Q0078_ADD_LAYER_SETS 681 Int m_numAddLayerSets; 682 UInt m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; 683 UInt m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 684 UInt m_numPredictedLayers[MAX_NUM_LAYER_IDS]; 685 Int m_numIndependentLayers; 686 Int m_numLayersInTreePartition[MAX_NUM_LAYER_IDS]; 687 UInt m_treePartitionLayerIdList[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 663 688 #endif 664 689 #if SPS_DPB_PARAMS … … 675 700 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 676 701 #if CHANGE_NUMSUBDPB_IDX 702 #if Q0078_ADD_LAYER_SETS 703 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 704 #else 677 705 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1]; 706 #endif 678 707 #else 679 708 Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1]; … … 735 764 } 736 765 #endif 766 #if HRD_BPB 767 Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl) 768 { 769 return m_bspHrd->getCpbCntMinus1(sl); 770 } 771 #endif 737 772 738 773 TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } … … 798 833 Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } 799 834 Int getNumRefLayers(Int currLayerId) { return m_numberRefLayers[currLayerId]; } 800 Void setNumRefLayers(Int currLayerId); 801 #endif 802 #if VPS_RENAME 803 UInt getMaxLayerId() { return m_maxLayerId; } 804 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 805 835 Void setNumRefLayers(); 836 #endif 837 #if Q0078_ADD_LAYER_SETS 838 void setLayerIdIncludedFlagsForAddLayerSets(); 839 UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } 840 Void setVpsNumLayerSetsMinus1(UInt x) { m_vpsNumLayerSetsMinus1 = x; } 841 UInt getNumAddLayerSets() { return m_numAddLayerSets; } 842 Void setNumAddLayerSets(UInt x) { m_numAddLayerSets = x; } 843 UInt getHighestLayerIdxPlus1(UInt set, UInt idx) { return m_highestLayerIdxPlus1[set][idx]; } 844 Void setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } 845 Void setPredictedLayerIds(); 846 UInt getPredictedLayerId(UInt layerIdx, UInt predIdx) { return m_predictedLayerId[layerIdx][predIdx]; } 847 Void setPredictedLayerId(UInt layerIdx, UInt predIdx, UInt x) { m_predictedLayerId[layerIdx][predIdx] = x; } 848 UInt getNumPredictedLayers(UInt layerId) { return m_numPredictedLayers[layerId]; } 849 Void setNumPredictedLayers(UInt layerId, UInt x) { m_numPredictedLayers[layerId] = x; } 850 Void setTreePartitionLayerIdList(); 851 Int getNumIndependentLayers() { return m_numIndependentLayers; } 852 Void setNumIndependentLayers(Int x) { m_numIndependentLayers = x; } 853 Int getNumLayersInTreePartition(Int idx) { return m_numLayersInTreePartition[idx]; } 854 Void setNumLayersInTreePartition(Int idx, Int x) { m_numLayersInTreePartition[idx] = x; } 855 UInt getTreePartitionLayerId(Int idx, Int layerIdx) { return m_treePartitionLayerIdList[idx][layerIdx]; } 856 Void setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } 857 #endif 858 UInt getMaxLayerId() { return m_maxLayerId; } 859 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 806 860 UInt getNumLayerSets() { return m_numLayerSets; } 807 861 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 808 #endif809 862 #if VPS_EXTN_MASK_AND_DIM_INFO 810 863 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } … … 835 888 Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } 836 889 #endif 837 #if ILP_SSH_SIG 838 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 839 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 840 #endif 890 #if BITRATE_PICRATE_SIGNALLING 891 UInt getMaxSLayersInLayerSetMinus1(Int ls) { return m_maxSLInLayerSetMinus1[ls]; } 892 Void setMaxSLayersInLayerSetMinus1(Int ls, Int x) { m_maxSLInLayerSetMinus1[ls] = x; } 893 #endif 894 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 895 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 841 896 #if VPS_EXTN_PROFILE_INFO 842 897 Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } … … 883 938 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 884 939 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } 940 Bool isSamplePredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 1 ) ? true : false; } 941 Bool isMotionPredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 2 ) >> 1 ) ? true : false; } 885 942 #endif 886 943 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } … … 923 980 Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } 924 981 #endif 925 #if N0147_IRAP_ALIGN_FLAG926 982 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } 927 983 Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } 928 #endif929 984 #if O0225_MAX_TID_FOR_REF_LAYERS 930 985 UInt getMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId) { return m_maxTidIlRefPicsPlus1[layerId][refLayerId]; } … … 934 989 Void setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer; } 935 990 #endif 936 #if N0120_MAX_TID_REF_PRESENT_FLAG937 991 Bool getMaxTidRefPresentFlag() { return m_maxTidRefPresentFlag ;} 938 992 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;} 939 #endif940 993 #if VPS_TSLAYERS 941 994 Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag ;} … … 960 1013 Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } 961 1014 #endif 962 #if TILE_BOUNDARY_ALIGNED_FLAG963 1015 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } 964 1016 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 965 #endif966 1017 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 967 1018 Bool getWppNotInUseFlag() { return m_wppNotInUseFlag; } … … 1001 1052 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } 1002 1053 #endif 1003 #if VPS_VUI_BITRATE_PICRATE1004 1054 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } 1005 1055 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } … … 1021 1071 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 1022 1072 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 1023 #endif1024 1073 #if O0164_MULTI_LAYER_HRD 1025 1074 Bool getVpsVuiBspHrdPresentFlag() { return m_vpsVuiBspHrdPresentFlag; } … … 1463 1512 #if SVC_EXTENSION 1464 1513 UInt m_layerId; 1514 Bool m_extensionFlag; 1465 1515 UInt m_numScaledRefLayerOffsets; 1466 1516 #if P0312_VERT_PHASE_ADJ … … 1621 1671 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1622 1672 UInt getLayerId() { return m_layerId; } 1673 Int getExtensionFlag() { return m_extensionFlag; } 1674 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1623 1675 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1624 1676 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } … … 1736 1788 1737 1789 #if SVC_EXTENSION 1790 Bool m_extensionFlag; 1738 1791 #if SCALINGLIST_INFERRING 1739 1792 UInt m_layerId; … … 1862 1915 1863 1916 #if SCALINGLIST_INFERRING 1864 UInt getLayerId() { return m_layerId; }1865 Void setLayerId( UInt layerId ) { m_layerId = layerId; }1866 Bool getInferScalingListFlag() { return m_inferScalingListFlag; }1867 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; }1868 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; }1869 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; }1870 #endif1871 1872 #if SCALINGLIST_INFERRING1873 1917 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1874 1918 #else … … 1886 1930 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1887 1931 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1932 #if SVC_EXTENSION 1933 Int getExtensionFlag() { return m_extensionFlag; } 1934 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1935 #if SCALINGLIST_INFERRING 1936 UInt getLayerId() { return m_layerId; } 1937 Void setLayerId( UInt layerId ) { m_layerId = layerId; } 1938 Bool getInferScalingListFlag() { return m_inferScalingListFlag; } 1939 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1940 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1941 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1942 #endif 1888 1943 #if POC_RESET_IDC 1889 1944 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } … … 1898 1953 Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n; } 1899 1954 #endif 1955 #endif //SVC_EXTENSION 1900 1956 }; 1901 1957 … … 1935 1991 Int m_iLastIDR; 1936 1992 Int m_iAssociatedIRAP; 1993 #if POC_RESET_IDC_ENCODER 1994 Int m_associatedIrapPocBeforeReset; 1995 #endif 1996 1937 1997 NalUnitType m_iAssociatedIRAPType; 1938 1998 static Int m_prevTid0POC; … … 2061 2121 Bool m_pocMsbValPresentFlag; 2062 2122 #endif 2123 #if POC_RESET_IDC_ENCODER 2124 Int m_pocValueBeforeReset; 2125 #endif 2126 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 2127 Int m_picOrderCntLsb; 2128 #endif 2063 2129 #if Q0048_CGS_3D_ASYMLUT 2064 2130 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream … … 2106 2172 Void adjustPrevTid0POC (Int adj) { m_prevTid0POC=m_prevTid0POC-adj; } 2107 2173 #endif 2174 #if POC_RESET_IDC_DECODER 2175 Void setPrevTid0POC( Int x ) { m_prevTid0POC = x; } 2176 #endif 2177 2108 2178 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 2109 2179 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } … … 2111 2181 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 2112 2182 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 2183 #if POC_RESET_IDC_ENCODER 2184 Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; } 2185 Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset; } 2186 #endif 2187 2113 2188 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 2114 2189 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } … … 2220 2295 Void setTLayerInfo( UInt uiTLayer ); 2221 2296 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 2297 #if POC_RESET_IDC_ENCODER 2298 Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false); 2299 #else 2222 2300 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 2301 #endif 2223 2302 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 2224 2303 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 2418 2497 Bool getCraPicFlag (); 2419 2498 #endif 2499 #if POC_RESET_IDC_DECODER 2500 Bool getRaslPicFlag (); 2501 Bool getRadlPicFlag (); 2502 #endif 2503 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 2504 Int getPicOrderCntLsb() { return m_picOrderCntLsb; } 2505 Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } 2506 #endif 2507 2508 #if POC_RESET_IDC_ENCODER 2509 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 2510 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 2511 Void decrementRefPocValues(Int const decrementValue); 2512 Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); 2513 #endif 2514 2420 2515 2421 2516 #endif //SVC_EXTENSION … … 2472 2567 } 2473 2568 2569 #if Q0078_ADD_LAYER_SETS 2570 Void removePS(Int psId) 2571 { 2572 assert(psId < m_maxId); 2573 if (m_paramsetMap.find(psId) != m_paramsetMap.end()) 2574 { 2575 m_paramsetMap.erase(psId); 2576 } 2577 } 2578 #endif 2579 2580 2474 2581 private: 2475 2582 std::map<Int,T *> m_paramsetMap; … … 2494 2601 TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; 2495 2602 TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; 2603 #if Q0078_ADD_LAYER_SETS 2604 Void removeSPS(Int spsId) { m_spsMap.removePS(spsId); }; 2605 #endif 2496 2606 2497 2607 //! store picture parameter set and take ownership of it … … 2500 2610 TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; 2501 2611 TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; 2612 #if Q0078_ADD_LAYER_SETS 2613 Void removePPS(Int ppsId) { m_ppsMap.removePS(ppsId); }; 2614 #endif 2502 2615 2503 2616 //! activate a SPS from a active parameter sets SEI message -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r713 r815 1 1 #include "TypeDef.h" 2 #if SVC_EXTENSION 2 3 #include "TComUpsampleFilter.h" 3 #include "TypeDef.h"4 5 #if SVC_UPSAMPLING6 #define CNU -1 ///< Coefficients Not Used7 4 8 5 const Int TComUpsampleFilter::m_lumaFixedFilter[16][NTAPS_US_LUMA] = 9 6 { 10 { 0, 0, 0, 64, 0, 0, 0, 0}, // 11 #if ARBITRARY_SPATIAL_RATIO 12 { 0, 1, -3, 63, 4, -2, 1, 0}, 13 { -1, 2, -5, 62, 8, -3, 1, 0}, 14 { -1, 3, -8, 60, 13, -4, 1, 0}, 15 { -1, 4,-10, 58, 17, -5, 1, 0}, 16 #else 17 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 18 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 23 #if ARBITRARY_SPATIAL_RATIO 24 { -1, 3, -9, 47, 31, -10, 4, -1}, 25 { -1, 4, -11, 45, 34, -10, 4, -1}, 26 #else 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 29 #endif 30 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 31 #if ARBITRARY_SPATIAL_RATIO 32 { -1, 4, -10, 34, 45, -11, 4, -1}, 33 { -1, 4, -10, 31, 47, -9, 3, -1}, 34 #else 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 37 #endif 38 { -1, 3, -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5 39 #if ARBITRARY_SPATIAL_RATIO 40 { 0, 1, -5, 17, 58, -10, 4, -1}, 41 { 0, 1, -4, 13, 60, -8, 3, -1}, 42 { 0, 1, -3, 8, 62, -5, 2, -1}, 43 { 0, 1, -2, 4, 63, -3, 1, 0} 44 #else 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 49 #endif 7 { 0, 0, 0, 64, 0, 0, 0, 0 }, 8 { 0, 1, -3, 63, 4, -2, 1, 0 }, 9 { -1, 2, -5, 62, 8, -3, 1, 0 }, 10 { -1, 3, -8, 60, 13, -4, 1, 0 }, 11 { -1, 4, -10, 58, 17, -5, 1, 0 }, 12 { -1, 4, -11, 52, 26, -8, 3, -1 }, // <-> actual phase shift 1/3, used for spatial scalability x1.5 13 { -1, 3, -9, 47, 31, -10, 4, -1 }, 14 { -1, 4, -11, 45, 34, -10, 4, -1 }, 15 { -1, 4, -11, 40, 40, -11, 4, -1 }, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 16 { -1, 4, -10, 34, 45, -11, 4, -1 }, 17 { -1, 4, -10, 31, 47, -9, 3, -1 }, 18 { -1, 3, -8, 26, 52, -11, 4, -1 }, // <-> actual phase shift 2/3, used for spatial scalability x1.5 19 { 0, 1, -5, 17, 58, -10, 4, -1 }, 20 { 0, 1, -4, 13, 60, -8, 3, -1 }, 21 { 0, 1, -3, 8, 62, -5, 2, -1 }, 22 { 0, 1, -2, 4, 63, -3, 1, 0 } 50 23 }; 51 24 52 25 const Int TComUpsampleFilter::m_chromaFixedFilter[16][NTAPS_US_CHROMA] = 53 26 { 54 { 0, 64, 0, 0},// 55 #if ARBITRARY_SPATIAL_RATIO 56 { -2, 62, 4, 0}, 57 { -2, 58, 10, -2}, 58 { -4, 56, 14, -2}, 59 #else 60 {CNU,CNU,CNU,CNU},// 61 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 63 #endif 64 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 67 #if ARBITRARY_SPATIAL_RATIO 68 { -4, 42, 30, -4}, 69 #else 70 {CNU,CNU,CNU,CNU},// 71 #endif 72 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 73 { -4, 30, 42, -4},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 74 #if ARBITRARY_SPATIAL_RATIO 75 { -4, 28, 46, -6}, 76 #else 77 {CNU,CNU,CNU,CNU},// 78 #endif 79 { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5 80 #if ARBITRARY_SPATIAL_RATIO 81 {-2, 16, 54, -4}, 82 {-2, 14, 56, -4}, 83 #else 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 88 { 0, 4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 27 { 0, 64, 0, 0 }, 28 { -2, 62, 4, 0 }, 29 { -2, 58, 10, -2 }, 30 { -4, 56, 14, -2 }, 31 { -4, 54, 16, -2 }, // <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 32 { -6, 52, 20, -2 }, // <-> actual phase shift 1/3, used for spatial scalability x1.5 33 { -6, 46, 28, -4 }, // <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 34 { -4, 42, 30, -4 }, 35 { -4, 36, 36, -4 }, // <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 36 { -4, 30, 42, -4 }, // <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 37 { -4, 28, 46, -6 }, 38 { -2, 20, 52, -6 }, // <-> actual phase shift 2/3, used for spatial scalability x1.5 39 { -2, 16, 54, -4 }, 40 { -2, 14, 56, -4 }, 41 { -2, 10, 58, -2 }, // <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 42 { 0, 4, 62, -2 } // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 89 43 }; 90 44 … … 260 214 } 261 215 262 #if ARBITRARY_SPATIAL_RATIO263 216 assert ( widthEL >= widthBL ); 264 217 assert ( heightEL >= heightBL ); 265 #else266 assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );267 assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );268 #endif269 218 270 219 pcBasePic->setBorderExtension(false); … … 298 247 #endif 299 248 300 #if ROUNDING_OFFSET301 249 Int addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 302 250 Int addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 303 #else304 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );305 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );306 #endif307 251 308 252 #if Q0120_PHASE_CALCULATION … … 333 277 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 334 278 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 335 #if N0214_INTERMEDIATE_BUFFER_16BITS336 279 #if O0194_JOINT_US_BITSHIFT 337 280 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 345 288 #else 346 289 Int shift1 = g_bitDepthY - 8; 347 #endif348 290 #endif 349 291 … … 362 304 for( j = 0; j < heightBL ; j++ ) 363 305 { 364 #if N0214_INTERMEDIATE_BUFFER_16BITS365 306 *piDstY = sumLumaHor(piSrcY, coeff) >> shift1; 366 #else367 *piDstY = sumLumaHor(piSrcY, coeff);368 #endif369 307 piSrcY += strideBL; 370 308 piDstY += strideEL; … … 378 316 pcTempPic->setHeight(heightEL); 379 317 380 #if N0214_INTERMEDIATE_BUFFER_16BITS381 318 #if O0194_JOINT_US_BITSHIFT 382 319 Int nShift = 20 - g_bitDepthYLayer[currLayerId]; 383 320 #else 384 321 Int nShift = US_FILTER_PREC*2 - shift1; 385 #endif386 #else387 const Int nShift = US_FILTER_PREC*2;388 322 #endif 389 323 Int iOffset = 1 << (nShift - 1); … … 472 406 #endif 473 407 474 #if ROUNDING_OFFSET475 408 addX = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 476 409 addY = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 477 #else478 addX = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );479 addY = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );480 #endif481 410 482 411 #if Q0120_PHASE_CALCULATION … … 502 431 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 503 432 504 #if N0214_INTERMEDIATE_BUFFER_16BITS505 433 #if O0194_JOINT_US_BITSHIFT 506 434 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 514 442 #else 515 443 shift1 = g_bitDepthC - 8; 516 #endif517 444 #endif 518 445 … … 533 460 for( j = 0; j < heightBL ; j++ ) 534 461 { 535 #if N0214_INTERMEDIATE_BUFFER_16BITS536 462 *piDstU = sumChromaHor(piSrcU, coeff) >> shift1; 537 463 *piDstV = sumChromaHor(piSrcV, coeff) >> shift1; 538 #else539 *piDstU = sumChromaHor(piSrcU, coeff);540 *piDstV = sumChromaHor(piSrcV, coeff);541 #endif542 464 543 465 piSrcU += strideBL; … … 554 476 pcTempPic->setHeight(heightEL << 1); 555 477 556 #if N0214_INTERMEDIATE_BUFFER_16BITS557 478 #if O0194_JOINT_US_BITSHIFT 558 479 nShift = 20 - g_bitDepthCLayer[currLayerId]; … … 561 482 #endif 562 483 iOffset = 1 << (nShift - 1); 563 #endif564 484 565 485 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) -
trunk/source/Lib/TLibCommon/TypeDef.h
r713 r815 41 41 #define SVC_EXTENSION 1 42 42 43 #define SYNTAX_BYTES 10 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 44 #if SVC_EXTENSION 45 45 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle 46 46 47 47 #define VPS_VUI_OFFSET 1 ///< N0085: Signal VPS VUI offset in the VPS extension 48 #define RANDOM_ACCESS_SEI_FIX 149 48 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 50 49 51 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 50 #define Q0108_TSA_STSA 0 ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers 51 #define Q0177_SPS_TEMP_NESTING_FIX 1 ///< JCTVC-Q0177; Fix the inference value of sps_temporal_id_nesting_flag when it is not present 52 #define Q0177_EOS_CHECKS 1 ///< JCTVC-Q0177; Put checks on handling EOS 53 #define Q0142_POC_LSB_NOT_PRESENT 1 ///< JCTVC-Q0142; Add constraint checking on the value of poc_reset_idc and poc_lsb_val 54 #define Q0146_SSH_EXT_DATA_BIT 1 ///< JCTVC-Q0146; Bug-fix -- the SSH_EXT_DATA_BIT can have any value -- not required to be 1 55 56 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 52 57 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 53 58 #if P0312_VERT_PHASE_ADJ … … 62 67 #define VPS_EXTN_UEV_CODING 1 ///< JCTVC-P0306: Code some syntax elements as ue(v), and remove some syntax elements that duplicate behaviour 63 68 #define CHANGE_NUMSUBDPB_IDX 1 ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec 64 #define RESOLUTION_BASED_DPB 1 ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS 69 #define RESOLUTION_BASED_DPB 0 ///< JCTVC-Q0154 - remove sharing of sub-DPB across layers 70 ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS 65 71 #define ALIGNED_BUMPING 1 ///< JCTVC-P0192: Align bumping of pictures in an AU 66 #define MAX_SUBDPBS MAX_LAYERS67 #define SUB_BITSTREAM_PROPERTY_SEI 1 ///< JCTVC-P0204: Sub-bitstream property SEI message68 #if SUB_BITSTREAM_PROPERTY_SEI69 #define MAX_SUB_STREAMS 102470 #endif71 72 #define O0109_O0199_FLAGS_TO_VUI 1 ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui 72 73 #define O0109_VIEW_ID_LEN 1 ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews … … 77 78 #endif 78 79 79 #define P0295_DEFAULT_OUT_LAYER_IDC 1 ///< JCTVC-P0295: modifify default_one_target_output_layer_idc to default_ target_output_layer_idc80 #define P0295_DEFAULT_OUT_LAYER_IDC 1 ///< JCTVC-P0295: modifify default_one_target_output_layer_idc to default_output_layer_idc 80 81 #define O0109_DEFAULT_ONE_OUT_LAYER_IDC 1 ///< JCTVC-O0109: default_one_target_output_layer_flag to default_one_target_output_layer_idc 81 82 #define O0109_MOVE_VPS_VUI_FLAG 1 ///< JCTVC-O0109: move vps_vui_present_flag before vps_vui_offset … … 84 85 85 86 #define O0164_MULTI_LAYER_HRD 1 ///< JCTVC-O0164: Multi-layer HRD operation 86 #define Q0 074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping87 #define Q0182_MULTI_LAYER_HRD_UPDATE 1 ///< JCTVC-Q0182: On bitstream partition buffering 87 88 88 89 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) … … 92 93 #define Q0048_CGS_3D_ASYMLUT 1 ///< JCTVC-Q0048: Colour gamut scalability with look-up table 93 94 #if Q0048_CGS_3D_ASYMLUT 95 #define CGS_GCC_NO_VECTORIZATION 1 94 96 #define O0194_WEIGHTED_PREDICTION_CGS 0 95 97 #else 96 98 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 97 99 #endif 98 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 99 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 100 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 100 #define POC_RESET_FLAG 0 ///< JCTVC-N0244: POC reset flag for layer pictures. 101 101 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG 102 102 #if POC_RESET_IDC 103 103 #define POC_RESET_IDC_SIGNALLING 1 ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements 104 #endif 104 #define POC_RESET_IDC_ENCODER 1 ///< JCTVC-P0041: Include support of enabling POC reset at the encoder 105 #define POC_RESET_IDC_DECODER 1 ///< JCTVC-P0041: Include support of enabling POC reset at the decoder 106 #define ALIGN_IRAP_BUGFIX 1 107 #define UNAVAILABLE_PIC_BUGFIX 1 108 #endif 109 #define POC_MSB_VAL_PRESENT_FLAG_SEM 1 ///< JCTVC-Q0146: Inference of poc_msb_val_present_flag 110 #define POC_RESET_INFO_INFERENCE 1 ///< JCTVC-Q0146: Infer the value of poc_reset_info_present_flag when not present 105 111 #define NO_OUTPUT_OF_PRIOR_PICS 1 ///< Use no_output_of_prior_pics_flag 106 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU.107 112 #define REPN_FORMAT_IN_VPS 1 ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS 108 113 #if REPN_FORMAT_IN_VPS 109 114 #define REPN_FORMAT_CONTROL_FLAG 1 ///< JCTVC-O0179: Add control flag in representation format to control sending of chroma and bitdepth parameters 110 115 #endif 111 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS112 116 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 113 117 114 118 #define SCALINGLIST_INFERRING 1 ///< JCTVC-N0371: inter-layer scaling list 115 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure116 #if SPS_EXTENSION117 119 #define O0142_CONDITIONAL_SPS_EXTENSION 1 ///< JCTVC-O0142: Conditional SPS extension 118 #endif119 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth120 #define LAYER_CTB 0 ///< enable layer-specific CTB structure121 120 #if POC_RESET_FLAG 122 121 #define PREVTID0_POC_RESET 1 ///< JCTVC-O0117 Modification of the PicOrderCntVal of prevTid0Pic … … 124 123 #endif 125 124 126 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header127 #if ILP_SSH_SIG128 #define ILP_SSH_SIG_FIX 1 ///< fix for SHM ticket #5129 #endif130 #define SPL_FLG_CHK 1 ///< JCTVC-N0195 proposal 5, JCTVC-N0085: constrain sum of lengths to be less than or equal to 6131 #define ILP_NUM_REF_CHK 1 ///< JCTVC-N0195 proposal 1, JCTVC-N0081, JCTVC-N0154, JCTVC-N0217: a condition on signaling inter_layer_pred_layer_idc[ i ], to avoid sending when NumDirectRefLayers equals NumActiveRefLayerPics, and instead infer values132 133 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS134 #define VPS_EXTNS 1 ///< Include function structure for VPS extensions135 #if VPS_EXTNS136 125 #define VPS_EXTN_MASK_AND_DIM_INFO 1 ///< Include avc_base_layer_flag, splitting_flag, scalability mask and dimension related info 137 126 #if VPS_EXTN_MASK_AND_DIM_INFO … … 142 131 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 143 132 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 144 #define VPS_VUI 1 ///< Include function structure for VPS VUI 145 146 #if VPS_VUI 133 147 134 #define VPS_VUI_TILES_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 148 135 #define VPS_VUI_WPP_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 149 #define TILE_BOUNDARY_ALIGNED_FLAG 1 ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment150 136 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 151 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI152 137 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 153 138 #define HIGHER_LAYER_IRAP_SKIP_FLAG 1 ///< JCTVC-O0199: Indication that higher layer IRAP picture uses skip blocks only … … 158 143 #endif 159 144 #define P0182_VPS_VUI_PS_FLAG 1 ///< JCTVC-P0182, add base_layer_parameter_set_compatibility_flag 160 #endif //VPS_VUI161 162 #endif163 145 164 146 #define P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED 1 ///< JCTVC-P0125 -- Keep it as a reserved FFFF value --- The following two macros (VPS_EXTN_OFFSET & VPS_EXTN_OFFSET_CALC) will have no effect when this macro is set to 1. … … 169 151 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing 170 152 171 #define SVC_UPSAMPLING 1 ///< upsampling filters172 #define ROUNDING_OFFSET 1 ///< JCTVC-N0111: upsampling rounding offset using scalling factors173 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits174 #define ARBITRARY_SPATIAL_RATIO 1 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio175 176 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization)177 178 153 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 179 154 #if AVC_BASE … … 181 156 #endif 182 157 183 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME)184 #define ENCODER_FAST_MODE 1 ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.185 158 #define REF_IDX_MFM 1 ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture 186 159 #define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1 ///< Allow maximum of one resampling process for direct reference layers 187 160 #define MOTION_RESAMPLING_CONSTRAINT 1 ///< JCTVC-N0108: Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction. 188 #define EARLY_REF_PIC_MARKING 1 ///< Decoded picture marking of sub-layer non-reference pictures 189 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag 190 #define N0120_MAX_TID_REF_CFG 1 ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting) 161 #define EARLY_REF_PIC_MARKING 0 ///< Valencia meeting - remove early marking of inter-layer reference pictures 162 ///< Decoded picture marking of sub-layer non-reference pictures 191 163 #define O0225_MAX_TID_FOR_REF_LAYERS 1 192 164 #define O0225_TID_BASED_IL_RPS_DERIV 1 … … 195 167 #define P0079_DERIVE_NUMACTIVE_REF_PICS 1 ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics 196 168 #define Q0060_MAX_TID_REF_EQUAL_TO_ZERO 1 ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0. 197 #if REF_IDX_MFM 198 #define N0139_POSITION_ROUNDING_OFFSET 1 ///< JCTVC-N0139: offset for collocated block in motion mapping 199 #endif 200 201 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 169 170 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 202 171 203 172 #define P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1 ///< a flag to indicatate whether picture types for IRAP are IDR across layers. 204 173 205 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers 206 #if N0147_IRAP_ALIGN_FLAG 207 #define O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS 1 ///< Remove IRAP align depedency constraints on poc_Reset_flag. 208 #define IRAP_ALIGN_FLAG_IN_VPS_VUI 1 ///< Move IRAP align flag to VPS VUI 209 #endif 210 #if !N0147_IRAP_ALIGN_FLAG 211 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers : As per JCTVC-N0373, IDR are not required to be aligned. 212 #endif 213 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) 214 #if FAST_INTRA_SHVC 215 #define NB_REMAIN_MODES 2 ///< JCTVC-M0115: nb of remaining modes 216 #endif 217 218 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037: rate control for SHVC 174 #define IRAP_ALIGN_FLAG_IN_VPS_VUI 1 ///< Move IRAP align flag to VPS VUI 219 175 220 176 #define VIEW_ID_RELATED_SIGNALING 1 ///< Introduce syntax elements view_id and view_id_val 221 #define LAYERS_NOT_PRESENT_SEI 1 ///< JCTVC-M0043: add layers not present SEI.222 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1223 177 #define N0065_LAYER_POC_ALIGNMENT 1 224 178 … … 246 200 247 201 #define Q0165_OUTPUT_LAYER_SET 1 ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set 248 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 202 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_olss and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 203 204 #define Q0078_ADD_LAYER_SETS 1 ///< JCTVC-Q0078: additional layer sets and layer set config 205 #if Q0078_ADD_LAYER_SETS 206 #define MAX_NUM_ADD_LAYER_SETS 1023 207 #endif 249 208 250 209 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters … … 263 222 #define P0138_USE_ALT_CPB_PARAMS_FLAG 1 ///< JCTVC-P0138: use_alt_cpb_params_flag syntax in buffering period SEI message extension 264 223 #define P0166_MODIFIED_PPS_EXTENSION 1 ///< JCTVC-P0166: add pps_extension_type_flag 265 266 #if VIEW_ID_RELATED_SIGNALING 224 #define BITRATE_PICRATE_SIGNALLING 1 ///< JCTVC-Q0102 Proposal 3 signal bitrate, picrate only up to the maximum temporal sub-layers in the corresponding layer set 225 #define LAYER_DECPICBUFF_PARAM 1 ///< JCTVC-Q0102 Proposal 2 infer value from layer DPB param 226 #define HRD_BPB 1 ///< JCTVC-Q0101 Bitstream Partition Buffering Proposals 227 #define DPB_CONSTRAINTS 1 ///< JCTVC-Q0100 RPS DPB constraints 228 267 229 /// scalability types 268 230 enum ScalabilityType 269 231 { 270 232 VIEW_ORDER_INDEX = 1, 271 SCALABILITY_ID = 2, 272 }; 273 #endif 233 SCALABILITY_ID = 2, 234 AUX_ID = 3, 235 }; 236 237 /// normative encoder constraints -------- 238 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 239 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME) 240 241 /// encoder settings --------------------- 242 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) 243 #if FAST_INTRA_SHVC 244 #define NB_REMAIN_MODES 2 ///< JCTVC-M0115: nb of remaining modes 245 #endif 246 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037: rate control for SHVC 247 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) 248 #define ENCODER_FAST_MODE 1 ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 249 #define LAYER_CTB 0 ///< enable layer-specific CTB structure 250 251 /// SEI messages ------------------------- 252 #define P0050_KNEE_FUNCTION_SEI 1 ///< JCTVC-P0050: Knee function SEI 253 #define SUB_BITSTREAM_PROPERTY_SEI 1 ///< JCTVC-P0204: Sub-bitstream property SEI message 254 #if SUB_BITSTREAM_PROPERTY_SEI 255 #define MAX_SUB_STREAMS 1024 256 #endif 257 #define Q0074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping 258 #define LAYERS_NOT_PRESENT_SEI 1 ///< JCTVC-M0043: add layers not present SEI. 259 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1 260 #define Q0189_TMVP_CONSTRAINTS 1 ///< JCTVC-Q0189: indicate constraints on TMVP 261 #define Q0247_FRAME_FIELD_INFO 1 ///< JCTVC-Q0247: field_frame_info SEI message 262 274 263 275 264 #else … … 304 293 #define MAX_NESTING_NUM_LAYER 64 305 294 306 #if VPS_RENAME307 #define MAX_VPS_OP_LAYER_SETS_PLUS1 3295 #if SVC_EXTENSION 296 #define MAX_VPS_OP_LAYER_SETS_PLUS1 (MAX_LAYERS+1) 308 297 #define MAX_VPS_LAYER_SETS_PLUS1 1024 309 298 #define MAX_VPS_LAYER_ID_PLUS1 MAX_LAYERS
Note: See TracChangeset for help on using the changeset viewer.