Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComRdCost.cpp
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r1196 r1313 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 38 38 #include <math.h> 39 39 #include <assert.h> 40 #include <limits> 40 41 #include "TComRom.h" 41 42 #include "TComRdCost.h" 42 #if H_3D43 #if NH_3D 43 44 #include "TComDataCU.h" 45 #include "TComRectangle.h" 44 46 #endif 45 47 … … 47 49 //! \{ 48 50 49 #if H_3D_VSO51 #if NH_3D_VSO 50 52 // SAIT_VSO_EST_A0033 51 53 Double TComRdCost::m_dDisparityCoeff = 1.0; … … 58 60 TComRdCost::~TComRdCost() 59 61 { 60 #if !FIX20361 xUninit();62 #endif63 62 } 64 63 65 64 // Calculate RD functions 66 #if H_3D_VSO65 #if NH_3D_VSO 67 66 Double TComRdCost::calcRdCost( UInt uiBits, Dist uiDistortion, Bool bFlag, DFunc eDFunc ) 68 67 #else 69 Double TComRdCost::calcRdCost( UInt uiBits, UIntuiDistortion, Bool bFlag, DFunc eDFunc )68 Double TComRdCost::calcRdCost( UInt uiBits, Distortion uiDistortion, Bool bFlag, DFunc eDFunc ) 70 69 #endif 71 70 { 72 71 Double dRdCost = 0.0; 73 72 Double dLambda = 0.0; 74 73 75 74 switch ( eDFunc ) 76 75 { … … 79 78 break; 80 79 case DF_SAD: 81 dLambda = (Double)m_uiLambdaMotionSAD; 80 #if RExt__HIGH_BIT_DEPTH_SUPPORT 81 dLambda = m_dLambdaMotionSAD[0]; // 0 is valid, because for lossless blocks, the cost equation is modified to compensate. 82 #else 83 dLambda = (Double)m_uiLambdaMotionSAD[0]; // 0 is valid, because for lossless blocks, the cost equation is modified to compensate. 84 #endif 82 85 break; 83 86 case DF_DEFAULT: … … 91 94 break; 92 95 } 93 94 if (bFlag) 96 97 if (bFlag) //NOTE: this "bFlag" is never true 95 98 { 96 99 // Intra8x8, Intra4x4 Block only... 97 #if SEQUENCE_LEVEL_LOSSLESS 98 dRdCost = (Double)(uiBits); 99 #else 100 dRdCost = (((Double)uiDistortion) + ((Double)uiBits * dLambda)); 101 #endif 100 if (m_costMode != COST_STANDARD_LOSSY) 101 { 102 dRdCost = (Double(uiDistortion) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 103 } 104 else 105 { 106 dRdCost = (((Double)uiDistortion) + ((Double)uiBits * dLambda)); 107 } 102 108 } 103 109 else … … 105 111 if (eDFunc == DF_SAD) 106 112 { 107 dRdCost = ((Double)uiDistortion + (Double)((Int)(uiBits * dLambda+.5)>>16)); 108 dRdCost = (Double)(UInt)floor(dRdCost); 113 if (m_costMode != COST_STANDARD_LOSSY) 114 { 115 dRdCost = ((Double(uiDistortion) * 65536) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 116 } 117 else 118 { 119 dRdCost = floor(Double(uiDistortion) + (floor((Double(uiBits) * dLambda) + 0.5) / 65536.0)); 120 } 109 121 } 110 122 else 111 123 { 112 #if SEQUENCE_LEVEL_LOSSLESS 113 dRdCost = (Double)(uiBits); 114 #else 115 dRdCost = ((Double)uiDistortion + (Double)((Int)(uiBits * dLambda+.5))); 116 dRdCost = (Double)(UInt)floor(dRdCost); 117 #endif 118 } 119 } 120 124 if (m_costMode != COST_STANDARD_LOSSY) 125 { 126 dRdCost = (Double(uiDistortion) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 127 } 128 else 129 { 130 dRdCost = floor(Double(uiDistortion) + (Double(uiBits) * dLambda) + 0.5); 131 } 132 } 133 } 134 135 D_PRINT_INDENT( g_traceRDCost, "Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 121 136 return dRdCost; 122 137 } 123 138 124 #if H_3D_VSO139 #if NH_3D_VSO 125 140 Double TComRdCost::calcRdCost64( UInt64 uiBits, Dist64 uiDistortion, Bool bFlag, DFunc eDFunc ) 126 141 #else … … 130 145 Double dRdCost = 0.0; 131 146 Double dLambda = 0.0; 132 147 133 148 switch ( eDFunc ) 134 149 { … … 137 152 break; 138 153 case DF_SAD: 139 dLambda = (Double)m_uiLambdaMotionSAD; 154 #if RExt__HIGH_BIT_DEPTH_SUPPORT 155 dLambda = m_dLambdaMotionSAD[0]; // 0 is valid, because for lossless blocks, the cost equation is modified to compensate. 156 #else 157 dLambda = (Double)m_uiLambdaMotionSAD[0]; // 0 is valid, because for lossless blocks, the cost equation is modified to compensate. 158 #endif 140 159 break; 141 160 case DF_DEFAULT: … … 149 168 break; 150 169 } 151 152 if (bFlag) 170 171 if (bFlag) //NOTE: this "bFlag" is never true 153 172 { 154 173 // Intra8x8, Intra4x4 Block only... 155 #if SEQUENCE_LEVEL_LOSSLESS 156 dRdCost = (Double)(uiBits); 157 #else 158 dRdCost = (((Double)(Int64)uiDistortion) + ((Double)(Int64)uiBits * dLambda)); 159 #endif 174 if (m_costMode != COST_STANDARD_LOSSY) 175 { 176 dRdCost = (Double(uiDistortion) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 177 } 178 else 179 { 180 dRdCost = (((Double)(Int64)uiDistortion) + ((Double)(Int64)uiBits * dLambda)); 181 } 160 182 } 161 183 else … … 163 185 if (eDFunc == DF_SAD) 164 186 { 165 dRdCost = ((Double)(Int64)uiDistortion + (Double)((Int)((Int64)uiBits * dLambda+.5)>>16)); 166 dRdCost = (Double)(UInt)floor(dRdCost); 187 if (m_costMode != COST_STANDARD_LOSSY) 188 { 189 dRdCost = ((Double(uiDistortion) * 65536) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 190 } 191 else 192 { 193 dRdCost = floor(Double(uiDistortion) + (floor((Double(uiBits) * dLambda) + 0.5) / 65536.0)); 194 } 167 195 } 168 196 else 169 197 { 170 #if SEQUENCE_LEVEL_LOSSLESS 171 dRdCost = (Double)(uiBits); 172 #else 173 dRdCost = ((Double)(Int64)uiDistortion + (Double)((Int)((Int64)uiBits * dLambda+.5))); 174 dRdCost = (Double)(UInt)floor(dRdCost); 175 #endif 176 } 177 } 178 198 if (m_costMode != COST_STANDARD_LOSSY) 199 { 200 dRdCost = (Double(uiDistortion) / dLambda) + Double(uiBits); // all lossless costs would have uiDistortion=0, and therefore this cost function can be used. 201 } 202 else 203 { 204 dRdCost = floor(Double(uiDistortion) + (Double(uiBits) * dLambda) + 0.5); 205 } 206 } 207 } 208 179 209 return dRdCost; 180 210 } 181 211 182 Void TComRdCost::setLambda( Double dLambda )212 Void TComRdCost::setLambda( Double dLambda, const BitDepths &bitDepths ) 183 213 { 184 214 m_dLambda = dLambda; 185 215 m_sqrtLambda = sqrt(m_dLambda); 186 m_uiLambdaMotionSAD = (UInt)floor(65536.0 * m_sqrtLambda); 187 m_uiLambdaMotionSSE = (UInt)floor(65536.0 * m_dLambda ); 216 #if RExt__HIGH_BIT_DEPTH_SUPPORT 217 m_dLambdaMotionSAD[0] = 65536.0 * m_sqrtLambda; 218 m_dLambdaMotionSSE[0] = 65536.0 * m_dLambda; 219 #if FULL_NBIT 220 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12) / 3.0)); 221 #else 222 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * (bitDepths.recon[CHANNEL_TYPE_LUMA] - 8)) / 3.0)); 223 #endif 224 m_dLambdaMotionSAD[1] = 65536.0 * sqrt(dLambda); 225 m_dLambdaMotionSSE[1] = 65536.0 * dLambda; 226 #else 227 m_uiLambdaMotionSAD[0] = (UInt)floor(65536.0 * m_sqrtLambda); 228 m_uiLambdaMotionSSE[0] = (UInt)floor(65536.0 * m_dLambda ); 229 #if FULL_NBIT 230 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12) / 3.0)); 231 #else 232 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * (bitDepths.recon[CHANNEL_TYPE_LUMA] - 8)) / 3.0)); 233 #endif 234 m_uiLambdaMotionSAD[1] = (UInt)floor(65536.0 * sqrt(dLambda)); 235 m_uiLambdaMotionSSE[1] = (UInt)floor(65536.0 * dLambda ); 236 #endif 188 237 } 189 238 … … 192 241 Void TComRdCost::init() 193 242 { 194 m_afpDistortFunc[0] = NULL; // for DF_DEFAULT 195 196 m_afpDistortFunc[1] = TComRdCost::xGetSSE; 197 m_afpDistortFunc[2] = TComRdCost::xGetSSE4; 198 m_afpDistortFunc[3] = TComRdCost::xGetSSE8; 199 m_afpDistortFunc[4] = TComRdCost::xGetSSE16; 200 m_afpDistortFunc[5] = TComRdCost::xGetSSE32; 201 m_afpDistortFunc[6] = TComRdCost::xGetSSE64; 202 m_afpDistortFunc[7] = TComRdCost::xGetSSE16N; 203 204 m_afpDistortFunc[8] = TComRdCost::xGetSAD; 205 m_afpDistortFunc[9] = TComRdCost::xGetSAD4; 206 m_afpDistortFunc[10] = TComRdCost::xGetSAD8; 207 m_afpDistortFunc[11] = TComRdCost::xGetSAD16; 208 m_afpDistortFunc[12] = TComRdCost::xGetSAD32; 209 m_afpDistortFunc[13] = TComRdCost::xGetSAD64; 210 m_afpDistortFunc[14] = TComRdCost::xGetSAD16N; 211 212 m_afpDistortFunc[15] = TComRdCost::xGetSAD; 213 m_afpDistortFunc[16] = TComRdCost::xGetSAD4; 214 m_afpDistortFunc[17] = TComRdCost::xGetSAD8; 215 m_afpDistortFunc[18] = TComRdCost::xGetSAD16; 216 m_afpDistortFunc[19] = TComRdCost::xGetSAD32; 217 m_afpDistortFunc[20] = TComRdCost::xGetSAD64; 218 m_afpDistortFunc[21] = TComRdCost::xGetSAD16N; 219 220 #if AMP_SAD 221 m_afpDistortFunc[43] = TComRdCost::xGetSAD12; 222 m_afpDistortFunc[44] = TComRdCost::xGetSAD24; 223 m_afpDistortFunc[45] = TComRdCost::xGetSAD48; 224 225 m_afpDistortFunc[46] = TComRdCost::xGetSAD12; 226 m_afpDistortFunc[47] = TComRdCost::xGetSAD24; 227 m_afpDistortFunc[48] = TComRdCost::xGetSAD48; 228 #endif 229 m_afpDistortFunc[22] = TComRdCost::xGetHADs; 230 m_afpDistortFunc[23] = TComRdCost::xGetHADs; 231 m_afpDistortFunc[24] = TComRdCost::xGetHADs; 232 m_afpDistortFunc[25] = TComRdCost::xGetHADs; 233 m_afpDistortFunc[26] = TComRdCost::xGetHADs; 234 m_afpDistortFunc[27] = TComRdCost::xGetHADs; 235 m_afpDistortFunc[28] = TComRdCost::xGetHADs; 236 237 #if H_3D_VSO 243 m_afpDistortFunc[DF_DEFAULT] = NULL; // for DF_DEFAULT 244 245 m_afpDistortFunc[DF_SSE ] = TComRdCost::xGetSSE; 246 m_afpDistortFunc[DF_SSE4 ] = TComRdCost::xGetSSE4; 247 m_afpDistortFunc[DF_SSE8 ] = TComRdCost::xGetSSE8; 248 m_afpDistortFunc[DF_SSE16 ] = TComRdCost::xGetSSE16; 249 m_afpDistortFunc[DF_SSE32 ] = TComRdCost::xGetSSE32; 250 m_afpDistortFunc[DF_SSE64 ] = TComRdCost::xGetSSE64; 251 m_afpDistortFunc[DF_SSE16N ] = TComRdCost::xGetSSE16N; 252 253 m_afpDistortFunc[DF_SAD ] = TComRdCost::xGetSAD; 254 m_afpDistortFunc[DF_SAD4 ] = TComRdCost::xGetSAD4; 255 m_afpDistortFunc[DF_SAD8 ] = TComRdCost::xGetSAD8; 256 m_afpDistortFunc[DF_SAD16 ] = TComRdCost::xGetSAD16; 257 m_afpDistortFunc[DF_SAD32 ] = TComRdCost::xGetSAD32; 258 m_afpDistortFunc[DF_SAD64 ] = TComRdCost::xGetSAD64; 259 m_afpDistortFunc[DF_SAD16N ] = TComRdCost::xGetSAD16N; 260 261 m_afpDistortFunc[DF_SADS ] = TComRdCost::xGetSAD; 262 m_afpDistortFunc[DF_SADS4 ] = TComRdCost::xGetSAD4; 263 m_afpDistortFunc[DF_SADS8 ] = TComRdCost::xGetSAD8; 264 m_afpDistortFunc[DF_SADS16 ] = TComRdCost::xGetSAD16; 265 m_afpDistortFunc[DF_SADS32 ] = TComRdCost::xGetSAD32; 266 m_afpDistortFunc[DF_SADS64 ] = TComRdCost::xGetSAD64; 267 m_afpDistortFunc[DF_SADS16N] = TComRdCost::xGetSAD16N; 268 269 m_afpDistortFunc[DF_SAD12 ] = TComRdCost::xGetSAD12; 270 m_afpDistortFunc[DF_SAD24 ] = TComRdCost::xGetSAD24; 271 m_afpDistortFunc[DF_SAD48 ] = TComRdCost::xGetSAD48; 272 273 m_afpDistortFunc[DF_SADS12 ] = TComRdCost::xGetSAD12; 274 m_afpDistortFunc[DF_SADS24 ] = TComRdCost::xGetSAD24; 275 m_afpDistortFunc[DF_SADS48 ] = TComRdCost::xGetSAD48; 276 277 m_afpDistortFunc[DF_HADS ] = TComRdCost::xGetHADs; 278 m_afpDistortFunc[DF_HADS4 ] = TComRdCost::xGetHADs; 279 m_afpDistortFunc[DF_HADS8 ] = TComRdCost::xGetHADs; 280 m_afpDistortFunc[DF_HADS16 ] = TComRdCost::xGetHADs; 281 m_afpDistortFunc[DF_HADS32 ] = TComRdCost::xGetHADs; 282 m_afpDistortFunc[DF_HADS64 ] = TComRdCost::xGetHADs; 283 m_afpDistortFunc[DF_HADS16N] = TComRdCost::xGetHADs; 284 285 #if NH_3D_VSO 238 286 // SAIT_VSO_EST_A0033 239 287 m_afpDistortFunc[29] = TComRdCost::xGetVSD; … … 245 293 m_afpDistortFunc[35] = TComRdCost::xGetVSD16N; 246 294 #endif 247 #if !FIX203 248 m_puiComponentCostOriginP = NULL; 249 m_puiComponentCost = NULL; 250 m_puiVerCost = NULL; 251 m_puiHorCost = NULL; 252 #endif 253 m_uiCost = 0; 254 m_iCostScale = 0; 255 #if !FIX203 256 m_iSearchLimit = 0xdeaddead; 257 #endif 258 #if H_3D_VSO 295 296 m_costMode = COST_STANDARD_LOSSY; 297 298 #if RExt__HIGH_BIT_DEPTH_SUPPORT 299 m_dCost = 0; 300 #else 301 m_uiCost = 0; 302 #endif 303 m_iCostScale = 0; 304 305 #if NH_3D_VSO 259 306 m_bUseVSO = false; 260 307 m_uiVSOMode = 0; … … 265 312 m_bUseEstimatedVSD = false; 266 313 #endif 267 #if H_3D_DBBP314 #if NH_3D_DBBP 268 315 m_bUseMask = false; 269 316 #endif 270 } 271 272 #if !FIX203 273 Void TComRdCost::initRateDistortionModel( Int iSubPelSearchLimit ) 274 { 275 // make it larger 276 iSubPelSearchLimit += 4; 277 iSubPelSearchLimit *= 8; 278 279 if( m_iSearchLimit != iSubPelSearchLimit ) 280 { 281 xUninit(); 282 283 m_iSearchLimit = iSubPelSearchLimit; 284 285 m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ]; 286 iSubPelSearchLimit *= 2; 287 288 m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit; 289 290 for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++) 291 { 292 m_puiComponentCost[n] = xGetComponentBits( n ); 293 } 294 } 295 } 296 297 Void TComRdCost::xUninit() 298 { 299 if( NULL != m_puiComponentCostOriginP ) 300 { 301 delete [] m_puiComponentCostOriginP; 302 m_puiComponentCostOriginP = NULL; 303 } 304 } 305 #endif 306 307 UInt TComRdCost::xGetComponentBits( Int iVal ) 308 { 317 318 } 319 320 // Static member function 321 UInt TComRdCost::xGetExpGolombNumberOfBits( Int iVal ) 322 { 323 assert(iVal != std::numeric_limits<Int>::min()); 309 324 UInt uiLength = 1; 310 UInt uiTemp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1); 311 312 assert ( uiTemp ); 313 325 UInt uiTemp = ( iVal <= 0) ? (UInt(-iVal)<<1)+1: UInt(iVal<<1); 326 314 327 while ( 1 != uiTemp ) 315 328 { … … 317 330 uiLength += 2; 318 331 } 319 332 320 333 return uiLength; 321 334 } … … 327 340 rcDistParam.iRows = uiBlkHeight; 328 341 rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 329 330 #if H_3D_DBBP342 343 #if NH_3D_DBBP 331 344 if( m_bUseMask ) 332 345 { … … 363 376 rcDistParam.pOrg = pcPatternKey->getROIY(); 364 377 rcDistParam.pCur = piRefY; 365 378 366 379 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 367 380 rcDistParam.iStrideCur = iRefStride; 368 381 369 382 // set Block Width / Height 370 383 rcDistParam.iCols = pcPatternKey->getROIYWidth(); 371 384 rcDistParam.iRows = pcPatternKey->getROIYHeight(); 372 385 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 373 374 #if AMP_SAD 386 375 387 if (rcDistParam.iCols == 12) 376 388 { 377 rcDistParam.DistFunc = m_afpDistortFunc[ 43];389 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD12]; 378 390 } 379 391 else if (rcDistParam.iCols == 24) 380 392 { 381 rcDistParam.DistFunc = m_afpDistortFunc[ 44];393 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD24]; 382 394 } 383 395 else if (rcDistParam.iCols == 48) 384 396 { 385 rcDistParam.DistFunc = m_afpDistortFunc[45 ]; 386 } 387 #endif 388 389 #if H_3D_DBBP 397 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD48]; 398 } 399 400 #if NH_3D_DBBP 390 401 if( m_bUseMask ) 391 402 { … … 403 414 rcDistParam.pOrg = pcPatternKey->getROIY(); 404 415 rcDistParam.pCur = piRefY; 405 416 406 417 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 407 418 rcDistParam.iStrideCur = iRefStride * iStep; 408 419 409 420 // set Step for interpolated buffer 410 421 rcDistParam.iStep = iStep; 411 422 412 423 // set Block Width / Height 413 424 rcDistParam.iCols = pcPatternKey->getROIYWidth(); 414 425 rcDistParam.iRows = pcPatternKey->getROIYHeight(); 415 426 416 427 // set distortion function 417 428 if ( !bHADME ) 418 429 { 419 430 rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 420 #if AMP_SAD421 431 if (rcDistParam.iCols == 12) 422 432 { 423 rcDistParam.DistFunc = m_afpDistortFunc[ 46];433 rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS12]; 424 434 } 425 435 else if (rcDistParam.iCols == 24) 426 436 { 427 rcDistParam.DistFunc = m_afpDistortFunc[ 47];437 rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS24]; 428 438 } 429 439 else if (rcDistParam.iCols == 48) 430 440 { 431 rcDistParam.DistFunc = m_afpDistortFunc[48 ]; 432 } 433 #endif 441 rcDistParam.DistFunc = m_afpDistortFunc[DF_SADS48]; 442 } 434 443 } 435 444 else … … 437 446 rcDistParam.DistFunc = m_afpDistortFunc[DF_HADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 438 447 } 439 440 #if H_3D_DBBP448 449 #if NH_3D_DBBP 441 450 if( m_bUseMask ) 442 451 { … … 448 457 } 449 458 450 Void 451 TComRdCost::setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard ) 459 Void TComRdCost::setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard ) 452 460 { 453 461 rcDP.pOrg = p1; … … 461 469 rcDP.bitDepth = bitDepth; 462 470 rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; 463 #if H_3D_DBBP471 #if NH_3D_DBBP 464 472 if( m_bUseMask ) 465 473 { … … 469 477 } 470 478 471 UInt TComRdCost::calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight )472 { 473 UIntuiSum = 0;479 Distortion TComRdCost::calcHAD( Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ) 480 { 481 Distortion uiSum = 0; 474 482 Int x, y; 475 483 476 484 if ( ( (iWidth % 8) == 0 ) && ( (iHeight % 8) == 0 ) ) 477 485 { … … 488 496 else 489 497 { 490 assert (iWidth % 4 == 0 && iHeight % 4 == 0);491 498 assert ( ( (iWidth % 4) == 0 ) && ( (iHeight % 4) == 0 ) ); 499 492 500 for ( y=0; y<iHeight; y+= 4 ) 493 501 { … … 500 508 } 501 509 } 502 503 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 504 505 } 506 507 #if H_3D_FAST_DEPTH_INTRA 508 509 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth) 510 511 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8) ); 512 } 513 514 #if NH_3D_ENC_DEPTH 515 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth, UInt maxCuWidth) 510 516 { 511 517 Int temp = 0; … … 519 525 } 520 526 521 Int cuMaxLog2Size = g_aucConvertToBit[ g_uiMaxCUWidth]+2;527 Int cuMaxLog2Size = g_aucConvertToBit[maxCuWidth]+2; 522 528 523 529 if ( width == 4 ) … … 542 548 543 549 544 UInt TComRdCost::getDistPart(Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, TextType eText, DFunc eDFunc)550 Distortion TComRdCost::getDistPart( Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, const ComponentID compID, DFunc eDFunc ) 545 551 { 546 552 DistParam cDtParam; … … 553 559 554 560 cDtParam.bApplyWeight = false; 555 cDtParam. uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed.556 cDtParam.bitDepth = bitDepth;557 558 #if H_3D_IC561 cDtParam.compIdx = MAX_NUM_COMPONENT; // just for assert: to be sure it was set before use 562 cDtParam.bitDepth = bitDepth; 563 564 #if NH_3D_IC 559 565 cDtParam.bUseIC = false; 560 566 #endif 561 #if H_3D_INTER_SDC567 #if NH_3D_SDC_INTER 562 568 cDtParam.bUseSDCMRSAD = false; 563 569 #endif 564 if (eText == TEXT_CHROMA_U) 565 { 566 return ((Int) (m_cbDistortionWeight * cDtParam.DistFunc( &cDtParam ))); 567 } 568 else if (eText == TEXT_CHROMA_V) 569 { 570 return ((Int) (m_crDistortionWeight * cDtParam.DistFunc( &cDtParam ))); 570 571 if (isChroma(compID)) 572 { 573 return ((Distortion) (m_distortionWeight[compID] * cDtParam.DistFunc( &cDtParam ))); 571 574 } 572 575 else … … 575 578 } 576 579 } 577 #if H_3D_VSO580 #if NH_3D_VSO 578 581 // SAIT_VSO_EST_A0033 579 UInt TComRdCost::getDistPartVSD( TComDataCU* pcCU, UInt uiPartOffset, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bHAD, DFunc eDFunc )582 UInt TComRdCost::getDistPartVSD( TComDataCU* pcCU, UInt uiPartOffset, Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bHAD, DFunc eDFunc ) 580 583 { 581 584 AOT( ( m_dDisparityCoeff <= 0 ) || ( m_dDisparityCoeff > 10 ) ); 582 585 583 Pel* piVirRec = m_pcVideoRecPicYuv->get LumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiPartOffset);584 Pel* piVirOrg = m_pcDepthPicYuv ->get LumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiPartOffset);585 Int iVirStride = m_pcVideoRecPicYuv->getStride( );586 Pel* piVirRec = m_pcVideoRecPicYuv->getAddr( COMPONENT_Y, pcCU->getCtuRsAddr( ), pcCU->getZorderIdxInCtu()+uiPartOffset ); 587 Pel* piVirOrg = m_pcDepthPicYuv ->getAddr( COMPONENT_Y, pcCU->getCtuRsAddr( ), pcCU->getZorderIdxInCtu()+uiPartOffset ); 588 Int iVirStride = m_pcVideoRecPicYuv->getStride( COMPONENT_Y ); 586 589 587 590 DistParam cDtParam; … … 596 599 cDtParam.iStep = 1; 597 600 598 cDtParam.bApplyWeight = false; 599 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 600 601 cDtParam.bitDepth = g_bitDepthY; 601 cDtParam.bApplyWeight = false; 602 603 cDtParam.bitDepth = bitDepth; 604 605 #if NH_3D_IC_FIX 606 cDtParam.bUseIC = false; 607 #endif 608 #if NH_3D_SDC_INTER 609 cDtParam.bUseSDCMRSAD = false; 610 #endif 602 611 603 612 Dist dist = cDtParam.DistFunc( &cDtParam ); … … 611 620 if ( !bHAD ) 612 621 { 613 distDepth = (Dist) getDistPart( g_bitDepthY, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight);622 distDepth = (Dist) getDistPart( bitDepth, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight, COMPONENT_Y); 614 623 } 615 624 else 616 625 { 617 distDepth = (Dist) calcHAD( g_bitDepthY, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight);626 distDepth = (Dist) calcHAD( bitDepth, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight); 618 627 } 619 628 … … 647 656 // ==================================================================================================================== 648 657 649 #if H_3D_DBBP658 #if NH_3D_DBBP 650 659 // -------------------------------------------------------------------------------------------------------------------- 651 660 // Masked distortion functions … … 688 697 689 698 AOF(!pcDtParam->bApplyWeight); 690 #if H_3D_IC699 #if NH_3D_IC 691 700 AOF(!pcDtParam->bUseIC); 692 701 #endif … … 756 765 // -------------------------------------------------------------------------------------------------------------------- 757 766 758 UIntTComRdCost::xGetSAD( DistParam* pcDtParam )767 Distortion TComRdCost::xGetSAD( DistParam* pcDtParam ) 759 768 { 760 769 if ( pcDtParam->bApplyWeight ) 761 770 { 762 return xGetSADw( pcDtParam );763 } 764 #if H_3D_IC771 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 772 } 773 #if NH_3D_IC 765 774 if( pcDtParam->bUseIC ) 766 775 { … … 768 777 } 769 778 #endif 770 #if H_3D_INTER_SDC779 #if NH_3D_SDC_INTER 771 780 if( pcDtParam->bUseSDCMRSAD ) 772 781 { … … 774 783 } 775 784 #endif 776 Pel* piOrg = pcDtParam->pOrg; 777 Pel* piCur = pcDtParam->pCur; 785 786 const Pel* piOrg = pcDtParam->pOrg; 787 const Pel* piCur = pcDtParam->pCur; 778 788 Int iRows = pcDtParam->iRows; 779 789 Int iCols = pcDtParam->iCols; 780 790 Int iStrideCur = pcDtParam->iStrideCur; 781 791 Int iStrideOrg = pcDtParam->iStrideOrg; 782 783 UIntuiSum = 0;784 792 793 Distortion uiSum = 0; 794 785 795 for( ; iRows != 0; iRows-- ) 786 796 { … … 792 802 piCur += iStrideCur; 793 803 } 794 795 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 796 } 797 798 UInt TComRdCost::xGetSAD4( DistParam* pcDtParam ) 799 { 800 if ( pcDtParam->bApplyWeight ) 801 { 802 return xGetSADw( pcDtParam ); 803 } 804 #if H_3D_IC 804 805 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 806 } 807 808 Distortion TComRdCost::xGetSAD4( DistParam* pcDtParam ) 809 { 810 if ( pcDtParam->bApplyWeight ) 811 { 812 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 813 } 814 815 #if NH_3D_IC 805 816 if( pcDtParam->bUseIC ) 806 817 { … … 808 819 } 809 820 #endif 810 #if H_3D_INTER_SDC821 #if NH_3D_SDC_INTER 811 822 if( pcDtParam->bUseSDCMRSAD ) 812 823 { … … 814 825 } 815 826 #endif 816 Pel* piOrg = pcDtParam->pOrg; 817 Pel* piCur = pcDtParam->pCur; 827 828 const Pel* piOrg = pcDtParam->pOrg; 829 const Pel* piCur = pcDtParam->pCur; 818 830 Int iRows = pcDtParam->iRows; 819 831 Int iSubShift = pcDtParam->iSubShift; … … 821 833 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 822 834 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 823 824 UIntuiSum = 0;825 835 836 Distortion uiSum = 0; 837 826 838 for( ; iRows != 0; iRows-=iSubStep ) 827 839 { … … 830 842 uiSum += abs( piOrg[2] - piCur[2] ); 831 843 uiSum += abs( piOrg[3] - piCur[3] ); 832 833 piOrg += iStrideOrg; 834 piCur += iStrideCur; 835 } 836 844 845 piOrg += iStrideOrg; 846 piCur += iStrideCur; 847 } 848 837 849 uiSum <<= iSubShift; 838 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);839 } 840 841 UIntTComRdCost::xGetSAD8( DistParam* pcDtParam )850 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 851 } 852 853 Distortion TComRdCost::xGetSAD8( DistParam* pcDtParam ) 842 854 { 843 855 if ( pcDtParam->bApplyWeight ) 844 856 { 845 return xGetSADw( pcDtParam ); 846 } 847 #if H_3D_IC 857 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 858 } 859 860 #if NH_3D_IC 848 861 if( pcDtParam->bUseIC ) 849 862 { … … 851 864 } 852 865 #endif 853 #if H_3D_INTER_SDC866 #if NH_3D_SDC_INTER 854 867 if( pcDtParam->bUseSDCMRSAD ) 855 868 { … … 857 870 } 858 871 #endif 859 Pel* piOrg = pcDtParam->pOrg; 860 Pel* piCur = pcDtParam->pCur; 872 873 const Pel* piOrg = pcDtParam->pOrg; 874 const Pel* piCur = pcDtParam->pCur; 861 875 Int iRows = pcDtParam->iRows; 862 876 Int iSubShift = pcDtParam->iSubShift; … … 864 878 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 865 879 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 866 867 UIntuiSum = 0;868 880 881 Distortion uiSum = 0; 882 869 883 for( ; iRows != 0; iRows-=iSubStep ) 870 884 { … … 877 891 uiSum += abs( piOrg[6] - piCur[6] ); 878 892 uiSum += abs( piOrg[7] - piCur[7] ); 879 880 piOrg += iStrideOrg; 881 piCur += iStrideCur; 882 } 883 893 894 piOrg += iStrideOrg; 895 piCur += iStrideCur; 896 } 897 884 898 uiSum <<= iSubShift; 885 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);886 } 887 888 UIntTComRdCost::xGetSAD16( DistParam* pcDtParam )899 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 900 } 901 902 Distortion TComRdCost::xGetSAD16( DistParam* pcDtParam ) 889 903 { 890 904 if ( pcDtParam->bApplyWeight ) 891 905 { 892 return xGetSADw( pcDtParam ); 893 } 894 #if H_3D_IC 906 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 907 } 908 909 #if NH_3D_IC 895 910 if( pcDtParam->bUseIC ) 896 911 { … … 898 913 } 899 914 #endif 900 #if H_3D_INTER_SDC915 #if NH_3D_SDC_INTER 901 916 if( pcDtParam->bUseSDCMRSAD ) 902 917 { … … 904 919 } 905 920 #endif 906 Pel* piOrg = pcDtParam->pOrg; 907 Pel* piCur = pcDtParam->pCur; 921 922 const Pel* piOrg = pcDtParam->pOrg; 923 const Pel* piCur = pcDtParam->pCur; 908 924 Int iRows = pcDtParam->iRows; 909 925 Int iSubShift = pcDtParam->iSubShift; … … 911 927 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 912 928 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 913 914 UIntuiSum = 0;915 929 930 Distortion uiSum = 0; 931 916 932 for( ; iRows != 0; iRows-=iSubStep ) 917 933 { … … 932 948 uiSum += abs( piOrg[14] - piCur[14] ); 933 949 uiSum += abs( piOrg[15] - piCur[15] ); 934 935 piOrg += iStrideOrg; 936 piCur += iStrideCur; 937 } 938 950 951 piOrg += iStrideOrg; 952 piCur += iStrideCur; 953 } 954 939 955 uiSum <<= iSubShift; 940 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 941 } 942 943 #if AMP_SAD 944 UInt TComRdCost::xGetSAD12( DistParam* pcDtParam ) 956 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 957 } 958 959 Distortion TComRdCost::xGetSAD12( DistParam* pcDtParam ) 945 960 { 946 961 if ( pcDtParam->bApplyWeight ) 947 962 { 948 return xGetSADw( pcDtParam );949 } 950 #if H_3D_IC963 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 964 } 965 #if NH_3D_IC 951 966 if( pcDtParam->bUseIC ) 952 967 { … … 954 969 } 955 970 #endif 956 #if H_3D_INTER_SDC971 #if NH_3D_SDC_INTER 957 972 if( pcDtParam->bUseSDCMRSAD ) 958 973 { … … 960 975 } 961 976 #endif 962 Pel* piOrg = pcDtParam->pOrg; 963 Pel* piCur = pcDtParam->pCur; 977 978 const Pel* piOrg = pcDtParam->pOrg; 979 const Pel* piCur = pcDtParam->pCur; 964 980 Int iRows = pcDtParam->iRows; 965 981 Int iSubShift = pcDtParam->iSubShift; … … 967 983 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 968 984 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 969 970 UIntuiSum = 0;971 985 986 Distortion uiSum = 0; 987 972 988 for( ; iRows != 0; iRows-=iSubStep ) 973 989 { … … 984 1000 uiSum += abs( piOrg[10] - piCur[10] ); 985 1001 uiSum += abs( piOrg[11] - piCur[11] ); 986 987 piOrg += iStrideOrg; 988 piCur += iStrideCur; 989 } 990 1002 1003 piOrg += iStrideOrg; 1004 piCur += iStrideCur; 1005 } 1006 991 1007 uiSum <<= iSubShift; 992 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 993 } 994 #endif 995 996 UInt TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 997 { 998 #if H_3D_IC 1008 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1009 } 1010 1011 Distortion TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 1012 { 1013 #if NH_3D_IC 999 1014 if( pcDtParam->bUseIC ) 1000 1015 { … … 1002 1017 } 1003 1018 #endif 1004 #if H_3D_INTER_SDC1019 #if NH_3D_SDC_INTER 1005 1020 if( pcDtParam->bUseSDCMRSAD ) 1006 1021 { … … 1008 1023 } 1009 1024 #endif 1010 Pel* piOrg = pcDtParam->pOrg; 1011 Pel* piCur = pcDtParam->pCur; 1025 1026 const Pel* piOrg = pcDtParam->pOrg; 1027 const Pel* piCur = pcDtParam->pCur; 1012 1028 Int iRows = pcDtParam->iRows; 1013 1029 Int iCols = pcDtParam->iCols; … … 1016 1032 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1017 1033 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1018 1019 UIntuiSum = 0;1020 1034 1035 Distortion uiSum = 0; 1036 1021 1037 for( ; iRows != 0; iRows-=iSubStep ) 1022 1038 { … … 1043 1059 piCur += iStrideCur; 1044 1060 } 1045 1061 1046 1062 uiSum <<= iSubShift; 1047 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);1048 } 1049 1050 UIntTComRdCost::xGetSAD32( DistParam* pcDtParam )1063 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1064 } 1065 1066 Distortion TComRdCost::xGetSAD32( DistParam* pcDtParam ) 1051 1067 { 1052 1068 if ( pcDtParam->bApplyWeight ) 1053 1069 { 1054 return xGetSADw( pcDtParam ); 1055 } 1056 #if H_3D_IC 1070 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1071 } 1072 1073 #if NH_3D_IC 1057 1074 if( pcDtParam->bUseIC ) 1058 1075 { … … 1060 1077 } 1061 1078 #endif 1062 #if H_3D_INTER_SDC1079 #if NH_3D_SDC_INTER 1063 1080 if( pcDtParam->bUseSDCMRSAD ) 1064 1081 { … … 1066 1083 } 1067 1084 #endif 1068 Pel* piOrg = pcDtParam->pOrg; 1069 Pel* piCur = pcDtParam->pCur; 1085 1086 const Pel* piOrg = pcDtParam->pOrg; 1087 const Pel* piCur = pcDtParam->pCur; 1070 1088 Int iRows = pcDtParam->iRows; 1071 1089 Int iSubShift = pcDtParam->iSubShift; … … 1073 1091 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1074 1092 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1075 1076 UIntuiSum = 0;1077 1093 1094 Distortion uiSum = 0; 1095 1078 1096 for( ; iRows != 0; iRows-=iSubStep ) 1079 1097 { … … 1110 1128 uiSum += abs( piOrg[30] - piCur[30] ); 1111 1129 uiSum += abs( piOrg[31] - piCur[31] ); 1112 1113 piOrg += iStrideOrg; 1114 piCur += iStrideCur; 1115 } 1116 1130 1131 piOrg += iStrideOrg; 1132 piCur += iStrideCur; 1133 } 1134 1117 1135 uiSum <<= iSubShift; 1118 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1119 } 1120 1121 #if AMP_SAD 1122 UInt TComRdCost::xGetSAD24( DistParam* pcDtParam ) 1136 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1137 } 1138 1139 Distortion TComRdCost::xGetSAD24( DistParam* pcDtParam ) 1123 1140 { 1124 1141 if ( pcDtParam->bApplyWeight ) 1125 1142 { 1126 return xGetSADw( pcDtParam ); 1127 } 1128 #if H_3D_IC 1143 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1144 } 1145 1146 #if NH_3D_IC 1129 1147 if( pcDtParam->bUseIC ) 1130 1148 { … … 1132 1150 } 1133 1151 #endif 1134 #if H_3D_INTER_SDC1152 #if NH_3D_SDC_INTER 1135 1153 if( pcDtParam->bUseSDCMRSAD ) 1136 1154 { … … 1138 1156 } 1139 1157 #endif 1140 Pel* piOrg = pcDtParam->pOrg; 1141 Pel* piCur = pcDtParam->pCur; 1158 1159 const Pel* piOrg = pcDtParam->pOrg; 1160 const Pel* piCur = pcDtParam->pCur; 1142 1161 Int iRows = pcDtParam->iRows; 1143 1162 Int iSubShift = pcDtParam->iSubShift; … … 1145 1164 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1146 1165 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1147 1148 UIntuiSum = 0;1149 1166 1167 Distortion uiSum = 0; 1168 1150 1169 for( ; iRows != 0; iRows-=iSubStep ) 1151 1170 { … … 1174 1193 uiSum += abs( piOrg[22] - piCur[22] ); 1175 1194 uiSum += abs( piOrg[23] - piCur[23] ); 1176 1177 piOrg += iStrideOrg; 1178 piCur += iStrideCur; 1179 } 1180 1195 1196 piOrg += iStrideOrg; 1197 piCur += iStrideCur; 1198 } 1199 1181 1200 uiSum <<= iSubShift; 1182 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1183 } 1184 1185 #endif 1186 1187 UInt TComRdCost::xGetSAD64( DistParam* pcDtParam ) 1201 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1202 } 1203 1204 Distortion TComRdCost::xGetSAD64( DistParam* pcDtParam ) 1188 1205 { 1189 1206 if ( pcDtParam->bApplyWeight ) 1190 1207 { 1191 return xGetSADw( pcDtParam ); 1192 } 1193 #if H_3D_IC 1208 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1209 } 1210 1211 #if NH_3D_IC 1194 1212 if( pcDtParam->bUseIC ) 1195 1213 { … … 1197 1215 } 1198 1216 #endif 1199 #if H_3D_INTER_SDC1217 #if NH_3D_SDC_INTER 1200 1218 if( pcDtParam->bUseSDCMRSAD ) 1201 1219 { … … 1203 1221 } 1204 1222 #endif 1205 Pel* piOrg = pcDtParam->pOrg; 1206 Pel* piCur = pcDtParam->pCur; 1223 1224 const Pel* piOrg = pcDtParam->pOrg; 1225 const Pel* piCur = pcDtParam->pCur; 1207 1226 Int iRows = pcDtParam->iRows; 1208 1227 Int iSubShift = pcDtParam->iSubShift; … … 1210 1229 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1211 1230 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1212 1213 UIntuiSum = 0;1214 1231 1232 Distortion uiSum = 0; 1233 1215 1234 for( ; iRows != 0; iRows-=iSubStep ) 1216 1235 { … … 1279 1298 uiSum += abs( piOrg[62] - piCur[62] ); 1280 1299 uiSum += abs( piOrg[63] - piCur[63] ); 1281 1282 piOrg += iStrideOrg; 1283 piCur += iStrideCur; 1284 } 1285 1300 1301 piOrg += iStrideOrg; 1302 piCur += iStrideCur; 1303 } 1304 1286 1305 uiSum <<= iSubShift; 1287 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1288 } 1289 1290 #if AMP_SAD 1291 UInt TComRdCost::xGetSAD48( DistParam* pcDtParam ) 1306 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1307 } 1308 1309 Distortion TComRdCost::xGetSAD48( DistParam* pcDtParam ) 1292 1310 { 1293 1311 if ( pcDtParam->bApplyWeight ) 1294 1312 { 1295 return xGetSADw( pcDtParam );1296 } 1297 #if H_3D_IC1313 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1314 } 1315 #if NH_3D_IC 1298 1316 if( pcDtParam->bUseIC ) 1299 1317 { … … 1301 1319 } 1302 1320 #endif 1303 #if H_3D_INTER_SDC1321 #if NH_3D_SDC_INTER 1304 1322 if( pcDtParam->bUseSDCMRSAD ) 1305 1323 { … … 1307 1325 } 1308 1326 #endif 1309 Pel* piOrg = pcDtParam->pOrg; 1310 Pel* piCur = pcDtParam->pCur; 1327 1328 const Pel* piOrg = pcDtParam->pOrg; 1329 const Pel* piCur = pcDtParam->pCur; 1311 1330 Int iRows = pcDtParam->iRows; 1312 1331 Int iSubShift = pcDtParam->iSubShift; … … 1314 1333 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1315 1334 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1316 1317 UIntuiSum = 0;1318 1335 1336 Distortion uiSum = 0; 1337 1319 1338 for( ; iRows != 0; iRows-=iSubStep ) 1320 1339 { … … 1367 1386 uiSum += abs( piOrg[46] - piCur[46] ); 1368 1387 uiSum += abs( piOrg[47] - piCur[47] ); 1369 1370 piOrg += iStrideOrg; 1371 piCur += iStrideCur; 1372 } 1373 1388 1389 piOrg += iStrideOrg; 1390 piCur += iStrideCur; 1391 } 1392 1374 1393 uiSum <<= iSubShift; 1375 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);1376 } 1377 #endif 1378 1379 #if H_3D_IC || H_3D_INTER_SDC1394 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 1395 } 1396 1397 1398 #if NH_3D_IC || NH_3D_SDC_INTER 1380 1399 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1381 1400 { 1382 1401 if ( pcDtParam->bApplyWeight ) 1383 1402 { 1384 return xGetSADw( pcDtParam );1403 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1385 1404 } 1386 1405 Pel* piOrg = pcDtParam->pOrg; … … 1430 1449 if ( pcDtParam->bApplyWeight ) 1431 1450 { 1432 return xGetSADw( pcDtParam );1451 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1433 1452 } 1434 1453 Pel* piOrg = pcDtParam->pOrg; … … 1487 1506 if ( pcDtParam->bApplyWeight ) 1488 1507 { 1489 return xGetSADw( pcDtParam );1508 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1490 1509 } 1491 1510 Pel* piOrg = pcDtParam->pOrg; … … 1556 1575 if ( pcDtParam->bApplyWeight ) 1557 1576 { 1558 return xGetSADw( pcDtParam );1577 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1559 1578 } 1560 1579 Pel* piOrg = pcDtParam->pOrg; … … 1645 1664 } 1646 1665 1647 #if AMP_SAD1648 1666 UInt TComRdCost::xGetSAD12ic( DistParam* pcDtParam ) 1649 1667 { 1650 1668 if ( pcDtParam->bApplyWeight ) 1651 1669 { 1652 return xGetSADw( pcDtParam );1670 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1653 1671 } 1654 1672 Pel* piOrg = pcDtParam->pOrg; … … 1726 1744 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 1727 1745 } 1728 #endif 1746 1729 1747 1730 1748 UInt TComRdCost::xGetSAD16Nic( DistParam* pcDtParam ) … … 1825 1843 if ( pcDtParam->bApplyWeight ) 1826 1844 { 1827 return xGetSADw( pcDtParam );1845 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1828 1846 } 1829 1847 Pel* piOrg = pcDtParam->pOrg; … … 1962 1980 } 1963 1981 1964 #if AMP_SAD 1982 1965 1983 UInt TComRdCost::xGetSAD24ic( DistParam* pcDtParam ) 1966 1984 { 1967 1985 if ( pcDtParam->bApplyWeight ) 1968 1986 { 1969 return xGetSADw( pcDtParam );1987 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1970 1988 } 1971 1989 Pel* piOrg = pcDtParam->pOrg; … … 2079 2097 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT( pcDtParam->bitDepth - 8 ) ); 2080 2098 } 2081 #endif2082 2099 2083 2100 UInt TComRdCost::xGetSAD64ic( DistParam* pcDtParam ) … … 2085 2102 if ( pcDtParam->bApplyWeight ) 2086 2103 { 2087 return xGetSADw( pcDtParam );2104 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2088 2105 } 2089 2106 Pel* piOrg = pcDtParam->pOrg; … … 2318 2335 } 2319 2336 2320 #if AMP_SAD 2337 2321 2338 UInt TComRdCost::xGetSAD48ic( DistParam* pcDtParam ) 2322 2339 { 2323 2340 if ( pcDtParam->bApplyWeight ) 2324 2341 { 2325 return xGetSADw( pcDtParam );2342 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2326 2343 } 2327 2344 … … 2509 2526 } 2510 2527 #endif 2511 2512 #endif2513 2528 // -------------------------------------------------------------------------------------------------------------------- 2514 2529 // SSE 2515 2530 // -------------------------------------------------------------------------------------------------------------------- 2516 2531 2517 UIntTComRdCost::xGetSSE( DistParam* pcDtParam )2532 Distortion TComRdCost::xGetSSE( DistParam* pcDtParam ) 2518 2533 { 2519 2534 if ( pcDtParam->bApplyWeight ) 2520 2535 { 2521 return xGetSSEw( pcDtParam );2522 } 2523 Pel* piOrg = pcDtParam->pOrg;2524 Pel* piCur = pcDtParam->pCur;2536 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2537 } 2538 const Pel* piOrg = pcDtParam->pOrg; 2539 const Pel* piCur = pcDtParam->pCur; 2525 2540 Int iRows = pcDtParam->iRows; 2526 2541 Int iCols = pcDtParam->iCols; 2527 2542 Int iStrideOrg = pcDtParam->iStrideOrg; 2528 2543 Int iStrideCur = pcDtParam->iStrideCur; 2529 2530 UInt uiSum= 0;2531 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1);2532 2533 Int iTemp;2534 2544 2545 Distortion uiSum = 0; 2546 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2547 2548 Intermediate_Int iTemp; 2549 2535 2550 for( ; iRows != 0; iRows-- ) 2536 2551 { … … 2538 2553 { 2539 2554 iTemp = piOrg[n ] - piCur[n ]; 2540 uiSum += ( iTemp * iTemp ) >> uiShift;2541 } 2542 piOrg += iStrideOrg; 2543 piCur += iStrideCur; 2544 } 2545 2555 uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2556 } 2557 piOrg += iStrideOrg; 2558 piCur += iStrideCur; 2559 } 2560 2546 2561 return ( uiSum ); 2547 2562 } 2548 2563 2549 UIntTComRdCost::xGetSSE4( DistParam* pcDtParam )2564 Distortion TComRdCost::xGetSSE4( DistParam* pcDtParam ) 2550 2565 { 2551 2566 if ( pcDtParam->bApplyWeight ) 2552 2567 { 2553 2568 assert( pcDtParam->iCols == 4 ); 2554 return xGetSSEw( pcDtParam );2555 } 2556 Pel* piOrg = pcDtParam->pOrg;2557 Pel* piCur = pcDtParam->pCur;2569 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2570 } 2571 const Pel* piOrg = pcDtParam->pOrg; 2572 const Pel* piCur = pcDtParam->pCur; 2558 2573 Int iRows = pcDtParam->iRows; 2559 2574 Int iStrideOrg = pcDtParam->iStrideOrg; 2560 2575 Int iStrideCur = pcDtParam->iStrideCur; 2561 2562 UInt uiSum= 0;2563 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1);2564 2565 Int iTemp;2566 2576 2577 Distortion uiSum = 0; 2578 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2579 2580 Intermediate_Int iTemp; 2581 2567 2582 for( ; iRows != 0; iRows-- ) 2568 2583 { 2569 2570 iTemp = piOrg[0] - piCur[0]; uiSum += ( iTemp * iTemp ) >> uiShift;2571 iTemp = piOrg[1] - piCur[1]; uiSum += ( iTemp * iTemp ) >> uiShift;2572 iTemp = piOrg[2] - piCur[2]; uiSum += ( iTemp * iTemp ) >> uiShift;2573 iTemp = piOrg[3] - piCur[3]; uiSum += ( iTemp * iTemp ) >> uiShift;2574 2575 piOrg += iStrideOrg; 2576 piCur += iStrideCur; 2577 } 2578 2584 2585 iTemp = piOrg[0] - piCur[0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2586 iTemp = piOrg[1] - piCur[1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2587 iTemp = piOrg[2] - piCur[2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2588 iTemp = piOrg[3] - piCur[3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2589 2590 piOrg += iStrideOrg; 2591 piCur += iStrideCur; 2592 } 2593 2579 2594 return ( uiSum ); 2580 2595 } 2581 2596 2582 UIntTComRdCost::xGetSSE8( DistParam* pcDtParam )2597 Distortion TComRdCost::xGetSSE8( DistParam* pcDtParam ) 2583 2598 { 2584 2599 if ( pcDtParam->bApplyWeight ) 2585 2600 { 2586 2601 assert( pcDtParam->iCols == 8 ); 2587 return xGetSSEw( pcDtParam );2588 } 2589 Pel* piOrg = pcDtParam->pOrg;2590 Pel* piCur = pcDtParam->pCur;2602 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2603 } 2604 const Pel* piOrg = pcDtParam->pOrg; 2605 const Pel* piCur = pcDtParam->pCur; 2591 2606 Int iRows = pcDtParam->iRows; 2592 2607 Int iStrideOrg = pcDtParam->iStrideOrg; 2593 2608 Int iStrideCur = pcDtParam->iStrideCur; 2594 2595 UInt uiSum= 0;2596 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1);2597 2598 Int iTemp;2599 2609 2610 Distortion uiSum = 0; 2611 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2612 2613 Intermediate_Int iTemp; 2614 2600 2615 for( ; iRows != 0; iRows-- ) 2601 2616 { 2602 iTemp = piOrg[0] - piCur[0]; uiSum += ( iTemp * iTemp ) >> uiShift;2603 iTemp = piOrg[1] - piCur[1]; uiSum += ( iTemp * iTemp ) >> uiShift;2604 iTemp = piOrg[2] - piCur[2]; uiSum += ( iTemp * iTemp ) >> uiShift;2605 iTemp = piOrg[3] - piCur[3]; uiSum += ( iTemp * iTemp ) >> uiShift;2606 iTemp = piOrg[4] - piCur[4]; uiSum += ( iTemp * iTemp ) >> uiShift;2607 iTemp = piOrg[5] - piCur[5]; uiSum += ( iTemp * iTemp ) >> uiShift;2608 iTemp = piOrg[6] - piCur[6]; uiSum += ( iTemp * iTemp ) >> uiShift;2609 iTemp = piOrg[7] - piCur[7]; uiSum += ( iTemp * iTemp ) >> uiShift;2610 2611 piOrg += iStrideOrg; 2612 piCur += iStrideCur; 2613 } 2614 2617 iTemp = piOrg[0] - piCur[0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2618 iTemp = piOrg[1] - piCur[1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2619 iTemp = piOrg[2] - piCur[2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2620 iTemp = piOrg[3] - piCur[3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2621 iTemp = piOrg[4] - piCur[4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2622 iTemp = piOrg[5] - piCur[5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2623 iTemp = piOrg[6] - piCur[6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2624 iTemp = piOrg[7] - piCur[7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2625 2626 piOrg += iStrideOrg; 2627 piCur += iStrideCur; 2628 } 2629 2615 2630 return ( uiSum ); 2616 2631 } 2617 2632 2618 UIntTComRdCost::xGetSSE16( DistParam* pcDtParam )2633 Distortion TComRdCost::xGetSSE16( DistParam* pcDtParam ) 2619 2634 { 2620 2635 if ( pcDtParam->bApplyWeight ) 2621 2636 { 2622 2637 assert( pcDtParam->iCols == 16 ); 2623 return xGetSSEw( pcDtParam );2624 } 2625 Pel* piOrg = pcDtParam->pOrg;2626 Pel* piCur = pcDtParam->pCur;2638 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2639 } 2640 const Pel* piOrg = pcDtParam->pOrg; 2641 const Pel* piCur = pcDtParam->pCur; 2627 2642 Int iRows = pcDtParam->iRows; 2628 2643 Int iStrideOrg = pcDtParam->iStrideOrg; 2629 2644 Int iStrideCur = pcDtParam->iStrideCur; 2630 2631 UInt uiSum= 0;2632 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1);2633 2634 Int iTemp;2635 2645 2646 Distortion uiSum = 0; 2647 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2648 2649 Intermediate_Int iTemp; 2650 2636 2651 for( ; iRows != 0; iRows-- ) 2637 2652 { 2638 2639 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift;2640 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift;2641 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += ( iTemp * iTemp ) >> uiShift;2642 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += ( iTemp * iTemp ) >> uiShift;2643 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += ( iTemp * iTemp ) >> uiShift;2644 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += ( iTemp * iTemp ) >> uiShift;2645 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += ( iTemp * iTemp ) >> uiShift;2646 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += ( iTemp * iTemp ) >> uiShift;2647 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += ( iTemp * iTemp ) >> uiShift;2648 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += ( iTemp * iTemp ) >> uiShift;2649 iTemp = piOrg[10] - piCur[10]; uiSum += ( iTemp * iTemp ) >> uiShift;2650 iTemp = piOrg[11] - piCur[11]; uiSum += ( iTemp * iTemp ) >> uiShift;2651 iTemp = piOrg[12] - piCur[12]; uiSum += ( iTemp * iTemp ) >> uiShift;2652 iTemp = piOrg[13] - piCur[13]; uiSum += ( iTemp * iTemp ) >> uiShift;2653 iTemp = piOrg[14] - piCur[14]; uiSum += ( iTemp * iTemp ) >> uiShift;2654 iTemp = piOrg[15] - piCur[15]; uiSum += ( iTemp * iTemp ) >> uiShift;2655 2656 piOrg += iStrideOrg; 2657 piCur += iStrideCur; 2658 } 2659 2653 2654 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2655 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2656 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2657 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2658 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2659 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2660 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2661 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2662 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2663 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2664 iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2665 iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2666 iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2667 iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2668 iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2669 iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2670 2671 piOrg += iStrideOrg; 2672 piCur += iStrideCur; 2673 } 2674 2660 2675 return ( uiSum ); 2661 2676 } 2662 2677 2663 UIntTComRdCost::xGetSSE16N( DistParam* pcDtParam )2678 Distortion TComRdCost::xGetSSE16N( DistParam* pcDtParam ) 2664 2679 { 2665 2680 if ( pcDtParam->bApplyWeight ) 2666 2681 { 2667 return xGetSSEw( pcDtParam );2668 } 2669 Pel* piOrg = pcDtParam->pOrg;2670 Pel* piCur = pcDtParam->pCur;2682 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2683 } 2684 const Pel* piOrg = pcDtParam->pOrg; 2685 const Pel* piCur = pcDtParam->pCur; 2671 2686 Int iRows = pcDtParam->iRows; 2672 2687 Int iCols = pcDtParam->iCols; 2673 2688 Int iStrideOrg = pcDtParam->iStrideOrg; 2674 2689 Int iStrideCur = pcDtParam->iStrideCur; 2675 2676 UInt uiSum = 0; 2677 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2678 Int iTemp; 2679 2690 2691 Distortion uiSum = 0; 2692 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2693 2694 Intermediate_Int iTemp; 2695 2680 2696 for( ; iRows != 0; iRows-- ) 2681 2697 { 2682 2698 for (Int n = 0; n < iCols; n+=16 ) 2683 2699 { 2684 2685 iTemp = piOrg[n+ 0] - piCur[n+ 0]; uiSum += ( iTemp * iTemp ) >> uiShift;2686 iTemp = piOrg[n+ 1] - piCur[n+ 1]; uiSum += ( iTemp * iTemp ) >> uiShift;2687 iTemp = piOrg[n+ 2] - piCur[n+ 2]; uiSum += ( iTemp * iTemp ) >> uiShift;2688 iTemp = piOrg[n+ 3] - piCur[n+ 3]; uiSum += ( iTemp * iTemp ) >> uiShift;2689 iTemp = piOrg[n+ 4] - piCur[n+ 4]; uiSum += ( iTemp * iTemp ) >> uiShift;2690 iTemp = piOrg[n+ 5] - piCur[n+ 5]; uiSum += ( iTemp * iTemp ) >> uiShift;2691 iTemp = piOrg[n+ 6] - piCur[n+ 6]; uiSum += ( iTemp * iTemp ) >> uiShift;2692 iTemp = piOrg[n+ 7] - piCur[n+ 7]; uiSum += ( iTemp * iTemp ) >> uiShift;2693 iTemp = piOrg[n+ 8] - piCur[n+ 8]; uiSum += ( iTemp * iTemp ) >> uiShift;2694 iTemp = piOrg[n+ 9] - piCur[n+ 9]; uiSum += ( iTemp * iTemp ) >> uiShift;2695 iTemp = piOrg[n+10] - piCur[n+10]; uiSum += ( iTemp * iTemp ) >> uiShift;2696 iTemp = piOrg[n+11] - piCur[n+11]; uiSum += ( iTemp * iTemp ) >> uiShift;2697 iTemp = piOrg[n+12] - piCur[n+12]; uiSum += ( iTemp * iTemp ) >> uiShift;2698 iTemp = piOrg[n+13] - piCur[n+13]; uiSum += ( iTemp * iTemp ) >> uiShift;2699 iTemp = piOrg[n+14] - piCur[n+14]; uiSum += ( iTemp * iTemp ) >> uiShift;2700 iTemp = piOrg[n+15] - piCur[n+15]; uiSum += ( iTemp * iTemp ) >> uiShift;2701 2702 } 2703 piOrg += iStrideOrg; 2704 piCur += iStrideCur; 2705 } 2706 2700 2701 iTemp = piOrg[n+ 0] - piCur[n+ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2702 iTemp = piOrg[n+ 1] - piCur[n+ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2703 iTemp = piOrg[n+ 2] - piCur[n+ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2704 iTemp = piOrg[n+ 3] - piCur[n+ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2705 iTemp = piOrg[n+ 4] - piCur[n+ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2706 iTemp = piOrg[n+ 5] - piCur[n+ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2707 iTemp = piOrg[n+ 6] - piCur[n+ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2708 iTemp = piOrg[n+ 7] - piCur[n+ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2709 iTemp = piOrg[n+ 8] - piCur[n+ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2710 iTemp = piOrg[n+ 9] - piCur[n+ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2711 iTemp = piOrg[n+10] - piCur[n+10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2712 iTemp = piOrg[n+11] - piCur[n+11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2713 iTemp = piOrg[n+12] - piCur[n+12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2714 iTemp = piOrg[n+13] - piCur[n+13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2715 iTemp = piOrg[n+14] - piCur[n+14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2716 iTemp = piOrg[n+15] - piCur[n+15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2717 2718 } 2719 piOrg += iStrideOrg; 2720 piCur += iStrideCur; 2721 } 2722 2707 2723 return ( uiSum ); 2708 2724 } 2709 2725 2710 UIntTComRdCost::xGetSSE32( DistParam* pcDtParam )2726 Distortion TComRdCost::xGetSSE32( DistParam* pcDtParam ) 2711 2727 { 2712 2728 if ( pcDtParam->bApplyWeight ) 2713 2729 { 2714 2730 assert( pcDtParam->iCols == 32 ); 2715 return xGetSSEw( pcDtParam );2716 } 2717 Pel* piOrg = pcDtParam->pOrg;2718 Pel* piCur = pcDtParam->pCur;2731 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2732 } 2733 const Pel* piOrg = pcDtParam->pOrg; 2734 const Pel* piCur = pcDtParam->pCur; 2719 2735 Int iRows = pcDtParam->iRows; 2720 2736 Int iStrideOrg = pcDtParam->iStrideOrg; 2721 2737 Int iStrideCur = pcDtParam->iStrideCur; 2722 2723 UInt uiSum = 0; 2724 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2725 Int iTemp; 2726 2738 2739 Distortion uiSum = 0; 2740 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2741 2742 Intermediate_Int iTemp; 2743 2727 2744 for( ; iRows != 0; iRows-- ) 2728 2745 { 2729 2730 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift;2731 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift;2732 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += ( iTemp * iTemp ) >> uiShift;2733 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += ( iTemp * iTemp ) >> uiShift;2734 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += ( iTemp * iTemp ) >> uiShift;2735 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += ( iTemp * iTemp ) >> uiShift;2736 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += ( iTemp * iTemp ) >> uiShift;2737 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += ( iTemp * iTemp ) >> uiShift;2738 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += ( iTemp * iTemp ) >> uiShift;2739 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += ( iTemp * iTemp ) >> uiShift;2740 iTemp = piOrg[10] - piCur[10]; uiSum += ( iTemp * iTemp ) >> uiShift;2741 iTemp = piOrg[11] - piCur[11]; uiSum += ( iTemp * iTemp ) >> uiShift;2742 iTemp = piOrg[12] - piCur[12]; uiSum += ( iTemp * iTemp ) >> uiShift;2743 iTemp = piOrg[13] - piCur[13]; uiSum += ( iTemp * iTemp ) >> uiShift;2744 iTemp = piOrg[14] - piCur[14]; uiSum += ( iTemp * iTemp ) >> uiShift;2745 iTemp = piOrg[15] - piCur[15]; uiSum += ( iTemp * iTemp ) >> uiShift;2746 iTemp = piOrg[16] - piCur[16]; uiSum += ( iTemp * iTemp ) >> uiShift;2747 iTemp = piOrg[17] - piCur[17]; uiSum += ( iTemp * iTemp ) >> uiShift;2748 iTemp = piOrg[18] - piCur[18]; uiSum += ( iTemp * iTemp ) >> uiShift;2749 iTemp = piOrg[19] - piCur[19]; uiSum += ( iTemp * iTemp ) >> uiShift;2750 iTemp = piOrg[20] - piCur[20]; uiSum += ( iTemp * iTemp ) >> uiShift;2751 iTemp = piOrg[21] - piCur[21]; uiSum += ( iTemp * iTemp ) >> uiShift;2752 iTemp = piOrg[22] - piCur[22]; uiSum += ( iTemp * iTemp ) >> uiShift;2753 iTemp = piOrg[23] - piCur[23]; uiSum += ( iTemp * iTemp ) >> uiShift;2754 iTemp = piOrg[24] - piCur[24]; uiSum += ( iTemp * iTemp ) >> uiShift;2755 iTemp = piOrg[25] - piCur[25]; uiSum += ( iTemp * iTemp ) >> uiShift;2756 iTemp = piOrg[26] - piCur[26]; uiSum += ( iTemp * iTemp ) >> uiShift;2757 iTemp = piOrg[27] - piCur[27]; uiSum += ( iTemp * iTemp ) >> uiShift;2758 iTemp = piOrg[28] - piCur[28]; uiSum += ( iTemp * iTemp ) >> uiShift;2759 iTemp = piOrg[29] - piCur[29]; uiSum += ( iTemp * iTemp ) >> uiShift;2760 iTemp = piOrg[30] - piCur[30]; uiSum += ( iTemp * iTemp ) >> uiShift;2761 iTemp = piOrg[31] - piCur[31]; uiSum += ( iTemp * iTemp ) >> uiShift;2762 2763 piOrg += iStrideOrg; 2764 piCur += iStrideCur; 2765 } 2766 2746 2747 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2748 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2749 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2750 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2751 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2752 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2753 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2754 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2755 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2756 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2757 iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2758 iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2759 iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2760 iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2761 iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2762 iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2763 iTemp = piOrg[16] - piCur[16]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2764 iTemp = piOrg[17] - piCur[17]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2765 iTemp = piOrg[18] - piCur[18]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2766 iTemp = piOrg[19] - piCur[19]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2767 iTemp = piOrg[20] - piCur[20]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2768 iTemp = piOrg[21] - piCur[21]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2769 iTemp = piOrg[22] - piCur[22]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2770 iTemp = piOrg[23] - piCur[23]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2771 iTemp = piOrg[24] - piCur[24]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2772 iTemp = piOrg[25] - piCur[25]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2773 iTemp = piOrg[26] - piCur[26]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2774 iTemp = piOrg[27] - piCur[27]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2775 iTemp = piOrg[28] - piCur[28]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2776 iTemp = piOrg[29] - piCur[29]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2777 iTemp = piOrg[30] - piCur[30]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2778 iTemp = piOrg[31] - piCur[31]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2779 2780 piOrg += iStrideOrg; 2781 piCur += iStrideCur; 2782 } 2783 2767 2784 return ( uiSum ); 2768 2785 } 2769 2786 2770 UIntTComRdCost::xGetSSE64( DistParam* pcDtParam )2787 Distortion TComRdCost::xGetSSE64( DistParam* pcDtParam ) 2771 2788 { 2772 2789 if ( pcDtParam->bApplyWeight ) 2773 2790 { 2774 2791 assert( pcDtParam->iCols == 64 ); 2775 return xGetSSEw( pcDtParam );2776 } 2777 Pel* piOrg = pcDtParam->pOrg;2778 Pel* piCur = pcDtParam->pCur;2792 return TComRdCostWeightPrediction::xGetSSEw( pcDtParam ); 2793 } 2794 const Pel* piOrg = pcDtParam->pOrg; 2795 const Pel* piCur = pcDtParam->pCur; 2779 2796 Int iRows = pcDtParam->iRows; 2780 2797 Int iStrideOrg = pcDtParam->iStrideOrg; 2781 2798 Int iStrideCur = pcDtParam->iStrideCur; 2782 2783 UInt uiSum = 0; 2784 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2785 Int iTemp; 2786 2799 2800 Distortion uiSum = 0; 2801 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 2802 2803 Intermediate_Int iTemp; 2804 2787 2805 for( ; iRows != 0; iRows-- ) 2788 2806 { 2789 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift;2790 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift;2791 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += ( iTemp * iTemp ) >> uiShift;2792 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += ( iTemp * iTemp ) >> uiShift;2793 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += ( iTemp * iTemp ) >> uiShift;2794 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += ( iTemp * iTemp ) >> uiShift;2795 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += ( iTemp * iTemp ) >> uiShift;2796 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += ( iTemp * iTemp ) >> uiShift;2797 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += ( iTemp * iTemp ) >> uiShift;2798 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += ( iTemp * iTemp ) >> uiShift;2799 iTemp = piOrg[10] - piCur[10]; uiSum += ( iTemp * iTemp ) >> uiShift;2800 iTemp = piOrg[11] - piCur[11]; uiSum += ( iTemp * iTemp ) >> uiShift;2801 iTemp = piOrg[12] - piCur[12]; uiSum += ( iTemp * iTemp ) >> uiShift;2802 iTemp = piOrg[13] - piCur[13]; uiSum += ( iTemp * iTemp ) >> uiShift;2803 iTemp = piOrg[14] - piCur[14]; uiSum += ( iTemp * iTemp ) >> uiShift;2804 iTemp = piOrg[15] - piCur[15]; uiSum += ( iTemp * iTemp ) >> uiShift;2805 iTemp = piOrg[16] - piCur[16]; uiSum += ( iTemp * iTemp ) >> uiShift;2806 iTemp = piOrg[17] - piCur[17]; uiSum += ( iTemp * iTemp ) >> uiShift;2807 iTemp = piOrg[18] - piCur[18]; uiSum += ( iTemp * iTemp ) >> uiShift;2808 iTemp = piOrg[19] - piCur[19]; uiSum += ( iTemp * iTemp ) >> uiShift;2809 iTemp = piOrg[20] - piCur[20]; uiSum += ( iTemp * iTemp ) >> uiShift;2810 iTemp = piOrg[21] - piCur[21]; uiSum += ( iTemp * iTemp ) >> uiShift;2811 iTemp = piOrg[22] - piCur[22]; uiSum += ( iTemp * iTemp ) >> uiShift;2812 iTemp = piOrg[23] - piCur[23]; uiSum += ( iTemp * iTemp ) >> uiShift;2813 iTemp = piOrg[24] - piCur[24]; uiSum += ( iTemp * iTemp ) >> uiShift;2814 iTemp = piOrg[25] - piCur[25]; uiSum += ( iTemp * iTemp ) >> uiShift;2815 iTemp = piOrg[26] - piCur[26]; uiSum += ( iTemp * iTemp ) >> uiShift;2816 iTemp = piOrg[27] - piCur[27]; uiSum += ( iTemp * iTemp ) >> uiShift;2817 iTemp = piOrg[28] - piCur[28]; uiSum += ( iTemp * iTemp ) >> uiShift;2818 iTemp = piOrg[29] - piCur[29]; uiSum += ( iTemp * iTemp ) >> uiShift;2819 iTemp = piOrg[30] - piCur[30]; uiSum += ( iTemp * iTemp ) >> uiShift;2820 iTemp = piOrg[31] - piCur[31]; uiSum += ( iTemp * iTemp ) >> uiShift;2821 iTemp = piOrg[32] - piCur[32]; uiSum += ( iTemp * iTemp ) >> uiShift;2822 iTemp = piOrg[33] - piCur[33]; uiSum += ( iTemp * iTemp ) >> uiShift;2823 iTemp = piOrg[34] - piCur[34]; uiSum += ( iTemp * iTemp ) >> uiShift;2824 iTemp = piOrg[35] - piCur[35]; uiSum += ( iTemp * iTemp ) >> uiShift;2825 iTemp = piOrg[36] - piCur[36]; uiSum += ( iTemp * iTemp ) >> uiShift;2826 iTemp = piOrg[37] - piCur[37]; uiSum += ( iTemp * iTemp ) >> uiShift;2827 iTemp = piOrg[38] - piCur[38]; uiSum += ( iTemp * iTemp ) >> uiShift;2828 iTemp = piOrg[39] - piCur[39]; uiSum += ( iTemp * iTemp ) >> uiShift;2829 iTemp = piOrg[40] - piCur[40]; uiSum += ( iTemp * iTemp ) >> uiShift;2830 iTemp = piOrg[41] - piCur[41]; uiSum += ( iTemp * iTemp ) >> uiShift;2831 iTemp = piOrg[42] - piCur[42]; uiSum += ( iTemp * iTemp ) >> uiShift;2832 iTemp = piOrg[43] - piCur[43]; uiSum += ( iTemp * iTemp ) >> uiShift;2833 iTemp = piOrg[44] - piCur[44]; uiSum += ( iTemp * iTemp ) >> uiShift;2834 iTemp = piOrg[45] - piCur[45]; uiSum += ( iTemp * iTemp ) >> uiShift;2835 iTemp = piOrg[46] - piCur[46]; uiSum += ( iTemp * iTemp ) >> uiShift;2836 iTemp = piOrg[47] - piCur[47]; uiSum += ( iTemp * iTemp ) >> uiShift;2837 iTemp = piOrg[48] - piCur[48]; uiSum += ( iTemp * iTemp ) >> uiShift;2838 iTemp = piOrg[49] - piCur[49]; uiSum += ( iTemp * iTemp ) >> uiShift;2839 iTemp = piOrg[50] - piCur[50]; uiSum += ( iTemp * iTemp ) >> uiShift;2840 iTemp = piOrg[51] - piCur[51]; uiSum += ( iTemp * iTemp ) >> uiShift;2841 iTemp = piOrg[52] - piCur[52]; uiSum += ( iTemp * iTemp ) >> uiShift;2842 iTemp = piOrg[53] - piCur[53]; uiSum += ( iTemp * iTemp ) >> uiShift;2843 iTemp = piOrg[54] - piCur[54]; uiSum += ( iTemp * iTemp ) >> uiShift;2844 iTemp = piOrg[55] - piCur[55]; uiSum += ( iTemp * iTemp ) >> uiShift;2845 iTemp = piOrg[56] - piCur[56]; uiSum += ( iTemp * iTemp ) >> uiShift;2846 iTemp = piOrg[57] - piCur[57]; uiSum += ( iTemp * iTemp ) >> uiShift;2847 iTemp = piOrg[58] - piCur[58]; uiSum += ( iTemp * iTemp ) >> uiShift;2848 iTemp = piOrg[59] - piCur[59]; uiSum += ( iTemp * iTemp ) >> uiShift;2849 iTemp = piOrg[60] - piCur[60]; uiSum += ( iTemp * iTemp ) >> uiShift;2850 iTemp = piOrg[61] - piCur[61]; uiSum += ( iTemp * iTemp ) >> uiShift;2851 iTemp = piOrg[62] - piCur[62]; uiSum += ( iTemp * iTemp ) >> uiShift;2852 iTemp = piOrg[63] - piCur[63]; uiSum += ( iTemp * iTemp ) >> uiShift;2853 2854 piOrg += iStrideOrg; 2855 piCur += iStrideCur; 2856 } 2857 2807 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2808 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2809 iTemp = piOrg[ 2] - piCur[ 2]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2810 iTemp = piOrg[ 3] - piCur[ 3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2811 iTemp = piOrg[ 4] - piCur[ 4]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2812 iTemp = piOrg[ 5] - piCur[ 5]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2813 iTemp = piOrg[ 6] - piCur[ 6]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2814 iTemp = piOrg[ 7] - piCur[ 7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2815 iTemp = piOrg[ 8] - piCur[ 8]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2816 iTemp = piOrg[ 9] - piCur[ 9]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2817 iTemp = piOrg[10] - piCur[10]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2818 iTemp = piOrg[11] - piCur[11]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2819 iTemp = piOrg[12] - piCur[12]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2820 iTemp = piOrg[13] - piCur[13]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2821 iTemp = piOrg[14] - piCur[14]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2822 iTemp = piOrg[15] - piCur[15]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2823 iTemp = piOrg[16] - piCur[16]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2824 iTemp = piOrg[17] - piCur[17]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2825 iTemp = piOrg[18] - piCur[18]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2826 iTemp = piOrg[19] - piCur[19]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2827 iTemp = piOrg[20] - piCur[20]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2828 iTemp = piOrg[21] - piCur[21]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2829 iTemp = piOrg[22] - piCur[22]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2830 iTemp = piOrg[23] - piCur[23]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2831 iTemp = piOrg[24] - piCur[24]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2832 iTemp = piOrg[25] - piCur[25]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2833 iTemp = piOrg[26] - piCur[26]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2834 iTemp = piOrg[27] - piCur[27]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2835 iTemp = piOrg[28] - piCur[28]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2836 iTemp = piOrg[29] - piCur[29]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2837 iTemp = piOrg[30] - piCur[30]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2838 iTemp = piOrg[31] - piCur[31]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2839 iTemp = piOrg[32] - piCur[32]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2840 iTemp = piOrg[33] - piCur[33]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2841 iTemp = piOrg[34] - piCur[34]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2842 iTemp = piOrg[35] - piCur[35]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2843 iTemp = piOrg[36] - piCur[36]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2844 iTemp = piOrg[37] - piCur[37]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2845 iTemp = piOrg[38] - piCur[38]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2846 iTemp = piOrg[39] - piCur[39]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2847 iTemp = piOrg[40] - piCur[40]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2848 iTemp = piOrg[41] - piCur[41]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2849 iTemp = piOrg[42] - piCur[42]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2850 iTemp = piOrg[43] - piCur[43]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2851 iTemp = piOrg[44] - piCur[44]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2852 iTemp = piOrg[45] - piCur[45]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2853 iTemp = piOrg[46] - piCur[46]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2854 iTemp = piOrg[47] - piCur[47]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2855 iTemp = piOrg[48] - piCur[48]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2856 iTemp = piOrg[49] - piCur[49]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2857 iTemp = piOrg[50] - piCur[50]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2858 iTemp = piOrg[51] - piCur[51]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2859 iTemp = piOrg[52] - piCur[52]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2860 iTemp = piOrg[53] - piCur[53]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2861 iTemp = piOrg[54] - piCur[54]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2862 iTemp = piOrg[55] - piCur[55]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2863 iTemp = piOrg[56] - piCur[56]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2864 iTemp = piOrg[57] - piCur[57]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2865 iTemp = piOrg[58] - piCur[58]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2866 iTemp = piOrg[59] - piCur[59]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2867 iTemp = piOrg[60] - piCur[60]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2868 iTemp = piOrg[61] - piCur[61]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2869 iTemp = piOrg[62] - piCur[62]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2870 iTemp = piOrg[63] - piCur[63]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift); 2871 2872 piOrg += iStrideOrg; 2873 piCur += iStrideCur; 2874 } 2875 2858 2876 return ( uiSum ); 2859 2877 } 2860 #if H_3D_VSO 2878 2879 #if NH_3D_VSO 2861 2880 //SAIT_VSO_EST_A0033 2862 2881 UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ) 2863 { 2864 Double dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 2865 2866 Double dDepthWeight = ( pOrg[x] >= ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 ); 2882 { 2883 // change to use bit depth from DistParam struct 2884 Double dD = ( (Double) ( dDM >> ( ENC_INTERNAL_BIT_DEPTH - 8 ) ) ) * m_dDisparityCoeff; 2885 2886 Double dDepthWeight = ( pOrg[x] >= ( (1<<(REN_BIT_DEPTH - 3)) + (1<<(REN_BIT_DEPTH - 2)) ) ? 4 : pOrg[x] > ((1<<REN_BIT_DEPTH) >> 4) ? (Float)(pOrg[x] - ((1<<REN_BIT_DEPTH) >> 4))/(Float)((1<<REN_BIT_DEPTH) >> 3) + 1 : 1.0 ); 2887 2867 2888 Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) ); 2868 2889 Int iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5)); … … 3092 3113 // -------------------------------------------------------------------------------------------------------------------- 3093 3114 3094 UInt TComRdCost::xCalcHADs2x2( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3095 { 3096 Int satd = 0, diff[4], m[4]; 3115 Distortion TComRdCost::xCalcHADs2x2( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3116 { 3117 Distortion satd = 0; 3118 TCoeff diff[4], m[4]; 3097 3119 assert( iStep == 1 ); 3098 3120 diff[0] = piOrg[0 ] - piCur[0]; … … 3104 3126 m[2] = diff[0] - diff[2]; 3105 3127 m[3] = diff[1] - diff[3]; 3106 3128 3107 3129 satd += abs(m[0] + m[1]); 3108 3130 satd += abs(m[0] - m[1]); 3109 3131 satd += abs(m[2] + m[3]); 3110 3132 satd += abs(m[2] - m[3]); 3111 3133 3112 3134 return satd; 3113 3135 } 3114 3136 3115 UInt TComRdCost::xCalcHADs4x4( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3116 { 3117 Int k, satd = 0, diff[16], m[16], d[16]; 3118 3137 Distortion TComRdCost::xCalcHADs4x4( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3138 { 3139 Int k; 3140 Distortion satd = 0; 3141 TCoeff diff[16], m[16], d[16]; 3142 3119 3143 assert( iStep == 1 ); 3120 3144 for( k = 0; k < 16; k+=4 ) … … 3124 3148 diff[k+2] = piOrg[2] - piCur[2]; 3125 3149 diff[k+3] = piOrg[3] - piCur[3]; 3126 3127 piCur += iStrideCur; 3128 piOrg += iStrideOrg; 3129 } 3130 3150 3151 piCur += iStrideCur; 3152 piOrg += iStrideOrg; 3153 } 3154 3131 3155 /*===== hadamard transform =====*/ 3132 3156 m[ 0] = diff[ 0] + diff[12]; … … 3146 3170 m[14] = diff[ 2] - diff[14]; 3147 3171 m[15] = diff[ 3] - diff[15]; 3148 3172 3149 3173 d[ 0] = m[ 0] + m[ 4]; 3150 3174 d[ 1] = m[ 1] + m[ 5]; … … 3163 3187 d[14] = m[14] - m[10]; 3164 3188 d[15] = m[15] - m[11]; 3165 3189 3166 3190 m[ 0] = d[ 0] + d[ 3]; 3167 3191 m[ 1] = d[ 1] + d[ 2]; … … 3180 3204 m[14] = d[13] - d[14]; 3181 3205 m[15] = d[12] - d[15]; 3182 3206 3183 3207 d[ 0] = m[ 0] + m[ 1]; 3184 3208 d[ 1] = m[ 0] - m[ 1]; … … 3197 3221 d[14] = m[14] + m[15]; 3198 3222 d[15] = m[15] - m[14]; 3199 3223 3200 3224 for (k=0; k<16; ++k) 3201 3225 { … … 3203 3227 } 3204 3228 satd = ((satd+1)>>1); 3205 3229 3206 3230 return satd; 3207 3231 } 3208 3232 3209 UInt TComRdCost::xCalcHADs8x8( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3210 { 3211 Int k, i, j, jj, sad=0; 3212 Int diff[64], m1[8][8], m2[8][8], m3[8][8]; 3233 Distortion TComRdCost::xCalcHADs8x8( Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep ) 3234 { 3235 Int k, i, j, jj; 3236 Distortion sad = 0; 3237 TCoeff diff[64], m1[8][8], m2[8][8], m3[8][8]; 3213 3238 assert( iStep == 1 ); 3214 3239 for( k = 0; k < 64; k += 8 ) … … 3222 3247 diff[k+6] = piOrg[6] - piCur[6]; 3223 3248 diff[k+7] = piOrg[7] - piCur[7]; 3224 3225 piCur += iStrideCur; 3226 piOrg += iStrideOrg; 3227 } 3228 3249 3250 piCur += iStrideCur; 3251 piOrg += iStrideOrg; 3252 } 3253 3229 3254 //horizontal 3230 3255 for (j=0; j < 8; j++) … … 3239 3264 m2[j][6] = diff[jj+2] - diff[jj+6]; 3240 3265 m2[j][7] = diff[jj+3] - diff[jj+7]; 3241 3266 3242 3267 m1[j][0] = m2[j][0] + m2[j][2]; 3243 3268 m1[j][1] = m2[j][1] + m2[j][3]; … … 3248 3273 m1[j][6] = m2[j][4] - m2[j][6]; 3249 3274 m1[j][7] = m2[j][5] - m2[j][7]; 3250 3275 3251 3276 m2[j][0] = m1[j][0] + m1[j][1]; 3252 3277 m2[j][1] = m1[j][0] - m1[j][1]; … … 3258 3283 m2[j][7] = m1[j][6] - m1[j][7]; 3259 3284 } 3260 3285 3261 3286 //vertical 3262 3287 for (i=0; i < 8; i++) … … 3270 3295 m3[6][i] = m2[2][i] - m2[6][i]; 3271 3296 m3[7][i] = m2[3][i] - m2[7][i]; 3272 3297 3273 3298 m1[0][i] = m3[0][i] + m3[2][i]; 3274 3299 m1[1][i] = m3[1][i] + m3[3][i]; … … 3279 3304 m1[6][i] = m3[4][i] - m3[6][i]; 3280 3305 m1[7][i] = m3[5][i] - m3[7][i]; 3281 3306 3282 3307 m2[0][i] = m1[0][i] + m1[1][i]; 3283 3308 m2[1][i] = m1[0][i] - m1[1][i]; … … 3289 3314 m2[7][i] = m1[6][i] - m1[7][i]; 3290 3315 } 3291 3316 3292 3317 for (i = 0; i < 8; i++) 3293 3318 { … … 3297 3322 } 3298 3323 } 3299 3324 3300 3325 sad=((sad+2)>>2); 3301 3326 3302 3327 return sad; 3303 3328 } 3304 3329 3305 UInt TComRdCost::xGetHADs4( DistParam* pcDtParam ) 3330 3331 Distortion TComRdCost::xGetHADs( DistParam* pcDtParam ) 3306 3332 { 3307 3333 if ( pcDtParam->bApplyWeight ) 3308 3334 { 3309 return xGetHADs4w( pcDtParam ); 3310 } 3311 Pel* piOrg = pcDtParam->pOrg; 3312 Pel* piCur = pcDtParam->pCur; 3313 Int iRows = pcDtParam->iRows; 3314 Int iStrideCur = pcDtParam->iStrideCur; 3315 Int iStrideOrg = pcDtParam->iStrideOrg; 3316 Int iStep = pcDtParam->iStep; 3317 Int y; 3318 Int iOffsetOrg = iStrideOrg<<2; 3319 Int iOffsetCur = iStrideCur<<2; 3320 3321 UInt uiSum = 0; 3322 3323 for ( y=0; y<iRows; y+= 4 ) 3324 { 3325 uiSum += xCalcHADs4x4( piOrg, piCur, iStrideOrg, iStrideCur, iStep ); 3326 piOrg += iOffsetOrg; 3327 piCur += iOffsetCur; 3328 } 3329 3330 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 3331 } 3332 3333 UInt TComRdCost::xGetHADs8( DistParam* pcDtParam ) 3334 { 3335 if ( pcDtParam->bApplyWeight ) 3336 { 3337 return xGetHADs8w( pcDtParam ); 3338 } 3339 Pel* piOrg = pcDtParam->pOrg; 3340 Pel* piCur = pcDtParam->pCur; 3341 Int iRows = pcDtParam->iRows; 3342 Int iStrideCur = pcDtParam->iStrideCur; 3343 Int iStrideOrg = pcDtParam->iStrideOrg; 3344 Int iStep = pcDtParam->iStep; 3345 Int y; 3346 3347 UInt uiSum = 0; 3348 3349 if ( iRows == 4 ) 3350 { 3351 uiSum += xCalcHADs4x4( piOrg+0, piCur , iStrideOrg, iStrideCur, iStep ); 3352 uiSum += xCalcHADs4x4( piOrg+4, piCur+4*iStep, iStrideOrg, iStrideCur, iStep ); 3353 } 3354 else 3355 { 3356 Int iOffsetOrg = iStrideOrg<<3; 3357 Int iOffsetCur = iStrideCur<<3; 3358 for ( y=0; y<iRows; y+= 8 ) 3359 { 3360 uiSum += xCalcHADs8x8( piOrg, piCur, iStrideOrg, iStrideCur, iStep ); 3361 piOrg += iOffsetOrg; 3362 piCur += iOffsetCur; 3363 } 3364 } 3365 3366 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 3367 } 3368 3369 UInt TComRdCost::xGetHADs( DistParam* pcDtParam ) 3370 { 3371 if ( pcDtParam->bApplyWeight ) 3372 { 3373 return xGetHADsw( pcDtParam ); 3374 } 3375 #if H_3D_IC 3335 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3336 } 3337 #if NH_3D_IC 3376 3338 if( pcDtParam->bUseIC ) 3377 3339 { … … 3379 3341 } 3380 3342 #endif 3381 #if H_3D_INTER_SDC3343 #if NH_3D_SDC_INTER 3382 3344 if( pcDtParam->bUseSDCMRSAD ) 3383 3345 { … … 3385 3347 } 3386 3348 #endif 3349 3387 3350 Pel* piOrg = pcDtParam->pOrg; 3388 3351 Pel* piCur = pcDtParam->pCur; … … 3392 3355 Int iStrideOrg = pcDtParam->iStrideOrg; 3393 3356 Int iStep = pcDtParam->iStep; 3394 3357 3395 3358 Int x, y; 3396 3397 UIntuiSum = 0;3398 3359 3360 Distortion uiSum = 0; 3361 3399 3362 if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) 3400 3363 { … … 3415 3378 Int iOffsetOrg = iStrideOrg<<2; 3416 3379 Int iOffsetCur = iStrideCur<<2; 3417 3380 3418 3381 for ( y=0; y<iRows; y+= 4 ) 3419 3382 { … … 3444 3407 assert(false); 3445 3408 } 3446 3447 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);3448 } 3449 3450 #if H_3D_IC || H_3D_INTER_SDC3409 3410 return ( uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8) ); 3411 } 3412 3413 #if NH_3D_IC || NH_3D_SDC_INTER 3451 3414 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3452 3415 { 3453 3416 if ( pcDtParam->bApplyWeight ) 3454 3417 { 3455 return xGetHADsw( pcDtParam );3418 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3456 3419 } 3457 3420 Pel* piOrg = pcDtParam->pOrg; … … 3593 3556 } 3594 3557 #endif 3595 3596 #if H_3D_VSO 3558 #if NH_3D_VSO 3597 3559 Void TComRdCost::setLambdaVSO( Double dLambdaVSO ) 3598 3560 { … … 3602 3564 m_uiLambdaMotionSSEVSO = (UInt)floor(65536.0 * m_dLambdaVSO ); 3603 3565 } 3604 3566 #endif 3567 #if NH_3D_VSO 3605 3568 Dist TComRdCost::xGetDistVSOMode4( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD ) 3606 3569 { … … 3621 3584 3622 3585 3623 Dist TComRdCost::getDistPartVSO( TComDataCU* pcCU, UInt uiAbsPartIndex, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bHAD )3586 Dist TComRdCost::getDistPartVSO( TComDataCU* pcCU, UInt uiAbsPartIndex, Int bitDepth, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bHAD ) 3624 3587 { 3625 3588 assert( m_bUseVSO ); … … 3635 3598 if ( m_bUseWVSO ) 3636 3599 { 3637 Int iDWeight = m_iDWeight * m_iDWeight ;3600 Int iDWeight = m_iDWeight * m_iDWeight ; 3638 3601 Int iVSOWeight = m_iVSOWeight * m_iVSOWeight; 3639 3602 Dist distDepth; … … 3641 3604 if ( !bHAD ) 3642 3605 { 3643 distDepth = (Dist) getDistPart( g_bitDepthY, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight);3606 distDepth = (Dist) getDistPart( bitDepth, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight, COMPONENT_Y); 3644 3607 } 3645 3608 else 3646 3609 { 3647 distDepth = (Dist) calcHAD ( g_bitDepthY, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight);3610 distDepth = (Dist) calcHAD ( bitDepth, piCur, iCurStride, piOrg, iOrgStride, uiBlkWidth, uiBlkHeight); 3648 3611 } 3649 3612 … … 3722 3685 } 3723 3686 3687 D_PRINT_INDENT( g_traceRDCost, "VSO Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 3688 3724 3689 return dRdCost; 3725 3690 } 3726 3691 3727 Void TComRdCost::setRenModelData( TComDataCU* pcCU, UInt uiAbsPartIndex, Pel* piData, Int iStride, Int iBlkWidth, Int iBlkHeight ) 3692 Void TComRdCost::setRenModelData( const TComDataCU* pcCU, UInt uiAbsPartIndex, const TComYuv* pcYuv, const TComTURecurse* tuRecurseWithPU ) 3693 { 3694 const TComRectangle &puRect=tuRecurseWithPU->getRect(COMPONENT_Y); 3695 const UInt uiCompWidth = puRect.width; 3696 const UInt uiCompHeight = puRect.height; 3697 3698 const Pel* piSrc = pcYuv->getAddr( COMPONENT_Y, uiAbsPartIndex ); 3699 const UInt uiSrcStride = pcYuv->getStride( COMPONENT_Y); 3700 setRenModelData( pcCU, uiAbsPartIndex, piSrc, uiSrcStride, uiCompWidth, uiCompHeight ); 3701 } 3702 3703 Void TComRdCost::setRenModelData( const TComDataCU* pcCU, UInt uiAbsPartIndex, const Pel* piData, Int iStride, Int iBlkWidth, Int iBlkHeight ) 3728 3704 { 3729 3705 UInt iBlkX = g_auiRasterToPelX[g_auiZscanToRaster[uiAbsPartIndex]];
Note: See TracChangeset for help on using the changeset viewer.