Changeset 302 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 28 Jun 2013, 00:40:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r300 r302 65 65 , m_deblockingFilterBetaOffsetDiv2 ( 0 ) 66 66 , m_deblockingFilterTcOffsetDiv2 ( 0 ) 67 #if !L0034_COMBINED_LIST_CLEANUP68 , m_bRefPicListModificationFlagLC ( false )69 , m_bRefPicListCombinationFlag ( false )70 #endif71 67 , m_bCheckLDC ( false ) 72 68 , m_iSliceQpDelta ( 0 ) … … 88 84 #else 89 85 , m_dLambda ( 0.0 ) 90 #endif91 #if !L0034_COMBINED_LIST_CLEANUP92 , m_bNoBackPredFlag ( false )93 86 #endif 94 87 , m_uiTLayer ( 0 ) … … 119 112 , m_enableTMVPFlag ( true ) 120 113 { 121 #if L0034_COMBINED_LIST_CLEANUP122 114 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; 123 #else124 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;125 #endif126 115 127 116 #if SVC_EXTENSION … … 148 137 initEqualRef(); 149 138 150 #if L0034_COMBINED_LIST_CLEANUP151 139 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 152 140 { 153 141 m_list1IdxToList0Idx[idx] = -1; 154 142 } 155 #else156 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)157 {158 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;159 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;160 m_eListIdFromIdxOfLC[iNumCount]=0;161 m_iRefIdxFromIdxOfLC[iNumCount]=0;162 m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;163 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;164 }165 #endif166 143 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 167 144 { … … 210 187 m_colRefIdx = 0; 211 188 initEqualRef(); 212 #if !L0034_COMBINED_LIST_CLEANUP213 m_bNoBackPredFlag = false;214 m_bRefPicListCombinationFlag = false;215 m_bRefPicListModificationFlagLC = false;216 #endif217 189 m_bCheckLDC = false; 218 190 m_iSliceQpDeltaCb = 0; 219 191 m_iSliceQpDeltaCr = 0; 220 221 #if !L0034_COMBINED_LIST_CLEANUP222 m_aiNumRefIdx[REF_PIC_LIST_C] = 0;223 #endif224 192 225 193 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 364 332 } 365 333 366 #if L0034_COMBINED_LIST_CLEANUP367 334 Void TComSlice::setList1IdxToList0Idx() 368 335 { … … 381 348 } 382 349 } 383 #else384 Void TComSlice::generateCombinedList()385 {386 if(m_aiNumRefIdx[REF_PIC_LIST_C] > 0)387 {388 m_aiNumRefIdx[REF_PIC_LIST_C]=0;389 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)390 {391 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;392 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;393 m_eListIdFromIdxOfLC[iNumCount]=0;394 m_iRefIdxFromIdxOfLC[iNumCount]=0;395 m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;396 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;397 }398 399 for (Int iNumRefIdx = 0; iNumRefIdx < MAX_NUM_REF; iNumRefIdx++)400 {401 if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_0])402 {403 Bool bTempRefIdxInL2 = true;404 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )405 {406 if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )407 {408 m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];409 m_iRefIdxOfL0FromRefIdxOfL1[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;410 bTempRefIdxInL2 = false;411 break;412 }413 }414 415 if(bTempRefIdxInL2 == true)416 {417 m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0;418 m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;419 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;420 }421 }422 423 if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_1])424 {425 Bool bTempRefIdxInL2 = true;426 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )427 {428 if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )429 {430 m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];431 m_iRefIdxOfL1FromRefIdxOfL0[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;432 bTempRefIdxInL2 = false;433 break;434 }435 }436 if(bTempRefIdxInL2 == true)437 {438 m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_1;439 m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;440 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;441 }442 }443 }444 }445 }446 #endif447 350 448 351 #if FIX1071 352 #if SVC_EXTENSION 449 353 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic) 354 #else 355 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 356 #endif 450 357 #else 451 358 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) … … 456 363 #endif 457 364 { 458 if ( m_eSliceType == I_SLICE)365 if (m_eSliceType == I_SLICE) 459 366 { 460 367 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 461 368 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 369 462 370 return; 463 371 } … … 672 580 } 673 581 674 assert(numPocTotalCurr !=0);582 assert(numPocTotalCurr > 0); 675 583 676 584 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); … … 699 607 { 700 608 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 701 } 609 } 610 702 611 #if REF_IDX_FRAMEWORK 703 612 if( m_layerId > 0 ) … … 718 627 } 719 628 #endif 629 assert(cIdx == numPocTotalCurr); 630 720 631 if (m_eSliceType==B_SLICE) 721 632 { … … 732 643 { 733 644 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 734 } 645 } 646 735 647 #if REF_IDX_FRAMEWORK 736 648 if( m_layerId > 0 ) … … 751 663 } 752 664 #endif 665 666 assert(cIdx == numPocTotalCurr); 753 667 } 754 668 755 669 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); 756 670 757 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++) 758 { 759 m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? rpsCurrList0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : rpsCurrList0[rIdx % numPocTotalCurr]; 760 m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)) 761 : ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1)); 762 } 763 if ( m_eSliceType == P_SLICE ) 671 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++) 672 { 673 cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr; 674 assert(cIdx >= 0 && cIdx < numPocTotalCurr); 675 m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ]; 676 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 ); 677 } 678 if ( m_eSliceType != B_SLICE ) 764 679 { 765 680 m_aiNumRefIdx[1] = 0; … … 768 683 else 769 684 { 770 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++) 771 { 772 m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? rpsCurrList1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : rpsCurrList1[rIdx % numPocTotalCurr]; 773 m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? 774 (m_RefPicListModification.getRefPicSetIdxL1(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)): ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1)); 685 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++) 686 { 687 cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr; 688 assert(cIdx >= 0 && cIdx < numPocTotalCurr); 689 m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ]; 690 m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 ); 775 691 } 776 692 } … … 1071 987 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 1072 988 1073 #if L0034_COMBINED_LIST_CLEANUP1074 989 for (i = 0; i < 2; i++) 1075 #else1076 for (i = 0; i < 3; i++)1077 #endif1078 990 { 1079 991 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 1080 992 } 1081 993 1082 #if L0034_COMBINED_LIST_CLEANUP1083 994 for (i = 0; i < MAX_NUM_REF; i++) 1084 995 { 1085 996 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 1086 997 } 1087 #else1088 for (i = 0; i < 2; i++)1089 {1090 for (j = 0; j < MAX_NUM_REF_LC; j++)1091 {1092 m_iRefIdxOfLC[i][j] = pSrc->m_iRefIdxOfLC[i][j];1093 }1094 }1095 for (i = 0; i < MAX_NUM_REF_LC; i++)1096 {1097 m_eListIdFromIdxOfLC[i] = pSrc->m_eListIdFromIdxOfLC[i];1098 m_iRefIdxFromIdxOfLC[i] = pSrc->m_iRefIdxFromIdxOfLC[i];1099 m_iRefIdxOfL1FromRefIdxOfL0[i] = pSrc->m_iRefIdxOfL1FromRefIdxOfL0[i];1100 m_iRefIdxOfL0FromRefIdxOfL1[i] = pSrc->m_iRefIdxOfL0FromRefIdxOfL1[i];1101 }1102 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;1103 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag;1104 #endif1105 998 m_bCheckLDC = pSrc->m_bCheckLDC; 1106 999 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 1164 1057 } 1165 1058 1166 #if !L0034_COMBINED_LIST_CLEANUP1167 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag;1168 #endif1169 1059 m_uiTLayer = pSrc->m_uiTLayer; 1170 1060 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 1471 1361 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1472 1362 */ 1363 #if FIX1071 1364 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1365 #else 1473 1366 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet) 1367 #endif 1474 1368 { 1475 1369 TComPic* rpcPic; … … 1496 1390 // and should be added to the explicit Reference Picture Set 1497 1391 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1392 #if FIX1071 1393 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1394 #else 1498 1395 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i)); 1396 #endif 1499 1397 if(pcRPS->getDeltaPOC(k) < 0) 1500 1398 { … … 1674 1572 { 1675 1573 m_numReorderPics[i] = 0; 1676 #if L0323_DPB1677 1574 m_uiMaxDecPicBuffering[i] = 1; 1678 #else1679 m_uiMaxDecPicBuffering[i] = 0;1680 #endif1681 1575 m_uiMaxLatencyIncrease[i] = 0; 1682 1576 } … … 1786 1680 , m_pcmLog2MaxSize ( 5) 1787 1681 , m_uiPCMLog2MinSize ( 7) 1788 #if !L0034_COMBINED_LIST_CLEANUP1789 , m_bUseLComb (false)1790 #endif1791 1682 , m_bitDepthY ( 8) 1792 1683 , m_bitDepthC ( 8) … … 1820 1711 { 1821 1712 m_uiMaxLatencyIncrease[i] = 0; 1822 #if L0323_DPB1823 1713 m_uiMaxDecPicBuffering[i] = 1; 1824 #else1825 m_uiMaxDecPicBuffering[i] = 0;1826 #endif1827 1714 m_numReorderPics[i] = 0; 1828 1715 } … … 1862 1749 TComHRD *hrd = vui->getHrdParameters(); 1863 1750 1864 #if L0043_TIMING_INFO1865 1751 TimingInfo *timingInfo = vui->getTimingInfo(); 1866 1752 timingInfo->setTimingInfoPresentFlag( true ); … … 1886 1772 break; 1887 1773 } 1888 #else1889 hrd->setTimingInfoPresentFlag( true );1890 switch( frameRate )1891 {1892 case 24:1893 hrd->setNumUnitsInTick( 1125000 ); hrd->setTimeScale ( 27000000 );1894 break;1895 case 25:1896 hrd->setNumUnitsInTick( 1080000 ); hrd->setTimeScale ( 27000000 );1897 break;1898 case 30:1899 hrd->setNumUnitsInTick( 900900 ); hrd->setTimeScale ( 27000000 );1900 break;1901 case 50:1902 hrd->setNumUnitsInTick( 540000 ); hrd->setTimeScale ( 27000000 );1903 break;1904 case 60:1905 hrd->setNumUnitsInTick( 450450 ); hrd->setTimeScale ( 27000000 );1906 break;1907 default:1908 hrd->setNumUnitsInTick( 1001 ); hrd->setTimeScale ( 60000 );1909 break;1910 }1911 #endif1912 1774 1913 1775 Bool rateCnt = ( bitRate > 0 ); … … 1922 1784 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 1923 1785 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 1924 #if L0044_DU_DPB_OUTPUT_DELAY_HRD1925 1786 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 1926 #endif1927 1787 } 1928 1788 else … … 1953 1813 UInt birateValue, cpbSizeValue; 1954 1814 UInt ducpbSizeValue; 1955 #if L0363_DU_BIT_RATE1956 1815 UInt duBitRateValue = 0; 1957 #endif1958 1816 1959 1817 for( i = 0; i < MAX_TLAYER; i ++ ) … … 1967 1825 cpbSizeValue = bitRate; // 1 second 1968 1826 ducpbSizeValue = bitRate/numDU; 1969 #if L0363_DU_BIT_RATE1970 1827 duBitRateValue = bitRate; 1971 #endif1972 1828 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 1973 1829 { … … 1980 1836 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 1981 1837 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 1982 #if L0363_DU_BIT_RATE1983 1838 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 1984 #endif1985 1839 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 1986 1840 } … … 2559 2413 , m_profileIdc (0) 2560 2414 , m_levelIdc (0) 2561 #if L0046_CONSTRAINT_FLAGS2562 2415 , m_progressiveSourceFlag (false) 2563 2416 , m_interlacedSourceFlag (false) 2564 2417 , m_nonPackedConstraintFlag(false) 2565 2418 , m_frameOnlyConstraintFlag(false) 2566 #endif2567 2419 { 2568 2420 ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag)); … … 2595 2447 // Copy all information related to general profile 2596 2448 this->getGeneralPTL()->copyProfileInfo(ptl->getGeneralPTL()); 2597 }2598 #endif2599 #if SIGNAL_BITRATE_PICRATE_IN_VPS2600 TComBitRatePicRateInfo::TComBitRatePicRateInfo()2601 {2602 ::memset(m_bitRateInfoPresentFlag, 0, sizeof(m_bitRateInfoPresentFlag));2603 ::memset(m_picRateInfoPresentFlag, 0, sizeof(m_picRateInfoPresentFlag));2604 ::memset(m_avgBitRate, 0, sizeof(m_avgBitRate));2605 ::memset(m_maxBitRate, 0, sizeof(m_maxBitRate));2606 ::memset(m_constantPicRateIdc, 0, sizeof(m_constantPicRateIdc));2607 ::memset(m_avgPicRate, 0, sizeof(m_avgPicRate));2608 2449 } 2609 2450 #endif
Note: See TracChangeset for help on using the changeset viewer.