History

astyle code style for enc

Guangwei Wang committed 9 years ago

Commit 3d150f01 parent bc8317915 files · +184 −172Browse files

Showing the changes to codec/encoder/core/src/svc_enc_slice_segment.cpp (1 of 15 files). Show all

Unified · Split

codec/encoder/core/src/svc_enc_slice_segment.cpp+26−27
@@ -67,7 +67,7 @@ int32_t AssignMbMapSingleSlice (void* pMbMap, const int32_t kiCountMbNum, const · 66 unmodified lines
6767 *
6868 * \return 0 - successful; none 0 - failed
6969 */
70−int32_t AssignMbMapMultipleSlices (SDqLayer* pCurDq,const SSliceArgument* kpSliceArgument) {
70+int32_t AssignMbMapMultipleSlices (SDqLayer* pCurDq, const SSliceArgument* kpSliceArgument) {
7171 SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx;
7272 int32_t iSliceIdx = 0;
7373 if (NULL == pSliceSeg || SM_SINGLE_SLICE == pSliceSeg->uiSliceMode)
@@ -80,8 +80,8 @@ int32_t AssignMbMapMultipleSlices (SDqLayer* pCurDq,const SSliceArgument* kpSlic · 6 unmodified lines
8080 iSliceIdx = 0;
8181 while (iSliceIdx < iSliceNum) {
8282 const int32_t kiFirstMb = iSliceIdx * kiMbWidth;
83− WelsSetMemMultiplebytes_c(pSliceSeg->pOverallMbMap + kiFirstMb, iSliceIdx,
84− kiMbWidth, sizeof(uint16_t));
83+ WelsSetMemMultiplebytes_c (pSliceSeg->pOverallMbMap + kiFirstMb, iSliceIdx,
84+ kiMbWidth, sizeof (uint16_t));
8585 ++ iSliceIdx;
8686 }
8787
@@ -108,7 +108,7 @@ int32_t AssignMbMapMultipleSlices (SDqLayer* pCurDq,const SSliceArgument* kpSlic · 20 unmodified lines
108108 ++ iSliceIdx;
109109 } while (iSliceIdx < kiCountSliceNumInFrame && iMbIdx < kiCountNumMbInFrame);
110110 } else if (SM_SIZELIMITED_SLICE == pSliceSeg->uiSliceMode) {
111− // do nothing,pSliceSeg->pOverallMbMap will be initial later
111+ // do nothing,pSliceSeg->pOverallMbMap will be initial later
112112 } else { // any else uiSliceMode?
113113 assert (0);
114114 }
@@ -139,7 +139,7 @@ bool CheckFixedSliceNumMultiSliceSetting (const int32_t kiMbNumInFrame, SSliceAr · 24 unmodified lines
139139
140140 pSlicesAssignList[uiSliceIdx] = iNumMbLeft;
141141
142− if (iNumMbLeft <= 0 || kiMbNumPerSlice <= 0 ) {
142+ if (iNumMbLeft <= 0 || kiMbNumPerSlice <= 0) {
143143 return false;
144144 }
145145
@@ -287,7 +287,7 @@ bool GomValidCheckSliceMbNum (const int32_t kiMbWidth, const int32_t kiMbHeight, · 141 unmodified lines
287287 if (iNumMbAssigning < iMinimalMbNum)
288288 iCurNumMbAssigning = iMinimalMbNum;
289289 else if (iNumMbAssigning > iMaximalMbNum)
290− iCurNumMbAssigning = ( iMaximalMbNum / iGomSize ) * iGomSize;
290+ iCurNumMbAssigning = (iMaximalMbNum / iGomSize) * iGomSize;
291291 else
292292 iCurNumMbAssigning = iNumMbAssigning;
293293
@@ -304,7 +304,7 @@ bool GomValidCheckSliceMbNum (const int32_t kiMbWidth, const int32_t kiMbHeight, · 10 unmodified lines
304304 ++ uiSliceIdx;
305305 }
306306 pSlicesAssignList[uiSliceIdx] = iNumMbLeft;
307− if ( iNumMbLeft < iMinimalMbNum ) {
307+ if (iNumMbLeft < iMinimalMbNum) {
308308 return false;
309309 }
310310
@@ -321,19 +321,18 @@ int32_t GetInitialSliceNum (SSliceArgument* pSliceArgument) { · 10 unmodified lines
321321 return -1;
322322
323323 switch (pSliceArgument->uiSliceMode) {
324− case SM_SINGLE_SLICE:
325− case SM_FIXEDSLCNUM_SLICE:
326− case SM_RASTER_SLICE:
327− {
328− return pSliceArgument->uiSliceNum;
329− }
330− case SM_SIZELIMITED_SLICE: {
331− return AVERSLICENUM_CONSTRAINT;//at the beginning of dynamic slicing, set the uiSliceNum to be 1
332− }
333− case SM_RESERVED:
334− default: {
335− return -1;
336− }
324+ case SM_SINGLE_SLICE:
325+ case SM_FIXEDSLCNUM_SLICE:
326+ case SM_RASTER_SLICE: {
327+ return pSliceArgument->uiSliceNum;
328+ }
329+ case SM_SIZELIMITED_SLICE: {
330+ return AVERSLICENUM_CONSTRAINT;//at the beginning of dynamic slicing, set the uiSliceNum to be 1
331+ }
332+ case SM_RESERVED:
333+ default: {
334+ return -1;
335+ }
337336 }
338337
339338 return -1;
@@ -395,13 +394,13 @@ int32_t InitSliceSegment (SDqLayer* pCurDq, · 55 unmodified lines
395394 return AssignMbMapSingleSlice (pSliceSeg->pOverallMbMap, kiCountMbNum, sizeof (pSliceSeg->pOverallMbMap[0]));
396395 } else { //if ( SM_MULTIPLE_SLICE == uiSliceMode )
397396 if (uiSliceMode != SM_FIXEDSLCNUM_SLICE && uiSliceMode != SM_RASTER_SLICE
398− && uiSliceMode != SM_SIZELIMITED_SLICE )
397+ && uiSliceMode != SM_SIZELIMITED_SLICE)
399398 return 1;
400399
401400 pSliceSeg->pOverallMbMap = (uint16_t*)pMa->WelsMallocz (kiCountMbNum * sizeof (uint16_t), "pSliceSeg->pOverallMbMap");
402401 WELS_VERIFY_RETURN_IF (1, NULL == pSliceSeg->pOverallMbMap)
403402
404− WelsSetMemMultiplebytes_c(pSliceSeg->pOverallMbMap, 0, kiCountMbNum, sizeof(uint16_t));
403+ WelsSetMemMultiplebytes_c (pSliceSeg->pOverallMbMap, 0, kiCountMbNum, sizeof (uint16_t));
405404
406405 //SM_SIZELIMITED_SLICE: init, set pSliceSeg->iSliceNumInFrame = 1;
407406 pSliceSeg->iSliceNumInFrame = GetInitialSliceNum (pSliceArgument);
@@ -533,7 +532,7 @@ uint16_t WelsMbToSliceIdc (SDqLayer* pCurDq, const int32_t kiMbXY) { · 125 unmodified lines
533532 * \return iFirstMb - successful; -1 - failed;
534533 */
535534 int32_t WelsGetFirstMbOfSlice (SDqLayer* pCurLayer, const int32_t kuiSliceIdc) {
536− if ( NULL == pCurLayer || NULL == pCurLayer->pFirstMbIdxOfSlice ) {
535+ if (NULL == pCurLayer || NULL == pCurLayer->pFirstMbIdxOfSlice) {
537536 return -1;
538537 }
539538
@@ -613,7 +612,7 @@ int32_t WelsGetPrevMbOfSlice (SDqLayer* pCurDq, const int32_t kiMbXY) { · 73 unmodified lines
613612 *
614613 * \return count_num_of_mb - successful; -1 - failed;
615614 */
616−int32_t WelsGetNumMbInSlice (SDqLayer* pCurDq, SSlice* pSlice, const int32_t kuiSliceIdc) {
615+int32_t WelsGetNumMbInSlice (SDqLayer* pCurDq, SSlice* pSlice, const int32_t kuiSliceIdc) {
617616 SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
618617 bool bInValidFlag = false;
619618
@@ -623,7 +622,7 @@ int32_t WelsGetNumMbInSlice (SDqLayer* pCurDq, SSlice* pSlice, const int32_t ku · 3 unmodified lines
623622
624623 bInValidFlag = ((SM_SINGLE_SLICE != pSliceCtx->uiSliceMode) && (kuiSliceIdc >= pSliceCtx->iSliceNumInFrame))
625624 || ((SM_SINGLE_SLICE == pSliceCtx->uiSliceMode) && (kuiSliceIdc > 0));
626− if(bInValidFlag) {
625+ if (bInValidFlag) {
627626 return -1;
628627 }
629628
@@ -662,8 +661,8 @@ int32_t DynamicAdjustSlicePEncCtxAll (SDqLayer* pCurDq, · 32 unmodified lines
662661 pCurDq->pFirstMbIdxOfSlice[iSliceIdx] = iFirstMbIdx;
663662 pCurDq->pCountMbNumInSlice[iSliceIdx] = kiSliceRun;
664663
665− WelsSetMemMultiplebytes_c(pSliceCtx->pOverallMbMap + iFirstMbIdx, iSliceIdx,
666− kiSliceRun, sizeof(uint16_t));
664+ WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdx, iSliceIdx,
665+ kiSliceRun, sizeof (uint16_t));
667666
668667 iFirstMbIdx += kiSliceRun;
669668

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