- Timestamp:
- 22 Mar 2016, 19:58:32 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1532 r1534 713 713 Int* cfg_auxId[MAX_LAYERS]; 714 714 #endif 715 #if VIEW_SCALABILITY 716 Int* cfg_viewOrderIndex [MAX_LAYERS]; 717 Int* cfg_viewId [MAX_LAYERS]; 718 #endif 715 719 716 720 Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; … … 889 893 cfg_auxId[layer] = &m_apcLayerCfg[layer]->m_auxId; 890 894 #endif 895 #if VIEW_SCALABILITY 896 cfg_viewOrderIndex[layer] = &m_apcLayerCfg[layer]->m_viewOrderIndex; 897 cfg_viewId[layer] = &m_apcLayerCfg[layer]->m_viewId; 898 #endif 891 899 cfg_layerSwitchOffBegin[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffBegin; 892 900 cfg_layerSwitchOffEnd[layer] = &m_apcLayerCfg[layer]->m_layerSwitchOffEnd; … … 1043 1051 #if AUXILIARY_PICTURES 1044 1052 ("AuxId%d", cfg_auxId, 0, m_numLayers, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") 1053 #endif 1054 #if VIEW_SCALABILITY 1055 ("ViewOrderIndex%d", cfg_viewOrderIndex, -1, m_numLayers, "View Order Index per layer") 1056 ("ViewId%d", cfg_viewId, -1, m_numLayers, "View Id per View Order Index") 1045 1057 #endif 1046 1058 ("ConformanceMode%d", cfg_conformanceMode, 0, m_numLayers, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") … … 3021 3033 // check validity of input parameters 3022 3034 #if SVC_EXTENSION 3035 #if VIEW_SCALABILITY 3036 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 3037 { 3038 3039 std::vector<Int> uniqueViewOrderIndices; 3040 std::vector<Int> uniqueViewIds; 3041 for( Int layer_idx = 0; layer_idx < m_numLayers; layer_idx++ ) 3042 { 3043 Bool isIn = false; 3044 for( Int uni = 0; uni < uniqueViewOrderIndices.size(); uni++ ) 3045 { 3046 isIn = isIn || ( *(cfg_viewOrderIndex[ layer_idx ]) == uniqueViewOrderIndices[ uni ] ); 3047 } 3048 if ( !isIn ) 3049 { 3050 uniqueViewOrderIndices.push_back( *(cfg_viewOrderIndex[ layer_idx ]) ); 3051 } 3052 3053 isIn = false; 3054 for( Int uni = 0; uni < uniqueViewIds.size(); uni++ ) 3055 { 3056 isIn = isIn || ( *(cfg_viewId[ layer_idx ]) == uniqueViewIds[ uni ] ); 3057 } 3058 if( !isIn ) 3059 { 3060 uniqueViewIds.push_back( *(cfg_viewId[ layer_idx ]) ); 3061 } 3062 3063 assert(uniqueViewIds.size()==uniqueViewOrderIndices.size()); 3064 3065 m_iNumberOfViews=uniqueViewIds.size(); 3066 3067 } 3068 3069 m_ViewIdVal = uniqueViewIds; 3070 m_iNumberOfViews = (Int)uniqueViewOrderIndices.size(); 3071 } 3072 #endif 3073 3023 3074 for( UInt layerIdx = 0; layerIdx < m_numLayers; layerIdx++ ) 3024 3075 { … … 4078 4129 } 4079 4130 #endif 4131 #if VIEW_SCALABILITY 4132 if (m_scalabilityMask[VIEW_ORDER_INDEX]) 4133 { 4134 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewId < 0 , "ViewId must be greater than or equal to 0"); 4135 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < 0 , "ViewOrderIndex must be greater than or equal to 0"); 4136 4137 if( layerIdx > 0 ) 4138 { 4139 xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < m_apcLayerCfg[layerIdx-1]->m_viewOrderIndex, "ViewOrderIndex shall be increasing"); 4140 } 4141 4142 } 4143 #endif 4080 4144 #if CGS_3D_ASYMLUT 4081 4145 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); … … 4226 4290 4227 4291 #if SVC_EXTENSION 4292 #if VIEW_SCALABILITY 4293 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 4294 { 4295 printf("ViewOrderIndex : %d\n", m_apcLayerCfg[layer]->m_viewOrderIndex ); 4296 printf("ViewId : %d\n", m_apcLayerCfg[layer]->m_viewId ); 4297 } 4298 #endif 4228 4299 printf("PTL index : %d\n", m_apcLayerCfg[layerIdx]->m_layerPTLIdx ); 4229 4300 } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1526 r1534 118 118 Int m_numLayers; ///< number of layers 119 119 Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask 120 #if VIEW_SCALABILITY 121 Int m_iNumberOfViews; ///< number of views 122 std::vector<Int> m_ViewIdVal; 123 #endif 120 124 Bool m_maxTidRefPresentFlag; 121 125 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1526 r1534 54 54 Int m_auxId; 55 55 #endif 56 #if VIEW_SCALABILITY 57 Int m_viewOrderIndex; 58 Int m_viewId; 59 #endif 56 60 57 61 Int m_extraRPSs; ///< extra RPSs added to handle CRA … … 173 177 Int* getPredLayerIds() const { return m_predLayerIds; } 174 178 Int getPredLayerIdx(Int i) const { return m_predLayerIds[i]; } 179 #if VIEW_SCALABILITY 180 Int getViewOrderIndex() { return m_viewOrderIndex; } 181 Int getViewId() { return m_viewId; } 182 #endif 175 183 176 184 Int getRepFormatIdx() const { return m_repFormatIdx; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1526 r1534 468 468 m_cTEncTop.setBottomRightTileIndex ( m_bottomRightTileIndex ); 469 469 m_cTEncTop.setIlcIdc ( m_ilcIdc ); 470 #endif 471 #if VIEW_SCALABILITY 472 m_cTEncTop.setUseDisparitySearchRangeRestriction ( m_scalabilityMask[VIEW_ORDER_INDEX] ); 470 473 #endif 471 474 … … 971 974 972 975 UInt i = 0, dimIdLen = 0; 976 #if VIEW_SCALABILITY 977 Int curDimId=0; 978 979 if( m_scalabilityMask[VIEW_ORDER_INDEX] ) 980 { 981 UInt maxViewOrderIndex = 0,maxViewId=0; 982 UInt voiLen = 1,vidLen=1; 983 984 for( i = 0; i < vps->getMaxLayers(); i++ ) 985 { 986 if( m_apcLayerCfg[i]->getViewOrderIndex() > maxViewOrderIndex ) 987 { 988 maxViewOrderIndex = m_apcLayerCfg[i]->getViewOrderIndex(); 989 } 990 991 if( m_apcLayerCfg[i]->getViewId() > maxViewId ) 992 { 993 maxViewId = m_apcLayerCfg[i]->getViewId(); 994 } 995 996 } 997 while((1 << voiLen) < (maxViewOrderIndex + 1)) 998 { 999 voiLen++; 1000 } 1001 1002 while((1 << vidLen) < (maxViewId + 1)) 1003 { 1004 vidLen++; 1005 } 1006 1007 vps->setDimensionIdLen(0, voiLen); 1008 vps->setViewIdLen(vidLen); 1009 1010 for( i = 0; i < vps->getMaxLayers(); i++ ) 1011 { 1012 vps->setDimensionId(i, 0, m_apcLayerCfg[i]->getViewOrderIndex()); 1013 } 1014 1015 for( i = 0; i < m_iNumberOfViews; i++ ) 1016 { 1017 vps->setViewIdVal(i, m_ViewIdVal[i]); 1018 } 1019 1020 curDimId++; 1021 } 1022 #endif 973 1023 974 1024 while((1 << dimIdLen) < m_numLayers) … … 976 1026 dimIdLen++; 977 1027 } 1028 #if VIEW_SCALABILITY 1029 vps->setDimensionIdLen(curDimId, dimIdLen); 1030 #else 978 1031 vps->setDimensionIdLen(0, dimIdLen); 1032 #endif 979 1033 vps->setNuhLayerIdPresentFlag(false); 980 1034 vps->setLayerIdInNuh(0, 0); … … 984 1038 vps->setLayerIdInNuh(i, m_apcLayerCfg[i]->m_layerId); 985 1039 vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i); 1040 #if VIEW_SCALABILITY 1041 vps->setDimensionId(i, curDimId, i); 1042 #else 986 1043 vps->setDimensionId(i, 0, i); 987 1044 #endif 988 1045 if( m_apcLayerCfg[i]->m_layerId != i ) 989 1046 { … … 1093 1150 scalabilityTypes += m_scalabilityMask[i]; 1094 1151 } 1152 #if VIEW_SCALABILITY 1153 assert( scalabilityTypes <= 3 ); 1154 #else 1095 1155 #if AUXILIARY_PICTURES 1096 1156 assert( scalabilityTypes <= 2 ); 1097 1157 #else 1098 1158 assert( scalabilityTypes == 1 ); 1159 #endif 1099 1160 #endif 1100 1161 vps->setNumScalabilityTypes(scalabilityTypes); -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1502 r1534 3317 3317 3318 3318 #if REF_IDX_ME_ZEROMV 3319 Bool TComDataCU:: xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)3319 Bool TComDataCU::checkZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3320 3320 { 3321 3321 Bool checkZeroMVILR = true; 3322 3322 3323 if(uhInterDir&0x1) //list0 3324 { 3325 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3326 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0); 3327 3328 if(refPic->isILR(m_pcPic->getLayerId())) 3329 { 3330 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3331 3332 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3333 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3334 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() ); 3335 } 3336 } 3337 if(uhInterDir&0x2) //list1 3338 { 3339 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3340 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1); 3341 3342 if(refPic->isILR(m_pcPic->getLayerId())) 3343 { 3344 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3345 3346 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3347 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3348 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() ); 3323 if( m_pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3324 { 3325 if( uhInterDir & 0x1 ) //list0 3326 { 3327 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3328 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0); 3329 3330 if(refPic->isILR(m_pcPic->getLayerId())) 3331 { 3332 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3333 3334 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3335 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3336 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() ); 3337 } 3338 } 3339 3340 if( uhInterDir & 0x2 ) //list1 3341 { 3342 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3343 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1); 3344 3345 if(refPic->isILR(m_pcPic->getLayerId())) 3346 { 3347 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3348 3349 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3350 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3351 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() ); 3352 } 3349 3353 } 3350 3354 } … … 3353 3357 } 3354 3358 3355 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx) 3356 { 3357 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0; 3358 assert(eRefPicList == REF_PIC_LIST_1); 3359 3359 Bool TComDataCU::checkZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx) 3360 { 3360 3361 Bool checkZeroMVILR = true; 3361 3362 3362 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_pcPic->getLayerId())) 3363 { 3364 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); 3365 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx]; 3366 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0); 3363 if( m_pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3364 { 3365 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0; 3366 assert(eRefPicList == REF_PIC_LIST_1); 3367 3368 if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->isILR(m_pcPic->getLayerId()) ) 3369 { 3370 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); 3371 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx]; 3372 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0); 3373 } 3367 3374 } 3368 3375 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1483 r1534 487 487 #endif 488 488 #if REF_IDX_ME_ZEROMV 489 Bool xCheckZeroMVILRMerge( UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);490 Bool xCheckZeroMVILRMvdL1Zero( Int iRefList, Int iRefIdx, Int MvpIdx);489 Bool checkZeroMVILRMerge ( UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); 490 Bool checkZeroMVILRMvdL1Zero ( Int iRefList, Int iRefIdx, Int MvpIdx); 491 491 #endif 492 492 TComDataCU* getBaseColCU ( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** posScalingFactor, Bool motionMapping = false ); -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1502 r1534 585 585 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 586 586 assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getPic()->getLayerIdx(), refPic->getLayerIdx() ) ); 587 587 #if VIEW_SCALABILITY 588 if( pcCU->getSlice()->getSPS()->getInterViewMvVertConstraintFlag() ) 589 { 590 assert( cMv.getVer()<= (56<<2) ); 591 } 592 #endif 588 593 #if REF_IDX_ME_ZEROMV 589 594 // It is a requirement of bitstream conformance that the variables mvLX[ 0 ] and mvLX[ 1 ] shall be equal to 0 if the value of refIdxLX corresponds to an inter-layer reference picture. -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1525 r1534 567 567 568 568 #if SVC_EXTENSION 569 #if VIEW_SCALABILITY 570 std::vector<TComPic*> refPicSetInterLayer0; 571 std::vector<TComPic*> refPicSetInterLayer1; 572 const TComVPS* cVPS=getVPS(); 573 574 Int viewIdCurrLayerId = cVPS->getViewIdVal(cVPS->getViewIndex(m_layerId) ); 575 Int viewId0 = cVPS->getViewIdVal( 0 ); 576 for( i=0; i< m_activeNumILRRefIdx ;i++) 577 { 578 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 579 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx()); 580 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 581 { 582 Int viewIdRefPicLayerIdi = cVPS->getViewIdVal( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx() ); 583 Bool refPicSet0Flag = 584 ( ( viewIdCurrLayerId <= viewId0 && viewIdCurrLayerId <= viewIdRefPicLayerIdi ) || 585 ( viewIdCurrLayerId >= viewId0 && viewIdCurrLayerId >= viewIdRefPicLayerIdi ) ); 586 587 if ( refPicSet0Flag ) 588 { 589 refPicSetInterLayer0.push_back( ilpPic[refLayerIdc] ); 590 } 591 else 592 { 593 refPicSetInterLayer1.push_back( ilpPic[refLayerIdc] ); 594 } 595 596 } 597 } 598 599 600 if( m_layerId > 0 ) 601 { 602 for( i = 0; i < refPicSetInterLayer0.size() && cIdx < numPicTotalCurr; cIdx ++, i ++) 603 { 604 rpsCurrList0[cIdx] = refPicSetInterLayer0[i]; 605 } 606 } 607 #else 569 608 // initial reference picture list construction 570 609 if( m_layerId > 0 ) … … 584 623 } 585 624 } 625 #endif 586 626 #endif //SVC_EXTENSION 587 627 … … 594 634 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 595 635 } 636 #if VIEW_SCALABILITY 637 if( m_layerId > 0 ) 638 { 639 for( i = 0; i < refPicSetInterLayer1.size(); cIdx++, i++ ) 640 { 641 rpsCurrList0[cIdx] = refPicSetInterLayer1[i]; 642 } 643 } 644 #else 596 645 assert(cIdx == numPicTotalCurr); 646 #endif 597 647 598 648 if (m_eSliceType==B_SLICE) … … 603 653 rpsCurrList1[cIdx] = RefPicSetStCurr1[i]; 604 654 } 655 #if VIEW_SCALABILITY 656 if( m_layerId > 0 ) 657 { 658 for( i = 0; i < refPicSetInterLayer1.size(); cIdx ++, i ++) 659 { 660 rpsCurrList1[cIdx] = refPicSetInterLayer1[i]; 661 } 662 } 663 #endif 605 664 for ( i=0; i<NumPicStCurr0; i++, cIdx++) 606 665 { … … 612 671 } 613 672 673 #if VIEW_SCALABILITY 674 if( m_layerId > 0 ) 675 { 676 for( i = 0; i < refPicSetInterLayer0.size(); cIdx ++, i ++) 677 { 678 rpsCurrList1[cIdx] = refPicSetInterLayer0[i]; 679 } 680 } 681 #else 614 682 #if SVC_EXTENSION 615 683 if( m_layerId > 0 ) … … 630 698 } 631 699 #endif //SVC_EXTENSION 632 633 700 assert(cIdx == numPicTotalCurr); 701 #endif 634 702 } 635 703 … … 643 711 644 712 #if SVC_EXTENSION 713 #if VIEW_SCALABILITY 714 m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = (cIdx<NumPicStCurr0 || (cIdx>=NumPicStCurr0+refPicSetInterLayer0.size() && cIdx<NumPicStCurr0+refPicSetInterLayer0.size()+NumPicStCurr1)) ? false : true; 715 #else 645 716 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPicStCurr0 && cIdx < NumPicStCurr0 + m_activeNumILRRefIdx ) || ( cIdx >= NumPicStCurr0 + NumPicStCurr1 + m_activeNumILRRefIdx ); 717 #endif 646 718 #else 647 719 m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 ); … … 660 732 assert(cIdx >= 0 && cIdx < numPicTotalCurr); 661 733 m_apcRefPicList[REF_PIC_LIST_1][rIdx] = rpsCurrList1[ cIdx ]; 734 #if VIEW_SCALABILITY 735 m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = (cIdx<NumPicStCurr1 || (cIdx>=NumPicStCurr1+refPicSetInterLayer1.size() && cIdx<NumPicStCurr1+refPicSetInterLayer1.size()+NumPicStCurr0)) ? false : true; 736 #else 662 737 m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 ); 738 #endif 663 739 } 664 740 } … … 699 775 return numRpsCurrTempList; 700 776 } 777 778 #if VIEW_SCALABILITY 779 Int TComSlice::getNumRpsInterLayerX(Int li, TComPic** ilpPic) 780 { 781 assert(li==0 || li==1); 782 783 Int viewIdCurrLayerId = m_pcVPS->getViewIdVal(m_pcVPS->getViewIndex(m_layerId) ); 784 Int viewId0 = m_pcVPS->getViewIdVal( 0 ); 785 Int numInterLayer0 = 0; 786 Int numInterLayer1 = 0; 787 788 for( Int i=0; i < m_activeNumILRRefIdx; i++ ) 789 { 790 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 791 Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx()); 792 793 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 794 { 795 Int viewIdRefPicLayerIdi = m_pcVPS->getViewIdVal( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx() ); 796 Bool refPicSet0Flag = ( ( viewIdCurrLayerId <= viewId0 && viewIdCurrLayerId <= viewIdRefPicLayerIdi ) || ( viewIdCurrLayerId >= viewId0 && viewIdCurrLayerId >= viewIdRefPicLayerIdi ) ); 797 798 if( refPicSet0Flag ) 799 { 800 numInterLayer0++; 801 } 802 else 803 { 804 numInterLayer1++; 805 } 806 } 807 } 808 809 if( li==0 ) 810 { 811 return numInterLayer0; 812 } 813 else 814 { 815 return numInterLayer1; 816 } 817 } 818 #endif 701 819 702 820 Void TComSlice::initEqualRef() … … 3477 3595 } 3478 3596 3597 #if VIEW_SCALABILITY 3598 Void TComSlice::setRefPicListModificationSvc( TComPic** ilpPic ) 3599 #else 3479 3600 Void TComSlice::setRefPicListModificationSvc() 3601 #endif 3480 3602 { 3481 3603 if( !m_pcPPS->getListsModificationPresentFlag()) … … 3491 3613 TComRefPicListModification* refPicListModification = &m_RefPicListModification; 3492 3614 Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList(); // total number of ref pics in listTemp0 including inter-layer ref pics 3493 #if SVC_EXTENSION 3494 Int numberOfPocBeforeCurr = this->getNumNegativeRpsCurrTempList(); // number of negative temporal ref pics 3495 #endif 3615 Int numberOfPocBeforeCurr = getNumNegativeRpsCurrTempList(); // number of negative temporal ref pics 3496 3616 3497 3617 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0); … … 3499 3619 3500 3620 //set L0 inter-layer reference picture modification 3501 #if SVC_EXTENSION 3502 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 3503 3504 if( m_activeNumILRRefIdx > 1 ) 3505 { 3506 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 3507 } 3508 #else 3509 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true; 3510 #endif 3621 #if VIEW_SCALABILITY 3622 Int numberOfPocAfterCurr = 0; 3623 Int numberOfInterLayer0 = 0; 3624 Int numberOfInterLayer1 = 0; 3625 #endif 3626 3627 Bool hasModification = false; 3628 3629 if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3630 { 3631 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 3632 3633 if( m_activeNumILRRefIdx > 1 ) 3634 { 3635 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 3636 } 3637 } 3638 #if VIEW_SCALABILITY 3639 else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view 3640 { 3641 numberOfPocAfterCurr = getNumfPositiveRpsCurrTempList(); 3642 numberOfInterLayer0 = getNumRpsInterLayerX(0, ilpPic); 3643 numberOfInterLayer1 = getNumRpsInterLayerX(1, ilpPic); 3644 3645 if( (numberOfInterLayer1 > 0 && m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfRpsCurrTempList) || (numberOfInterLayer1 == 0 && m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfPocBeforeCurr + numberOfInterLayer0 ) ) 3646 { 3647 hasModification = true; 3648 } 3649 else 3650 { 3651 hasModification = false; 3652 } 3653 } 3654 #endif 3655 3511 3656 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 ); 3512 3657 refPicListModification->setRefPicListModificationFlagL0(hasModification); … … 3526 3671 } 3527 3672 } 3528 else 3673 else if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3529 3674 { 3530 3675 // number of ILRPs included into the reference picture list with the list modification … … 3533 3678 for(Int i = includeNumILRP; i > 0; i-- ) 3534 3679 { 3535 #if SVC_EXTENSION3536 3680 if( numberOfPocBeforeCurr >= m_aiNumRefIdx[REF_PIC_LIST_0] ) 3537 3681 { … … 3547 3691 } 3548 3692 } 3549 #else 3550 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i); 3551 #endif 3552 } 3553 } 3693 } 3694 } 3695 #if VIEW_SCALABILITY 3696 else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view 3697 { 3698 Int includeNumILRP = m_activeNumILRRefIdx; 3699 Int iNumILRP = includeNumILRP; 3700 3701 if( numberOfInterLayer1 > 0 ) 3702 { 3703 if( m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfPocBeforeCurr + m_activeNumILRRefIdx ) 3704 { 3705 for( Int i = 0; i < numberOfInterLayer0 && iNumILRP > 0; i++, iNumILRP-- ) 3706 { 3707 refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - includeNumILRP + i, numberOfPocBeforeCurr + i ); 3708 } 3709 3710 for( Int i = 0; i < numberOfInterLayer1 && iNumILRP > 0; i++, iNumILRP-- ) 3711 { 3712 refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - includeNumILRP +numberOfInterLayer0+ i, numberOfRpsCurrTempList- numberOfInterLayer1 + i ); 3713 } 3714 } 3715 else 3716 { 3717 iNumILRP -= numberOfInterLayer0; 3718 3719 for( Int i = numberOfInterLayer1; i >0 && iNumILRP > 0; i--, iNumILRP-- ) 3720 { 3721 refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i ); 3722 } 3723 } 3724 } 3725 else 3726 { 3727 for( Int i = numberOfInterLayer0; i >0 && iNumILRP >0 ; i--, iNumILRP-- ) 3728 { 3729 refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + numberOfInterLayer0 - i ); 3730 } 3731 } 3732 } 3733 #endif 3554 3734 } 3555 3735 3556 3736 //set L1 inter-layer reference picture modification 3557 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true; 3737 if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3738 { 3739 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true; 3740 } 3741 #if VIEW_SCALABILITY 3742 else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view 3743 { 3744 if( (numberOfInterLayer0 > 0 && m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfRpsCurrTempList) || (numberOfInterLayer0 == 0 && m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfPocAfterCurr + numberOfInterLayer1) ) 3745 { 3746 hasModification = true; 3747 } 3748 else 3749 { 3750 hasModification = false; 3751 } 3752 } 3753 #endif 3558 3754 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 ); 3559 3755 … … 3573 3769 } 3574 3770 } 3575 else 3771 else if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer 3576 3772 { 3577 3773 Int includeNumILRP = min(m_aiNumRefIdx[REF_PIC_LIST_1], m_activeNumILRRefIdx); … … 3582 3778 } 3583 3779 } 3780 #if VIEW_SCALABILITY 3781 else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view 3782 { 3783 Int includeNumILRP = m_activeNumILRRefIdx; 3784 Int iNumILRP=includeNumILRP; 3785 3786 if( numberOfInterLayer0 > 0 ) 3787 { 3788 if( m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfPocAfterCurr + m_activeNumILRRefIdx ) 3789 { 3790 for( Int i = 0; i < numberOfInterLayer1 && iNumILRP>0; i++,iNumILRP-- ) 3791 { 3792 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - includeNumILRP + i, numberOfPocAfterCurr + i); 3793 } 3794 3795 for(Int i = 0; i < numberOfInterLayer0 && iNumILRP>0; i++,iNumILRP-- ) 3796 { 3797 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - includeNumILRP +numberOfInterLayer1+ i, numberOfRpsCurrTempList-numberOfInterLayer0+i); 3798 } 3799 } 3800 else 3801 { 3802 iNumILRP -= numberOfInterLayer1; 3803 for( Int i = numberOfInterLayer0; i > 0 && iNumILRP > 0; i--,iNumILRP-- ) 3804 { 3805 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i); 3806 } 3807 } 3808 } 3809 else 3810 { 3811 for( Int i = numberOfInterLayer1; i >0 && iNumILRP>0; i--, iNumILRP-- ) 3812 { 3813 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfPocAfterCurr + numberOfInterLayer1 - i); 3814 } 3815 } 3816 } 3817 #endif 3584 3818 } 3585 3819 return; … … 3638 3872 } 3639 3873 } 3874 3875 #if VIEW_SCALABILITY 3876 Int TComSlice::getNumfPositiveRpsCurrTempList() 3877 { 3878 if( m_eSliceType == I_SLICE ) 3879 { 3880 return 0; 3881 } 3882 3883 Int numPocAfterCurr = 0; 3884 3885 for( UInt i = 0; i < m_pRPS->getNumberOfPositivePictures(); i++ ) 3886 { 3887 if( m_pRPS->getUsed(i) ) 3888 { 3889 numPocAfterCurr++; 3890 } 3891 } 3892 3893 return numPocAfterCurr; 3894 } 3895 #endif 3896 3640 3897 #endif //SVC_EXTENSION 3641 3898 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1502 r1534 1443 1443 Bool m_inferScalingListFlag; 1444 1444 UInt m_scalingListRefLayerId; 1445 #if VIEW_SCALABILITY 1446 Bool m_interViewMvVertConstraintFlag; 1447 #endif 1445 1448 #endif //SVC_EXTENSION 1446 1449 … … 1599 1602 1600 1603 Void inferSPS( const UInt layerId, TComVPS* vps ); 1604 1605 #if VIEW_SCALABILITY 1606 Void setInterViewMvVertConstraintFlag( Bool val ) { m_interViewMvVertConstraintFlag = val; } 1607 Bool getInterViewMvVertConstraintFlag() const { return m_interViewMvVertConstraintFlag; } 1608 #endif 1601 1609 #endif //SVC_EXTENSION 1602 1610 }; … … 2351 2359 Void setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 2352 2360 TComPicYuv* getFullPelBaseRec( UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 2353 2361 #if VIEW_SCALABILITY 2362 Int getNumRpsInterLayerX( Int li, TComPic** ilpPic ); 2363 Void setRefPicListModificationSvc( TComPic** ilpPic ); 2364 Int getNumfPositiveRpsCurrTempList(); 2365 #else 2354 2366 Void setRefPicListModificationSvc(); 2367 #endif 2355 2368 Int getNumILRRefIdx() { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } 2356 2369 -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1531 r1534 72 72 #define NO_CLRAS_OUTPUT_FLAG 1 73 73 74 #define VIEW_SCALABILITY 0 ///< JCTVC-W0134: multi-view support 75 74 76 /// scalability types 75 77 enum ScalabilityType … … 87 89 88 90 /// normative encoder constraints -------- 89 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME) 90 91 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture for scalable layer (without fractional ME) 91 92 /// encoder settings --------------------- 92 93 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1533 r1534 2186 2186 READ_CODE(32, uiCode, "reserved_zero_34bits"); READ_CODE(2, uiCode, "reserved_zero_34bits"); 2187 2187 } 2188 #if VIEW_SCALABILITY 2189 else if( ptl->getProfileIdc() == Profile::MULTIVIEWMAIN ) 2190 { 2191 READ_FLAG( uiCode, "general_max_12bit_constraint_flag" ); assert (uiCode == 1); 2192 READ_FLAG( uiCode, "general_max_10bit_constraint_flag" ); assert (uiCode == 1); 2193 READ_FLAG( uiCode, "general_max_8bit_constraint_flag" ); assert (uiCode == 1); 2194 READ_FLAG( uiCode, "general_max_422chroma_constraint_flag" ); assert (uiCode == 1); 2195 READ_FLAG( uiCode, "general_max_420chroma_constraint_flag" ); assert (uiCode == 1); 2196 READ_FLAG( uiCode, "general_max_monochrome_constraint_flag" ); assert (uiCode == 0); 2197 READ_FLAG( uiCode, "general_intra_constraint_flag"); assert (uiCode == 0); 2198 READ_FLAG( uiCode, "general_one_picture_only_constraint_flag"); assert (uiCode == 0); 2199 READ_FLAG( uiCode, "general_lower_bit_rate_constraint_flag"); assert (uiCode == 1); 2200 READ_CODE(32, uiCode, "general_reserved_zero_34bits"); READ_CODE(2, uiCode, "general_reserved_zero_34bits"); 2201 } 2202 #endif 2188 2203 else 2189 2204 { … … 3556 3571 3557 3572 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); 3573 3574 #if VIEW_SCALABILITY 3575 pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 3576 #else 3577 // Vertical MV component restriction is not used in SHVC CTC 3578 assert( uiCode == 0 ); 3579 #endif 3558 3580 } 3559 3581 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1531 r1534 839 839 // set motion mapping flag 840 840 m_apcSlicePilot->setMFMEnabledFlag( ( m_apcSlicePilot->getNumMotionPredRefLayers() > 0 && m_apcSlicePilot->getActiveNumILRRefIdx() && !m_apcSlicePilot->isIntra() ) ? true : false ); 841 842 #if VIEW_SCALABILITY 843 if( vps->getViewIndex(nalu.m_nuhLayerId) == 1 && sps->getPTL()->getGeneralPTL()->getProfileIdc() == Profile::MULTIVIEWMAIN ) 844 { 845 assert( sps->getInterViewMvVertConstraintFlag() == 1 ); 846 } 847 #endif 841 848 #endif 842 849 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1533 r1534 1445 1445 WRITE_CODE(0, 32, "general_reserved_zero_34bits"); WRITE_CODE(0, 2, "general_reserved_zero_34bits"); 1446 1446 } 1447 #if VIEW_SCALABILITY 1448 else if( ptl->getProfileIdc() == Profile::MULTIVIEWMAIN ) 1449 { 1450 WRITE_FLAG(true, "general_max_12bit_constraint_flag"); 1451 WRITE_FLAG(true, "general_max_10bit_constraint_flag"); 1452 WRITE_FLAG(true, "general_max_8bit_constraint_flag"); 1453 WRITE_FLAG(true, "general_max_422chroma_constraint_flag"); 1454 WRITE_FLAG(true, "general_max_420chroma_constraint_flag"); 1455 WRITE_FLAG(false, "general_max_monochrome_constraint_flag"); 1456 WRITE_FLAG(false, "general_intra_constraint_flag"); 1457 WRITE_FLAG(false, "general_one_picture_only_constraint_flag"); 1458 WRITE_FLAG(true, "general_lower_bit_rate_constraint_flag"); 1459 WRITE_CODE(0, 32, "general_reserved_zero_34bits"); WRITE_CODE(0, 2, "general_reserved_zero_34bits"); 1460 } 1461 #endif 1447 1462 else 1448 1463 { … … 1994 2009 1995 2010 WRITE_CODE( vps->getViewIdLen( ), 4, "view_id_len" ); 2011 #if !VIEW_SCALABILITY 1996 2012 assert ( vps->getNumViews() >= (1<<vps->getViewIdLen()) ); 2013 #endif 1997 2014 1998 2015 if ( vps->getViewIdLen() > 0 ) … … 2460 2477 2461 2478 // Vertical MV component restriction is not used in SHVC CTC 2479 #if VIEW_SCALABILITY 2480 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0 , "inter_view_mv_vert_constraint_flag" ); 2481 #else 2462 2482 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 2483 #endif 2463 2484 } 2464 2485 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1475 r1534 399 399 400 400 #if SVC_EXTENSION 401 UInt m_layerId; 401 UInt m_layerId; 402 402 UInt m_numLayer; 403 403 Bool m_elRapSliceBEnabled; … … 483 483 Int m_TMVPConstraintsSEIEnabled; 484 484 #endif 485 486 #if VIEW_SCALABILITY 487 Bool m_bUseDisparitySearchRangeRestriction; 488 #endif 485 489 #endif //SVC_EXTENSION 486 490 … … 1253 1257 #endif 1254 1258 #endif 1259 #if VIEW_SCALABILITY 1260 Void setUseDisparitySearchRangeRestriction ( Bool b ) { m_bUseDisparitySearchRangeRestriction = b; } 1261 Bool getUseDisparitySearchRangeRestriction () { return m_bUseDisparitySearchRangeRestriction; } 1262 #endif 1255 1263 #endif //SVC_EXTENSION 1256 1264 }; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1502 r1534 1299 1299 { 1300 1300 #if REF_IDX_ME_ZEROMV 1301 Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 1302 if(bZeroMVILR) 1301 Bool bZeroMVILR = rpcTempCU->checkZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 1302 1303 if( bZeroMVILR ) 1303 1304 { 1304 1305 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1531 r1534 2029 2029 { 2030 2030 pcSlice->setILRPic( m_pcEncTop->getIlpList() ); 2031 #if VIEW_SCALABILITY 2032 pcSlice->setRefPicListModificationSvc(m_pcEncTop->getIlpList()); 2033 #else 2031 2034 pcSlice->setRefPicListModificationSvc(); 2035 #endif 2032 2036 pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList()); 2033 2037 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1514 r1534 2888 2888 { 2889 2889 #if REF_IDX_ME_ZEROMV 2890 Bool bZeroMVILR = pcCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 2891 if(bZeroMVILR) 2890 Bool bZeroMVILR = pcCU->checkZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 2891 2892 if( bZeroMVILR ) 2892 2893 { 2893 2894 #endif … … 3113 3114 { 3114 3115 #if REF_IDX_ME_ZEROMV 3115 Bool bZeroMVILR = pcCU->xCheckZeroMVILRMvdL1Zero(iRefList, iRefIdxTemp, aaiMvpIdx[iRefList][iRefIdxTemp]); 3116 if(bZeroMVILR) 3116 Bool bZeroMVILR = pcCU->checkZeroMVILRMvdL1Zero(iRefList, iRefIdxTemp, aaiMvpIdx[iRefList][iRefIdxTemp]); 3117 3118 if( bZeroMVILR ) 3117 3119 { 3118 3120 #endif … … 3864 3866 3865 3867 TComMv cMvPred = *pcMvPred; 3866 3868 #if VIEW_SCALABILITY 3869 m_vertRestriction = m_pcEncCfg->getUseDisparitySearchRangeRestriction() && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC(); 3870 #endif 3867 3871 if ( bBi ) 3868 3872 { … … 3882 3886 // Do integer search 3883 3887 #if REF_IDX_ME_ZEROMV 3884 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId())) //ILR reference pic 3888 //scalable layer 3889 if( pcCU->getSlice()->getVPS()->getScalabilityMask( SCALABILITY_ID ) && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId()) ) //ILR reference pic 3885 3890 { 3886 3891 rcMv.setZero(); //use Mv(0, 0) for integer ME … … 3918 3923 3919 3924 #if REF_IDX_ME_ZEROMV 3920 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId())) //ILR reference pic 3925 //scalable layer 3926 if( pcCU->getSlice()->getVPS()->getScalabilityMask( SCALABILITY_ID ) && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId())) //ILR reference pic 3921 3927 { 3922 3928 xPatternSearchFracDIFMv0( pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost ); … … 3950 3956 rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) ); 3951 3957 rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) ); 3958 #if VIEW_SCALABILITY 3959 if( m_vertRestriction ) 3960 { 3961 Int mvRestricted = ( 56 - 1 ) << iMvShift ; // -1 to consider subpel search 3962 if( rcMvSrchRngRB.getVer() > mvRestricted ) 3963 { 3964 rcMvSrchRngRB.setVer( mvRestricted ); 3965 } 3966 } 3967 #endif 3952 3968 pcCU->clipMv ( rcMvSrchRngLT ); 3953 3969 pcCU->clipMv ( rcMvSrchRngRB ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h
r1487 r1534 120 120 Bool m_isInitialized; 121 121 122 #if SVC_EXTENSION && N0383_IL_CONSTRAINED_TILE_SETS_SEI 122 #if SVC_EXTENSION 123 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 123 124 Bool m_disableILP; 125 #endif 126 #if VIEW_SCALABILITY 127 Bool m_vertRestriction; 128 #endif 124 129 #endif 125 130 … … 473 478 inline Void setDistParamComp( ComponentID compIdx ) { m_cDistParam.compIdx = compIdx; } 474 479 475 #if SVC_EXTENSION && REF_IDX_ME_ZEROMV 480 #if SVC_EXTENSION 481 #if REF_IDX_ME_ZEROMV 476 482 Void xPatternSearchFracDIFMv0 ( TComPattern* pcPatternKey, 477 483 Pel* piRefY, … … 485 491 UInt& ruiCost ); 486 492 #endif 487 #endif //SVC_EXTENSION 493 #endif 494 495 #if VIEW_SCALABILITY 496 TComMv xCheckMVVertRestriction( TComMv mv ); 497 #endif 498 #endif //SVC_EXTENSION 488 499 489 500 };// END CLASS DEFINITION TEncSearch -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1513 r1534 848 848 m_cSPS.setLayerId(m_layerId); 849 849 } 850 #if VIEW_SCALABILITY 851 if( m_bUseDisparitySearchRangeRestriction ) 852 { 853 m_cSPS.setInterViewMvVertConstraintFlag( true ); 854 } 855 else 856 { 857 m_cSPS.setInterViewMvVertConstraintFlag( false ); 858 } 859 #endif 850 860 #endif //SVC_EXTENSION 851 861
Note: See TracChangeset for help on using the changeset viewer.