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