Method of and apparatus for deciding encoding mode for variable block size motion estimation

Information

  • Patent Application
  • 20070171974
  • Publication Number
    20070171974
  • Date Filed
    January 08, 2007
    18 years ago
  • Date Published
    July 26, 2007
    17 years ago
Abstract
Provided are a method of and an apparatus for deciding an encoding mode for variable block size motion estimation, which can decide an encoding mode quickly and with less computation during variable block size motion estimation. The method includes searching in a reference frame for a macroblock that is most similar to a current macroblock, selecting a temporary encoding mode candidate group for encoding of the current macroblock from among a plurality of encoding mode candidate groups including at least one encoding mode, using encoding mode information of the searched-for macroblock of the reference frame, selecting the decided temporary encoding mode candidate group or an encoding mode candidate group including an encoding mode using a smaller block than the decided temporary encoding mode candidate group as a final encoding mode candidate group, based on the temporary encoding mode candidate group, the complexity of the current macroblock or sub-blocks obtained by dividing the current macroblock, and the difference between the current macroblock or each of the sub-blocks and the reference frame, and performing motion estimation in encoding mode included in the final encoding mode candidate group and deciding an encoding mode of the current macroblock.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects of the present invention will become more apparent by describing in detail an exemplary embodiment thereof with reference to the attached drawings, in which:



FIG. 1 illustrates blocks of various sizes used in variable block size motion estimation of related art H.264/MPEG-4 AVC;



FIG. 2 illustrates a variable block size motion estimated image according to the related art;



FIG. 3 is a block diagram of a video encoder incorporating an apparatus for deciding an encoding mode according to an exemplary embodiment of the present invention;



FIG. 4 is a block diagram of an apparatus for deciding an encoding mode according to an exemplary embodiment of the present invention;



FIG. 5 is a flowchart illustrating a method of deciding an encoding mode according to an exemplary embodiment of the present invention;



FIG. 6 is a diagram for explaining the process of deciding a temporary encoding mode candidate group according to an exemplary embodiment of the present invention;



FIG. 7 is an enlargement of an overlapping region of FIG. 6 according to an exemplary embodiment of the present invention;



FIG. 8 illustrates encoding mode candidate groups according to an exemplary embodiment of the present invention; and



FIG. 9 is a diagram for explaining the process of calculating a temporal difference between a current macroblock and its corresponding macroblock in a previous reference frame according to an exemplary embodiment of the present invention.


