History

astyle all files

huili2 committed 12 years ago

Commit 5ed24f21 parent 0c24686120 files · +3967 −3886Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 120 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+22−18
@@ -970,7 +970,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 969 unmodified lines
970970 pCtx->sMb.pInterPredictionDoneFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
971971 int8_t), "pCtx->sMb.pInterPredictionDoneFlag[]");
972972
973− pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool), "pCtx->sMb.pMbCorrectlyDecodedFlag[]");
973+ pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool),
974+ "pCtx->sMb.pMbCorrectlyDecodedFlag[]");
974975
975976 // check memory block valid due above allocated..
976977 WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
@@ -1482,60 +1483,63 @@ void WelsDecodeAccessUnitEnd (PWelsDecoderContext pCtx) { · 505 unmodified lines
14821483 * return:
14831484 * true - the AU to be construct is the start of new sequence; false - not
14841485 */
1485−static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) {
1486+static bool CheckNewSeqBeginAndUpdateActiveLayerSps (PWelsDecoderContext pCtx) {
14861487 bool bNewSeq = false;
14871488 PAccessUnit pCurAu = pCtx->pAccessUnitList;
14881489 PSps pTmpLayerSps[MAX_LAYER_NUM];
1489− for(int i = 0; i < MAX_LAYER_NUM; i++) {
1490+ for (int i = 0; i < MAX_LAYER_NUM; i++) {
14901491 pTmpLayerSps[i] = NULL;
14911492 }
14921493 // track the layer sps for the current au
1493− for(unsigned int i = pCurAu->uiStartPos; i <= pCurAu->uiEndPos; i++) {
1494+ for (unsigned int i = pCurAu->uiStartPos; i <= pCurAu->uiEndPos; i++) {
14941495 uint32_t uiDid = pCurAu->pNalUnitsList[i]->sNalHeaderExt.uiDependencyId;
14951496 pTmpLayerSps[uiDid] = pCurAu->pNalUnitsList[i]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
1496− if ((pCurAu->pNalUnitsList[i]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR) || (pCurAu->pNalUnitsList[i]->sNalHeaderExt.bIdrFlag))
1497+ if ((pCurAu->pNalUnitsList[i]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR)
1498+ || (pCurAu->pNalUnitsList[i]->sNalHeaderExt.bIdrFlag))
14971499 bNewSeq = true;
14981500 }
14991501 int iMaxActiveLayer = 0, iMaxCurrentLayer = 0;
1500− for(int i = MAX_LAYER_NUM - 1; i >= 0; i--) {
1502+ for (int i = MAX_LAYER_NUM - 1; i >= 0; i--) {
15011503 if (pCtx->pActiveLayerSps[i] != NULL) {
15021504 iMaxActiveLayer = i;
15031505 break;
15041506 }
15051507 }
1506− for(int i = MAX_LAYER_NUM - 1; i >= 0; i--) {
1508+ for (int i = MAX_LAYER_NUM - 1; i >= 0; i--) {
15071509 if (pTmpLayerSps[i] != NULL) {
15081510 iMaxCurrentLayer = i;
15091511 break;
15101512 }
15111513 }
1512− if ((iMaxCurrentLayer != iMaxActiveLayer) || (pTmpLayerSps[iMaxCurrentLayer] != pCtx->pActiveLayerSps[iMaxActiveLayer])) {
1514+ if ((iMaxCurrentLayer != iMaxActiveLayer)
1515+ || (pTmpLayerSps[iMaxCurrentLayer] != pCtx->pActiveLayerSps[iMaxActiveLayer])) {
15131516 bNewSeq = true;
15141517 }
15151518 // fill active sps if the current sps is not null while active layer is null
15161519 if (!bNewSeq) {
1517− for(int i = 0; i < MAX_LAYER_NUM; i++) {
1520+ for (int i = 0; i < MAX_LAYER_NUM; i++) {
15181521 if (pCtx->pActiveLayerSps[i] == NULL && pTmpLayerSps[i] != NULL) {
15191522 pCtx->pActiveLayerSps[i] = pTmpLayerSps[i];
15201523 }
15211524 }
15221525 } else {
15231526 // UpdateActiveLayerSps if new sequence start
1524− memcpy(&pCtx->pActiveLayerSps[0], &pTmpLayerSps[0], MAX_LAYER_NUM * sizeof(PSps));
1527+ memcpy (&pCtx->pActiveLayerSps[0], &pTmpLayerSps[0], MAX_LAYER_NUM * sizeof (PSps));
15251528 }
15261529 return bNewSeq;
15271530 }
15281531
1529−static void WriteBackActiveParameters(PWelsDecoderContext pCtx) {
1532+static void WriteBackActiveParameters (PWelsDecoderContext pCtx) {
15301533 if (pCtx->iOverwriteFlags & OVERWRITE_PPS) {
1531− memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps));
1534+ memcpy (&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof (SPps));
15321535 }
15331536 if (pCtx->iOverwriteFlags & OVERWRITE_SPS) {
1534− memcpy(&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof(SSps));
1537+ memcpy (&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof (SSps));
15351538 pCtx->bNewSeqBegin = true;
15361539 }
15371540 if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) {
1538− memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps));
1541+ memcpy (&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId],
1542+ &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof (SSubsetSps));
15391543 pCtx->bNewSeqBegin = true;
15401544 }
15411545 pCtx->iOverwriteFlags = OVERWRITE_NONE;
@@ -1561,7 +1565,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 19 unmodified lines
15611565
15621566 pCtx->bAuReadyFlag = false;
15631567 pCtx->bLastHasMmco5 = false;
1564− bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1568+ bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps (pCtx);
15651569 pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || bTmpNewSeqBegin;
15661570 iErr = WelsDecodeAccessUnitStart (pCtx);
15671571 GetVclNalTemporalId (pCtx);
@@ -1595,11 +1599,11 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 27 unmodified lines
15951599 ImplementErrorCon (pCtx);
15961600
15971601 pCtx->bNewSeqBegin = false;
1598− WriteBackActiveParameters(pCtx);
1602+ WriteBackActiveParameters (pCtx);
15991603 pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin;
16001604 pCtx->bNextNewSeqBegin = false; // reset it
16011605 if (pCtx->bNewSeqBegin)
1602− ResetActiveSPSForEachLayer(pCtx);
1606+ ResetActiveSPSForEachLayer (pCtx);
16031607 if (ERR_NONE != iErr) {
16041608 WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr);
16051609 return iErr;
@@ -1932,7 +1936,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 326 unmodified lines
19321936 }
19331937 }
19341938
1935− // need update frame_num due current frame is well decoded
1939+ // need update frame_num due current frame is well decoded
19361940 pCtx->iPrevFrameNum = pSh->iFrameNum;
19371941 if (pCtx->bLastHasMmco5)
19381942 pCtx->iPrevFrameNum = 0;

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