1. A method of bit allocation performed in an audio encoder, the method comprising: in a quantization module of the audio encoder, incrementally adjusting a global gain by an incremental adjustment value according to a gradient until the incremental adjustment value reaches a predetermined incremental adjustment amount, wherein the gradient is adjusted each time a number of bits used to represent a quantized value is counted.