Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123869

Forum Post: RE: question about scalar framerate

$
0
0

If I just invoke  System_linkControl(encId, ENC_LINK_CMD_SET_CODEC_FPS, &encTargetFps, sizeof(encTargetFps)

I can change the targetFrameRate,

Enter Choice: [m3video] 
[m3video] *** ENCODE Statistics *** 
[m3video] 
[m3video] Elasped Time : 12 secs
[m3video] 
[m3video] 
[m3video] CH | In Recv In Skip In User Out Latency 
[m3video] Num | FPS FPS Skip FPS FPS Min / Max
[m3video] --------------------------------------------
[m3video] 0 | 63 0 31 31 255 / 61916
[m3video]

But when I invoke  System_linkControl(encId, ENC_LINK_CMD_SET_CODEC_INPUT_FPS, &encFps, sizeof(encFps), TRUE);

I can not change the input framerate.

And I invoke System_linkControl(sclrId, SCLR_LINK_CMD_SET_FRAME_RATE, &params, sizeof(params), TRUE);

I also can not change the input and output framerate with sclr link

the following is my demo code:

srcPrm.outQueParams.nextLink = sclrId;
if (isProgressive)
{
srcPrm.timerPeriod = 16;
}
else 
{
srcPrm.timerPeriod = 15;
}
srcPrm.inputInfo.numCh = SRC_NUM_CH;
for(i = 0; i < srcPrm.inputInfo.numCh; i++)
{
System_LinkChInfo *pChInfo;

pChInfo = &srcPrm.inputInfo.chInfo[i];

pChInfo->dataFormat = SYSTEM_DF_YUV420SP_UV;
pChInfo->memType = SYSTEM_MT_TILEDMEM;
pChInfo->width = 1920;
if (isProgressive)
{
pChInfo->height = 1080;
pChInfo->scanFormat = SYSTEM_SF_PROGRESSIVE;
}
else
{
pChInfo->height = 480/2;
pChInfo->scanFormat = SYSTEM_SF_INTERLACED;
}
pChInfo->pitch[0] = SystemUtils_align(pChInfo->width+pChInfo->startX,
SYSTEM_BUFFER_ALIGNMENT);
pChInfo->pitch[1] = pChInfo->pitch[0];
pChInfo->pitch[2] = 0;
}

SclrLink_CreateParams_Init(&sclrPrm);
sclrPrm.inQueParams.prevLinkId = srcId;
sclrPrm.inQueParams.prevLinkQueId = 0;
sclrPrm.outQueParams.nextLink = nsfId;
sclrPrm.tilerEnable = FALSE;
sclrPrm.enableLineSkipSc = FALSE;
sclrPrm.inputFrameRate = 60;
sclrPrm.outputFrameRate = 60;

sclrPrm.scaleMode = SCLR_SCALE_MODE_ABSOLUTE;

sclrPrm.outScaleFactor.absoluteResolution.outWidth = 1920;
sclrPrm.outScaleFactor.absoluteResolution.outHeight = 1080;

NsfLink_CreateParams_Init(&nsfPrm);
nsfPrm.bypassNsf = TRUE;
nsfPrm.tilerEnable = FALSE;
nsfPrm.inQueParams.prevLinkId = sclrId;
nsfPrm.inQueParams.prevLinkQueId = 0;
nsfPrm.numOutQue = 1;
nsfPrm.numBufsPerCh = 0;
nsfPrm.inputFrameRate = 60;
nsfPrm.outputFrameRate = 60;
nsfPrm.outQueParams[0].nextLink = ipcOutVpssId;

ipcOutVpssPrm.inQueParams.prevLinkId = nsfId;
ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
ipcOutVpssPrm.numOutQue = 1;
ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;
ipcOutVpssPrm.notifyNextLink = TRUE;
ipcOutVpssPrm.notifyPrevLink = TRUE;
ipcOutVpssPrm.noNotifyMode = FALSE;

ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;
ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
ipcInVideoPrm.numOutQue = 1;
ipcInVideoPrm.outQueParams[0].nextLink = encId;
ipcInVideoPrm.notifyNextLink = TRUE;
ipcInVideoPrm.notifyPrevLink = TRUE;
ipcInVideoPrm.noNotifyMode = FALSE;

 for (i = 0; i < SRC_NUM_CH; i++)
 {
 encPrm.chCreateParams[i].format = IVIDEO_H264HP;
 encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;
 encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;
 if (isProgressive)
 encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE;
 else
 encPrm.chCreateParams[i].fieldMergeEncodeEnable = TRUE;
 encPrm.chCreateParams[i].maxBitRate = -1;
 encPrm.chCreateParams[i].encodingPreset = XDM_USER_DEFINED;//3;
 encPrm.chCreateParams[i].rateControlPreset = 0;
 encPrm.chCreateParams[i].enableHighSpeed = 0;
 encPrm.chCreateParams[i].enableAnalyticinfo = 0;
 encPrm.chCreateParams[i].enableWaterMarking = 0;
 encPrm.chCreateParams[i].rateControlPreset = IVIDEO_STORAGE;
 
 encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = 60;
 encPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate = 60;
 encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = (2 * 1000 * 1000);
 encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 60;
 encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;
 encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
 encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = 0 ;
 encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10;
 encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 40;
 encPrm.chCreateParams[i].defaultDynamicParams.qpInit = -1;
 encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8;
 encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0;
 }

encPrm.inQueParams.prevLinkId = ipcInVideoId;
encPrm.inQueParams.prevLinkQueId = 0;
encPrm.outQueParams.nextLink = ipcBitsOutVideoId;
encPrm.numBufPerCh[0] = 6;
encPrm.numBufPerCh[1] = 6;
encPrm.numBufPerCh[2] = 6;
encPrm.numBufPerCh[3] = 6;

ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = encId;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = ipcBitsInHostId;
Chains_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm, TRUE);

ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcBitsOutVideoId;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;                                                               ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;                Chains_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm);



Viewing all articles
Browse latest Browse all 123869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>