Patent ID: 7349842

Claim:
A method comprising: setting an initial common scale factor to a prior common scale factor if a maximum spectral coefficient within a frame of audio data is not equal to zero; determining an initial number of bits associated with the initial common scale factor; computing an initial increment using the initial number of bits and a target number of bits; incrementing the initial common scale factor by the initial increment; adjusting the incremented common scale factor based on the target number of bits; computing a plurality of individual scale factors based on an allowed distortion for an encoded audio signal, the individual scale factors controlling distortion in the encoded audio signal, wherein an initial value for each individual scale factor is equal to the adjusted common scale factor; if a current number of bits associated with the plurality of individual scale factors exceeds the target number of bits, modifying the adjusted common scale factor until a resulting number of bits no longer exceeds the target number of bits; and encoding the frame using the individual scale factors and the adjusted common scale factor.