| 401 | |
| 402 | |
| 403 | int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingParam) { |
| 404 | int8_t i = 0; |
| 405 | int32_t iIdx = 0; |
| 406 | |
| 407 | assert (pCodingParam != NULL); |
| 408 | if (NULL == pCodingParam) |
| 409 | return ENC_RETURN_INVALIDINPUT; |
| 410 | |
| 411 | if ((pCodingParam->iUsageType != CAMERA_VIDEO_REAL_TIME) && (pCodingParam->iUsageType != SCREEN_CONTENT_REAL_TIME)) { |
| 412 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(),Invalid usage type = %d", pCodingParam->iUsageType); |
| 413 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 414 | } |
| 415 | if ((pCodingParam->iUsageType == SCREEN_CONTENT_REAL_TIME) && (!pCodingParam->bIsLosslessLink |
| 416 | && pCodingParam->bEnableLongTermReference)) { |
| 417 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 418 | "ParamValidationExt(), setting lossy link for LTR under screen, which is not supported yet! Auto disabled LTR!"); |
| 419 | pCodingParam->bEnableLongTermReference = false; |
| 420 | } |
| 421 | if (pCodingParam->iSpatialLayerNum < 1 || pCodingParam->iSpatialLayerNum > MAX_DEPENDENCY_LAYER) { |
| 422 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iSpatialLayerNum: %d!", |
| 423 | pCodingParam->iSpatialLayerNum); |
| 424 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 425 | } |
| 426 | |
| 427 | if (pCodingParam->iTemporalLayerNum < 1 || pCodingParam->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { |
| 428 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iTemporalLayerNum: %d!", |
| 429 | pCodingParam->iTemporalLayerNum); |
| 430 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 431 | } |
| 432 | |
| 433 | if (pCodingParam->uiGopSize < 1 || pCodingParam->uiGopSize > MAX_GOP_SIZE) { |
| 434 | WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->uiGopSize: %d!", |
| 435 | pCodingParam->uiGopSize); |
| 436 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 437 | } |
| 438 | |
| 439 | |
| 440 | if (pCodingParam->uiIntraPeriod && pCodingParam->uiIntraPeriod < pCodingParam->uiGopSize) { |
| 441 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 442 | "ParamValidationExt(), uiIntraPeriod(%d) should be not less than that of uiGopSize(%d) or -1 specified!", |
| 443 | pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize); |
| 444 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 445 | } |
| 446 | |
| 447 | if (pCodingParam->uiIntraPeriod && (pCodingParam->uiIntraPeriod & (pCodingParam->uiGopSize - 1)) != 0) { |
| 448 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 449 | "ParamValidationExt(), uiIntraPeriod(%d) should be multiple of uiGopSize(%d) or -1 specified!", |
| 450 | pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize); |
| 451 | return ENC_RETURN_UNSUPPORTED_PARA; |
| 452 | } |
| 453 | |
| 454 | //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode |
| 455 | // (1) Single Thread |
| 456 | // if (THREAD==1)//single thread |
| 457 | // no parallel_deblocking: bDeblockingParallelFlag = 0; |
| 458 | // (2) Multi Thread: see uiSliceMode decision |
| 459 | if (pCodingParam->iMultipleThreadIdc == 1) { |
| 460 | //now is single thread. no parallel deblocking, set flag=0 |
no test coverage detected