This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Extract Y channel from NV12 image will consume too usage of DSP(C6x)



Dear support:

- Use case: Extract two channel NV12 images(input size:1280x960) ,then remap these two gray images to BEV(Bird Eye View) images(output size: 320x640), using pipeline graph.
- Test result (ti-processor-sdk-rtos-j721e-evm-07_02_00_06):
  C6x1: 44% (vxChannelExtractNode, only extract Y channel, replicated node mode)
  C6x2: 58% (vxRemapNode for remap two gray images, two individual remap nodes)
My questions:
- Why extracting Y channel consume so much C6x usage since Y channel memory lies at header of NV12 image;
- Whether i can use vxCreateImageFromChannel instead of vxChannelExtractNode for pipelining?

BTW: I tried to use vxCreateImageFromChannel to extract Y channel, but it dont' work( the first output image sometime is wrong, but the second is right) , we guess it seem not support pipelining(We read "Pipelining is not supported in TIOVX(see: ROI_NOTE)"  from TIOVX document).


Thanks,
  • Hi,

    Why do you actually want to use channel extract node in this case? For NV12 image buffer, Luma and chroma are separated into different buffer and you could get buffer pointer for both the components in image descriptor. I think there is no need to use channel extract node to extract luma data from nv12 buffer. You could directly connect the output to next node and in that node, you could use only luma buffer pointer..

    Regards,

    Brijesh

  • Hi Brijesh,

    for non pipeline, using  vxCreateImageFromChannel, it work and  the performance is OK;
    for my case, i want to use pipeline mode, but there is a problem, vxCreateImageFromChannel can run, but some time vxRemapNode's output images is back image.

    because vxRemapNode not support NV12 image format, it only support 
    VX_DF_IMAGE_U8, so i can't pass NV12 image to remap node;
    As far as I know we can't pass NV12 image Y data pointer to next node as input, except we wrap it to image object, such as vxCreateImageFromHandle, but it seem be for host CPU memory, for my usecase, NV12 come from LDC node, it's VPAC memory.



  • Hi,

    So, as i understand, your data path is capture -> VISS -> LDC -> vxRemapNode, could you please confirm it? 

    and since vxRemapNode does not support NV12 image, you have introduced ChannelExtract node to extract luma data from nv12 ??

    I really dont think you need to use CreateImageFromChannel here. I think it is better to modify Remap Node to support NV12 image format and use just luma portion of it.. Could you please try it? 

    You would require to make changes in ti-processor-sdk-rtos-j721e-evm-08_00_00_12\tiovx\kernels\openvx-core\host\vx_remap_host.c and ti-processor-sdk-rtos-j721e-evm-08_00_00_12\tiovx\kernels\openvx-core\c66x\vx_remap_target.c files.

    Regards,

    Brijesh

  • Hi,

    So, as i understand, your data path is capture -> VISS -> LDC -> vxRemapNode, could you please confirm it? 

    Yes, but my data flow path miss VISS node because camera output NV12 format directly;

    You would require to make changes in ti-processor-sdk-rtos-j721e-evm-08_00_00_12\tiovx\kernels\openvx-core\host\vx_remap_host.c and ti-processor-sdk-rtos-j721e-evm-08_00_00_12\tiovx\kernels\openvx-core\c66x\vx_remap_target.c files.

    I view the source code you mentioned(vx_remap_host.c and vx_remap_target.c), I think that changing vx_remap_host.c maybe support NV12 as input and gray as output, but if i want to support NV12 as remap's output, change vx_remap_target.c can not be available because UV part is interleave and DSP functions like VXLIB_remapNearest_bc_i8u_i32f_o8u only support 8 bit to 8 bit conversion, there is no 16 bit to 16 bit conversion function(we can assume UV as a one 16 bit item, dim_x and dim_y is half of original image dim if DSP provide).

    Regards,

    Lon

  • Hi Lon,

    Yes, According to OpenVX standard, this node does not support NV12 image. I suggested for updating these files to allow input as NV12, but the output will still be grey scale only. 

    If you require remap function with NV12 input and output, can you consider using LDC available in the VPAC? It can also be used for remap function, and it works based on the Lookup table. 

    Regards,

    Brijesh