1. A method of encoding an input signal comprising: obtaining a plurality of coefficients that represent the input signal; for each coefficient, determining a range of perceptual slack values; selecting a sequence of quantized values for the coefficients, each quantized value selected to lie within the range of perceptual slack values for one of the plurality of coefficients, wherein the sequence of quantized values is selected from a plurality of sequences and the selected sequence minimizes a size of a coded output signal; and performing encoding on the selected sequence of quantized values, thereby obtaining a coded output signal.