Changeset 133 in SHVCSoftware for branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 28 Apr 2013, 08:49:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r125 r133 54 54 , m_iPOC ( 0 ) 55 55 , m_iLastIDR ( 0 ) 56 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR )56 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 57 57 , m_eSliceType ( I_SLICE ) 58 58 , m_iSliceQp ( 0 ) … … 65 65 , m_deblockingFilterBetaOffsetDiv2 ( 0 ) 66 66 , m_deblockingFilterTcOffsetDiv2 ( 0 ) 67 #if !L0034_COMBINED_LIST_CLEANUP 67 68 , m_bRefPicListModificationFlagLC ( false ) 68 69 , m_bRefPicListCombinationFlag ( false ) 70 #endif 69 71 , m_bCheckLDC ( false ) 70 72 , m_iSliceQpDelta ( 0 ) … … 84 86 , m_dLambda ( 0.0 ) 85 87 #endif 86 , m_bNoBackPredFlag ( false ) 88 #if !L0034_COMBINED_LIST_CLEANUP 89 , m_bNoBackPredFlag ( false ) 90 #endif 87 91 , m_uiTLayer ( 0 ) 88 92 #if SVC_EXTENSION … … 113 117 , m_enableTMVPFlag ( true ) 114 118 { 119 #if L0034_COMBINED_LIST_CLEANUP 120 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; 121 #else 115 122 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 123 #endif 116 124 117 125 #if REF_LIST_BUGFIX … … 120 128 initEqualRef(); 121 129 130 #if L0034_COMBINED_LIST_CLEANUP 131 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 132 { 133 m_list1IdxToList0Idx[idx] = -1; 134 } 135 #else 122 136 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) 123 137 { … … 129 143 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; 130 144 } 145 #endif 131 146 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 132 147 { … … 136 151 m_aiRefPOCList [1][iNumCount] = 0; 137 152 } 138 resetWpScaling( m_weightPredTable);153 resetWpScaling(); 139 154 initWpAcDcParam(); 140 155 m_saoEnabledFlag = false; … … 173 188 m_colRefIdx = 0; 174 189 initEqualRef(); 190 #if !L0034_COMBINED_LIST_CLEANUP 175 191 m_bNoBackPredFlag = false; 176 192 m_bRefPicListCombinationFlag = false; 177 193 m_bRefPicListModificationFlagLC = false; 194 #endif 178 195 m_bCheckLDC = false; 179 196 m_iSliceQpDeltaCb = 0; 180 197 m_iSliceQpDeltaCr = 0; 181 198 199 #if !L0034_COMBINED_LIST_CLEANUP 182 200 m_aiNumRefIdx[REF_PIC_LIST_C] = 0; 201 #endif 183 202 184 203 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 194 213 Bool TComSlice::getRapPicFlag() 195 214 { 196 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 215 return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 197 216 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 198 217 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 199 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT200 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 218 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 219 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 201 220 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 202 221 } … … 213 232 } 214 233 215 Void TComSlice::sortPicList 234 Void TComSlice::sortPicList(TComList<TComPic*>& rcListPic) 216 235 { 217 236 TComPic* pcPicExtract; … … 268 287 269 288 270 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic, 271 Int poc) 289 TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb) 272 290 { 273 291 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 274 292 TComPic* pcPic = *(iterPic); 275 293 TComPic* pcStPic = pcPic; 294 295 Int pocCycle = 1 << getSPS()->getBitsForPOC(); 296 if (!pocHasMsb) 297 { 298 poc = poc % pocCycle; 299 } 300 276 301 while ( iterPic != rcListPic.end() ) 277 302 { 278 303 pcPic = *(iterPic); 279 if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC()))) 280 { 281 if(pcPic->getIsLongTerm()) 304 if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced()) 305 { 306 Int picPoc = pcPic->getPOC(); 307 if (!pocHasMsb) 308 { 309 picPoc = picPoc % pocCycle; 310 } 311 312 if (poc == picPoc) 313 { 314 if (pcPic->getIsLongTerm()) 282 315 { 283 316 return pcPic; … … 289 322 break; 290 323 } 324 } 291 325 292 326 iterPic++; 293 327 } 328 294 329 return pcStPic; 295 330 } 296 331 297 Void TComSlice::setRefPOCList 332 Void TComSlice::setRefPOCList() 298 333 { 299 334 for (Int iDir = 0; iDir < 2; iDir++) … … 307 342 } 308 343 344 #if L0034_COMBINED_LIST_CLEANUP 345 Void TComSlice::setList1IdxToList0Idx() 346 { 347 Int idxL0, idxL1; 348 for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ ) 349 { 350 m_list1IdxToList0Idx[idxL1] = -1; 351 for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ ) 352 { 353 if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() ) 354 { 355 m_list1IdxToList0Idx[idxL1] = idxL0; 356 break; 357 } 358 } 359 } 360 } 361 #else 309 362 Void TComSlice::generateCombinedList() 310 363 { … … 369 422 } 370 423 } 371 372 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic) 373 { 424 #endif 425 426 #if FIX1071 427 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 428 #else 429 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 430 #endif 431 { 432 #if FIX1071 433 if (!checkNumPocTotalCurr) 434 #endif 435 { 374 436 #if REF_IDX_FRAMEWORK 375 437 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 376 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA ) &&438 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 377 439 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 378 440 #else … … 388 450 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 389 451 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 452 } 390 453 391 454 TComPic* pcRefPic= NULL; … … 410 473 } 411 474 } 475 412 476 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++) 413 477 { … … 422 486 } 423 487 } 488 424 489 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--) 425 490 { 426 491 if(m_pcRPS->getUsed(i)) 427 492 { 428 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );493 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 429 494 pcRefPic->setIsLongTerm(1); 430 495 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 434 499 if(pcRefPic==NULL) 435 500 { 436 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );501 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 437 502 } 438 503 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); … … 443 508 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 444 509 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 445 446 { 510 #if FIX1071 511 if (checkNumPocTotalCurr) 512 { 513 // 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: 514 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 515 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 516 if (getRapPicFlag()) 517 { 518 assert(numPocTotalCurr == 0); 519 } 520 521 if (m_eSliceType == I_SLICE) 522 { 523 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 524 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 525 526 return; 527 } 528 529 assert(numPocTotalCurr != 0); 530 531 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 532 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 533 } 534 #endif 535 447 536 Int cIdx = 0; 448 537 for ( i=0; i<NumPocStCurr0; i++, cIdx++) … … 458 547 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 459 548 } 460 }461 549 462 550 if (m_eSliceType==B_SLICE) 463 551 { 464 IntcIdx = 0;552 cIdx = 0; 465 553 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 466 554 { … … 509 597 } 510 598 511 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 599 if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) 600 { 512 601 return; 602 } 513 603 514 604 TComRefPicListModification* refPicListModification = this->getRefPicListModification(); … … 589 679 590 680 //temporal reference pictures 591 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )681 if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) 592 682 { 593 683 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++) … … 619 709 if(m_pcRPS->getUsed(i)) 620 710 { 621 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );711 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 622 712 pcRefPic->setIsLongTerm(1); 623 713 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 627 717 if(pcRefPic==NULL) 628 718 { 629 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i) );719 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i)); 630 720 } 631 721 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); … … 636 726 #if REF_IDX_MFM 637 727 assert(m_aiNumILRRefIdx == 1); 638 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())728 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 639 729 { 640 730 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); … … 672 762 { 673 763 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList0; cIdx++,i++) 674 refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ]; 675 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++) 676 refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ]; 677 for ( i=0; i<NumPocLtCurr && 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 { 678 773 refPicListTemp0[cIdx] = RefPicSetLtCurr[ i ]; 774 } 679 775 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList0; cIdx++,i++) 776 { 680 777 refPicListTemp0[cIdx] = ilpPic[ i ]; 778 } 681 779 } 682 780 cIdx = 0; 683 781 while (cIdx<numRpsCurrTempList1 && m_eSliceType==B_SLICE) 684 782 { 685 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++) 783 for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++) 784 { 686 785 refPicListTemp1[cIdx] = RefPicSetStCurr1[ i ]; 687 for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++) 688 refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ]; 689 for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,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 { 690 793 refPicListTemp1[cIdx] = RefPicSetLtCurr[ i ]; 794 } 691 795 for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList1; cIdx++,i++) 796 { 692 797 refPicListTemp1[cIdx] = ilpPic[ i ]; 798 } 693 799 } 694 800 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); … … 724 830 #if REF_IDX_FRAMEWORK 725 831 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 726 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA ) &&832 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 727 833 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 728 834 #else … … 793 899 } 794 900 795 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA )901 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic) 796 902 { 797 903 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 806 912 if(pocCRA < MAX_UINT && getPOC() > pocCRA) 807 913 { 914 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 915 { 916 assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA); 917 } 918 else 919 { 808 920 assert(pReferencePictureSet->getPOC(i) >= pocCRA); 809 921 } 810 922 } 811 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 923 } 924 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found 812 925 { 813 926 pocCRA = getPOC(); … … 819 932 prevRAPisBLA = false; 820 933 } 821 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 822 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT934 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 935 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 823 936 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found 824 937 { … … 851 964 Int pocCurr = getPOC(); 852 965 853 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 854 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT966 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 967 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 855 968 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 856 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR 969 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 857 970 || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR or BLA picture 858 971 { … … 866 979 iterPic++; 867 980 } 868 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA 869 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA NT981 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 982 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 870 983 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) 871 984 { … … 881 994 { 882 995 rpcPic = *(iterPic); 883 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false); 996 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) 997 { 998 rpcPic->getSlice(0)->setReferenced(false); 999 } 884 1000 iterPic++; 885 1001 } … … 912 1028 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 913 1029 1030 #if L0034_COMBINED_LIST_CLEANUP 1031 for (i = 0; i < 2; i++) 1032 #else 914 1033 for (i = 0; i < 3; i++) 1034 #endif 915 1035 { 916 1036 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 917 1037 } 918 1038 1039 #if L0034_COMBINED_LIST_CLEANUP 1040 for (i = 0; i < MAX_NUM_REF; i++) 1041 { 1042 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 1043 } 1044 #else 919 1045 for (i = 0; i < 2; i++) 920 1046 { … … 933 1059 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; 934 1060 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; 1061 #endif 935 1062 m_bCheckLDC = pSrc->m_bCheckLDC; 936 1063 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 984 1111 } 985 1112 1113 #if !L0034_COMBINED_LIST_CLEANUP 986 1114 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; 1115 #endif 987 1116 m_uiTLayer = pSrc->m_uiTLayer; 988 1117 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 1018 1147 1019 1148 Int TComSlice::m_prevPOC = 0; 1149 1020 1150 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. 1021 1151 * \param uiTLayer Temporal layer ID of the current slice … … 1078 1208 Int i, isReference; 1079 1209 1080 Int j = 0;1081 1210 // loop through all pictures in the reference picture buffer 1082 1211 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1083 1212 while ( iterPic != rcListPic.end()) 1084 1213 { 1085 j++;1086 1214 rpcPic = *(iterPic++); 1215 1216 if(!rpcPic->getSlice( 0 )->isReferenced()) 1217 { 1218 continue; 1219 } 1087 1220 1088 1221 isReference = 0; … … 1123 1256 { 1124 1257 rpcPic->getSlice( 0 )->setReferenced( false ); 1258 rpcPic->setUsedByCurr(0); 1125 1259 rpcPic->setIsLongTerm(0); 1126 1260 } … … 1128 1262 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer()); 1129 1263 //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture 1130 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)1264 if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N) 1131 1265 { 1132 1266 assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer()); … … 1145 1279 { 1146 1280 TComPic* rpcPic; 1147 Int i, isAvailable , j;1281 Int i, isAvailable; 1148 1282 Int atLeastOneLost = 0; 1149 1283 Int atLeastOneRemoved = 0; … … 1154 1288 for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++) 1155 1289 { 1156 j = 0;1157 1290 isAvailable = 0; 1158 1291 // loop through all pictures in the reference picture buffer … … 1160 1293 while ( iterPic != rcListPic.end()) 1161 1294 { 1162 j++;1163 1295 rpcPic = *(iterPic++); 1164 1296 if(pReferencePictureSet->getCheckLTMSBPresent(i)==true) … … 1183 1315 while ( iterPic != rcListPic.end()) 1184 1316 { 1185 j++;1186 1317 rpcPic = *(iterPic++); 1187 1318 1188 if((rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == (this->getPOC() + pReferencePictureSet->getDeltaPOC(i))%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced()) 1319 Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1320 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC(); 1321 Int refPoc = pReferencePictureSet->getPOC(i); 1322 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1323 { 1324 curPoc = curPoc % pocCycle; 1325 refPoc = refPoc % pocCycle; 1326 } 1327 1328 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1189 1329 { 1190 1330 isAvailable = 1; … … 1224 1364 for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++) 1225 1365 { 1226 j = 0;1227 1366 isAvailable = 0; 1228 1367 // loop through all pictures in the reference picture buffer … … 1230 1369 while ( iterPic != rcListPic.end()) 1231 1370 { 1232 j++;1233 1371 rpcPic = *(iterPic++); 1234 1372 … … 1247 1385 { 1248 1386 if(printErrors) 1387 { 1249 1388 printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1389 } 1250 1390 atLeastOneRemoved = 1; 1251 1391 } … … 1253 1393 { 1254 1394 if(printErrors) 1395 { 1255 1396 printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i)); 1397 } 1256 1398 atLeastOneLost = 1; 1257 1399 iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i); … … 1399 1541 * \returns Void 1400 1542 */ 1401 Void TComSlice::resetWpScaling( wpScalingParam wp[2][MAX_NUM_REF][3])1543 Void TComSlice::resetWpScaling() 1402 1544 { 1403 1545 for ( Int e=0 ; e<2 ; e++ ) … … 1407 1549 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1408 1550 { 1409 wpScalingParam *pwp = &( wp[e][i][yuv]);1551 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1410 1552 pwp->bPresentFlag = false; 1411 1553 pwp->uiLog2WeightDenom = 0; … … 1423 1565 Void TComSlice::initWpScaling() 1424 1566 { 1425 initWpScaling(m_weightPredTable);1426 }1427 1428 /** set WP tables1429 * \param wpScalingParam1430 * \returns Void1431 */1432 Void TComSlice::initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3])1433 {1434 1567 for ( Int e=0 ; e<2 ; e++ ) 1435 1568 { … … 1438 1571 for ( Int yuv=0 ; yuv<3 ; yuv++ ) 1439 1572 { 1440 wpScalingParam *pwp = &(wp[e][i][yuv]); 1441 if ( !pwp->bPresentFlag ) { 1573 wpScalingParam *pwp = &(m_weightPredTable[e][i][yuv]); 1574 if ( !pwp->bPresentFlag ) 1575 { 1442 1576 // Inferring values not present : 1443 1577 pwp->iWeight = (1 << pwp->uiLog2WeightDenom); … … 1482 1616 { 1483 1617 m_numReorderPics[i] = 0; 1618 #if L0323_DPB 1619 m_uiMaxDecPicBuffering[i] = 1; 1620 #else 1484 1621 m_uiMaxDecPicBuffering[i] = 0; 1622 #endif 1485 1623 m_uiMaxLatencyIncrease[i] = 0; 1486 1624 } … … 1516 1654 TComVPS::~TComVPS() 1517 1655 { 1518 if( m_hrdParameters != NULL ) delete m_hrdParameters;1519 if( m_hrdOpSetIdx != NULL ) delete m_hrdOpSetIdx;1520 if( m_cprmsPresentFlag != NULL ) delete m_cprmsPresentFlag;1656 if( m_hrdParameters != NULL ) delete[] m_hrdParameters; 1657 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1658 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1521 1659 } 1522 1660 … … 1533 1671 , m_picWidthInLumaSamples (352) 1534 1672 , m_picHeightInLumaSamples (288) 1673 , m_log2MinCodingBlockSize ( 0) 1674 , m_log2DiffMaxMinCodingBlockSize (0) 1535 1675 , m_uiMaxCUWidth ( 32) 1536 1676 , m_uiMaxCUHeight ( 32) 1537 1677 , m_uiMaxCUDepth ( 3) 1538 , m_uiMinTrDepth ( 0)1539 , m_uiMaxTrDepth ( 1)1540 1678 , m_bLongTermRefsPresent (false) 1541 1679 , m_uiQuadtreeTULog2MaxSize ( 0) … … 1547 1685 , m_pcmLog2MaxSize ( 5) 1548 1686 , m_uiPCMLog2MinSize ( 7) 1687 #if !L0034_COMBINED_LIST_CLEANUP 1549 1688 , m_bUseLComb (false) 1689 #endif 1550 1690 , m_bitDepthY ( 8) 1551 1691 , m_bitDepthC ( 8) … … 1572 1712 { 1573 1713 m_uiMaxLatencyIncrease[i] = 0; 1714 #if L0323_DPB 1715 m_uiMaxDecPicBuffering[i] = 1; 1716 #else 1574 1717 m_uiMaxDecPicBuffering[i] = 0; 1718 #endif 1575 1719 m_numReorderPics[i] = 0; 1576 1720 } … … 1591 1735 m_RPSList.create(numRPS); 1592 1736 } 1737 1593 1738 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 1594 1739 { … … 1835 1980 return m_POC[bufferNum]; 1836 1981 } 1982 1837 1983 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC) 1838 1984 { 1839 1985 m_POC[bufferNum] = POC; 1840 1986 } 1987 1841 1988 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) 1842 1989 { 1843 1990 return m_bCheckLTMSB[bufferNum]; 1844 1991 } 1992 1845 1993 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b) 1846 1994 { … … 2022 2170 return (defaultCounter == (SCALING_LIST_NUM * SCALING_LIST_SIZE_NUM - 4)) ? false : true; // -4 for 32x32 2023 2171 } 2172 2024 2173 /** get scaling matrix from RefMatrixID 2025 2174 * \param sizeId size index … … 2031 2180 ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 2032 2181 } 2182 2033 2183 /** parse syntax infomation 2034 2184 * \param pchFile syntax infomation … … 2123 2273 m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32 2124 2274 } 2275 2125 2276 /** destroy quantization matrix array 2126 2277 */ … … 2135 2286 } 2136 2287 } 2288 2137 2289 /** get default address of quantization matrix 2138 2290 * \param sizeId size index … … 2164 2316 return src; 2165 2317 } 2318 2166 2319 /** process of default matrix 2167 2320 * \param sizeId size index … … 2173 2326 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 2174 2327 } 2328 2175 2329 /** check DC value of matrix for default matrix signaling 2176 2330 */ … … 2240 2394 //! activate a PPS and depending on isIDR parameter also SPS and VPS 2241 2395 //! \returns true, if activation is successful 2242 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isI DR)2396 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP) 2243 2397 { 2244 2398 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 2246 2400 { 2247 2401 Int spsId = pps->getSPSId(); 2248 if (!isI DR&& (spsId != m_activeSPSId))2249 { 2250 printf("Warning: tried to activate PPS referring to a inactive SPS at non-I DR.");2402 if (!isIRAP && (spsId != m_activeSPSId)) 2403 { 2404 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP."); 2251 2405 return false; 2252 2406 } … … 2255 2409 { 2256 2410 Int vpsId = sps->getVPSId(); 2257 if (!isI DR&& (vpsId != m_activeVPSId))2258 { 2259 printf("Warning: tried to activate PPS referring to a inactive VPS at non-I DR.");2411 if (!isIRAP && (vpsId != m_activeVPSId)) 2412 { 2413 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP."); 2260 2414 return false; 2261 2415 } … … 2403 2557 assert(iRefPicNum == 1); 2404 2558 #if RAP_MFM_INIT 2405 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())2559 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 2406 2560 #else 2407 2561 if( getPOC() != 0 )
Note: See TracChangeset for help on using the changeset viewer.