Showing the changes to codec/encoder/core/src/encoder.cpp (1 of 3 files). Show all
Unified · Split
| @@ -213,11 +213,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EFrameType keFrameType) { · 212 unmodified lines | ||
| 213 | 213 | InitBits (&pEncCtx->pOut->sBsWrite, pEncCtx->pOut->pBsBuffer, pEncCtx->pOut->uiSize); |
| 214 | 214 | |
| 215 | 215 | if (keFrameType == WELS_FRAME_TYPE_P) { |
| 216 | − if (pEncCtx->pSvcParam->uiIntraPeriod) { | |
| 217 | − ++pEncCtx->iFrameIndex; | |
| 218 | − } | |
| 219 | − | |
| 220 | − ++pEncCtx->uiFrameIdxRc; | |
| 216 | + ++pEncCtx->iFrameIndex; | |
| 221 | 217 | |
| 222 | 218 | if (pEncCtx->iPOC < (1 << pEncCtx->pSps->iLog2MaxPocLsb) - 2) // if iPOC type is no 0, this need be modification |
| 223 | 219 | pEncCtx->iPOC += 2; // for POC type 0 |
| @@ -237,10 +233,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EFrameType keFrameType) { · 13 unmodified lines | ||
| 237 | 233 | pEncCtx->iFrameNum = 0; |
| 238 | 234 | pEncCtx->iPOC = 0; |
| 239 | 235 | pEncCtx->bEncCurFrmAsIdrFlag = false; |
| 240 | − if (pEncCtx->pSvcParam->uiIntraPeriod) { | |
| 241 | − pEncCtx->iFrameIndex = 0; | |
| 242 | − } | |
| 243 | − pEncCtx->uiFrameIdxRc = 0; | |
| 236 | + pEncCtx->iFrameIndex = 0; | |
| 244 | 237 | |
| 245 | 238 | pEncCtx->eNalType = NAL_UNIT_CODED_SLICE_IDR; |
| 246 | 239 | pEncCtx->eSliceType = I_SLICE; |
| @@ -286,7 +279,7 @@ EFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum) { · 39 unmodified lines | ||
| 286 | 279 | // perform scene change detection |
| 287 | 280 | if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag || |
| 288 | 281 | (kiSpatialNum < pSvcParam->iSpatialLayerNum) |
| 289 | − || (pEncCtx->uiFrameIdxRc < (VGOP_SIZE << 1))) { // avoid too frequent I frame coding, rc control | |
| 282 | + || (pEncCtx->iFrameIndex < (VGOP_SIZE << 1))) { // avoid too frequent I frame coding, rc control | |
| 290 | 283 | bSceneChangeFlag = false; |
| 291 | 284 | } else { |
| 292 | 285 | bSceneChangeFlag = pEncCtx->pVaa->bSceneChangeFlag; |