ref: cbe7891300b4730b34793128631ef9d9e9c414b9
parent: 5762cbb8fc352e3a7dabd9c486953d21cf76c5c1
author: Sijia Chen <[email protected]>
date: Tue Oct 21 12:00:46 EDT 2014
add clip in ParamTranscode for input para checking
--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -399,8 +399,11 @@
#ifdef ENABLE_FRAME_DUMP
pDlp->sRecFileName[0] = '\0'; // file to be constructed
#endif//ENABLE_FRAME_DUMP
- pSpatialLayer->iVideoWidth = pCodingParam.sSpatialLayers[iIdxSpatial].iVideoWidth; // frame width
- pSpatialLayer->iVideoHeight = pCodingParam.sSpatialLayers[iIdxSpatial].iVideoHeight;// frame height
+ pSpatialLayer->iVideoWidth = WELS_CLIP3 (pCodingParam.sSpatialLayers[iIdxSpatial].iVideoWidth, MB_WIDTH_LUMA,
+ iPicWidth); // frame width
+ pSpatialLayer->iVideoHeight = WELS_CLIP3 (pCodingParam.sSpatialLayers[iIdxSpatial].iVideoHeight, MB_HEIGHT_LUMA,
+ iPicHeight);// frame height
+
pSpatialLayer->iSpatialBitrate =
pCodingParam.sSpatialLayers[iIdxSpatial].iSpatialBitrate; // target bitrate for current spatial layer
pSpatialLayer->iMaxSpatialBitrate =
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -207,6 +207,7 @@
if (sConfig.ParamBaseTranscode (*argv)) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
"CWelsH264SVCEncoder::Initialize(), parameter_translation failed.");
+ TraceParamInfo (&sConfig);
Uninitialize();
return cmInitParaError;
}
@@ -230,6 +231,7 @@
if (sConfig.ParamTranscode (*argv)) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
"CWelsH264SVCEncoder::InitializeExt(), parameter_translation failed.");
+ TraceParamInfo (&sConfig);
Uninitialize();
return cmInitParaError;
}