Changeset 792 in 3DVCSoftware for branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder
- Timestamp:
- 23 Jan 2014, 05:06:49 (11 years ago)
- Location:
- branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder/TEncCu.cpp
r782 r792 1979 1979 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1980 1980 { 1981 #if SEC_INTER_SDC_G0101 1982 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 1983 { 1984 if( rpcTempCU != rpcTempCUPre ) 1985 { 1986 rpcTempCU->initEstData( uhDepth, orgQP ); 1987 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 1988 } 1989 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 1990 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 1991 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 1992 #if H_3D_VSO //M2 1993 if( m_pcRdCost->getUseRenModel() ) 1994 { //Reset 1995 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 1996 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 1997 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 1998 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 1999 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2000 } 2001 #endif 2002 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2003 m_ppcOrigYuv[uhDepth], 2004 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2005 m_ppcResiYuvTemp[uhDepth], 2006 m_ppcRecoYuvTemp[uhDepth], 2007 uiOffest, 2008 uhDepth ); 2009 2010 xCheckDQP( rpcTempCU ); 2011 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2012 } 2013 #else 1981 2014 if( rpcTempCU != rpcTempCUPre ) 1982 2015 { … … 2006 2039 xCheckDQP( rpcTempCU ); 2007 2040 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2041 #endif 2008 2042 } 2009 2043 #endif … … 2202 2236 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2203 2237 #if H_3D_INTER_SDC 2238 #if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC 2239 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2240 #else 2204 2241 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2205 { 2242 #endif 2243 { 2244 #if SEC_INTER_SDC_G0101 2245 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2246 { 2247 if( rpcTempCU != rpcTempCUPre ) 2248 { 2249 Int orgQP = rpcBestCU->getQP( 0 ); 2250 rpcTempCU->initEstData( uhDepth, orgQP ); 2251 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2252 } 2253 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2254 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2255 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2256 #if H_3D_VSO // M3 2257 if( m_pcRdCost->getUseRenModel() ) 2258 { 2259 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2260 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2261 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2262 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2263 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2264 } 2265 #endif 2266 2267 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2268 m_ppcOrigYuv[uhDepth], 2269 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2270 m_ppcResiYuvTemp[uhDepth], 2271 m_ppcRecoYuvTemp[uhDepth], 2272 uiOffest, 2273 uhDepth ); 2274 2275 xCheckDQP( rpcTempCU ); 2276 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2277 } 2278 #else 2206 2279 if( rpcTempCU != rpcTempCUPre ) 2207 2280 { … … 2233 2306 xCheckDQP( rpcTempCU ); 2234 2307 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2308 #endif 2235 2309 } 2236 2310 #endif -
branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder/TEncEntropy.cpp
r782 r792 882 882 } 883 883 884 #if SEC_INTER_SDC_G0101 885 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 886 #else 884 887 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 885 { 886 return; 887 } 888 888 #endif 889 { 890 return; 891 } 892 893 #if SEC_INTER_SDC_G0101 894 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 895 #else 889 896 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 897 #endif 890 898 891 899 if( bRD ) … … 905 913 906 914 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) ) 907 {908 915 return; 909 916 } -
branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder/TEncSbac.cpp
r782 r792 2259 2259 else //all-zero inter SDC is not allowed 2260 2260 { 2261 #if SEC_INTER_SDC_G0101 2262 uiNumSegments = 1; 2263 #else 2261 2264 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2262 2263 2265 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2266 #endif 2264 2267 dimDeltaDC = 1; 2265 2268 } -
branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder/TEncSearch.cpp
r782 r792 5633 5633 5634 5634 #if H_3D_INTER_SDC 5635 #if SEC_INTER_SDC_G0101 5636 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth ) 5637 #else 5635 5638 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5639 #endif 5636 5640 { 5637 5641 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) … … 5647 5651 UInt uiWidth = pcCU->getWidth ( 0 ); 5648 5652 UInt uiHeight = pcCU->getHeight( 0 ); 5653 #if SEC_INTER_SDC_G0101 5654 UInt uiSegSize = 0; 5655 #else 5649 5656 UChar* pMask = pcCU->getInterSDCMask(); 5650 5657 memset( pMask, 0, uiWidth*uiHeight ); … … 5653 5660 5654 5661 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 5662 #endif 5655 5663 Pel *pPred, *pOrg; 5656 5664 UInt uiPredStride = pcPred->getStride(); 5657 5665 UInt uiOrgStride = pcOrg->getStride(); 5658 5666 UInt uiPelX, uiPelY; 5667 #if !SEC_INTER_SDC_G0101 5659 5668 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 5660 5669 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 ); 5670 #endif 5661 5671 5662 5672 pPred = pcPred->getLumaAddr( 0 ); 5663 5673 pOrg = pcOrg->getLumaAddr( 0 ); 5674 #if SEC_INTER_SDC_G0101 5675 Int pResDC = 0; 5676 #else 5664 5677 Int pResDC[4] = { 0, 0, 0, 0}; 5678 #endif 5665 5679 5666 5680 //calculate dc value for prediction and original signal, and calculate residual and reconstruction … … 5669 5683 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5670 5684 { 5685 #if SEC_INTER_SDC_G0101 5686 pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5687 uiSegSize++; 5688 #else 5671 5689 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5672 5690 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5673 5691 uiSegSize[uiSeg]++; 5692 #endif 5674 5693 } 5675 5694 pOrg += uiOrgStride; … … 5677 5696 } 5678 5697 5698 #if SEC_INTER_SDC_G0101 5699 Int iResiOffset = ( pResDC > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) ); 5700 pResDC = ( pResDC + iResiOffset ) / (Int) uiSegSize; 5701 5702 pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 ); 5703 #else 5679 5704 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5680 5705 { … … 5687 5712 #endif 5688 5713 } 5714 #endif 5689 5715 5690 5716 Pel *pRec; … … 5697 5723 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5698 5724 { 5725 #if SEC_INTER_SDC_G0101 5726 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) ); 5727 #else 5699 5728 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5700 5729 assert( uiSeg < uiSegmentNum ); 5701 5730 5702 5731 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] ); 5732 #endif 5703 5733 } 5704 5734 pPred += uiPredStride; … … 5745 5775 Bool bNonSkip = true; 5746 5776 #endif 5777 #if SEC_INTER_SDC_G0101 5778 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0; 5779 #else 5747 5780 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5748 5781 { … … 5753 5786 #endif 5754 5787 } 5788 #endif 5755 5789 5756 5790 if( !bNonSkip ) -
branches/HTM-9.3-dev3-Samsung/source/Lib/TLibEncoder/TEncSearch.h
r781 r792 219 219 TComYuv* pcResi, 220 220 TComYuv* pcRec, 221 #if SEC_INTER_SDC_G0101 222 Int uiOffset, 223 #endif 221 224 const UInt uiDepth ); 222 225 #endif
Note: See TracChangeset for help on using the changeset viewer.