TI中文支持网
TI专业的中文技术问题搜集分享网站

DM385 可以做到同時 enc (fps:60) 和 display (fps:60)?

Dear all,

   我想要做一個同時 enc (fps:60) 和 display (fps:60), 使用ipnc_rdk3.8

我的範例:

                               |——–swms[0]—display

capture – > dup –|

                               |——-swms[3]—-nsf —- enc

我看到的情況是若只有單獨 enc 或display 時, 可以有60 fps.

當同時跑enc和display , enc就沒有 60 fps,  display 哪一路也沒有.

是dm385效能?還是….

我的程序碼如下:

Void allLinksSet (void)
{
cameraId = SYSTEM_LINK_ID_CAMERA;

swMsId [0] = SYSTEM_LINK_ID_SW_MS_MULTI_INST_0;
swMsPrm[0].numSwMsInst = 1;
swMsPrm[0].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_SC5;
swMsId [3] = SYSTEM_LINK_ID_SW_MS_MULTI_INST_3;
swMsPrm[3].numSwMsInst = 1;
swMsPrm[3].swMsInstId[0] = SYSTEM_SW_MS_SC_INST_DEIHQ_SC;

nsfId[0] = SYSTEM_LINK_ID_NSF_0;
ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
encId = SYSTEM_LINK_ID_VENC_0;
ipcBitsOutVideoId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
ipcBitsInHostId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;
dupId[0] = SYSTEM_VPSS_LINK_ID_DUP_0; displayId[0] = SYSTEM_LINK_ID_DISPLAY_0; // HDMI

CHAINS_INIT_STRUCT(CameraLink_CreateParams, cameraPrm);
CHAINS_INIT_STRUCT(NsfLink_CreateParams, nsfPrm[0]);
CHAINS_INIT_STRUCT(SwMsLink_CreateParams, swMsPrm[0]);
CHAINS_INIT_STRUCT(SwMsLink_CreateParams, swMsPrm[3]);
CHAINS_INIT_STRUCT(IpcLink_CreateParams, ipcOutVpssPrm);
CHAINS_INIT_STRUCT(IpcLink_CreateParams, ipcInVideoPrm);
CHAINS_INIT_STRUCT(EncLink_CreateParams, encPrm);
CHAINS_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams, ipcBitsOutVideoPrm);
CHAINS_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams, ipcBitsInHostPrm);
CHAINS_INIT_STRUCT(DisplayLink_CreateParams, displayPrm[0]);

Chains_ipcFramesInit();

// IVA map table
System_linkControl(
SYSTEM_LINK_ID_M3VIDEO,
SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
&systemVid_encDecIvaChMapTbl,
sizeof(SystemVideo_Ivahd2ChMap_Tbl),
TRUE
);

cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
cameraPrm.numAudioChannels = 0;
cameraPrm.numVipInst = 1;
cameraPrm.outQueParams[0].nextLink = dupId[0];
cameraPrm.tilerEnable = FALSE;
cameraPrm.vsEnable = 0;
pCameraInstPrm = &cameraPrm.vipInst[0];
pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
pCameraInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_CAM_IMX140_DRV;
pCameraInstPrm->inDataFormat = SYSTEM_DF_BAYER_RAW;
pCameraInstPrm->sensorOutWidth = 1920;
pCameraInstPrm->sensorOutHeight = 1080;
pCameraInstPrm->standard = SYSTEM_STD_1080P_60;
pCameraInstPrm->numOutput = 1;
pCameraOutPrm = &pCameraInstPrm->outParams[0];
pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV;
pCameraOutPrm->scEnable = FALSE;
pCameraOutPrm->scOutWidth = 1920;
pCameraOutPrm->scOutHeight = 1080;
pCameraOutPrm->outQueId = 0;
// 2A config
cameraPrm.t2aConfig.n2A_vendor = UI_AEWB_ID_AVER;//UI_AEWB_ID_NONE;
cameraPrm.t2aConfig.n2A_mode = UI_AEWB_AEWB;//UI_AEWB_OFF;

dupPrm[0].inQueParams.prevLinkId = cameraId;
dupPrm[0].inQueParams.prevLinkQueId = 0;
dupPrm[0].numOutQue = 2;//4;
dupPrm[0].outQueParams[0].nextLink = swMsId[0];
dupPrm[0].outQueParams[1].nextLink = swMsId[3];
dupPrm[0].notifyNextLink = TRUE;

swMsPrm[0].inQueParams.prevLinkId = dupId[0];
swMsPrm[0].inQueParams.prevLinkQueId = 0;
swMsPrm[0].outQueParams.nextLink = nsfId[0];//mergeId[3];
swMsPrm[0].maxInputQueLen = SYSTEM_SW_MS_DEFAULT_INPUT_QUE_LEN;
swMsPrm[0].maxOutRes = VSYS_STD_1080P_60;
swMsPrm[0].lineSkipMode = FALSE;
swMsPrm[0].layoutPrm.outputFPS = 30;
swMsPrm[0].numOutBuf = 6;
Chains_swMsGenerateLayoutParams(0, 2, &swMsPrm[0]);

