rewrite all fucntion of cesk_diff.c & to be tested