could anyone help me ?
I have a parm "Analysis_Begin" in the ARM application code.it uses to call different code in DSP server.But I notice only the first value of Analysis_Begin(FALSE) was transferd.
specifically,In the first 10 frames,Analysis_Begin=0,the code(Vanalytics_process)should execute init process.in other frames,Analysis_Begin=1,the code(Vanalytics_process) should execute Analysis process.
But I only see the output of init process.It means Analysis_Begin always equals to 0 ! I want to know how to transfer the changed value of Analysis_Begin.
Thanks !
ARM(application code):
/* Analysis_Begin=FLASE.process initialize parms. */
DBG("got buffer from capture thread hVidBuf\n");
VanalyticsParams.Analysis_Begin=FALSE;
Vanalytics_process(hVaEnv, hVidBuf, hDisplayBuf);
......
/*Analysis_Begin=TRUE,process Analysis. I can see the DEBUG info, But it still executes initialization instead of analysis */
DBG("Got %d frames , Analysis Begin\n",frame_count);
VanalyticsParams.Analysis_Begin=TRUE;
Vanalytics_process(hVaEnv, hVidBuf, hDisplayBuf);
DBG(" Analysis is processing ");
DSP code:
In algorithm code motion.c,the display depend on parm "Analysis_Begin":
/* Analysis_Begin=FALSE.initialize parms. */
if (Analysis_Begin ==FALSE)
{
VLIB_initMeanWithLumaS32(currentmeans,pLocalBufIn,pixnum);
VLIB_initVarWithConstS32(currentVars, initialVar, pixnum);
for(i = 0; i < width*height; i++){
pBufOut[i] = (pLocalBufIn[i]) * 255;//output luma image //I could only see this output
}
}
else
{
/*nalysis_Begin=TRUE,Start Analysis. */
VLIB_subtractBackgroundS32(fgmask, // new foreground mask to be computed
pLocalBufIn, // the newest luma frame
currentmeans, // running mean
currentVars, // running variance
thresholdGlobal, // global threshold
thresholdFactor, // multiplicative factor for the image threshold
pixnum);
VLIB_updateEWRMeanS32(currentmeans,
pLocalBufIn,
fgmask,
bgAdaptRate,
pixnum);
VLIB_updateEWRVarianceS32(currentVars,
currentmeans,
pLocalBufIn,
fgmask,
bgAdaptRate,
pixnum);
Unpack32BitPackedBinImage(mask, width, height,pLocalScratch);
for(i = 0; i < width*height; i++){
pBufOut[i] = (pLocalScratch[i]) * 255; //output analyzed image
}
DSP(activate Res in ires.c)。
IRES_Fxns MOTION_WY_IRES = {
&MOTION_WY_IRES,
MOTION_WY_getResources,
MOTION_WY_numResources,
MOTION_WY_initResources,
MOTION_WY_reInitResources,
MOTION_WY_deInitResources,
MOTION_WY_activateRes,
MOTION_WY_activateAllRes,
MOTION_WY_deactivateRes,
MOTION_WY_deactivateAllRes
};
……
/*
* ======== MOTION_WY_activateRes ========
*/
static IRES_Status MOTION_WY_activateRes(IALG_Handle handle, IRES_Handle res)
{
MOTION_WY_Obj *alg = (MOTION_WY_Obj *)handle;// MOTION_WY_Obj include Analysis_Begin
/* Check that res = alg->edmaHandle */
if (res == (IRES_Handle)(alg->edmaHandle)) {
if (TRUE == alg->resActive[0]) {
return (IRES_EFAIL);
}
alg->resActive[0] = TRUE;
}
return (IRES_OK);
}
}