Object encoding