Changeset 1243 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 1 Jun 2015, 18:57:12 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp
r1239 r1243 1971 1971 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1972 1972 { 1973 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC1974 1973 UInt uiWidth = pcCU->getWidth ( 0 ); 1975 1974 UInt uiHeight = pcCU->getHeight( 0 ); … … 2110 2109 } 2111 2110 #endif 2112 #else2113 UInt uiLumaPredMode = pcCU ->getLumaIntraDir( uiAbsPartIdx );2114 UInt uiWidth = pcCU ->getWidth ( 0 );2115 UInt uiHeight = pcCU ->getHeight ( 0 );2116 TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );2117 UInt numParts = 1;2118 UInt sdcDepth = 0;2119 UInt uiStride;2120 Pel* piOrg;2121 Pel* piPred;2122 Pel* piReco;2123 2124 UInt uiZOrder;2125 Pel* piRecIPred;2126 UInt uiRecIPredStride;2127 2128 if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )2129 {2130 numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );2131 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();2132 uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );2133 }2134 2135 for ( Int i = 0; i < numParts; i++ )2136 {2137 uiStride = pcOrgYuv ->getStride ();2138 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );2139 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx );2140 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx );2141 2142 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;2143 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );2144 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride ();2145 2146 AOF( uiWidth == uiHeight );2147 2148 //===== init availability pattern =====2149 Bool bAboveAvail = false;2150 Bool bLeftAvail = false;2151 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx );2152 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );2153 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );2154 //===== get prediction signal =====2155 if( isDmmMode( uiLumaPredMode ) )2156 {2157 UInt dimType = getDmmType ( uiLumaPredMode );2158 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);2159 UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth;2160 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX )2161 {2162 if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.2163 {2164 patternID = 1349; // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x162165 }2166 else2167 {2168 patternID = patternID >> 1; // Other cases2169 }2170 pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);2171 }2172 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true , dmm4Segmentation );2173 Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();2174 Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();2175 for( UInt k = 0; k < (uiWidth*uiHeight); k++ )2176 {2177 dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];2178 }2179 }2180 else2181 {2182 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );2183 }2184 if ( numParts > 1 )2185 {2186 for( UInt uiY = 0; uiY < uiHeight; uiY++ )2187 {2188 for( UInt uiX = 0; uiX < uiWidth; uiX++ )2189 {2190 piPred [ uiX ] = ClipY( piPred[ uiX ] );2191 piRecIPred [ uiX ] = piPred[ uiX ];2192 }2193 piPred += uiStride;2194 piRecIPred += uiRecIPredStride;2195 }2196 }2197 uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 );2198 dmm4Segmentation->destroy(); delete dmm4Segmentation;2199 }2200 uiAbsPartIdx = 0;2201 uiStride = pcOrgYuv ->getStride ();2202 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );2203 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx );2204 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx );2205 2206 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;2207 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );2208 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride ();2209 2210 if (numParts > 1)2211 {2212 uiWidth = pcCU->getWidth( 0 );2213 uiHeight = pcCU->getHeight( 0 );2214 }2215 // number of segments depends on prediction mode2216 UInt uiNumSegments = 1;2217 Bool* pbMask = NULL;2218 UInt uiMaskStride = 0;2219 2220 if( getDmmType( uiLumaPredMode ) == DMM1_IDX )2221 {2222 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);2223 2224 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];2225 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));2226 2227 uiNumSegments = 2;2228 pbMask = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern();2229 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();2230 }2231 if( getDmmType( uiLumaPredMode ) == DMM4_IDX )2232 {2233 uiNumSegments = 2;2234 pbMask = dmm4SegmentationOrg->getPattern();2235 uiMaskStride = dmm4SegmentationOrg->getStride();2236 }2237 2238 // get DC prediction for each segment2239 Pel apDCPredValues[2];2240 if ( getDmmType( uiLumaPredMode ) == DMM1_IDX || getDmmType( uiLumaPredMode ) == DMM4_IDX )2241 {2242 apDCPredValues[0] = pcCU->getDmmPredictor( 0 );2243 apDCPredValues[1] = pcCU->getDmmPredictor( 1 );2244 }2245 else2246 {2247 analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );2248 }2249 2250 2251 // get original DC for each segment2252 Pel apDCOrigValues[2];2253 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true );2254 #endif2255 2111 2256 2112 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) … … 2337 2193 } 2338 2194 2339 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC2340 2195 #if NH_3D_DMM 2341 2196 if( pbMask ) { delete[] pbMask; } 2342 #endif2343 2197 #endif 2344 2198 … … 2392 2246 #endif 2393 2247 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2394 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup2395 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;2396 #endif2397 2248 } 2398 2249 #endif … … 3142 2993 #endif 3143 2994 3144 #if NH_3D_DMM 2995 #if NH_3D_DMM || NH_3D_ENC_DEPTH 3145 2996 const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y); 3146 2997 const UInt uiAbsPartIdx=tuRecurseWithPU.GetAbsPartIdxTU(); 3147 2998 3148 2999 Pel* piOrg = pcOrgYuv ->getAddr( COMPONENT_Y, uiAbsPartIdx ); 3000 UInt uiStride = pcPredYuv->getStride( COMPONENT_Y ); 3001 #endif 3002 #if NH_3D_DMM 3149 3003 Pel* piPred = pcPredYuv->getAddr( COMPONENT_Y, uiAbsPartIdx ); 3150 UInt uiStride = pcPredYuv->getStride( COMPONENT_Y );3151 3004 if( m_pcEncCfg->getIsDepth() ) 3152 3005 { … … 3623 3476 if( !tuRecurseWithPU.IsLastSection() ) 3624 3477 { 3625 //const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y);3478 const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y); 3626 3479 const UInt uiCompWidth = puRect.width; 3627 3480 const UInt uiCompHeight = puRect.height; … … 7780 7633 7781 7634 #endif 7782 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC7783 7635 #if NH_3D_SDC_INTRA 7784 7636 Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ) … … 7804 7656 } 7805 7657 #endif 7806 #endif7807 7658 //! \}
Note: See TracChangeset for help on using the changeset viewer.