Changeset 773 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 16 Jan 2014, 09:56:13 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r758 r773 425 425 Bool dimDeltaDC = isDimDeltaDC( uiIntraMode ); 426 426 Bool isDmmMode = (dimType < DMM_NUM_TYPE); 427 #if !SEC_DMM3_RBC_F0147428 Bool isRbcMode = (dimType == RBC_IDX);429 #endif430 427 431 428 Bool* biSegPattern = NULL; … … 443 440 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 444 441 } break; 445 #if !SEC_DMM3_RBC_F0147446 case( DMM3_IDX ):447 {448 UInt uiTabIdx = 0;449 if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }450 else451 {452 uiTabIdx = xPredWedgeFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm3IntraTabIdx( uiAbsPartIdx ) );453 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );454 }455 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);456 } break;457 #endif458 442 case( DMM4_IDX ): 459 443 { … … 468 452 } 469 453 #endif 470 #if H_3D_DIM_RBC471 if( isRbcMode )472 {473 biSegPattern = pcCU->getEdgePartition( uiAbsPartIdx );474 patternStride = iWidth;475 }476 #endif477 454 478 455 // get predicted partition values 479 456 assert( biSegPattern ); 480 457 Int* piMask = NULL; 481 #if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171482 458 piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering 483 #else484 if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM485 else piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );486 #endif487 459 assert( piMask ); 488 460 Int maskStride = 2*iWidth + 1; … … 499 471 Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx ); 500 472 #if H_3D_DIM_DMM 501 #if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147502 if( isDmmMode || isRbcMode)503 #else504 473 if( isDmmMode ) 505 #endif506 474 { 507 475 #if H_3D_DIM_DLT 508 #if DLT_DIFF_CODING_IN_PPS509 476 segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 ); 510 477 segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 ); 511 478 #else 512 segDC1 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );513 segDC2 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );514 #endif515 #else516 479 segDC1 = ClipY( predDC1 + deltaDC1 ); 517 480 segDC2 = ClipY( predDC2 + deltaDC2 ); 518 481 #endif 519 }520 #endif521 #if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132522 if( isRbcMode )523 {524 xDeltaDCQuantScaleUp( pcCU, deltaDC1 );525 xDeltaDCQuantScaleUp( pcCU, deltaDC2 );526 segDC1 = ClipY( predDC1 + deltaDC1 );527 segDC2 = ClipY( predDC2 + deltaDC2 );528 482 } 529 483 #endif … … 566 520 } 567 521 568 #if MTK_SPIVMP_F0110522 #if H_3D_SPIVMP 569 523 Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ) 570 524 { … … 677 631 else 678 632 { 679 #if MTK_SPIVMP_F0110633 #if H_3D_SPIVMP 680 634 if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 681 635 { … … 717 671 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 718 672 } 719 #if MTK_SPIVMP_F0110673 #if H_3D_SPIVMP 720 674 } 721 675 #endif … … 763 717 else 764 718 { 765 #if MTK_SPIVMP_F0110719 #if H_3D_SPIVMP 766 720 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 767 721 { … … 802 756 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 803 757 } 804 #if MTK_SPIVMP_F0110758 #if H_3D_SPIVMP 805 759 } 806 760 #endif … … 830 784 pcCU->clipMv(cMv); 831 785 #if H_3D_ARP 832 #if QC_MTK_INTERVIEW_ARP_F0123_F0108833 786 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) 834 787 { 835 788 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); 836 789 } 837 790 else 838 #endif 839 if( pcCU->getARPW( uiPartAddr ) > 0840 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N841 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()842 )843 {844 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );845 }846 else847 {791 { 792 if( pcCU->getARPW( uiPartAddr ) > 0 793 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 794 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 795 ) 796 { 797 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 798 } 799 else 800 { 848 801 #endif 849 802 #if H_3D_IC 850 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );851 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi803 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 804 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 852 805 #if H_3D_ARP 853 , false854 #endif 855 , bICFlag );856 bICFlag = bICFlag && (iWidth > 8);857 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi806 , false 807 #endif 808 , bICFlag ); 809 bICFlag = bICFlag && (iWidth > 8); 810 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 858 811 #if H_3D_ARP 859 , false860 #endif 861 , bICFlag );812 , false 813 #endif 814 , bICFlag ); 862 815 #else 863 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );864 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );816 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 817 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 865 818 #endif 866 819 #if H_3D_ARP 820 } 867 821 } 868 822 #endif … … 918 872 pcBaseViewDepthPicYuv->extendPicBorder(); 919 873 920 #if MTK_F0109_LG_F0120_VSP_BLOCK921 874 Int vspSize=0; 922 875 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize ); … … 924 877 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 925 878 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 926 #else927 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp );928 // sub-PU based compensation929 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );930 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );931 #endif932 879 } 933 880 #endif … … 959 906 if( cDistparity.bDV ) 960 907 { 961 #if SHARP_ARP_REF_CHECK_F0105962 908 Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList); 963 909 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() ) 964 #else965 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC() )966 #endif967 910 { 968 911 bTobeScaled = true; … … 971 914 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 972 915 973 #if SHARP_ARP_REF_CHECK_F0105974 916 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 975 917 976 918 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 977 #else978 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan );979 980 if( ( !pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC() ) || ( !pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ) )981 #endif982 919 { 983 920 dW = 0; … … 986 923 else 987 924 { 988 #if SHARP_ARP_REF_CHECK_F0105989 925 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() ); 990 #else991 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() );992 #endif993 926 } 994 927 … … 1039 972 } 1040 973 } 1041 #if QC_MTK_INTERVIEW_ARP_F0123_F01081042 974 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1043 975 { … … 1061 993 1062 994 assert(dW > 0); 1063 #if SHARP_ARP_REF_CHECK_F01051064 995 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex())) 1065 996 { 1066 997 dW = 0; 1067 998 } 1068 #endif1069 999 Int uiLCUAddr,uiAbsPartAddr; 1070 1000 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); … … 1144 1074 } 1145 1075 } 1146 #endif1147 1076 1148 1077 #endif … … 1804 1733 #if H_3D_VSP 1805 1734 // not fully support iRatioTxtPerDepth* != 1 1806 #if MTK_F0109_LG_F0120_VSP_BLOCK1807 1735 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) 1808 #else1809 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )1810 #endif1811 1736 { 1812 1737 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; … … 1836 1761 Pel *depth = yuvDepth->getLumaAddr(); 1837 1762 1838 #if !SHARP_VSP_BLOCK_IN_AMP_F01021839 if( width<8 || height<8 )1840 { // no split1841 Int rightOffset = width - 1;1842 Int depStrideBlock = depStride * nTxtPerDepthY;1843 Pel *refDepthTop = refDepth;1844 Pel *refDepthBot = refDepthTop + (height-1)*refDepStride;1845 1846 Pel maxDepth = refDepthTop[0] > refDepthBot[0] ? refDepthTop[0] : refDepthBot[0];1847 if( maxDepth < refDepthTop[rightOffset] ) { maxDepth = refDepthTop[rightOffset]; }1848 if( maxDepth < refDepthBot[rightOffset] ) { maxDepth = refDepthBot[rightOffset]; }1849 1850 for( Int sY=0; sY<height; sY+=nTxtPerDepthY )1851 {1852 for( Int sX=0; sX<width; sX+=nTxtPerDepthX )1853 {1854 depth[sX] = maxDepth;1855 }1856 depth += depStrideBlock;1857 }1858 #if MTK_F0109_LG_F0120_VSP_BLOCK1859 if(width==4)1860 vspSize=0;1861 else1862 vspSize=1;1863 #endif1864 }1865 else1866 { // split to 4x8, or 8x41867 Int blocksize = 8;1868 Int subblocksize = 4;1869 Int depStrideBlock = depStride * blocksize;1870 Pel *depthTmp = NULL;1871 Int depStrideTmp = depStride * nTxtPerDepthY;1872 Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };1873 Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };1874 Pel repDepth4x8[2] = {0, 0};1875 Pel repDepth8x4[2] = {0, 0};1876 #endif1877 1878 #if !MTK_F0109_LG_F0120_VSP_BLOCK1879 #if SHARP_VSP_BLOCK_IN_AMP_F01021880 Int blocksize = 8;1881 Int subblocksize = 4;1882 Int depStrideBlock = depStride * blocksize;1883 Pel *depthTmp = NULL;1884 Int depStrideTmp = depStride * nTxtPerDepthY;1885 Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };1886 Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };1887 #endif1888 Int refDepStrideBlock = refDepStride * blocksize;1889 Int refDepStrideSubBlock = refDepStride * subblocksize;1890 1891 refDepthTmp[0] = refDepth;1892 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock;1893 refDepthTmp[1] = refDepthTmp[2] - refDepStride;1894 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;1895 1896 #if SHARP_VSP_BLOCK_IN_AMP_F01021897 Int subBlockW, subBlockH;1898 Int blockW, blockH;1899 subBlockW = subBlockH = 8;1900 if (height % 8)1901 {1902 subBlockW = 8;1903 subBlockH = 4;1904 blockW = width; // no further split1905 blockH = height; // no further split1906 }1907 else if (width % 8)1908 {1909 subBlockW = 4;1910 subBlockH = 8;1911 blockW = width; // no further split1912 blockH = height; // no further split1913 }1914 else1915 {1916 blockW = blockH = 8;1917 }1918 for( Int y=0; y<height; y+=blockH )1919 {1920 for( Int x=0; x<width; x+=blockW )1921 {1922 if (blockW == 8 && blockH == 8)1923 {1924 Bool ULvsBR = false, URvsBL = false;1925 ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];1926 URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];1927 if( ULvsBR ^ URvsBL )1928 { // 4x81929 subBlockW = 4;1930 subBlockH = 8;1931 }1932 else1933 {1934 subBlockW = 8;1935 subBlockH = 4;1936 }1937 }1938 for( Int yy=0; yy<blockH; yy+=subBlockH )1939 {1940 for( Int xx=0; xx<blockW; xx+=subBlockW )1941 {1942 Pel maxDepthVal = 0;1943 Int xP0, xP1, yP0, yP1;1944 xP0 = x+xx;1945 xP1 = x+xx+subBlockW-1;1946 yP0 = yy;1947 yP1 = yy+subBlockH-1;1948 maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP0*refDepStride]);1949 maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP0*refDepStride]);1950 maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP1*refDepStride]);1951 maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP1*refDepStride]);1952 depthTmp = &depth[x+xx+yy*depStride];1953 for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )1954 {1955 for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )1956 {1957 depthTmp[sX] = maxDepthVal;1958 }1959 depthTmp += depStrideTmp;1960 }1961 }1962 }1963 }1964 refDepthTmp[0] += refDepStrideBlock;1965 depth += depStrideBlock;1966 }1967 #else // SHARP_VSP_BLOCK_IN_AMP_F01021968 for( Int y=0; y<height; y+=blocksize )1969 {1970 for( Int x=0; x<width; x+=blocksize )1971 {1972 Bool ULvsBR = false, URvsBL = false;1973 1974 ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];1975 URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];1976 1977 if( ULvsBR ^ URvsBL )1978 { // 4x81979 repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]];1980 if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] )1981 {1982 repDepth4x8[0] = refDepthTmp[3][x+offset[0]];1983 }1984 if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] )1985 {1986 repDepth4x8[0] = refDepthTmp[3][x+offset[1]];1987 }1988 repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]];1989 if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] )1990 {1991 repDepth4x8[1] = refDepthTmp[3][x+offset[2]];1992 }1993 if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] )1994 {1995 repDepth4x8[1] = refDepthTmp[3][x+offset[3]];1996 }1997 1998 depthTmp = &depth[x];1999 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )2000 {2001 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )2002 {2003 depthTmp[sX] = repDepth4x8[0];2004 }2005 depthTmp += depStrideTmp;2006 }2007 depthTmp = &depth[x+subblocksize];2008 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )2009 {2010 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )2011 {2012 depthTmp[sX] = repDepth4x8[1];2013 }2014 depthTmp += depStrideTmp;2015 }2016 }2017 else2018 { // 8x42019 repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]];2020 if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] )2021 {2022 repDepth8x4[0] = refDepthTmp[1][x+offset[0]];2023 }2024 if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] )2025 {2026 repDepth8x4[0] = refDepthTmp[1][x+offset[3]];2027 }2028 repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]];2029 if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] )2030 {2031 repDepth8x4[1] = refDepthTmp[3][x+offset[0]];2032 }2033 if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] )2034 {2035 repDepth8x4[1] = refDepthTmp[3][x+offset[3]];2036 }2037 2038 depthTmp = &depth[x];2039 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )2040 {2041 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )2042 {2043 depthTmp[sX] = repDepth8x4[0];2044 }2045 depthTmp += depStrideTmp;2046 }2047 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )2048 {2049 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )2050 {2051 depthTmp[sX] = repDepth8x4[1];2052 }2053 depthTmp += depStrideTmp;2054 }2055 }2056 }2057 refDepthTmp[0] += refDepStrideBlock;2058 refDepthTmp[1] += refDepStrideBlock;2059 refDepthTmp[2] += refDepStrideBlock;2060 refDepthTmp[3] += refDepStrideBlock;2061 depth += depStrideBlock;2062 }2063 #endif // SHARP_VSP_BLOCK_IN_AMP_F01022064 #else2065 #if SHARP_VSP_BLOCK_IN_AMP_F01022066 1763 if ((height % 8)) 2067 1764 { … … 2115 1812 } 2116 1813 } 2117 } 2118 #else // SHARP_VSP_BLOCK_IN_AMP_F0102 2119 Int refDepStrideBlock = refDepStride * height; 2120 Int refDepStrideSubBlock = refDepStride * height/2; 2121 refDepthTmp[0] = refDepth; 2122 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock; 2123 refDepthTmp[1] = refDepthTmp[2] - refDepStride; 2124 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 2125 offset[3] = width-1; 2126 Bool ULvsBR = false, URvsBL = false; 2127 ULvsBR = refDepthTmp[0][0+offset[0]] < refDepthTmp[3][0+offset[3]]; 2128 URvsBL = refDepthTmp[0][0+offset[3]] < refDepthTmp[3][0+offset[0]]; 2129 refDepStrideBlock = refDepStride * blocksize; 2130 refDepStrideSubBlock = refDepStride * subblocksize; 2131 refDepthTmp[0] = refDepth; 2132 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock; 2133 refDepthTmp[1] = refDepthTmp[2] - refDepStride; 2134 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 2135 offset[3] = blocksize-1; 2136 if( ULvsBR ^ URvsBL ) 2137 { 2138 vspSize = 0;//4x8 2139 for( Int y=0; y<height; y+=blocksize ) 2140 { 2141 for( Int x=0; x<width; x+=blocksize ) 2142 { 2143 { // 4x8 2144 repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]]; 2145 if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] ) 2146 { 2147 repDepth4x8[0] = refDepthTmp[3][x+offset[0]]; 2148 } 2149 if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] ) 2150 { 2151 repDepth4x8[0] = refDepthTmp[3][x+offset[1]]; 2152 } 2153 repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]]; 2154 if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] ) 2155 { 2156 repDepth4x8[1] = refDepthTmp[3][x+offset[2]]; 2157 } 2158 if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] ) 2159 { 2160 repDepth4x8[1] = refDepthTmp[3][x+offset[3]]; 2161 } 2162 2163 depthTmp = &depth[x]; 2164 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 2165 { 2166 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 2167 { 2168 depthTmp[sX] = repDepth4x8[0]; 2169 } 2170 depthTmp += depStrideTmp; 2171 } 2172 depthTmp = &depth[x+subblocksize]; 2173 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 2174 { 2175 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 2176 { 2177 depthTmp[sX] = repDepth4x8[1]; 2178 } 2179 depthTmp += depStrideTmp; 2180 } 2181 } 2182 } 2183 refDepthTmp[0] += refDepStrideBlock; 2184 refDepthTmp[1] += refDepStrideBlock; 2185 refDepthTmp[2] += refDepStrideBlock; 2186 refDepthTmp[3] += refDepStrideBlock; 2187 depth += depStrideBlock; 2188 } 2189 } 2190 else 2191 { // 8x4 2192 vspSize = 1; 2193 for( Int y=0; y<height; y+=blocksize ) 2194 { 2195 for( Int x=0; x<width; x+=blocksize ) 2196 { 2197 repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]]; 2198 if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] ) 2199 { 2200 repDepth8x4[0] = refDepthTmp[1][x+offset[0]]; 2201 } 2202 if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] ) 2203 { 2204 repDepth8x4[0] = refDepthTmp[1][x+offset[3]]; 2205 } 2206 repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]]; 2207 if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] ) 2208 { 2209 repDepth8x4[1] = refDepthTmp[3][x+offset[0]]; 2210 } 2211 if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] ) 2212 { 2213 repDepth8x4[1] = refDepthTmp[3][x+offset[3]]; 2214 } 2215 2216 depthTmp = &depth[x]; 2217 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 2218 { 2219 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 2220 { 2221 depthTmp[sX] = repDepth8x4[0]; 2222 } 2223 depthTmp += depStrideTmp; 2224 } 2225 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 2226 { 2227 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 2228 { 2229 depthTmp[sX] = repDepth8x4[1]; 2230 } 2231 depthTmp += depStrideTmp; 2232 } 2233 } 2234 refDepthTmp[0] += refDepStrideBlock; 2235 refDepthTmp[1] += refDepStrideBlock; 2236 refDepthTmp[2] += refDepStrideBlock; 2237 refDepthTmp[3] += refDepStrideBlock; 2238 depth += depStrideBlock; 2239 } 2240 } 2241 #endif 2242 #endif 2243 #if !SHARP_VSP_BLOCK_IN_AMP_F0102 2244 } 2245 #endif 2246 2247 2248 } 2249 #if MTK_F0109_LG_F0120_VSP_BLOCK 1814 } 1815 } 1816 2250 1817 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize) 2251 #else2252 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi )2253 #endif2254 1818 { 2255 1819 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 2256 1820 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 2257 1821 2258 #if MTK_F0109_LG_F0120_VSP_BLOCK2259 1822 nTxtPerDepthX = nTxtPerDepthX << vspSize; 2260 1823 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize); 2261 #endif 1824 2262 1825 Int refStride = picRef->getStride(); 2263 1826 Int dstStride = yuvDst->getStride(); … … 2365 1928 } 2366 1929 2367 #if MTK_F0109_LG_F0120_VSP_BLOCK2368 1930 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize) 2369 #else2370 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi )2371 #endif2372 1931 { 2373 1932 #if (H_3D_VSP_BLOCKSIZE==1) … … 2379 1938 #endif 2380 1939 2381 #if MTK_F0109_LG_F0120_VSP_BLOCK2382 1940 nTxtPerDepthX = nTxtPerDepthX << vspSize; 2383 1941 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize); 2384 #endif 1942 2385 1943 Int refStride = picRef->getCStride(); 2386 1944 Int dstStride = yuvDst->getCStride(); … … 2564 2122 2565 2123 #if H_3D_DIM_DMM 2566 #if !SEC_DMM3_RBC_F01472567 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )2568 {2569 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic();2570 assert( pcPicTex != NULL );2571 TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());2572 UInt uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;2573 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;2574 2575 assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );2576 return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);2577 }2578 #endif2579 2124 2580 2125 Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ) … … 2628 2173 #endif 2629 2174 2630 #if H_3D_DIM_RBC 2631 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC ) 2632 { 2633 Int iSign = rDeltaDC < 0 ? -1 : 1; 2634 UInt uiAbs = abs( rDeltaDC ); 2635 2636 Int iQp = pcCU->getQP(0); 2637 Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) ); 2638 Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) ); 2639 2640 rDeltaDC = iSign * roftoi( uiAbs * dStepSize ); 2641 return; 2642 } 2643 2644 Void TComPrediction::xDeltaDCQuantScaleDown( TComDataCU* pcCU, Pel& rDeltaDC ) 2645 { 2646 Int iSign = rDeltaDC < 0 ? -1 : 1; 2647 UInt uiAbs = abs( rDeltaDC ); 2648 2649 Int iQp = pcCU->getQP(0); 2650 Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) ); 2651 Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) ); 2652 2653 rDeltaDC = iSign * roftoi( uiAbs / dStepSize ); 2654 return; 2655 } 2656 #endif 2175 2657 2176 #if H_3D_DIM_SDC 2658 2177 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
Note: See TracChangeset for help on using the changeset viewer.