Improvement of frame quality when using iMX8QXP and ISL79987

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Improvement of frame quality when using iMX8QXP and ISL79987

跳至解决方案
3,283 次查看
toshinariagata
Contributor III

Dear @qiang_li-mpu_se 

I read "ISL79987 and adv7180 de-interlace driver for iMX8QXP boards" and I am trying it.

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/ISL79987-and-adv7180-de-interlace-driver...

 

However, I have some troubles. So, I have some questions, and please see an attached pptx file.

Would you please tell me how to solve the problem?

0 项奖励
1 解答
3,149 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

For blending mode, only ISI0 can support it, and it needs combine with another ISI channel on the fly, that's the hardware limitation. So we can't support 4 CNs with blending mode.

在原帖中查看解决方案

0 项奖励
11 回复数
3,272 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi @toshinariagata 

For CN1, it can use the blending mode for de-interlace, this is the best mode for video quality, but it can only support one channel at the same time. That's why CN1 is better than others.

For RGB format, it can't be supported when weaving mode de-interlace is used. In this case, only CN1 can support RGB format output, for CN2~4, we have to use YUV format to capture.

 

All of the above are ISI hardware limitation.

0 项奖励
3,252 次查看
toshinariagata
Contributor III

Hi. @qiang_li-mpu_se 

Thank you for replying.

I understood that the blending mode can be used by only CN1.
I want to capture video frames for all channels at the same time without blending.
I think it goes well when all the frames are blended after they are captured without blending in each CN.

Would you please tell me how to do the following?
How to disable to blend CN1 in ISL79987. Would you please tell me the register of ISL79987?
How to blend all CNs by hardware (instead of software) after getting frames(use Hardware).

0 项奖励
3,245 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

If you don't apply the "0003-ISL79987-Support-blending-mode-de-interlace-for-iMX8.patch", then there is no blending mode used on CN1. 

All de-interlace used in the patches are hardware based, no software de-interlace here.

0 项奖励
3,234 次查看
toshinariagata
Contributor III

Thank you for replying.

I understood that only CN1 uses blending in "0003-ISL79987-Support-blending-mode-de-interlace-for-iMX8.patch".
I will roll back it.

0 项奖励
3,213 次查看
toshinariagata
Contributor III

Hi. @qiang_li-mpu_se 

I rolled back "0003-ISL79987-Support-blending-mode-de-interlace-for-iMX8.patch", so I got the same quality all CNs.
Thank you for the advice.

As I wanted to get better quality, I thought I used deinterlace of gstreamer.
I changed "deinterlace_mode = <0>" in the imx8qxp-mek-isl7998x.dts.
However, I got a frame with two frames up and down. Please see the attachment.
Would you please tell me how to get one frame at a time?

0 项奖励
3,204 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi @toshinariagata 

I haven't used deinterlace of gstreamer, so you know what's requirement for source interlaced frame?

For ISI side, to get a frame with two fields, you must enable the weaving mode de-interlace.

And if you want to get one field data as a "frame", for example 720*240 for NTSC, after set "deinterlace_mode = 0" in dts, you also need change the code in isl7998x.c:

1. Change height from 480 to 240:

static video_fmt_t video_fmts[] = {
{ /*! NTSC */
.v4l2_id = V4L2_STD_NTSC,
.name = "NTSC",
.width = 720, /* ACT_FRM_WIDTH plus 1 */
- .height = 480, /* ACT_FRM_WIDTH plus 1 */
+ .height = 240, /* ACT_FRM_WIDTH plus 1 */

 

2. Change ISL79987 from frame mode to field mode in isl7998x_hardware_init():

- isl7998x_write_reg(isl7998x_data, 0x01, 0x25); //For frame mode

+ isl7998x_write_reg(isl7998x_data, 0x01, 0x05); //For field mode

 

0 项奖励
3,194 次查看
toshinariagata
Contributor III

Hi. @qiang_li-mpu_se 

Thank you for the reply.

I'll try the changes you suggested.

I'm sorry, I haven't used deinterlace of gstreamer too.
The ISI can deinterlace only "weave", so I thought if I use it, I get better quality.

https://gstreamer.freedesktop.org/documentation/deinterlace/index.html?gi-language=c

This page explains deinterlace of gstreamer.

0 项奖励
3,177 次查看
toshinariagata
Contributor III

Hi. @qiang_li-mpu_se 

Thanks to you, I got a 720*240 frame, but I was able to deinterlace by gstreamer.

Would you please tell me how to get a better frame when "deinterlace_mode = 3(Even odd weave)"? I'm sorry to bother you again.

Comparing software weaved frame (equivalent to "deinterlace_mode = 0") and "deinterlace_mode = 3", the first one is better. Please see an attached pptx file.

0 项奖励
3,172 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

With static picture, if you found the sawtooth, then there is chance the de-interlace mode is not correct, you can try with "deinterlace_mode = 2", it will swap the field order with "deinterlace_mode = 3".

0 项奖励
3,158 次查看
toshinariagata
Contributor III

Hi. @qiang_li-mpu_se 

I appreciate your advice.
Thanks to you, I got the same quality frames from all CNs.
I hope the ISI can output the format of YUV or RGB or it can do blending at all CNs.
If it can, I think I will get more quality frames.

0 项奖励
3,150 次查看
qiang_li-mpu_se
NXP Employee
NXP Employee

For blending mode, only ISI0 can support it, and it needs combine with another ISI channel on the fly, that's the hardware limitation. So we can't support 4 CNs with blending mode.

0 项奖励