Encoding methods