Patent ID: 7403561

Claim:
A method for fixed bit rate, intraframe compression of video, including a sequence of images, comprising, for each image: transforming portions of the image to generate frequency domain coefficients for each portion; selecting a quantization matrix according to the desired bit rate; determining a bit rate for each transformed portion using a plurality of scale factors; estimating distortion for each portion according to the plurality of scale factors; selecting a scale factor for each portion to minimize the total distortion in the image to achieve a desired bit rate; quantizing the frequency domain coefficients for each portion using the selected quantization matrix as scaled by the selected scale factor for the portion; entropy encoding the quantized frequency domain coefficients using a variable length encoding to provide compressed data for each of the defined portions; and outputting the compressed data for each of the defined portions to provide a compressed bitstream at the desired bit rate; wherein entropy encoding comprises: for each nonzero amplitude coefficient not preceded by a run of zero valued coefficients, determining whether the nonzero amplitude coefficient is in a base range or an index range; for each nonzero amplitude coefficient not preceded by a run of zero valued coefficients and in the base range, encoding the nonzero amplitude coefficient using a code word from a first set of code words; for each nonzero amplitude coefficient not preceded by a run of zero valued coefficients and in the index range, determining an index and encoding the nonzero amplitude coefficient using a code word from a second set of code words, followed by the index; for each nonzero amplitude coefficient preceded by a run of zero valued coefficients, determining whether the nonzero amplitude coefficient is in a base range or an index range; for each nonzero amplitude coefficient preceded by a run of zero valued coefficients and in the base range, encoding the nonzero amplitude coefficient using a code word from a third set of code words and encoding the run of zero valued coefficients using a code word from a fifth set of code words and after the code word for the nonzero amplitude coefficient; and for each nonzero amplitude coefficient preceded by a run of zero valued coefficients and in the index range, determining an index and encoding the nonzero amplitude coefficient using a code word from a fourth set of code words, followed by the index and encoding the run of zero valued coefficients using a code word from the fifth set of code words and after the code word for the nonzero amplitude coefficient.