Patent ID: 8331707

Claim:
An electrical-device-implemented image coding method, comprising: obtaining a raw block from an image, wherein the raw block comprises a plurality of raw pixel values, and there are a max pixel value and a min pixel value among the raw pixel values; calculating a first difference sum, which is sum of differences between the raw pixel values and the max pixel value respectively; calculating a second difference sum, which is sum of differences between the raw pixel values and the min pixel value respectively; calculating a plurality of residue values corresponding to the raw pixel values, wherein each of the residue values is calculated by subtracting the min pixel value from the corresponding raw pixel value if the first difference sum is not smaller than the second difference sum, wherein each of the residue values is calculated by subtracting the corresponding raw pixel value from the max pixel value if the first difference sum is smaller than the second difference sum, encoding each of the residue values into a compressed codeword; and generating a bit stream according to the compressed codewords.