Claims
  • 1. A method of deciding an encoding mode for variable block size motion estimation, the method comprising operations of: (a) searching in a reference frame for a macroblock that is most similar to a current macroblock;(b) selecting a temporary encoding mode candidate group for encoding the current macroblock from among a plurality of encoding mode candidate groups comprising at least one encoding mode, using encoding mode information on the searched-for macroblock of the reference frame;(c) selecting the temporary encoding mode candidate group or an encoding mode candidate group comprising an encoding mode using a smaller block than the temporary encoding mode candidate group as a final encoding mode candidate group, based on the temporary encoding mode candidate group, complexity of the current macroblock or sub-blocks obtained by dividing the current macroblock, and difference between the current macroblock or each of the sub-blocks and the reference frame; and(d) performing motion estimation in encoding modes included in the final encoding mode candidate group and deciding an encoding mode of the current macroblock.
  • 2. The method of claim 1, wherein operation (a) comprises: (a1) searching in the reference frame for a region that is most similar to the current macroblock; and(a2) searching for a macroblock having the largest overlap with a searched-for region if the searched-for region overlaps a plurality of macroblocks in the reference frame.
  • 3. The method of claim 1, wherein the plurality of encoding mode candidate groups comprises: a first encoding mode candidate group comprising an inter 16×16 mode;a second encoding mode candidate group comprising the inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, and an inter 8×8 mode; anda third second encoding mode candidate group comprising the inter 16×16 mode, the inter 16×8 mode, the inter 8×16 mode, the inter 8×8 mode, an inter 8×4 mode, an inter 4×8 mode, and an inter 4×4 mode.
  • 4. The method of claim 1, wherein the difference between the current macroblock or each of the sub-blocks and the reference frame is a sum of absolute differences (SAD) between a pixel value of the current macroblock or each of the sub-blocks and a pixel value of a corresponding block of the reference frame.
  • 5. The method of claim 1, wherein if the selected temporary encoding mode candidate group is a first encoding mode candidate group comprising an inter 16×16 mode, then operation (c) comprises: (c1) calculating the complexity of the current macroblock and the difference between the current macroblock and its corresponding macroblock of the reference frame; and(c2) selecting the first encoding mode candidate group as the final encoding mode candidate group if the complexity and the difference calculated in operation (c1) are less than first predetermined threshold values.
  • 6. The method of claim 5, further comprising selecting the encoding mode candidate group, comprising the encoding mode using the smaller block than the first encoding mode candidate group, as the final encoding mode candidate group if the complexity and difference calculated in operation (c1) are not less than the first predetermined threshold values.
  • 7. The method of claim 1, wherein if the selected temporary encoding mode candidate group is a second encoding mode candidate group comprising an inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, and an inter 8×8 mode, operation (c) comprises: (c1) dividing the current macroblock into four 8×8 blocks;(c2) calculating the complexity of each of the 8×8 blocks and the difference between each of the 8×8 blocks and its corresponding block in the reference frame; and(c3) selecting the second encoding mode candidate group as the final encoding mode candidate group if the complexity and the difference calculated in operation (c2) are less than second predetermined threshold values.
  • 8. The method of claim 7, further comprising: (c4) dividing each of the 8×8 blocks into four 4×4 blocks if the complexity and the difference calculated in operation (c2) are not less than the second predetermined threshold values;(c5) calculating complexity of each of the 4×4 blocks and difference between each of the 4×4 blocks and its corresponding block in the reference frame; and(c6) selecting the second encoding mode candidate group as the final encoding mode candidate group if a number of 4×4 blocks, satisfying conditions that the complexity and the difference calculated in operation (c5) are greater than third predetermined threshold values, is less than a predetermined value.
  • 9. The method of claim 8, further comprising: (c7) selecting a third encoding mode candidate group comprising an inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, an inter 8×8 mode, an inter 8×4 mode, an inter 4×8 mode, and an inter 4×4 mode as the final encoding mode candidate group, if a number of 4×4 blocks satisfying the conditions, that the complexity and the difference calculated in operation (c5) are greater than the third predetermined threshold values, is not less than the predetermined value.
  • 10. The method of claim 1, wherein operation (d) comprises performing motion estimation in the encoding modes included in the final encoding mode candidate group, comparing rate-distortion (RD) costs of the encoding modes, and deciding an encoding mode of the current macroblock.
  • 11. An apparatus for deciding an encoding mode for variable block size motion estimation, the apparatus comprising: a temporary encoding mode candidate group decision unit which searches in a reference frame for a macroblock that is most similar to a current macroblock and selects a temporary encoding mode candidate group for encoding the current macroblock from among a plurality of encoding mode candidate groups comprising at least one encoding mode, using encoding mode information of the searched-for macroblock of the reference frame;a calculation unit which calculates complexity of the current macroblock or sub-blocks obtained by dividing the current macroblock, and difference between the current macroblock or each of the sub-blocks and the reference frame;a final encoding mode candidate group selection unit which selects the temporary encoding mode candidate group or an encoding mode candidate group comprising an encoding mode using a smaller block than the temporary encoding mode candidate group as a final encoding mode candidate group, based on the temporary encoding mode candidate group, the complexity of the current macroblock or sub-blocks obtained by dividing the current macroblock, and the difference between the current macroblock or each of the sub-blocks and the reference frame; andan encoding mode decision unit which performs motion estimation in encoding modes included in the final encoding mode candidate group and deciding an encoding mode of the current macroblock.
  • 12. The apparatus of claim 11, wherein the temporary encoding mode candidate group decision unit searches in the reference frame for a region that is most similar to the current macroblock and searches for a macroblock comprising the largest overlap with the searched-for region if the searched-for region overlaps a plurality of macroblocks in the reference frame.
  • 13. The apparatus of claim 11, wherein the plurality of encoding mode candidate groups comprises: a first encoding mode candidate group comprising an inter 16×16 mode;a second encoding mode candidate group comprising the inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, and an inter 8×8 mode; anda third second encoding mode candidate group comprising the inter 16×16 mode, the inter 16×8 mode, the inter 8×16 mode, the inter 8×8 mode, an inter 8×4 mode, an inter 4×8 mode, and an inter 4×4 mode.
  • 14. The apparatus of claim 11, wherein the calculation unit calculates a sum of absolute differences (SAD) between a pixel value of the current macroblock or each of the sub-blocks and a pixel value of a corresponding block of the reference frame as the difference between the current macroblock or each of the sub-blocks and the reference frame.
  • 15. The apparatus of claim 11, wherein if the selected temporary encoding mode candidate group is a first encoding mode candidate group comprising an inter 16×16 mode, the final encoding mode candidate group selection unit selects the first encoding mode candidate group as the final encoding mode candidate group if the complexity of the current macroblock and the difference between the current macroblock and its corresponding macroblock of the reference frame are less than first predetermined threshold values.
  • 16. The apparatus of claim 15, wherein the final encoding mode candidate group selection unit selects the encoding mode candidate group comprising the encoding mode using the smaller block than the first encoding mode candidate group, as the final encoding mode candidate group if the calculated complexity and difference are not less than the first predetermined threshold values.
  • 17. The apparatus of claim 11, wherein if the selected temporary encoding mode candidate group is a second encoding mode candidate group comprising an inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, and an inter 8×8 mode, the final encoding mode candidate group selection unit selects the second encoding mode candidate group as the final encoding mode candidate group if the complexity of each of four 8×8 blocks obtained by dividing the current macroblock and the difference between each of the 8×8 blocks and its corresponding block in the reference frame are less than second predetermined threshold values.
  • 18. The apparatus of claim 17, wherein using complexity of each of 4×4 blocks obtained by dividing each of the 8×8 blocks, satisfying conditions that the complexity of each of the 8×8 blocks and the difference between each of the 8×8 blocks and its corresponding block in the reference frame are not less than the second predetermined threshold values, and difference between each of the 4×4 blocks and its corresponding block in the reference frame, if a number of 4×4 blocks, satisfying conditions that the complexity of each of the 4×4 blocks and the difference between each of the 4×4 blocks and its corresponding block in the reference frame are greater than third predetermined threshold values, is less than a predetermined value, the final encoding mode candidate group selection unit selects the second encoding mode candidate group as the final encoding mode candidate group.
  • 19. The apparatus of claim 18, wherein if a number of 4×4 blocks, satisfying the conditions that the complexity of each of the 4×4 blocks and the difference between each of the 4×4 blocks and its corresponding block in the reference frame are greater than the third predetermined threshold values, is not less than the predetermined value, the final encoding mode candidate group selection unit selects a third encoding mode candidate group comprising an inter 16×16 mode, an inter 16×8 mode, an inter 8×16 mode, an inter 8×8 mode, an inter 8×4 mode, an inter 4×8 mode, and an inter 4×4 mode as the final encoding mode candidate group.
  • 20. The apparatus of claim 11, wherein the encoding mode decision unit performs motion estimation in the encoding modes included in the final encoding mode candidate group, compares rate-distortion (RD) costs of the encoding modes, and decides an encoding mode of the current macroblock.
Priority Claims (1)
Number Date Country Kind
10-2006-0006806 Jan 2006 KR national