Changeset 880 in 3DVCSoftware


Ignore:
Timestamp:
27 Mar 2014, 22:57:10 (10 years ago)
Author:
tech
Message:

Cleanups part 5.

Location:
branches/HTM-10.1-dev0/source/Lib
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r878 r880  
    32793279  Bool  refViewAvailFlag = false;
    32803280  UChar predFlag[2]      = {0, 0};
    3281 #if !MTK_RBIP_VSP_G0069
    3282   Int   refListIdY       = 0;   
    3283   Int   viewIdInRefListX = -1;
    3284 #endif
    32853281
    32863282  for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
     
    32943290        refViewAvailFlag      = true;
    32953291        predFlag[iRefListIdX] = 1;
    3296 #if !MTK_RBIP_VSP_G0069
    3297         viewIdInRefListX      = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();
    3298         refListIdY            = 1 - iRefListIdX;
    3299 #endif
    33003292        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    33013293#if H_3D_NBDV
     
    33053297    }
    33063298  }
    3307 
    3308 #if !MTK_RBIP_VSP_G0069
    3309   if (m_pcSlice->isInterB() && refViewAvailFlag)
    3310   {
    3311     RefPicList eRefPicListY = RefPicList( refListIdY );
    3312     refViewAvailFlag = false;
    3313     for ( Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicListY) && !refViewAvailFlag; i++ )
    3314     {
    3315       Int viewIdxRefInListY = m_pcSlice->getRefPic(eRefPicListY, i)->getViewIndex();
    3316       if ( viewIdxRefInListY != refViewIdx && viewIdxRefInListY != m_pcSlice->getViewIndex() )
    3317       {
    3318         refViewAvailFlag = true;
    3319         predFlag[refListIdY] = 1;
    3320         TComMv  cMv = pDInfo->m_acNBDV;
    3321 
    3322         Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();
    3323         Int currViewId       = m_pcSlice->getViewId();
    3324 
    3325         //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed):
    3326         // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx  );
    3327 
    3328         Int iScale      = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );
    3329 
    3330         // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.
    3331         if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )
    3332         {
    3333           cMv = cMv.scaleMv( iScale );
    3334         }
    3335         else
    3336         {
    3337 
    3338           cMv = cMv;
    3339         }
    3340         clipMv( cMv );
    3341         pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );
    3342 #if H_3D_NBDV
    3343         pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);
    3344 #endif
    3345       }
    3346     }
    3347   }
    3348 #endif
    33493299
    33503300  // Set values to be returned
     
    34653415  for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
    34663416  {
    3467 #if NTT_STORE_SPDV_VSP_G0148
    34683417    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
    3469 #else
    3470     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )
    3471 #endif
    34723418    {
    34733419      continue;
     
    39853931    iPosLeftAbove[0] = numA1B1B0;
    39863932#if H_3D_VSP
    3987 #if NTT_STORE_SPDV_VSP_G0148
    39883933    if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    3989 #else
    3990     if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
    3991 #endif
    39923934#if H_3D_IC
    39933935      && !bICFlag
     
    40123954    iPosLeftAbove[1] = numA1B1B0;
    40133955#if H_3D_VSP
    4014 #if NTT_STORE_SPDV_VSP_G0148
    40153956    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
    4016 #else
    4017     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
    4018 #endif
    40193957#if H_3D_IC
    40203958      && !bICFlag
     
    40393977  {
    40403978#if H_3D_VSP
    4041 #if NTT_STORE_SPDV_VSP_G0148
    40423979    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
    4043 #else
    4044     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
    4045 #endif
    40463980#if H_3D_IC
    40473981      && !bICFlag
     
    40643998  {
    40653999#if H_3D_VSP
    4066 #if NTT_STORE_SPDV_VSP_G0148
    40674000    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
    4068 #else
    4069     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
    4070 #endif
    40714001#if H_3D_IC
    40724002      && !bICFlag
     
    40914021  {
    40924022#if H_3D_VSP
    4093 #if NTT_STORE_SPDV_VSP_G0148
    40944023    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
    4095 #else
    4096     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
    4097 #endif
    40984024#if H_3D_IC
    40994025      && !bICFlag
     
    72477173#endif
    72487174
    7249 #if NTT_STORE_SPDV_VSP_G0148
     7175#if H_3D_VSP
    72507176Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
    72517177{
     
    73817307
    73827308}
    7383 #endif // NTT_STORE_SPDV_VSP_G0148
     7309#endif
    73847310
    73857311//! \}
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h

    r878 r880  
    267267  Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
    268268
    269 #if NTT_STORE_SPDV_VSP_G0148
     269#if H_3D_VSP
    270270  Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
    271271#endif
     
    665665  Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
    666666  Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    667 #if NTT_STORE_SPDV_VSP_G0148
    668667  Void          setMvFieldPUForVSP    ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize );
    669 #endif
    670668#endif
    671669  Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h

    r872 r880  
    176176  Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
    177177#endif
    178 #if NTT_STORE_SPDV_VSP_G0148
     178#if H_3D_VSP
    179179  Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
    180180  Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r879 r880  
    11691169Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    11701170{
    1171 #if NTT_STORE_SPDV_VSP_G0148
    11721171  Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1;
    11731172
     
    11841183  }
    11851184  xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU );
    1186 
    1187 #else // NTT_STORE_SPDV_VSP_G0148
    1188   // Get depth reference
    1189   Int       depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
    1190 #if H_3D_FCO_VSP_DONBDV_E0163
    1191   TComPic* pRefPicBaseDepth = 0;
    1192   Bool     bIsCurrDepthCoded = false;
    1193   pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
    1194   if ( pRefPicBaseDepth->getPicYuvRec() != NULL  )
    1195   {
    1196     bIsCurrDepthCoded = true;
    1197   }
    1198   else
    1199   {
    1200     pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    1201   }
    1202 #else
    1203   TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    1204 #endif
    1205   assert(pRefPicBaseDepth != NULL);
    1206   TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
    1207   assert(pcBaseViewDepthPicYuv != NULL);
    1208 
    1209   // Get texture reference
    1210   Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );
    1211   assert(iRefIdx >= 0);
    1212   TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx );
    1213   TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec();
    1214   assert(pcBaseViewTxtPicYuv != NULL);
    1215 
    1216   // Initialize LUT according to the reference viewIdx
    1217   Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
    1218   Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
    1219   assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
    1220 
    1221   // Do compensation
    1222   TComMv cDv  = pcCU->getDvInfo(uiPartAddr).m_acNBDV;
    1223   pcCU->clipMv(cDv);
    1224 
    1225 #if H_3D_FCO_VSP_DONBDV_E0163
    1226   if ( bIsCurrDepthCoded )
    1227   {
    1228       cDv.setZero();
    1229   }
    1230 #endif
    1231   // fetch virtual depth map
    1232   pcBaseViewDepthPicYuv->extendPicBorder();
    1233 
    1234   Int vspSize=0;
    1235   xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
    1236   // sub-PU based compensation
    1237   xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    1238   xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
    1239 #endif // NTT_STORE_SPDV_VSP_G0148
    1240 }
    1241 
    1242 #if NTT_STORE_SPDV_VSP_G0148
     1185}
     1186
    12431187Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU )
    12441188{
     
    12651209  }
    12661210}
    1267 #endif // NTT_STORE_SPDV_VSP_G0148
    12681211
    12691212#endif
     
    21202063#endif
    21212064
    2122 #if H_3D_VSP
    2123 #if !(NTT_STORE_SPDV_VSP_G0148)
    2124 // not fully support iRatioTxtPerDepth* != 1
    2125 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
    2126 {
    2127   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    2128   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    2129 
    2130   Int refDepStride = picRefDepth->getStride();
    2131 
    2132   Int refDepOffset  = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;
    2133   Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2134 
    2135   if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 )
    2136   {
    2137     Int posX, posY;
    2138     refDepth    = picRefDepth->getLumaAddr( );
    2139     cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
    2140     posX /= ratioTxtPerDepthX; // texture position -> depth postion
    2141     posY /= ratioTxtPerDepthY;
    2142     refDepOffset += posX + posY * refDepStride;
    2143 
    2144     width  /= ratioTxtPerDepthX; // texture size -> depth size
    2145     height /= ratioTxtPerDepthY;
    2146   }
    2147 
    2148   refDepth += refDepOffset;
    2149 
    2150   Int depStride = yuvDepth->getStride();
    2151   Pel *depth = yuvDepth->getLumaAddr();
    2152 
    2153   if ((height % 8))
    2154   {
    2155     vspSize = 1; // 8x4
    2156   }
    2157   else if ((width % 8))
    2158   {
    2159     vspSize = 0; // 4x8
    2160   }
    2161   else
    2162   {
    2163     Bool ULvsBR, URvsBL;
    2164     ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
    2165     URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
    2166     vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
    2167   }
    2168   Int subBlockW, subBlockH;
    2169   Int depStrideTmp = depStride * nTxtPerDepthY;
    2170   if (vspSize)
    2171   {
    2172     subBlockW = 8;
    2173     subBlockH = 4;
    2174   }
    2175   else
    2176   {
    2177     subBlockW = 4;
    2178     subBlockH = 8;
    2179   }
    2180   for( Int y=0; y<height; y+=subBlockH )
    2181   {
    2182     Pel *refDepthTmp[4];
    2183     refDepthTmp[0] = refDepth + refDepStride * y;
    2184     refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
    2185     refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
    2186     refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
    2187     for( Int x=0; x<width; x+=subBlockW )
    2188     {
    2189       Pel  maxDepthVal;
    2190       maxDepthVal = refDepthTmp[0][x];
    2191       maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
    2192       maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
    2193       maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
    2194       Pel *depthTmp = &depth[x+y*depStride];
    2195       for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
    2196       {
    2197         for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
    2198         {
    2199           depthTmp[sX] = maxDepthVal;
    2200         }
    2201         depthTmp += depStrideTmp;
    2202       }
    2203     }
    2204   }   
    2205 }
    2206 
    2207 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)
    2208 {
    2209   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
    2210   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
    2211  
    2212   nTxtPerDepthX = nTxtPerDepthX << vspSize;
    2213   nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2214 
    2215   Int refStride = picRef->getStride();
    2216   Int dstStride = yuvDst->getStride();
    2217   Int depStride = yuvDepth->getStride();
    2218   Int refStrideBlock = refStride  * nTxtPerDepthY;
    2219   Int dstStrideBlock = dstStride * nTxtPerDepthY;
    2220   Int depStrideBlock = depStride * nTxtPerDepthY;
    2221 
    2222   Pel *ref    = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2223   Pel *dst    = yuvDst->getLumaAddr(partAddr);
    2224   Pel *depth  = yuvDepth->getLumaAddr();
    2225 
    2226 #if H_3D_VSP_BLOCKSIZE == 1
    2227 #if H_3D_VSP_CONSTRAINED
    2228   //get LUT based horizontal reference range
    2229   Int range = xGetConstrainedSize(width, height);
    2230 
    2231   // The minimum depth value
    2232   Int minRelativePos = MAX_INT;
    2233   Int maxRelativePos = MIN_INT;
    2234 
    2235   Pel* depthTemp, *depthInitial=depth;
    2236   for (Int yTxt = 0; yTxt < height; yTxt++)
    2237   {
    2238     for (Int xTxt = 0; xTxt < width; xTxt++)
    2239     {
    2240       if (depthPosX+xTxt < widthDepth)
    2241       {
    2242         depthTemp = depthInitial + xTxt;
    2243       }
    2244       else
    2245       {
    2246         depthTemp = depthInitial + (widthDepth - depthPosX - 1);
    2247       }
    2248 
    2249       Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec;
    2250       Int disparityInt = disparity >> 2;
    2251 
    2252       if( disparity <= 0)
    2253       {
    2254         if (minRelativePos > disparityInt+xTxt)
    2255         {
    2256           minRelativePos = disparityInt+xTxt;
    2257         }
    2258       }
    2259       else
    2260       {
    2261         if (maxRelativePos < disparityInt+xTxt)
    2262         {
    2263           maxRelativePos = disparityInt+xTxt;
    2264         }
    2265       }
    2266     }
    2267     if (depthPosY+yTxt < heightDepth)
    2268     {
    2269       depthInitial = depthInitial + depStride;
    2270     }
    2271   }
    2272 
    2273   Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec;
    2274   if (disparity_tmp <= 0)
    2275   {
    2276     maxRelativePos = minRelativePos + range -1 ;
    2277   }
    2278   else
    2279   {
    2280     minRelativePos = maxRelativePos - range +1 ;
    2281   }
    2282 #endif
    2283 #endif // H_3D_VSP_BLOCKSIZE == 1
    2284 
    2285   TComMv dv(0, 0);
    2286 
    2287   for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
    2288   {
    2289     for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
    2290     {
    2291       Pel repDepth = depth[ xTxt ];
    2292       assert( repDepth >= 0 && repDepth <= 255 );
    2293 
    2294       Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ??
    2295       Int xFrac = disparity & 0x3;
    2296 
    2297       dv.setHor( disparity );
    2298       cu->clipMv( dv );
    2299 
    2300       Int refOffset = xTxt + (dv.getHor() >> 2);
    2301      
    2302 #if H_3D_VSP_CONSTRAINED
    2303       if(refOffset<minRelativePos || refOffset>maxRelativePos)
    2304       {
    2305         xFrac = 0;
    2306       }
    2307       refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
    2308 #endif
    2309 
    2310       assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
    2311       m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2312     }
    2313     ref   += refStrideBlock;
    2314     dst   += dstStrideBlock;
    2315     depth += depStrideBlock;
    2316   }
    2317 
    2318 }
    2319 
    2320 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)
    2321 {
    2322 #if (H_3D_VSP_BLOCKSIZE==1)
    2323   Int nTxtPerDepthX = 1;
    2324   Int nTxtPerDepthY = 1;
    2325 #else
    2326   Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;
    2327   Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;
    2328 #endif
    2329 
    2330   nTxtPerDepthX = nTxtPerDepthX << vspSize;
    2331   nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
    2332 
    2333   Int refStride = picRef->getCStride();
    2334   Int dstStride = yuvDst->getCStride();
    2335   Int depStride = yuvDepth->getStride();
    2336   Int refStrideBlock = refStride * nTxtPerDepthY;
    2337   Int dstStrideBlock = dstStride * nTxtPerDepthY;
    2338   Int depStrideBlock = depStride * (nTxtPerDepthY<<1);
    2339 
    2340   Pel *refCb  = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2341   Pel *refCr  = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
    2342   Pel *dstCb  = yuvDst->getCbAddr(partAddr);
    2343   Pel *dstCr  = yuvDst->getCrAddr(partAddr);
    2344   Pel *depth  = yuvDepth->getLumaAddr();
    2345 
    2346 #if H_3D_VSP_BLOCKSIZE == 1
    2347 #if H_3D_VSP_CONSTRAINED
    2348   //get LUT based horizontal reference range
    2349   Int range = xGetConstrainedSize(width, height, false);
    2350 
    2351   // The minimum depth value
    2352   Int minRelativePos = MAX_INT;
    2353   Int maxRelativePos = MIN_INT;
    2354 
    2355   Int depthTmp;
    2356   for (Int yTxt=0; yTxt<height; yTxt++)
    2357   {
    2358     for (Int xTxt=0; xTxt<width; xTxt++)
    2359     {
    2360       depthTmp = m_pDepthBlock[xTxt+yTxt*width];
    2361       Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec;
    2362       Int disparityInt = disparity >> 3;//in chroma resolution
    2363 
    2364       if (disparityInt < 0)
    2365       {
    2366         if (minRelativePos > disparityInt+xTxt)
    2367         {
    2368           minRelativePos = disparityInt+xTxt;
    2369         }
    2370       }
    2371       else
    2372       {
    2373         if (maxRelativePos < disparityInt+xTxt)
    2374         {
    2375           maxRelativePos = disparityInt+xTxt;
    2376         }
    2377       }
    2378     }
    2379   }
    2380 
    2381   depthTmp = m_pDepthBlock[0];
    2382   Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec;
    2383   if ( disparity_tmp < 0 )
    2384   {
    2385     maxRelativePos = minRelativePos + range - 1;
    2386   }
    2387   else
    2388   {
    2389     minRelativePos = maxRelativePos - range + 1;
    2390   }
    2391 
    2392 #endif // H_3D_VSP_CONSTRAINED
    2393 #endif // H_3D_VSP_BLOCKSIZE == 1
    2394 
    2395   TComMv dv(0, 0);
    2396   // luma size -> chroma size
    2397   height >>= 1;
    2398   width  >>= 1;
    2399 
    2400   for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
    2401   {
    2402     for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
    2403     {
    2404       Pel repDepth = depth[ xTxt<<1 ];
    2405       assert( repDepth >= 0 && repDepth <= 255 );
    2406 
    2407       Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec;
    2408       Int xFrac = disparity & 0x7;
    2409      
    2410       dv.setHor( disparity );
    2411       cu->clipMv( dv );
    2412 
    2413       Int refOffset = xTxt + (dv.getHor() >> 3);
    2414 
    2415 #if H_3D_VSP_CONSTRAINED
    2416       if(refOffset<minRelativePos || refOffset>maxRelativePos)
    2417       {
    2418         xFrac = 0;
    2419       }
    2420       refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
    2421 #endif
    2422 
    2423       assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
    2424       assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
    2425 
    2426       m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2427       m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
    2428     }
    2429     refCb += refStrideBlock;
    2430     refCr += refStrideBlock;
    2431     dstCb += dstStrideBlock;
    2432     dstCr += dstStrideBlock;
    2433     depth += depStrideBlock;
    2434   }
    2435 }
    2436 #endif
    2437 
    2438 #if H_3D_VSP_CONSTRAINED
    2439 Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)
    2440 {
    2441   Int iSize = 0;
    2442   if (bLuma)
    2443   {
    2444     Int iArea = (nPbW+7) * (nPbH+7);
    2445     Int iAlpha = iArea / nPbH - nPbW - 7;
    2446     iSize = iAlpha + nPbW;
    2447   }
    2448   else // chroma
    2449   {
    2450     Int iArea = (nPbW+2) * (nPbH+2);
    2451     Int iAlpha = iArea / nPbH - nPbW - 4;
    2452     iSize = iAlpha + nPbW;
    2453   }
    2454   return iSize;
    2455 }
    2456 #endif // H_3D_VSP_CONSTRAINED
    2457 
    2458 #endif // H_3D_VSP
    2459 
    24602065#if H_3D_DIM
    24612066Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 )
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.h

    r878 r880  
    8080
    8181#if H_3D_VSP
    82   Int*   m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
    83 #if H_3D_VSP_CONSTRAINED
    84   Int  xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true);
    85 #endif
    86   TComYuv   m_cYuvDepthOnVsp;
     82  Int*    m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
     83  TComYuv m_cYuvDepthOnVsp;
    8784#endif
    8885
     
    121118
    122119#if H_3D_VSP
    123 #if NTT_STORE_SPDV_VSP_G0148
    124120  Void xPredInterUniSubPU        ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 );
    125 #else
    126   Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );
    127   Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
    128   Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
    129 #endif
    130121#endif
    131122
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r879 r880  
    139139                                              // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
    140140                                              // LGE_SHARP_VSP_INHERIT_F0104
     141                                              // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
     142                                              // Restricted bi-prediction for VSP
    141143
    142144#define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
     
    314316#define MTK_DDD_G0063                     1   // Disparity derived depth coding
    315317#define HTM10RC1_FIX                      1   // Fix of DDD
    316 
    317 
    318 #if H_3D_VSP
    319 #define MTK_RBIP_VSP_G0069                1   // Restricted bi-prediction for VSP
    320 #define NTT_STORE_SPDV_VSP_G0148          1   // Storing Sub-PU based DV for VSP
    321 #endif
    322 
    323 
    324 
    325318#endif
    326319
  • branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r879 r880  
    472472        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    473473        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    474 #if NTT_STORE_SPDV_VSP_G0148
     474#if H_3D_VSP
    475475        if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
    476476        {
  • branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r877 r880  
    373373          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    374374          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    375 #if NTT_STORE_SPDV_VSP_G0148
     375#if H_3D_VSP
    376376#if H_3D_DBBP
    377377          if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
     
    437437    }
    438438#if H_3D_VSP
    439 #if NTT_STORE_SPDV_VSP_G0148
    440439    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
    441 #else
    442     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
    443 #endif
    444440#else
    445441    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r877 r880  
    19001900          else
    19011901#endif
    1902 #if NTT_STORE_SPDV_VSP_G0148
    1903             {
     1902#if H_3D_VSP
     1903          {
    19041904          if ( vspFlag[uiMergeCand] )
    19051905          {
     
    19341934            rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    19351935            rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1936 #if NTT_STORE_SPDV_VSP_G0148
     1936#if H_3D_VSP
    19371937          }
    19381938        }
     
    19671967
    19681968          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
    1969 #if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
     1969#if H_3D_VSP // possible bug fix
    19701970          if( rpcTempCU->getSkipFlag(0) )
    19711971          {
     
    21972197#endif
    21982198  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
    2199 #if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
     2199#if H_3D_VSP // possible bug fix
    22002200  if( rpcTempCU->getQtRootCbf(0)==0 )
    22012201  {
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r879 r880  
    37563756  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    37573757  {
    3758       UInt uiCostCand = MAX_UINT;
    3759       UInt uiBitsCand = 0;
    3760      
    3761       PartSize ePartSize = pcCU->getPartitionSize( 0 );
    3762      
    3763 #if H_3D_VSP && NTT_STORE_SPDV_VSP_G0148
    3764       pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3765       pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3758    UInt uiCostCand = MAX_UINT;
     3759    UInt uiBitsCand = 0;
     3760
     3761    PartSize ePartSize = pcCU->getPartitionSize( 0 );
     3762
     3763#if H_3D_VSP
     3764    pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3765    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    37663766#endif
    37673767
    37683768#if H_3D_SPIVMP
    3769       pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ));
    3770       if (pbSPIVMPFlag[uiMergeCand])
    3771       {
    3772         UInt uiSPAddr;
    3773 
    3774         Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
    3775 
    3776         pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
    3777 
    3778         for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
    3779         {
    3780           pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
    3781           pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
    3782           pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
    3783         }
    3784       }
    3785       else
    3786 #endif
    3787 #if NTT_STORE_SPDV_VSP_G0148
     3769    pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ));
     3770    if (pbSPIVMPFlag[uiMergeCand])
     3771    {
     3772      UInt uiSPAddr;
     3773
     3774      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     3775
     3776      pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
     3777
     3778      for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
     3779      {
     3780        pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
     3781        pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
     3782        pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
     3783      }
     3784    }
     3785    else
     3786#endif
     3787#if H_3D_VSP
    37883788#if H_3D_DBBP
    37893789      if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) )
     
    38213821        pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    38223822        pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    3823 
    3824 #if NTT_STORE_SPDV_VSP_G0148
    3825       }
    3826 #endif
    3827 #if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148
    3828       pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3829       pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3823#if H_3D_VSP
     3824      }
    38303825#endif
    38313826
     
    38333828      if( uiMergeCand == pcCU->getUseDDDCandIdx() )
    38343829      {
    3835           pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3836           pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3830        pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3831        pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    38373832      }
    38383833      else
    38393834      {
    3840           pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3835        pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    38413836      }
    38423837#endif
     
    38463841      if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1)
    38473842      {
    3848          uiBitsCand--;
     3843        uiBitsCand--;
    38493844      }
    38503845      uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
     
    38573852        uiMergeIndex = uiMergeCand;
    38583853      }
    3859     }
     3854  }
    38603855  }
    38613856
     
    44484443    {
    44494444      uiLastMode = 1;
    4450           pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
    4451           pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
    4452         TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
    4453             pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
     4445      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
     4446      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
     4447      TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
     4448      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
    44544449      pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    4455      
     4450
    44564451      pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    44574452      pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     
    45744569        else
    45754570#endif
    4576 #if NTT_STORE_SPDV_VSP_G0148
     4571#if H_3D_VSP
    45774572#if H_3D_DBBP
    45784573        if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) )
Note: See TracChangeset for help on using the changeset viewer.