di: fix wire drawing issue caused by pendulum clock stuck [1/1]
authorWenfeng Guo <wenfeng.guo@amlogic.com>
Thu, 9 May 2019 03:04:08 +0000 (11:04 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 22 May 2019 05:14:25 +0000 (22:14 -0700)
PD#SWPL-7650

Problem:
TL1 have drawing.

Solution:
fine-tuning GMV

Verify:
TL1

Change-Id: Ie50207969a2d7511882552b0adc8baef083300ff
Signed-off-by: Wenfeng Guo <wenfeng.guo@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace_mtn.c

index b9a3562..81e0036 100644 (file)
@@ -647,6 +647,11 @@ void fix_tl1_1080i_sawtooth_patch(void)
        DI_Wr(0x17af, 0x60020a60);
 }
 
+static int combing_cnt;
+int combing_diff_min = 2000;
+int combing_diff_max = 2000;
+int combing_cnt_thd = 10;
+
 int adaptive_combing_fixing(
        struct combing_status_s *cmb_status,
        unsigned int field_diff,
@@ -701,6 +706,13 @@ int adaptive_combing_fixing(
        glb_mot[2] = glb_mot[1];
        glb_mot[1] = glb_mot[0];
        glb_mot[0] = frame_diff;
+       if (glb_mot[0] < combing_diff_min)
+               combing_cnt = combing_cnt + 1;
+       else
+               combing_cnt = 0;
+       if (glb_mot[0] < combing_diff_min && glb_mot[1] > combing_diff_max &&
+               combing_cnt <= combing_cnt_thd)
+               glb_mot[0] = glb_mot[1];
        glb_mot_avg5 =
                (glb_mot[0] + glb_mot[1] + glb_mot[2] + glb_mot[3] +
                 glb_mot[4]) / 5;