What's the meaning of "AsyncDepth" parameter of "mfxVideoParam",is it means how many asynchronous tasks in a session? For example,I create a session has vpp(do color convert & image scale) and enc tasks,I should set "AsyncDepth" as 2(or 4?),if the session has dec,vpp & enc tasks,I should set it as 3,is it right?
From the SDK's doc said,if a session had more than one asynchronous tasks,every task should share the some surface pool to catch better performance,my session has vpp and enc task,so I allocate a surface pool for vpp out & enc in.From <<mediask-man.pdf>>,the number of the common surface pool should be calculated like below:
MFXVideoVPP_QueryIOSurf(session, &init_param_v, response_v);
MFXVideoENCODE_QueryIOSurf(session, &init_param_e, &response_e);
num_surfaces= response_v.NumFrameSuggested+response_e.NumFrameSuggested-async_depth; /* double counted in ENCODE & VPP*/
but the demo "sample_encode" calculate it in another way:
nEncSurfNum = EncRequest.NumFrameSuggested + MSDK_MAX(VppRequest.NumFrameSuggested, 1) - 1 + (m_nAsyncDepth - 1);
manual said should exclute "async_depth",but demo include "async_depth",which one is right? which formula should I use?