Changeset 1225 in 3DVCSoftware for branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon
- Timestamp:
- 22 May 2015, 05:38:04 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/ContextTables.h
r1200 r1225 166 166 #endif 167 167 168 #if H_3D_IC168 #if NH_3D_IC 169 169 #define NUM_IC_FLAG_CTX 1 ///< number of context models for illumination compensation flag 170 170 #endif … … 552 552 553 553 #endif 554 #if H_3D_IC554 #if NH_3D_IC 555 555 static const UChar 556 556 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComCodingStatistics.h
r1200 r1225 92 92 STATS__CABAC_BITS__ALIGNED_SIGN_BIT, 93 93 STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS, 94 #if NH_3D_IC 95 STATS__CABAC_BITS__3D_IC, 96 #endif 94 97 STATS__NUM_STATS 95 98 }; … … 142 145 "CABAC_BITS__ALIGNED_SIGN_BIT", 143 146 "CABAC_BITS__ALIGNED_ESCAPE_BITS" 147 #if NH_3D_IC 148 "CABAC_BITS__3D_IC" 149 #endif 144 150 }; 145 151 assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(Char *) && name < STATS__NUM_STATS); -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.cpp
r1213 r1225 137 137 m_puhARPW = NULL; 138 138 #endif 139 #if H_3D_IC139 #if NH_3D_IC 140 140 m_pbICFlag = NULL; 141 141 #endif … … 252 252 m_puhARPW = new UChar[ uiNumPartition]; 253 253 #endif 254 #if H_3D_IC254 #if NH_3D_IC 255 255 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 256 256 #endif … … 471 471 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } 472 472 #endif 473 #if H_3D_IC473 #if NH_3D_IC 474 474 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 475 475 #endif … … 601 601 m_puhARPW [ui] = pcFrom->getARPW( ui ); 602 602 #endif 603 #if H_3D_IC604 m_pbICFlag[ui] = pcFrom->m_pbICFlag[ui];603 #if NH_3D_IC 604 memset( m_pbICFlag , false, m_uiNumPartition * sizeof( *m_pbICFlag ) ); 605 605 #endif 606 606 … … 654 654 memset( m_puhARPW + firstElement, 0, numElements * sizeof( UChar ) ); 655 655 #endif 656 #if H_3D_IC657 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) );658 #endif659 660 656 661 657 #if H_3D_DIM … … 815 811 m_puhARPW[ui] = 0; 816 812 #endif 817 #if H_3D_IC813 #if NH_3D_IC 818 814 m_pbICFlag[ui] = false; 819 815 #endif … … 926 922 memset( m_puhHeight, uhHeight, iSizeInUchar ); 927 923 memset( m_pbIPCMFlag, 0, iSizeInBool ); 928 #if H_3D_IC924 #if NH_3D_IC 929 925 memset( m_pbICFlag, 0, iSizeInBool ); 930 926 #endif … … 986 982 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 987 983 #endif 988 #if H_3D_IC984 #if NH_3D_IC 989 985 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 990 986 #endif … … 1093 1089 m_puhARPW = pcCU->getARPW() + uiPart; 1094 1090 #endif 1095 #if H_3D_IC1091 #if NH_3D_IC 1096 1092 m_pbICFlag = pcCU->getICFlag() + uiPart; 1097 1093 #endif … … 1259 1255 } 1260 1256 #endif 1261 #if H_3D_IC1257 #if NH_3D_IC 1262 1258 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 1263 1259 #endif … … 1383 1379 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1384 1380 #endif 1385 #if H_3D_IC1381 #if NH_3D_IC 1386 1382 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1387 1383 #endif … … 1504 1500 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1505 1501 #endif 1506 #if H_3D_IC1507 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool);1502 #if NH_3D_IC 1503 memcpy( pCtu->getICFlag() + m_absZIdxInCtu, m_pbICFlag, sizeof( *m_pbICFlag ) * m_uiNumPartition ); 1508 1504 #endif 1509 1505 … … 1545 1541 #if H_3D_ARP 1546 1542 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar ); 1547 #endif1548 #if H_3D_IC1549 memcpy( rpcCU->getICFlag() + uiPartOffset, m_pbICFlag, iSizeInBool );1550 1543 #endif 1551 1544 … … 2731 2724 2732 2725 // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx 2733 #if H_3D_IC2726 #if NH_3D_IC 2734 2727 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2735 2728 { … … 3699 3692 #endif 3700 3693 3701 #if H_3D_IC3694 #if NH_3D_IC 3702 3695 Bool bICFlag = getICFlag(uiAbsPartIdx); 3703 3696 #endif … … 3737 3730 #if H_3D_VSP 3738 3731 , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3739 #if H_3D_IC3732 #if NH_3D_IC 3740 3733 && !bICFlag 3741 3734 #endif … … 4185 4178 if ( 4186 4179 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 4187 #if H_3D_IC4180 #if NH_3D_IC 4188 4181 !bICFlag && 4189 4182 #endif … … 5222 5215 return ( getSkipFlag( uiPartIdx ) ); 5223 5216 } 5224 5225 #if H_3D_IC5226 Bool TComDataCU::isIC( UInt uiPartIdx )5227 {5228 if ( m_pcSlice->isIntra () )5229 {5230 return false;5231 }5232 return ( ( getSkipFlag(uiPartIdx) || getPredictionMode(uiPartIdx) == MODE_INTER) && getICFlag( uiPartIdx ) && isICFlagRequired( uiPartIdx ) );5233 }5234 #endif5235 5217 5236 5218 // ==================================================================================================================== … … 6681 6663 #endif 6682 6664 6683 #if H_3D_IC6665 #if NH_3D_IC 6684 6666 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 6685 6667 { 6686 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPart InCU() >> ( 2 * uiDepth ))*sizeof(Bool) );6668 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartitionsInCtu() >> ( 2 * uiDepth ))*sizeof(Bool) ); 6687 6669 } 6688 6670 -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComDataCU.h
r1213 r1225 179 179 UChar* m_puhARPW; 180 180 #endif 181 #if H_3D_IC181 #if NH_3D_IC 182 182 Bool* m_pbICFlag; ///< array of IC flags 183 183 #endif … … 536 536 Double getARPWFactor ( UInt uiIdx ); 537 537 #endif 538 #if H_3D_IC538 #if NH_3D_IC 539 539 Bool* getICFlag () { return m_pbICFlag; } 540 540 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } … … 705 705 Bool isBipredRestriction( UInt puIdx ); 706 706 707 #if H_3D_IC708 Bool isIC ( UInt uiPartIdx );709 #endif710 711 707 // ------------------------------------------------------------------------------------------------------------------- 712 708 // member functions for symbol prediction (most probable / mode conversion) -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPattern.h
r1200 r1225 81 81 // TComPatternParam m_cPatternCb; 82 82 //TComPatternParam m_cPatternCr; 83 #if H_3D_IC83 #if NH_3D_IC 84 84 Bool m_bICFlag; 85 85 #endif … … 98 98 Int getBitDepthY() { return m_cPatternY.m_bitDepth; } 99 99 100 #if H_3D_IC100 #if NH_3D_IC 101 101 Bool getICFlag() { return m_bICFlag; } 102 102 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.cpp
r1200 r1225 201 201 } 202 202 } 203 #if H_3D_IC203 #if NH_3D_IC 204 204 m_uiaShift[0] = 0; 205 205 for( Int i = 1; i < 64; i++ ) … … 1398 1398 { 1399 1399 #endif 1400 #if H_3D_IC 1401 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 1402 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1400 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++) 1401 { 1402 const ComponentID compID=ComponentID(comp); 1403 #if NH_3D_IC 1404 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) ); 1405 xPredInterBlk(compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) 1403 1406 #if H_3D_ARP 1404 1407 , false 1405 1408 #endif 1406 1409 , bICFlag ); 1407 bICFlag = bICFlag && (iWidth > 8);1408 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi1409 #if H_3D_ARP1410 , false1411 #endif1412 , bICFlag );1413 1410 #else 1414 1415 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)1416 {1417 const ComponentID compID=ComponentID(comp);1418 1411 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) ); 1419 } 1420 #endif 1412 #endif 1413 } 1421 1414 #if H_3D_ARP 1422 1415 } … … 1902 1895 , Bool filterType 1903 1896 #endif 1904 #if H_3D_IC1897 #if NH_3D_IC 1905 1898 , Bool bICFlag 1906 1899 #endif … … 1925 1918 { 1926 1919 refOffset = mv->getHor() + mv->getVer() * refStride; 1927 ref = refPic->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refOffset; 1920 ref = refPic->getAddr(compID, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refOffset; 1921 1928 1922 xFrac = 0; 1929 1923 yFrac = 0; … … 1938 1932 if ( yFrac == 0 ) 1939 1933 { 1940 #if H_3D_IC1941 m_if.filterHor Luma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag1934 #if NH_3D_IC 1935 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag, chFmt, bitDepth 1942 1936 #else 1943 1937 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth … … 1950 1944 else if ( xFrac == 0 ) 1951 1945 { 1952 #if H_3D_IC1953 m_if.filterVer Luma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag1946 #if NH_3D_IC 1947 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag, chFmt, bitDepth 1954 1948 #else 1955 1949 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth … … 1972 1966 #endif 1973 1967 ); 1974 #if H_3D_IC1975 m_if.filterVer Luma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag1968 #if NH_3D_IC 1969 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi || bICFlag, chFmt, bitDepth 1976 1970 #else 1977 1971 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth … … 1983 1977 } 1984 1978 1985 #if H_3D_IC1979 #if NH_3D_IC 1986 1980 if( bICFlag ) 1987 1981 { 1988 1982 Int a, b, i, j; 1989 1983 const Int iShift = IC_CONST_SHIFT; 1990 1991 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1992 1993 1994 for ( i = 0; i < height; i++ )1995 { 1996 for ( j = 0; j < width; j++ )1997 { 1998 dst[j] = Clip3( 0, ( 1 << g_bitDepthY) - 1, ( ( a*dst[j] ) >> iShift ) + b );1984 Pel *dst2 = dst; 1985 1986 xGetLLSICPrediction( compID, cu, mv, refPic, a, b, bitDepth ); 1987 1988 for ( i = 0; i < cxHeight; i++ ) 1989 { 1990 for ( j = 0; j < cxWidth; j++ ) 1991 { 1992 dst[j] = Clip3( 0, ( 1 << bitDepth ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1999 1993 } 2000 1994 dst += dstStride; … … 2003 1997 if(bi) 2004 1998 { 2005 Pel *dst2 = dstPic->getLumaAddr( partAddr ); 2006 Int shift = IF_INTERNAL_PREC - g_bitDepthY; 2007 for (i = 0; i < height; i++) 2008 { 2009 for (j = 0; j < width; j++) 1999 Int shift = IF_INTERNAL_PREC - bitDepth; 2000 for (i = 0; i < cxHeight; i++) 2001 { 2002 for (j = 0; j < cxWidth; j++) 2010 2003 { 2011 Shortval = dst2[j] << shift;2012 dst2[j] = val - ( Short)IF_INTERNAL_OFFS;2004 Pel val = dst2[j] << shift; 2005 dst2[j] = val - (Pel)IF_INTERNAL_OFFS; 2013 2006 } 2014 2007 dst2 += dstStride; … … 2020 2013 } 2021 2014 2022 2023 #if H_3D_ARP2024 , Bool filterType2025 #endif2026 #if H_3D_IC2027 , Bool bICFlag2028 #endif2029 #if H_3D_IC2030 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag2031 #else2032 #endif2033 #if H_3D_ARP2034 , filterType2035 #endif2036 #if H_3D_IC2037 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag2038 #else2039 #endif2040 #if H_3D_ARP2041 , filterType2042 #endif2043 #if H_3D_IC2044 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag2045 #else2046 #endif2047 #if H_3D_ARP2048 , filterType2049 #endif2050 #if H_3D_IC2051 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag2052 #else2053 #endif2054 #if H_3D_ARP2055 , filterType2056 #endif2057 #if H_3D_ARP2058 , filterType2059 #endif2060 #if H_3D_IC2061 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag2062 #else2063 #endif2064 #if H_3D_ARP2065 , filterType2066 #endif2067 #if H_3D_ARP2068 , filterType2069 #endif2070 #if H_3D_IC2071 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag2072 #else2073 #endif2074 #if H_3D_ARP2075 , filterType2076 #endif2077 #if H_3D_IC2078 if( bICFlag )2079 {2080 Int a, b, i, j;2081 const Int iShift = IC_CONST_SHIFT;2082 2083 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb2084 for ( i = 0; i < cxHeight; i++ )2085 {2086 for ( j = 0; j < cxWidth; j++ )2087 {2088 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b );2089 }2090 dstCb += dstStride;2091 }2092 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr2093 for ( i = 0; i < cxHeight; i++ )2094 {2095 for ( j = 0; j < cxWidth; j++ )2096 {2097 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b );2098 }2099 dstCr += dstStride;2100 }2101 2102 if(bi)2103 {2104 Pel* dstCb2 = dstPic->getCbAddr( partAddr );2105 Pel* dstCr2 = dstPic->getCrAddr( partAddr );2106 Int shift = IF_INTERNAL_PREC - g_bitDepthC;2107 for (i = 0; i < cxHeight; i++)2108 {2109 for (j = 0; j < cxWidth; j++)2110 {2111 Short val = dstCb2[j] << shift;2112 dstCb2[j] = val - (Short)IF_INTERNAL_OFFS;2113 2114 val = dstCr2[j] << shift;2115 dstCr2[j] = val - (Short)IF_INTERNAL_OFFS;2116 }2117 dstCb2 += dstStride;2118 dstCr2 += dstStride;2119 }2120 }2121 }2122 #endif2123 2015 Void TComPrediction::xWeightedAverage( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* pcYuvDst, const BitDepths &clipBitDepths 2124 2016 ) … … 2265 2157 (uiDirMode==HOR_IDX || uiDirMode==VER_IDX); 2266 2158 } 2267 #if H_3D_IC2159 #if NH_3D_IC 2268 2160 /** Function for deriving the position of first non-zero binary bit of a value 2269 2161 * \param x input value … … 2295 2187 /** Function for deriving LM illumination compensation. 2296 2188 */ 2297 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType)2189 Void TComPrediction::xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth ) 2298 2190 { 2299 2191 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 2300 2192 Pel *pRec = NULL, *pRef = NULL; 2301 2193 UInt uiWidth, uiHeight, uiTmpPartIdx; 2302 Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();2303 Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();2194 Int iRecStride = pRecPic->getStride(compID); 2195 Int iRefStride = pRefPic->getStride(compID); 2304 2196 Int iRefOffset, iHor, iVer; 2305 2197 iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 ); 2306 2198 iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 ); 2307 if( eType != TEXT_LUMA)2199 if( !isLuma(compID) ) 2308 2200 { 2309 2201 iHor = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getHor() + 1 ) >> 1 ) : ( ( pMv->getHor() + 4 ) >> 3 ); 2310 2202 iVer = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getVer() + 1 ) >> 1 ) : ( ( pMv->getVer() + 4 ) >> 3 ); 2311 2203 } 2312 uiWidth = ( eType == TEXT_LUMA ) ? pcCU->getWidth( 0 ) : ( pcCU->getWidth( 0 ) >> 1);2313 uiHeight = ( eType == TEXT_LUMA ) ? pcCU->getHeight( 0 ) : ( pcCU->getHeight( 0 ) >> 1);2204 uiWidth = pcCU->getWidth( 0 ) >> pRefPic->getComponentScaleX(compID); 2205 uiHeight = pcCU->getHeight( 0 ) >> pRefPic->getComponentScaleY(compID); 2314 2206 2315 2207 Int i, j, iCountShift = 0; 2316 2208 2317 // LLS parameters estimation --> 2318 2209 // LLS parameters estimation 2319 2210 Int x = 0, y = 0, xx = 0, xy = 0; 2320 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 2321 2322 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) ) 2211 Int precShift = std::max(0, bitDepth - 12); 2212 2213 UInt partAddr = 0; 2214 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) ) 2323 2215 { 2324 2216 iRefOffset = iHor + iVer * iRefStride - iRefStride; 2325 if( eType == TEXT_LUMA ) 2326 { 2327 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2328 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2329 } 2330 else if( eType == TEXT_CHROMA_U ) 2331 { 2332 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2333 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2334 } 2335 else 2336 { 2337 assert( eType == TEXT_CHROMA_V ); 2338 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2339 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2340 } 2341 2217 pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset; 2218 pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - iRecStride; 2342 2219 for( j = 0; j < uiWidth; j+=2 ) 2343 2220 { 2344 2221 x += pRef[j]; 2345 2222 y += pRec[j]; 2346 if ( eType == TEXT_LUMA)2223 if( isLuma(compID) ) 2347 2224 { 2348 2225 xx += (pRef[j] * pRef[j])>>precShift; … … 2353 2230 } 2354 2231 2355 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInC U() ) )2232 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) ) 2356 2233 { 2357 2234 iRefOffset = iHor + iVer * iRefStride - 1; 2358 if( eType == TEXT_LUMA ) 2359 { 2360 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2361 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2362 } 2363 else if( eType == TEXT_CHROMA_U ) 2364 { 2365 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2366 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2367 } 2368 else 2369 { 2370 assert( eType == TEXT_CHROMA_V ); 2371 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2372 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2373 } 2374 2235 pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset; 2236 pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - 1; 2375 2237 for( i = 0; i < uiHeight; i+=2 ) 2376 2238 { 2377 2239 x += pRef[0]; 2378 2240 y += pRec[0]; 2379 if ( eType == TEXT_LUMA)2241 if( isLuma(compID) ) 2380 2242 { 2381 2243 xx += (pRef[0] * pRef[0])>>precShift; … … 2395 2257 } 2396 2258 2397 if ( eType != TEXT_LUMA)2398 { 2399 a = 32;2259 if( !isLuma(compID) ) 2260 { 2261 a = ( 1 << IC_CONST_SHIFT ); 2400 2262 b = ( y - x + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2401 2263 } 2402 2264 else 2403 2265 { 2404 xy += xx >> IC_REG_COST_SHIFT; 2405 xx += xx >> IC_REG_COST_SHIFT; 2406 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 2407 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 2408 const Int iShift = IC_CONST_SHIFT; 2409 { 2410 { 2411 const Int iShiftA2 = 6; 2412 const Int iAccuracyShift = 15; 2413 2414 Int iScaleShiftA2 = 0; 2415 Int iScaleShiftA1 = 0; 2416 Int a1s = a1; 2417 Int a2s = a2; 2418 2419 a1 = Clip3(0, 2*a2, a1); 2420 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 2421 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 2422 2423 if( iScaleShiftA1 < 0 ) 2424 { 2425 iScaleShiftA1 = 0; 2426 } 2427 2428 if( iScaleShiftA2 < 0 ) 2429 { 2430 iScaleShiftA2 = 0; 2431 } 2432 2433 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 2434 2435 2436 a2s = a2 >> iScaleShiftA2; 2437 2438 a1s = a1 >> iScaleShiftA1; 2439 2440 a = a1s * m_uiaShift[ a2s ]; 2441 a = a >> iScaleShiftA; 2442 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2443 } 2444 } 2266 xy += xx >> IC_REG_COST_SHIFT; 2267 xx += xx >> IC_REG_COST_SHIFT; 2268 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 2269 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 2270 const Int iShift = IC_CONST_SHIFT; 2271 const Int iShiftA2 = 6; 2272 const Int iAccuracyShift = 15; 2273 Int iScaleShiftA2 = 0; 2274 Int iScaleShiftA1 = 0; 2275 Int a1s; 2276 Int a2s; 2277 2278 a1 = Clip3(0, 2*a2, a1); 2279 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 2280 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 2281 2282 if( iScaleShiftA1 < 0 ) 2283 { 2284 iScaleShiftA1 = 0; 2285 } 2286 if( iScaleShiftA2 < 0 ) 2287 { 2288 iScaleShiftA2 = 0; 2289 } 2290 2291 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 2292 2293 a2s = a2 >> iScaleShiftA2; 2294 a1s = a1 >> iScaleShiftA1; 2295 2296 a = a1s * m_uiaShift[ a2s ]; 2297 a = a >> iScaleShiftA; 2298 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2445 2299 } 2446 2300 } -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h
r1200 r1225 87 87 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample 88 88 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 89 #if H_3D_IC89 #if NH_3D_IC 90 90 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 91 91 #endif … … 117 117 , Bool filterType = false 118 118 #endif 119 #if H_3D_IC119 #if NH_3D_IC 120 120 , Bool bICFlag = false 121 121 #endif … … 124 124 #if H_3D_ARP 125 125 , Bool filterType = false 126 #endif127 #if H_3D_IC128 , Bool bICFlag = false129 126 #endif 130 127 #if H_3D_VSP … … 135 132 136 133 Void xGetLLSPrediction ( const Pel* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0, const ChromaFormat chFmt DEBUG_STRING_FN_DECLARE(sDebug) ); 137 #if H_3D_IC138 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType);134 #if NH_3D_IC 135 Void xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth); 139 136 #endif 140 137 Void xDCPredFiltering( const Pel* pSrc, Int iSrcStride, Pel* pDst, Int iDstStride, Int iWidth, Int iHeight, ChannelType channelType ); -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.cpp
r1200 r1225 562 562 cDtParam.bitDepth = bitDepth; 563 563 564 #if H_3D_IC564 #if NH_3D_IC 565 565 cDtParam.bUseIC = false; 566 566 #endif … … 690 690 691 691 AOF(!pcDtParam->bApplyWeight); 692 #if H_3D_IC692 #if NH_3D_IC 693 693 AOF(!pcDtParam->bUseIC); 694 694 #endif … … 764 764 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 765 765 } 766 #if H_3D_IC766 #if NH_3D_IC 767 767 if( pcDtParam->bUseIC ) 768 768 { … … 806 806 } 807 807 808 #if H_3D_IC808 #if NH_3D_IC 809 809 if( pcDtParam->bUseIC ) 810 810 { … … 851 851 } 852 852 853 #if H_3D_IC853 #if NH_3D_IC 854 854 if( pcDtParam->bUseIC ) 855 855 { … … 900 900 } 901 901 902 #if H_3D_IC902 #if NH_3D_IC 903 903 if( pcDtParam->bUseIC ) 904 904 { … … 956 956 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 957 957 } 958 #if H_3D_IC958 #if NH_3D_IC 959 959 if( pcDtParam->bUseIC ) 960 960 { … … 1004 1004 Distortion TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 1005 1005 { 1006 #if H_3D_IC1006 #if NH_3D_IC 1007 1007 if( pcDtParam->bUseIC ) 1008 1008 { … … 1064 1064 } 1065 1065 1066 #if H_3D_IC1066 #if NH_3D_IC 1067 1067 if( pcDtParam->bUseIC ) 1068 1068 { … … 1137 1137 } 1138 1138 1139 #if H_3D_IC1139 #if NH_3D_IC 1140 1140 if( pcDtParam->bUseIC ) 1141 1141 { … … 1202 1202 } 1203 1203 1204 #if H_3D_IC1204 #if NH_3D_IC 1205 1205 if( pcDtParam->bUseIC ) 1206 1206 { … … 1306 1306 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1307 1307 } 1308 #if H_3D_IC1308 #if NH_3D_IC 1309 1309 if( pcDtParam->bUseIC ) 1310 1310 { … … 1389 1389 1390 1390 1391 #if H_3D_IC || H_3D_INTER_SDC1391 #if NH_3D_IC || H_3D_INTER_SDC 1392 1392 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1393 1393 { 1394 1394 if ( pcDtParam->bApplyWeight ) 1395 1395 { 1396 return xGetSADw( pcDtParam );1396 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1397 1397 } 1398 1398 Pel* piOrg = pcDtParam->pOrg; … … 1442 1442 if ( pcDtParam->bApplyWeight ) 1443 1443 { 1444 return xGetSADw( pcDtParam );1444 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1445 1445 } 1446 1446 Pel* piOrg = pcDtParam->pOrg; … … 1499 1499 if ( pcDtParam->bApplyWeight ) 1500 1500 { 1501 return xGetSADw( pcDtParam );1501 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1502 1502 } 1503 1503 Pel* piOrg = pcDtParam->pOrg; … … 1568 1568 if ( pcDtParam->bApplyWeight ) 1569 1569 { 1570 return xGetSADw( pcDtParam );1570 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1571 1571 } 1572 1572 Pel* piOrg = pcDtParam->pOrg; … … 1661 1661 if ( pcDtParam->bApplyWeight ) 1662 1662 { 1663 return xGetSADw( pcDtParam );1663 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1664 1664 } 1665 1665 Pel* piOrg = pcDtParam->pOrg; … … 1836 1836 if ( pcDtParam->bApplyWeight ) 1837 1837 { 1838 return xGetSADw( pcDtParam );1838 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1839 1839 } 1840 1840 Pel* piOrg = pcDtParam->pOrg; … … 1978 1978 if ( pcDtParam->bApplyWeight ) 1979 1979 { 1980 return xGetSADw( pcDtParam );1980 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1981 1981 } 1982 1982 Pel* piOrg = pcDtParam->pOrg; … … 2095 2095 if ( pcDtParam->bApplyWeight ) 2096 2096 { 2097 return xGetSADw( pcDtParam );2097 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2098 2098 } 2099 2099 Pel* piOrg = pcDtParam->pOrg; … … 2333 2333 if ( pcDtParam->bApplyWeight ) 2334 2334 { 2335 return xGetSADw( pcDtParam );2335 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2336 2336 } 2337 2337 … … 3328 3328 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3329 3329 } 3330 #if H_3D_IC3330 #if NH_3D_IC 3331 3331 if( pcDtParam->bUseIC ) 3332 3332 { … … 3404 3404 } 3405 3405 3406 #if H_3D_IC || H_3D_INTER_SDC3406 #if NH_3D_IC || H_3D_INTER_SDC 3407 3407 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3408 3408 { 3409 3409 if ( pcDtParam->bApplyWeight ) 3410 3410 { 3411 return xGetHADsw( pcDtParam );3411 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3412 3412 } 3413 3413 Pel* piOrg = pcDtParam->pOrg; -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComRdCost.h
r1200 r1225 91 91 Int iStrideVir; 92 92 #endif 93 #if H_3D_IC93 #if NH_3D_IC 94 94 Bool bUseIC; 95 95 #endif … … 256 256 static Distortion xGetSSE64 ( DistParam* pcDtParam ); 257 257 static Distortion xGetSSE16N ( DistParam* pcDtParam ); 258 #if H_3D_IC || H_3D_INTER_SDC258 #if NH_3D_IC || H_3D_INTER_SDC 259 259 static UInt xGetSADic ( DistParam* pcDtParam ); 260 260 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 283 283 #endif 284 284 285 #if H_3D_IC || H_3D_INTER_SDC285 #if NH_3D_IC || H_3D_INTER_SDC 286 286 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 287 287 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 294 294 295 295 296 #if H_3D_IC || H_3D_INTER_SDC296 #if NH_3D_IC || H_3D_INTER_SDC 297 297 static UInt xGetHADsic ( DistParam* pcDtParam ); 298 298 #endif -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.cpp
r1214 r1225 140 140 , m_pocMsbValRequiredFlag (false) 141 141 #endif 142 #if H_3D_IC142 #if NH_3D_IC 143 143 , m_bApplyIC (false) 144 144 , m_icSkipParseFlag (false) … … 1170 1170 m_bApplyDIS = pSrc->m_bApplyDIS; 1171 1171 #endif 1172 #if H_3D_IC1172 #if NH_3D_IC 1173 1173 m_bApplyIC = pSrc->m_bApplyIC; 1174 1174 m_icSkipParseFlag = pSrc->m_icSkipParseFlag; … … 3690 3690 #endif 3691 3691 3692 #if H_3D_IC3692 #if NH_3D_IC 3693 3693 // This is an encoder only function and should be moved to TEncSlice or TEncSearch!! 3694 3694 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc) … … 3779 3779 { 3780 3780 // Histogram building - luminance 3781 Int iMaxPelValue = ( 1 << g _bitDepthY);3781 Int iMaxPelValue = ( 1 << getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 3782 3782 Int *aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 3783 3783 Int *aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); … … 3785 3785 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 3786 3786 3787 Int iWidth = pcCurrPicYuv->getWidth(); 3788 Int iHeight = pcCurrPicYuv->getHeight(); 3789 3790 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 3791 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 3792 Int iCurrStride = pcCurrPicYuv->getStride(); 3793 Int iRefStride = pcRefPicYuvOrg->getStride(); 3794 3787 Int iWidth = pcCurrPicYuv->getWidth(COMPONENT_Y); 3788 Int iHeight = pcCurrPicYuv->getHeight(COMPONENT_Y); 3789 Pel* pCurrY = pcCurrPicYuv->getAddr(COMPONENT_Y); 3790 Pel* pRefOrgY = pcRefPicYuvOrg->getAddr(COMPONENT_Y); 3791 Int iCurrStride = pcCurrPicYuv->getStride(COMPONENT_Y); 3792 Int iRefStride = pcRefPicYuvOrg->getStride(COMPONENT_Y); 3795 3793 for ( Int y = 0; y < iHeight; y++ ) 3796 3794 { -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TComSlice.h
r1213 r1225 2603 2603 std::vector<Int> m_pocsInCurrRPSs; 2604 2604 #endif 2605 #if H_3D_IC2605 #if NH_3D_IC 2606 2606 Bool m_bApplyIC; 2607 2607 Bool m_icSkipParseFlag; … … 2619 2619 #endif 2620 2620 #endif 2621 #if H_3D_IC2621 #if NH_3D_IC 2622 2622 Int* m_aICEnableCandidate; 2623 2623 Int* m_aICEnableNum; … … 2706 2706 Int getNumCurCmpLIds( ) const { return (Int) m_inCmpRefViewIdcs.size(); } 2707 2707 TComPic* getIvPic( Bool depthFlag, Int viewIndex) const { return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } 2708 #endif 2708 #endif 2709 2709 #if H_3D 2710 2710 TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } 2711 2711 #endif 2712 #if H_3D_IC2712 #if NH_3D_IC 2713 2713 Void setApplyIC( Bool b ) { m_bApplyIC = b; } 2714 2714 Bool getApplyIC() { return m_bApplyIC; } 2715 Void xSetApplyIC(); 2716 Void xSetApplyIC(Bool bUseLowLatencyICEnc); 2715 Void xSetApplyIC(); 2716 Void xSetApplyIC(Bool bUseLowLatencyICEnc); 2717 2717 2718 Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } 2718 2719 Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } … … 2957 2958 Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ getVPS()->getVoiInVps( refViewIdx) ];} 2958 2959 Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ getVPS()->getVoiInVps( refViewIdx) ];} 2959 #if H_3D_IC2960 #if NH_3D_IC 2960 2961 Void setICEnableCandidate( Int* icEnableCandidate) { m_aICEnableCandidate = icEnableCandidate; } 2961 2962 Void setICEnableNum( Int* icEnableNum) { m_aICEnableNum = icEnableNum; } -
branches/HTM-14.1-update-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h
r1213 r1225 66 66 #if NH_MV 67 67 #define H_MV_ENC_DEC_TRAC 1 //< CU/PU level tracking 68 #define H_MV_ENC_DEC_TRAC_FIX 1 // by SHARP 68 69 69 70 #if NH_3D … … 72 73 // Sony_M23639 73 74 // H_3D_TMVP_SCALING_FIX_K0053 1 // QC/CY for K0053 75 #define NH_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 76 // Unifying rounding offset, for IC part, JCT3V-D0135 77 // SHARP_ILLUCOMP_REFINE_E0046 78 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 79 // LGE_IC_CTX_F0160 //JCT3V-F0160 80 // SEC_ONLY_TEXTURE_IC_F0151 81 // MTK_IC_FLAG_CABAC_SIMP_G0061 82 // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121 83 // MTK_LOW_LATENCY_IC_ENCODING_H0086 Low-latency IC encoding in JCT3V-H0086 84 // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX 1 // Remove the global variables used in JCT3V-H0086 85 // SEC_IC_NEIGHBOR_CLIP_I0080 // Clipping of neighboring sample position, JCT3V-I0080 86 // LGE_CHROMA_IC_J0050_J0034 87 88 74 89 #endif 75 90 … … 322 337 #endif 323 338 ///// ***** ILLUMATION COMPENSATION ********* 324 #if H_3D_IC339 #if NH_3D_IC 325 340 #define IC_REG_COST_SHIFT 7 326 341 #define IC_CONST_SHIFT 5
Note: See TracChangeset for help on using the changeset viewer.