History

add a param adjustment

sijchen@cisco.com committed 8 years ago

Commit 1d91f021 parent bbfc8401 file · +15 −4Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+15−4
@@ -488,13 +488,24 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 487 unmodified lines
488488
489489 for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) {
490490 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;
493493 uint32_t iMbWidth = 0;
494494 uint32_t iMbHeight = 0;
495495 int32_t iMbNumInFrame = 0;
496496 uint32_t iMaxSliceNum = MAX_SLICES_NUM;
497497 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+
498509 if ((kiPicWidth <= 0) || (kiPicHeight <= 0) || (kiPicWidth * kiPicHeight > (MAX_MBS_PER_FRAME << 8))) {
499510 WelsLog (pLogCtx, WELS_LOG_ERROR,
500511 "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
641652 WelsLog (pLogCtx, WELS_LOG_WARNING, "layerId(%d) Profile is baseline, Change CABAC to CAVLC", i);
642653 }
643654 } 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;
646657 } else {
647658 pLayerInfo->uiProfileIdc = PRO_SCALABLE_BASELINE;
648659 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t