cl-new-wdr: tune log threshold for high contrast

 * tune constrast threshold accroding to average brightness
 * fix array access overflow issue
 * optimize performance.

Signed-off-by: Wind Yuan <feng.yuan@intel.com>
2 files changed