Changeset 310 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 22 Jul 2013, 21:40:00 (12 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-2.1-dev (added) merged: 193-196,202,204,210-212,214-216,224,226-228,233-251,258,282-309
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r230 r310 56 56 // ==================================================================================================================== 57 57 58 #define NV_VERSION "2.0avc" ///< Current software version 58 #if SVC_EXTENSION 59 #define NV_VERSION "2.1" ///< Current software version 60 #else 61 #define NV_VERSION "11.0" ///< Current software version 62 #endif 59 63 60 64 // ==================================================================================================================== … … 110 114 #define MAX_NUM_REF_PICS 16 ///< max. number of pictures used for reference 111 115 #define MAX_NUM_REF 16 ///< max. number of entries in picture reference list 112 #if !L0034_COMBINED_LIST_CLEANUP113 #define MAX_NUM_REF_LC MAX_NUM_REF_PICS // TODO: remove this macro definition (leftover from combined list concept)114 #endif115 116 116 117 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer -
trunk/source/Lib/TLibCommon/NAL.h
r191 r310 91 91 || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R; 92 92 } 93 #if L0045_NON_NESTED_SEI_RESTRICTIONS94 93 Bool isSei() 95 94 { … … 102 101 return ( (UInt)m_nalUnitType < 32 ); 103 102 } 104 #endif105 103 }; 106 104 -
trunk/source/Lib/TLibCommon/SEI.cpp
r189 r310 39 39 #include "SEI.h" 40 40 41 #if J0149_TONE_MAPPING_SEI42 41 //Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator 43 42 Int Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1}; 44 #endif45 43 46 44 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType) -
trunk/source/Lib/TLibCommon/SEI.h
r191 r310 72 72 SCALABLE_NESTING = 133, 73 73 REGION_REFRESH_INFO = 134, 74 #if M0043_LAYERS_PRESENT_SEI 75 LAYERS_PRESENT = 137, 76 #endif 74 77 }; 75 78 … … 124 127 125 128 SEIActiveParameterSets() 126 #if !L0047_APS_FLAGS127 :numSpsIdsMinus1(0)128 #else129 129 : activeVPSId (0) 130 130 , m_fullRandomAccessFlag (false) 131 131 , m_noParamSetUpdateFlag (false) 132 132 , numSpsIdsMinus1 (0) 133 #endif134 133 {} 135 134 virtual ~SEIActiveParameterSets() {} 136 135 137 136 Int activeVPSId; 138 #if L0047_APS_FLAGS139 137 Bool m_fullRandomAccessFlag; 140 138 Bool m_noParamSetUpdateFlag; 141 #endif142 139 Int numSpsIdsMinus1; 143 140 std::vector<Int> activeSeqParamSetId; … … 150 147 151 148 SEIBufferingPeriod() 152 #if L0044_CPB_DPB_DELAY_OFFSET153 149 : m_bpSeqParameterSetId (0) 154 150 , m_rapCpbParamsPresentFlag (false) … … 161 157 ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset)); 162 158 } 163 #else164 {}165 #endif166 159 virtual ~SEIBufferingPeriod() {} 167 160 168 161 UInt m_bpSeqParameterSetId; 169 162 Bool m_rapCpbParamsPresentFlag; 170 #if L0044_CPB_DPB_DELAY_OFFSET171 163 Bool m_cpbDelayOffset; 172 164 Bool m_dpbDelayOffset; 173 #endif174 165 UInt m_initialCpbRemovalDelay [MAX_CPB_CNT][2]; 175 166 UInt m_initialCpbRemovalDelayOffset [MAX_CPB_CNT][2]; 176 167 UInt m_initialAltCpbRemovalDelay [MAX_CPB_CNT][2]; 177 168 UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2]; 178 #if L0328_SPLICING179 169 Bool m_concatenationFlag; 180 170 UInt m_auCpbRemovalDelayDelta; 181 #endif182 171 }; 183 172 class SEIPictureTiming : public SEI … … 188 177 SEIPictureTiming() 189 178 : m_picStruct (0) 190 #if L0046_RENAME_PROG_SRC_IDC191 179 , m_sourceScanType (0) 192 #else193 , m_progressiveSourceIdc (0)194 #endif195 180 , m_duplicateFlag (false) 196 #if L0044_DU_DPB_OUTPUT_DELAY_HRD197 181 , m_picDpbOutputDuDelay (0) 198 #endif199 182 , m_numNalusInDuMinus1 (NULL) 200 183 , m_duCpbRemovalDelayMinus1 (NULL) … … 213 196 214 197 UInt m_picStruct; 215 #if L0046_RENAME_PROG_SRC_IDC216 198 UInt m_sourceScanType; 217 #else218 UInt m_progressiveSourceIdc;219 #endif220 199 Bool m_duplicateFlag; 221 200 222 201 UInt m_auCpbRemovalDelay; 223 202 UInt m_picDpbOutputDelay; 224 #if L0044_DU_DPB_OUTPUT_DELAY_HRD225 203 UInt m_picDpbOutputDuDelay; 226 #endif227 204 UInt m_numDecodingUnitsMinus1; 228 205 Bool m_duCommonCpbRemovalDelayFlag; … … 240 217 : m_decodingUnitIdx(0) 241 218 , m_duSptCpbRemovalDelay(0) 242 #if L0044_DU_DPB_OUTPUT_DELAY_HRD243 219 , m_dpbOutputDuDelayPresentFlag(false) 244 220 , m_picSptDpbOutputDuDelay(0) 245 #endif246 221 {} 247 222 virtual ~SEIDecodingUnitInfo() {} 248 223 Int m_decodingUnitIdx; 249 224 Int m_duSptCpbRemovalDelay; 250 #if L0044_DU_DPB_OUTPUT_DELAY_HRD251 225 Bool m_dpbOutputDuDelayPresentFlag; 252 226 Int m_picSptDpbOutputDuDelay; 253 #endif254 227 }; 255 228 … … 290 263 Int m_frame1GridPositionY; 291 264 Int m_arrangementReservedByte; 292 #if L0045_PERSISTENCE_FLAGS293 265 Bool m_arrangementPersistenceFlag; 294 #else295 Int m_arrangementRepetetionPeriod;296 #endif297 266 Bool m_upsampledAspectRatio; 298 267 }; … … 305 274 SEIDisplayOrientation() 306 275 : cancelFlag(true) 307 #if L0045_PERSISTENCE_FLAGS308 276 , persistenceFlag(0) 309 #else310 , repetitionPeriod(1)311 #endif312 277 , extensionFlag(false) 313 278 {} … … 319 284 320 285 UInt anticlockwiseRotation; 321 #if L0045_PERSISTENCE_FLAGS322 286 Bool persistenceFlag; 323 #else324 UInt repetitionPeriod;325 #endif326 287 Bool extensionFlag; 327 288 }; … … 355 316 }; 356 317 357 #if L0208_SOP_DESCRIPTION_SEI 318 #if M0043_LAYERS_PRESENT_SEI 319 class SEILayersPresent : public SEI 320 { 321 public: 322 PayloadType payloadType() const { return LAYERS_PRESENT; } 323 324 SEILayersPresent() {} 325 virtual ~SEILayersPresent() {} 326 327 UInt m_activeVpsId; 328 UInt m_vpsMaxLayers; 329 Bool m_layerPresentFlag[MAX_LAYERS]; 330 }; 331 #endif 332 358 333 class SEISOPDescription : public SEI 359 334 { … … 372 347 Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP]; 373 348 }; 374 #endif 375 376 #if J0149_TONE_MAPPING_SEI 349 377 350 class SEIToneMappingInfo : public SEI 378 351 { … … 407 380 Int m_extendedWhiteLevelLumaCodeValue; 408 381 }; 409 #endif410 382 411 383 typedef std::list<SEI*> SEIMessages; … … 420 392 Void deleteSEIs (SEIMessages &seiList); 421 393 422 #if K0180_SCALABLE_NESTING_SEI423 394 class SEIScalableNesting : public SEI 424 395 { … … 450 421 SEIMessages m_nestedSEIs; 451 422 }; 452 #endif453 423 454 424 //! \} -
trunk/source/Lib/TLibCommon/TComBitStream.h
r191 r310 193 193 } 194 194 195 Void peekPreviousByte( UInt &byte ) 196 { 197 assert(m_fifo_idx > 0); 198 byte = (*m_fifo)[m_fifo_idx - 1]; 199 } 200 195 201 Void readOutTrailingBits (); 196 202 UChar getHeldBits () { return m_held_bits; } -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r208 r310 589 589 } 590 590 591 UInt uiTmp = uhWidth*uhHeight;592 593 591 if(getPic()->getPicSym()->getInverseCUOrderMap(getAddr())*m_pcPic->getNumPartInCU()+m_uiAbsIdxInLCU >= getSlice()->getSliceSegmentCurStartCUAddr()) 594 592 { 595 593 m_acCUMvField[0].clearMvField(); 596 594 m_acCUMvField[1].clearMvField(); 597 uiTmp = uhWidth*uhHeight;595 UInt uiTmp = uhWidth*uhHeight; 598 596 599 597 memset( m_pcTrCoeffY, 0, uiTmp * sizeof( *m_pcTrCoeffY ) ); … … 794 792 m_uiCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 795 793 796 UInt uiWidth = g_uiMaxCUWidth >> uiDepth;797 UInt uiHeight = g_uiMaxCUHeight >> uiDepth;798 799 794 m_skipFlag=pcCU->getSkipFlag() + uiPart; 800 795 … … 838 833 m_apcCUColocated[1] = pcCU->getCUColocated(REF_PIC_LIST_1); 839 834 840 UInt uiTmp = uiWidth*uiHeight;841 835 UInt uiMaxCuWidth=pcCU->getSlice()->getSPS()->getMaxCUWidth(); 842 836 UInt uiMaxCuHeight=pcCU->getSlice()->getSPS()->getMaxCUHeight(); … … 850 844 m_pcIPCMSampleY = pcCU->getPCMSampleY() + uiCoffOffset; 851 845 852 uiTmp >>= 2;853 846 uiCoffOffset >>=2; 854 847 m_pcTrCoeffCb=pcCU->getCoeffCb() + uiCoffOffset; … … 1577 1570 return getSlice()->getSliceQp(); 1578 1571 } 1579 else 1580 if ( iLastValidPartIdx >= 0 ) 1572 else if ( iLastValidPartIdx >= 0 ) 1581 1573 { 1582 1574 return getQP( iLastValidPartIdx ); … … 1647 1639 Int iLeftIntraDir, iAboveIntraDir; 1648 1640 Int uiPredNum = 0; 1649 1641 1650 1642 // Get intra direction of left PU 1651 1643 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); … … 1738 1730 return uiPredNum; 1739 1731 } 1732 1733 1734 #if FAST_INTRA_SHVC 1735 /** generate limited set of remaining modes 1736 *\param uiAbsPartIdx 1737 *\param uiIntraDirPred pointer to the array for MPM storage 1738 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs) 1739 */ 1740 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ) 1741 { 1742 // check BL mode 1743 UInt uiCUAddrBase, uiAbsPartAddrBase; 1744 // the right reference layerIdc should be specified, currently it is set to m_layerId-1 1745 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase ); 1746 1747 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) 1748 { 1749 return( NUM_INTRA_MODE-1 ); 1750 } 1751 1752 // compute set of enabled modes g_reducedSetIntraModes[...] 1753 Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; 1754 Int nbModes; 1755 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st 1756 { 1757 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes]; 1758 authorizedMode[ uiIntraDirPred[nbModes] ] = 0; 1759 } 1760 1761 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase ); 1762 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode 1763 { 1764 g_reducedSetIntraModes[nbModes++] = iColBaseDir; 1765 authorizedMode[ iColBaseDir ] = 0; 1766 } 1767 1768 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0]; 1769 if ( iRefMode > 1 ) //add neighboring modes of refMode 1770 { 1771 UInt Left = iRefMode; 1772 UInt Right = iRefMode; 1773 while ( nbModes < NB_REMAIN_MODES+3 ) 1774 { 1775 Left = ((Left + 29) % 32) + 2; 1776 Right = ((Right - 1 ) % 32) + 2; 1777 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left; 1778 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right; 1779 } 1780 } 1781 else //add pre-defined modes 1782 { 1783 Int idx = 0; 1784 while ( nbModes < NB_REMAIN_MODES+3 ) 1785 { 1786 UInt mode = g_predefSetIntraModes[idx++]; 1787 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode; 1788 } 1789 } 1790 1791 fullSetOfModes = 0; 1792 return ( nbModes ); 1793 } 1794 #endif 1795 1740 1796 1741 1797 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) … … 2541 2597 if(m_layerId) 2542 2598 { 2543 pcColCU = getBaseColCU( xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase );2599 pcColCU = getBaseColCU( m_layerId - 1, xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase ); 2544 2600 2545 2601 #if INTRA_BL … … 2563 2619 { 2564 2620 pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_0, cMvFieldBaseColCU[0]); 2565 scaleBaseMV( pcMvFieldNeighbours[iCount<<1], cMvFieldBaseColCU[0] );2621 scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[iCount<<1], cMvFieldBaseColCU[0] ); 2566 2622 } 2567 2623 … … 2569 2625 { 2570 2626 pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_1, cMvFieldBaseColCU[1] ); 2571 scaleBaseMV( pcMvFieldNeighbours[(iCount<<1)+1], cMvFieldBaseColCU[1] );2627 scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[(iCount<<1)+1], cMvFieldBaseColCU[1] ); 2572 2628 } 2573 2629 … … 2796 2852 //>> MTK colocated-RightBottom 2797 2853 UInt uiPartIdxRB; 2798 Int uiLCUIdx = getAddr();2799 2854 2800 2855 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); … … 2805 2860 TComMv cColMv; 2806 2861 Int iRefIdx; 2862 Int uiLCUIdx = -1; 2807 2863 2808 2864 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 2809 2865 { 2810 uiLCUIdx = -1;2811 2866 } 2812 2867 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 2813 2868 { 2814 uiLCUIdx = -1;2815 2869 } 2816 2870 else … … 2825 2879 { 2826 2880 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 2827 uiLCUIdx = -1 ;2828 2881 } 2829 2882 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU … … 2835 2888 { 2836 2889 uiAbsPartAddr = 0; 2837 uiLCUIdx = -1 ;2838 2890 } 2839 2891 } … … 3099 3151 if (!bAdded) 3100 3152 { 3101 bAdded =xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLB, MD_LEFT );3153 xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLB, MD_LEFT ); 3102 3154 } 3103 3155 } … … 3112 3164 if(!bAdded) 3113 3165 { 3114 bAdded =xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);3166 xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT); 3115 3167 } 3116 3168 bAdded = bAddedSmvp; … … 3127 3179 if(!bAdded) 3128 3180 { 3129 bAdded =xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);3181 xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT); 3130 3182 } 3131 3183 } … … 3147 3199 UInt uiAbsPartIdx; 3148 3200 UInt uiAbsPartAddr; 3149 Int uiLCUIdx = getAddr();3150 3201 3151 3202 deriveRightBottomIdx( uiPartIdx, uiPartIdxRB ); … … 3154 3205 //---- co-located RightBottom Temporal Predictor (H) ---// 3155 3206 uiAbsPartIdx = g_auiZscanToRaster[uiPartIdxRB]; 3207 Int uiLCUIdx = -1; 3156 3208 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 3157 3209 { 3158 uiLCUIdx = -1;3159 3210 } 3160 3211 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdx] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 3161 3212 { 3162 uiLCUIdx = -1;3163 3213 } 3164 3214 else … … 3173 3223 { 3174 3224 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdx + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 3175 uiLCUIdx = -1 ;3176 3225 } 3177 3226 else if ( uiAbsPartIdx / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU … … 3183 3232 { 3184 3233 uiAbsPartAddr = 0; 3185 uiLCUIdx = -1 ;3186 3234 } 3187 3235 } … … 3245 3293 UInt TComDataCU::getIntraSizeIdx(UInt uiAbsPartIdx) 3246 3294 { 3247 UInt uiShift = ( (m_puhTrIdx[uiAbsPartIdx]==0) && (m_pePartSize[uiAbsPartIdx]==SIZE_NxN) ) ? m_puhTrIdx[uiAbsPartIdx]+1 : m_puhTrIdx[uiAbsPartIdx]; 3248 uiShift = ( m_pePartSize[uiAbsPartIdx]==SIZE_NxN ? 1 : 0 ); 3295 UInt uiShift = ( m_pePartSize[uiAbsPartIdx]==SIZE_NxN ? 1 : 0 ); 3249 3296 3250 3297 UChar uiWidth = m_puhWidth[uiAbsPartIdx]>>uiShift; … … 3332 3379 } 3333 3380 3334 #if L0363_MVP_POC3335 3381 if ( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getPOC() == pcTmpCU->getSlice()->getRefPOC( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) )) 3336 #else3337 if ( m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) )3338 #endif3339 3382 { 3340 3383 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 3519 3562 3520 3563 // use coldir. 3564 #if M0457_COL_PICTURE_SIGNALING 3565 TComPic *pColPic; 3566 if (m_layerId > 0 && getSlice()->getAltColIndicationFlag()) 3567 { 3568 pColPic = getSlice()->getMotionPredIlp(); 3569 } 3570 else 3571 { 3572 pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 3573 } 3574 #else 3521 3575 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 3576 #endif 3522 3577 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 3523 3578 if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE) … … 3526 3581 } 3527 3582 iCurrPOC = m_pcSlice->getPOC(); 3528 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();3529 3583 iColPOC = pColCU->getSlice()->getPOC(); 3530 3584 … … 4121 4175 4122 4176 #if SVC_COL_BLK 4123 TComDataCU* TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )4177 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4124 4178 { 4125 4179 #if 1 // it should provide identical resutls … … 4127 4181 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4128 4182 4129 return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );4183 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 4130 4184 #else 4131 4185 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); … … 4176 4230 } 4177 4231 4178 TComDataCU* TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )4179 { 4180 TComPic* cBaseColPic = m_pcSlice->getBaseColPic( );4232 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4233 { 4234 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc); 4181 4235 4182 4236 #if !SIMPLIFIED_MV_POS_SCALING … … 4206 4260 #if SIMPLIFIED_MV_POS_SCALING 4207 4261 #if SCALED_REF_LAYER_OFFSETS 4208 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow( ).getWindowLeftOffset();4209 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow( ).getWindowTopOffset();4210 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[ m_layerId][0] + (1<<15)) >> 16;4211 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[ m_layerId][1] + (1<<15)) >> 16;4262 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 4263 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 4264 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4265 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4212 4266 #else 4213 Int iBX = (uiPelX*g_posScalingFactor[ m_layerId][0] + (1<<15)) >> 16;4214 Int iBY = (uiPelY*g_posScalingFactor[ m_layerId][1] + (1<<15)) >> 16;4267 Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4268 Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4215 4269 #endif 4216 4270 #else … … 4234 4288 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow(); 4235 4289 4236 Int widthBL = m_pcSlice->getBaseColPic( )->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();4237 Int heightBL = m_pcSlice->getBaseColPic( )->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();4290 Int widthBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 4291 Int heightBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 4238 4292 #endif 4239 4293 if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture … … 4255 4309 } 4256 4310 4257 Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase )4311 Void TComDataCU::scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ) 4258 4312 { 4259 4313 TComMvField cMvFieldBase; 4260 4314 TComMv cMv; 4261 4315 #if SIMPLIFIED_MV_POS_SCALING 4262 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[ m_layerId][0], g_mvScalingFactor[m_layerId][1] );4316 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[refLayerIdc][0], g_mvScalingFactor[refLayerIdc][1] ); 4263 4317 #else 4264 4318 const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); -
trunk/source/Lib/TLibCommon/TComDataCU.h
r191 r310 533 533 #endif 534 534 535 #if FAST_INTRA_SHVC 536 Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); 537 #endif 538 535 539 #if REF_IDX_ME_ZEROMV 536 540 Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); … … 550 554 551 555 #if SVC_COL_BLK 552 TComDataCU* getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );553 TComDataCU* getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );554 Void scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );556 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 557 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 558 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 555 559 #endif 556 560 }; -
trunk/source/Lib/TLibCommon/TComLoopFilter.cpp
r191 r310 461 461 if ( ((piRefP0==piRefQ0)&&(piRefP1==piRefQ1)) || ((piRefP0==piRefQ1)&&(piRefP1==piRefQ0)) ) 462 462 { 463 uiBs = 0;464 463 if ( piRefP0 != piRefP1 ) // Different L0 & L1 465 464 { … … 694 693 for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ ) 695 694 { 696 ucBs = 0;697 698 695 uiBsAbsIdx = xCalcBsIdx( pcCU, uiAbsZorderIdx, iDir, iEdge, iIdx); 699 696 ucBs = m_aapucBS[iDir][uiBsAbsIdx]; -
trunk/source/Lib/TLibCommon/TComMv.h
r191 r310 152 152 const TComMv scaleMv( Int iScaleX, Int iScaleY ) const 153 153 { 154 Int mvx = Clip3( -32768, 32767, (iScaleX * getHor() + 127 + (iScaleX * getHor() < 0)) >> 8 );155 Int mvy = Clip3( -32768, 32767, (iScaleY * getVer() + 127 + (iScaleY * getVer() < 0)) >> 8 );154 Int mvx = iScaleX == 4096 ? getHor() : Clip3( -32768, 32767, (iScaleX * getHor() + 127 + (iScaleX * getHor() < 0)) >> 8 ); 155 Int mvy = iScaleY == 4096 ? getVer() : Clip3( -32768, 32767, (iScaleY * getVer() + 127 + (iScaleY * getVer() < 0)) >> 8 ); 156 156 return TComMv( mvx, mvy ); 157 157 } -
trunk/source/Lib/TLibCommon/TComPic.cpp
r191 r310 67 67 , m_pNDBFilterYuvTmp (NULL) 68 68 , m_bCheckLTMSB (false) 69 { 69 70 #if SVC_EXTENSION 70 , m_bSpatialEnhLayer( false ) 71 , m_pcFullPelBaseRec( NULL ) 72 #endif 73 { 71 memset( m_pcFullPelBaseRec, 0, sizeof( m_pcFullPelBaseRec ) ); 72 memset( m_bSpatialEnhLayer, false, sizeof( m_bSpatialEnhLayer ) ); 73 #endif 74 74 m_apcPicYuv[0] = NULL; 75 75 m_apcPicYuv[1] = NULL; … … 91 91 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 92 92 93 if (m_bSpatialEnhLayer) 94 { 95 m_pcFullPelBaseRec = new TComPicYuv; m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 93 for( Int i = 0; i < MAX_LAYERS; i++ ) 94 { 95 if( m_bSpatialEnhLayer[i] ) 96 { 97 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 98 } 96 99 } 97 100 … … 173 176 deleteSEIs(m_SEIs); 174 177 #if SVC_EXTENSION && SVC_UPSAMPLING 175 if (m_bSpatialEnhLayer) 176 { 177 m_pcFullPelBaseRec->destroy(); 178 delete m_pcFullPelBaseRec; 179 m_pcFullPelBaseRec = NULL; 178 for( Int i = 0; i < MAX_LAYERS; i++ ) 179 { 180 if( m_bSpatialEnhLayer[i] ) 181 { 182 m_pcFullPelBaseRec[i]->destroy(); 183 delete m_pcFullPelBaseRec[i]; 184 m_pcFullPelBaseRec[i] = NULL; 185 } 180 186 } 181 187 #endif … … 562 568 563 569 #if REF_IDX_MFM 564 Void TComPic::copyUpsampledMvField( TComPic* pcPicBase)570 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase) 565 571 { 566 572 #if AVC_SYNTAX && !ILP_DECODED_PICTURE … … 592 598 593 599 TComDataCU *pcColCU = 0; 594 pcColCU = pcCUDes->getBaseColCU( pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);600 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 595 601 596 602 #if AVC_SYNTAX && !ILP_DECODED_PICTURE … … 607 613 TComMvField sMvFieldBase, sMvField; 608 614 pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 609 pcCUDes->scaleBaseMV( sMvField, sMvFieldBase );615 pcCUDes->scaleBaseMV( refLayerIdc, sMvField, sMvFieldBase ); 610 616 611 617 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); -
trunk/source/Lib/TLibCommon/TComPic.h
r191 r310 92 92 SEIMessages m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. 93 93 #if SVC_EXTENSION 94 Bool m_bSpatialEnhLayer ; // whether current layer is a spatial enhancement layer,95 TComPicYuv* m_pcFullPelBaseRec ; // upsampled base layer recontruction for difference domain inter prediction94 Bool m_bSpatialEnhLayer[MAX_LAYERS]; // whether current layer is a spatial enhancement layer, 95 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; // upsampled base layer recontruction for difference domain inter prediction 96 96 #endif 97 97 … … 114 114 Void setLayerId (UInt layerId) { m_layerId = layerId; } 115 115 UInt getLayerId () { return m_layerId; } 116 Bool isSpatialEnhLayer( ) { return m_bSpatialEnhLayer; }117 Void setSpatialEnhLayerFlag ( Bool b) { m_bSpatialEnhLayer= b; }118 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec= p; }119 TComPicYuv* getFullPelBaseRec ( ) { return m_pcFullPelBaseRec; }116 Bool isSpatialEnhLayer(UInt refLayerIdc) { return m_bSpatialEnhLayer[refLayerIdc]; } 117 Void setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; } 118 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 119 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 120 120 #endif 121 121 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM … … 124 124 125 125 #if REF_IDX_MFM 126 Void copyUpsampledMvField ( TComPic* pcPicBase );126 Void copyUpsampledMvField ( UInt refLayerIdc, TComPic* pcPicBase ); 127 127 Void initUpsampledMvField (); 128 128 #endif -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r191 r310 92 92 #endif 93 93 94 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 95 Bool m_isReconstructed; 96 #endif 97 94 98 Bool m_bIsBorderExtended; 95 99 … … 126 130 #endif 127 131 128 #if JCTVC_L0178129 Void setWidth ( Int iPicWidth ) { m_iPicWidth = iPicWidth; }130 #endif131 132 Int getStride () { return (m_iPicWidth ) + (m_iLumaMarginX <<1); } 132 133 Int getCStride () { return (m_iPicWidth >> 1) + (m_iChromaMarginX<<1); } … … 177 178 // Dump picture 178 179 Void dump (Char* pFileName, Bool bAdd = false); 179 180 181 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 182 Void setReconstructed(Bool x) { m_isReconstructed = x; } 183 Bool isReconstructed() { return m_isReconstructed; } 184 #endif 185 180 186 // Set border extension flag 181 187 Void setBorderExtension(Bool b) { m_bIsBorderExtended = b; } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r191 r310 122 122 Pel TComPrediction::predIntraGetPredValDC( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft ) 123 123 { 124 assert(iWidth > 0 && iHeight > 0); 124 125 Int iInd, iSum = 0; 125 126 Pel pDcVal; … … 774 775 #if SVC_UPSAMPLING 775 776 #if SCALED_REF_LAYER_OFFSETS 776 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)777 { 778 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic, window);777 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 778 { 779 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window); 779 780 } 780 781 #else 781 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic)782 { 783 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic);782 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic) 783 { 784 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic); 784 785 } 785 786 #endif -
trunk/source/Lib/TLibCommon/TComPrediction.h
r191 r310 123 123 #if SVC_UPSAMPLING 124 124 #if SCALED_REF_LAYER_OFFSETS 125 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 126 126 #else 127 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );127 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 128 128 #endif 129 129 #endif -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r191 r310 485 485 } 486 486 487 #if RATE_CONTROL_LAMBDA_DOMAIN 487 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 488 488 UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ) 489 489 { -
trunk/source/Lib/TLibCommon/TComRdCost.h
r191 r310 168 168 #if RATE_CONTROL_LAMBDA_DOMAIN 169 169 Double getLambda() { return m_dLambda; } 170 #if M0036_RC_IMPROVEMENT 171 Double getChromaWeight () {return((m_cbDistortionWeight+m_crDistortionWeight)/2.0);} 172 #endif 170 173 #endif 171 174 … … 264 267 #endif 265 268 266 #if RATE_CONTROL_LAMBDA_DOMAIN 269 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 267 270 UInt getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ); 268 271 #endif -
trunk/source/Lib/TLibCommon/TComRom.cpp
r191 r310 99 99 UInt g_auiPUOffset[8] = { 0, 8, 4, 4, 2, 10, 1, 5}; 100 100 101 #if FAST_INTRA_SHVC 102 UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; 103 UInt g_predefSetIntraModes[NUM_INTRA_MODE-1] = {26,10,18,34,2,22,14,30,6,24,12,28,8,20,16,32,4,17,19,15,21,13,23,11,25,9,27,7,29,5,31,3,33,0,2}; 104 #endif 105 101 106 Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx ) 102 107 { -
trunk/source/Lib/TLibCommon/TComRom.h
r191 r310 132 132 133 133 extern const UChar g_aucIntraModeNumFast[7]; 134 135 #if FAST_INTRA_SHVC 136 extern UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1]; 137 extern UInt g_predefSetIntraModes[NUM_INTRA_MODE-1]; 138 #endif 134 139 135 140 // ==================================================================================================================== -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r191 r310 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 ) … … 75 71 , m_iDepth ( 0 ) 76 72 , m_bRefenced ( false ) 73 #if SH_DISCARDABLE_FLAG 74 , m_bDiscardableFlag ( false ) 75 #endif 77 76 , m_pcSPS ( NULL ) 78 77 , m_pcPPS ( NULL ) … … 86 85 , m_dLambda ( 0.0 ) 87 86 #endif 88 #if !L0034_COMBINED_LIST_CLEANUP89 , m_bNoBackPredFlag ( false )90 #endif91 87 , m_uiTLayer ( 0 ) 92 88 #if SVC_EXTENSION 93 89 , m_layerId ( 0 ) 94 , m_pcBaseColPic ( NULL )95 90 #endif 96 91 , m_bTLayerSwitchingFlag ( false ) … … 117 112 , m_enableTMVPFlag ( true ) 118 113 { 119 #if L0034_COMBINED_LIST_CLEANUP120 114 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; 121 #else 122 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 123 #endif 124 115 116 #if SVC_EXTENSION 117 memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) ); 125 118 #if REF_IDX_FRAMEWORK 126 119 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 131 124 m_numILRRefIdx = 0; 132 125 #endif 126 #if M0457_COL_PICTURE_SIGNALING 127 m_altColIndicationFlag = false; 128 m_colRefLayerIdx = 0; 129 #endif 130 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 131 m_numSamplePredRefLayers = 0; 132 m_interLayerSamplePredOnlyFlag = false; 133 #endif 134 #endif 133 135 #endif 134 136 135 137 initEqualRef(); 136 138 137 #if L0034_COMBINED_LIST_CLEANUP138 139 for ( Int idx = 0; idx < MAX_NUM_REF; idx++ ) 139 140 { 140 141 m_list1IdxToList0Idx[idx] = -1; 141 142 } 142 #else143 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)144 {145 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;146 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;147 m_eListIdFromIdxOfLC[iNumCount]=0;148 m_iRefIdxFromIdxOfLC[iNumCount]=0;149 m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;150 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;151 }152 #endif153 143 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++) 154 144 { … … 188 178 m_numILRRefIdx = 0; 189 179 #endif 190 180 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 181 m_numSamplePredRefLayers = 0; 182 m_interLayerSamplePredOnlyFlag = false; 183 #endif 191 184 #endif 192 185 m_colFromL0Flag = 1; … … 194 187 m_colRefIdx = 0; 195 188 initEqualRef(); 196 #if !L0034_COMBINED_LIST_CLEANUP197 m_bNoBackPredFlag = false;198 m_bRefPicListCombinationFlag = false;199 m_bRefPicListModificationFlagLC = false;200 #endif201 189 m_bCheckLDC = false; 202 190 m_iSliceQpDeltaCb = 0; 203 191 m_iSliceQpDeltaCr = 0; 204 205 #if !L0034_COMBINED_LIST_CLEANUP206 m_aiNumRefIdx[REF_PIC_LIST_C] = 0;207 #endif208 192 209 193 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 348 332 } 349 333 350 #if L0034_COMBINED_LIST_CLEANUP351 334 Void TComSlice::setList1IdxToList0Idx() 352 335 { … … 365 348 } 366 349 } 367 #else368 Void TComSlice::generateCombinedList()369 {370 if(m_aiNumRefIdx[REF_PIC_LIST_C] > 0)371 {372 m_aiNumRefIdx[REF_PIC_LIST_C]=0;373 for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)374 {375 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;376 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;377 m_eListIdFromIdxOfLC[iNumCount]=0;378 m_iRefIdxFromIdxOfLC[iNumCount]=0;379 m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;380 m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;381 }382 383 for (Int iNumRefIdx = 0; iNumRefIdx < MAX_NUM_REF; iNumRefIdx++)384 {385 if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_0])386 {387 Bool bTempRefIdxInL2 = true;388 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )389 {390 if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )391 {392 m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];393 m_iRefIdxOfL0FromRefIdxOfL1[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;394 bTempRefIdxInL2 = false;395 break;396 }397 }398 399 if(bTempRefIdxInL2 == true)400 {401 m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0;402 m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;403 m_iRefIdxOfLC[REF_PIC_LIST_0][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;404 }405 }406 407 if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_1])408 {409 Bool bTempRefIdxInL2 = true;410 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )411 {412 if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )413 {414 m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];415 m_iRefIdxOfL1FromRefIdxOfL0[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;416 bTempRefIdxInL2 = false;417 break;418 }419 }420 if(bTempRefIdxInL2 == true)421 {422 m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_1;423 m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;424 m_iRefIdxOfLC[REF_PIC_LIST_1][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;425 }426 }427 }428 }429 }430 #endif431 350 432 351 #if FIX1071 352 #if SVC_EXTENSION 433 353 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic) 354 #else 355 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) 356 #endif 434 357 #else 435 358 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) … … 440 363 #endif 441 364 { 442 if ( m_eSliceType == I_SLICE)365 if (m_eSliceType == I_SLICE) 443 366 { 444 367 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); 445 368 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 369 446 370 return; 447 371 } … … 479 403 pcRefPic->getPicYuvRec()->extendPicBorder(); 480 404 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic; 405 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 406 if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId()) 407 #endif 481 408 NumPocStCurr0++; 482 409 pcRefPic->setCheckLTMSBPresent(false); … … 492 419 pcRefPic->getPicYuvRec()->extendPicBorder(); 493 420 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic; 421 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 422 if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId()) 423 #endif 494 424 NumPocStCurr1++; 495 425 pcRefPic->setCheckLTMSBPresent(false); … … 505 435 pcRefPic->getPicYuvRec()->extendPicBorder(); 506 436 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic; 437 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 438 if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId()) 439 #endif 507 440 NumPocLtCurr++; 508 441 } … … 518 451 519 452 #if REF_IDX_FRAMEWORK 520 //inter-layer reference picture 453 for( i = 0; i < m_activeNumILRRefIdx; i++ ) 454 { 455 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 456 //inter-layer reference picture 521 457 #if REF_IDX_MFM 458 459 #if ILR_RESTR 460 Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0; 522 461 #if ZERO_NUM_DIRECT_LAYERS 523 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 524 #else 525 if (getLayerId()) 526 #endif 527 { 528 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 529 { 530 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); 531 } 532 else 533 { 534 ilpPic[0]->initUpsampledMvField(); 535 } 536 #endif 537 ilpPic[0]->setIsLongTerm(1); 462 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 463 #else 464 if( m_layerId > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 465 #endif 466 467 #else 468 #if ZERO_NUM_DIRECT_LAYERS 469 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 470 #else 471 if( m_layerId > 0 ) 472 #endif 473 #endif 474 { 475 #if M0457_COL_PICTURE_SIGNALING 476 if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && getMFMEnabledFlag()) 477 #else 478 if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && m_pcSPS->getMFMEnabledFlag()) 479 #endif 480 { 481 ilpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcBaseColPic[refLayerIdc] ); 482 } 483 else 484 { 485 ilpPic[refLayerIdc]->initUpsampledMvField(); 486 } 487 #endif 488 ilpPic[refLayerIdc]->setIsLongTerm(1); 489 } 538 490 } 539 491 #endif … … 542 494 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 543 495 #if REF_IDX_FRAMEWORK 496 #if ILR_RESTR 497 Int numInterLayerRPSPics = 0; 498 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 499 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 500 #else 501 if( m_layerId > 0 ) 502 #endif 503 { 504 for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ ) 505 { 506 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId()); 507 if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) ) 508 { 509 numInterLayerRPSPics++; 510 } 511 } 512 #if JCTVC_M0458_INTERLAYER_RPS_SIG 513 if (numInterLayerRPSPics < m_activeNumILRRefIdx) 514 { 515 m_activeNumILRRefIdx = numInterLayerRPSPics; 516 } 517 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS && SIMPLIFIED_MV_POS_SCALING 518 if( m_pcVPS->getScalabilityMask(1) ) 519 { 520 Int numResampler = 0; 521 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 522 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && 523 (scalEL.getWindowRightOffset() == 0 ) && 524 (scalEL.getWindowTopOffset() == 0 ) && 525 (scalEL.getWindowBottomOffset() == 0 ) 526 ); 527 528 for( i=0; i < m_activeNumILRRefIdx; i++ ) 529 { 530 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 531 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) && (scalingOffset)) // ratio 1x 532 { 533 numResampler++; 534 } 535 } 536 537 //Bitstream constraint for SHVC: The picture resampling process as specified in subclause G.8.1.4.1 shall not be invoked more than once for decoding of each particular picture. 538 assert(numResampler <= 1); 539 } 540 #endif 541 #else 542 if (numInterLayerRPSPics < m_numILRRefIdx) 543 { 544 m_numILRRefIdx = numInterLayerRPSPics; 545 } 546 #endif 547 } 548 #endif 544 549 #if JCTVC_M0458_INTERLAYER_RPS_SIG 545 550 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_activeNumILRRefIdx; … … 554 559 { 555 560 // 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: 561 #if ILP_RAP // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0 562 // – If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0. 563 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 564 if (getRapPicFlag() && getLayerId()==0) 565 #else 556 566 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 557 567 // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 558 568 if (getRapPicFlag()) 569 #endif 559 570 { 560 571 assert(numPocTotalCurr == 0); … … 569 580 } 570 581 571 assert(numPocTotalCurr !=0);582 assert(numPocTotalCurr > 0); 572 583 573 584 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); … … 575 586 } 576 587 #endif 577 588 589 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 590 if( m_interLayerSamplePredOnlyFlag && getLayerId() ) 591 { 592 m_aiNumRefIdx[0] = m_aiNumRefIdx[0] > m_activeNumILRRefIdx ? m_activeNumILRRefIdx : m_aiNumRefIdx[0]; 593 m_aiNumRefIdx[1] = m_aiNumRefIdx[1] > m_activeNumILRRefIdx ? m_activeNumILRRefIdx : m_aiNumRefIdx[1]; 594 } 595 #endif 596 578 597 Int cIdx = 0; 579 598 for ( i=0; i<NumPocStCurr0; i++, cIdx++) … … 588 607 { 589 608 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 590 } 609 } 610 591 611 #if REF_IDX_FRAMEWORK 592 if( getLayerId())612 if( m_layerId > 0 ) 593 613 { 594 614 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 598 618 #endif 599 619 { 600 rpsCurrList0[cIdx] = ilpPic[i]; 601 } 602 } 603 #endif 620 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 621 #if ILR_RESTR 622 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 623 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 624 #endif 625 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 626 } 627 } 628 #endif 629 assert(cIdx == numPocTotalCurr); 630 604 631 if (m_eSliceType==B_SLICE) 605 632 { … … 616 643 { 617 644 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 618 } 645 } 646 619 647 #if REF_IDX_FRAMEWORK 620 if( getLayerId())648 if( m_layerId > 0 ) 621 649 { 622 650 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 626 654 #endif 627 655 { 628 rpsCurrList1[cIdx] = ilpPic[i]; 629 } 630 } 631 #endif 656 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 657 #if ILR_RESTR 658 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 659 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 660 #endif 661 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; 662 } 663 } 664 #endif 665 666 assert(cIdx == numPocTotalCurr); 632 667 } 633 668 634 669 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm)); 635 670 636 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++) 637 { 638 m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? rpsCurrList0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : rpsCurrList0[rIdx % numPocTotalCurr]; 639 m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)) 640 : ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1)); 641 } 642 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 ) 643 679 { 644 680 m_aiNumRefIdx[1] = 0; … … 647 683 else 648 684 { 649 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++) 650 { 651 m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? rpsCurrList1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : rpsCurrList1[rIdx % numPocTotalCurr]; 652 m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? 653 (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 ); 654 691 } 655 692 } … … 659 696 Void TComSlice::setRefPicListModificationSvc() 660 697 { 661 if( ! this->getPPS()->getListsModificationPresentFlag())698 if( !m_pcPPS->getListsModificationPresentFlag()) 662 699 { 663 700 return; 664 701 } 665 702 666 if( this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType()<= NAL_UNIT_CODED_SLICE_CRA)703 if(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) 667 704 { 668 705 return; 669 706 } 670 707 671 TComRefPicListModification* refPicListModification = this->getRefPicListModification();708 TComRefPicListModification* refPicListModification = &m_RefPicListModification; 672 709 Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList(); // total number of ref pics in listTemp0 including inter-layer ref pics 673 710 … … 743 780 744 781 #if REF_IDX_FRAMEWORK 745 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() &&746 ( getNalUnitType()>= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&747 ( getNalUnitType()<= NAL_UNIT_CODED_SLICE_CRA) ) )782 if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() && 783 (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 784 (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) ) 748 785 #else 749 786 if (m_eSliceType == I_SLICE) … … 768 805 } 769 806 #if REF_IDX_FRAMEWORK 770 if( getLayerId())807 if( m_layerId > 0 ) 771 808 { 772 809 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 950 987 m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2; 951 988 952 #if L0034_COMBINED_LIST_CLEANUP953 989 for (i = 0; i < 2; i++) 954 #else955 for (i = 0; i < 3; i++)956 #endif957 990 { 958 991 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 959 992 } 960 993 961 #if L0034_COMBINED_LIST_CLEANUP962 994 for (i = 0; i < MAX_NUM_REF; i++) 963 995 { 964 996 m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i]; 965 997 } 966 #else967 for (i = 0; i < 2; i++)968 {969 for (j = 0; j < MAX_NUM_REF_LC; j++)970 {971 m_iRefIdxOfLC[i][j] = pSrc->m_iRefIdxOfLC[i][j];972 }973 }974 for (i = 0; i < MAX_NUM_REF_LC; i++)975 {976 m_eListIdFromIdxOfLC[i] = pSrc->m_eListIdFromIdxOfLC[i];977 m_iRefIdxFromIdxOfLC[i] = pSrc->m_iRefIdxFromIdxOfLC[i];978 m_iRefIdxOfL1FromRefIdxOfL0[i] = pSrc->m_iRefIdxOfL1FromRefIdxOfL0[i];979 m_iRefIdxOfL0FromRefIdxOfL1[i] = pSrc->m_iRefIdxOfL0FromRefIdxOfL1[i];980 }981 m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;982 m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag;983 #endif984 998 m_bCheckLDC = pSrc->m_bCheckLDC; 985 999 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 1012 1026 m_activeNumILRRefIdx = pSrc->m_activeNumILRRefIdx; 1013 1027 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1014 m_numInterLayerRefPics = pSrc->m_numInterLayerRefPics;1015 1028 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1016 1029 #elif REF_IDX_FRAMEWORK … … 1044 1057 } 1045 1058 1046 #if !L0034_COMBINED_LIST_CLEANUP1047 m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag;1048 #endif1049 1059 m_uiTLayer = pSrc->m_uiTLayer; 1050 1060 m_bTLayerSwitchingFlag = pSrc->m_bTLayerSwitchingFlag; … … 1351 1361 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1352 1362 */ 1363 #if FIX1071 1364 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1365 #else 1353 1366 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet) 1367 #endif 1354 1368 { 1355 1369 TComPic* rpcPic; … … 1376 1390 // and should be added to the explicit Reference Picture Set 1377 1391 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1392 #if FIX1071 1393 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1394 #else 1378 1395 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i)); 1396 #endif 1379 1397 if(pcRPS->getDeltaPOC(k) < 0) 1380 1398 { … … 1554 1572 { 1555 1573 m_numReorderPics[i] = 0; 1556 #if L0323_DPB1557 1574 m_uiMaxDecPicBuffering[i] = 1; 1558 #else1559 m_uiMaxDecPicBuffering[i] = 0;1560 #endif1561 1575 m_uiMaxLatencyIncrease[i] = 0; 1562 1576 } … … 1587 1601 ::memset(m_numDirectRefLayers, 0, sizeof(m_numDirectRefLayers )); 1588 1602 ::memset(m_refLayerId, 0, sizeof(m_refLayerId )); 1603 #if M0457_PREDICTION_INDICATIONS 1604 m_directDepTypeLen = 2; 1605 ::memset(m_directDependencyType, 0, sizeof(m_directDependencyType)); 1606 #endif 1589 1607 #endif 1590 1608 #if DERIVE_LAYER_ID_LIST_VARIABLES … … 1597 1615 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1598 1616 m_maxOneActiveRefLayerFlag = true; 1617 #endif 1618 #if JCTVC_M0203_INTERLAYER_PRED_IDC 1619 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 1620 { 1621 m_maxSublayerForIlpPlus1[i] = m_uiMaxTLayers + 1; 1622 } 1599 1623 #endif 1600 1624 } … … 1656 1680 , m_pcmLog2MaxSize ( 5) 1657 1681 , m_uiPCMLog2MinSize ( 7) 1658 #if !L0034_COMBINED_LIST_CLEANUP1659 , m_bUseLComb (false)1660 #endif1661 1682 , m_bitDepthY ( 8) 1662 1683 , m_bitDepthC ( 8) … … 1676 1697 , m_vuiParametersPresentFlag (false) 1677 1698 , m_vuiParameters () 1699 #if M0463_VUI_EXT_ILP_REF 1700 , m_interViewMvVertConstraintFlag (false) 1701 , m_numIlpRestrictedRefLayers ( 0 ) 1702 #endif 1678 1703 #if SVC_EXTENSION 1679 1704 , m_layerId(0) 1680 1705 #endif 1706 #if SCALED_REF_LAYER_OFFSETS 1707 , m_numScaledRefLayerOffsets (0) 1708 #endif 1681 1709 { 1682 1710 for ( Int i = 0; i < MAX_TLAYER; i++ ) 1683 1711 { 1684 1712 m_uiMaxLatencyIncrease[i] = 0; 1685 #if L0323_DPB1686 1713 m_uiMaxDecPicBuffering[i] = 1; 1687 #else1688 m_uiMaxDecPicBuffering[i] = 0;1689 #endif1690 1714 m_numReorderPics[i] = 0; 1691 1715 } … … 1693 1717 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 1694 1718 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 1719 #if M0463_VUI_EXT_ILP_REF 1720 for (Int i = 0; i < MAX_LAYERS; i++ ) 1721 { 1722 m_minSpatialSegmentOffsetPlus1[ i ] = 0; 1723 m_ctuBasedOffsetEnabledFlag [ i ] = false; 1724 m_minHorizontalCtuOffsetPlus1 [ i ] = 0; 1725 } 1726 #endif 1695 1727 } 1696 1728 … … 1717 1749 TComHRD *hrd = vui->getHrdParameters(); 1718 1750 1719 #if L0043_TIMING_INFO1720 1751 TimingInfo *timingInfo = vui->getTimingInfo(); 1721 1752 timingInfo->setTimingInfoPresentFlag( true ); … … 1741 1772 break; 1742 1773 } 1743 #else1744 hrd->setTimingInfoPresentFlag( true );1745 switch( frameRate )1746 {1747 case 24:1748 hrd->setNumUnitsInTick( 1125000 ); hrd->setTimeScale ( 27000000 );1749 break;1750 case 25:1751 hrd->setNumUnitsInTick( 1080000 ); hrd->setTimeScale ( 27000000 );1752 break;1753 case 30:1754 hrd->setNumUnitsInTick( 900900 ); hrd->setTimeScale ( 27000000 );1755 break;1756 case 50:1757 hrd->setNumUnitsInTick( 540000 ); hrd->setTimeScale ( 27000000 );1758 break;1759 case 60:1760 hrd->setNumUnitsInTick( 450450 ); hrd->setTimeScale ( 27000000 );1761 break;1762 default:1763 hrd->setNumUnitsInTick( 1001 ); hrd->setTimeScale ( 60000 );1764 break;1765 }1766 #endif1767 1774 1768 1775 Bool rateCnt = ( bitRate > 0 ); … … 1777 1784 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 1778 1785 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 1779 #if L0044_DU_DPB_OUTPUT_DELAY_HRD1780 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 1781 #endif1782 1787 } 1783 1788 else … … 1808 1813 UInt birateValue, cpbSizeValue; 1809 1814 UInt ducpbSizeValue; 1810 #if L0363_DU_BIT_RATE1811 1815 UInt duBitRateValue = 0; 1812 #endif1813 1816 1814 1817 for( i = 0; i < MAX_TLAYER; i ++ ) … … 1822 1825 cpbSizeValue = bitRate; // 1 second 1823 1826 ducpbSizeValue = bitRate/numDU; 1824 #if L0363_DU_BIT_RATE1825 1827 duBitRateValue = bitRate; 1826 #endif1827 1828 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 1828 1829 { … … 1835 1836 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 1836 1837 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 1837 #if L0363_DU_BIT_RATE1838 1838 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 1839 #endif1840 1839 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 1841 1840 } … … 2414 2413 , m_profileIdc (0) 2415 2414 , m_levelIdc (0) 2416 #if L0046_CONSTRAINT_FLAGS2417 2415 , m_progressiveSourceFlag (false) 2418 2416 , m_interlacedSourceFlag (false) 2419 2417 , m_nonPackedConstraintFlag(false) 2420 2418 , m_frameOnlyConstraintFlag(false) 2421 #endif2422 2419 { 2423 2420 ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag)); … … 2450 2447 // Copy all information related to general profile 2451 2448 this->getGeneralPTL()->copyProfileInfo(ptl->getGeneralPTL()); 2452 }2453 #endif2454 #if SIGNAL_BITRATE_PICRATE_IN_VPS2455 TComBitRatePicRateInfo::TComBitRatePicRateInfo()2456 {2457 ::memset(m_bitRateInfoPresentFlag, 0, sizeof(m_bitRateInfoPresentFlag));2458 ::memset(m_picRateInfoPresentFlag, 0, sizeof(m_picRateInfoPresentFlag));2459 ::memset(m_avgBitRate, 0, sizeof(m_avgBitRate));2460 ::memset(m_maxBitRate, 0, sizeof(m_maxBitRate));2461 ::memset(m_constantPicRateIdc, 0, sizeof(m_constantPicRateIdc));2462 ::memset(m_avgPicRate, 0, sizeof(m_avgPicRate));2463 2449 } 2464 2450 #endif … … 2509 2495 #endif 2510 2496 2511 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt layerID)2497 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc ) 2512 2498 { 2513 if (layerID== 0)2514 { 2515 m _pcBaseColPic = NULL;2499 if(m_layerId == 0) 2500 { 2501 memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) ); 2516 2502 return; 2517 2503 } 2518 setBaseColPic( xGetRefPic(rcListPic, getPOC()));2504 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 2519 2505 } 2520 2506 #endif 2521 2507 2522 2508 #if REF_IDX_MFM 2523 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) 2524 { 2525 //set reference picture POC of each ILP reference 2526 Int thePoc = ilpPic[0]->getPOC(); 2527 assert(thePoc >= 0); 2528 assert(thePoc == pcRefPicBL->getPOC()); 2529 2530 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2531 2532 //copy reference pictures marking from the reference layer 2533 ilpPic[0]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2534 2535 for( Int refList = 0; refList < 2; refList++ ) 2536 { 2537 RefPicList refPicList = RefPicList( refList ); 2538 2539 //set reference POC of ILP 2540 ilpPic[0]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2541 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2542 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2543 2544 //initialize reference POC of ILP 2545 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2546 { 2547 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2548 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2549 } 2550 2551 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2552 { 2553 ilpPic[0]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2554 ilpPic[0]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2509 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic** pcRefPicRL ) 2510 { 2511 for( UInt i = 0; i < m_activeNumILRRefIdx; i++ ) 2512 { 2513 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 2514 2515 TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc]; 2516 //set reference picture POC of each ILP reference 2517 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 2518 assert(thePoc >= 0); 2519 assert(thePoc == pcRefPicBL->getPOC()); 2520 2521 ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL ); 2522 2523 //copy reference pictures marking from the reference layer 2524 ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2525 2526 for( Int refList = 0; refList < 2; refList++ ) 2527 { 2528 RefPicList refPicList = RefPicList( refList ); 2529 2530 //set reference POC of ILP 2531 ilpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2532 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2533 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2534 2535 //initialize reference POC of ILP 2536 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2537 { 2538 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2539 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2540 } 2541 2542 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2543 { 2544 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2545 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2546 } 2555 2547 } 2556 2548 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r191 r310 191 191 Int m_levelIdc; 192 192 193 #if L0046_CONSTRAINT_FLAGS194 193 Bool m_progressiveSourceFlag; 195 194 Bool m_interlacedSourceFlag; 196 195 Bool m_nonPackedConstraintFlag; 197 196 Bool m_frameOnlyConstraintFlag; 198 #endif199 197 200 198 public: … … 216 214 Void setLevelIdc(Int x) { m_levelIdc = x; } 217 215 218 #if L0046_CONSTRAINT_FLAGS219 216 Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } 220 217 Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } … … 228 225 Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } 229 226 Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } 230 #endif231 227 #if VPS_EXTN_PROFILE_INFO 232 228 Void copyProfileInfo(ProfileTierLevel *ptl); … … 257 253 }; 258 254 /// VPS class 259 260 #if SIGNAL_BITRATE_PICRATE_IN_VPS261 class TComBitRatePicRateInfo262 {263 Bool m_bitRateInfoPresentFlag[MAX_TLAYER];264 Bool m_picRateInfoPresentFlag[MAX_TLAYER];265 Int m_avgBitRate[MAX_TLAYER];266 Int m_maxBitRate[MAX_TLAYER];267 Int m_constantPicRateIdc[MAX_TLAYER];268 Int m_avgPicRate[MAX_TLAYER];269 public:270 TComBitRatePicRateInfo();271 Bool getBitRateInfoPresentFlag(Int i) {return m_bitRateInfoPresentFlag[i];}272 Void setBitRateInfoPresentFlag(Int i, Bool x) {m_bitRateInfoPresentFlag[i] = x;}273 274 Bool getPicRateInfoPresentFlag(Int i) {return m_picRateInfoPresentFlag[i];}275 Void setPicRateInfoPresentFlag(Int i, Bool x) {m_picRateInfoPresentFlag[i] = x;}276 277 Int getAvgBitRate(Int i) {return m_avgBitRate[i];}278 Void setAvgBitRate(Int i, Int x) {m_avgBitRate[i] = x;}279 280 Int getMaxBitRate(Int i) {return m_maxBitRate[i];}281 Void setMaxBitRate(Int i, Int x) {m_maxBitRate[i] = x;}282 283 Int getConstantPicRateIdc(Int i) {return m_constantPicRateIdc[i];}284 Void setConstantPicRateIdc(Int i, Int x) {m_constantPicRateIdc[i] = x;}285 286 Int getAvgPicRate(Int i) {return m_avgPicRate[i];}287 Void setAvgPicRate(Int i, Int x) {m_avgPicRate[i] = x;}288 };289 #endif290 255 291 256 struct HrdSubLayerInfo … … 300 265 UInt ducpbSizeValue [MAX_CPB_CNT][2]; 301 266 UInt cbrFlag [MAX_CPB_CNT][2]; 302 #if L0363_DU_BIT_RATE303 267 UInt duBitRateValue [MAX_CPB_CNT][2]; 304 #endif305 268 }; 306 269 … … 308 271 { 309 272 private: 310 #if !L0043_TIMING_INFO311 Bool m_timingInfoPresentFlag;312 UInt m_numUnitsInTick;313 UInt m_timeScale;314 #endif315 273 Bool m_nalHrdParametersPresentFlag; 316 274 Bool m_vclHrdParametersPresentFlag; … … 319 277 UInt m_duCpbRemovalDelayLengthMinus1; 320 278 Bool m_subPicCpbParamsInPicTimingSEIFlag; 321 #if L0044_DU_DPB_OUTPUT_DELAY_HRD322 279 UInt m_dpbOutputDelayDuLengthMinus1; 323 #endif324 280 UInt m_bitRateScale; 325 281 UInt m_cpbSizeScale; … … 333 289 public: 334 290 TComHRD() 335 #if !L0043_TIMING_INFO336 :m_timingInfoPresentFlag(false)337 ,m_numUnitsInTick(1001)338 ,m_timeScale(60000)339 ,m_nalHrdParametersPresentFlag(0)340 #else341 291 :m_nalHrdParametersPresentFlag(0) 342 #endif343 292 ,m_vclHrdParametersPresentFlag(0) 344 293 ,m_subPicCpbParamsPresentFlag(false) … … 346 295 ,m_duCpbRemovalDelayLengthMinus1(0) 347 296 ,m_subPicCpbParamsInPicTimingSEIFlag(false) 348 #if L0044_DU_DPB_OUTPUT_DELAY_HRD349 297 ,m_dpbOutputDelayDuLengthMinus1(0) 350 #endif351 298 ,m_bitRateScale(0) 352 299 ,m_cpbSizeScale(0) … … 357 304 358 305 virtual ~TComHRD() {} 359 #if !L0043_TIMING_INFO360 Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; }361 Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; }362 363 Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; }364 UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; }365 366 Void setTimeScale ( UInt value ) { m_timeScale = value; }367 UInt getTimeScale ( ) { return m_timeScale; }368 #endif369 306 370 307 Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } … … 386 323 Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } 387 324 388 #if L0044_DU_DPB_OUTPUT_DELAY_HRD389 325 Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } 390 326 UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } 391 #endif392 327 393 328 Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } … … 430 365 Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } 431 366 UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } 432 #if L0363_DU_BIT_RATE433 367 Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } 434 368 UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } 435 #endif436 369 Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } 437 370 Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } … … 439 372 Void setNumDU ( UInt value ) { m_numDU = value; } 440 373 UInt getNumDU ( ) { return m_numDU; } 441 #if L0045_CONDITION_SIGNALLING442 374 Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } 443 #endif444 375 }; 445 376 446 #if L0043_TIMING_INFO447 377 class TimingInfo 448 378 { … … 475 405 Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } 476 406 }; 477 #endif478 407 479 408 class TComVPS … … 487 416 UInt m_numReorderPics[MAX_TLAYER]; 488 417 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 489 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; 418 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 490 419 491 420 UInt m_numHrdParameters; … … 509 438 #endif 510 439 TComPTL m_pcPTL; 511 #if SIGNAL_BITRATE_PICRATE_IN_VPS512 TComBitRatePicRateInfo m_bitRatePicRateInfo;513 #endif514 #if L0043_TIMING_INFO515 440 TimingInfo m_timingInfo; 516 #endif517 441 518 442 // ------------------------------------------ … … 549 473 UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; 550 474 UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 475 #if M0457_PREDICTION_INDICATIONS 476 UInt m_directDepTypeLen; 477 UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 478 #endif 551 479 #endif 552 480 #if VPS_PROFILE_OUTPUT_LAYERS … … 560 488 Bool m_maxOneActiveRefLayerFlag; 561 489 #endif 490 #if JCTVC_M0203_INTERLAYER_PRED_IDC 491 UInt m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 492 #endif 493 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 494 Bool m_singleLayerForNonIrapFlag; 495 #endif 562 496 public: 563 497 TComVPS(); … … 626 560 #endif 627 561 TComPTL* getPTL() { return &m_pcPTL; } 628 #if SIGNAL_BITRATE_PICRATE_IN_VPS629 TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; }630 #endif631 #if L0043_TIMING_INFO632 562 TimingInfo* getTimingInfo() { return &m_timingInfo; } 633 #endif634 563 #if VPS_EXTN_MASK_AND_DIM_INFO 635 564 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } … … 691 620 UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } 692 621 Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } 622 623 #if M0457_PREDICTION_INDICATIONS 624 UInt getDirectDepTypeLen() { return m_directDepTypeLen; } 625 Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } 626 627 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 628 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } 629 #endif 693 630 #endif 694 631 #if VPS_PROFILE_OUTPUT_LAYERS … … 712 649 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } 713 650 #endif 651 #if JCTVC_M0203_INTERLAYER_PRED_IDC 652 Bool getMaxSublayerForIlpPlus1(Int layerId) { return m_maxSublayerForIlpPlus1[layerId]; } 653 Void setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer) { m_maxSublayerForIlpPlus1[layerId] = maxSublayer; } 654 #endif 655 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 656 Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } 657 Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } 658 #endif 714 659 }; 715 660 … … 788 733 Int m_log2MaxMvLengthVertical; 789 734 TComHRD m_hrdParameters; 790 #if L0043_TIMING_INFO791 735 TimingInfo m_timingInfo; 792 # else793 Bool m_ pocProportionalToTimingFlag;794 Int m_numTicksPocDiffOneMinus1; 795 #endif 736 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 737 Bool m_tileBoundariesAlignedFlag; 738 #endif 739 796 740 797 741 public: … … 826 770 ,m_log2MaxMvLengthHorizontal(15) 827 771 ,m_log2MaxMvLengthVertical(15) 828 #if !L0043_TIMING_INFO 829 ,m_pocProportionalToTimingFlag(false) 830 ,m_numTicksPocDiffOneMinus1(0) 772 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 773 ,m_tileBoundariesAlignedFlag(true) 831 774 #endif 832 775 {} … … 924 867 925 868 TComHRD* getHrdParameters () { return &m_hrdParameters; } 926 #if L0043_TIMING_INFO927 869 TimingInfo* getTimingInfo() { return &m_timingInfo; } 928 #else 929 Bool getPocProportionalToTimingFlag() {return m_pocProportionalToTimingFlag; } 930 Void setPocProportionalToTimingFlag(Bool x) {m_pocProportionalToTimingFlag = x;} 931 Int getNumTicksPocDiffOneMinus1() {return m_numTicksPocDiffOneMinus1;} 932 Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x;} 870 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 871 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } 872 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } 933 873 #endif 934 874 }; … … 971 911 Bool m_useAMP; 972 912 973 #if !L0034_COMBINED_LIST_CLEANUP974 Bool m_bUseLComb;975 #endif976 977 913 // Parameter 978 914 Int m_bitDepthY; … … 1003 939 TComScalingList* m_scalingList; //!< ScalingList class pointer 1004 940 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 1005 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; 941 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) 1006 942 1007 943 Bool m_useDF; … … 1015 951 TComPTL m_pcPTL; 1016 952 953 #if M0463_VUI_EXT_ILP_REF 954 Bool m_interViewMvVertConstraintFlag; 955 Int m_numIlpRestrictedRefLayers ; 956 Int m_minSpatialSegmentOffsetPlus1[MAX_LAYERS]; 957 Bool m_ctuBasedOffsetEnabledFlag [MAX_LAYERS]; 958 Int m_minHorizontalCtuOffsetPlus1 [MAX_LAYERS]; 959 #endif 960 1017 961 #if SVC_EXTENSION 1018 962 UInt m_layerId; 1019 963 #endif 1020 964 #if REF_IDX_MFM 965 #if !M0457_COL_PICTURE_SIGNALING 1021 966 Bool m_bMFMEnabledFlag; 1022 967 #endif 968 #endif 1023 969 #if SCALED_REF_LAYER_OFFSETS 1024 Window m_scaledRefLayerWindow; 970 UInt m_numScaledRefLayerOffsets; 971 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1025 972 #endif 1026 973 public: … … 1098 1045 1099 1046 // Tool list 1100 #if !L0034_COMBINED_LIST_CLEANUP1101 Void setUseLComb (Bool b) { m_bUseLComb = b; }1102 Bool getUseLComb () { return m_bUseLComb; }1103 #endif1104 1105 1047 Bool getUseLossless () { return m_useLossless; } 1106 1048 Void setUseLossless ( Bool b ) { m_useLossless = b; } … … 1156 1098 1157 1099 #if SVC_EXTENSION 1100 #if M0463_VUI_EXT_ILP_REF 1101 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1102 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1103 1104 //// sps_extension_vui_parameters( ) 1105 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} 1106 Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} 1107 1108 Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;} 1109 Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];} 1110 1111 Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;} 1112 Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];} 1113 1114 Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} 1115 Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} 1116 #endif 1158 1117 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1159 1118 UInt getLayerId() { return m_layerId; } 1160 1119 #endif 1161 1120 #if REF_IDX_MFM 1121 #if !M0457_COL_PICTURE_SIGNALING 1162 1122 Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} 1163 1123 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} 1164 1124 #endif 1125 #endif 1165 1126 #if SCALED_REF_LAYER_OFFSETS 1166 Window& getScaledRefLayerWindow( ) { return m_scaledRefLayerWindow; } 1127 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1128 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1129 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1167 1130 #endif 1168 1131 }; … … 1431 1394 #endif 1432 1395 #endif 1433 #if L0034_COMBINED_LIST_CLEANUP 1396 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 1397 Int m_numSamplePredRefLayers; 1398 Bool m_interLayerSamplePredOnlyFlag; 1399 #endif 1434 1400 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1435 1401 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 1436 #else1437 Int m_aiNumRefIdx [3]; // for multiple reference of current slice1438 Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC];1439 Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC];1440 Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC];1441 Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC];1442 Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC];1443 Bool m_bRefPicListModificationFlagLC;1444 Bool m_bRefPicListCombinationFlag;1445 #endif1446 1402 1447 1403 Bool m_bCheckLDC; … … 1459 1415 Bool m_bRefenced; 1460 1416 1417 #if SH_DISCARDABLE_FLAG 1418 Bool m_bDiscardableFlag; 1419 #endif 1420 1461 1421 // access channel 1462 1422 TComVPS* m_pcVPS; … … 1481 1441 1482 1442 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1483 #if !L0034_COMBINED_LIST_CLEANUP1484 Bool m_bNoBackPredFlag;1485 #endif1486 1443 UInt m_uiTLayer; 1487 1444 #if SVC_EXTENSION 1488 1445 UInt m_layerId; 1489 TComPic* m_pcBaseColPic; 1490 TComPicYuv* m_pcFullPelBaseRec; 1446 TComPic* m_pcBaseColPic[MAX_LAYERS]; 1447 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; 1448 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1449 Int m_numMotionPredRefLayers; 1450 #if REF_IDX_MFM 1451 Bool m_bMFMEnabledFlag; 1452 Int m_colRefLayerIdx; 1453 Bool m_altColIndicationFlag; 1454 TComPic* m_pcIlpPic; 1455 #endif 1456 #endif 1491 1457 #endif 1492 1458 Bool m_bTLayerSwitchingFlag; … … 1525 1491 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1526 1492 Bool m_interLayerPredEnabledFlag; 1527 Int m_numInterLayerRefPics;1528 1493 #endif 1529 1494 public: … … 1595 1560 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1596 1561 Int getNumRpsCurrTempList(); 1597 #if L0034_COMBINED_LIST_CLEANUP1598 1562 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1599 #else1600 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; }1601 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; }1602 Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; }1603 Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];}1604 Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];}1605 Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;}1606 Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;}1607 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;}1608 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;}1609 #endif1610 1563 Void setReferenced(Bool b) { m_bRefenced = b; } 1611 1564 Bool isReferenced() { return m_bRefenced; } … … 1616 1569 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1617 1570 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1571 #if RESTR_CHK 1572 Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } 1573 Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } 1574 #endif 1575 1576 #if SH_DISCARDABLE_FLAG 1577 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 1578 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } 1579 #endif 1580 1618 1581 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); 1619 1582 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); … … 1638 1601 1639 1602 #if FIX1071 1603 #if SVC_EXTENSION 1640 1604 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 1605 #else 1606 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1607 #endif 1641 1608 #else 1642 1609 Void setRefPicList ( TComList<TComPic*>& rcListPic ); … … 1674 1641 1675 1642 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 1676 #if L0034_COMBINED_LIST_CLEANUP1677 1643 Void setList1IdxToList0Idx(); 1678 #else1679 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }1680 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }1681 Void generateCombinedList ();1682 #endif1683 1644 1684 1645 UInt getTLayer () { return m_uiTLayer; } … … 1691 1652 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); 1692 1653 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 1654 #if FIX1071 1655 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 1656 #else 1693 1657 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); 1658 #endif 1694 1659 1695 1660 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } … … 1764 1729 1765 1730 #if SVC_EXTENSION 1766 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); 1767 Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } 1768 TComPic* getBaseColPic () { return m_pcBaseColPic; } 1731 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 1732 Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 1733 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 1734 TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } 1769 1735 1770 1736 Void setLayerId (UInt layerId) { m_layerId = layerId; } 1771 1737 UInt getLayerId () { return m_layerId; } 1772 1738 1773 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec= p; }1774 TComPicYuv* getFullPelBaseRec ( ) { return m_pcFullPelBaseRec; }1739 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 1740 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 1775 1741 1776 1742 #if AVC_SYNTAX … … 1783 1749 1784 1750 #if REF_IDX_MFM 1785 Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL);1751 Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); 1786 1752 #endif 1787 1753 … … 1790 1756 Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } 1791 1757 1792 Int getInterLayerPredLayerIdc (UInt Idx ) { return m_interLayerPredLayerIdc[Idx];}1793 Void setInterLayerPredLayerIdc (UInt val, UInt Idx) { m_interLayerPredLayerIdc[Idx] = val; }1758 Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_interLayerPredLayerIdc[layerIdx];} 1759 Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdx) { m_interLayerPredLayerIdc[layerIdx] = refLayerIdc; } 1794 1760 1795 1761 Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } 1796 1762 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 1797 1798 Void setNumInterLayerRefPics ( UInt val ) { m_numInterLayerRefPics = val; }1799 UInt getNumInterLayerRefPics () { return m_numInterLayerRefPics;}1800 1763 #else 1801 1764 Void setNumILRRefIdx ( Int i ) { m_numILRRefIdx = i; } 1802 1765 #endif 1803 #endif 1766 1767 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 1768 Int getNumSamplePredRefLayers ( ) { return m_numSamplePredRefLayers; } 1769 Void setNumSamplePredRefLayers ( Int i ) { m_numSamplePredRefLayers = i; } 1770 Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } 1771 Void setInterLayerSamplePredOnlyFlag( Bool val ) { m_interLayerSamplePredOnlyFlag = val; } 1772 #endif 1773 1774 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1775 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 1776 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } 1777 #if REF_IDX_MFM 1778 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 1779 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 1780 Void setColRefLayerIdx(Int i) { m_colRefLayerIdx = i; } 1781 Int getColRefLayerIdx() { return m_colRefLayerIdx; } 1782 Void setAltColIndicationFlag(Bool i) { m_altColIndicationFlag = i; } 1783 Bool getAltColIndicationFlag() { return m_altColIndicationFlag; } 1784 Void setMotionPredIlp(TComPic *ilpPic) { m_pcIlpPic = ilpPic; } 1785 TComPic* getMotionPredIlp() { return m_pcIlpPic; } 1786 #endif 1787 #endif 1788 1789 #else 1790 // temporal solution for IntraBL. Only one reference layer is supported. 1791 Int getActiveNumILRRefIdx ( ) { return 1; } 1792 Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_layerId - 1;} 1793 Void setActiveNumILRRefIdx ( Int i ) {} 1794 Void setInterLayerPredEnabledFlag( Bool val ) {} 1795 #endif 1796 1797 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 1804 1798 1805 1799 #endif //SVC_EXTENSION -
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r191 r310 1075 1075 Int iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; // Represents scaling through forward transform 1076 1076 1077 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits1078 1079 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);1080 1081 1077 #if ADAPTIVE_QP_SELECTION 1082 iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;1078 Int iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift; 1083 1079 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9); 1084 1080 Int iQBitsC = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift - ARL_C_PRECISION; 1085 1081 Int iAddC = 1 << (iQBitsC-1); 1082 #else 1083 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1084 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9); 1086 1085 #endif 1087 1086 … … 1364 1363 #else 1365 1364 Int j; 1366 { 1367 Short block[ 64 * 64 ]; 1368 Short coeff[ 64 * 64 ]; 1369 { 1370 for (j = 0; j < iHeight; j++) 1371 { 1372 memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) ); 1373 } 1374 } 1375 xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode ); 1376 for ( j = 0; j < iHeight * iWidth; j++ ) 1377 { 1378 psCoeff[ j ] = coeff[ j ]; 1379 } 1380 return ; 1365 Short block[ 32 * 32 ]; 1366 Short coeff[ 32 * 32 ]; 1367 for (j = 0; j < iHeight; j++) 1368 { 1369 memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) ); 1370 } 1371 xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode ); 1372 for ( j = 0; j < iHeight * iWidth; j++ ) 1373 { 1374 psCoeff[ j ] = coeff[ j ]; 1381 1375 } 1382 1376 #endif … … 1399 1393 Int j; 1400 1394 { 1401 Short block[ 64 * 64];1402 Short coeff[ 64 * 64];1395 Short block[ 32 * 32 ]; 1396 Short coeff[ 32 * 32 ]; 1403 1397 for ( j = 0; j < iHeight * iWidth; j++ ) 1404 1398 { … … 1522 1516 UInt uiAbsPartIdx ) 1523 1517 { 1524 Int iQBits = m_cQP.m_iBits;1525 Double dTemp = 0;1526 1518 UInt uiLog2TrSize = g_aucConvertToBit[ uiWidth ] + 2; 1527 Int uiQ = g_quantScales[m_cQP.rem()];1528 1519 1529 1520 UInt uiBitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC; … … 1536 1527 assert(scalingListType < 6); 1537 1528 1538 iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1539 Double dErrScale = 0; 1529 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1540 1530 Double *pdErrScaleOrg = getErrScaleCoeff(scalingListType,uiLog2TrSize-2,m_cQP.m_iRem); 1541 1531 Int *piQCoefOrg = getQuantCoeff(scalingListType,m_cQP.m_iRem,uiLog2TrSize-2); … … 1589 1579 Double d64BaseCost = 0; 1590 1580 Int iLastScanPos = -1; 1591 dTemp = dErrScale;1592 1581 1593 1582 UInt c1Idx = 0; … … 1618 1607 UInt uiBlkPos = scan[iScanPos]; 1619 1608 // set coeff 1620 uiQ = piQCoef[uiBlkPos];1621 dTemp = pdErrScale[uiBlkPos];1609 Int uiQ = piQCoef[uiBlkPos]; 1610 Double dTemp = pdErrScale[uiBlkPos]; 1622 1611 Int lLevelDouble = plSrcCoeff[ uiBlkPos ]; 1623 1612 lLevelDouble = (Int)min<Int64>((Int64)abs((Int)lLevelDouble) * uiQ , MAX_INT - (1 << (iQBits - 1))); -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r229 r310 4 4 5 5 #if SVC_UPSAMPLING 6 // ====================================================================================================================7 // Tables:8 // 1. PHASE_DERIVATION_IN_INTEGER = 0 is the implementation using 2 multi-phase (12 phase and 8 phase) filter sets9 // by following K0378.10 // 2. PHASE_DERIVATION_IN_INTEGER = 1 is the implemetation using a 16-phase filter set just for speed up. Some phases11 // is approximated to x/16 (e.g. 1/3 -> 5/16).12 // 3. It was confirmed that two implementations provides the identical result.13 // 4. By default, PHASE_DERIVATION_IN_INTEGER is set to 1.14 // ====================================================================================================================15 6 #define CNU -1 ///< Coefficients Not Used 16 7 17 #if PHASE_DERIVATION_IN_INTEGER18 8 const Int TComUpsampleFilter::m_lumaFixedFilter[16][NTAPS_US_LUMA] = 19 9 { … … 74 64 #endif 75 65 }; 76 #else77 const Int TComUpsampleFilter::m_lumaFixedFilter[12][NTAPS_US_LUMA] =78 {79 { 0, 0, 0, 64, 0, 0, 0, 0},80 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//1/1281 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//2/1282 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//3/1283 { -1, 4, -11, 52, 26, -8, 3, -1},//4/1284 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//5/1285 { -1, 4, -11, 40, 40, -11, 4, -1},//6/1286 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//7/1287 { -1, 3, -8, 26, 52, -11, 4, -1},//8/1288 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//9/1289 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//10/1290 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU},//11/1291 };92 93 const Int TComUpsampleFilter::m_chromaFixedFilter15[12][NTAPS_US_CHROMA] =94 {95 { 0, 64, 0, 0},96 {CNU,CNU,CNU,CNU},//1/1297 {CNU,CNU,CNU,CNU},//2/1298 { -4, 54, 16, -2},//3/1299 { -5, 50, 22, -3},//4/12100 {CNU,CNU,CNU,CNU},//5/12101 {CNU,CNU,CNU,CNU},//6/12102 { -4, 30, 43, -5},//7/12103 { -3, 22, 50, -5},//8/12104 {CNU,CNU,CNU,CNU},//9/12105 {CNU,CNU,CNU,CNU},//10/12106 { -1, 5, 62, -2} //11/12107 };108 109 const Int TComUpsampleFilter::m_chromaFixedFilter20[8][NTAPS_US_CHROMA] =110 {111 { 0, 64, 0, 0},112 {CNU,CNU,CNU,CNU},//1/8113 {CNU,CNU,CNU,CNU},//2/8114 { -6, 46, 28, -4},//3/8115 { -4, 36, 36, -4},//4/8116 {CNU,CNU,CNU,CNU},//5/8117 {CNU,CNU,CNU,CNU},//6/8118 { -2, 10, 58, -2},//7/8119 };120 #endif121 66 122 67 TComUpsampleFilter::TComUpsampleFilter(void) … … 129 74 130 75 #if SCALED_REF_LAYER_OFFSETS 131 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )132 #else 133 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )76 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 77 #else 78 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 134 79 #endif 135 80 { … … 165 110 Pel* piSrcBufY = pcBasePic->getLumaAddr(); 166 111 Pel* piDstBufY = pcUsPic->getLumaAddr(); 167 112 168 113 Pel* piSrcY; 169 114 Pel* piDstY; 170 115 171 116 Pel* piTempBufU = pcTempPic->getCbAddr(); 172 117 Pel* piSrcBufU = pcBasePic->getCbAddr(); 173 118 Pel* piDstBufU = pcUsPic->getCbAddr(); 174 119 175 120 Pel* piTempBufV = pcTempPic->getCrAddr(); 176 121 Pel* piSrcBufV = pcBasePic->getCrAddr(); 177 122 Pel* piDstBufV = pcUsPic->getCrAddr(); 178 123 179 124 Pel* piSrcU; 180 125 Pel* piDstU; 181 126 Pel* piSrcV; 182 127 Pel* piDstV; 183 184 #if JCTVC_L0178 185 Pel *tempBufRight = NULL, *tempBufBottom = NULL; 186 Int tempBufSizeRight = 0, tempBufSizeBottom = 0; 187 188 if( confBL.getWindowRightOffset()) 189 { 190 tempBufSizeRight = confBL.getWindowRightOffset() * pcBasePic->getHeight(); 191 } 192 193 if( confBL.getWindowBottomOffset() ) 194 { 195 tempBufSizeBottom = confBL.getWindowBottomOffset() * pcBasePic->getWidth (); 196 } 197 198 if( tempBufSizeRight ) 199 { 200 tempBufRight = (Pel *) xMalloc(Pel, tempBufSizeRight + (tempBufSizeRight>>1) ); 201 assert( tempBufRight ); 202 } 203 204 if( tempBufSizeBottom ) 205 { 206 tempBufBottom = (Pel *) xMalloc(Pel, tempBufSizeBottom + (tempBufSizeBottom>>1) ); 207 assert( tempBufBottom ); 208 } 209 210 #endif 211 212 if( widthEL == widthBL && heightEL == heightBL ) 128 129 #if SIMPLIFIED_MV_POS_SCALING 130 Int scaleX = g_posScalingFactor[refLayerIdc][0]; 131 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 132 #else 133 Int scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 134 Int scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 135 #endif 136 137 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x 213 138 { 214 139 piSrcY = piSrcBufY - scalEL.getWindowLeftOffset() - scalEL.getWindowTopOffset() * strideEL; … … 248 173 else 249 174 { 250 #if PHASE_DERIVATION_IN_INTEGER 251 Int refPos16 = 0; 252 Int phase = 0; 253 Int refPos = 0; 254 Int* coeff = m_chromaFilter[phase]; 255 for ( i = 0; i < 16; i++) 256 { 257 memcpy( m_lumaFilter[i], m_lumaFixedFilter[i], sizeof(Int) * NTAPS_US_LUMA ); 258 memcpy( m_chromaFilter[i], m_chromaFixedFilter[i], sizeof(Int) * NTAPS_US_CHROMA ); 259 } 260 #else 261 for ( i = 0; i < 12; i++) 262 { 263 memcpy( m_lumaFilter[i], m_lumaFixedFilter[i], sizeof(Int) * NTAPS_US_LUMA ); 264 } 265 266 Int chromaPhaseDenominator; 267 if (widthEL == 2*widthBL) // 2x scalability 268 { 269 for ( i = 0; i < 8; i++) 270 { 271 memcpy( m_chromaFilter[i], m_chromaFixedFilter20[i], sizeof(Int) * NTAPS_US_CHROMA ); 272 } 273 chromaPhaseDenominator = 8; 274 } 275 else 276 { 277 for ( i = 0; i < 12; i++) // 1.5x scalability 278 { 279 memcpy( m_chromaFilter[i], m_chromaFixedFilter15[i], sizeof(Int) * NTAPS_US_CHROMA ); 280 } 281 chromaPhaseDenominator = 12; 282 } 283 #endif 284 285 assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL ); 286 assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL ); 287 288 #if JCTVC_L0178 289 // save the cropped region to copy back to the base picture since the base picture might be used as a reference picture 290 if( tempBufSizeRight ) 291 { 292 piSrcY = piSrcBufY + widthBL; 293 piDstY = tempBufRight; 294 for( i = 0; i < pcBasePic->getHeight(); i++ ) 295 { 296 memcpy(piDstY, piSrcY, sizeof(Pel) * confBL.getWindowRightOffset()); 297 piSrcY += strideBL; 298 piDstY += confBL.getWindowRightOffset(); 299 } 300 301 if(confBL.getWindowRightOffset()>>1) 302 { 303 Int strideBLChroma = (strideBL>>1); 304 piSrcU = piSrcBufU + (widthBL>>1); 305 piDstU = tempBufRight + confBL.getWindowRightOffset() * pcBasePic->getHeight(); 306 piSrcV = piSrcBufV + (widthBL>>1); 307 piDstV = piDstU + (confBL.getWindowRightOffset()>>1) * (pcBasePic->getHeight()>>1); 308 309 for( i = 0; i < pcBasePic->getHeight()>>1; i++ ) 310 { 311 memcpy(piDstU, piSrcU, sizeof(Pel) * (confBL.getWindowRightOffset()>>1)); 312 piSrcU += strideBLChroma; 313 piDstU += (confBL.getWindowRightOffset()>>1); 314 315 memcpy(piDstV, piSrcV, sizeof(Pel) * (confBL.getWindowRightOffset()>>1)); 316 piSrcV += strideBLChroma; 317 piDstV += (confBL.getWindowRightOffset()>>1); 318 } 319 } 320 321 pcBasePic->setWidth(widthBL); 322 } 323 324 if( tempBufSizeBottom ) 325 { 326 piSrcY = piSrcBufY + heightBL * strideBL; 327 piDstY = tempBufBottom; 328 for( i = 0; i < confBL.getWindowBottomOffset(); i++ ) 329 { 330 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth()); 331 piSrcY += strideBL; 332 piDstY += pcBasePic->getWidth(); 333 } 334 335 if(confBL.getWindowBottomOffset()>>1) 336 { 337 Int strideBLChroma = (strideBL>>1); 338 piSrcU = piSrcBufU + (heightBL>>1) * strideBLChroma; 339 piDstU = tempBufBottom + confBL.getWindowBottomOffset() * pcBasePic->getWidth(); 340 piSrcV = piSrcBufV + (heightBL>>1) * strideBLChroma; 341 piDstV = piDstU + (confBL.getWindowBottomOffset()>>1) * (pcBasePic->getWidth()>>1); 175 Int refPos16 = 0; 176 Int phase = 0; 177 Int refPos = 0; 178 Int* coeff = m_chromaFilter[phase]; 179 for ( i = 0; i < 16; i++) 180 { 181 memcpy( m_lumaFilter[i], m_lumaFixedFilter[i], sizeof(Int) * NTAPS_US_LUMA ); 182 memcpy( m_chromaFilter[i], m_chromaFixedFilter[i], sizeof(Int) * NTAPS_US_CHROMA ); 183 } 184 185 assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL ); 186 assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL ); 187 188 pcBasePic->setBorderExtension(false); 189 pcBasePic->extendPicBorder (); // extend the border. 190 191 Int shiftX = 16; 192 Int shiftY = 16; 193 194 Int phaseX = 0; 195 Int phaseY = 0; 196 197 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 198 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 199 200 Int deltaX = 4 * phaseX; 201 Int deltaY = 4 * phaseY; 202 203 Int shiftXM4 = shiftX - 4; 204 Int shiftYM4 = shiftY - 4; 205 206 #if ILP_DECODED_PICTURE 207 widthEL = pcUsPic->getWidth (); 208 heightEL = pcUsPic->getHeight(); 209 210 widthBL = pcBasePic->getWidth (); 211 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 212 #endif 213 #if SCALED_REF_LAYER_OFFSETS 214 Int leftStartL = scalEL.getWindowLeftOffset(); 215 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); 216 Int topStartL = scalEL.getWindowTopOffset(); 217 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 218 #endif 219 220 //========== horizontal upsampling =========== 221 for( i = 0; i < widthEL; i++ ) 222 { 223 #if SCALED_REF_LAYER_OFFSETS 224 Int x = Clip3( leftStartL, rightEndL - 1, i ); 225 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 226 #else 227 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 228 #endif 229 phase = refPos16 & 15; 230 refPos = refPos16 >> 4; 231 coeff = m_lumaFilter[phase]; 232 233 piSrcY = piSrcBufY + refPos -((NTAPS_US_LUMA>>1) - 1); 234 piDstY = piTempBufY + i; 235 236 for( j = 0; j < heightBL ; j++ ) 237 { 238 *piDstY = sumLumaHor(piSrcY, coeff); 239 piSrcY += strideBL; 240 piDstY += strideEL; 241 } 242 } 243 244 //========== vertical upsampling =========== 245 pcTempPic->setBorderExtension(false); 246 pcTempPic->setHeight(heightBL); 247 pcTempPic->extendPicBorder (); // extend the border. 248 pcTempPic->setHeight(heightEL); 249 250 const Int nShift = US_FILTER_PREC*2; 251 Int iOffset = 1 << (nShift - 1); 252 253 #if SCALED_REF_LAYER_OFFSETS 254 for( j = 0; j < pcTempPic->getHeight(); j++ ) 255 #else 256 for( j = 0; j < heightEL; j++ ) 257 #endif 258 { 259 #if SCALED_REF_LAYER_OFFSETS 260 Int y = Clip3(topStartL, bottomEndL - 1, j); 261 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 262 #else 263 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 264 #endif 265 phase = refPos16 & 15; 266 refPos = refPos16 >> 4; 267 coeff = m_lumaFilter[phase]; 268 269 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 270 #if SCALED_REF_LAYER_OFFSETS 271 #if 1 // it should provide identical result 272 Pel* piDstY0 = piDstBufY + j * strideEL; 273 piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 ); 274 275 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 276 { 277 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 278 piSrcY++; 279 piDstY++; 280 } 281 282 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 283 { 284 *piDstY = piDstY0[rightEndL-1]; 285 piDstY++; 286 } 287 288 piDstY = piDstY0; 289 for( i = 0; i < leftStartL; i++ ) 290 { 291 *piDstY = piDstY0[leftStartL]; 292 piDstY++; 293 } 294 #else 295 piDstY = piDstBufY + j * strideEL; 296 297 for( i = 0; i < pcTempPic->getWidth(); i++ ) 298 { 299 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 300 301 // Only increase the x position of reference upsample picture when within the window 302 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 303 if( (i >= leftStartL) && (i <= rightEndL-2) ) 304 { 305 piSrcY++; 306 } 307 piDstY++; 308 } 309 #endif 310 #else 311 piDstY = piDstBufY + j * strideEL; 312 313 for( i = 0; i < widthEL; i++ ) 314 { 315 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 316 piSrcY++; 317 piDstY++; 318 } 319 #endif 320 } 321 322 #if ILP_DECODED_PICTURE 323 #if SCALED_REF_LAYER_OFFSETS 324 widthBL = pcBasePic->getWidth (); 325 heightBL = pcBasePic->getHeight(); 326 327 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 328 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 329 #else 330 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 331 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 332 333 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 334 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 335 #endif 336 #endif 337 338 //========== UV component upsampling =========== 339 340 widthEL >>= 1; 341 heightEL >>= 1; 342 343 widthBL >>= 1; 344 heightBL >>= 1; 345 346 strideBL = pcBasePic->getCStride(); 347 strideEL = pcUsPic->getCStride(); 348 #if SCALED_REF_LAYER_OFFSETS 349 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 350 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); 351 Int topStartC = scalEL.getWindowTopOffset() >> 1; 352 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 353 #endif 354 355 shiftX = 16; 356 shiftY = 16; 357 358 phaseX = 0; 359 phaseY = 1; 360 361 addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 362 addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 363 364 deltaX = 4 * phaseX; 365 deltaY = 4 * phaseY; 366 367 shiftXM4 = shiftX - 4; 368 shiftYM4 = shiftY - 4; 369 370 #if !SIMPLIFIED_MV_POS_SCALING 371 scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 372 scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 373 #endif 374 375 #if ILP_DECODED_PICTURE 376 widthEL = pcUsPic->getWidth () >> 1; 377 heightEL = pcUsPic->getHeight() >> 1; 378 379 widthBL = pcBasePic->getWidth () >> 1; 380 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 381 #endif 382 383 //========== horizontal upsampling =========== 384 for( i = 0; i < widthEL; i++ ) 385 { 386 #if SCALED_REF_LAYER_OFFSETS 387 Int x = Clip3(leftStartC, rightEndC - 1, i); 388 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 389 #else 390 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 391 #endif 392 phase = refPos16 & 15; 393 refPos = refPos16 >> 4; 394 coeff = m_chromaFilter[phase]; 395 396 piSrcU = piSrcBufU + refPos -((NTAPS_US_CHROMA>>1) - 1); 397 piSrcV = piSrcBufV + refPos -((NTAPS_US_CHROMA>>1) - 1); 398 piDstU = piTempBufU + i; 399 piDstV = piTempBufV + i; 400 401 for( j = 0; j < heightBL ; j++ ) 402 { 403 *piDstU = sumChromaHor(piSrcU, coeff); 404 *piDstV = sumChromaHor(piSrcV, coeff); 405 406 piSrcU += strideBL; 407 piSrcV += strideBL; 408 piDstU += strideEL; 409 piDstV += strideEL; 410 } 411 } 412 413 //========== vertical upsampling =========== 414 pcTempPic->setBorderExtension(false); 415 pcTempPic->setHeight(heightBL << 1); 416 pcTempPic->extendPicBorder (); // extend the border. 417 pcTempPic->setHeight(heightEL << 1); 418 419 #if SCALED_REF_LAYER_OFFSETS 420 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 421 #else 422 for( j = 0; j < heightEL; j++ ) 423 #endif 424 { 425 #if SCALED_REF_LAYER_OFFSETS 426 Int y = Clip3(topStartC, bottomEndC - 1, j); 427 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 428 #else 429 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 430 #endif 431 phase = refPos16 & 15; 432 refPos = refPos16 >> 4; 433 coeff = m_chromaFilter[phase]; 342 434 343 for( i = 0; i < confBL.getWindowBottomOffset()>>1; i++ ) 344 { 345 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 346 piSrcU += strideBLChroma; 347 piDstU += (pcBasePic->getWidth()>>1); 348 349 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 350 piSrcV += strideBLChroma; 351 piDstV += (pcBasePic->getWidth()>>1); 352 } 353 } 354 355 pcBasePic->setHeight(heightBL); 356 } 357 #endif 358 359 pcBasePic->setBorderExtension(false); 360 pcBasePic->extendPicBorder (); // extend the border. 361 362 #if PHASE_DERIVATION_IN_INTEGER 363 Int shiftX = 16; 364 Int shiftY = 16; 365 366 Int phaseX = 0; 367 Int phaseY = 0; 368 369 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 370 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 371 372 Int deltaX = 4 * phaseX; 373 Int deltaY = 4 * phaseY; 374 375 Int shiftXM4 = shiftX - 4; 376 Int shiftYM4 = shiftY - 4; 377 378 Int scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 379 Int scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 380 #else 381 const Double sFactor = 1.0 * widthBL / widthEL; 382 const Double sFactor12 = sFactor * 12; 383 #endif 384 #if ILP_DECODED_PICTURE 385 widthEL = pcUsPic->getWidth (); 386 heightEL = pcUsPic->getHeight(); 387 388 widthBL = pcBasePic->getWidth (); 389 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 390 #endif 391 #if SCALED_REF_LAYER_OFFSETS 392 Int leftStartL = scalEL.getWindowLeftOffset(); 393 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); 394 Int topStartL = scalEL.getWindowTopOffset(); 395 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 396 #endif 397 398 //========== horizontal upsampling =========== 399 for( i = 0; i < widthEL; i++ ) 400 { 401 #if SCALED_REF_LAYER_OFFSETS 402 Int x = Clip3( leftStartL, rightEndL - 1, i ); 403 #endif 404 #if PHASE_DERIVATION_IN_INTEGER 405 #if SCALED_REF_LAYER_OFFSETS 406 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 407 #else 408 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 409 #endif 410 phase = refPos16 & 15; 411 refPos = refPos16 >> 4; 412 coeff = m_lumaFilter[phase]; 413 #else 414 Int refPos12 = (Int) ( i * sFactor12 ); 415 Int refPos = (Int)( i * sFactor ); 416 Int phase = (refPos12 + 12) % 12; 417 Int* coeff = m_lumaFilter[phase]; 418 #endif 419 420 piSrcY = piSrcBufY + refPos -((NTAPS_US_LUMA>>1) - 1); 421 piDstY = piTempBufY + i; 422 423 for( j = 0; j < heightBL ; j++ ) 424 { 425 *piDstY = sumLumaHor(piSrcY, coeff); 426 piSrcY += strideBL; 427 piDstY += strideEL; 428 } 429 } 430 431 432 //========== vertical upsampling =========== 433 pcTempPic->setBorderExtension(false); 434 pcTempPic->setHeight(heightBL); 435 pcTempPic->extendPicBorder (); // extend the border. 436 pcTempPic->setHeight(heightEL); 437 438 const Int nShift = US_FILTER_PREC*2; 439 Int iOffset = 1 << (nShift - 1); 440 441 #if SCALED_REF_LAYER_OFFSETS 442 for( j = 0; j < pcTempPic->getHeight(); j++ ) 443 #else 444 for( j = 0; j < heightEL; j++ ) 445 #endif 446 { 447 #if SCALED_REF_LAYER_OFFSETS 448 Int y = Clip3(topStartL, bottomEndL - 1, j); 449 #endif 450 #if PHASE_DERIVATION_IN_INTEGER 451 #if SCALED_REF_LAYER_OFFSETS 452 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 453 #else 454 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 455 #endif 456 phase = refPos16 & 15; 457 refPos = refPos16 >> 4; 458 coeff = m_lumaFilter[phase]; 459 #else 460 Int refPos12 = (Int) (j * sFactor12 ); 461 Int refPos = (Int)( j * sFactor ); 462 Int phase = (refPos12 + 12) % 12; 463 Int* coeff = m_lumaFilter[phase]; 464 #endif 465 466 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 467 piDstY = piDstBufY + j * strideEL; 468 #if SCALED_REF_LAYER_OFFSETS 469 for( i = 0; i < pcTempPic->getWidth(); i++ ) 470 #else 471 for( i = 0; i < widthEL; i++ ) 472 #endif 473 { 474 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 475 #if SCALED_REF_LAYER_OFFSETS 476 // Only increase the x position of reference upsample picture when within the window 477 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 478 if( (i >= leftStartL) && (i <= rightEndL-2) ) 479 { 480 piSrcY++; 481 } 482 #else 483 piSrcY++; 484 #endif 485 piDstY++; 486 } 487 } 488 489 #if ILP_DECODED_PICTURE 490 #if SCALED_REF_LAYER_OFFSETS 491 widthBL = pcBasePic->getWidth (); 492 heightBL = pcBasePic->getHeight(); 493 494 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 495 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 496 #else 497 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 498 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 499 500 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 501 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 502 #endif 503 #endif 504 505 //========== UV component upsampling =========== 506 507 widthEL >>= 1; 508 heightEL >>= 1; 509 510 widthBL >>= 1; 511 heightBL >>= 1; 512 513 strideBL = pcBasePic->getCStride(); 514 strideEL = pcUsPic->getCStride(); 515 #if SCALED_REF_LAYER_OFFSETS 516 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 517 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); 518 Int topStartC = scalEL.getWindowTopOffset() >> 1; 519 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 520 #endif 521 522 #if PHASE_DERIVATION_IN_INTEGER 523 shiftX = 16; 524 shiftY = 16; 525 526 phaseX = 0; 527 phaseY = 1; 528 529 addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 530 addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 531 532 deltaX = 4 * phaseX; 533 deltaY = 4 * phaseY; 534 535 shiftXM4 = shiftX - 4; 536 shiftYM4 = shiftY - 4; 537 538 scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 539 scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 540 #endif 541 542 #if ILP_DECODED_PICTURE 543 widthEL = pcUsPic->getWidth () >> 1; 544 heightEL = pcUsPic->getHeight() >> 1; 545 546 widthBL = pcBasePic->getWidth () >> 1; 547 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 548 #endif 549 550 //========== horizontal upsampling =========== 551 for( i = 0; i < widthEL; i++ ) 552 { 553 #if SCALED_REF_LAYER_OFFSETS 554 Int x = Clip3(leftStartC, rightEndC - 1, i); 555 #endif 556 #if PHASE_DERIVATION_IN_INTEGER 557 #if SCALED_REF_LAYER_OFFSETS 558 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 559 #else 560 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 561 #endif 562 phase = refPos16 & 15; 563 refPos = refPos16 >> 4; 564 coeff = m_chromaFilter[phase]; 565 #else 566 Int refPosM = (Int) ( i * chromaPhaseDenominator * sFactor ); 567 Int refPos = (Int)( i * sFactor ); 568 Int phase = (refPosM + chromaPhaseDenominator) % chromaPhaseDenominator; 569 Int* coeff = m_chromaFilter[phase]; 570 #endif 571 572 piSrcU = piSrcBufU + refPos -((NTAPS_US_CHROMA>>1) - 1); 573 piSrcV = piSrcBufV + refPos -((NTAPS_US_CHROMA>>1) - 1); 574 piDstU = piTempBufU + i; 575 piDstV = piTempBufV + i; 576 577 for( j = 0; j < heightBL ; j++ ) 578 { 579 *piDstU = sumChromaHor(piSrcU, coeff); 580 *piDstV = sumChromaHor(piSrcV, coeff); 581 582 piSrcU += strideBL; 583 piSrcV += strideBL; 584 piDstU += strideEL; 585 piDstV += strideEL; 586 } 587 } 588 589 //========== vertical upsampling =========== 590 pcTempPic->setBorderExtension(false); 591 pcTempPic->setHeight(heightBL << 1); 592 pcTempPic->extendPicBorder (); // extend the border. 593 pcTempPic->setHeight(heightEL << 1); 594 595 #if SCALED_REF_LAYER_OFFSETS 596 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 597 #else 598 for( j = 0; j < heightEL; j++ ) 599 #endif 600 { 601 #if SCALED_REF_LAYER_OFFSETS 602 Int y = Clip3(topStartC, bottomEndC - 1, j); 603 #endif 604 #if PHASE_DERIVATION_IN_INTEGER 605 #if SCALED_REF_LAYER_OFFSETS 606 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 607 #else 608 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 609 #endif 610 phase = refPos16 & 15; 611 refPos = refPos16 >> 4; 612 coeff = m_chromaFilter[phase]; 613 #else 614 Int refPosM = (Int) (j * chromaPhaseDenominator * sFactor) - 1; 615 Int refPos; 616 if ( refPosM < 0 ) 617 { 618 refPos = (Int)( j * sFactor ) - 1; 619 } 620 else 621 { 622 refPos = refPosM / chromaPhaseDenominator; 623 } 624 Int phase = (refPosM + chromaPhaseDenominator) % chromaPhaseDenominator; 625 Int* coeff = m_chromaFilter[phase]; 626 #endif 627 628 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 629 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 630 631 piDstU = piDstBufU + j*strideEL; 632 piDstV = piDstBufV + j*strideEL; 633 634 #if SCALED_REF_LAYER_OFFSETS 635 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 636 #else 637 for( i = 0; i < widthEL; i++ ) 638 #endif 639 { 640 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 641 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 642 643 #if SCALED_REF_LAYER_OFFSETS 644 // Only increase the x position of reference upsample picture when within the window 645 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 646 if( (i >= leftStartC) && (i <= rightEndC-2) ) 647 { 435 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 436 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 437 #if SCALED_REF_LAYER_OFFSETS 438 #if 1 // it should provide identical result 439 Pel* piDstU0 = piDstBufU + j*strideEL; 440 Pel* piDstV0 = piDstBufV + j*strideEL; 441 piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 ); 442 piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 ); 443 444 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 445 { 446 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 447 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 648 448 piSrcU++; 649 449 piSrcV++; 650 } 651 #else 652 piSrcU++; 653 piSrcV++; 654 #endif 655 piDstU++; 656 piDstV++; 657 } 658 } 659 660 pcUsPic->setBorderExtension(false); 661 pcUsPic->extendPicBorder (); // extend the border. 662 663 //Reset the Border extension flag 664 pcUsPic->setBorderExtension(false); 665 pcTempPic->setBorderExtension(false); 666 pcBasePic->setBorderExtension(false); 667 668 #if JCTVC_L0178 669 // copy back the saved cropped region 670 if( tempBufSizeRight ) 671 { 672 // put the correct width back 673 pcBasePic->setWidth(pcBasePic->getWidth() + confBL.getWindowRightOffset()); 674 } 675 if( tempBufSizeBottom ) 676 { 677 pcBasePic->setHeight(pcBasePic->getHeight() + confBL.getWindowBottomOffset()); 678 } 679 680 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 681 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 682 683 strideBL = pcBasePic->getStride(); 684 685 if( tempBufSizeRight ) 686 { 687 piSrcY = tempBufRight; 688 piDstY = piSrcBufY + widthBL; 689 690 for( i = 0; i < pcBasePic->getHeight(); i++ ) 691 { 692 memcpy(piDstY, piSrcY, sizeof(Pel) * confBL.getWindowRightOffset() ); 693 piSrcY += confBL.getWindowRightOffset(); 694 piDstY += strideBL; 695 } 696 697 if(confBL.getWindowRightOffset()>>1) 698 { 699 Int strideBLChroma = (strideBL>>1); 700 piSrcU = tempBufRight + confBL.getWindowRightOffset() * pcBasePic->getHeight(); 701 piDstU = piSrcBufU + (widthBL>>1); 702 piSrcV = piSrcU + (confBL.getWindowRightOffset()>>1) * (pcBasePic->getHeight()>>1); 703 piDstV = piSrcBufV + (widthBL>>1); 704 705 for( i = 0; i < pcBasePic->getHeight()>>1; i++ ) 706 { 707 memcpy(piDstU, piSrcU, sizeof(Pel) * (confBL.getWindowRightOffset()>>1)); 708 piSrcU += (confBL.getWindowRightOffset()>>1); 709 piDstU += strideBLChroma; 710 711 memcpy(piDstV, piSrcV, sizeof(Pel) * (confBL.getWindowRightOffset()>>1)); 712 piSrcV += (confBL.getWindowRightOffset()>>1); 713 piDstV += strideBLChroma; 714 } 715 } 716 } 717 718 if( tempBufSizeBottom ) 719 { 720 piDstY = piSrcBufY + heightBL * strideBL; 721 piSrcY = tempBufBottom; 722 for( i = 0; i < confBL.getWindowBottomOffset(); i++ ) 723 { 724 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth()); 725 piDstY += strideBL; 726 piSrcY += pcBasePic->getWidth(); 727 } 728 729 if(confBL.getWindowBottomOffset()>>1) 730 { 731 Int strideBLChroma = (strideBL>>1); 732 piSrcU = tempBufBottom + confBL.getWindowBottomOffset() * pcBasePic->getWidth(); 733 piDstU = piSrcBufU + (heightBL>>1) * strideBLChroma; 734 piSrcV = piSrcU + (confBL.getWindowBottomOffset()>>1) * (pcBasePic->getWidth()>>1); 735 piDstV = piSrcBufV + (heightBL>>1) * strideBLChroma; 736 737 for( i = 0; i < confBL.getWindowBottomOffset()>>1; i++ ) 738 { 739 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 740 piSrcU += (pcBasePic->getWidth()>>1); 741 piDstU += strideBLChroma; 742 743 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 744 piSrcV += (pcBasePic->getWidth()>>1); 745 piDstV += strideBLChroma; 746 } 747 } 748 749 } 750 751 if( tempBufSizeRight ) 752 { 753 xFree( tempBufRight ); 754 } 755 if( tempBufSizeBottom ) 756 { 757 xFree( tempBufBottom ); 758 } 759 #endif 450 piDstU++; 451 piDstV++; 452 } 453 454 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 455 { 456 *piDstU = piDstU0[rightEndC-1]; 457 *piDstV = piDstV0[rightEndC-1]; 458 piDstU++; 459 piDstV++; 460 } 461 462 piDstU = piDstU0; 463 piDstV = piDstV0; 464 for( i = 0; i < leftStartC; i++ ) 465 { 466 *piDstU = piDstU0[leftStartC]; 467 *piDstV = piDstV0[leftStartC]; 468 piDstU++; 469 piDstV++; 470 } 471 #else 472 piDstU = piDstBufU + j*strideEL; 473 piDstV = piDstBufV + j*strideEL; 474 475 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 476 { 477 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 478 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 479 480 // Only increase the x position of reference upsample picture when within the window 481 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 482 if( (i >= leftStartC) && (i <= rightEndC-2) ) 483 { 484 piSrcU++; 485 piSrcV++; 486 } 487 488 piDstU++; 489 piDstV++; 490 } 491 #endif 492 #else 493 piDstU = piDstBufU + j*strideEL; 494 piDstV = piDstBufV + j*strideEL; 495 496 for( i = 0; i < widthEL; i++ ) 497 { 498 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 499 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 500 piSrcU++; 501 piSrcV++; 502 piDstU++; 503 piDstV++; 504 } 505 #endif 506 } 507 508 pcUsPic->setBorderExtension(false); 509 pcUsPic->extendPicBorder (); // extend the border. 510 511 //Reset the Border extension flag 512 pcUsPic->setBorderExtension(false); 513 pcTempPic->setBorderExtension(false); 514 pcBasePic->setBorderExtension(false); 760 515 } 761 516 } -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r189 r310 13 13 { 14 14 private: 15 #if PHASE_DERIVATION_IN_INTEGER16 15 static const Int m_lumaFixedFilter[16][NTAPS_US_LUMA]; ///< Luma filter taps for both 1.5x and 2x scalability 17 16 static const Int m_chromaFixedFilter[16][NTAPS_US_CHROMA]; ///< Chroma filter taps for 1.5x scalability … … 19 18 Int m_lumaFilter[16][NTAPS_US_LUMA]; 20 19 Int m_chromaFilter[16][NTAPS_US_CHROMA]; 21 #else22 static const Int m_lumaFixedFilter[12][NTAPS_US_LUMA]; ///< Luma filter taps for both 1.5x and 2x scalability23 static const Int m_chromaFixedFilter20[8][NTAPS_US_CHROMA]; ///< Chroma filter taps for 2x scalability24 static const Int m_chromaFixedFilter15[12][NTAPS_US_CHROMA]; ///< Chroma filter taps for 1.5x scalability25 26 Int m_lumaFilter[12][NTAPS_US_LUMA];27 Int m_chromaFilter[12][NTAPS_US_CHROMA];28 #endif29 20 30 21 static inline Int sumLumaHor( Pel* pel, Int* coeff ) … … 53 44 54 45 #if SCALED_REF_LAYER_OFFSETS 55 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );46 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 56 47 #else 57 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );48 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 58 49 #endif 59 50 }; -
trunk/source/Lib/TLibCommon/TComWeightPrediction.cpp
r191 r310 271 271 Void TComWeightPrediction::getWpScaling( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1, wpScalingParam *&wp0, wpScalingParam *&wp1) 272 272 { 273 assert(iRefIdx0 >= 0 || iRefIdx1 >= 0); 274 273 275 TComSlice* pcSlice = pcCU->getSlice(); 274 276 TComPPS* pps = pcCU->getSlice()->getPPS(); -
trunk/source/Lib/TLibCommon/TypeDef.h
r208 r310 44 44 45 45 #if SVC_EXTENSION 46 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 47 48 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1 ///< VUI flag to indicate tile boundary alignment 49 #define M0463_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 50 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure 51 #define SCALED_REF_LAYER_OFFSET_FLAG 0 ///< M0309: Signal scaled reference layer offsets in SPS 46 52 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 47 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle48 53 49 54 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS … … 54 59 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 55 60 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 56 #define VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 157 61 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i] 58 62 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id 59 63 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2 60 #endif 64 #define SPS_SUB_LAYER_INFO 1 ///< M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0 65 #define VPS_SPLIT_FLAG 1 ///< M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1. 66 #define M0457_PREDICTION_INDICATIONS 1 67 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 68 #endif 69 70 #define SH_DISCARDABLE_FLAG 1 ///< M0152: Use one reserved flag in the slice header for discardable flag 61 71 62 72 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing … … 64 74 #define SVC_COL_BLK 1 ///< get co-located block 65 75 #define SVC_UPSAMPLING 1 ///< upsampling filters 66 #define PHASE_DERIVATION_IN_INTEGER 1 ///< upsampling filters implementation using only integer arithmetic67 #define ENCODER_BUGFIX 1 ///< L0167: encoder bug fix for inter mode68 76 #define CHROMA_UPSAMPLING 1 ///< L0335: Chroma upsampling with 5 bits coefficients 69 77 … … 71 79 #define ILP_DECODED_PICTURE 1 ///< M0274: use decoded picture for inter-layer prediction 72 80 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) 81 #define RESTR_CHK 1 ///< JCTVC-M0208 proposal 1 82 #define ILP_RAP 1 ///< JCTVC-M0208 proposal 3 73 83 74 84 #define REF_IDX_FRAMEWORK 1 ///< inter-layer reference framework 75 76 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE77 #define JCTVC_L0178 1 ///< implementation of JCTVC-L0178 (code only supports right and bottom croppping offsets)78 #endif79 85 80 86 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers … … 89 95 #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. 90 96 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 91 #define JCTVC_M0458_INTERLAYER_RPS_SIG 1 ///< implementation of JCTVC-L0178 (currently only one reference layer is supported )97 #define JCTVC_M0458_INTERLAYER_RPS_SIG 1 ///< implementation of JCTVC-L0178 92 98 #if JCTVC_M0458_INTERLAYER_RPS_SIG 93 99 #define ZERO_NUM_DIRECT_LAYERS 1 ///< support of zero direct reference layers 94 #endif 100 #define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1 ///< Allow maximum of one resampling process for direct reference layers 101 #endif 102 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication 103 #if JCTVC_M0203_INTERLAYER_PRED_IDC 104 #define ILR_RESTR 1 ///< JCTVC-M0209 Inter-layer RPS and RPL 105 #endif 106 #define M0457_COL_PICTURE_SIGNALING 1 107 108 #if !VPS_EXTN_DIRECT_REF_LAYERS || !M0457_PREDICTION_INDICATIONS || !JCTVC_M0458_INTERLAYER_RPS_SIG 109 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 110 #else 111 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 112 #endif 113 95 114 #else 96 115 #define INTRA_BL 1 ///< inter-layer texture prediction … … 110 129 #endif 111 130 #endif 131 132 #define FAST_INTRA_SHVC 1 ///< M0115: reduction number of intra modes in the EL (encoder only) 133 #if FAST_INTRA_SHVC 134 #define NB_REMAIN_MODES 2 ///< nb of remaining modes (M0115) 135 #endif 136 137 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037, rate control for SHVC 138 112 139 #else 113 140 #define ILP_DECODED_PICTURE 0 114 141 #define SYNTAX_OUTPUT 0 115 #endif 142 #endif // SVC_EXTENSION 143 116 144 117 145 //! \ingroup TLibCommon 118 146 //! \{ 119 147 120 #define FIX1071 1 ///< Temporaryfix for issue #1071121 122 #define L0208_SOP_DESCRIPTION_SEI 1 ///< L0208: add SOP descrioption SEI 148 #define FIX1071 1 ///< fix for issue #1071 149 #define M0043_LAYERS_PRESENT_SEI 0 ///< M0043: add layers present SEI 150 123 151 #define MAX_NUM_PICS_IN_SOP 1024 124 152 125 #define K0180_SCALABLE_NESTING_SEI 1 ///JCTVC-K0180 scalable nesting sei message126 153 #define MAX_NESTING_NUM_OPS 1024 127 154 #define MAX_NESTING_NUM_LAYER 64 128 129 #define J0149_TONE_MAPPING_SEI 1 ///< J0149: Tone mapping information SEI130 #define L0363_DU_BIT_RATE 1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters131 #define L0328_SPLICING 1 ///< L0328: splicing support in HRD132 #define L0044_DU_DPB_OUTPUT_DELAY_HRD 1 ///< L0044: Include dpb_output_delay_du_length_minus1 in hrd_parameters(), dpb_output_du_delay in133 ///< picture timing SEI and DU information SEI134 #define L0045_PERSISTENCE_FLAGS 1 ///< L0045: Replace "repetition_period" syntax elements in SEI with "persistence_flag"135 #define L0045_NON_NESTED_SEI_RESTRICTIONS 1 ///< L0045; Include restriction on the order of APS and non-nested BP, PT and DU info SEI messages136 #define L0044_CPB_DPB_DELAY_OFFSET 1 ///< L0044: Include syntax elements cpb_delay_offset and dpb_delay_offset in the BP SEI message137 #define L0047_APS_FLAGS 1 ///< L0047: Include full_random_access_flag and no_param_set_update_flag in the active parameter set SEI message138 #define L0043_TIMING_INFO 1 ///< L0043: Timing information is signalled in VUI outside hrd_parameters()139 #define L0046_RENAME_PROG_SRC_IDC 1 ///< L0046: Rename progressive_source_idc to source_scan_type140 #define L0045_CONDITION_SIGNALLING 1 ///< L0045: Condition the signaling of some syntax elements in picture timing SEI message141 #define L0043_MSS_IDC 1142 #define L0116_ENTRY_POINT 1143 #define L0363_MORE_BITS 1144 #define L0363_MVP_POC 1145 #define L0363_BYTE_ALIGN 1146 #define L0363_SEI_ALLOW_SUFFIX 1147 #define L0323_LIMIT_DEFAULT_LIST_SIZE 1148 #define L0046_CONSTRAINT_FLAGS 1149 #define L0255_MOVE_PPS_FLAGS 1 ///< move some flags to earlier positions in the PPS150 #define L0444_FPA_TYPE 1 ///< allow only FPA types 3, 4 and 5151 #define L0372 1152 #define SIGNAL_BITRATE_PICRATE_IN_VPS 0 ///< K0125: Signal bit_rate and pic_rate in VPS153 #define L0232_RD_PENALTY 1 ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices154 #define L0386_DB_METRIC 1 ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream)155 #define L0323_DPB 1 ///< L0323: Specification of active reference indices and decoded picture buffer156 157 #define L0034_COMBINED_LIST_CLEANUP 1158 155 159 156 #if VPS_EXTN_MASK_AND_DIM_INFO … … 169 166 #endif 170 167 #define RATE_CONTROL_LAMBDA_DOMAIN 1 ///< JCTVC-K0103, rate control by R-lambda model 171 #define L0033_RC_BUGFIX 1 ///< JCTVC-L0033, bug fix for R-lambda model based rate control 168 #define M0036_RC_IMPROVEMENT 1 ///< JCTVC-M0036, improvement for R-lambda model based rate control 169 #define TICKET_1090_FIX 1 170 171 #define RC_FIX 1 /// suggested fix for M0036 172 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 172 173 173 174 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) … … 190 191 191 192 #define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 1 ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode 192 193 #define REMOVE_SINGLE_SEI_EXTENSION_FLAGS 1 ///< remove display orientation SEI extension flag (there is a generic SEI extension mechanism now)194 193 195 194 #define SAO_ENCODING_CHOICE 1 ///< I0184: picture early termination … … 205 204 #define MAX_NUM_SPS 16 206 205 #define MAX_NUM_PPS 64 207 208 209 206 210 207 #define WEIGHTED_CHROMA_DISTORTION 1 ///< F386: weighting of chroma for RDO … … 495 492 REF_PIC_LIST_0 = 0, ///< reference list 0 496 493 REF_PIC_LIST_1 = 1, ///< reference list 1 497 #if !L0034_COMBINED_LIST_CLEANUP498 REF_PIC_LIST_C = 2, ///< combined reference list for uni-prediction in B-Slices499 #endif500 494 REF_PIC_LIST_X = 100 ///< special mark 501 495 };
Note: See TracChangeset for help on using the changeset viewer.