- Timestamp:
- 8 Apr 2015, 15:26:52 (10 years ago)
- Location:
- branches/HTM-14.0-dev0/source
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.0-dev0/source/App/TAppEncoder/TAppEncCfg.h
r1185 r1187 539 539 Int iSpace = max(1, ENC_CFG_CONSOUT_SPACE - (Int) description.length() ); 540 540 541 for ( Int i = 0; i < iSpace; i++ ) 541 for ( Int i = 0; i < iSpace; i++ ) 542 { 542 543 description.append( " " ); 544 } 543 545 544 546 description.append( ":" ); 545 547 printf( "%s", description.c_str() ); 546 548 547 for(Int i=0;i<rpcVector.size();i++) 549 for(Int i=0;i<rpcVector.size();i++) 550 { 548 551 xPrintVectorElem( rpcVector[i] ); 552 } 549 553 550 554 printf("\n"); -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/ContextTables.h
r1185 r1187 51 51 #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag 52 52 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 53 #if H_3D 53 54 #define NUM_DIS_FLAG_CTX 1 54 55 #define NUM_DIS_TYPE_CTX 1 56 #endif 55 57 #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended 56 58 #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r1185 r1187 153 153 m_pbDBBPFlag = NULL; 154 154 #endif 155 156 155 } 157 156 … … 957 956 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 958 957 #endif 959 960 961 958 #if H_3D_DIM 962 959 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 1095 1092 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1096 1093 #endif 1097 1098 1094 #if H_3D_ARP 1099 1095 m_puhARPW = pcCU->getARPW() + uiPart; … … 1102 1098 m_pbICFlag = pcCU->getICFlag() + uiPart; 1103 1099 #endif 1104 1105 1106 1100 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; 1107 1101 m_puhChromaIntraDir = pcCU->getChromaIntraDir() + uiPart; … … 1242 1236 #endif 1243 1237 #if H_3D_SPIVMP 1244 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1245 #endif 1246 1238 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1239 #endif 1247 1240 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1248 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 1249 1241 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 1250 1242 #if H_3D_ARP 1251 1243 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1252 #endif 1253 1254 1244 #endif 1255 1245 #if H_3D_DBBP 1256 1246 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiAbsPartIdx; … … 1300 1290 memcpy( m_piVSPFlag + uiOffset, pcCU->getVSPFlag(), sizeof( Char ) * uiNumPartition ); 1301 1291 memcpy( m_pDvInfo + uiOffset, pcCU->getDvInfo(), sizeof( *m_pDvInfo ) * uiNumPartition ); 1302 1303 1292 #endif 1304 1293 #if H_3D_SPIVMP … … 1316 1305 memcpy( m_puhCbf[1] + uiOffset, pcCU->getCbf(TEXT_CHROMA_U), iSizeInUchar ); 1317 1306 memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar ); 1318 1319 1320 1321 1307 #if H_3D_DIM 1322 1308 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 1415 1401 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1416 1402 #endif 1417 1418 1419 1403 memcpy( rpcCU->getPartitionSize() + m_uiAbsIdxInLCU, m_pePartSize, sizeof( *m_pePartSize ) * m_uiNumPartition ); 1420 1404 memcpy( rpcCU->getPredictionMode() + m_uiAbsIdxInLCU, m_pePredMode, sizeof( *m_pePredMode ) * m_uiNumPartition ); … … 1548 1532 memcpy( rpcCU->getCbf(TEXT_CHROMA_U) + uiPartOffset, m_puhCbf[1], iSizeInUchar ); 1549 1533 memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar ); 1550 1551 1552 1534 #if H_3D_DIM 1553 1535 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) … … 2284 2266 { 2285 2267 return NULL; 2286 } 2287 2268 } 2288 2269 #if H_3D_FCO 2289 2270 TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); … … 3850 3831 #endif 3851 3832 #if H_3D_ARP 3852 Bool bARPFlag = getARPW(uiAbsPartIdx) >0 ? true : false;3833 Bool bARPFlag = getARPW(uiAbsPartIdx) > 0; 3853 3834 #endif 3854 3835 #if H_3D_DBBP … … 3883 3864 m_mergCands[MRG_A1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc] 3884 3865 #if H_3D_VSP 3885 , 3886 (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3866 , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3887 3867 #if H_3D_IC 3888 3868 && !bICFlag … … 3907 3887 m_mergCands[MRG_B1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc] 3908 3888 #if H_3D_VSP 3909 , 3910 false 3889 , false 3911 3890 #endif 3912 3891 , false … … 3935 3914 m_mergCands[MRG_A0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc] 3936 3915 #if H_3D_VSP 3937 , 3938 false 3916 , false 3939 3917 #endif 3940 3918 , false … … 3949 3927 m_mergCands[MRG_B2].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc] 3950 3928 #if H_3D_VSP 3951 , 3952 false 3929 , false 3953 3930 #endif 3954 3931 , false … … 3977 3954 TComPic * pcTexPic = m_pcSlice->getTexturePic(); 3978 3955 #if H_3D_FCO 3979 #if H_3D_FCO3980 3956 if (pcTexPic && pcTexPic->getReconMark()) 3981 #else3982 if (pcTexturePic->getReconMark())3983 #endif3984 3957 { 3985 3958 #endif … … 4016 3989 Int iTexPosX, iTexPosY; 4017 3990 const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4018 3991 4019 3992 Int iCenterPosX = iCurrPosX + ( ( iWidth / iPUWidth ) >> 1 ) * iPUWidth + ( iPUWidth >> 1 ); 4020 3993 Int iCenterPosY = iCurrPosY + ( ( iHeight / iPUHeight ) >> 1 ) * iPUHeight + (iPUHeight >> 1); … … 4023 3996 if(iWidth == iPUWidth && iHeight == iPUHeight) 4024 3997 { 4025 4026 3998 iCenterPosX = iCurrPosX + (iWidth >> 1); 3999 iCenterPosY = iCurrPosY + (iHeight >> 1); 4027 4000 } 4028 4001 … … 4060 4033 if ( bSPIVMPFlag == true ) 4061 4034 { 4062 4063 4064 4065 4035 iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0); 4036 tmpDir = iInterDirSaved; 4037 tmpMV[0] = cMvFieldSaved[0]; 4038 tmpMV[1] = cMvFieldSaved[1]; 4066 4039 } 4067 4040 … … 4205 4178 if (!bRemoveSpa) 4206 4179 { 4207 Bool SPIVMPFlag = false;4180 Bool spiMvpFlag = false; 4208 4181 if(!m_pcSlice->getIsDepth()) 4209 4182 { 4210 SPIVMPFlag = true;4183 spiMvpFlag = true; 4211 4184 } 4212 4185 #if H_3D_DBBP 4213 SPIVMPFlag &= !bDBBPFlag;4214 #endif 4215 4216 m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);4186 spiMvpFlag &= !bDBBPFlag; 4187 #endif 4188 4189 m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, spiMvpFlag); 4217 4190 4218 4191 if ( mrgCandIdx == iCount ) … … 5319 5292 5320 5293 #if H_MV 5321 Void TComDataCU::checkM V_V(TComMv& rcMv, RefPicList eRefPicList, int iRefIdx )5294 Void TComDataCU::checkMvVertRest (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ) 5322 5295 { 5323 5296 if ( getSlice()->getSPS()->getInterViewMvVertConstraintFlag() ) … … 5685 5658 iScale = 4096; 5686 5659 if ( iCurrRefViewId != iCurrViewId && iColViewId != iColRefViewId ) 5660 { 5687 5661 iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId ); 5662 } 5688 5663 if ( bMRG && iScale != 4096 && m_pcSlice->getIvMvScalingFlag( ) ) 5689 5664 { … … 5862 5837 } 5863 5838 #endif 5839 5864 5840 #if H_3D_IV_MERGE 5865 5841 Void TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 5866 5842 { 5867 5868 5843 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N); 5869 5844 … … 5871 5846 if ( getSlice()->getDefaultRefViewIdxAvailableFlag() ) 5872 5847 { 5873 5874 5875 5876 5877 5878 5879 5880 5848 Int iViewIdx = getSlice()->getDefaultRefViewIdx(); 5849 pDisp->m_aVIdxCan = iViewIdx; 5850 Int iDisp = getSlice()->getDepthToDisparityB( iViewIdx )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepthY() - 1 )) ]; 5851 5852 cMv.setHor(iDisp); 5853 cMv.setVer(0); 5854 pDisp->m_acNBDV = cMv; 5855 pDisp->m_aVIdxCan = iViewIdx; 5881 5856 } 5882 5857 } … … 6037 6012 #endif 6038 6013 if (picDepth && bDepthRefine) 6014 { 6039 6015 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 6040 6016 } 6041 6017 pDInfo->m_acDoNBDV = cColMv; 6042 6018 #endif //H_3D_NBDV_REF … … 6121 6097 if (getSlice()->getDefaultRefViewIdxAvailableFlag()) 6122 6098 { 6123 6099 pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx(); 6124 6100 6125 6101 #if H_3D_NBDV_REF 6126 6102 TComPic* picDepth = NULL; 6127 6103 #if H_3D_FCO_VSP_DONBDV_E0163 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6104 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 6105 if ( picDepth->getPicYuvRec() != NULL ) 6106 { 6107 defaultDV.setZero(); 6108 } 6109 else // Go back with virtual depth 6110 { 6111 picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx()); 6112 } 6113 6114 assert(picDepth != NULL); 6139 6115 #else 6140 6141 #endif 6142 6143 6144 6145 6146 6116 picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx()); 6117 #endif 6118 if (picDepth && bDepthRefine) 6119 { 6120 estimateDVFromDM(getSlice()->getDefaultRefViewIdx(), uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view 6121 } 6122 pDInfo->m_acDoNBDV = defaultDV; 6147 6123 #endif 6148 6124 } … … 6236 6212 6237 6213 if (picDepth && bDepthRefine) 6214 { 6238 6215 estimateDVFromDM(refViewIdx, uiPartIdx, picDepth, uiPartAddr, &cMvPred ); 6239 6216 } 6240 6217 pNbDvInfo->m_acDoNBDV = cMvPred; 6241 6218 #endif … … 6657 6634 { 6658 6635 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 6659 Bool bLoop _stop = false;6660 for(Int iLoop = 0; iLoop < 2 && !bLoop _stop; ++iLoop)6636 Bool bLoopStop = false; 6637 for(Int iLoop = 0; iLoop < 2 && !bLoopStop; ++iLoop) 6661 6638 { 6662 6639 RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); … … 6684 6661 } 6685 6662 6686 bLoop _stop = true;6663 bLoopStop = true; 6687 6664 6688 6665 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx); … … 6916 6893 { 6917 6894 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 6918 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 6895 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 6896 { 6897 m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; 6898 } 6919 6899 } 6920 6900 #endif -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComDataCU.h
r1185 r1187 72 72 PartSize eVirtualPartSize; 73 73 UInt uiVirtualPartIndex; 74 } D BBPTmpData;74 } DbbpTmpData; 75 75 #endif 76 76 … … 173 173 #endif 174 174 #if H_3D_VSP 175 Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not 176 ///< 0: non-VSP; 1: VSP 175 Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not ///< 0: non-VSP; 1: VSP 177 176 #endif 178 177 #if H_3D_SPIVMP 179 Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP 180 ///< 0: non-SPIVMP; 1: SPIVMP 178 Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP 181 179 #endif 182 180 #if H_3D_ARP … … 194 192 Bool* m_pbSDCFlag; 195 193 Pel* m_apSegmentDCOffset[2]; 196 Pel m_apDmmPredictor[2];194 Pel m_apDmmPredictor[2]; 197 195 #endif 198 196 #endif 199 197 #if H_3D_DBBP 200 198 Bool* m_pbDBBPFlag; ///< array of DBBP flags 201 D BBPTmpData m_sDBBPTmpData;199 DbbpTmpData m_sDBBPTmpData; 202 200 #endif 203 201 #if H_3D … … 247 245 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 248 246 #if H_3D_TMVP 249 , 250 Bool bMRG = true 247 , Bool bMRG = true 251 248 #endif 252 249 ); … … 368 365 Void setDBBPFlag ( UInt uiIdx, Bool b ) { m_pbDBBPFlag[uiIdx] = b; } 369 366 Void setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 370 D BBPTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; }367 DbbpTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } 371 368 #endif 372 369 … … 596 593 Void clipMv ( TComMv& rcMv ); 597 594 #if H_MV 598 Void checkM V_V(TComMv& rcMv, RefPicList eRefPicList, int iRefIdx );595 Void checkMvVertRest (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ); 599 596 #endif 600 597 Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r1179 r1187 353 353 { 354 354 assert(frac >= 0 && frac < 4); 355 355 356 356 if ( frac == 0 ) 357 357 { … … 368 368 { 369 369 #endif 370 filterHor<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);370 filterHor<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 371 371 #if H_3D_ARP 372 372 } … … 436 436 { 437 437 assert(frac >= 0 && frac < 8); 438 438 439 439 if ( frac == 0 ) 440 440 { … … 451 451 { 452 452 #endif 453 filterHor<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]);453 filterHor<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]); 454 454 #if H_3D_ARP 455 455 } … … 478 478 { 479 479 assert(frac >= 0 && frac < 8); 480 480 481 481 if ( frac == 0 ) 482 482 { … … 493 493 { 494 494 #endif 495 filterVer<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]);495 filterVer<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]); 496 496 #if H_3D_ARP 497 497 } -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComMotionInfo.cpp
r1179 r1187 335 335 Int iStartPelY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIdx]]; 336 336 Int iEndPelX = iStartPelX + iWidth; 337 Int iEndPelY = iStartPelY + iHeight; 338 339 Int iCurrRaster, uiPartAddr; 337 Int iEndPelY = iStartPelY + iHeight; 340 338 341 339 for (Int i=iStartPelY; i<iEndPelY; i+=pcCU->getPic()->getMinCUHeight()) … … 343 341 for (Int j=iStartPelX; j < iEndPelX; j += pcCU->getPic()->getMinCUWidth()) 344 342 { 345 iCurrRaster = i / pcCU->getPic()->getMinCUHeight() * pcCU->getPic()->getNumPartInWidth() + j/pcCU->getPic()->getMinCUWidth();346 uiPartAddr = g_auiRasterToZscan[iCurrRaster];343 Int iCurrRaster = i / pcCU->getPic()->getMinCUHeight() * pcCU->getPic()->getNumPartInWidth() + j/pcCU->getPic()->getMinCUWidth(); 344 Int uiPartAddr = g_auiRasterToZscan[iCurrRaster]; 347 345 uiPartAddr -= pcCU->getZorderIdxInCU(); 348 346 -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComPic.cpp
r1179 r1187 415 415 #endif 416 416 417 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 418 419 for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++ ) 420 { 421 for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir ); iTextRefIdx++) 422 { 423 Int iTextRefPOC = pcTextSlice->getRefPOC( ( RefPicList )iTextRefDir, iTextRefIdx); 424 Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList )iTextRefDir, iTextRefIdx)->getViewIndex(); 425 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 426 Int iCurrRefDir = iTextRefDir; 427 for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++) 428 { 429 if( pcCurrSlice->getRefPOC( ( RefPicList )iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 430 pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId ) 431 { 432 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 417 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 418 419 for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++ ) 420 { 421 for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir ); iTextRefIdx++) 422 { 423 Int iTextRefPOC = pcTextSlice->getRefPOC( ( RefPicList )iTextRefDir, iTextRefIdx); 424 Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList )iTextRefDir, iTextRefIdx)->getViewIndex(); 425 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 426 Int iCurrRefDir = iTextRefDir; 427 for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++) 428 { 429 if( pcCurrSlice->getRefPOC( ( RefPicList )iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 430 pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId ) 431 { 432 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 433 } 433 434 } 434 435 } 435 } 436 437 } 436 437 } 438 438 #if H_3D_FCO 439 439 } 440 440 #endif 441 442 441 } 443 442 -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r1185 r1187 54 54 m_pDepthBlock = (Int*) malloc(MAX_NUM_SPU_W*MAX_NUM_SPU_W*sizeof(Int)); 55 55 if (m_pDepthBlock == NULL) 56 { 56 57 printf("ERROR: UKTGHU, No memory allocated.\n"); 58 } 57 59 #endif 58 60 } … … 62 64 #if H_3D_VSP 63 65 if (m_pDepthBlock != NULL) 64 free(m_pDepthBlock); 66 { 67 free(m_pDepthBlock); 68 } 65 69 m_cYuvDepthOnVsp.destroy(); 66 70 #endif … … 513 517 514 518 #if H_3D_DIM_DMM 515 if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; } 519 if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) 520 { 521 dmmSegmentation->destroy(); 522 delete dmmSegmentation; 523 } 516 524 #endif 517 525 } … … 635 643 // segmentation of texture block --> mask IDs 636 644 Pel* pDepthBlockStart = pDepthPels; 637 645 638 646 // first compute average of depth block for thresholding 639 647 Int iSumDepth = 0; … … 648 656 Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2); 649 657 Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2); 658 650 659 UInt t=0; 651 660 652 661 for (Int y=0; y<uiSize; y+=iSubSample) 653 662 { 654 663 for (Int x=0; x<uiSize; x+=iSubSample) 655 {656 if (iBlkX+x>iPictureWidth)657 {658 Int depthPel = pDepthPels[t];659 iSumDepth += depthPel;660 }661 else662 {663 Int depthPel = pDepthPels[x];664 t=x;665 iSumDepth += depthPel;666 }667 }668 664 { 665 if (iBlkX+x>iPictureWidth) 666 { 667 Int depthPel = pDepthPels[t]; 668 iSumDepth += depthPel; 669 } 670 else 671 { 672 Int depthPel = pDepthPels[x]; 673 t=x; 674 iSumDepth += depthPel; 675 } 676 } 677 669 678 // next row 670 679 if (!(iBlkY+y+4>iPictureHeight)) 671 pDepthPels += uiDepthStride*iSubSample; 672 } 673 680 { 681 pDepthPels += uiDepthStride*iSubSample; 682 } 683 } 684 674 685 Int iSizeInBits = g_aucConvertToBit[uiSize] - g_aucConvertToBit[iSubSample]; // respect sub-sampling factor 675 686 Int iMean = iSumDepth >> iSizeInBits*2; // iMean /= (uiSize*uiSize); 676 687 677 688 // start again for segmentation 678 689 pDepthPels = pDepthBlockStart; 679 690 680 691 // start mapping process 681 692 Int matchedPartSum[2][2] = {{0,0},{0,0}}; // counter for each part size and boolean option 682 693 PartSize virtualPartSizes[2] = { SIZE_Nx2N, SIZE_2NxN}; 683 694 684 695 UInt uiHalfSize = uiSize>>1; 685 696 for (Int y=0; y<uiSize; y+=iSubSample) … … 688 699 { 689 700 Int depthPel = 0; 690 if (iBlkX+x>iPictureWidth)691 {692 depthPel = pDepthPels[t];693 }694 else695 {696 depthPel = pDepthPels[x];697 t=x;698 }699 701 if (iBlkX+x>iPictureWidth) 702 { 703 depthPel = pDepthPels[t]; 704 } 705 else 706 { 707 depthPel = pDepthPels[x]; 708 t=x; 709 } 710 700 711 // decide which segment this pixel belongs to 701 712 Int ucSegment = (Int)(depthPel>iMean); 702 713 703 714 // Matched Filter to find optimal (conventional) partitioning 704 715 705 716 // SIZE_Nx2N 706 717 if(x<uiHalfSize) // left … … 712 723 matchedPartSum[0][1-ucSegment]++; 713 724 } 714 725 715 726 // SIZE_2NxN 716 727 if(y<uiHalfSize) // top … … 723 734 } 724 735 } 725 736 726 737 // next row 727 738 if (!(iBlkY+y+4>iPictureHeight)) 728 pDepthPels += uiDepthStride*iSubSample; 729 } 730 739 { 740 pDepthPels += uiDepthStride*iSubSample; 741 } 742 } 743 731 744 PartSize matchedPartSize = SIZE_NONE; 732 745 733 746 Int iMaxMatchSum = 0; 734 747 for(Int p=0; p<2; p++) // loop over partition … … 743 756 } 744 757 } 745 758 746 759 AOF( matchedPartSize != SIZE_NONE ); 747 760 748 761 return matchedPartSize; 749 762 } … … 761 774 uiMaxDepth = pDepthPels[ 0 ]; 762 775 iSumDepth = pDepthPels[ 0 ]; 763 UInt t=0;776 764 777 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(); 765 778 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); … … 835 848 836 849 // generate mask 850 UInt t=0; 837 851 UInt uiSumPix[2] = {0,0}; 838 852 for (Int y=0; y<uiHeight; y++) … … 952 966 } 953 967 954 if ( tmpTar ) { xFree(tmpTar); tmpTar = NULL; } 968 if ( tmpTar ) 969 { 970 xFree(tmpTar); 971 tmpTar = NULL; 972 } 955 973 956 974 // now combine chroma … … 1055 1073 } 1056 1074 1057 if ( tmpTarU ) { xFree(tmpTarU); tmpTarU = NULL; } 1058 if ( tmpTarV ) { xFree(tmpTarV); tmpTarV = NULL; } 1075 if( tmpTarU ) 1076 { 1077 xFree(tmpTarU); 1078 tmpTarU = NULL; 1079 } 1080 if ( tmpTarV ) 1081 { 1082 xFree(tmpTarV); 1083 tmpTarV = NULL; 1084 } 1059 1085 } 1060 1086 #endif … … 1243 1269 pcCU->clipMv(cMv); 1244 1270 #if H_MV 1245 pcCU->checkM V_V(cMv, eRefPicList, iRefIdx );1271 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); 1246 1272 #endif 1247 1273 #if H_3D_ARP … … 2367 2393 for( UInt k = 0; k < (patternStride * patternStride); k++ ) 2368 2394 { 2369 if( true == biSegPattern[k] ) { ptrDst[k] = valDC2; } 2370 else { ptrDst[k] = valDC1; } 2395 if( true == biSegPattern[k] ) 2396 { 2397 ptrDst[k] = valDC2; 2398 } 2399 else 2400 { 2401 ptrDst[k] = valDC1; 2402 } 2371 2403 } 2372 2404 } … … 2378 2410 for( UInt uiX = 0; uiX < patternStride; uiX++ ) 2379 2411 { 2380 if( true == biSegPattern[uiX] ) { piTemp[uiX] = valDC2; } 2381 else { piTemp[uiX] = valDC1; } 2412 if( true == biSegPattern[uiX] ) 2413 { 2414 piTemp[uiX] = valDC2; 2415 } 2416 else 2417 { 2418 piTemp[uiX] = valDC1; 2419 } 2382 2420 } 2383 2421 piTemp += dstStride; … … 2449 2487 Int iSumPix[2]; 2450 2488 memset(iSumPix, 0, sizeof(Int)*2); 2489 2451 2490 for( Int i = 0; i < uiNumSegments; i++ ) 2452 2491 { 2453 rpSegMeans[i] = 0; 2454 } 2455 if (orgDC == false) 2492 rpSegMeans[i] = 0; 2493 } 2494 2495 if ( !orgDC ) 2456 2496 { 2457 2497 Pel* pLeftTop = pOrig; … … 2473 2513 subSamplePix = 1; 2474 2514 } 2515 2475 2516 for (Int y=0; y<uiSize; y+=subSamplePix) 2476 2517 { … … 2492 2533 { 2493 2534 if( iSumPix[ucSeg] > 0 ) 2535 { 2494 2536 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 2537 } 2495 2538 else 2539 { 2496 2540 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 2541 } 2497 2542 } 2498 2543 } -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComPrediction.h
r1185 r1187 121 121 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 122 122 #endif 123 124 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 125 123 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 126 124 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 127 125 #if H_3D_IC -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComRdCost.cpp
r1185 r1187 2862 2862 UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ) 2863 2863 { 2864 Double dD; 2865 Int iTemp; 2866 2867 dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 2864 Double dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 2868 2865 2869 2866 Double dDepthWeight = ( pOrg[x] >= ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 ); 2870 2867 Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) ); 2871 iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5));2868 Int iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5)); 2872 2869 2873 2870 return (UInt) ( (iTemp*iTemp)>>1 ); -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComRom.cpp
r1185 r1187 104 104 if( !g_dmmWedgeLists.empty() ) 105 105 { 106 for( UInt ui = 0; ui < g_dmmWedgeLists.size(); ui++ ) { g_dmmWedgeLists[ui].clear(); } 106 for( UInt ui = 0; ui < g_dmmWedgeLists.size(); ui++ ) 107 { 108 g_dmmWedgeLists[ui].clear(); 109 } 107 110 g_dmmWedgeLists.clear(); 108 111 } 109 112 if( !g_dmmWedgeRefLists.empty() ) 110 113 { 111 for( UInt ui = 0; ui < g_dmmWedgeRefLists.size(); ui++ ) { g_dmmWedgeRefLists[ui].clear(); } 114 for( UInt ui = 0; ui < g_dmmWedgeRefLists.size(); ui++ ) 115 { 116 g_dmmWedgeRefLists[ui].clear(); 117 } 112 118 g_dmmWedgeRefLists.clear(); 113 119 } … … 115 121 if( !g_dmmWedgeNodeLists.empty() ) 116 122 { 117 for( UInt ui = 0; ui < g_dmmWedgeNodeLists.size(); ui++ ) { g_dmmWedgeNodeLists[ui].clear(); } 123 for( UInt ui = 0; ui < g_dmmWedgeNodeLists.size(); ui++ ) 124 { 125 g_dmmWedgeNodeLists[ui].clear(); 126 } 118 127 g_dmmWedgeNodeLists.clear(); 119 128 } -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComRom.h
r1179 r1187 290 290 291 291 #if H_MV_ENC_DEC_TRAC 292 #define DTRACE_CU(x,y) 293 #define DTRACE_PU(x,y) 294 #define DTRACE_TU(x,y) 295 296 #define DTRACE_CU_S(x) 297 #define DTRACE_PU_S(x) 298 #define DTRACE_TU_S(x) 292 #define DTRACE_CU(x,y) ; 293 #define DTRACE_PU(x,y) ; 294 #define DTRACE_TU(x,y) ; 295 296 #define DTRACE_CU_S(x) ; 297 #define DTRACE_PU_S(x) ; 298 #define DTRACE_TU_S(x) ; 299 299 300 300 #endif -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r1185 r1187 2721 2721 } 2722 2722 2723 #if H_3D 2724 Void TComVPS::initViewCompLayer() 2725 { 2726 assert( m_viewCompLayerId.size() == 0 && m_viewCompLayerPresentFlag.size() == 0 ); 2727 for( Int i = 0; i < getNumViews(); i++ ) 2728 { 2729 m_viewCompLayerId .push_back( std::vector<Int>(0) ); 2730 m_viewCompLayerPresentFlag.push_back( std::vector<Bool>(0) ); 2731 2732 for( Int depFlag = 0; depFlag <= 1; depFlag++ ) 2733 { 2734 Int iViewOIdx = getViewOIdxList( i ); 2735 Int layerId = -1; 2736 for( Int j = 0; j <= getMaxLayersMinus1(); j++ ) 2737 { 2738 Int jNuhLId = getLayerIdInNuh( j ); 2739 if( getVpsDepthFlag( jNuhLId ) == ( (Bool) depFlag ) && getViewOrderIdx( jNuhLId ) == iViewOIdx 2740 && getDependencyId( jNuhLId ) == 0 && getAuxId( jNuhLId ) == 0 ) 2741 { 2742 layerId = jNuhLId; 2743 } 2744 } 2745 m_viewCompLayerPresentFlag[ i ].push_back( layerId != -1 ); 2746 m_viewCompLayerId [ i ].push_back( layerId ); 2747 } 2748 } 2749 } 2750 2751 Int TComVPS::getVoiInVps(Int viewOIdx) 2752 { 2753 for ( Int i = 0; i < m_viewOIdxList.size(); i++ ) 2754 { 2755 if ( m_viewOIdxList[ i ] == viewOIdx ) 2756 { 2757 return i; 2758 } 2759 } 2760 assert( 0 ); 2761 return -1; 2762 } 2763 2764 Void TComVPS::deriveCpPresentFlag() 2765 { 2766 for( Int nInVps = 0; nInVps < getNumViews(); nInVps++ ) 2767 { 2768 for( Int mInVps = 0; mInVps < getNumViews(); mInVps++ ) 2769 { 2770 m_cpPresentFlag[nInVps][mInVps] = 0; 2771 } 2772 } 2773 2774 for( Int n = 1; n < getNumViews(); n++ ) 2775 { 2776 Int iInVps = getVoiInVps( getViewOIdxList( n ) ); 2777 for( Int m = 0; m < getNumCp( iInVps ); m++ ) 2778 { 2779 m_cpPresentFlag[ iInVps ][ getVoiInVps( getCpRefVoi( iInVps, m ) ) ] = 1; 2780 } 2781 } 2782 } 2783 #endif 2723 2784 2724 2785 #endif // H_MV … … 3824 3885 } 3825 3886 #endif 3887 3826 3888 #if H_3D_IC 3889 // This is an encoder only function and should be moved to TEncSlice or TEncSearch!! 3827 3890 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc) 3828 3891 { … … 3888 3951 } 3889 3952 else 3890 { 3891 Int iMaxPelValue = ( 1 << g_bitDepthY ); 3892 Int *aiRefOrgHist; 3893 Int *aiCurrHist; 3894 aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 3895 aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); 3896 memset( aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 3897 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 3898 // Reference Idx Number 3899 Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 ); 3900 TComPic* pcCurrPic = NULL; 3901 TComPic* pcRefPic = NULL; 3902 TComPicYuv* pcCurrPicYuv = NULL; 3903 TComPicYuv* pcRefPicYuvOrg = NULL; 3904 pcCurrPic = getPic(); 3905 pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 3906 Int iWidth = pcCurrPicYuv->getWidth(); 3907 Int iHeight = pcCurrPicYuv->getHeight(); 3908 3909 3910 // Get InterView Reference picture 3911 // !!!!! Assume only one Interview Reference Picture in L0 3912 for ( Int i = 0; i < iNumRefIdx; i++ ) 3913 { 3914 pcRefPic = getRefPic( REF_PIC_LIST_0, i ); 3915 if ( pcRefPic != NULL ) 3916 { 3917 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 3918 { 3919 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 3920 } 3921 } 3922 } 3923 3924 if ( pcRefPicYuvOrg != NULL ) 3925 { 3926 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 3927 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 3928 Int iCurrStride = pcCurrPicYuv->getStride(); 3929 Int iRefStride = pcRefPicYuvOrg->getStride(); 3930 Int iSumOrgSAD = 0; 3931 Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05; 3932 3933 // Histogram building - luminance 3934 for ( Int y = 0; y < iHeight; y++ ) 3935 { 3936 for ( Int x = 0; x < iWidth; x++ ) 3937 { 3938 aiCurrHist[pCurrY[x]]++; 3939 aiRefOrgHist[pRefOrgY[x]]++; 3940 } 3941 pCurrY += iCurrStride; 3942 pRefOrgY += iRefStride; 3943 } 3944 // Histogram SAD 3945 for ( Int i = 0; i < iMaxPelValue; i++ ) 3946 { 3947 iSumOrgSAD += abs( aiCurrHist[i] - aiRefOrgHist[i] ); 3948 } 3949 // Setting 3950 if ( iSumOrgSAD > Int( dThresholdOrgSAD * iWidth * iHeight ) ) 3951 { 3952 m_bApplyIC = true; 3953 } 3954 else 3955 { 3956 m_bApplyIC = false; 3957 } 3958 } 3959 3960 xFree( aiCurrHist ); 3961 xFree( aiRefOrgHist ); 3962 aiCurrHist = NULL; 3963 aiRefOrgHist = NULL; 3953 { 3954 TComPic* pcCurrPic = getPic(); 3955 TComPicYuv* pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 3956 3957 // Get InterView Reference picture 3958 // !!!!! Assume only one Interview Reference Picture in L0 3959 // GT: Is this assumption correct? 3960 3961 TComPicYuv* pcRefPicYuvOrg = NULL; 3962 for ( Int i = 0; i < getNumRefIdx( REF_PIC_LIST_0 ); i++ ) 3963 { 3964 TComPic* pcRefPic = getRefPic( REF_PIC_LIST_0, i ); 3965 if ( pcRefPic != NULL ) 3966 { 3967 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 3968 { 3969 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 3970 } 3971 } 3972 } 3973 3974 if ( pcRefPicYuvOrg != NULL ) 3975 { 3976 // Histogram building - luminance 3977 Int iMaxPelValue = ( 1 << g_bitDepthY ); 3978 Int *aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 3979 Int *aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); 3980 memset( aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 3981 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 3982 3983 Int iWidth = pcCurrPicYuv->getWidth(); 3984 Int iHeight = pcCurrPicYuv->getHeight(); 3985 3986 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 3987 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 3988 Int iCurrStride = pcCurrPicYuv->getStride(); 3989 Int iRefStride = pcRefPicYuvOrg->getStride(); 3990 3991 for ( Int y = 0; y < iHeight; y++ ) 3992 { 3993 for ( Int x = 0; x < iWidth; x++ ) 3994 { 3995 aiCurrHist[pCurrY[x]]++; 3996 aiRefOrgHist[pRefOrgY[x]]++; 3997 } 3998 pCurrY += iCurrStride; 3999 pRefOrgY += iRefStride; 4000 } 4001 4002 // Histogram SAD 4003 Int iSumOrgSAD = 0; 4004 for ( Int i = 0; i < iMaxPelValue; i++ ) 4005 { 4006 iSumOrgSAD += abs( aiCurrHist[i] - aiRefOrgHist[i] ); 4007 } 4008 4009 // Setting 4010 Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05; 4011 4012 if ( iSumOrgSAD > Int( dThresholdOrgSAD * iWidth * iHeight ) ) 4013 { 4014 m_bApplyIC = true; 4015 } 4016 else 4017 { 4018 m_bApplyIC = false; 4019 } 4020 4021 xFree( aiCurrHist ); 4022 xFree( aiRefOrgHist ); 4023 } 3964 4024 }//if(bUseLowLatencyICEnc) 3965 4025 } … … 4136 4196 #endif 4137 4197 } 4198 4199 Void TComSlice::deriveInCmpPredAndCpAvailFlag() 4200 { 4201 Int numCurCmpLIds = getIsDepth() ? 1 : getNumActiveRefLayerPics(); 4202 std::vector<Int> curCmpLIds; 4203 if ( getIsDepth() ) 4204 { 4205 curCmpLIds.push_back( getLayerId() ); 4206 } 4207 else 4208 { 4209 for (Int i = 0; i < numCurCmpLIds; i++) 4210 { 4211 curCmpLIds.push_back( getRefPicLayerId( i ) ); 4212 } 4213 } 4214 4215 m_cpAvailableFlag = true; 4216 m_inCmpRefViewIdcs.clear(); 4217 Bool allRefCmpLayersAvailFlag = true; 4218 4219 for( Int i = 0; i <= numCurCmpLIds - 1; i++ ) 4220 { 4221 m_inCmpRefViewIdcs.push_back( getVPS()->getViewOrderIdx( curCmpLIds[ i ] )); 4222 if( !getVPS()->getCpPresentFlag( getVPS()->getVoiInVps( getViewIndex() ), getVPS()->getVoiInVps( m_inCmpRefViewIdcs[ i ] ) ) ) 4223 { 4224 m_cpAvailableFlag = false; 4225 } 4226 Bool refCmpCurLIdAvailFlag = false; 4227 if( getVPS()->getViewCompLayerPresentFlag( m_inCmpRefViewIdcs[ i ], !getIsDepth() ) ) 4228 { 4229 Int j = getVPS()->getLayerIdInVps( getVPS()->getViewCompLayerId( m_inCmpRefViewIdcs[ i ], !getIsDepth() ) ); 4230 if ( getVPS()->getDirectDependencyFlag( getVPS()->getLayerIdInVps( getLayerId() ) , j ) && 4231 getVPS()->getSubLayersVpsMaxMinus1( j ) >= getTemporalId() && 4232 ( getTemporalId() == 0 || getVPS()->getMaxTidIlRefPicsPlus1( j , getVPS()->getLayerIdInVps( getLayerId() ) ) > getTemporalId() ) 4233 ) 4234 { 4235 refCmpCurLIdAvailFlag = true; 4236 } 4237 } 4238 if( !refCmpCurLIdAvailFlag ) 4239 { 4240 allRefCmpLayersAvailFlag = false; 4241 } 4242 } 4243 4244 if( !allRefCmpLayersAvailFlag ) 4245 { 4246 m_inCmpPredAvailFlag = false; 4247 } 4248 else 4249 { 4250 TComSps3dExtension* sps3dExt = getSPS()->getSps3dExtension(); 4251 if( !getIsDepth() ) 4252 { 4253 m_inCmpPredAvailFlag = sps3dExt->getViewSynthesisPredFlag( getIsDepth() ) || 4254 sps3dExt->getDepthBasedBlkPartFlag( getIsDepth() ) || 4255 sps3dExt->getDepthRefinementFlag ( getIsDepth() ); 4256 } 4257 else 4258 { 4259 m_inCmpPredAvailFlag = sps3dExt->getIntraContourFlag( getIsDepth() ) || 4260 sps3dExt->getQtPredFlag( getIsDepth() ) || 4261 sps3dExt->getMpiFlag( getIsDepth() ); 4262 } 4263 } 4264 } 4265 4266 Void TComSlice::checkInCompPredRefLayers() 4267 { 4268 if ( getInCompPredFlag() ) 4269 { 4270 for (Int i = 0; i < getNumCurCmpLIds(); i++ ) 4271 { 4272 assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL ); 4273 // It is a requirement of bitstream conformance that there 4274 // is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture, 4275 // and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ]. 4276 } 4277 } 4278 } 4279 4138 4280 #endif 4139 4281 -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TComSlice.h
r1185 r1187 912 912 Int xGetDimBitOffset( Int j ); 913 913 Void xSetRefLayerFlags( Int currLayerId ); 914 914 915 // VPS EXTENSION 2 SYNTAX ELEMENTS 915 916 #if H_3D … … 1011 1012 Void setVpsNonVuiExtensionLength( Int val ) { m_vpsNonVuiExtensionLength = val; } 1012 1013 Int getVpsNonVuiExtensionLength( ) { return m_vpsNonVuiExtensionLength; } 1013 1014 1015 // VPS Extension 1014 1016 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } 1015 1017 Bool getSplittingFlag() { return m_splittingFlag; } … … 1154 1156 Void initNumViews(); 1155 1157 #if H_3D 1156 Void initViewCompLayer( ) 1157 { 1158 assert( m_viewCompLayerId.size() == 0 && m_viewCompLayerPresentFlag.size() == 0 ); 1159 for( Int i = 0; i < getNumViews(); i++ ) 1160 { 1161 m_viewCompLayerId .push_back( std::vector<Int>(0) ); 1162 m_viewCompLayerPresentFlag.push_back( std::vector<Bool>(0) ); 1163 1164 for( Int depFlag = 0; depFlag <= 1; depFlag++ ) 1165 { 1166 Int iViewOIdx = getViewOIdxList( i ); 1167 Int layerId = -1; 1168 for( Int j = 0; j <= getMaxLayersMinus1(); j++ ) 1169 { 1170 Int jNuhLId = getLayerIdInNuh( j ); 1171 if( getVpsDepthFlag( jNuhLId ) == ( (Bool) depFlag ) && getViewOrderIdx( jNuhLId ) == iViewOIdx 1172 && getDependencyId( jNuhLId ) == 0 && getAuxId( jNuhLId ) == 0 ) 1173 { 1174 layerId = jNuhLId; 1175 } 1176 } 1177 m_viewCompLayerPresentFlag[ i ].push_back( layerId != -1 ); 1178 m_viewCompLayerId [ i ].push_back( layerId ); 1179 } 1180 } 1181 }; 1182 1183 1158 Void initViewCompLayer( ); 1184 1159 Int getViewOIdxList( Int i ) { return m_viewOIdxList[i]; } 1185 1160 std::vector<Int> getViewOIdxList( ) { return m_viewOIdxList; } 1186 1161 1187 Int getVoiInVps( Int viewOIdx ) 1188 { 1189 for ( Int i = 0; i < m_viewOIdxList.size(); i++ ) 1190 { 1191 if ( m_viewOIdxList[ i ] == viewOIdx ) 1192 { 1193 return i; 1194 } 1195 } 1196 assert( 0 ); 1197 return -1; 1198 }; 1162 Int getVoiInVps( Int viewOIdx );; 1199 1163 1200 1164 Bool getViewCompLayerPresentFlag (Int i, Bool d ) { return m_viewCompLayerPresentFlag[ getVoiInVps(i) ][d]; } … … 1349 1313 1350 1314 // Derived 1351 Void deriveCpPresentFlag( ) 1352 { 1353 for( Int nInVps = 0; nInVps < getNumViews(); nInVps++ ) 1354 { 1355 for( Int mInVps = 0; mInVps < getNumViews(); mInVps++ ) 1356 { 1357 m_cpPresentFlag[nInVps][mInVps] = 0; 1358 } 1359 } 1360 1361 for( Int n = 1; n < getNumViews(); n++ ) 1362 { 1363 Int iInVps = getVoiInVps( getViewOIdxList( n ) ); 1364 for( Int m = 0; m < getNumCp( iInVps ); m++ ) 1365 { 1366 m_cpPresentFlag[ iInVps ][ getVoiInVps( getCpRefVoi( iInVps, m ) ) ] = 1; 1367 } 1368 } 1369 } 1315 Void deriveCpPresentFlag( ); 1370 1316 1371 1317 Void setCpPresentFlag( Int i, Int m, Bool flag ) { m_cpPresentFlag[i][m] = flag; } … … 2480 2426 Bool m_bApplyDIS; 2481 2427 #if H_3D_IC 2482 Int *m_aICEnableCandidate;2483 Int *m_aICEnableNum;2428 Int* m_aICEnableCandidate; 2429 Int* m_aICEnableNum; 2484 2430 #endif 2485 2431 Int m_iDefaultRefViewIdx; … … 2930 2876 #if H_3D 2931 2877 // 3D-HEVC tool parameters 2932 Void deriveInCmpPredAndCpAvailFlag() 2933 { 2934 Int numCurCmpLIds = getIsDepth() ? 1 : getNumActiveRefLayerPics(); 2935 std::vector<Int> curCmpLIds; 2936 if ( getIsDepth() ) 2937 { 2938 curCmpLIds.push_back( getLayerId() ); 2939 } 2940 else 2941 { 2942 for (Int i = 0; i < numCurCmpLIds; i++) 2943 { 2944 curCmpLIds.push_back( getRefPicLayerId( i ) ); 2945 } 2946 } 2947 2948 m_cpAvailableFlag = true; 2949 m_inCmpRefViewIdcs.clear(); 2950 Bool allRefCmpLayersAvailFlag = true; 2951 2952 for( Int i = 0; i <= numCurCmpLIds - 1; i++ ) 2953 { 2954 m_inCmpRefViewIdcs.push_back( getVPS()->getViewOrderIdx( curCmpLIds[ i ] )); 2955 if( !getVPS()->getCpPresentFlag( getVPS()->getVoiInVps( getViewIndex() ), getVPS()->getVoiInVps( m_inCmpRefViewIdcs[ i ] ) ) ) 2956 { 2957 m_cpAvailableFlag = false; 2958 } 2959 Bool refCmpCurLIdAvailFlag = false; 2960 if( getVPS()->getViewCompLayerPresentFlag( m_inCmpRefViewIdcs[ i ], !getIsDepth() ) ) 2961 { 2962 Int j = getVPS()->getLayerIdInVps( getVPS()->getViewCompLayerId( m_inCmpRefViewIdcs[ i ], !getIsDepth() ) ); 2963 if ( getVPS()->getDirectDependencyFlag( getVPS()->getLayerIdInVps( getLayerId() ) , j ) && 2964 getVPS()->getSubLayersVpsMaxMinus1( j ) >= getTemporalId() && 2965 ( getTemporalId() == 0 || getVPS()->getMaxTidIlRefPicsPlus1( j , getVPS()->getLayerIdInVps( getLayerId() ) ) > getTemporalId() ) 2966 ) 2967 { 2968 refCmpCurLIdAvailFlag = true; 2969 } 2970 } 2971 if( !refCmpCurLIdAvailFlag ) 2972 { 2973 allRefCmpLayersAvailFlag = false; 2974 } 2975 } 2976 2977 if( !allRefCmpLayersAvailFlag ) 2978 { 2979 m_inCmpPredAvailFlag = false; 2980 } 2981 else 2982 { 2983 TComSps3dExtension* sps3dExt = getSPS()->getSps3dExtension(); 2984 if( !getIsDepth() ) 2985 { 2986 m_inCmpPredAvailFlag = sps3dExt->getViewSynthesisPredFlag( getIsDepth() ) || 2987 sps3dExt->getDepthBasedBlkPartFlag( getIsDepth() ) || 2988 sps3dExt->getDepthRefinementFlag ( getIsDepth() ); 2989 } 2990 else 2991 { 2992 m_inCmpPredAvailFlag = sps3dExt->getIntraContourFlag( getIsDepth() ) || 2993 sps3dExt->getQtPredFlag( getIsDepth() ) || 2994 sps3dExt->getMpiFlag( getIsDepth() ); 2995 } 2996 } 2997 }; 2998 2999 2878 Void deriveInCmpPredAndCpAvailFlag(); 3000 2879 Void init3dToolParameters(); 3001 Void checkInCompPredRefLayers() 3002 { 3003 if ( getInCompPredFlag() ) 3004 { 3005 for (Int i = 0; i < getNumCurCmpLIds(); i++ ) 3006 { 3007 assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL ); 3008 // It is a requirement of bitstream conformance that there 3009 // is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture, 3010 // and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ]. 3011 } 3012 } 3013 }; 2880 Void checkInCompPredRefLayers();; 3014 2881 3015 2882 Bool getIvMvPredFlag ( ) { return m_ivMvPredFlag ; }; -
branches/HTM-14.0-dev0/source/Lib/TLibCommon/TypeDef.h
r1185 r1187 306 306 #define H_3D_DISABLE_CHROMA 1 307 307 #define H_3D_OUTPUT_ACTIVE_TOOLS 0 308 #define H_3D_REN_MAX_DEV_OUT 0 308 309 #endif 309 310 -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1185 r1187 2397 2397 if( rpcSlice->getSPS()->getChromaFormatIdc() != 0 ) 2398 2398 { 2399 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);2400 }2399 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 2400 } 2401 2401 else 2402 2402 { 2403 2403 rpcSlice->setSaoEnabledFlagChroma( false ); 2404 2404 } 2405 2406 2405 #else 2407 2406 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r1185 r1187 593 593 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 594 594 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 595 595 596 596 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 597 597 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); … … 601 601 bBoundary = true; 602 602 } 603 603 604 604 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 605 605 { … … 611 611 uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; 612 612 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 613 613 614 614 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 615 615 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) … … 617 617 xDecompressCU(pcCU, uiIdx, uiNextDepth ); 618 618 } 619 619 620 620 uiIdx += uiQNumParts; 621 621 } … … 625 625 // Residual reconstruction 626 626 m_ppcYuvResi[uiDepth]->clear(); 627 627 628 628 m_ppcCU[uiDepth]->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); 629 629 630 630 switch( m_ppcCU[uiDepth]->getPredictionMode(0) ) 631 631 { 632 632 case MODE_INTER: 633 633 #if H_3D_DBBP 634 635 636 637 638 639 634 if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) 635 { 636 xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 637 } 638 else 639 { 640 640 #endif 641 641 #if H_3D_INTER_SDC … … 647 647 { 648 648 #endif 649 xReconInter( m_ppcCU[uiDepth], uiDepth );649 xReconInter( m_ppcCU[uiDepth], uiDepth ); 650 650 #if H_3D_INTER_SDC 651 651 } 652 652 #endif 653 653 #if H_3D_DBBP 654 655 #endif 656 657 654 } 655 #endif 656 break; 657 case MODE_INTRA: 658 658 #if H_3D 659 660 661 662 659 if( m_ppcCU[uiDepth]->getDISFlag(0) ) 660 { 661 xReconDIS( m_ppcCU[uiDepth], 0, uiDepth ); 662 } 663 663 #if H_3D_DIM_SDC 664 665 666 667 668 #endif 669 664 else if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 665 { 666 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 667 } 668 #endif 669 else 670 670 #endif 671 671 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 672 673 674 675 672 break; 673 default: 674 assert(0); 675 break; 676 676 } 677 677 if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) … … 679 679 xFillPCMBuffer(m_ppcCU[uiDepth], uiDepth); 680 680 } 681 681 682 682 xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); 683 683 } … … 847 847 AOF(bValidMask); 848 848 849 D BBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData();849 DbbpTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 850 850 TComYuv* apSegPredYuv[2] = { m_ppcYuvReco[uiDepth], m_ppcYuvRecoDBBP[uiDepth] }; 851 851 -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r1186 r1187 220 220 #endif 221 221 #if H_3D_SPIVMP 222 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 223 TComMvField* pcMvFieldSP; 224 UChar* puhInterDirSP; 225 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 226 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 222 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 223 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 224 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 227 225 #endif 228 226 for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ ) … … 489 487 } 490 488 } 491 #if H_3D_ARP492 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth );493 #endif494 #if H_3D_IC495 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );496 #endif497 489 } 498 490 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) … … 735 727 if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) 736 728 { 737 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )738 {739 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );740 }741 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )742 {743 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );744 }745 }746 else747 {729 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) 730 { 731 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); 732 } 733 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) 734 { 735 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); 736 } 737 } 738 else 739 { 748 740 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) 749 741 { -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r1185 r1187 446 446 UInt uiSymbol; 447 447 448 448 m_pcTDecBinIf->decodeBinTrm(uiSymbol); 449 449 450 450 #if H_MV_ENC_DEC_TRAC 451 452 #endif 453 454 451 DTRACE_CU("pcm_flag", uiSymbol) 452 #endif 453 if (uiSymbol) 454 { 455 455 Bool bIpcmFlag = true; 456 456 … … 485 485 piPCMSample += uiWidth; 486 486 } 487 488 489 487 #if H_3D_DISABLE_CHROMA 490 488 if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) 491 489 { 492 490 #endif 493 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;494 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;495 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;496 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();497 498 for(uiY = 0; uiY < uiHeight; uiY++)499 {500 for(uiX = 0; uiX < uiWidth; uiX++)501 {502 UInt uiSample;503 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample);504 piPCMSample[uiX] = uiSample;505 }506 piPCMSample += uiWidth;507 }508 509 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;510 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;511 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;512 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();513 514 for(uiY = 0; uiY < uiHeight; uiY++)515 {516 for(uiX = 0; uiX < uiWidth; uiX++)517 {518 UInt uiSample;519 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample);520 piPCMSample[uiX] = uiSample;521 }522 piPCMSample += uiWidth;523 }491 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset; 492 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; 493 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 494 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 495 496 for(uiY = 0; uiY < uiHeight; uiY++) 497 { 498 for(uiX = 0; uiX < uiWidth; uiX++) 499 { 500 UInt uiSample; 501 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 502 piPCMSample[uiX] = uiSample; 503 } 504 piPCMSample += uiWidth; 505 } 506 507 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset; 508 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; 509 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 510 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 511 512 for(uiY = 0; uiY < uiHeight; uiY++) 513 { 514 for(uiX = 0; uiX < uiWidth; uiX++) 515 { 516 UInt uiSample; 517 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 518 piPCMSample[uiX] = uiSample; 519 } 520 piPCMSample += uiWidth; 521 } 524 522 #if H_3D_DISABLE_CHROMA 525 523 } 526 524 #endif 527 528 529 525 m_pcTDecBinIf->start(); 530 526 } … … 707 703 #if H_3D_QTLPC 708 704 Bool bParseSplitFlag = true; 709 710 711 705 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag(); 712 706 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); … … 745 739 #endif 746 740 pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx ); 747 741 748 742 return; 749 743 } … … 762 756 #if H_3D_QTLPC 763 757 Bool bParsePartSize = true; 764 758 765 759 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag(); 766 760 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); … … 794 788 #endif 795 789 796 790 797 791 if ( pcCU->isIntra( uiAbsPartIdx ) ) 798 792 { … … 801 795 { 802 796 #endif 803 uiSymbol = 1;797 uiSymbol = 1; 804 798 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 805 799 { … … 834 828 { 835 829 #endif 836 UInt uiMaxNumBits = 2; 837 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) ) 838 { 839 uiMaxNumBits ++; 840 } 841 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 842 { 843 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 844 if ( uiSymbol ) 845 { 846 break; 847 } 848 uiMode++; 849 } 850 eMode = (PartSize) uiMode; 851 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 852 { 853 if (eMode == SIZE_2NxN) 854 { 855 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 856 if (uiSymbol == 0) 830 UInt uiMaxNumBits = 2; 831 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) ) 832 { 833 uiMaxNumBits ++; 834 } 835 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 836 { 837 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 838 if ( uiSymbol ) 857 839 { 858 m_pcTDecBinIf->decodeBinEP(uiSymbol); 859 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 840 break; 860 841 } 861 } 862 else if (eMode == SIZE_Nx2N) 863 { 864 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 865 if (uiSymbol == 0) 842 uiMode++; 843 } 844 eMode = (PartSize) uiMode; 845 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 846 { 847 if (eMode == SIZE_2NxN) 866 848 { 867 m_pcTDecBinIf->decodeBinEP(uiSymbol); 868 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 849 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 850 if (uiSymbol == 0) 851 { 852 m_pcTDecBinIf->decodeBinEP(uiSymbol); 853 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 854 } 869 855 } 870 } 871 } 856 else if (eMode == SIZE_Nx2N) 857 { 858 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 859 if (uiSymbol == 0) 860 { 861 m_pcTDecBinIf->decodeBinEP(uiSymbol); 862 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 863 } 864 } 865 } 872 866 #if H_3D_QTLPC 873 867 } … … 995 989 { 996 990 #endif 997 m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) );998 mpmPred[j] = symbol;991 m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) ); 992 mpmPred[j] = symbol; 999 993 #if H_MV_ENC_DEC_TRAC 1000 DTRACE_CU("prev_intra_luma_pred_flag", symbol)994 DTRACE_CU("prev_intra_luma_pred_flag", symbol) 1001 995 #endif 1002 996 #if H_3D_DIM … … 1010 1004 { 1011 1005 #endif 1012 Int preds[3] = {-1, -1, -1}; 1013 Int predNum = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds); 1014 if (mpmPred[j]) 1015 { 1016 m_pcTDecBinIf->decodeBinEP( symbol ); 1017 if (symbol) 1006 Int preds[3] = {-1, -1, -1}; 1007 Int predNum = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds); 1008 if (mpmPred[j]) 1018 1009 { 1019 1010 m_pcTDecBinIf->decodeBinEP( symbol ); 1020 symbol++; 1021 } 1011 if (symbol) 1012 { 1013 m_pcTDecBinIf->decodeBinEP( symbol ); 1014 symbol++; 1015 } 1022 1016 #if H_MV_ENC_DEC_TRAC 1023 DTRACE_CU("mpm_idx", symbol)1024 #endif 1025 intraPredMode = preds[symbol];1026 }1027 else1028 {1029 m_pcTDecBinIf->decodeBinsEP( symbol, 5 );1030 intraPredMode = symbol;1017 DTRACE_CU("mpm_idx", symbol) 1018 #endif 1019 intraPredMode = preds[symbol]; 1020 } 1021 else 1022 { 1023 m_pcTDecBinIf->decodeBinsEP( symbol, 5 ); 1024 intraPredMode = symbol; 1031 1025 #if H_MV_ENC_DEC_TRAC 1032 DTRACE_CU("rem_intra_luma_pred_mode", symbol)1026 DTRACE_CU("rem_intra_luma_pred_mode", symbol) 1033 1027 #endif 1034 //postponed sorting of MPMs (only in remaining branch)1035 if (preds[0] > preds[1])1036 {1037 std::swap(preds[0], preds[1]);1038 }1039 if (preds[0] > preds[2])1040 {1041 std::swap(preds[0], preds[2]);1042 }1043 if (preds[1] > preds[2])1044 {1045 std::swap(preds[1], preds[2]);1046 }1047 for ( Int i = 0; i < predNum; i++ )1048 {1049 intraPredMode += ( intraPredMode >= preds[i] );1050 }1051 }1052 pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, absPartIdx+partOffset*j, depth );1028 //postponed sorting of MPMs (only in remaining branch) 1029 if (preds[0] > preds[1]) 1030 { 1031 std::swap(preds[0], preds[1]); 1032 } 1033 if (preds[0] > preds[2]) 1034 { 1035 std::swap(preds[0], preds[2]); 1036 } 1037 if (preds[1] > preds[2]) 1038 { 1039 std::swap(preds[1], preds[2]); 1040 } 1041 for ( Int i = 0; i < predNum; i++ ) 1042 { 1043 intraPredMode += ( intraPredMode >= preds[i] ); 1044 } 1045 } 1046 pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, absPartIdx+partOffset*j, depth ); 1053 1047 #if H_3D_DIM 1054 1048 } … … 1068 1062 DTRACE_CU("intra_chroma_pred_mode", uiSymbol ) 1069 1063 #endif 1070 uiSymbol = DM_CHROMA_IDX;1064 uiSymbol = DM_CHROMA_IDX; 1071 1065 } 1072 1066 else … … 1078 1072 DTRACE_CU("intra_chroma_pred_mode", uiIPredMode ) 1079 1073 #endif 1080 UInt uiAllowedChromaDir[ NUM_CHROMA_MODE ];1074 UInt uiAllowedChromaDir[ NUM_CHROMA_MODE ]; 1081 1075 pcCU->getAllowedChromaDir( uiAbsPartIdx, uiAllowedChromaDir ); 1082 1076 uiSymbol = uiAllowedChromaDir[ uiIPredMode ]; -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r1185 r1187 290 290 } 291 291 } 292 293 294 292 } 295 293 … … 349 347 } 350 348 #endif 349 351 350 TDecTop::TDecTop() 352 351 { … … 1197 1196 #if H_3D_TMVP 1198 1197 if(pcSlice->getLayerId()) 1198 { 1199 1199 pcSlice->generateAlterRefforTMVP(); 1200 } 1200 1201 #endif 1201 1202 } … … 1650 1651 } 1651 1652 1652 #if H_MV1653 1653 Void TDecTop::xCeckNoClrasOutput() 1654 1654 { … … 1684 1684 return allRefLayersInitilizedFlag; 1685 1685 } 1686 1687 #if H_3D 1688 Void TDecTop::setProfileIdc() 1689 { 1690 if (m_targetOptLayerSetIdx != -1 ) 1691 { 1692 TComVPS* vps = getPrefetchedVPS(); 1693 Int lsIdx = vps->olsIdxToLsIdx( m_targetOptLayerSetIdx ); 1694 Int lIdx = -1; 1695 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ); j++ ) 1696 { 1697 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 1698 { 1699 lIdx = j; 1700 break; 1701 } 1702 } 1703 assert( lIdx != -1 ); 1704 1705 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOptLayerSetIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1706 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1707 m_profileIdc = profileIdc; 1708 }; 1709 } 1686 1710 #endif 1687 1711 #endif -
branches/HTM-14.0-dev0/source/Lib/TLibDecoder/TDecTop.h
r1185 r1187 301 301 Void setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; } 302 302 303 Void setProfileIdc() 304 { 305 if (m_targetOptLayerSetIdx != -1 ) 306 { 307 TComVPS* vps = getPrefetchedVPS(); 308 Int lsIdx = vps->olsIdxToLsIdx( m_targetOptLayerSetIdx ); 309 Int lIdx = -1; 310 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ); j++ ) 311 { 312 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 313 { 314 lIdx = j; 315 break; 316 } 317 } 318 assert( lIdx != -1 ); 319 320 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOptLayerSetIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 321 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 322 m_profileIdc = profileIdc; 323 }; 324 } 303 Void setProfileIdc(); 325 304 Bool decProcAnnexI() { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); } 326 305 #endif -
branches/HTM-14.0-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r1186 r1187 541 541 TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU 542 542 UInt uiCUIdx = rpcBestCU->getZorderIdxInCU(); 543 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partition ned than the texture.543 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitioned than the texture. 544 544 if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split. 545 545 { … … 556 556 { 557 557 if(pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxN || pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxnU|| pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxnD) 558 { 558 559 bTry2NxN = true; 560 } 559 561 else 562 { 560 563 bTryNx2N = true; 564 } 561 565 } 562 566 } … … 592 596 #endif 593 597 #if H_3D_NBDV_REF 594 if( rpcTempCU->getSlice()->getDepthRefinementFlag() ) 595 rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 596 else 598 if( rpcTempCU->getSlice()->getDepthRefinementFlag() ) 599 { 600 rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 601 } 602 else 597 603 #endif 598 rpcTempCU->getDisMvpCandNBDV(&DvInfo); 599 604 { 605 rpcTempCU->getDisMvpCandNBDV(&DvInfo); 606 } 600 607 #if H_3D_IV_MERGE 601 608 } … … 624 631 Bool bICFlag = uiICId ? true : false; 625 632 #endif 626 // 2Nx2N 627 if(m_pcEncCfg->getUseEarlySkipDetection()) 628 { 633 // 2Nx2N 634 if(m_pcEncCfg->getUseEarlySkipDetection()) 635 { 636 #if H_3D_IC 637 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 638 #endif 639 #if H_3D_FAST_TEXTURE_ENCODING 640 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 641 #else 642 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 643 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 644 #endif 645 #if H_3D_VSP 646 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 647 #endif 648 } 649 // SKIP 629 650 #if H_3D_IC 630 651 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 631 652 #endif 653 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 632 654 #if H_3D_FAST_TEXTURE_ENCODING 633 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 634 #else 635 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 636 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 637 #endif 655 bFMD = bIVFMerge && rpcBestCU->isSkipped(0); 656 #endif 657 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 638 658 #if H_3D_VSP 639 659 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 640 660 #endif 641 } 642 // SKIP 643 #if H_3D_IC 644 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 645 #endif 646 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 647 #if H_3D_FAST_TEXTURE_ENCODING 648 bFMD = bIVFMerge && rpcBestCU->isSkipped(0); 649 #endif 650 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 651 #if H_3D_VSP 652 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 653 #endif 654 655 if(!m_pcEncCfg->getUseEarlySkipDetection()) 656 { 657 // 2Nx2N, NxN 661 662 if(!m_pcEncCfg->getUseEarlySkipDetection()) 663 { 664 // 2Nx2N, NxN 658 665 #if H_3D_IC 659 666 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); … … 662 669 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD ); rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 663 670 #else 664 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );665 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );671 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 672 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 666 673 #endif 667 674 #if H_3D_VSP 668 675 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 669 676 #endif 670 677 671 678 #if H_3D_DBBP 672 if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )673 {674 xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false );675 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );679 if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) 680 { 681 xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false ); 682 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 676 683 #if H_3D_VSP 677 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 678 #endif 679 } 680 #endif 681 684 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 685 #endif 686 } 687 #endif 682 688 if(m_pcEncCfg->getUseCbfFastMode()) 683 689 { 684 690 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 685 691 } 686 }692 } 687 693 #if H_3D_IC 688 694 } … … 1771 1777 Bool bICFlag = rpcTempCU->getICFlag( 0 ); 1772 1778 #endif 1773 #if H_3D_VSO // M1 //nece ccary here?1779 #if H_3D_VSO // M1 //necessary here? 1774 1780 if( m_pcRdCost->getUseRenModel() ) 1775 1781 { … … 1896 1902 { 1897 1903 #if H_3D_IC 1898 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) 1904 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) 1905 { 1906 if( bICFlag && uiMergeCand == 0 ) 1899 1907 { 1900 if( bICFlag && uiMergeCand == 0 ) 1901 { 1902 continue; 1903 } 1908 continue; 1904 1909 } 1905 #endif 1906 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1907 { 1910 } 1911 #endif 1912 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1913 { 1908 1914 if( !(bestIsSkip && uiNoResidual == 0) ) 1909 1915 { … … 1944 1950 #if H_3D_VSP 1945 1951 { 1946 if ( vspFlag[uiMergeCand] ) 1947 { 1948 UInt partAddr; 1949 Int vspSize; 1950 Int width, height; 1951 rpcTempCU->getPartIndexAndSize( 0, partAddr, width, height ); 1952 if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 ) 1952 if ( vspFlag[uiMergeCand] ) 1953 1953 { 1954 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize ); 1955 rpcTempCU->setVSPFlag( partAddr, vspSize ); 1954 UInt partAddr; 1955 Int vspSize; 1956 Int width, height; 1957 rpcTempCU->getPartIndexAndSize( 0, partAddr, width, height ); 1958 if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 ) 1959 { 1960 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize ); 1961 rpcTempCU->setVSPFlag( partAddr, vspSize ); 1962 } 1963 else 1964 { 1965 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1966 } 1967 if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 ) 1968 { 1969 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_1 , cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize ); 1970 rpcTempCU->setVSPFlag( partAddr, vspSize ); 1971 } 1972 else 1973 { 1974 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1975 } 1976 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1956 1977 } 1957 1978 else 1958 1979 { 1980 #endif 1981 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1959 1982 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1983 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1984 #if H_3D_VSP 1960 1985 } 1961 if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 )1962 {1963 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_1 , cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize );1964 rpcTempCU->setVSPFlag( partAddr, vspSize );1965 }1966 else1967 {1968 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level1969 }1970 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level1971 1986 } 1972 else 1987 #endif 1988 // do MC 1989 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1990 // estimate residual and encode everything 1991 #if H_3D_VSO //M2 1992 if( m_pcRdCost->getUseRenModel() ) 1993 { //Reset 1994 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 1995 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 1996 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 1997 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 1998 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1999 } 2000 #endif 2001 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, 2002 m_ppcOrigYuv [uhDepth], 2003 m_ppcPredYuvTemp[uhDepth], 2004 m_ppcResiYuvTemp[uhDepth], 2005 m_ppcResiYuvBest[uhDepth], 2006 m_ppcRecoYuvTemp[uhDepth], 2007 (uiNoResidual? true:false)); 2008 2009 2010 if ( uiNoResidual == 0 && rpcTempCU->getQtRootCbf(0) == 0 ) 1973 2011 { 1974 #endif 1975 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1976 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1977 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1978 #if H_3D_VSP 2012 // If no residual when allowing for one, then set mark to not try case where residual is forced to 0 2013 mergeCandBuffer[uiMergeCand] = 1; 1979 2014 } 1980 }1981 #endif1982 // do MC1983 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );1984 // estimate residual and encode everything1985 #if H_3D_VSO //M21986 if( m_pcRdCost->getUseRenModel() )1987 { //Reset1988 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ();1989 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight ();1990 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr ();1991 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride ();1992 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1993 }1994 #endif1995 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU,1996 m_ppcOrigYuv [uhDepth],1997 m_ppcPredYuvTemp[uhDepth],1998 m_ppcResiYuvTemp[uhDepth],1999 m_ppcResiYuvBest[uhDepth],2000 m_ppcRecoYuvTemp[uhDepth],2001 (uiNoResidual? true:false));2002 2003 2004 if ( uiNoResidual == 0 && rpcTempCU->getQtRootCbf(0) == 0 )2005 {2006 // If no residual when allowing for one, then set mark to not try case where residual is forced to 02007 mergeCandBuffer[uiMergeCand] = 1;2008 }2009 2015 2010 2016 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); … … 2094 2100 rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag ); 2095 2101 2096 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 2102 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 2103 { 2104 #if H_3D_INTER_SDC 2105 if( rpcTempCU->getSlice()->getInterSdcFlag() ) 2106 { 2107 bestIsSkip = !rpcBestCU->getSDCFlag( 0 ) && ( rpcBestCU->getQtRootCbf(0) == 0 ); 2108 } 2109 else 2110 { 2111 #endif 2112 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 2113 #if H_3D_INTER_SDC 2114 } 2115 #endif 2116 } 2117 } 2118 } 2119 } 2120 2121 if(uiNoResidual == 0 && m_pcEncCfg->getUseEarlySkipDetection()) 2122 { 2123 if(rpcBestCU->getQtRootCbf( 0 ) == 0) 2097 2124 { 2098 #if H_3D_INTER_SDC 2099 if( rpcTempCU->getSlice()->getInterSdcFlag() ) 2125 if( rpcBestCU->getMergeFlag( 0 )) 2100 2126 { 2101 bestIsSkip = !rpcBestCU->getSDCFlag( 0 ) && ( rpcBestCU->getQtRootCbf(0) == 0 );2127 *earlyDetectionSkipMode = true; 2102 2128 } 2103 2129 else 2104 2130 { 2105 #endif 2106 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 2107 #if H_3D_INTER_SDC 2108 } 2109 #endif 2110 } 2111 } 2112 } 2113 } 2114 2115 if(uiNoResidual == 0 && m_pcEncCfg->getUseEarlySkipDetection()) 2116 { 2117 if(rpcBestCU->getQtRootCbf( 0 ) == 0) 2118 { 2119 if( rpcBestCU->getMergeFlag( 0 )) 2120 { 2121 *earlyDetectionSkipMode = true; 2122 } 2123 else 2124 { 2125 Int absoulte_MV=0; 2126 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 2127 { 2128 if ( rpcBestCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 2131 Int absoulte_MV=0; 2132 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 2129 2133 { 2130 TComCUMvField* pcCUMvField = rpcBestCU->getCUMvField(RefPicList( uiRefListIdx )); 2131 Int iHor = pcCUMvField->getMvd( 0 ).getAbsHor(); 2132 Int iVer = pcCUMvField->getMvd( 0 ).getAbsVer(); 2133 absoulte_MV+=iHor+iVer; 2134 if ( rpcBestCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 2135 { 2136 TComCUMvField* pcCUMvField = rpcBestCU->getCUMvField(RefPicList( uiRefListIdx )); 2137 Int iHor = pcCUMvField->getMvd( 0 ).getAbsHor(); 2138 Int iVer = pcCUMvField->getMvd( 0 ).getAbsVer(); 2139 absoulte_MV+=iHor+iVer; 2140 } 2141 } 2142 2143 if(absoulte_MV == 0) 2144 { 2145 *earlyDetectionSkipMode = true; 2134 2146 } 2135 2147 } 2136 2137 if(absoulte_MV == 0)2138 {2139 *earlyDetectionSkipMode = true;2140 }2141 2148 } 2142 2149 } 2143 2150 } 2144 }2145 2151 #if H_3D_SPIVMP 2146 2152 delete[] pcMvFieldSP; … … 2163 2169 #endif 2164 2170 { 2165 2166 2171 #if H_3D 2167 2172 const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0); … … 2171 2176 { 2172 2177 #endif 2173 UChar uhDepth = rpcTempCU->getDepth( 0 );2178 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2174 2179 #if H_3D_ARP 2175 Bool bFirstTime = true; 2176 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2177 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) ) 2178 { 2179 nARPWMax = 0; 2180 } 2181 2182 for( Int nARPW = 0; nARPW <= nARPWMax; nARPW++ ) 2183 { 2184 if( !bFirstTime && rpcTempCU->getSlice()->getIvResPredFlag() ) 2185 { 2186 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0),bTransquantBypassFlag ); 2187 } 2188 #endif 2189 #if H_3D_VSO // M3 2190 if( m_pcRdCost->getUseRenModel() ) 2191 { 2192 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2193 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2194 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2195 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2196 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2197 } 2198 #endif 2199 2200 rpcTempCU->setDepthSubParts( uhDepth, 0 ); 2201 2202 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2203 #if H_3D 2204 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2205 #endif 2206 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2207 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2208 2209 #if H_3D_ARP 2210 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 2211 #endif 2212 2213 #if H_3D_ARP 2214 if( bFirstTime == false && nARPWMax ) 2215 { 2216 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth ); 2217 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 2218 2219 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 2220 } 2221 else 2222 { 2223 bFirstTime = false; 2224 #endif 2225 #if AMP_MRG 2226 rpcTempCU->setMergeAMP (true); 2227 #if H_3D_FAST_TEXTURE_ENCODING 2228 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG ); 2229 #else 2230 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); 2231 #endif 2232 #else 2233 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 2234 #endif 2235 #if H_3D_ARP 2236 if( nARPWMax ) 2237 { 2238 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 2239 } 2240 } 2241 #endif 2242 2243 #if AMP_MRG 2244 if ( !rpcTempCU->getMergeAMP() ) 2245 { 2246 #if H_3D_ARP 2247 if( nARPWMax ) 2248 { 2249 continue; 2250 } 2251 else 2252 #endif 2253 return; 2254 } 2255 #endif 2256 2257 #if KWU_RC_MADPRED_E0227 2258 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2259 { 2260 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2261 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2262 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2263 m_temporalSAD = (Int)SAD; 2264 } 2265 #endif 2266 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); 2267 #if H_3D_VSP // possible bug fix 2268 if( rpcTempCU->getQtRootCbf(0)==0 ) 2269 { 2270 rpcTempCU->setTrIdxSubParts(0, 0, uhDepth); 2271 } 2272 #endif 2273 #if H_3D_VSO // M4 2274 if( m_pcRdCost->getUseLambdaScaleVSO() ) 2275 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2276 else 2277 #endif 2278 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2279 #if H_3D_INTER_SDC 2280 TComDataCU *rpcTempCUPre = rpcTempCU; 2281 #endif 2282 xCheckDQP( rpcTempCU ); 2283 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2284 #if H_3D_INTER_SDC 2285 if( rpcTempCU->getSlice()->getInterSdcFlag() && ePartSize == SIZE_2Nx2N) 2286 { 2287 Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE}; 2288 for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ ) 2289 { 2290 if( uiOffest > 3) 2180 Bool bFirstTime = true; 2181 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2182 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) ) 2183 { 2184 nARPWMax = 0; 2185 } 2186 2187 for( Int nARPW = 0; nARPW <= nARPWMax; nARPW++ ) 2188 { 2189 if( !bFirstTime && rpcTempCU->getSlice()->getIvResPredFlag() ) 2291 2190 { 2292 if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) ) 2293 { 2294 continue; 2295 } 2296 if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] && uiOffest == 5) 2297 { 2298 continue; 2299 } 2300 if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] && uiOffest == 4) 2301 { 2302 continue; 2303 } 2191 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0),bTransquantBypassFlag ); 2304 2192 } 2305 2306 if( rpcTempCU != rpcTempCUPre ) 2307 { 2308 Int orgQP = rpcBestCU->getQP( 0 ); 2309 rpcTempCU->initEstData( uhDepth, orgQP ,bTransquantBypassFlag ); 2310 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2311 } 2312 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2313 #if H_3D 2314 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2315 #endif 2316 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2317 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2193 #endif 2318 2194 #if H_3D_VSO // M3 2319 2195 if( m_pcRdCost->getUseRenModel() ) … … 2327 2203 #endif 2328 2204 2329 Int iSdcOffset = 0; 2330 if(uiOffest % 2 == 0) 2205 rpcTempCU->setDepthSubParts( uhDepth, 0 ); 2206 2207 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2208 #if H_3D 2209 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2210 #endif 2211 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2212 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2213 #if H_3D_ARP 2214 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 2215 #endif 2216 #if H_3D_ARP 2217 if( bFirstTime == false && nARPWMax ) 2331 2218 { 2332 iSdcOffset = uiOffest >> 1; 2219 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth ); 2220 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 2221 2222 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 2333 2223 } 2334 2224 else 2335 2225 { 2336 iSdcOffset = -1 * (uiOffest >> 1); 2226 bFirstTime = false; 2227 #endif 2228 #if AMP_MRG 2229 rpcTempCU->setMergeAMP (true); 2230 #if H_3D_FAST_TEXTURE_ENCODING 2231 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG ); 2232 #else 2233 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); 2234 #endif 2235 #else 2236 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 2237 #endif 2238 #if H_3D_ARP 2239 if( nARPWMax ) 2240 { 2241 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 2242 } 2337 2243 } 2338 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2339 m_ppcOrigYuv[uhDepth], 2340 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2341 m_ppcResiYuvTemp[uhDepth], 2342 m_ppcRecoYuvTemp[uhDepth], 2343 iSdcOffset, 2344 uhDepth ); 2345 if (uiOffest <= 3 ) 2244 #endif 2245 2246 #if AMP_MRG 2247 if ( !rpcTempCU->getMergeAMP() ) 2346 2248 { 2347 dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost(); 2249 #if H_3D_ARP 2250 if( nARPWMax ) 2251 { 2252 continue; 2253 } 2254 else 2255 #endif 2256 return; 2348 2257 } 2349 2258 #endif 2259 2260 #if KWU_RC_MADPRED_E0227 2261 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 2262 { 2263 UInt SAD = m_pcRdCost->getSADPart( g_bitDepthY, m_ppcPredYuvTemp[uhDepth]->getLumaAddr(), m_ppcPredYuvTemp[uhDepth]->getStride(), 2264 m_ppcOrigYuv[uhDepth]->getLumaAddr(), m_ppcOrigYuv[uhDepth]->getStride(), 2265 rpcTempCU->getWidth(0), rpcTempCU->getHeight(0) ); 2266 m_temporalSAD = (Int)SAD; 2267 } 2268 #endif 2269 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); 2270 #if H_3D_VSP // possible bug fix 2271 if( rpcTempCU->getQtRootCbf(0)==0 ) 2272 { 2273 rpcTempCU->setTrIdxSubParts(0, 0, uhDepth); 2274 } 2275 #endif 2276 #if H_3D_VSO // M4 2277 if( m_pcRdCost->getUseLambdaScaleVSO() ) 2278 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2279 else 2280 #endif 2281 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2282 #if H_3D_INTER_SDC 2283 TComDataCU *rpcTempCUPre = rpcTempCU; 2284 #endif 2350 2285 xCheckDQP( rpcTempCU ); 2351 2286 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2352 } 2353 2354 } 2287 #if H_3D_INTER_SDC 2288 if( rpcTempCU->getSlice()->getInterSdcFlag() && ePartSize == SIZE_2Nx2N) 2289 { 2290 Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE}; 2291 for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ ) 2292 { 2293 if( uiOffest > 3) 2294 { 2295 if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) ) 2296 { 2297 continue; 2298 } 2299 if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] && uiOffest == 5) 2300 { 2301 continue; 2302 } 2303 if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] && uiOffest == 4) 2304 { 2305 continue; 2306 } 2307 } 2308 2309 if( rpcTempCU != rpcTempCUPre ) 2310 { 2311 Int orgQP = rpcBestCU->getQP( 0 ); 2312 rpcTempCU->initEstData( uhDepth, orgQP ,bTransquantBypassFlag ); 2313 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2314 } 2315 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2316 #if H_3D 2317 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2318 #endif 2319 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2320 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2321 #if H_3D_VSO // M3 2322 if( m_pcRdCost->getUseRenModel() ) 2323 { 2324 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2325 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2326 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2327 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2328 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2329 } 2330 #endif 2331 2332 Int iSdcOffset = 0; 2333 if(uiOffest % 2 == 0) 2334 { 2335 iSdcOffset = uiOffest >> 1; 2336 } 2337 else 2338 { 2339 iSdcOffset = -1 * (uiOffest >> 1); 2340 } 2341 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2342 m_ppcOrigYuv[uhDepth], 2343 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2344 m_ppcResiYuvTemp[uhDepth], 2345 m_ppcRecoYuvTemp[uhDepth], 2346 iSdcOffset, 2347 uhDepth ); 2348 if (uiOffest <= 3 ) 2349 { 2350 dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost(); 2351 } 2352 2353 xCheckDQP( rpcTempCU ); 2354 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2355 } 2356 2357 } 2355 2358 #endif 2356 2359 #if H_3D_ARP 2357 }2360 } 2358 2361 #endif 2359 2362 #if H_3D_FAST_TEXTURE_ENCODING … … 2548 2551 // find optimal motion/disparity vector for each segment 2549 2552 DisInfo originalDvInfo = rpcTempCU->getDvInfo(0); 2550 D BBPTmpData* pDBBPTmpData = rpcTempCU->getDBBPTmpData();2553 DbbpTmpData* pDBBPTmpData = rpcTempCU->getDBBPTmpData(); 2551 2554 TComYuv* apPredYuv[2] = { m_ppcRecoYuvTemp[uhDepth], m_ppcPredYuvTemp[uhDepth] }; 2552 2555 … … 2629 2632 } 2630 2633 #endif 2634 2631 2635 #if H_3D_DIM 2632 2636 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP ) … … 2670 2674 if( !rpcTempCU->getSDCFlag( 0 ) ) 2671 2675 #endif 2672 m_pcPredSearch ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC );2676 m_pcPredSearch ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC ); 2673 2677 2674 2678 m_pcEntropyCoder->resetBits(); … … 2683 2687 { 2684 2688 #endif 2685 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true );2686 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );2687 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true );2688 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );2689 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2690 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2691 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2692 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2689 2693 #if H_3D_DIM_SDC 2690 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );2691 #endif 2692 2693 // Encode Coefficients2694 Bool bCodeDQP = getdQPFlag();2694 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2695 #endif 2696 2697 // Encode Coefficients 2698 Bool bCodeDQP = getdQPFlag(); 2695 2699 #if H_3D_DISABLE_CHROMA 2696 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true ); 2697 #else 2698 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2699 #endif 2700 2701 2702 setdQPFlag( bCodeDQP ); 2700 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true ); 2701 #else 2702 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2703 #endif 2704 setdQPFlag( bCodeDQP ); 2703 2705 #if H_3D 2704 2706 } … … 2707 2709 2708 2710 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2709 2711 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2710 2712 #if H_3D_VSO // M6 2711 2713 if( m_pcRdCost->getUseLambdaScaleVSO()) -
branches/HTM-14.0-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r1185 r1187 561 561 #endif 562 562 #endif 563 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );563 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); 564 564 } 565 565 else // if it is Inter mode, encode motion vector and reference index -
branches/HTM-14.0-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r1185 r1187 255 255 curCost += m_CUTransquantBypassFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG ); 256 256 #if H_3D_DIM 257 if( m_pcSlice->getIntraSdcWedgeFlag() || m_pcSlice->getIntraContourFlag() )258 {259 curCost += m_cDepthIntraModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );260 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );261 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA );262 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG );263 }257 if( m_pcSlice->getIntraSdcWedgeFlag() || m_pcSlice->getIntraContourFlag() ) 258 { 259 curCost += m_cDepthIntraModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); 260 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 261 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 262 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 263 } 264 264 #endif 265 265 if (curCost < bestCost) … … 626 626 Bool bDepthMapDetect = (pcTexture != NULL); 627 627 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE); 628 628 629 629 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 630 630 … … 664 664 return; 665 665 } 666 666 667 667 #if H_MV_ENC_DEC_TRAC 668 668 DTRACE_CU("part_mode", eSize ) … … 672 672 { 673 673 #endif 674 switch(eSize)675 {676 case SIZE_2Nx2N:677 {678 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) );679 break;680 }681 case SIZE_2NxN:682 case SIZE_2NxnU:683 case SIZE_2NxnD:684 {685 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );686 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) );687 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )688 {689 if (eSize == SIZE_2NxN)690 {691 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 ));692 }693 else694 {695 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 ));696 m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1));697 }698 }699 break;700 }701 case SIZE_Nx2N:702 case SIZE_nLx2N:703 case SIZE_nRx2N:704 {705 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );706 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );707 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )708 {709 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) );710 }711 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )712 {713 if (eSize == SIZE_Nx2N)714 {715 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 ));716 }717 else718 {719 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 ));720 m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1));721 }722 }723 break;724 }725 case SIZE_NxN:726 {727 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )728 {729 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );730 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );731 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) );732 }733 break;734 }735 default:736 {737 assert(0);738 }739 }674 switch(eSize) 675 { 676 case SIZE_2Nx2N: 677 { 678 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 679 break; 680 } 681 case SIZE_2NxN: 682 case SIZE_2NxnU: 683 case SIZE_2NxnD: 684 { 685 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 686 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 687 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 688 { 689 if (eSize == SIZE_2NxN) 690 { 691 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 692 } 693 else 694 { 695 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 696 m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1)); 697 } 698 } 699 break; 700 } 701 case SIZE_Nx2N: 702 case SIZE_nLx2N: 703 case SIZE_nRx2N: 704 { 705 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 706 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 707 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 708 { 709 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 710 } 711 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 712 { 713 if (eSize == SIZE_Nx2N) 714 { 715 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 716 } 717 else 718 { 719 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 720 m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1)); 721 } 722 } 723 break; 724 } 725 case SIZE_NxN: 726 { 727 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 728 { 729 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 730 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 731 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 732 } 733 break; 734 } 735 default: 736 { 737 assert(0); 738 } 739 } 740 740 #if H_3D_QTLPC 741 741 } … … 1089 1089 { 1090 1090 #endif 1091 if(predIdx[j] != -1)1092 {1093 m_pcBinIf->encodeBinEP( predIdx[j] ? 1 : 0 );1094 if (predIdx[j])1095 {1096 m_pcBinIf->encodeBinEP( predIdx[j]-1 );1097 }1091 if(predIdx[j] != -1) 1092 { 1093 m_pcBinIf->encodeBinEP( predIdx[j] ? 1 : 0 ); 1094 if (predIdx[j]) 1095 { 1096 m_pcBinIf->encodeBinEP( predIdx[j]-1 ); 1097 } 1098 1098 #if H_MV_ENC_DEC_TRAC 1099 DTRACE_CU("mpm_idx", predIdx[j] );1100 #endif 1101 }1102 else1103 {1104 if (preds[j][0] > preds[j][1])1105 {1106 std::swap(preds[j][0], preds[j][1]);1107 }1108 if (preds[j][0] > preds[j][2])1109 {1110 std::swap(preds[j][0], preds[j][2]);1111 }1112 if (preds[j][1] > preds[j][2])1113 {1114 std::swap(preds[j][1], preds[j][2]);1115 }1116 for(Int i = (predNum[j] - 1); i >= 0; i--)1117 {1118 dir[j] = dir[j] > preds[j][i] ? dir[j] - 1 : dir[j];1119 }1120 m_pcBinIf->encodeBinsEP( dir[j], 5 );1099 DTRACE_CU("mpm_idx", predIdx[j] ); 1100 #endif 1101 } 1102 else 1103 { 1104 if (preds[j][0] > preds[j][1]) 1105 { 1106 std::swap(preds[j][0], preds[j][1]); 1107 } 1108 if (preds[j][0] > preds[j][2]) 1109 { 1110 std::swap(preds[j][0], preds[j][2]); 1111 } 1112 if (preds[j][1] > preds[j][2]) 1113 { 1114 std::swap(preds[j][1], preds[j][2]); 1115 } 1116 for(Int i = (predNum[j] - 1); i >= 0; i--) 1117 { 1118 dir[j] = dir[j] > preds[j][i] ? dir[j] - 1 : dir[j]; 1119 } 1120 m_pcBinIf->encodeBinsEP( dir[j], 5 ); 1121 1121 #if H_MV_ENC_DEC_TRAC 1122 DTRACE_CU("rem_intra_luma_pred_mode", dir[j] );1123 #endif 1124 }1122 DTRACE_CU("rem_intra_luma_pred_mode", dir[j] ); 1123 #endif 1124 } 1125 1125 #if H_3D_DIM 1126 1126 } … … 1467 1467 { 1468 1468 #endif 1469 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;1470 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;1471 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;1472 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();1473 1474 for(uiY = 0; uiY < uiHeight; uiY++)1475 {1476 for(uiX = 0; uiX < uiWidth; uiX++)1477 {1478 UInt uiSample = piPCMSample[uiX];1479 1480 m_pcBinIf->xWritePCMCode(uiSample, uiSampleBits);1481 }1482 piPCMSample += uiWidth;1483 }1484 1485 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;1486 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;1487 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;1488 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();1489 1490 for(uiY = 0; uiY < uiHeight; uiY++)1491 {1492 for(uiX = 0; uiX < uiWidth; uiX++)1493 {1494 UInt uiSample = piPCMSample[uiX];1495 1496 m_pcBinIf->xWritePCMCode(uiSample, uiSampleBits);1497 }1498 piPCMSample += uiWidth;1499 }1469 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset; 1470 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; 1471 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 1472 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 1473 1474 for(uiY = 0; uiY < uiHeight; uiY++) 1475 { 1476 for(uiX = 0; uiX < uiWidth; uiX++) 1477 { 1478 UInt uiSample = piPCMSample[uiX]; 1479 1480 m_pcBinIf->xWritePCMCode(uiSample, uiSampleBits); 1481 } 1482 piPCMSample += uiWidth; 1483 } 1484 1485 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset; 1486 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; 1487 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 1488 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 1489 1490 for(uiY = 0; uiY < uiHeight; uiY++) 1491 { 1492 for(uiX = 0; uiX < uiWidth; uiX++) 1493 { 1494 UInt uiSample = piPCMSample[uiX]; 1495 1496 m_pcBinIf->xWritePCMCode(uiSample, uiSampleBits); 1497 } 1498 piPCMSample += uiWidth; 1499 } 1500 1500 #if H_3D_DISABLE_CHROMA 1501 1501 } -
branches/HTM-14.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r1185 r1187 976 976 { 977 977 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 978 #if H_3D_ SDC978 #if H_3D_DIM_SDC 979 979 } 980 980 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); … … 2211 2211 // encode pred direction + DC residual data 2212 2212 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2213 #if H_3D_ SDC2213 #if H_3D_DIM_SDC 2214 2214 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2215 2215 #endif … … 3016 3016 pcCU->getPattern()->initPattern ( pcCU, uiInitTrDepth, uiPartOffset ); 3017 3017 pcCU->getPattern()->initAdiPattern( pcCU, uiPartOffset, uiInitTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 3018 3018 3019 3019 //===== determine set of modes to be tested (using prediction signal only) ===== 3020 3020 Int numModesAvailable = 35; //total number of Intra modes … … 3024 3024 UInt uiRdModeList[FAST_UDI_MAX_RDMODE_NUM]; 3025 3025 Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ]; 3026 3026 3027 3027 #if H_3D_DIM 3028 3028 if( bOnlyIVP ) … … 3033 3033 { 3034 3034 #endif 3035 Bool doFastSearch = (numModesForFullRD != numModesAvailable);3036 if (doFastSearch)3037 {3038 assert(numModesForFullRD < numModesAvailable);3039 3040 for( Int i=0; i < numModesForFullRD; i++ )3041 {3042 CandCostList[ i ] = MAX_DOUBLE;3043 }3044 CandNum = 0;3045 3046 for( Int modeIdx = 0; modeIdx < numModesAvailable; modeIdx++ )3047 {3048 UInt uiMode = modeIdx;3049 3050 predIntraLumaAng( pcCU->getPattern(), uiMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );3035 Bool doFastSearch = (numModesForFullRD != numModesAvailable); 3036 if (doFastSearch) 3037 { 3038 assert(numModesForFullRD < numModesAvailable); 3039 3040 for( Int i=0; i < numModesForFullRD; i++ ) 3041 { 3042 CandCostList[ i ] = MAX_DOUBLE; 3043 } 3044 CandNum = 0; 3045 3046 for( Int modeIdx = 0; modeIdx < numModesAvailable; modeIdx++ ) 3047 { 3048 UInt uiMode = modeIdx; 3049 3050 predIntraLumaAng( pcCU->getPattern(), uiMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 3051 3051 #if H_3D_VSO // M34 3052 Dist uiSad; 3053 if ( m_pcRdCost->getUseVSO() ) 3054 { 3055 if ( m_pcRdCost->getUseEstimatedVSD() ) 3056 { 3057 uiSad = (Dist) ( m_pcRdCost->getDistPartVSD( pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, true ) ); 3052 Dist uiSad; 3053 if ( m_pcRdCost->getUseVSO() ) 3054 { 3055 if ( m_pcRdCost->getUseEstimatedVSD() ) 3056 { 3057 uiSad = (Dist) ( m_pcRdCost->getDistPartVSD( pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, true ) ); 3058 } 3059 else 3060 { 3061 uiSad = m_pcRdCost->getDistPartVSO(pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, true ); 3062 } 3058 3063 } 3059 3064 else 3060 { 3061 uiSad = m_pcRdCost-> getDistPartVSO(pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, true);3065 { 3066 uiSad = m_pcRdCost->calcHAD(g_bitDepthY, piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 3062 3067 } 3063 }3064 else3065 {3066 uiSad = m_pcRdCost->calcHAD(g_bitDepthY, piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );3067 }3068 3068 #else 3069 // use hadamard transform here3070 UInt uiSad = m_pcRdCost->calcHAD(g_bitDepthY, piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );3071 #endif 3072 3073 UInt iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth );3069 // use hadamard transform here 3070 UInt uiSad = m_pcRdCost->calcHAD(g_bitDepthY, piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 3071 #endif 3072 3073 UInt iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth ); 3074 3074 #if H_3D_VSO // M35 3075 Double dLambda;3076 if ( m_pcRdCost->getUseLambdaScaleVSO() )3077 {3078 dLambda = m_pcRdCost->getUseRenModel() ? m_pcRdCost->getLambdaVSO() : m_pcRdCost->getSqrtLambdaVSO();3079 }3080 else3081 {3082 dLambda = m_pcRdCost->getSqrtLambda();3083 }3084 3085 Double cost = (Double)uiSad + (Double)iModeBits * dLambda;3075 Double dLambda; 3076 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 3077 { 3078 dLambda = m_pcRdCost->getUseRenModel() ? m_pcRdCost->getLambdaVSO() : m_pcRdCost->getSqrtLambdaVSO(); 3079 } 3080 else 3081 { 3082 dLambda = m_pcRdCost->getSqrtLambda(); 3083 } 3084 3085 Double cost = (Double)uiSad + (Double)iModeBits * dLambda; 3086 3086 #else 3087 Double cost = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();3088 #endif 3089 3090 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList );3091 }3092 3087 Double cost = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda(); 3088 #endif 3089 3090 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 3091 } 3092 3093 3093 #if FAST_UDI_USE_MPM 3094 Int uiPreds[3] = {-1, -1, -1}; 3095 Int iMode = -1; 3096 Int numCand = pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode ); 3097 if( iMode >= 0 ) 3098 { 3099 numCand = iMode; 3100 } 3101 3102 for( Int j=0; j < numCand; j++) 3103 3104 { 3105 Bool mostProbableModeIncluded = false; 3106 Int mostProbableMode = uiPreds[j]; 3107 3094 Int uiPreds[3] = {-1, -1, -1}; 3095 Int iMode = -1; 3096 Int numCand = pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode ); 3097 if( iMode >= 0 ) 3098 { 3099 numCand = iMode; 3100 } 3101 3102 for( Int j=0; j < numCand; j++) 3103 3104 { 3105 Bool mostProbableModeIncluded = false; 3106 Int mostProbableMode = uiPreds[j]; 3107 3108 for( Int i=0; i < numModesForFullRD; i++) 3109 { 3110 mostProbableModeIncluded |= (mostProbableMode == uiRdModeList[i]); 3111 } 3112 if (!mostProbableModeIncluded) 3113 { 3114 uiRdModeList[numModesForFullRD++] = mostProbableMode; 3115 } 3116 } 3117 #endif // FAST_UDI_USE_MPM 3118 } 3119 else 3120 { 3108 3121 for( Int i=0; i < numModesForFullRD; i++) 3109 3122 { 3110 mostProbableModeIncluded |= (mostProbableMode == uiRdModeList[i]); 3111 } 3112 if (!mostProbableModeIncluded) 3113 { 3114 uiRdModeList[numModesForFullRD++] = mostProbableMode; 3115 } 3116 } 3117 #endif // FAST_UDI_USE_MPM 3118 } 3119 else 3120 { 3121 for( Int i=0; i < numModesForFullRD; i++) 3122 { 3123 uiRdModeList[i] = i; 3124 } 3125 } 3123 uiRdModeList[i] = i; 3124 } 3125 } 3126 3126 #if H_3D_DIM 3127 3127 } 3128 3128 #endif 3129 3129 3130 3130 #if H_3D_DIM 3131 3131 //===== determine set of depth intra modes to be tested ===== … … 3148 3148 { 3149 3149 #if H_3D_FAST_DEPTH_INTRA 3150 Int threshold = max(((pcCU->getQP(0))>>3)-1,3);3151 Int varThreshold = (Int)( threshold * threshold - 8 );3152 UInt varCU = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0));3150 Int threshold = max(((pcCU->getQP(0))>>3)-1,3); 3151 Int varThreshold = (Int)( threshold * threshold - 8 ); 3152 UInt varCU = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0)); 3153 3153 #endif 3154 3154 3155 3155 #if H_3D_DIM_DMM 3156 if( ( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) || pcCU->getSlice()->getIntraContourFlag() )3156 if( ( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) || pcCU->getSlice()->getIntraContourFlag() ) 3157 3157 #if H_3D_FAST_DEPTH_INTRA 3158 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)3159 #endif 3160 )3161 {3162 UInt uiStart, uiEnd;3163 if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSlice()->getIntraContourFlag() )3164 {3165 uiStart = 0;3166 uiEnd = 2;3167 }3168 else if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) )3169 {3170 uiStart = 0;3171 uiEnd = 1;3172 }3173 else if( pcCU->getSlice()->getIntraContourFlag() )3174 {3175 uiStart = 1;3176 uiEnd = 2;3177 }3178 else3179 {3180 uiStart = 0;3181 uiEnd = 0;3182 }3183 for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ )3184 {3158 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold) 3159 #endif 3160 ) 3161 { 3162 UInt uiStart, uiEnd; 3163 if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSlice()->getIntraContourFlag() ) 3164 { 3165 uiStart = 0; 3166 uiEnd = 2; 3167 } 3168 else if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) ) 3169 { 3170 uiStart = 0; 3171 uiEnd = 1; 3172 } 3173 else if( pcCU->getSlice()->getIntraContourFlag() ) 3174 { 3175 uiStart = 1; 3176 uiEnd = 2; 3177 } 3178 else 3179 { 3180 uiStart = 0; 3181 uiEnd = 0; 3182 } 3183 for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ ) 3184 { 3185 3185 #if H_3D_FCO 3186 3186 TComPic* picTexture = pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() ); … … 3191 3191 #endif 3192 3192 { 3193 3193 continue; 3194 3194 } 3195 3195 #endif 3196 UInt uiTabIdx = 0; 3197 TComWedgelet* biSegmentation = NULL; 3198 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3199 switch( dmmType ) 3200 { 3201 case( DMM1_IDX ): 3196 UInt uiTabIdx = 0; 3197 TComWedgelet* biSegmentation = NULL; 3198 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3199 switch( dmmType ) 3202 3200 { 3203 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx ); 3204 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 3205 biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 3201 case( DMM1_IDX ): 3202 { 3203 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx ); 3204 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 3205 biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 3206 3206 &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3207 } break; 3208 3209 case( DMM4_IDX ): 3207 } break; 3208 3209 case( DMM4_IDX ): 3210 { 3211 { 3212 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); 3213 xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, biSegmentation ); 3214 } 3215 } break; 3216 default: assert(0); 3217 } 3218 3219 if( biSegmentation ) 3210 3220 { 3221 if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){ 3222 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3223 } 3224 else 3211 3225 { 3212 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); 3213 xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, biSegmentation ); 3226 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3214 3227 } 3215 } break; 3216 default: assert(0); 3228 pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 ); 3229 pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 ); 3230 3231 uiRdModeList[ numModesForFullRD++ ] = (dmmType +DIM_OFFSET); 3232 if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; } 3233 } 3217 3234 } 3218 3219 if( biSegmentation ) 3220 { 3221 if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){ 3222 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3223 } 3224 else 3225 { 3226 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3227 } 3228 pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 ); 3229 pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 ); 3230 3231 uiRdModeList[ numModesForFullRD++ ] = (dmmType +DIM_OFFSET); 3232 if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; } 3233 } 3234 } 3235 } 3235 } 3236 3236 #if H_3D_DIM 3237 3237 } … … 3245 3245 Double dSecondBestPUCost = MAX_DOUBLE; 3246 3246 #endif 3247 3247 3248 3248 UInt uiBestPUMode = 0; 3249 3249 #if H_3D_FAST_INTRA_SDC … … 3279 3279 // set luma prediction mode 3280 3280 #if !H_3D_FAST_INTRA_SDC 3281 UInt uiOrgMode = uiRdModeList[uiMode];3282 #endif 3283 3281 UInt uiOrgMode = uiRdModeList[uiMode]; 3282 #endif 3283 3284 3284 #if H_3D_FAST_INTRA_SDC 3285 3285 UInt uiOrgMode; 3286 3286 if (uiMode < numModesForFullRD) 3287 3287 { 3288 3288 uiOrgMode = uiRdModeList[uiMode]; 3289 3289 } 3290 3290 else 3291 3291 { 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3292 uiOrgMode = uiRdModeList[uiMode - numModesForFullRD]; 3293 3294 if (uiBestPUModeConv <= 1 ) 3295 { 3296 if (uiOrgMode > 1 && varCU < 1) continue; 3297 } 3298 else 3299 { 3300 if (uiOrgMode != uiBestPUModeConv && uiOrgMode != uiSecondBestPUModeConv && uiOrgMode != uiThirdBestPUModeConv 3301 && uiOrgMode > 1 && uiOrgMode < NUM_INTRA_MODE && varCU < 4) 3302 continue; 3303 } 3304 } 3305 3305 #endif 3306 3306 3307 3307 pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3308 3308 3309 3309 #if H_3D_DIM_SDC 3310 3310 #if H_3D_FAST_INTRA_SDC … … 3313 3313 Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) ); 3314 3314 #endif 3315 3315 3316 3316 for( UInt uiSDC=0; uiSDC<=(bTestSDC?1:0); uiSDC++ ) 3317 3317 { … … 3352 3352 } 3353 3353 #endif 3354 3354 3355 3355 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3356 Bool bTestZeroResi = false;3356 Bool bTestZeroResi = false; 3357 3357 #if H_3D_DIM_ENC 3358 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP();3358 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP(); 3359 3359 #endif 3360 3360 #if H_3D_DIM_SDC 3361 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);3362 #endif 3363 if( uiSDC != 0 && iSDCDeltaResi != 0 )3364 {3365 bTestZeroResi = false;3366 }3367 #endif 3368 3361 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3362 #endif 3363 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3364 { 3365 bTestZeroResi = false; 3366 } 3367 #endif 3368 3369 3369 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3370 for( UInt testZeroResi = 0; testZeroResi <= (bTestZeroResi ? 1 : 0) ; testZeroResi++ )3371 {3372 #endif 3373 // set context models3374 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );3375 3376 // determine residual for partition3370 for( UInt testZeroResi = 0; testZeroResi <= (bTestZeroResi ? 1 : 0) ; testZeroResi++ ) 3371 { 3372 #endif 3373 // set context models 3374 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 3375 3376 // determine residual for partition 3377 3377 #if H_3D_VSO 3378 Dist uiPUDistY = 0;3378 Dist uiPUDistY = 0; 3379 3379 #else 3380 UInt uiPUDistY = 0;3381 #endif 3382 UInt uiPUDistC = 0;3383 Double dPUCost = 0.0;3380 UInt uiPUDistY = 0; 3381 #endif 3382 UInt uiPUDistC = 0; 3383 Double dPUCost = 0.0; 3384 3384 #if H_3D_VSO // M36 3385 if( m_pcRdCost->getUseRenModel() )3386 {3387 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );3388 }3385 if( m_pcRdCost->getUseRenModel() ) 3386 { 3387 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ); 3388 } 3389 3389 #endif 3390 3390 #if H_3D_DIM_SDC 3391 if( pcCU->getSDCFlag(uiPartOffset) )3392 {3393 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);3394 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);3395 3396 // start encoding with SDC3397 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );3398 if ( testZeroResi == 0 && iOffset <= 3 )3399 {3400 dOffsetCost [iOffset -1] = dPUCost;3401 }3402 }3403 else3404 {3391 if( pcCU->getSDCFlag(uiPartOffset) ) 3392 { 3393 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 3394 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth); 3395 3396 // start encoding with SDC 3397 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3398 if ( testZeroResi == 0 && iOffset <= 3 ) 3399 { 3400 dOffsetCost [iOffset -1] = dPUCost; 3401 } 3402 } 3403 else 3404 { 3405 3405 #endif 3406 3406 #if HHI_RQT_INTRA_SPEEDUP 3407 3407 #if H_3D_DIM_ENC 3408 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) );3408 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) ); 3409 3409 #if H_3D_FAST_INTRA_SDC 3410 if( dPUCost < dBestPUCostConv )3411 {3412 uiThirdBestPUModeConv = uiSecondBestPUModeConv;3413 uiSecondBestPUModeConv = uiBestPUModeConv;3414 uiBestPUModeConv = uiOrgMode;3415 dBestPUCostConv = dPUCost;3416 }3410 if( dPUCost < dBestPUCostConv ) 3411 { 3412 uiThirdBestPUModeConv = uiSecondBestPUModeConv; 3413 uiSecondBestPUModeConv = uiBestPUModeConv; 3414 uiBestPUModeConv = uiOrgMode; 3415 dBestPUCostConv = dPUCost; 3416 } 3417 3417 #endif 3418 3418 #else 3419 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost );3419 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost ); 3420 3420 #endif 3421 3421 #else 3422 3422 #if H_3D_DIM_ENC 3423 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost, (testZeroResi != 0) );3423 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost, (testZeroResi != 0) ); 3424 3424 #else 3425 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost );3425 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost ); 3426 3426 #endif 3427 3427 #endif 3428 3428 #if H_3D_DIM_SDC 3429 }3430 #endif 3431 3432 // check r-d cost3433 if( dPUCost < dBestPUCost )3434 {3429 } 3430 #endif 3431 3432 // check r-d cost 3433 if( dPUCost < dBestPUCost ) 3434 { 3435 3435 #if HHI_RQT_INTRA_SPEEDUP_MOD 3436 uiSecondBestMode = uiBestPUMode;3437 dSecondBestPUCost = dBestPUCost;3438 #endif 3439 uiBestPUMode = uiOrgMode;3440 uiBestPUDistY = uiPUDistY;3441 uiBestPUDistC = uiPUDistC;3442 dBestPUCost = dPUCost;3436 uiSecondBestMode = uiBestPUMode; 3437 dSecondBestPUCost = dBestPUCost; 3438 #endif 3439 uiBestPUMode = uiOrgMode; 3440 uiBestPUDistY = uiPUDistY; 3441 uiBestPUDistC = uiPUDistC; 3442 dBestPUCost = dPUCost; 3443 3443 3444 3444 #if H_3D_DIM_SDC 3445 if( pcCU->getSDCFlag(uiPartOffset) ) 3446 { 3447 bBestUseSDC = true; 3448 3449 // copy reconstruction 3450 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 3451 3452 // copy DC values 3453 apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset); 3454 apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset); 3445 if( pcCU->getSDCFlag(uiPartOffset) ) 3446 { 3447 bBestUseSDC = true; 3448 3449 // copy reconstruction 3450 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 3451 3452 // copy DC values 3453 apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset); 3454 apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset); 3455 } 3456 else 3457 { 3458 bBestUseSDC = false; 3459 #endif 3460 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv ); 3461 3462 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3463 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3464 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3465 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3466 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3467 ::memcpy( m_puhQTTempTransformSkipFlag[0], pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3468 ::memcpy( m_puhQTTempTransformSkipFlag[1], pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3469 ::memcpy( m_puhQTTempTransformSkipFlag[2], pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3470 #if H_3D_DIM_SDC 3471 } 3472 #endif 3473 } 3474 #if HHI_RQT_INTRA_SPEEDUP_MOD 3475 else if( dPUCost < dSecondBestPUCost ) 3476 { 3477 uiSecondBestMode = uiOrgMode; 3478 dSecondBestPUCost = dPUCost; 3479 } 3480 #endif 3481 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3455 3482 } 3456 else3457 {3458 bBestUseSDC = false;3459 #endif3460 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );3461 3462 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );3463 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) );3464 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3465 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3466 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3467 ::memcpy( m_puhQTTempTransformSkipFlag[0], pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3468 ::memcpy( m_puhQTTempTransformSkipFlag[1], pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3469 ::memcpy( m_puhQTTempTransformSkipFlag[2], pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, uiQPartNum * sizeof( UChar ) );3470 #if H_3D_DIM_SDC3471 }3472 #endif3473 }3474 #if HHI_RQT_INTRA_SPEEDUP_MOD3475 else if( dPUCost < dSecondBestPUCost )3476 {3477 uiSecondBestMode = uiOrgMode;3478 dSecondBestPUCost = dPUCost;3479 }3480 #endif3481 #if H_3D_DIM_ENC || H_3D_DIM_SDC3482 }3483 3483 } // SDC residual loop 3484 3484 #endif … … 3487 3487 #endif 3488 3488 } // Mode loop 3489 3489 3490 3490 #if HHI_RQT_INTRA_SPEEDUP 3491 3491 #if HHI_RQT_INTRA_SPEEDUP_MOD … … 3502 3502 UInt uiOrgMode = uiBestPUMode; 3503 3503 #endif 3504 3504 3505 3505 pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3506 3506 #if H_3D_DIM_SDC 3507 3507 pcCU->setSDCFlagSubParts(false, uiPartOffset, uiDepth + uiInitTrDepth); 3508 3508 #endif 3509 3509 3510 3510 // set context models 3511 3512 3511 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 3512 3513 3513 // determine residual for partition 3514 3514 #if H_3D_VSO … … 3527 3527 #endif 3528 3528 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost ); 3529 3529 3530 3530 // check r-d cost 3531 3531 if( dPUCost < dBestPUCost ) … … 3538 3538 bBestUseSDC = false; 3539 3539 #endif 3540 3540 3541 3541 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv ); 3542 3542 3543 3543 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3544 3544 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) ); … … 3552 3552 } // Mode loop 3553 3553 #endif 3554 3554 3555 3555 //--- update overall distortion --- 3556 3556 uiOverallDistY += uiBestPUDistY; 3557 3557 uiOverallDistC += uiBestPUDistC; 3558 3558 3559 3559 #if H_3D_DIM_SDC 3560 3560 if( bBestUseSDC ) … … 3562 3562 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 3563 3563 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth); 3564 3564 3565 3565 //=== copy best DC segment values back to CU ==== 3566 3566 pcCU->setSDCSegmentDCOffset(apBestDCOffsets[0], 0, uiPartOffset); … … 3570 3570 { 3571 3571 #endif 3572 3573 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );3574 ::memcpy( pcCU->getTransformIdx() + uiPartOffset, m_puhQTTempTrIdx, uiQPartNum * sizeof( UChar ) );3575 ::memcpy( pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, m_puhQTTempCbf[0], uiQPartNum * sizeof( UChar ) );3576 ::memcpy( pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, m_puhQTTempCbf[1], uiQPartNum * sizeof( UChar ) );3577 ::memcpy( pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, m_puhQTTempCbf[2], uiQPartNum * sizeof( UChar ) );3578 ::memcpy( pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, m_puhQTTempTransformSkipFlag[0], uiQPartNum * sizeof( UChar ) );3579 ::memcpy( pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, m_puhQTTempTransformSkipFlag[1], uiQPartNum * sizeof( UChar ) );3580 ::memcpy( pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, m_puhQTTempTransformSkipFlag[2], uiQPartNum * sizeof( UChar ) );3572 //--- update transform index and cbf --- 3573 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3574 ::memcpy( pcCU->getTransformIdx() + uiPartOffset, m_puhQTTempTrIdx, uiQPartNum * sizeof( UChar ) ); 3575 ::memcpy( pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, m_puhQTTempCbf[0], uiQPartNum * sizeof( UChar ) ); 3576 ::memcpy( pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, m_puhQTTempCbf[1], uiQPartNum * sizeof( UChar ) ); 3577 ::memcpy( pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, m_puhQTTempCbf[2], uiQPartNum * sizeof( UChar ) ); 3578 ::memcpy( pcCU->getTransformSkip(TEXT_LUMA) + uiPartOffset, m_puhQTTempTransformSkipFlag[0], uiQPartNum * sizeof( UChar ) ); 3579 ::memcpy( pcCU->getTransformSkip(TEXT_CHROMA_U) + uiPartOffset, m_puhQTTempTransformSkipFlag[1], uiQPartNum * sizeof( UChar ) ); 3580 ::memcpy( pcCU->getTransformSkip(TEXT_CHROMA_V) + uiPartOffset, m_puhQTTempTransformSkipFlag[2], uiQPartNum * sizeof( UChar ) ); 3581 3581 #if H_3D_DIM_SDC 3582 3582 } … … 3594 3594 bChromaSame = true; 3595 3595 } 3596 3596 3597 3597 UInt uiCompWidth = pcCU->getWidth ( 0 ) >> uiInitTrDepth; 3598 3598 UInt uiCompHeight = pcCU->getHeight( 0 ) >> uiInitTrDepth; … … 3646 3646 } 3647 3647 } 3648 3648 3649 3649 //=== update PU data ==== 3650 3650 pcCU->setLumaIntraDirSubParts ( uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth ); … … 3974 3974 3975 3975 #if H_3D_DBBP 3976 D BBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData();3976 DbbpTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 3977 3977 if( pcCU->getDBBPFlag(0) ) 3978 3978 { … … 4964 4964 { 4965 4965 #if H_3D_DBBP 4966 D BBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData();4966 DbbpTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 4967 4967 if( pcCU->getDBBPFlag(0) ) 4968 4968 { … … 5326 5326 5327 5327 #if H_MV 5328 Bool bMv_VRng_Restricted = false;5328 Bool motVecVertRngRestricted = false; 5329 5329 if( m_pcEncCfg->getUseDisparitySearchRangeRestriction() 5330 5330 && … … 5332 5332 ) 5333 5333 { 5334 bMv_VRng_Restricted = true;5335 } 5336 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );5337 else xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );5334 motVecVertRngRestricted = true; 5335 } 5336 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, motVecVertRngRestricted, m_pcEncCfg->getVerticalDisparitySearchRange() ); 5337 else xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, motVecVertRngRestricted, m_pcEncCfg->getVerticalDisparitySearchRange() ); 5338 5338 #else 5339 5339 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); … … 5523 5523 if( ! pcCU->getSlice()->getIsDepth() ) 5524 5524 #endif 5525 rcMv >>= 2;5525 rcMv >>= 2; 5526 5526 // init TZSearchStruct 5527 5527 IntTZSearchStruct cStruct;
Note: See TracChangeset for help on using the changeset viewer.