Changeset 467 in 3DVCSoftware for branches/HTM-DEV-0.3-dev1/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 14 Jun 2013, 17:12:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev1/source/Lib/TLibDecoder/TDecCu.cpp
r459 r467 399 399 break; 400 400 case MODE_INTRA: 401 #if H_3D_DIM_SDC 402 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 403 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 404 else 405 #endif 401 406 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 402 407 break; … … 634 639 635 640 } 641 642 #if H_3D_DIM_SDC 643 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 644 { 645 UInt uiWidth = pcCU->getWidth ( 0 ); 646 UInt uiHeight = pcCU->getHeight ( 0 ); 647 648 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 649 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 650 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 651 652 UInt uiStride = pcRecoYuv->getStride (); 653 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 654 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 655 Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 656 657 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 658 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 659 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 660 661 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 662 663 AOF( uiWidth == uiHeight ); 664 AOF( uiAbsPartIdx == 0 ); 665 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 666 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 667 668 //===== init availability pattern ===== 669 Bool bAboveAvail = false; 670 Bool bLeftAvail = false; 671 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 672 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 673 674 //===== get prediction signal ===== 675 #if H_3D_DIM 676 if( isDimMode( uiLumaPredMode ) ) 677 { 678 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight ); 679 } 680 else 681 { 682 #endif 683 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 684 #if H_3D_DIM 685 } 686 #endif 687 688 // number of segments depends on prediction mode 689 UInt uiNumSegments = 1; 690 Bool* pbMask = NULL; 691 UInt uiMaskStride = 0; 692 693 if( getDimType( uiLumaPredMode ) == DMM1_IDX ) 694 { 695 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); 696 697 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 698 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 699 700 uiNumSegments = 2; 701 pbMask = pcWedgelet->getPattern(); 702 uiMaskStride = pcWedgelet->getStride(); 703 } 704 705 // get DC prediction for each segment 706 Pel apDCPredValues[2]; 707 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 708 709 // reconstruct residual based on mask + DC residuals 710 Pel apDCResiValues[2]; 711 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 712 { 713 #if H_3D_DIM_DLT 714 Pel pPredIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 715 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 716 Pel pRecoValue = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); 717 718 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 719 #else 720 apDCResiValues[uiSegment] = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 721 #endif 722 } 723 724 //===== reconstruction ===== 725 Bool*pMask = pbMask; 726 Pel* pPred = piPred; 727 Pel* pResi = piResi; 728 Pel* pReco = piReco; 729 Pel* pRecIPred = piRecIPred; 730 731 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 732 { 733 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 734 { 735 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 736 assert( ucSegment < uiNumSegments ); 737 738 Pel pResiDC = apDCResiValues[ucSegment]; 739 740 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResiDC ); 741 pRecIPred[ uiX ] = pReco[ uiX ]; 742 } 743 pPred += uiStride; 744 pResi += uiStride; 745 pReco += uiStride; 746 pRecIPred += uiRecIPredStride; 747 pMask += uiMaskStride; 748 } 749 750 // clear UV 751 UInt uiStrideC = pcPredYuv->getCStride(); 752 Pel *pRecCb = pcPredYuv->getCbAddr(); 753 Pel *pRecCr = pcPredYuv->getCrAddr(); 754 755 for (Int y=0; y<uiHeight/2; y++) 756 { 757 for (Int x=0; x<uiWidth/2; x++) 758 { 759 pRecCb[x] = 128; 760 pRecCr[x] = 128; 761 } 762 763 pRecCb += uiStrideC; 764 pRecCr += uiStrideC; 765 } 766 } 767 #endif 636 768 637 769 /** Function for deriving recontructed PU/CU Luma sample with QTree structure
Note: See TracChangeset for help on using the changeset viewer.