update codebook
merge codebook