Showing the changes to codec/encoder/core/src/encoder.cpp (1 of 54 files). Show all
Unified · Split
| @@ -240,7 +240,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) { · 239 unmodified lines | ||
| 240 | 240 | ++pEncCtx->iFrameIndex; |
| 241 | 241 | |
| 242 | 242 | if (pEncCtx->iPOC < (1 << pEncCtx->pSps->iLog2MaxPocLsb) - 2) // if iPOC type is no 0, this need be modification |
| 243 | − pEncCtx->iPOC += 2; // for POC type 0 | |
| 243 | + pEncCtx->iPOC += 2; // for POC type 0 | |
| 244 | 244 | else |
| 245 | 245 | pEncCtx->iPOC = 0; |
| 246 | 246 | |
| @@ -248,7 +248,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) { · 1 unmodified line | ||
| 248 | 248 | if (pEncCtx->iFrameNum < (1 << pEncCtx->pSps->uiLog2MaxFrameNum) - 1) |
| 249 | 249 | ++ pEncCtx->iFrameNum; |
| 250 | 250 | else |
| 251 | − pEncCtx->iFrameNum = 0; // if iFrameNum overflow | |
| 251 | + pEncCtx->iFrameNum = 0; // if iFrameNum overflow | |
| 252 | 252 | } |
| 253 | 253 | pEncCtx->eNalType = NAL_UNIT_CODED_SLICE; |
| 254 | 254 | pEncCtx->eSliceType = P_SLICE; |
| @@ -270,7 +270,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) { · 15 unmodified lines | ||
| 270 | 270 | // rc_init_gop |
| 271 | 271 | } else if (keFrameType == videoFrameTypeI) { |
| 272 | 272 | if (pEncCtx->iPOC < (1 << pEncCtx->pSps->iLog2MaxPocLsb) - 2) // if iPOC type is no 0, this need be modification |
| 273 | − pEncCtx->iPOC += 2; // for POC type 0 | |
| 273 | + pEncCtx->iPOC += 2; // for POC type 0 | |
| 274 | 274 | else |
| 275 | 275 | pEncCtx->iPOC = 0; |
| 276 | 276 | |
| @@ -278,7 +278,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) { · 1 unmodified line | ||
| 278 | 278 | if (pEncCtx->iFrameNum < (1 << pEncCtx->pSps->uiLog2MaxFrameNum) - 1) |
| 279 | 279 | ++ pEncCtx->iFrameNum; |
| 280 | 280 | else |
| 281 | − pEncCtx->iFrameNum = 0; // if iFrameNum overflow | |
| 281 | + pEncCtx->iFrameNum = 0; // if iFrameNum overflow | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | pEncCtx->eNalType = NAL_UNIT_CODED_SLICE; |
| @@ -296,7 +296,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) { · 11 unmodified lines | ||
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum) { |
| 299 | − SWelsSvcCodingParam* pSvcParam = pEncCtx->pSvcParam; | |
| 299 | + SWelsSvcCodingParam* pSvcParam = pEncCtx->pSvcParam; | |
| 300 | 300 | EVideoFrameType iFrameType = videoFrameTypeInvalid; |
| 301 | 301 | bool bSceneChangeFlag = false; |
| 302 | 302 | |
| @@ -370,7 +370,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 67 unmodified lines | ||
| 370 | 370 | extern "C" void DumpDependencyRec (SPicture* pCurPicture, const char* kpFileName, const int8_t kiDid, bool bAppend, |
| 371 | 371 | SDqLayer* pDqLayer) { |
| 372 | 372 | WelsFileHandle* pDumpRecFile = NULL; |
| 373 | − int32_t iWrittenSize = 0; | |
| 373 | + int32_t iWrittenSize = 0; | |
| 374 | 374 | const char* openMode = bAppend ? "ab" : "wb"; |
| 375 | 375 | SWelsSPS* pSpsTmp = (kiDid > BASE_DEPENDENCY_ID) ? & (pDqLayer->sLayerInfo.pSubsetSpsP->pSps) : |
| 376 | 376 | pDqLayer->sLayerInfo.pSpsP; |
| @@ -384,8 +384,8 @@ extern "C" void DumpDependencyRec (SPicture* pCurPicture, const char* kpFileName · 7 unmodified lines | ||
| 384 | 384 | pDumpRecFile = WelsFopen (kpFileName, openMode); |
| 385 | 385 | else { |
| 386 | 386 | char sDependencyRecFileName[16] = {0}; |
| 387 | − WelsSnprintf (sDependencyRecFileName, 16, "rec%d.yuv", kiDid); // confirmed_safe_unsafe_usage | |
| 388 | − pDumpRecFile = WelsFopen (sDependencyRecFileName, openMode); | |
| 387 | + WelsSnprintf (sDependencyRecFileName, 16, "rec%d.yuv", kiDid); // confirmed_safe_unsafe_usage | |
| 388 | + pDumpRecFile = WelsFopen (sDependencyRecFileName, openMode); | |
| 389 | 389 | } |
| 390 | 390 | if (NULL != pDumpRecFile && bAppend) |
| 391 | 391 | WelsFseek (pDumpRecFile, 0, SEEK_END); |
| @@ -437,22 +437,22 @@ extern "C" void DumpDependencyRec (SPicture* pCurPicture, const char* kpFileName · 45 unmodified lines | ||
| 437 | 437 | |
| 438 | 438 | void DumpRecFrame (SPicture* pCurPicture, const char* kpFileName, const int8_t kiDid, bool bAppend, |
| 439 | 439 | SDqLayer* pDqLayer) { |
| 440 | − WelsFileHandle* pDumpRecFile = NULL; | |
| 440 | + WelsFileHandle* pDumpRecFile = NULL; | |
| 441 | 441 | SWelsSPS* pSpsTmp = (kiDid > BASE_DEPENDENCY_ID) ? & (pDqLayer->sLayerInfo.pSubsetSpsP->pSps) : |
| 442 | 442 | pDqLayer->sLayerInfo.pSpsP; |
| 443 | 443 | bool bFrameCroppingFlag = pSpsTmp->bFrameCroppingFlag; |
| 444 | 444 | SCropOffset* pFrameCrop = &pSpsTmp->sFrameCrop; |
| 445 | 445 | |
| 446 | − int32_t iWrittenSize = 0; | |
| 446 | + int32_t iWrittenSize = 0; | |
| 447 | 447 | const char* openMode = bAppend ? "ab" : "wb"; |
| 448 | 448 | |
| 449 | 449 | if (NULL == pCurPicture || NULL == kpFileName) |
| 450 | 450 | return; |
| 451 | 451 | |
| 452 | − if (strlen (kpFileName) > 0) { // confirmed_safe_unsafe_usage | |
| 453 | − pDumpRecFile = WelsFopen (kpFileName, openMode); | |
| 452 | + if (strlen (kpFileName) > 0) { // confirmed_safe_unsafe_usage | |
| 453 | + pDumpRecFile = WelsFopen (kpFileName, openMode); | |
| 454 | 454 | } else { |
| 455 | − pDumpRecFile = WelsFopen ("rec.yuv", openMode); | |
| 455 | + pDumpRecFile = WelsFopen ("rec.yuv", openMode); | |
| 456 | 456 | } |
| 457 | 457 | if (NULL != pDumpRecFile && bAppend) |
| 458 | 458 | WelsFseek (pDumpRecFile, 0, SEEK_END); |