Changeset 213 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 31 Dec 2012, 18:33:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r193 r213 38 38 #include "TDecCu.h" 39 39 40 #if RWTH_SDC_DLT_B0036 41 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) 42 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) 43 #endif 44 40 45 //! \ingroup TLibDecoder 41 46 //! \{ … … 424 429 } 425 430 } 431 #if LGE_ILLUCOMP_B0045 432 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 433 #endif 426 434 #if HHI_MPI 427 435 } … … 505 513 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 506 514 515 #if LGE_ILLUCOMP_B0045 516 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 517 #endif 518 507 519 #if HHI_INTER_VIEW_RESIDUAL_PRED 508 520 if( !pcCU->isIntra( uiAbsPartIdx ) ) … … 670 682 break; 671 683 case MODE_INTRA: 684 #if RWTH_SDC_DLT_B0036 685 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 686 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 687 else 688 #endif 672 689 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 673 690 break; … … 694 711 { 695 712 #if HHI_MPI 713 #if FIX_MPI_B0065 714 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 715 { 716 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 717 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 718 { 719 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 720 pcCU->setPartSizeSubParts( partSize, 0, uiDepth ); 721 } 722 else 723 { 724 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 725 } 726 } 727 #else 696 728 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 697 729 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 698 730 #endif 731 #endif 699 732 700 733 // inter prediction 701 734 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 702 735 703 736 #if HHI_MPI 704 737 if( pcCU->getTextureModeDepth( 0 ) != -1 ) … … 779 812 m_pcPrediction->getPredicBufHeight (), 780 813 bAboveAvail, bLeftAvail ); 781 #if LGE_EDGE_INTRA 814 #if LGE_EDGE_INTRA_A0070 782 815 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 783 816 { … … 1018 1051 1019 1052 } 1053 1054 #if RWTH_SDC_DLT_B0036 1055 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1056 { 1057 UInt uiWidth = pcCU->getWidth ( 0 ); 1058 UInt uiHeight = pcCU->getHeight ( 0 ); 1059 1060 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 1061 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 1062 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 1063 1064 UInt uiStride = pcRecoYuv->getStride (); 1065 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 1066 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1067 Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 1068 1069 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1070 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1071 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1072 1073 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 1074 1075 AOF( uiWidth == uiHeight ); 1076 AOF( uiAbsPartIdx == 0 ); 1077 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1078 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1079 1080 //===== init availability pattern ===== 1081 Bool bAboveAvail = false; 1082 Bool bLeftAvail = false; 1083 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1084 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1085 1086 //===== get prediction signal ===== 1087 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1088 if( uiLumaPredMode >= NUM_INTRA_MODE ) 1089 { 1090 m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); 1091 } 1092 else 1093 { 1094 #endif 1095 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 1096 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1097 } 1098 #endif 1099 1100 // number of segments depends on prediction mode 1101 UInt uiNumSegments = 1; 1102 Bool* pbMask = NULL; 1103 UInt uiMaskStride = 0; 1104 1105 if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX ) 1106 { 1107 Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx); 1108 1109 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 1110 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1111 1112 uiNumSegments = 2; 1113 pbMask = pcWedgelet->getPattern(); 1114 uiMaskStride = pcWedgelet->getStride(); 1115 } 1116 1117 // get DC prediction for each segment 1118 Pel apDCPredValues[2]; 1119 xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 1120 1121 // reconstruct residual based on mask + DC residuals 1122 Pel apDCResiValues[2]; 1123 //Pel apDCRecoValues[2]; 1124 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1125 { 1126 Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[ui] ); 1127 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx); 1128 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1129 1130 //apDCRecoValues[ui] = pRecoValue; 1131 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 1132 } 1133 1134 //===== reconstruction ===== 1135 Bool*pMask = pbMask; 1136 Pel* pPred = piPred; 1137 Pel* pResi = piResi; 1138 Pel* pReco = piReco; 1139 Pel* pRecIPred = piRecIPred; 1140 1141 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1142 { 1143 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1144 { 1145 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1146 assert( ucSegment < uiNumSegments ); 1147 1148 Pel pPredVal= apDCPredValues[ucSegment]; 1149 Pel pResiDC = apDCResiValues[ucSegment]; 1150 1151 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1152 pRecIPred[ uiX ] = pReco[ uiX ]; 1153 } 1154 pPred += uiStride; 1155 pResi += uiStride; 1156 pReco += uiStride; 1157 pRecIPred += uiRecIPredStride; 1158 pMask += uiMaskStride; 1159 } 1160 1161 // clear UV 1162 UInt uiStrideC = pcPredYuv->getCStride(); 1163 Pel *pRecCb = pcPredYuv->getCbAddr(); 1164 Pel *pRecCr = pcPredYuv->getCrAddr(); 1165 1166 for (Int y=0; y<uiHeight/2; y++) 1167 { 1168 for (Int x=0; x<uiWidth/2; x++) 1169 { 1170 pRecCb[x] = (Pel)(128<<g_uiBitIncrement); 1171 pRecCr[x] = (Pel)(128<<g_uiBitIncrement); 1172 } 1173 1174 pRecCb += uiStrideC; 1175 pRecCr += uiStrideC; 1176 } 1177 } 1178 #endif 1020 1179 1021 1180 /** Function for deriving recontructed PU/CU Luma sample with QTree structure … … 1283 1442 #endif 1284 1443 1444 #if RWTH_SDC_DLT_B0036 1445 Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride ) 1446 { 1447 Int iSumDepth[2]; 1448 memset(iSumDepth, 0, sizeof(Int)*2); 1449 Int iSumPix[2]; 1450 memset(iSumPix, 0, sizeof(Int)*2); 1451 1452 for (Int y=0; y<uiSize; y++) 1453 { 1454 for (Int x=0; x<uiSize; x++) 1455 { 1456 UChar ucSegment = pMask?(UChar)pMask[x]:0; 1457 assert( ucSegment < uiNumSegments ); 1458 1459 iSumDepth[ucSegment] += pOrig[x]; 1460 iSumPix[ucSegment] += 1; 1461 } 1462 1463 pOrig += uiStride; 1464 pMask += uiMaskStride; 1465 } 1466 1467 // compute mean for each segment 1468 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 1469 { 1470 if( iSumPix[ucSeg] > 0 ) 1471 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 1472 else 1473 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 1474 } 1475 } 1476 #endif 1477 1285 1478 //! \}
Note: See TracChangeset for help on using the changeset viewer.