swMsPrm[3].inQueParams.prevLinkId = dupId[0];
swMsPrm[3].inQueParams.prevLinkQueId = 1;
swMsPrm[3].outQueParams.nextLink = displayId[0];
swMsPrm[3].maxInputQueLen = SYSTEM_SW_MS_DEFAULT_INPUT_QUE_LEN + 6;
swMsPrm[3].maxOutRes = VSYS_STD_1080P_60;
swMsPrm[3].lineSkipMode = FALSE;
swMsPrm[3].layoutPrm.outputFPS = 60;
swMsPrm[3].numOutBuf = 6;
Chains_swMsGenerateLayoutParams(0, 7, &swMsPrm[3]);

nsfPrm[0].bypassNsf = TRUE;
nsfPrm[0].tilerEnable = FALSE;
nsfPrm[0].inQueParams.prevLinkId = swMsId[0];//mergeId[3];
nsfPrm[0].inQueParams.prevLinkQueId = 0;
nsfPrm[0].numOutQue = 1;
nsfPrm[0].outQueParams[0].nextLink = ipcOutVpssId;
nsfPrm[0].numBufsPerCh = 6;

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

/*InM3*/
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;

int i;
for (i = 0; i < ENC_CH – 1; i++)
{
switch (EncVdoType[i])
{
default:
case VDO_H264:
{
encPrm.chCreateParams[i].format = IVIDEO_H264BP;
encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;//IH264_BASELINE_PROFILE;
encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;
encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE;
encPrm.chCreateParams[i].maxBitRate = 10 * 1000 * 1000;//-1;
encPrm.chCreateParams[i].encodingPreset = 3;
encPrm.chCreateParams[i].enableHighSpeed = 0;
encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 30;
encPrm.chCreateParams[i].enableAnalyticinfo = 0;
encPrm.chCreateParams[i].enableWaterMarking = 0;
encPrm.chCreateParams[i].rateControlPreset = IVIDEO_LOW_DELAY;
encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = 30;
encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = (4 * 1000 * 1000); //(0.9 * 1000 * 1000);
encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;
encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = 1;//IH264_RATECONTROL_DEFAULT ;
encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10;//5;
encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 42;//30;
encPrm.chCreateParams[i].defaultDynamicParams.qpInit = -1;
encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8;
encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0;
break;
} }
}

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

ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = encId;
ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = ipcBitsInHostId;
ipcBitsOutVideoPrm.baseCreateParams.noNotifyMode = FALSE;
ipcBitsOutVideoPrm.baseCreateParams.notifyNextLink = TRUE;
ipcBitsOutVideoPrm.baseCreateParams.notifyPrevLink = FALSE;

ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcBitsOutVideoId;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsInHostPrm.baseCreateParams.noNotifyMode = FALSE;
ipcBitsInHostPrm.baseCreateParams.notifyNextLink = FALSE;
ipcBitsInHostPrm.baseCreateParams.notifyPrevLink = TRUE;
Chains_ipcBitsInSetCbInfo(&ipcBitsInHostPrm);

for (i = 0; i < SYSTEM_DC_MAX_VENC; i++)
displayRes[i] = VSYS_STD_1080P_60;

Chains_displayCtrlInit(displayRes);

displayPrm[0].inQueParams[0].prevLinkId = swMsId[3];
displayPrm[0].inQueParams[0].prevLinkQueId = 0;
displayPrm[0].displayRes = swMsPrm[3].maxOutRes;
}

Eason Wang:

你用的是哪个速度等级的芯片?

目前能做到的帧率是多少?

chen zihsian:

回复 Eason Wang:

dear Eason Wang,

Turbo(AAR1x) (1.35 V) A8( 970 ), HDVICP2(410),  HDVPSS (240), iss (480),  L3/L4 (240), DDR (533). 

目前 1080p  display 60fps, enc 30fps 沒問題

Chris Meng:

回复 chen zihsian:

你好,

为什么要增加SWMS link?编码前的数据就可以直接送给HDMI显示,请参考full feature的use case。

chen zihsian:

回复 Chris Meng:

dear Chris Meng ,

 我用兩個SWMS的目的是ENC端的SWMS可以動態切換RESULOTION跟FPS

Chris Meng:

回复 chen zihsian:

你好,

建议用两个RSZ的输出来完成切换分辨率功能,帧率可以通过软件丢帧来实现。

两个SWMS增加了两个1080p60的读和写,对系统影响是比较大的。

chen zihsian:

回复 Chris Meng:

你好:

                                                 —————-display

 Camara – > swms —dup–|

                                                 —————–enc

架構是改接這樣? 假設res 1080p 跟 fps:60

Chris Meng:

回复 chen zihsian:

你好,

去掉SWMS。ISP的rsz输出是可以修改大小的。

chen zihsian:

回复 Chris Meng:

你好

因為我的 Sensor captureMode= CAMERA_LINK_CAPMODE_ISIF

不是cameraPrm.captureMode = CAMERA_LINK_CAPMODE_DDR 所以我的沒有接isp link ,對isp link不了解

這兩者的差別是?

Chris Meng:

回复 chen zihsian:

你好,

 CAMERA_LINK_CAPMODE_ISIF:数据流sensor-》ISIF-》IPIPE-》Resizer-》DDR

CAMERA_LINK_CAPMODE_DDR:数据流sensor-》ISIF-》DDR-》IPIPE-》Resizer-》DDR

无论是哪种模式都会使用resizer.

赞(0)
未经允许不得转载:TI中文支持网 » DM385 可以做到同時 enc (fps:60) 和 display (fps:60)?
分享到: 更多 (0)