I’m considering using the NvMedia 2D hardware accelerator for the data transfer and layout conversion, instead of NvSciBufObjPutPixels . The proposed approach is (refer to image_2d.c):
- Source
NvSciBufObj(srcBufObj):
- Allocate a
NvSciBufObjconfigured withNvSciBufImage_PitchLinearTypelayout andNeedCpuAccess = true. - Get raw YUV data and
memcpyit directly into thissrcBufObj(viaNvSciBufObjGetCpuPtr).
- Destination
NvSciBufObj(dstBufObj):
- Allocate another
NvSciBufObjconfigured withNvSciBufImage_BlockLinearTypelayout, as required by the IEP. This will be the buffer fed toNvMediaIEPFeedFrame.
- NvMedia 2D for Transfer & Conversion:
- Initialize an
NvMedia2Dinstance. - Register both
srcBufObjanddstBufObjwith the NVM2D instance. - Use
NvMedia2DComposeto transfer data fromsrcBufObjtodstBufObj. The NVM2D hardware would handle the conversion from pitch-linear to block-linear layout.
Question:
Is this a viable and recommended approach to offload the CPU-intensive NvSciBufObjPutPixels work to the NVM2D hardware for preparing IEP input buffers?