encoded decode on the fly