amvecm: further improvement for LC block artifect [1/2]
authorXihai Zhu <xihai.zhu@amlogic.com>
Mon, 19 Aug 2019 06:53:26 +0000 (02:53 -0400)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 20 Aug 2019 07:13:18 +0000 (00:13 -0700)
PD#SWPL-12867

Problem:
after some swtich or on/off operation, minor block
artifect is seen under super black pattern

Solution:
improve the temporal filter calculation and fine tune
related parameter as well

Verify:
TL1

Change-Id: If52360e458934d71438899b88d9246f1279ce524
Signed-off-by: Xihai Zhu <xihai.zhu@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/local_contrast.c

index fe78d04..fc2298c 100644 (file)
@@ -1303,18 +1303,18 @@ int cal_curv_iir(int *curve_nodes_cur,
                                tmap[k] =
                                        (node_cur * refresh_alpha[addr_curv1])
                                        + ((node_pre_raw *
-                                       (refresh - refresh_alpha[addr_curv1]) +
-                                       (1 << (refresh_bit - 1)))
+                                       (refresh - refresh_alpha[addr_curv1]))
                                                >> refresh_bit);
                                curve_nodes_pre_raw[addr_curv2] =
                                        tmap[k];
-                               tmap[k] = (tmap[k] >> refresh_bit);
+                               tmap[k] = (tmap[k] + (1 << (1 + refresh_bit)))
+                                                       >> (2 + refresh_bit);
                                /*output the iir result*/
                                curve_nodes_cur[addr_curv2] =
-                                       (int)(tmap[k] >> 2);/*back to u10*/
+                                       (int)(tmap[k]);/*back to u10*/
                                /*delay for next iir*/
                                curve_nodes_pre[addr_curv2] =
-                                       (int)(tmap[k] >> 2);
+                                       (int)(tmap[k]);
                        }
                }
        }