Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCu.cpp
- Timestamp:
- 26 May 2013, 15:41:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r332 r443 64 64 m_ppcBestCU = new TComDataCU*[m_uhTotalDepth-1]; 65 65 m_ppcTempCU = new TComDataCU*[m_uhTotalDepth-1]; 66 66 #if QC_ARP_D0177 67 m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1]; 68 #endif 67 69 m_ppcPredYuvBest = new TComYuv*[m_uhTotalDepth-1]; 68 70 m_ppcResiYuvBest = new TComYuv*[m_uhTotalDepth-1]; … … 91 93 m_ppcBestCU[i] = new TComDataCU; m_ppcBestCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 92 94 m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 93 95 #if QC_ARP_D0177 96 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 97 #endif 94 98 m_ppcPredYuvBest[i] = new TComYuv; m_ppcPredYuvBest[i]->create(uiWidth, uiHeight); 95 99 m_ppcResiYuvBest[i] = new TComYuv; m_ppcResiYuvBest[i]->create(uiWidth, uiHeight); … … 170 174 { 171 175 m_ppcResPredTmp [i]->destroy(); delete m_ppcResPredTmp[i]; m_ppcResPredTmp[i] = NULL; 176 } 177 #endif 178 #if QC_ARP_D0177 179 if(m_ppcWeightedTempCU[i]) 180 { 181 m_ppcWeightedTempCU[i]->destroy(); delete m_ppcWeightedTempCU[i]; m_ppcWeightedTempCU[i] = NULL; 172 182 } 173 183 #endif … … 591 601 } 592 602 #endif 593 603 #if QC_CU_NBDV_D0181 604 DisInfo DvInfo; 605 DvInfo.bDV = false; 606 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 607 { 608 #if QC_ARP_D0177 609 if(( rpcTempCU->getSlice()->getSPS()->getMultiviewMvPredMode() || rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) && rpcTempCU->getSlice()->getViewId()) 610 #else 611 if(( rpcTempCU->getSlice()->getSPS()->getMultiviewMvPredMode() || rpcTempCU->getSlice()->getSPS()->getMultiviewResPredMode()) && rpcTempCU->getSlice()->getViewId()) 612 #endif 613 { 614 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); 615 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 616 #if MERL_VSP_C0152 617 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(0, 0, &DvInfo, false, true); 618 #else 619 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(0, 0, &DvInfo, false); 620 #endif 621 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 622 rpcBestCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 623 rpcTempCU->setPartSizeSubParts( ePartTemp, 0, uiDepth ); 624 } 625 626 if(DvInfo.bDV==false) 627 { 628 DvInfo.iN=1; 629 #if !SEC_DEFAULT_DV_D0112 630 DvInfo.m_acMvCand[0].setHor(0); 631 DvInfo.m_acMvCand[0].setVer(0); 632 DvInfo.m_aVIdxCan[0] = 0; 633 #endif 634 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 635 rpcBestCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 636 } 637 } 638 #endif 594 639 // do inter modes, SKIP and 2Nx2N 595 640 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 596 641 { 597 642 #if H3D_IVRP 643 #if QC_ARP_D0177 644 Bool bResPredAvailable = false; 645 Bool bResPredAllowed = (!rpcBestCU->getSlice()->getSPS()->isDepth () ); 646 bResPredAllowed = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId () ); 647 if( bResPredAllowed ) 648 { 649 bResPredAvailable = rpcBestCU->getResidualSamples( 0, true, m_ppcResPredTmp[uiDepth] ); 650 } 651 for( UInt uiResPrdId = 0; uiResPrdId < (rpcBestCU->getSlice()->getSPS()->getUseAdvRP()? 1: ( bResPredAvailable ? 2 : 1 )); uiResPrdId++ ) 652 #else 598 653 Bool bResPredAvailable = false; 599 654 UInt uiResPrdId = 0; 655 #endif 600 656 { 601 657 Bool bResPredFlag = ( uiResPrdId > 0 ); … … 665 721 666 722 #if LGE_ILLUCOMP_B0045 723 #if SHARP_ILLUCOMP_PARSE_D0060 724 bICEnabled = false; 725 #else 667 726 bICEnabled = rpcBestCU->getICFlag(0); 727 #endif 668 728 #endif 669 729 … … 715 775 { 716 776 #if H3D_IVRP 777 #if QC_ARP_D0177 778 Bool bResPredAvailable = false; 779 Bool bResPredAllowed = (!rpcBestCU->getSlice()->getSPS()->isDepth () ); 780 bResPredAllowed = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId () ); 781 if( bResPredAllowed ) 782 { 783 bResPredAvailable = rpcBestCU->getResidualSamples( 0, true, m_ppcResPredTmp[uiDepth] ); 784 } 785 for( UInt uiResPrdId = 0; uiResPrdId < (rpcBestCU->getSlice()->getSPS()->getUseAdvRP()? 1: ( bResPredAvailable ? 2 : 1 )); uiResPrdId++ ) 786 #else 717 787 Bool bResPredAvailable = false; 718 788 UInt uiResPrdId = 0; 789 #endif 719 790 { 720 791 Bool bResPredFlag = ( uiResPrdId > 0 ); 721 792 #if LGE_ILLUCOMP_B0045 793 #if SHARP_ILLUCOMP_PARSE_D0060 794 { 795 Bool bICFlag = false; 796 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 797 #else 722 798 for(UInt uiICId = 0; uiICId < (bICEnabled ? 2 : 1); uiICId++) 723 799 { 724 800 Bool bICFlag = (uiICId ? true : false); 725 801 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 802 #endif 726 803 #endif 727 804 #endif … … 1648 1725 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1649 1726 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 1650 1727 1651 1728 if( getCheckBurstIPCMFlag() ) 1652 1729 { … … 1760 1837 { 1761 1838 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); 1839 1762 1840 #if LGE_ILLUCOMP_B0045 1763 1841 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx … … 1767 1845 ); 1768 1846 #endif 1847 #if QC_ARP_D0177 1848 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx, 0, uiDepth); 1849 #endif 1769 1850 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1770 1851 return; … … 1775 1856 #endif 1776 1857 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1777 1858 1778 1859 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1779 1860 1780 1861 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1781 1862 { … … 1792 1873 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1793 1874 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1875 1794 1876 #if LGE_ILLUCOMP_B0045 1795 1877 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx … … 1833 1915 Int numValidMergeCand = 0; 1834 1916 1917 #if QC_ARP_D0177 1918 Bool bResPrdAvail = rpcTempCU->getResPredAvail( 0 ); 1919 Bool bResPrdFlag = rpcTempCU->getResPredFlag ( 0 ); 1920 #endif 1835 1921 #if LGE_ILLUCOMP_B0045 1836 1922 Bool bICFlag = rpcTempCU->getICFlag(0); … … 1860 1946 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1861 1947 #if MERL_VSP_C0152 1948 #if LGE_VSP_INHERIT_D0092 1949 Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM]; 1950 for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++) 1951 { 1952 iVSPIndexTrue[i] = 0; 1953 } 1954 #else 1862 1955 Int iVSPIndexTrue[3] = {-1, -1, -1}; 1956 #endif 1957 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1958 Int iVSPDirTrue[3] = {-1, -1, -1}; 1959 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue ); 1960 #else 1863 1961 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 1962 #endif 1864 1963 #else 1865 1964 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1866 1965 #endif 1867 #if H3D_IVRP 1966 #if H3D_IVRP & !QC_ARP_D0177 1868 1967 Bool bResPredAvail = rpcTempCU->getResPredAvail(0); 1869 1968 #endif 1870 1969 1871 1970 Bool bestIsSkip = false; 1872 1971 #if QC_ARP_D0177 1972 Int nGRPW = rpcTempCU->getSlice()->getARPStepNum() - 1; 1973 if(nGRPW < 0 || !bResPrdAvail ) 1974 nGRPW = 0; 1975 for( ; nGRPW >= 0 ; nGRPW-- ) 1976 { 1977 #endif 1873 1978 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 1874 1979 { 1875 1980 { 1876 1981 TComYuv* pcPredYuvTemp = NULL; 1982 #if SHARP_ILLUCOMP_PARSE_D0060 1983 if (rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag()) 1984 { 1985 if (bICFlag && uiMergeCand == 0) 1986 { 1987 continue; 1988 } 1989 } 1990 #endif 1877 1991 #if LOSSLESS_CODING 1878 1992 UInt iteration; … … 1904 2018 rpcTempCU->setPredModeSubParts( MODE_SKIP, 0, uhDepth ); // interprets depth relative to LCU level 1905 2019 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 2020 #if QC_ARP_D0177 2021 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2022 rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth ); 2023 #endif 1906 2024 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level 1907 2025 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level 1908 2026 #if MERL_VSP_C0152 2027 2028 #if MTK_D0156 2029 if( !rpcTempCU->getSlice()->getSPS()->getUseVSPCompensation() ) 2030 { 2031 rpcTempCU->setVSPIndexSubParts( 0, 0, 0, uhDepth ); 2032 } 2033 else 2034 #endif 1909 2035 { 1910 2036 Int iVSPIdx = 0; 2037 #if LGE_VSP_INHERIT_D0092 2038 if (iVSPIndexTrue[uiMergeCand] == 1) 2039 { 2040 iVSPIdx = 1; 2041 } 2042 #else 1911 2043 Int numVSPIdx; 1912 2044 numVSPIdx = 3; … … 1919 2051 } 1920 2052 } 2053 #endif 1921 2054 rpcTempCU->setVSPIndexSubParts( iVSPIdx, 0, 0, uhDepth ); 2055 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2056 rpcTempCU->setVSPDirSubParts(0, 0, 0, uhDepth ); // interprets depth relative to LCU level 2057 #endif 2058 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 2059 if(iVSPIdx != 0) 2060 { 2061 Int iIVCIdx = rpcTempCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==rpcTempCU->getSlice()->getPOC() ? 0: rpcTempCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0); 2062 cMvFieldNeighbours[2*uiMergeCand].setRefIdx(iIVCIdx); 2063 } 2064 #endif 1922 2065 } 1923 2066 #endif … … 1927 2070 1928 2071 #if H3D_IVRP 2072 #if !QC_ARP_D0177 1929 2073 rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth); 2074 #else 2075 rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth ); 2076 rpcTempCU->setResPredFlagSubParts ( bResPrdFlag, 0, 0, uhDepth ); 2077 #endif 1930 2078 #endif 1931 2079 #if LGE_ILLUCOMP_B0045 1932 2080 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uhDepth); 1933 2081 #endif 1934 2082 #if QC_ARP_D0177 2083 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2084 { 2085 bool bSignalflag[2] = {true, true}; 2086 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 2087 { 2088 Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx(); 2089 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 2090 if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx)) 2091 bSignalflag[uiRefListIdx] = false; 2092 } 2093 if(!bSignalflag[0]&& !bSignalflag[1]) 2094 { 2095 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 2096 } 2097 } 2098 #endif 1935 2099 // do MC 1936 2100 #if HHI_INTERVIEW_SKIP … … 1945 2109 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1946 2110 #endif 1947 #if H3D_IVRP 2111 #if H3D_IVRP & !QC_ARP_D0177 1948 2112 if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0)) 1949 2113 { … … 1964 2128 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1965 2129 #endif 1966 #if H3D_IVRP 2130 #if H3D_IVRP & !QC_ARP_D0177 1967 2131 if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0)) 1968 2132 { … … 2021 2185 } 2022 2186 } 2187 #if QC_ARP_D0177 2188 } 2189 #endif 2023 2190 } 2024 2191 … … 2038 2205 { 2039 2206 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2040 2207 #if QC_ARP_D0177 2208 Bool bFirstTime = true; 2209 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2210 if(nARPWMax < 0 || !rpcTempCU->getResPredAvail( 0 ) ) 2211 nARPWMax = 0; 2212 if( ePartSize != SIZE_2Nx2N) 2213 nARPWMax = 0; 2214 Int nARPWStart = 0 , nARPWStep = 1; 2215 for( Int nCount = 0 , nGRPW = nARPWStart ; nCount <= nARPWMax ; nCount++ , nGRPW += nARPWStep ) 2216 { 2217 if( bFirstTime == false && rpcTempCU->getSlice()->getSPS()->getUseAdvRP() ) 2218 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) ); 2219 #endif 2041 2220 #if HHI_VSO 2042 2221 if( m_pcRdCost->getUseRenModel() ) … … 2065 2244 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2066 2245 2246 #if QC_ARP_D0177 2247 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2248 rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth ); 2249 #endif 2250 #if QC_ARP_D0177 2251 if( bFirstTime == false && rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2252 { 2253 assert(!rpcTempCU->getSlice()->getSPS()->isDepth()); 2254 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth, true ); 2255 rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth ); 2256 #if MERL_VSP_C0152 2257 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth], 0); 2258 #else 2259 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 2260 #endif 2261 if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N) 2262 { 2263 bool bSignalflag[2] = {true, true}; 2264 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 2265 { 2266 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 2267 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 2268 if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx)) 2269 bSignalflag[uiRefListIdx] = false; 2270 } 2271 if(!bSignalflag[0]&& !bSignalflag[1]) 2272 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 2273 } 2274 } 2275 else 2276 { 2277 bFirstTime = false; 2278 #endif 2067 2279 #if AMP_MRG 2068 2280 rpcTempCU->setMergeAMP (true); … … 2079 2291 #endif 2080 2292 #endif 2293 #if QC_ARP_D0177 2294 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2295 { 2296 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 2297 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP() && rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N) 2298 { 2299 bool bSignalflag[2] = {true, true}; 2300 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 2301 { 2302 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 2303 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 2304 if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx)) 2305 bSignalflag[uiRefListIdx] = false; 2306 } 2307 if(!bSignalflag[0]&& !bSignalflag[1]) 2308 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 2309 } 2310 } 2311 } 2312 #endif 2081 2313 2082 2314 #if AMP_MRG 2083 2315 if ( !rpcTempCU->getMergeAMP() ) 2084 2316 { 2317 #if QC_ARP_D0177 2318 if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) 2319 continue; 2320 else 2321 #endif 2085 2322 return; 2086 2323 } … … 2123 2360 xCheckDQP( rpcTempCU ); 2124 2361 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2362 #if QC_ARP_D0177 2363 } 2364 #endif 2125 2365 } 2126 2366 … … 2758 2998 assert( rpcTempCU->getPredictionMode( ui ) != MODE_NONE ); 2759 2999 #if MERL_VSP_C0152 2760 Int vspIdx = pcTextureCU->getVSPIndex( rpcTempCU->getZorderIdxInCU() + ui );3000 Int vspIdx = pcTextureCU->getVSPIndex( rpcTempCU->getZorderIdxInCU() + ui ); 2761 3001 rpcTempCU->setVSPIndex( ui , vspIdx); 3002 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3003 Int vspDir = pcTextureCU->getVSPDir ( rpcTempCU->getZorderIdxInCU() + ui ); 3004 rpcTempCU->setVSPDir( ui, vspDir); 3005 #endif 2762 3006 #endif 2763 3007 }
Note: See TracChangeset for help on using the changeset viewer.