Changeset 618 in 3DVCSoftware for branches/HTM-8.0-dev0/source/Lib/TLibCommon
- Timestamp:
- 9 Sep 2013, 23:15:14 (11 years ago)
- Location:
- branches/HTM-8.0-dev0/source/Lib/TLibCommon
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.0-dev0/source/Lib/TLibCommon/CommonDef.h
r609 r618 48 48 #endif // _MSC_VER > 1000 49 49 #include "TypeDef.h" 50 #if H_MV 51 #include <assert.h> 52 #endif 50 53 51 54 //! \ingroup TLibCommon … … 183 186 return (t < 0) ? T(-1) : T(1); 184 187 } 188 189 #if H_MV5 190 template <typename T> 191 __inline T gCeilLog2( T val ) 192 { 193 assert( val > 0 ); 194 Int ceilLog2 = 0; 195 while( val > ( 1 << ceilLog2 ) ) ceilLog2++; 196 return ceilLog2; 197 } 198 #endif 185 199 186 200 #define RemoveBitIncrement( exp ) ( exp >> ( g_bitDepthY - 8 ) ) -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r617 r618 4830 4830 4831 4831 // use coldir. 4832 #if H_MV5 4833 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 4834 #else 4832 4835 #if H_MV 4833 4836 TComPic *pColPic; … … 4842 4845 #else 4843 4846 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 4847 #endif 4844 4848 #endif 4845 4849 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.cpp
r613 r618 372 372 const Bool g_bEncDecTraceEnable = true; 373 373 const Bool g_bEncDecTraceDisable = false; 374 Bool g_HLSTraceEnable = true;374 Bool g_HLSTraceEnable = false; 375 375 Bool g_bJustDoIt = false; 376 376 UInt64 g_nSymbolCounter = 0; … … 380 380 Bool g_traceTU = true; 381 381 Bool g_disableHLSTrace = false; 382 UInt64 g_stopAtCounter = 10803; 382 UInt64 g_stopAtCounter = 48; 383 Bool g_traceCopyBack = false; 384 Bool g_decTraceDispDer = false; 385 Bool g_decTraceMvFromMerge = false; 383 386 #endif 384 387 #endif -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComRom.h
r613 r618 224 224 extern Bool g_tracePU; 225 225 extern Bool g_traceTU; 226 extern Bool g_disableHLSTrace; 227 extern UInt64 g_stopAtCounter; 226 extern Bool g_disableHLSTrace; // USE g_HLSTraceEnable to toggle HLS trace. Not this one! 227 extern UInt64 g_stopAtCounter; // Counter to set breakpoint. 228 extern Bool g_traceCopyBack; // Output samples on copy back 229 extern Bool g_decTraceDispDer; // Trace derived disparity vectors (decoder only) 230 extern Bool g_decTraceMvFromMerge; // Trace motion vectors obtained from merge (decoder only) 228 231 229 232 #define DTRACE_CU(x,y) writeToTraceFile( x,y, g_traceCU ); -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r615 r618 101 101 , m_enableTMVPFlag ( true ) 102 102 #if H_MV 103 #if H_MV5 104 , m_refPicSetInterLayer0 ( NULL ) 105 , m_refPicSetInterLayer1 ( NULL ) 106 #else 103 107 , m_refPicSetInterLayer ( NULL ) 108 #endif 104 109 , m_layerId (0) 105 110 , m_viewId (0) 111 #if H_MV5 112 , m_viewIndex (0) 113 #endif 106 114 #if H_3D 115 #if !H_MV5 107 116 , m_viewIndex (0) 117 #endif 108 118 , m_isDepth (false) 119 #endif 120 #if H_MV5 121 , m_pocResetFlag (false) 109 122 #endif 110 123 , m_discardableFlag (false) 111 124 , m_interLayerPredEnabledFlag (false) 112 125 , m_numInterLayerRefPicsMinus1 (0) 126 #if !H_MV5 113 127 , m_interLayerSamplePredOnlyFlag (false) 114 128 , m_altCollocatedIndicationFlag (0) 115 129 , m_collocatedRefLayerIdx (0) 130 #endif 116 131 #if H_3D_IC 117 132 , m_bApplyIC ( false ) … … 149 164 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 150 165 { 166 #if H_MV5 167 m_interLayerPredLayerIdc[ i ] = i; 168 #else 151 169 m_interLayerPredLayerIdc[ i ] = 0; 170 #endif 152 171 } 153 172 #endif … … 162 181 { 163 182 if ( m_depthToDisparityB && m_depthToDisparityB[ i ] ) 183 { 164 184 delete[] m_depthToDisparityB [ i ]; 185 } 165 186 166 187 if ( m_depthToDisparityF && m_depthToDisparityF[ i ] ) 188 { 167 189 delete[] m_depthToDisparityF [ i ]; 168 190 } 191 } 169 192 170 193 if ( m_depthToDisparityF ) 194 { 171 195 delete[] m_depthToDisparityF; 196 } 172 197 173 198 m_depthToDisparityF = NULL; … … 362 387 } 363 388 } 364 #if H_MV 365 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr) 366 #else 389 #if H_MV5 390 #if !H_MV 367 391 #if FIX1071 368 392 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) … … 370 394 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 371 395 #endif 372 #endif373 396 { 374 397 #if FIX1071 … … 380 403 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 381 404 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 382 405 383 406 return; 384 407 } 385 386 #if !H_MV 408 387 409 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 388 410 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 389 #endif390 411 } 391 412 … … 411 432 } 412 433 } 434 435 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 436 { 437 if(m_pcRPS->getUsed(i)) 438 { 439 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i)); 440 pcRefPic->setIsLongTerm(0); 441 pcRefPic->getPicYuvRec()->extendPicBorder(); 442 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic; 443 NumPocStCurr1++; 444 pcRefPic->setCheckLTMSBPresent(false); 445 } 446 } 447 448 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 449 { 450 if(m_pcRPS->getUsed(i)) 451 { 452 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 453 pcRefPic->setIsLongTerm(1); 454 pcRefPic->getPicYuvRec()->extendPicBorder(); 455 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic; 456 NumPocLtCurr++; 457 } 458 if(pcRefPic==NULL) 459 { 460 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 461 } 462 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 463 } 464 465 // ref_pic_list_init 466 TComPic* rpsCurrList0[MAX_NUM_REF+1]; 467 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 468 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 469 470 #if FIX1071 471 if (checkNumPocTotalCurr) 472 { 473 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 474 // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 475 // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 476 if (getRapPicFlag()) 477 { 478 assert(numPocTotalCurr == 0); 479 } 480 481 if (m_eSliceType == I_SLICE) 482 { 483 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 484 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 485 486 return; 487 } 488 489 assert(numPocTotalCurr > 0); 490 491 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 492 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 493 } 494 #endif 495 496 Int cIdx = 0; 497 for ( i=0; i<NumPocStCurr0; i++, cIdx++) 498 { 499 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 500 } 501 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 502 { 503 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 504 } 505 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 506 { 507 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 508 } 509 assert(cIdx == numPocTotalCurr); 510 511 if (m_eSliceType==B_SLICE) 512 { 513 cIdx = 0; 514 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 515 { 516 rpsCurrList1[cIdx] = RefPicSetStCurr1[i]; 517 } 518 for ( i=0; i<NumPocStCurr0; i++, cIdx++) 519 { 520 rpsCurrList1[cIdx] = RefPicSetStCurr0[i]; 521 } 522 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 523 { 524 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 525 } 526 assert(cIdx == numPocTotalCurr); 527 } 528 529 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); 530 531 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++) 532 { 533 cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr; 534 assert(cIdx >= 0 && cIdx < numPocTotalCurr); 535 m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ]; 536 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 ); 537 } 538 if ( m_eSliceType != B_SLICE ) 539 { 540 m_aiNumRefIdx[1] = 0; 541 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1])); 542 } 543 else 544 { 545 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++) 546 { 547 cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr; 548 assert(cIdx >= 0 && cIdx < numPocTotalCurr); 549 m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ]; 550 m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 ); 551 } 552 } 553 } 554 555 #else 556 Void TComSlice::getTempRefPicLists( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, 557 std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr ) 558 { 559 if (!checkNumPocTotalCurr) 560 { 561 if (m_eSliceType == I_SLICE) 562 { 563 return; 564 } 565 } 566 567 TComPic* pcRefPic= NULL; 568 TComPic* RefPicSetStCurr0[16]; 569 TComPic* RefPicSetStCurr1[16]; 570 TComPic* RefPicSetLtCurr[16]; 571 UInt NumPocStCurr0 = 0; 572 UInt NumPocStCurr1 = 0; 573 UInt NumPocLtCurr = 0; 574 Int i; 575 576 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) 577 { 578 if(m_pcRPS->getUsed(i)) 579 { 580 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i)); 581 pcRefPic->setIsLongTerm(0); 582 pcRefPic->getPicYuvRec()->extendPicBorder(); 583 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic; 584 NumPocStCurr0++; 585 pcRefPic->setCheckLTMSBPresent(false); 586 } 587 } 588 589 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 590 { 591 if(m_pcRPS->getUsed(i)) 592 { 593 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i)); 594 pcRefPic->setIsLongTerm(0); 595 pcRefPic->getPicYuvRec()->extendPicBorder(); 596 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic; 597 NumPocStCurr1++; 598 pcRefPic->setCheckLTMSBPresent(false); 599 } 600 } 601 602 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 603 { 604 if(m_pcRPS->getUsed(i)) 605 { 606 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 607 pcRefPic->setIsLongTerm(1); 608 pcRefPic->getPicYuvRec()->extendPicBorder(); 609 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic; 610 NumPocLtCurr++; 611 } 612 if(pcRefPic==NULL) 613 { 614 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 615 } 616 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 617 } 618 619 Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 620 numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( ); 621 assert( numPocTotalCurr == getNumRpsCurrTempList() ); 622 623 if (checkNumPocTotalCurr) 624 { 625 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 626 // - If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0. 627 // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 628 if ( getRapPicFlag() && m_layerId == 0 ) 629 { 630 assert(numPocTotalCurr == 0); 631 } 632 633 if (m_eSliceType == I_SLICE) 634 { 635 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 636 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 637 638 return; 639 } 640 641 assert(numPocTotalCurr > 0); 642 643 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 644 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 645 } 646 647 std::vector<TComPic*>* refPicSetInterLayer[2] = { &refPicSetInterLayer0, &refPicSetInterLayer1}; 648 Int numPocInterLayer[2] = { getNumActiveRefLayerPics0( ), getNumActiveRefLayerPics1( ) }; 649 650 TComPic** refPicSetStCurr [2] = { RefPicSetStCurr0, RefPicSetStCurr1 }; 651 Int numPocStCurr[2] = { NumPocStCurr0, NumPocStCurr1 }; 652 653 for (Int li = 0; li < ((m_eSliceType==B_SLICE) ? 2 : 1); li++) 654 { 655 rpsCurrList [li].resize(MAX_NUM_REF+1,NULL ); 656 usedAsLongTerm[li].resize(MAX_NUM_REF+1,false); 657 658 Int cIdx = 0; 659 for ( i=0; i < numPocStCurr[li]; i++, cIdx++) 660 { 661 rpsCurrList[li][cIdx] = refPicSetStCurr[li][i]; 662 usedAsLongTerm [li][cIdx] = false; 663 } 664 665 for ( i=0; i < numPocInterLayer[li]; i++, cIdx++) 666 { 667 rpsCurrList[li][cIdx] = (*refPicSetInterLayer[li])[i]; 668 usedAsLongTerm [li][cIdx] = true; 669 } 670 671 for ( i=0; i < numPocStCurr[1-li]; i++, cIdx++) 672 { 673 rpsCurrList[li][cIdx] = refPicSetStCurr[1-li][i]; 674 usedAsLongTerm [li][cIdx] = false; 675 } 676 677 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 678 { 679 rpsCurrList[li][cIdx] = RefPicSetLtCurr[i]; 680 usedAsLongTerm [li][cIdx] = true; 681 } 682 683 for ( i=0; i < numPocInterLayer[1-li]; i++, cIdx++) 684 { 685 assert( cIdx < MAX_NUM_REF ); 686 rpsCurrList[li][cIdx] = (*refPicSetInterLayer[1-li])[i]; 687 usedAsLongTerm [li][cIdx] = true; 688 } 689 690 assert(cIdx == numPocTotalCurr); 691 } 692 } 693 694 Void TComSlice::setRefPicList( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr ) 695 696 { 697 if (!checkNumPocTotalCurr) 698 { 699 if (m_eSliceType == I_SLICE) 700 { 701 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 702 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 703 704 return; 705 } 706 } 707 708 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); 709 710 for (Int li = 0; li < 2; li++) 711 { 712 if ( m_eSliceType == P_SLICE && li == 1 ) 713 { 714 m_aiNumRefIdx[1] = 0; 715 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1])); 716 } 717 else 718 { 719 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++) 720 { 721 Bool listModified = m_RefPicListModification.getRefPicListModificationFlagL( li ); 722 Int orgIdx = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr); 723 724 assert( rpsCurrList[li][ orgIdx ] != NULL ); 725 m_apcRefPicList [li][rIdx] = rpsCurrList [li][ orgIdx ]; 726 m_bIsUsedAsLongTerm[li][rIdx] = usedAsLongTerm [li][ orgIdx ] ; 727 } 728 } 729 } 730 } 731 #endif 732 #else 733 #if H_MV 734 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr) 735 #else 736 #if FIX1071 737 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 738 #else 739 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 740 #endif 741 #endif 742 { 743 #if FIX1071 744 if (!checkNumPocTotalCurr) 745 #endif 746 { 747 if (m_eSliceType == I_SLICE) 748 { 749 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 750 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 751 752 return; 753 } 754 755 #if !H_MV 756 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 757 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 758 #endif 759 } 760 761 TComPic* pcRefPic= NULL; 762 TComPic* RefPicSetStCurr0[16]; 763 TComPic* RefPicSetStCurr1[16]; 764 TComPic* RefPicSetLtCurr[16]; 765 UInt NumPocStCurr0 = 0; 766 UInt NumPocStCurr1 = 0; 767 UInt NumPocLtCurr = 0; 768 Int i; 769 770 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) 771 { 772 if(m_pcRPS->getUsed(i)) 773 { 774 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i)); 775 pcRefPic->setIsLongTerm(0); 776 pcRefPic->getPicYuvRec()->extendPicBorder(); 777 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic; 778 NumPocStCurr0++; 779 pcRefPic->setCheckLTMSBPresent(false); 780 } 781 } 413 782 414 783 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) … … 458 827 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 459 828 #if H_MV 460 // –If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.461 // –Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.829 // â If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0. 830 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 462 831 if ( getRapPicFlag() && m_layerId == 0 ) 463 832 #else 464 // –If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.465 // –Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.833 // â If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 834 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 466 835 if (getRapPicFlag()) 467 836 #endif … … 593 962 } 594 963 964 #endif 595 965 Int TComSlice::getNumRpsCurrTempList() 596 966 { … … 609 979 } 610 980 #if H_MV 981 #if !H_MV5 611 982 assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() ); 983 #endif 612 984 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics(); 613 985 #endif … … 923 1295 #if H_MV 924 1296 // Additional slice header syntax elements 1297 #if H_MV5 1298 m_pocResetFlag = pSrc->m_pocResetFlag; 1299 #endif 925 1300 m_discardableFlag = pSrc->m_discardableFlag; 926 1301 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; … … 931 1306 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 932 1307 } 933 1308 #if !H_MV5 934 1309 m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag; 935 1310 m_altCollocatedIndicationFlag = pSrc->m_altCollocatedIndicationFlag ; … … 941 1316 m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer]; 942 1317 } 1318 #endif 943 1319 #endif 944 1320 #if H_3D_IC … … 1405 1781 : m_VPSId ( 0) 1406 1782 , m_uiMaxTLayers ( 1) 1783 #if H_MV5 1784 #if H_MV 1785 , m_uiMaxLayersMinus1 ( 0) 1786 #else 1407 1787 , m_uiMaxLayers ( 1) 1788 #endif 1789 #else 1790 , m_uiMaxLayers ( 1) 1791 #endif 1408 1792 , m_bTemporalIdNestingFlag (false) 1409 1793 , m_numHrdParameters ( 0) … … 1416 1800 , m_hrdOpSetIdx (NULL) 1417 1801 , m_cprmsPresentFlag (NULL) 1802 #if H_MV5 1803 #if H_MV 1804 , m_vpsVUI ( NULL ) 1805 #endif 1806 #endif 1418 1807 { 1419 1808 for( Int i = 0; i < MAX_TLAYER; i++) … … 1459 1848 1460 1849 m_avcBaseLayerFlag = false; 1850 #if H_MV5 1851 m_vpsVuiOffset = 0; 1852 #endif 1461 1853 m_splittingFlag = false; 1462 1854 1463 1855 for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ ) 1464 1856 { 1857 #if H_MV5 1858 m_scalabilityMaskFlag[i] = false; 1859 #else 1465 1860 m_scalabilityMask[i] = false; 1861 #endif 1466 1862 m_dimensionIdLen [i] = -1; 1467 1863 } … … 1489 1885 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1490 1886 m_numDirectRefLayers[i] = 0; 1887 #if H_MV5 1888 m_maxTidIlRefPicPlus1[i] = 7; 1889 m_vpsRepFormatIdx [i] = 0; 1890 m_repFormat [i] = NULL; 1891 m_viewIdVal [i] = 0; 1892 #else 1491 1893 m_maxTidIlRefPicPlus1[i] = -1; 1894 #endif 1895 1492 1896 #if H_3D 1493 1897 m_viewIndex [i] = -1; … … 1531 1935 #endif 1532 1936 } 1937 #if H_MV5 1938 m_vpsVUI = new TComVPSVUI; 1939 #endif 1533 1940 #if H_3D 1534 1941 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1556 1963 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1557 1964 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1965 #if H_MV5 1966 #if H_MV 1967 if ( m_vpsVUI != NULL ) delete m_vpsVUI; 1968 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1969 { 1970 if (m_repFormat[ i ] != NULL ) delete m_repFormat[ i ]; 1971 #if H_3D_DIM_DLT 1972 if ( m_iDepthValue2Idx[i] != 0 ) 1973 { 1974 xFree( m_iDepthValue2Idx[i] ); 1975 m_iDepthValue2Idx[i] = 0; 1976 } 1977 1978 if ( m_iIdx2DepthValue[i] != 0 ) 1979 { 1980 xFree( m_iIdx2DepthValue[i] ); 1981 m_iIdx2DepthValue[i] = 0; 1982 } 1983 #endif 1984 } 1985 #endif 1986 #else 1558 1987 #if H_3D_DIM_DLT 1559 1988 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1572 2001 } 1573 2002 } 2003 #endif 1574 2004 #endif 1575 2005 } … … 1642 2072 Bool TComVPS::checkVPSExtensionSyntax() 1643 2073 { 2074 #if H_MV5 2075 for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ ) 2076 #else 1644 2077 for( Int layer = 1; layer < getMaxLayers(); layer++ ) 2078 #endif 1645 2079 { 1646 2080 // check layer_id_in_nuh constraint … … 1658 2092 { 1659 2093 assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES ); 2094 #if H_MV5 2095 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) ); 2096 #else 1660 2097 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) ); 1661 2098 #endif 1662 2099 Int scalIdx = 0; 1663 2100 for( Int curScalType = 0; curScalType < scalType; curScalType++ ) 1664 2101 { 2102 #if H_MV5 2103 scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 ); 2104 #else 1665 2105 scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 ); 2106 #endif 2107 1666 2108 } 1667 2109 1668 2110 return scalIdx; 1669 2111 } 1670 2112 #if H_MV5 2113 Void TComVPS::setScalabilityMaskFlag( UInt val ) 2114 { 2115 for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ ) 2116 { 2117 setScalabilityMaskFlag( scalType, ( val & (1 << scalType ) ) != 0 ); 2118 } 2119 } 2120 #else 1671 2121 Void TComVPS::setScalabilityMask( UInt val ) 1672 2122 { … … 1675 2125 } 1676 2126 2127 #endif 2128 2129 #if H_MV5 2130 Void TComVPS::setRefLayers() 2131 { 2132 for( Int i = 0; i <= getMaxLayersMinus1(); i++ ) 2133 { 2134 Int iNuhLId = getLayerIdInNuh( i ); 2135 m_numDirectRefLayers[ iNuhLId ] = 0; 2136 for( Int j = 0; j < i; j++ ) 2137 { 2138 if( getDirectDependencyFlag(i , j) ) 2139 { 2140 m_refLayerId[ iNuhLId ][m_numDirectRefLayers[ iNuhLId ]++ ] = getLayerIdInNuh( j ); 2141 } 2142 } 2143 } 2144 } 2145 2146 Int TComVPS::getRefLayerId( Int layerIdInNuh, Int idx ) 2147 { 2148 assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInNuh] ); 2149 Int refLayerIdInNuh = m_refLayerId[ layerIdInNuh ][ idx ]; 2150 assert ( refLayerIdInNuh >= 0 ); 2151 return refLayerIdInNuh; 2152 } 2153 2154 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType ) 2155 { 2156 return getScalabilityMaskFlag( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0; 2157 } 2158 2159 #if H_3D 2160 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag ) 2161 { 2162 Int foundLayerIdinNuh = -1; 2163 2164 for (Int layerIdInVps = 0 ; layerIdInVps <= getMaxLayersMinus1(); layerIdInVps++ ) 2165 { 2166 Int layerIdInNuh = getLayerIdInNuh( layerIdInVps ); 2167 if( ( getViewIndex( layerIdInNuh ) == viewIndex ) && ( getDepthId( layerIdInNuh ) == ( depthFlag ? 1 : 0 ) ) ) 2168 { 2169 foundLayerIdinNuh = layerIdInNuh; 2170 break; 2171 } 2172 } 2173 assert( foundLayerIdinNuh != -1 ); 2174 2175 return foundLayerIdinNuh; 2176 } 2177 #endif // H_3D 2178 #else 1677 2179 Void TComVPS::setRefLayers() 1678 2180 { … … 1793 2295 } 1794 2296 2297 #endif // H_MV5 2298 1795 2299 1796 2300 Int TComVPS::xGetDimBitOffset( Int j ) … … 1832 2336 return numLayersInIdList; 1833 2337 } 2338 #if H_MV5 2339 Int TComVPS::getNumViews() 2340 { 2341 Int numViews = 1; 2342 for( Int i = 0; i <= getMaxLayersMinus1(); i++ ) 2343 { 2344 Int lId = getLayerIdInNuh( i ); 2345 if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) ) 2346 { 2347 numViews++; 2348 } 2349 } 2350 2351 return numViews; 2352 } 2353 2354 Bool TComVPS::getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth /*= 0 */ ) 2355 { 2356 assert( depth < 65 ); 2357 Bool dependentFlag = getDirectDependencyFlag( depLayeridInVps, refLayeridInVps ); 2358 2359 for( Int i = 0; i < depLayeridInVps && !dependentFlag; i++ ) 2360 { 2361 if ( getDirectDependencyFlag( depLayeridInVps, i ) ) 2362 { 2363 dependentFlag = getInDirectDependencyFlag( i, refLayeridInVps, depth++ ); 2364 } 2365 } 2366 return dependentFlag; 2367 } 2368 #endif 1834 2369 #endif // H_MV 1835 2370 … … 1882 2417 , m_vuiParameters () 1883 2418 #if H_MV 2419 #if H_MV5 2420 , m_pcVPS ( NULL ) 2421 , m_spsInferScalingListFlag ( false ) 2422 , m_spsScalingListRefLayerId ( 0 ) 2423 , m_updateRepFormatFlag ( true ) 2424 , m_interViewMvVertConstraintFlag (false) 2425 #else 1884 2426 , m_interViewMvVertConstraintFlag (false) 1885 2427 , m_numIlpRestrictedRefLayers ( 0 ) 2428 #endif 1886 2429 #endif 1887 2430 #if H_3D … … 1898 2441 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 1899 2442 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2443 #if !H_MV5 1900 2444 #if H_MV 1901 2445 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1905 2449 m_minHorizontalCtuOffsetPlus1 [ i ] = 0; 1906 2450 } 2451 #endif 1907 2452 #endif 1908 2453 } … … 2058 2603 , m_listsModificationPresentFlag( 0) 2059 2604 , m_numExtraSliceHeaderBits(0) 2605 #if H_MV5 2606 #if H_MV 2607 , m_ppsInferScalingListFlag(false) 2608 , m_ppsScalingListRefLayerId(0) 2609 #endif 2610 #endif 2060 2611 { 2061 2612 m_scalingList = new TComScalingList; … … 2077 2628 } 2078 2629 2630 #if H_MV5 2631 #if H_MV 2632 Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr ) 2633 { 2634 if ( layerIdCurr > 0 ) 2635 { 2636 TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 2637 if ( !getUpdateRepFormatFlag() ) 2638 { 2639 setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() ); 2640 //// ToDo: add when supported: 2641 // setSeperateColourPlaneFlag( repFormat->getSeparateColourPlaneVpsFlag() ) ; 2642 2643 setPicWidthInLumaSamples ( repFormat->getPicWidthVpsInLumaSamples() ); 2644 setPicHeightInLumaSamples( repFormat->getPicHeightVpsInLumaSamples() ); 2645 2646 setBitDepthY ( repFormat->getBitDepthVpsLumaMinus8() + 8 ); 2647 setQpBDOffsetY ( (Int) (6*( getBitDepthY() - 8 )) ); 2648 2649 setBitDepthC ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2650 setQpBDOffsetC ( (Int) (6* ( getBitDepthC() -8 ) ) ); 2651 } 2652 else 2653 { 2654 assert( getChromaFormatIdc() <= repFormat->getChromaFormatVpsIdc() ); 2655 //// ToDo: add when supported: 2656 // assert( getSeperateColourPlaneFlag() <= repFormat->getSeparateColourPlaneVpsFlag() ) ; 2657 2658 assert( getPicWidthInLumaSamples() <= repFormat->getPicWidthVpsInLumaSamples() ); 2659 assert( getPicHeightInLumaSamples() <= repFormat->getPicHeightVpsInLumaSamples() ); 2660 2661 assert( getBitDepthY() <= repFormat->getBitDepthVpsLumaMinus8() + 8 ); 2662 assert( getBitDepthC() <= repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2663 } 2664 } 2665 2666 // Set conformance window 2667 Int scal = TComSPS::getWinUnitX( getChromaFormatIdc() ) ; 2668 getConformanceWindow().scaleOffsets( scal ); 2669 getVuiParameters()->getDefaultDisplayWindow().scaleOffsets( scal ); 2670 } 2671 2672 Void TComSPS::inferScalingList( TComSPS* spsSrc ) 2673 { 2674 if ( getSpsInferScalingListFlag() ) 2675 { 2676 assert( spsSrc != NULL ); 2677 assert( !spsSrc->getSpsInferScalingListFlag() ); 2678 getScalingList()->inferFrom( spsSrc->getScalingList() ); 2679 } 2680 } 2681 #endif 2682 #endif 2079 2683 #if H_3D 2080 2684 Void … … 2346 2950 2347 2951 #if H_MV 2348 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ) 2349 { 2350 refPicSetInterLayer.clear(); 2952 #if H_MV5 2953 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ) 2954 { 2955 refPicSetInterLayer0.clear(); 2956 refPicSetInterLayer1.clear(); 2351 2957 2352 2958 for( Int i = 0; i < getNumActiveRefLayerPics(); i++ ) … … 2360 2966 picRef->getSlice(0)->setReferenced( true ); 2361 2967 2968 Int viewIdCur = getVPS()->getViewId( getLayerId() ); 2969 Int viewIdZero = getVPS()->getViewId( 0 ); 2970 Int viewIdRef = getVPS()->getViewId( layerIdRef ); 2971 2972 if ( ( viewIdCur <= viewIdZero && viewIdCur <= viewIdRef ) || ( viewIdCur >= viewIdZero && viewIdCur >= viewIdRef ) ) 2973 { 2974 refPicSetInterLayer0.push_back( picRef ); 2975 } 2976 else 2977 { 2978 refPicSetInterLayer1.push_back( picRef ); 2979 } 2980 // Consider to check here: 2981 // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer0 and RefPicSetInterLayer1 that is a RASL picture. " 2982 } 2983 } 2984 #else 2985 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ) 2986 { 2987 refPicSetInterLayer.clear(); 2988 2989 for( Int i = 0; i < getNumActiveRefLayerPics(); i++ ) 2990 { 2991 Int layerIdRef = getRefPicLayerId( i ); 2992 TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ; 2993 assert ( picRef != 0 ); 2994 2995 picRef->getPicYuvRec()->extendPicBorder(); 2996 picRef->setIsLongTerm( true ); 2997 picRef->getSlice(0)->setReferenced( true ); 2998 2362 2999 // Consider to check here: 2363 3000 // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. " … … 2365 3002 } 2366 3003 } 2367 3004 #endif 3005 3006 #if H_MV5 3007 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ) 3008 { 3009 // Mark as shortterm 3010 for ( Int i = 0; i < refPicSetInterLayer0.size(); i++ ) 3011 { 3012 refPicSetInterLayer0[i]->setIsLongTerm( false ); 3013 } 3014 3015 for ( Int i = 0; i < refPicSetInterLayer1.size(); i++ ) 3016 { 3017 refPicSetInterLayer1[i]->setIsLongTerm( false ); 3018 } 3019 3020 } 3021 #else 2368 3022 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer ) 2369 3023 { … … 2375 3029 } 2376 3030 3031 #endif 2377 3032 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 2378 3033 { … … 2380 3035 if (targetDecLayerIdSet.size() == 0 ) 2381 3036 { 3037 #if H_MV5 3038 for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ ) 3039 #else 2382 3040 for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ ) 3041 #endif 2383 3042 { 2384 3043 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); … … 2391 3050 { 2392 3051 if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId ) 3052 { 2393 3053 break; 3054 } 2394 3055 } 2395 3056 … … 2407 3068 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 2408 3069 { 3070 #if H_MV5 3071 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 3072 { 3073 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 3074 #else 2409 3075 Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] ); 2410 3076 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ ) 3077 { 2411 3078 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS, k ) ) 3079 #endif 3080 { 2412 3081 remainingInterLayerReferencesFlag = true; 2413 3082 } 2414 3083 } 3084 } 3085 } 2415 3086 if( !remainingInterLayerReferencesFlag ) 3087 { 2416 3088 pcPic->getSlice(0)->setReferenced( false ); 2417 3089 } … … 2419 3091 } 2420 3092 } 2421 3093 } 3094 3095 #if H_MV5 3096 Void TComSlice::printRefPicList() 3097 #else 2422 3098 Void TComSlice::xPrintRefPicList() 3099 #endif 2423 3100 { 2424 3101 for ( Int li = 0; li < 2; li++) … … 2433 3110 } 2434 3111 } 3112 #if !H_MV5 2435 3113 Int TComSlice::xCeilLog2( Int val ) 2436 3114 { … … 2440 3118 return ceilLog2; 2441 3119 } 3120 #endif 2442 3121 2443 3122 Void TComSlice::markCurrPic( TComPic* currPic ) … … 2454 3133 } 2455 3134 3135 #if H_MV5 3136 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 ) 3137 { 3138 m_refPicSetInterLayer0 = refPicSetInterLayer0; 3139 m_refPicSetInterLayer1 = refPicSetInterLayer1; 3140 } 3141 3142 TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId ) 3143 { 3144 assert ( setIdc == 0 || setIdc == 1); 3145 std::vector<TComPic*>* refPicSetInterLayer = ( setIdc == 0 ? m_refPicSetInterLayer0 : m_refPicSetInterLayer1); 3146 assert( refPicSetInterLayer != 0 ); 3147 3148 TComPic* pcPic = NULL; 3149 for ( Int i = 0; i < (*refPicSetInterLayer).size(); i++ ) 3150 { 3151 if ((*refPicSetInterLayer)[ i ]->getLayerId() == layerId ) 3152 { 3153 pcPic = (*refPicSetInterLayer)[ i ]; 3154 } 3155 } 3156 3157 assert(pcPic != NULL); 3158 return pcPic; 3159 } 3160 #else 2456 3161 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer ) 2457 3162 { … … 2474 3179 return pcPic; 2475 3180 } 2476 3181 #endif 2477 3182 Int TComSlice::getNumActiveRefLayerPics() 2478 3183 { 2479 3184 Int numActiveRefLayerPics; 2480 3185 3186 #if H_MV5 3187 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) == 0 ) 3188 { 3189 numActiveRefLayerPics = 0; 3190 } 3191 else if (getVPS()->getAllRefLayersActiveFlag() ) 3192 { 3193 numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() ); 3194 } 3195 else if ( !getInterLayerPredEnabledFlag() ) 3196 { 3197 numActiveRefLayerPics = 0; 3198 } 3199 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3200 #else 2481 3201 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() ) 2482 3202 { … … 2484 3204 } 2485 3205 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 ) 3206 #endif 2486 3207 { 2487 3208 numActiveRefLayerPics = 1; … … 2496 3217 Int TComSlice::getRefPicLayerId( Int i ) 2497 3218 { 3219 #if H_MV5 3220 return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) ); 3221 #else 2498 3222 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 2499 } 2500 3223 #endif 3224 } 3225 3226 #if !H_MV5 2501 3227 Void TComSlice::setActiveMotionPredRefLayers() 2502 3228 { … … 2527 3253 return interRefEnabledInRPLFlag; 2528 3254 } 3255 #endif 2529 3256 #if H_3D_ARP 2530 3257 Void TComSlice::setARPStepNum() … … 2804 3531 } 2805 3532 3533 #if H_MV5 3534 #if H_MV 3535 Void TComScalingList::inferFrom( TComScalingList* srcScLi ) 3536 { 3537 for(Int sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 3538 { 3539 for(Int listId = 0; listId < g_scalingListNum[sizeId]; listId++) 3540 { 3541 setRefMatrixId (sizeId,listId, srcScLi->getRefMatrixId (sizeId,listId)); 3542 setScalingListDC(sizeId,listId, srcScLi->getScalingListDC(sizeId,listId)); 3543 ::memcpy(getScalingListAddress(sizeId, listId),srcScLi->getScalingListAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 3544 } 3545 } 3546 } 3547 #endif 3548 #endif 2806 3549 /** initialization process of quantization matrix array 2807 3550 */ … … 2893 3636 , m_ppsMap(MAX_NUM_PPS) 2894 3637 , m_activeVPSId(-1) 3638 #if H_MV5 3639 #if !H_MV 2895 3640 , m_activeSPSId(-1) 2896 3641 , m_activePPSId(-1) 2897 3642 { 3643 #else 3644 { 3645 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 3646 { 3647 m_activeSPSId[ i ] = -1; 3648 m_activePPSId[ i ] = -1; 3649 } 3650 #endif 3651 #else 3652 , m_activeSPSId(-1) 3653 , m_activePPSId(-1) 3654 { 3655 #endif 2898 3656 } 2899 3657 … … 2905 3663 //! activate a SPS from a active parameter sets SEI message 2906 3664 //! \returns true, if activation is successful 3665 #if H_MV5 3666 #if H_MV 3667 Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId ) 3668 #else 2907 3669 Bool ParameterSetManager::activateSPSWithSEI(Int spsId) 3670 #endif 3671 #else 3672 Bool ParameterSetManager::activateSPSWithSEI(Int spsId) 3673 #endif 2908 3674 { 2909 3675 TComSPS *sps = m_spsMap.getPS(spsId); … … 2914 3680 { 2915 3681 m_activeVPSId = vpsId; 3682 #if !H_MV5 2916 3683 m_activeSPSId = spsId; 3684 #else 3685 #if H_MV 3686 m_activeSPSId[ layerId ] = spsId; 3687 #else 3688 m_activeSPSId = spsId; 3689 #endif 3690 #endif 2917 3691 return true; 2918 3692 } … … 2931 3705 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2932 3706 //! \returns true, if activation is successful 3707 #if H_MV5 3708 #if H_MV 3709 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId ) 3710 #else 3711 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 3712 #endif 3713 { 3714 TComPPS *pps = m_ppsMap.getPS(ppsId); 3715 if (pps) 3716 { 3717 Int spsId = pps->getSPSId(); 3718 #if H_MV 3719 if (!isIRAP && (spsId != m_activeSPSId[ layerId ])) 3720 #else 3721 if (!isIRAP && (spsId != m_activeSPSId)) 3722 #endif 3723 { 3724 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 3725 return false; 3726 } 3727 3728 TComSPS *sps = m_spsMap.getPS(spsId); 3729 if (sps) 3730 { 3731 Int vpsId = sps->getVPSId(); 3732 if (!isIRAP && (vpsId != m_activeVPSId)) 3733 { 3734 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP."); 3735 return false; 3736 } 3737 if (m_vpsMap.getPS(vpsId)) 3738 { 3739 #if H_MV 3740 m_activePPSId[ layerId ] = ppsId; 3741 m_activeVPSId = vpsId; 3742 m_activeSPSId[ layerId ] = spsId; 3743 #else 3744 m_activePPSId = ppsId; 3745 m_activeVPSId = vpsId; 3746 m_activeSPSId = spsId; 3747 #endif 3748 #else 2933 3749 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 2934 3750 { … … 2960 3776 m_activeVPSId = vpsId; 2961 3777 m_activeSPSId = spsId; 3778 #endif 2962 3779 return true; 2963 3780 } … … 3021 3838 #endif 3022 3839 //! \} 3840 3841 #if H_MV5 3842 #if H_MV 3843 TComVPSVUI::TComVPSVUI() 3844 { 3845 m_bitRatePresentVpsFlag = false; 3846 m_picRatePresentVpsFlag = false; 3847 for ( Int i = 0; i < MAX_VPS_OP_SETS_PLUS1; i++) 3848 { 3849 for ( Int j = 0; j < MAX_TLAYER; j++) 3850 { 3851 m_bitRatePresentFlag [i][j] = false; 3852 m_picRatePresentFlag [i][j] = false; 3853 m_avgBitRate [i][j] = -1; 3854 m_maxBitRate [i][j] = -1; 3855 m_constantPicRateIdc [i][j] = -1; 3856 m_avgPicRate [i][j] = -1; 3857 } 3858 } 3859 3860 m_ilpRestrictedRefLayersFlag = false; 3861 3862 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 3863 { 3864 for ( Int j = 0; j < MAX_NUM_LAYERS; j++) 3865 { 3866 m_tileBoundariesAlignedFlag [i][j] = false; 3867 m_minSpatialSegmentOffsetPlus1[i][j] = 0; 3868 m_ctuBasedOffsetEnabledFlag [i][j] = false; 3869 m_minHorizontalCtuOffsetPlus1 [i][j] = -1; 3870 } 3871 } 3872 } 3873 #endif 3874 #endif -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComSlice.h
r615 r618 169 169 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 170 170 Bool xParseScalingList (Char* pchFile); 171 #if H_MV5 172 #if H_MV 173 Void inferFrom ( TComScalingList* srcScLi ); 174 #endif 175 #endif 171 176 172 177 private: … … 402 407 }; 403 408 409 #if H_MV5 410 #if H_MV 411 class TComVPSVUI 412 { 413 private: 414 Bool m_bitRatePresentVpsFlag; 415 Bool m_picRatePresentVpsFlag; 416 Bool m_bitRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 417 Bool m_picRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 418 Int m_avgBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 419 Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 420 Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 421 Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 422 Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 423 Bool m_ilpRestrictedRefLayersFlag; 424 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 425 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 426 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 427 428 public: 429 TComVPSVUI();; 430 431 Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } 432 Bool getBitRatePresentVpsFlag( ) { return m_bitRatePresentVpsFlag; } 433 434 Void setPicRatePresentVpsFlag( Bool flag ) { m_picRatePresentVpsFlag = flag; } 435 Bool getPicRatePresentVpsFlag( ) { return m_picRatePresentVpsFlag; } 436 437 Void setBitRatePresentFlag( Int i, Int j, Bool flag ) { m_bitRatePresentFlag[i][j] = flag; } 438 Bool getBitRatePresentFlag( Int i, Int j ) { return m_bitRatePresentFlag[i][j]; } 439 440 Void setPicRatePresentFlag( Int i, Int j, Bool flag ) { m_picRatePresentFlag[i][j] = flag; } 441 Bool getPicRatePresentFlag( Int i, Int j ) { return m_picRatePresentFlag[i][j]; } 442 443 Void setAvgBitRate( Int i, Int j, Int val ) { m_avgBitRate[i][j] = val; } 444 Int getAvgBitRate( Int i, Int j ) { return m_avgBitRate[i][j]; } 445 446 Void setMaxBitRate( Int i, Int j, Int val ) { m_maxBitRate[i][j] = val; } 447 Int getMaxBitRate( Int i, Int j ) { return m_maxBitRate[i][j]; } 448 449 Void setConstantPicRateIdc( Int i, Int j, Int val ) { m_constantPicRateIdc[i][j] = val; } 450 Int getConstantPicRateIdc( Int i, Int j ) { return m_constantPicRateIdc[i][j]; } 451 452 Void setAvgPicRate( Int i, Int j, Int val ) { m_avgPicRate[i][j] = val; } 453 Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } 454 455 Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } 456 Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } 457 458 Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } 459 Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } 460 461 Void setMinSpatialSegmentOffsetPlus1( Int i, Int j, Int val ) { m_minSpatialSegmentOffsetPlus1[i][j] = val; } 462 Int getMinSpatialSegmentOffsetPlus1( Int i, Int j ) { return m_minSpatialSegmentOffsetPlus1[i][j]; } 463 464 Void setCtuBasedOffsetEnabledFlag( Int i, Int j, Bool flag ) { m_ctuBasedOffsetEnabledFlag[i][j] = flag; } 465 Bool getCtuBasedOffsetEnabledFlag( Int i, Int j ) { return m_ctuBasedOffsetEnabledFlag[i][j]; } 466 467 Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } 468 Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } 469 470 }; 471 472 class TComRepFormat 473 { 474 private: 475 Int m_chromaFormatVpsIdc; 476 Bool m_separateColourPlaneVpsFlag; 477 Int m_picWidthVpsInLumaSamples; 478 Int m_picHeightVpsInLumaSamples; 479 Int m_bitDepthVpsLumaMinus8; 480 Int m_bitDepthVpsChromaMinus8; 481 482 public: 483 TComRepFormat() { }; 484 485 Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } 486 Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } 487 488 Void setSeparateColourPlaneVpsFlag( Bool flag ) { m_separateColourPlaneVpsFlag = flag; } 489 Bool getSeparateColourPlaneVpsFlag( ) { return m_separateColourPlaneVpsFlag; } 490 491 Void setPicWidthVpsInLumaSamples( Int val ) { m_picWidthVpsInLumaSamples = val; } 492 Int getPicWidthVpsInLumaSamples( ) { return m_picWidthVpsInLumaSamples; } 493 494 Void setPicHeightVpsInLumaSamples( Int val ) { m_picHeightVpsInLumaSamples = val; } 495 Int getPicHeightVpsInLumaSamples( ) { return m_picHeightVpsInLumaSamples; } 496 497 Void setBitDepthVpsLumaMinus8( Int val ) { m_bitDepthVpsLumaMinus8 = val; } 498 Int getBitDepthVpsLumaMinus8( ) { return m_bitDepthVpsLumaMinus8; } 499 500 Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } 501 Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } 502 }; 503 #endif 504 #endif 505 404 506 class TComVPS 405 507 { … … 407 509 Int m_VPSId; 408 510 UInt m_uiMaxTLayers; 511 512 #if H_MV5 513 #if H_MV 514 UInt m_uiMaxLayersMinus1; 515 #else 409 516 UInt m_uiMaxLayers; 517 #endif 518 #else 519 UInt m_uiMaxLayers; 520 #endif 410 521 Bool m_bTemporalIdNestingFlag; 411 522 … … 440 551 /// VPS EXTENSION SYNTAX ELEMENTS 441 552 Bool m_avcBaseLayerFlag; 553 #if H_MV5 554 Int m_vpsVuiOffset; 555 #endif 442 556 Bool m_splittingFlag; 557 #if H_MV5 558 Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; 559 #else 443 560 Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES]; 561 #endif 444 562 Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; 445 563 Bool m_vpsNuhLayerIdPresentFlag; 446 564 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 447 565 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 566 #if H_MV5 567 Int m_viewIdLenMinus1; 568 Int m_viewIdVal [MAX_NUM_LAYERS]; 569 #endif 448 570 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 571 #if H_MV5 572 Bool m_maxTidRefPresentFlag; 573 #endif 449 574 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 575 #if H_MV5 576 Bool m_allRefLayersActiveFlag; 577 #endif 450 578 Int m_vpsNumberLayerSetsMinus1; 451 579 Int m_vpsNumProfileTierLevelMinus1; … … 458 586 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 459 587 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 588 #if H_MV5 589 Bool m_repFormatIdxPresentFlag; 590 Int m_vpsNumRepFormatsMinus1; 591 Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; 592 TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; 593 #endif 460 594 Bool m_maxOneActiveRefLayerFlag; 595 #if H_MV5 596 Bool m_crossLayerIrapAlignedFlag; 597 #endif 461 598 Int m_directDepTypeLenMinus2; 599 #if H_MV5 600 Bool m_vpsVuiPresentFlag; 601 TComVPSVUI* m_vpsVUI; 602 #endif 462 603 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; 463 604 … … 475 616 Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 476 617 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 618 #if H_MV5 619 Int m_viewIndex [MAX_NUM_LAYERS ]; 620 #else 477 621 #if H_3D 478 622 Int m_viewIndex [MAX_NUM_LAYERS ]; … … 480 624 481 625 Int xCeilLog2 ( Int val ); 626 #endif 482 627 Int xGetDimBitOffset( Int j ); 483 628 629 // VPS EXTENSION 2 SYNTAX ELEMENTS 484 630 #if H_3D_ARP 485 631 UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; … … 535 681 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 536 682 683 #if H_MV5 684 #if H_MV 685 UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; 686 Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } 687 #else 537 688 UInt getMaxLayers () { return m_uiMaxLayers; } 538 689 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 690 #endif 691 #else 692 UInt getMaxLayers () { return m_uiMaxLayers; } 693 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 694 #endif 539 695 540 696 Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } … … 579 735 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } 580 736 737 #if H_MV5 738 Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } 739 Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } 740 #endif 741 581 742 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } 582 743 Bool getSplittingFlag() { return m_splittingFlag; } 583 744 745 #if H_MV5 746 Void setScalabilityMaskFlag( UInt val ); 747 Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } 748 Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } 749 #else 584 750 Void setScalabilityMask( UInt val ); 585 751 586 752 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; } 587 753 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; } 588 754 #endif 589 755 Int getNumScalabilityTypes( ); 590 756 … … 603 769 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 604 770 771 #if H_MV5 772 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 773 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } 774 775 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 776 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 777 #endif 605 778 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 606 779 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 607 780 781 #if H_MV5 782 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 783 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 784 #endif 608 785 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 609 786 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 610 787 #if H_MV5 788 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 789 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } 790 #endif 611 791 Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } 612 792 Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } … … 639 819 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 640 820 821 #if H_MV5 822 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } 823 Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } 824 825 Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } 826 Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } 827 828 Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } 829 Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } 830 831 Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } 832 TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } 833 #endif 641 834 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 642 835 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 643 836 #if H_MV5 837 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 838 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 839 #endif 644 840 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 645 841 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } … … 647 843 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 648 844 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 649 650 845 #if H_MV5 846 Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } 847 Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } 848 849 TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } 850 #endif 651 851 // VPS EXTENSION SEMANTICS VARIABLES 652 852 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } … … 654 854 655 855 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 856 #if H_MV5 857 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } 858 #else 656 859 Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); } 657 860 861 #endif 658 862 Void setRefLayers(); 659 863 864 #if H_MV5 865 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 866 Int getNumViews(); 867 868 Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; 869 Int getRefLayerId ( Int layerIdInNuh, Int idx );; 870 #else 660 871 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; 661 872 Int getRefLayerId ( Int layerIdInVps, Int idx );; … … 668 879 Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; } 669 880 Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; } 670 881 #endif 671 882 Bool checkVPSExtensionSyntax(); 672 883 Int scalTypeToScalIdx ( ScalabilityType scalType ); 673 884 885 #if H_MV5 886 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 887 #else 674 888 Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 889 #endif 890 675 891 Int getNumLayersInIdList ( Int lsIdx );; 676 892 … … 679 895 Int inferLastDimsionIdLenMinus1(); 680 896 897 #if H_MV5 898 // helpers 899 Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); 900 #endif 901 /// VPS EXTENSION 2 SYNTAX ELEMENTS 681 902 #if H_3D 903 #if H_MV5 904 Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } 905 #else 682 906 Void initViewIndex(); 683 907 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } 684 908 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 909 #endif 685 910 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 686 911 … … 735 960 Int m_winTopOffset; 736 961 Int m_winBottomOffset; 962 #if H_MV5 963 #if H_MV 964 Bool m_scaledFlag; 965 #endif 966 #endif 737 967 public: 738 968 Window() … … 742 972 , m_winTopOffset (0) 743 973 , m_winBottomOffset (0) 974 #if H_MV5 975 #if H_MV 976 , m_scaledFlag(true) 977 #endif 978 #endif 744 979 { } 745 980 … … 755 990 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 756 991 992 #if H_MV5 993 #if H_MV 994 Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } 995 Bool getScaledFlag() const { return m_scaledFlag; } 996 Void scaleOffsets( Int scal ) 997 { 998 if (! m_scaledFlag ) 999 { 1000 m_scaledFlag = true; 1001 m_winLeftOffset *= scal; 1002 m_winRightOffset *= scal; 1003 m_winTopOffset *= scal; 1004 m_winBottomOffset *= scal; 1005 } 1006 } 1007 #endif 1008 #endif 757 1009 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) 758 1010 { … … 802 1054 TComHRD m_hrdParameters; 803 1055 TimingInfo m_timingInfo; 1056 #if !H_MV5 804 1057 #if H_MV 805 1058 Bool m_tileBoundariesAlignedFlag; 1059 #endif 806 1060 #endif 807 1061 … … 837 1091 ,m_log2MaxMvLengthHorizontal(15) 838 1092 ,m_log2MaxMvLengthVertical(15) 1093 #if !H_MV5 839 1094 #if H_MV 840 1095 ,m_tileBoundariesAlignedFlag(true) 1096 #endif 841 1097 #endif 842 1098 {} … … 935 1191 TComHRD* getHrdParameters () { return &m_hrdParameters; } 936 1192 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1193 #if !H_MV5 937 1194 #if H_MV 938 1195 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } 939 1196 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } 940 1197 #endif 1198 #endif 1199 941 1200 }; 942 1201 … … 1022 1281 TComPTL m_pcPTL; 1023 1282 #if H_MV 1283 #if H_MV5 1284 TComVPS* m_pcVPS; 1285 // SPS 1286 Bool m_spsInferScalingListFlag; 1287 Int m_spsScalingListRefLayerId; 1288 Bool m_updateRepFormatFlag; 1289 #endif 1290 // SPS Extension 1024 1291 Bool m_interViewMvVertConstraintFlag; 1292 #if !H_MV5 1025 1293 Int m_numIlpRestrictedRefLayers ; 1026 1294 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS]; 1027 1295 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS]; 1028 1296 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS]; 1297 #endif 1029 1298 #endif 1030 1299 #if H_3D … … 1163 1432 TComPTL* getPTL() { return &m_pcPTL; } 1164 1433 #if H_MV 1434 #if H_MV5 1435 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1436 TComVPS* getVPS () { return m_pcVPS; } 1437 1438 Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } 1439 Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } 1440 1441 Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } 1442 Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } 1443 1444 Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } 1445 Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } 1446 #endif 1447 // SPS Extension 1165 1448 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1166 1449 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1167 1168 //// sps_extension_vui_parameters( ) 1450 #if H_MV5 1451 // Inference 1452 Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); 1453 1454 Void inferScalingList( TComSPS* spsSrc ); 1455 #else 1169 1456 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} 1170 1457 Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} … … 1178 1465 Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} 1179 1466 Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} 1467 1468 #endif 1180 1469 #endif 1181 1470 #if H_3D_QTLPC … … 1293 1582 Int m_numExtraSliceHeaderBits; 1294 1583 1584 #if H_MV5 1585 #if H_MV 1586 Int m_layerId; 1587 Bool m_ppsInferScalingListFlag; 1588 Int m_ppsScalingListRefLayerId; 1589 #endif 1590 #endif 1295 1591 public: 1296 1592 TComPPS(); … … 1414 1710 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1415 1711 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1712 #if H_MV5 1713 #if H_MV 1714 Void setLayerId( Int val ) { m_layerId = val; } 1715 Int getLayerId( ) { return m_layerId; } 1716 1717 Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } 1718 Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } 1719 1720 Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } 1721 Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } 1722 #endif 1723 #endif 1416 1724 }; 1417 1725 … … 1446 1754 Bool m_PicOutputFlag; ///< pic_output_flag 1447 1755 Int m_iPOC; 1756 #if H_MV5 1757 #if H_MV 1758 Int m_iPOCBeforeReset; 1759 #endif 1760 #endif 1448 1761 Int m_iLastIDR; 1449 1762 static Int m_prevPOC; … … 1540 1853 Bool m_enableTMVPFlag; 1541 1854 #if H_MV 1855 #if H_MV5 1856 std::vector<TComPic*>* m_refPicSetInterLayer0; 1857 std::vector<TComPic*>* m_refPicSetInterLayer1; 1858 Int m_layerId; 1859 Int m_viewId; 1860 Int m_viewIndex; 1861 #if H_3D 1862 Bool m_isDepth; 1863 #endif 1864 #else 1542 1865 std::vector<TComPic*>* m_refPicSetInterLayer; 1543 1866 Int m_layerId; … … 1547 1870 Bool m_isDepth; 1548 1871 #endif 1872 #endif 1549 1873 1550 1874 // Additional slice header syntax elements 1875 #if H_MV5 1876 Bool m_pocResetFlag; 1877 #endif 1551 1878 Bool m_discardableFlag; 1552 1879 Bool m_interLayerPredEnabledFlag; 1553 1880 Int m_numInterLayerRefPicsMinus1; 1554 1881 Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; 1882 #if !H_MV5 1555 1883 Bool m_interLayerSamplePredOnlyFlag; 1556 1884 Bool m_altCollocatedIndicationFlag; … … 1560 1888 Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ]; 1561 1889 1890 #endif 1562 1891 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1563 1892 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; … … 1693 2022 1694 2023 #if H_MV 2024 #if H_MV5 2025 Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } 2026 Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } 2027 #endif 1695 2028 Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } 1696 2029 Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } 1697 #endif 1698 #if H_MV 2030 #if H_MV5 2031 Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, 2032 std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2033 2034 Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2035 #else 1699 2036 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false ); 2037 #endif 1700 2038 #else 1701 2039 #if FIX1071 … … 1746 2084 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 1747 2085 #if H_MV 2086 #if !H_MV5 1748 2087 Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ); 1749 2088 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer ); 2089 #else 2090 Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); 2091 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); 2092 #endif 1750 2093 static Void markCurrPic ( TComPic* currPic );; 1751 2094 static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); 2095 #if H_MV5 2096 Void printRefPicList(); 2097 #else 1752 2098 Void xPrintRefPicList(); 2099 #endif 1753 2100 #endif 1754 2101 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 1837 2184 Void setViewId ( Int viewId ) { m_viewId = viewId; } 1838 2185 Int getViewId () { return m_viewId; } 2186 #if H_MV5 2187 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 2188 Int getViewIndex () { return m_viewIndex; } 2189 #endif 1839 2190 #if H_3D 1840 2191 #if H_3D_TMVP … … 1843 2194 Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } 1844 2195 #endif 2196 #if !H_MV5 1845 2197 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 1846 2198 Int getViewIndex () { return m_viewIndex; } 2199 #endif 1847 2200 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 1848 2201 Bool getIsDepth () { return m_isDepth; } … … 1865 2218 #if H_MV 1866 2219 // Additional slice header syntax elements 2220 2221 #if H_MV5 2222 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2223 Bool getPocResetFlag( ) { return m_pocResetFlag; } 2224 #endif 2225 1867 2226 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 1868 2227 Bool getDiscardableFlag( ) { return m_discardableFlag; } … … 1877 2236 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 1878 2237 2238 #if H_MV5 2239 // Additional variables derived in slice header semantics 2240 Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2241 Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2242 2243 Int getNumActiveRefLayerPics( ); 2244 2245 Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; 2246 Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; 2247 2248 Int getRefPicLayerId ( Int i ); 2249 2250 Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); 2251 TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); 2252 #else 1879 2253 Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; } 1880 2254 Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } … … 1903 2277 TComPic* getPicFromRefPicSetInterLayer( Int layerId ); 1904 2278 2279 #endif 1905 2280 #endif 1906 2281 protected: … … 1909 2284 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1910 2285 #if H_MV 2286 #if !H_MV5 1911 2287 Int xCeilLog2( Int val ); 2288 #endif 1912 2289 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); 1913 2290 #endif … … 1991 2368 //! activate a SPS from a active parameter sets SEI message 1992 2369 //! \returns true, if activation is successful 2370 #if !H_MV5 1993 2371 Bool activateSPSWithSEI(Int SPSId); 1994 2372 … … 2010 2388 Int m_activeSPSId; 2011 2389 Int m_activePPSId; 2390 #else 2391 #if H_MV 2392 Bool activateSPSWithSEI(Int SPSId, Int layerId ); 2393 #else 2394 Bool activateSPSWithSEI(Int SPSId); 2395 #endif 2396 2397 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2398 //! \returns true, if activation is successful 2399 #if H_MV 2400 Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); 2401 #else 2402 Bool activatePPS(Int ppsId, Bool isIRAP); 2403 #endif 2404 2405 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; 2406 #if H_MV 2407 TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; 2408 TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; 2409 #else 2410 TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; 2411 TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; 2412 #endif 2413 protected: 2414 2415 ParameterSetMap<TComVPS> m_vpsMap; 2416 ParameterSetMap<TComSPS> m_spsMap; 2417 ParameterSetMap<TComPPS> m_ppsMap; 2418 2419 Int m_activeVPSId; 2420 #if H_MV 2421 Int m_activeSPSId[ MAX_NUM_LAYERS ]; 2422 Int m_activePPSId[ MAX_NUM_LAYERS ]; 2423 #else 2424 Int m_activeSPSId; 2425 Int m_activePPSId; 2426 #endif 2427 2428 #endif 2012 2429 }; 2013 2430 -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TComYuv.cpp
r608 r618 110 110 { 111 111 ::memcpy( pDst, pSrc, sizeof(Pel)*iWidth); 112 113 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 114 if ( g_traceCopyBack && g_nSymbolCounter >= g_stopAtCounter ) 115 { 116 for ( Int x = 0; x < iWidth; x++) 117 { 118 std::cout << pSrc[ x ] << " " ; 119 } 120 std::cout << std::endl; 121 } 122 #endif 123 112 124 pDst += iDstStride; 113 125 pSrc += iSrcStride; -
branches/HTM-8.0-dev0/source/Lib/TLibCommon/TypeDef.h
r616 r618 70 70 #if H_MV 71 71 #define H_MV_ENC_DEC_TRAC 1 //< CU/PU level tracking 72 #define H_MV5 1 72 73 #endif 73 74 … … 791 792 enum ScalabilityType 792 793 { 794 #if H_MV5 795 #if H_3D 796 DEPTH_ID = 0, 797 #endif 798 VIEW_ORDER_INDEX = 1, 799 #else 793 800 VIEW_ID = 0, 794 801 #if H_3D 795 802 DEPTH_ID = 1, 796 803 #endif 804 #endif 797 805 }; 798 806 #endif
Note: See TracChangeset for help on using the changeset viewer.