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/TLibDecoder/TDecCu.cpp

    r1227 r1243  
    11861186Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    11871187{
    1188 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
    11891188  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
    11901189  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     
    13241323  }
    13251324#endif
    1326 #else
    1327   UInt uiWidth        = pcCU->getWidth  ( 0 );
    1328   UInt uiHeight       = pcCU->getHeight ( 0 );
    1329   TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
    1330   UInt numParts = 1;
    1331   UInt sdcDepth    = 0;
    1332   TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
    1333   TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
    1334   TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
    1335 
    1336   UInt    uiStride = 0;
    1337   Pel*    piReco;
    1338   Pel*    piPred;
    1339   Pel*    piResi;
    1340 
    1341   UInt    uiZOrder;       
    1342   Pel*    piRecIPred;     
    1343   UInt    uiRecIPredStride;
    1344 
    1345   UInt    uiLumaPredMode = 0; 
    1346 
    1347   if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
    1348   {
    1349     numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
    1350     sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    1351     uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
    1352   }
    1353 
    1354   for ( Int i = 0; i < numParts; i++ )
    1355   {
    1356     uiStride    = pcRecoYuv->getStride  ();
    1357     piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
    1358     piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    1359     piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
    1360 
    1361     uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    1362     piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    1363     uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1364 
    1365     uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
    1366 
    1367     AOF( uiWidth == uiHeight );
    1368 
    1369     //===== init availability pattern =====
    1370     Bool  bAboveAvail = false;
    1371     Bool  bLeftAvail  = false;
    1372 
    1373     pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
    1374     pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
    1375 
    1376     TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1377     //===== get prediction signal =====
    1378     if( isDmmMode( uiLumaPredMode ) )
    1379     {
    1380       m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation  );
    1381       Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
    1382       Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
    1383       for( UInt k = 0; k < (uiWidth*uiHeight); k++ )
    1384       {
    1385         dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
    1386       }
    1387     }
    1388     else
    1389     {
    1390       m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
    1391     }
    1392 
    1393     if ( numParts > 1 )
    1394     {
    1395       for( UInt uiY = 0; uiY < uiHeight; uiY++ )
    1396       {
    1397         for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    1398         {
    1399           piReco        [ uiX ] = ClipY( piPred[ uiX ] );
    1400           piRecIPred    [ uiX ] = piReco[ uiX ];
    1401         }
    1402         piPred     += uiStride;
    1403         piReco     += uiStride;
    1404         piRecIPred += uiRecIPredStride;
    1405       }
    1406     }
    1407     uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 );
    1408     dmm4Segmentation->destroy(); delete dmm4Segmentation;
    1409   }
    1410   uiAbsPartIdx = 0;
    1411  
    1412   if ( numParts > 1 )
    1413   {
    1414     uiWidth = pcCU->getWidth( 0 );
    1415     uiHeight = pcCU->getHeight( 0 );
    1416   }
    1417   piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
    1418   piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    1419   piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
    1420   uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    1421   piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    1422   uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1423   // number of segments depends on prediction mode
    1424   UInt uiNumSegments = 1;
    1425   Bool* pbMask = NULL;
    1426   UInt uiMaskStride = 0;
    1427  
    1428   if( getDmmType( uiLumaPredMode ) == DMM1_IDX )
    1429   {
    1430     Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
    1431 
    1432     WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] :  &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
    1433     TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
    1434 
    1435     uiNumSegments = 2;
    1436 
    1437     pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
    1438     uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
    1439   }
    1440   if( getDmmType( uiLumaPredMode ) == DMM4_IDX )
    1441   {
    1442     uiNumSegments = 2;
    1443     pbMask  = dmm4SegmentationOrg->getPattern();
    1444     uiMaskStride = dmm4SegmentationOrg->getStride();
    1445   }
    1446   // get DC prediction for each segment
    1447   Pel apDCPredValues[2];
    1448   if ( getDmmType( uiLumaPredMode ) == DMM1_IDX || getDmmType( uiLumaPredMode ) == DMM4_IDX )
    1449   {
    1450     apDCPredValues[0] = pcCU->getDmmPredictor( 0 );
    1451     apDCPredValues[1] = pcCU->getDmmPredictor( 1 );
    1452   }
    1453   else
    1454   {
    1455     m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
    1456   }
    1457 #endif
    14581325 
    14591326  // reconstruct residual based on mask + DC residuals
     
    15151382  }
    15161383#if NH_3D_DMM
    1517 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC
    15181384  if( pbMask ) { delete[] pbMask; }
    1519 #else
    1520   dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
    1521 #endif
    15221385#endif
    15231386}
Note: See TracChangeset for help on using the changeset viewer.