Patent ID: 8559512

Claim:
A method implemented in a computing device for encoding a data block of digital data, the method comprising: receiving an uncompressed data block defining values for a set of pixels; selecting one of a plurality of intra frame encoding modes each having a different direction for extrapolating already encoded pixels adjacent to the data block, by: computing two or more direction gradient blocks, each representing changes in pixel values in a respective direction, wherein computing comprises applying a gradient filter in the respective direction to the set of pixels and a set of adjacent pixels which belong to one or more previously encoded data blocks; generating a 3D multi-directional gradient block by combining the two or more direction gradient blocks; calculating directional energy values of the data block, the values being associated with each of a predefined plurality of different mode directions, by, for each of the directional energy values, computing a scalar product of a mode direction vector and a vector of pixel value changes from the 3D multi-directional gradient block; and selecting a mode direction that is associated with a direction of minimum pixel value change by selecting a minimal directional energy value; computing a predicted intra frame encoding residual data for the data block associated with the selected mode based on the minimal directional energy value; computing inter frame encoding residual data for the data block associated with the difference between the pixel values of the data block in a current frame and one or more already encoded data blocks in one or more different reference frames; comparing the predicted intra frame encoding and inter frame encoding residual data; and compressing the data block using intra frame encoding or inter frame encoding having the smaller residual data.