add DP sample, Motion cost, and bug fix