Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCu.cpp
- Timestamp:
- 7 Apr 2015, 17:05:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 275 275 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 276 276 277 #if H_3D_DISABLE_CHROMA 278 m_ppcWeightedTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 279 #endif 280 277 281 #if KWU_RC_MADPRED_E0227 278 282 m_LCUPredictionSAD = 0; … … 437 441 #if H_3D_VSP 438 442 DisInfo DvInfo; 443 #if !SEC_ARP_REM_ENC_RESTRICT_K0035 439 444 DvInfo.bDV = false; 445 #endif 440 446 DvInfo.m_acNBDV.setZero(); 441 447 DvInfo.m_aVIdxCan = 0; … … 583 589 if (rpcTempCU->getSlice()->getIsDepth() ) 584 590 { 591 #if SEC_ARP_REM_ENC_RESTRICT_K0035 592 rpcTempCU->getDispforDepth(0, 0, &DvInfo); 593 #else 585 594 DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo); 595 #endif 586 596 } 587 597 else … … 590 600 #if H_3D_NBDV_REF 591 601 if( rpcTempCU->getSlice()->getDepthRefinementFlag() ) 602 #if SEC_ARP_REM_ENC_RESTRICT_K0035 603 rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 604 #else 592 605 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 606 #endif 593 607 else 594 608 #endif 609 #if SEC_ARP_REM_ENC_RESTRICT_K0035 610 rpcTempCU->getDisMvpCandNBDV(&DvInfo); 611 #else 595 612 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo); 613 #endif 596 614 597 615 #if H_3D_IV_MERGE … … 712 730 } 713 731 #endif 732 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 733 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 734 if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() ) 735 { 736 xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 737 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 738 } 739 #else 714 740 #if H_3D_SINGLE_DEPTH 715 741 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); … … 719 745 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 720 746 } 747 #endif 721 748 #endif 722 749 if(!earlyDetectionSkipMode) … … 1226 1253 TComDataCU* pcSubTempPartCU = m_ppcTempCU[uhNextDepth]; 1227 1254 1255 #if H_3D_DISABLE_CHROMA 1256 m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice()); 1257 #endif 1228 1258 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) 1229 1259 { … … 1577 1607 return; 1578 1608 } 1609 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1610 m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx ); 1611 if(!pcCU->getDISFlag(uiAbsPartIdx)) 1612 { 1613 #else 1579 1614 #if H_3D_SINGLE_DEPTH 1580 1615 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx ); … … 1582 1617 { 1583 1618 #endif 1619 #endif 1584 1620 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1585 1621 1586 1622 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1587 1623 1624 #if !HHI_MOVE_SYN_K0052 1588 1625 #if H_3D_DIM_SDC 1589 1626 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1590 1627 #endif 1628 #endif 1591 1629 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1592 1630 { 1593 1631 m_pcEntropyCoder->encodeIPCMInfo( pcCU, uiAbsPartIdx ); 1594 1595 1632 if(pcCU->getIPCMFlag(uiAbsPartIdx)) 1596 1633 { 1634 #if HHI_MOVE_SYN_K0052 1635 #if H_3D_DIM_SDC 1636 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1637 #endif 1638 #endif 1597 1639 // Encode slice finish 1598 1640 finishCU(pcCU,uiAbsPartIdx,uiDepth); … … 1603 1645 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1604 1646 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1605 1647 #if HHI_MOVE_SYN_K0052 1648 m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx ); 1649 #if H_3D_DIM_SDC 1650 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1651 #endif 1652 #endif 1606 1653 #if H_3D_ARP 1607 1654 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); … … 1612 1659 // Encode Coefficients 1613 1660 Bool bCodeDQP = getdQPFlag(); 1661 #if H_3D_DISABLE_CHROMA 1662 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP, false ); 1663 #else 1614 1664 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP ); 1665 #endif 1615 1666 setdQPFlag( bCodeDQP ); 1667 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1668 } 1669 #else 1616 1670 #if H_3D_SINGLE_DEPTH 1617 1671 } 1672 #endif 1618 1673 #endif 1619 1674 // --- write terminating bit --- … … 1834 1889 #if H_3D_ARP 1835 1890 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1891 #if SEC_ARP_REM_ENC_RESTRICT_K0035 1892 if( nARPWMax < 0 || bICFlag ) 1893 #else 1836 1894 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag ) 1895 #endif 1837 1896 { 1838 1897 nARPWMax = 0; … … 2000 2059 2001 2060 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 2061 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2062 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2063 #else 2002 2064 #if H_3D_SINGLE_DEPTH 2003 2065 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2066 #endif 2004 2067 #endif 2005 2068 #if H_3D_VSP // possible bug fix … … 2042 2105 } 2043 2106 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2107 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2108 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2109 #else 2044 2110 #if H_3D_SINGLE_DEPTH 2045 2111 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2112 #endif 2046 2113 #endif 2047 2114 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); … … 2166 2233 Bool bFirstTime = true; 2167 2234 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2168 2235 #if SEC_ARP_REM_ENC_RESTRICT_K0035 2236 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) ) 2237 #else 2169 2238 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) ) 2239 #endif 2170 2240 { 2171 2241 nARPWMax = 0; … … 2193 2263 2194 2264 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2265 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2266 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2267 #else 2195 2268 #if H_3D_SINGLE_DEPTH 2196 2269 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2270 #endif 2197 2271 #endif 2198 2272 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); … … 2303 2377 } 2304 2378 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2379 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2380 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2381 #else 2305 2382 #if H_3D_SINGLE_DEPTH 2306 2383 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2384 #endif 2307 2385 #endif 2308 2386 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); … … 2413 2491 } 2414 2492 } 2493 2494 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2495 Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2496 { 2497 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2498 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) 2499 { 2500 return; 2501 } 2502 2503 #if H_3D_VSO // M5 2504 if( m_pcRdCost->getUseRenModel() ) 2505 { 2506 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2507 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); 2508 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr(); 2509 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2510 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2511 } 2512 #endif 2513 2514 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2515 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 2516 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); 2517 rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth ); 2518 2519 rpcTempCU->setTrIdxSubParts(0, 0, uiDepth); 2520 rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth); 2521 rpcTempCU->setDISFlagSubParts(true, 0, uiDepth); 2522 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2523 #if H_3D_DIM_SDC 2524 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2525 #endif 2526 2527 UInt uiPreCalcDistC; 2528 m_pcPredSearch ->estIntraPredDIS ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false ); 2529 2530 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 2531 Int oldTraceCopyBack = g_traceCopyBack; 2532 g_traceCopyBack = false; 2533 #endif 2534 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2535 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 2536 g_traceCopyBack = oldTraceCopyBack; 2537 #endif 2538 2539 2540 m_pcEntropyCoder->resetBits(); 2541 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2542 { 2543 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2544 } 2545 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2546 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2547 2548 2549 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2550 2551 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2552 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2553 2554 2555 #if H_3D_VSO // M6 2556 if( m_pcRdCost->getUseLambdaScaleVSO()) 2557 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2558 else 2559 #endif 2560 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2561 2562 2563 xCheckDQP( rpcTempCU ); 2564 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 2565 } 2566 #else 2415 2567 #if H_3D_SINGLE_DEPTH 2416 2568 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) … … 2480 2632 } 2481 2633 #endif 2634 #endif 2482 2635 2483 2636 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) … … 2522 2675 AOF( uiDepthStride != 0 ); 2523 2676 2677 #if HS_DBBP_CLEAN_K0048 2678 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU); 2679 2524 2680 // derive partitioning from depth 2681 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2682 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU); 2683 #else 2525 2684 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth); 2526 2685 … … 2528 2687 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2529 2688 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask); 2689 #endif 2530 2690 2531 2691 if( !bValidMask ) … … 2636 2796 2637 2797 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2798 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2799 rpcTempCU->setDISFlagSubParts( false, 0, uiDepth ); 2800 #else 2638 2801 #if H_3D_SINGLE_DEPTH 2639 2802 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2803 #endif 2640 2804 #endif 2641 2805 rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth ); … … 2656 2820 2657 2821 #if H_3D_DIM_SDC 2822 #if 0 // H_3D_DISABLE_CHROMA 2823 if( !rpcTempCU->getSDCFlag( 0 ) && !rpcTempCU->getSlice()->getIsDepth() ) 2824 #else 2658 2825 if( !rpcTempCU->getSDCFlag( 0 ) ) 2826 #endif 2659 2827 #endif 2660 2828 m_pcPredSearch ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC ); … … 2666 2834 } 2667 2835 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2836 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2837 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2838 if(!rpcTempCU->getDISFlag(0)) 2839 { 2840 #else 2668 2841 #if H_3D_SINGLE_DEPTH 2669 2842 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); … … 2671 2844 { 2672 2845 #endif 2846 #endif 2673 2847 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2674 2848 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2849 #if !HHI_MOVE_SYN_K0052 2675 2850 #if H_3D_DIM_SDC 2676 2851 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2677 2852 #endif 2853 #endif 2678 2854 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2679 2855 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2856 #if HHI_MOVE_SYN_K0052 2857 #if H_3D_DIM_SDC 2858 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2859 #endif 2860 #endif 2680 2861 2681 2862 // Encode Coefficients 2682 2863 Bool bCodeDQP = getdQPFlag(); 2864 #if H_3D_DISABLE_CHROMA 2865 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true ); 2866 #else 2683 2867 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2868 #endif 2869 2870 2684 2871 setdQPFlag( bCodeDQP ); 2872 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2873 } 2874 #else 2685 2875 #if H_3D_SINGLE_DEPTH 2686 2876 } 2687 #endif 2877 #endif 2878 #endif 2688 2879 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2689 2880 … … 2713 2904 2714 2905 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2906 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2907 rpcTempCU->setDISFlagSubParts( false, 0, uiDepth ); 2908 #else 2715 2909 #if H_3D_SINGLE_DEPTH 2716 2910 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2911 #endif 2717 2912 #endif 2718 2913 rpcTempCU->setIPCMFlag(0, true); … … 2732 2927 } 2733 2928 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2929 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2930 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2931 #else 2734 2932 #if H_3D_SINGLE_DEPTH 2735 2933 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2736 2934 #endif 2935 #endif 2737 2936 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2738 2937 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2938 #if !HHI_MOVE_SYN_K0052 2739 2939 #if H_3D_DIM_SDC 2740 2940 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2741 2941 #endif 2942 #endif 2742 2943 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2743 2944 #if HHI_MOVE_SYN_K0052 2945 #if H_3D_DIM_SDC 2946 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2947 #endif 2948 #endif 2744 2949 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2745 2950
Note: See TracChangeset for help on using the changeset viewer.