Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -488,13 +488,24 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 487 unmodified lines | ||
| 488 | 488 | |
| 489 | 489 | for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) { |
| 490 | 490 | SSpatialLayerConfig* pSpatialLayer = &pCodingParam->sSpatialLayers[i]; |
| 491 | − const int32_t kiPicWidth = pSpatialLayer->iVideoWidth; | |
| 492 | − const int32_t kiPicHeight = pSpatialLayer->iVideoHeight; | |
| 491 | + int32_t kiPicWidth = pSpatialLayer->iVideoWidth; | |
| 492 | + int32_t kiPicHeight = pSpatialLayer->iVideoHeight; | |
| 493 | 493 | uint32_t iMbWidth = 0; |
| 494 | 494 | uint32_t iMbHeight = 0; |
| 495 | 495 | int32_t iMbNumInFrame = 0; |
| 496 | 496 | uint32_t iMaxSliceNum = MAX_SLICES_NUM; |
| 497 | 497 | int32_t iReturn = 0; |
| 498 | + | |
| 499 | + if ((pCodingParam->iPicWidth > 0) && (pCodingParam->iPicHeight > 0) | |
| 500 | + && (kiPicWidth == 0) && (kiPicHeight == 0) | |
| 501 | + && (pCodingParam->iSpatialLayerNum == 1)) { | |
| 502 | + kiPicWidth = pSpatialLayer->iVideoWidth = pCodingParam->iPicWidth; | |
| 503 | + kiPicHeight = pSpatialLayer->iVideoHeight = pCodingParam->iPicHeight; | |
| 504 | + WelsLog (pLogCtx, WELS_LOG_DEBUG, | |
| 505 | + "ParamValidationExt(), layer resolution is not set, set to general resolution %d x %d", | |
| 506 | + pSpatialLayer->iVideoWidth, pSpatialLayer->iVideoHeight); | |
| 507 | + } | |
| 508 | + | |
| 498 | 509 | if ((kiPicWidth <= 0) || (kiPicHeight <= 0) || (kiPicWidth * kiPicHeight > (MAX_MBS_PER_FRAME << 8))) { |
| 499 | 510 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| 500 | 511 | "ParamValidationExt(), width > 0, height > 0, width * height <= %d, invalid %d x %d in dependency layer settings!", |
| @@ -641,8 +652,8 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 140 unmodified lines | ||
| 641 | 652 | WelsLog (pLogCtx, WELS_LOG_WARNING, "layerId(%d) Profile is baseline, Change CABAC to CAVLC", i); |
| 642 | 653 | } |
| 643 | 654 | } else if (pLayerInfo->uiProfileIdc == PRO_UNKNOWN) { |
| 644 | − if ((i==0) || pCodingParam->bSimulcastAVC) { | |
| 645 | − pLayerInfo->uiProfileIdc = (pCodingParam->iEntropyCodingModeFlag)?PRO_HIGH:PRO_BASELINE; | |
| 655 | + if ((i == 0) || pCodingParam->bSimulcastAVC) { | |
| 656 | + pLayerInfo->uiProfileIdc = (pCodingParam->iEntropyCodingModeFlag) ? PRO_HIGH : PRO_BASELINE; | |
| 646 | 657 | } else { |
| 647 | 658 | pLayerInfo->uiProfileIdc = PRO_SCALABLE_BASELINE; |
| 648 | 659 | } |