Changeset 1039 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 4 Aug 2014, 11:36:05 (11 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r976 r1039 887 887 { 888 888 #if H_3D_QTLPC 889 #if !MTK_I0099_VPS_EX2 889 890 //GT: This has to go to VPS 890 891 if( depthFlag ) … … 893 894 WRITE_FLAG( pcSPS->getUsePC() ? 1 : 0, "use_pc_flag"); 894 895 } 896 #endif 895 897 #endif 896 898 } … … 1558 1560 Void TEncCavlc::codeVPSExtension2( TComVPS* pcVPS ) 1559 1561 { 1562 #if SEC_VPS_CLEANUP_I0090 1563 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1564 #else 1560 1565 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1561 { 1566 #endif 1567 { 1568 #if !SEC_VPS_CLEANUP_I0090 1562 1569 if (i!= 0) 1563 { 1570 #endif 1571 { 1572 #if MTK_I0099_VPS_EX2 1573 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1574 #if SEC_HLS_CLEANUP_I0100 1575 WRITE_FLAG( pcVPS->getIvMvScalingFlag( i ) ? 1 : 0 , "iv_mv_scaling_flag[i]" ); 1576 #endif 1577 1578 #endif 1564 1579 if ( !( pcVPS->getDepthId( i ) == 1 ) ) 1565 1580 { 1566 1581 #if H_3D_IV_MERGE 1582 #if !MTK_I0099_VPS_EX2 1567 1583 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1584 #endif 1568 1585 #if H_3D_SPIVMP 1569 1586 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]"); … … 1585 1602 else 1586 1603 { 1604 #if !MTK_I0099_VPS_EX2 1587 1605 if(i!=1) 1588 1606 { … … 1595 1613 } 1596 1614 #endif 1615 #endif 1597 1616 #if H_3D_IV_MERGE 1598 1617 WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 , "mpi_flag[i]" ); 1599 1618 #endif 1619 #if MTK_I0099_VPS_EX2 1620 WRITE_UVLC( pcVPS->getSubPUMPILog2Size(i)-3, "log2_mpi_sub_PU_size_minus3[i]"); 1621 #endif 1600 1622 WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 , "vps_depth_modes_flag[i]" ); 1601 //WRITE_FLAG( pcVPS->getLimQtPredFlag ( i ) ? 1 : 0 , "lim_qt_pred_flag[i]" ); 1623 #if SEPARATE_FLAG_I0085 1624 WRITE_FLAG( pcVPS->getIVPFlag( i ) ? 1 : 0 , "IVP_flag[i]" ); 1625 #endif 1626 #if MTK_I0099_VPS_EX2 1627 WRITE_FLAG( pcVPS->getLimQtPredFlag ( i ) ? 1 : 0 , "lim_qt_pred_flag[i]" ); 1628 #endif 1629 1602 1630 #if H_3D_INTER_SDC 1603 1631 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); … … 1607 1635 } 1608 1636 WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" ); 1637 #if SEC_VPS_CLEANUP_I0090 1638 for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++) 1639 #else 1609 1640 for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++) 1641 #endif 1610 1642 { 1611 1643 WRITE_FLAG( pcVPS->getCamParPresent(viewIndex) ? 1 : 0, "cp_present_flag[i]" ); … … 1625 1657 } 1626 1658 } 1659 #if !MTK_I0099_VPS_EX2 1627 1660 WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3"); 1661 #endif 1628 1662 #if H_3D_TMVP 1663 #if !SEC_HLS_CLEANUP_I0100 1629 1664 WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 , "iv_mv_scaling_flag" ); 1665 #endif 1630 1666 #endif 1631 1667 } … … 2013 2049 } 2014 2050 #if H_3D_IC 2051 #if SEC_HLS_CLEANUP_I0100 2052 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 ) 2053 #else 2015 2054 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth()) 2055 #endif 2016 2056 { 2017 2057 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); … … 2022 2062 } 2023 2063 #endif 2024 2064 #if MTK_SINGLE_DEPTH_MODE_I0095 2065 if(pcSlice->getIsDepth()) 2066 { 2067 WRITE_FLAG( pcSlice->getApplySingleDepthMode() ? 1 : 0, "slice_enable_single_depth_mode" ); 2068 } 2069 #endif 2025 2070 #if H_3D_IV_MERGE 2026 2071 assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM); … … 2408 2453 assert(0); 2409 2454 } 2410 2455 #if MTK_SINGLE_DEPTH_MODE_I0095 2456 Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2457 { 2458 assert(0); 2459 } 2460 #endif 2411 2461 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2412 2462 { -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r884 r1039 123 123 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 124 124 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 125 #if MTK_SINGLE_DEPTH_MODE_I0095 126 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 127 #endif 125 128 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 126 129 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r976 r1039 414 414 #if H_3D_DIM 415 415 Bool m_useDMM; 416 #if SEPARATE_FLAG_I0085 417 Bool m_useIVP; 418 #endif 416 419 Bool m_useSDC; 417 420 Bool m_useDLT; 418 421 #endif 422 #if MTK_SINGLE_DEPTH_MODE_I0095 423 Bool m_useSingleDepthMode; 424 #endif 419 425 #if H_3D_IV_MERGE 420 426 Bool m_useMPI; 421 427 #endif 428 #if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX 422 429 #if H_3D_QTLPC 423 430 Bool m_bUseQTL; 431 #if !MTK_I0099_VPS_EX2 424 432 Bool m_bUsePC; 433 #endif 434 #endif 425 435 #endif 426 436 #endif … … 1003 1013 Bool getUseDMM () { return m_useDMM; } 1004 1014 Void setUseDMM ( Bool b) { m_useDMM = b; } 1015 #if SEPARATE_FLAG_I0085 1016 Bool getUseIVP () { return m_useIVP; } 1017 Void setUseIVP ( Bool b) { m_useIVP = b; } 1018 #endif 1005 1019 Bool getUseSDC () { return m_useSDC; } 1006 1020 Void setUseSDC ( Bool b) { m_useSDC = b; } … … 1008 1022 Void setUseDLT ( Bool b) { m_useDLT = b; } 1009 1023 #endif 1024 #if MTK_SINGLE_DEPTH_MODE_I0095 1025 Void setUseSingleDepthMode ( Bool bVal ) { m_useSingleDepthMode = bVal; } 1026 Bool getUseSingleDepthMode () { return m_useSingleDepthMode; } 1027 #endif 1028 #if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX 1010 1029 #if H_3D_QTLPC 1011 1030 Void setUseQTL ( Bool b ) { m_bUseQTL = b; } 1012 1031 Bool getUseQTL () { return m_bUseQTL; } 1032 #if !MTK_I0099_VPS_EX2 1013 1033 Void setUsePC ( Bool b ) { m_bUsePC = b; } 1014 1034 Bool getUsePC () { return m_bUsePC; } 1035 #endif 1036 #endif 1015 1037 #endif 1016 1038 #if H_3D_IV_MERGE -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r976 r1039 409 409 410 410 #if H_3D_QTLPC 411 #if MTK_I0099_VPS_EX2 412 TComVPS *vps = pcPic->getSlice(0)->getVPS(); 413 Bool bLimQtPredFalg = vps->getLimQtPredFlag(pcPic->getSlice(0)->getLayerId()); 414 #else 411 415 TComSPS *sps = pcPic->getSlice(0)->getSPS(); 416 #endif 412 417 TComPic *pcTexture = rpcBestCU->getSlice()->getTexturePic(); 413 418 … … 531 536 //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU 532 537 538 #if MTK_I0099_VPS_EX2 539 #if MTK_I0099_FIX 540 if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg )) 541 #else 542 if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg) 543 #endif 544 #else 533 545 if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL()) 546 #endif 534 547 { 535 548 TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU … … 685 698 686 699 #if H_3D_QTLPC 700 #if MTK_I0099_VPS_EX2 701 #if MTK_I0099_FIX 702 if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg )) 703 #else 704 if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg) 705 #endif 706 #else 687 707 if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL()) 708 #endif 688 709 { 689 710 bTrySplitDQP = bTrySplit; … … 709 730 } 710 731 #endif 711 732 #if MTK_SINGLE_DEPTH_MODE_I0095 733 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 734 if(rpcBestCU->getSlice()->getApplySingleDepthMode()) 735 { 736 xCheckRDCostSingleDepth( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 737 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 738 } 739 #endif 712 740 if(!earlyDetectionSkipMode) 713 741 { … … 1021 1049 // speedup for inter frames 1022 1050 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 1023 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 ||1024 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 ||1051 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 1052 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 1025 1053 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 1026 1054 #if H_3D_DIM_ENC 1055 #if HHI_DMM4_ENC_I0066 1056 || rpcBestCU->getSlice()->getIsDepth() 1057 #else 1027 1058 || ( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() ) 1059 #endif 1028 1060 #endif 1029 1061 ) // avoid very complex intra if it is unlikely 1030 1062 { 1063 #if HHI_DMM4_ENC_I0066 1064 Bool bOnlyIVP = false; 1065 if( rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP()) && 1066 rpcBestCU->getSlice()->getSliceType() != I_SLICE && 1067 rpcBestCU->getCbf( 0, TEXT_LUMA ) == 0 && 1068 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) == 0 && 1069 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) == 0 1070 ) 1071 { 1072 bOnlyIVP = true; 1073 } 1074 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bOnlyIVP ); 1075 #else 1031 1076 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 1077 #endif 1032 1078 1033 1079 #if KWU_RC_MADPRED_E0227 … … 1048 1094 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 1049 1095 { 1096 #if HHI_DMM4_ENC_I0066 1097 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN, bOnlyIVP ); 1098 #else 1050 1099 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 1100 #endif 1051 1101 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1052 1102 } … … 1536 1586 return; 1537 1587 } 1588 #if MTK_SINGLE_DEPTH_MODE_I0095 1589 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx ); 1590 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 1591 { 1592 #endif 1538 1593 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1539 1594 … … 1568 1623 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP ); 1569 1624 setdQPFlag( bCodeDQP ); 1570 1625 #if MTK_SINGLE_DEPTH_MODE_I0095 1626 } 1627 #endif 1571 1628 // --- write terminating bit --- 1572 1629 finishCU(pcCU,uiAbsPartIdx,uiDepth); … … 1802 1859 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1803 1860 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1861 #if !FIX_TICKET_79 1804 1862 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1863 #endif 1805 1864 #if H_3D_SPIVMP 1806 1865 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; … … 1815 1874 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1816 1875 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1876 #if !FIX_TICKET_79 1817 1877 , inheritedVSPDisInfo 1878 #endif 1818 1879 #if H_3D_SPIVMP 1819 1880 , pcMvFieldSP, puhInterDirSP … … 1830 1891 1831 1892 #else 1893 #if FIX_TICKET_79 1894 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand ); 1895 #else 1832 1896 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 1833 1897 #endif 1898 #endif 1899 1834 1900 1835 1901 #endif … … 1872 1938 #if H_3D_VSP 1873 1939 rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth ); 1940 #if !FIX_TICKET_79 1874 1941 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1942 #endif 1875 1943 #endif 1876 1944 #if H_3D_DDD … … 1971 2039 1972 2040 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 2041 #if MTK_SINGLE_DEPTH_MODE_I0095 2042 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2043 #endif 1973 2044 #if H_3D_VSP // possible bug fix 1974 2045 if( rpcTempCU->getSkipFlag(0) ) … … 1986 2057 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1987 2058 { 2059 #if FAST_SDC_OFFSET_DECISION_I0084 2060 Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE}; 2061 for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ ) 2062 #else 1988 2063 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2064 #endif 1989 2065 { 2066 #if FAST_SDC_OFFSET_DECISION_I0084 2067 if( uiOffest > 3) 2068 { 2069 if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) ) 2070 { 2071 continue; 2072 } 2073 if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] && uiOffest == 5) 2074 { 2075 continue; 2076 } 2077 if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] && uiOffest == 4) 2078 { 2079 continue; 2080 } 2081 } 2082 #endif 1990 2083 if( rpcTempCU != rpcTempCUPre ) 1991 2084 { … … 1994 2087 } 1995 2088 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2089 #if MTK_SINGLE_DEPTH_MODE_I0095 2090 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2091 #endif 1996 2092 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 1997 2093 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2006 2102 } 2007 2103 #endif 2104 #if FAST_SDC_OFFSET_DECISION_I0084 2105 Int iSdcOffset = 0; 2106 if(uiOffest % 2 == 0) 2107 { 2108 iSdcOffset = uiOffest >> 1; 2109 } 2110 else 2111 { 2112 iSdcOffset = -1 * (uiOffest >> 1); 2113 } 2114 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2115 m_ppcOrigYuv[uhDepth], 2116 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2117 m_ppcResiYuvTemp[uhDepth], 2118 m_ppcRecoYuvTemp[uhDepth], 2119 iSdcOffset, 2120 uhDepth ); 2121 if (uiOffest <= 3 ) 2122 { 2123 dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost(); 2124 } 2125 #else 2008 2126 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2009 2127 m_ppcOrigYuv[uhDepth], … … 2013 2131 uiOffest, 2014 2132 uhDepth ); 2133 #endif 2015 2134 2016 2135 xCheckDQP( rpcTempCU ); … … 2130 2249 2131 2250 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2132 2251 #if MTK_SINGLE_DEPTH_MODE_I0095 2252 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2253 #endif 2133 2254 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2134 2255 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); … … 2217 2338 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2218 2339 { 2340 #if FAST_SDC_OFFSET_DECISION_I0084 2341 Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE}; 2342 for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ ) 2343 #else 2219 2344 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2220 { 2345 #endif 2346 { 2347 #if FAST_SDC_OFFSET_DECISION_I0084 2348 if( uiOffest > 3) 2349 { 2350 if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) ) 2351 { 2352 continue; 2353 } 2354 if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] && uiOffest == 5) 2355 { 2356 continue; 2357 } 2358 if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] && uiOffest == 4) 2359 { 2360 continue; 2361 } 2362 } 2363 #endif 2221 2364 if( rpcTempCU != rpcTempCUPre ) 2222 2365 { … … 2226 2369 } 2227 2370 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2371 #if MTK_SINGLE_DEPTH_MODE_I0095 2372 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2373 #endif 2228 2374 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2229 2375 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2239 2385 #endif 2240 2386 2387 #if FAST_SDC_OFFSET_DECISION_I0084 2388 Int iSdcOffset = 0; 2389 if(uiOffest % 2 == 0) 2390 { 2391 iSdcOffset = uiOffest >> 1; 2392 } 2393 else 2394 { 2395 iSdcOffset = -1 * (uiOffest >> 1); 2396 } 2397 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2398 m_ppcOrigYuv[uhDepth], 2399 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2400 m_ppcResiYuvTemp[uhDepth], 2401 m_ppcRecoYuvTemp[uhDepth], 2402 iSdcOffset, 2403 uhDepth ); 2404 if (uiOffest <= 3 ) 2405 { 2406 dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost(); 2407 } 2408 #else 2241 2409 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2242 2410 m_ppcOrigYuv[uhDepth], … … 2246 2414 uiOffest, 2247 2415 uhDepth ); 2416 #endif 2248 2417 2249 2418 xCheckDQP( rpcTempCU ); … … 2320 2489 } 2321 2490 } 2322 2491 #if MTK_SINGLE_DEPTH_MODE_I0095 2492 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2493 { 2494 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2495 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) 2496 { 2497 return; 2498 } 2499 2500 #if H_3D_VSO // M5 2501 if( m_pcRdCost->getUseRenModel() ) 2502 { 2503 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2504 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); 2505 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr(); 2506 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2507 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2508 } 2509 #endif 2510 2511 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2512 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 2513 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); 2514 rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth ); 2515 2516 rpcTempCU->setTrIdxSubParts(0, 0, uiDepth); 2517 rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth); 2518 rpcTempCU->setSingleDepthFlagSubParts(true, 0, uiDepth); 2519 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2520 #if H_3D_DIM_SDC 2521 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2522 #endif 2523 2524 UInt uiPreCalcDistC; 2525 m_pcPredSearch ->estIntraPredSingleDepth ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false ); 2526 2527 2528 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2529 2530 2531 m_pcEntropyCoder->resetBits(); 2532 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2533 { 2534 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2535 } 2536 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2537 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2538 2539 2540 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2541 2542 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2543 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2544 2545 2546 #if H_3D_VSO // M6 2547 if( m_pcRdCost->getUseLambdaScaleVSO()) 2548 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2549 else 2550 #endif 2551 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2552 2553 2554 xCheckDQP( rpcTempCU ); 2555 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 2556 } 2557 #endif 2323 2558 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) 2324 2559 { … … 2341 2576 UInt uiHeight = rpcTempCU->getHeight(0); 2342 2577 AOF( uiWidth == uiHeight ); 2578 2579 #if SEC_DBBP_DISALLOW_8x8_I0078 2580 if(uiWidth <= 8) 2581 { 2582 return; 2583 } 2584 #endif 2343 2585 2344 2586 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); … … 2438 2680 2439 2681 // reconstruct final prediction signal by combining both segments 2682 #if SHARP_DBBP_SIMPLE_FLTER_I0109 2683 m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize); 2684 #else 2440 2685 m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight); 2686 #endif 2441 2687 2442 2688 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); … … 2447 2693 #endif 2448 2694 2695 #if HHI_DMM4_ENC_I0066 2696 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP ) 2697 #else 2449 2698 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2699 #endif 2450 2700 { 2451 2701 UInt uiDepth = rpcTempCU->getDepth( 0 ); … … 2463 2713 2464 2714 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2465 2715 #if MTK_SINGLE_DEPTH_MODE_I0095 2716 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2717 #endif 2466 2718 rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth ); 2467 2719 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); … … 2473 2725 m_pcPredSearch->preestChromaPredMode( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth] ); 2474 2726 } 2727 #if HHI_DMM4_ENC_I0066 2728 m_pcPredSearch ->estIntraPredQT ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma, bOnlyIVP ); 2729 #else 2475 2730 m_pcPredSearch ->estIntraPredQT ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma ); 2476 2731 #endif 2477 2732 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2478 2733 … … 2488 2743 } 2489 2744 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2745 #if MTK_SINGLE_DEPTH_MODE_I0095 2746 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2747 if(!rpcTempCU->getSingleDepthFlag(0)) 2748 { 2749 #endif 2490 2750 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2491 2751 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); … … 2500 2760 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2501 2761 setdQPFlag( bCodeDQP ); 2502 2762 #if MTK_SINGLE_DEPTH_MODE_I0095 2763 } 2764 #endif 2503 2765 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2504 2766 … … 2528 2790 2529 2791 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2530 2792 #if MTK_SINGLE_DEPTH_MODE_I0095 2793 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2794 #endif 2531 2795 rpcTempCU->setIPCMFlag(0, true); 2532 2796 rpcTempCU->setIPCMFlagSubParts (true, 0, rpcTempCU->getDepth(0)); … … 2545 2809 } 2546 2810 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2811 #if MTK_SINGLE_DEPTH_MODE_I0095 2812 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2813 #endif 2547 2814 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2548 2815 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); -
trunk/source/Lib/TLibEncoder/TEncCu.h
r872 r1039 159 159 Void xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false ); 160 160 #endif 161 #if MTK_SINGLE_DEPTH_MODE_I0095 162 Void xCheckRDCostSingleDepth ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 163 #endif 164 #if HHI_DMM4_ENC_I0066 165 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bOnlyIVP ); 166 #else 161 167 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 168 #endif 162 169 Void xCheckDQP ( TComDataCU* pcCU ); 163 170 -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r976 r1039 119 119 m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx ); 120 120 } 121 121 #if MTK_SINGLE_DEPTH_MODE_I0095 122 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 123 { 124 if ( !pcCU->getSlice()->getIsDepth() ) 125 { 126 return; 127 } 128 if(!pcCU->getSlice()->getApplySingleDepthMode()) 129 { 130 return; 131 } 132 133 if( bRD ) 134 { 135 uiAbsPartIdx = 0; 136 } 137 m_pcEntropyCoderIf->codeSingleDepthMode( pcCU, uiAbsPartIdx ); 138 } 139 #endif 122 140 /** encode merge flag 123 141 * \param pcCU … … 244 262 245 263 #if H_3D_DBBP 264 #if! SEC_DBBP_EXPLICIT_SIG_I0077 246 265 PartSize eVirtualPartSize = pcCU->getPartitionSize(uiAbsPartIdx); 247 266 if( pcCU->getDBBPFlag(uiAbsPartIdx) ) … … 253 272 } 254 273 #endif 274 #endif 255 275 256 276 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 257 277 258 278 #if H_3D_DBBP 279 #if SEC_DBBP_EXPLICIT_SIG_I0077 280 #if SEC_DBBP_DISALLOW_8x8_I0078 281 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 ) 282 #else 283 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) ) 284 #endif 285 #else 286 #if SEC_DBBP_DISALLOW_8x8_I0078 287 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 ) 288 #else 259 289 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ) 290 #endif 291 #endif 260 292 { 261 293 encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD); 262 294 #if !SEC_DBBP_EXPLICIT_SIG_I0077 263 295 if( pcCU->getDBBPFlag(uiAbsPartIdx) ) 264 296 { … … 266 298 pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth); 267 299 } 300 #endif 268 301 } 269 302 #endif -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r884 r1039 86 86 virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 87 87 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 88 #if MTK_SINGLE_DEPTH_MODE_I0095 89 virtual Void codeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #endif 88 91 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 92 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 171 174 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 172 175 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 176 #if MTK_SINGLE_DEPTH_MODE_I0095 177 Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false ); 178 #endif 173 179 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 174 180 Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r976 r1039 934 934 pcSlice->setRefPicList ( rcListPic ); 935 935 #endif 936 936 #if MTK_SINGLE_DEPTH_MODE_I0095 937 TEncTop* pcEncTop = (TEncTop*) m_pcCfg; 938 bool enableSingleDepthMode=false; 939 if(pcEncTop->getUseSingleDepthMode()) 940 { 941 if(pcSlice->getIsDepth()) 942 { 943 enableSingleDepthMode=true; 944 } 945 } 946 pcSlice->setApplySingleDepthMode(enableSingleDepthMode); 947 #endif 937 948 #if H_3D_ARP 938 949 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r976 r1039 58 58 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 59 59 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 60 #if MTK_SINGLE_DEPTH_MODE_I0095 61 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 #endif 60 64 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 65 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 130 134 131 135 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 136 #if MTK_SINGLE_DEPTH_MODE_I0095 137 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 138 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 139 #endif 132 140 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 133 141 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); … … 206 214 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 207 215 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 216 #if MTK_SINGLE_DEPTH_MODE_I0095 217 curCost += m_cCUSingleDepthFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 218 curCost += m_cSingleDepthValueSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 219 #endif 208 220 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 209 221 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); … … 243 255 curCost += m_CUTransquantBypassFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG ); 244 256 #if H_3D_DIM 257 #if SEPARATE_FLAG_I0085 258 if( m_pcSlice->getVpsDepthModesFlag() || m_pcSlice->getIVPFlag() ) 259 #else 245 260 if( m_pcSlice->getVpsDepthModesFlag() ) 261 #endif 246 262 { 247 263 curCost += m_cDepthIntraModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); … … 275 291 276 292 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 293 #if MTK_SINGLE_DEPTH_MODE_I0095 294 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 295 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 296 #endif 277 297 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 278 298 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); … … 434 454 m_pcBinIf->encodeBinsEP( bins, numBins ); 435 455 } 436 456 #if MTK_SINGLE_DEPTH_MODE_I0095 457 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 458 { 459 UInt uiSymbol = pcCU->getSingleDepthFlag(uiAbsPartIdx ) ? 1 : 0; 460 m_pcBinIf->encodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) ); 461 if(uiSymbol) 462 { 463 UInt uiUnaryIdx = (UInt) pcCU->getSingleDepthValue(uiAbsPartIdx); 464 UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE; 465 if ( uiNumCand > 1 ) 466 { 467 for( UInt ui = 0; ui < uiNumCand - 1; ++ui ) 468 { 469 const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1; 470 if ( ui==0 ) 471 { 472 m_pcBinIf->encodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) ); 473 } 474 else 475 { 476 m_pcBinIf->encodeBinEP( uiSymbol2 ); 477 } 478 if( uiSymbol2 == 0 ) 479 { 480 break; 481 } 482 } 483 } 484 } 485 } 486 #endif 437 487 /** Coding of coeff_abs_level_minus3 438 488 * \param uiSymbol value of coeff_abs_level_minus3 … … 514 564 #endif 515 565 566 #if !FIX_TICKET_76 516 567 #if H_3D_DIM_SDC 517 568 Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) … … 600 651 #endif 601 652 #endif 653 #endif 654 602 655 603 656 // SBAC RD … … 664 717 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 665 718 #if H_3D_QTLPC 719 #if MTK_I0099_VPS_EX2 720 TComVPS *vps = pcCU->getPic()->getSlice(0)->getVPS(); 721 Bool bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId()); 722 #else 666 723 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 724 #endif 667 725 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 668 726 Bool bDepthMapDetect = (pcTexture != NULL); … … 673 731 Bool depthDependent = false; 674 732 UInt uiTexturePart = eSize; 733 #if MTK_I0099_VPS_EX2 734 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag ) 735 #else 675 736 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() ) 737 #endif 676 738 { 677 739 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); … … 1031 1093 Bool bCodeSplitFlag = true; 1032 1094 1095 #if MTK_I0099_VPS_EX2 1096 TComVPS *vps = pcCU->getPic()->getSlice(0)->getVPS(); 1097 Bool bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId()); 1098 #else 1033 1099 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 1100 #endif 1034 1101 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 1035 1102 Bool bDepthMapDetect = (pcTexture != NULL); … … 1038 1105 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); 1039 1106 1107 #if MTK_I0099_VPS_EX2 1108 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag ) 1109 #else 1040 1110 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC()) 1111 #endif 1041 1112 { 1042 1113 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); … … 1088 1159 dir[j] = pcCU->getLumaIntraDir( absPartIdx+partOffset*j ); 1089 1160 #if H_3D_DIM 1161 #if SEPARATE_FLAG_I0085 1162 if( pcCU->getSlice()->getVpsDepthModesFlag() || pcCU->getSlice()->getIVPFlag() ) 1163 #else 1090 1164 if( pcCU->getSlice()->getVpsDepthModesFlag() ) 1165 #endif 1091 1166 { 1092 1167 codeIntraDepth( pcCU, absPartIdx+partOffset*j ); … … 1234 1309 } 1235 1310 //mode coding 1311 #if SEPARATE_FLAG_I0085 1312 if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag()) 1313 { 1314 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1315 } 1316 #else 1236 1317 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1318 #endif 1237 1319 } 1238 1320 } … … 2278 2360 } 2279 2361 2362 #if HS_DMM_SIGNALLING_I0120 2363 UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1; 2364 UInt dimDeltaDC = 1; 2365 #else 2280 2366 UInt uiNumSegments = 0; 2281 2367 UInt dimDeltaDC = 0; 2282 2368 #endif 2369 2370 #if HS_DMM_SIGNALLING_I0120 2371 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2372 { 2373 #else 2283 2374 if( pcCU->isIntra( absPartIdx ) ) 2284 2375 { … … 2288 2379 if( pcCU->getSDCFlag( absPartIdx ) ) 2289 2380 { 2381 #endif 2290 2382 if( uiNumSegments == 1 ) 2291 2383 { … … 2296 2388 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0; 2297 2389 } 2390 #if !HS_DMM_SIGNALLING_I0120 2298 2391 } 2299 2392 else … … 2301 2394 dimDeltaDC = isDimDeltaDC( dir ); 2302 2395 } 2396 #endif 2303 2397 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2304 2398 } 2399 #if !HS_DMM_SIGNALLING_I0120 2305 2400 else //all-zero inter SDC is not allowed 2306 2401 { … … 2308 2403 dimDeltaDC = 1; 2309 2404 } 2405 #endif 2310 2406 2311 2407 if( dimDeltaDC ) … … 2343 2439 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2344 2440 { 2441 #if SEC_DBBP_EXPLICIT_SIG_I0077 2442 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2443 AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N ); 2444 #endif 2345 2445 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ); 2346 2446 AOF( !pcCU->getSlice()->getIsDepth() ); -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r976 r1039 130 130 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 131 131 #endif 132 #if !FIX_TICKET_76 132 133 #if H_3D_DIM_SDC 133 134 Void xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 135 #endif 134 136 #endif 135 137 #endif … … 153 155 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 154 156 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 157 #if MTK_SINGLE_DEPTH_MODE_I0095 158 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 159 #endif 155 160 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 156 161 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 219 224 ContextModel3DBuffer m_cCUSplitFlagSCModel; 220 225 ContextModel3DBuffer m_cCUSkipFlagSCModel; 226 #if MTK_SINGLE_DEPTH_MODE_I0095 227 ContextModel3DBuffer m_cCUSingleDepthFlagSCModel; 228 ContextModel3DBuffer m_cSingleDepthValueSCModel; 229 #endif 221 230 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 222 231 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r976 r1039 915 915 } 916 916 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 917 #if MTK_SINGLE_DEPTH_MODE_I0095 918 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 919 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 920 #endif 917 921 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 918 922 } 919 923 #if MTK_SINGLE_DEPTH_MODE_I0095 924 else 925 { 926 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 927 } 928 #endif 929 #if MTK_SINGLE_DEPTH_MODE_I0095 930 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 931 { 932 #endif 920 933 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 921 934 … … 932 945 } 933 946 } 934 } 947 #if MTK_SINGLE_DEPTH_MODE_I0095 948 } 949 #endif 950 } 951 #if MTK_SINGLE_DEPTH_MODE_I0095 952 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 953 { 954 #endif 935 955 // luma prediction mode 936 956 if( pcCU->getPartitionSize(0) == SIZE_2Nx2N ) … … 975 995 } 976 996 } 977 997 #if MTK_SINGLE_DEPTH_MODE_I0095 998 } 999 #endif 978 1000 } 979 1001 if( bChroma ) … … 1837 1859 dRDCost += dSingleCost; 1838 1860 } 1839 1861 #if MTK_SINGLE_DEPTH_MODE_I0095 1862 Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor ) 1863 { 1864 UInt uiWidth = pcCU ->getWidth ( 0 ); 1865 UInt uiHeight = pcCU ->getHeight ( 0 ); 1866 UInt uiStride = pcOrgYuv ->getStride (); 1867 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1868 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1869 1870 AOF( uiWidth == uiHeight ); 1871 AOF( uiAbsPartIdx == 0 ); 1872 pcCU->setSingleDepthValueSubParts((Pel)iTestDepthIdx,uiAbsPartIdx, 0, pcCU->getDepth(0)); 1873 //===== reconstruction ===== 1874 1875 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1876 { 1877 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1878 { 1879 piPred[ uiX ] = DepthNeighbor[iTestDepthIdx]; 1880 } 1881 piPred += uiStride; 1882 } 1883 1884 // clear UV 1885 UInt uiStrideC = pcPredYuv->getCStride(); 1886 Pel *pRecCb = pcPredYuv->getCbAddr(); 1887 Pel *pRecCr = pcPredYuv->getCrAddr(); 1888 1889 for (Int y=0; y<uiHeight/2; y++) 1890 { 1891 for (Int x=0; x<uiWidth/2; x++) 1892 { 1893 pRecCb[x] = 1<<(g_bitDepthC-1); 1894 pRecCr[x] = 1<<(g_bitDepthC-1); 1895 } 1896 1897 pRecCb += uiStrideC; 1898 pRecCr += uiStrideC; 1899 } 1900 1901 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1902 //===== determine distortion ===== 1903 #if H_3D_VSO 1904 if ( m_pcRdCost->getUseVSO() ) 1905 ruiDist = m_pcRdCost->getDistPartVSO ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 1906 else 1907 #endif 1908 ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1909 1910 //===== determine rate and r-d cost ===== 1911 m_pcEntropyCoder->resetBits(); 1912 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, 0, true ); 1913 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 1914 1915 #if H_3D_VSO 1916 if ( m_pcRdCost->getUseLambdaScaleVSO()) 1917 dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); 1918 else 1919 #endif 1920 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 1921 } 1922 #endif 1840 1923 #if H_3D_DIM_SDC 1841 1924 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) … … 1887 1970 UInt dimType = getDimType ( uiLumaPredMode ); 1888 1971 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx); 1972 #if SHARP_DMM1_I0110 1973 UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth; 1974 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX ) 1975 #else 1889 1976 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX ) 1890 { 1977 #endif 1978 { 1979 #if SHARP_DMM1_I0110 1980 if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 1981 #else 1891 1982 if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 1983 #endif 1892 1984 { 1893 1985 patternID = 1349; // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16 … … 1951 2043 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); 1952 2044 2045 #if SHARP_DMM1_I0110 2046 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 2047 #else 1953 2048 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 2049 #endif 1954 2050 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1955 2051 1956 2052 uiNumSegments = 2; 2053 #if SHARP_DMM1_I0110 2054 pbMask = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern(); 2055 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 2056 #else 1957 2057 pbMask = pcWedgelet->getPattern(); 1958 2058 uiMaskStride = pcWedgelet->getStride(); 2059 #endif 1959 2060 } 1960 2061 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) … … 2777 2878 pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) ); 2778 2879 } 2779 2880 #if MTK_SINGLE_DEPTH_MODE_I0095 2780 2881 Void 2781 TEncSearch::estIntraPred QT( TComDataCU* pcCU,2882 TEncSearch::estIntraPredSingleDepth( TComDataCU* pcCU, 2782 2883 TComYuv* pcOrgYuv, 2783 2884 TComYuv* pcPredYuv, … … 2786 2887 UInt& ruiDistC, 2787 2888 Bool bLumaOnly ) 2889 { 2890 UInt uiDepth = pcCU->getDepth(0); 2891 UInt uiWidth = pcCU->getWidth (0); 2892 UInt uiHeight = pcCU->getHeight(0); 2893 2894 2895 Pel* piOrg = pcOrgYuv ->getLumaAddr( 0, uiWidth ); 2896 UInt uiStride = pcPredYuv->getStride(); 2897 2898 Int index=0; 2899 Pel testDepth; 2900 Pel DepthNeighbours[5]; 2901 //construction of depth candidates 2902 for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ ) 2903 { 2904 if(!pcCU->getNeighDepth (0, 0, &testDepth, i)) 2905 { 2906 continue; 2907 } 2908 DepthNeighbours[index]=testDepth; 2909 index++; 2910 for(Int j=0;j<index-1;j++) 2911 { 2912 if( (DepthNeighbours[index-1]==DepthNeighbours[j])) 2913 { 2914 index--; 2915 break; 2916 } 2917 } 2918 } 2919 2920 if(index==0) 2921 { 2922 DepthNeighbours[index]=1<<(g_bitDepthY-1); 2923 index++; 2924 } 2925 2926 if(index==1) 2927 { 2928 DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 ); 2929 index++; 2930 } 2931 2932 2933 Dist uiDist = 0; 2934 Double dCost = 0.0; 2935 Dist uiBestDist = 0; 2936 Double dBestCost = MAX_DOUBLE; 2937 Pel pBestSingleDepthValue = 0; 2938 2939 for( Int testdepthidx = 0; testdepthidx < index ; testdepthidx++ ) 2940 { 2941 // set context models 2942 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 2943 2944 // determine residual for partition 2945 uiDist = 0; 2946 dCost = 0.0; 2947 #if H_3D_VSO // M36 2948 if( m_pcRdCost->getUseRenModel() ) 2949 { 2950 m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight ); 2951 } 2952 #endif 2953 xIntraCodingSingleDepth(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, testdepthidx, DepthNeighbours); 2954 // check r-d cost 2955 if( dCost < dBestCost ) 2956 { 2957 uiBestDist = uiDist; 2958 dBestCost = dCost; 2959 pBestSingleDepthValue = pcCU->getSingleDepthValue(0); 2960 // copy reconstruction 2961 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 2962 } 2963 } // depth index loop 2964 2965 2966 pcCU->setSingleDepthValueSubParts((Pel)pBestSingleDepthValue,0, 0, uiDepth); 2967 assert(pBestSingleDepthValue>=0); 2968 2969 //===== reset context models ===== 2970 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]); 2971 2972 //===== set distortion (rate and r-d costs are determined later) ===== 2973 pcCU->getTotalDistortion() = uiBestDist; 2974 } 2975 2976 #endif 2977 Void 2978 TEncSearch::estIntraPredQT( TComDataCU* pcCU, 2979 TComYuv* pcOrgYuv, 2980 TComYuv* pcPredYuv, 2981 TComYuv* pcResiYuv, 2982 TComYuv* pcRecoYuv, 2983 UInt& ruiDistC, 2984 Bool bLumaOnly 2985 #if HHI_DMM4_ENC_I0066 2986 , Bool bOnlyIVP 2987 #endif 2988 ) 2788 2989 { 2789 2990 UInt uiDepth = pcCU->getDepth(0); … … 2831 3032 Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ]; 2832 3033 3034 #if HHI_DMM4_ENC_I0066 3035 if( bOnlyIVP ) 3036 { 3037 numModesForFullRD = 0; 3038 } 3039 else 3040 { 3041 #endif 2833 3042 Bool doFastSearch = (numModesForFullRD != numModesAvailable); 2834 3043 if (doFastSearch) … … 2922 3131 } 2923 3132 } 2924 3133 #if HHI_DMM4_ENC_I0066 3134 } 3135 #endif 3136 2925 3137 #if H_3D_DIM 2926 3138 //===== determine set of depth intra modes to be tested ===== 2927 3139 if( m_pcEncCfg->getIsDepth() && uiWidth >= DIM_MIN_SIZE && uiWidth <= DIM_MAX_SIZE && uiWidth == uiHeight ) 2928 3140 { 2929 3141 #if HHI_DMM4_ENC_I0066 3142 #if SEPARATE_FLAG_I0085 3143 if( bOnlyIVP && m_pcEncCfg->getUseIVP() ) 3144 #else 3145 if( bOnlyIVP ) 3146 #endif 3147 { 3148 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 3149 xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, dmm4Segmentation ); 3150 3151 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3152 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, dmm4Segmentation->getPattern(), dmm4Segmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3153 pcCU->setDimDeltaDC( DMM4_IDX, 0, uiPartOffset, deltaDC1 ); 3154 pcCU->setDimDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 ); 3155 3156 #if HS_DMM_SIGNALLING_I0120 3157 uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DIM_OFFSET); 3158 #else 3159 uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX +DIM_OFFSET); 3160 if( deltaDC1 != 0 || deltaDC2 != 0 ) 3161 uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX+1+DIM_OFFSET); 3162 #endif 3163 dmm4Segmentation->destroy(); delete dmm4Segmentation; 3164 } 3165 else 3166 { 3167 #endif 2930 3168 #if H_3D_FAST_DEPTH_INTRA 2931 3169 Int threshold = max(((pcCU->getQP(0))>>3)-1,3); … … 2935 3173 2936 3174 #if H_3D_DIM_DMM 3175 #if SEPARATE_FLAG_I0085 3176 if( ( m_pcEncCfg->getUseDMM() || m_pcEncCfg->getUseIVP() ) 3177 #else 2937 3178 if( m_pcEncCfg->getUseDMM() 3179 #endif 2938 3180 #if H_3D_FAST_DEPTH_INTRA 2939 3181 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold) … … 2941 3183 ) 2942 3184 { 3185 #if SEPARATE_FLAG_I0085 3186 UInt uiStart, uiEnd; 3187 if( m_pcEncCfg->getUseDMM() && m_pcEncCfg->getUseIVP() ) 3188 { 3189 uiStart = 0; 3190 uiEnd = 2; 3191 } 3192 else if( m_pcEncCfg->getUseDMM() ) 3193 { 3194 uiStart = 0; 3195 uiEnd = 1; 3196 } 3197 else if( m_pcEncCfg->getUseIVP() ) 3198 { 3199 uiStart = 1; 3200 uiEnd = 2; 3201 } 3202 else 3203 { 3204 uiStart = 0; 3205 uiEnd = 0; 3206 } 3207 for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ ) 3208 #else 2943 3209 for( UInt dmmType = 0; dmmType < DMM_NUM_TYPE; dmmType++ ) 3210 #endif 2944 3211 { 2945 3212 #if H_3D_FCO … … 2959 3226 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx ); 2960 3227 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 3228 #if SHARP_DMM1_I0110 3229 biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 3230 &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3231 #else 2961 3232 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3233 #endif 2962 3234 } break; 2963 3235 … … 2974 3246 if( biSegmentation ) 2975 3247 { 3248 #if SHARP_DMM1_I0110 3249 if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){ 3250 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3251 } 3252 else 3253 { 3254 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3255 } 3256 #else 2976 3257 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3258 #endif 2977 3259 pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 ); 2978 3260 pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 ); 2979 3261 3262 #if HS_DMM_SIGNALLING_I0120 3263 uiRdModeList[ numModesForFullRD++ ] = (dmmType +DIM_OFFSET); 3264 #else 2980 3265 uiRdModeList[ numModesForFullRD++ ] = (2*dmmType +DIM_OFFSET); 3266 #if HHI_DMM4_ENC_I0066 3267 if( deltaDC1 != 0 || deltaDC2 != 0 ) 3268 #endif 2981 3269 uiRdModeList[ numModesForFullRD++ ] = (2*dmmType+1+DIM_OFFSET); 3270 #endif 2982 3271 2983 3272 if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; } … … 2985 3274 } 2986 3275 } 3276 #if HHI_DMM4_ENC_I0066 3277 } 3278 #endif 2987 3279 #endif 2988 3280 } … … 2995 3287 2996 3288 UInt uiBestPUMode = 0; 3289 #if SCU_HS_FAST_INTRA_SDC_I0123 3290 UInt uiBestPUModeConv = 0; 3291 UInt uiSecondBestPUModeConv = 0; 3292 UInt uiThirdBestPUModeConv = 0; 3293 #endif 3294 2997 3295 #if H_3D_VSO 2998 3296 Dist uiBestPUDistY = 0; … … 3002 3300 UInt uiBestPUDistC = 0; 3003 3301 Double dBestPUCost = MAX_DOUBLE; 3302 3303 #if SCU_HS_FAST_INTRA_SDC_I0123 3304 Double dBestPUCostConv = MAX_DOUBLE; 3305 UInt varCU = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0)); 3306 UInt rdSDC = m_pcEncCfg->getIsDepth() ? numModesForFullRD : 0; 3307 #endif 3308 3004 3309 #if H_3D_DIM_SDC 3005 3310 Bool bBestUseSDC = false; 3006 3311 Pel apBestDCOffsets[2] = {0,0}; 3007 3312 #endif 3313 #if SCU_HS_FAST_INTRA_SDC_I0123 3314 for( UInt uiMode = 0; uiMode < numModesForFullRD + rdSDC; uiMode++ ) 3315 #else 3008 3316 for( UInt uiMode = 0; uiMode < numModesForFullRD; uiMode++ ) 3317 #endif 3009 3318 { 3010 3319 // set luma prediction mode 3011 UInt uiOrgMode = uiRdModeList[uiMode]; 3320 #if !SCU_HS_FAST_INTRA_SDC_I0123 3321 UInt uiOrgMode = uiRdModeList[uiMode]; 3322 #endif 3012 3323 3324 #if SCU_HS_FAST_INTRA_SDC_I0123 3325 UInt uiOrgMode; 3326 if (uiMode < numModesForFullRD) 3327 { 3328 uiOrgMode = uiRdModeList[uiMode]; 3329 } 3330 else 3331 { 3332 uiOrgMode = uiRdModeList[uiMode - numModesForFullRD]; 3333 3334 if (uiBestPUModeConv <= 1 ) 3335 { 3336 if (uiOrgMode > 1 && varCU < 1) continue; 3337 } 3338 else 3339 { 3340 if (uiOrgMode != uiBestPUModeConv && uiOrgMode != uiSecondBestPUModeConv && uiOrgMode != uiThirdBestPUModeConv 3341 && uiOrgMode > 1 && uiOrgMode < NUM_INTRA_MODE && varCU < 4) 3342 continue; 3343 } 3344 } 3345 #endif 3346 3013 3347 pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3014 3348 3015 3349 #if H_3D_DIM_SDC 3350 #if SCU_HS_FAST_INTRA_SDC_I0123 3351 Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD); 3352 #else 3016 3353 Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) ); 3354 #endif 3017 3355 3018 3356 for( UInt uiSDC=0; uiSDC<=(bTestSDC?1:0); uiSDC++ ) 3019 3357 { 3358 #if SCU_HS_FAST_INTRA_SDC_I0123 3359 if (!uiSDC && uiMode >= numModesForFullRD) continue; 3360 #endif 3020 3361 pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth ); 3362 #if FAST_SDC_OFFSET_DECISION_I0084 3363 Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE}; 3364 for( Int iOffset = 1; iOffset <= 5; iOffset++ ) 3365 #else 3021 3366 for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ ) 3022 { 3367 #endif 3368 { 3369 #if FAST_SDC_OFFSET_DECISION_I0084 3370 Int iSDCDeltaResi = 0; 3371 if(iOffset % 2 == 0) 3372 { 3373 iSDCDeltaResi = iOffset >> 1; 3374 } 3375 else 3376 { 3377 iSDCDeltaResi = -1 * (iOffset >> 1); 3378 } 3379 #endif 3023 3380 if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 ) 3024 3381 { 3025 3382 continue; 3026 3383 } 3384 #if FAST_SDC_OFFSET_DECISION_I0084 3385 if( iOffset > 3) 3386 { 3387 if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) ) 3388 { 3389 continue; 3390 } 3391 if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] && iOffset == 5) 3392 { 3393 continue; 3394 } 3395 if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] && iOffset == 4) 3396 { 3397 continue; 3398 } 3399 } 3400 #endif 3027 3401 #endif 3028 3402 … … 3070 3444 // start encoding with SDC 3071 3445 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3446 #if FAST_SDC_OFFSET_DECISION_I0084 3447 if ( testZeroResi == 0 && iOffset <= 3 ) 3448 { 3449 dOffsetCost [iOffset -1] = dPUCost; 3450 } 3451 #endif 3072 3452 } 3073 3453 else … … 3077 3457 #if H_3D_DIM_ENC 3078 3458 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) ); 3459 #if SCU_HS_FAST_INTRA_SDC_I0123 3460 if( dPUCost < dBestPUCostConv ) 3461 { 3462 uiThirdBestPUModeConv = uiSecondBestPUModeConv; 3463 uiSecondBestPUModeConv = uiBestPUModeConv; 3464 uiBestPUModeConv = uiOrgMode; 3465 dBestPUCostConv = dPUCost; 3466 } 3467 #endif 3079 3468 #else 3080 3469 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost ); … … 3620 4009 #if H_3D_VSP 3621 4010 , Int* vspFlag 4011 #if !FIX_TICKET_79 3622 4012 , InheritedVSPDisInfo* inheritedVSPDisInfo 4013 #endif 3623 4014 #endif 3624 4015 #if H_3D_SPIVMP … … 3680 4071 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); 3681 4072 pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 3682 #if H_3D_VSP 4073 #if H_3D_VSP && !FIX_TICKET_79 3683 4074 , inheritedVSPDisInfo 3684 4075 #endif … … 3710 4101 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); 3711 4102 pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours 3712 #if H_3D_VSP 4103 #if H_3D_VSP && !FIX_TICKET_79 3713 4104 , inheritedVSPDisInfo 3714 4105 #endif … … 3733 4124 #endif 3734 4125 } 3735 #if H_3D_VSP 4126 #if H_3D_VSP && !FIX_TICKET_75 3736 4127 xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand ); 3737 4128 #else … … 3765 4156 #if H_3D_VSP 3766 4157 pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4158 #if !FIX_TICKET_79 3767 4159 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4160 #endif 3768 4161 #endif 3769 4162 … … 3865 4258 * \returns Void 3866 4259 */ 3867 #if H_3D_VSP 4260 #if H_3D_VSP && !FIX_TICKET_75 3868 4261 Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand ) 3869 4262 #else … … 3875 4268 for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand ) 3876 4269 { 3877 #if H_3D_VSP 4270 #if H_3D_VSP && !FIX_TICKET_75 3878 4271 if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) ) 3879 4272 #else … … 4501 4894 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 4502 4895 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 4896 #if !FIX_TICKET_79 4503 4897 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 4898 #endif 4504 4899 UInt uiAbsPartIdx = 0; 4505 4900 Int iWidth = 0; … … 4519 4914 #if H_3D_VSP 4520 4915 , vspFlag 4916 #if !FIX_TICKET_79 4521 4917 , inheritedVSPDisInfo 4918 #endif 4522 4919 #endif 4523 4920 #if H_3D_SPIVMP … … 4533 4930 #if H_3D_VSP 4534 4931 pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4932 #if !FIX_TICKET_79 4535 4933 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4934 #endif 4536 4935 #endif 4537 4936 #if H_3D_DDD … … 6981 7380 } 6982 7381 m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true ); 7382 #if MTK_SINGLE_DEPTH_MODE_I0095 7383 m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true ); 7384 #endif 6983 7385 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 6984 7386 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); … … 7435 7837 7436 7838 Pel refDC1 = 0; Pel refDC2 = 0; 7839 #if SHARP_DMM1_I0110 7840 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 7841 WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7842 #else 7437 7843 WedgeList* pacWedgeList = &g_dmmWedgeLists [(g_aucConvertToBit[uiWidth])]; 7438 7844 WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7845 #endif 7439 7846 7440 7847 // coarse wedge search … … 7444 7851 { 7445 7852 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())); 7853 #if SHARP_DMM1_I0110 7854 Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); 7855 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride(); 7856 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 ); 7857 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7858 #else 7446 7859 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7447 7860 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7861 #endif 7448 7862 7449 7863 Dist uiActDist = RDO_DIST_MAX; … … 7481 7895 { 7482 7896 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))); 7897 #if SHARP_DMM1_I0110 7898 Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern(); 7899 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride(); 7900 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 ); 7901 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7902 #else 7483 7903 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7484 7904 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7485 7905 #endif 7486 7906 Dist uiActDist = RDO_DIST_MAX; 7487 7907 #if H_3D_VSO -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r884 r1039 180 180 TComYuv* pcRecoYuv, 181 181 UInt& ruiDistC, 182 Bool bLumaOnly ); 182 Bool bLumaOnly 183 #if HHI_DMM4_ENC_I0066 184 , Bool bOnlyIVP 185 #endif 186 ); 183 187 Void estIntraPredChromaQT ( TComDataCU* pcCU, 184 188 TComYuv* pcOrgYuv, … … 187 191 TComYuv* pcRecoYuv, 188 192 UInt uiPreCalcDistC ); 189 193 #if MTK_SINGLE_DEPTH_MODE_I0095 194 Void estIntraPredSingleDepth ( TComDataCU* pcCU, 195 TComYuv* pcOrgYuv, 196 TComYuv* pcPredYuv, 197 TComYuv* pcResiYuv, 198 TComYuv* pcRecoYuv, 199 UInt& ruiDistC, 200 Bool bLumaOnly ); 201 #endif 190 202 191 203 /// encoder estimation - inter prediction (non-skip) … … 342 354 UInt uiAbsPartIdx, 343 355 UInt stateU0V1Both2 ); 344 356 #if MTK_SINGLE_DEPTH_MODE_I0095 357 Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor ); 358 #endif 345 359 #if H_3D_DIM 346 360 // ------------------------------------------------------------------------------------------------------------------- … … 415 429 #if H_3D_VSP 416 430 , Int* vspFlag 431 #if !FIX_TICKET_79 417 432 , InheritedVSPDisInfo* inheritedVSPDisInfo 433 #endif 418 434 #endif 419 435 #if H_3D_SPIVMP … … 427 443 TComMvField* mvFieldNeighbours, 428 444 UChar* interDirNeighbours, 429 #if H_3D_VSP 445 #if H_3D_VSP && !FIX_TICKET_75 430 446 Int* vspFlag, 431 447 #endif -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r976 r1039 744 744 m_cSPS.setUseAMP ( m_useAMP ); 745 745 746 #if !MTK_I0099_VPS_EX2 746 747 #if H_3D_QTLPC 747 748 m_cSPS.setUseQTL( m_bUseQTL ); 748 749 m_cSPS.setUsePC ( m_bUsePC ); 750 #endif 749 751 #endif 750 752
Note: See TracChangeset for help on using the changeset viewer.