iMX6 deinterlacing MIPI frame with top/bottom field on same buffer

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

iMX6 deinterlacing MIPI frame with top/bottom field on same buffer

Jump to solution
3,217 Views
edison_fernande
Contributor III

HI all,

I'm trying to capture 1080i60 video from a TC358743 which has a mipi interface. As specified by the reference manual I'm using Non-Gated mode ("When working with MIPI, the non-gated mode should be configured.").

I'm able to capture the video in the right rate: 30 frames per second (60 fields per second) but the problem is that it is in field sequential order (all the scan lines of the top filed followed by all the scan lines for the bottom) and I'm not being able to deinterlace this video with the IPU as it only works if the fields are interleaved.  Attach you'll see a couple of pictures describing my issue: the one called original is my test pattern, in this picture all the even lines are white and all the odd lines are black so you end up with a white and a black field, the one called interlaced is what I get in the iMX6, you can see how half of the picture is white and half of the picture is black so I'm getting both fields.

Knowing this I have a couple of questions:

1. Is there a way of deinterlacing this video in the iMX6? As mentioned before, I have only been able of dinterlacing video when in comes  interleaved (even lines of a frame correspond to one field and odd lines to the other).

2. Is there a way of making the iMX6 to give the frame in the way the deinterlacer is expecting it?

Not sure if this is a limitation of the MIPI interface in the iMX6 as I haven't had any problem when using the parallel interface.

Thanks a lot for your help.

Edison

Labels (1)
0 Kudos
Reply
1 Solution
2,246 Views
skappen
Contributor II

Can you set "csi_mem.interlaced = ture"  for the CSI and try it.

Regards,

Sam 

View solution in original post

0 Kudos
Reply
6 Replies
2,247 Views
skappen
Contributor II

Can you set "csi_mem.interlaced = ture"  for the CSI and try it.

Regards,

Sam 

0 Kudos
Reply
2,246 Views
edison_fernande
Contributor III

Hi,

That did the trick. When we are capturing from MIPI the CSI interface has to be configured for none gated clock mode and when none gated clock mode is used csi_mem.interlaced is always false so the IDMAC channel is configured for progressive scan. I added some logic to the IPU driver so I can configure the CSI for none gated clock mode and have the IDMAC channel configured for interlaced scan (by setting csi_mem.interlaced = true).

Thanks for your help.

0 Kudos
Reply
2,246 Views
jimmychan
NXP TechSupport
NXP TechSupport

could you tell me which BSP are you using?

0 Kudos
Reply
2,246 Views
edison_fernande
Contributor III

Hi,

I'm not using an actual BSP. I've been testing in a Nitrogen6X running both Android Lollipop and linux. Lollipop uses kernel 3.14.52 and Linux uses kernel 3.14.28.

Edison

0 Kudos
Reply
2,246 Views
jimmychan
NXP TechSupport
NXP TechSupport

I got the reply from the expert.

=======================

Yes, it's possible to de-interlace the video as customer needs. i.MX6 Automotive board does it and customer can base the new driver on the ADV7180 driver. 

 

Checking the pictures sent by customer, seems that VDIC is not being used or VDIC/IDMAC channels are not being correctly configured.

 

This is a good application note explaining the de-interlace configuration for ADV7180.

iMX6 IPU TVIN Application Notes 

2,246 Views
edison_fernande
Contributor III

Hi,

Thanks for the info, I was trying to access your link but I says I'm unauthorized. 

Do you happened to know if it is currently possible to deinterlace that video (as shown in interlaced.jpeg) with the gstreamer imx plugins? I tried with NXP's version (4.1.4) and gstreamer-imx (GitHub - Freescale/gstreamer-imx: GStreamer 1.0 plugins for i.MX platforms ) and none of them seems to be able to deinterlace it. 

EDITED: I was checking the adv7180 driver and it has a parallel interface. I have worked with interlaced video using the parallel  interface in the past with no problem but this chip has a MIPI interface and I'm not sure if my problem is being caused by that.  When using the parallel interface (gs2971 for instance) I always get the frames with the fields interleaved (the lines of top and bottom field are all interleaved in the frame so for instance, line 0 is from the top field, line 1 is from bottom, line 2 is from top and so on) and the deinterlacer has no problem with  it but in the TC358743 case, with the video source as shown in original.jpeg I get the frames as shown in interlaced.jpeg and I haven't found a way of deinterlacing this.

Edison

0 Kudos
Reply