Changeset 773 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComPrediction.cpp


Ignore:
Timestamp:
16 Jan 2014, 09:56:13 (10 years ago)
Author:
tech
Message:

Merged branch/9.2-dev0@722.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r758 r773  
    425425  Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );   
    426426  Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
    427 #if !SEC_DMM3_RBC_F0147
    428   Bool isRbcMode  = (dimType == RBC_IDX);
    429 #endif
    430427
    431428  Bool* biSegPattern  = NULL;
     
    443440        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
    444441      } break;
    445 #if !SEC_DMM3_RBC_F0147
    446     case( DMM3_IDX ):
    447       {
    448         UInt uiTabIdx = 0;
    449         if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }
    450         else
    451         {
    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 #endif
    458442    case( DMM4_IDX ):
    459443      {
     
    468452  }
    469453#endif
    470 #if H_3D_DIM_RBC
    471   if( isRbcMode )
    472   {
    473     biSegPattern  = pcCU->getEdgePartition( uiAbsPartIdx );
    474     patternStride = iWidth;
    475   }
    476 #endif
    477454
    478455  // get predicted partition values
    479456  assert( biSegPattern );
    480457  Int* piMask = NULL;
    481 #if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171
    482458  piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering
    483 #else
    484   if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM
    485   else            piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );
    486 #endif
    487459  assert( piMask );
    488460  Int maskStride = 2*iWidth + 1; 
     
    499471    Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx );
    500472#if H_3D_DIM_DMM
    501 #if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147
    502     if( isDmmMode || isRbcMode)
    503 #else
    504473    if( isDmmMode )
    505 #endif
    506474    {
    507475#if H_3D_DIM_DLT
    508 #if DLT_DIFF_CODING_IN_PPS
    509476      segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
    510477      segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
    511478#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 #endif
    515 #else
    516479      segDC1 = ClipY( predDC1 + deltaDC1 );
    517480      segDC2 = ClipY( predDC2 + deltaDC2 );
    518481#endif
    519     }
    520 #endif
    521 #if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132
    522     if( isRbcMode )
    523     {
    524       xDeltaDCQuantScaleUp( pcCU, deltaDC1 );
    525       xDeltaDCQuantScaleUp( pcCU, deltaDC2 );
    526       segDC1 = ClipY( predDC1 + deltaDC1 );
    527       segDC2 = ClipY( predDC2 + deltaDC2 );
    528482    }
    529483#endif
     
    566520}
    567521
    568 #if MTK_SPIVMP_F0110
     522#if H_3D_SPIVMP
    569523Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr )
    570524{
     
    677631      else
    678632      {
    679 #if MTK_SPIVMP_F0110
     633#if H_3D_SPIVMP
    680634        if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    681635        {
     
    717671            xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    718672          }
    719 #if MTK_SPIVMP_F0110
     673#if H_3D_SPIVMP
    720674        }
    721675#endif
     
    763717      else
    764718      {
    765 #if MTK_SPIVMP_F0110
     719#if H_3D_SPIVMP
    766720       if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    767721      {
     
    802756          xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    803757        }
    804 #if MTK_SPIVMP_F0110
     758#if H_3D_SPIVMP
    805759       }
    806760#endif
     
    830784  pcCU->clipMv(cMv);
    831785#if H_3D_ARP
    832 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    833786  if(pcCU->getARPW( uiPartAddr ) > 0  && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC())
    834787  {
    835       xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
     788    xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
    836789  }
    837790  else
    838 #endif
    839   if(  pcCU->getARPW( uiPartAddr ) > 0
    840     && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N
    841     && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
    842     )
    843   {
    844     xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );
    845   }
    846   else
    847   {
     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    {
    848801#endif
    849802#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, bi
     803      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
    852805#if H_3D_ARP
    853       , false
    854 #endif
    855       , bICFlag );
    856     bICFlag = bICFlag && (iWidth > 8);
    857     xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
     806        , 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
    858811#if H_3D_ARP
    859       , false
    860 #endif
    861       , bICFlag );
     812        , false
     813#endif
     814        , bICFlag );
    862815#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 );
    865818#endif
    866819#if H_3D_ARP
     820    }
    867821  }
    868822#endif
     
    918872  pcBaseViewDepthPicYuv->extendPicBorder();
    919873
    920 #if MTK_F0109_LG_F0120_VSP_BLOCK
    921874  Int vspSize=0;
    922875  xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
     
    924877  xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    925878  xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    926 #else
    927   xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp );
    928   // sub-PU based compensation
    929   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 #endif
    932879}
    933880#endif
     
    959906  if( cDistparity.bDV )
    960907  {
    961 #if SHARP_ARP_REF_CHECK_F0105
    962908    Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList);
    963909    if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() )
    964 #else
    965     if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC() )
    966 #endif
    967910    {
    968911      bTobeScaled = true;
     
    971914    pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan );
    972915
    973 #if SHARP_ARP_REF_CHECK_F0105
    974916    pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan );
    975917
    976918    if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
    977 #else
    978     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 #endif
    982919    {
    983920      dW = 0;
     
    986923    else
    987924    {
    988 #if SHARP_ARP_REF_CHECK_F0105
    989925      assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() );
    990 #else
    991       assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() );
    992 #endif
    993926    }
    994927
     
    1039972  }
    1040973}
    1041 #if QC_MTK_INTERVIEW_ARP_F0123_F0108
    1042974Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    1043975{
     
    1061993
    1062994  assert(dW > 0);
    1063 #if SHARP_ARP_REF_CHECK_F0105
    1064995  if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))
    1065996  {
    1066997    dW = 0;
    1067998  }
    1068 #endif
    1069999  Int uiLCUAddr,uiAbsPartAddr;
    10701000  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
     
    11441074  }
    11451075}
    1146 #endif
    11471076
    11481077#endif
     
    18041733#if H_3D_VSP
    18051734// not fully support iRatioTxtPerDepth* != 1
    1806 #if MTK_F0109_LG_F0120_VSP_BLOCK
    18071735Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    1808 #else
    1809 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    1810 #endif
    18111736{
    18121737  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
     
    18361761  Pel *depth = yuvDepth->getLumaAddr();
    18371762
    1838 #if !SHARP_VSP_BLOCK_IN_AMP_F0102
    1839   if( width<8 || height<8 )
    1840   { // no split
    1841     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_BLOCK
    1859   if(width==4)
    1860     vspSize=0;
    1861   else
    1862     vspSize=1;
    1863 #endif
    1864   }
    1865   else
    1866   { // split to 4x8, or 8x4
    1867     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 #endif
    1877 
    1878 #if !MTK_F0109_LG_F0120_VSP_BLOCK
    1879 #if SHARP_VSP_BLOCK_IN_AMP_F0102
    1880     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 #endif
    1888     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_F0102
    1897     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 split
    1905       blockH = height; // no further split
    1906     }
    1907     else if (width % 8)
    1908     {
    1909       subBlockW = 4;
    1910       subBlockH = 8;
    1911       blockW = width;  // no further split
    1912       blockH = height; // no further split
    1913     }
    1914     else
    1915     {
    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           { // 4x8
    1929             subBlockW = 4;
    1930             subBlockH = 8;
    1931           }
    1932           else
    1933           {
    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_F0102
    1968     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         { // 4x8
    1979           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         else
    2018         { // 8x4
    2019           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_F0102
    2064 #else
    2065 #if SHARP_VSP_BLOCK_IN_AMP_F0102
    20661763  if ((height % 8))
    20671764  {
     
    21151812      }
    21161813    }
    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
    22501817Void 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 #else
    2252 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 #endif
    22541818{
    22551819  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    22561820  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    22571821 
    2258 #if MTK_F0109_LG_F0120_VSP_BLOCK
    22591822  nTxtPerDepthX = nTxtPerDepthX << vspSize;
    22601823  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2261 #endif
     1824
    22621825  Int refStride = picRef->getStride();
    22631826  Int dstStride = yuvDst->getStride();
     
    23651928}
    23661929
    2367 #if MTK_F0109_LG_F0120_VSP_BLOCK
    23681930Void 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 #else
    2370 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 #endif
    23721931{
    23731932#if (H_3D_VSP_BLOCKSIZE==1)
     
    23791938#endif
    23801939
    2381 #if MTK_F0109_LG_F0120_VSP_BLOCK
    23821940  nTxtPerDepthX = nTxtPerDepthX << vspSize;
    23831941  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2384 #endif
     1942
    23851943  Int refStride = picRef->getCStride();
    23861944  Int dstStride = yuvDst->getCStride();
     
    25642122
    25652123#if H_3D_DIM_DMM
    2566 #if !SEC_DMM3_RBC_F0147
    2567 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 #endif
    25792124
    25802125Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge )
     
    26282173#endif
    26292174
    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
    26572176#if H_3D_DIM_SDC
    26582177Void 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.