De-interlace issue for Capture Device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

De-interlace issue for Capture Device

1,918 Views
rotechen
Contributor I

I using i.MX6DL with ADV7180.

The software platform is "android jb4.3 r1.1.0".

I found the image quality is very best when the video is static image. The show as below.

CSI_MEM_side_static.png

But if the video is move image. the object edge will have some interlacing artifacts in edge of motion object. The show as below.

CSI_MEM_side_effect.png

For this issue, i adding apply patch at <De-interlace Capture Device>, the image became blur. The show as below.

PATCH.png

Is this right? How to improve it?

0 Kudos
4 Replies

715 Views
SergioSolis
NXP Employee
NXP Employee

Can you please tell me what are the exact patches you used?

0 Kudos

715 Views
rotechen
Contributor I

I using the patch "add-csi-deinterlace-capture.patch.zip" at <De-interlace Capture Device>.

Then modify the struct "mxc_capture_inputs" as below in the mxc_v4l2_capture.c.


static struct v4l2_input mxc_capture_inputs[MXC_V4L2_CAPTURE_NUM_INPUTS] = {

  {

  .index = 0,

  .name = "CSI VDI MEM",

  .type = V4L2_INPUT_TYPE_CAMERA,

  .audioset = 0,

  .tuner = 0,

  .std = V4L2_STD_UNKNOWN,

  .status = V4L2_IN_ST_NO_POWER,

  },

  {

  .index = 1,

  .name = "CSI VDI MEM",

  .type = V4L2_INPUT_TYPE_CAMERA,

  .audioset = 0,

  .tuner = 0,

  .std = V4L2_STD_UNKNOWN,

  .status = V4L2_IN_ST_NO_POWER,

  },

};

0 Kudos

715 Views
SergioSolis
NXP Employee
NXP Employee

Hello Rote,


Here is the answer from our expert, please let me know of any questions you may have:


I found that the original patch was using the wrong protocol definition to set the field,V4L2_FIELD_INTERLACED_BT was used instead of IPU_DEINTERLACE_FIELD_BOTTOM. This causes the field order to be top field first in the deinterlacer. The fix is the patch below. I have included all of my patches to reproduce and fix the problem on our Jelly Bean 4.3.3 1.1.0 GA release.

diff --git a/drivers/media/platform/mxc/capture/ipu_vdi_enc.c b/drivers/media/platform/mxc/capture/ipu_vdi_enc.c

index 96003a2..3aa0c3a 100644

--- a/drivers/media/platform/mxc/capture/ipu_vdi_enc.c

+++ b/drivers/media/platform/mxc/capture/ipu_vdi_enc.c

@@ -256,7 +256,7 @@ static int vdi_enc_setup(cam_data *cam)

        enc.mem_prp_vf_mem.in_pixel_fmt = enc.mem_prp_vf_mem.out_pixel_fmt;

        enc.mem_prp_vf_mem.motion_sel = MED_MOTION;

-        enc.mem_prp_vf_mem.field_fmt = V4L2_FIELD_INTERLACED_BT;

+      enc.mem_prp_vf_mem.field_fmt = IPU_DEINTERLACE_FIELD_BOTTOM;

        ipu_csi_enable_mclk_if(cam->ipu, CSI_MCLK_ENC, cam->csi, true, true);

0 Kudos

715 Views
rotechen
Contributor I

Hello Sergio,

Thanks for your reply. I modify the file "ipu_vdi_enc.c" follow your suggest. But the issue still happen.

Below show my capture image.

1. enc.mem_prp_vf_mem.field_fmt = IPU_DEINTERLACE_FIELD_BOTTOM

IPU_DEINTERLACE_FIELD_BOTTOM.png

2. enc.mem_prp_vf_mem.field_fmt = IPU_DEINTERLACE_FIELD_TOP

   IPU_DEINTERLACE_FIELD_TOP.png

3. enc.mem_prp_vf_mem.field_fmt = V4L2_FIELD_INTERLACED_BT

   V4L2_FIELD_INTERLACED_BT.png

4. enc.mem_prp_vf_mem.field_fmt = V4L2_FIELD_INTERLACED_TB

V4L2_FIELD_INTERLACED_TB.png

0 Kudos