A method for performing video motion estimation in video encoding, in which a video signal consists of frames comprising blocks. In the method a combined comparison value is calculated between a current video block of a frame to be encoded and at least one other video block of another frame. The current video block of the frame to be encoded comprises a set of first data values, and the at least one other video block of another frame comprises a set of second data values. Data value pairs are formed of data values from the set of first data values and equal number of corresponding data values from the set of second data values. The combined comparison value is formed by defining comparison values, each of which is defined by using data values of one data value pair of the data value pairs. Further, at least one threshold value is defined, and it is determined whether the process for defining the combined comparison value can be terminated.
A current video block of a frame to be encoded comprises a set of first data values, and at least one other video block of another frame comprises a set of second data values. Data value pairs are formed of data values from said set of first data values and equal number of corresponding data values from said set of second data values. A combined comparison value is formed by defining comparison values, each of which is defined by using data values of one data value pair of said data value pairs. Said data value pairs are divided into at least two sub-sets of data value pairs each sub-set comprising equal number of data value pairs. The calculation of the comparison values is interlaced such that the calculation of comparison values of one sub-set of data value pairs is initiated in a time after initiating and before completing the calculation of comparison values of another sub-set of data value pairs.