[x265] [PATCH] TComRdCost::xGetSAD4 cleanup
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Fri Jul 12 10:20:33 CEST 2013
# HG changeset patch
# User praveentiwari
# Date 1373617223 -19800
# Node ID 7b90015331bc5737771fad71d24fa4c5549431c5
# Parent f3b49b4bc2446a75de68f46f4e5b8c15295d9d8f
TComRdCost::xGetSAD4 cleanup
diff -r f3b49b4bc244 -r 7b90015331bc source/Lib/TLibCommon/TComRdCost.cpp
--- a/source/Lib/TLibCommon/TComRdCost.cpp Fri Jul 12 13:00:56 2013 +0530
+++ b/source/Lib/TLibCommon/TComRdCost.cpp Fri Jul 12 13:50:23 2013 +0530
@@ -228,35 +228,35 @@
return sum >> DISTORTION_PRECISION_ADJUSTMENT(distParam->bitDepth - 8);
}
-UInt TComRdCost::xGetSAD4(DistParam* pcDtParam)
+UInt TComRdCost::xGetSAD4(DistParam* distParam)
{
- if (pcDtParam->applyWeight)
+ if (distParam->applyWeight)
{
- return xGetSADw(pcDtParam);
+ return xGetSADw(distParam);
}
- Pel* piOrg = pcDtParam->fenc;
- Pel* piCur = pcDtParam->fref;
- Int iRows = pcDtParam->rows;
- Int iSubShift = pcDtParam->subShift;
- Int iSubStep = (1 << iSubShift);
- Int iStrideCur = pcDtParam->frefstride * iSubStep;
- Int iStrideOrg = pcDtParam->fencstride * iSubStep;
- UInt uiSum = 0;
+ Pel* org = distParam->fenc;
+ Pel* cur = distParam->fref;
+ Int rows = distParam->rows;
+ Int shift = distParam->subShift;
+ Int step = (1 << shift);
+ Int strideCur = distParam->frefstride * step;
+ Int strideOrg = distParam->fencstride * step;
+ UInt sum = 0;
- for (; iRows != 0; iRows -= iSubStep)
+ for (; rows != 0; rows -= step)
{
- uiSum += abs(piOrg[0] - piCur[0]);
- uiSum += abs(piOrg[1] - piCur[1]);
- uiSum += abs(piOrg[2] - piCur[2]);
- uiSum += abs(piOrg[3] - piCur[3]);
+ sum += abs(org[0] - cur[0]);
+ sum += abs(org[1] - cur[1]);
+ sum += abs(org[2] - cur[2]);
+ sum += abs(org[3] - cur[3]);
- piOrg += iStrideOrg;
- piCur += iStrideCur;
+ org += strideOrg;
+ cur += strideCur;
}
- uiSum <<= iSubShift;
- return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth - 8);
+ sum <<= shift;
+ return sum >> DISTORTION_PRECISION_ADJUSTMENT(distParam->bitDepth - 8);
}
UInt TComRdCost::xGetSAD8(DistParam* pcDtParam)
More information about the x265-devel
mailing list