Changeset 100 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 9 Aug 2012, 12:53:16 (13 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r77 r100 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION " 3.1rc1" ///< Current software version60 #define NV_VERSION "4.0rc1" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 130 130 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED ) 131 131 #define DEPTH_MAP_GENERATION 1 132 #define PDM_REMOVE_DEPENDENCE 1 //bug-fix for DMDV JCT2-A0095 132 133 #else 133 134 #define DEPTH_MAP_GENERATION 0 … … 138 139 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 139 140 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 140 #if SAIT_IMPROV_MOTION_PRED_M24829 141 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN 141 142 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) 142 143 #else … … 170 171 #define STD_CAM_PARAMETERS_PRECISION 5 ///< quarter luma sample accuarcy for derived disparities (as default) 171 172 172 #define LOG2_DISP_PREC_LUT 2///< log2 of disparity precision used in integer disparity LUTs173 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 173 174 174 175 // ==================================================================================================================== … … 400 401 #define Clip3( MinVal, MaxVal, a) ( ((a)<(MinVal)) ? (MinVal) : (((a)>(MaxVal)) ? (MaxVal) :(a)) ) ///< general min/max clip 401 402 #define RemoveBitIncrement(x) ( (x + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 403 404 #if SAIT_VSO_EST_A0033 405 #define ROUND(a) (((a) < 0)? (int)((a) - 0.5) : (int)((a) + 0.5)) 406 #endif 402 407 403 408 // ==================================================================================================================== … … 495 500 NAL_UNIT_UNSPECIFIED_24, 496 501 #if VIDYO_VPS_INTEGRATION 497 502 NAL_UNIT_VPS, 498 503 #else 499 504 NAL_UNIT_UNSPECIFIED_25, -
trunk/source/Lib/TLibCommon/ContextTables.h
r56 r100 152 152 #endif 153 153 154 #if LGE_EDGE_INTRA 155 #define NUM_EDGE_INTRA_CTX 1 156 #if LGE_EDGE_INTRA_DELTA_DC 157 #define NUM_EDGE_INTRA_DELTA_DC_CTX 2 // one for Delta_DC flag, another for Delta_DC value 158 #endif 159 #endif 160 154 161 // ==================================================================================================================== 155 162 // Tables … … 1272 1279 } 1273 1280 }; 1281 1282 #if LGE_EDGE_INTRA 1283 static const Short 1284 INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = 1285 { 1286 { 1287 CNU 1288 }, 1289 { 1290 CNU 1291 }, 1292 { 1293 CNU 1294 } 1295 }; 1296 1297 #if LGE_EDGE_INTRA_DELTA_DC 1298 static const Short 1299 INIT_EDGE_INTRA_DELTA_DC[3][NUM_EDGE_INTRA_DELTA_DC_CTX] = 1300 { 1301 { 1302 CNU, CNU 1303 }, 1304 { 1305 CNU, CNU 1306 }, 1307 { 1308 CNU, CNU 1309 } 1310 }; 1311 #endif 1312 #endif 1313 1274 1314 #endif 1275 1315 1276 1316 //! \} 1277 1317 1278 1279 #endif 1280 1318 #endif 1319 -
trunk/source/Lib/TLibCommon/NAL.h
r77 r100 52 52 #endif 53 53 #if VIDYO_VPS_INTEGRATION 54 54 unsigned m_layerId; 55 55 unsigned m_temporalId; ///< temporal_id 56 56 #else … … 100 100 m_isDepth = isDepth; 101 101 #else 102 102 m_layerId = layerId; 103 103 #endif 104 104 m_temporalId = temporalID; … … 124 124 m_isDepth = isDepth; 125 125 #else 126 126 m_layerId = layerId; 127 127 #endif 128 128 m_temporalId = temporalID; -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r81 r100 141 141 m_pbResPredFlag = NULL; 142 142 #endif 143 #if LGE_EDGE_INTRA 144 m_pucEdgeCode = NULL; 145 m_pucEdgeNumber = NULL; 146 m_pucEdgeStartPos = NULL; 147 m_pbEdgeLeftFirst = NULL; 148 m_pbEdgePartition = NULL; 149 #if LGE_EDGE_INTRA_DELTA_DC 150 m_piEdgeDeltaDC0 = NULL; 151 m_piEdgeDeltaDC1 = NULL; 152 #endif 153 #endif 143 154 } 144 155 … … 259 270 m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 260 271 #endif 272 #if LGE_EDGE_INTRA 273 m_pucEdgeCode = (UChar*)xMalloc(UChar, uiNumPartition * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4); 274 m_pucEdgeNumber = (UChar*)xMalloc(UChar, uiNumPartition); 275 m_pucEdgeStartPos = (UChar*)xMalloc(UChar, uiNumPartition); 276 m_pbEdgeLeftFirst = (Bool*) xMalloc(Bool, uiNumPartition); 277 m_pbEdgePartition = (Bool*) xMalloc(Bool, uiNumPartition * 16); 278 #if LGE_EDGE_INTRA_DELTA_DC 279 m_piEdgeDeltaDC0 = (Int* ) xMalloc(Int, uiNumPartition); 280 m_piEdgeDeltaDC1 = (Int* ) xMalloc(Int, uiNumPartition); 281 #endif 282 #endif 261 283 } 262 284 else … … 359 381 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 360 382 #endif 383 #if LGE_EDGE_INTRA 384 if ( m_pbEdgeLeftFirst ) { xFree(m_pbEdgeLeftFirst); m_pbEdgeLeftFirst = NULL; } 385 if ( m_pucEdgeStartPos ) { xFree(m_pucEdgeStartPos); m_pucEdgeStartPos = NULL; } 386 if ( m_pucEdgeNumber ) { xFree(m_pucEdgeNumber); m_pucEdgeNumber = NULL; } 387 if ( m_pucEdgeCode ) { xFree(m_pucEdgeCode); m_pucEdgeCode = NULL; } 388 if ( m_pbEdgePartition ) { xFree(m_pbEdgePartition); m_pbEdgePartition = NULL; } 389 #if LGE_EDGE_INTRA_DELTA_DC 390 if ( m_piEdgeDeltaDC0 ) { xFree(m_piEdgeDeltaDC0); m_piEdgeDeltaDC0 = NULL; } 391 if ( m_piEdgeDeltaDC1 ) { xFree(m_piEdgeDeltaDC1); m_piEdgeDeltaDC1 = NULL; } 392 #endif 393 #endif 361 394 m_acCUMvField[0].destroy(); 362 395 m_acCUMvField[1].destroy(); … … 1093 1126 m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart; 1094 1127 #endif 1128 #if LGE_EDGE_INTRA 1129 if( pcCU->getSlice()->getSPS()->isDepth() ) 1130 { 1131 m_pucEdgeCode = pcCU->getEdgeCode( uiPart ); 1132 m_pucEdgeNumber = pcCU->getEdgeNumber() + uiPart; 1133 m_pucEdgeStartPos = pcCU->getEdgeStartPos() + uiPart; 1134 m_pbEdgeLeftFirst = pcCU->getEdgeLeftFirst() + uiPart; 1135 m_pbEdgePartition = pcCU->getEdgePartition( uiPart ); 1136 #if LGE_EDGE_INTRA_DELTA_DC 1137 m_piEdgeDeltaDC0 = pcCU->getEdgeDeltaDC0() + uiPart; 1138 m_piEdgeDeltaDC1 = pcCU->getEdgeDeltaDC1() + uiPart; 1139 #endif 1140 } 1141 #endif 1095 1142 } 1096 1143 … … 1250 1297 memcpy( m_piContourPredTexDeltaDC2 + uiOffset, pcCU->getContourPredTexDeltaDC2(), sizeof( Int ) * uiNumPartition ); 1251 1298 #endif 1299 1300 #if LGE_EDGE_INTRA 1301 if( getSlice()->getSPS()->isDepth() ) 1302 { 1303 memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1304 memcpy( getEdgeNumber() + uiOffset, pcCU->getEdgeNumber(), iSizeInUchar ); 1305 memcpy( getEdgeStartPos() + uiOffset, pcCU->getEdgeStartPos(), iSizeInUchar ); 1306 memcpy( getEdgeLeftFirst() + uiOffset, pcCU->getEdgeLeftFirst(), iSizeInBool ); 1307 memcpy( getEdgePartition( uiOffset ), pcCU->getEdgePartition(0), iSizeInBool * 16 ); 1308 #if LGE_EDGE_INTRA_DELTA_DC 1309 memcpy( getEdgeDeltaDC0() + uiOffset, pcCU->getEdgeDeltaDC0(), sizeof( Int ) * uiNumPartition ); 1310 memcpy( getEdgeDeltaDC1() + uiOffset, pcCU->getEdgeDeltaDC1(), sizeof( Int ) * uiNumPartition ); 1311 #endif 1312 } 1313 #endif 1314 1252 1315 #if HHI_MPI 1253 1316 memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition ); … … 1352 1415 memcpy( rpcCU->getContourPredTexDeltaDC2() + m_uiAbsIdxInLCU, m_piContourPredTexDeltaDC2, sizeof( Int ) * m_uiNumPartition ); 1353 1416 #endif 1417 1418 #if LGE_EDGE_INTRA 1419 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1420 { 1421 memcpy( rpcCU->getEdgeCode( m_uiAbsIdxInLCU ), m_pucEdgeCode, iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1422 memcpy( rpcCU->getEdgeNumber() + m_uiAbsIdxInLCU, m_pucEdgeNumber, iSizeInUchar ); 1423 memcpy( rpcCU->getEdgeStartPos() + m_uiAbsIdxInLCU, m_pucEdgeStartPos,iSizeInUchar ); 1424 memcpy( rpcCU->getEdgeLeftFirst() + m_uiAbsIdxInLCU, m_pbEdgeLeftFirst,iSizeInBool ); 1425 memcpy( rpcCU->getEdgePartition( m_uiAbsIdxInLCU ), m_pbEdgePartition,iSizeInBool * 16 ); 1426 #if LGE_EDGE_INTRA_DELTA_DC 1427 memcpy( rpcCU->getEdgeDeltaDC0() + m_uiAbsIdxInLCU, m_piEdgeDeltaDC0, sizeof( Int ) * m_uiNumPartition ); 1428 memcpy( rpcCU->getEdgeDeltaDC1() + m_uiAbsIdxInLCU, m_piEdgeDeltaDC1, sizeof( Int ) * m_uiNumPartition ); 1429 #endif 1430 } 1431 #endif 1432 1354 1433 #if HHI_MPI 1355 1434 memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition ); … … 1455 1534 memcpy( rpcCU->getContourPredTexDeltaDC2() + uiPartOffset, m_piContourPredTexDeltaDC2, sizeof( Int ) * uiQNumPart ); 1456 1535 #endif 1536 1537 #if LGE_EDGE_INTRA 1538 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1539 { 1540 memcpy( rpcCU->getEdgeCode( uiPartOffset ), m_pucEdgeCode, iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1541 memcpy( rpcCU->getEdgeNumber() + uiPartOffset, m_pucEdgeNumber, iSizeInUchar ); 1542 memcpy( rpcCU->getEdgeStartPos() + uiPartOffset, m_pucEdgeStartPos,iSizeInUchar ); 1543 memcpy( rpcCU->getEdgeLeftFirst() + uiPartOffset, m_pbEdgeLeftFirst,iSizeInBool ); 1544 memcpy( rpcCU->getEdgePartition( uiPartOffset ), m_pbEdgePartition,iSizeInBool * 16 ); 1545 #if LGE_EDGE_INTRA_DELTA_DC 1546 memcpy( rpcCU->getEdgeDeltaDC0() + uiPartOffset, m_piEdgeDeltaDC0, sizeof( Int ) * uiQNumPart ); 1547 memcpy( rpcCU->getEdgeDeltaDC1() + uiPartOffset, m_piEdgeDeltaDC1, sizeof( Int ) * uiQNumPart ); 1548 #endif 1549 } 1550 #endif 1551 1457 1552 #if HHI_MPI 1458 1553 memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart ); … … 2332 2427 mapDMMtoIntraMode( iLeftIntraDir ); 2333 2428 #endif 2429 #if LGE_EDGE_INTRA 2430 mapEdgeIntratoDC( iLeftIntraDir ); 2431 #endif 2334 2432 2335 2433 // Get intra direction of above PU … … 2343 2441 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2344 2442 mapDMMtoIntraMode( iAboveIntraDir ); 2443 #endif 2444 #if LGE_EDGE_INTRA 2445 mapEdgeIntratoDC( iAboveIntraDir ); 2345 2446 #endif 2346 2447 … … 2426 2527 return uiPredNum; 2427 2528 } 2529 2530 #if LGE_EDGE_INTRA 2531 UInt TComDataCU::getCtxEdgeIntra( UInt uiAbsPartIdx ) 2532 { 2533 UInt uiCtx = 0; 2534 return uiCtx; 2535 } 2536 #endif 2428 2537 2429 2538 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) … … 2886 2995 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2887 2996 { 2888 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2889 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2890 2891 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 2892 { 2893 case SIZE_2NxN: 2894 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 2895 break; 2896 case SIZE_Nx2N: 2897 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 2898 break; 2899 case SIZE_NxN: 2900 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 2901 break; 2902 case SIZE_2NxnU: 2903 riWidth = getWidth(uiTmpAbsPartIdx); 2904 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 2905 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 2906 break; 2907 case SIZE_2NxnD: 2908 riWidth = getWidth(uiTmpAbsPartIdx); 2909 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 2910 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 2911 break; 2912 case SIZE_nLx2N: 2913 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 2914 riHeight = getHeight(uiTmpAbsPartIdx); 2915 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 2916 break; 2917 case SIZE_nRx2N: 2918 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 2919 riHeight = getHeight(uiTmpAbsPartIdx); 2920 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 2921 break; 2922 default: 2923 #if HHI_FIX 2997 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2998 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2999 3000 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 3001 { 3002 case SIZE_2NxN: 3003 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 3004 break; 3005 case SIZE_Nx2N: 3006 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 3007 break; 3008 case SIZE_NxN: 3009 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 3010 break; 3011 case SIZE_2NxnU: 3012 riWidth = getWidth(uiTmpAbsPartIdx); 3013 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 3014 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 3015 break; 3016 case SIZE_2NxnD: 3017 riWidth = getWidth(uiTmpAbsPartIdx); 3018 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 3019 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 3020 break; 3021 case SIZE_nLx2N: 3022 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 3023 riHeight = getHeight(uiTmpAbsPartIdx); 3024 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 3025 break; 3026 case SIZE_nRx2N: 3027 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 3028 riHeight = getHeight(uiTmpAbsPartIdx); 3029 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 3030 break; 3031 default: 2924 3032 assert ( m_pePartSize[uiTmpAbsPartIdx ] == SIZE_2Nx2N ); 2925 #else 2926 assert ( m_pePartSize[0] == SIZE_2Nx2N ); 2927 #endif 2928 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 2929 break; 2930 } 3033 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 3034 break; 3035 } 2931 3036 } 2932 3037 #else … … 2975 3080 Int TComDataCU::getResiPredMode(UInt uiPartAddr) 2976 3081 { 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 3082 Int iAddResiShift = -1; 3083 3084 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3085 { 3086 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3087 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3088 if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3089 iAddResiShift++; 3090 } 3091 3092 return iAddResiShift; 2988 3093 } 2989 3094 2990 3095 Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex) 2991 3096 { 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3097 UInt uiPartSize = getPartitionSize(uiAbsPartIndex); 3098 UInt uiPartAddr; 3099 Int iWidth, iHeight; 3100 Int iAddResiShift; 3101 3102 if(uiPartSize == SIZE_2Nx2N) 3103 { 3104 iAddResiShift = getResiPredMode(uiAbsPartIndex); 3105 for(UInt i = 0; i < 4; i++) 3106 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3107 return; 3108 } 3109 3110 if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD) 3111 { 3112 for(UInt i = 0; i < 2; i++) 3113 { 3114 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3115 uiPartAddr += uiAbsPartIndex; 3116 iAddResiShift = getResiPredMode(uiPartAddr); 3117 iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3118 } 3119 return; 3120 } 3121 3122 if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N) 3123 { 3124 for(UInt i = 0; i < 2; i++) 3125 { 3126 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3127 uiPartAddr += uiAbsPartIndex; 3128 iAddResiShift = getResiPredMode(uiPartAddr); 3129 iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3130 } 3131 return; 3132 } 3133 3134 if(uiPartSize == SIZE_NxN) 3135 { 3136 for(UInt i = 0; i < 4; i++) 3137 { 3138 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3139 uiPartAddr += uiAbsPartIndex; 3140 iAddResiShift = getResiPredMode(uiPartAddr); 3141 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3142 } 3143 } 3039 3144 3040 3145 } … … 3358 3463 TComMv acPdmMv [2]; 3359 3464 Int aiPdmRefIdx [2] = {-1, -1}; 3465 3466 #if LGE_DVMCP 3467 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 3468 #endif 3469 3470 #if QC_MULTI_DIS_CAN 3471 DisInfo cDisInfo; 3472 cDisInfo.iN = 0; 3473 if(!bNoPdmMerge) 3474 { 3475 #if LGE_DVMCP 3476 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true ); 3477 #else 3478 getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo ); 3479 #endif 3480 } 3481 if(cDisInfo.iN==0) 3482 { 3483 cDisInfo.iN = 1; 3484 cDisInfo.m_acMvCand[0].setHor(0); 3485 cDisInfo.m_acMvCand[0].setVer(0); 3486 cDisInfo.m_aVIdxCan[0] = 0; 3487 } 3488 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo ); 3489 #else 3360 3490 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3491 #endif 3361 3492 3362 3493 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 ) … … 3413 3544 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3414 3545 } 3546 #if LGE_DVMCP 3547 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3548 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3549 #endif 3415 3550 #if SIMP_MRG_PRUN 3416 3551 if ( mrgCandIdx == iCount ) … … 3485 3620 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3486 3621 } 3622 #if LGE_DVMCP 3623 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3624 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3625 #endif 3487 3626 #if SIMP_MRG_PRUN 3488 3627 if ( mrgCandIdx == iCount ) … … 3552 3691 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3553 3692 } 3693 #if LGE_DVMCP 3694 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3695 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3696 #endif 3554 3697 #if SIMP_MRG_PRUN 3555 3698 if ( mrgCandIdx == iCount ) … … 3616 3759 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3617 3760 } 3761 #if LGE_DVMCP 3762 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3763 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3764 #endif 3618 3765 #if SIMP_MRG_PRUN 3619 3766 if ( mrgCandIdx == iCount ) … … 3689 3836 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3690 3837 } 3838 #if LGE_DVMCP 3839 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3840 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3841 #endif 3691 3842 #if SIMP_MRG_PRUN 3692 3843 if ( mrgCandIdx == iCount ) … … 3805 3956 puhInterDirNeighbours[uiArrayAddr] = 1; 3806 3957 } 3958 #if LGE_DVMCP 3959 pcMvFieldNeighbours[uiArrayAddr<<1 ].getMv().m_bDvMcp = false; 3960 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false; 3961 #endif 3807 3962 #if SIMP_MRG_PRUN 3808 3963 if ( mrgCandIdx == iCount ) … … 4274 4429 return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]); 4275 4430 } 4431 #if QC_MULTI_DIS_CAN 4432 /** construct a list of disparity motion vectors from the neighbouring PUs **/ 4433 Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo ) 4434 { 4435 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4436 TComDataCU* pcTmpCU = NULL; 4437 pDInfo->iN = 0; 4438 4439 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4440 //-- Get Spatial MV 4441 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4442 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4443 4444 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 4445 deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 4446 4447 UInt uiIdx = 0; 4448 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4449 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4450 #else 4451 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 4452 #endif 4453 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4454 { 4455 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4456 { 4457 eRefPicList = RefPicList(iList); 4458 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4459 if( refId >= 0) 4460 { 4461 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4462 if (refViewIdx!= m_pcSlice->getViewId()) 4463 { 4464 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4465 clipMv(cMvPred); 4466 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4467 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4468 return; 4469 } 4470 } 4471 } 4472 } 4473 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4474 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 4475 #else 4476 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 4477 #endif 4478 4479 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4480 { 4481 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4482 { 4483 eRefPicList = RefPicList(iList); 4484 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4485 if( refId >= 0) 4486 { 4487 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4488 if (refViewIdx!= m_pcSlice->getViewId()) 4489 { 4490 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4491 clipMv(cMvPred); 4492 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4493 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4494 return; 4495 } 4496 } 4497 } 4498 } 4499 4500 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4501 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4502 #else 4503 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 4504 #endif 4505 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4506 { 4507 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4508 { 4509 eRefPicList = RefPicList(iList); 4510 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4511 if( refId >= 0) 4512 { 4513 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4514 if (refViewIdx!= m_pcSlice->getViewId()) 4515 { 4516 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4517 clipMv(cMvPred); 4518 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4519 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4520 return; 4521 } 4522 } 4523 } 4524 } 4525 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4526 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4527 #else 4528 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 4529 #endif 4530 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4531 { 4532 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4533 { 4534 eRefPicList = RefPicList(iList); 4535 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4536 if( refId >= 0) 4537 { 4538 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4539 if (refViewIdx!= m_pcSlice->getViewId()) 4540 { 4541 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4542 clipMv(cMvPred); 4543 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4544 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4545 return; 4546 } 4547 } 4548 } 4549 } 4550 4551 // Above predictor search 4552 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4553 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 4554 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4555 #else 4556 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 4557 #endif 4558 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4559 { 4560 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4561 { 4562 eRefPicList = RefPicList(iList); 4563 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4564 if( refId >= 0) 4565 { 4566 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4567 if (refViewIdx!= m_pcSlice->getViewId()) 4568 { 4569 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4570 clipMv(cMvPred); 4571 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4572 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4573 return; 4574 } 4575 } 4576 } 4577 } 4578 //Get temporal MV 4579 TComMv cColMv; 4580 Int iTargetViewIdx = 0; 4581 Int iTStartViewIdx = 0; 4582 UInt uiPartIdxRB, uiBRIdx; 4583 Int uiViewIdxCurr= getSlice()->getViewId(); 4584 4585 UInt uiAbsPartAddr; 4586 int uiLCUIdx = getAddr(); 4587 Int uiLCUnew = uiLCUIdx; 4588 eCUMode = getPartitionSize( 0 ); 4589 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 4590 uiBRIdx = uiPartIdxLT; 4591 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4592 if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() )) // image boundary check 4593 { 4594 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 4595 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 4596 { 4597 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 4598 } 4599 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 4600 { 4601 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 4602 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 4603 } 4604 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 4605 { 4606 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4607 uiLCUnew = uiLCUIdx + 1; 4608 } 4609 else //is the right bottom corner of LCU 4610 { 4611 uiBRIdx = 0; 4612 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 4613 } 4614 } 4615 4616 Int MaxRef = getSlice()->getNumRefIdx(RefPicList(0)); 4617 UInt uiNumPartInCUHeight = m_pcPic->getNumPartInHeight(); 4618 UInt uiPUVert = (UInt)((Int)g_auiZscanToRaster[uiPartIdxLB]/(Int)(uiNumPartInCUWidth)-(Int)g_auiZscanToRaster[uiPartIdxLT]/(Int)(uiNumPartInCUWidth)); 4619 UInt uiPUHorStart = g_auiZscanToRaster[uiPartIdxLT]; 4620 UInt uiPUHorEnd = g_auiZscanToRaster[uiPartIdxRT]; 4621 for( Int i= 0; i< getSlice()->getNumRefIdx(RefPicList(0)); i ++) 4622 { 4623 getSlice()->getRefPic( RefPicList(0), i)->setCandPicCheckedFlag(0); 4624 } 4625 for( Int i= 0; i< getSlice()->getNumRefIdx(RefPicList(1)); i ++) 4626 { 4627 getSlice()->getRefPic( RefPicList(1), i)->setCandPicCheckedFlag(0); 4628 } 4629 { 4630 //check the col-located picture 4631 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 4632 #if COLLOCATED_REF_IDX 4633 Int lpRef = getSlice()->getColRefIdx(); 4634 #else 4635 Int lpRef = 0; 4636 #endif 4637 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 4638 { 4639 if (uiViewIdxCurr > 1) 4640 { 4641 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4642 { 4643 clipMv(cColMv); 4644 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4645 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4646 return ; 4647 } 4648 } 4649 for(UInt uiLoopVert = 0; uiLoopVert <= uiPUVert; uiLoopVert+=4) 4650 for( uiIdx = uiPUHorStart; uiIdx <= uiPUHorEnd; uiIdx +=4 ) 4651 { 4652 uiAbsPartAddr = g_auiRasterToZscan[uiIdx+uiNumPartInCUWidth*uiLoopVert]; 4653 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4654 { 4655 clipMv(cColMv); 4656 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4657 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4658 return ; 4659 } 4660 } 4661 for(UInt uiIdx_y = 0; uiIdx_y <uiNumPartInCUHeight; uiIdx_y +=4 ) 4662 for(UInt uiIdx_X = 0; uiIdx_X <uiNumPartInCUWidth; uiIdx_X +=4 ) 4663 { 4664 uiIdx = uiIdx_X + uiIdx_y * uiNumPartInCUWidth; 4665 uiAbsPartAddr = g_auiRasterToZscan[uiIdx]; 4666 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4667 { 4668 clipMv(cColMv); 4669 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4670 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4671 return ; 4672 } 4673 } 4674 if (uiViewIdxCurr == 1) 4675 { 4676 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4677 { 4678 clipMv(cColMv); 4679 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4680 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4681 return ; 4682 } 4683 } 4684 } 4685 getSlice()->getRefPic( eRefPicList, lpRef)->setCandPicCheckedFlag(1); 4686 } 4687 { 4688 //check the remaining reference pictures in list0 and list1 4689 if(getSlice()->isInterB()) 4690 { 4691 if(getSlice()->getNumRefIdx(RefPicList(0))< getSlice()->getNumRefIdx(RefPicList(1))) 4692 MaxRef = getSlice()->getNumRefIdx(RefPicList(1)); 4693 } 4694 for(Int lpRef = 0; lpRef < MaxRef; lpRef++) 4695 { 4696 for(Int lpNr = 0; lpNr < (getSlice()->isInterB() ? 2: 1); lpNr ++) 4697 { 4698 eRefPicList = RefPicList(0); 4699 if(getSlice()->isInterB()) 4700 eRefPicList = RefPicList(lpNr==0 ? (getSlice()->getColDir()): (1-getSlice()->getColDir())); 4701 if(getSlice()->getRefPic( eRefPicList, lpRef)->getCandPicCheckedFlag()) 4702 continue; 4703 4704 if(lpRef >= getSlice()->getNumRefIdx(eRefPicList)||(m_pcSlice->getViewId() != getSlice()->getRefPic( eRefPicList, lpRef)->getViewId())) 4705 continue; 4706 if (uiViewIdxCurr > 1 ) 4707 { 4708 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4709 { 4710 clipMv(cColMv); 4711 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4712 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4713 return ; 4714 } 4715 } 4716 for(UInt uiLoopVert = 0; uiLoopVert <= uiPUVert; uiLoopVert += 4) 4717 for( uiIdx = uiPUHorStart; uiIdx <= uiPUHorEnd; uiIdx += 4 ) 4718 { 4719 uiAbsPartAddr = g_auiRasterToZscan[uiIdx+uiNumPartInCUWidth*uiLoopVert]; 4720 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4721 { 4722 clipMv(cColMv); 4723 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4724 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4725 return ; 4726 } 4727 } 4728 for(UInt uiIdx_y = 0; uiIdx_y <uiNumPartInCUHeight; uiIdx_y += 4 ) 4729 for(UInt uiIdx_X = 0; uiIdx_X <uiNumPartInCUWidth; uiIdx_X += 4 ) 4730 { 4731 uiIdx = uiIdx_X + uiIdx_y * uiNumPartInCUWidth; 4732 uiAbsPartAddr = g_auiRasterToZscan[uiIdx]; 4733 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4734 { 4735 clipMv(cColMv); 4736 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4737 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4738 return ; 4739 } 4740 } 4741 if (uiViewIdxCurr == 1 ) 4742 { 4743 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4744 { 4745 clipMv(cColMv); 4746 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4747 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4748 return ; 4749 } 4750 } 4751 getSlice()->getRefPic( eRefPicList, lpRef)->setCandPicCheckedFlag(1); 4752 }//reference lists 4753 }//reference indices 4754 }//remaining pictures 4755 } 4756 4757 #if LGE_DVMCP 4758 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 ) 4759 { 4760 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4761 TComDataCU* pcTmpCU = NULL; 4762 TComDataCU* pcCULeft = NULL; 4763 pDInfo->iN = 0; 4764 4765 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4766 //-- Get Spatial MV 4767 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4768 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4769 4770 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºí·°¿¡¼ »ç¿ëµÈ DV¸¦ ÀúÀå 4771 Bool abDvMcpFlag [2][7] = {{false,},{false,}}; 4772 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug 4773 TComMv cTmpMvPred, cMv; 4774 Bool bTmpIsSkipped = false; 4775 Bool bDvMcpIsFound = false; 4776 4777 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 4778 deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 4779 4780 UInt uiIdx = 0; 4781 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4782 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4783 #else 4784 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 4785 #endif 4786 4787 pcCULeft = pcTmpCU; 4788 UInt uiLeftPartIdx = uiIdx; 4789 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4790 { 4791 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4792 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4793 { 4794 eRefPicList = RefPicList(iList); 4795 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4796 if( refId >= 0) 4797 { 4798 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4799 if (refViewIdx!= m_pcSlice->getViewId()) // DCP 4800 { 4801 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4802 clipMv(cMvPred); 4803 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4804 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4805 return; 4806 } 4807 else // MCP 4808 { 4809 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4810 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4811 { 4812 aiDvMcpDvCand[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX; 4813 abDvMcpFlag [iList][DVFROM_LEFT] = true; 4814 bDvMcpIsFound = true; 4815 } 4816 } 4817 } 4818 } 4819 } 4820 4821 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4822 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 4823 #else 4824 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 4825 #endif 4826 4827 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4828 { 4829 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4830 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4831 { 4832 eRefPicList = RefPicList(iList); 4833 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4834 if( refId >= 0) 4835 { 4836 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4837 if (refViewIdx!= m_pcSlice->getViewId()) 4838 { 4839 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4840 clipMv(cMvPred); 4841 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4842 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4843 return; 4844 } 4845 else // MCP 4846 { 4847 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4848 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4849 { 4850 aiDvMcpDvCand[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX; 4851 abDvMcpFlag [iList][DVFROM_ABOVE] = true; 4852 bDvMcpIsFound = true; 4853 } 4854 } 4855 } 4856 } 4857 } 4858 4859 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4860 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4861 #else 4862 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 4863 #endif 4864 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4865 { 4866 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4867 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4868 { 4869 eRefPicList = RefPicList(iList); 4870 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4871 if( refId >= 0) 4872 { 4873 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4874 if (refViewIdx!= m_pcSlice->getViewId()) 4875 { 4876 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4877 clipMv(cMvPred); 4878 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4879 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4880 return; 4881 } 4882 else // MCP 4883 { 4884 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4885 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4886 { 4887 aiDvMcpDvCand[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX; 4888 abDvMcpFlag [iList][DVFROM_ABOVERIGHT] = true; 4889 bDvMcpIsFound = true; 4890 } 4891 } 4892 } 4893 } 4894 } 4895 4896 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4897 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4898 #else 4899 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 4900 #endif 4901 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4902 { 4903 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4904 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4905 { 4906 eRefPicList = RefPicList(iList); 4907 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4908 if( refId >= 0) 4909 { 4910 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4911 if (refViewIdx!= m_pcSlice->getViewId()) 4912 { 4913 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4914 clipMv(cMvPred); 4915 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4916 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4917 return; 4918 } 4919 else // MCP 4920 { 4921 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4922 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4923 { 4924 aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX; 4925 abDvMcpFlag [iList][DVFROM_LEFTBELOW] = true; 4926 bDvMcpIsFound = true; 4927 } 4928 } 4929 } 4930 } 4931 } 4932 4933 // Above predictor search 4934 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4935 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 4936 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4937 #else 4938 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 4939 #endif 4940 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4941 { 4942 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4943 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4944 { 4945 eRefPicList = RefPicList(iList); 4946 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4947 if( refId >= 0) 4948 { 4949 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4950 if (refViewIdx!= m_pcSlice->getViewId()) 4951 { 4952 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4953 clipMv(cMvPred); 4954 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4955 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4956 return; 4957 } 4958 else // MCP 4959 { 4960 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4961 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4962 { 4963 aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX; 4964 abDvMcpFlag [iList][DVFROM_ABOVELEFT] = true; 4965 bDvMcpIsFound = true; 4966 } 4967 } 4968 } 4969 } 4970 } 4971 4972 // copied from getInterMergeCand() 4973 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 4974 { 4975 UInt uiPUIdx = uiPartIdx; 4976 UInt uiAbsPartAddr = uiPartAddr; 4977 4978 // col [2] 4979 Int iRefIdxSkip[2] = {-1, -1}; 4980 if( !bMerge ) 4981 { 4982 iRefIdxSkip[ eRefPicList0 ] = iRefIdx0; 4983 } 4984 else 4985 { 4986 for (Int i=0; i<2; i++) 4987 { 4988 RefPicList eRefPicList1 = ( i==1 ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4989 #if SET_MERGE_TMVP_REFIDX 4990 Int iRefIdxTmp; 4991 if ( uiPUIdx != 0 ) 4992 { 4993 iRefIdxTmp = 0; 4994 } 4995 else 4996 { 4997 iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1; 4998 } 4999 #else 5000 Int iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1; 5001 #endif 5002 iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0; 5003 } 5004 } 5005 5006 //>> MTK colocated-RightBottom 5007 UInt uiPartIdxRB; 5008 Int uiLCUIdx = getAddr(); 5009 eCUMode = getPartitionSize( 0 ); 5010 5011 deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB ); 5012 5013 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5014 //UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 5015 5016 TComMv cColMv; 5017 Int iRefIdx; 5018 5019 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 5020 { 5021 uiLCUIdx = -1; 5022 } 5023 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5024 { 5025 uiLCUIdx = -1; 5026 } 5027 else 5028 { 5029 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5030 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5031 { 5032 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5033 uiLCUIdx = getAddr(); 5034 } 5035 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5036 { 5037 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5038 uiLCUIdx = -1 ; 5039 } 5040 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5041 { 5042 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5043 uiLCUIdx = getAddr() + 1; 5044 } 5045 else //is the right bottom corner of LCU 5046 { 5047 uiAbsPartAddr = 0; 5048 uiLCUIdx = -1 ; 5049 } 5050 } 5051 5052 Bool bExistMV = false; 5053 UInt uiPartIdxCenter; 5054 UInt uiCurLCUIdx = getAddr(); 5055 xDeriveCenterIdx( eCUMode, uiPUIdx, uiPartIdxCenter ); 5056 5057 Int iTargetView, iStartView; 5058 if( !bMerge ) // AMVP 5059 { 5060 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( eRefPicList0, iRefIdx0, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5061 if( bExistMV == false ) 5062 { 5063 bExistMV = xGetColDisMV( eRefPicList0, iRefIdx0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5064 } 5065 if( bExistMV ) // DV is found 5066 { 5067 if( cColMv.m_bDvMcp == false ) //=> DCP, if true => DV-MCP 5068 { 5069 clipMv(cColMv); 5070 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5071 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5072 return; 5073 } 5074 else // DV-MCP 5075 { 5076 aiDvMcpDvCand[eRefPicList0][DVFROM_COL] = cColMv.getHor(); 5077 abDvMcpFlag [eRefPicList0][DVFROM_COL] = true; 5078 bDvMcpIsFound = true; 5079 } 5080 } 5081 } 5082 else // MERGE 5083 { 5084 iRefIdx = iRefIdxSkip[0]; 5085 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5086 if( bExistMV == false ) 5087 { 5088 bExistMV = xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5089 } 5090 if( bExistMV ) 5091 { 5092 if( cColMv.m_bDvMcp == false ) // DCP 5093 { 5094 clipMv(cColMv); 5095 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5096 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5097 return; 5098 } 5099 else { // // DV-MCP 5100 aiDvMcpDvCand[0][DVFROM_COL] = cColMv.getHor(); 5101 abDvMcpFlag [0][DVFROM_COL] = true; 5102 bDvMcpIsFound = true; 5103 }; 5104 5105 if ( getSlice()->isInterB() ) 5106 { 5107 iRefIdx = iRefIdxSkip[1]; 5108 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5109 if( bExistMV == false ) 5110 { 5111 bExistMV = xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5112 } 5113 if( bExistMV ) 5114 { 5115 if( cColMv.m_bDvMcp == false ) // DCP 5116 { 5117 clipMv(cColMv); 5118 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5119 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5120 return; 5121 } 5122 else // DV-MCP 5123 { 5124 aiDvMcpDvCand[1][DVFROM_COL] = cColMv.getHor(); 5125 abDvMcpFlag [1][DVFROM_COL] = true; 5126 bDvMcpIsFound = true; 5127 }; 5128 } 5129 } 5130 } 5131 } 5132 } // if TMVP Flag 5133 5134 if( bDvMcpIsFound ) // skip dvmcp 5135 { 5136 for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal 5137 { 5138 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5139 { 5140 if( abDvMcpFlag[iList][i]==true ) 5141 { 5142 TComMv dv( aiDvMcpDvCand[iList][ i ], 0 ); 5143 clipMv( dv ); 5144 pDInfo->m_acMvCand[ pDInfo->iN ] = dv; 5145 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 5146 return; 5147 } 5148 5149 } 5150 } 5151 } 5152 5153 return; 5154 5155 } 5156 #endif 5157 5158 #endif 4276 5159 4277 5160 /** Constructs a list of candidates for AMVP … … 4295 5178 } 4296 5179 5180 #if QC_MULTI_DIS_CAN 5181 DisInfo cDisInfo; 5182 cDisInfo.iN = 0; 5183 if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5184 { 5185 #if LGE_DVMCP 5186 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 5187 #else 5188 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); 5189 #endif 5190 } 5191 if(cDisInfo.iN==0) 5192 { 5193 cDisInfo.iN = 1; 5194 cDisInfo.m_acMvCand[0].setHor(0); 5195 cDisInfo.m_acMvCand[0].setVer(0); 5196 cDisInfo.m_aVIdxCan[0] = 0; 5197 } 5198 #endif 4297 5199 #if HHI_INTER_VIEW_MOTION_PRED 4298 5200 #if ( PDM_AMVP_POS == 0 ) 4299 5201 // get inter-view mv predictor (at position 0) 4300 5202 TComMv cPdmMvPred; 5203 #if QC_MULTI_DIS_CAN 5204 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5205 #else 4301 5206 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5207 #endif 4302 5208 { 4303 5209 clipMv( cPdmMvPred ); … … 4354 5260 // get inter-view mv predictor (at position 1) 4355 5261 TComMv cPdmMvPred; 5262 #if QC_MULTI_DIS_CAN 5263 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5264 #else 4356 5265 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5266 #endif 4357 5267 { 4358 5268 clipMv( cPdmMvPred ); … … 4402 5312 // get inter-view mv predictor (at position 2) 4403 5313 TComMv cPdmMvPred; 5314 #if QC_MULTI_DIS_CAN 5315 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5316 #else 4404 5317 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5318 #endif 4405 5319 { 4406 5320 clipMv( cPdmMvPred ); … … 4418 5332 } 4419 5333 } 5334 #if QC_MULTI_DIS_CAN 5335 if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 ) 5336 { 5337 if ( pInfo->m_acMvCand[ 1 ] == pInfo->m_acMvCand[ 2 ] ) 5338 { 5339 pInfo->iN = 2; 5340 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] ) 5341 pInfo->iN = 1; 5342 } 5343 else 5344 { 5345 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] ) 5346 { 5347 pInfo->m_acMvCand[1 ] = pInfo->m_acMvCand[ 2 ]; 5348 pInfo->iN = 2; 5349 } 5350 else if (pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 2 ]) 5351 { 5352 pInfo->iN = 2; 5353 } 5354 } 5355 } 5356 #endif 4420 5357 #endif 4421 5358 … … 4488 5425 // get inter-view mv predictor (at position 3) 4489 5426 TComMv cPdmMvPred; 5427 #if QC_MULTI_DIS_CAN 5428 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5429 #else 4490 5430 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5431 #endif 4491 5432 { 4492 5433 clipMv( cPdmMvPred ); … … 4674 5615 { 4675 5616 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4676 5617 #if LGE_DVMCP 5618 cMvPred.m_bDvMcp = false; 5619 #endif 4677 5620 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; 4678 5621 return true; … … 4709 5652 { 4710 5653 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 5654 #if LGE_DVMCP 5655 cMvPred.m_bDvMcp = false; 5656 #endif 4711 5657 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; 4712 5658 return true; … … 4840 5786 Int iNeibRefPOC; 4841 5787 4842 #if HHI_FIX4843 5788 if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 ) 4844 5789 { … … 4849 5794 { 4850 5795 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 4851 5796 #if LGE_DVMCP 5797 cMvPred.m_bDvMcp = false; 5798 #endif 4852 5799 clipMv(cMvPred); 4853 5800 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; … … 4855 5802 } 4856 5803 } 4857 #endif 5804 4858 5805 //--------------- V1 (END) ------------------// 4859 5806 if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0) … … 4877 5824 rcMv = cMvPred.scaleMv( iScale ); 4878 5825 } 5826 #if LGE_DVMCP 5827 rcMv.m_bDvMcp = false; 5828 #endif 4879 5829 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 4880 5830 return true; … … 4901 5851 rcMv = cMvPred.scaleMv( iScale ); 4902 5852 } 5853 #if LGE_DVMCP 5854 rcMv.m_bDvMcp = false; 5855 #endif 4903 5856 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 4904 5857 return true; … … 4908 5861 } 4909 5862 5863 #if QC_MULTI_DIS_CAN 5864 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5865 { 5866 #if LGE_DVMCP 5867 Int iDvMcpDispX[2] = {-1,}; 5868 Bool bDvMcpFlag [2] = { false, }; 5869 Int iCurrViewIdx = m_pcSlice->getViewId(); 5870 #endif 5871 5872 UInt uiAbsPartAddr = uiPartUnitIdx; 5873 5874 RefPicList eColRefPicList = REF_PIC_LIST_0; 5875 Int iColViewIdx, iColRefViewIdx; 5876 TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx); 5877 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 5878 iColViewIdx = pColCU->getSlice()->getViewId(); 5879 5880 5881 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr)) 5882 { 5883 return false; 5884 } 5885 #if LGE_DVMCP 5886 Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr ); 5887 #endif 5888 for (Int ilist = 0; ilist < (pColCU->getSlice()->isInterB()? 2:1); ilist++) 5889 { 5890 if(pColCU->getSlice()->isInterB()) 5891 { 5892 if(ilist == 0 ) 5893 eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(1-getSlice()->getColDir()); 5894 else 5895 eColRefPicList = getSlice()->getCheckLDC() ? (eRefPicList== REF_PIC_LIST_0? REF_PIC_LIST_1:REF_PIC_LIST_0 ): RefPicList(getSlice()->getColDir()); 5896 } 5897 5898 Int iColRefIdx = pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr); 5899 5900 if (iColRefIdx < 0) 5901 { 5902 continue; 5903 } 5904 5905 iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewId(); 5906 5907 if ( iColViewIdx == iColRefViewIdx ) // temporal vector 5908 { 5909 #if LGE_DVMCP 5910 if( iColViewIdx >0 ) 5911 { 5912 TComMv tmpMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 5913 if( tmpMv.m_bDvMcp && bColIsSkipped ) // DV-MCP SKIP 5914 { 5915 iDvMcpDispX[ilist] = tmpMv.m_iDvMcpDispX; 5916 bDvMcpFlag [ilist] = true; 5917 iTargetViewIdx = 0; //iColRefViewIdx ; 5918 iStartViewIdx = 0; //iCurrViewIdx; //iColViewIdx ; 5919 } 5920 } 5921 #endif 5922 continue; 5923 } 5924 else 5925 { 5926 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 5927 #if LGE_DVMCP 5928 rcMv.m_bDvMcp = false; 5929 #endif 5930 iTargetViewIdx = iColRefViewIdx ; 5931 iStartViewIdx = iColViewIdx ; 5932 return true; 5933 } 5934 } 5935 5936 #if LGE_DVMCP 5937 for( Int ilist=0 ; ilist<2 ; ilist++ ) 5938 { 5939 if( bDvMcpFlag[ilist] ) 5940 { 5941 rcMv.setHor( iDvMcpDispX[ilist] ); 5942 rcMv.setVer( 0 ); 5943 rcMv.m_bDvMcp = true; 5944 iTargetViewIdx = 0; //iColRefViewIdx ; 5945 iStartViewIdx = iCurrViewIdx; //iColViewIdx ; 5946 return true; 5947 } 5948 } 5949 #endif 5950 5951 return false; 5952 } 5953 #endif 4910 5954 /** 4911 5955 * \param eRefPicList … … 4984 6028 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 4985 6029 #else 4986 #if HHI_FIX4987 6030 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() ) 4988 #else4989 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != m_pcSlice->getRefPic( eRefPicList, riRefIdx )->getViewId() )4990 #endif4991 6031 { 4992 6032 return false; … … 5004 6044 else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)) 5005 6045 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 5006 #if HHI_FIX //GT: fix reported by Sony5007 6046 else 5008 6047 return false; 5009 #endif 6048 5010 6049 #else 5011 6050 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 5951 6990 // ------------------------------------------------------------------------------------------------------------------- 5952 6991 #if HHI_INTER_VIEW_MOTION_PRED 6992 #if !QC_MULTI_DIS_CAN 5953 6993 Int 5954 6994 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 5967 7007 return pcDepthMapGenerator->getPdmMvPred( this, uiPartIdx, eRefPicList, iRefIdx, rcMv, bMerge ); 5968 7008 } 7009 #else 7010 Int 7011 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 7012 { 7013 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7014 ROFRS( pcDepthMapGenerator, 0 ); 7015 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo ); 7016 } 7017 Bool 7018 TComDataCU::getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 7019 { 7020 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7021 ROFRS( pcDepthMapGenerator, false ); 7022 if (pDInfo->iN > 0 && pcDepthMapGenerator->getDisCanPdmMvPred(this, uiPartIdx, eRefPicList, iRefIdx, rcMv, pDInfo, bMerge )) //bug fix li 7023 return true; 7024 return false; 7025 } 7026 #endif 5969 7027 5970 7028 … … 5988 7046 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 5989 7047 ROFRS( pcResidualGenerator, false ); 7048 #if QC_MULTI_DIS_CAN 7049 DisInfo cDisInfo; 7050 cDisInfo.iN = 0; 7051 PartSize m_peSaved = getPartitionSize( 0 ); 7052 m_pePartSize[0] = SIZE_2Nx2N; 7053 #if LGE_DVMCP 7054 getDisMvpCand2( 0, 0, &cDisInfo, true ); 7055 #else 7056 getDisMvpCand ( 0, 0, &cDisInfo ); 7057 #endif 7058 if( cDisInfo.iN == 0) 7059 { 7060 m_pePartSize[0] = m_peSaved; 7061 return false; 7062 } 7063 else 7064 { 7065 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor() 7066 #if QC_SIMPLIFIEDIVRP_M24938 7067 , bRecon 7068 #endif 7069 ); 7070 m_pePartSize[0] = m_peSaved; 7071 return bAvailable; 7072 } 7073 #else 5990 7074 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv 5991 7075 #if QC_SIMPLIFIEDIVRP_M24938 … … 5993 7077 #endif 5994 7078 ); 5995 } 7079 #endif 7080 } 7081 #endif 7082 7083 #if LGE_EDGE_INTRA 7084 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) 7085 { 7086 Int iWidth; 7087 Int iHeight; 7088 if( uiDepth == 0 ) 7089 { 7090 iWidth = 64; 7091 iHeight = 64; 7092 } 7093 else if( uiDepth == 1 ) 7094 { 7095 iWidth = 32; 7096 iHeight = 32; 7097 } 7098 else if( uiDepth == 2 ) 7099 { 7100 iWidth = 16; 7101 iHeight = 16; 7102 } 7103 else if( uiDepth == 3 ) 7104 { 7105 iWidth = 8; 7106 iHeight = 8; 7107 } 7108 else // uiDepth == 4 7109 { 7110 iWidth = 4; 7111 iHeight = 4; 7112 } 7113 7114 Int iPtr = 0; 7115 Int iX, iY; 7116 Int iDir = -1; 7117 Int iDiffX = 0, iDiffY = 0; 7118 7119 // 1. Edge Code -> Vert & Horz Edges 7120 Bool* pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight ); 7121 7122 for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ ) 7123 pbEdge [ ui ] = false; 7124 7125 // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7) 7126 // Code : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6) 7127 const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 }, 7128 { 1, 5, 7, 2, 3, 4, 6 }, 7129 { 2, 4, 5, 0, 1, 6, 7 }, 7130 { 3, 7, 6, 1, 0, 5, 4 }, 7131 { 4, 0, 2, 6, 5, 3, 1 }, 7132 { 5, 2, 1, 4, 7, 0, 3 }, 7133 { 6, 3, 0, 7, 4, 1, 2 }, 7134 { 7, 1, 3, 5, 6, 2, 0 }}; 7135 7136 UChar ucCode = pucEdgeCode[iPtr++]; 7137 7138 if( !bLeft ) 7139 { 7140 iX = ucStartPos; 7141 iY = 0; 7142 7143 switch(ucCode) 7144 { 7145 case 0: // bottom 7146 iDir = 3; 7147 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7148 break; 7149 case 2: // left-bottom 7150 iDir = 6; 7151 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7152 break; 7153 case 1: // right-bottom 7154 iDir = 7; 7155 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7156 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7157 break; 7158 case 4: // left 7159 iDir = 0; 7160 assert(false); 7161 break; 7162 case 3: // right 7163 iDir = 1; 7164 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7165 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7166 break; 7167 } 7168 } 7169 else 7170 { 7171 iX = 0; 7172 iY = ucStartPos; 7173 7174 switch(ucCode) 7175 { 7176 case 0: // right 7177 iDir = 1; 7178 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7179 break; 7180 case 1: // right-top 7181 iDir = 5; 7182 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7183 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7184 break; 7185 case 2: // right-bottom 7186 iDir = 7; 7187 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7188 break; 7189 case 3: // top 7190 iDir = 2; 7191 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7192 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7193 break; 7194 case 4: // bottom 7195 iDir = 3; 7196 assert(false); 7197 break; 7198 } 7199 } 7200 7201 switch( iDir ) 7202 { 7203 case 0: // left 7204 iDiffX = -1; 7205 iDiffY = 0; 7206 break; 7207 case 1: // right 7208 iDiffX = +1; 7209 iDiffY = 0; 7210 break; 7211 case 2: // top 7212 iDiffX = 0; 7213 iDiffY = -1; 7214 break; 7215 case 3: // bottom 7216 iDiffX = 0; 7217 iDiffY = +1; 7218 break; 7219 case 4: // left-top 7220 iDiffX = -1; 7221 iDiffY = -1; 7222 break; 7223 case 5: // right-top 7224 iDiffX = +1; 7225 iDiffY = -1; 7226 break; 7227 case 6: // left-bottom 7228 iDiffX = -1; 7229 iDiffY = +1; 7230 break; 7231 case 7: // right-bottom 7232 iDiffX = +1; 7233 iDiffY = +1; 7234 break; 7235 } 7236 7237 iX += iDiffX; 7238 iY += iDiffY; 7239 7240 while( iPtr < ucNumEdge ) 7241 { 7242 ucCode = pucEdgeCode[iPtr++]; 7243 7244 Int iNewDir = tableDir[iDir][ucCode]; 7245 7246 switch( iNewDir ) 7247 { 7248 case 0: // left 7249 iDiffX = -1; 7250 iDiffY = 0; 7251 break; 7252 case 1: // right 7253 iDiffX = +1; 7254 iDiffY = 0; 7255 break; 7256 case 2: // top 7257 iDiffX = 0; 7258 iDiffY = -1; 7259 break; 7260 case 3: // bottom 7261 iDiffX = 0; 7262 iDiffY = +1; 7263 break; 7264 case 4: // left-top 7265 iDiffX = -1; 7266 iDiffY = -1; 7267 break; 7268 case 5: // right-top 7269 iDiffX = +1; 7270 iDiffY = -1; 7271 break; 7272 case 6: // left-bottom 7273 iDiffX = -1; 7274 iDiffY = +1; 7275 break; 7276 case 7: // right-bottom 7277 iDiffX = +1; 7278 iDiffY = +1; 7279 break; 7280 } 7281 7282 switch( iDir ) 7283 { 7284 case 0: // left 7285 switch( ucCode ) 7286 { 7287 case 0: 7288 case 2: 7289 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7290 break; 7291 case 1: 7292 case 3: 7293 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7294 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7295 break; 7296 case 4: 7297 case 6: 7298 // no 7299 break; 7300 case 5: 7301 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7302 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7303 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7304 break; 7305 } 7306 break; 7307 case 1: // right 7308 switch( ucCode ) 7309 { 7310 case 0: 7311 case 2: 7312 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7313 break; 7314 case 1: 7315 case 3: 7316 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7317 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7318 break; 7319 case 4: 7320 case 6: 7321 // no 7322 break; 7323 case 5: 7324 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7325 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7326 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7327 break; 7328 } 7329 break; 7330 case 2: // top 7331 switch( ucCode ) 7332 { 7333 case 0: 7334 case 2: 7335 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7336 break; 7337 case 1: 7338 case 3: 7339 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7340 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7341 break; 7342 case 4: 7343 case 6: 7344 // no 7345 break; 7346 case 5: 7347 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7348 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7349 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7350 break; 7351 } 7352 break; 7353 case 3: // bottom 7354 switch( ucCode ) 7355 { 7356 case 0: 7357 case 2: 7358 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7359 break; 7360 case 1: 7361 case 3: 7362 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7363 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7364 break; 7365 case 4: 7366 case 6: 7367 // no 7368 break; 7369 case 5: 7370 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7371 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7372 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7373 break; 7374 } 7375 break; 7376 case 4: // left-top 7377 switch( ucCode ) 7378 { 7379 case 0: 7380 case 1: 7381 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7382 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7383 break; 7384 case 2: 7385 case 4: 7386 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7387 break; 7388 case 3: 7389 case 5: 7390 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7391 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7392 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7393 break; 7394 case 6: 7395 // no 7396 break; 7397 } 7398 break; 7399 case 5: // right-top 7400 switch( ucCode ) 7401 { 7402 case 0: 7403 case 1: 7404 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7405 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7406 break; 7407 case 2: 7408 case 4: 7409 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7410 break; 7411 case 3: 7412 case 5: 7413 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7414 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7415 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7416 break; 7417 case 6: 7418 // no 7419 break; 7420 } 7421 break; 7422 case 6: // left-bottom 7423 switch( ucCode ) 7424 { 7425 case 0: 7426 case 1: 7427 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7428 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7429 break; 7430 case 2: 7431 case 4: 7432 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7433 break; 7434 case 3: 7435 case 5: 7436 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7437 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7438 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7439 break; 7440 case 6: 7441 // no 7442 break; 7443 } 7444 break; 7445 case 7: // right-bottom 7446 switch( ucCode ) 7447 { 7448 case 0: 7449 case 1: 7450 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7451 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7452 break; 7453 case 2: 7454 case 4: 7455 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7456 break; 7457 case 3: 7458 case 5: 7459 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7460 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7461 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7462 break; 7463 case 6: 7464 // no 7465 break; 7466 } 7467 break; 7468 } 7469 7470 assert( iX >= 0 && iX <= iWidth ); 7471 assert( iY >= 0 && iY <= iHeight ); 7472 7473 iX += iDiffX; 7474 iY += iDiffY; 7475 iDir = iNewDir; 7476 } 7477 7478 // finalize edge chain 7479 if( iX == iWidth-1 ) 7480 { 7481 if( iY == 0 ) 7482 { 7483 if( iDir == 1 ) 7484 { 7485 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7486 } 7487 else if( iDir == 5 ) 7488 { 7489 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7490 } 7491 else 7492 { 7493 assert(false); 7494 } 7495 } 7496 else if( iY == iHeight-1 ) 7497 { 7498 if( iDir == 3 ) 7499 { 7500 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7501 } 7502 else if( iDir == 7 ) 7503 { 7504 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7505 } 7506 else 7507 { 7508 assert(false); 7509 } 7510 } 7511 else 7512 { 7513 if( iDir == 1 ) 7514 { 7515 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7516 } 7517 else if( iDir == 3 ) 7518 { 7519 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7520 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7521 } 7522 else if( iDir == 5 ) 7523 { 7524 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7525 } 7526 else if( iDir == 7 ) 7527 { 7528 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7529 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7530 } 7531 else 7532 { 7533 assert(false); 7534 } 7535 } 7536 } 7537 else if( iX == 0 ) 7538 { 7539 if( iY == 0 ) 7540 { 7541 if( iDir == 2 ) 7542 { 7543 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7544 } 7545 else if( iDir == 4 ) 7546 { 7547 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7548 } 7549 else 7550 { 7551 assert(false); 7552 } 7553 } 7554 else if( iY == iHeight-1 ) 7555 { 7556 if( iDir == 0 ) 7557 { 7558 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7559 } 7560 else if( iDir == 6 ) 7561 { 7562 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7563 } 7564 else 7565 { 7566 assert(false); 7567 } 7568 } 7569 else 7570 { 7571 if( iDir == 0 ) 7572 { 7573 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7574 } 7575 else if( iDir == 2 ) 7576 { 7577 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7578 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7579 } 7580 else if( iDir == 4 ) 7581 { 7582 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7583 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7584 } 7585 else if( iDir == 6 ) 7586 { 7587 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7588 } 7589 else 7590 { 7591 assert(false); 7592 } 7593 } 7594 } 7595 else if( iY == 0 ) 7596 { 7597 if( iDir == 1 ) 7598 { 7599 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7600 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7601 } 7602 else if( iDir == 2 ) 7603 { 7604 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7605 } 7606 else if( iDir == 4 ) 7607 { 7608 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7609 } 7610 else if( iDir == 5 ) 7611 { 7612 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7613 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7614 } 7615 else 7616 { 7617 assert(false); 7618 } 7619 } 7620 else if( iY == iHeight-1 ) 7621 { 7622 if( iDir == 0 ) 7623 { 7624 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7625 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7626 } 7627 else if( iDir == 3 ) 7628 { 7629 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7630 } 7631 else if( iDir == 6 ) 7632 { 7633 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7634 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7635 } 7636 else if( iDir == 7 ) 7637 { 7638 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7639 } 7640 else 7641 { 7642 assert(false); 7643 } 7644 } 7645 else 7646 { 7647 printf("xPredIntraEdge: wrong termination\n"); 7648 assert(false); 7649 } 7650 7651 // Reconstruct Region from Chain Code 7652 Bool* pbVisit = (Bool*) xMalloc( Bool, iWidth * iHeight ); 7653 Int* piStack = (Int* ) xMalloc( Int, iWidth * iHeight ); 7654 7655 for( UInt ui = 0; ui < iWidth * iHeight; ui++ ) 7656 { 7657 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next) 7658 pbVisit [ ui ] = false; 7659 } 7660 7661 iPtr = 0; 7662 piStack[iPtr++] = (0 << 8) | (0); 7663 pbRegion[ 0 ] = false; 7664 7665 while(iPtr > 0) 7666 { 7667 Int iTmp = piStack[--iPtr]; 7668 Int iX1, iY1; 7669 iX1 = iTmp & 0xff; 7670 iY1 = (iTmp >> 8) & 0xff; 7671 7672 pbVisit[ iX1 + iY1 * iWidth ] = true; 7673 7674 assert( iX1 >= 0 && iX1 < iWidth ); 7675 assert( iY1 >= 0 && iY1 < iHeight ); 7676 7677 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] ) 7678 { 7679 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1); 7680 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false; 7681 } 7682 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] ) 7683 { 7684 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1); 7685 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false; 7686 } 7687 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] ) 7688 { 7689 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1; 7690 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false; 7691 } 7692 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] ) 7693 { 7694 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1; 7695 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false; 7696 } 7697 } 7698 7699 xFree( pbEdge ); 7700 xFree( pbVisit ); 7701 xFree( piStack ); 7702 } 7703 5996 7704 #endif 5997 7705 -
trunk/source/Lib/TLibCommon/TComDataCU.h
r77 r100 214 214 #endif 215 215 216 #if LGE_EDGE_INTRA 217 UChar* m_pucEdgeCode; ///< array of edge code 218 UChar* m_pucEdgeNumber; ///< total number of edge 219 UChar* m_pucEdgeStartPos; ///< starting point position 220 Bool* m_pbEdgeLeftFirst; ///< true if edge should be checked in left boundary first 221 Bool* m_pbEdgePartition; ///< true if it belongs to region 1, otherwise, region 0 222 #if LGE_EDGE_INTRA_DELTA_DC 223 Int* m_piEdgeDeltaDC0; 224 Int* m_piEdgeDeltaDC1; 225 #endif 226 #endif 227 216 228 // ------------------------------------------------------------------------------------------------------------------- 217 229 // misc. variables … … 256 268 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); 257 269 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 270 #if QC_MULTI_DIS_CAN 271 Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 272 #endif 258 273 259 274 #if !AMVP_PRUNING_SIMPLIFICATION … … 503 518 504 519 #if HHI_INTER_VIEW_MOTION_PRED 520 #if !QC_MULTI_DIS_CAN 505 521 Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 506 522 Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); 523 #else 524 Bool getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false ); 525 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 526 Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); 527 #if LGE_DVMCP 528 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 ); 529 #endif 530 531 #endif 507 532 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 508 533 #endif … … 659 684 UInt getEntropySliceStartCU ( UInt pos ) { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU]; } 660 685 UInt& getTotalBins () { return m_uiTotalBins; } 686 687 #if LGE_EDGE_INTRA 688 UInt getCtxEdgeIntra ( UInt uiAbsPartIdx ); 689 #endif 690 661 691 // ------------------------------------------------------------------------------------------------------------------- 662 692 // member functions for RD cost storage … … 734 764 Void setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); 735 765 #endif 766 767 #if LGE_EDGE_INTRA 768 UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; } 769 UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } 770 UChar getEdgeNumber( UInt uiIdx ) { return m_pucEdgeNumber[uiIdx]; } 771 Void setEdgeNumber( UInt uiIdx, UChar val ) { m_pucEdgeNumber[uiIdx] = val; } 772 UChar* getEdgeStartPos( ) { return m_pucEdgeStartPos; } 773 UChar getEdgeStartPos( UInt uiIdx ) { return m_pucEdgeStartPos[uiIdx]; } 774 Void setEdgeStartPos( UInt uiIdx, UChar val ) { m_pucEdgeStartPos[uiIdx] = val; } 775 Bool* getEdgeLeftFirst( ) { return m_pbEdgeLeftFirst; } 776 Bool getEdgeLeftFirst( UInt uiIdx ) { return m_pbEdgeLeftFirst[uiIdx]; } 777 Void setEdgeLeftFirst( UInt uiIdx, Bool val ) { m_pbEdgeLeftFirst[uiIdx] = val; } 778 Bool* getEdgePartition( UInt uiIdx ) { return &m_pbEdgePartition[uiIdx * 16]; } 779 Void reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ); 780 781 #if LGE_EDGE_INTRA_DELTA_DC 782 Int* getEdgeDeltaDC0( ) { return m_piEdgeDeltaDC0; } 783 Int* getEdgeDeltaDC1( ) { return m_piEdgeDeltaDC1; } 784 Int getEdgeDeltaDC0( UInt uiIdx ) { return m_piEdgeDeltaDC0[uiIdx]; } 785 Int getEdgeDeltaDC1( UInt uiIdx ) { return m_piEdgeDeltaDC1[uiIdx]; } 786 Void setEdgeDeltaDC0( UInt uiIdx, Int val ) { m_piEdgeDeltaDC0[uiIdx] = val; } 787 Void setEdgeDeltaDC1( UInt uiIdx, Int val ) { m_piEdgeDeltaDC1[uiIdx] = val; } 788 #endif 789 #endif 736 790 }; 737 791 -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r77 r100 78 78 m_uiSubSampExpX = uiSubSampExpX; 79 79 m_uiSubSampExpY = uiSubSampExpY; 80 #if !QC_MULTI_DIS_CAN 80 81 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 81 82 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 91 92 m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth ); 92 93 xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 ); 94 #endif 93 95 m_bCreated = true; 94 96 } … … 100 102 { 101 103 m_bCreated = false; 104 #if !QC_MULTI_DIS_CAN 102 105 for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ ) 103 106 { … … 114 117 delete [] m_ppcCU; m_ppcCU = 0; 115 118 m_cTmpPic.destroy(); 119 #endif 116 120 m_uiMaxDepth = 0; 117 121 m_uiOrgDepthBitDepth = 0; … … 163 167 m_bPDMAvailable = false; 164 168 m_uiCurrViewId = pcPic->getSPS()->getViewId(); 165 169 #if PDM_REMOVE_DEPENDENCE 170 pcPic->setStoredPDMforV2(0); 171 #endif 166 172 // update SPS list and AU pic list and set depth map generator in SPS 167 173 #if VIDYO_VPS_INTEGRATION … … 218 224 if( m_uiCurrViewId ) 219 225 { 226 #if PDM_REMOVE_DEPENDENCE 227 UInt uiBaseVId = m_auiBaseIdList[0]; 228 #else 220 229 Bool bCheckVId1 = ( m_uiCurrViewId > 1 && m_auiBaseIdList[0] == 0 ); 221 230 UInt uiBaseVId = ( bCheckVId1 ? 1 : m_auiBaseIdList[0] ); 231 #endif 222 232 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseVId ); 223 233 SliceType eSliceType = pcBasePic->getCurrSlice()->getSliceType(); … … 367 377 } 368 378 369 379 #if !QC_MULTI_DIS_CAN 370 380 Bool 371 381 TComDepthMapGenerator::predictDepthMap( TComPic* pcPic ) … … 398 408 pcBasePic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_pcSPSAccess->getPdm()), PDM_SUB_SAMP_EXP_Y(m_pcSPSAccess->getPdm()) ); 399 409 xClearDepthMap( pcBasePic ); 410 #if PDM_REMOVE_DEPENDENCE 411 xClearDepthMap( pcBasePic, PDM_UNDEFINED_DEPTH, 1 ); 412 #endif 400 413 } 401 414 #if PDM_OUTPUT_PRED_DEPTH_MAP … … 442 455 { 443 456 xClearDepthMap( pcPic ); 457 #if PDM_REMOVE_DEPENDENCE 458 xClearDepthMap( pcPic, PDM_UNDEFINED_DEPTH, 1 ); 459 #endif 444 460 } 445 461 return bUndefined; … … 463 479 464 480 // predict depth map using current coding symbols 481 #if PDM_REMOVE_DEPENDENCE 482 pcPic->setStoredPDMforV2(0); 483 xPredictDepthMap( pcPic ); 484 if(m_uiCurrViewId==0) 485 { 486 pcPic->setStoredPDMforV2(1); 487 xPredictDepthMap( pcPic ); 488 pcPic->setStoredPDMforV2(0); 489 } 490 #else 465 491 xPredictDepthMap( pcPic ); 466 492 #if PDM_OUTPUT_PRED_DEPTH_MAP … … 469 495 dumpDepthMap( pcPic, acFilenameBase ); 470 496 } 497 #endif 471 498 #endif 472 499 … … 481 508 #endif 482 509 } 510 #if PDM_REMOVE_DEPENDENCE 511 if( m_uiCurrViewId == 2 ) 512 { 513 TComPic* pcBasePic = m_pcAUPicAccess->getPic( 0 ); 514 AOF( pcBasePic ); 515 xConvertDepthMapCurr2Ref( pcBasePic, pcPic ); 516 #if PDM_OUTPUT_PRED_DEPTH_MAP 517 dumpDepthMap( pcBasePic, acFilenameBase ); 518 #endif 519 } 520 #endif 483 521 } 484 522 … … 501 539 Int iSrcStride = pcPicYuv->getStride (); 502 540 Int iDstStride = m_cTmpPic.getStride (); 541 #if PDM_REMOVE_DEPENDENCE 542 if(pcPic->getStoredPDMforV2()) 543 pcPicYuv = pcPic->getPredDepthMapTemp(); 544 #endif 503 545 Pel* pSrcSamples = pcPicYuv->getLumaAddr ( 0 ); 504 546 Pel* pDstSamples = m_cTmpPic.getLumaAddr ( 0 ); … … 520 562 m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 ) ); 521 563 } 522 564 #endif 523 565 524 566 #if HHI_INTER_VIEW_MOTION_PRED … … 563 605 564 606 #if HHI_INTER_VIEW_MOTION_PRED 607 #if QC_MULTI_DIS_CAN 608 Int 609 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 610 #else 565 611 Int 566 612 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) 567 { 613 #endif 614 { 615 #if MTK_INTERVIEW_MERGE_A0049 616 AOF ( m_bCreated && m_bInit ); 617 618 #if !QC_MULTI_DIS_CAN 619 ROFRS( m_bPDMAvailable, 0 ); 620 #endif 621 622 TComSlice* pcSlice = pcCU->getSlice (); 623 TComSPS* pcSPS = pcSlice->getSPS(); 624 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 625 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 626 ROTRS( !bPdmMerge, 0 ); 627 628 Bool abPdmAvailable[2] = {false,false}; 629 630 Int iValid = 0; 631 Int iViewId = 0; 632 for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ ) 633 { 634 UInt uiBaseId = m_auiBaseIdList[ uiBId ]; 635 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 636 for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ ) 637 { 638 RefPicList eRefPicListTest = RefPicList( iRefListId ); 639 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ; 640 for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ ) 641 { 642 if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 643 && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId()) 644 { 645 iValid=1; 646 iViewId = uiBaseId; 647 break; 648 } 649 } 650 } 651 } 652 if (iValid == 0) 653 return 0; 654 655 //--- get base CU/PU and check prediction mode --- 656 TComPic* pcBasePic = m_pcAUPicAccess->getPic( iViewId ); 657 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 658 659 #if QC_MULTI_DIS_CAN 660 Int iCurrPosX, iCurrPosY; 661 UInt uiPartAddr; 662 Int iWidth; 663 Int iHeight; 664 665 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 666 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 667 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 668 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 669 670 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 671 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 672 Int iBaseCUAddr; 673 Int iBaseAbsPartIdx; 674 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 675 #else 676 Int iPrdDepth, iCurrPosX, iCurrPosY; 677 Bool bAvailable = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY ); 678 AOF( bAvailable ); 679 TComPicYuv* pcBasePdm = pcBasePic->getPredDepthMap(); 680 Int iDisparity = xGetDisparityFromVirtDepth( iViewId, iPrdDepth ); 681 Int iShiftX = m_uiSubSampExpX + 2; 682 Int iAddX = ( 1 << iShiftX ) >> 1; 683 Int iBasePosX = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) ); 684 Int iBasePosY = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY ); 685 Int iBaseCUAddr; 686 Int iBaseAbsPartIdx; 687 pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx ); 688 #endif 689 690 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 691 692 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP ) 693 { 694 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 695 { 696 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 697 TComMvField cBaseMvField; 698 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 699 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 700 701 if (iBaseRefIdx >= 0) 702 { 703 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 704 if (iBaseRefPOC != pcSlice->getPOC()) 705 { 706 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eBaseRefPicList ); iPdmRefIdx++) 707 { 708 if (iBaseRefPOC == pcSlice->getRefPOC(eBaseRefPicList, iPdmRefIdx)) 709 { 710 abPdmAvailable[ uiBaseRefListId ] = true; 711 paiPdmRefIdx [ uiBaseRefListId ] = iPdmRefIdx; 712 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 713 #if LGE_DVMCP 714 cMv.m_bDvMcp = true; 715 cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 716 #endif 717 pcCU->clipMv( cMv ); 718 pacPdmMv [ uiBaseRefListId ] = cMv; 719 break; 720 } 721 } 722 } 723 } 724 } 725 } 726 Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 727 728 if (iPdmInterDir == 0) 729 { 730 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 731 { 732 RefPicList eRefPicList = RefPicList( iRefListId ); 733 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicList ); 734 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 735 { 736 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 737 { 738 abPdmAvailable[ iRefListId ] = true; 739 paiPdmRefIdx [ iRefListId ] = iPdmRefIdx; 740 #if QC_MULTI_DIS_CAN 741 TComMv cMv = pDInfo->m_acMvCand[0]; 742 cMv.setVer(0); 743 #else 744 TComMv cMv(iDisparity, 0); 745 #endif 746 pcCU->clipMv( cMv ); 747 pacPdmMv [ iRefListId ] = cMv; 748 break; 749 } 750 } 751 } 752 iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ; 753 } 754 755 return iPdmInterDir; 756 757 #else 568 758 Int iMaxNumInterPics = 1; 569 759 Int iMaxNumAllPics = 2; … … 580 770 if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() ) 581 771 { 772 #if QC_MULTI_DIS_CAN 773 if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 774 #else 582 775 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 776 #endif 583 777 { 584 778 pcCU->clipMv( cMv ); … … 602 796 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 603 797 { 798 #if QC_MULTI_DIS_CAN 799 if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 800 #else 604 801 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 802 #endif 605 803 { 606 804 pcCU->clipMv( cMv ); … … 615 813 } 616 814 return iPdmInterDir; 617 } 618 619 815 #endif 816 } 817 818 #if QC_MULTI_DIS_CAN 819 Bool 820 TComDepthMapGenerator::getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 821 { 822 #if LGE_DVMCP 823 rcMv.m_bDvMcp = false; 824 #endif 825 AOF ( m_bCreated && m_bInit ); 826 AOF ( iRefIdx >= 0 ); 827 AOF ( pcCU ); 828 //ROFRS( m_bPDMAvailable, false ); 829 TComSlice* pcSlice = pcCU->getSlice (); 830 TComSPS* pcSPS = pcSlice->getSPS(); 831 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 832 TComPic* pcRefPic = pcSlice->getRefPic( eRefPicList, iRefIdx ); 833 UInt uiRefViewId = pcRefPic->getSPS()->getViewId(); 834 Int iRefPoc = pcRefPic->getPOC(); 835 Bool bInterview = ( uiRefViewId < m_uiCurrViewId ); 836 AOT( bInterview && iRefPoc != pcSlice->getPOC() ); 837 AOT( !bInterview && iRefPoc == pcSlice->getPOC() ); 838 Bool bPdmIView = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW ); 839 Bool bPdmInter = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER ); 840 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 841 ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false ); 842 ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false ); 843 ROTRS( bMerge && !bPdmMerge, false ); 844 Int iCurrPosX, iCurrPosY; 845 TComMv cDisMv; 846 847 if( bInterview ) 848 { 849 rcMv = pDInfo->m_acMvCand[0]; 850 rcMv.setVer(0); 851 return true; 852 } 853 for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ ) 854 { 855 UInt uiBaseId = uiBId; //m_auiBaseIdList[ uiBId ]; 856 857 if (m_uiCurrViewId >1 && uiBaseId ==1 ) 858 continue; 859 860 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 861 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 862 UInt uiPartAddr; 863 Int iWidth; 864 Int iHeight; 865 866 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 867 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 868 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 869 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 870 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 871 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 872 Int iBaseCUAddr; 873 Int iBaseAbsPartIdx; 874 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 875 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 876 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP ) 877 { 878 continue; 879 } 880 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 881 { 882 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 883 TComMvField cBaseMvField; 884 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 885 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 886 Int iBaseRefPoc = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) ); 887 if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc ) 888 { 889 rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() ); 890 #if LGE_DVMCP 891 // save disparity vector when a merge candidate for IVMP is set as DV-MCP 892 if( bMerge ) 893 { 894 rcMv.m_bDvMcp = true; 895 rcMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 896 } 897 else { // AMVP ? 898 rcMv.m_bDvMcp = false; 899 } 900 #endif 901 return true; 902 } 903 } 904 } 905 return false; 906 } 907 #else 620 908 Bool 621 909 TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ) … … 664 952 //--- get base CU/PU and check prediction mode --- 665 953 UInt uiBaseId = m_auiBaseIdList[ uiBId ]; 954 #if PDM_REMOVE_DEPENDENCE 955 if( uiBaseId != 0) 956 continue; 957 #endif 666 958 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 667 959 TComPicYuv* pcBasePdm = pcBasePic->getPredDepthMap(); … … 697 989 return false; 698 990 } 991 #endif 699 992 700 993 … … 744 1037 745 1038 746 1039 #if !QC_MULTI_DIS_CAN 747 1040 /*=======================================================* 748 1041 *===== =====* … … 760 1053 AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () ); 761 1054 AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() ); 762 1055 #if PDM_REMOVE_DEPENDENCE 1056 if( pcCur->getViewId() == 1) 1057 xClearDepthMap( pcRef ); 1058 else if (pcCur->getViewId() == 2) 1059 xClearDepthMap( pcRef, PDM_UNDEFINED_DEPTH, 1 ); 1060 #else 763 1061 xClearDepthMap( pcRef ); 1062 #endif 764 1063 TComPicYuv* pcCurDepthMap = pcCur->getPredDepthMap (); 765 1064 TComPicYuv* pcRefDepthMap = pcRef->getPredDepthMap (); … … 771 1070 Pel* pRefSamples = pcRefDepthMap->getLumaAddr( 0 ); 772 1071 Int iRefViewIdx = pcRef->getViewId(); 1072 #if PDM_REMOVE_DEPENDENCE 1073 if( pcCur->getViewId() == 2) 1074 { 1075 pcRefDepthMap = pcRef->getPredDepthMapTemp(); 1076 pRefSamples = pcRefDepthMap->getLumaAddr( 0 ); 1077 } 1078 #endif 773 1079 Int iShiftX = m_uiSubSampExpX + 2; 774 1080 Int iAddX = ( 1 << iShiftX ) >> 1; … … 799 1105 AOF( pcCur->getSPS()->getViewId() > pcRef->getSPS()->getViewId() ); 800 1106 AOF( pcCur->getPredDepthMap() ); 1107 #if PDM_REMOVE_DEPENDENCE 1108 if(pcCur->getViewId() == 1) 1109 { 1110 AOF( pcRef->getPredDepthMap() ); 1111 }else 1112 { 1113 AOF( pcRef->getPredDepthMapTemp() ); 1114 } 1115 #else 801 1116 AOF( pcRef->getPredDepthMap() ); 1117 #endif 802 1118 AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () ); 803 1119 AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() ); … … 805 1121 xClearDepthMap( pcCur ); 806 1122 TComPicYuv* pcRefDepthMap = pcRef->getPredDepthMap (); 1123 #if PDM_REMOVE_DEPENDENCE 1124 if(pcCur->getViewId() == 2) 1125 pcRefDepthMap = pcRef->getPredDepthMapTemp (); 1126 #endif 807 1127 TComPicYuv* pcCurDepthMap = pcCur->getPredDepthMap (); 808 1128 Int iWidth = pcRefDepthMap->getWidth (); … … 844 1164 } 845 1165 Bool bUndefined = xFillDepthMapHoles( pcPic ); 1166 #if PDM_REMOVE_DEPENDENCE 1167 if(pcPic->getStoredPDMforV2() == 1){ 1168 pcPic->getPredDepthMapTemp()->setBorderExtension( false ); 1169 pcPic->getPredDepthMapTemp()->extendPicBorder (); 1170 }else{ 1171 #endif 846 1172 pcPic->getPredDepthMap()->setBorderExtension( false ); 847 1173 pcPic->getPredDepthMap()->extendPicBorder (); 1174 #if PDM_REMOVE_DEPENDENCE 1175 } 1176 #endif 848 1177 return bUndefined; 849 1178 } … … 855 1184 Bool bUndefined = false; 856 1185 TComPicYuv* pcDepthMap = pcPic->getPredDepthMap (); 1186 #if PDM_REMOVE_DEPENDENCE 1187 if(pcPic->getViewId()==0 && pcPic->getStoredPDMforV2()==1) 1188 pcDepthMap = pcPic->getPredDepthMapTemp (); 1189 #endif 857 1190 Int iWidth = pcDepthMap->getWidth (); 858 1191 Int iHeight = pcDepthMap->getHeight (); … … 888 1221 { 889 1222 bUndefined = true; 890 1223 break; 891 1224 } 892 1225 iX = iE - 1; … … 913 1246 914 1247 Void 915 TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal ) 1248 TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal 1249 #if PDM_REMOVE_DEPENDENCE 1250 , 1251 Int forFirstNonBaseView 1252 #endif 1253 ) 916 1254 { 917 1255 TComPicYuv* pcDepthMap = pcPic->getPredDepthMap (); … … 920 1258 Int iStride = pcDepthMap->getStride (); 921 1259 Pel* pDMSamples = pcDepthMap->getLumaAddr ( 0 ); 1260 #if PDM_REMOVE_DEPENDENCE 1261 if( forFirstNonBaseView == 1) 1262 { 1263 pcDepthMap = pcPic->getPredDepthMapTemp (); 1264 pDMSamples = pcDepthMap->getLumaAddr ( 0 ); 1265 } 1266 #endif 922 1267 for( Int iY = 0; iY < iHeight; iY++, pDMSamples += iStride ) 923 1268 { … … 989 1334 TComYuv* pcSubDM = m_ppcYuv[ uiDepth ]; 990 1335 TComPicYuv* pcPicDM = pcCU->getPic()->getPredDepthMap(); 1336 #if PDM_REMOVE_DEPENDENCE 1337 if( pcCU->getPic()->getStoredPDMforV2() == 1) 1338 pcPicDM = pcCU->getPic()->getPredDepthMapTemp(); 1339 #endif 991 1340 UInt uiCUAddr = pcCU->getAddr(); 992 1341 pcSubCU->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); … … 1075 1424 UInt uiZOrderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1076 1425 Pel* pPicDepthMap = pcCU->getPic()->getPredDepthMap()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx ); 1426 #if PDM_REMOVE_DEPENDENCE 1427 if(pcCU->getPic()->getStoredPDMforV2()==1) 1428 pPicDepthMap = pcCU->getPic()->getPredDepthMapTemp()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx ); 1429 #endif 1077 1430 Int iPicStride = pcCU->getPic()->getPredDepthMap()->getStride (); 1078 1431 for( UInt uiY = 0; uiY < uiHeight; uiY++, pDepthMap += uiStride, pPicDepthMap += iPicStride ) … … 1511 1864 return true; 1512 1865 } 1866 #endif 1513 1867 1514 1868 #endif // DEPTH_MAP_GENERATION -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r77 r100 136 136 137 137 Void initViewComponent ( TComPic* pcPic ); 138 #if !QC_MULTI_DIS_CAN 138 139 Bool predictDepthMap ( TComPic* pcPic ); 139 140 Void updateDepthMap ( TComPic* pcPic ); 140 141 Void dumpDepthMap ( TComPic* pcPic, char* pFilenameBase ); 142 #endif 141 143 142 144 #if HHI_INTER_VIEW_MOTION_PRED … … 149 151 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 150 152 #if HHI_INTER_VIEW_MOTION_PRED 153 #if QC_MULTI_DIS_CAN 154 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 155 Bool getPdmMvPredDisCan ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 156 Bool getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 157 #else 151 158 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 152 159 Bool getPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ); 160 #endif 153 161 Bool getIViewOrgDepthMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 154 162 #endif … … 163 171 private: 164 172 // picture operations 173 #if !QC_MULTI_DIS_CAN 165 174 Bool xConvertDepthMapCurr2Ref ( TComPic* pcRef, TComPic* pcCur ); 166 175 Bool xConvertDepthMapRef2Curr ( TComPic* pcCur, TComPic* pcRef ); 167 176 Bool xPredictDepthMap ( TComPic* pcPic ); 168 177 Bool xFillDepthMapHoles ( TComPic* pcPic ); 169 Void xClearDepthMap ( TComPic* pcPic, Int iVal = PDM_UNDEFINED_DEPTH ); 178 Void xClearDepthMap ( TComPic* pcPic, Int iVal = PDM_UNDEFINED_DEPTH 179 #if PDM_REMOVE_DEPENDENCE 180 , 181 Int forFirstNonBaseView = 0 182 #endif 183 ); 170 184 Void xSetChroma ( TComPicYuv* pcPic, Int iVal ); 171 185 … … 182 196 Void xInterPUDepthMapPrediction( TComDataCU* pcCU, TComYuv* pcCUDepthMap, UInt uiPartIdx ); // PU inter prediction 183 197 Bool xGetPredDepth ( TComDataCU* pcCU, UInt uiPartIdx, Int& riPrdDepth, Int* piPosX = 0, Int* piPosY = 0 ); 184 198 #endif 185 199 // conversion functions 186 200 Int xGetVirtDepthFromDisparity( UInt uiBaseId, Int iDisparity ) -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r56 r100 59 59 60 60 // ==================================================================================================================== 61 #if QC_MULTI_DIS_CAN 62 typedef struct _DisCand 63 { 64 TComMv m_acMvCand[ DIS_CANS ]; ///< array of motion vector predictor candidates 65 Int m_aVIdxCan[ DIS_CANS ]; ///< array of motion vector predictor candidates 66 Int iN; ///< number of motion vector predictor candidates 67 } DisInfo; 68 #endif 61 69 // Class definition 62 70 // ==================================================================================================================== -
trunk/source/Lib/TLibCommon/TComMv.h
r56 r100 57 57 public: 58 58 59 #if LGE_DVMCP 60 Bool m_bDvMcp; // is dv-mcp ? 61 Int m_iDvMcpDispX; // disparity for dv-mcp 62 #endif 63 59 64 // ------------------------------------------------------------------------------------------------------------------ 60 65 // constructors … … 64 69 m_iHor(0), 65 70 m_iVer(0) 71 #if LGE_DVMCP 72 , m_bDvMcp(false) 73 , m_iDvMcpDispX(0) 74 #endif 66 75 { 67 76 } … … 70 79 m_iHor(iHor), 71 80 m_iVer(iVer) 81 #if LGE_DVMCP 82 , m_bDvMcp(false) 83 , m_iDvMcpDispX(0) 84 #endif 72 85 { 73 86 } -
trunk/source/Lib/TLibCommon/TComPattern.cpp
r56 r100 675 675 { 676 676 Int* piSrc; 677 #if LGE_EDGE_INTRA 678 mapEdgeIntratoDC( uiDirMode ); 679 #endif 677 680 assert(log2BlkSize >= 2 && log2BlkSize < 7); 678 681 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX -
trunk/source/Lib/TLibCommon/TComPic.cpp
r56 r100 55 55 #if DEPTH_MAP_GENERATION 56 56 m_pcPredDepthMap = NULL; 57 #if PDM_REMOVE_DEPENDENCE 58 m_pcPredDepthMap_temp = NULL; 59 #endif 57 60 #endif 58 61 #if HHI_INTER_VIEW_MOTION_PRED … … 136 139 m_pcPredDepthMap = NULL; 137 140 } 141 #if PDM_REMOVE_DEPENDENCE 142 if( m_pcPredDepthMap_temp ) // estimated depth map 143 { 144 m_pcPredDepthMap_temp->destroy(); 145 delete m_pcPredDepthMap_temp; 146 m_pcPredDepthMap_temp = NULL; 147 } 148 #endif 138 149 #endif 139 150 #if HHI_INTER_VIEW_MOTION_PRED … … 179 190 m_pcPredDepthMap = new TComPicYuv; 180 191 m_pcPredDepthMap ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth ); 192 #if PDM_REMOVE_DEPENDENCE 193 m_pcPredDepthMap_temp = new TComPicYuv; 194 m_pcPredDepthMap_temp ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth ); 195 #endif 181 196 } 182 197 #endif … … 224 239 m_pcPredDepthMap = NULL; 225 240 } 241 #if PDM_REMOVE_DEPENDENCE 242 if(m_pcPredDepthMap_temp) 243 { 244 m_pcPredDepthMap_temp->destroy(); 245 delete m_pcPredDepthMap_temp; 246 m_pcPredDepthMap_temp = NULL; 247 } 248 #endif 226 249 } 227 250 #endif -
trunk/source/Lib/TLibCommon/TComPic.h
r77 r100 67 67 #if DEPTH_MAP_GENERATION 68 68 TComPicYuv* m_pcPredDepthMap; // estimated depth map 69 #if PDM_REMOVE_DEPENDENCE 70 TComPicYuv* m_pcPredDepthMap_temp; // estimated depth map 71 Bool m_bPDMV2; 72 #endif 73 #endif 74 75 #if LG_ZEROINTRADEPTHRESI_M26039 76 Int m_uiIntraPeriod; 69 77 #endif 70 78 71 79 #if HHI_INTER_VIEW_MOTION_PRED 72 80 TComPicYuv* m_pcOrgDepthMap; // original depth map 81 #if QC_MULTI_DIS_CAN 82 Bool m_checked; 83 #endif 73 84 #endif 74 85 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 123 134 TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } 124 135 #endif 136 #if LG_ZEROINTRADEPTHRESI_M26039 137 Int getIntraPeriod() { return m_uiIntraPeriod; } 138 Void setIntraPeriod(Int uiIntraPeriod) { m_uiIntraPeriod = uiIntraPeriod; } 139 #endif 125 140 TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } 126 141 Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } 127 142 Int getViewId() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); } 128 TComDataCU*& getCU( UInt uiCUAddr ) 143 TComDataCU*& getCU( UInt uiCUAddr ){ return m_apcPicSym->getCU( uiCUAddr ); } 129 144 130 145 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } … … 136 151 #if DEPTH_MAP_GENERATION 137 152 TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } 138 #endif 139 153 #if PDM_REMOVE_DEPENDENCE 154 TComPicYuv* getPredDepthMapTemp() { return m_pcPredDepthMap_temp; } 155 Void setStoredPDMforV2 (Bool flag) { m_bPDMV2 = flag;} 156 Bool getStoredPDMforV2 () { return m_bPDMV2;} 157 #endif 158 159 #endif 140 160 #if HHI_INTER_VIEW_MOTION_PRED 141 161 TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } 162 #if QC_MULTI_DIS_CAN 163 Void setCandPicCheckedFlag (Bool bchecked) { m_checked = bchecked; } 164 Bool getCandPicCheckedFlag () { return m_checked;} 165 #endif 142 166 #endif 143 167 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r56 r100 46 46 // ==================================================================================================================== 47 47 48 #if LGE_EDGE_INTRA 49 #define MAX_DISTANCE_EDGEINTRA 255 50 #endif 51 48 52 TComPrediction::TComPrediction() 49 53 : m_pLumaRecBuffer(0) … … 419 423 } 420 424 425 #if LGE_EDGE_INTRA 426 Void TComPrediction::predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta ) 427 { 428 Pel *piDst = piPred; 429 Int *piSrc; 430 Int iSrcStride = ( iWidth<<1 ) + 1; 431 Int iDstStride = uiStride; 432 433 piSrc = pcTComPattern->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt ); 434 435 xPredIntraEdge ( pcCU, uiAbsPartIdx, iWidth, iHeight, piSrc, iSrcStride, piDst, iDstStride 436 #if LGE_EDGE_INTRA_DELTA_DC 437 , bDelta 438 #endif 439 ); 440 } 441 442 Pel TComPrediction::xGetNearestNeighbor( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion ) 443 { 444 Bool bLeft = (x < y) ? true : false; 445 Bool bFound = false; 446 Int iFoundX = -1, iFoundY = -1; 447 Int cResult = 0; 448 449 UChar* piTopDistance = new UChar[iWidth]; 450 UChar* piLeftDistance = new UChar[iHeight]; 451 452 for( Int i = 0; i < iWidth; i++ ) 453 { 454 int Abs = x > i ? x - i : i - x; 455 piTopDistance[ i ] = y + Abs; 456 457 Abs = y > i ? y - i : i - y; 458 piLeftDistance[ i ] = x + Abs; 459 } 460 461 for( Int dist = 0; dist < MAX_DISTANCE_EDGEINTRA && !bFound; dist++ ) 462 { 463 if( !bLeft ) 464 { 465 for( Int i = 0; i < iWidth; i++ ) 466 { 467 if( piTopDistance[ i ] == dist ) 468 { 469 if( bpRegion[ i ] == bpRegion[ x + y * iWidth ] ) 470 { 471 iFoundX = i; 472 iFoundY = 0; 473 bFound = true; 474 } 475 } 476 } 477 for( Int i = 0; i < iHeight; i++ ) 478 { 479 if( piLeftDistance[ i ] == dist ) 480 { 481 if( bpRegion[ i * iWidth ] == bpRegion[ x + y * iWidth ] ) 482 { 483 iFoundX = 0; 484 iFoundY = i; 485 bFound = true; 486 } 487 } 488 } 489 } 490 else 491 { 492 for( Int i = 0; i < iHeight; i++ ) 493 { 494 if( piLeftDistance[ i ] == dist ) 495 { 496 if( bpRegion[ i * iWidth ] == bpRegion[ x + y * iWidth ] ) 497 { 498 iFoundX = 0; 499 iFoundY = i; 500 bFound = true; 501 } 502 } 503 } 504 for( Int i = 0; i < iWidth; i++ ) 505 { 506 if( piTopDistance[ i ] == dist ) 507 { 508 if( bpRegion[ i ] == bpRegion[ x + y * iWidth ] ) 509 { 510 iFoundX = i; 511 iFoundY = 0; 512 bFound = true; 513 } 514 } 515 } 516 } 517 } 518 519 if( iFoundY == 0 ) 520 { 521 cResult = pSrc[ iFoundX + 1 ]; 522 } 523 else // iFoundX == 0 524 { 525 cResult = pSrc[ (iFoundY + 1) * srcStride ]; 526 } 527 528 delete[] piTopDistance; piTopDistance = NULL; 529 delete[] piLeftDistance; piLeftDistance = NULL; 530 531 assert( bFound ); 532 533 return cResult; 534 } 535 536 Void TComPrediction::xPredIntraEdge( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta ) 537 { 538 Pel* pDst = rpDst; 539 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx ); 540 541 // Do prediction 542 { 543 //UInt uiSum0 = 0, uiSum1 = 0; 544 Int iSum0 = 0, iSum1 = 0; 545 //UInt uiMean0, uiMean1; 546 Int iMean0, iMean1; 547 //UInt uiCount0 = 0, uiCount1 = 0; 548 Int iCount0 = 0, iCount1 = 0; 549 for( UInt ui = 0; ui < iWidth; ui++ ) 550 { 551 if( pbRegion[ ui ] == false ) 552 { 553 iSum0 += (pSrc[ ui + 1 ]); 554 iCount0++; 555 } 556 else 557 { 558 iSum1 += (pSrc[ ui + 1 ]); 559 iCount1++; 560 } 561 } 562 for( UInt ui = 0; ui < iHeight; ui++ ) // (0,0) recount (to avoid division) 563 { 564 if( pbRegion[ ui * iWidth ] == false ) 565 { 566 iSum0 += (pSrc[ (ui + 1) * srcStride ]); 567 iCount0++; 568 } 569 else 570 { 571 iSum1 += (pSrc[ (ui + 1) * srcStride ]); 572 iCount1++; 573 } 574 } 575 if( iCount0 == 0 ) 576 assert(false); 577 if( iCount1 == 0 ) 578 assert(false); 579 iMean0 = iSum0 / iCount0; // TODO : integer op. 580 iMean1 = iSum1 / iCount1; 581 #if LGE_EDGE_INTRA_DELTA_DC 582 if( bDelta ) 583 { 584 Int iDeltaDC0 = pcCU->getEdgeDeltaDC0( uiAbsPartIdx ); 585 Int iDeltaDC1 = pcCU->getEdgeDeltaDC1( uiAbsPartIdx ); 586 xDeltaDCQuantScaleUp( pcCU, iDeltaDC0 ); 587 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 588 iMean0 = Clip( iMean0 + iDeltaDC0 ); 589 iMean1 = Clip( iMean1 + iDeltaDC1 ); 590 } 591 #endif 592 for( UInt ui = 0; ui < iHeight; ui++ ) 593 { 594 for( UInt uii = 0; uii < iWidth; uii++ ) 595 { 596 if( pbRegion[ uii + ui * iWidth ] == false ) 597 pDst[ uii + ui * dstStride ] = iMean0; 598 else 599 pDst[ uii + ui * dstStride ] = iMean1; 600 } 601 } 602 } 603 } 604 #endif 605 421 606 #if DEPTH_MAP_GENERATION 422 607 Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) … … 569 754 { 570 755 UInt uiRShift = 0; 571 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 756 #if PDM_REMOVE_DEPENDENCE 757 if( pcCU->getPic()->getStoredPDMforV2() == 1 ) 758 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 759 else 760 #endif 761 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 762 572 763 return; 573 764 } -
trunk/source/Lib/TLibCommon/TComPrediction.h
r56 r100 125 125 #endif 126 126 127 #if LGE_EDGE_INTRA 128 Pel xGetNearestNeighbor ( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion ); 129 Void xPredIntraEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta = false ); 130 #endif 131 127 132 public: 128 133 TComPrediction(); … … 170 175 Bool getWedgePatternIdx ( WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); 171 176 #endif 177 #if LGE_EDGE_INTRA 178 Void predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta = false ); 179 #endif 172 180 173 181 // simplified intra pred for "virtual" depth maps -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r81 r100 45 45 //! \{ 46 46 47 #if SAIT_VSO_EST_A0033 48 Double TComRdCost::m_dDisparityCoeff = 1.0; 49 #endif 50 47 51 TComRdCost::TComRdCost() 48 52 { … … 232 236 m_afpDistortFunc[28] = TComRdCost::xGetHADs; 233 237 238 #if SAIT_VSO_EST_A0033 239 m_afpDistortFunc[29] = TComRdCost::xGetVSD; 240 m_afpDistortFunc[30] = TComRdCost::xGetVSD4; 241 m_afpDistortFunc[31] = TComRdCost::xGetVSD8; 242 m_afpDistortFunc[32] = TComRdCost::xGetVSD16; 243 m_afpDistortFunc[33] = TComRdCost::xGetVSD32; 244 m_afpDistortFunc[34] = TComRdCost::xGetVSD64; 245 m_afpDistortFunc[35] = TComRdCost::xGetVSD16N; 246 #endif 247 234 248 #if !FIX203 235 249 m_puiComponentCostOriginP = NULL; … … 248 262 m_uiNumberRefPics = 0; 249 263 m_bUseVSO = false; 264 #if SAIT_VSO_EST_A0033 265 m_bUseEstimatedVSD = false; 266 #endif 250 267 m_uiVSOMode = 0; 251 268 m_fpDistortFuncVSO = NULL; … … 273 290 274 291 m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ]; 275 #if HHI_FIX276 292 m_puiMultiviewRegCostHorOrgP = new UInt[ 4 * iSubPelSearchLimit ]; 277 293 m_puiMultiviewRegCostVerOrgP = new UInt[ 4 * iSubPelSearchLimit ]; 278 #endif 294 279 295 iSubPelSearchLimit *= 2; 280 296 281 297 m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit; 282 #if HHI_FIX 298 283 299 m_puiMultiviewRegCostHor = m_puiMultiviewRegCostHorOrgP + iSubPelSearchLimit; 284 300 m_puiMultiviewRegCostVer = m_puiMultiviewRegCostVerOrgP + iSubPelSearchLimit; 285 #endif 301 286 302 287 303 for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++) 288 304 { 289 305 m_puiComponentCost[n] = xGetComponentBits( n ); 290 #if HHI_FIX291 306 m_puiMultiviewRegCostHor[n] = xGetComponentBits( n ); // first version 292 307 m_puiMultiviewRegCostVer[n] = xGetComponentBits( n ); // first version 293 #endif294 308 } 295 309 } … … 303 317 m_puiComponentCostOriginP = NULL; 304 318 } 305 #if HHI_FIX 319 306 320 if( m_puiMultiviewRegCostHorOrgP ) 307 321 { … … 314 328 m_puiMultiviewRegCostVerOrgP = NULL; 315 329 } 316 #endif317 330 } 318 331 #endif … … 565 578 } 566 579 580 581 #if SAIT_VSO_EST_A0033 582 UInt TComRdCost::getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piVirRec, Pel* piVirOrg, Int iVirStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc ) 583 { 584 AOT( ( m_dDisparityCoeff <= 0 ) || ( m_dDisparityCoeff > 10 ) ); 585 586 DistParam cDtParam; 587 setDistParam( uiBlkWidth, uiBlkHeight, eDFunc, cDtParam ); 588 cDtParam.pOrg = piOrg; 589 cDtParam.pCur = piCur; 590 cDtParam.pVirRec = piVirRec; 591 cDtParam.pVirOrg = piVirOrg; 592 cDtParam.iStrideVir = iVirStride; 593 cDtParam.iStrideOrg = iOrgStride; 594 cDtParam.iStrideCur = iCurStride; 595 cDtParam.iStep = 1; 596 597 cDtParam.bApplyWeight = false; 598 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 599 600 return cDtParam.DistFunc( &cDtParam ); 601 } 602 #endif 567 603 568 604 … … 2026 2062 #endif 2027 2063 2064 2065 #if SAIT_VSO_EST_A0033 2066 UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ) 2067 { 2068 Double dD; 2069 Int iTemp; 2070 2071 dD = ( (Double) ( dDM >> g_uiBitIncrement ) ) * m_dDisparityCoeff; 2072 2073 iTemp = (Int) ROUND( 0.5 * fabs(dD) * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) ); 2074 2075 return (UInt) ( (iTemp*iTemp)>>1 ); 2076 } 2077 2078 UInt TComRdCost::xGetVSD( DistParam* pcDtParam ) 2079 { 2080 Pel* piOrg = pcDtParam->pOrg; 2081 Pel* piCur = pcDtParam->pCur; 2082 Pel* piVirRec = pcDtParam->pVirRec; 2083 Pel* piVirOrg = pcDtParam->pVirOrg; 2084 Int iRows = pcDtParam->iRows; 2085 Int iCols = pcDtParam->iCols; 2086 Int iStrideOrg = pcDtParam->iStrideOrg; 2087 Int iStrideCur = pcDtParam->iStrideCur; 2088 Int iStrideVir = pcDtParam->iStrideVir; 2089 2090 UInt uiSum = 0; 2091 UInt uiShift = g_uiBitIncrement<<1; 2092 2093 Int dDM; 2094 2095 for ( Int y = 0 ; y < iRows ; y++ ) 2096 { 2097 for (Int x = 0; x < iCols; x++ ) 2098 { 2099 dDM = (Int) ( piOrg[x ] - piCur[x ] ); 2100 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2101 } 2102 piOrg += iStrideOrg; 2103 piCur += iStrideCur; 2104 } 2105 2106 return ( uiSum ); 2107 } 2108 2109 UInt TComRdCost::xGetVSD4( DistParam* pcDtParam ) 2110 { 2111 Pel* piOrg = pcDtParam->pOrg; 2112 Pel* piCur = pcDtParam->pCur; 2113 Pel* piVirRec = pcDtParam->pVirRec; 2114 Pel* piVirOrg = pcDtParam->pVirOrg; 2115 Int iRows = pcDtParam->iRows; 2116 Int iStrideOrg = pcDtParam->iStrideOrg; 2117 Int iStrideCur = pcDtParam->iStrideCur; 2118 Int iStrideVir = pcDtParam->iStrideVir; 2119 2120 UInt uiSum = 0; 2121 UInt uiShift = g_uiBitIncrement<<1; 2122 2123 Int dDM; 2124 2125 for ( Int y = 0 ; y < iRows ; y++ ) 2126 { 2127 dDM = (Int) ( piOrg[0] - piCur[0] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 0, y ) ) >> uiShift; 2128 dDM = (Int) ( piOrg[1] - piCur[1] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 1, y ) ) >> uiShift; 2129 dDM = (Int) ( piOrg[2] - piCur[2] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 2, y ) ) >> uiShift; 2130 dDM = (Int) ( piOrg[3] - piCur[3] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 3, y ) ) >> uiShift; 2131 2132 piOrg += iStrideOrg; 2133 piCur += iStrideCur; 2134 } 2135 2136 return ( uiSum ); 2137 } 2138 2139 UInt TComRdCost::xGetVSD8( DistParam* pcDtParam ) 2140 { 2141 Pel* piOrg = pcDtParam->pOrg; 2142 Pel* piCur = pcDtParam->pCur; 2143 Pel* piVirRec = pcDtParam->pVirRec; 2144 Pel* piVirOrg = pcDtParam->pVirOrg; 2145 Int iRows = pcDtParam->iRows; 2146 Int iStrideOrg = pcDtParam->iStrideOrg; 2147 Int iStrideCur = pcDtParam->iStrideCur; 2148 Int iStrideVir = pcDtParam->iStrideVir; 2149 2150 UInt uiSum = 0; 2151 UInt uiShift = g_uiBitIncrement<<1; 2152 2153 Int dDM; 2154 2155 for ( Int y = 0 ; y < iRows ; y++ ) 2156 { 2157 for (Int x = 0; x < 8; x++ ) 2158 { 2159 dDM = (Int) ( piOrg[x] - piCur[x] ); 2160 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2161 } 2162 piOrg += iStrideOrg; 2163 piCur += iStrideCur; 2164 } 2165 2166 return ( uiSum ); 2167 } 2168 2169 UInt TComRdCost::xGetVSD16( DistParam* pcDtParam ) 2170 { 2171 Pel* piOrg = pcDtParam->pOrg; 2172 Pel* piCur = pcDtParam->pCur; 2173 Pel* piVirRec = pcDtParam->pVirRec; 2174 Pel* piVirOrg = pcDtParam->pVirOrg; 2175 Int iRows = pcDtParam->iRows; 2176 Int iStrideOrg = pcDtParam->iStrideOrg; 2177 Int iStrideCur = pcDtParam->iStrideCur; 2178 Int iStrideVir = pcDtParam->iStrideVir; 2179 2180 UInt uiSum = 0; 2181 UInt uiShift = g_uiBitIncrement<<1; 2182 2183 Int dDM; 2184 2185 for ( Int y = 0 ; y < iRows ; y++ ) 2186 { 2187 for (Int x = 0; x < 16; x++ ) 2188 { 2189 dDM = (Int) ( piOrg[x] - piCur[x] ); 2190 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2191 } 2192 piOrg += iStrideOrg; 2193 piCur += iStrideCur; 2194 } 2195 2196 return ( uiSum ); 2197 } 2198 2199 UInt TComRdCost::xGetVSD16N( DistParam* pcDtParam ) 2200 { 2201 Pel* piOrg = pcDtParam->pOrg; 2202 Pel* piCur = pcDtParam->pCur; 2203 Pel* piVirRec = pcDtParam->pVirRec; 2204 Pel* piVirOrg = pcDtParam->pVirOrg; 2205 Int iRows = pcDtParam->iRows; 2206 Int iCols = pcDtParam->iCols; 2207 Int iStrideOrg = pcDtParam->iStrideOrg; 2208 Int iStrideCur = pcDtParam->iStrideCur; 2209 Int iStrideVir = pcDtParam->iStrideVir; 2210 2211 UInt uiSum = 0; 2212 UInt uiShift = g_uiBitIncrement<<1; 2213 2214 Int dDM; 2215 2216 for ( Int y = 0 ; y < iRows ; y++ ) 2217 { 2218 for (Int x = 0; x < iCols; x+=16 ) 2219 { 2220 for ( Int k = 0 ; k < 16 ; k++ ) 2221 { 2222 dDM = (Int) ( piOrg[x+k] - piCur[x+k] ); 2223 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x+k, y ) >> uiShift; 2224 } 2225 } 2226 piOrg += iStrideOrg; 2227 piCur += iStrideCur; 2228 } 2229 2230 return ( uiSum ); 2231 } 2232 2233 UInt TComRdCost::xGetVSD32( DistParam* pcDtParam ) 2234 { 2235 Pel* piOrg = pcDtParam->pOrg; 2236 Pel* piCur = pcDtParam->pCur; 2237 Pel* piVirRec = pcDtParam->pVirRec; 2238 Pel* piVirOrg = pcDtParam->pVirOrg; 2239 Int iRows = pcDtParam->iRows; 2240 Int iStrideOrg = pcDtParam->iStrideOrg; 2241 Int iStrideCur = pcDtParam->iStrideCur; 2242 Int iStrideVir = pcDtParam->iStrideVir; 2243 2244 UInt uiSum = 0; 2245 UInt uiShift = g_uiBitIncrement<<1; 2246 2247 Int dDM; 2248 2249 for ( Int y = 0 ; y < iRows ; y++ ) 2250 { 2251 for (Int x = 0; x < 32 ; x++ ) 2252 { 2253 dDM = (Int) ( piOrg[x] - piCur[x] ); 2254 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2255 } 2256 piOrg += iStrideOrg; 2257 piCur += iStrideCur; 2258 } 2259 2260 return ( uiSum ); 2261 } 2262 2263 UInt TComRdCost::xGetVSD64( DistParam* pcDtParam ) 2264 { 2265 Pel* piOrg = pcDtParam->pOrg; 2266 Pel* piCur = pcDtParam->pCur; 2267 Pel* piVirRec = pcDtParam->pVirRec; 2268 Pel* piVirOrg = pcDtParam->pVirOrg; 2269 Int iRows = pcDtParam->iRows; 2270 Int iStrideOrg = pcDtParam->iStrideOrg; 2271 Int iStrideCur = pcDtParam->iStrideCur; 2272 Int iStrideVir = pcDtParam->iStrideVir; 2273 2274 UInt uiSum = 0; 2275 UInt uiShift = g_uiBitIncrement<<1; 2276 2277 Int dDM; 2278 2279 for ( Int y = 0 ; y < iRows ; y++ ) 2280 { 2281 for (Int x = 0; x < 64; x++ ) 2282 { 2283 dDM = (Int) ( piOrg[x] - piCur[x] ); 2284 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2285 } 2286 piOrg += iStrideOrg; 2287 piCur += iStrideCur; 2288 } 2289 2290 return ( uiSum ); 2291 } 2292 2293 #endif 2294 2028 2295 // -------------------------------------------------------------------------------------------------------------------- 2029 2296 // HADAMARD with step (used in fractional search) … … 2668 2935 { 2669 2936 AOT(bSAD); 2937 #ifdef LGE_VSO_EARLY_SKIP_A0093 2938 RMDist iDist = m_pcRenModel->getDist( iStartPosX, iStartPosY, (Int) uiBlkWidth, (Int) uiBlkHeight, iCurStride, piCur, piOrg, iOrgStride); 2939 #else 2670 2940 RMDist iDist = m_pcRenModel->getDist( iStartPosX, iStartPosY, (Int) uiBlkWidth, (Int) uiBlkHeight, iCurStride, piCur ); 2941 #endif 2671 2942 2672 2943 RMDist iDistMin = (RMDist) RDO_DIST_MIN; -
trunk/source/Lib/TLibCommon/TComRdCost.h
r81 r100 80 80 Int iStrideOrg; 81 81 Int iStrideCur; 82 #if SAIT_VSO_EST_A0033 83 Pel* pVirRec; 84 Pel* pVirOrg; 85 Int iStrideVir; 86 #endif 82 87 Int iRows; 83 88 Int iCols; … … 105 110 pOrg = NULL; 106 111 pCur = NULL; 112 #if SAIT_VSO_EST_A0033 113 pVirRec = NULL; 114 pVirOrg = NULL;; 115 iStrideVir = 0; 116 #endif 107 117 iStrideOrg = 0; 108 118 iStrideCur = 0; … … 145 155 UInt m_uiLambdaMotionSSE; 146 156 Double m_dFrameLambda; 157 #if SAIT_VSO_EST_A0033 158 static Double m_dDisparityCoeff; 159 #endif 147 160 148 161 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE … … 192 205 Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } 193 206 207 #if SAIT_VSO_EST_A0033 208 Void setDisparityCoeff( Double dDisparityCoeff ) { m_dDisparityCoeff = dDisparityCoeff; } 209 Double getDisparityCoeff() { return m_dDisparityCoeff; } 210 #endif 211 194 212 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 195 213 Void setLambdaScale ( Double dLambdaScale) { m_dLambdaScale = dLambdaScale; } … … 222 240 { 223 241 m_uiCost = (bSad ? m_uiLambdaMotionSAD + iAdd : m_uiLambdaMotionSSE + iAdd); 224 #if HHI_FIX225 242 m_uiLambdaMVReg = ( bSad ? m_uiLambdaMVRegSAD : m_uiLambdaMVRegSSE ); 226 #endif 243 227 244 } 228 245 Void setPredictor( TComMv& rcMv ) … … 301 318 static UInt xGetSAD16N ( DistParam* pcDtParam ); 302 319 320 #if SAIT_VSO_EST_A0033 321 static UInt xGetVSD ( DistParam* pcDtParam ); 322 static UInt xGetVSD4 ( DistParam* pcDtParam ); 323 static UInt xGetVSD8 ( DistParam* pcDtParam ); 324 static UInt xGetVSD16 ( DistParam* pcDtParam ); 325 static UInt xGetVSD32 ( DistParam* pcDtParam ); 326 static UInt xGetVSD64 ( DistParam* pcDtParam ); 327 static UInt xGetVSD16N ( DistParam* pcDtParam ); 328 #endif 329 303 330 #if AMP_SAD 304 331 static UInt xGetSAD12 ( DistParam* pcDtParam ); … … 329 356 #endif 330 357 358 #if SAIT_VSO_EST_A0033 359 UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piVirRec, Pel* piVirOrg, Int iVirStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_VSD ); 360 static UInt getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ); 361 #endif 362 331 363 #if HHI_VSO 332 364 private: … … 340 372 Bool m_bAllowNegDist; 341 373 #endif 374 #if SAIT_VSO_EST_A0033 375 TComPicYuv * m_pcVideoRecPicYuv; 376 TComPicYuv * m_pcDepthPicYuv; 377 Bool m_bUseEstimatedVSD; 378 #endif 342 379 343 380 Bool m_bUseVSO; … … 357 394 Void setUseVSO ( Bool bIn ) { m_bUseVSO = bIn; }; 358 395 Bool getUseVSO ( ) { return m_bUseVSO;}; 396 #if SAIT_VSO_EST_A0033 397 Bool getUseEstimatedVSD( ) { return m_bUseEstimatedVSD; }; 398 Void setUseEstimatedVSD( Bool bIn ) { m_bUseEstimatedVSD = bIn; }; 399 400 TComPicYuv* getVideoRecPicYuv () { return m_pcVideoRecPicYuv; }; 401 Void setVideoRecPicYuv ( TComPicYuv* pcVideoRecPicYuv ) { m_pcVideoRecPicYuv = pcVideoRecPicYuv; }; 402 TComPicYuv* getDepthPicYuv () { return m_pcDepthPicYuv; }; 403 Void setDepthPicYuv ( TComPicYuv* pcDepthPicYuv ) { m_pcDepthPicYuv = pcDepthPicYuv; }; 404 #endif 359 405 360 406 Bool getUseRenModel ( ) { return (m_bUseVSO && m_uiVSOMode == 4); }; -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r77 r100 219 219 } 220 220 221 221 #if QC_MULTI_DIS_CAN 222 Bool 223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp 224 #if QC_SIMPLIFIEDIVRP_M24938 225 , Bool bRecon 226 #endif 227 ) 228 #else 222 229 Bool 223 230 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv … … 226 233 #endif 227 234 ) 235 #endif 228 236 { 229 237 AOF( pcCU ); … … 235 243 iBlkHeight = pcCU->getHeight ( 0 ); 236 244 pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos ); 245 #if QC_MULTI_DIS_CAN 246 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp 247 #if QC_SIMPLIFIEDIVRP_M24938 248 , bRecon 249 #endif 250 ); 251 #else 237 252 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv 238 253 #if QC_SIMPLIFIEDIVRP_M24938 … … 240 255 #endif 241 256 ); 257 #endif 242 258 } 243 259 260 #if QC_MULTI_DIS_CAN 261 Bool 262 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 263 #if QC_SIMPLIFIEDIVRP_M24938 264 , Bool bRecon 265 #endif 266 ) 267 #else 244 268 Bool 245 269 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv … … 248 272 #endif 249 273 ) 274 #endif 250 275 { 251 276 UInt uiBaseViewId = m_pcDepthMapGenerator->getBaseViewId( 0 ); … … 258 283 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 259 284 #endif 285 #if QC_MULTI_DIS_CAN 286 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp 287 #if QC_SIMPLIFIEDIVRP_M24938 288 , &uiXPosInRefView , &uiYPosInRefView , bRecon 289 #endif 290 ); 291 #else 260 292 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv 261 293 #if QC_SIMPLIFIEDIVRP_M24938 … … 263 295 #endif 264 296 ); 265 297 #endif 266 298 #if QC_SIMPLIFIEDIVRP_M24938 267 299 return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight ); … … 423 455 AOF( bOK ); 424 456 #if LG_RESTRICTEDRESPRED_M24766 425 426 457 pcCU->getPUResiPredShift(iPUPredResiShift, 0); 458 pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 427 459 #else 428 460 pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); … … 485 517 486 518 487 519 #if QC_MULTI_DIS_CAN 520 Void 521 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 522 #if QC_SIMPLIFIEDIVRP_M24938 523 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 524 #endif 525 ) 526 #else 488 527 Void 489 528 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv … … 492 531 #endif 493 532 ) 533 #endif 494 534 { 495 535 //===== set and check some basic variables ===== … … 508 548 509 549 //===== get disparity ===== 550 #if QC_MULTI_DIS_CAN 551 Int iDisparity = iDisp; 552 #else 510 553 Int iMidPosX = Int( uiXPos + ( ( uiBlkWidth - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX(); 511 554 Int iMidPosY = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpY(); 512 555 Int iDisparity = m_pcDepthMapGenerator->getDisparity( pcPic, iMidPosX, iMidPosY, uiBaseViewId ); 513 556 #endif 514 557 //===== compensate luma ===== 515 558 Int iYWidth = Int( uiBlkWidth ); -
trunk/source/Lib/TLibCommon/TComResidualGenerator.h
r77 r100 69 69 Void setRecResidualPic ( TComPic* pcPic ); 70 70 71 #if QC_MULTI_DIS_CAN 72 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp 73 #if QC_SIMPLIFIEDIVRP_M24938 74 , Bool bRecon 75 #endif 76 ); 77 Bool getResidualSamples ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv , Int iDisp 78 #if QC_SIMPLIFIEDIVRP_M24938 79 , Bool bRecon 80 #endif 81 ); 82 #else 71 83 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv 72 84 #if QC_SIMPLIFIEDIVRP_M24938 … … 79 91 #endif 80 92 ); 93 #endif 81 94 82 95 private: … … 87 100 Void xClearIntViewResidual ( TComDataCU* pcCU, TComYuv* pcCUResidual, UInt uiPartIdx ); 88 101 Void xClearResidual ( TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 89 102 #if QC_MULTI_DIS_CAN 103 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 104 #if QC_SIMPLIFIEDIVRP_M24938 105 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 106 #endif 107 ); 108 #else 90 109 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 91 110 #if QC_SIMPLIFIEDIVRP_M24938 … … 93 112 #endif 94 113 ); 114 #endif 95 115 Bool xIsNonZero ( TComYuv* pcYuv, UInt uiBlkWidth, UInt uiBlkHeight ); 96 116 #if QC_SIMPLIFIEDIVRP_M24938 -
trunk/source/Lib/TLibCommon/TComRom.h
r56 r100 206 206 #endif 207 207 208 #if LGE_EDGE_INTRA 209 __inline Void mapEdgeIntratoDC( UChar& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 210 __inline Void mapEdgeIntratoDC( UInt& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 211 __inline Void mapEdgeIntratoDC( Int& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 212 #endif 213 208 214 // ========================================== 209 215 // Mode-Dependent DST Matrices -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r77 r100 1335 1335 TComVPS::~TComVPS() 1336 1336 { 1337 1338 1337 1338 1339 1339 } 1340 1340 -
trunk/source/Lib/TLibCommon/TComSlice.h
r77 r100 151 151 private: 152 152 Int m_VPSId; 153 UIntm_uiMaxTLayers;154 UIntm_uiMaxLayers;155 Boolm_bTemporalIdNestingFlag;156 157 153 UInt m_uiMaxTLayers; 154 UInt m_uiMaxLayers; 155 Bool m_bTemporalIdNestingFlag; 156 157 UInt m_uiExtensionType; 158 158 159 159 Bool m_bDependentFlag[MAX_LAYER_NUM]; … … 170 170 TComVPS(); 171 171 virtual ~TComVPS(); 172 172 173 173 Int getVPSId () { return m_VPSId; } 174 174 Void setVPSId (Int i) { m_VPSId = i; } 175 175 176 176 UInt getMaxTLayers () { return m_uiMaxTLayers; } 177 177 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 178 178 179 179 UInt getMaxLayers () { return m_uiMaxLayers; } 180 181 180 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 181 182 182 Bool getTemporalNestingFlag () { return m_uiMaxLayers; } 183 183 Void setTemporalNestingFlag (UInt t) { m_bTemporalIdNestingFlag = t; } 184 184 185 185 Void setExtensionType(UInt v) { m_uiExtensionType = v; } … … 219 219 private: 220 220 #if VIDYO_VPS_INTEGRATION 221 Intm_VPSId;221 Int m_VPSId; 222 222 #endif 223 223 Int m_SPSId; … … 379 379 virtual ~TComSPS(); 380 380 #if VIDYO_VPS_INTEGRATION 381 381 Int getVPSId () { return m_VPSId; } 382 382 Void setVPSId (Int i) { m_VPSId = i; } 383 383 #endif -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r77 r100 396 396 TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 397 397 { 398 399 398 addLuma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth, iHeight, bSubtract ); 399 addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 400 } 401 401 #else … … 412 412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset) 413 413 { 414 415 {416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 iXOffset = iWidth; iYOffset = iHeight;break;433 414 switch(uhPartitionSize) 415 { 416 case SIZE_2NxN: 417 iXOffset = iWidth; iYOffset = iHeight >> 1; break; 418 case SIZE_2NxnU: 419 iXOffset = iWidth; iYOffset = iHeight >> 2; break; 420 case SIZE_2NxnD: 421 iXOffset = iWidth; iYOffset = (iHeight >> 1) + (iHeight >> 2); break; 422 case SIZE_Nx2N: 423 iXOffset = iWidth >> 1; iYOffset = iHeight; break; 424 case SIZE_nLx2N: 425 iXOffset = iWidth >> 2; iYOffset = iHeight; break; 426 case SIZE_nRx2N: 427 iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break; 428 case SIZE_NxN: 429 iXOffset = iWidth >> 1; iYOffset = iHeight >> 1; break; 430 default: 431 assert(uhPartitionSize == SIZE_2Nx2N); 432 iXOffset = iWidth; iYOffset = iHeight; break; 433 } 434 434 } 435 435 #endif … … 456 456 for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 457 457 { 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 458 if(iPUResiPredShift[0] >= 0) 459 { 460 for( Int iX = 0; iX < iXOffset; iX++ ) 461 { 462 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]); 463 } 464 } 465 466 if(iPUResiPredShift[1] >= 0) 467 { 468 for( Int iX = iXOffset; iX < iWidth; iX++ ) 469 { 470 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]); 471 } 472 } 473 473 } 474 474 475 475 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 476 476 { 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 477 if(iPUResiPredShift[2] >= 0) 478 { 479 for( Int iX = 0; iX < iXOffset; iX++ ) 480 { 481 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]); 482 } 483 } 484 485 if(iPUResiPredShift[3] >= 0) 486 { 487 for( Int iX = iXOffset; iX < iWidth; iX++ ) 488 { 489 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]); 490 } 491 } 492 492 } 493 493 #else … … 524 524 525 525 for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 526 527 { 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 526 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 527 { 528 if(iPUResiPredShift[0] >= 0) 529 { 530 for( Int iX = 0; iX < iXOffset; iX++ ) 531 { 532 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]); 533 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]); 534 } 535 } 536 537 if(iPUResiPredShift[1] >= 0) 538 { 539 for( Int iX = iXOffset; iX < iWidth; iX++ ) 540 { 541 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]); 542 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]); 543 } 544 } 545 545 } 546 546 547 547 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 548 549 { 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 548 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 549 { 550 if(iPUResiPredShift[2] >= 0) 551 { 552 for( Int iX = 0; iX < iXOffset; iX++ ) 553 { 554 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]); 555 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]); 556 } 557 } 558 559 if(iPUResiPredShift[3] >= 0) 560 { 561 for( Int iX = iXOffset; iX < iWidth; iX++ ) 562 { 563 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]); 564 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]); 565 } 566 } 567 567 } 568 568 #else … … 679 679 Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 680 680 { 681 682 681 subtractLuma (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 682 subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 683 683 } 684 684 #else … … 713 713 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 714 714 { 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 715 if(iPUResiPredShift[3] >= 0) 716 { 717 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 718 { 719 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 720 } 721 } 722 723 if(iPUResiPredShift[2] >= 0) 724 { 725 for ( x = iXOffset-1; x >= 0; x-- ) 726 { 727 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 728 } 729 } 730 pSrc0 += iSrc0Stride; 731 pSrc1 += iSrc1Stride; 732 pDst += iDstStride; 733 733 } 734 734 735 735 for ( y = iYOffset-1; y >= 0; y-- ) 736 736 { 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 737 if(iPUResiPredShift[1] >= 0) 738 { 739 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 740 { 741 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 742 } 743 } 744 745 if(iPUResiPredShift[0] >= 0) 746 { 747 for ( x = iXOffset-1; x >= 0; x-- ) 748 { 749 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 750 } 751 } 752 pSrc0 += iSrc0Stride; 753 pSrc1 += iSrc1Stride; 754 pDst += iDstStride; 755 755 } 756 756 … … 794 794 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 795 795 { 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 796 if(iPUResiPredShift[3] >= 0) 797 { 798 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 799 { 800 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]); 801 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]); 802 } 803 } 804 805 if(iPUResiPredShift[2] >= 0) 806 { 807 for ( x = iXOffset-1; x >= 0; x-- ) 808 { 809 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]); 810 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]); 811 } 812 } 813 pSrcU0 += iSrc0Stride; 814 pSrcU1 += iSrc1Stride; 815 pSrcV0 += iSrc0Stride; 816 pSrcV1 += iSrc1Stride; 817 pDstU += iDstStride; 818 pDstV += iDstStride; 819 819 } 820 820 821 821 for ( y = iYOffset-1; y >= 0; y-- ) 822 822 { 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 823 if(iPUResiPredShift[1] >= 0) 824 { 825 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 826 { 827 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]); 828 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]); 829 } 830 } 831 832 if(iPUResiPredShift[0] >= 0) 833 { 834 for ( x = iXOffset-1; x >= 0; x-- ) 835 { 836 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]); 837 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]); 838 } 839 } 840 pSrcU0 += iSrc0Stride; 841 pSrcU1 += iSrc1Stride; 842 pSrcV0 += iSrc0Stride; 843 pSrcV1 += iSrc1Stride; 844 pDstU += iDstStride; 845 pDstV += iDstStride; 846 846 } 847 847 #else -
trunk/source/Lib/TLibCommon/TComYuv.h
r77 r100 167 167 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight ); 168 168 #if LG_RESTRICTEDRESPRED_M24766 169 voidgetPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);169 Void getPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset); 170 170 Void add (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 171 171 Void addLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r77 r100 42 42 //! \{ 43 43 44 #define FIXES 1 45 #define LGE_EDGE_INTRA 1 //JCT2-A0070 46 #if LGE_EDGE_INTRA 47 #define LGE_EDGE_INTRA_MIN_SIZE 4 48 #define LGE_EDGE_INTRA_MAX_SIZE 32 49 #define LGE_EDGE_INTRA_THRESHOLD 20 50 #define LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 8 51 #define LGE_EDGE_INTRA_DELTA_DC 1 52 #define LGE_EDGE_INTRA_PIXEL_DIFFERENCE 1 53 #endif 54 55 #define LG_ZEROINTRADEPTHRESI_M26039 1 //JCT2-A0087 56 44 57 #define SONY_COLPIC_AVAILABILITY 1 45 58 46 59 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 47 60 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 48 #define HHI_FIX 1 // inter-view prediction and other fixes 61 #define QC_MULTI_DIS_CAN 1 // JCT2-A0097 62 #if QC_MULTI_DIS_CAN 63 #define DIS_CANS 1 64 #endif 65 66 #define MTK_INTERVIEW_MERGE_A0049 1 // JCT2-A0049 second part 67 68 #define LGE_DVMCP 1 // JCT2-A0126 69 #if LGE_DVMCP 70 #define DVFROM_LEFTBELOW 1 71 #define DVFROM_LEFT 2 72 #define DVFROM_ABOVERIGHT 3 73 #define DVFROM_ABOVE 4 74 #define DVFROM_ABOVELEFT 5 75 #define DVFROM_COL 6 76 #endif 77 49 78 50 79 #define HHI_VSO 1 51 #define HHI_VSO_LS_TABLE 1 80 #define HHI_VSO_LS_TABLE 1 // m23714 52 81 #define HHI_VSO_DIST_INT 1 53 82 #define HHI_VSO_SYNTH_DIST_OUT 0 54 83 #define HHI_VSO_COLOR_PLANES 1 84 #define HHI_VSO_SPEEDUP_A033 1 // JCT2-A0033 modification 1 (changes classes directly related the renderer model 85 // to are not covered by this define, since nearly the entire class has been changed) 86 #define HHI_VSO_RM_ASSERTIONS 0 // output VSO assertions 87 #define HHI_VSO_SET_OPTIM 1 // remove unnecessary updates (works only with HHI_VSO_FIX 1 properly) 88 #define SAIT_VSO_EST_A0033 1 // JCT2-A0033 modification 3 89 #define LGE_VSO_EARLY_SKIP_A0093 1 // JCT2-A0093 modification 4 90 55 91 56 92 #define HHI_INTERVIEW_SKIP 1 57 93 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1 58 94 59 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)60 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )95 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction) 96 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction ) 61 97 62 98 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 224 260 #define LOG2_SCAN_SET_SIZE 4 225 261 262 #if LGE_EDGE_INTRA 263 #if LGE_EDGE_INTRA_DELTA_DC 264 #define FAST_UDI_MAX_RDMODE_NUM 37 ///< maximum number of RD comparison in fast-UDI estimation loop 265 #else 266 #define FAST_UDI_MAX_RDMODE_NUM 36 ///< maximum number of RD comparison in fast-UDI estimation loop 267 #endif 268 #else 226 269 #define FAST_UDI_MAX_RDMODE_NUM 35 ///< maximum number of RD comparison in fast-UDI estimation loop 270 #endif 227 271 228 272 #define ZERO_MVD_EST 0 ///< Zero Mvd Estimation in normal mode … … 263 307 #define NUM_DMM_MODE 4 264 308 #endif 309 310 #if LGE_EDGE_INTRA 311 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 312 #define EDGE_INTRA_IDX (NUM_INTRA_MODE+NUM_DMM_MODE) 313 #endif // HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 314 #if LGE_EDGE_INTRA_DELTA_DC 315 #define EDGE_INTRA_DELTA_IDX (EDGE_INTRA_IDX+1) 316 #endif 317 #endif // LGE_EDGE_INTRA 265 318 266 319 #define IBDI_DISTORTION 0 ///< enable/disable SSE modification when IBDI is used (JCTVC-D152) … … 647 700 }; 648 701 702 #if HHI_VSO_SPEEDUP_A033 703 704 enum BlenMod 705 { 706 BLEND_NONE = -1, 707 BLEND_AVRG = 0, 708 BLEND_LEFT = 1, 709 BLEND_RIGHT = 2, 710 BLEND_GEN = 3 711 }; 712 #endif 713 649 714 /// supported prediction type 650 715 enum PredMode … … 712 777 DF_HADS16N = 28, ///< 16NxM HAD with step 713 778 779 #if SAIT_VSO_EST_A0033 780 DF_VSD = 29, ///< general size VSD 781 DF_VSD4 = 30, ///< 4xM VSD 782 DF_VSD8 = 31, ///< 8xM VSD 783 DF_VSD16 = 32, ///< 16xM VSD 784 DF_VSD32 = 33, ///< 32xM VSD 785 DF_VSD64 = 34, ///< 64xM VSD 786 DF_VSD16N = 35, ///< 16NxM VSD 787 #endif 788 789 714 790 #if AMP_SAD 715 791 DF_SAD12 = 43,
Note: See TracChangeset for help on using the changeset viewer.