[x265] [PATCH] Cleaup the remaing functions in TComRdCost.cpp file
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Mon Jul 15 11:00:04 CEST 2013
# HG changeset patch
# User praveentiwari
# Date 1373872873 -19800
# Node ID 08ff2ba4cfecd65a80fdd32b86b0ea60f4e777cd
# Parent 9e689682ffb144709c5351ca3b2828c507b19b26
Cleaup the remaing functions in TComRdCost.cpp file
diff -r 9e689682ffb1 -r 08ff2ba4cfec source/Lib/TLibCommon/TComRdCost.cpp
--- a/source/Lib/TLibCommon/TComRdCost.cpp Fri Jul 12 23:22:40 2013 -0500
+++ b/source/Lib/TLibCommon/TComRdCost.cpp Mon Jul 15 12:51:13 2013 +0530
@@ -1199,209 +1199,209 @@
}
template<typename T1, typename T2>
-UInt xGetSSE64Help(T1* piOrg, Int iStrideOrg, T2* piCur, Int iStrideCur, Int iRows, UInt uiShift)
+UInt xGetSSE64Help(T1* org, Int strideOrg, T2* cur, Int strideCur, Int rows, UInt shift)
{
- UInt uiSum = 0;
- Int iTemp;
+ UInt sum = 0;
+ Int temp;
- for (; iRows != 0; iRows--)
+ for (; rows != 0; rows--)
{
- iTemp = piOrg[0] - piCur[0];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[1] - piCur[1];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[2] - piCur[2];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[3] - piCur[3];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[4] - piCur[4];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[5] - piCur[5];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[6] - piCur[6];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[7] - piCur[7];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[8] - piCur[8];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[9] - piCur[9];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[10] - piCur[10];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[11] - piCur[11];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[12] - piCur[12];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[13] - piCur[13];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[14] - piCur[14];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[15] - piCur[15];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[16] - piCur[16];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[17] - piCur[17];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[18] - piCur[18];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[19] - piCur[19];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[20] - piCur[20];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[21] - piCur[21];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[22] - piCur[22];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[23] - piCur[23];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[24] - piCur[24];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[25] - piCur[25];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[26] - piCur[26];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[27] - piCur[27];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[28] - piCur[28];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[29] - piCur[29];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[30] - piCur[30];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[31] - piCur[31];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[32] - piCur[32];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[33] - piCur[33];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[34] - piCur[34];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[35] - piCur[35];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[36] - piCur[36];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[37] - piCur[37];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[38] - piCur[38];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[39] - piCur[39];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[40] - piCur[40];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[41] - piCur[41];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[42] - piCur[42];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[43] - piCur[43];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[44] - piCur[44];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[45] - piCur[45];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[46] - piCur[46];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[47] - piCur[47];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[48] - piCur[48];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[49] - piCur[49];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[50] - piCur[50];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[51] - piCur[51];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[52] - piCur[52];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[53] - piCur[53];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[54] - piCur[54];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[55] - piCur[55];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[56] - piCur[56];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[57] - piCur[57];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[58] - piCur[58];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[59] - piCur[59];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[60] - piCur[60];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[61] - piCur[61];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[62] - piCur[62];
- uiSum += (iTemp * iTemp) >> uiShift;
- iTemp = piOrg[63] - piCur[63];
- uiSum += (iTemp * iTemp) >> uiShift;
+ temp = org[0] - cur[0];
+ sum += (temp * temp) >> shift;
+ temp = org[1] - cur[1];
+ sum += (temp * temp) >> shift;
+ temp = org[2] - cur[2];
+ sum += (temp * temp) >> shift;
+ temp = org[3] - cur[3];
+ sum += (temp * temp) >> shift;
+ temp = org[4] - cur[4];
+ sum += (temp * temp) >> shift;
+ temp = org[5] - cur[5];
+ sum += (temp * temp) >> shift;
+ temp = org[6] - cur[6];
+ sum += (temp * temp) >> shift;
+ temp = org[7] - cur[7];
+ sum += (temp * temp) >> shift;
+ temp = org[8] - cur[8];
+ sum += (temp * temp) >> shift;
+ temp = org[9] - cur[9];
+ sum += (temp * temp) >> shift;
+ temp = org[10] - cur[10];
+ sum += (temp * temp) >> shift;
+ temp = org[11] - cur[11];
+ sum += (temp * temp) >> shift;
+ temp = org[12] - cur[12];
+ sum += (temp * temp) >> shift;
+ temp = org[13] - cur[13];
+ sum += (temp * temp) >> shift;
+ temp = org[14] - cur[14];
+ sum += (temp * temp) >> shift;
+ temp = org[15] - cur[15];
+ sum += (temp * temp) >> shift;
+ temp = org[16] - cur[16];
+ sum += (temp * temp) >> shift;
+ temp = org[17] - cur[17];
+ sum += (temp * temp) >> shift;
+ temp = org[18] - cur[18];
+ sum += (temp * temp) >> shift;
+ temp = org[19] - cur[19];
+ sum += (temp * temp) >> shift;
+ temp = org[20] - cur[20];
+ sum += (temp * temp) >> shift;
+ temp = org[21] - cur[21];
+ sum += (temp * temp) >> shift;
+ temp = org[22] - cur[22];
+ sum += (temp * temp) >> shift;
+ temp = org[23] - cur[23];
+ sum += (temp * temp) >> shift;
+ temp = org[24] - cur[24];
+ sum += (temp * temp) >> shift;
+ temp = org[25] - cur[25];
+ sum += (temp * temp) >> shift;
+ temp = org[26] - cur[26];
+ sum += (temp * temp) >> shift;
+ temp = org[27] - cur[27];
+ sum += (temp * temp) >> shift;
+ temp = org[28] - cur[28];
+ sum += (temp * temp) >> shift;
+ temp = org[29] - cur[29];
+ sum += (temp * temp) >> shift;
+ temp = org[30] - cur[30];
+ sum += (temp * temp) >> shift;
+ temp = org[31] - cur[31];
+ sum += (temp * temp) >> shift;
+ temp = org[32] - cur[32];
+ sum += (temp * temp) >> shift;
+ temp = org[33] - cur[33];
+ sum += (temp * temp) >> shift;
+ temp = org[34] - cur[34];
+ sum += (temp * temp) >> shift;
+ temp = org[35] - cur[35];
+ sum += (temp * temp) >> shift;
+ temp = org[36] - cur[36];
+ sum += (temp * temp) >> shift;
+ temp = org[37] - cur[37];
+ sum += (temp * temp) >> shift;
+ temp = org[38] - cur[38];
+ sum += (temp * temp) >> shift;
+ temp = org[39] - cur[39];
+ sum += (temp * temp) >> shift;
+ temp = org[40] - cur[40];
+ sum += (temp * temp) >> shift;
+ temp = org[41] - cur[41];
+ sum += (temp * temp) >> shift;
+ temp = org[42] - cur[42];
+ sum += (temp * temp) >> shift;
+ temp = org[43] - cur[43];
+ sum += (temp * temp) >> shift;
+ temp = org[44] - cur[44];
+ sum += (temp * temp) >> shift;
+ temp = org[45] - cur[45];
+ sum += (temp * temp) >> shift;
+ temp = org[46] - cur[46];
+ sum += (temp * temp) >> shift;
+ temp = org[47] - cur[47];
+ sum += (temp * temp) >> shift;
+ temp = org[48] - cur[48];
+ sum += (temp * temp) >> shift;
+ temp = org[49] - cur[49];
+ sum += (temp * temp) >> shift;
+ temp = org[50] - cur[50];
+ sum += (temp * temp) >> shift;
+ temp = org[51] - cur[51];
+ sum += (temp * temp) >> shift;
+ temp = org[52] - cur[52];
+ sum += (temp * temp) >> shift;
+ temp = org[53] - cur[53];
+ sum += (temp * temp) >> shift;
+ temp = org[54] - cur[54];
+ sum += (temp * temp) >> shift;
+ temp = org[55] - cur[55];
+ sum += (temp * temp) >> shift;
+ temp = org[56] - cur[56];
+ sum += (temp * temp) >> shift;
+ temp = org[57] - cur[57];
+ sum += (temp * temp) >> shift;
+ temp = org[58] - cur[58];
+ sum += (temp * temp) >> shift;
+ temp = org[59] - cur[59];
+ sum += (temp * temp) >> shift;
+ temp = org[60] - cur[60];
+ sum += (temp * temp) >> shift;
+ temp = org[61] - cur[61];
+ sum += (temp * temp) >> shift;
+ temp = org[62] - cur[62];
+ sum += (temp * temp) >> shift;
+ temp = org[63] - cur[63];
+ sum += (temp * temp) >> shift;
- piOrg += iStrideOrg;
- piCur += iStrideCur;
+ org += strideOrg;
+ cur += strideCur;
}
- return uiSum;
+ return sum;
}
-UInt TComRdCost::xGetSSE64(DistParam* pcDtParam)
+UInt TComRdCost::xGetSSE64(DistParam* distParam)
{
- if (pcDtParam->applyWeight)
+ if (distParam->applyWeight)
{
- assert(pcDtParam->cols == 64);
- return xGetSSEw(pcDtParam);
+ assert(distParam->cols == 64);
+ return xGetSSEw(distParam);
}
- Pel* piOrg = pcDtParam->fenc;
- Pel* piCur = pcDtParam->fref;
- Int iRows = pcDtParam->rows;
- Int iStrideOrg = pcDtParam->fencstride;
- Int iStrideCur = pcDtParam->frefstride;
+ Pel* org = distParam->fenc;
+ Pel* cur = distParam->fref;
+ Int rows = distParam->rows;
+ Int strideOrg = distParam->fencstride;
+ Int strideCur = distParam->frefstride;
- UInt uiSum = 0;
- UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth - 8) << 1);
+ UInt sum = 0;
+ UInt shift = DISTORTION_PRECISION_ADJUSTMENT((distParam->bitDepth - 8) << 1);
- if ((sizeof(Pel) == 2) || ((piOrg != NULL) && (piCur != NULL)))
+ if ((sizeof(Pel) == 2) || ((org != NULL) && (cur != NULL)))
{
- uiSum = xGetSSE64Help<Pel, Pel>(piOrg, iStrideOrg, piCur, iStrideCur, iRows, uiShift);
+ sum = xGetSSE64Help<Pel, Pel>(org, strideOrg, cur, strideCur, rows, shift);
}
else
{
- Short* piOrg_s;
- Short* piCur_s;
- DistParamSSE* DtParam = reinterpret_cast<DistParamSSE*>(pcDtParam);
- piOrg_s = DtParam->ptr1;
- piCur_s = DtParam->ptr2;
+ Short* org_s;
+ Short* cur_s;
+ DistParamSSE* DtParam = reinterpret_cast<DistParamSSE*>(distParam);
+ org_s = DtParam->ptr1;
+ cur_s = DtParam->ptr2;
- if ((piOrg == NULL) && (piCur == NULL))
+ if ((org == NULL) && (cur == NULL))
{
- uiSum = xGetSSE64Help<Short, Short>(piOrg_s, iStrideOrg, piCur_s, iStrideCur, iRows, uiShift);
+ sum = xGetSSE64Help<Short, Short>(org_s, strideOrg, cur_s, strideCur, rows, shift);
}
else
{
- uiSum = xGetSSE64Help<Short, Pel>(piOrg_s, iStrideOrg, piCur, iStrideCur, iRows, uiShift);
+ sum = xGetSSE64Help<Short, Pel>(org_s, strideOrg, cur, strideCur, rows, shift);
}
}
- return uiSum;
+ return sum;
}
// --------------------------------------------------------------------------------------------------------------------
// HADAMARD with step (used in fractional search)
// --------------------------------------------------------------------------------------------------------------------
-UInt TComRdCost::xCalcHADs4x4(Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep)
+UInt TComRdCost::xCalcHADs4x4(Pel *org, Pel *cur, Int strideOrg, Int strideCur, Int step)
{
- assert(iStep == 1);
+ assert(step == 1);
Int k, satd = 0, diff[16], m[16], d[16];
for (k = 0; k < 16; k += 4)
{
- diff[k + 0] = piOrg[0] - piCur[0];
- diff[k + 1] = piOrg[1] - piCur[1];
- diff[k + 2] = piOrg[2] - piCur[2];
- diff[k + 3] = piOrg[3] - piCur[3];
+ diff[k + 0] = org[0] - cur[0];
+ diff[k + 1] = org[1] - cur[1];
+ diff[k + 2] = org[2] - cur[2];
+ diff[k + 3] = org[3] - cur[3];
- piCur += iStrideCur;
- piOrg += iStrideOrg;
+ cur += strideCur;
+ org += strideOrg;
}
/*===== hadamard transform =====*/
@@ -1449,8 +1449,8 @@
m[7] = d[4] - d[7];
m[8] = d[8] + d[11];
m[9] = d[9] + d[10];
- m[10] = d[9] - d[10];
- m[11] = d[8] - d[11];
+ m[10] = d[9] - d[10];
+ m[11] = d[8] - d[11];
m[12] = d[12] + d[15];
m[13] = d[13] + d[14];
m[14] = d[13] - d[14];
@@ -1483,24 +1483,24 @@
return satd;
}
-UInt TComRdCost::xCalcHADs8x8(Pel *piOrg, Pel *piCur, Int iStrideOrg, Int iStrideCur, Int iStep)
+UInt TComRdCost::xCalcHADs8x8(Pel *org, Pel *cur, Int strideOrg, Int strideCur, Int step)
{
- assert(iStep == 1);
+ assert(step == 1);
Int k, i, j, jj, sad = 0;
Int diff[64], m1[8][8], m2[8][8], m3[8][8];
for (k = 0; k < 64; k += 8)
{
- diff[k + 0] = piOrg[0] - piCur[0];
- diff[k + 1] = piOrg[1] - piCur[1];
- diff[k + 2] = piOrg[2] - piCur[2];
- diff[k + 3] = piOrg[3] - piCur[3];
- diff[k + 4] = piOrg[4] - piCur[4];
- diff[k + 5] = piOrg[5] - piCur[5];
- diff[k + 6] = piOrg[6] - piCur[6];
- diff[k + 7] = piOrg[7] - piCur[7];
+ diff[k + 0] = org[0] - cur[0];
+ diff[k + 1] = org[1] - cur[1];
+ diff[k + 2] = org[2] - cur[2];
+ diff[k + 3] = org[3] - cur[3];
+ diff[k + 4] = org[4] - cur[4];
+ diff[k + 5] = org[5] - cur[5];
+ diff[k + 6] = org[6] - cur[6];
+ diff[k + 7] = org[7] - cur[7];
- piCur += iStrideCur;
- piOrg += iStrideOrg;
+ cur += strideCur;
+ org += strideOrg;
}
//horizontal
@@ -1579,114 +1579,114 @@
return sad;
}
-UInt TComRdCost::xGetHADs4(DistParam* pcDtParam)
+UInt TComRdCost::xGetHADs4(DistParam* distParam)
{
- if (pcDtParam->applyWeight)
+ if (distParam->applyWeight)
{
- return xGetHADs4w(pcDtParam);
+ return xGetHADs4w(distParam);
}
- Pel* piOrg = pcDtParam->fenc;
- Pel* piCur = pcDtParam->fref;
- Int iRows = pcDtParam->rows;
- Int iStrideCur = pcDtParam->frefstride;
- Int iStrideOrg = pcDtParam->fencstride;
- Int iStep = pcDtParam->step;
- UInt uiSum = 0;
+ Pel* org = distParam->fenc;
+ Pel* cur = distParam->fref;
+ Int rows = distParam->rows;
+ Int strideCur = distParam->frefstride;
+ Int strideOrg = distParam->fencstride;
+ Int step = distParam->step;
+ UInt sum = 0;
- Int iOffsetOrg = iStrideOrg << 2;
- Int iOffsetCur = iStrideCur << 2;
- for (Int y = 0; y < iRows; y += 4)
+ Int offsetOrg = strideOrg << 2;
+ Int offsetCur = strideCur << 2;
+ for (Int y = 0; y < rows; y += 4)
{
- uiSum += xCalcHADs4x4(piOrg, piCur, iStrideOrg, iStrideCur, iStep);
- piOrg += iOffsetOrg;
- piCur += iOffsetCur;
+ sum += xCalcHADs4x4(org, cur, strideOrg, strideCur, step);
+ org += offsetOrg;
+ cur += offsetCur;
}
- return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth - 8);
+ return sum >> DISTORTION_PRECISION_ADJUSTMENT(distParam->bitDepth - 8);
}
-UInt TComRdCost::xGetHADs8(DistParam* pcDtParam)
+UInt TComRdCost::xGetHADs8(DistParam* distParam)
{
- if (pcDtParam->applyWeight)
+ if (distParam->applyWeight)
{
- return xGetHADs8w(pcDtParam);
+ return xGetHADs8w(distParam);
}
- Pel* piOrg = pcDtParam->fenc;
- Pel* piCur = pcDtParam->fref;
- Int iRows = pcDtParam->rows;
- Int iStrideCur = pcDtParam->frefstride;
- Int iStrideOrg = pcDtParam->fencstride;
- Int iStep = pcDtParam->step;
+ Pel* org = distParam->fenc;
+ Pel* cur = distParam->fref;
+ Int rows = distParam->rows;
+ Int strideCur = distParam->frefstride;
+ Int strideOrg = distParam->fencstride;
+ Int step = distParam->step;
Int y;
UInt uiSum = 0;
- if (iRows == 4)
+ if (rows == 4)
{
- uiSum += xCalcHADs4x4(piOrg + 0, piCur, iStrideOrg, iStrideCur, iStep);
- uiSum += xCalcHADs4x4(piOrg + 4, piCur + 4 * iStep, iStrideOrg, iStrideCur, iStep);
+ uiSum += xCalcHADs4x4(org + 0, cur, strideOrg, strideCur, step);
+ uiSum += xCalcHADs4x4(org + 4, cur + 4 * step, strideOrg, strideCur, step);
}
else
{
- Int iOffsetOrg = iStrideOrg << 3;
- Int iOffsetCur = iStrideCur << 3;
- for (y = 0; y < iRows; y += 8)
+ Int iOffsetOrg = strideOrg << 3;
+ Int iOffsetCur = strideCur << 3;
+ for (y = 0; y < rows; y += 8)
{
- uiSum += xCalcHADs8x8(piOrg, piCur, iStrideOrg, iStrideCur, iStep);
- piOrg += iOffsetOrg;
- piCur += iOffsetCur;
+ uiSum += xCalcHADs8x8(org, cur, strideOrg, strideCur, step);
+ org += iOffsetOrg;
+ cur += iOffsetCur;
}
}
- return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth - 8);
+ return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(distParam->bitDepth - 8);
}
-UInt TComRdCost::xGetHADs(DistParam* pcDtParam)
+UInt TComRdCost::xGetHADs(DistParam* distParam)
{
- if (pcDtParam->applyWeight)
+ if (distParam->applyWeight)
{
- return xGetHADsw(pcDtParam);
+ return xGetHADsw(distParam);
}
- Pel* piOrg = pcDtParam->fenc;
- Pel* piCur = pcDtParam->fref;
- Int iRows = pcDtParam->rows;
- Int iCols = pcDtParam->cols;
- Int iStrideCur = pcDtParam->frefstride;
- Int iStrideOrg = pcDtParam->fencstride;
- Int iStep = pcDtParam->step;
+ Pel* org = distParam->fenc;
+ Pel* cur = distParam->fref;
+ Int rows = distParam->rows;
+ Int cols = distParam->cols;
+ Int strideCur = distParam->frefstride;
+ Int strideOrg = distParam->fencstride;
+ Int step = distParam->step;
Int x, y;
- UInt uiSum = 0;
+ UInt sum = 0;
- if ((iRows % 8 == 0) && (iCols % 8 == 0))
+ if ((rows % 8 == 0) && (cols % 8 == 0))
{
- Int iOffsetOrg = iStrideOrg << 3;
- Int iOffsetCur = iStrideCur << 3;
- for (y = 0; y < iRows; y += 8)
+ Int offsetOrg = strideOrg << 3;
+ Int offsetCur = strideCur << 3;
+ for (y = 0; y < rows; y += 8)
{
- for (x = 0; x < iCols; x += 8)
+ for (x = 0; x < cols; x += 8)
{
- uiSum += xCalcHADs8x8(&piOrg[x], &piCur[x * iStep], iStrideOrg, iStrideCur, iStep);
+ sum += xCalcHADs8x8(&org[x], &cur[x * step], strideOrg, strideCur, step);
}
- piOrg += iOffsetOrg;
- piCur += iOffsetCur;
+ org += offsetOrg;
+ cur += offsetCur;
}
}
- else if ((iRows % 4 == 0) && (iCols % 4 == 0))
+ else if ((rows % 4 == 0) && (cols % 4 == 0))
{
- Int iOffsetOrg = iStrideOrg << 2;
- Int iOffsetCur = iStrideCur << 2;
+ Int offsetOrg = strideOrg << 2;
+ Int offsetCur = strideCur << 2;
- for (y = 0; y < iRows; y += 4)
+ for (y = 0; y < rows; y += 4)
{
- for (x = 0; x < iCols; x += 4)
+ for (x = 0; x < cols; x += 4)
{
- uiSum += xCalcHADs4x4(&piOrg[x], &piCur[x * iStep], iStrideOrg, iStrideCur, iStep);
+ sum += xCalcHADs4x4(&org[x], &cur[x * step], strideOrg, strideCur, step);
}
- piOrg += iOffsetOrg;
- piCur += iOffsetCur;
+ org += offsetOrg;
+ cur += offsetCur;
}
}
else
@@ -1694,7 +1694,7 @@
assert(false);
}
- return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth - 8);
+ return sum >> DISTORTION_PRECISION_ADJUSTMENT(distParam->bitDepth - 8);
}
//! \}
More information about the x265-devel
mailing list