History

Merge pull request #1995 from sijchen/ps22

[Encoder] make two un-error ending of encoding go to a same exit and save the d…

huili2 committed 11 years ago

Commit 2ca6af52 parents dea4303 2ff38e91 file · +15 −11Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+15−11
@@ -3850,15 +3850,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3849 unmodified lines
38503850
38513851 pCtx->pFuncList->pMarkPic (pCtx);
38523852 if (!pCtx->pFuncList->pBuildRefList (pCtx, pCtx->iPOC, 0)) {
3853− pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx);
3854− // Force coding IDR as followed
3855− ForceCodingIDR (pCtx);
38563853 WelsLog (pLogCtx, WELS_LOG_WARNING,
38573854 "WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!",
38583855 pCtx->iNumRef0);
3859− pFbi->eFrameType = videoFrameTypeIDR;
3856+ eFrameType = videoFrameTypeIDR;
38603857 pCtx->iEncoderError = ENC_RETURN_CORRECTED;
3861− return ENC_RETURN_CORRECTED;
3858+ break;
38623859 }
38633860 if (pCtx->eSliceType != I_SLICE) {
38643861 pCtx->pFuncList->pAfterBuildRefList (pCtx);
@@ -4125,13 +4122,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 260 unmodified lines
41254122 // reference picture list update
41264123 if (eNalRefIdc != NRI_PRI_LOWEST) {
41274124 if (!pCtx->pFuncList->pUpdateRefList (pCtx)) {
4128− pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx);
4129− // Force coding IDR as followed
4130− ForceCodingIDR (pCtx);
41314125 WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!");
41324126 //the above is to set the next frame to be IDR
4133− pFbi->eFrameType = eFrameType;
4134− return ENC_RETURN_CORRECTED;
4127+ pCtx->iEncoderError = ENC_RETURN_CORRECTED;
4128+ break;
41354129 }
41364130 }
41374131
@@ -4284,7 +4278,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 146 unmodified lines
42844278
42854279 if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) {
42864280 ForceCodingIDR (pCtx);
4287− WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!");
4281+ WelsLog (pLogCtx, WELS_LOG_WARNING,
4282+ "WelsEncoderEncodeExt(), Logic Error Found in Preprocess updating. ForceCodingIDR!");
42884283 //the above is to set the next frame IDR
42894284 pFbi->eFrameType = eFrameType;
42904285 return ENC_RETURN_CORRECTED;
@@ -4296,6 +4291,15 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 5 unmodified lines
42964291 }
42974292 }
42984293
4294+ if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) {
4295+ pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid);
4296+ ForceCodingIDR (pCtx);
4297+ WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!");
4298+ //the above is to set the next frame IDR
4299+ pFbi->eFrameType = eFrameType;
4300+ return ENC_RETURN_CORRECTED;
4301+ }
4302+
42994303 #if defined(MT_DEBUG)
43004304 TrackSliceConsumeTime (pCtx, iDidList, iSpatialNum);
43014305 #endif//MT_DEBUG

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