Changeset 983 in 3DVCSoftware for branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
- Timestamp:
- 11 Jul 2014, 03:49:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
r976 r983 709 709 } 710 710 #endif 711 711 #if MTK_SINGLE_DEPTH_MODE_I0095 712 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 713 if(rpcBestCU->getSlice()->getApplySingleDepthMode()) 714 { 715 xCheckRDCostSingleDepth( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 716 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 717 } 718 #endif 712 719 if(!earlyDetectionSkipMode) 713 720 { … … 1536 1543 return; 1537 1544 } 1545 #if MTK_SINGLE_DEPTH_MODE_I0095 1546 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx ); 1547 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 1548 { 1549 #endif 1538 1550 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1539 1551 … … 1568 1580 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP ); 1569 1581 setdQPFlag( bCodeDQP ); 1570 1582 #if MTK_SINGLE_DEPTH_MODE_I0095 1583 } 1584 #endif 1571 1585 // --- write terminating bit --- 1572 1586 finishCU(pcCU,uiAbsPartIdx,uiDepth); … … 1971 1985 1972 1986 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1987 #if MTK_SINGLE_DEPTH_MODE_I0095 1988 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 1989 #endif 1973 1990 #if H_3D_VSP // possible bug fix 1974 1991 if( rpcTempCU->getSkipFlag(0) ) … … 1994 2011 } 1995 2012 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2013 #if MTK_SINGLE_DEPTH_MODE_I0095 2014 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2015 #endif 1996 2016 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 1997 2017 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2130 2150 2131 2151 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2132 2152 #if MTK_SINGLE_DEPTH_MODE_I0095 2153 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2154 #endif 2133 2155 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2134 2156 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); … … 2226 2248 } 2227 2249 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2250 #if MTK_SINGLE_DEPTH_MODE_I0095 2251 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2252 #endif 2228 2253 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2229 2254 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2320 2345 } 2321 2346 } 2322 2347 #if MTK_SINGLE_DEPTH_MODE_I0095 2348 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2349 { 2350 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2351 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) 2352 { 2353 return; 2354 } 2355 2356 #if H_3D_VSO // M5 2357 if( m_pcRdCost->getUseRenModel() ) 2358 { 2359 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2360 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); 2361 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr(); 2362 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2363 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2364 } 2365 #endif 2366 2367 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2368 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 2369 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); 2370 rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth ); 2371 2372 rpcTempCU->setTrIdxSubParts(0, 0, uiDepth); 2373 rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth); 2374 rpcTempCU->setSingleDepthFlagSubParts(true, 0, uiDepth); 2375 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2376 #if H_3D_DIM_SDC 2377 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2378 #endif 2379 2380 UInt uiPreCalcDistC; 2381 m_pcPredSearch ->estIntraPredSingleDepth ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false ); 2382 2383 2384 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2385 2386 2387 m_pcEntropyCoder->resetBits(); 2388 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2389 { 2390 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2391 } 2392 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2393 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2394 2395 2396 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2397 2398 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2399 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2400 2401 2402 #if H_3D_VSO // M6 2403 if( m_pcRdCost->getUseLambdaScaleVSO()) 2404 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2405 else 2406 #endif 2407 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2408 2409 2410 xCheckDQP( rpcTempCU ); 2411 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 2412 } 2413 #endif 2323 2414 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) 2324 2415 { … … 2463 2554 2464 2555 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2465 2556 #if MTK_SINGLE_DEPTH_MODE_I0095 2557 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2558 #endif 2466 2559 rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth ); 2467 2560 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); … … 2488 2581 } 2489 2582 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2583 #if MTK_SINGLE_DEPTH_MODE_I0095 2584 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2585 if(!rpcTempCU->getSingleDepthFlag(0)) 2586 { 2587 #endif 2490 2588 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2491 2589 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); … … 2500 2598 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2501 2599 setdQPFlag( bCodeDQP ); 2502 2600 #if MTK_SINGLE_DEPTH_MODE_I0095 2601 } 2602 #endif 2503 2603 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2504 2604 … … 2528 2628 2529 2629 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2530 2630 #if MTK_SINGLE_DEPTH_MODE_I0095 2631 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2632 #endif 2531 2633 rpcTempCU->setIPCMFlag(0, true); 2532 2634 rpcTempCU->setIPCMFlagSubParts (true, 0, rpcTempCU->getDepth(0)); … … 2545 2647 } 2546 2648 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2649 #if MTK_SINGLE_DEPTH_MODE_I0095 2650 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2651 #endif 2547 2652 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2548 2653 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
Note: See TracChangeset for help on using the changeset viewer.