Changeset 1131 in 3DVCSoftware for branches/HTM-13.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 18 Feb 2015, 17:39:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-13.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r1124 r1131 179 179 } 180 180 #endif 181 #if LGE_DEFAULT_DV_J0046182 181 m_iDefaultRefViewIdx = -1; 183 182 m_bDefaultRefViewIdxAvailableFlag = false; 184 #endif185 183 } 186 184 … … 1879 1877 m_vpsBaseLayerAvailableFlag = true; 1880 1878 1881 #if H_MV_FIX_NUM_VIEWS1882 1879 m_numViews = 0; 1883 #endif1884 1880 1885 1881 #endif … … 1918 1914 m_repFormatIdxPresentFlag = false; 1919 1915 m_maxOneActiveRefLayerFlag = false; 1920 #if H_MV_HLS_FIX1921 1916 m_vpsPocLsbAlignedFlag = false; 1922 #endif1923 1917 m_directDepTypeLenMinus2 = 0; 1924 1918 … … 1956 1950 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1957 1951 m_numDirectRefLayers[i] = 0; 1958 #if HHI_DEPENDENCY_SIGNALLING_I1_J01071959 1952 #if H_3D 1960 1953 m_numRefListLayers[i] = 0; 1961 #endif1962 1954 #endif 1963 1955 m_vpsRepFormatIdx [i] = 0; … … 1968 1960 #if H_3D 1969 1961 m_viewIndex [i] = -1; 1970 #if !HHI_TOOL_PARAMETERS_I2_J01071971 m_vpsDepthModesFlag [i] = false;1972 m_ivMvScalingFlag[i] = true;1973 m_bIVPFlag [i] = false;1974 #if MTK_SINGLE_DEPTH_VPS_FLAG_J00601975 m_singleDepthModeFlag[ i ] = false;1976 #endif1977 #endif1978 1962 #endif 1979 1963 … … 1984 1968 m_dependencyFlag [i][j] = false; 1985 1969 m_idDirectRefLayer[i][j] = -1; 1986 #if HHI_DEPENDENCY_SIGNALLING_I1_J01071987 1970 #if H_3D 1988 1971 m_idRefListLayer[i][j] = -1; 1989 #endif1990 1972 #endif 1991 1973 m_idPredictedLayer[i][j] = -1; … … 1999 1981 } 2000 1982 #if H_3D_ARP 2001 #if !HHI_TOOL_PARAMETERS_I2_J01072002 m_uiUseAdvResPred[i] = 0;2003 m_uiARPStepNum[i] = 1;2004 #endif2005 1983 #endif 2006 1984 } … … 2008 1986 m_dpbSize = new TComDpbSize; 2009 1987 2010 #if !HHI_TOOL_PARAMETERS_I2_J01072011 #if H_3D2012 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )2013 {2014 #if H_3D_IV_MERGE2015 m_ivMvPredFlag [ i ] = false;2016 #if H_3D_SPIVMP2017 m_iSubPULog2Size [ i ] = 0;2018 #endif2019 #endif2020 #if H_3D_QTLPC2021 m_bLimQtPredFlag [ i ] = false;2022 #endif2023 #if H_3D_VSP2024 m_viewSynthesisPredFlag[ i ] = false;2025 #endif2026 #if H_3D_NBDV_REF2027 m_depthRefinementFlag [ i ] = false;2028 #endif2029 #if H_3D_INTER_SDC2030 m_bInterSDCFlag [ i ] = false;2031 #endif2032 #if H_3D2033 m_bIVPFlag [ i ] = false;2034 #endif2035 #if H_3D_DBBP2036 m_dbbpFlag [ i ] = false;2037 #endif2038 #if H_3D_IV_MERGE2039 m_bMPIFlag [ i ] = false;2040 #endif2041 }2042 #endif2043 #endif2044 1988 2045 1989 #endif … … 2132 2076 Int iNuhLId = getLayerIdInNuh( i ); 2133 2077 Int d = 0; 2134 #if HHI_DEPENDENCY_SIGNALLING_I1_J01072135 2078 #if H_3D 2136 2079 Int l = 0; 2137 2080 #endif 2138 #endif2139 2081 Int r = 0; 2140 2082 Int p = 0; … … 2147 2089 m_idDirectRefLayer[iNuhLId][d++] = jNuhLid; 2148 2090 } 2149 #if HHI_DEPENDENCY_SIGNALLING_I1_J01072150 2091 #if H_3D 2151 2092 if( getDirectDependencyFlag( i , j ) && ( getDepthId( iNuhLId ) == getDepthId( jNuhLid ) )) … … 2154 2095 } 2155 2096 #endif 2156 #endif2157 2097 2158 2098 if( getDependencyFlag( i , j ) ) … … 2166 2106 } 2167 2107 m_numDirectRefLayers[ iNuhLId ] = d; 2168 #if HHI_DEPENDENCY_SIGNALLING_I1_J01072169 2108 #if H_3D 2170 2109 m_numRefListLayers[ iNuhLId ] = l; 2171 #endif2172 2110 #endif 2173 2111 … … 2206 2144 2207 2145 2208 #if H_MV_FIX_NUM_VIEWS2209 2146 Void TComVPS::initNumViews( ) 2210 2147 { … … 2242 2179 } 2243 2180 } 2244 #endif2245 2181 2246 2182 … … 2403 2339 } 2404 2340 2405 #if !H_MV_FIX_NUM_VIEWS2406 Int TComVPS::getNumViews()2407 {2408 Int numViews = 1;2409 for( Int i = 0; i <= getMaxLayersMinus1(); i++ )2410 {2411 Int lId = getLayerIdInNuh( i );2412 if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )2413 {2414 numViews++;2415 }2416 }2417 return numViews;2418 }2419 #endif2420 2341 2421 2342 … … 2656 2577 xPrintArray( "IdRefLayer" , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true ); 2657 2578 xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true ); 2658 #if HHI_DEPENDENCY_SIGNALLING_I1_J01072659 2579 #if H_3D 2660 2580 xPrintArray( "IdRefListLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefListLayers, m_idRefListLayer, true ); 2661 #endif2662 2581 #endif 2663 2582 … … 3084 3003 i++; 3085 3004 } 3086 #if SHARP_DLT_SIMP_J00293087 3005 iIdxUp = bFound ? iIdxDown + 1 : iNumDepthValues-1; 3088 #else3089 // iterate over indices to find upper closest depth3090 i = iNumDepthValues-2;3091 bFound = false;3092 while(!bFound && i>=0)3093 {3094 if( m_iIdx2DepthValue[layerIdInVps][i] < p )3095 {3096 iIdxUp = i+1;3097 bFound = true;3098 }3099 3100 i--;3101 }3102 3103 // assert monotony3104 assert(iIdxDown<=iIdxUp);3105 #endif3106 3006 3107 3007 // assign closer depth value/idx … … 3684 3584 { 3685 3585 TComVPS* vps = getVPS(); 3686 #if HHI_DEPENDENCY_SIGNALLING_I1_J01073687 3586 #if H_3D 3688 3587 Int refLayerIdx = vps->getLayerIdInVps( vps->getIdRefListLayer( getLayerId(), i ) ); … … 3690 3589 Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) ); 3691 3590 #endif 3692 #else 3693 Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) ); 3694 #endif 3695 3696 #if H_MV_FIX_REF_LAYER_PIC_FLAG 3591 3697 3592 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() && ( getTLayer() == 0 || 3698 3593 vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() )); 3699 #else3700 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && ( getTLayer() == 0 ) &&3701 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );3702 #endif3703 3594 return refLayerPicFlag; 3704 3595 } … … 3708 3599 Int refLayerPicIdc = -1; 3709 3600 Int curj = 0; 3710 #if HHI_DEPENDENCY_SIGNALLING_I1_J01073711 3601 #if H_3D 3712 3602 for( Int i = 0; i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ ) … … 3714 3604 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 3715 3605 #endif 3716 #else3717 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )3718 #endif3719 3606 { 3720 3607 if( getRefLayerPicFlag( i ) ) … … 3737 3624 { 3738 3625 Int numRefLayerPics = 0; 3739 #if HHI_DEPENDENCY_SIGNALLING_I1_J01073740 3626 #if H_3D 3741 3627 for( Int i = 0; i < getVPS()->getNumRefListLayers( getLayerId()) ; i++ ) … … 3743 3629 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 3744 3630 #endif 3745 #else3746 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )3747 #endif3748 3631 { 3749 3632 numRefLayerPics += getRefLayerPicFlag( i ); … … 3770 3653 numActiveRefLayerPics = 0; 3771 3654 } 3772 #if HHI_DEPENDENCY_SIGNALLING_I1_J01073773 3655 #if H_3D 3774 3656 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumRefListLayers( getLayerId() ) == 1 ) … … 3776 3658 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3777 3659 #endif 3778 #else3779 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )3780 #endif3781 3660 { 3782 3661 numActiveRefLayerPics = 1; … … 3791 3670 Int TComSlice::getRefPicLayerId( Int i ) 3792 3671 { 3793 #if HHI_DEPENDENCY_SIGNALLING_I1_J01073794 3672 #if H_3D 3795 3673 return getVPS()->getIdRefListLayer( getLayerId(), getInterLayerPredLayerIdc( i ) ); … … 3797 3675 return getVPS()->getIdDirectRefLayer( getLayerId(), getInterLayerPredLayerIdc( i ) ); 3798 3676 #endif 3799 #else 3800 return getVPS()->getIdDirectRefLayer( getLayerId(), getInterLayerPredLayerIdc( i ) ); 3801 #endif 3802 } 3803 3804 #if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037 3677 } 3678 #if H_3D 3805 3679 Void TComSlice::setDefaultRefView( ) 3806 3680 { … … 3839 3713 { 3840 3714 Bool tempRefPicInListsFlag = false; 3841 #if HHI_TOOL_PARAMETERS_I2_J01073842 3715 if( !getIvResPredFlag() || this->isIRAP()) 3843 #else3844 if(!getVPS()->getUseAdvRP(getLayerId()) || this->isIRAP())3845 #endif3846 3716 { 3847 3717 m_nARPStepNum = 0; … … 3871 3741 } 3872 3742 } 3873 #if SEC_ARP_VIEW_REF_CHECK_J00373874 3743 tempRefPicInListsFlag = (getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0) && getDefaultRefViewIdxAvailableFlag(); 3875 #else3876 tempRefPicInListsFlag = getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0;3877 #endif3878 #if HHI_TOOL_PARAMETERS_I2_J01073879 3744 m_nARPStepNum = tempRefPicInListsFlag ? H_3D_ARP_WFNR : 0; 3880 #else3881 m_nARPStepNum = tempRefPicInListsFlag ? getVPS()->getARPStepNum(getLayerId()) : 0;3882 #endif3883 3745 } 3884 3746 … … 4063 3925 Bool setupLUT = false; 4064 3926 4065 #if HHI_TOOL_PARAMETERS_I2_J01074066 3927 setupLUT = setupLUT || getViewSynthesisPredFlag( ); 4067 #else4068 Int layerIdInVPS = getVPS()->getLayerIdInNuh( m_layerId );4069 #if H_3D_VSP4070 setupLUT = setupLUT || getVPS()->getViewSynthesisPredFlag( layerIdInVPS);4071 #endif4072 #endif4073 3928 4074 3929 #if H_3D_NBDV_REF 4075 #if HHI_TOOL_PARAMETERS_I2_J01074076 3930 setupLUT = setupLUT || getDepthRefinementFlag( ); 4077 #else4078 setupLUT = setupLUT || getVPS()->getDepthRefinementFlag( layerIdInVPS );4079 #endif4080 3931 #endif 4081 3932 4082 3933 #if H_3D_IV_MERGE 4083 #if HHI_TOOL_PARAMETERS_I2_J01074084 3934 setupLUT = setupLUT || ( getIvMvPredFlag() && getIsDepth() ); 4085 #else 4086 setupLUT = setupLUT || ( getVPS()->getIvMvPredFlag(layerIdInVPS ) && getIsDepth() ); 4087 #endif 4088 #endif 4089 4090 #if !LGE_DDD_REMOVAL_J0042_J0030 4091 #if H_3D_DDD 4092 #if H_3D_FCO 4093 if( getIsDepth() && getViewIndex() > 0 && getVPS()->getMPIFlag(layerIdInVPS)) 4094 #else 4095 if( getIsDepth() && getViewIndex() > 0 ) 4096 #endif 4097 { 4098 TComSlice *pcTextSlice = getTexturePic()->getSlice( 0 ); 4099 memcpy( m_aiDDDInvScale, pcTextSlice->m_aiDDDInvScale, sizeof( Int ) * getViewIndex() ); 4100 memcpy( m_aiDDDInvOffset, pcTextSlice->m_aiDDDInvOffset, sizeof( Int ) * getViewIndex() ); 4101 memcpy( m_aiDDDShift, pcTextSlice->m_aiDDDShift, sizeof( Int ) * getViewIndex() ); 4102 } 4103 #endif 4104 #endif 3935 #endif 3936 4105 3937 4106 3938 if( !setupLUT ) … … 4151 3983 m_depthToDisparityF[ i ][ d ] = ( invCodScale[ i ] * d + invOffset ) >> log2Div; 4152 3984 } 4153 #if !LGE_DDD_REMOVAL_J0042_J0030 4154 #if H_3D_DDD 4155 initializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i ); 4156 #endif 4157 #endif 4158 } 4159 } 4160 #endif 4161 #endif 4162 4163 #if !LGE_DDD_REMOVAL_J0042_J0030 4164 #if H_3D_DDD 4165 Void TComSlice::initializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ) 4166 { 4167 UInt uiViewId = getViewIndex(); 4168 4169 if( uiViewId == 0 ) 4170 { 4171 m_aiDDDInvScale[ iBaseViewIdx ] = m_aiDDDInvOffset[ iBaseViewIdx ] = m_aiDDDShift[ iBaseViewIdx ] = 0; 4172 return; 4173 } 4174 4175 4176 Int iSign = iCodedScale >= 0 ? 1 : -1; 4177 iCodedScale = abs( iCodedScale ); 4178 4179 Int iBitWidth = 0; 4180 4181 const Int iInvPres = 9; 4182 4183 while( ((( 1 << iBitWidth ) << 1 ) <= iCodedScale ) ) 4184 { 4185 iBitWidth ++; 4186 } 4187 iBitWidth += iInvPres; 4188 Int iTargetValue = 1 << iBitWidth; 4189 4190 Int iMinError = MAX_INT; 4191 Int iBestD = 1 << ( iInvPres - 1 ); 4192 for( Int d = 1 << ( iInvPres - 1 ); d < ( 1 << iInvPres ); d++ ) 4193 { 4194 Int iError = abs( iCodedScale * d - iTargetValue ); 4195 if( iError < iMinError ) 4196 { 4197 iMinError = iError; 4198 iBestD = d; 4199 } 4200 if( iMinError == 0 ) 4201 { 4202 break; 4203 } 4204 } 4205 Int iRoundingDir = 0; 4206 if( iCodedScale * iBestD > iTargetValue ) 4207 { 4208 iRoundingDir = -1; 4209 } 4210 else if( iCodedScale * iBestD < iTargetValue ) 4211 { 4212 iRoundingDir = 1; 4213 } 4214 Int iCamPres = uiCamParsCodedPrecision - 1; 4215 m_aiDDDInvScale [ iBaseViewIdx ] = ( iBestD << ( iCamPres + g_bitDepthY )) * iSign; 4216 m_aiDDDInvOffset[ iBaseViewIdx ] = -iSign * iBestD * ( iCodedOffset << g_bitDepthY ); 4217 m_aiDDDShift [ iBaseViewIdx ] = iBitWidth; 4218 m_aiDDDInvOffset[ iBaseViewIdx ] += 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 1 ); 4219 m_aiDDDInvOffset[ iBaseViewIdx ] += ( 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 4 ) ) * iRoundingDir; 4220 4221 return; 4222 } 4223 4224 4225 #endif 4226 #endif 3985 } 3986 } 3987 #endif 3988 #endif 3989 4227 3990 4228 3991 #if H_MV … … 4258 4021 #endif 4259 4022 4260 #if !LGE_DDD_REMOVAL_J0042_J0030 4261 #if H_3D_DBBP 4262 Int TComSlice::getDepthFromDV( Int iDV, Int iBaseViewIdx ) 4263 { 4264 return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]); 4265 } 4266 #endif 4267 #endif 4268 4269 #if HHI_TOOL_PARAMETERS_I2_J0107 4023 4270 4024 #if H_3D 4271 4025 … … 4364 4118 } 4365 4119 #endif 4366 #endif4367 4120 4368 4121
Note: See TracChangeset for help on using the changeset viewer.