I have a requirement where I need to display camera capture (interlaced YUYV) using v4l2 capture/X11/GLES2.0. I am able to write a test application which captures via v4l2 capture apis and using X11/GLES able to show it. However the displayed image doesn't look smooth, instead I am seeing jaggy (saw kind)/aliasing artifacts.
Some more information:
- Camera outputs CVBS NTSC format. here it is interlaced YUYV
- I am using glTexDirectVIV() extension with GL_VIV_YUY2 input format.
See the attached bmp image with artifacts here.
If I try imx-test/mxc_4l2_tvin.out test with "-m 2 or -m 0" option, camera capture image is coming correctly (smooth).
./mxc_v4l2_tvin.out -ow 800 -oh 480 -f YUYV -m (Result: aliasing kind artifacts)
./mxc_v4l2_tvin.out -ow 800 -oh 480 -f YUYV -m 0 (Result: Good)
./mxc_v4l2_tvin.out -ow 800 -oh 480 -f YUYV -m 1 (Result: aliasing kind artifacts)
./mxc_v4l2_tvin.out -ow 800 -oh 480 -f YUYV -m 2 (Result: Good)
Looking at the source of mxc_v4l2_tvin.c, it seems following code makes camera capture to come correctly on display. Which in turn sets required value to VDI Control register (i.e. IPU_VDI_C) when v4l2 output path is getting used.
"output_buf.field = V4L2_FIELD_INTERLACED_BT;"
I captured the VDI Control register value and tried to set it using devmem before running my application as follows but it didn't help.
#devmem 0x2668004 32 0x42083332
Could anyone give some ideas/inputs/suggestions to avoid artifacts using X11/GLES2.0?
Is there anyway to use the IPU VDI functionality as above (i.e. mxc_v4l2_tvin) with the output/display pipeline with X11/GLES2.0/EGL/FB?
Thanking you all in advance and waiting for replies.