Use cgo to speed up Decode
Use cgo to speed up Encode