basic codec function is ok!