Updated composite codec to handle encoding