Ignore:
Timestamp:
1 Jun 2015, 18:57:12 (9 years ago)
Author:
rwth
Message:
  • fixed problem when NH_3D_DMM=0
  • cleaned TEMP_SDC_CLEANUP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp

    r1239 r1243  
    19711971Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
    19721972{
    1973 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
    19741973  UInt uiWidth        = pcCU->getWidth ( 0 );
    19751974  UInt uiHeight       = pcCU->getHeight( 0 );
     
    21102109  }
    21112110#endif
    2112 #else
    2113   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 16x16
    2165         }
    2166         else
    2167         {
    2168           patternID = patternID >> 1;  // Other cases
    2169         }
    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     else
    2181     {
    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 mode
    2216   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 segment
    2239   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   else
    2246   {
    2247     analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
    2248   }
    2249 
    2250 
    2251   // get original DC for each segment
    2252   Pel apDCOrigValues[2];
    2253   analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true );
    2254 #endif
    22552111
    22562112  for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
     
    23372193  }
    23382194
    2339 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
    23402195#if NH_3D_DMM
    23412196  if( pbMask ) { delete[] pbMask; }
    2342 #endif
    23432197#endif
    23442198
     
    23922246#endif
    23932247    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
    2394 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup
    2395   dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
    2396 #endif
    23972248}
    23982249#endif
     
    31422993#endif
    31432994
    3144 #if NH_3D_DMM
     2995#if NH_3D_DMM || NH_3D_ENC_DEPTH
    31452996    const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y);
    31462997    const UInt uiAbsPartIdx=tuRecurseWithPU.GetAbsPartIdxTU();
    31472998   
    31482999    Pel* piOrg         = pcOrgYuv ->getAddr( COMPONENT_Y, uiAbsPartIdx );
     3000    UInt uiStride      = pcPredYuv->getStride( COMPONENT_Y );
     3001#endif
     3002#if NH_3D_DMM
    31493003    Pel* piPred        = pcPredYuv->getAddr( COMPONENT_Y, uiAbsPartIdx );
    3150     UInt uiStride      = pcPredYuv->getStride( COMPONENT_Y );
    31513004    if( m_pcEncCfg->getIsDepth() )
    31523005    {
     
    36233476    if( !tuRecurseWithPU.IsLastSection() )
    36243477    {
    3625       //const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y);
     3478      const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y);
    36263479      const UInt  uiCompWidth   = puRect.width;
    36273480      const UInt  uiCompHeight  = puRect.height;
     
    77807633
    77817634#endif
    7782 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC
    77837635#if NH_3D_SDC_INTRA
    77847636Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC )
     
    78047656}
    78057657#endif
    7806 #endif
    78077658//! \}
Note: See TracChangeset for help on using the changeset viewer.