Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3859,15 +3859,12 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3858 unmodified lines | |||
| 3859 | 3859 | ||
| 3860 | pCtx->pFuncList->pMarkPic (pCtx); | 3860 | pCtx->pFuncList->pMarkPic (pCtx); |
| 3861 | if (!pCtx->pFuncList->pBuildRefList (pCtx, pCtx->iPOC, 0)) { | 3861 | if (!pCtx->pFuncList->pBuildRefList (pCtx, pCtx->iPOC, 0)) { |
| 3862 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx); | ||
| 3863 | // Force coding IDR as followed | ||
| 3864 | ForceCodingIDR (pCtx); | ||
| 3865 | WelsLog (pLogCtx, WELS_LOG_WARNING, | 3862 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 3866 | "WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!", | 3863 | "WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!", |
| 3867 | pCtx->iNumRef0); | 3864 | pCtx->iNumRef0); |
| 3868 | pFbi->eFrameType = videoFrameTypeIDR; | 3865 | eFrameType = videoFrameTypeIDR; |
| 3869 | pCtx->iEncoderError = ENC_RETURN_CORRECTED; | 3866 | pCtx->iEncoderError = ENC_RETURN_CORRECTED; |
| 3870 | return ENC_RETURN_CORRECTED; | 3867 | break; |
| 3871 | } | 3868 | } |
| 3872 | if (pCtx->eSliceType != I_SLICE) { | 3869 | if (pCtx->eSliceType != I_SLICE) { |
| 3873 | pCtx->pFuncList->pAfterBuildRefList (pCtx); | 3870 | pCtx->pFuncList->pAfterBuildRefList (pCtx); |
| @@ -4134,13 +4131,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 260 unmodified lines | |||
| 4134 | // reference picture list update | 4131 | // reference picture list update |
| 4135 | if (eNalRefIdc != NRI_PRI_LOWEST) { | 4132 | if (eNalRefIdc != NRI_PRI_LOWEST) { |
| 4136 | if (!pCtx->pFuncList->pUpdateRefList (pCtx)) { | 4133 | if (!pCtx->pFuncList->pUpdateRefList (pCtx)) { |
| 4137 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx); | ||
| 4138 | // Force coding IDR as followed | ||
| 4139 | ForceCodingIDR (pCtx); | ||
| 4140 | WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!"); | 4134 | WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!"); |
| 4141 | //the above is to set the next frame to be IDR | 4135 | //the above is to set the next frame to be IDR |
| 4142 | pFbi->eFrameType = eFrameType; | 4136 | pCtx->iEncoderError = ENC_RETURN_CORRECTED; |
| 4143 | return ENC_RETURN_CORRECTED; | 4137 | break; |
| 4144 | } | 4138 | } |
| 4145 | } | 4139 | } |
| 4146 | 4140 | ||
| @@ -4293,7 +4287,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 146 unmodified lines | |||
| 4293 | 4287 | ||
| 4294 | if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) { | 4288 | if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) { |
| 4295 | ForceCodingIDR (pCtx); | 4289 | ForceCodingIDR (pCtx); |
| 4296 | WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!"); | 4290 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 4291 | "WelsEncoderEncodeExt(), Logic Error Found in Preprocess updating. ForceCodingIDR!"); | ||
| 4297 | //the above is to set the next frame IDR | 4292 | //the above is to set the next frame IDR |
| 4298 | pFbi->eFrameType = eFrameType; | 4293 | pFbi->eFrameType = eFrameType; |
| 4299 | return ENC_RETURN_CORRECTED; | 4294 | return ENC_RETURN_CORRECTED; |
| @@ -4305,6 +4300,15 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 5 unmodified lines | |||
| 4305 | } | 4300 | } |
| 4306 | } | 4301 | } |
| 4307 | 4302 | ||
| 4303 | if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) { | ||
| 4304 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid); | ||
| 4305 | ForceCodingIDR (pCtx); | ||
| 4306 | WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!"); | ||
| 4307 | //the above is to set the next frame IDR | ||
| 4308 | pFbi->eFrameType = eFrameType; | ||
| 4309 | return ENC_RETURN_CORRECTED; | ||
| 4310 | } | ||
| 4311 | |||
| 4308 | #if defined(MT_DEBUG) | 4312 | #if defined(MT_DEBUG) |
| 4309 | TrackSliceConsumeTime (pCtx, iDidList, iSpatialNum); | 4313 | TrackSliceConsumeTime (pCtx, iDidList, iSpatialNum); |
| 4310 | #endif//MT_DEBUG | 4314 | #endif//MT_DEBUG |