di: fix the flash mosaic caused by cue [1/1]
authorBencheng Jing <bencheng.jing@amlogic.com>
Thu, 25 Jul 2019 13:02:20 +0000 (21:02 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 31 Jul 2019 05:27:22 +0000 (22:27 -0700)
PD#SWPL-11034

Problem:
flash mosaic when play VTS_13_1.VOB

Solution:
adjust cue function

Verify:
sm1

Change-Id: If188f49f3972e5da2b2fe4e917bb6e1b14163569
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
drivers/amlogic/media/deinterlace/nr_drv.c

index 0e7e8b1..1d8cc7b 100644 (file)
@@ -768,23 +768,24 @@ void adaptive_cue_adjust(unsigned int frame_diff, unsigned int field_diff)
        }
        if (glb_fieldck_en) {
                if (field_diff < pcue_parm->glb_mot_fieldthr)
-                       pcue_parm->field_count = pcue_parm->field_count + 1;
-               else if (pcue_parm->field_count < pcue_parm->glb_mot_fieldnum) {
-                       pcue_parm->field_count = pcue_parm->field_count > 0 ?
-                               (pcue_parm->field_count - 1) : 0;
-               }
+                       pcue_parm->field_count =
+                       pcue_parm->field_count < pcue_parm->glb_mot_fieldnum ?
+                       (pcue_parm->field_count + 1) :
+                       pcue_parm->glb_mot_fieldnum;
+               else if (pcue_parm->field_count > 0)
+                       pcue_parm->field_count = (pcue_parm->field_count - 1);
                /*--------------------------*/
                /*patch from vlsi-yanling to fix tv-7314 cue cause sawtooth*/
                if (field_diff < pcue_parm->glb_mot_fieldthr ||
                        field_diff > pcue_parm->glb_mot_fieldthr1)
-                       pcue_parm->field_count1 = pcue_parm->field_count1 + 1;
-               else if (pcue_parm->field_count1 > 8) {
-                       pcue_parm->field_count1 = pcue_parm->field_count1 > 0 ?
-                               (pcue_parm->field_count1 - 1) : 0;
-               }
+                       pcue_parm->field_count1 =
+                       pcue_parm->field_count1 < pcue_parm->glb_mot_fieldnum ?
+                       (pcue_parm->field_count1 + 1) :
+                       pcue_parm->glb_mot_fieldnum;
+               else if (pcue_parm->field_count1 > 0)
+                       pcue_parm->field_count1 = pcue_parm->field_count1 - 1;
                /*--------------------------*/
        }
-
        if (cue_glb_mot_check_en) {
                if (pcue_parm->frame_count >
                        (pcue_parm->glb_mot_fieldnum - 6) &&