Changeset 494 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 16 Nov 2013, 22:09:25 (11 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev (added) merged: 444-493
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev/source (added) merged: 445-471,473-479,481-486,488-493
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r442 r494 130 130 extern Int g_bitDepthY; 131 131 extern Int g_bitDepthC; 132 132 #if O0194_DIFFERENT_BITDEPTH_EL_BL 133 extern Int g_bitDepthYLayer[MAX_LAYERS]; 134 extern Int g_bitDepthCLayer[MAX_LAYERS]; 135 136 extern UInt g_uiPCMBitDepthLumaDec[MAX_LAYERS]; // PCM bit-depth 137 extern UInt g_uiPCMBitDepthChromaDec[MAX_LAYERS]; // PCM bit-depth 138 #endif 139 #if O0194_WEIGHTED_PREDICTION_CGS 140 extern void* g_refWeightACDCParam; //type:wpACDCParam 141 #endif 133 142 /** clip x, such that 0 <= x <= #g_maxLumaVal */ 134 143 template <typename T> inline T ClipY(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); } -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r442 r494 1872 1872 #endif 1873 1873 1874 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1875 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 1876 { 1877 Bool checkILR = false; 1878 1879 if(uhInterDir&0x1) //list0 1880 { 1881 Int refIdxL0 = cMvFieldL0.getRefIdx(); 1882 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId); 1883 } 1884 if(uhInterDir&0x2) //list1 1885 { 1886 Int refIdxL1 = cMvFieldL1.getRefIdx(); 1887 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId); 1888 } 1889 1890 return checkILR; 1891 } 1892 #endif 1893 1874 1894 UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx ) 1875 1895 { … … 4004 4024 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4005 4025 4026 #if !LAYER_CTB 4006 4027 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4007 4008 #if SCALED_REF_LAYER_OFFSETS 4028 #endif 4029 4009 4030 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 4010 4031 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 4011 4032 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4012 4033 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4013 #else4014 Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;4015 Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;4016 #endif4017 4034 4018 4035 #if N0139_POSITION_ROUNDING_OFFSET … … 4024 4041 #endif 4025 4042 4026 #if SCALED_REF_LAYER_OFFSETS4027 4043 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || 4028 4044 iBX < 0 || iBY < 0 ) 4045 { 4046 return NULL; 4047 } 4048 4049 #if LAYER_CTB 4050 UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight(); 4051 UInt baseMaxCUWidth = cBaseColPic->getPicSym()->getMaxCUWidth(); 4052 UInt baseMinUnitSize = cBaseColPic->getMinCUWidth(); 4053 4054 uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth() ); 4029 4055 #else 4030 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight())4056 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4031 4057 #endif 4032 {4033 return NULL;4034 }4035 4036 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);4037 4058 4038 4059 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4039 4060 4061 #if LAYER_CTB 4062 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize; 4063 4064 uiAbsPartIdxBase = g_auiLayerRasterToZscan[cBaseColPic->getLayerId()][uiRasterAddrBase]; 4065 #else 4040 4066 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4041 4067 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4042 4068 4043 4069 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4070 #endif 4044 4071 4045 4072 return cBaseColPic->getCU(uiCUAddrBase); -
trunk/source/Lib/TLibCommon/TComDataCU.h
r442 r494 492 492 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 493 493 Bool isBipredRestriction( UInt puIdx ); 494 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 495 Bool isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); 496 #endif 494 497 495 498 // ------------------------------------------------------------------------------------------------------------------- -
trunk/source/Lib/TLibCommon/TComPic.cpp
r442 r494 79 79 } 80 80 #if SVC_UPSAMPLING 81 #if AUXILIARY_PICTURES 82 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 83 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 84 #else 81 85 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 82 86 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 83 87 #endif 84 88 { 85 89 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 86 90 if (!bIsVirtual) 87 91 { 92 #if AUXILIARY_PICTURES 93 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 94 #else 88 95 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 89 } 96 #endif 97 } 98 #if AUXILIARY_PICTURES 99 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 100 #else 90 101 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 102 #endif 91 103 92 104 for( Int i = 0; i < MAX_LAYERS; i++ ) … … 94 106 if( m_bSpatialEnhLayer[i] ) 95 107 { 108 #if AUXILIARY_PICTURES 109 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 110 #else 96 111 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 112 #endif 97 113 } 98 114 } … … 407 423 { 408 424 m_pNDBFilterYuvTmp = new TComPicYuv(); 425 #if AUXILIARY_PICTURES 426 m_pNDBFilterYuvTmp->create(picWidth, picHeight, getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 427 #else 409 428 m_pNDBFilterYuvTmp->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 429 #endif 430 410 431 } 411 432 … … 801 822 #endif 802 823 824 #if MFM_ENCCONSTRAINT 825 Bool TComPic::checkSameRefInfo() 826 { 827 Bool bSameRefInfo = true; 828 TComSlice * pSlice0 = getSlice( 0 ); 829 for( UInt uSliceID = getNumAllocatedSlice() - 1 ; bSameRefInfo && uSliceID > 0 ; uSliceID-- ) 830 { 831 TComSlice * pSliceN = getSlice( uSliceID ); 832 if( pSlice0->getSliceType() != pSliceN->getSliceType() ) 833 { 834 bSameRefInfo = false; 835 } 836 else if( pSlice0->getSliceType() != I_SLICE ) 837 { 838 Int nListNum = pSlice0->getSliceType() == B_SLICE ? 2 : 1; 839 for( Int nList = 0 ; nList < nListNum ; nList++ ) 840 { 841 RefPicList eRefList = ( RefPicList )nList; 842 if( pSlice0->getNumRefIdx( eRefList ) == pSliceN->getNumRefIdx( eRefList ) ) 843 { 844 for( Int refIdx = pSlice0->getNumRefIdx( eRefList ) - 1 ; refIdx >= 0 ; refIdx-- ) 845 { 846 if( pSlice0->getRefPic( eRefList , refIdx ) != pSliceN->getRefPic( eRefList , refIdx ) ) 847 { 848 bSameRefInfo = false; 849 break; 850 } 851 } 852 } 853 else 854 { 855 bSameRefInfo = false; 856 break; 857 } 858 } 859 } 860 } 861 862 return( bSameRefInfo ); 863 } 864 #endif 803 865 804 866 //! \} -
trunk/source/Lib/TLibCommon/TComPic.h
r442 r494 102 102 virtual ~TComPic(); 103 103 104 #if AUXILIARY_PICTURES 105 #if SVC_UPSAMPLING 106 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 107 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 108 #else 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 110 Int *numReorderPics, Bool bIsVirtual = false ); 111 #endif 112 #else 104 113 #if SVC_UPSAMPLING 105 114 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 109 118 Int *numReorderPics, Bool bIsVirtual = false ); 110 119 #endif 120 #endif 111 121 virtual Void destroy(); 112 122 … … 128 138 Void copyUpsampledMvField ( UInt refLayerIdc, TComPic* pcPicBase ); 129 139 Void initUpsampledMvField (); 140 #endif 141 #if MFM_ENCCONSTRAINT 142 Bool checkSameRefInfo(); 130 143 #endif 131 144 … … 163 176 164 177 Int getStride() { return m_apcPicYuv[1]->getStride(); } 178 #if AUXILIARY_PICTURES 179 ChromaFormat getChromaFormat() const { return m_apcPicYuv[1]->getChromaFormat(); } 180 #endif 165 181 Int getCStride() { return m_apcPicYuv[1]->getCStride(); } 166 182 -
trunk/source/Lib/TLibCommon/TComPicSym.h
r442 r494 126 126 TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcTComDataCU[uiCUAddr]; } 127 127 128 #if LAYER_CTB 129 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } 130 UInt getMaxCUHeight() { return m_uiMaxCUHeight; } 131 #endif 132 128 133 #if AVC_SYNTAX 129 134 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r313 r494 67 67 { 68 68 } 69 #if AUXILIARY_PICTURES 70 #if SVC_UPSAMPLING 71 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 72 #else 73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 74 #endif 75 #else 69 76 #if SVC_UPSAMPLING 70 77 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 71 78 #else 72 79 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 80 #endif 73 81 #endif 74 82 { … … 86 94 m_iCuWidth = uiMaxCUWidth; 87 95 m_iCuHeight = uiMaxCUHeight; 96 #if AUXILIARY_PICTURES 97 m_chromaFormatIDC = chromaFormatIDC; 98 #endif 88 99 89 100 Int numCuInWidth = m_iPicWidth / m_iCuWidth + (m_iPicWidth % m_iCuWidth != 0); 90 101 Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0); 91 102 103 #if LAYER_CTB 104 m_iLumaMarginX = uiMaxCUWidth + 16; // for 16-byte alignment 105 m_iLumaMarginY = uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 106 #else 92 107 m_iLumaMarginX = g_uiMaxCUWidth + 16; // for 16-byte alignment 93 108 m_iLumaMarginY = g_uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 109 #endif 94 110 95 111 m_iChromaMarginX = m_iLumaMarginX>>1; … … 234 250 } 235 251 252 #if AUXILIARY_PICTURES 253 Void TComPicYuv::convertToMonochrome() 254 { 255 Int numPix = ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)); 256 Pel grayVal = (1 << (g_bitDepthC - 1)); 257 258 for (UInt i = 0; i < numPix; i++) 259 { 260 m_apiPicBufU[i] = grayVal; 261 m_apiPicBufV[i] = grayVal; 262 } 263 } 264 #endif 265 236 266 Void TComPicYuv::extendPicBorder () 237 267 { -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r313 r494 75 75 Int m_iPicWidth; ///< Width of picture 76 76 Int m_iPicHeight; ///< Height of picture 77 #if AUXILIARY_PICTURES 78 ChromaFormat m_chromaFormatIDC; ////< Chroma Format 79 #endif 77 80 78 81 Int m_iCuWidth; ///< Width of Coding Unit (CU) … … 108 111 // Memory management 109 112 // ------------------------------------------------------------------------------------------------ 113 #if AUXILIARY_PICTURES 114 #if SVC_UPSAMPLING 115 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 116 #else 117 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 118 #endif 119 #else 110 120 #if SVC_UPSAMPLING 111 121 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); … … 113 123 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 114 124 #endif 125 #endif 115 126 116 127 Void destroy (); … … 125 136 Int getWidth () { return m_iPicWidth; } 126 137 Int getHeight () { return m_iPicHeight; } 138 #if AUXILIARY_PICTURES 139 ChromaFormat getChromaFormat () const { return m_chromaFormatIDC; } 140 #endif 127 141 128 142 #if SVC_EXTENSION … … 184 198 #endif 185 199 200 #if AUXILIARY_PICTURES 201 Void convertToMonochrome(); 202 #endif 203 186 204 // Set border extension flag 187 205 Void setBorderExtension(Bool b) { m_bIsBorderExtended = b; } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r442 r494 765 765 766 766 #if SVC_UPSAMPLING 767 #if SCALED_REF_LAYER_OFFSETS 767 #if O0215_PHASE_ALIGNMENT 768 #if O0194_JOINT_US_BITSHIFT 769 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ) 770 { 771 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag ); 772 } 773 #else 774 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ) 775 { 776 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag ); 777 } 778 #endif 779 #else 780 #if O0194_JOINT_US_BITSHIFT 781 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 782 { 783 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window); 784 } 785 #else 768 786 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 769 787 { 770 788 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window); 771 789 } 772 #else 773 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic) 774 { 775 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic); 776 } 790 #endif 777 791 #endif 778 792 #endif -
trunk/source/Lib/TLibCommon/TComPrediction.h
r442 r494 120 120 #if SVC_EXTENSION 121 121 #if SVC_UPSAMPLING 122 #if SCALED_REF_LAYER_OFFSETS 122 #if O0215_PHASE_ALIGNMENT 123 #if O0194_JOINT_US_BITSHIFT 124 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ); 125 #else 126 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ); 127 #endif 128 #else 129 #if O0194_JOINT_US_BITSHIFT 130 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 131 #else 123 132 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 124 #else125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );126 133 #endif 127 134 #endif 128 135 #endif 136 #endif //SVC_EXTENSION 129 137 }; 130 138 -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r313 r494 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 61 61 Double dRdCost = 0.0; 62 62 Double dLambda = 0.0; 63 63 64 64 switch ( eDFunc ) 65 65 { … … 80 80 break; 81 81 } 82 82 83 83 if (bFlag) 84 84 { … … 107 107 } 108 108 } 109 109 110 110 return dRdCost; 111 111 } … … 115 115 Double dRdCost = 0.0; 116 116 Double dLambda = 0.0; 117 117 118 118 switch ( eDFunc ) 119 119 { … … 134 134 break; 135 135 } 136 136 137 137 if (bFlag) 138 138 { … … 161 161 } 162 162 } 163 163 164 164 return dRdCost; 165 165 } … … 178 178 { 179 179 m_afpDistortFunc[0] = NULL; // for DF_DEFAULT 180 180 181 181 m_afpDistortFunc[1] = TComRdCost::xGetSSE; 182 182 m_afpDistortFunc[2] = TComRdCost::xGetSSE4; … … 186 186 m_afpDistortFunc[6] = TComRdCost::xGetSSE64; 187 187 m_afpDistortFunc[7] = TComRdCost::xGetSSE16N; 188 188 189 189 m_afpDistortFunc[8] = TComRdCost::xGetSAD; 190 190 m_afpDistortFunc[9] = TComRdCost::xGetSAD4; … … 194 194 m_afpDistortFunc[13] = TComRdCost::xGetSAD64; 195 195 m_afpDistortFunc[14] = TComRdCost::xGetSAD16N; 196 196 197 197 m_afpDistortFunc[15] = TComRdCost::xGetSAD; 198 198 m_afpDistortFunc[16] = TComRdCost::xGetSAD4; … … 202 202 m_afpDistortFunc[20] = TComRdCost::xGetSAD64; 203 203 m_afpDistortFunc[21] = TComRdCost::xGetSAD16N; 204 204 205 205 #if AMP_SAD 206 206 m_afpDistortFunc[43] = TComRdCost::xGetSAD12; … … 219 219 m_afpDistortFunc[27] = TComRdCost::xGetHADs; 220 220 m_afpDistortFunc[28] = TComRdCost::xGetHADs; 221 221 222 222 #if !FIX203 223 223 m_puiComponentCostOriginP = NULL; … … 239 239 iSubPelSearchLimit += 4; 240 240 iSubPelSearchLimit *= 8; 241 241 242 242 if( m_iSearchLimit != iSubPelSearchLimit ) 243 243 { 244 244 xUninit(); 245 245 246 246 m_iSearchLimit = iSubPelSearchLimit; 247 247 248 248 m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ]; 249 249 iSubPelSearchLimit *= 2; 250 250 251 251 m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit; 252 252 253 253 for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++) 254 254 { … … 272 272 UInt uiLength = 1; 273 273 UInt uiTemp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1); 274 274 275 275 assert ( uiTemp ); 276 276 277 277 while ( 1 != uiTemp ) 278 278 { … … 280 280 uiLength += 2; 281 281 } 282 282 283 283 return uiLength; 284 284 } … … 290 290 rcDistParam.iRows = uiBlkHeight; 291 291 rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 292 292 293 293 // initialize 294 294 rcDistParam.iSubShift = 0; … … 301 301 rcDistParam.pOrg = pcPatternKey->getROIY(); 302 302 rcDistParam.pCur = piRefY; 303 303 304 304 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 305 305 rcDistParam.iStrideCur = iRefStride; 306 306 307 307 // set Block Width / Height 308 308 rcDistParam.iCols = pcPatternKey->getROIYWidth(); 309 309 rcDistParam.iRows = pcPatternKey->getROIYHeight(); 310 310 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 311 311 312 312 #if AMP_SAD 313 313 if (rcDistParam.iCols == 12) … … 336 336 #endif 337 337 { 338 #if O0194_WEIGHTED_PREDICTION_CGS 339 // Bug fix: The correct bit depth has not been used for weighted cost calculation 340 rcDistParam.bitDepth = g_bitDepthY; 341 #endif 338 342 // set Original & Curr Pointer / Stride 339 343 rcDistParam.pOrg = pcPatternKey->getROIY(); 340 344 rcDistParam.pCur = piRefY; 341 345 342 346 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 343 347 rcDistParam.iStrideCur = iRefStride * iStep; 344 348 345 349 // set Step for interpolated buffer 346 350 rcDistParam.iStep = iStep; 347 351 348 352 // set Block Width / Height 349 353 rcDistParam.iCols = pcPatternKey->getROIYWidth(); … … 352 356 rcDistParam.bUseNSHAD = bUseNSHAD; 353 357 #endif 354 358 355 359 // set distortion function 356 360 if ( !bHADME ) … … 376 380 rcDistParam.DistFunc = m_afpDistortFunc[DF_HADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 377 381 } 378 382 379 383 // initialize 380 384 rcDistParam.iSubShift = 0; … … 407 411 UInt uiSum = 0; 408 412 Int x, y; 409 413 410 414 if ( ( (iWidth % 8) == 0 ) && ( (iHeight % 8) == 0 ) ) 411 415 { … … 444 448 } 445 449 } 446 450 447 451 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 448 452 … … 523 527 Int iStrideCur = pcDtParam->iStrideCur; 524 528 Int iStrideOrg = pcDtParam->iStrideOrg; 525 526 UInt uiSum = 0; 527 529 530 UInt uiSum = 0; 531 528 532 for( ; iRows != 0; iRows-- ) 529 533 { … … 535 539 piCur += iStrideCur; 536 540 } 537 541 538 542 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 539 543 } … … 541 545 UInt TComRdCost::xGetSAD4( DistParam* pcDtParam ) 542 546 { 543 if ( pcDtParam->bApplyWeight ) 547 if ( pcDtParam->bApplyWeight ) 544 548 { 545 549 return xGetSADw( pcDtParam ); … … 552 556 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 553 557 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 554 555 UInt uiSum = 0; 556 558 559 UInt uiSum = 0; 560 557 561 for( ; iRows != 0; iRows-=iSubStep ) 558 562 { … … 561 565 uiSum += abs( piOrg[2] - piCur[2] ); 562 566 uiSum += abs( piOrg[3] - piCur[3] ); 563 564 piOrg += iStrideOrg; 565 piCur += iStrideCur; 566 } 567 567 568 piOrg += iStrideOrg; 569 piCur += iStrideCur; 570 } 571 568 572 uiSum <<= iSubShift; 569 573 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 583 587 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 584 588 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 585 586 UInt uiSum = 0; 587 589 590 UInt uiSum = 0; 591 588 592 for( ; iRows != 0; iRows-=iSubStep ) 589 593 { … … 596 600 uiSum += abs( piOrg[6] - piCur[6] ); 597 601 uiSum += abs( piOrg[7] - piCur[7] ); 598 599 piOrg += iStrideOrg; 600 piCur += iStrideCur; 601 } 602 602 603 piOrg += iStrideOrg; 604 piCur += iStrideCur; 605 } 606 603 607 uiSum <<= iSubShift; 604 608 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 618 622 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 619 623 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 620 621 UInt uiSum = 0; 622 624 625 UInt uiSum = 0; 626 623 627 for( ; iRows != 0; iRows-=iSubStep ) 624 628 { … … 639 643 uiSum += abs( piOrg[14] - piCur[14] ); 640 644 uiSum += abs( piOrg[15] - piCur[15] ); 641 642 piOrg += iStrideOrg; 643 piCur += iStrideCur; 644 } 645 645 646 piOrg += iStrideOrg; 647 piCur += iStrideCur; 648 } 649 646 650 uiSum <<= iSubShift; 647 651 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 662 666 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 663 667 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 664 665 UInt uiSum = 0; 666 668 669 UInt uiSum = 0; 670 667 671 for( ; iRows != 0; iRows-=iSubStep ) 668 672 { … … 679 683 uiSum += abs( piOrg[10] - piCur[10] ); 680 684 uiSum += abs( piOrg[11] - piCur[11] ); 681 682 piOrg += iStrideOrg; 683 piCur += iStrideCur; 684 } 685 685 686 piOrg += iStrideOrg; 687 piCur += iStrideCur; 688 } 689 686 690 uiSum <<= iSubShift; 687 691 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 699 703 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 700 704 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 701 702 UInt uiSum = 0; 703 705 706 UInt uiSum = 0; 707 704 708 for( ; iRows != 0; iRows-=iSubStep ) 705 709 { … … 726 730 piCur += iStrideCur; 727 731 } 728 732 729 733 uiSum <<= iSubShift; 730 734 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 744 748 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 745 749 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 746 747 UInt uiSum = 0; 748 750 751 UInt uiSum = 0; 752 749 753 for( ; iRows != 0; iRows-=iSubStep ) 750 754 { … … 781 785 uiSum += abs( piOrg[30] - piCur[30] ); 782 786 uiSum += abs( piOrg[31] - piCur[31] ); 783 784 piOrg += iStrideOrg; 785 piCur += iStrideCur; 786 } 787 787 788 piOrg += iStrideOrg; 789 piCur += iStrideCur; 790 } 791 788 792 uiSum <<= iSubShift; 789 793 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 804 808 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 805 809 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 806 807 UInt uiSum = 0; 808 810 811 UInt uiSum = 0; 812 809 813 for( ; iRows != 0; iRows-=iSubStep ) 810 814 { … … 833 837 uiSum += abs( piOrg[22] - piCur[22] ); 834 838 uiSum += abs( piOrg[23] - piCur[23] ); 835 836 piOrg += iStrideOrg; 837 piCur += iStrideCur; 838 } 839 839 840 piOrg += iStrideOrg; 841 piCur += iStrideCur; 842 } 843 840 844 uiSum <<= iSubShift; 841 845 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 857 861 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 858 862 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 859 860 UInt uiSum = 0; 861 863 864 UInt uiSum = 0; 865 862 866 for( ; iRows != 0; iRows-=iSubStep ) 863 867 { … … 926 930 uiSum += abs( piOrg[62] - piCur[62] ); 927 931 uiSum += abs( piOrg[63] - piCur[63] ); 928 929 piOrg += iStrideOrg; 930 piCur += iStrideCur; 931 } 932 932 933 piOrg += iStrideOrg; 934 piCur += iStrideCur; 935 } 936 933 937 uiSum <<= iSubShift; 934 938 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 949 953 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 950 954 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 951 952 UInt uiSum = 0; 953 955 956 UInt uiSum = 0; 957 954 958 for( ; iRows != 0; iRows-=iSubStep ) 955 959 { … … 1002 1006 uiSum += abs( piOrg[46] - piCur[46] ); 1003 1007 uiSum += abs( piOrg[47] - piCur[47] ); 1004 1005 piOrg += iStrideOrg; 1006 piCur += iStrideCur; 1007 } 1008 1008 1009 piOrg += iStrideOrg; 1010 piCur += iStrideCur; 1011 } 1012 1009 1013 uiSum <<= iSubShift; 1010 1014 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 1028 1032 Int iStrideOrg = pcDtParam->iStrideOrg; 1029 1033 Int iStrideCur = pcDtParam->iStrideCur; 1030 1034 1031 1035 UInt uiSum = 0; 1032 1036 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1033 1037 1034 1038 Int iTemp; 1035 1039 1036 1040 for( ; iRows != 0; iRows-- ) 1037 1041 { … … 1044 1048 piCur += iStrideCur; 1045 1049 } 1046 1050 1047 1051 return ( uiSum ); 1048 1052 } … … 1060 1064 Int iStrideOrg = pcDtParam->iStrideOrg; 1061 1065 Int iStrideCur = pcDtParam->iStrideCur; 1062 1066 1063 1067 UInt uiSum = 0; 1064 1068 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1065 1069 1066 1070 Int iTemp; 1067 1071 1068 1072 for( ; iRows != 0; iRows-- ) 1069 1073 { 1070 1074 1071 1075 iTemp = piOrg[0] - piCur[0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1072 1076 iTemp = piOrg[1] - piCur[1]; uiSum += ( iTemp * iTemp ) >> uiShift; 1073 1077 iTemp = piOrg[2] - piCur[2]; uiSum += ( iTemp * iTemp ) >> uiShift; 1074 1078 iTemp = piOrg[3] - piCur[3]; uiSum += ( iTemp * iTemp ) >> uiShift; 1075 1076 piOrg += iStrideOrg; 1077 piCur += iStrideCur; 1078 } 1079 1079 1080 piOrg += iStrideOrg; 1081 piCur += iStrideCur; 1082 } 1083 1080 1084 return ( uiSum ); 1081 1085 } … … 1093 1097 Int iStrideOrg = pcDtParam->iStrideOrg; 1094 1098 Int iStrideCur = pcDtParam->iStrideCur; 1095 1099 1096 1100 UInt uiSum = 0; 1097 1101 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1098 1102 1099 1103 Int iTemp; 1100 1104 1101 1105 for( ; iRows != 0; iRows-- ) 1102 1106 { … … 1109 1113 iTemp = piOrg[6] - piCur[6]; uiSum += ( iTemp * iTemp ) >> uiShift; 1110 1114 iTemp = piOrg[7] - piCur[7]; uiSum += ( iTemp * iTemp ) >> uiShift; 1111 1112 piOrg += iStrideOrg; 1113 piCur += iStrideCur; 1114 } 1115 1115 1116 piOrg += iStrideOrg; 1117 piCur += iStrideCur; 1118 } 1119 1116 1120 return ( uiSum ); 1117 1121 } … … 1129 1133 Int iStrideOrg = pcDtParam->iStrideOrg; 1130 1134 Int iStrideCur = pcDtParam->iStrideCur; 1131 1135 1132 1136 UInt uiSum = 0; 1133 1137 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1134 1138 1135 1139 Int iTemp; 1136 1140 1137 1141 for( ; iRows != 0; iRows-- ) 1138 1142 { 1139 1143 1140 1144 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1141 1145 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1154 1158 iTemp = piOrg[14] - piCur[14]; uiSum += ( iTemp * iTemp ) >> uiShift; 1155 1159 iTemp = piOrg[15] - piCur[15]; uiSum += ( iTemp * iTemp ) >> uiShift; 1156 1157 piOrg += iStrideOrg; 1158 piCur += iStrideCur; 1159 } 1160 1160 1161 piOrg += iStrideOrg; 1162 piCur += iStrideCur; 1163 } 1164 1161 1165 return ( uiSum ); 1162 1166 } … … 1174 1178 Int iStrideOrg = pcDtParam->iStrideOrg; 1175 1179 Int iStrideCur = pcDtParam->iStrideCur; 1176 1180 1177 1181 UInt uiSum = 0; 1178 1182 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1179 1183 Int iTemp; 1180 1184 1181 1185 for( ; iRows != 0; iRows-- ) 1182 1186 { 1183 1187 for (Int n = 0; n < iCols; n+=16 ) 1184 1188 { 1185 1189 1186 1190 iTemp = piOrg[n+ 0] - piCur[n+ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1187 1191 iTemp = piOrg[n+ 1] - piCur[n+ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1200 1204 iTemp = piOrg[n+14] - piCur[n+14]; uiSum += ( iTemp * iTemp ) >> uiShift; 1201 1205 iTemp = piOrg[n+15] - piCur[n+15]; uiSum += ( iTemp * iTemp ) >> uiShift; 1202 1203 } 1204 piOrg += iStrideOrg; 1205 piCur += iStrideCur; 1206 } 1207 1206 1207 } 1208 piOrg += iStrideOrg; 1209 piCur += iStrideCur; 1210 } 1211 1208 1212 return ( uiSum ); 1209 1213 } … … 1221 1225 Int iStrideOrg = pcDtParam->iStrideOrg; 1222 1226 Int iStrideCur = pcDtParam->iStrideCur; 1223 1227 1224 1228 UInt uiSum = 0; 1225 1229 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1226 1230 Int iTemp; 1227 1231 1228 1232 for( ; iRows != 0; iRows-- ) 1229 1233 { 1230 1234 1231 1235 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1232 1236 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1261 1265 iTemp = piOrg[30] - piCur[30]; uiSum += ( iTemp * iTemp ) >> uiShift; 1262 1266 iTemp = piOrg[31] - piCur[31]; uiSum += ( iTemp * iTemp ) >> uiShift; 1263 1264 piOrg += iStrideOrg; 1265 piCur += iStrideCur; 1266 } 1267 1267 1268 piOrg += iStrideOrg; 1269 piCur += iStrideCur; 1270 } 1271 1268 1272 return ( uiSum ); 1269 1273 } … … 1281 1285 Int iStrideOrg = pcDtParam->iStrideOrg; 1282 1286 Int iStrideCur = pcDtParam->iStrideCur; 1283 1287 1284 1288 UInt uiSum = 0; 1285 1289 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1286 1290 Int iTemp; 1287 1291 1288 1292 for( ; iRows != 0; iRows-- ) 1289 1293 { … … 1352 1356 iTemp = piOrg[62] - piCur[62]; uiSum += ( iTemp * iTemp ) >> uiShift; 1353 1357 iTemp = piOrg[63] - piCur[63]; uiSum += ( iTemp * iTemp ) >> uiShift; 1354 1355 piOrg += iStrideOrg; 1356 piCur += iStrideCur; 1357 } 1358 1358 1359 piOrg += iStrideOrg; 1360 piCur += iStrideCur; 1361 } 1362 1359 1363 return ( uiSum ); 1360 1364 } … … 1376 1380 m[2] = diff[0] - diff[2]; 1377 1381 m[3] = diff[1] - diff[3]; 1378 1382 1379 1383 satd += abs(m[0] + m[1]); 1380 1384 satd += abs(m[0] - m[1]); 1381 1385 satd += abs(m[2] + m[3]); 1382 1386 satd += abs(m[2] - m[3]); 1383 1387 1384 1388 return satd; 1385 1389 } … … 1388 1392 { 1389 1393 Int k, satd = 0, diff[16], m[16], d[16]; 1390 1394 1391 1395 assert( iStep == 1 ); 1392 1396 for( k = 0; k < 16; k+=4 ) … … 1396 1400 diff[k+2] = piOrg[2] - piCur[2]; 1397 1401 diff[k+3] = piOrg[3] - piCur[3]; 1398 1399 piCur += iStrideCur; 1400 piOrg += iStrideOrg; 1401 } 1402 1402 1403 piCur += iStrideCur; 1404 piOrg += iStrideOrg; 1405 } 1406 1403 1407 /*===== hadamard transform =====*/ 1404 1408 m[ 0] = diff[ 0] + diff[12]; … … 1418 1422 m[14] = diff[ 2] - diff[14]; 1419 1423 m[15] = diff[ 3] - diff[15]; 1420 1424 1421 1425 d[ 0] = m[ 0] + m[ 4]; 1422 1426 d[ 1] = m[ 1] + m[ 5]; … … 1435 1439 d[14] = m[14] - m[10]; 1436 1440 d[15] = m[15] - m[11]; 1437 1441 1438 1442 m[ 0] = d[ 0] + d[ 3]; 1439 1443 m[ 1] = d[ 1] + d[ 2]; … … 1452 1456 m[14] = d[13] - d[14]; 1453 1457 m[15] = d[12] - d[15]; 1454 1458 1455 1459 d[ 0] = m[ 0] + m[ 1]; 1456 1460 d[ 1] = m[ 0] - m[ 1]; … … 1469 1473 d[14] = m[14] + m[15]; 1470 1474 d[15] = m[15] - m[14]; 1471 1475 1472 1476 for (k=0; k<16; ++k) 1473 1477 { … … 1475 1479 } 1476 1480 satd = ((satd+1)>>1); 1477 1481 1478 1482 return satd; 1479 1483 } … … 1494 1498 diff[k+6] = piOrg[6] - piCur[6]; 1495 1499 diff[k+7] = piOrg[7] - piCur[7]; 1496 1497 piCur += iStrideCur; 1498 piOrg += iStrideOrg; 1499 } 1500 1500 1501 piCur += iStrideCur; 1502 piOrg += iStrideOrg; 1503 } 1504 1501 1505 //horizontal 1502 1506 for (j=0; j < 8; j++) … … 1511 1515 m2[j][6] = diff[jj+2] - diff[jj+6]; 1512 1516 m2[j][7] = diff[jj+3] - diff[jj+7]; 1513 1517 1514 1518 m1[j][0] = m2[j][0] + m2[j][2]; 1515 1519 m1[j][1] = m2[j][1] + m2[j][3]; … … 1520 1524 m1[j][6] = m2[j][4] - m2[j][6]; 1521 1525 m1[j][7] = m2[j][5] - m2[j][7]; 1522 1526 1523 1527 m2[j][0] = m1[j][0] + m1[j][1]; 1524 1528 m2[j][1] = m1[j][0] - m1[j][1]; … … 1530 1534 m2[j][7] = m1[j][6] - m1[j][7]; 1531 1535 } 1532 1536 1533 1537 //vertical 1534 1538 for (i=0; i < 8; i++) … … 1542 1546 m3[6][i] = m2[2][i] - m2[6][i]; 1543 1547 m3[7][i] = m2[3][i] - m2[7][i]; 1544 1548 1545 1549 m1[0][i] = m3[0][i] + m3[2][i]; 1546 1550 m1[1][i] = m3[1][i] + m3[3][i]; … … 1551 1555 m1[6][i] = m3[4][i] - m3[6][i]; 1552 1556 m1[7][i] = m3[5][i] - m3[7][i]; 1553 1557 1554 1558 m2[0][i] = m1[0][i] + m1[1][i]; 1555 1559 m2[1][i] = m1[0][i] - m1[1][i]; … … 1561 1565 m2[7][i] = m1[6][i] - m1[7][i]; 1562 1566 } 1563 1567 1564 1568 for (i = 0; i < 8; i++) 1565 1569 { … … 1569 1573 } 1570 1574 } 1571 1575 1572 1576 sad=((sad+2)>>2); 1573 1577 1574 1578 return sad; 1575 1579 } … … 1681 1685 //vertical 1682 1686 for (i=0; i < 16; i++) 1683 { 1687 { 1684 1688 m2[0][i] = m1[0][i] + m1[2][i]; 1685 1689 m2[1][i] = m1[1][i] + m1[3][i]; … … 1838 1842 Int iOffsetOrg = iStrideOrg<<2; 1839 1843 Int iOffsetCur = iStrideCur<<2; 1840 1841 UInt uiSum = 0; 1842 1844 1845 UInt uiSum = 0; 1846 1843 1847 for ( y=0; y<iRows; y+= 4 ) 1844 1848 { … … 1847 1851 piCur += iOffsetCur; 1848 1852 } 1849 1853 1850 1854 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1851 1855 } … … 1864 1868 Int iStep = pcDtParam->iStep; 1865 1869 Int y; 1866 1867 UInt uiSum = 0; 1868 1870 1871 UInt uiSum = 0; 1872 1869 1873 if ( iRows == 4 ) 1870 1874 { … … 1883 1887 } 1884 1888 } 1885 1889 1886 1890 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1887 1891 } … … 1900 1904 Int iStrideOrg = pcDtParam->iStrideOrg; 1901 1905 Int iStep = pcDtParam->iStep; 1902 1906 1903 1907 Int x, y; 1904 1905 UInt uiSum = 0; 1906 1908 1909 UInt uiSum = 0; 1910 1907 1911 #if NS_HAD 1908 1912 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) … … 1924 1928 } 1925 1929 #if NS_HAD 1926 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 1930 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 1927 1931 { 1928 1932 Int iOffsetOrg = iStrideOrg<<2; … … 1938 1942 } 1939 1943 } 1940 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 1944 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 1941 1945 { 1942 1946 Int iOffsetOrg = iStrideOrg<<4; … … 1957 1961 Int iOffsetOrg = iStrideOrg<<2; 1958 1962 Int iOffsetCur = iStrideCur<<2; 1959 1963 1960 1964 for ( y=0; y<iRows; y+= 4 ) 1961 1965 { … … 1986 1990 assert(false); 1987 1991 } 1988 1992 1989 1993 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1990 1994 } -
trunk/source/Lib/TLibCommon/TComRom.cpp
r442 r494 86 86 // Data structure related table & variable 87 87 // ==================================================================================================================== 88 88 #if LAYER_CTB 89 UInt g_auiLayerMaxCUWidth[MAX_LAYERS]; 90 UInt g_auiLayerMaxCUHeight[MAX_LAYERS]; 91 UInt g_auiLayerMaxCUDepth[MAX_LAYERS]; 92 UInt g_auiLayerAddCUDepth[MAX_LAYERS]; 93 UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 94 UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 95 UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 96 UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 97 #endif 89 98 UInt g_uiMaxCUWidth = MAX_CU_SIZE; 90 99 UInt g_uiMaxCUHeight = MAX_CU_SIZE; … … 312 321 UInt g_uiPCMBitDepthLuma = 8; // PCM bit-depth 313 322 UInt g_uiPCMBitDepthChroma = 8; // PCM bit-depth 314 323 #if O0194_DIFFERENT_BITDEPTH_EL_BL 324 Int g_bitDepthYLayer[MAX_LAYERS]; 325 Int g_bitDepthCLayer[MAX_LAYERS]; 326 327 UInt g_uiPCMBitDepthLumaDec[MAX_LAYERS]; // PCM bit-depth 328 UInt g_uiPCMBitDepthChromaDec[MAX_LAYERS]; // PCM bit-depth 329 #endif 330 #if O0194_WEIGHTED_PREDICTION_CGS 331 void * g_refWeightACDCParam; // type=wpACDCParam 332 #endif 315 333 // ==================================================================================================================== 316 334 // Misc. -
trunk/source/Lib/TLibCommon/TComRom.h
r442 r494 81 81 82 82 // global variable (LCU width/height, max. CU depth) 83 #if LAYER_CTB 84 extern UInt g_auiLayerMaxCUWidth[MAX_LAYERS]; 85 extern UInt g_auiLayerMaxCUHeight[MAX_LAYERS]; 86 extern UInt g_auiLayerMaxCUDepth[MAX_LAYERS]; 87 extern UInt g_auiLayerAddCUDepth[MAX_LAYERS]; 88 extern UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 89 extern UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 90 extern UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 91 extern UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 92 #endif 83 93 extern UInt g_uiMaxCUWidth; 84 94 extern UInt g_uiMaxCUHeight; -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r442 r494 75 75 , m_iDepth ( 0 ) 76 76 , m_bRefenced ( false ) 77 #if POC_RESET_FLAG78 , m_bPocResetFlag ( false )79 #endif80 #if SH_DISCARDABLE_FLAG81 , m_bDiscardableFlag ( false )82 #endif83 77 , m_pcSPS ( NULL ) 84 78 , m_pcPPS ( NULL ) … … 93 87 #endif 94 88 , m_uiTLayer ( 0 ) 95 #if SVC_EXTENSION96 , m_layerId ( 0 )97 #endif98 89 , m_bTLayerSwitchingFlag ( false ) 99 90 , m_sliceMode ( 0 ) … … 118 109 , m_temporalLayerNonReferenceFlag ( false ) 119 110 , m_enableTMVPFlag ( true ) 111 #if SVC_EXTENSION 112 , m_layerId ( 0 ) 113 #if REF_IDX_MFM 114 , m_bMFMEnabledFlag ( false ) 115 #endif 116 #if POC_RESET_FLAG 117 , m_bPocResetFlag ( false ) 118 #endif 119 , m_bDiscardableFlag ( false ) 120 #endif //SVC_EXTENSION 120 121 { 121 122 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0; … … 138 139 m_interLayerSamplePredOnlyFlag = false; 139 140 #endif 140 #endif 141 #endif //SVC_EXTENSION 141 142 142 143 initEqualRef(); … … 455 456 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 456 457 //inter-layer reference picture 457 458 #if ILR_RESTR 458 #if O0225_MAX_TID_FOR_REF_LAYERS 459 Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId(),m_layerId) : 0; 460 #else 459 461 Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0; 462 #endif 460 463 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 461 #else //#if ILR_RESTR462 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )463 #endif //#if ILR_RESTR464 464 { 465 465 #if REF_IDX_MFM … … 485 485 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 486 486 #if SVC_EXTENSION 487 #if ILR_RESTR488 487 Int numInterLayerRPSPics = 0; 489 488 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 495 494 for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ ) 496 495 { 496 #if O0225_MAX_TID_FOR_REF_LAYERS 497 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[i]->getSlice(0)->getLayerId(),m_layerId); 498 #else 497 499 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[i]->getSlice(0)->getLayerId()); 500 #endif 498 501 if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) ) 499 502 { … … 574 577 #endif 575 578 } 576 #endif577 579 #if JCTVC_M0458_INTERLAYER_RPS_SIG 578 580 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_activeNumILRRefIdx; … … 580 582 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_numILRRefIdx; 581 583 #endif 582 #else 584 #else //SVC_EXTENSION 583 585 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 584 #endif 586 #endif //SVC_EXTENSION 585 587 #if FIX1071 586 588 if (checkNumPocTotalCurr) … … 631 633 #if RPL_INIT_N0316_N0082 632 634 if( m_layerId > 0 ) 633 { 635 { 634 636 #if JCTVC_M0458_INTERLAYER_RPS_SIG 635 637 for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) … … 639 641 { 640 642 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 641 #if ILR_RESTR 643 #if O0225_MAX_TID_FOR_REF_LAYERS 644 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId(),m_layerId); 645 #else 642 646 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 647 #endif 643 648 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 644 #endif 649 { 645 650 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 646 } 647 } 648 #endif 649 #endif 651 } 652 } 653 } 654 #endif 655 #endif //SVC_EXTENSION 650 656 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 651 657 { … … 667 673 { 668 674 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 669 #if ILR_RESTR 670 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 675 #if O0225_MAX_TID_FOR_REF_LAYERS 676 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId(),m_layerId); 677 #else 678 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 679 #endif 671 680 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 672 #endif 673 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 681 { 682 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 683 } 674 684 } 675 685 } … … 704 714 { 705 715 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 706 #if ILR_RESTR 716 #if O0225_MAX_TID_FOR_REF_LAYERS 717 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId(),m_layerId); 718 #else 707 719 Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 720 #endif 708 721 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 709 #endif 710 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; 711 } 712 } 713 #endif 722 { 723 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; 724 } 725 } 726 } 727 #endif //SVC_EXTENSION 714 728 715 729 assert(cIdx == numPocTotalCurr); … … 781 795 #if N0147_IRAP_ALIGN_FLAG 782 796 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 ); 783 #endif784 #if FINAL_RPL_CHANGE_N0082785 hasModification = false; //modification is not necessary786 797 #endif 787 798 refPicListModification->setRefPicListModificationFlagL0(hasModification); … … 1133 1144 #if SVC_EXTENSION 1134 1145 m_pcVPS = pSrc->m_pcVPS; 1146 m_layerId = pSrc->m_layerId; 1135 1147 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1136 1148 m_activeNumILRRefIdx = pSrc->m_activeNumILRRefIdx; … … 1847 1859 return retVal; 1848 1860 } 1861 #if AUXILIARY_PICTURES 1862 ChromaFormat TComSlice::getChromaFormatIdc() 1863 #else 1849 1864 UInt TComSlice::getChromaFormatIdc() 1865 #endif 1866 { 1867 TComSPS *sps = getSPS(); 1868 TComVPS *vps = getVPS(); 1869 #if AUXILIARY_PICTURES 1870 ChromaFormat retVal; 1871 UInt layerId = getLayerId(); 1872 #else 1873 UInt retVal, layerId = getLayerId(); 1874 #endif 1875 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1876 { 1877 retVal = sps->getChromaFormatIdc(); 1878 } 1879 else 1880 { 1881 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1882 } 1883 return retVal; 1884 } 1885 UInt TComSlice::getBitDepthY() 1850 1886 { 1851 1887 TComSPS *sps = getSPS(); … … 1854 1890 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1855 1891 { 1856 retVal = sps->get ChromaFormatIdc();1892 retVal = sps->getBitDepthY(); 1857 1893 } 1858 1894 else 1859 1895 { 1860 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->get ChromaFormatVpsIdc();1896 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1861 1897 } 1862 1898 return retVal; 1863 1899 } 1864 UInt TComSlice::getBitDepth Y()1900 UInt TComSlice::getBitDepthC() 1865 1901 { 1866 1902 TComSPS *sps = getSPS(); … … 1869 1905 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1870 1906 { 1871 retVal = sps->getBitDepth Y();1907 retVal = sps->getBitDepthC(); 1872 1908 } 1873 1909 else 1874 1910 { 1875 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVps Luma();1911 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1876 1912 } 1877 1913 return retVal; 1878 1914 } 1879 UInt TComSlice::getBitDepthC()1880 {1881 TComSPS *sps = getSPS();1882 TComVPS *vps = getVPS();1883 UInt retVal, layerId = getLayerId();1884 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )1885 {1886 retVal = sps->getBitDepthC();1887 }1888 else1889 {1890 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();1891 }1892 return retVal;1893 }1894 1915 Int TComSlice::getQpBDOffsetY() 1895 1916 { … … 1902 1923 1903 1924 RepFormat::RepFormat() 1925 #if AUXILIARY_PICTURES 1926 : m_chromaFormatVpsIdc (CHROMA_420) 1927 #else 1904 1928 : m_chromaFormatVpsIdc (0) 1929 #endif 1905 1930 , m_separateColourPlaneVpsFlag (false) 1906 1931 , m_picWidthVpsInLumaSamples (0) … … 1914 1939 // Video parameter set (VPS) 1915 1940 // ------------------------------------------------------------------------------------------------ 1941 #if SVC_EXTENSION 1916 1942 TComVPS::TComVPS() 1917 1943 : m_VPSId ( 0) … … 1933 1959 , m_numOutputLayerSets (0) 1934 1960 #endif 1935 #if VPS_PROFILE_OUTPUT_LAYERS1936 1961 , m_numProfileTierLevel (0) 1937 1962 , m_moreOutputLayerSetsThanDefaultFlag (false) 1938 1963 , m_numAddOutputLayerSets (0) 1939 1964 , m_defaultOneTargetOutputLayerFlag (false) 1940 #endif1941 1965 #if VPS_VUI_BITRATE_PICRATE 1942 1966 , m_bitRatePresentVpsFlag (false) … … 1992 2016 ::memset(m_numLayerInIdList, 0, sizeof(m_numLayerInIdList )); 1993 2017 #endif 1994 #if VPS_PROFILE_OUTPUT_LAYERS1995 2018 ::memset(m_profileLevelTierIdx, 0, sizeof(m_profileLevelTierIdx)); 1996 #endif1997 2019 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1998 2020 m_maxOneActiveRefLayerFlag = true; 2021 #endif 2022 #if O0062_POC_LSB_NOT_PRESENT_FLAG 2023 ::memset(m_pocLsbNotPresentFlag, 0, sizeof(m_pocLsbNotPresentFlag)); 1999 2024 #endif 2000 2025 #if N0147_IRAP_ALIGN_FLAG … … 2007 2032 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 2008 2033 { 2034 #if O0225_MAX_TID_FOR_REF_LAYERS 2035 for( Int j = 0; j < MAX_VPS_LAYER_ID_PLUS1; j++) 2036 { 2037 m_maxTidIlRefPicsPlus1[i][j] = m_uiMaxTLayers + 1; 2038 } 2039 #else 2009 2040 m_maxTidIlRefPicsPlus1[i] = m_uiMaxTLayers + 1; 2041 #endif 2010 2042 } 2011 2043 #endif … … 2034 2066 #endif 2035 2067 } 2068 #else 2069 TComVPS::TComVPS() 2070 : m_VPSId ( 0) 2071 , m_uiMaxTLayers ( 1) 2072 , m_uiMaxLayers ( 1) 2073 , m_bTemporalIdNestingFlag (false) 2074 , m_numHrdParameters ( 0) 2075 , m_maxNuhReservedZeroLayerId ( 0) 2076 , m_hrdParameters (NULL) 2077 , m_hrdOpSetIdx (NULL) 2078 , m_cprmsPresentFlag (NULL) 2079 { 2080 for( Int i = 0; i < MAX_TLAYER; i++) 2081 { 2082 m_numReorderPics[i] = 0; 2083 m_uiMaxDecPicBuffering[i] = 1; 2084 m_uiMaxLatencyIncrease[i] = 0; 2085 } 2086 } 2087 #endif //SVC_EXTENSION 2036 2088 2037 2089 TComVPS::~TComVPS() … … 2163 2215 , m_vuiParametersPresentFlag (false) 2164 2216 , m_vuiParameters () 2217 #if SVC_EXTENSION 2165 2218 #if M0463_VUI_EXT_ILP_REF 2166 2219 , m_interViewMvVertConstraintFlag (false) 2167 2220 , m_numIlpRestrictedRefLayers ( 0 ) 2168 2221 #endif 2169 #if SVC_EXTENSION 2170 , m_layerId(0) 2171 #endif 2172 #if SCALED_REF_LAYER_OFFSETS 2173 , m_numScaledRefLayerOffsets (0) 2174 #endif 2222 , m_layerId ( 0 ) 2223 , m_numScaledRefLayerOffsets ( 0 ) 2175 2224 #if REPN_FORMAT_IN_VPS 2176 2225 , m_updateRepFormatFlag (false) 2177 2226 #endif 2227 #endif //SVC_EXTENSION 2178 2228 { 2179 2229 for ( Int i = 0; i < MAX_TLAYER; i++ ) … … 3038 3088 #endif 3039 3089 } 3040 #endif 3090 3091 #if MFM_ENCCONSTRAINT 3092 TComPic* TComSlice::getBaseColPic( TComList<TComPic*>& rcListPic ) 3093 { 3094 #if POC_RESET_FLAG 3095 return xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC ); 3096 #else 3097 return xGetRefPic( rcListPic, m_iPOC ); 3098 #endif 3099 } 3100 #endif 3041 3101 3042 3102 #if REF_IDX_MFM … … 3085 3145 #endif 3086 3146 3147 Void TComSlice::setILRPic(TComPic **pcIlpPic) 3148 { 3149 for( Int i = 0; i < m_activeNumILRRefIdx; i++ ) 3150 { 3151 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 3152 3153 if( pcIlpPic[refLayerIdc] ) 3154 { 3155 pcIlpPic[refLayerIdc]->copyUpsampledPictureYuv( m_pcPic->getFullPelBaseRec( refLayerIdc ), pcIlpPic[refLayerIdc]->getPicYuvRec() ); 3156 pcIlpPic[refLayerIdc]->getSlice(0)->setPOC( m_iPOC ); 3157 pcIlpPic[refLayerIdc]->setLayerId( m_pcBaseColPic[refLayerIdc]->getLayerId() ); //set reference layerId 3158 pcIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension( false ); 3159 pcIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 3160 for (Int j=0; j<pcIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId 3161 { 3162 pcIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId( pcIlpPic[refLayerIdc]->getLayerId() ); 3163 } 3164 } 3165 } 3166 } 3167 3168 #endif //SVC_EXTENSION 3169 3087 3170 //! \} -
trunk/source/Lib/TLibCommon/TComSlice.h
r442 r494 436 436 class RepFormat 437 437 { 438 #if AUXILIARY_PICTURES 439 ChromaFormat m_chromaFormatVpsIdc; 440 #else 438 441 Int m_chromaFormatVpsIdc; 442 #endif 439 443 Bool m_separateColourPlaneVpsFlag; 440 444 Int m_picWidthVpsInLumaSamples; … … 446 450 RepFormat(); 447 451 452 #if AUXILIARY_PICTURES 453 ChromaFormat getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 454 Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } 455 #else 448 456 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 449 457 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 458 #endif 450 459 451 460 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } … … 484 493 UInt* m_hrdOpSetIdx; 485 494 Bool* m_cprmsPresentFlag; 495 #if !SVC_EXTENSION 496 UInt m_numOpSets; 497 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 498 #endif 499 TComPTL m_pcPTL; 500 TimingInfo m_timingInfo; 501 502 #if SVC_EXTENSION 503 #if DERIVE_LAYER_ID_LIST_VARIABLES 504 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 505 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 506 #endif 507 #if IL_SL_SIGNALLING_N0371 508 Bool m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS]; // layer dependency for scaling list 509 #endif 510 #if VPS_EXTN_OFFSET 511 UInt m_extensionOffset; 512 #endif 486 513 #if VPS_RENAME 487 514 UInt m_maxLayerId; 488 515 UInt m_numLayerSets; 489 516 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 490 #else 491 UInt m_numOpSets; 492 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 493 #endif 494 #if DERIVE_LAYER_ID_LIST_VARIABLES 495 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 496 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 497 #endif 498 #if IL_SL_SIGNALLING_N0371 499 Bool m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS]; // layer dependency for scaling list 500 #endif 501 #if VPS_EXTN_OFFSET 502 UInt m_extensionOffset; 503 #endif 504 TComPTL m_pcPTL; 505 TimingInfo m_timingInfo; 517 #endif 506 518 507 519 // ------------------------------------------ … … 546 558 #endif 547 559 #endif 548 #if VPS_PROFILE_OUTPUT_LAYERS549 560 UInt m_numProfileTierLevel; 550 561 Bool m_moreOutputLayerSetsThanDefaultFlag; … … 552 563 Bool m_defaultOneTargetOutputLayerFlag; 553 564 Int m_profileLevelTierIdx[64]; 554 #endif555 565 #if JCTVC_M0458_INTERLAYER_RPS_SIG 556 566 Bool m_maxOneActiveRefLayerFlag; 557 567 #endif 568 #if O0062_POC_LSB_NOT_PRESENT_FLAG 569 Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_ID_PLUS1]; 570 #endif 558 571 #if N0147_IRAP_ALIGN_FLAG 559 572 Bool m_crossLayerIrapAlignFlag; 560 573 #endif 561 574 #if JCTVC_M0203_INTERLAYER_PRED_IDC 575 #if O0225_MAX_TID_FOR_REF_LAYERS 576 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1][MAX_VPS_LAYER_ID_PLUS1]; 577 #else 562 578 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 579 #endif 563 580 #endif 564 581 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 597 614 Int m_viewIdVal [MAX_LAYERS]; 598 615 #endif 616 617 #if O0215_PHASE_ALIGNMENT 618 Bool m_phaseAlignFlag; 619 #endif 620 #endif //SVC_EXTENSION 599 621 public: 600 622 TComVPS(); … … 637 659 UInt getNumHrdParameters() { return m_numHrdParameters; } 638 660 Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } 639 640 #if VPS_RENAME 641 UInt getMaxLayerId() { return m_maxLayerId; } 642 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 643 644 UInt getNumLayerSets() { return m_numLayerSets; } 645 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 646 #else 661 662 #if !SVC_EXTENSION 647 663 UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } 648 664 Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } … … 653 669 Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } 654 670 Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } 671 672 TComPTL* getPTL() { return &m_pcPTL; } 673 TimingInfo* getTimingInfo() { return &m_timingInfo; } 674 675 #if SVC_EXTENSION 655 676 #if DERIVE_LAYER_ID_LIST_VARIABLES 656 677 Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } … … 669 690 #endif 670 691 671 TComPTL* getPTL() { return &m_pcPTL; } 672 TimingInfo* getTimingInfo() { return &m_timingInfo; } 692 #if VPS_RENAME 693 UInt getMaxLayerId() { return m_maxLayerId; } 694 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 695 696 UInt getNumLayerSets() { return m_numLayerSets; } 697 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 698 #endif 673 699 #if VPS_EXTN_MASK_AND_DIM_INFO 674 700 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } … … 743 769 #endif 744 770 #endif 745 #if VPS_PROFILE_OUTPUT_LAYERS746 771 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } 747 772 Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } … … 758 783 Int getProfileLevelTierIdx(Int i) { return m_profileLevelTierIdx[i]; } 759 784 Void setProfileLevelTierIdx(Int i, Int x) { m_profileLevelTierIdx[i] = x ; } 760 #endif761 785 #if JCTVC_M0458_INTERLAYER_RPS_SIG 762 786 Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag; } 763 787 Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } 764 #endif 788 #endif 789 #if O0062_POC_LSB_NOT_PRESENT_FLAG 790 UInt getPocLsbNotPresentFlag(Int i) { return m_pocLsbNotPresentFlag[i]; } 791 Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x; } 792 #endif 765 793 #if N0147_IRAP_ALIGN_FLAG 766 794 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } … … 768 796 #endif 769 797 #if JCTVC_M0203_INTERLAYER_PRED_IDC 798 #if O0225_MAX_TID_FOR_REF_LAYERS 799 UInt getMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId) { return m_maxTidIlRefPicsPlus1[layerId][refLayerId]; } 800 Void setMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId][refLayerId] = maxSublayer; } 801 #else 770 802 UInt getMaxTidIlRefPicsPlus1(Int layerId) { return m_maxTidIlRefPicsPlus1[layerId]; } 771 803 Void setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer; } 804 #endif 772 805 #endif 773 806 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 847 880 Void setExtensionOffset( UInt offset ) { m_extensionOffset = offset; } 848 881 #endif 882 #if O0215_PHASE_ALIGNMENT 883 Bool getPhaseAlignFlag() { return m_phaseAlignFlag; } 884 Void setPhaseAlignFlag(Bool x) { m_phaseAlignFlag = x; } 885 #endif 886 #endif //SVC_EXTENSION 849 887 }; 850 888 … … 924 962 TComHRD m_hrdParameters; 925 963 TimingInfo m_timingInfo; 926 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG927 Bool m_tileBoundariesAlignedFlag;928 #endif929 930 964 931 965 public: … … 960 994 ,m_log2MaxMvLengthHorizontal(15) 961 995 ,m_log2MaxMvLengthVertical(15) 962 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG963 ,m_tileBoundariesAlignedFlag(true)964 #endif965 996 {} 966 997 … … 1058 1089 TComHRD* getHrdParameters () { return &m_hrdParameters; } 1059 1090 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1060 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG1061 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; }1062 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; }1063 #endif1064 1091 }; 1065 1092 … … 1070 1097 Int m_SPSId; 1071 1098 Int m_VPSId; 1099 #if AUXILIARY_PICTURES 1100 ChromaFormat m_chromaFormatIdc; 1101 #else 1072 1102 Int m_chromaFormatIdc; 1103 #endif 1073 1104 1074 1105 UInt m_uiMaxTLayers; // maximum number of temporal layers … … 1143 1174 TComPTL m_pcPTL; 1144 1175 1176 #if SVC_EXTENSION 1145 1177 #if M0463_VUI_EXT_ILP_REF 1146 1178 Bool m_interViewMvVertConstraintFlag; … … 1151 1183 #endif 1152 1184 1153 #if SVC_EXTENSION1154 1185 UInt m_layerId; 1155 1186 … … 1161 1192 #endif 1162 1193 1163 #endif1164 1194 #if REF_IDX_MFM 1165 1195 #if !M0457_COL_PICTURE_SIGNALING … … 1167 1197 #endif 1168 1198 #endif 1169 #if SCALED_REF_LAYER_OFFSETS1170 1199 UInt m_numScaledRefLayerOffsets; 1171 1200 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1172 #endif1173 1201 #if REPN_FORMAT_IN_VPS 1174 1202 Bool m_updateRepFormatFlag; 1175 1203 #endif 1204 #endif //SVC_EXTENSION 1176 1205 public: 1177 1206 TComSPS(); … … 1182 1211 Int getSPSId () { return m_SPSId; } 1183 1212 Void setSPSId (Int i) { m_SPSId = i; } 1213 1214 #if AUXILIARY_PICTURES 1215 ChromaFormat getChromaFormatIdc () { return m_chromaFormatIdc; } 1216 Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } 1217 1218 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1219 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1220 #else 1184 1221 Int getChromaFormatIdc () { return m_chromaFormatIdc; } 1185 1222 Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } … … 1187 1224 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1188 1225 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1226 #endif 1189 1227 1190 1228 // structure … … 1334 1372 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1335 1373 UInt getLayerId() { return m_layerId; } 1336 #endif1337 1374 #if REF_IDX_MFM 1338 1375 #if !M0457_COL_PICTURE_SIGNALING … … 1341 1378 #endif 1342 1379 #endif 1343 #if SCALED_REF_LAYER_OFFSETS1344 1380 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1345 1381 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1346 1382 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1347 #endif1348 1383 #if REPN_FORMAT_IN_VPS 1349 1384 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } 1350 1385 Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } 1351 1386 #endif 1387 #endif //SVC_EXTENSION 1352 1388 }; 1353 1389 … … 1604 1640 Int64 iAC; 1605 1641 Int64 iDC; 1642 #if O0194_WEIGHTED_PREDICTION_CGS 1643 Int iSamples; 1644 #endif 1606 1645 } wpACDCParam; 1607 1646 … … 1636 1675 Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter 1637 1676 Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter 1638 #if JCTVC_M0458_INTERLAYER_RPS_SIG1639 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures1640 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1];1641 #else1642 #if SVC_EXTENSION1643 Int m_numILRRefIdx; //< for inter-layer reference picture ser1644 #endif1645 #endif1646 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG1647 Int m_numSamplePredRefLayers;1648 Bool m_interLayerSamplePredOnlyFlag;1649 #endif1650 1677 Int m_list1IdxToList0Idx[MAX_NUM_REF]; 1651 1678 Int m_aiNumRefIdx [2]; // for multiple reference of current slice … … 1664 1691 // referenced slice? 1665 1692 Bool m_bRefenced; 1666 1667 #if POC_RESET_FLAG 1668 Bool m_bPocResetFlag; 1669 Int m_pocValueBeforeReset; 1670 #endif 1671 #if SH_DISCARDABLE_FLAG 1672 Bool m_bDiscardableFlag; 1673 #endif 1693 1674 1694 // access channel 1675 1695 TComVPS* m_pcVPS; … … 1685 1705 UInt m_maxNumMergeCand; 1686 1706 1687 1688 1707 #if SAO_CHROMA_LAMBDA 1689 1708 Double m_dLambdaLuma; … … 1695 1714 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 1696 1715 UInt m_uiTLayer; 1697 #if SVC_EXTENSION1698 UInt m_layerId;1699 TComPic* m_pcBaseColPic[MAX_LAYERS];1700 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];1701 #if M0457_COL_PICTURE_SIGNALING1702 Int m_numMotionPredRefLayers;1703 #if REF_IDX_MFM1704 Bool m_bMFMEnabledFlag;1705 Int m_colRefLayerIdx;1706 Bool m_altColIndicationFlag;1707 TComPic* m_pcIlpPic;1708 #endif1709 #endif1710 #endif1711 1716 Bool m_bTLayerSwitchingFlag; 1712 1717 … … 1742 1747 1743 1748 Bool m_enableTMVPFlag; 1749 1750 #if SVC_EXTENSION 1751 UInt m_layerId; 1752 TComPic* m_pcBaseColPic[MAX_LAYERS]; 1753 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; 1754 #if M0457_COL_PICTURE_SIGNALING 1755 Int m_numMotionPredRefLayers; 1756 #if REF_IDX_MFM 1757 Bool m_bMFMEnabledFlag; 1758 Int m_colRefLayerIdx; 1759 Bool m_altColIndicationFlag; 1760 TComPic* m_pcIlpPic; 1761 #endif 1762 #endif 1763 1744 1764 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1745 Bool m_interLayerPredEnabledFlag; 1765 Bool m_interLayerPredEnabledFlag; 1766 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 1767 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; 1768 #else 1769 #if SVC_EXTENSION 1770 Int m_numILRRefIdx; //< for inter-layer reference picture ser 1771 #endif 1746 1772 #endif 1773 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 1774 Int m_numSamplePredRefLayers; 1775 Bool m_interLayerSamplePredOnlyFlag; 1776 #endif 1777 #if POC_RESET_FLAG 1778 Bool m_bPocResetFlag; 1779 Int m_pocValueBeforeReset; 1780 #endif 1781 Bool m_bDiscardableFlag; 1782 #endif //SVC_EXTENSION 1783 1747 1784 public: 1748 1785 TComSlice(); … … 1818 1855 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1819 1856 Int getNumRpsCurrTempList(); 1820 #if RPL_INIT_N0316_N00821821 Int getNumNegativeRpsCurrTempList();1822 #endif1823 1857 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1824 1858 Void setReferenced(Bool b) { m_bRefenced = b; } … … 1831 1865 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1832 1866 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 1833 #if RESTR_CHK1834 Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); }1835 Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); }1836 #endif1837 1838 #if POC_RESET_FLAG1839 Bool getPocResetFlag () { return m_bPocResetFlag; }1840 Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; }1841 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; }1842 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; }1843 #endif1844 #if SH_DISCARDABLE_FLAG1845 Bool getDiscardableFlag () { return m_bDiscardableFlag; }1846 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; }1847 #endif1848 1849 1867 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 1850 1868 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); … … 2008 2026 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 2009 2027 TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } 2028 #if MFM_ENCCONSTRAINT 2029 TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); 2030 #endif 2010 2031 2011 2032 Void setLayerId (UInt layerId) { m_layerId = layerId; } … … 2063 2084 #endif 2064 2085 2065 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 2066 2067 #endif //SVC_EXTENSION 2086 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 2087 2088 #if RESTR_CHK 2089 Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } 2090 Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } 2091 #endif 2092 2093 #if POC_RESET_FLAG 2094 Bool getPocResetFlag () { return m_bPocResetFlag; } 2095 Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; } 2096 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 2097 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 2098 #endif 2099 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 2100 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } 2101 2102 #if RPL_INIT_N0316_N0082 2103 Int getNumNegativeRpsCurrTempList(); 2104 #endif 2068 2105 2069 2106 #if REPN_FORMAT_IN_VPS 2070 2107 UInt getPicWidthInLumaSamples(); 2071 2108 UInt getPicHeightInLumaSamples(); 2109 #if AUXILIARY_PICTURES 2110 ChromaFormat getChromaFormatIdc(); 2111 #else 2072 2112 UInt getChromaFormatIdc(); 2113 #endif 2073 2114 UInt getBitDepthY(); 2074 2115 UInt getBitDepthC(); 2075 Int getQpBDOffsetY(); 2076 Int getQpBDOffsetC(); 2077 #endif 2116 Int getQpBDOffsetY(); 2117 Int getQpBDOffsetC(); 2118 #endif 2119 2120 Void setILRPic(TComPic **pcIlpPic); 2121 2122 #endif //SVC_EXTENSION 2078 2123 protected: 2079 2124 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r442 r494 17 17 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 18 18 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 23 23 #if ARBITRARY_SPATIAL_RATIO 24 24 { -1, 3, -9, 47, 31, -10, 4, -1}, 25 25 { -1, 4, -11, 45, 34, -10, 4, -1}, 26 26 #else 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 29 29 #endif 30 30 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 … … 33 33 { -1, 4, -10, 31, 47, -9, 3, -1}, 34 34 #else 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 37 37 #endif 38 38 { -1, 3, -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5 … … 43 43 { 0, 1, -2, 4, 63, -3, 1, 0} 44 44 #else 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 49 49 #endif 50 50 }; … … 60 60 {CNU,CNU,CNU,CNU},// 61 61 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 63 63 #endif 64 64 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 67 67 #if ARBITRARY_SPATIAL_RATIO 68 68 { -4, 42, 30, -4}, 69 69 #else 70 {CNU,CNU,CNU,CNU},// 70 {CNU,CNU,CNU,CNU},// 71 71 #endif 72 72 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 … … 75 75 { -4, 28, 46, -6}, 76 76 #else 77 {CNU,CNU,CNU,CNU},// 77 {CNU,CNU,CNU,CNU},// 78 78 #endif 79 79 { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5 … … 82 82 {-2, 14, 56, -4}, 83 83 #else 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 88 88 { 0, 4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 89 89 }; … … 97 97 } 98 98 99 #if SCALED_REF_LAYER_OFFSETS 99 #if O0215_PHASE_ALIGNMENT 100 #if O0194_JOINT_US_BITSHIFT 101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ) 102 #else 103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ) 104 #endif 105 #else 106 #if O0194_JOINT_US_BITSHIFT 107 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 108 #else 100 109 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 101 #else 102 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 110 #endif 103 111 #endif 104 112 { … … 109 117 110 118 //========== Y component upsampling =========== 111 #if SCALED_REF_LAYER_OFFSETS112 119 const Window &scalEL = window; 113 120 … … 119 126 Int heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 120 127 Int strideEL = pcUsPic->getStride(); 121 #else 122 const Window &confBL = pcBasePic->getConformanceWindow(); 123 const Window &confEL = pcUsPic->getConformanceWindow(); 124 125 Int widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 126 Int heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 127 Int strideBL = pcBasePic->getStride(); 128 129 Int widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 130 Int heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 131 Int strideEL = pcUsPic->getStride(); 132 #endif 128 133 129 Pel* piTempBufY = pcTempPic->getLumaAddr(); 134 130 Pel* piSrcBufY = pcBasePic->getLumaAddr(); … … 153 149 Int scaleX = g_posScalingFactor[refLayerIdc][0]; 154 150 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 151 152 #if O0194_JOINT_US_BITSHIFT 153 UInt currLayerId = currSlice->getLayerId(); 154 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc ); 155 #endif 155 156 156 157 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x … … 194 195 Int refPos16 = 0; 195 196 Int phase = 0; 196 Int refPos = 0; 197 Int refPos = 0; 197 198 Int* coeff = m_chromaFilter[phase]; 198 199 for ( i = 0; i < 16; i++) … … 202 203 } 203 204 204 #if ARBITRARY_SPATIAL_RATIO 205 #if ARBITRARY_SPATIAL_RATIO 205 206 assert ( widthEL >= widthBL ); 206 207 assert ( heightEL >= heightBL ); … … 216 217 Int shiftY = 16; 217 218 219 #if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2 220 Int phaseX = 2*phaseAlignFlag; 221 Int phaseY = 2*phaseAlignFlag; 222 #else 218 223 Int phaseX = 0; 219 224 Int phaseY = 0; 225 #endif 220 226 221 227 #if ROUNDING_OFFSET … … 228 234 229 235 Int deltaX = 4 * phaseX; 230 Int deltaY = 4 * phaseY; 236 Int deltaY = 4 * phaseY; 231 237 232 238 Int shiftXM4 = shiftX - 4; … … 238 244 widthBL = pcBasePic->getWidth (); 239 245 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 240 #if SCALED_REF_LAYER_OFFSETS 246 241 247 Int leftStartL = scalEL.getWindowLeftOffset(); 242 248 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); 243 249 Int topStartL = scalEL.getWindowTopOffset(); 244 250 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 245 #if BUGFIX_RESAMPLE246 251 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 247 #endif248 #endif249 252 250 253 #if N0214_INTERMEDIATE_BUFFER_16BITS 254 #if O0194_JOINT_US_BITSHIFT 255 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 256 Int shift1 = g_bitDepthYLayer[refLayerId] - 8; 257 #else 251 258 Int shift1 = g_bitDepthY - 8; 259 #endif 252 260 #endif 253 261 … … 255 263 for( i = 0; i < widthEL; i++ ) 256 264 { 257 #if SCALED_REF_LAYER_OFFSETS258 265 Int x = Clip3( leftStartL, rightEndL - 1, i ); 259 266 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 260 #else261 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;262 #endif263 267 phase = refPos16 & 15; 264 268 refPos = refPos16 >> 4; … … 287 291 288 292 #if N0214_INTERMEDIATE_BUFFER_16BITS 293 #if O0194_JOINT_US_BITSHIFT 294 Int nShift = 20 - g_bitDepthYLayer[currLayerId]; 295 #else 289 296 Int nShift = US_FILTER_PREC*2 - shift1; 297 #endif 290 298 #else 291 299 const Int nShift = US_FILTER_PREC*2; 292 300 #endif 293 Int iOffset = 1 << (nShift - 1); 294 295 #if SCALED_REF_LAYER_OFFSETS 301 Int iOffset = 1 << (nShift - 1); 302 296 303 for( j = 0; j < pcTempPic->getHeight(); j++ ) 297 #else 298 for( j = 0; j < heightEL; j++ ) 299 #endif 300 { 301 #if SCALED_REF_LAYER_OFFSETS 304 { 302 305 Int y = Clip3(topStartL, bottomEndL - 1, j); 303 306 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 304 #else305 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;306 #endif307 307 phase = refPos16 & 15; 308 308 refPos = refPos16 >> 4; … … 310 310 311 311 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 312 #if SCALED_REF_LAYER_OFFSETS 313 #if BUGFIX_RESAMPLE 314 Pel* piDstY0 = piDstBufY + j * strideEL; 312 Pel* piDstY0 = piDstBufY + j * strideEL; 315 313 piDstY = piDstY0 + leftOffset; 316 314 piSrcY += leftOffset; … … 335 333 piDstY++; 336 334 } 337 #else 338 #if 1 // it should provide identical result 339 Pel* piDstY0 = piDstBufY + j * strideEL; 340 piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 ); 341 342 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 343 { 344 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 345 piSrcY++; 346 piDstY++; 347 } 348 349 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 350 { 351 *piDstY = piDstY0[rightEndL-1]; 352 piDstY++; 353 } 354 355 piDstY = piDstY0; 356 for( i = 0; i < leftStartL; i++ ) 357 { 358 *piDstY = piDstY0[leftStartL]; 359 piDstY++; 360 } 361 #else 362 piDstY = piDstBufY + j * strideEL; 363 364 for( i = 0; i < pcTempPic->getWidth(); i++ ) 365 { 366 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 367 368 // Only increase the x position of reference upsample picture when within the window 369 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 370 if( (i >= leftStartL) && (i <= rightEndL-2) ) 371 { 372 piSrcY++; 373 } 374 piDstY++; 375 } 376 #endif 377 #endif 378 #else 379 piDstY = piDstBufY + j * strideEL; 380 381 for( i = 0; i < widthEL; i++ ) 382 { 383 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 384 piSrcY++; 385 piDstY++; 386 } 387 #endif 388 } 389 390 #if SCALED_REF_LAYER_OFFSETS 335 336 } 337 391 338 widthBL = pcBasePic->getWidth (); 392 339 heightBL = pcBasePic->getHeight(); … … 394 341 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 395 342 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 396 #else397 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();398 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();399 400 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();401 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();402 #endif403 343 404 344 //========== UV component upsampling =========== … … 412 352 strideBL = pcBasePic->getCStride(); 413 353 strideEL = pcUsPic->getCStride(); 414 #if SCALED_REF_LAYER_OFFSETS 354 415 355 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 416 356 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); 417 357 Int topStartC = scalEL.getWindowTopOffset() >> 1; 418 358 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 419 #if BUGFIX_RESAMPLE420 359 leftOffset = leftStartC > 0 ? leftStartC : 0; 421 #endif422 #endif423 360 424 361 shiftX = 16; 425 362 shiftY = 16; 426 363 364 #if O0215_PHASE_ALIGNMENT 365 Int phaseXC = 0; 366 Int phaseYC = 1; 367 368 #if ROUNDING_OFFSET 369 addX = ( ( (phaseXC+phaseAlignFlag) * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 370 addY = ( ( (phaseYC+phaseAlignFlag) * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 371 #else 372 addX = ( ( ( widthBL * (phaseXC+phaseAlignFlag) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 373 addY = ( ( ( heightBL * (phaseYC+phaseAlignFlag) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 374 #endif 375 376 deltaX = 4 * (phaseXC+phaseAlignFlag); 377 deltaY = 4 * (phaseYC+phaseAlignFlag); 378 #else 427 379 phaseX = 0; 428 380 phaseY = 1; … … 438 390 deltaX = 4 * phaseX; 439 391 deltaY = 4 * phaseY; 392 #endif 440 393 441 394 shiftXM4 = shiftX - 4; … … 449 402 450 403 #if N0214_INTERMEDIATE_BUFFER_16BITS 404 #if O0194_JOINT_US_BITSHIFT 405 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 406 shift1 = g_bitDepthCLayer[refLayerId] - 8; 407 #else 451 408 shift1 = g_bitDepthC - 8; 409 #endif 452 410 #endif 453 411 … … 455 413 for( i = 0; i < widthEL; i++ ) 456 414 { 457 #if SCALED_REF_LAYER_OFFSETS458 415 Int x = Clip3(leftStartC, rightEndC - 1, i); 459 416 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 460 #else461 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;462 #endif463 417 phase = refPos16 & 15; 464 418 refPos = refPos16 >> 4; … … 494 448 495 449 #if N0214_INTERMEDIATE_BUFFER_16BITS 450 #if O0194_JOINT_US_BITSHIFT 451 nShift = 20 - g_bitDepthCLayer[refLayerId]; 452 #else 496 453 nShift = US_FILTER_PREC*2 - shift1; 497 iOffset = 1 << (nShift - 1); 498 #endif 499 500 #if SCALED_REF_LAYER_OFFSETS 454 #endif 455 iOffset = 1 << (nShift - 1); 456 #endif 457 501 458 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 502 #else 503 for( j = 0; j < heightEL; j++ ) 504 #endif 505 { 506 #if SCALED_REF_LAYER_OFFSETS 459 { 507 460 Int y = Clip3(topStartC, bottomEndC - 1, j); 508 461 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 509 #else510 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;511 #endif512 462 phase = refPos16 & 15; 513 refPos = refPos16 >> 4; 463 refPos = refPos16 >> 4; 514 464 coeff = m_chromaFilter[phase]; 515 465 516 466 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 517 467 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 518 #if SCALED_REF_LAYER_OFFSETS 519 #if BUGFIX_RESAMPLE 468 520 469 Pel* piDstU0 = piDstBufU + j*strideEL; 521 470 Pel* piDstV0 = piDstBufV + j*strideEL; … … 552 501 piDstV++; 553 502 } 554 #else 555 #if 1 // it should provide identical result 556 Pel* piDstU0 = piDstBufU + j*strideEL; 557 Pel* piDstV0 = piDstBufV + j*strideEL; 558 piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 ); 559 piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 ); 560 561 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 562 { 563 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 564 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 565 piSrcU++; 566 piSrcV++; 567 piDstU++; 568 piDstV++; 569 } 570 571 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 572 { 573 *piDstU = piDstU0[rightEndC-1]; 574 *piDstV = piDstV0[rightEndC-1]; 575 piDstU++; 576 piDstV++; 577 } 578 579 piDstU = piDstU0; 580 piDstV = piDstV0; 581 for( i = 0; i < leftStartC; i++ ) 582 { 583 *piDstU = piDstU0[leftStartC]; 584 *piDstV = piDstV0[leftStartC]; 585 piDstU++; 586 piDstV++; 587 } 588 #else 589 piDstU = piDstBufU + j*strideEL; 590 piDstV = piDstBufV + j*strideEL; 591 592 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 593 { 594 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 595 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 596 597 // Only increase the x position of reference upsample picture when within the window 598 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 599 if( (i >= leftStartC) && (i <= rightEndC-2) ) 600 { 601 piSrcU++; 602 piSrcV++; 603 } 604 605 piDstU++; 606 piDstV++; 607 } 608 #endif 609 #endif 610 #else 611 piDstU = piDstBufU + j*strideEL; 612 piDstV = piDstBufV + j*strideEL; 613 614 for( i = 0; i < widthEL; i++ ) 615 { 616 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 617 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 618 piSrcU++; 619 piSrcV++; 620 piDstU++; 621 piDstV++; 622 } 623 #endif 503 624 504 } 625 505 } -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r313 r494 43 43 ~TComUpsampleFilter(void); 44 44 45 #if SCALED_REF_LAYER_OFFSETS 45 #if O0215_PHASE_ALIGNMENT 46 #if O0194_JOINT_US_BITSHIFT 47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ); 48 #else 49 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag ); 50 #endif 51 #else 52 #if O0194_JOINT_US_BITSHIFT 53 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 54 #else 46 55 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 47 #else48 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );49 56 #endif 57 #endif 58 50 59 }; 51 60 -
trunk/source/Lib/TLibCommon/TypeDef.h
r442 r494 45 45 #define RANDOM_ACCESS_SEI_FIX 1 46 46 #if SVC_EXTENSION 47 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 48 49 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) 50 #if O0194_DIFFERENT_BITDEPTH_EL_BL 51 #define O0194_JOINT_US_BITSHIFT 1 ///< JCTVC-O0194: Joint Upsampling and bit-shift 52 #endif 53 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 54 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 47 55 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 48 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle49 56 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 50 57 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU. … … 52 59 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS 53 60 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 54 #define FINAL_RPL_CHANGE_N0082 1 ///< JCTVC-N0082: final ref picture list change (encoder) 55 #if FINAL_RPL_CHANGE_N0082 56 #define EXTERNAL_USEDBYCURR_N0082 1 ///< JCTVC-N0082: final ref picture list change (encoder) //dev ver. 57 #define TEMP_SCALABILITY_FIX 1 ///< fix for temporal scalability 58 #endif 61 59 62 #define IL_SL_SIGNALLING_N0371 0 ///< JCTVC-N0371: inter-layer scaling list 60 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< JCTVC-M0464: VUI flag to indicate tile boundary alignment61 63 #define M0463_VUI_EXT_ILP_REF 0 ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling 62 64 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure 63 #define SCALED_REF_LAYER_OFFSETS 1 ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS64 65 #define VERT_MV_CONSTRAINT 1 ///< Vertical MV component constraint flag 65 66 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth 67 #define LAYER_CTB 0 ///< enable layer-specific CTB structure 66 68 67 69 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header 70 #if ILP_SSH_SIG 71 #define ILP_SSH_SIG_FIX 1 ///< fix for SHM ticket #5 72 #endif 68 73 #define SPL_FLG_CHK 1 ///< JCTVC-N0195 proposal 5, JCTVC-N0085: constrain sum of lengths to be less than or equal to 6 69 74 #define ILP_NUM_REF_CHK 1 ///< JCTVC-N0195 proposal 1, JCTVC-N0081, JCTVC-N0154, JCTVC-N0217: a condition on signaling inter_layer_pred_layer_idc[ i ], to avoid sending when NumDirectRefLayers equals NumActiveRefLayerPics, and instead infer values … … 76 81 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 77 82 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 78 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< JCTVC-M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]79 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< JCTVC-M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id80 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< JCTVC-M0268: Signal profile information and output layer information as in Sec. 3 of M0268v281 #define SPS_SUB_LAYER_INFO 1 ///< JCTVC-M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 082 #define VPS_SPLIT_FLAG 1 ///< JCTVC-M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1.83 83 #define M0457_PREDICTION_INDICATIONS 1 84 84 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 … … 89 89 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 90 90 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI 91 #else92 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< VUI flag to indicate tile boundary alignment93 91 #endif //VPS_VUI 94 92 … … 96 94 97 95 #define VPS_EXTN_OFFSET 1 ///< implementation of vps_extension_offset syntax element 96 #define VPS_EXTN_OFFSET_CALC 1 ///< Calculation of VPS extension offset 98 97 #define SPS_PTL_FIX 1 ///< remove profile_tier_level from enhancement layer SPS 99 #define SH_DISCARDABLE_FLAG 1 ///< JCTVC-M0152: Use one reserved flag in the slice header for discardable flag100 98 101 99 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing … … 104 102 #define ROUNDING_OFFSET 1 ///< JCTVC-N0111: upsampling rounding offset using scalling factors 105 103 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits 106 #define ARBITRARY_SPATIAL_RATIO 0 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 107 #define BUGFIX_RESAMPLE 1 ///< JCTVC-N0055: resampling bug fix for positive left scalled offset 104 #define ARBITRARY_SPATIAL_RATIO 1 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 108 105 109 106 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) … … 126 123 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication 127 124 #if JCTVC_M0203_INTERLAYER_PRED_IDC 128 #define ILR_RESTR 1 ///< JCTVC-M0209: Inter-layer RPS and RPL129 #define ILR_RESTR_FIX 1 ///< Fix encoder crash when temporal layers are used with scalable coding130 125 #define EARLY_REF_PIC_MARKING 1 ///< Decoded picture marking of sub-layer non-reference pictures 131 126 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag 132 127 #define N0120_MAX_TID_REF_CFG 1 ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting) 128 #define O0225_MAX_TID_FOR_REF_LAYERS 1 133 129 #endif 134 130 #if REF_IDX_MFM … … 145 141 146 142 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers 143 #if N0147_IRAP_ALIGN_FLAG 144 #define O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS 1 ///< Remove IRAP align depedency constraints on poc_Reset_flag. 145 #define IRAP_ALIGN_FLAG_IN_VPS_VUI 1 ///< Move IRAP align flag to VPS VUI 146 #endif 147 147 #if !N0147_IRAP_ALIGN_FLAG 148 148 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers : As per JCTVC-N0373, IDR are not required to be aligned. … … 159 159 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1 160 160 #define N0065_LAYER_POC_ALIGNMENT 1 161 162 #define O0215_PHASE_ALIGNMENT 1 ///< JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned, 163 #define AUXILIARY_PICTURES 1 ///< JCTVC-O0041: auxiliary picture layers 164 165 #define O0062_POC_LSB_NOT_PRESENT_FLAG 1 ///< JCTVC-O0062: signal poc_lsb_not_present_flag for each layer in VPS extension 166 #define SHM_FIX7 1 ///< fix for SHVC WD ticket #7 167 161 168 #else 162 169 #define SYNTAX_OUTPUT 0 … … 469 476 CHROMA_422 = 2, 470 477 CHROMA_444 = 3 478 #if AUXILIARY_PICTURES 479 ,NUM_CHROMA_FORMAT = 4 480 #endif 471 481 }; 472 482
Note: See TracChangeset for help on using the changeset viewer.