A method for encoding a bitstream representing a sequence of pictures of a video stream, where the pictures are divided into units which are further divided into blocks of a first size, wherein the blocks can be divided further into four quarter blocks of a second size, the method comprising: - determining if a unit should be divided into blocks of the first size or quarter blocks of the second size to be used for encoding the units, by: - calculating a result of at least one comparison involving a scaled version of a first error measure associated with one of the quarter blocks, a scaled version of a second error measure associated with at least the remaining quarter blocks; and a threshold C, wherein the first error measure is calculated as a sum of squared differences, SSD, between predicted values and original values of said quarter block, and wherein the second error measure is calculated as a SSD between predicted values and original values of at least said remaining quarter blocks;and when at least one of said comparisons gives a Boolean result of a first kind, wherein said Boolean result of said first kind indicates that a difference between said scaled version of the first error measure and said scaled version of the second error measure is larger than or, in an alternative realisation, is not smaller than said threshold C; - determining that the unit should be divided into quarter blocks of the second size to be used for encoding the picture, and when all of said comparisons give a Boolean result of a second kind different from the first kind, wherein said Boolean result of said second kind indicates that a difference between said scaled version of the first error measure and said scaled version of the second error measure is not larger than or, in said alternative realisation, is smaller than said threshold C,; - determining that the unit should be divided into blocks of the first size to be used for encoding the picture. - determining if a unit should be divided into blocks of the first size or quarter blocks of the second size to be used for encoding the units, by: - calculating a result of at least one comparison involving a scaled version of a first error measure associated with one of the quarter blocks, a scaled version of a second error measure associated with at least the remaining quarter blocks; and a threshold C, wherein the first error measure is calculated as a sum of squared differences, SSD, between predicted values and original values of said quarter block, and wherein the second error measure is calculated as a SSD between predicted values and original values of at least said remaining quarter blocks;and when at least one of said comparisons gives a Boolean result of a first kind, wherein said Boolean result of said first kind indicates that a difference between said scaled version of the first error measure and said scaled version of the second error measure is larger than or, in an alternative realisation, is not smaller than said threshold C; - determining that the unit should be divided into quarter blocks of the second size to be used for encoding the picture, and when all of said comparisons give a Boolean result of a second kind different from the first kind, wherein said Boolean result of said second kind indicates that a difference between said scaled version of the first error measure and said scaled version of the second error measure is not larger than or, in said alternative realisation, is smaller than said threshold C,; - determining that the unit should be divided into blocks of the first size to be used for encoding the picture.