Changeset 809 in 3DVCSoftware for branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon
- Timestamp:
- 29 Jan 2014, 03:07:07 (11 years ago)
- Location:
- branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.cpp
r801 r809 3539 3539 for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ ) 3540 3540 { 3541 #if NTT_STORE_SPDV_VSP_G0148 3542 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) ) 3543 #else 3541 3544 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) ) 3545 #endif 3542 3546 { 3543 3547 continue; … … 4052 4056 iPosLeftAbove[0] = numA1B1B0; 4053 4057 #if H_3D_VSP 4058 #if NTT_STORE_SPDV_VSP_G0148 4059 if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 4060 #else 4054 4061 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1 4062 #endif 4055 4063 #if H_3D_IC 4056 4064 && !bICFlag … … 4075 4083 iPosLeftAbove[1] = numA1B1B0; 4076 4084 #if H_3D_VSP 4085 #if NTT_STORE_SPDV_VSP_G0148 4086 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 4087 #else 4077 4088 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 4089 #endif 4078 4090 #if H_3D_IC 4079 4091 && !bICFlag … … 4098 4110 { 4099 4111 #if H_3D_VSP 4112 #if NTT_STORE_SPDV_VSP_G0148 4113 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 4114 #else 4100 4115 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 4116 #endif 4101 4117 #if H_3D_IC 4102 4118 && !bICFlag … … 4119 4135 { 4120 4136 #if H_3D_VSP 4137 #if NTT_STORE_SPDV_VSP_G0148 4138 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0 4139 #else 4121 4140 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1 4141 #endif 4122 4142 #if H_3D_IC 4123 4143 && !bICFlag … … 4142 4162 { 4143 4163 #if H_3D_VSP 4164 #if NTT_STORE_SPDV_VSP_G0148 4165 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 4166 #else 4144 4167 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 4168 #endif 4145 4169 #if H_3D_IC 4146 4170 && !bICFlag … … 7869 7893 #endif 7870 7894 7895 #if NTT_STORE_SPDV_VSP_G0148 7896 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 7897 { 7898 // Get depth reference 7899 Int depthRefViewIdx = pcCU->getDvInfo(partAddr).m_aVIdxCan; 7900 7901 #if H_3D_FCO_VSP_DONBDV_E0163 7902 TComPic* pRefPicBaseDepth = 0; 7903 Bool bIsCurrDepthCoded = false; 7904 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() ); 7905 if ( pRefPicBaseDepth->getPicYuvRec() != NULL ) 7906 { 7907 bIsCurrDepthCoded = true; 7908 } 7909 else 7910 { 7911 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 7912 } 7913 #else 7914 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 7915 #endif 7916 assert(pRefPicBaseDepth != NULL); 7917 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 7918 assert(pcBaseViewDepthPicYuv != NULL); 7919 pcBaseViewDepthPicYuv->extendPicBorder(); 7920 7921 // Get texture reference 7922 assert(iRefIdx >= 0); 7923 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx ); 7924 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 7925 assert(pcBaseViewTxtPicYuv != NULL); 7926 7927 // Initialize LUT according to the reference viewIdx 7928 Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex(); 7929 Int* pShiftLUT = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx ); 7930 assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() ); 7931 7932 // prepare Dv to access depth map or reference view 7933 TComMv cDv = pcCU->getDvInfo(partAddr).m_acNBDV; 7934 pcCU->clipMv(cDv); 7935 7936 #if H_3D_FCO_VSP_DONBDV_E0163 7937 if ( bIsCurrDepthCoded ) 7938 { 7939 cDv.setZero(); 7940 } 7941 #endif 7942 7943 // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory 7944 xSetMvFieldForVSP( pcCU, pcBaseViewDepthPicYuv, &cDv, partAddr, width, height, pShiftLUT, eRefPicList, iRefIdx, pcCU->getSlice()->getIsDepth(), vspSize ); 7945 } 7946 7947 Void TComDataCU::xSetMvFieldForVSP( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ) 7948 { 7949 TComCUMvField *cuMvField = cu->getCUMvField( refPicList ); 7950 Int partAddrRasterSubPULine = g_auiZscanToRaster[ partAddr ]; 7951 Int numPartsLine = cu->getPic()->getNumPartInWidth(); 7952 7953 Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth(); 7954 Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight(); 7955 7956 Int refDepStride = picRefDepth->getStride(); 7957 7958 TComMv tmpMv(0, 0); 7959 tmpMv.setIDVFlag(false); 7960 7961 Int refDepOffset = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride; 7962 Pel *refDepth = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset; 7963 7964 if ((height % 8)) 7965 { 7966 vspSize = 1; // 8x4 7967 } 7968 else if ((width % 8)) 7969 { 7970 vspSize = 0; // 4x8 7971 } 7972 else 7973 { 7974 Bool ULvsBR, URvsBL; 7975 ULvsBR = refDepth[0] < refDepth[refDepStride * (height-1) + width-1]; 7976 URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)]; 7977 vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1; 7978 } 7979 7980 Int subBlockW, subBlockH; 7981 if (vspSize) 7982 { 7983 subBlockW = 8; 7984 subBlockH = 4; 7985 } 7986 else 7987 { 7988 subBlockW = 4; 7989 subBlockH = 8; 7990 } 7991 7992 Int numPartsInSubPUW = subBlockW / nTxtPerMvInfoX; 7993 Int numPartsInSubPUH = subBlockH / nTxtPerMvInfoY * numPartsLine; 7994 7995 for( Int y=0; y<height; y+=subBlockH, partAddrRasterSubPULine+=numPartsInSubPUH ) 7996 { 7997 Pel *refDepthTmp[4]; 7998 refDepthTmp[0] = refDepth + refDepStride * y; 7999 refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1; 8000 refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1); 8001 refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1; 8002 8003 Int partAddrRasterSubPU = partAddrRasterSubPULine; 8004 for( Int x=0; x<width; x+=subBlockW, partAddrRasterSubPU+=numPartsInSubPUW ) 8005 { 8006 Pel maxDepthVal; 8007 maxDepthVal = refDepthTmp[0][x]; 8008 maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]); 8009 maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]); 8010 maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]); 8011 tmpMv.setHor( (Short) shiftLUT[ maxDepthVal ] ); 8012 8013 Int partAddrRasterPartLine = partAddrRasterSubPU; 8014 for( Int sY=0; sY<numPartsInSubPUH; sY+=numPartsLine, partAddrRasterPartLine += numPartsLine ) 8015 { 8016 Int partAddrRasterPart = partAddrRasterPartLine; 8017 for( Int sX=0; sX<numPartsInSubPUW; sX+=1, partAddrRasterPart++ ) 8018 { 8019 cuMvField->setMv ( g_auiRasterToZscan[ partAddrRasterPart ], tmpMv ); 8020 cuMvField->setRefIdx( g_auiRasterToZscan[ partAddrRasterPart ], refIdx ); 8021 } 8022 } 8023 } 8024 } 8025 8026 vspSize = (vspSize<<2)+1; 8027 8028 } 8029 #endif // NTT_STORE_SPDV_VSP_G0148 7871 8030 7872 8031 //! \} -
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.h
r795 r809 291 291 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 292 292 293 #if NTT_STORE_SPDV_VSP_G0148 294 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 295 #endif 296 293 297 public: 294 298 TComDataCU(); … … 702 706 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 703 707 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 708 #if NTT_STORE_SPDV_VSP_G0148 709 Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); 710 #endif 704 711 #endif 705 712 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); -
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComMotionInfo.h
r773 r809 176 176 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 177 177 #endif 178 #if NTT_STORE_SPDV_VSP_G0148 179 Void setMv ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; } 180 Void setRefIdx ( Int iIdx, Int iRefIdx ) { m_piRefIdx[iIdx] = iRefIdx; } 181 #endif 178 182 179 183 Void setNumPartition( Int iNumPart ) -
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.cpp
r795 r809 863 863 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 864 864 { 865 #if NTT_STORE_SPDV_VSP_G0148 866 Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1; 867 868 Int widthSubPU, heightSubPU; 869 if (vspSize) 870 { 871 widthSubPU = 8; 872 heightSubPU = 4; 873 } 874 else 875 { 876 widthSubPU = 4; 877 heightSubPU = 8; 878 } 879 xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU ); 880 881 #else // NTT_STORE_SPDV_VSP_G0148 865 882 // Get depth reference 866 883 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; … … 914 931 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 915 932 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 916 } 933 #endif // NTT_STORE_SPDV_VSP_G0148 934 } 935 936 #if NTT_STORE_SPDV_VSP_G0148 937 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 938 { 939 UInt numPartsInLine = pcCU->getPic()->getNumPartInWidth(); 940 UInt horiNumPartsInSubPU = widthSubPU >> 2; 941 UInt vertNumPartsInSubPU = (heightSubPU >> 2) * numPartsInLine; 942 943 UInt partAddrRasterLine = g_auiZscanToRaster[ uiPartAddr ]; 944 945 for( Int posY=0; posY<iHeight; posY+=heightSubPU, partAddrRasterLine+=vertNumPartsInSubPU ) 946 { 947 UInt partAddrRasterSubPU = partAddrRasterLine; 948 for( Int posX=0; posX<iWidth; posX+=widthSubPU, partAddrRasterSubPU+=horiNumPartsInSubPU ) 949 { 950 UInt partAddrSubPU = g_auiRasterToZscan[ partAddrRasterSubPU ]; 951 Int refIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( partAddrSubPU ); assert (refIdx >= 0); 952 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( partAddrSubPU ); 953 pcCU->clipMv(cMv); 954 955 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi ); 956 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi ); 957 958 } 959 } 960 } 961 #endif // NTT_STORE_SPDV_VSP_G0148 962 917 963 #endif 918 964 … … 1769 1815 1770 1816 #if H_3D_VSP 1817 #if !(NTT_STORE_SPDV_VSP_G0148) 1771 1818 // not fully support iRatioTxtPerDepth* != 1 1772 1819 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) … … 2081 2128 } 2082 2129 } 2083 2130 #endif 2084 2131 2085 2132 #if H_3D_VSP_CONSTRAINED -
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComPrediction.h
r773 r809 121 121 122 122 #if H_3D_VSP 123 #if NTT_STORE_SPDV_VSP_G0148 124 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 125 #else 123 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 ); 124 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); 125 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 126 130 #endif 127 131 -
branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TypeDef.h
r800 r809 259 259 #endif 260 260 #define MTK_RBIP_VSP_G0069 1 // Restricted bi-prediction for VSP 261 #define NTT_STORE_SPDV_VSP_G0148 1 // Storing Sub-PU based DV for VSP 261 262 #endif 262 263
Note: See TracChangeset for help on using the changeset viewer.