Patent ID: 8325808

Claim:
A method of encoding a video image comprising a plurality of macroblocks, the method comprising: partitioning a macroblock of the video image into a plurality of blocks that each comprises a plurality of sub-blocks; for each particular block: calculating an energy value for each sub-block of the particular block based on a sum of a plurality of difference values, each difference value based on a difference between one of a plurality of image values of the sub-block and an average value of the plurality of image values of the sub-block; calculating an energy difference between each pair of sub-blocks of the particular block; when the energy difference between each pair of sub-blocks in the particular block is within a particular threshold value of an average energy value of the particular block, designating each sub-block of the particular block as a flat sub-block; and when the energy difference between at least one sub-block of the particular block and another sub-block of the particular block is greater than the particular threshold value, designating each sub-block of the particular block as a non-flat sub-block; designating a pattern to the macroblock based on the flat or non-flat designations of the sub-blocks for each of the plurality of blocks of the macroblock; and selecting an encoding scheme for encoding the macroblock based on the pattern designated to the macroblock.