Vector Quantizer and method therein for vector quantization, e.g. in a transform audio codec. The method comprises comparing an input target vector with four centroids C0, C1, C0,flip and C1,flip, wherein centroid C0,flip is a flipped version of centroid C0 and centroid C1,flip is a flipped version of centroid C1, each centroid representing a respective class of codevectors. A starting point for a search related to the input target vector in the codebook is determined, based on the comparison. A search is performed in the codebook, starting at the determined starting point, and a codevector is identified to represent the input target vector. A number of input target vectors per block or time segment is variable. A search space is dynamically adjusted to the number of input target vectors. The codevectors are sorted according to a distortion measure reflecting the distance between each codevector and the centroids C0 and C1.