Changeset 1074 in 3DVCSoftware for branches/HTM-12.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
- Timestamp:
- 21 Oct 2014, 20:39:50 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-12.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r1066 r1074 52 52 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 53 53 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 54 #if MTK_SINGLE_DEPTH_MODE_I009554 #if H_3D_SINGLE_DEPTH 55 55 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 56 56 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 136 136 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 137 137 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 138 #if MTK_SINGLE_DEPTH_MODE_I0095138 #if H_3D_SINGLE_DEPTH 139 139 m_cCUSingleDepthFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 140 140 m_cSingleDepthValueSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); … … 207 207 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG ); 208 208 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 209 #if MTK_SINGLE_DEPTH_MODE_I0095209 #if H_3D_SINGLE_DEPTH 210 210 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 211 211 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); … … 432 432 #endif 433 433 434 #if !FIX_TICKET_76 435 #if H_3D_DIM_SDC 436 Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 437 { 438 assert( pcCU->getSlice()->getIsDepth() ); 439 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 440 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 441 assert( uiSegment < 2 ); 442 443 UInt uiResidual = 0; 444 UInt uiBit = 0; 445 UInt uiAbsIdx = 0; 446 UInt uiSign = 0; 447 Int iIdx = 0; 448 449 #if H_3D_DIM_DLT 450 UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() ); 451 #else 452 UInt uiMaxResidualBits = g_bitDepthY; 453 #endif 454 assert( uiMaxResidualBits <= g_bitDepthY ); 455 456 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) ); 457 458 #if H_MV_ENC_DEC_TRAC 459 DTRACE_CU("sdc_residual_flag[i]", uiResidual) 460 #endif 461 462 if (uiResidual) 463 { 464 // decode residual sign bit 465 m_pcTDecBinIf->decodeBinEP(uiSign); 466 #if H_MV_ENC_DEC_TRAC 467 DTRACE_CU("sdc_residual_sign_flag[i]", uiSign) 468 #endif 469 470 // decode residual magnitude 471 // prefix part 472 UInt uiCount = 0; 473 #if H_3D_DIM_DLT 474 UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ); 475 #else 476 UInt uiNumDepthValues = ((1 << g_bitDepthY)-1); 477 #endif 478 UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2); 479 for ( UInt ui = 0; ui < uiPrefixThreshold; ui++) 480 { 481 m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) ); 482 if ( uiBit == 0 ) 483 break; 484 else 485 uiCount++; 486 } 487 // suffix part 488 if ( uiCount == uiPrefixThreshold ) 489 { 490 for ( UInt ui = 0; ui < numBitsForValue(uiNumDepthValues - uiPrefixThreshold); ui++ ) 491 { 492 m_pcTDecBinIf->decodeBinEP( uiBit ); 493 uiAbsIdx |= uiBit << ui; 494 } 495 uiAbsIdx += uiCount; 496 } 497 else 498 { 499 uiAbsIdx = uiCount; 500 } 501 502 #if H_MV_ENC_DEC_TRAC 503 DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx) 504 #endif 505 506 uiAbsIdx += 1; 507 iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx; 508 } 509 510 pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx); 511 } 512 #endif 513 #endif 434 514 435 #endif 515 436 /** Parse I_PCM information. … … 649 570 #endif 650 571 } 651 #if MTK_SINGLE_DEPTH_MODE_I0095572 #if H_3D_SINGLE_DEPTH 652 573 Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 653 574 { … … 671 592 672 593 UInt uiUnaryIdx = 0; 673 UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;594 UInt uiNumCand = SINGLE_DEPTH_MODE_CAND_LIST_SIZE; 674 595 if ( uiNumCand > 1 ) 675 596 { … … 778 699 779 700 UInt uiSymbol; 701 Bool bParseSplitFlag = true; 702 780 703 #if H_3D_QTLPC 781 Bool bParseSplitFlag = true; 782 783 #if MTK_I0099_VPS_EX2 704 784 705 TComVPS *vps = pcCU->getPic()->getSlice(0)->getVPS(); 785 706 Bool bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId()); 786 #else787 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS();788 #endif789 707 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 790 708 Bool bDepthMapDetect = (pcTexture != NULL); … … 793 711 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 794 712 795 #if MTK_I0099_VPS_EX2 796 #if LGE_FCO_I0116 713 #if H_3D_FCO 797 714 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark()) 798 715 #else 799 716 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag) 800 #endif801 #else802 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())803 717 #endif 804 718 { … … 843 757 #if H_3D_QTLPC 844 758 Bool bParsePartSize = true; 845 #if MTK_I0099_VPS_EX2846 759 TComVPS *vps = pcCU->getPic()->getSlice(0)->getVPS(); 847 760 Bool bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId()); 848 #else849 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS();850 #endif851 761 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 852 762 Bool bDepthMapDetect = (pcTexture != NULL); … … 857 767 Bool depthDependent = false; 858 768 UInt uiTexturePart = uiMode; 859 #if MTK_I0099_VPS_EX2 860 #if LGE_FCO_I0116769 770 #if H_3D_FCO 861 771 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark()) 862 772 #else 863 773 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag ) 864 #endif865 #else866 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())867 774 #endif 868 775 { … … 1076 983 { 1077 984 #if H_3D_DIM 1078 #if SEPARATE_FLAG_I00851079 985 if( pcCU->getSlice()->getVpsDepthModesFlag() || pcCU->getSlice()->getIVPFlag() ) 1080 #else1081 if( pcCU->getSlice()->getVpsDepthModesFlag() )1082 #endif1083 986 { 1084 987 parseIntraDepth( pcCU, absPartIdx+partOffset*j, depth ); … … 1222 1125 if( uiIsDimMode ) 1223 1126 { 1224 #if SEPARATE_FLAG_I00851225 1127 if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag() ) 1226 1128 { … … 1228 1130 if( !uiSymbol ) 1229 1131 { 1230 #if HS_DMM_SIGNALLING_I01201231 1132 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth ); 1232 #else1233 pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );1234 #endif1235 1133 } 1236 1134 else 1237 1135 { 1238 #if HS_DMM_SIGNALLING_I01201239 1136 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth ); 1240 #else1241 pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );1242 #endif1243 1137 } 1244 1138 } 1245 1139 else if ( pcCU->getSlice()->getVpsDepthModesFlag() ) 1246 1140 { 1247 #if HS_DMM_SIGNALLING_I01201248 1141 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth ); 1249 #else1250 pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );1251 #endif1252 1142 } 1253 1143 else if( pcCU->getSlice()->getIVPFlag() ) 1254 1144 { 1255 #if HS_DMM_SIGNALLING_I01201256 1145 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth ); 1257 #else 1258 pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth ); 1259 #endif 1260 } 1261 #else 1262 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1263 if( !uiSymbol ) 1264 { 1265 #if HS_DMM_SIGNALLING_I0120 1266 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth ); 1267 #else 1268 pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth ); 1269 #endif 1270 } 1271 else 1272 { 1273 #if HS_DMM_SIGNALLING_I0120 1274 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth ); 1275 #else 1276 pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth ); 1277 #endif 1278 } 1279 #endif 1146 } 1280 1147 } 1281 1148 } … … 2190 2057 } 2191 2058 2192 #if HS_DMM_SIGNALLING_I01202193 2059 UInt symbol = 1; 2194 2060 UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1; 2195 #else 2196 UInt symbol = 0; 2197 UInt uiNumSegments = 0; 2198 #endif 2199 2200 #if HS_DMM_SIGNALLING_I0120 2061 2201 2062 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2202 2063 { 2203 #else 2204 if( pcCU->isIntra( absPartIdx ) ) 2205 { 2206 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2207 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2208 #endif 2064 2209 2065 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2210 #if !HS_DMM_SIGNALLING_I01202211 if( pcCU->getSDCFlag( absPartIdx ) )2212 {2213 #endif2214 2066 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); 2215 2067 pcCU->setTrIdxSubParts( 0, absPartIdx, depth ); 2216 2068 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2217 2069 } 2218 #if !HS_DMM_SIGNALLING_I01202219 else2220 {2221 pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth );2222 }2223 }2224 else2225 {2226 uiNumSegments = 1;2227 symbol = 1;2228 }2229 #endif2230 2231 2070 2232 2071 for( UInt segment = 0; segment < uiNumSegments; segment++ ) … … 2289 2128 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) ); 2290 2129 2291 #if SEC_DBBP_EXPLICIT_SIG_I00772292 2130 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2293 2131 AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N ); … … 2295 2133 pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx, 0, uiDepth); 2296 2134 pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx+uiPUOffset, 1, uiDepth); 2297 #else2298 if( uiSymbol )2299 {2300 pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);2301 UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;2302 pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);2303 }2304 #endif2305 2135 } 2306 2136 #endif
Note: See TracChangeset for help on using the changeset viewer.