Avoid duplicating code in the MotionEstimate test

All the tests of the line search (unoptimized and optimized)
use the exact same copypasted structure. Instead factorize this
into a test function which uses the provided function.
Add func init for welsfillingPred
Add func init on UT source code
Fix gtest build error when OS=msvc.
Merge pull request #792 from zhilwang/msvc-gtest

Fix gtest build error when OS=msvc.
Merge pull request #791 from zhilwang/intraSad

Add func init for welsfillingPred
Merge pull request #788 from mstorsjo/factorize-duplicated-test

Avoid duplicating code in the MotionEstimate test

Approved by Sijia.