Changeset 1209 in 3DVCSoftware for branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder
- Timestamp:
- 13 May 2015, 15:16:14 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1200 r1209 3389 3389 #endif 3390 3390 #if H_3D_INTER_SDC 3391 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )3392 {3393 assert(0);3394 }3395 3396 3391 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3397 3392 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCAVLC.h
r1200 r1209 123 123 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 124 124 #endif 125 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 126 Void parseDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); }; 127 #endif 125 128 #if H_3D_INTER_SDC 126 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );127 129 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 128 130 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCu.cpp
r1200 r1209 1009 1009 1010 1010 //===== get prediction signal ===== 1011 #if H_3D_DIM1012 if( isDimMode( uiLumaPredMode ) )1013 { 1014 m_pcPrediction->predIntraLumaD epth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight );1011 #if NH_3D_DMM 1012 if( bIsLuma && isDmmMode( uiChFinalMode ) ) 1013 { 1014 m_pcPrediction->predIntraLumaDmm( pcCU, uiAbsPartIdx, getDmmType( uiChFinalMode ), piPred, uiStride, uiWidth, uiHeight ); 1015 1015 } 1016 1016 else 1017 1017 { 1018 1018 #endif 1019 1020 1019 m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions ); 1021 #if H_3D_DIM1020 #if NH_3D_DMM 1022 1021 } 1023 1022 #endif … … 1040 1039 #endif 1041 1040 #if H_3D 1042 Bool useDltFlag = (isD imMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());1041 Bool useDltFlag = (isDmmMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()); 1043 1042 1044 1043 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag ) … … 1158 1157 } 1159 1158 } 1160 #if H_3D_DIM1161 mapDepthModeToIntraDir( uiChromaPredMode );1162 #endif1163 1164 1159 1165 1160 Void … … 1191 1186 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1192 1187 { 1188 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1189 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 1190 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 1191 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 1192 1193 Bool bAboveAvail = false; 1194 Bool bLeftAvail = false; 1195 UInt uiWidth = pcCU->getWidth ( 0 ); 1196 UInt uiHeight = pcCU->getHeight( 0 ); 1197 UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 1198 1199 UInt sdcDepth = 0; 1200 UInt uiStride; 1201 Pel* piReco; 1202 Pel* piPred; 1203 Pel* piResi; 1204 1205 UInt uiZOrder; 1206 Pel* piRecIPred; 1207 UInt uiRecIPredStride; 1208 1209 Pel apDCPredValues[2]; 1210 UInt uiNumSegments; 1211 1212 Bool* pbMask = NULL; 1213 UInt uiMaskStride = 0; 1214 1215 #if NH_3D_DMM 1216 TComWedgelet* dmm4Segmentation = NULL; 1217 if( isDmmMode( uiLumaPredMode ) ) 1218 { 1219 assert( uiWidth == uiHeight ); 1220 assert( uiWidth >= DMM_MIN_SIZE && uiWidth <= DMM_MAX_SIZE ); 1221 assert( !((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) ); 1222 1223 uiNumSegments = 2; 1224 1225 uiStride = pcRecoYuv->getStride( COMPONENT_Y ); 1226 piReco = pcRecoYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1227 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1228 piResi = pcResiYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1229 1230 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 1231 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y ); 1232 1233 //===== init availability pattern ===== 1234 #if !TEMP_SDC_CLEANUP // PM: please migrate together with below "initPattern" and remove macro 1235 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 1236 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1237 #endif 1238 1239 // get partition 1240 pbMask = new Bool[ uiWidth*uiHeight ]; 1241 uiMaskStride = uiWidth; 1242 switch( getDmmType( uiLumaPredMode ) ) 1243 { 1244 case( DMM1_IDX ): { (getWedgeListScaled( uiWidth )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( uiWidth, pbMask ); } break; 1245 case( DMM4_IDX ): { m_pcPrediction->predContourFromTex( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask ); } break; 1246 default: assert(0); 1247 } 1248 1249 // get predicted partition values 1250 Pel predDC1 = 0, predDC2 = 0; 1251 m_pcPrediction->predBiSegDCs( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask, uiMaskStride, predDC1, predDC2 ); 1252 1253 // set prediction signal 1254 Pel* pDst = piPred; 1255 m_pcPrediction->assignBiSegDCs( pDst, uiStride, pbMask, uiMaskStride, predDC1, predDC2 ); 1256 apDCPredValues[0] = predDC1; 1257 apDCPredValues[1] = predDC2; 1258 } 1259 else // regular HEVC intra modes 1260 { 1261 #endif 1262 uiNumSegments = 1; 1263 1264 UInt numParts = 1; 1265 UInt uiSubPartIdx = uiAbsPartIdx; 1266 1267 if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) 1268 { 1269 numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1270 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1271 uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1272 } 1273 1274 for ( Int i = 0; i < numParts; i++ ) 1275 { 1276 uiStride = pcRecoYuv->getStride (); 1277 piReco = pcRecoYuv->getLumaAddr( uiSubPartIdx ); 1278 piPred = pcPredYuv->getLumaAddr( uiSubPartIdx ); 1279 piResi = pcResiYuv->getLumaAddr( uiSubPartIdx ); 1280 1281 uiZOrder = pcCU->getZorderIdxInCU() + uiSubPartIdx; 1282 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1283 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1284 1285 AOF( uiWidth == uiHeight ); 1286 1287 //===== init availability pattern ===== 1288 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiSubPartIdx ); 1289 pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1290 1291 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1292 1293 if ( numParts > 1 ) 1294 { 1295 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1296 { 1297 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1298 { 1299 piReco [ uiX ] = ClipY( piPred[ uiX ] ); 1300 piRecIPred [ uiX ] = piReco[ uiX ]; 1301 } 1302 piPred += uiStride; 1303 piReco += uiStride; 1304 piRecIPred += uiRecIPredStride; 1305 } 1306 } 1307 uiSubPartIdx += ( (uiWidth * uiWidth) >> 4 ); 1308 } 1309 1310 // reset to full block 1311 uiWidth = pcCU->getWidth( 0 ); 1312 uiHeight = pcCU->getHeight( 0 ); 1313 1314 piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 1315 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1316 piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 1317 1318 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1319 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1320 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1321 1322 m_pcPrediction->predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0; 1323 #if NH_3D_DMM 1324 } 1325 #endif 1326 #else 1193 1327 UInt uiWidth = pcCU->getWidth ( 0 ); 1194 1328 UInt uiHeight = pcCU->getHeight ( 0 ); … … 1242 1376 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1243 1377 //===== get prediction signal ===== 1244 if( isD imMode( uiLumaPredMode ) )1378 if( isDmmMode( uiLumaPredMode ) ) 1245 1379 { 1246 1380 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation ); … … 1292 1426 UInt uiMaskStride = 0; 1293 1427 1294 if( getD imType( uiLumaPredMode ) == DMM1_IDX )1428 if( getDmmType( uiLumaPredMode ) == DMM1_IDX ) 1295 1429 { 1296 1430 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); … … 1304 1438 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 1305 1439 } 1306 if( getD imType( uiLumaPredMode ) == DMM4_IDX )1440 if( getDmmType( uiLumaPredMode ) == DMM4_IDX ) 1307 1441 { 1308 1442 uiNumSegments = 2; … … 1312 1446 // get DC prediction for each segment 1313 1447 Pel apDCPredValues[2]; 1314 if ( getD imType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )1448 if ( getDmmType( uiLumaPredMode ) == DMM1_IDX || getDmmType( uiLumaPredMode ) == DMM4_IDX ) 1315 1449 { 1316 1450 apDCPredValues[0] = pcCU->getDmmPredictor( 0 ); … … 1321 1455 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); 1322 1456 } 1457 #endif 1323 1458 1324 1459 // reconstruct residual based on mask + DC residuals … … 1379 1514 pRecCr += uiStrideC; 1380 1515 } 1516 #if NH_3D_DMM 1517 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1518 if( pbMask ) { delete[] pbMask; } 1519 #else 1381 1520 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 1521 #endif 1522 #endif 1382 1523 } 1383 1524 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecEntropy.cpp
r1200 r1209 970 970 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 971 971 } 972 #endif 972 973 #if H_3D_INTER_SDC 973 974 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) … … 978 979 } 979 980 #endif 980 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 981 { 982 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 983 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 984 985 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 986 { 987 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 988 { 989 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 990 { 991 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 992 } 993 } 994 } 995 else 981 #if NH_3D 982 if( pcCU->getSlice()->getIsDepth() ) 983 { 984 #if H_3D_DIM_SDC || H_3D_INTER_SDC 985 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 996 986 { 997 987 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth ); 998 988 return; 999 989 } 990 #endif 991 #if NH_3D_DMM 992 if( pcCU->isIntra( uiAbsPartIdx ) ) 993 { 994 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 995 UInt uiPartOffset = ( pcCU->getPic()->getNumPartitionsInCtu() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 996 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 997 { 998 if( isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx + uiPartOffset*iPart ) ) ) 999 { 1000 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 1001 } 1002 } 1003 } 1004 #endif 1000 1005 } 1001 1006 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecEntropy.h
r1200 r1209 91 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 92 #endif 93 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 94 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 95 #endif 93 96 #if H_3D_INTER_SDC 94 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;95 97 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 96 98 #endif … … 180 182 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 181 183 #endif 184 182 185 #if H_3D_INTER_SDC 183 186 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecSbac.cpp
r1200 r1209 106 106 , m_ChromaQpAdjFlagSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 107 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 #if H_3D_DIM 109 , m_cDepthIntraModeSCModel ( 1, 1, NUM_DEPTH_INTRA_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 109 #if NH_3D_DMM 110 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 #endif 113 #if NH_3D_DMM || NH_3D_SDC 114 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 #endif 113 116 #if H_3D_DIM_SDC 114 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 #endif 117 #endif 118 #if H_3D_DIM_SDC 119 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 117 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 121 #endif 121 122 #if H_3D_DBBP 122 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)123 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 123 124 #endif 124 125 … … 197 198 m_ChromaQpAdjFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 198 199 m_ChromaQpAdjIdcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 199 #if H_3D_DIM 200 m_cDepthIntraModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); 201 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 202 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 203 m_cAngleFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 200 #if NH_3D_DMM 201 m_cNotDmmFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_NOTDMM_FLAG ); 202 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE ); 203 #endif 204 #if NH_3D_DMM || NH_3D_SDC 205 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 206 #endif 204 207 #if H_3D_DIM_SDC 205 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 206 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 207 #endif 208 #endif 209 #if H_3D_DIM_SDC 210 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 208 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 209 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 210 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 211 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 211 212 #endif 212 213 #if H_3D_DBBP 213 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG );214 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG ); 214 215 #endif 215 216 … … 247 248 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 248 249 #endif 249 #if H_3D_DIM250 m_cDepthIntraModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );251 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );252 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );253 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );254 250 #if H_3D_DIM_SDC 255 251 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 256 252 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 257 #endif258 #endif259 #if H_3D_DIM_SDC260 253 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 254 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 261 255 #endif 262 256 #if H_3D_DBBP … … 433 427 } 434 428 } 435 436 #if H_3D_DIM437 Void TDecSbac::xReadExGolombLevel( UInt& ruiSymbol, ContextModel& rcSCModel )438 {439 UInt uiSymbol;440 UInt uiCount = 0;441 do442 {443 m_pcTDecBinIf->decodeBin( uiSymbol, rcSCModel );444 uiCount++;445 }446 while( uiSymbol && ( uiCount != 3 ) );447 ruiSymbol = uiCount - 1;448 449 if( uiSymbol )450 {451 xReadEpExGolomb( uiSymbol, 0 );452 ruiSymbol += uiSymbol + 1;453 }454 455 return;456 }457 458 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg )459 {460 UInt absValDeltaDC = 0;461 xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, 0) );462 rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 );463 464 if( rValDeltaDC != 0 )465 {466 UInt uiSign;467 m_pcTDecBinIf->decodeBinEP( uiSign );468 if ( uiSign )469 {470 rValDeltaDC = -rValDeltaDC;471 }472 }473 }474 475 476 #if H_3D_DIM_DMM477 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit )478 {479 UInt uiSymbol, uiIdx = 0;480 for( Int i = 0; i < iNumBit; i++ )481 {482 m_pcTDecBinIf->decodeBinEP( uiSymbol );483 uiIdx += uiSymbol << i;484 }485 ruiTabIdx = uiIdx;486 }487 #endif488 489 490 #endif491 492 429 493 430 /** Parse I_PCM information. … … 1019 956 for (j=0;j<partNum;j++) 1020 957 { 1021 #if H_3D_DIM958 #if NH_3D_DMM 1022 959 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() ) 1023 960 { 1024 parseIntraDepth( pcCU, absPartIdx+partOffset*j, depth ); 1025 } 1026 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 961 xParseIntraDepthMode( pcCU, absPartIdx+partOffset*j, depth ); 962 xParseDmmData ( pcCU, absPartIdx+partOffset*j, depth ); 963 } 964 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1027 965 { 1028 966 #endif … … 1032 970 DTRACE_CU("prev_intra_luma_pred_flag", symbol) 1033 971 #endif 1034 #if H_3D_DIM972 #if NH_3D_DMM 1035 973 } 1036 974 #endif … … 1038 976 for (j=0;j<partNum;j++) 1039 977 { 1040 #if H_3D_DIM1041 if( pcCU->get LumaIntraDir(absPartIdx+partOffset*j ) < NUM_INTRA_MODE )978 #if NH_3D_DMM 979 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1042 980 { 1043 981 #endif … … 1084 1022 } 1085 1023 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth ); 1086 #if H_3D_DIM1024 #if NH_3D_DMM 1087 1025 } 1088 1026 #endif … … 1120 1058 pcCU->setIntraDirSubParts( CHANNEL_TYPE_CHROMA, uiSymbol, uiAbsPartIdx, uiDepth ); 1121 1059 } 1122 1123 #if H_3D_DIM1124 Void TDecSbac::parseIntraDepth( TComDataCU* pcCU, UInt absPartIdx, UInt depth )1125 {1126 parseIntraDepthMode( pcCU, absPartIdx, depth );1127 1128 UInt dir = pcCU->getLumaIntraDir( absPartIdx );1129 UInt dimType = getDimType( dir );1130 1131 switch( dimType )1132 {1133 #if H_3D_DIM_DMM1134 case( DMM1_IDX ):1135 {1136 UInt uiTabIdx = 0;1137 xParseDmm1WedgeIdx( uiTabIdx, g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1138 1139 assert( uiTabIdx < g_dmmWedgeLists[ g_aucConvertToBit[ pcCU->getDMM1BasePatternWidth( pcCU->getWidth( absPartIdx ) )]].size());1140 1141 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );1142 } break;1143 case( DMM4_IDX ): break;1144 #endif1145 default: break;1146 }1147 1148 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );1149 }1150 1151 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )1152 {1153 UInt uiSymbol, uiIsDimMode;1154 1155 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed1156 {1157 m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, 0 ) );1158 }1159 else1160 {1161 uiSymbol = 1;1162 }1163 uiIsDimMode = uiSymbol ? 0 : 1;1164 pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );1165 1166 //decode DMM index1167 if( uiIsDimMode )1168 {1169 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag() )1170 {1171 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );1172 if( !uiSymbol )1173 {1174 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );1175 }1176 else1177 {1178 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );1179 }1180 }1181 else if ( pcCU->getSlice()->getIntraSdcWedgeFlag() )1182 {1183 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );1184 }1185 else if( pcCU->getSlice()->getIntraContourFlag() )1186 {1187 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );1188 }1189 }1190 }1191 #endif1192 1060 1193 1061 Void TDecSbac::parseInterDir( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ) … … 2472 2340 #endif 2473 2341 2474 #if H_3D_INTER_SDC2342 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 2475 2343 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2476 2344 { 2477 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2478 { 2345 #if H_3D_DIM_SDC || H_3D_INTER_SDC 2346 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2347 #endif 2348 #if NH_3D_DMM 2349 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2350 #endif 2479 2351 assert( 0 ); 2480 }2481 2352 2482 2353 UInt symbol = 1; 2483 UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1; 2484 2354 #if H_3D_DIM_SDC 2485 2355 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2486 2356 { 2487 2488 2357 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2489 2358 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); … … 2491 2360 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2492 2361 } 2362 #endif 2363 UInt uiNumSegments = 1; 2364 #if NH_3D_DMM 2365 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2366 #endif 2493 2367 2494 2368 for( UInt segment = 0; segment < uiNumSegments; segment++ ) … … 2497 2371 if( symbol ) 2498 2372 { 2499 xParseD imDeltaDC( valDeltaDC, uiNumSegments );2373 xParseDeltaDC( valDeltaDC, uiNumSegments ); 2500 2374 } 2501 2375 2502 2376 if( pcCU->isIntra( absPartIdx ) ) 2503 2377 { 2504 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2505 2378 #if H_3D_DIM_SDC 2506 2379 if( pcCU->getSDCFlag( absPartIdx ) ) 2507 2380 { … … 2510 2383 else 2511 2384 { 2512 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC ); 2513 } 2514 } 2385 #endif 2386 #if NH_3D_DMM 2387 pcCU->setDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx, valDeltaDC ); 2388 #endif 2389 #if H_3D_DIM_SDC 2390 } 2391 #endif 2392 } 2393 #if H_3D_INTER_SDC 2515 2394 else 2516 2395 { 2517 2396 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2518 2397 } 2519 } 2520 } 2521 2398 #endif 2399 } 2400 } 2401 2402 Void TDecSbac::xParseDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg ) 2403 { 2404 UInt absValDeltaDC = 0; 2405 xReadExGolombLevelDdc( absValDeltaDC ); 2406 rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 ); 2407 2408 if( rValDeltaDC != 0 ) 2409 { 2410 UInt uiSign; 2411 m_pcTDecBinIf->decodeBinEP( uiSign RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SIGN_EP) ); 2412 if ( uiSign ) 2413 { 2414 rValDeltaDC = -rValDeltaDC; 2415 } 2416 } 2417 } 2418 2419 Void TDecSbac::xReadExGolombLevelDdc( UInt& ruiSymbol ) 2420 { 2421 UInt uiSymbol; 2422 UInt uiCount = 0; 2423 do 2424 { 2425 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDdcDataSCModel.get(0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_PREFIX) ); 2426 uiCount++; 2427 } 2428 while( uiSymbol && ( uiCount != 3 ) ); 2429 ruiSymbol = uiCount - 1; 2430 2431 if( uiSymbol ) 2432 { 2433 xReadEpExGolomb( uiSymbol, 0 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SUFFIX_EP) ); 2434 ruiSymbol += uiSymbol + 1; 2435 } 2436 2437 return; 2438 } 2439 #endif 2440 #if NH_3D_DMM 2441 Void TDecSbac::xParseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2442 { 2443 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, 0, absPartIdx, depth ); 2444 2445 UInt uiSymbol; 2446 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 2447 { 2448 m_pcTDecBinIf->decodeBin( uiSymbol, m_cNotDmmFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__NOTDMM_FLAG) ); 2449 } 2450 else 2451 { 2452 uiSymbol = 1; 2453 } 2454 2455 //decode DMM mode index 2456 if( !uiSymbol ) 2457 { 2458 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag() ) 2459 { 2460 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmmModeSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMMMODE) ); 2461 if( !uiSymbol ) 2462 { 2463 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2464 } 2465 else 2466 { 2467 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2468 } 2469 } 2470 else if( pcCU->getSlice()->getIntraSdcWedgeFlag() ) 2471 { 2472 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2473 } 2474 else if( pcCU->getSlice()->getIntraContourFlag() ) 2475 { 2476 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2477 } 2478 } 2479 } 2480 2481 Void TDecSbac::xParseDmmData( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2482 { 2483 UInt dir = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ); 2484 switch( getDmmType( dir ) ) 2485 { 2486 case( DMM1_IDX ): 2487 { 2488 UInt uiTabIdx = 0; 2489 xParseDmm1WedgeIdx( uiTabIdx, g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 2490 assert( uiTabIdx < getWedgeListScaled( pcCU->getWidth( absPartIdx ) )->size() ); 2491 pcCU->setDmm1WedgeTabIdxSubParts( uiTabIdx, absPartIdx, depth ); 2492 } break; 2493 case( DMM4_IDX ): break; 2494 default: break; 2495 } 2496 } 2497 2498 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit ) 2499 { 2500 UInt uiSymbol, uiIdx = 0; 2501 for( Int i = 0; i < iNumBit; i++ ) 2502 { 2503 m_pcTDecBinIf->decodeBinEP( uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMM1_BITS_EP) ); 2504 uiIdx += uiSymbol << i; 2505 } 2506 ruiTabIdx = uiIdx; 2507 } 2508 #endif 2509 #if H_3D_INTER_SDC 2522 2510 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2523 2511 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecSbac.h
r1200 r1209 107 107 Void xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 108 108 #endif 109 #if H_3D_DIM 110 Void xReadExGolombLevel ( UInt& ruiSymbol, ContextModel& rcSCModel ); 111 Void xParseDimDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 112 #if H_3D_DIM_DMM 109 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 110 Void xReadExGolombLevelDdc( UInt& ruiSymbol ); 111 Void xParseDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 112 #endif 113 #if NH_3D_DMM 114 Void xParseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 115 Void xParseDmmData ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 113 116 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 114 117 #endif … … 116 119 Void xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 117 120 #endif 118 #endif119 121 #if H_3D_INTER_SDC 120 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );121 122 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 123 #endif … … 134 135 #if H_3D 135 136 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 #endif 138 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 139 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 136 140 #endif 137 141 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 150 154 Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 151 155 Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 152 153 #if H_3D_DIM154 Void parseIntraDepth ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );155 Void parseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );156 #endif157 158 156 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); 159 157 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); … … 227 225 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 228 226 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 229 #if H_3D_DIM 230 ContextModel3DBuffer m_cDepthIntraModeSCModel; 231 ContextModel3DBuffer m_cDdcFlagSCModel; 227 #if NH_3D_DMM 228 ContextModel3DBuffer m_cNotDmmFlagSCModel; 229 ContextModel3DBuffer m_cDmmModeSCModel; 230 #endif 231 #if NH_3D_DMM || NH_3D_SDC 232 232 ContextModel3DBuffer m_cDdcDataSCModel; 233 ContextModel3DBuffer m_cAngleFlagSCModel; 233 #endif 234 234 #if H_3D_DIM_SDC 235 235 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 236 236 ContextModel3DBuffer m_cSDCResidualSCModel; 237 #endif238 #endif239 #if H_3D_DIM_SDC240 237 ContextModel3DBuffer m_cSDCFlagSCModel; 238 ContextModel3DBuffer m_cDdcFlagSCModel; 241 239 #endif 242 240 #if H_3D_DBBP
Note: See TracChangeset for help on using the changeset viewer.