History

remove repeat initialization

ruil2 committed 12 years ago

Commit ac404ce1 parent 44013d46 files · +8469 −8481Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+18−13
@@ -961,7 +961,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 960 unmodified lines
961961 }
962962
963963 // initialize pPps
964− WelsInitPps (pPps, pSps, pSubsetSps, iPpsId, true, bUseSubsetSps,pParam->iEntropyCodingModeFlag != 0);
964+ WelsInitPps (pPps, pSps, pSubsetSps, iPpsId, true, bUseSubsetSps, pParam->iEntropyCodingModeFlag != 0);
965965
966966 // Not using FMO in SVC coding so far, come back if need FMO
967967 {
@@ -2347,8 +2347,8 @@ void UpdateSlicepEncCtxWithPartition (SSliceCtx* pSliceCtx, int32_t iPartitionNu · 1379 unmodified lines
23472347 }
23482348 pSliceCtx->pFirstMbInSlice[i] = iFirstMbIdx;
23492349
2350− WelsSetMemMultiplebytes_c(pSliceCtx->pOverallMbMap + iFirstMbIdx, i,
2351− pSliceCtx->pCountMbNumInSlice[i], sizeof(uint16_t));
2350+ WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdx, i,
2351+ pSliceCtx->pCountMbNumInSlice[i], sizeof (uint16_t));
23522352
23532353 // for next partition(or pSlice)
23542354 iFirstMbIdx += pSliceCtx->pCountMbNumInSlice[i];
@@ -3080,7 +3080,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 725 unmodified lines
30803080 pSrcPic->uiTimeStamp);
30813081 return ENC_RETURN_SUCCESS;
30823082 }
3083−
30843083 InitFrameCoding (pCtx, eFrameType);
30853084
30863085 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[pSpatialIndexMap->iDid], pCtx->iCodingIndex,
@@ -3926,7 +3925,7 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 839 unmodified lines
39263925
39273926 SWelsNalRaw* pNalList = (SWelsNalRaw*)pMA->WelsMalloc (iCountNals * sizeof (SWelsNalRaw), "pOut->sNalList");
39283927 if (NULL == pNalList) {
3929− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalList is NULL");
3928+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalList is NULL");
39303929 return ENC_RETURN_MEMALLOCERR;
39313930 }
39323931 memcpy (pNalList, pCtx->pOut->sNalList, sizeof (SWelsNalRaw) * pCtx->pOut->iCountNals);
@@ -3935,7 +3934,7 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 2 unmodified lines
39353934
39363935 int32_t* pNalLen = (int32_t*)pMA->WelsMalloc (iCountNals * sizeof (int32_t), "pOut->pNalLen");
39373936 if (NULL == pNalLen) {
3938− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalLen is NULL");
3937+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pNalLen is NULL");
39393938 return ENC_RETURN_MEMALLOCERR;
39403939 }
39413940 memcpy (pNalLen, pCtx->pOut->pNalLen, sizeof (int32_t) * pCtx->pOut->iCountNals);
@@ -3954,7 +3953,7 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 12 unmodified lines
39543953
39553954 SSlice* pSlice = (SSlice*)pMA->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "Slice");
39563955 if (NULL == pSlice) {
3957− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pSlice is NULL");
3956+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pSlice is NULL");
39583957 return ENC_RETURN_MEMALLOCERR;
39593958 }
39603959 memcpy (pSlice, pCurLayer->sLayerInfo.pSliceInLayer, sizeof (SSlice) * iMaxSliceNumOld);
@@ -3971,7 +3970,8 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 10 unmodified lines
39713970 else
39723971 pSliceIdx->pSliceBsa = &pCtx->pOut->sBsWrite;
39733972 if (AllocMbCacheAligned (&pSliceIdx->sMbCacheInfo, pMA)) {
3974− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc MbCache not successful at slice_idx=%d (max-slice=%d)",
3973+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
3974+ "CWelsH264SVCEncoder::DynSliceRealloc: realloc MbCache not successful at slice_idx=%d (max-slice=%d)",
39753975 uiSliceIdx, iMaxSliceNum);
39763976 return ENC_RETURN_MEMALLOCERR;
39773977 }
@@ -3994,7 +3994,7 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 16 unmodified lines
39943994
39953995 int16_t* pFirstMbInSlice = (int16_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int16_t), "pSliceSeg->pFirstMbInSlice");
39963996 if (NULL == pFirstMbInSlice) {
3997− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pFirstMbInSlice is NULL");
3997+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: pFirstMbInSlice is NULL");
39983998 return ENC_RETURN_MEMALLOCERR;
39993999 }
40004000 memset (pFirstMbInSlice, 0, sizeof (int16_t) * iMaxSliceNum);
@@ -4005,7 +4005,8 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 4 unmodified lines
40054005 int32_t* pCountMbNumInSlice = (int32_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (int32_t),
40064006 "pSliceSeg->pCountMbNumInSlice");
40074007 if (NULL == pCountMbNumInSlice) {
4008− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc pCountMbNumInSlice not successful");
4008+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
4009+ "CWelsH264SVCEncoder::DynSliceRealloc: realloc pCountMbNumInSlice not successful");
40094010 return ENC_RETURN_MEMALLOCERR;
40104011 }
40114012 memcpy (pCountMbNumInSlice, pCurLayer->pSliceEncCtx->pCountMbNumInSlice, sizeof (int32_t) * iMaxSliceNumOld);
@@ -4019,7 +4020,8 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 7 unmodified lines
40194020
40204021 SRCSlicing* pSlcingOverRc = (SRCSlicing*)pMA->WelsMalloc (iMaxSliceNum * sizeof (SRCSlicing), "SlicingOverRC");
40214022 if (NULL == pSlcingOverRc) {
4022− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::DynSliceRealloc: realloc pSlcingOverRc not successful");
4023+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
4024+ "CWelsH264SVCEncoder::DynSliceRealloc: realloc pSlcingOverRc not successful");
40234025 return ENC_RETURN_MEMALLOCERR;
40244026 }
40254027 memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld);
@@ -4087,11 +4089,14 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 61 unmodified lines
40874089 if (pCtx->iActiveThreadsNum == 1) {
40884090 //only single thread support re-alloc now
40894091 if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) {
4090− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::WelsCodeOnePicPartition: DynSliceRealloc not successful");
4092+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
4093+ "CWelsH264SVCEncoder::WelsCodeOnePicPartition: DynSliceRealloc not successful");
40914094 return ENC_RETURN_MEMALLOCERR;
40924095 }
40934096 } else if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
4094− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::WelsCodeOnePicPartition: iSliceIdx(%d) over iMaxSliceNumConstraint(%d)", iSliceIdx, pSliceCtx->iMaxSliceNumConstraint);
4097+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
4098+ "CWelsH264SVCEncoder::WelsCodeOnePicPartition: iSliceIdx(%d) over iMaxSliceNumConstraint(%d)", iSliceIdx,
4099+ pSliceCtx->iMaxSliceNumConstraint);
40954100 return ENC_RETURN_MEMALLOCERR;
40964101 }
40974102 }

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