Changeset 21 in 3DVCSoftware
- Timestamp:
- 15 Feb 2012, 19:05:04 (13 years ago)
- Location:
- trunk/source
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppCommon/TAppComCamPara.cpp
r5 r21 984 984 xGetCameraShifts( 0, iMinAbsVOIId, m_uiFirstFrameId, dCamPosShift, dPicPosShift ); 985 985 Double dCamPosShiftVOI01 = dCamPosShift / Double( iMinVOI ); 986 Double dAbsCamPosShiftVOI01 = ( dCamPosShiftVOI01 < 0.0 ? -dCamPosShiftVOI01 : dCamPosShiftVOI01 );987 986 988 987 //--- determine maximum absolute camera position shift, precision, and base scale --- … … 997 996 } 998 997 } 998 Int iPrecision = 0; 999 #if 0 // enabling this lines might be reasonable, but produces different results for the 2 view and 3 view test cases 999 1000 Double dEpsilon = 1e-15; 1001 Double dAbsCamPosShiftVOI01 = ( dCamPosShiftVOI01 < 0.0 ? -dCamPosShiftVOI01 : dCamPosShiftVOI01 ); 1000 1002 Double dShiftRatio = dMaxAbsCamPosShift / dAbsCamPosShiftVOI01 - dEpsilon; 1001 Int iPrecision = 0; for( ; (Double)( 1 << iPrecision ) < dShiftRatio; iPrecision++ ); 1003 for( ; (Double)( 1 << iPrecision ) < dShiftRatio; iPrecision++ ); 1004 #endif 1002 1005 Int iPrecShift = iPrecision + PDM_INTER_CALC_SHIFT + PDM_VIRT_DEPTH_PRECISION - 2; 1003 1006 AOF( iPrecShift < PDM_INTERNAL_CALC_BIT_DEPTH ); -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r5 r21 352 352 m_acTDecTopList[0]->setPictureDigestEnabled(m_pictureDigestEnabled); 353 353 m_acTDecTopList[0]->setCamParsCollector( &m_cCamParsCollector ); 354 #if SONY_COLPIC_AVAILABILITY 355 m_acTDecTopList[0]->setViewOrderIdx(0); 356 #endif 354 357 } 355 358 -
trunk/source/App/TAppDecoder/TAppDecTop.h
r5 r21 105 105 TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } 106 106 TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } 107 TDecTop* getDecTop0 () { return m_acTDecTopList[0]; } 107 108 #endif 108 109 -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r17 r21 268 268 // GT: For development, will be removed later 269 269 ("VSOMode", m_uiVSOMode , (UInt) 4 , "VSO Mode") 270 #if HHI_VSO_LS_TABLE 271 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 272 #else 270 273 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 0.5 , "Lambda Scaling for VSO") 274 #endif 271 275 ("ForceLambdaScaleVSO", m_bForceLambdaScaleVSO , false , "Force using Lambda Scale VSO also in non-VSO-Mode") 272 276 #if HHI_VSO_DIST_INT … … 479 483 } 480 484 } 485 486 #if HHI_VSO_LS_TABLE 487 // Q&D 488 Double adLambdaScaleTable[] = 489 { 0.031250, 0.031639, 0.032029, 0.032418, 0.032808, 0.033197, 0.033586, 0.033976, 0.034365, 0.034755, 490 0.035144, 0.035533, 0.035923, 0.036312, 0.036702, 0.037091, 0.037480, 0.037870, 0.038259, 0.038648, 491 0.039038, 0.039427, 0.039817, 0.040206, 0.040595, 0.040985, 0.041374, 0.041764, 0.042153, 0.042542, 492 0.042932, 0.043321, 0.043711, 0.044100, 0.044194, 0.053033, 0.061872, 0.070711, 0.079550, 0.088388, 493 0.117851, 0.147314, 0.176777, 0.235702, 0.294628, 0.353553, 0.471405, 0.589256, 0.707107, 0.707100, 494 0.753550, 0.800000 495 }; 496 AOT( (m_aiQP[1] < 0) || (m_aiQP[1] > 51)); 497 m_dLambdaScaleVSO *= adLambdaScaleTable[m_aiQP[1]]; 498 #endif 481 499 #endif 482 500 … … 629 647 xConfirmPara ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5, "CodedCamParsPrecision must be in range of 0..5" ); 630 648 #if DEPTH_MAP_GENERATION 631 xConfirmPara ( m_uiPredDepthMapGeneration > 3, "PredDepthMapGen must be less than or equal to 3" );649 xConfirmPara ( m_uiPredDepthMapGeneration > 2, "PredDepthMapGen must be less than or equal to 2" ); 632 650 xConfirmPara ( m_uiPredDepthMapGeneration >= 2 && !m_bUsingDepthMaps, "PredDepthMapGen >= 2 requires CodeDepthMaps = 1" ); 633 651 #endif -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r5 r21 583 583 //GT: setup and init Bools for Eos and Continue Reading 584 584 Bool bAllEos = false; 585 Bool bAllContinueReadingPics ;585 Bool bAllContinueReadingPics = false; 586 586 std::vector<Bool> bEos ; 587 587 std::vector<Bool> bContinueReadingPics ; 588 588 589 589 Bool bAllDepthEos = false; 590 Bool bAllContinueReadingDepthPics ;590 Bool bAllContinueReadingDepthPics = false; 591 591 std::vector<Bool> bDepthEos ; 592 592 std::vector<Bool> bContinueReadingDepthPics ; -
trunk/source/Lib/TLibCommon/CommonDef.h
r17 r21 58 58 59 59 #define HM_VERSION "3.0rc2" ///< Current software version 60 #define NV_VERSION "0. 2r1"///< Current software version60 #define NV_VERSION "0.3" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 145 145 146 146 //>>>>> generation and usage of virtual prediction depth maps >>>>> 147 #define PDM_DEPTH_MAP_MCP_FILTER 2 // 0: standard filter, 1:bilinear, 2:nearest neighbour148 147 #define PDM_ONE_DEPTH_PER_PU 1 // use only a single depth for a prediction unit (in update) 149 #define PDM_NO_INTER_UPDATE 0// no update for inter (but not inter-view) predicted blocks148 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 150 149 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..5) 151 150 #define PDM_AMVP_POS 2 // position of pdm in amvp list (0..3) … … 167 166 #define PDM_USE_FOR_INTER 2 168 167 #define PDM_USE_FOR_MERGE 4 168 169 #define PDM_SUBSAMPLING_EXP 2 // subsampling factor is 2^PDM_SUBSAMPLING_EXP 170 #define PDM_SUB_SAMP_EXP_X(Pdm) ((Pdm)==1?PDM_SUBSAMPLING_EXP:0) 171 #define PDM_SUB_SAMP_EXP_Y(Pdm) ((Pdm)==1?PDM_SUBSAMPLING_EXP:0) 169 172 //<<<<< generation and usage of virtual prediction depth maps <<<<< 170 173 -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r5 r21 4213 4213 RefPicList eColRefPicList; 4214 4214 Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale; 4215 #if SONY_COLPIC_AVAILABILITY 4216 Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx; 4217 #endif 4215 4218 TComMv cColMv; 4216 4219 4217 4220 iCurrPOC = m_pcSlice->getPOC(); 4218 4221 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 4219 4222 #if SONY_COLPIC_AVAILABILITY 4223 iCurrViewOrderIdx = m_pcSlice->getViewOrderIdx(); 4224 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 4225 #endif 4220 4226 // use coldir. 4221 4227 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0), 0); 4222 4228 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 4223 4229 iColPOC = pColCU->getSlice()->getPOC(); 4230 #if SONY_COLPIC_AVAILABILITY 4231 iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx(); 4232 #endif 4224 4233 4225 4234 if (pColCU->isIntra(uiAbsPartAddr)) … … 4227 4236 return false; 4228 4237 } 4229 4238 #if !SONY_COLPIC_AVAILABILITY 4230 4239 if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() ) 4231 4240 return false; 4241 #endif 4232 4242 4233 4243 // Prefer a vector crossing us. Prefer shortest. … … 4245 4255 } 4246 4256 iColRefPOC = pColCU->getSlice()->getRefPOC(RefPicList(l), iColRefIdx); 4257 #if SONY_COLPIC_AVAILABILITY 4258 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic(RefPicList(l), iColRefIdx)->getViewOrderIdx(); 4259 bool bCrosses; 4260 int iColDist; 4261 if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)){ 4262 iColDist = abs(iColRefPOC - iColPOC); 4263 bCrosses = iColPOC < iCurrPOC ? iColRefPOC > iCurrPOC : iColRefPOC < iCurrPOC; 4264 }else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)){ 4265 iColDist = abs(iColRefViewOrderIdx - iColViewOrderIdx); 4266 bCrosses = iColViewOrderIdx < iCurrViewOrderIdx ? iColRefViewOrderIdx > iCurrViewOrderIdx : iColRefViewOrderIdx < iCurrViewOrderIdx; 4267 }else{ 4268 continue; 4269 } 4270 #else 4247 4271 if( pColCU->getSlice()->getRefViewIdx(RefPicList(l), iColRefIdx) != pColCU->getSlice()->getViewIdx() ) 4248 4272 continue; 4249 4273 int iColDist = abs(iColRefPOC - iColPOC); 4250 4274 bool bCrosses = iColPOC < iCurrPOC ? iColRefPOC > iCurrPOC : iColRefPOC < iCurrPOC; 4275 #endif 4276 4251 4277 if (iFirstColDist < 0) 4252 4278 { … … 4277 4303 iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr)); 4278 4304 cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 4305 #if SONY_COLPIC_AVAILABILITY 4306 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 4307 #endif 4279 4308 4280 4309 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 4310 #if SONY_COLPIC_AVAILABILITY 4311 iScale = 0; 4312 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 4313 if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)) 4281 4314 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); 4315 else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)) 4316 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 4317 #else 4318 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); 4319 #endif 4282 4320 if (iScale == 1024) 4283 4321 { -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r5 r21 57 57 m_uiMaxDepth = 0; 58 58 m_uiOrgDepthBitDepth = 0; 59 m_uiSubSampExpX = 0; 60 m_uiSubSampExpY = 0; 59 61 m_ppcYuv = 0; 60 62 m_ppcCU = 0; … … 68 70 69 71 Void 70 TComDepthMapGenerator::create( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth )72 TComDepthMapGenerator::create( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth, UInt uiSubSampExpX, UInt uiSubSampExpY ) 71 73 { 72 74 destroy(); … … 74 76 m_uiMaxDepth = uiMaxCUDepth; 75 77 m_uiOrgDepthBitDepth = uiOrgBitDepth; 78 m_uiSubSampExpX = uiSubSampExpX; 79 m_uiSubSampExpY = uiSubSampExpY; 76 80 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 77 81 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 82 86 UInt uiHeight = uiMaxCUHeight >> uiDepth; 83 87 84 m_ppcYuv[ uiDepth ] = new TComYuv; m_ppcYuv[ uiDepth ]->create( uiWidth, uiHeight);88 m_ppcYuv[ uiDepth ] = new TComYuv; m_ppcYuv[ uiDepth ]->create( uiWidth >> m_uiSubSampExpX, uiHeight >> m_uiSubSampExpY ); 85 89 m_ppcCU [ uiDepth ] = new TComDataCU; m_ppcCU [ uiDepth ]->create( uiNumPart, uiWidth, uiHeight, true ); 86 90 } 87 m_cTmpPic.create( uiPicWidth , uiPicHeight, uiMaxCUWidth, uiMaxCUHeight, uiMaxCUDepth );91 m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth ); 88 92 xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 ); 89 93 m_bCreated = true; … … 106 110 m_uiMaxDepth = 0; 107 111 m_uiOrgDepthBitDepth = 0; 112 m_uiSubSampExpX = 0; 113 m_uiSubSampExpY = 0; 108 114 m_bDecoder = false; 109 115 } … … 372 378 if( pcBasePic->getPOC() == 0 ) 373 379 { 380 pcBasePic->removePrdDepthMapBuffer(); 381 pcBasePic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_pcSPSAccess->getPdm()), PDM_SUB_SAMP_EXP_Y(m_pcSPSAccess->getPdm()) ); 374 382 xClearDepthMap( pcBasePic ); 375 383 } … … 643 651 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 644 652 Int iDisparity = xGetDisparityFromVirtDepth( uiBaseId, iPrdDepth ); 645 Int iBasePosX = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + 2 ) >> 2 ) ); 653 Int iShiftX = m_uiSubSampExpX + 2; 654 Int iAddX = ( 1 << iShiftX ) >> 1; 655 Int iBasePosX = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) ); 646 656 Int iBasePosY = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY ); 647 657 Int iBaseCUAddr; 648 658 Int iBaseAbsPartIdx; 649 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );659 pcBaseRec->getCUAddrAndPartIdx( iBasePosX << m_uiSubSampExpX, iBasePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx ); 650 660 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 651 661 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP ) … … 744 754 Pel* pRefSamples = pcRefDepthMap->getLumaAddr( 0 ); 745 755 Int iRefViewIdx = pcRef->getViewIdx(); 756 Int iShiftX = m_uiSubSampExpX + 2; 757 Int iAddX = ( 1 << iShiftX ) >> 1; 746 758 for( Int iY = 0; iY < iHeight; iY++, pCurSamples += iCurStride, pRefSamples += iRefStride ) 747 759 { … … 750 762 Int iDepth = pCurSamples[ iXCur ]; 751 763 Int iDisp = xGetDisparityFromVirtDepth( iRefViewIdx, iDepth ); 752 Int iXRef = iXCur + ( ( iDisp + 2 ) >> 2);764 Int iXRef = iXCur + ( ( iDisp + iAddX ) >> iShiftX ); 753 765 if( iXRef >= 0 && iXRef < iWidth && iDepth > pRefSamples[ iXRef ] ) 754 766 { … … 784 796 Pel* pCurSamples = pcCurDepthMap->getLumaAddr( 0 ); 785 797 Int iRefViewIdx = pcRef->getViewIdx(); 798 Int iShiftX = m_uiSubSampExpX + 2; 799 Int iAddX = ( 1 << iShiftX ) >> 1; 786 800 for( Int iY = 0; iY < iHeight; iY++, pRefSamples += iRefStride, pCurSamples += iCurStride ) 787 801 { … … 790 804 Int iDepth = pRefSamples[ iXRef ]; 791 805 Int iDisp = xGetDisparityFromVirtDepth( iRefViewIdx, iDepth ); 792 Int iXCur = iXRef - ( ( iDisp + 2 ) >> 2);806 Int iXCur = iXRef - ( ( iDisp + iAddX ) >> iShiftX ); 793 807 if( iXCur >= 0 && iXCur < iWidth && iDepth > pCurSamples[ iXCur ] ) 794 808 { … … 1022 1036 if( uiTrMode == uiTrDepth ) 1023 1037 { 1024 UInt uiWidth = pcCU->getWidth ( 0 ) >> uiTrDepth;1025 UInt uiHeight = pcCU->getHeight( 0 ) >> uiTrDepth;1038 UInt uiWidth = pcCU->getWidth ( 0 ) >> ( uiTrDepth + m_uiSubSampExpX ); 1039 UInt uiHeight = pcCU->getHeight( 0 ) >> ( uiTrDepth + m_uiSubSampExpY ); 1026 1040 UInt uiStride = pcCUDepthMap->getStride (); 1027 Pel* pDepthMap = pcCUDepthMap->getLumaAddr( uiAbsPartIdx ); 1041 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX; 1042 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY; 1043 Pel* pDepthMap = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX; 1028 1044 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 1029 1045 Bool bAboveAvail = false; … … 1034 1050 m_pcPrediction->getPredicBufWidth (), 1035 1051 m_pcPrediction->getPredicBufHeight (), 1036 bAboveAvail, bLeftAvail, true );1052 bAboveAvail, bLeftAvail, true, m_uiSubSampExpX, m_uiSubSampExpY ); 1037 1053 m_pcPrediction->predIntraDepthAng ( pcCU->getPattern(), uiLumaPredMode, pDepthMap, uiStride, uiWidth, uiHeight ); // could be replaced with directional intra prediction 1038 1054 // using "predIntraLumaAng", but note: … … 1106 1122 UInt uiAbsPartIdx; 1107 1123 pcCU->getPartIndexAndSize( uiPartIdx, uiAbsPartIdx, iWidth, iHeight ); 1124 iWidth >>= m_uiSubSampExpX; 1125 iHeight >>= m_uiSubSampExpY; 1108 1126 1109 1127 // get depth values … … 1125 1143 if( aiPrdDepth[ 0 ] != PDM_UNDEFINED_DEPTH && aiPrdDepth[ 1 ] != PDM_UNDEFINED_DEPTH ) 1126 1144 { 1127 iDepthValue = ( aiPrdDepth[ 0 ] + aiPrdDepth[ 1 ] + 1 ) >> 2;1145 iDepthValue = ( aiPrdDepth[ 0 ] + aiPrdDepth[ 1 ] + 1 ) >> 1; 1128 1146 } 1129 1147 else … … 1135 1153 1136 1154 // set depth map for PU 1137 Pel* pDMSamples = pcCUDepthMap->getLumaAddr( uiAbsPartIdx ); 1155 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX; 1156 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY; 1157 Pel* pDMSamples = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX; 1138 1158 Int iStride = pcCUDepthMap->getStride (); 1139 1159 for( Int iY = 0; iY < iHeight; iY++, pDMSamples += iStride ) … … 1160 1180 Int iNum4x4BlksY = iHeight >> 2; 1161 1181 Int iNum4x4BlksX = iWidth >> 2; 1182 iWidth >>= m_uiSubSampExpX; 1183 iHeight >>= m_uiSubSampExpY; 1184 1162 1185 TComPicYuv* pcCurrDepthMap = pcCU->getPic()->getPredDepthMap(); 1163 1186 Pel* piCurrDepthMap = pcCurrDepthMap->getLumaAddr(); … … 1184 1207 Pel* piBaseDepthMap = pcBaseDepthMap->getLumaAddr(); 1185 1208 Int iBaseStride = pcBaseDepthMap->getStride(); 1209 Int iShiftX = m_uiSubSampExpX + 2; 1210 Int iShiftY = m_uiSubSampExpY + 2; 1211 Int iAddX = ( 1 << iShiftX ) >> 1; 1212 Int iAddY = ( 1 << iShiftY ) >> 1; 1186 1213 1187 1214 //===== initialize 4x4 block arrays ===== … … 1202 1229 { 1203 1230 // position parameters 1204 Int iCurrBlkPosX = iCurrPUPosX + ( i4x4BlkX << 2);1205 Int iCurrBlkPosY = iCurrPUPosY + ( i4x4BlkY << 2);1206 Int iCurrSamplePosX = iCurrBlkPosX + 1;1207 Int iCurrSamplePosY = iCurrBlkPosY + 1;1231 Int iCurrBlkPosX = iCurrPUPosX + ( ( i4x4BlkX << 2 ) >> m_uiSubSampExpX ); 1232 Int iCurrBlkPosY = iCurrPUPosY + ( ( i4x4BlkY << 2 ) >> m_uiSubSampExpY ); 1233 Int iCurrSamplePosX = iCurrBlkPosX + ( 1 >> m_uiSubSampExpX ); 1234 Int iCurrSamplePosY = iCurrBlkPosY + ( 1 >> m_uiSubSampExpY ); 1208 1235 Int iCurrPredDepth = piCurrDepthMap[ iCurrSamplePosY * iCurrStride + iCurrSamplePosX ]; 1209 1236 Int iCurrPredDisp = xGetDisparityFromVirtDepth( uiBaseId, iCurrPredDepth ); 1210 Int iBaseSamplePosX = iCurrSamplePosX + ( ( iCurrPredDisp + 2 ) >> 2);1237 Int iBaseSamplePosX = iCurrSamplePosX + ( ( iCurrPredDisp + iAddX ) >> iShiftX ); 1211 1238 Int iBaseSamplePosY = iCurrSamplePosY; 1212 1239 iBaseSamplePosX = Clip3( 0, pcBaseDepthMap->getWidth () - 1, iBaseSamplePosX ); … … 1222 1249 Int iBaseCUAddr; 1223 1250 Int iBaseAbsPartIdx; 1224 pcBaseRecPic->getCUAddrAndPartIdx( iBaseSamplePosX , iBaseSamplePosY, iBaseCUAddr, iBaseAbsPartIdx );1251 pcBaseRecPic->getCUAddrAndPartIdx( iBaseSamplePosX << m_uiSubSampExpX, iBaseSamplePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx ); 1225 1252 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 1226 1253 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP ) … … 1256 1283 Int iCurrRefStride = pcCurrRefDMap->getStride(); 1257 1284 TComMv& rcCurrMv = aiCurrMvField[ iCurrRefListId ]->getMv( uiAbsPartIdx ); 1258 Int iCurrRefSamplePosX = iCurrSamplePosX + ( ( rcCurrMv.getHor() + 2 ) >> 2);1259 Int iCurrRefSamplePosY = iCurrSamplePosY + ( ( rcCurrMv.getVer() + 2 ) >> 2);1285 Int iCurrRefSamplePosX = iCurrSamplePosX + ( ( rcCurrMv.getHor() + iAddX ) >> iShiftX ); 1286 Int iCurrRefSamplePosY = iCurrSamplePosY + ( ( rcCurrMv.getVer() + iAddY ) >> iShiftY ); 1260 1287 Int iCurrRefSamplePosXC = Clip3( 0, pcCurrRefDMap->getWidth () - 1, iCurrRefSamplePosX ); 1261 1288 Int iCurrRefSamplePosYC = Clip3( 0, pcCurrRefDMap->getHeight() - 1, iCurrRefSamplePosY ); … … 1271 1298 // location and depth for path currView/currAU -> currView/refAU -> baseView/refAU 1272 1299 Int iCurrRefDisp = xGetDisparityFromVirtDepth( uiBaseId, iCurrRefDepth ); 1273 Int iBaseRefSamplePosX = iCurrRefSamplePosX + ( ( iCurrRefDisp + 2 ) >> 2);1300 Int iBaseRefSamplePosX = iCurrRefSamplePosX + ( ( iCurrRefDisp + iAddX ) >> iShiftX ); 1274 1301 Int iBaseRefSamplePosY = iCurrRefSamplePosY; 1275 1302 TComPic* pcBaseRefPic = pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, aiBaseRefIdx[ iBaseRefListId ] ); … … 1328 1355 for( Int i4x4BlkX = 0; i4x4BlkX < iNum4x4BlksX; i4x4BlkX++ ) 1329 1356 { 1330 Int iCurrSamplePosX = iCurrPUPosX + ( i4x4BlkX << 2 ) + 1;1331 Int iCurrSamplePosY = iCurrPUPosY + ( i4x4BlkY << 2 ) + 1;1357 Int iCurrSamplePosX = iCurrPUPosX + ( ( ( i4x4BlkX << 2 ) + 1 ) >> m_uiSubSampExpX ); 1358 Int iCurrSamplePosY = iCurrPUPosY + ( ( ( i4x4BlkY << 2 ) + 1 ) >> m_uiSubSampExpY ); 1332 1359 m_aai4x4Depth[i4x4BlkY][i4x4BlkX] = piCurrDepthMap[ iCurrSamplePosY * iCurrStride + iCurrSamplePosX ]; 1333 1360 m_aabDepthSet[i4x4BlkY][i4x4BlkX] = true; … … 1389 1416 1390 1417 //===== set depth values ===== 1391 Pel* piDepthMap = pcCUDepthMap->getLumaAddr( uiAbsPartIdx ); 1418 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpX; 1419 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ] >> m_uiSubSampExpY; 1420 Pel* piDepthMap = pcCUDepthMap->getLumaAddr() + uiBlkY * pcCUDepthMap->getStride() + uiBlkX; 1392 1421 Int iCUStride = pcCUDepthMap->getStride (); 1393 1422 for( Int iRow = 0; iRow < iHeight; iRow++, piDepthMap += iCUStride ) … … 1395 1424 for( Int iCol = 0; iCol < iWidth; iCol++ ) 1396 1425 { 1397 piDepthMap[ iCol ] = m_aai4x4Depth[ iRow >> 2 ][ iCol>> 2 ];1426 piDepthMap[ iCol ] = m_aai4x4Depth[ (iRow << m_uiSubSampExpY) >> 2 ][ (iCol << m_uiSubSampExpX) >> 2 ]; 1398 1427 } 1399 1428 } … … 1404 1433 TComDepthMapGenerator::xInterPUDepthMapPrediction( TComDataCU* pcCU, TComYuv* pcCUDepthMap, UInt uiPartIdx ) 1405 1434 { 1406 m_pcPrediction->motionCompensation( pcCU, pcCUDepthMap, REF_PIC_LIST_X, (Int)uiPartIdx, true );1435 m_pcPrediction->motionCompensation( pcCU, pcCUDepthMap, REF_PIC_LIST_X, (Int)uiPartIdx, true, m_uiSubSampExpX, m_uiSubSampExpY ); 1407 1436 } 1408 1437 … … 1432 1461 Int iCurrPosY; 1433 1462 pcPredDepthMap->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 1434 iCurrPosX += ( iWidth- 1 ) >> 1;1435 iCurrPosY += ( iHeight- 1 ) >> 1;1463 iCurrPosX += ( ( iWidth >> m_uiSubSampExpX ) - 1 ) >> 1; 1464 iCurrPosY += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1; 1436 1465 riPrdDepth = piPredDepthMap[ iCurrPosX + iCurrPosY * iCurrStride ]; 1437 1466 if( piPosX ) -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r5 r21 110 110 ~TComDepthMapGenerator(); 111 111 112 Void create ( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth );112 Void create ( Bool bDecoder, UInt uiPicWidth, UInt uiPicHeight, UInt uiMaxCUDepth, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiOrgBitDepth, UInt uiSubSampExpX, UInt uiSubSampExpY ); 113 113 Void destroy (); 114 114 … … 126 126 127 127 UInt getBaseViewId ( UInt uiIdx ) { AOF( uiIdx < m_auiBaseIdList.size() ); return m_auiBaseIdList[uiIdx]; } 128 UInt getSubSampExpX () { return m_uiSubSampExpX; } 129 UInt getSubSampExpY () { return m_uiSubSampExpY; } 128 130 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 129 131 #if HHI_INTER_VIEW_MOTION_PRED … … 200 202 UInt m_uiMaxDepth; 201 203 UInt m_uiOrgDepthBitDepth; 204 UInt m_uiSubSampExpX; 205 UInt m_uiSubSampExpY; 202 206 TComYuv** m_ppcYuv; 203 207 TComDataCU** m_ppcCU; -
trunk/source/Lib/TLibCommon/TComPattern.cpp
r5 r21 147 147 if ( iComp == 0 ) 148 148 { 149 #if DEPTH_MAP_GENERATION 150 m_iPatternStride = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getStride() : pcCU->getPic()->getStride() ); 151 #else 149 152 m_iPatternStride = pcCU->getPic()->getStride(); 153 #endif 150 154 m_piPatternOrigin = pcPic->getLumaAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft; 151 155 } 152 156 else 153 157 { 158 #if DEPTH_MAP_GENERATION 159 m_iPatternStride = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getCStride() : pcCU->getPic()->getCStride() ); 160 #else 154 161 m_iPatternStride = pcCU->getPic()->getCStride(); 162 #endif 155 163 if ( iComp == 1 ) 156 164 m_piPatternOrigin = pcPic->getCbAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft; … … 242 250 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft 243 251 #if DEPTH_MAP_GENERATION 244 , Bool bPrdDepthMap 252 , Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY 245 253 #endif 246 254 ) … … 254 262 UInt uiWidth; 255 263 UInt uiHeight; 264 265 #if DEPTH_MAP_GENERATION 266 Int iPicStride = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getStride() : pcCU->getPic()->getStride() ); 267 #else 256 268 Int iPicStride = pcCU->getPic()->getStride(); 269 #endif 270 257 271 Int iCuAddr; 258 272 #if REFERENCE_SAMPLE_PADDING … … 375 389 #endif // REFERENCE_SAMPLE_PADDING 376 390 391 #if DEPTH_MAP_GENERATION 392 if ( bPrdDepthMap ) 393 { 394 uiWidth = ( uiCuWidth2 >> uiSubSampExpX ) + 1; 395 uiHeight = ( uiCuHeight2 >> uiSubSampExpY ) + 1; 396 } 397 else 398 { 377 399 uiWidth=uiCuWidth2+1; 378 400 uiHeight=uiCuHeight2+1; 401 } 402 #else 403 uiWidth=uiCuWidth2+1; 404 uiHeight=uiCuHeight2+1; 405 #endif 379 406 380 407 if (((uiWidth<<2)>iOrgBufStride)||((uiHeight<<2)>iOrgBufHeight)) … … 398 425 #if REFERENCE_SAMPLE_PADDING 399 426 #if DEPTH_MAP_GENERATION 427 if ( bPrdDepthMap ) 428 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize >> uiSubSampExpX, iNumUnitsInCu, iTotalUnits, uiCuWidth >> uiSubSampExpX, uiCuHeight >> uiSubSampExpY, uiWidth, uiHeight, iPicStride, bPrdDepthMap ); 429 else 400 430 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bPrdDepthMap ); 401 431 #else -
trunk/source/Lib/TLibCommon/TComPattern.h
r5 r21 174 174 Bool& bLeft 175 175 #if DEPTH_MAP_GENERATION 176 ,Bool bPrdDepthMap = false 176 , 177 Bool bPrdDepthMap = false, 178 UInt uiSubSampExpX = 0, 179 UInt uiSubSampExpY = 0 177 180 #endif 178 181 ); -
trunk/source/Lib/TLibCommon/TComPic.cpp
r5 r21 73 73 m_aiNumRefIdx[0] = 0; 74 74 m_aiNumRefIdx[1] = 0; 75 75 #if SONY_COLPIC_AVAILABILITY 76 m_iViewOrderIdx = 0; 77 #endif 76 78 m_iViewIdx = 0; 77 79 m_aaiCodedScale = 0; … … 211 213 #if DEPTH_MAP_GENERATION 212 214 Void 213 TComPic::addPrdDepthMapBuffer( )215 TComPic::addPrdDepthMapBuffer( UInt uiSubSampExpX, UInt uiSubSampExpY ) 214 216 { 215 217 AOT( m_pcPredDepthMap ); … … 221 223 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 222 224 m_pcPredDepthMap = new TComPicYuv; 223 m_pcPredDepthMap ->create( iWidth , iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );225 m_pcPredDepthMap ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth ); 224 226 } 225 227 #endif -
trunk/source/Lib/TLibCommon/TComPic.h
r5 r21 90 90 91 91 Int m_iViewIdx; 92 #if SONY_COLPIC_AVAILABILITY 93 Int m_iViewOrderIdx; 94 #endif 92 95 Int** m_aaiCodedScale; 93 96 Int** m_aaiCodedOffset; … … 159 162 Void setViewIdx( Int i ) { m_iViewIdx = i; } 160 163 Int getViewIdx() { return m_iViewIdx; } 164 #if SONY_COLPIC_AVAILABILITY 165 Void setViewOrderIdx(Int i) { m_iViewOrderIdx = i; } 166 Int getViewOrderIdx() { return m_iViewOrderIdx; } 167 #endif 161 168 162 169 Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } … … 200 207 #endif 201 208 #if DEPTH_MAP_GENERATION 202 Void addPrdDepthMapBuffer ( );209 Void addPrdDepthMapBuffer ( UInt uiSubSampExpX, UInt uiSubSampExpY ); 203 210 #endif 204 211 #if HHI_INTER_VIEW_MOTION_PRED -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r5 r21 1507 1507 #endif 1508 1508 1509 Void TComPrediction::motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap ) 1509 #if DEPTH_MAP_GENERATION 1510 Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1511 #else 1512 Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx ) 1513 #endif 1510 1514 { 1511 1515 Int iWidth; … … 1516 1520 { 1517 1521 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1522 1523 #if DEPTH_MAP_GENERATION 1524 if( bPrdDepthMap ) 1525 { 1526 iWidth >>= uiSubSampExpX; 1527 iHeight >>= uiSubSampExpY; 1528 } 1529 #endif 1530 1518 1531 if ( eRefPicList != REF_PIC_LIST_X ) 1519 1532 { 1520 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap ); 1533 #if DEPTH_MAP_GENERATION 1534 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1535 #else 1536 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); 1537 #endif 1521 1538 #ifdef WEIGHT_PRED 1522 1539 if ( pcCU->getSlice()->getPPS()->getUseWP() ) … … 1528 1545 else 1529 1546 { 1530 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx, bPrdDepthMap ); 1531 1547 #if DEPTH_MAP_GENERATION 1548 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 1549 #else 1550 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx ); 1551 #endif 1532 1552 } 1533 1553 return; … … 1538 1558 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1539 1559 1560 #if DEPTH_MAP_GENERATION 1561 if( bPrdDepthMap ) 1562 { 1563 iWidth >>= uiSubSampExpX; 1564 iHeight >>= uiSubSampExpY; 1565 } 1566 #endif 1567 1540 1568 if ( eRefPicList != REF_PIC_LIST_X ) 1541 1569 { 1542 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap ); 1570 #if DEPTH_MAP_GENERATION 1571 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1572 #else 1573 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); 1574 #endif 1543 1575 #ifdef WEIGHT_PRED 1544 1576 if ( pcCU->getSlice()->getPPS()->getUseWP() ) … … 1550 1582 else 1551 1583 { 1552 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx, bPrdDepthMap ); 1584 #if DEPTH_MAP_GENERATION 1585 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 1586 #else 1587 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx ); 1588 #endif 1553 1589 } 1554 1590 } … … 1558 1594 #if HIGH_ACCURACY_BI 1559 1595 #if DEPTH_MAP_GENERATION 1560 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi )1596 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi ) 1561 1597 #else 1562 1598 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi ) … … 1564 1600 #else 1565 1601 #if DEPTH_MAP_GENERATION 1566 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )1602 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1567 1603 #else 1568 1604 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) … … 1576 1612 #if DEPTH_MAP_GENERATION 1577 1613 if( bPrdDepthMap ) 1614 { 1615 UInt uiRShift = 0; 1616 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift ); 1617 return; 1618 } 1619 #endif 1620 1621 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1622 if( pcCU->getSlice()->getSPS()->isDepth() ) 1578 1623 { 1579 1624 #if HIGH_ACCURACY_BI … … 1582 1627 UInt uiRShift = 0; 1583 1628 #endif 1584 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, PDM_DEPTH_MAP_MCP_FILTER ); 1585 return; 1586 } 1587 #endif 1588 1589 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1590 if( pcCU->getSlice()->getSPS()->isDepth() ) 1591 { 1592 #if HIGH_ACCURACY_BI 1593 UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 ); 1629 #if DEPTH_MAP_GENERATION 1630 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, 0, 0, rpcYuvPred, uiRShift ); 1594 1631 #else 1595 UInt uiRShift = 0; 1596 #endif 1597 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, 2 ); 1632 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift ); 1633 #endif 1598 1634 } 1599 1635 else … … 1630 1666 } 1631 1667 1632 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 1668 #if DEPTH_MAP_GENERATION 1669 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 1670 #else 1671 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ) 1672 #endif 1633 1673 { 1634 1674 TComYuv* pcMbYuv; … … 1651 1691 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 1652 1692 #if DEPTH_MAP_GENERATION 1653 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, true );1693 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 1654 1694 #else 1655 1695 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true ); … … 1657 1697 else 1658 1698 #if DEPTH_MAP_GENERATION 1659 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );1699 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1660 1700 #else 1661 1701 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx ); … … 1663 1703 #else 1664 1704 #if DEPTH_MAP_GENERATION 1665 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );1705 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1666 1706 #else 1667 1707 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx ); … … 1677 1717 else 1678 1718 #endif 1719 1720 #if DEPTH_MAP_GENERATION 1721 if ( bPrdDepthMap ) 1722 { 1723 xWeightedAveragePdm( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, uiSubSampExpX, uiSubSampExpY ); 1724 } 1725 else 1726 { 1727 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1728 } 1729 #else 1679 1730 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1731 #endif 1732 1680 1733 } 1681 1734 1682 1735 1683 1736 Void 1684 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ) // 0:std, 1:bilin, 2:nearest neighbour 1685 { 1686 AOF( uiFilterMode <= 2 ); 1687 1737 #if DEPTH_MAP_GENERATION 1738 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ) 1739 #else 1740 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift ) 1741 #endif 1742 { 1743 #if DEPTH_MAP_GENERATION 1744 Int iShiftX = 2 + uiSubSampExpX; 1745 Int iShiftY = 2 + uiSubSampExpY; 1746 Int iAddX = ( 1 << iShiftX ) >> 1; 1747 Int iAddY = ( 1 << iShiftY ) >> 1; 1748 Int iHor = ( pcMv->getHor() + iAddX ) >> iShiftX; 1749 Int iVer = ( pcMv->getVer() + iAddY ) >> iShiftY; 1750 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1751 if( pcCU->getSlice()->getSPS()->isDepth() ) 1752 { 1753 iHor = pcMv->getHor(); 1754 iVer = pcMv->getVer(); 1755 } 1756 #endif 1757 Int iRefStride = pcPicYuvRef->getStride(); 1758 Int iDstStride = rpcYuv->getStride(); 1759 Int iRefOffset = iHor + iVer * iRefStride; 1760 #else 1688 1761 Int iFPelMask = ~3; 1689 1762 Int iRefStride = pcPicYuvRef->getStride(); 1690 1763 Int iDstStride = rpcYuv->getStride(); 1691 Int iHor = ( uiFilterMode == 2 ? ( pcMv->getHor() + 2 ) & iFPelMask : pcMv->getHor() );1692 Int iVer = ( uiFilterMode == 2 ? ( pcMv->getVer() + 2 ) & iFPelMask : pcMv->getVer() );1764 Int iHor = ( pcMv->getHor() + 2 ) & iFPelMask; 1765 Int iVer = ( pcMv->getVer() + 2 ) & iFPelMask; 1693 1766 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1694 1767 if( pcCU->getSlice()->getSPS()->isDepth() ) 1695 1768 { 1696 assert( uiFilterMode == 2 );1697 1769 iHor = pcMv->getHor() * 4; 1698 1770 iVer = pcMv->getVer() * 4; 1699 1771 } 1700 1772 #endif 1701 Int iRefOffset = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;1702 1773 Int ixFrac = iHor & 0x3; 1703 1774 Int iyFrac = iVer & 0x3; 1775 Int iRefOffset = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride; 1776 #endif 1777 1704 1778 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 1705 1779 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 1706 1780 1707 // Integer position1708 if( ixFrac == 0 && iyFrac == 0 )1709 {1710 1781 for( Int y = 0; y < iHeight; y++, piDstY += iDstStride, piRefY += iRefStride ) 1711 1782 { … … 1715 1786 } 1716 1787 } 1717 return;1718 }1719 1720 // bi-linear interpolation1721 if( uiFilterMode == 1 )1722 {1723 Int iW00 = ( 4 - ixFrac ) * ( 4 - iyFrac );1724 Int iW01 = ( ixFrac ) * ( 4 - iyFrac );1725 Int iW10 = ( 4 - ixFrac ) * ( iyFrac );1726 Int iW11 = ( ixFrac ) * ( iyFrac );1727 Pel* piRefY1 = piRefY + iRefStride;1728 for( Int y = 0; y < iHeight; y++, piDstY += iDstStride, piRefY += iRefStride, piRefY1 += iRefStride )1729 {1730 for( Int x = 0; x < iWidth; x++ )1731 {1732 Int iSV = iW00 * piRefY [ x ] + iW01 * piRefY [ x + 1 ]1733 + iW10 * piRefY1[ x ] + iW11 * piRefY1[ x + 1 ];1734 iSV <<= uiRShift;1735 piDstY[ x ] = ( iSV + 8 ) >> 4;1736 }1737 }1738 return;1739 }1740 1741 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, pcMv, iWidth, iHeight, rpcYuv );1742 return;1743 1788 } 1744 1789 … … 2167 2212 } 2168 2213 2214 #endif 2215 2216 #if DEPTH_MAP_GENERATION 2217 Void TComPrediction::xWeightedAveragePdm( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) 2218 { 2219 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 2220 { 2221 rpcYuvDst->addAvgPdm( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY ); 2222 } 2223 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 2224 { 2225 pcYuvSrc0->copyPartToPartYuvPdm( rpcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY ); 2226 } 2227 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 2228 { 2229 pcYuvSrc1->copyPartToPartYuvPdm( rpcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY ); 2230 } 2231 else 2232 { 2233 assert (0); 2234 } 2235 } 2169 2236 #endif 2170 2237 -
trunk/source/Lib/TLibCommon/TComPrediction.h
r5 r21 89 89 #if HIGH_ACCURACY_BI 90 90 #if DEPTH_MAP_GENERATION 91 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi=false );91 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); 92 92 #else 93 93 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); … … 95 95 #else 96 96 #if DEPTH_MAP_GENERATION 97 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );97 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 98 98 #else 99 99 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 100 100 #endif 101 101 #endif 102 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 103 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ); // 0:std, 1:bilin, 2:nearest neighbour 102 #if DEPTH_MAP_GENERATION 103 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 104 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ); 105 #else 106 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ); 107 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift ); 108 #endif 104 109 Void xPredInterLumaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 105 110 Void xPredInterChromaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 111 112 #if DEPTH_MAP_GENERATION 113 Void xWeightedAveragePdm ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); 114 #endif 106 115 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 116 117 107 118 Void xDCTIF_FilterC ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac); 108 119 … … 145 156 146 157 // inter 147 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false ); 158 #if DEPTH_MAP_GENERATION 159 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 160 #else 161 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 162 #endif 148 163 149 164 // motion vector prediction -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r5 r21 432 432 433 433 //===== get disparity ===== 434 Int iMidPosX = Int( uiXPos + ( ( uiBlkWidth - 1 ) >> 1 ) ) ;435 Int iMidPosY = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) ) ;434 Int iMidPosX = Int( uiXPos + ( ( uiBlkWidth - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX(); 435 Int iMidPosY = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpY(); 436 436 Int iDisparity = m_pcDepthMapGenerator->getDisparity( pcPic, iMidPosX, iMidPosY, uiBaseViewId ); 437 437 -
trunk/source/Lib/TLibCommon/TComRom.cpp
r5 r21 2815 2815 assert( uiWidth == uiHeight ); 2816 2816 2817 UChar uhStartX, uhStartY, uhEndX, uhEndY; 2818 Int iStepStartX, iStepStartY, iStepEndX, iStepEndY; 2819 2817 UChar uhStartX = 0, uhStartY = 0, uhEndX = 0, uhEndY = 0; 2818 Int iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0; 2820 2819 UInt uiBlockSize = 0; 2821 2820 switch( eWedgeRes ) -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r5 r21 66 66 m_iViewIdx = 0 ; 67 67 68 #if SONY_COLPIC_AVAILABILITY 69 m_iViewOrderIdx = 0; 70 #endif 71 68 72 initEqualRef(); 69 73 m_bNoBackPredFlag = false; … … 440 444 m_iPOC = pSrc->m_iPOC; 441 445 m_iViewIdx = pSrc->m_iViewIdx; 446 #if SONY_COLPIC_AVAILABILITY 447 m_iViewOrderIdx = pSrc->m_iViewOrderIdx; 448 #endif 442 449 #if DCM_DECODING_REFRESH 443 450 m_eNalUnitType = pSrc->m_eNalUnitType; … … 676 683 // AMVP parameter 677 684 ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); 685 686 #if ( HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX ) 678 687 m_bUseDMM = false; 688 #endif 679 689 } 680 690 -
trunk/source/Lib/TLibCommon/TComSlice.h
r5 r21 370 370 UInt m_uiPPSId; 371 371 Int m_iPOC; 372 #if SONY_COLPIC_AVAILABILITY 373 Int m_iViewOrderIdx; 374 #endif 372 375 #if DCM_DECODING_REFRESH 373 376 NalUnitType m_eNalUnitType; ///< Nal unit type for the slice … … 460 463 SliceType getSliceType () { return m_eSliceType; } 461 464 Int getPOC () { return m_iPOC; } 465 #if SONY_COLPIC_AVAILABILITY 466 Int getViewOrderIdx () { return m_iViewOrderIdx; } 467 #endif 462 468 Int getSliceQp () { return m_iSliceQp; } 463 469 Int getSliceQpDelta () { return m_iSliceQpDelta; } … … 495 501 Void setPPSId ( UInt u ) { m_uiPPSId = u; } 496 502 Void setPOC ( Int i ) { m_iPOC = i; } 503 #if SONY_COLPIC_AVAILABILITY 504 Void setViewOrderIdx ( Int i ) { m_iViewOrderIdx = i; } 505 #endif 497 506 #if DCM_DECODING_REFRESH 498 507 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r5 r21 300 300 } 301 301 302 #if DEPTH_MAP_GENERATION 303 Void TComYuv::copyPartToPartYuvPdm ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ) 304 { 305 copyPartToPartLumaPdm (pcYuvDst, uiPartIdx, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY ); 306 } 307 #endif 308 302 309 Void TComYuv::copyPartToPartYuv ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight ) 303 310 { … … 305 312 copyPartToPartChroma (pcYuvDst, uiPartIdx, iWidth>>1, iHeight>>1 ); 306 313 } 314 315 #if DEPTH_MAP_GENERATION 316 Void TComYuv::copyPartToPartLumaPdm ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ) 317 { 318 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpX; 319 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpY; 320 Pel* pSrc = getLumaAddr(uiPartIdx); 321 Pel* pDst = pcYuvDst->getLumaAddr() + uiBlkY * pcYuvDst->getStride() + uiBlkX; 322 323 if( pSrc == pDst ) 324 { 325 //th not a good idea 326 //th best would be to fix the caller 327 return ; 328 } 329 330 UInt iSrcStride = getStride(); 331 UInt iDstStride = pcYuvDst->getStride(); 332 for ( UInt y = iHeight; y != 0; y-- ) 333 { 334 ::memcpy( pDst, pSrc, iWidth * sizeof(Pel) ); 335 pSrc += iSrcStride; 336 pDst += iDstStride; 337 } 338 } 339 #endif 307 340 308 341 Void TComYuv::copyPartToPartLuma ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt iWidth, UInt iHeight ) … … 801 834 } 802 835 836 #if DEPTH_MAP_GENERATION 837 Void TComYuv::addAvgPdm( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ) 838 { 839 Int x, y; 840 841 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpX; 842 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpY; 843 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 844 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 845 Pel* pDstY = getLumaAddr() + uiBlkY * getStride() + uiBlkX; 846 847 UInt iSrc0Stride = pcYuvSrc0->getStride(); 848 UInt iSrc1Stride = pcYuvSrc1->getStride(); 849 UInt iDstStride = getStride(); 850 851 for ( y = iHeight-1; y >= 0; y-- ) 852 { 853 for ( x = iWidth-1; x >= 0; x-- ) 854 { 855 pDstY[x] = (pSrcY0[x] + pSrcY1[x] + 1) >> 1; 856 } 857 pSrcY0 += iSrc0Stride; 858 pSrcY1 += iSrc1Stride; 859 pDstY += iDstStride; 860 } 861 } 862 #endif 863 864 803 865 Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight ) 804 866 { -
trunk/source/Lib/TLibCommon/TComYuv.h
r5 r21 113 113 Void copyPartToPartLuma ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight ); 114 114 Void copyPartToPartChroma ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight ); 115 #if DEPTH_MAP_GENERATION 116 Void copyPartToPartYuvPdm ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ); 117 Void copyPartToPartLumaPdm ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ); 118 #endif 115 119 116 120 // ------------------------------------------------------------------------------------------------------------------ … … 135 139 #endif 136 140 Void addAvg ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight ); 141 #if DEPTH_MAP_GENERATION 142 Void addAvgPdm ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY ); 143 #endif 137 144 138 145 // Remove High frequency -
trunk/source/Lib/TLibCommon/TypeDef.h
r5 r21 40 40 41 41 42 43 #define SONY_COLPIC_AVAILABILITY 1 44 42 45 //>>>>> HHI 3DV tools >>>>> 43 46 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction … … 50 53 #define HHI_VSO_COLOR_PLANES 1 // view synthesis optimization in color planes 51 54 #define HHI_VSO_DIST_INT 1 // view synthesis optimization integer distorition in rdo process 55 #define HHI_VSO_LS_TABLE 1 // table based lambda scaling 52 56 53 57 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE && !HHI_INTERVIEW_SKIP … … 60 64 #define HHI_NO_LowDelayCoding 0 // old-fashioned encoder control, should be adapted to hm5.0 61 65 //<<<<< HHI 3DV tools <<<<< 66 62 67 63 68 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r5 r21 250 250 m_bIsDepth = false ; 251 251 m_iViewIdx = 0 ; 252 #if SONY_COLPIC_AVAILABILITY 253 m_iViewOrderIdx = 0; 254 #endif 252 255 #if ENC_DEC_TRACE 253 256 g_hTrace = fopen( "TraceDec.txt", "wb" ); … … 382 385 383 386 #if DEPTH_MAP_GENERATION 384 Bool bNeedPrdDepthMapBuffer = ( !pcSlice->getSPS()->isDepth() && ( pcSlice->getSPS()->getViewId() == 0 || pcSlice->getSPS()->getPredDepthMapGeneration() > 0 ) ); 387 UInt uiPdm = ( pcSlice->getSPS()->getViewId() ? pcSlice->getSPS()->getPredDepthMapGeneration() : m_pcTAppDecTop->getSPSAccess()->getPdm() ); 388 Bool bNeedPrdDepthMapBuffer = ( !pcSlice->getSPS()->isDepth() && uiPdm > 0 ); 385 389 #endif 386 390 … … 392 396 if( bNeedPrdDepthMapBuffer ) 393 397 { 394 rpcPic->addPrdDepthMapBuffer( );398 rpcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 395 399 } 396 400 #endif … … 426 430 if( bNeedPrdDepthMapBuffer && !rpcPic->getPredDepthMap() ) 427 431 { 428 rpcPic->addPrdDepthMapBuffer( );432 rpcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 429 433 } 430 434 #endif … … 593 597 m_apcSlicePilot->setSliceIdx(m_uiSliceIdx); 594 598 m_apcSlicePilot->setViewIdx( m_cSPS.getViewId() ); 599 #if SONY_COLPIC_AVAILABILITY 600 m_apcSlicePilot->setViewOrderIdx( m_cSPS.getViewOrderIdx()); 601 #endif 595 602 if (!m_bFirstSliceInPicture) 596 603 { … … 633 640 pcPic->setViewIdx( m_cSPS.getViewId() ); 634 641 642 #if SONY_COLPIC_AVAILABILITY 643 pcPic->setViewOrderIdx( m_cSPS.getViewOrderIdx() ); 644 #endif 645 635 646 /* transfer any SEI messages that have been received to the picture */ 636 647 pcPic->setSEIs(m_SEIs); … … 645 656 646 657 #if DEPTH_MAP_GENERATION 647 m_cDepthMapGenerator.create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement ); 658 UInt uiPdm = ( m_cSPS.getViewId() ? m_cSPS.getPredDepthMapGeneration() : getDecTop()->getSPSAccess()->getPdm() ); 659 m_cDepthMapGenerator.create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 660 TComDepthMapGenerator* pcDMG0 = getDecTop()->getDecTop0()->getDepthMapGenerator(); 661 if( m_cSPS.getViewId() == 1 && ( pcDMG0->getSubSampExpX() != PDM_SUB_SAMP_EXP_X(uiPdm) || pcDMG0->getSubSampExpY() != PDM_SUB_SAMP_EXP_Y(uiPdm) ) ) 662 { 663 pcDMG0->create( true, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 664 } 648 665 #endif 649 666 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 683 700 pcSlice->setTexturePic( pcTexturePic ); 684 701 pcSlice->setViewIdx( pcPic->getViewIdx() ); 702 #if SONY_COLPIC_AVAILABILITY 703 pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() ); 704 #endif 685 705 pcSlice->setRefPicListExplicitlyDecoderSided(m_cListPic, apcSpatRefPics) ;// temporary solution 686 706 -
trunk/source/Lib/TLibDecoder/TDecTop.h
r5 r21 140 140 Bool m_bIsDepth; 141 141 Int m_iViewIdx; 142 #if SONY_COLPIC_AVAILABILITY 143 Int m_iViewOrderIdx; 144 #endif 142 145 TAppDecTop* m_pcTAppDecTop; 143 146 CamParsCollector* m_pcCamParsCollector; … … 180 183 Void setViewIdx(Int i) { m_iViewIdx = i ;} 181 184 Int getViewIdx() { return m_iViewIdx ; } 185 #if SONY_COLPIC_AVAILABILITY 186 Void setViewOrderIdx(Int i) { m_iViewOrderIdx = i ;} 187 Int getViewOrderIdx() { return m_iViewOrderIdx ; } 188 #endif 182 189 183 190 Void setToDepth(Bool b) { m_bIsDepth = b ;} … … 187 194 188 195 TComList<TComPic*>* getListPic () { return &m_cListPic; } 189 TAppDecTop* getDecTop ( ){ return m_pcTAppDecTop ;}; 196 TAppDecTop* getDecTop ( ){ return m_pcTAppDecTop ;} 197 #if DEPTH_MAP_GENERATION 198 TComDepthMapGenerator* getDepthMapGenerator () { return &m_cDepthMapGenerator; } 199 #endif 190 200 191 201 Void setSPS (TComSPS cSPS ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r5 r21 355 355 #endif 356 356 357 #if SONY_COLPIC_AVAILABILITY 358 Int getViewOrderIdx () { return m_iViewOrderIdx; } 359 #endif 360 357 361 #if HHI_VSO 358 362 //==== VSO ========== -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r5 r21 149 149 rpcSlice->initSlice(); 150 150 rpcSlice->setPOC( pcPic->getPOC() ); 151 #if SONY_COLPIC_AVAILABILITY 152 rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx()); 153 #endif 151 154 152 155 // slice type -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r5 r21 92 92 m_cLoopFilter. create( g_uiMaxCUDepth ); 93 93 #if DEPTH_MAP_GENERATION 94 m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );94 m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 95 95 #endif 96 96 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 304 304 if( bNeedPrdDepthMapBuf && !pcPic->getPredDepthMap() ) 305 305 { 306 pcPic->addPrdDepthMapBuffer( );306 pcPic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 307 307 } 308 308 #endif … … 798 798 pcPic->setQP(max(MIN_QP,min(MAX_QP, m_iQP+ m_aiTLayerQPOffset[m_cSeqIter.getFrameDescriptor().getTEncSeqStructureLayer(m_uiViewId)] + iQpChangeOffset )) ); 799 799 pcPic->setViewIdx( m_uiViewId ); 800 #if SONY_COLPIC_AVAILABILITY 801 pcPic->setViewOrderIdx(m_iViewOrderIdx); 802 #endif 800 803 #if 0 801 804 pcPic->setNumRefs(0, REF_PIC_LIST_0);
Note: See TracChangeset for help on using the changeset viewer.