1. A method of encoding an input signal with an encoder, the encoder configured to perform method steps comprising: receiving the input signal; 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; performing encoding on the selected sequence of quantized values, thereby obtaining the coded output signal; and outputting the output signal, wherein the quantized values are selected from a pre-defined dictionary of quantized values, wherein the pre-defined dictionary of quantized values is in accordance with an entropy code and the encoding is performed by an entropy coder, and wherein the entropy code has a probability distribution determined by compiling a corpus of coefficient values along with corresponding ranges of perceptual slack values; finding a quantized value to which a most number of coefficient values fall within the corresponding ranges of perceptual slack values, removing such coefficient values from the corpus, and setting a probability of the quantized value in the probability distribution to a frequency with which coefficient values can be quantized to the quantized value; and iterating with remaining coefficient values in the corpus until the corpus is empty.