Changeset 162 in SHVCSoftware for branches/SHM-2.0-dev/source
- Timestamp:
- 8 May 2013, 18:40:29 (12 years ago)
- Location:
- branches/SHM-2.0-dev/source/Lib/TLibCommon
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp
r150 r162 116 116 return; 117 117 } 118 #if REF_IDX_FRAMEWORK && 0119 Void TComPic::createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps, Bool bIsVirtual)120 {121 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );122 if (!bIsVirtual)123 {124 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );125 }126 m_apcPicYuv[1] = NULL;127 128 #if SVC_UPSAMPLING129 if (m_bSpatialEnhLayer)130 {131 m_pcFullPelBaseRec = new TComPicYuv; m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );132 }133 #endif134 135 /* there are no SEI messages associated with this picture initially */136 m_SEIs.clear();137 m_bUsedByCurr = false;138 return;139 }140 #endif141 118 #else 142 119 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 654 631 } 655 632 } 656 #endif 657 658 #if RAP_MFM_INIT 633 659 634 Void TComPic::initUpsampledMvField() 660 635 { -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h
r150 r162 103 103 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 104 104 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 105 #if REF_IDX_FRAMEWORK && 0106 Void createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps = NULL, Bool bIsVirtual = false );107 Void setPicYuvRec(TComPicYuv *pPicYuv) { m_apcPicYuv[1]=pPicYuv; }108 #endif109 105 #else 110 106 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 129 125 #if REF_IDX_MFM 130 126 Void copyUpsampledMvField ( TComPic* pcPicBase ); 131 #if RAP_MFM_INIT132 127 Void initUpsampledMvField (); 133 #endif134 128 #endif 135 129 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r160 r162 123 123 #endif 124 124 125 #if REF_ LIST_BUGFIX125 #if REF_IDX_FRAMEWORK 126 126 m_aiNumILRRefIdx = 0; 127 127 #endif … … 174 174 m_aiNumRefIdx[0] = 0; 175 175 m_aiNumRefIdx[1] = 0; 176 #if REF_ LIST_BUGFIX176 #if REF_IDX_FRAMEWORK 177 177 if(layerId) 178 178 { … … 425 425 426 426 #if FIX1071 427 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr 427 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic) 428 428 #else 429 429 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) … … 434 434 #endif 435 435 { 436 #if REF_IDX_FRAMEWORK 437 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 438 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 439 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 440 #else 441 if (m_eSliceType == I_SLICE) 442 #endif 443 { 444 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 445 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 446 447 return; 448 } 436 if( m_eSliceType == I_SLICE ) 437 { 438 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 439 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 440 return; 441 } 449 442 450 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);451 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);443 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 444 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 452 445 } 453 446 … … 461 454 Int i; 462 455 456 #if REF_IDX_FRAMEWORK 457 if ((getLayerId() == 0) || 458 ((getSPS()->getLayerId()) && !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 459 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) 460 ) 461 { 462 #endif 463 463 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) 464 464 { … … 503 503 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 504 504 } 505 505 #if REF_IDX_FRAMEWORK 506 } 507 #endif 508 509 #if REF_IDX_FRAMEWORK 510 //inter-layer reference picture 511 #if REF_IDX_MFM 512 if (getLayerId()) 513 { 514 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 515 { 516 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); 517 } 518 else 519 { 520 ilpPic[0]->initUpsampledMvField(); 521 } 522 #endif 523 ilpPic[0]->setIsLongTerm(1); 524 } 525 #endif 506 526 // ref_pic_list_init 507 527 TComPic* rpsCurrList0[MAX_NUM_REF+1]; 508 528 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 529 #if REF_IDX_FRAMEWORK 530 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_aiNumILRRefIdx; 531 #else 509 532 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 533 #endif 510 534 #if FIX1071 511 535 if (checkNumPocTotalCurr) … … 547 571 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 548 572 } 549 573 #if REF_IDX_FRAMEWORK 574 if(getLayerId()) 575 { 576 for( i = 0; i < m_aiNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 577 { 578 rpsCurrList0[cIdx] = ilpPic[i]; 579 } 580 } 581 #endif 550 582 if (m_eSliceType==B_SLICE) 551 583 { … … 563 595 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 564 596 } 597 #if REF_IDX_FRAMEWORK 598 if(getLayerId()) 599 { 600 for( i = 0; i < m_aiNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 601 { 602 rpsCurrList1[cIdx] = ilpPic[i]; 603 } 604 } 605 #endif 565 606 } 566 607 … … 589 630 } 590 631 591 #if REF_ LIST_BUGFIX632 #if REF_IDX_FRAMEWORK 592 633 Void TComSlice::setRefPicListModificationSvc() 593 634 { … … 659 700 } 660 701 } 661 return;662 }663 664 Void TComSlice::setRefPicListSvc( TComList<TComPic*>& rcListPic, TComPic** ilpPic )665 {666 assert(getLayerId() > 0);667 668 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);669 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);670 671 TComPic* pcRefPic= NULL;672 TComPic* RefPicSetStCurr0[16];673 TComPic* RefPicSetStCurr1[16];674 TComPic* RefPicSetLtCurr[16];675 UInt NumPocStCurr0 = 0;676 UInt NumPocStCurr1 = 0;677 UInt NumPocLtCurr = 0;678 Int i;679 680 //temporal reference pictures681 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )682 {683 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)684 {685 if(m_pcRPS->getUsed(i))686 {687 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));688 pcRefPic->setIsLongTerm(0);689 pcRefPic->getPicYuvRec()->extendPicBorder();690 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;691 NumPocStCurr0++;692 pcRefPic->setCheckLTMSBPresent(false);693 }694 }695 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)696 {697 if(m_pcRPS->getUsed(i))698 {699 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));700 pcRefPic->setIsLongTerm(0);701 pcRefPic->getPicYuvRec()->extendPicBorder();702 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;703 NumPocStCurr1++;704 pcRefPic->setCheckLTMSBPresent(false);705 }706 }707 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)708 {709 if(m_pcRPS->getUsed(i))710 {711 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));712 pcRefPic->setIsLongTerm(1);713 pcRefPic->getPicYuvRec()->extendPicBorder();714 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;715 NumPocLtCurr++;716 }717 if(pcRefPic==NULL)718 {719 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));720 }721 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));722 }723 }724 725 //inter-layer reference picture726 #if REF_IDX_MFM727 assert(m_aiNumILRRefIdx == 1);728 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())729 {730 ilpPic[0]->copyUpsampledMvField(getBaseColPic());731 }732 else733 {734 ilpPic[0]->initUpsampledMvField();735 }736 #endif737 ilpPic[0]->setIsLongTerm(1);738 739 // ref_pic_list_init740 UInt cIdx = 0;741 UInt num_ref_idx_l0_active_minus1 = m_aiNumRefIdx[0] - 1;742 UInt num_ref_idx_l1_active_minus1 = m_aiNumRefIdx[1] - 1;743 TComPic* refPicListTemp0[MAX_NUM_REF+1];744 TComPic* refPicListTemp1[MAX_NUM_REF+1];745 Int numRpsCurrTempList0, numRpsCurrTempList1;746 747 numRpsCurrTempList0 = numRpsCurrTempList1 = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_aiNumILRRefIdx;748 if (numRpsCurrTempList0 <= num_ref_idx_l0_active_minus1)749 {750 numRpsCurrTempList0 = num_ref_idx_l0_active_minus1 + 1;751 }752 if (numRpsCurrTempList1 <= num_ref_idx_l1_active_minus1)753 {754 numRpsCurrTempList1 = num_ref_idx_l1_active_minus1 + 1;755 }756 757 assert(numRpsCurrTempList0 <= MAX_NUM_REF);758 assert(numRpsCurrTempList1 <= MAX_NUM_REF);759 760 cIdx = 0;761 while (cIdx < numRpsCurrTempList0)762 {763 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList0; cIdx++,i++)764 {765 refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ];766 }767 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++)768 {769 refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ];770 }771 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList0; cIdx++,i++)772 {773 refPicListTemp0[cIdx] = RefPicSetLtCurr[ i ];774 }775 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList0; cIdx++,i++)776 {777 refPicListTemp0[cIdx] = ilpPic[ i ];778 }779 }780 cIdx = 0;781 while (cIdx<numRpsCurrTempList1 && m_eSliceType==B_SLICE)782 {783 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++)784 {785 refPicListTemp1[cIdx] = RefPicSetStCurr1[ i ];786 }787 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++)788 {789 refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ];790 }791 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,i++)792 {793 refPicListTemp1[cIdx] = RefPicSetLtCurr[ i ];794 }795 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList1; cIdx++,i++)796 {797 refPicListTemp1[cIdx] = ilpPic[ i ];798 }799 }800 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));801 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++)802 {803 m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : refPicListTemp0[rIdx % numRpsCurrTempList0];804 m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1))805 : ((rIdx % numRpsCurrTempList0) >= (NumPocStCurr0 + NumPocStCurr1));806 }807 if ( m_eSliceType == P_SLICE )808 {809 m_aiNumRefIdx[1] = 0;810 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));811 }812 else813 {814 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++)815 {816 m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : refPicListTemp1[rIdx % numRpsCurrTempList1];817 m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ?818 (m_RefPicListModification.getRefPicSetIdxL1(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)): ((rIdx % numRpsCurrTempList1) >= (NumPocStCurr0 + NumPocStCurr1));819 }820 }821 822 702 return; 823 703 } … … 836 716 #endif 837 717 { 838 #if REF_ LIST_BUGFIX718 #if REF_IDX_FRAMEWORK 839 719 return m_aiNumILRRefIdx; 840 720 #else … … 849 729 } 850 730 } 851 #if REF_ LIST_BUGFIX731 #if REF_IDX_FRAMEWORK 852 732 if(getLayerId()) 853 733 { … … 2575 2455 #endif 2576 2456 2577 #if REF_IDX_FRAMEWORK2578 Void TComSlice::addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset )2579 {2580 if(getSPS()->getLayerId() && m_eSliceType != I_SLICE)2581 {2582 #if REF_IDX_MFM2583 assert(iRefPicNum == 1);2584 #if RAP_MFM_INIT2585 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())2586 #else2587 if( getPOC() != 0 )2588 #endif2589 {2590 pIlpPicList[0]->copyUpsampledMvField(getBaseColPic());2591 }2592 #if RAP_MFM_INIT2593 else2594 {2595 pIlpPicList[0]->initUpsampledMvField();2596 }2597 #endif2598 #endif2599 //add to list 0;2600 Int iOffset;2601 m_aiNumRefIdx[REF_PIC_LIST_0] += iInsertOffset;2602 iOffset = m_aiNumRefIdx[REF_PIC_LIST_0];2603 for (Int i=0; i<iRefPicNum; i++)2604 {2605 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference2606 m_bIsUsedAsLongTerm[REF_PIC_LIST_0][iOffset + i] = 1; //mark ilp as long-term reference2607 m_apcRefPicList[REF_PIC_LIST_0][iOffset + i] = pIlpPicList[i];2608 m_aiNumRefIdx[REF_PIC_LIST_0]++;2609 //m_aiNumRefIdx[REF_PIC_LIST_C]++;2610 }2611 if(m_eSliceType == B_SLICE)2612 {2613 m_aiNumRefIdx[REF_PIC_LIST_1] += iInsertOffset;2614 iOffset = m_aiNumRefIdx[REF_PIC_LIST_1];2615 for (Int i=0; i<iRefPicNum; i++)2616 {2617 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference2618 m_bIsUsedAsLongTerm[REF_PIC_LIST_1][iOffset + i] = 1; //mark ilp as long-term reference2619 m_apcRefPicList[REF_PIC_LIST_1][iOffset + i] = pIlpPicList[i];2620 m_aiNumRefIdx[REF_PIC_LIST_1]++;2621 //m_aiNumRefIdx[REF_PIC_LIST_C]++;2622 }2623 }2624 }2625 }2626 2627 2457 #if REF_IDX_MFM 2628 2458 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) … … 2664 2494 #endif 2665 2495 2666 2667 #endif2668 2496 //! \} -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h
r160 r162 1388 1388 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1389 1389 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1390 #if REF_ LIST_BUGFIX1390 #if REF_IDX_FRAMEWORK 1391 1391 Int m_aiNumILRRefIdx; //< for inter-layer reference picture ser 1392 1392 #endif … … 1538 1538 Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } 1539 1539 Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } 1540 #if REF_ LIST_BUGFIX1540 #if REF_IDX_FRAMEWORK 1541 1541 Int getNumILRRefIdx ( ) { return m_aiNumILRRefIdx; } 1542 1542 Void setNumILRRefIdx ( Int i ) { m_aiNumILRRefIdx = i; } … … 1617 1617 1618 1618 #if FIX1071 1619 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );1619 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 1620 1620 #else 1621 1621 Void setRefPicList ( TComList<TComPic*>& rcListPic ); … … 1627 1627 Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } 1628 1628 1629 #if REF_ LIST_BUGFIX1629 #if REF_IDX_FRAMEWORK 1630 1630 Void setRefPicListModificationSvc(); 1631 Void setRefPicListSvc ( TComList<TComPic*>& rcListPic, TComPic** ilpPic );1632 1631 #endif 1633 1632 … … 1746 1745 Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } 1747 1746 Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} 1748 #if REF_IDX_FRAMEWORK1749 Void addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset=0 );1750 #endif1751 1747 protected: 1752 1748 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h
r160 r162 87 87 #define ENCODER_FAST_MODE 1 ///< 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. 88 88 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 89 90 #if REF_IDX_MFM91 #define RAP_MFM_INIT 1 ///< initilizing MFM when base layer is RAP picture92 #endif93 #define REF_LIST_BUGFIX 194 95 89 #else 96 90 #define INTRA_BL 1 ///< inter-layer texture prediction
Note: See TracChangeset for help on using the changeset viewer.