Changeset 177 in 3DVCSoftware for branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder
- Timestamp:
- 10 Nov 2012, 19:05:41 (12 years ago)
- Location:
- branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp
r152 r177 1674 1674 } 1675 1675 #endif 1676 1677 READ_FLAG( uiCode, "base_view_flag" ); 1676 1677 #if RWTH_SDC_DLT_B0036 1678 if( bIsDepth ) 1679 { 1680 READ_FLAG( uiCode, "use_dlt_flag" ); 1681 pcSPS->setUseDLT( uiCode ); 1682 if( pcSPS->getUseDLT() ) 1683 { 1684 // decode mapping 1685 UInt uiNumDepthValues; 1686 // parse number of values in DLT 1687 xReadUvlc( uiNumDepthValues ); 1688 1689 // parse actual DLT values 1690 UInt* auiIdx2DepthValue = (UInt*) calloc(uiNumDepthValues, sizeof(UInt)); 1691 for(UInt d=0; d<uiNumDepthValues; d++) 1692 { 1693 xReadUvlc( uiCode ); 1694 auiIdx2DepthValue[d] = uiCode; 1695 } 1696 1697 pcSPS->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues); 1698 1699 // clean memory 1700 free(auiIdx2DepthValue); 1701 } 1702 else 1703 pcSPS->setDepthLUTs(); 1704 } 1705 #endif 1706 1707 READ_FLAG( uiCode, "base_view_flag" ); 1678 1708 if( uiCode ) 1679 1709 { // baseview SPS -> set standard values … … 2827 2857 #endif 2828 2858 2859 #if RWTH_SDC_DLT_B0036 2860 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2861 { 2862 assert(0); 2863 } 2864 Void TDecCavlc::parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2865 { 2866 assert(0); 2867 } 2868 Void TDecCavlc::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) 2869 { 2870 assert(0); 2871 } 2872 #endif 2873 2829 2874 // ==================================================================================================================== 2830 2875 // Protected member functions -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCAVLC.h
r152 r177 178 178 Void parseDFFlag ( UInt& ruiVal, const Char *pSymbolName ); 179 179 Void parseDFSvlc ( Int& riVal, const Char *pSymbolName ); 180 #if RWTH_SDC_DLT_B0036 181 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 182 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 183 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 184 #endif 180 185 protected: 181 186 #if DBL_CONTROL -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCu.cpp
r156 r177 37 37 38 38 #include "TDecCu.h" 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 39 44 40 45 //! \ingroup TLibDecoder … … 608 613 break; 609 614 case MODE_INTRA: 615 #if RWTH_SDC_DLT_B0036 616 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 617 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 618 else 619 #endif 610 620 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 611 621 break; … … 951 961 952 962 } 963 964 #if RWTH_SDC_DLT_B0036 965 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 966 { 967 UInt uiWidth = pcCU->getWidth ( 0 ); 968 UInt uiHeight = pcCU->getHeight ( 0 ); 969 970 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 971 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 972 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 973 974 UInt uiStride = pcRecoYuv->getStride (); 975 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 976 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 977 Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 978 979 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 980 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 981 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 982 983 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 984 985 AOF( uiWidth == uiHeight ); 986 AOF( uiAbsPartIdx == 0 ); 987 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 988 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 989 990 //===== init availability pattern ===== 991 Bool bAboveAvail = false; 992 Bool bLeftAvail = false; 993 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 994 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 995 996 //===== get prediction signal ===== 997 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 998 if( uiLumaPredMode >= NUM_INTRA_MODE ) 999 { 1000 m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); 1001 } 1002 else 1003 { 1004 #endif 1005 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 1006 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1007 } 1008 #endif 1009 1010 // number of segments depends on prediction mode 1011 UInt uiNumSegments = 1; 1012 Bool* pbMask = NULL; 1013 UInt uiMaskStride = 0; 1014 1015 //if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX ) 1016 if( 0 ) 1017 { 1018 Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx); 1019 1020 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 1021 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1022 1023 uiNumSegments = 2; 1024 pbMask = pcWedgelet->getPattern(); 1025 uiMaskStride = pcWedgelet->getStride(); 1026 } 1027 1028 // get DC prediction for each segment 1029 Pel apDCPredValues[2]; 1030 xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 1031 1032 // reconstruct residual based on mask + DC residuals 1033 Pel apDCResiValues[2]; 1034 Pel apDCRecoValues[2]; 1035 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1036 { 1037 Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[ui] ); 1038 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx); 1039 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1040 1041 apDCRecoValues[ui] = pRecoValue; 1042 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 1043 } 1044 1045 //===== reconstruction ===== 1046 Bool*pMask = pbMask; 1047 Pel* pPred = piPred; 1048 Pel* pResi = piResi; 1049 Pel* pReco = piReco; 1050 Pel* pRecIPred = piRecIPred; 1051 1052 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1053 { 1054 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1055 { 1056 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1057 assert( ucSegment < uiNumSegments ); 1058 1059 Pel pPredVal= apDCPredValues[ucSegment]; 1060 Pel pResiDC = apDCResiValues[ucSegment]; 1061 1062 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1063 pRecIPred[ uiX ] = pReco[ uiX ]; 1064 } 1065 pPred += uiStride; 1066 pResi += uiStride; 1067 pReco += uiStride; 1068 pRecIPred += uiRecIPredStride; 1069 pMask += uiMaskStride; 1070 } 1071 1072 // clear UV 1073 UInt uiStrideC = pcPredYuv->getCStride(); 1074 Pel *pRecCb = pcPredYuv->getCbAddr(); 1075 Pel *pRecCr = pcPredYuv->getCrAddr(); 1076 1077 for (Int y=0; y<uiHeight/2; y++) 1078 { 1079 for (Int x=0; x<uiWidth/2; x++) 1080 { 1081 pRecCb[x] = (Pel)(128<<g_uiBitIncrement); 1082 pRecCr[x] = (Pel)(128<<g_uiBitIncrement); 1083 } 1084 1085 pRecCb += uiStrideC; 1086 pRecCr += uiStrideC; 1087 } 1088 } 1089 #endif 953 1090 954 1091 /** Function for deriving recontructed PU/CU Luma sample with QTree structure … … 1216 1353 #endif 1217 1354 1355 #if RWTH_SDC_DLT_B0036 1356 Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride ) 1357 { 1358 Int iSumDepth[uiNumSegments]; 1359 memset(iSumDepth, 0, sizeof(Int)*uiNumSegments); 1360 Int iSumPix[uiNumSegments]; 1361 memset(iSumPix, 0, sizeof(Int)*uiNumSegments); 1362 1363 for (Int y=0; y<uiSize; y++) 1364 { 1365 for (Int x=0; x<uiSize; x++) 1366 { 1367 UChar ucSegment = pMask?(UChar)pMask[x]:0; 1368 assert( ucSegment < uiNumSegments ); 1369 1370 iSumDepth[ucSegment] += pOrig[x]; 1371 iSumPix[ucSegment] += 1; 1372 } 1373 1374 pOrig += uiStride; 1375 pMask += uiMaskStride; 1376 } 1377 1378 // compute mean for each segment 1379 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 1380 { 1381 if( iSumPix[ucSeg] > 0 ) 1382 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 1383 else 1384 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 1385 } 1386 } 1387 #endif 1388 1218 1389 //! \} -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecCu.h
r56 r177 121 121 Void xFillPCMBuffer (TComDataCU* pCU, UInt absPartIdx, UInt depth); 122 122 #endif 123 #if RWTH_SDC_DLT_B0036 124 Void xAnalyzeSegmentsSDC ( Pel* pOrig, 125 UInt uiStride, 126 UInt uiSize, 127 Pel* rpSegMeans, 128 UInt uiNumSegments, 129 Bool* pMask, 130 UInt uiMaskStride ); 131 132 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 133 #endif 123 134 }; 124 135 -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecEntropy.cpp
r152 r177 147 147 { 148 148 m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); 149 150 #if RWTH_SDC_DLT_B0036 151 // if B-Slice, code SDC flag later 152 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() ) 153 { 154 // decode SDC flag 155 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); 156 } 157 #endif 149 158 } 150 159 151 160 Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 152 161 { 162 #if RWTH_SDC_DLT_B0036 163 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) 164 { 165 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 166 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 167 return; 168 } 169 #endif 170 153 171 m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); 172 173 #if RWTH_SDC_DLT_B0036 174 if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) ) 175 { 176 // decode SDC flag 177 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); 178 179 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 180 { 181 // part size is also known for SDC intra 182 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 183 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 184 } 185 } 186 #endif 154 187 } 155 188 156 189 Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) 157 190 { 191 #if RWTH_SDC_DLT_B0036 192 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 193 { 194 decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth); 195 return; 196 } 197 #endif 198 158 199 PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx ); 159 200 … … 196 237 return; 197 238 } 239 240 #if RWTH_SDC_DLT_B0036 241 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 242 { 243 return; 244 } 245 #endif 198 246 199 247 m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); … … 912 960 #endif 913 961 962 #if RWTH_SDC_DLT_B0036 963 if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) ) 964 { 965 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 966 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 967 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 968 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 969 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 970 971 decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth); 972 return; 973 } 974 #endif 975 914 976 if( pcCU->isIntra(uiAbsPartIdx) ) 915 977 { … … 954 1016 } 955 1017 1018 #if RWTH_SDC_DLT_B0036 1019 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1020 { 1021 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1022 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 1023 1024 m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth ); 1025 } 1026 1027 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1028 { 1029 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1030 1031 m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth ); 1032 } 1033 1034 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1035 { 1036 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1037 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 1038 1039 // number of segments depends on prediction mode for INTRA 1040 UInt uiNumSegments = 2; 1041 UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); 1042 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) ) 1043 uiNumSegments = 1; 1044 1045 // decode residual data for each segment 1046 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 1047 m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg); 1048 } 1049 #endif 1050 956 1051 //! \} -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecEntropy.h
r152 r177 142 142 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 143 143 144 #if RWTH_SDC_DLT_B0036 145 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 146 virtual Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 147 virtual Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 148 #endif 149 144 150 virtual ~TDecEntropyIf() {} 145 151 }; … … 256 262 Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); } 257 263 #endif 264 265 #if RWTH_SDC_DLT_B0036 266 Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 267 Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 268 Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 269 #endif 258 270 259 271 };// END CLASS DEFINITION TDecEntropy -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecSbac.cpp
r152 r177 38 38 #include "TDecSbac.h" 39 39 40 #if RWTH_SDC_DLT_B0036 41 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues()) 42 #define GetBitsPerDepthValue() (pcCU->getSlice()->getSPS()->getBitsPerDepthValue()) 43 #endif 44 40 45 //! \ingroup TLibDecoder 41 46 //! \{ … … 106 111 , m_cEdgeIntraDeltaDCSCModel ( 1, 1, NUM_EDGE_INTRA_DELTA_DC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 112 #endif 113 #endif 114 #if RWTH_SDC_DLT_B0036 115 , m_cSDCFlagSCModel ( 1, 1, SDC_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 , m_cSDCResidualFlagSCModel ( 1, 2, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 117 , m_cSDCResidualSignFlagSCModel ( 1, 2, SDC_NUM_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 , m_cSDCResidualSCModel ( 1, 2, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 120 #endif 109 121 { … … 206 218 m_cDmmDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_DATA ); 207 219 #endif 220 #if RWTH_SDC_DLT_B0036 221 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 222 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 223 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 224 m_cSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG ); 225 m_cSDCPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE ); 226 #endif 208 227 209 228 // new structure … … 285 304 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 286 305 #endif 306 #if RWTH_SDC_DLT_B0036 307 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 308 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 309 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 310 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 311 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 312 #endif 287 313 288 314 m_pcTDecBinIf->start(); … … 2486 2512 } 2487 2513 #endif 2514 2515 #if RWTH_SDC_DLT_B0036 2516 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2517 { 2518 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2519 2520 UInt uiSymbol = 0; 2521 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2522 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2523 2524 if( uiSymbol == 1 ) 2525 { 2526 pcCU->setPartSizeSubParts(SIZE_2Nx2N, uiAbsPartIdx, uiDepth); 2527 2528 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth); 2529 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth); 2530 pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth); 2531 } 2532 } 2533 2534 Void TDecSbac::parseSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2535 { 2536 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2537 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 2538 2539 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2540 2541 UInt uiCtx = 0; 2542 2543 UInt uiMPModeIdx = 0; 2544 2545 for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++) 2546 { 2547 UInt uiIsMostProb = 0; 2548 m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) ); 2549 2550 if ( uiIsMostProb == 1 ) 2551 break; 2552 2553 // else: get next most probable pred mode 2554 uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES; 2555 } 2556 2557 Int intraPredMode = g_auiSDCPredModes[uiMPModeIdx]; 2558 2559 #if HHI_DMM_WEDGE_INTRA 2560 if( intraPredMode == DMM_WEDGE_FULL_IDX ) { xParseWedgeFullInfo ( pcCU, uiAbsPartIdx, uiDepth ); } 2561 if( intraPredMode == DMM_WEDGE_PREDDIR_IDX ) { xParseWedgePredDirInfo ( pcCU, uiAbsPartIdx, uiDepth ); } 2562 #endif 2563 2564 pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth); 2565 } 2566 2567 Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 2568 { 2569 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2570 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2571 assert( uiSegment < 2 ); 2572 2573 UInt uiResidual = 0; 2574 UInt uiBit = 0; 2575 UInt uiAbsIdx = 0; 2576 UInt uiSign = 0; 2577 Int iIdx = 0; 2578 2579 UInt uiMaxResidualBits = GetBitsPerDepthValue(); 2580 assert( uiMaxResidualBits <= g_uiBitDepth ); 2581 2582 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); 2583 2584 if (uiResidual) 2585 { 2586 // decode residual sign bit 2587 m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); 2588 2589 // decode residual magnitude 2590 for (Int i=0; i<uiMaxResidualBits; i++) 2591 { 2592 m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); 2593 uiAbsIdx |= uiBit << i; 2594 } 2595 2596 uiAbsIdx += 1; 2597 iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx; 2598 } 2599 2600 pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx); 2601 } 2602 #endif 2488 2603 2489 2604 //! \} -
branches/HTM-4.1-dev2-RWTH/source/Lib/TLibDecoder/TDecSbac.h
r152 r177 126 126 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam); 127 127 #endif 128 129 #if RWTH_SDC_DLT_B0036 130 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 132 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 133 #endif 128 134 private: 129 135 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); … … 269 275 #endif 270 276 #endif 277 278 #if RWTH_SDC_DLT_B0036 279 ContextModel3DBuffer m_cSDCFlagSCModel; 280 281 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 282 ContextModel3DBuffer m_cSDCResidualSignFlagSCModel; 283 ContextModel3DBuffer m_cSDCResidualSCModel; 284 285 ContextModel3DBuffer m_cSDCPredModeSCModel; 286 #endif 271 287 }; 272 288
Note: See TracChangeset for help on using the changeset viewer.