Hi, everyone!
I'm using DM8127 and IPNC RDK ver3.5. I modify the multich_encode_decode usecase as:
camera link(1080P)---->Sclr link(352*288)---->ipcframeVpssOut---->ipcframeHostIn
I have a callback function on arm to save the first YUV420sp frame as yuv file, and then turn this YUV420sp frame to BGR and save as jpg using OpenCV.
here is the jpg picture:
This picture has two problem:
problem 1.the picture is too dark compared with what I see on the web using multich_tristream_fullfeature usecase. Even all advanced features are turned off in multich_tristream_fullfeature usecase, it's still much brighter than this one.
problem 2. the last two line has some grey pixel points which is not correct. I read the yuv file using UltraEdit, and find the last few Y valve is always 128,and thus makes it grey.
More details:
Here is my link param:
/* Camera Link */
CameraLink_CreateParams_Init(&cameraPrm);
cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
cameraPrm.numAudioChannels = 1;
cameraPrm.numVipInst = 1;
cameraPrm.tilerEnable = FALSE;
cameraPrm.vsEnable = FALSE;
cameraPrm.outQueParams[0].nextLink = gVcamModuleContext.sclrId[0];
cameraPrm.t2aConfig.n2A_vendor = UI_AEWB_ID_TI;
cameraPrm.t2aConfig.n2A_mode = UI_AEWB_AEWB;
pCameraInstPrm = &cameraPrm.vipInst[0];
pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(MT_9J003);
pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;
pCameraInstPrm->sensorOutWidth = 1920;
pCameraInstPrm->sensorOutHeight = 1080;
pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
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;
/* Scaler Link Params */
SclrLink_CreateParams_Init(&sclrPrm);
sclrPrm.inQueParams.prevLinkId = gVcamModuleContext.cameraId;
sclrPrm.inQueParams.prevLinkQueId = 0;
sclrPrm.outQueParams.nextLink = ipcFramesOutVpssId;
sclrPrm.tilerEnable = FALSE;
sclrPrm.enableLineSkipSc = FALSE;
sclrPrm.inputFrameRate = 30;
sclrPrm.outputFrameRate = 30;
sclrPrm.scaleMode = DEI_SCALE_MODE_ABSOLUTE;
sclrPrm.outScaleFactor.absoluteResolution.outWidth = 352;
sclrPrm.outScaleFactor.absoluteResolution.outHeight = 288;
sclrPrm.outDataFormat = VF_YUV420SP_UV;
sclrPrm.pathId = SCLR_LINK_SEC0_SC3;
/* IPC Frames Out VPSS */
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = gVcamModuleContext.sclrId[0];
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.numOutQue = 1;
ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = ipcFramesInHLOSId;
ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.processLink = SYSTEM_LINK_ID_INVALID;
ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = TRUE;
/* IPC Frames in Host */
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutVpssId;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInHostPrm.baseCreateParams.notifyNextLink = FALSE;
ipcFramesInHostPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInHostPrm.cbFxn = MultiCh_ipcFramesInHostCb;
ipcFramesInHostPrm.cbCtx = NULL;
when the frame is sent to ARM, I use mmap to read the file, the mmap function is provided in ti_mcfw_ipcframe.c as App_mmap() and App_unmmap().
I'm wondering if I miss something when I config the camera link that makes the picture so dark.
And I also guess scaling 1920*1080 to 352*288 may be the reason why I lose some pixel points, am I right? If someone can explain to me how the sclr link works inside,I'll be grateful.
I have to admit these two problems are quite wield to me and I don't know how to solve it,hope someone can give me an advice.
best regards,
Zhao