History

Merge pull request #1834 from sijchen/check_param

complete parameter checking related to loop-filter-idc

huili2 committed 11 years ago

Commit 4048b972 parents 3022d4f 94d19762 files · +23 −8Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+12−8
@@ -185,7 +185,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 184 unmodified lines
185 if (pCfg->bEnableSceneChangeDetect == false) {185 if (pCfg->bEnableSceneChangeDetect == false) {
186 pCfg->bEnableSceneChangeDetect = true;186 pCfg->bEnableSceneChangeDetect = true;
187 WelsLog (pLogCtx, WELS_LOG_WARNING,187 WelsLog (pLogCtx, WELS_LOG_WARNING,
188 "ParamValidation(), screen change detection should be turned on,change bEnableSceneChangeDetect as true");188 "ParamValidation(), screen change detection should be turned on, change bEnableSceneChangeDetect as true");
189 }189 }
190 190
191 }191 }
@@ -196,12 +196,22 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 4 unmodified lines
196 SSpatialLayerConfig* fDlp = &pCfg->sSpatialLayers[i];196 SSpatialLayerConfig* fDlp = &pCfg->sSpatialLayers[i];
197 if ((fDlp->iVideoWidth > iFinalWidth) || (fDlp->iVideoHeight > iFinalHeight)) {197 if ((fDlp->iVideoWidth > iFinalWidth) || (fDlp->iVideoHeight > iFinalHeight)) {
198 WelsLog (pLogCtx, WELS_LOG_ERROR,198 WelsLog (pLogCtx, WELS_LOG_ERROR,
199 "ParamValidation,Invalid resolution layer(%d) resolution(%d x %d) shoudl be less than the highest spatial layer resolution(%d x %d) ",199 "ParamValidation,Invalid resolution layer(%d) resolution(%d x %d) should be less than the highest spatial layer resolution(%d x %d) ",
200 i, fDlp->iVideoWidth, fDlp->iVideoHeight, iFinalWidth, iFinalHeight);200 i, fDlp->iVideoWidth, fDlp->iVideoHeight, iFinalWidth, iFinalHeight);
201 return ENC_RETURN_UNSUPPORTED_PARA;201 return ENC_RETURN_UNSUPPORTED_PARA;
202 }202 }
203 }203 }
204 }204 }
205
206 if (!CheckInRangeCloseOpen (pCfg->iLoopFilterDisableIdc, DEBLOCKING_IDC_0, DEBLOCKING_IDC_2 + 1) ||
207 !CheckInRangeCloseOpen (pCfg->iLoopFilterAlphaC0Offset, DEBLOCKING_OFFSET_MINUS, DEBLOCKING_OFFSET + 1) ||
208 !CheckInRangeCloseOpen (pCfg->iLoopFilterBetaOffset, DEBLOCKING_OFFSET_MINUS, DEBLOCKING_OFFSET + 1)) {
209 WelsLog (pLogCtx, WELS_LOG_ERROR,
210 "ParamValidation, Invalid iLoopFilterDisableIdc(%d) or iLoopFilterAlphaC0Offset(%d) or iLoopFilterBetaOffset(%d)!",
211 pCfg->iLoopFilterDisableIdc, pCfg->iLoopFilterAlphaC0Offset, pCfg->iLoopFilterBetaOffset);
212 return ENC_RETURN_UNSUPPORTED_PARA;
213 }
214
205 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {215 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
206 SSpatialLayerInternal* fDlp = &pCfg->sDependencyLayers[i];216 SSpatialLayerInternal* fDlp = &pCfg->sDependencyLayers[i];
207 SSpatialLayerConfig* pConfig = &pCfg->sSpatialLayers[i];217 SSpatialLayerConfig* pConfig = &pCfg->sSpatialLayers[i];
@@ -314,12 +324,6 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 106 unmodified lines
314 pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);324 pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);
315 return ENC_RETURN_UNSUPPORTED_PARA;325 return ENC_RETURN_UNSUPPORTED_PARA;
316 }326 }
317 if (pCodingParam->iLoopFilterDisableIdc < 0 || pCodingParam->iLoopFilterDisableIdc > 6) {
318 WelsLog (pLogCtx, WELS_LOG_ERROR,
319 "ParamValidationExt(), iLoopFilterDisableIdc(%d) must be between 0 and 6",
320 pCodingParam->iLoopFilterDisableIdc);
321 return ENC_RETURN_UNSUPPORTED_PARA;
322 }
323 327
324 //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode328 //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode
325 // (1) Single Thread329 // (1) Single Thread

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