Converting NvMediaImage with Block Linear surface layout to Pitch Linear surface layout efficiently

I would like to learn the suggested way to convert NvMediaImage data with Block-Linear surface layout (for a semi-planar YUV 420) into Pitch-Linear surface layout, by using NvMedia libraries in Drive OS 5.2

The purpose is to be able to directly feed the output of the ISP0/1 into the jpeg encoder, which seems to accept only Pitch-Linear surface layout.

My current approach is doing the following:

	    status = NvMedia2DBlitEx(m_i2d,           /* i2d */
	                             imageFrame,      /* dstSurface */
	                             NULL,       /* dstRect */
	                             imagePtr,      /* srcSurface */
	                             NULL,       /* srcRect */
	                             NULL,   /* params */
	                             NULL);              /* paramsOut */

where imageFrame is allocated with NvMediaImageCreateNew, with a pitch linear surface layout, and imagePtr is obtained from the output buffer of ISP0, which is in block linear surface layout.

This seems to work, since I can use imageFrame with NvMediaIJPEFeedFrame. However, I’m not sure if this way of blitting is the most efficient way to use the hardware.

This looks like a DRIVE platform issue. We recommend you to raise it to the respective platform from the below link
Latest DRIVE AGX/DRIVE AGX General topics - NVIDIA Developer Forums

ok thanks

hi goksani, is there a new ticket on AGX dev portal? do you have the most efficient solution now? if yes, could you share it here?


There’s some more info here: YUV 420 Semi-planar block linear format to JPEG encoding

However, since I’m using 5.1.9 and not 5.2, I cannot get an explicit answer. But it seems like to in order to avoid blitting to convert block linear to pitch linear, you can configure the camera master instead.