Divide encode decode to two csproject

and many bug fixed