basic implementation of quickEncode that does NOT use mergeCodeTables