Patent ID: 8462851

Claim:
A video encoding method comprising: dividing, by a video encoding apparatus, a macroblock into first blocks of a predetermined size and performing motion compensation on each of the first blocks; determining, by the video encoding apparatus, a second-block processing order for second blocks of a size smaller than the predetermined size of the first blocks, based on a macroblock division type for motion compensation, for sequentially processing the second blocks included in a current first block of the first blocks in order to transform a residue between a motion compensation value of the current first block, which is generated by the motion compensation, and the current first block in units of the second blocks; and transforming, by the video encoding apparatus, the residue according to the determined second-block processing order in units of the second blocks included in the current first block, wherein when the macroblock division type for motion compensation is one of 8×16 and 4×8 blocks, a processing order of the second blocks for the transforming of the residue is determined such that the second blocks included in a same first block are processed before second blocks included in other first block are processed, and wherein the predetermined size of the first block is one of 8×16 and 4×8 pixels, the size of each of the second blocks is one of 8×8 and 4×4 pixels if the size of the first block is 8×16, and the size of each of the second blocks is 4×4 pixels if the size of the first block is 4×8.