Changeset 880 in 3DVCSoftware
- Timestamp:
- 27 Mar 2014, 22:57:10 (11 years ago)
- 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 3279 3279 Bool refViewAvailFlag = false; 3280 3280 UChar predFlag[2] = {0, 0}; 3281 #if !MTK_RBIP_VSP_G00693282 Int refListIdY = 0;3283 Int viewIdInRefListX = -1;3284 #endif3285 3281 3286 3282 for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) … … 3294 3290 refViewAvailFlag = true; 3295 3291 predFlag[iRefListIdX] = 1; 3296 #if !MTK_RBIP_VSP_G00693297 viewIdInRefListX = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();3298 refListIdY = 1 - iRefListIdX;3299 #endif3300 3292 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 3301 3293 #if H_3D_NBDV … … 3305 3297 } 3306 3298 } 3307 3308 #if !MTK_RBIP_VSP_G00693309 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 else3336 {3337 3338 cMv = cMv;3339 }3340 clipMv( cMv );3341 pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );3342 #if H_3D_NBDV3343 pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);3344 #endif3345 }3346 }3347 }3348 #endif3349 3299 3350 3300 // Set values to be returned … … 3465 3415 for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ ) 3466 3416 { 3467 #if NTT_STORE_SPDV_VSP_G01483468 3417 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) ) 3469 #else3470 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )3471 #endif3472 3418 { 3473 3419 continue; … … 3985 3931 iPosLeftAbove[0] = numA1B1B0; 3986 3932 #if H_3D_VSP 3987 #if NTT_STORE_SPDV_VSP_G01483988 3933 if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3989 #else3990 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 13991 #endif3992 3934 #if H_3D_IC 3993 3935 && !bICFlag … … 4012 3954 iPosLeftAbove[1] = numA1B1B0; 4013 3955 #if H_3D_VSP 4014 #if NTT_STORE_SPDV_VSP_G01484015 3956 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 4016 #else4017 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)4018 #endif4019 3957 #if H_3D_IC 4020 3958 && !bICFlag … … 4039 3977 { 4040 3978 #if H_3D_VSP 4041 #if NTT_STORE_SPDV_VSP_G01484042 3979 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 4043 #else4044 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)4045 #endif4046 3980 #if H_3D_IC 4047 3981 && !bICFlag … … 4064 3998 { 4065 3999 #if H_3D_VSP 4066 #if NTT_STORE_SPDV_VSP_G01484067 4000 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0 4068 #else4069 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 14070 #endif4071 4001 #if H_3D_IC 4072 4002 && !bICFlag … … 4091 4021 { 4092 4022 #if H_3D_VSP 4093 #if NTT_STORE_SPDV_VSP_G01484094 4023 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 4095 #else4096 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)4097 #endif4098 4024 #if H_3D_IC 4099 4025 && !bICFlag … … 7247 7173 #endif 7248 7174 7249 #if NTT_STORE_SPDV_VSP_G01487175 #if H_3D_VSP 7250 7176 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 7251 7177 { … … 7381 7307 7382 7308 } 7383 #endif // NTT_STORE_SPDV_VSP_G01487309 #endif 7384 7310 7385 7311 //! \} -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h
r878 r880 267 267 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 268 268 269 #if NTT_STORE_SPDV_VSP_G0148269 #if H_3D_VSP 270 270 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 271 271 #endif … … 665 665 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 666 666 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 667 #if NTT_STORE_SPDV_VSP_G0148668 667 Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); 669 #endif670 668 #endif 671 669 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h
r872 r880 176 176 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 177 177 #endif 178 #if NTT_STORE_SPDV_VSP_G0148178 #if H_3D_VSP 179 179 Void setMv ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; } 180 180 Void setRefIdx ( Int iIdx, Int iRefIdx ) { m_piRefIdx[iIdx] = iRefIdx; } -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r879 r880 1169 1169 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1170 1170 { 1171 #if NTT_STORE_SPDV_VSP_G01481172 1171 Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1; 1173 1172 … … 1184 1183 } 1185 1184 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 1243 1187 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 1244 1188 { … … 1265 1209 } 1266 1210 } 1267 #endif // NTT_STORE_SPDV_VSP_G01481268 1211 1269 1212 #endif … … 2120 2063 #endif 2121 2064 2122 #if H_3D_VSP2123 #if !(NTT_STORE_SPDV_VSP_G0148)2124 // not fully support iRatioTxtPerDepth* != 12125 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 texture2140 posX /= ratioTxtPerDepthX; // texture position -> depth postion2141 posY /= ratioTxtPerDepthY;2142 refDepOffset += posX + posY * refDepStride;2143 2144 width /= ratioTxtPerDepthX; // texture size -> depth size2145 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; // 8x42156 }2157 else if ((width % 8))2158 {2159 vspSize = 0; // 4x82160 }2161 else2162 {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 else2176 {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 == 12227 #if H_3D_VSP_CONSTRAINED2228 //get LUT based horizontal reference range2229 Int range = xGetConstrainedSize(width, height);2230 2231 // The minimum depth value2232 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 else2245 {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 else2260 {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 else2279 {2280 minRelativePos = maxRelativePos - range +1 ;2281 }2282 #endif2283 #endif // H_3D_VSP_BLOCKSIZE == 12284 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_CONSTRAINED2303 if(refOffset<minRelativePos || refOffset>maxRelativePos)2304 {2305 xFrac = 0;2306 }2307 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2308 #endif2309 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 #else2326 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;2327 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;2328 #endif2329 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 == 12347 #if H_3D_VSP_CONSTRAINED2348 //get LUT based horizontal reference range2349 Int range = xGetConstrainedSize(width, height, false);2350 2351 // The minimum depth value2352 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 resolution2363 2364 if (disparityInt < 0)2365 {2366 if (minRelativePos > disparityInt+xTxt)2367 {2368 minRelativePos = disparityInt+xTxt;2369 }2370 }2371 else2372 {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 else2388 {2389 minRelativePos = maxRelativePos - range + 1;2390 }2391 2392 #endif // H_3D_VSP_CONSTRAINED2393 #endif // H_3D_VSP_BLOCKSIZE == 12394 2395 TComMv dv(0, 0);2396 // luma size -> chroma size2397 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_CONSTRAINED2416 if(refOffset<minRelativePos || refOffset>maxRelativePos)2417 {2418 xFrac = 0;2419 }2420 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2421 #endif2422 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 #endif2437 2438 #if H_3D_VSP_CONSTRAINED2439 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 // chroma2449 {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_CONSTRAINED2457 2458 #endif // H_3D_VSP2459 2460 2065 #if H_3D_DIM 2461 2066 Void 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 80 80 81 81 #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; 87 84 #endif 88 85 … … 121 118 122 119 #if H_3D_VSP 123 #if NTT_STORE_SPDV_VSP_G0148124 120 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 125 #else126 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 #endif130 121 #endif 131 122 -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h
r879 r880 139 139 // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss 140 140 // LGE_SHARP_VSP_INHERIT_F0104 141 // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP 142 // Restricted bi-prediction for VSP 141 143 142 144 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate … … 314 316 #define MTK_DDD_G0063 1 // Disparity derived depth coding 315 317 #define HTM10RC1_FIX 1 // Fix of DDD 316 317 318 #if H_3D_VSP319 #define MTK_RBIP_VSP_G0069 1 // Restricted bi-prediction for VSP320 #define NTT_STORE_SPDV_VSP_G0148 1 // Storing Sub-PU based DV for VSP321 #endif322 323 324 325 318 #endif 326 319 -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r879 r880 472 472 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 473 473 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 474 #if NTT_STORE_SPDV_VSP_G0148474 #if H_3D_VSP 475 475 if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 ) 476 476 { -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r877 r880 373 373 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 374 374 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 375 #if NTT_STORE_SPDV_VSP_G0148375 #if H_3D_VSP 376 376 #if H_3D_DBBP 377 377 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) … … 437 437 } 438 438 #if H_3D_VSP 439 #if NTT_STORE_SPDV_VSP_G0148440 439 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0)) 441 #else442 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))443 #endif444 440 #else 445 441 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r877 r880 1900 1900 else 1901 1901 #endif 1902 #if NTT_STORE_SPDV_VSP_G01481903 1902 #if H_3D_VSP 1903 { 1904 1904 if ( vspFlag[uiMergeCand] ) 1905 1905 { … … 1934 1934 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1935 1935 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_G01481936 #if H_3D_VSP 1937 1937 } 1938 1938 } … … 1967 1967 1968 1968 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1969 #if NTT_STORE_SPDV_VSP_G0148// possible bug fix1969 #if H_3D_VSP // possible bug fix 1970 1970 if( rpcTempCU->getSkipFlag(0) ) 1971 1971 { … … 2197 2197 #endif 2198 2198 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 fix2199 #if H_3D_VSP // possible bug fix 2200 2200 if( rpcTempCU->getQtRootCbf(0)==0 ) 2201 2201 { -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r879 r880 3756 3756 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 3757 3757 { 3758 3759 3760 3761 3762 3763 #if H_3D_VSP && NTT_STORE_SPDV_VSP_G01483764 3765 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 ) ); 3766 3766 #endif 3767 3767 3768 3768 #if H_3D_SPIVMP 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 #endif 3787 #if NTT_STORE_SPDV_VSP_G01483769 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 3788 3788 #if H_3D_DBBP 3789 3789 if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) ) … … 3821 3821 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3822 3822 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 } 3830 3825 #endif 3831 3826 … … 3833 3828 if( uiMergeCand == pcCU->getUseDDDCandIdx() ) 3834 3829 { 3835 3836 3830 pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3831 pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3837 3832 } 3838 3833 else 3839 3834 { 3840 3835 pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3841 3836 } 3842 3837 #endif … … 3846 3841 if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1) 3847 3842 { 3848 3843 uiBitsCand--; 3849 3844 } 3850 3845 uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand ); … … 3857 3852 uiMergeIndex = uiMergeCand; 3858 3853 } 3859 3854 } 3860 3855 } 3861 3856 … … 4448 4443 { 4449 4444 uiLastMode = 1; 4450 4451 4452 4453 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 ); 4454 4449 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 4455 4450 4456 4451 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 4457 4452 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); … … 4574 4569 else 4575 4570 #endif 4576 #if NTT_STORE_SPDV_VSP_G01484571 #if H_3D_VSP 4577 4572 #if H_3D_DBBP 4578 4573 if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) )
Note: See TracChangeset for help on using the changeset viewer.