Changeset 494 in SHVCSoftware for trunk/source/Lib
- Timestamp:
- 16 Nov 2013, 22:09:25 (11 years ago)
- Location:
- trunk
- Files:
-
- 46 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 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r442 r494 187 187 assert(uiCode <= 63); 188 188 pcPPS->setPPSId (uiCode); 189 189 190 190 READ_UVLC( uiCode, "pps_seq_parameter_set_id"); 191 191 assert(uiCode <= 15); 192 192 pcPPS->setSPSId (uiCode); 193 193 194 194 READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag" ); pcPPS->setDependentSliceSegmentsEnabledFlag ( uiCode == 1 ); 195 195 READ_FLAG( uiCode, "output_flag_present_flag" ); pcPPS->setOutputFlagPresentFlag( uiCode==1 ); … … 293 293 294 294 #if IL_SL_SIGNALLING_N0371 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 296 296 #endif 297 297 … … 301 301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() ); 302 302 303 if( pcPPS->getLayerId() > 0 ) 303 if( pcPPS->getLayerId() > 0 ) 304 304 { 305 305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false ); 306 306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 307 307 308 308 if( pcPPS->getPredScalingListFlag() ) 309 309 { … … 319 319 } 320 320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 322 322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 323 323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 324 324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 326 326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 327 327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); … … 450 450 { 451 451 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 452 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG453 if ( pcSPS->getLayerId() > 0 )454 {455 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );456 }457 #endif458 452 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 459 453 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); … … 542 536 } 543 537 544 #if S PS_SUB_LAYER_INFO538 #if SVC_EXTENSION 545 539 Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager) 546 540 #else … … 554 548 UInt uiCode; 555 549 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 556 #if S PS_SUB_LAYER_INFO550 #if SVC_EXTENSION 557 551 if(pcSPS->getLayerId() == 0) 558 552 { … … 560 554 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 561 555 assert(uiCode <= 6); 562 556 563 557 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 564 #if S PS_SUB_LAYER_INFO558 #if SVC_EXTENSION 565 559 } 566 560 else … … 569 563 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 570 564 } 571 #endif572 565 #if IL_SL_SIGNALLING_N0371 573 566 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) ); 574 567 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 575 568 #endif 569 #endif 576 570 if ( pcSPS->getMaxTLayers() == 1 ) 577 571 { 578 572 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 579 #if S PS_SUB_LAYER_INFO573 #if SVC_EXTENSION 580 574 assert( pcSPS->getTemporalIdNestingFlag() == true ); 581 575 #else … … 598 592 if( pcSPS->getLayerId() > 0 ) 599 593 { 600 READ_FLAG( uiCode, "update_rep_format_flag" ); 594 READ_FLAG( uiCode, "update_rep_format_flag" ); 601 595 pcSPS->setUpdateRepFormatFlag( uiCode ? true : false ); 602 596 } … … 605 599 pcSPS->setUpdateRepFormatFlag( true ); 606 600 } 607 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 608 { 609 #endif 601 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 602 { 603 #endif 604 #if AUXILIARY_PICTURES 605 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) ); 606 #else 610 607 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 608 #endif 611 609 assert(uiCode <= 3); 612 610 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream … … 639 637 } 640 638 #if REPN_FORMAT_IN_VPS 641 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 639 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 642 640 { 643 641 #endif … … 659 657 UInt subLayerOrderingInfoPresentFlag; 660 658 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 661 659 662 660 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 663 661 { … … 728 726 } 729 727 730 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 728 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 731 729 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 732 730 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 733 731 734 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 732 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 735 733 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 736 734 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); … … 841 839 assert( uiCode == 0 ); 842 840 #endif 843 #if SCALED_REF_LAYER_OFFSETS844 841 if( pcSPS->getLayerId() > 0 ) 845 842 { 846 Int iCode; 843 Int iCode; 847 844 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode); 848 845 for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++) … … 855 852 } 856 853 } 857 #endif858 854 #if M0463_VUI_EXT_ILP_REF 859 855 //// sps_extension_vui_parameters( ) 860 856 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 861 { 862 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 863 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 864 { 865 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 866 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 867 { 868 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 869 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 870 { 871 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 872 } 873 } 874 } 875 } 857 { 858 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 859 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 860 { 861 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 862 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 863 { 864 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 865 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 866 { 867 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 868 } 869 } 870 } 871 } 876 872 //// sps_extension_vui_parameters( ) END 877 873 #endif … … 1000 996 } 1001 997 998 #if SVC_EXTENSION 1002 999 #if VPS_EXTNS 1003 1000 Void TDecCavlc::parseVPSExtension(TComVPS *vps) … … 1018 1015 vps->setNumScalabilityTypes(numScalabilityTypes); 1019 1016 1020 #if VPS_SPLIT_FLAG1021 1017 for(j = 0; j < numScalabilityTypes - vps->getSplittingFlag(); j++) 1022 #else1023 for(j = 0; j < numScalabilityTypes; j++)1024 #endif1025 1018 { 1026 1019 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1); 1027 1020 } 1028 #if VPS_SPLIT_FLAG 1021 1029 1022 if(vps->getSplittingFlag()) 1030 1023 { … … 1038 1031 numBits = 6; 1039 1032 } 1040 #else1041 if(vps->getSplittingFlag())1042 {1043 UInt numBits = 0;1044 for(j = 0; j < numScalabilityTypes; j++)1045 {1046 numBits += vps->getDimensionIdLen(j);1047 }1048 assert( numBits <= 6 );1049 }1050 #endif1051 1033 1052 1034 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false); … … 1066 1048 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 1067 1049 1068 #if VPS_SPLIT_FLAG 1069 if(!vps->getSplittingFlag()) 1070 #endif 1050 if( !vps->getSplittingFlag() ) 1051 { 1071 1052 for(j = 0; j < numScalabilityTypes; j++) 1072 1053 { 1073 1054 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode); 1055 #if !AUXILIARY_PICTURES 1074 1056 assert( uiCode <= vps->getMaxLayerId() ); 1075 } 1076 } 1077 #endif 1078 #if VIEW_ID_RELATED_SIGNALING 1079 // if ( pcVPS->getNumViews() > 1 ) 1080 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1057 #endif 1058 } 1059 } 1060 } 1061 #endif 1062 #if VIEW_ID_RELATED_SIGNALING 1063 // if ( pcVPS->getNumViews() > 1 ) 1064 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1081 1065 { 1082 1066 READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode ); … … 1088 1072 } 1089 1073 #endif 1090 #if VPS_MOVE_DIR_DEPENDENCY_FLAG1091 1074 #if VPS_EXTN_DIRECT_REF_LAYERS 1092 1075 // For layer 0 … … 1108 1091 } 1109 1092 #endif 1110 #endif1111 1093 #if JCTVC_M0203_INTERLAYER_PRED_IDC 1112 1094 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 1116 1098 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1117 1099 { 1100 #if O0225_MAX_TID_FOR_REF_LAYERS 1101 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 1102 { 1103 if(vps->getDirectDependencyFlag(j, i)) 1104 { 1105 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i][j]" ); vps->setMaxTidIlRefPicsPlus1(i, j, uiCode); 1106 assert( uiCode <= vps->getMaxTLayers()); 1107 } 1108 } 1109 #else 1118 1110 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1119 1111 #if N0120_MAX_TID_REF_CFG 1120 1112 assert( uiCode <= vps->getMaxTLayers()); 1121 #else 1113 #else 1122 1114 assert( uiCode <= vps->getMaxTLayers()+ 1 ); 1115 #endif 1123 1116 #endif 1124 1117 } 1125 1118 } 1126 else 1119 else 1127 1120 { 1128 1121 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1129 1122 { 1123 #if O0225_MAX_TID_FOR_REF_LAYERS 1124 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 1125 { 1126 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1127 } 1128 #else 1130 1129 vps->setMaxTidIlRefPicsPlus1(i, 7); 1130 #endif 1131 1131 } 1132 1132 } … … 1134 1134 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1135 1135 { 1136 #if O0225_MAX_TID_FOR_REF_LAYERS 1137 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 1138 { 1139 if(vps->getDirectDependencyFlag(j, i)) 1140 { 1141 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i][j]" ); vps->setMaxTidIlRefPicsPlus1(i, j, uiCode); 1142 assert( uiCode <= vps->getMaxTLayers() ); 1143 } 1144 } 1145 #else 1136 1146 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1137 1147 assert( uiCode <= vps->getMaxTLayers() ); 1148 #endif 1138 1149 } 1139 1150 #endif … … 1144 1155 #if VPS_EXTN_PROFILE_INFO 1145 1156 // Profile-tier-level signalling 1146 #if VPS_PROFILE_OUTPUT_LAYERS1147 1157 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); assert( uiCode == (vps->getNumLayerSets() - 1) ); 1148 1158 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 ); 1149 1159 vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel()); 1150 1160 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 1151 #else1152 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets());1153 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)1154 #endif1155 1161 { 1156 1162 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false); 1157 1163 if( !vps->getProfilePresentFlag(idx) ) 1158 1164 { 1159 #if VPS_PROFILE_OUTPUT_LAYERS1160 1165 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1); 1161 #else1162 READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);1163 #endif1164 1166 assert( vps->getProfileLayerSetRef(idx) < idx ); 1167 1165 1168 // Copy profile information as indicated 1166 1169 vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) ); … … 1170 1173 #endif 1171 1174 1172 #if VPS_PROFILE_OUTPUT_LAYERS1173 1175 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false ); 1174 1176 Int numOutputLayerSets = 0; … … 1231 1233 READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode); 1232 1234 } 1233 #else 1234 #if VPS_EXTN_OP_LAYER_SETS 1235 // Target output layer signalling 1236 READ_UVLC( uiCode, "vps_num_output_layer_sets"); vps->setNumOutputLayerSets(uiCode); 1237 for(i = 0; i < vps->getNumOutputLayerSets(); i++) 1238 { 1239 #if VPS_OUTPUT_LAYER_SET_IDX 1240 READ_UVLC( uiCode, "vps_output_layer_set_idx_minus1[i]"); vps->setOutputLayerSetIdx(i, uiCode + 1); 1241 #else 1242 READ_UVLC( uiCode, "vps_output_layer_set_idx[i]"); vps->setOutputLayerSetIdx(i, uiCode); 1243 #endif 1244 Int lsIdx = vps->getOutputLayerSetIdx(i); 1245 for(j = 0; j <= vps->getMaxLayerId(); j++) 1246 { 1247 if(vps->getLayerIdIncludedFlag(lsIdx, j)) 1248 { 1249 READ_FLAG( uiCode, "vps_output_layer_flag[lsIdx][j]"); vps->setOutputLayerFlag(lsIdx, j, uiCode); 1250 } 1251 } 1252 } 1253 #endif 1254 #endif 1235 1255 1236 #if REPN_FORMAT_IN_VPS 1256 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1237 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1257 1238 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1258 1239 … … 1273 1254 parseRepFormat( vps->getVpsRepFormat(i) ); 1274 1255 } 1275 1256 1276 1257 // Default assignment for layer 0 1277 1258 vps->setVpsRepFormatIdx( 0, 0 ); … … 1305 1286 vps->setMaxOneActiveRefLayerFlag(uiCode); 1306 1287 #endif 1307 1308 #if N0147_IRAP_ALIGN_FLAG 1288 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1289 for(i = 1; i< vps->getMaxLayers(); i++) 1290 { 1291 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1292 { 1293 READ_FLAG(uiCode, "poc_lsb_not_present_flag[i]"); 1294 vps->setPocLsbNotPresentFlag(i, uiCode); 1295 } 1296 } 1297 #endif 1298 #if O0215_PHASE_ALIGNMENT 1299 READ_FLAG( uiCode, "cross_layer_phase_alignment_flag"); vps->setPhaseAlignFlag( uiCode == 1 ? true : false ); 1300 #endif 1301 1302 #if N0147_IRAP_ALIGN_FLAG && !IRAP_ALIGN_FLAG_IN_VPS_VUI 1309 1303 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1310 1304 vps->setCrossLayerIrapAlignFlag(uiCode); 1311 #endif 1312 1313 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG 1314 #if VPS_EXTN_DIRECT_REF_LAYERS 1315 // For layer 0 1316 vps->setNumDirectRefLayers(0, 0); 1317 // For other layers 1318 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1319 { 1320 UInt numDirectRefLayers = 0; 1321 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1322 { 1323 READ_FLAG(uiCode, "direct_dependency_flag[i][j]" ); vps->setDirectDependencyFlag(layerCtr, refLayerCtr, uiCode? true : false); 1324 if(uiCode) 1325 { 1326 vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr); 1327 numDirectRefLayers++; 1328 } 1329 } 1330 vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers); 1331 } 1332 #endif 1333 #endif 1305 #endif 1306 1334 1307 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1335 1308 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); … … 1351 1324 { 1352 1325 for(j = 0; j < i; j++) 1353 { 1326 { 1354 1327 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1355 1328 } … … 1370 1343 } 1371 1344 parseVPSVUI(vps); 1372 #endif 1345 #endif 1373 1346 } 1374 1347 } … … 1378 1351 { 1379 1352 UInt uiCode; 1353 #if AUXILIARY_PICTURES 1354 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1355 #else 1380 1356 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1357 #endif 1381 1358 1382 1359 if( repFormat->getChromaFormatVpsIdc() == 3 ) … … 1387 1364 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1388 1365 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1389 1366 1390 1367 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1391 1368 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); … … 1398 1375 UInt i,j; 1399 1376 UInt uiCode; 1377 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1378 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1379 vps->setCrossLayerIrapAlignFlag(uiCode); 1380 #endif 1400 1381 #if VPS_VUI_BITRATE_PICRATE 1401 1382 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); vps->setBitRatePresentVpsFlag( uiCode ? true : false ); … … 1453 1434 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1454 1435 { 1455 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1456 } 1457 } 1458 #endif 1436 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1437 } 1438 } 1439 #endif 1459 1440 #if N0160_VUI_EXT_ILP_REF 1460 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1441 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1461 1442 if( vps->getNumIlpRestrictedRefLayers()) 1462 1443 { … … 1465 1446 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1466 1447 { 1467 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1468 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1469 { 1470 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1471 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1448 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1449 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1450 { 1451 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1452 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1472 1453 { 1473 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1454 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1474 1455 } 1475 } 1476 } 1477 } 1478 } 1479 #endif 1480 } 1481 #endif 1456 } 1457 } 1458 } 1459 } 1460 #endif 1461 } 1462 #endif 1463 #endif //SVC_EXTENSION 1464 1482 1465 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) 1483 1466 { … … 1552 1535 if(!rpcSlice->getDependentSliceSegmentFlag()) 1553 1536 { 1537 #if SVC_EXTENSION 1554 1538 #if POC_RESET_FLAG 1555 Int iBits = 0; 1539 Int iBits = 0; 1556 1540 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1557 1541 { … … 1569 1553 } 1570 1554 #else 1571 #if SH_DISCARDABLE_FLAG1572 1555 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1573 1556 { … … 1578 1561 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1579 1562 } 1580 #else 1563 #endif 1564 #else //SVC_EXTENSION 1581 1565 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1582 1566 { 1583 1567 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1584 1568 } 1585 #endif 1586 #endif 1569 #endif //SVC_EXTENSION 1587 1570 1588 1571 READ_UVLC ( uiCode, "slice_type" ); rpcSlice->setSliceType((SliceType)uiCode); … … 1611 1594 } 1612 1595 #if N0065_LAYER_POC_ALIGNMENT 1596 #if SHM_FIX7 1597 Int iPOClsb = 0; 1598 #endif 1599 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1600 if( ( rpcSlice->getLayerId() > 0 && !rpcSlice->getVPS()->getPocLsbNotPresentFlag( rpcSlice->getVPS()->getLayerIdInVps(rpcSlice->getLayerId())) ) || !rpcSlice->getIdrPicFlag()) 1601 #else 1613 1602 if( rpcSlice->getLayerId() > 0 || !rpcSlice->getIdrPicFlag() ) 1603 #endif 1614 1604 #else 1615 1605 else … … 1617 1607 { 1618 1608 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1609 #if SHM_FIX7 1610 iPOClsb = uiCode; 1611 #else 1619 1612 Int iPOClsb = uiCode; 1613 #endif 1620 1614 Int iPrevPOC = rpcSlice->getPrevTid0POC(); 1621 1615 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); … … 1645 1639 1646 1640 #if N0065_LAYER_POC_ALIGNMENT 1641 #if SHM_FIX7 1642 } 1643 #endif 1647 1644 if( !rpcSlice->getIdrPicFlag() ) 1648 1645 { … … 1737 1734 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1738 1735 - iPOClsb + pocLsbLt; 1736 1739 1737 rps->setPOC (j, pocLTCurr); 1740 1738 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLTCurr); … … 1746 1744 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1747 1745 rps->setCheckLTMSBPresent(j,false); 1748 1746 1749 1747 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 1750 1748 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) … … 1779 1777 rpcSlice->setEnableTMVPFlag(false); 1780 1778 } 1781 #if N0065_LAYER_POC_ALIGNMENT 1779 #if N0065_LAYER_POC_ALIGNMENT && !SHM_FIX7 1782 1780 } 1783 1781 #endif … … 1788 1786 rpcSlice->setActiveNumILRRefIdx(0); 1789 1787 #if ILP_SSH_SIG 1788 #if ILP_SSH_SIG_FIX 1789 if((sps->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) ) 1790 #else 1790 1791 if((sps->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) ) 1792 #endif 1791 1793 #else 1792 1794 if((sps->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) ) … … 1841 1843 } 1842 1844 #if ILP_SSH_SIG 1845 #if ILP_SSH_SIG_FIX 1846 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true ) 1847 #else 1843 1848 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false ) 1849 #endif 1844 1850 { 1845 1851 rpcSlice->setInterLayerPredEnabledFlag(true); … … 1870 1876 { 1871 1877 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 1878 #if AUXILIARY_PICTURES 1879 ChromaFormat format; 1880 #if REPN_FORMAT_IN_VPS 1881 if( ( sps->getLayerId() == 0 ) || sps->getUpdateRepFormatFlag() ) 1882 { 1883 format = sps->getChromaFormatIdc(); 1884 } 1885 else 1886 { 1887 format = rpcSlice->getVPS()->getVpsRepFormat( rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 1888 } 1889 #else 1890 format = sps->getChromaFormatIdc(); 1891 #endif 1892 if (format != CHROMA_400) 1893 { 1894 #endif 1872 1895 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 1896 #if AUXILIARY_PICTURES 1897 } 1898 else 1899 { 1900 rpcSlice->setSaoEnabledFlagChroma(false); 1901 } 1902 #endif 1873 1903 } 1874 1904 … … 2069 2099 2070 2100 #if REPN_FORMAT_IN_VPS 2101 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2102 g_bitDepthYLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthY(); 2103 g_bitDepthCLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthC(); 2104 #endif 2071 2105 assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() ); 2072 2106 #else … … 2179 2213 { 2180 2214 Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation(); 2181 2215 2182 2216 // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header 2183 2217 for ( UInt curByteIdx = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ ) … … 2465 2499 SliceType eSliceType = pcSlice->getSliceType(); 2466 2500 Int iNbRef = (eSliceType == B_SLICE ) ? (2) : (1); 2501 #if SVC_EXTENSION 2502 UInt uiLog2WeightDenomLuma = 0, uiLog2WeightDenomChroma = 0; 2503 #else 2467 2504 UInt uiLog2WeightDenomLuma, uiLog2WeightDenomChroma; 2505 #endif 2468 2506 UInt uiTotalSignalledWeightFlags = 0; 2469 2507 2470 2508 Int iDeltaDenom; 2509 #if AUXILIARY_PICTURES 2510 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 2511 { 2512 bChroma = false; 2513 } 2514 #endif 2471 2515 // decode delta_luma_log2_weight_denom : 2472 2516 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom … … 2488 2532 2489 2533 wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma; 2534 #if AUXILIARY_PICTURES 2535 if (!bChroma) 2536 { 2537 wp[1].uiLog2WeightDenom = 0; 2538 wp[2].uiLog2WeightDenom = 0; 2539 } 2540 else 2541 { 2542 #endif 2490 2543 wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2491 2544 wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2545 #if AUXILIARY_PICTURES 2546 } 2547 #endif 2492 2548 2493 2549 UInt uiCode; … … 2585 2641 #if IL_SL_SIGNALLING_N0371 2586 2642 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2587 { 2643 { 2588 2644 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2589 2645 scalingListPredModeFlag = (code) ? true : false; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r442 r494 72 72 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 73 73 Void parseVPS ( TComVPS* pcVPS ); 74 #if SPS_EXTENSION 74 75 #if VPS_EXTNS 75 76 Void parseVPSExtension ( TComVPS* pcVPS ); … … 82 83 Void parseRepFormat ( RepFormat *repFormat ); 83 84 #endif 84 #if SPS_SUB_LAYER_INFO85 85 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); 86 #else 86 Void parseSPSExtension ( TComSPS* pcSPS ); 87 #else //SVC_EXTENSION 87 88 Void parseSPS ( TComSPS* pcSPS ); 88 #endif 89 #if SPS_EXTENSION 90 Void parseSPSExtension ( TComSPS* pcSPS ); 91 #endif 89 #endif //SVC_EXTENSION 92 90 Void parsePPS ( TComPPS* pcPPS); 93 91 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r442 r494 616 616 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 617 617 } 618 #if O0194_DIFFERENT_BITDEPTH_EL_BL 619 // Bug-fix 620 #if REPN_FORMAT_IN_VPS 621 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 622 #else 618 623 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 624 #endif 625 #else 626 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 627 #endif 619 628 620 629 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; … … 768 777 // Cb and Cr 769 778 Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 779 #if O0194_DIFFERENT_BITDEPTH_EL_BL 780 // Bug-fix 781 #if REPN_FORMAT_IN_VPS 782 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 783 #else 770 784 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 785 #endif 786 #else 787 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 788 #endif 771 789 772 790 uiWidth >>= 1; … … 776 794 777 795 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 796 #if O0194_DIFFERENT_BITDEPTH_EL_BL 797 // Bug-fix 798 #if REPN_FORMAT_IN_VPS 799 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 800 #else 778 801 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 802 #endif 803 #else 804 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 805 #endif 779 806 780 807 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r345 r494 66 66 67 67 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 68 #if S PS_SUB_LAYER_INFO68 #if SVC_EXTENSION 69 69 virtual Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) = 0; 70 70 #else … … 134 134 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 135 135 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 136 #if S PS_SUB_LAYER_INFO136 #if SVC_EXTENSION 137 137 Void decodeSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager); } 138 138 #else -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r442 r494 356 356 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 357 357 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 358 #if AUXILIARY_PICTURES 359 ChromaFormat format = pcCU->getSlice()->getChromaFormatIdc(); 360 UInt uiGrayVal = 1 << (uiSampleBits - 1); 361 #endif 358 362 359 363 for(uiY = 0; uiY < uiHeight; uiY++) … … 362 366 { 363 367 UInt uiSample; 368 #if AUXILIARY_PICTURES 369 if (format == CHROMA_400) 370 uiSample = uiGrayVal; 371 else 372 #endif 364 373 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 365 374 piPCMSample[uiX] = uiSample; … … 378 387 { 379 388 UInt uiSample; 389 #if AUXILIARY_PICTURES 390 if (format == CHROMA_400) 391 uiSample = uiGrayVal; 392 else 393 #endif 380 394 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 381 395 piPCMSample[uiX] = uiSample; … … 665 679 UInt uiSymbol; 666 680 681 #if AUXILIARY_PICTURES 682 if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 ) 683 { 684 uiSymbol = DC_IDX; 685 } 686 else 687 { 688 #endif 667 689 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUChromaPredSCModel.get( 0, 0, 0 ) ); 668 690 … … 681 703 } 682 704 } 705 #if AUXILIARY_PICTURES 706 } 707 #endif 683 708 pcCU->setChromIntraDirSubParts( uiSymbol, uiAbsPartIdx, uiDepth ); 684 709 return; … … 885 910 UInt uiSymbol; 886 911 const UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth ); 912 #if AUXILIARY_PICTURES 913 if (pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 && (eType == TEXT_CHROMA_U || eType == TEXT_CHROMA_V)) 914 { 915 uiSymbol = 0; 916 } 917 else 918 { 919 #endif 887 920 m_pcTDecBinIf->decodeBin( uiSymbol , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA: eType, uiCtx ) ); 921 #if AUXILIARY_PICTURES 922 } 923 #endif 888 924 889 925 DTRACE_CABAC_VL( g_nSymbolCounter++ ) -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r345 r494 76 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 77 77 Void parseVPS ( TComVPS* /*pcVPS*/ ) {} 78 #if S PS_SUB_LAYER_INFO78 #if SVC_EXTENSION 79 79 Void parseSPS ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {} 80 80 #else -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r442 r494 179 179 180 180 m_cIlpPic[j] = new TComPic; 181 #if AUXILIARY_PICTURES 182 #if REPN_FORMAT_IN_VPS 183 #if SVC_UPSAMPLING 184 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 185 #else 186 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 187 #endif 188 #else 189 #if SVC_UPSAMPLING 190 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 191 #else 192 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 193 #endif 194 #endif 195 #else 181 196 #if REPN_FORMAT_IN_VPS 182 197 #if SVC_UPSAMPLING … … 190 205 #else 191 206 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 207 #endif 192 208 #endif 193 209 #endif … … 196 212 m_cIlpPic[j]->getPicSym()->getCU(i)->initCU(m_cIlpPic[j], i); 197 213 } 198 }199 }200 }201 }202 203 204 205 Void TDecTop::setILRPic(TComPic *pcPic)206 {207 for( Int i = 0; i < pcPic->getSlice(0)->getActiveNumILRRefIdx(); i++ )208 {209 Int refLayerIdc = pcPic->getSlice(0)->getInterLayerPredLayerIdc(i);210 211 if(m_cIlpPic[refLayerIdc])212 {213 m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(refLayerIdc), m_cIlpPic[refLayerIdc]->getPicYuvRec());214 m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC());215 m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(refLayerIdc)->getLayerId()); //set reference layerId216 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false);217 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder();218 for (Int j=0; j<m_cIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId219 {220 m_cIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId(m_cIlpPic[refLayerIdc]->getLayerId());221 214 } 222 215 } … … 310 303 #endif 311 304 } 312 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS313 #if SCALABILITY_MASK_E0104314 if(pcSlice->getVPS()->getScalabilityMask(2))315 #else316 if(pcSlice->getVPS()->getScalabilityMask(1))317 #endif318 {319 pcSlice->setPic(rpcPic);320 }321 #endif322 305 } 323 306 } 324 307 #endif 325 308 309 #if AUXILIARY_PICTURES 310 #if REPN_FORMAT_IN_VPS 311 #if SVC_UPSAMPLING 312 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 313 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 314 #else 315 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 316 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 317 #endif 318 #else 319 #if SVC_UPSAMPLING 320 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 321 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 322 #else 323 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 324 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 325 #endif 326 #endif 327 #else 326 328 #if REPN_FORMAT_IN_VPS 327 329 #if SVC_UPSAMPLING … … 341 343 #endif 342 344 #endif 345 #endif 343 346 344 347 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); … … 381 384 rpcPic->destroy(); 382 385 386 #if AUXILIARY_PICTURES 387 #if REPN_FORMAT_IN_VPS 388 #if SVC_UPSAMPLING 389 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 390 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 391 392 #else 393 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 394 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 395 #endif 396 #else 397 #if SVC_UPSAMPLING 398 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 399 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 400 401 #else 402 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 403 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 404 #endif 405 #endif 406 #else 383 407 #if REPN_FORMAT_IN_VPS 384 408 #if SVC_UPSAMPLING … … 398 422 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 399 423 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 424 #endif 400 425 #endif 401 426 #endif … … 473 498 474 499 Int remainingInterLayerReferencesFlag = 0; 500 #if O0225_MAX_TID_FOR_REF_LAYERS 501 for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 502 { 503 Int jLidx = pcSlice->getVPS()->getLayerIdInVps(targetDecLayerIdList[j]); 504 if ( currTid <= pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(latestDecLayerId,jLidx) - 1 ) 505 { 506 #else 475 507 if ( currTid <= pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(latestDecLayerId) - 1 ) 476 508 { 477 509 for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 478 510 { 511 #endif 479 512 for ( Int k = 0; k < m_ppcTDecTop[targetDecLayerIdList[j]]->getNumDirectRefLayers(); k++ ) 480 513 { … … 684 717 685 718 #if SVC_EXTENSION 719 m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above 686 720 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 687 721 setRefLayerParams(m_apcSlicePilot->getVPS()); … … 754 788 // actual decoding starts here 755 789 xActivateParameterSets(); 756 #if 0 // N0147_IRAP_ALIGN_FLAG Disabled for now! 790 #if !O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS 791 //Note setting O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS to 0 may cause decoder to crash. 757 792 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 758 793 if(!m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) … … 1098 1133 pcPic->setLayerId(nalu.m_layerId); 1099 1134 pcSlice->setLayerId(nalu.m_layerId); 1135 pcSlice->setPic(pcPic); 1100 1136 #endif 1101 1137 … … 1113 1149 #endif 1114 1150 1115 #if SVC_EXTENSION 1116 if(m_layerId > 0) 1151 #if SVC_EXTENSION 1152 // Create upsampling reference layer pictures for all possible dependent layers and do it only once for the first slice. 1153 // Other slices might choose which reference pictures to be used for inter-layer prediction 1154 if( m_layerId > 0 && m_uiSliceIdx == 0 ) 1155 { 1156 for( i = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1157 { 1158 UInt refLayerIdc = i; 1159 #if AVC_BASE 1160 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() ) 1161 { 1162 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); 1163 #if AVC_SYNTAX 1164 TComPic* pBLPic = pcSlice->getBaseColPic(refLayerIdc); 1165 if( pcSlice->getPOC() == 0 ) 1166 { 1167 // initialize partition order. 1168 UInt* piTmp = &g_auiZscanToRaster[0]; 1169 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 1170 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 1171 } 1172 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice ); 1173 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 1174 #endif 1175 } 1176 else 1177 { 1178 #if VPS_EXTN_DIRECT_REF_LAYERS 1179 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 1180 #else 1181 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 1182 #endif 1183 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 1184 pcSlice->setBaseColPic ( *cListPic, refLayerIdc ); 1185 } 1186 #else 1187 #if VPS_EXTN_DIRECT_REF_LAYERS 1188 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 1189 #else 1190 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 1191 #endif 1192 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 1193 pcSlice->setBaseColPic ( *cListPic, refLayerIdc ); 1194 #endif 1195 1196 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1197 1198 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 1199 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 1200 1201 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1202 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 1203 1204 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 1205 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 1206 1207 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 1208 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1209 1210 #if SVC_UPSAMPLING 1211 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1212 { 1213 #if O0215_PHASE_ALIGNMENT 1214 #if O0194_JOINT_US_BITSHIFT 1215 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1216 #else 1217 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1218 #endif 1219 #else 1220 #if O0194_JOINT_US_BITSHIFT 1221 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) ); 1222 #else 1223 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) ); 1224 #endif 1225 #endif 1226 } 1227 else 1228 { 1229 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() ); 1230 } 1231 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1232 #endif 1233 } 1234 } 1235 1236 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1117 1237 { 1118 1238 for( i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) … … 1156 1276 #endif 1157 1277 1158 #if SCALED_REF_LAYER_OFFSETS1159 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);1160 1161 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();1162 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight();1163 1164 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();1165 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset();1166 #else1167 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();1168 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();1169 1170 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();1171 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();1172 1173 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();1174 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();1175 #endif1176 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL);1177 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);1178 1179 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL;1180 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;1181 1182 #if SVC_UPSAMPLING1183 if( pcPic->isSpatialEnhLayer(refLayerIdc) )1184 {1185 #if SCALED_REF_LAYER_OFFSETS1186 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );1187 #else1188 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() );1189 #endif1190 }1191 else1192 {1193 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() );1194 }1195 1278 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1196 #endif 1197 } 1198 } 1199 1200 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1201 { 1202 setILRPic(pcPic); 1279 } 1280 1281 pcSlice->setILRPic( m_cIlpPic ); 1282 1203 1283 #if REF_IDX_MFM 1204 1284 #if M0457_COL_PICTURE_SIGNALING … … 1221 1301 } 1222 1302 #endif 1223 #endif 1224 1225 #endif //SVC_EXTENSION 1226 1303 #if MFM_ENCCONSTRAINT 1304 if( pcSlice->getMFMEnabledFlag() ) 1305 { 1306 Int refLayerId = pcSlice->getRefPic( pcSlice->getSliceType() == B_SLICE ? ( RefPicList )( 1 - pcSlice->getColFromL0Flag() ) : REF_PIC_LIST_0 , pcSlice->getColRefIdx() )->getLayerId(); 1307 if( refLayerId != pcSlice->getLayerId() ) 1308 { 1309 TComPic* pColBasePic = pcSlice->getBaseColPic( *m_ppcTDecTop[refLayerId]->getListPic() ); 1310 assert( pColBasePic->checkSameRefInfo() == true ); 1311 } 1312 } 1313 #endif 1314 #endif 1315 1227 1316 #if N0147_IRAP_ALIGN_FLAG 1228 1317 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) … … 1239 1328 } 1240 1329 #endif 1330 #endif //SVC_EXTENSION 1241 1331 1242 1332 // For generalized B … … 1347 1437 #if SVC_EXTENSION 1348 1438 sps->setLayerId(m_layerId); 1349 #endif1350 1351 #if SPS_SUB_LAYER_INFO1352 1439 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] ); 1353 #else1354 m_cEntropyDecoder.decodeSPS( sps );1355 #endif1356 #if SVC_EXTENSION1357 1440 m_parameterSetManagerDecoder[m_layerId].storePrefetchedSPS(sps); 1358 #else1359 m_parameterSetManagerDecoder.storePrefetchedSPS(sps);1360 #endif1361 #if SVC_EXTENSION1362 1441 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1363 1442 if(m_numLayer>0) … … 1366 1445 } 1367 1446 #endif 1368 #endif 1447 #else //SVC_EXTENSION 1448 m_cEntropyDecoder.decodeSPS( sps ); 1449 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1450 #endif //SVC_EXTENSION 1369 1451 } 1370 1452 … … 1519 1601 Window &conformanceWindow = sps->getConformanceWindow(); 1520 1602 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window(); 1603 #if AUXILIARY_PICTURES 1521 1604 #if SVC_UPSAMPLING 1522 1605 #if AVC_SYNTAX 1523 1606 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1607 #else 1608 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 1609 #endif 1610 #else 1611 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1612 #endif 1613 #else 1614 #if SVC_UPSAMPLING 1615 #if AVC_SYNTAX 1524 1616 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1525 1617 #else … … 1528 1620 #else 1529 1621 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1622 #endif 1623 #endif 1624 1625 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1626 // set AVC BL bit depth, can be an input parameter from the command line 1627 g_bitDepthYLayer[0] = 8; 1628 g_bitDepthCLayer[0] = 8; 1530 1629 #endif 1531 1630 } -
trunk/source/Lib/TLibDecoder/TDecTop.h
r442 r494 213 213 Void xInitILRP(TComSPS *pcSPS); 214 214 #endif 215 Void setILRPic(TComPic *pcPic);216 215 #endif 217 216 #if AVC_SYNTAX || SYNTAX_OUTPUT -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r442 r494 359 359 { 360 360 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG362 if ( pcSPS->getLayerId() > 0 )363 {364 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );365 }366 #endif367 361 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 368 362 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 454 448 #endif 455 449 WRITE_CODE( pcSPS->getVPSId (), 4, "sps_video_parameter_set_id" ); 456 #if S PS_SUB_LAYER_INFO450 #if SVC_EXTENSION 457 451 if(pcSPS->getLayerId() == 0) 458 452 { … … 460 454 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1" ); 461 455 WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "sps_temporal_id_nesting_flag" ); 462 #if S PS_SUB_LAYER_INFO456 #if SVC_EXTENSION 463 457 } 464 458 #endif … … 670 664 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 671 665 #endif 672 #if SCALED_REF_LAYER_OFFSETS673 666 if( pcSPS->getLayerId() > 0 ) 674 667 { … … 683 676 } 684 677 } 685 #endif686 678 #if M0463_VUI_EXT_ILP_REF 687 679 //// sps_extension_vui_parameters( ) … … 708 700 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 709 701 { 702 #if VPS_EXTN_OFFSET_CALC 703 UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits(); 704 #endif 710 705 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 711 706 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); … … 811 806 WRITE_FLAG(1, "vps_extension_alignment_bit_equal_to_one"); 812 807 } 808 #if VPS_EXTN_OFFSET_CALC 809 Int vpsExntOffsetValueInBits = this->m_pcBitIf->getNumberOfWrittenBits() - numBytesInVps + 16; // 2 bytes for NUH 810 assert( vpsExntOffsetValueInBits % 8 == 0 ); 811 pcVPS->setExtensionOffset( vpsExntOffsetValueInBits >> 3 ); 812 #endif 813 813 codeVPSExtension(pcVPS); 814 814 WRITE_FLAG( 0, "vps_extension2_flag" ); // Flag value of 1 reserved … … 820 820 } 821 821 822 #if SVC_EXTENSION 822 823 #if VPS_EXTNS 823 824 Void TEncCavlc::codeVPSExtension (TComVPS *vps) … … 835 836 } 836 837 837 #if VPS_SPLIT_FLAG838 838 for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++) 839 #else840 for(j = 0; j < vps->getNumScalabilityTypes(); j++)841 #endif842 839 { 843 840 WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3, "dimension_id_len_minus1[j]" ); … … 863 860 WRITE_CODE( vps->getLayerIdInNuh(i), 6, "layer_id_in_nuh[i]" ); 864 861 } 865 #if VPS_SPLIT_FLAG 866 if( !vps->getSplittingFlag())867 #endif 862 863 if( !vps->getSplittingFlag() ) 864 { 868 865 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 869 866 { … … 871 868 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 872 869 } 870 } 873 871 } 874 872 #endif … … 885 883 } 886 884 #endif 887 #if VPS_MOVE_DIR_DEPENDENCY_FLAG888 885 #if VPS_EXTN_DIRECT_REF_LAYERS 889 886 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 894 891 } 895 892 } 896 #endif897 893 #endif 898 894 #if JCTVC_M0203_INTERLAYER_PRED_IDC … … 903 899 for( i = 0; i < vps->getMaxLayers() - 1; i++) 904 900 { 901 #if O0225_MAX_TID_FOR_REF_LAYERS 902 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 903 { 904 if(vps->getDirectDependencyFlag(j, i)) 905 { 906 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 907 } 908 } 909 #else 905 910 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 911 #endif 906 912 } 907 913 } … … 909 915 for( i = 0; i < vps->getMaxLayers() - 1; i++) 910 916 { 917 #if O0225_MAX_TID_FOR_REF_LAYERS 918 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 919 { 920 if(vps->getDirectDependencyFlag(j, i)) 921 { 922 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 923 } 924 } 925 #else 911 926 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 927 #endif 912 928 } 913 929 #endif … … 918 934 #if VPS_EXTN_PROFILE_INFO 919 935 // Profile-tier-level signalling 920 #if VPS_PROFILE_OUTPUT_LAYERS921 936 WRITE_CODE( vps->getNumLayerSets() - 1 , 10, "vps_number_layer_sets_minus1" ); 922 937 WRITE_CODE( vps->getNumProfileTierLevel() - 1, 6, "vps_num_profile_tier_level_minus1"); 923 938 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 924 #else925 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)926 #endif927 939 { 928 940 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 929 941 if( !vps->getProfilePresentFlag(idx) ) 930 942 { 931 #if VPS_PROFILE_OUTPUT_LAYERS932 943 WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" ); 933 #else934 WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );935 #endif936 944 } 937 945 codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); … … 939 947 #endif 940 948 941 #if VPS_PROFILE_OUTPUT_LAYERS942 949 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; 943 950 WRITE_FLAG( (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" ); … … 974 981 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 975 982 } 976 #else977 #if VPS_EXTN_OP_LAYER_SETS978 // Target output layer signalling979 WRITE_UVLC( vps->getNumOutputLayerSets(), "vps_num_output_layer_sets");980 for(i = 0; i < vps->getNumOutputLayerSets(); i++)981 {982 #if VPS_OUTPUT_LAYER_SET_IDX983 assert(vps->getOutputLayerSetIdx(i) > 0);984 WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1, "vps_output_layer_set_idx_minus1[i]");985 #else986 WRITE_UVLC( vps->getOutputLayerSetIdx(i), "vps_output_layer_set_idx[i]");987 #endif988 Int lsIdx = vps->getOutputLayerSetIdx(i);989 for(j = 0; j <= vps->getMaxLayerId(); j++)990 {991 if(vps->getLayerIdIncludedFlag(lsIdx, j))992 {993 WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]");994 }995 }996 }997 #endif998 #endif999 983 1000 984 #if REPN_FORMAT_IN_VPS … … 1025 1009 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1026 1010 WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag"); 1011 #endif 1012 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1013 for(i = 1; i< vps->getMaxLayers(); i++) 1014 { 1015 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1016 { 1017 WRITE_FLAG(vps->getPocLsbNotPresentFlag(i), "poc_lsb_not_present_flag[i]"); 1018 } 1019 } 1020 #endif 1021 #if O0215_PHASE_ALIGNMENT 1022 WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" ); 1023 #endif 1024 #if N0147_IRAP_ALIGN_FLAG && !IRAP_ALIGN_FLAG_IN_VPS_VUI 1025 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1027 1026 #endif 1028 #if N0147_IRAP_ALIGN_FLAG1029 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");1030 #endif1031 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG1032 #if VPS_EXTN_DIRECT_REF_LAYERS1033 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1034 {1035 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1036 {1037 WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" );1038 }1039 }1040 #endif1041 #endif1042 1027 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1043 1028 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); … … 1107 1092 { 1108 1093 Int i,j; 1094 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1095 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1096 #endif 1109 1097 #if VPS_VUI_BITRATE_PICRATE 1110 1098 WRITE_FLAG( vps->getBitRatePresentVpsFlag(), "bit_rate_present_vps_flag" ); … … 1173 1161 } 1174 1162 #endif 1163 #endif //SVC_EXTENSION 1175 1164 1176 1165 Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) … … 1218 1207 if ( !pcSlice->getDependentSliceSegmentFlag() ) 1219 1208 { 1220 1209 #if SVC_EXTENSION 1221 1210 #if POC_RESET_FLAG 1222 1211 Int iBits = 0; … … 1238 1227 } 1239 1228 #else 1240 #if SH_DISCARDABLE_FLAG1241 1229 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1242 1230 { … … 1249 1237 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1250 1238 } 1251 #else 1239 #endif 1240 #else //SVC_EXTENSION 1252 1241 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1253 1242 { … … 1255 1244 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1256 1245 } 1257 #endif 1258 #endif 1246 #endif //SVC_EXTENSION 1259 1247 1260 1248 WRITE_UVLC( pcSlice->getSliceType(), "slice_type" ); … … 1265 1253 } 1266 1254 1255 #if !AUXILIARY_PICTURES 1267 1256 #if REPN_FORMAT_IN_VPS 1268 1257 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present … … 1272 1261 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 ); 1273 1262 #endif 1263 #endif 1274 1264 // if( separate_colour_plane_flag == 1 ) 1275 1265 // colour_plane_id u(2) 1276 1266 1277 1267 #if N0065_LAYER_POC_ALIGNMENT 1268 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1269 if( (pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag()) 1270 #else 1278 1271 if( pcSlice->getLayerId() > 0 || !pcSlice->getIdrPicFlag() ) 1272 #endif 1279 1273 #else 1280 1274 if( !pcSlice->getIdrPicFlag() ) … … 1297 1291 1298 1292 #if N0065_LAYER_POC_ALIGNMENT 1293 #if SHM_FIX7 1294 } 1295 #endif 1299 1296 if( !pcSlice->getIdrPicFlag() ) 1300 1297 { … … 1414 1411 WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enable_flag" ); 1415 1412 } 1416 #if N0065_LAYER_POC_ALIGNMENT 1413 #if N0065_LAYER_POC_ALIGNMENT && !SHM_FIX7 1417 1414 } 1418 1415 #endif … … 1421 1418 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1422 1419 #if ILP_SSH_SIG 1420 #if ILP_SSH_SIG_FIX 1421 if((pcSlice->getSPS()->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1422 #else 1423 1423 if((pcSlice->getSPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) ) 1424 #endif 1424 1425 #else 1425 1426 if((pcSlice->getSPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) … … 1468 1469 WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" ); 1469 1470 { 1471 #if AUXILIARY_PICTURES 1472 if (pcSlice->getChromaFormatIdc() != CHROMA_400) 1473 { 1474 #endif 1470 1475 SAOParam *saoParam = pcSlice->getPic()->getPicSym()->getSaoParam(); 1471 1476 WRITE_FLAG( saoParam->bSaoFlag[1], "slice_sao_chroma_flag" ); 1477 #if AUXILIARY_PICTURES 1478 } 1479 #endif 1472 1480 } 1473 1481 } … … 1934 1942 UInt uiMode = 0; 1935 1943 UInt uiTotalSignalledWeightFlags = 0; 1944 #if AUXILIARY_PICTURES 1945 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 1946 { 1947 bChroma = false; 1948 } 1949 #endif 1936 1950 if ( (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()) ) 1937 1951 { -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r442 r494 69 69 Int m_numRefIdc; 70 70 Int m_refIdc[MAX_NUM_REF_PICS+1]; 71 #if EXTERNAL_USEDBYCURR_N008272 Int m_UseExtusedByCurrPic;73 Int m_ExtusedByCurrPic[MAX_NUM_REF_PICS];74 #endif75 71 GOPEntry() 76 72 : m_POC(-1) … … 87 83 , m_deltaRPS(0) 88 84 , m_numRefIdc(0) 89 #if EXTERNAL_USEDBYCURR_N008290 , m_UseExtusedByCurrPic(0)91 #endif92 85 { 93 86 ::memset( m_referencePics, 0, sizeof(m_referencePics) ); 94 87 ::memset( m_usedByCurrPic, 0, sizeof(m_usedByCurrPic) ); 95 88 ::memset( m_refIdc, 0, sizeof(m_refIdc) ); 96 #if EXTERNAL_USEDBYCURR_N008297 ::memset( m_usedByCurrPic, 0, sizeof(m_ExtusedByCurrPic) );98 #endif99 89 } 100 90 }; … … 221 211 Int m_chromaCbQpOffset; // Chroma Cb QP Offset (0:default) 222 212 Int m_chromaCrQpOffset; // Chroma Cr Qp Offset (0:default) 213 #if AUXILIARY_PICTURES 214 ChromaFormat m_chromaFormatIDC; 215 #endif 223 216 224 217 #if ADAPTIVE_QP_SELECTION … … 941 934 Int getAdaptiveResolutionChange() { return m_adaptiveResolutionChange; } 942 935 #endif 936 #if AUXILIARY_PICTURES 937 Void setChromaFormatIDC(ChromaFormat x) { m_chromaFormatIDC = x; } 938 ChromaFormat getChromaFormatIDC() { return m_chromaFormatIDC; } 939 #endif 943 940 #endif 944 941 }; -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r442 r494 250 250 #endif 251 251 252 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 253 m_disableILP = xCheckTileSetConstraint(rpcCU); 254 m_pcPredSearch->setDisableILP(m_disableILP); 255 #endif 256 252 257 // analysis of CU 253 258 xCompressCU( m_ppcBestCU[0], m_ppcTempCU[0], 0 ); … … 261 266 } 262 267 } 268 #endif 269 270 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 271 xVerifyTileSetConstraint(rpcCU); 263 272 #endif 264 273 } … … 731 740 } 732 741 #if (ENCODER_FAST_MODE) 742 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 743 if(pcPic->getLayerId() > 0 && !m_disableILP) 744 #else 733 745 if(pcPic->getLayerId() > 0) 746 #endif 734 747 { 735 748 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) … … 1381 1394 Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 1382 1395 if(bZeroMVILR) 1396 { 1397 #endif 1398 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1399 if (!(rpcTempCU->isInterLayerReference(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]) && m_disableILP)) 1383 1400 { 1384 1401 #endif … … 1426 1443 } 1427 1444 } 1445 } 1446 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1447 } 1448 #endif 1428 1449 #if REF_IDX_ME_ZEROMV 1429 } 1430 #endif 1431 } 1450 } 1451 #endif 1432 1452 } 1433 1453 … … 1808 1828 } 1809 1829 1830 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1831 Bool TEncCu::xCheckTileSetConstraint( TComDataCU*& rpcCU ) 1832 { 1833 Bool disableILP = false; 1834 1835 if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0) 1836 { 1837 if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 2) 1838 { 1839 disableILP = true; 1840 } 1841 if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 1) 1842 { 1843 Int currCUaddr = rpcCU->getAddr(); 1844 Int frameWitdhInCU = rpcCU->getPic()->getPicSym()->getFrameWidthInCU(); 1845 Int frameHeightInCU = rpcCU->getPic()->getPicSym()->getFrameHeightInCU(); 1846 Bool leftCUExists = (currCUaddr % frameWitdhInCU) > 0; 1847 Bool aboveCUExists = (currCUaddr / frameWitdhInCU) > 0; 1848 Bool rightCUExists = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1); 1849 Bool belowCUExists = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1); 1850 Int currTileSetIdx = rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr); 1851 // Check if CU is at tile set boundary 1852 if ( (leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-1) != currTileSetIdx) || 1853 (leftCUExists && aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) || 1854 (aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) || 1855 (aboveCUExists && rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) || 1856 (rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+1) != currTileSetIdx) || 1857 (rightCUExists && belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) || 1858 (belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) || 1859 (belowCUExists && leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) ) 1860 { 1861 disableILP = true; // Disable ILP in tile set boundary CU 1862 } 1863 } 1864 } 1865 1866 return disableILP; 1867 } 1868 1869 Void TEncCu::xVerifyTileSetConstraint( TComDataCU*& rpcCU ) 1870 { 1871 if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0 && 1872 m_disableILP) 1873 { 1874 UInt numPartitions = rpcCU->getPic()->getNumPartInCU(); 1875 for (UInt i = 0; i < numPartitions; i++) 1876 { 1877 if (!rpcCU->isIntra(i)) 1878 { 1879 for (UInt refList = 0; refList < 2; refList++) 1880 { 1881 if (rpcCU->getInterDir(i) & (1<<refList)) 1882 { 1883 TComCUMvField *mvField = rpcCU->getCUMvField(RefPicList(refList)); 1884 if (mvField->getRefIdx(i) >= 0) 1885 { 1886 assert(!(rpcCU->getSlice()->getRefPic(RefPicList(refList), mvField->getRefIdx(i))->isILR(rpcCU->getLayerId()))); 1887 } 1888 } 1889 } 1890 } 1891 } 1892 } 1893 } 1894 #endif 1895 1810 1896 /** Collect ARL statistics from one LCU 1811 1897 * \param pcCU -
trunk/source/Lib/TLibEncoder/TEncCu.h
r345 r494 108 108 Int m_temporalSAD; 109 109 #endif 110 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 111 Bool m_disableILP; 112 #endif 110 113 public: 111 114 /// copy parameters from encoder class … … 171 174 #endif 172 175 176 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 177 Bool xCheckTileSetConstraint( TComDataCU*& rpcCU ); 178 Void xVerifyTileSetConstraint( TComDataCU*& rpcCU ); 179 #endif 180 173 181 #if AMP_ENC_SPEEDUP 174 182 #if AMP_MRG -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r345 r494 280 280 const UInt uiTrDepthCurr = uiDepth - pcCU->getDepth( uiAbsPartIdx ); 281 281 const Bool bFirstCbfOfCU = uiTrDepthCurr == 0; 282 #if AUXILIARY_PICTURES 283 if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400) 284 { 285 #endif 282 286 if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) 283 287 { … … 296 300 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 297 301 } 302 #if AUXILIARY_PICTURES 303 } 304 else 305 { 306 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == 0 ); 307 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == 0 ); 308 } 309 #endif 298 310 299 311 if( uiSubdiv ) … … 402 414 Void TEncEntropy::encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 403 415 { 416 #if AUXILIARY_PICTURES 417 if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 ) 418 { 419 return; 420 } 421 #endif 404 422 if( bRD ) 405 423 { -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r442 r494 753 753 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 754 754 #if SVC_EXTENSION 755 #if ILR_RESTR && ILR_RESTR_FIX 755 if (m_layerId > 0) 756 { 756 757 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 757 758 Int activeNumILRRefIdxTmp = 0; 758 #endif 759 if (m_layerId > 0) 760 { 759 761 760 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 762 761 { … … 769 768 pcSlice->setBaseColPic( *cListPic, refLayerIdc ); 770 769 771 #if ILR_RESTR && ILR_RESTR_FIX772 770 // Apply temporal layer restriction to inter-layer prediction 771 #if O0225_MAX_TID_FOR_REF_LAYERS 772 Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId(),m_layerId); 773 #else 773 774 Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId()); 775 #endif 774 776 if( ((Int)(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getRapPicFlag()) ) 775 777 { … … 780 782 continue; // ILP is not valid due to temporal layer restriction 781 783 } 782 #endif 783 784 #if SCALED_REF_LAYER_OFFSETS 784 785 785 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); 786 786 … … 790 790 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 791 791 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 792 #else 793 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow(); 794 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 795 796 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 797 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 798 799 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 800 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 801 #endif 792 802 793 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 803 794 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); … … 809 800 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 810 801 { 811 #if SCALED_REF_LAYER_OFFSETS 802 #if O0215_PHASE_ALIGNMENT 803 #if O0194_JOINT_US_BITSHIFT 804 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 805 #else 806 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 807 #endif 808 #else 809 #if O0194_JOINT_US_BITSHIFT 810 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) ); 811 #else 812 812 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) ); 813 #else 814 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() ); 813 #endif 815 814 #endif 816 815 } … … 823 822 } 824 823 825 #if ILR_RESTR && ILR_RESTR_FIX826 824 // Update the list of active inter-layer pictures 827 825 for ( Int i = 0; i < activeNumILRRefIdxTmp; i++) … … 835 833 pcSlice->setInterLayerPredEnabledFlag(false); 836 834 } 837 #endif838 835 839 836 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) … … 1167 1164 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1168 1165 { 1169 m_pcEncTop->setILRPic(pcPic);1166 pcSlice->setILRPic( m_pcEncTop->getIlpList() ); 1170 1167 #if REF_IDX_MFM 1171 1168 #if M0457_COL_PICTURE_SIGNALING … … 1201 1198 UInt ColFromL0Flag = pcSlice->getColFromL0Flag(); 1202 1199 UInt ColRefIdx = pcSlice->getColRefIdx(); 1200 1203 1201 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1204 1202 { 1205 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) ) 1203 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1204 #if MFM_ENCCONSTRAINT 1205 && pcSlice->getBaseColPic( *m_ppcTEncTop[pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1206 #endif 1207 ) 1206 1208 { 1207 1209 ColRefIdx = colIdx; … … 1216 1218 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1217 1219 { 1218 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) ) 1220 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1221 #if MFM_ENCCONSTRAINT 1222 && pcSlice->getBaseColPic( *m_ppcTEncTop[pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1223 #endif 1224 ) 1219 1225 { 1220 1226 ColRefIdx = colIdx; … … 1567 1573 { 1568 1574 pcPic->getPicYuvOrg()->copyToPic( pcPic->getPicYuvRec() ); 1575 #if O0194_WEIGHTED_PREDICTION_CGS 1576 // Calculate for the base layer to be used in EL as Inter layer reference 1577 m_pcSliceEncoder->estimateILWpParam( pcSlice ); 1578 #endif 1569 1579 #if AVC_SYNTAX 1570 1580 pcPic->readBLSyntax( m_ppcTEncTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); … … 1607 1617 pcSlice->setSliceSegmentCurStartCUAddr ( startCUAddrSlice ); 1608 1618 pcSlice->setSliceBits(0); 1619 #if SVC_EXTENSION 1620 // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture 1621 memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) ); 1622 #endif 1609 1623 uiNumSlices ++; 1610 1624 } … … 1689 1703 #else 1690 1704 OutputNALUnit nalu(NAL_UNIT_VPS); 1705 #endif 1706 #if VPS_EXTN_OFFSET_CALC 1707 OutputNALUnit tempNalu(NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1708 m_pcEntropyCoder->setBitstream(&tempNalu.m_Bitstream); 1709 m_pcEntropyCoder->encodeVPS(m_pcEncTop->getVPS()); // Use to calculate the VPS extension offset 1691 1710 #endif 1692 1711 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); … … 3162 3181 3163 3182 TComPicYuv* pcOrgInterlaced = new TComPicYuv; 3183 #if AUXILIARY_PICTURES 3184 pcOrgInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3185 #else 3164 3186 pcOrgInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3187 #endif 3165 3188 3166 3189 TComPicYuv* pcRecInterlaced = new TComPicYuv; 3190 #if AUXILIARY_PICTURES 3191 pcRecInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3192 #else 3167 3193 pcRecInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 3194 #endif 3168 3195 3169 3196 Pel* pOrgInterlaced = pcOrgInterlaced->getLumaAddr(); -
trunk/source/Lib/TLibEncoder/TEncPic.cpp
r313 r494 126 126 * \return Void 127 127 */ 128 #if AUXILIARY_PICTURES 129 #if SVC_UPSAMPLING 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 132 133 #else 134 135 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 136 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 137 #endif 138 { 139 #if SVC_UPSAMPLING 140 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 141 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 142 #else 143 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 144 #endif 145 m_uiMaxAQDepth = uiMaxAQDepth; 146 if ( uiMaxAQDepth > 0 ) 147 { 148 m_acAQLayer = new TEncPicQPAdaptationLayer[ m_uiMaxAQDepth ]; 149 for (UInt d = 0; d < m_uiMaxAQDepth; d++) 150 { 151 m_acAQLayer[d].create( iWidth, iHeight, uiMaxWidth>>d, uiMaxHeight>>d ); 152 } 153 } 154 } 155 #else 128 156 #if SVC_UPSAMPLING 129 157 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, … … 152 180 } 153 181 } 182 #endif 154 183 155 184 /** Clean up -
trunk/source/Lib/TLibEncoder/TEncPic.h
r313 r494 105 105 virtual ~TEncPic(); 106 106 107 #if AUXILIARY_PICTURES 108 #if SVC_UPSAMPLING 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 110 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 111 #else 112 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 114 115 #endif 116 #else 107 117 #if SVC_UPSAMPLING 108 118 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, … … 111 121 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 112 122 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 123 #endif 113 124 #endif 114 125 virtual Void destroy(); -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r313 r494 1871 1871 1872 1872 saoParam->bSaoFlag[0] = true; 1873 #if AUXILIARY_PICTURES 1874 saoParam->bSaoFlag[1] = m_pcPic->getChromaFormat() == CHROMA_400 ? false : true; 1875 #else 1873 1876 saoParam->bSaoFlag[1] = true; 1877 #endif 1874 1878 saoParam->oneUnitFlag[0] = false; 1875 1879 saoParam->oneUnitFlag[1] = false; -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r442 r494 914 914 } 915 915 916 #if AUXILIARY_PICTURES 917 if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400) 918 { 919 #endif 916 920 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset; 917 921 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; … … 945 949 piPCMSample += uiWidth; 946 950 } 951 #if AUXILIARY_PICTURES 952 } 953 #endif 947 954 m_pcBinIf->resetBac(); 948 955 } -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r442 r494 3092 3092 { 3093 3093 #endif 3094 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3095 if (!(pcCU->isInterLayerReference(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]) && m_disableILP)) 3096 { 3097 #endif 3094 3098 UInt uiCostCand = MAX_UINT; 3095 3099 UInt uiBitsCand = 0; … … 3115 3119 uiMergeIndex = uiMergeCand; 3116 3120 } 3121 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3122 } 3123 #endif 3117 3124 #if REF_IDX_ME_ZEROMV 3118 3125 } … … 3221 3228 Int numValidMergeCand = 0 ; 3222 3229 3223 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI3224 Bool disableILP = false;3225 if (pcCU->getPic()->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && pcCU->getPic()->getPicSym()->getTileSetIdxMap(pcCU->getAddr()) >= 0)3226 {3227 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 2)3228 {3229 disableILP = true;3230 }3231 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 1)3232 {3233 Int currCUaddr = pcCU->getAddr();3234 Int frameWitdhInCU = pcCU->getPic()->getPicSym()->getFrameWidthInCU();3235 Int frameHeightInCU = pcCU->getPic()->getPicSym()->getFrameHeightInCU();3236 Bool leftCUExists = (currCUaddr % frameWitdhInCU) > 0;3237 Bool aboveCUExists = (currCUaddr / frameWitdhInCU) > 0;3238 Bool rightCUExists = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1);3239 Bool belowCUExists = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1);3240 Int currTileSetIdx = pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr);3241 // Check if CU is at tile set boundary3242 if ( (leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-1) != currTileSetIdx) ||3243 (leftCUExists && aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) ||3244 (aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) ||3245 (aboveCUExists && rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) ||3246 (rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+1) != currTileSetIdx) ||3247 (rightCUExists && belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) ||3248 (belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) ||3249 (belowCUExists && leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) )3250 {3251 disableILP = true; // Disable ILP in tile set boundary CU3252 }3253 }3254 }3255 #endif3256 3257 3230 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 3258 3231 { … … 3305 3278 { 3306 3279 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3307 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && disableILP)3280 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && m_disableILP) 3308 3281 { 3309 3282 continue; … … 3529 3502 } 3530 3503 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3531 if (pcPic->isILR(pcCU->getLayerId()) && disableILP)3504 if (pcPic->isILR(pcCU->getLayerId()) && m_disableILP) 3532 3505 { 3533 3506 testIter = false; … … 3550 3523 } 3551 3524 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3552 if (pcPic->isILR(pcCU->getLayerId()) && disableILP)3525 if (pcPic->isILR(pcCU->getLayerId()) && m_disableILP) 3553 3526 { 3554 3527 testRefIdx = false; … … 4119 4092 4120 4093 // prediction pattern 4094 #if O0194_WEIGHTED_PREDICTION_CGS 4095 // Bug Fix (It did not check WP for BSlices) 4096 if ( pcCU->getSlice()->getPPS()->getUseWP()) 4097 #else 4121 4098 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) 4099 #endif 4122 4100 { 4123 4101 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true ); … … 4128 4106 } 4129 4107 4108 #if O0194_WEIGHTED_PREDICTION_CGS 4109 if ( pcCU->getSlice()->getPPS()->getUseWP()) 4110 ///< Bug Fix (It did not check WP for BSlices) 4111 #else 4130 4112 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) 4113 #endif 4131 4114 { 4132 4115 xWeightedPredictionUni( pcCU, pcTemplateCand, uiPartAddr, iSizeX, iSizeY, eRefPicList, pcTemplateCand, iRefIdx ); -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r345 r494 129 129 // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; 130 130 UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds 131 131 132 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 133 Bool m_disableILP; 134 #endif 135 132 136 public: 133 137 TEncSearch(); … … 220 224 Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); 221 225 Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); 226 227 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 228 Void setDisableILP(Bool a) {m_disableILP = a;} 229 #endif 230 222 231 protected: 223 232 -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r442 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 … … 51 51 m_apcPicYuvPred = NULL; 52 52 m_apcPicYuvResi = NULL; 53 53 54 54 m_pdRdPicLambda = NULL; 55 55 m_pdRdPicQp = NULL; … … 69 69 } 70 70 71 Void TEncSlice::initCtxMem( UInt i ) 72 { 71 Void TEncSlice::initCtxMem( UInt i ) 72 { 73 73 for (std::vector<TEncSbac*>::iterator j = CTXMem.begin(); j != CTXMem.end(); j++) 74 74 { 75 75 delete (*j); 76 76 } 77 CTXMem.clear(); 78 CTXMem.resize(i); 77 CTXMem.clear(); 78 CTXMem.resize(i); 79 79 } 80 80 81 #if AUXILIARY_PICTURES 82 Void TEncSlice::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ) 83 { 84 // create prediction picture 85 if ( m_apcPicYuvPred == NULL ) 86 { 87 m_apcPicYuvPred = new TComPicYuv; 88 m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 89 } 90 91 // create residual picture 92 if( m_apcPicYuvResi == NULL ) 93 { 94 m_apcPicYuvResi = new TComPicYuv; 95 m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 96 } 97 } 98 #else 81 99 Void TEncSlice::create( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ) 82 100 { … … 87 105 m_apcPicYuvPred->create( iWidth, iHeight, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 88 106 } 89 107 90 108 // create residual picture 91 109 if( m_apcPicYuvResi == NULL ) … … 95 113 } 96 114 } 115 #endif 97 116 98 117 Void TEncSlice::destroy() … … 105 124 m_apcPicYuvPred = NULL; 106 125 } 107 126 108 127 // destroy residual picture 109 128 if ( m_apcPicYuvResi ) … … 113 132 m_apcPicYuvResi = NULL; 114 133 } 115 134 116 135 // free lambda and QP arrays 117 136 if ( m_pdRdPicLambda ) { xFree( m_pdRdPicLambda ); m_pdRdPicLambda = NULL; } … … 139 158 #if SVC_EXTENSION 140 159 m_ppcTEncTop = pcEncTop->getLayerEnc(); 141 #endif 160 #endif 142 161 m_pcGOPEncoder = pcEncTop->getGOPEncoder(); 143 162 m_pcCuEncoder = pcEncTop->getCuEncoder(); 144 163 m_pcPredSearch = pcEncTop->getPredSearch(); 145 164 146 165 m_pcEntropyCoder = pcEncTop->getEntropyCoder(); 147 166 m_pcCavlcCoder = pcEncTop->getCavlcCoder(); … … 149 168 m_pcBinCABAC = pcEncTop->getBinCABAC(); 150 169 m_pcTrQuant = pcEncTop->getTrQuant(); 151 170 152 171 m_pcBitCounter = pcEncTop->getBitCounter(); 153 172 m_pcRdCost = pcEncTop->getRdCost(); 154 173 m_pppcRDSbacCoder = pcEncTop->getRDSbacCoder(); 155 174 m_pcRDGoOnSbacCoder = pcEncTop->getRDGoOnSbacCoder(); 156 175 157 176 // create lambda and QP arrays 158 177 m_pdRdPicLambda = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); … … 187 206 Double dQP; 188 207 Double dLambda; 189 208 190 209 rpcSlice = pcPic->getSlice(0); 191 210 rpcSlice->setSPS( pSPS ); … … 202 221 rpcSlice->setPicOutputFlag( true ); 203 222 rpcSlice->setPOC( pocCurr ); 204 223 205 224 // depth computation based on GOP size 206 225 Int depth; … … 230 249 } 231 250 } 232 251 233 252 // slice type 234 253 SliceType eSliceType; 235 254 236 255 eSliceType=B_SLICE; 237 256 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 238 257 239 258 rpcSlice->setSliceType ( eSliceType ); 240 259 241 260 // ------------------------------------------------------------------------------------------------------------------ 242 261 // Non-referenced frame marking 243 262 // ------------------------------------------------------------------------------------------------------------------ 244 263 245 264 if(pocLast == 0) 246 265 { … … 252 271 } 253 272 rpcSlice->setReferenced(true); 254 273 255 274 // ------------------------------------------------------------------------------------------------------------------ 256 275 // QP setting 257 276 // ------------------------------------------------------------------------------------------------------------------ 258 277 259 278 dQP = m_pcCfg->getQP(); 260 279 if(eSliceType!=I_SLICE) 261 280 { 262 281 #if REPN_FORMAT_IN_VPS 263 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 264 #else 265 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 282 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 283 #else 284 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 266 285 #endif 267 286 { … … 269 288 } 270 289 } 271 290 272 291 // modify QP 273 292 Int* pdQPs = m_pcCfg->getdQPs(); … … 285 304 // Lambda computation 286 305 // ------------------------------------------------------------------------------------------------------------------ 287 306 288 307 Int iQP; 289 308 Double dOrigQP = dQP; … … 294 313 // compute QP value 295 314 dQP = dOrigQP + ((iDQpIdx+1)>>1)*(iDQpIdx%2 ? -1 : 1); 296 315 297 316 // compute lambda value 298 317 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); … … 326 345 #endif 327 346 } 328 347 329 348 // if hadamard is used in ME process 330 349 if ( !m_pcCfg->getUseHADME() && rpcSlice->getSliceType( ) != I_SLICE ) … … 332 351 dLambda *= 0.95; 333 352 } 334 353 335 354 #if REPN_FORMAT_IN_VPS 336 355 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); … … 343 362 m_piRdPicQp [iDQpIdx] = iQP; 344 363 } 345 364 346 365 // obtain dQP = 0 case 347 366 dLambda = m_pdRdPicLambda[0]; 348 367 dQP = m_pdRdPicQp [0]; 349 368 iQP = m_piRdPicQp [0]; 350 369 351 370 if( rpcSlice->getSliceType( ) != I_SLICE ) 352 371 { … … 359 378 Int nCurLayer = rpcSlice->getLayerId(); 360 379 Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[nCurLayer-1]->getQP() - m_ppcTEncTop[nCurLayer]->getQP() , 361 1.0 * m_ppcTEncTop[nCurLayer]->getSourceWidth() * m_ppcTEncTop[nCurLayer]->getSourceHeight() 380 1.0 * m_ppcTEncTop[nCurLayer]->getSourceWidth() * m_ppcTEncTop[nCurLayer]->getSourceHeight() 362 381 / m_ppcTEncTop[nCurLayer-1]->getSourceWidth() / m_ppcTEncTop[nCurLayer-1]->getSourceHeight() ); 363 382 dLambda *= gamma; … … 392 411 #endif 393 412 394 #if RDOQ_CHROMA_LAMBDA 413 #if RDOQ_CHROMA_LAMBDA 395 414 // for RDOQ 396 m_pcTrQuant->setLambda( dLambda, dLambda / weight ); 415 m_pcTrQuant->setLambda( dLambda, dLambda / weight ); 397 416 #else 398 417 m_pcTrQuant->setLambda( dLambda ); … … 401 420 #if SAO_CHROMA_LAMBDA 402 421 // For SAO 403 rpcSlice ->setLambda( dLambda, dLambda / weight ); 422 rpcSlice ->setLambda( dLambda, dLambda / weight ); 404 423 #else 405 424 rpcSlice ->setLambda( dLambda ); 406 425 #endif 407 426 408 427 #if HB_LAMBDA_FOR_LDC 409 428 // restore original slice type 410 429 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 411 430 412 431 #if SVC_EXTENSION 413 432 if(m_pcCfg->getLayerId() > 0) … … 418 437 rpcSlice->setSliceType ( eSliceType ); 419 438 #endif 420 439 421 440 if (m_pcCfg->getUseRecalculateQPAccordingToLambda()) 422 441 { 423 442 dQP = xGetQPValueAccordingToLambda( dLambda ); 424 443 #if REPN_FORMAT_IN_VPS 425 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 426 #else 427 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 444 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 445 #else 446 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 428 447 #endif 429 448 } … … 438 457 rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 439 458 rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 440 459 441 460 if ( m_pcCfg->getDeblockingFilterMetric() ) 442 461 { … … 479 498 480 499 rpcSlice->setDepth ( depth ); 481 500 482 501 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 483 #if TEMP_SCALABILITY_FIX 484 if((eSliceType==I_SLICE) || (rpcSlice->getPOC() == 0)) 485 #else 502 486 503 if(eSliceType==I_SLICE) 487 #endif488 504 { 489 505 pcPic->setTLayer(0); … … 493 509 assert( m_apcPicYuvPred ); 494 510 assert( m_apcPicYuvResi ); 495 511 496 512 pcPic->setPicYuvPred( m_apcPicYuvPred ); 497 513 pcPic->setPicYuvResi( m_apcPicYuvResi ); … … 557 573 #endif 558 574 559 #if RDOQ_CHROMA_LAMBDA 575 #if RDOQ_CHROMA_LAMBDA 560 576 // for RDOQ 561 577 m_pcTrQuant->setLambda( lambda, lambda / weight ); … … 665 681 #endif 666 682 667 #if RDOQ_CHROMA_LAMBDA 683 #if RDOQ_CHROMA_LAMBDA 668 684 // for RDOQ 669 m_pcTrQuant->setLambda( lambda, lambda / weight ); 685 m_pcTrQuant->setLambda( lambda, lambda / weight ); 670 686 #else 671 687 m_pcTrQuant->setLambda( lambda ); … … 674 690 #if SAO_CHROMA_LAMBDA 675 691 // For SAO 676 pcSlice ->setLambda( lambda, lambda / weight ); 692 pcSlice ->setLambda( lambda, lambda / weight ); 677 693 #else 678 694 pcSlice ->setLambda( lambda ); … … 692 708 Int iMaxSR = m_pcCfg->getSearchRange(); 693 709 Int iNumPredDir = pcSlice->isInterP() ? 1 : 2; 694 710 695 711 for (Int iDir = 0; iDir <= iNumPredDir; iDir++) 696 712 { … … 726 742 } 727 743 #endif 728 744 729 745 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 730 746 Double dPicRdCostBest = MAX_DOUBLE; 731 747 UInt uiQpIdxBest = 0; 732 748 733 749 Double dFrameLambda; 734 750 #if FULL_NBIT … … 737 753 Int SHIFT_QP = 12; 738 754 #endif 739 755 740 756 // set frame lambda 741 757 if (m_pcCfg->getGOPSize() > 1) … … 748 764 } 749 765 m_pcRdCost ->setFrameLambda(dFrameLambda); 750 766 751 767 // for each QP candidate 752 768 for ( UInt uiQpIdx = 0; uiQpIdx < 2 * m_pcCfg->getDeltaQpRD() + 1; uiQpIdx++ ) … … 776 792 #endif 777 793 778 #if RDOQ_CHROMA_LAMBDA 794 #if RDOQ_CHROMA_LAMBDA 779 795 // for RDOQ 780 796 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); … … 784 800 #if SAO_CHROMA_LAMBDA 785 801 // For SAO 786 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); 802 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); 787 803 #else 788 804 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx] ); 789 805 #endif 790 806 791 807 // try compress 792 808 compressSlice ( rpcPic ); 793 809 794 810 Double dPicRdCost; 795 811 UInt64 uiPicDist = m_uiPicDist; 796 812 UInt64 uiALFBits = 0; 797 813 798 814 m_pcGOPEncoder->preLoopFilterPicAll( rpcPic, uiPicDist, uiALFBits ); 799 815 800 816 // compute RD cost and choose the best 801 817 dPicRdCost = m_pcRdCost->calcRdCost64( m_uiPicTotalBits + uiALFBits, uiPicDist, true, DF_SSE_FRAME); 802 818 803 819 if ( dPicRdCost < dPicRdCostBest ) 804 820 { … … 807 823 } 808 824 } 809 825 810 826 // set best values 811 827 pcSlice ->setSliceQp ( m_piRdPicQp [uiQpIdxBest] ); … … 832 848 #endif 833 849 834 #if RDOQ_CHROMA_LAMBDA 835 // for RDOQ 836 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 850 #if RDOQ_CHROMA_LAMBDA 851 // for RDOQ 852 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 837 853 #else 838 854 m_pcTrQuant ->setLambda ( m_pdRdPicLambda[uiQpIdxBest] ); … … 840 856 #if SAO_CHROMA_LAMBDA 841 857 // For SAO 842 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 858 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 843 859 #else 844 860 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest] ); … … 862 878 863 879 UInt uiEncCUOrder; 864 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 880 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 865 881 for( uiEncCUOrder = uiStartCUAddr/rpcPic->getNumPartInCU(); 866 882 uiEncCUOrder < (uiBoundingCUAddr+(rpcPic->getNumPartInCU()-1))/rpcPic->getNumPartInCU(); … … 898 914 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 899 915 xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false ); 900 916 901 917 // initialize cost values 902 918 m_uiPicTotalBits = 0; 903 919 m_dPicRdCost = 0; 904 920 m_uiPicDist = 0; 905 921 906 922 // set entropy coder 907 923 if( m_pcCfg->getUseSBACRD() ) … … 921 937 m_pcEntropyCoder->setBitstream ( m_pcBitCounter ); 922 938 } 923 939 924 940 //------------------------------------------------------------------------------ 925 941 // Weighted Prediction parameters estimation. … … 930 946 xCalcACDCParamSlice(pcSlice); 931 947 } 948 #if O0194_WEIGHTED_PREDICTION_CGS 949 else 950 { 951 // Calculate for the base layer to be used in EL as Inter layer reference 952 estimateILWpParam( pcSlice ); 953 } 954 #endif 932 955 933 956 Bool bWp_explicit = (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()); … … 1021 1044 m_pcBufferSbacCoders[uiTileCol].loadContexts( CTXMem[1] ); 1022 1045 Int iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles(); 1023 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 1046 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 1024 1047 uiLin = uiCUAddr / uiWidthInLCUs; 1025 1048 uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(rpcPic->getPicSym()->getCUOrderMap(uiCUAddr))*iNumSubstreamsPerTile … … 1098 1121 pcCUTR = rpcPic->getCU( uiCUAddr - uiWidthInCU + 1 ); 1099 1122 } 1100 if ( ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1123 if ( ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1101 1124 (pcCUTR->getSCUAddr()+uiMaxParts-1 < pcSlice->getSliceCurStartCUAddr()) || 1102 1125 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(uiCUAddr))) … … 1137 1160 m_pcEntropyCoder->setEntropyCoder ( m_pcRDGoOnSbacCoder, pcSlice ); 1138 1161 m_pcEntropyCoder->setBitstream( &pcBitCounters[uiSubStrm] ); 1139 1162 1140 1163 ((TEncBinCABAC*)m_pcRDGoOnSbacCoder->getEncBinIf())->setBinCountingEnableFlag(true); 1141 1164 … … 1242 1265 m_pcRdCost->setLambda(oldLambda); 1243 1266 #if RATE_CONTROL_INTRA 1244 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1267 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1245 1268 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1246 1269 #else … … 1250 1273 #endif 1251 1274 #endif 1252 1275 1253 1276 // restore entropy coder to an initial stage 1254 1277 m_pcEntropyCoder->setEntropyCoder ( m_pppcRDSbacCoder[0][CI_CURR_BEST], pcSlice ); … … 1275 1298 { 1276 1299 ppppcRDSbacCoders[uiSubStrm][0][CI_CURR_BEST]->load( m_pppcRDSbacCoder[0][CI_CURR_BEST] ); 1277 1300 1278 1301 //Store probabilties of second LCU in line into buffer 1279 1302 if ( ( uiCol == uiTileLCUX+1) && (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && m_pcCfg->getWaveFrontsynchro()) … … 1325 1348 1326 1349 #if RATE_CONTROL_INTRA 1327 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1350 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1328 1351 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1329 1352 #else … … 1350 1373 } 1351 1374 } 1352 1375 1353 1376 m_uiPicTotalBits += pcCU->getTotalBits(); 1354 1377 m_dPicRdCost += pcCU->getTotalCost(); … … 1401 1424 m_pcEntropyCoder->setEntropyCoder ( m_pcSbacCoder, pcSlice ); 1402 1425 } 1403 1426 1404 1427 m_pcCuEncoder->setBitCounter( NULL ); 1405 1428 m_pcBitCounter = NULL; … … 1427 1450 m_pcBufferSbacCoders[ui].load(m_pcSbacCoder); //init. state 1428 1451 } 1429 1452 1430 1453 for (Int iSubstrmIdx=0; iSubstrmIdx < iNumSubstreams; iSubstrmIdx++) 1431 1454 { … … 1524 1547 } 1525 1548 if ( (true/*bEnforceSliceRestriction*/ && 1526 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1549 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1527 1550 (pcCUTR->getSCUAddr()+uiMaxParts-1 < pcSlice->getSliceCurStartCUAddr()) || 1528 1551 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(uiCUAddr))) … … 1579 1602 } 1580 1603 1581 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 1604 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 1582 1605 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 1583 1606 { … … 1613 1636 if (allowMergeLeft) 1614 1637 { 1615 m_pcEntropyCoder->m_pcEntropyCoderIf->codeSaoMerge(mergeLeft); 1638 m_pcEntropyCoder->m_pcEntropyCoderIf->codeSaoMerge(mergeLeft); 1616 1639 } 1617 1640 else … … 1676 1699 #if ENC_DEC_TRACE 1677 1700 g_bJustDoIt = g_bEncDecTraceDisable; 1678 #endif 1701 #endif 1679 1702 if( m_pcCfg->getUseSBACRD() ) 1680 1703 { 1681 1704 pcSbacCoders[uiSubStrm].load(m_pcSbacCoder); //load back status of the entropy coder after encoding the LCU into relevant bitstream entropy coder 1682 1705 1683 1706 1684 1707 //Store probabilties of second LCU in line into buffer … … 1733 1756 UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame(); 1734 1757 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame; 1735 if (bEncodeSlice) 1758 if (bEncodeSlice) 1736 1759 { 1737 1760 UInt uiCUAddrIncrement; … … 1769 1792 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1770 1793 break; 1771 } 1794 } 1772 1795 // WPP: if a slice does not start at the beginning of a CTB row, it must end within the same CTB row 1773 1796 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiStartCUAddrSlice % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1809 1832 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1810 1833 break; 1811 } 1834 } 1812 1835 // WPP: if a slice does not start at the beginning of a CTB row, it must end within the same CTB row 1813 1836 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiStartCUAddrSlice % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1819 1842 1820 1843 Bool tileBoundary = false; 1821 if ((m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_BYTES) && 1844 if ((m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_BYTES) && 1822 1845 (m_pcCfg->getNumRowsMinus1() > 0 || m_pcCfg->getNumColumnsMinus1() > 0)) 1823 1846 { … … 1832 1855 } 1833 1856 tileBoundingCUAddrSlice = lcuEncAddr*rpcPic->getNumPartInCU(); 1834 1857 1835 1858 if (tileBoundingCUAddrSlice < uiBoundingCUAddrSlice) 1836 1859 { … … 1845 1868 startCUAddrSliceSegment = pcSlice->getSliceSegmentCurStartCUAddr(); 1846 1869 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame; 1847 if (bEncodeSlice) 1870 if (bEncodeSlice) 1848 1871 { 1849 1872 UInt uiCUAddrIncrement; … … 1880 1903 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1881 1904 break; 1882 } 1905 } 1883 1906 // WPP: if a slice segment does not start at the beginning of a CTB row, it must end within the same CTB row 1884 1907 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (startCUAddrSliceSegment % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1919 1942 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1920 1943 break; 1921 } 1944 } 1922 1945 // WPP: if a slice segment does not start at the beginning of a CTB row, it must end within the same CTB row 1923 1946 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (startCUAddrSliceSegment % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1927 1950 pcSlice->setSliceSegmentCurEndCUAddr( boundingCUAddrSliceSegment ); 1928 1951 } 1929 if ((m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_BYTES) && 1952 if ((m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_BYTES) && 1930 1953 (m_pcCfg->getNumRowsMinus1() > 0 || m_pcCfg->getNumColumnsMinus1() > 0)) 1931 1954 { … … 1979 2002 } 1980 2003 UInt uiRealStartAddress = rpcPic->getPicSym()->getPicSCUEncOrder(uiExternalAddress*rpcPic->getNumPartInCU()+uiInternalAddress); 1981 2004 1982 2005 pcSlice->setSliceSegmentCurStartCUAddr(uiRealStartAddress); 1983 2006 startCUAddrSliceSegment=uiRealStartAddress; 1984 2007 1985 2008 //calculate real slice start address 1986 2009 uiInternalAddress = rpcPic->getPicSym()->getPicSCUAddr(pcSlice->getSliceCurStartCUAddr()) % rpcPic->getNumPartInCU(); … … 2007 2030 } 2008 2031 uiRealStartAddress = rpcPic->getPicSym()->getPicSCUEncOrder(uiExternalAddress*rpcPic->getNumPartInCU()+uiInternalAddress); 2009 2032 2010 2033 pcSlice->setSliceCurStartCUAddr(uiRealStartAddress); 2011 2034 uiStartCUAddrSlice=uiRealStartAddress; 2012 2035 2013 2036 // Make a joint decision based on reconstruction and dependent slice bounds 2014 2037 startCUAddr = max(uiStartCUAddrSlice , startCUAddrSliceSegment ); … … 2022 2045 if ( (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2023 2046 || (m_pcCfg->getSliceMode()==0 && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2024 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==0) 2047 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==0) 2025 2048 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2026 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==0) 2049 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==0) 2027 2050 || (m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceMode()==0) 2028 2051 || tileBoundary … … 2066 2089 } 2067 2090 #endif 2091 #if O0194_WEIGHTED_PREDICTION_CGS 2092 Void TEncSlice::estimateILWpParam( TComSlice* pcSlice ) 2093 { 2094 xCalcACDCParamSlice(pcSlice); 2095 wpACDCParam * temp_weightACDCParam; 2096 2097 pcSlice->getWpAcDcParam(temp_weightACDCParam); 2098 g_refWeightACDCParam = (void *) temp_weightACDCParam; 2099 } 2100 #endif 2068 2101 //! \} -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r442 r494 111 111 virtual ~TEncSlice(); 112 112 113 #if AUXILIARY_PICTURES 114 Void create ( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ); 115 #else 113 116 Void create ( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth ); 117 #endif 114 118 Void destroy (); 115 119 Void init ( TEncTop* pcEncTop ); … … 119 123 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 120 124 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ); 125 #if O0194_WEIGHTED_PREDICTION_CGS 126 Void estimateILWpParam ( TComSlice* pcSlice ); 127 #endif 121 128 #else 122 129 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r442 r494 88 88 m_bMFMEnabledFlag = false; 89 89 #endif 90 #if SCALED_REF_LAYER_OFFSETS91 90 m_numScaledRefLayerOffsets = 0; 92 #endif93 #endif94 91 #if POC_RESET_FLAG 95 92 m_pocAdjustmentValue = 0; 96 93 #endif 94 #endif //SVC_EXTENSION 97 95 } 98 96 … … 117 115 m_cGOPEncoder. create(); 118 116 #endif 117 #if AUXILIARY_PICTURES 118 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 119 #else 119 120 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 121 #endif 120 122 m_cCuEncoder. create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight ); 121 123 if (m_bUseSAO) … … 175 177 } 176 178 } 179 180 #if LAYER_CTB 181 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) ); 182 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) ); 183 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) ); 184 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) ); 185 #endif 177 186 } 178 187 … … 601 610 else 602 611 { 612 #if AUXILIARY_PICTURES 613 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 614 #else 603 615 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 616 #endif 604 617 } 605 618 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 801 814 #endif 802 815 816 #if AUXILIARY_PICTURES 817 #if SVC_UPSAMPLING 818 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 819 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 820 #else 821 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 822 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 823 #endif 824 #else 803 825 #if SVC_UPSAMPLING 804 826 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , … … 807 829 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 808 830 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 831 #endif 809 832 #endif 810 833 rpcPic = pcEPic; … … 842 865 #endif 843 866 867 #if AUXILIARY_PICTURES 868 #if SVC_UPSAMPLING 869 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 870 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 871 #else 872 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 873 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 874 #endif 875 #else 844 876 #if SVC_UPSAMPLING 845 877 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 849 881 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 850 882 #endif 883 #endif 851 884 } 852 885 … … 871 904 #if SVC_EXTENSION 872 905 m_cSPS.setLayerId(m_layerId); 873 #endif874 906 #if REF_IDX_MFM 875 907 #if !M0457_COL_PICTURE_SIGNALING … … 877 909 #endif 878 910 #endif 879 #if SCALED_REF_LAYER_OFFSETS880 911 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets); 881 912 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) … … 883 914 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 884 915 } 885 #endif 916 #endif //SVC_EXTENSION 886 917 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 887 918 profileTierLevel.setLevelIdc(m_level); … … 914 945 m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight ); 915 946 m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); 947 #if AUXILIARY_PICTURES 948 m_cSPS.setChromaFormatIdc( m_chromaFormatIDC); 949 #endif 916 950 917 951 Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth ); … … 1188 1222 for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) 1189 1223 { 1190 #if FINAL_RPL_CHANGE_N00821191 GOPEntry ge = m_ppcTEncTop[m_cSPS.getLayerId()]->getGOPEntry(i);1192 #else1193 1224 GOPEntry ge = getGOPEntry(i); 1194 #endif1195 1225 rps = rpsList->getReferencePictureSet(i); 1196 1226 rps->setNumberOfPictures(ge.m_numRefPics); … … 1536 1566 #endif 1537 1567 1538 #if SVC_EXTENSION1539 1568 #if !REPN_FORMAT_IN_VPS 1540 1569 Void TEncTop::xInitILRP() … … 1559 1588 m_cIlpPic[j] = new TComPic; 1560 1589 #if SVC_UPSAMPLING 1590 #if AUXILIARY_PICTURES 1591 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1592 #else 1561 1593 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1594 #endif 1562 1595 #else 1563 1596 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); … … 1611 1644 m_cIlpPic[j] = new TComPic; 1612 1645 #if SVC_UPSAMPLING 1646 #if AUXILIARY_PICTURES 1647 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1648 #else 1613 1649 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1650 #endif 1614 1651 #else 1615 1652 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); … … 1624 1661 } 1625 1662 #endif 1626 Void TEncTop::setILRPic(TComPic *pcPic) 1627 { 1628 for( Int i = 0; i < pcPic->getSlice(0)->getActiveNumILRRefIdx(); i++ ) 1629 { 1630 Int refLayerIdc = pcPic->getSlice(0)->getInterLayerPredLayerIdc(i); 1631 1632 if(m_cIlpPic[refLayerIdc]) 1633 { 1634 m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(refLayerIdc), m_cIlpPic[refLayerIdc]->getPicYuvRec()); 1635 m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC()); 1636 m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(refLayerIdc)->getLayerId()); //set reference layerId 1637 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 1638 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 1639 for (Int j=0; j<m_cIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId 1640 { 1641 m_cIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId(m_cIlpPic[refLayerIdc]->getLayerId()); 1642 } 1643 } 1644 } 1645 } 1646 #endif 1647 #endif 1663 #endif //SVC_EXTENSION 1648 1664 //! \} -
trunk/source/Lib/TLibEncoder/TEncTop.h
r442 r494 140 140 Int m_ilSampleOnlyPred; 141 141 #endif 142 #if SCALED_REF_LAYER_OFFSETS143 142 UInt m_numScaledRefLayerOffsets; 144 143 Window m_scaledRefLayerWindow[MAX_LAYERS]; 145 #endif146 144 #if POC_RESET_FLAG 147 145 Int m_pocAdjustmentValue; 148 146 #endif 149 #endif 147 #endif //SVC_EXTENSION 150 148 protected: 151 149 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 209 207 Int getNumPicRcvd () { return m_iNumPicRcvd; } 210 208 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 211 #if SCALED_REF_LAYER_OFFSETS212 209 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 213 210 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 214 211 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 215 #endif 216 #endif 212 #endif //SVC_EXTENSION 217 213 218 214 // ------------------------------------------------------------------------------------------------------------------- … … 223 219 #if SVC_EXTENSION 224 220 TComPic** getIlpList() { return m_cIlpPic; } 225 Void setILRPic(TComPic *pcPic);226 221 #if REF_IDX_MFM 227 222 Void setMFMEnabledFlag (Bool flag) {m_bMFMEnabledFlag = flag;} -
trunk/source/Lib/TLibEncoder/WeightPredAnalysis.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 … … 51 51 for ( Int iList =0 ; iList<2 ; iList++ ) 52 52 { 53 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 53 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 54 54 { 55 55 for ( Int comp=0 ; comp<3 ;comp++ ) … … 74 74 TComPicYuv* pPic = slice->getPic()->getPicYuvOrg(); 75 75 Int iSample = 0; 76 #if O0194_WEIGHTED_PREDICTION_CGS 77 // Define here to assign the parameter of "iSample" 78 wpACDCParam weightACDCParam[3]; 79 #endif 76 80 77 81 // calculate DC/AC value for Y … … 81 85 pOrg = pPic->getLumaAddr(); 82 86 Int64 iOrgACY = xCalcACValueSlice(slice, pOrg, iOrgNormDCY); 87 #if O0194_WEIGHTED_PREDICTION_CGS 88 weightACDCParam[0].iSamples = iSample; 89 #endif 83 90 84 91 // calculate DC/AC value for Cb … … 88 95 pOrg = pPic->getCbAddr(); 89 96 Int64 iOrgACCb = xCalcACValueUVSlice(slice, pOrg, iOrgNormDCCb); 97 #if O0194_WEIGHTED_PREDICTION_CGS 98 weightACDCParam[1].iSamples = iSample; 99 #endif 90 100 91 101 // calculate DC/AC value for Cr … … 95 105 pOrg = pPic->getCrAddr(); 96 106 Int64 iOrgACCr = xCalcACValueUVSlice(slice, pOrg, iOrgNormDCCr); 97 107 #if O0194_WEIGHTED_PREDICTION_CGS 108 weightACDCParam[2].iSamples = iSample; 109 #endif 110 111 #if !O0194_WEIGHTED_PREDICTION_CGS 98 112 wpACDCParam weightACDCParam[3]; 113 #endif 99 114 weightACDCParam[0].iAC = iOrgACY; 100 115 weightACDCParam[0].iDC = iOrgNormDCY; … … 138 153 for ( Int iList=0 ; iList<2 ; iList++ ) 139 154 { 140 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 141 { 142 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 155 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 156 { 157 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 143 158 { 144 159 wpScalingParam *pwp = &(m_wp[iList][iRefIdx][iComp]); … … 154 169 for ( Int iList=0 ; iList<2 ; iList++ ) 155 170 { 156 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 171 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 157 172 { 158 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 173 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 159 174 { 160 175 wpScalingParam *pwp = &(m_wp[iList][iRefIdx][iComp]); … … 195 210 // selecting whether WP is used, or not 196 211 xSelectWP(slice, m_wp, iDenom); 197 212 198 213 slice->setWpScaling( m_wp ); 199 214 … … 216 231 slice->getWpAcDcParam(currWeightACDCParam); 217 232 slice->getRefPic(eRefPicList, refIdxTemp)->getSlice(0)->getWpAcDcParam(refWeightACDCParam); 233 #if O0194_WEIGHTED_PREDICTION_CGS 234 UInt currLayerId = slice->getLayerId(); 235 UInt refLayerId = slice->getRefPic(eRefPicList, refIdxTemp)->getLayerId(); 236 Bool validILRPic = slice->getRefPic(eRefPicList, refIdxTemp)->isILR( currLayerId ) && refLayerId == 0; 237 238 if( validILRPic ) 239 { 240 refWeightACDCParam = (wpACDCParam *)g_refWeightACDCParam; 241 } 242 #endif 218 243 219 244 for ( Int comp = 0; comp < 3; comp++ ) … … 229 254 Int64 refDC = refWeightACDCParam[comp].iDC; 230 255 Int64 refAC = refWeightACDCParam[comp].iAC; 256 #if O0194_WEIGHTED_PREDICTION_CGS 257 if( validILRPic ) 258 { 259 refAC = ( refAC * currWeightACDCParam[comp].iSamples ) /refWeightACDCParam[comp].iSamples; 260 #if O0194_JOINT_US_BITSHIFT 261 refAC <<= (g_bitDepthYLayer[currLayerId]-g_bitDepthYLayer[refLayerId]); 262 refDC <<= (g_bitDepthYLayer[currLayerId]-g_bitDepthYLayer[refLayerId]); 263 #endif 264 } 265 #endif 231 266 232 267 // calculating iWeight and iOffset params … … 234 269 Int weight = (Int)( 0.5 + dWeight * (Double)(1<<log2Denom) ); 235 270 Int offset = (Int)( ((currDC<<log2Denom) - ((Int64)weight * refDC) + (Int64)realOffset) >> realLog2Denom ); 271 #if O0194_WEIGHTED_PREDICTION_CGS 272 if( !validILRPic ) 273 { 274 dWeight = 1; 275 offset = 0; 276 } 277 weight = (Int)( 0.5 + dWeight * (Double)(1<<log2Denom) ); 278 #endif 236 279 237 280 // Chroma offset range limitation … … 253 296 if(deltaWeight > 127 || deltaWeight < -128) 254 297 return (false); 298 #if O0194_WEIGHTED_PREDICTION_CGS 299 // make sure the reference frames other than ILR are not using weighted prediction 300 else 301 if( !validILRPic ) 302 { 303 continue; 304 } 305 #endif 255 306 256 307 m_wp[refList][refIdxTemp][comp].bPresentFlag = true; … … 264 315 } 265 316 266 /** select whether weighted pred enables or not. 317 /** select whether weighted pred enables or not. 267 318 * \param TComSlice *slice 268 319 * \param wpScalingParam … … 325 376 } 326 377 327 /** calculate DC value of original image for luma. 378 /** calculate DC value of original image for luma. 328 379 * \param TComSlice *slice 329 380 * \param Pel *pPel … … 345 396 } 346 397 347 /** calculate AC value of original image for luma. 398 /** calculate AC value of original image for luma. 348 399 * \param TComSlice *slice 349 400 * \param Pel *pPel … … 363 414 } 364 415 365 /** calculate DC value of original image for chroma. 416 /** calculate DC value of original image for chroma. 366 417 * \param TComSlice *slice 367 418 * \param Pel *pPel … … 383 434 } 384 435 385 /** calculate AC value of original image for chroma. 436 /** calculate AC value of original image for chroma. 386 437 * \param TComSlice *slice 387 438 * \param Pel *pPel … … 401 452 } 402 453 403 /** calculate DC value. 454 /** calculate DC value. 404 455 * \param Pel *pPel 405 456 * \param Int iWidth … … 423 474 } 424 475 425 /** calculate AC value. 476 /** calculate AC value. 426 477 * \param Pel *pPel 427 478 * \param Int iWidth … … 446 497 } 447 498 448 /** calculate SAD values for both WP version and non-WP version. 499 /** calculate SAD values for both WP version and non-WP version. 449 500 * \param Pel *pOrgPel 450 501 * \param Pel *pRefPel -
trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
r442 r494 473 473 { 474 474 dstPicYuv = new TComPicYuv; 475 #if AUXILIARY_PICTURES 476 dstPicYuv->create( pPicYuv->getWidth(), pPicYuv->getHeight(), pPicYuv->getChromaFormat(), 1, 1, 0 ); 477 #else 475 478 dstPicYuv->create( pPicYuv->getWidth(), pPicYuv->getHeight(), 1, 1, 0 ); 479 #endif 476 480 pPicYuv->copyToPic(dstPicYuv); 477 481 … … 567 571 { 568 572 dstPicTop = new TComPicYuv; 573 #if AUXILIARY_PICTURES 574 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), pPicTop->getChromaFormat(), 1, 1, 0 ); 575 #else 569 576 dstPicTop->create( pPicTop->getWidth(), pPicTop->getHeight(), 1, 1, 0 ); 577 #endif 570 578 pPicTop->copyToPic(dstPicTop); 571 579 572 580 dstPicBottom = new TComPicYuv; 581 #if AUXILIARY_PICTURES 582 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), pPicBottom->getChromaFormat(), 1, 1, 0 ); 583 #else 573 584 dstPicBottom->create( pPicBottom->getWidth(), pPicBottom->getHeight(), 1, 1, 0 ); 585 #endif 574 586 pPicBottom->copyToPic(dstPicBottom); 575 587
Note: See TracChangeset for help on using the changeset viewer.