From 81c5c65d7e0bebbeef2e96a2ca101d5342596414 Mon Sep 17 00:00:00 2001 From: Bencheng Jing Date: Thu, 25 Jul 2019 21:02:20 +0800 Subject: [PATCH] di: fix the flash mosaic caused by cue [1/1] 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 --- drivers/amlogic/media/deinterlace/nr_drv.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/amlogic/media/deinterlace/nr_drv.c b/drivers/amlogic/media/deinterlace/nr_drv.c index 0e7e8b19124b..1d8cc7bf4b29 100644 --- a/drivers/amlogic/media/deinterlace/nr_drv.c +++ b/drivers/amlogic/media/deinterlace/nr_drv.c @@ -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) &&