amvecm: add global motion information patch [2/2]
authorWenfeng Guo <wenfeng.guo@amlogic.com>
Mon, 21 Oct 2019 11:48:26 +0000 (19:48 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 29 Oct 2019 02:05:51 +0000 (19:05 -0700)
PD#SWPL-7814

Problem:
VPP need global motion information

Solution:
1.di add global motion information
2.amvecm set dejaggy according GMV(from baozheng)

Verify:
tl1

Change-Id: I0bc9190101995c99d5e881cefe482b513f82d253
Signed-off-by: Wenfeng Guo <wenfeng.guo@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/amvecm.c

index a6ec90abcff172c8d0e862eec5e6b65092224862..7c4394863887d5beff502723a4df2c22ce8d002f 100644 (file)
@@ -206,6 +206,8 @@ unsigned int sr_demo_flag;
 bool pd_detect_en;
 int pd_fix_lvl = PD_HIG_LVL;
 
+unsigned int gmv_th = 17;
+
 static int wb_init_bypass_coef[24] = {
        0, 0, 0, /* pre offset */
        1024,   0,      0,
@@ -1105,7 +1107,7 @@ void amvecm_dejaggy_patch(struct vframe_s *vf)
        if ((vf->height == 1080) &&
                (vf->width == 1920) &&
                (vf->di_pulldown & (1 << 3)) &&
-               (vf->di_pulldown & 0x7)) {
+               ((vf->di_pulldown & 0x7) || ((vf->di_gmv / 10000) >= gmv_th))) {
                if (pd_detect_en == 1)
                        return;
                pd_detect_en = 1;
@@ -5995,6 +5997,12 @@ static ssize_t amvecm_debug_store(struct class *cla,
                        pd_fix_lvl = PD_DEF_LVL;
                else
                        pd_fix_lvl = val;
+       } else if (!strcmp(parm[0], "gmv_th")) {
+               if (parm[1]) {
+                       if (kstrtoul(parm[1], 10, &val) < 0)
+                               goto free_buf;
+               }
+               gmv_th = val;
        } else
                pr_info("unsupport cmd\n");