A method for encoding data, the data including quantized transform domain coefficients, the method comprising: quantizing transform domain coefficients to obtain the quantized transform domain coefficients using a quantization step size specified by a quantization parameter, generating reconstruction space parameters based upon the transform domain coefficients, the reconstruction space parameters being specific to a data type of the transform domain coefficients and the quantization parameter, wherein the reconstruction space parameters include a first reconstruction level and a reconstruction step size for further reconstruction levels, wherein the further reconstruction levels are determined by adding multiples of the reconstruction step size to the first reconstruction level, wherein generating includes setting the first reconstruction level as equal to an average of the transform domain coefficients quantized to the first level, and wherein generating further includes determining the reconstruction step size by minimizing the following expression for s ∑ i ≥ 2 ∑ j un j i − i ⋅ s 2 where s denotes the reconstruction step size, i denotes the quantization level, i = 2 is the second quantization level, un j i are unrounded quantized coefficients given by un j i = c j i / q , with c j i denoting the transform domain coefficients quantized to the i-th quantization level and q denoting the quantization step size indicated by the quantization parameter, and index j runs, for a given quantization level, over all transform domain coefficients quantized to the given quantization level; entropy encoding the quantized transform domain coefficients; and generating a bitstream containing the encoded quantized transform domain coefficients, the first reconstruction level and the reconstruction step size, wherein the quantization parameter is incorporated into the bitstream. quantizing transform domain coefficients to obtain the quantized transform domain coefficients using a quantization step size specified by a quantization parameter, generating reconstruction space parameters based upon the transform domain coefficients, the reconstruction space parameters being specific to a data type of the transform domain coefficients and the quantization parameter, wherein the reconstruction space parameters include a first reconstruction level and a reconstruction step size for further reconstruction levels, wherein the further reconstruction levels are determined by adding multiples of the reconstruction step size to the first reconstruction level, wherein generating includes setting the first reconstruction level as equal to an average of the transform domain coefficients quantized to the first level, and wherein generating further includes determining the reconstruction step size by minimizing the following expression for s where s denotes the reconstruction step size, i denotes the quantization level, i = 2 is the second quantization level, un j i are unrounded quantized coefficients given by un j i = c j i / q , with c j i denoting the transform domain coefficients quantized to the i-th quantization level and q denoting the quantization step size indicated by the quantization parameter, and index j runs, for a given quantization level, over all transform domain coefficients quantized to the given quantization level; entropy encoding the quantized transform domain coefficients; and generating a bitstream containing the encoded quantized transform domain coefficients, the first reconstruction level and the reconstruction step size, wherein the quantization parameter is incorporated into the bitstream. <EOS>