Patent ID: 8582652

Claim:
A method for selecting a coding mode for a block of a current picture, comprising: receiving the block of a current picture; subtracting a prediction block from the received block to calculate a prediction residual block; performing a forward transform, quantization, dequantization, and inverse transform on the prediction residual block to calculate a reconstructed prediction residual block including: performing the forward transform on the prediction residual block to calculate a transformed prediction residual block, and performing the quantization on the transformed prediction residual block to calculate a quantized transformed prediction residual block; performing a binarization process on the quantized transformed prediction residual block, resulting in a plurality of bins; computing a coding bits parameter from the plurality of bins; measuring a coding distortion parameter between the prediction residual block and the reconstructed prediction residual block; and selecting the coding mode in accordance with a cost function for coding the received block, wherein the cost function comprises the coding distortion parameter and the coding bits parameter.