execuse me,everyone!I have a question when i use DM8168 scalar.The question is described as follows:
1、My environment is DM8168 and dvrrdk4.0.0.3
2、My links are connected as follows:
|-->DEI-->|
| |
|-->DEI-->|
CAP-->select-->| |-->merge-->ipcoutVpss-->ipcInVideo-->ENC-->ipcBitsOutRtos-->ipcBitsInHost-->ES
|-->DEI-->|
| |
|-->DEI-->|
after we reveive the ES stream ,we packet it as TS stream.
3、In DEI module,we have used the scalar function.The params of dei is setted as follows:
static void set_dei_prm(DeiLink_CreateParams *deiPrm, Int32 outQueId, Bool bypass, Bool byScEnable)
{
Int32 chId;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_DEI_SC] = FALSE;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_VIP_SC] = FALSE;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT] = FALSE;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_DEI_SC_SECONDARY_OUT] = FALSE;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_DEI_SC_TERTIARY_OUT] = FALSE;
deiPrm[0].enableOut[DEI_LINK_OUT_QUE_VIP_SC] = TRUE;
deiPrm[0].tilerEnable[DEI_LINK_OUT_QUE_VIP_SC] = FALSE;
deiPrm[0].comprEnable = FALSE;
deiPrm[0].setVipScYuv422Format = FALSE;
deiPrm[0].enableDeiForceBypass = bypass;
deiPrm[0].enableLineSkipSc = FALSE;
deiPrm[0].enableForceInterlacedInput = FALSE;
deiPrm[0].inputDeiFrameRate = 50;
deiPrm[0].outputDeiFrameRate = 50;
if(bypass)
{
//progress drop by select
deiPrm[0].inputFrameRate [DEI_LINK_OUT_QUE_VIP_SC] = 25;
deiPrm[0].outputFrameRate[DEI_LINK_OUT_QUE_VIP_SC] = 25;
}
else
{
deiPrm[0].inputFrameRate [DEI_LINK_OUT_QUE_VIP_SC] = 50;
deiPrm[0].outputFrameRate[DEI_LINK_OUT_QUE_VIP_SC] = 25;
}
/* Set Output Scaling at DEI based on ratio */
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].scaleMode = DEI_SCALE_MODE_RATIO;
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.heightRatio.numerator = 1;
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.heightRatio.denominator = 1;
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.widthRatio.numerator = 1;
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0].ratio.widthRatio.denominator = 1;
deiPrm[0].outScaleEnable[DEI_LINK_OUT_QUE_VIP_SC] = byScEnable;
for (chId=1; chId < DEI_LINK_MAX_CH; chId++)
deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][chId] = deiPrm[0].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC][0];
//modify end
}
From this function,we can know we use the DEI_LINK_OUT_QUE_VIP_SC.
4、Then we dynamic set the dei scalar output resolution as this:
status = System_linkControl(
gVcapModuleContext.deiId[deiId],
DEI_LINK_CMD_GET_OUTPUTRESOLUTION,
&(params),
sizeof(params),
TRUE
);
params.width = SystemUtils_align(psCapChnDynaParam->chDynamicRes.width, 16);
params.height = SystemUtils_align(psCapChnDynaParam->chDynamicRes.height, 1);
status = System_linkControl(
gVcapModuleContext.deiId[deiId],
DEI_LINK_CMD_SET_OUTPUTRESOLUTION,
&(params),
sizeof(params),
TRUE
);
5、Then we open the lazy loading mode in function DeiLink_drvSetScCoeffs :
Vps_ScLazyLoadingParams lazyLoadingParams;
lazyLoadingParams.enableLazyLoading = TRUE;
lazyLoadingParams.enableFilterSelect = TRUE;
lazyLoadingParams.scalarId = VPS_M2M_DEI_SCALAR_ID_VIP_SC;
retVal = FVID2_control(pObj->fvidHandle,
IOCTL_VPS_SC_SET_LAZY_LOADING,
&lazyLoadingParams,
NULL);
UTILS_assert(FVID2_SOK == retVal);
now the question is :
when we has not open the lazy loading mode,the result of the scalar is very good .But the quality of the video is not very good.
When we open the lazy loading mode,the source video resolution 1920x1080I@60. When we set the dei scalar output resolution is 961x540,the scalar result is good,and the quality of the picture is better .
But when the dei scalar output resolution is smaller or equal than 1/2 of the source resolution such as 960x540/959x540/940x530 ,the scalar result is not good. We found the scalar cut half of the source video,and then shrink the video.
When the dei salar output resolution is smaller than 1/4 of the source resolution such as 479x269,we can found the scalar cut 1/4 of the source video and then shrink the video.
And then we have test many operation,we found:
1, if the source video resolution is W*H,and then we set the output resolution as (W/2)*H first time,the scalar result is good,but when we set the output resolution as (W/2)*H again,the scalar result is not good,the scalar cut half of the source video,and then shrink the video.
2,if we first set the output resolution as (W/2-X)*H,the scalar result is not good.Then we set the output resolution as (W/2)*H ,the result is good.
I want to know why? We just want to shrink the whole video picture,but not the 1/2 or 1/4 of the video picture.
If you have good ideas ,please tell me! Thank you very much.