change codebook format