History

Convert tabs to spaces in vertically aligned code

Martin Storsjö committed 11 years ago

Commit 51efa571 parent 723044864 files · +2746 −2751Browse files

Showing the changes to codec/processing/src/backgrounddetection/BackgroundDetection.cpp (1 of 64 files). Show all

Unified · Split

codec/processing/src/backgrounddetection/BackgroundDetection.cpp+39−39
@@ -107,16 +107,16 @@ EResult CBackgroundDetection::Set (int32_t iType, void* pParam) { · 106 unmodified lines
107107 }
108108
109109 inline SBackgroundOU* CBackgroundDetection::AllocateOUArrayMemory (int32_t iWidth, int32_t iHeight) {
110− int32_t iMaxOUWidth = (BGD_OU_SIZE - 1 + iWidth) >> LOG2_BGD_OU_SIZE;
111− int32_t iMaxOUHeight = (BGD_OU_SIZE - 1 + iHeight) >> LOG2_BGD_OU_SIZE;
110+ int32_t iMaxOUWidth = (BGD_OU_SIZE - 1 + iWidth) >> LOG2_BGD_OU_SIZE;
111+ int32_t iMaxOUHeight = (BGD_OU_SIZE - 1 + iHeight) >> LOG2_BGD_OU_SIZE;
112112 return (SBackgroundOU*)WelsMalloc (iMaxOUWidth * iMaxOUHeight * sizeof (SBackgroundOU));
113113 }
114114
115115 void CBackgroundDetection::GetOUParameters (SVAACalcResult* sVaaCalcInfo, int32_t iMbIndex, int32_t iMbWidth,
116116 SBackgroundOU* pBgdOU) {
117− int32_t iSubSD[4];
118− uint8_t iSubMAD[4];
119− int32_t iSubSAD[4];
117+ int32_t iSubSD[4];
118+ uint8_t iSubMAD[4];
119+ int32_t iSubSAD[4];
120120
121121 uint8_t (*pMad8x8)[4];
122122 int32_t (*pSad8x8)[4];
@@ -141,9 +141,9 @@ void CBackgroundDetection::GetOUParameters (SVAACalcResult* sVaaCalcInfo, int32_ · 18 unmodified lines
141141 iSubMAD[2] = pMad8x8[iMbIndex][2];
142142 iSubMAD[3] = pMad8x8[iMbIndex][3];
143143
144− pBgdOU->iSD = iSubSD[0] + iSubSD[1] + iSubSD[2] + iSubSD[3];
145− pBgdOU->iSAD = iSubSAD[0] + iSubSAD[1] + iSubSAD[2] + iSubSAD[3];
146− pBgdOU->iSD = WELS_ABS (pBgdOU->iSD);
144+ pBgdOU->iSD = iSubSD[0] + iSubSD[1] + iSubSD[2] + iSubSD[3];
145+ pBgdOU->iSAD = iSubSAD[0] + iSubSAD[1] + iSubSAD[2] + iSubSAD[3];
146+ pBgdOU->iSD = WELS_ABS (pBgdOU->iSD);
147147
148148 // get the max absolute difference (MAD) of OU and min value of the MAD of sub-blocks of OU
149149 pBgdOU->iMAD = WELS_MAX (WELS_MAX (iSubMAD[0], iSubMAD[1]), WELS_MAX (iSubMAD[2], iSubMAD[3]));
@@ -155,9 +155,9 @@ void CBackgroundDetection::GetOUParameters (SVAACalcResult* sVaaCalcInfo, int32_ · 5 unmodified lines
155155 }
156156
157157 void CBackgroundDetection::ForegroundBackgroundDivision (vBGDParam* pBgdParam) {
158− int32_t iPicWidthInOU = pBgdParam->iBgdWidth >> LOG2_BGD_OU_SIZE;
159− int32_t iPicHeightInOU = pBgdParam->iBgdHeight >> LOG2_BGD_OU_SIZE;
160− int32_t iPicWidthInMb = (15 + pBgdParam->iBgdWidth) >> 4;
158+ int32_t iPicWidthInOU = pBgdParam->iBgdWidth >> LOG2_BGD_OU_SIZE;
159+ int32_t iPicHeightInOU = pBgdParam->iBgdHeight >> LOG2_BGD_OU_SIZE;
160+ int32_t iPicWidthInMb = (15 + pBgdParam->iBgdWidth) >> 4;
161161
162162 SBackgroundOU* pBackgroundOU = pBgdParam->pOU_array;
163163
@@ -187,8 +187,8 @@ void CBackgroundDetection::ForegroundBackgroundDivision (vBGDParam* pBgdParam) { · 23 unmodified lines
187187 }
188188 }
189189 inline int32_t CBackgroundDetection::CalculateAsdChromaEdge (uint8_t* pOriRef, uint8_t* pOriCur, int32_t iStride) {
190− int32_t ASD = 0;
191− int32_t idx;
190+ int32_t ASD = 0;
191+ int32_t idx;
192192 for (idx = 0; idx < BGD_OU_SIZE_UV; idx++) {
193193 ASD += *pOriCur - *pOriRef;
194194 pOriRef += iStride;
@@ -199,16 +199,16 @@ inline int32_t CBackgroundDetection::CalculateAsdChromaEdge (uint8_t* pOriRef, u · 4 unmodified lines
199199
200200 inline bool CBackgroundDetection::ForegroundDilation23Luma (SBackgroundOU* pBackgroundOU,
201201 SBackgroundOU* pOUNeighbours[]) {
202− SBackgroundOU* pOU_L = pOUNeighbours[0];
203− SBackgroundOU* pOU_R = pOUNeighbours[1];
204− SBackgroundOU* pOU_U = pOUNeighbours[2];
205− SBackgroundOU* pOU_D = pOUNeighbours[3];
202+ SBackgroundOU* pOU_L = pOUNeighbours[0];
203+ SBackgroundOU* pOU_R = pOUNeighbours[1];
204+ SBackgroundOU* pOU_U = pOUNeighbours[2];
205+ SBackgroundOU* pOU_D = pOUNeighbours[3];
206206
207207 if (pBackgroundOU->iMAD > pBackgroundOU->iMinSubMad << 1) {
208208 int32_t iMaxNbrForegroundMad;
209209 int32_t iMaxNbrBackgroundMad;
210− int32_t aBackgroundMad[4];
211− int32_t aForegroundMad[4];
210+ int32_t aBackgroundMad[4];
211+ int32_t aForegroundMad[4];
212212
213213 aForegroundMad[0] = (pOU_L->iBackgroundFlag - 1) & pOU_L->iMAD;
214214 aForegroundMad[1] = (pOU_R->iBackgroundFlag - 1) & pOU_R->iMAD;
@@ -232,9 +232,9 @@ inline bool CBackgroundDetection::ForegroundDilation23Luma (SBackgroundOU* pBack · 17 unmodified lines
232232
233233 inline bool CBackgroundDetection::ForegroundDilation23Chroma (int8_t iNeighbourForegroundFlags,
234234 int32_t iStartSamplePos, int32_t iPicStrideUV, vBGDParam* pBgdParam) {
235− static const int8_t kaOUPos[4] = {OU_LEFT, OU_RIGHT, OU_TOP, OU_BOTTOM};
236− int32_t aEdgeOffset[4] = {0, BGD_OU_SIZE_UV - 1, 0, iPicStrideUV* (BGD_OU_SIZE_UV - 1)};
237− int32_t iStride[4] = {iPicStrideUV, iPicStrideUV, 1, 1};
235+ static const int8_t kaOUPos[4] = {OU_LEFT, OU_RIGHT, OU_TOP, OU_BOTTOM};
236+ int32_t aEdgeOffset[4] = {0, BGD_OU_SIZE_UV - 1, 0, iPicStrideUV* (BGD_OU_SIZE_UV - 1)};
237+ int32_t iStride[4] = {iPicStrideUV, iPicStrideUV, 1, 1};
238238
239239 // V component first, high probability because V stands for red color and human skin colors have more weight on this component
240240 for (int32_t i = 0; i < 4; i++) {
@@ -262,8 +262,8 @@ inline bool CBackgroundDetection::ForegroundDilation23Chroma (int8_t iNeighbourF · 21 unmodified lines
262262
263263 inline void CBackgroundDetection::ForegroundDilation (SBackgroundOU* pBackgroundOU, SBackgroundOU* pOUNeighbours[],
264264 vBGDParam* pBgdParam, int32_t iChromaSampleStartPos) {
265− int32_t iPicStrideUV = pBgdParam->iStride[1];
266− int32_t iSumNeighBackgroundFlags = pOUNeighbours[0]->iBackgroundFlag + pOUNeighbours[1]->iBackgroundFlag +
265+ int32_t iPicStrideUV = pBgdParam->iStride[1];
266+ int32_t iSumNeighBackgroundFlags = pOUNeighbours[0]->iBackgroundFlag + pOUNeighbours[1]->iBackgroundFlag +
267267 pOUNeighbours[2]->iBackgroundFlag + pOUNeighbours[3]->iBackgroundFlag;
268268
269269 if (pBackgroundOU->iSAD > BGD_OU_SIZE * Q_FACTOR) {
@@ -318,10 +318,10 @@ inline void CBackgroundDetection::SetBackgroundMbFlag (int8_t* pBackgroundMbFlag · 48 unmodified lines
318318 inline void CBackgroundDetection::UpperOUForegroundCheck (SBackgroundOU* pCurOU, int8_t* pBackgroundMbFlag,
319319 int32_t iPicWidthInOU, int32_t iPicWidthInMb) {
320320 if (pCurOU->iSAD > BGD_OU_SIZE * Q_FACTOR) {
321− SBackgroundOU* pOU_L = pCurOU - 1;
322− SBackgroundOU* pOU_R = pCurOU + 1;
323− SBackgroundOU* pOU_U = pCurOU - iPicWidthInOU;
324− SBackgroundOU* pOU_D = pCurOU + iPicWidthInOU;
321+ SBackgroundOU* pOU_L = pCurOU - 1;
322+ SBackgroundOU* pOU_R = pCurOU + 1;
323+ SBackgroundOU* pOU_U = pCurOU - iPicWidthInOU;
324+ SBackgroundOU* pOU_D = pCurOU + iPicWidthInOU;
325325 if (pOU_L->iBackgroundFlag + pOU_R->iBackgroundFlag + pOU_U->iBackgroundFlag + pOU_D->iBackgroundFlag <= 1) {
326326 SetBackgroundMbFlag (pBackgroundMbFlag, iPicWidthInMb, 0);
327327 pCurOU->iBackgroundFlag = 0;
@@ -330,21 +330,21 @@ inline void CBackgroundDetection::UpperOUForegroundCheck (SBackgroundOU* pCurOU, · 2 unmodified lines
330330 }
331331
332332 void CBackgroundDetection::ForegroundDilationAndBackgroundErosion (vBGDParam* pBgdParam) {
333− int32_t iPicStrideUV = pBgdParam->iStride[1];
334− int32_t iPicWidthInOU = pBgdParam->iBgdWidth >> LOG2_BGD_OU_SIZE;
335− int32_t iPicHeightInOU = pBgdParam->iBgdHeight >> LOG2_BGD_OU_SIZE;
336− int32_t iOUStrideUV = iPicStrideUV << (LOG2_BGD_OU_SIZE - 1);
337− int32_t iPicWidthInMb = (15 + pBgdParam->iBgdWidth) >> 4;
333+ int32_t iPicStrideUV = pBgdParam->iStride[1];
334+ int32_t iPicWidthInOU = pBgdParam->iBgdWidth >> LOG2_BGD_OU_SIZE;
335+ int32_t iPicHeightInOU = pBgdParam->iBgdHeight >> LOG2_BGD_OU_SIZE;
336+ int32_t iOUStrideUV = iPicStrideUV << (LOG2_BGD_OU_SIZE - 1);
337+ int32_t iPicWidthInMb = (15 + pBgdParam->iBgdWidth) >> 4;
338338
339339 SBackgroundOU* pBackgroundOU = pBgdParam->pOU_array;
340− int8_t* pVaaBackgroundMbFlag = (int8_t*)pBgdParam->pBackgroundMbFlag;
341− SBackgroundOU* pOUNeighbours[4];//0: left; 1: right; 2: top; 3: bottom
340+ int8_t* pVaaBackgroundMbFlag = (int8_t*)pBgdParam->pBackgroundMbFlag;
341+ SBackgroundOU* pOUNeighbours[4];//0: left; 1: right; 2: top; 3: bottom
342342
343− pOUNeighbours[2] = pBackgroundOU;//top OU
343+ pOUNeighbours[2] = pBackgroundOU;//top OU
344344 for (int32_t j = 0; j < iPicHeightInOU; j ++) {
345345 int8_t* pRowSkipFlag = pVaaBackgroundMbFlag;
346− pOUNeighbours[0] = pBackgroundOU;//left OU
347− pOUNeighbours[3] = pBackgroundOU + (iPicWidthInOU & ((j == iPicHeightInOU - 1) - 1)); //bottom OU
346+ pOUNeighbours[0] = pBackgroundOU;//left OU
347+ pOUNeighbours[3] = pBackgroundOU + (iPicWidthInOU & ((j == iPicHeightInOU - 1) - 1)); //bottom OU
348348 for (int32_t i = 0; i < iPicWidthInOU; i++) {
349349 pOUNeighbours[1] = pBackgroundOU + (i < iPicWidthInOU - 1); //right OU
350350
@@ -367,7 +367,7 @@ void CBackgroundDetection::ForegroundDilationAndBackgroundErosion (vBGDParam* pB · 16 unmodified lines
367367 pOUNeighbours[3]++;
368368 pBackgroundOU++;
369369 }
370− pOUNeighbours[2] = pBackgroundOU - iPicWidthInOU;
370+ pOUNeighbours[2] = pBackgroundOU - iPicWidthInOU;
371371 pVaaBackgroundMbFlag += OU_SIZE_IN_MB * iPicWidthInMb;
372372 }
373373 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t