The IMX8MM reference manual section on the G2D specifies support for BT.601 and BT.709 YUV to RGB color conversions, including the formulas used. How are these set as they are not exposed in the G2D API?
14.2.2.4.8 YUV to RGB Conversion
YUV data can be converted into 8-bit per component RGB format at the output of the
cache only. Once converted, there is no way back to YUV format. GPU supports BT.601
and BT.709 YUV to RGB color conversion standards....
Hi
Any feedback would be appreciated.
BR
Hallo,
Any feedback would be appreciated.
Thx
Hi Brenhale,
How did you actually solve this problem?
thx
Why does it matter why we need these? Our application requires it. The IMX8MM manual states the G2D supports this, but the supplied G2D library does not appear to actually support it? I would like to understand how we achieve this?
I don't want to convert "BT601 to BT709". As per original question I want to configure the G2D to use the correct formulas for a YUV to RGB conversion using either BT601 or BT709 maths. The maths are different for these conversions, and the API does not define how this is configured, despite saying it is supported in the G2D section.
if you use linux bsp, you can use gstreamer command like this to do the color conversion:
"gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12 ! imxvideoconvert_g2d ! video/xraw,
format=RGB16 ! ximagesink display=:0"
this is just an example, you can change your yuv format and rgb format, then g2d would convert from yuv to rgb
Hi,
I am resurrecting this thread since I face the exact same issue.
The same issue is also discussed here without answer:
https://community.nxp.com/t5/i-MX-Processors/YUV-to-RGB-conversion/td-p/629789
@brenhale actually clearly specified the problem.
@joanxie suggested to use gstreamer but this is not what I want.
I already wrote a G2D code that implements BT.601:
g2d_open(&handle);
src.planes[0] = buf_y;
src.planes[1] = buf_u;
src.planes[2] = buf_v;
src.left = crop.left;
src.top = crop.top;
src.right = crop.right;
src.bottom = crop.bottom;
src.stride = y_stride;
src.width = y_width;
src.height = y_height;
src.rot = G2D_ROTATION_0;
src.format = G2D_I420;
dst.planes[0] = buf_rgba;
dst.left = 0;
dst.top = 0;
dst.right = disp_width;
dst.bottom = disp_height;
dst.stride = disp_width;
dst.width = disp_width;
dst.height = disp_height;
dst.rot = G2D_ROTATION_0;
dst.format = G2D_RGBA8888;
g2d_blit(handle, &src, &dst);
g2d_finish(handle);
g2d_close(handle);
The problem with this is that it provides RGBA (RGB32) while I want RGB 24bit
From the formula in the imx8mp ref manual it appears BT.709 has only RGB no alpha channel.
The question is:
How do I configure G2D programmatically to do YUV to RGB conversion?
How do I configure BT.709 ?
Thx