WO2011129672A2 - 영상 부호화/복호화 장치 및 방법 - Google Patents

영상 부호화/복호화 장치 및 방법 Download PDF

Info

Publication number
WO2011129672A2
WO2011129672A2 PCT/KR2011/002762 KR2011002762W WO2011129672A2 WO 2011129672 A2 WO2011129672 A2 WO 2011129672A2 KR 2011002762 W KR2011002762 W KR 2011002762W WO 2011129672 A2 WO2011129672 A2 WO 2011129672A2
Authority
WO
WIPO (PCT)
Prior art keywords
block
subblock
prediction
encoding
encoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/KR2011/002762
Other languages
English (en)
French (fr)
Other versions
WO2011129672A3 (ko
Inventor
송진한
임정연
문주희
이영렬
김해광
전병우
한종기
박형미
이주옥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SK Telecom Co Ltd
Original Assignee
SK Telecom Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020110035426A external-priority patent/KR101791078B1/ko
Application filed by SK Telecom Co Ltd filed Critical SK Telecom Co Ltd
Priority to US13/641,682 priority Critical patent/US9686555B2/en
Priority to CN201180029878.2A priority patent/CN102948149B/zh
Publication of WO2011129672A2 publication Critical patent/WO2011129672A2/ko
Publication of WO2011129672A3 publication Critical patent/WO2011129672A3/ko
Anticipated expiration legal-status Critical
Priority to US14/743,092 priority patent/US9912955B2/en
Priority to US15/851,000 priority patent/US9955167B1/en
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding

Definitions

  • the present invention relates to an image encoding / decoding apparatus and method. More specifically, by dividing the expanded macroblock into subblocks of various sizes and shapes, and encoding the image using different prediction units and transformation units according to the size and shape of the divided subblocks to improve image compression efficiency. A method and apparatus are disclosed. The present invention also relates to an apparatus and method for improving the reconstruction efficiency of an image by receiving a bitstream from such an image encoding apparatus and correspondingly decoding the image.
  • Standardized techniques for compressing video data currently include H.261, H.263, H.264, MPEG-2, and MPEG-4.
  • each image is encoded by dividing each image into fixed-size macroblocks consisting of a rectangular region of pixels of size 16x16 of luminance and pixels of size 8x8 of chrominance.
  • Luma and chrominance components of each macroblock are predicted spatially and temporally, and the predicted residuals are transform and quantization, entropy coding, etc. Compressed through the process of.
  • the encoding apparatus can intra-prediction encode by dividing each macroblock into smaller blocks of 16x16, 8x8, and 4x4 sizes, and 4 kinds of 16x16 pixel blocks. Intra prediction encoding is performed using one of prediction modes, and one of nine prediction modes for 8x8 pixel blocks and 4x4 pixel blocks.
  • each macroblock may be divided into 16x16 size, 16x8 size, 8x16 size, 8x8 size, 8x4 size, 4x8 size, and 4x4 pixel blocks to be inter prediction encoded. Transform is applied in units of 8x8 size or 4x4 pixel block, and scalar quantization is used as quantization of transform coefficients.
  • 16x16 macroblocks are generally suitable for small QCIF and CIF sized images, and are not suitable for macroblocks for high resolution image compression such as 4Kx2K video.
  • the conventional video compression technique encodes an image using a fixed size macroblock (although H.264 / AVC divides and encodes a macroblock into smaller block units, the macroblock size is fixed). In the case of encoding a high resolution image, there is a problem that efficient encoding is difficult.
  • the present invention extends a macroblock to various sizes, divides the expanded macroblock into subblocks of various sizes and shapes, and different prediction units and transform units according to the size of the divided subblocks.
  • the main purpose is to improve the compression efficiency and the reconstruction efficiency by encoding and decoding an image using the image.
  • an image encoding / decoding apparatus generates a prediction subblock by predicting a subblock in which a macroblock is divided, and subtracts the residual subblock and the prediction subblock.
  • Generate a quantized transform coefficient by transforming and quantizing a residual subblock using a transform selected according to the size of the subblock, generating encoded image data by encoding the quantized transform coefficient, and segmenting the subblock
  • An image encoder for selectively calculating and determining an encoding cost when determining an encoding mode for at least one of a block type, a prediction mode, a transform type, and a motion vector for the block; And restoring the partition type information, the motion information, the transform type information, and the quantized transform coefficients by decoding the encoded data having the encoding cost selectively determined, and inverting the quantized transform coefficients by using the transform identified by the recovered transform type information.
  • An image encoding apparatus for achieving the above object includes a predictor for predicting a subblock in which a macroblock is divided to generate a predicted subblock; A subtractor for subtracting the subblock and the predictive subblock to generate a residual subblock; A transform and quantizer for transforming and quantizing the remaining subblocks using a transform selected according to the size of the subblock to produce quantized transform coefficients; And an encoder that encodes the quantized transform coefficients to generate encoded image data, wherein the encoding cost is determined when determining an encoding mode for at least one of a block type, a prediction mode, a transform type, and a motion vector for the divided subblock. It is characterized by selectively calculating and determining.
  • the encoding cost may be selected and calculated differently depending on whether the size of the subblock is greater than or equal to the size of the set pixel block.
  • the coding cost may be calculated according to the following equation.
  • RDcost SATD (or SAD) + ⁇ Bit [block type, prediction info, CBP]
  • RDcost is a coding cost by a bit rate-distortion optimization technique
  • SAD is a sum of absolute values and differences between an original image and a predicted image
  • SATD converts residual blocks to absolute values.
  • the sum is a sum of the two values
  • is a constant determined by a quantization parameter
  • Bit represents the number of bits required to encode a block to be encoded.
  • the coding cost may be calculated according to the following equation.
  • RDcost Distortion + ⁇ Bit [block type, prediction info, CBP, coeficient]
  • RDcost is an encoding cost by a bit rate-distortion optimization technique
  • is a constant determined by a quantization parameter
  • Bit represents the number of bits necessary for encoding an encoding target block.
  • the coding cost may be differently selected depending on whether or not it is used as a reference picture.
  • An image decoding apparatus for achieving the above object includes: a decoder configured to decode coded data for which a coding cost is selectively determined and to reconstruct partition type information, motion information, transform type information, and quantized transform coefficients; An inverse quantizer and an inverse transformer for restoring the remaining subblocks by inverse quantization and inverse transformation of the quantized transform coefficients using a transform identified by the transformed type information to be recovered; A predictor for predicting a subblock identified according to the reconstructed partition type information by using the reconstructed motion information to generate a predicted subblock; And an adder for reconstructing the subblock by adding a prediction subblock and the residual subblock.
  • an image encoding / decoding method generates a prediction subblock by predicting a subblock in which a macroblock is divided, and subtracts the residual subblock and the prediction subblock.
  • a method of encoding an image including: generating a prediction subblock by predicting a subblock in which a macroblock is divided; Generating a residual subblock by subtracting the subblock and the prediction subblock; Transforming and quantizing a residual subblock using a transform selected according to the size of the subblock to generate quantized transform coefficients; And generating encoded image data by encoding the quantized transform coefficients, wherein the encoding cost is determined when determining an encoding mode for at least one of a block type, a prediction mode, a transform type, and a motion vector for the divided subblock. It is characterized by selectively calculating and determining.
  • the encoding cost may be selected and calculated differently depending on whether the size of the subblock is greater than or equal to the size of the set pixel block.
  • the coding cost may be calculated according to the following equation.
  • RDcost SATD (or SAD) + ⁇ Bit [block type, prediction info, CBP]
  • RDcost is a coding cost by a bit rate-distortion optimization technique
  • SAD is a sum of absolute values and differences between an original image and a predicted image
  • SATD converts residual blocks to absolute values.
  • the sum is a sum of the two values
  • is a constant determined by a quantization parameter
  • Bit represents the number of bits required to encode a block to be encoded.
  • the coding cost may be calculated according to the following equation.
  • RDcost Distortion + ⁇ Bit [block type, prediction info, CBP, coeficient]
  • RDcost is an encoding cost by a bit rate-distortion optimization technique
  • is a constant determined by a quantization parameter
  • Bit represents the number of bits necessary for encoding an encoding target block.
  • the coding cost may be differently selected depending on whether or not it is used as a reference picture.
  • An image encoding method for achieving the above object, the method comprising: restoring the partition type information, motion information, transform type information and quantized transform coefficients by decoding the encoded data having the encoding cost selectively determined; Inversely quantizing and inversely transforming the quantized transform coefficients using a transform identified by the transformed type information to be recovered to recover the remaining subblocks; Generating a predicted subblock by predicting a subblock identified according to the reconstructed partition type information using the reconstructed motion information; And reconstructing the subblock by adding the prediction subblock and the residual subblock.
  • compression efficiency is achieved by dividing an extended macroblock into subblocks of various sizes and shapes, and encoding and decoding an image using different prediction units and transformation units according to the sizes of the divided subblocks. And the recovery efficiency can be improved.
  • FIG. 1 is a block diagram schematically illustrating a video encoding apparatus according to an embodiment of the present invention.
  • FIG. 2 is a diagram illustrating encoding and decoding when an input image is padded according to an embodiment of the present invention.
  • FIG. 2 illustrates an input image and positions of an extended macroblock to be currently encoded.
  • FIG. 3 is an enlarged view of an extended macroblock that is currently encoded in FIG. 2.
  • FIG. 4 is a diagram illustrating an example of a process of dividing a macroblock into subblocks of various sizes for intra prediction encoding and inter prediction encoding according to an embodiment of the present invention.
  • FIG. 5 is a diagram illustrating an example of a process of dividing a macroblock into subblocks of various sizes for intra prediction encoding and inter prediction encoding according to another embodiment of the present invention.
  • FIG. 6 is an exemplary diagram for describing a method of encoding an intra picture and related data to be transmitted through encoded data, according to an embodiment of the present invention.
  • FIG. 7 is an exemplary diagram illustrating nine prediction directions and prediction mode numbers according to intra prediction modes of luminance components according to an embodiment of the present invention.
  • FIG. 8 is an exemplary diagram illustrating four prediction directions and prediction mode numbers according to intra prediction modes of luminance components according to an embodiment of the present invention.
  • FIG. 9 is an exemplary diagram illustrating three prediction directions and prediction mode numbers according to intra prediction modes of luminance components according to an embodiment of the present invention.
  • FIG. 10 is an exemplary diagram illustrating prediction directions and prediction mode numbers according to four intra prediction modes of a color difference component according to an embodiment of the present invention.
  • 11 is an exemplary diagram illustrating various subblock types for an extended macroblock of 64x64 pixels according to an embodiment of the present invention.
  • FIG. 12 is an exemplary diagram for describing an encoding method of an inter picture and related data to be transmitted through encoded data according to an embodiment of the present invention.
  • FIG. 13 is an exemplary view for explaining a process of determining a predicted motion vector according to an embodiment of the present invention.
  • FIG. 14 is an exemplary diagram for describing a process of determining a predicted motion vector of an 8x16 pixel block and a 16x8 pixel block according to an embodiment of the present invention.
  • FIG. 15 is an exemplary diagram illustrating types of usable transforms and units in which transform types are encoded according to subblock sizes according to an embodiment of the present invention.
  • 16 is an exemplary diagram illustrating a block boundary to perform deblocking filtering according to an embodiment of the present invention.
  • 17 is an exemplary diagram illustrating syntax of an intra picture according to an embodiment of the present invention.
  • 18 is an exemplary view showing a number for each division type according to an embodiment of the present invention.
  • FIG. 19 is a diagram illustrating a split type number coding sequence in the case of dividing an expanded macroblock into subblocks of various sizes according to an embodiment of the present invention.
  • 20 is an exemplary diagram sequentially illustrating a process of dividing a macroblock into divided layers according to an embodiment of the present invention.
  • 21 is an exemplary diagram for describing a process of sequentially encoding a split type number for each layer of a macroblock.
  • 22 is an exemplary diagram illustrating a coding order of an intra prediction mode according to an embodiment of the present invention.
  • FIG. 23 is an exemplary diagram for explaining an example of a process of encoding an intra prediction mode of a macroblock according to an embodiment of the present invention.
  • 24 is an exemplary diagram for describing a process of encoding a CBPX_flag and a CBP for an intra macroblock according to an embodiment of the present invention.
  • 25 is an exemplary view showing the structure of a CBP according to an embodiment of the present invention.
  • FIG. 26 is an exemplary diagram illustrating an example of a sequence of encoding a CBPX flag and a CBP according to an embodiment of the present invention.
  • FIG. 27 is an exemplary diagram illustrating another example of a sequence of encoding a CBPX flag and a CBP for an intra macroblock according to an embodiment of the present invention.
  • FIG. 28 is an exemplary diagram illustrating a coding order of quantized transform coefficients for each partition type according to an embodiment of the present invention.
  • 29 is an exemplary diagram illustrating a syntax structure of encoded data according to an embodiment of the present invention.
  • FIG. 30 is a diagram illustrating an example of syntax used in a P-picture (or P-slice) according to an embodiment of the present invention.
  • FIG. 31 is a diagram illustrating an example of syntax used in a B-picture (or B-slice) according to an embodiment of the present invention.
  • 32 is an exemplary diagram for describing an encoding process of a SKIPX flag according to an embodiment of the present invention.
  • 33 and 34 are exemplary diagrams for describing a CBPX_flag, a transform type, and a CBP encoding process for an inter macroblock according to an embodiment of the present invention.
  • 35 is a diagram illustrating an example of ctx_inc for encoding / decoding skipX_flag according to an embodiment of the present invention.
  • 36 illustrates an example of ctx_inc for encoding / decoding interX_flag according to an embodiment of the present invention.
  • 38 and 39 are diagrams for describing a process of encoding split type information using a tree structure according to an embodiment of the present invention.
  • FIG. 40 is a diagram illustrating an example of encoding of a partition type according to an embodiment of the present invention.
  • 41 is a diagram illustrating another example of split type encoding according to an embodiment of the present invention.
  • FIG. 43 is a diagram illustrating an example of ctx_inc for encoding / decoding a transform type when two types of transforms are available according to an embodiment of the present invention.
  • FIG. 44 is a diagram illustrating an example of ctx_inc for encoding / decoding a transform type when there are three types of transforms available according to an embodiment of the present invention.
  • FIG. 45 is a diagram illustrating another example of ctx_inc for encoding / decoding a transform type when there are three types of transforms available according to an embodiment of the present invention.
  • 46 is a block diagram schematically illustrating an image decoding apparatus according to an embodiment of the present invention.
  • 48 is a diagram illustrating types of transforms according to an intra prediction mode.
  • FIG. 49 is a diagram illustrating types of transforms according to types of horizontal and vertical transforms according to an intra prediction mode of a current block.
  • 50 is an exemplary diagram for describing a process of determining a predicted motion vector according to a second embodiment of the present invention.
  • 51 is a diagram illustrating an allocation code at the time of encoding the representative motion vector of each block group.
  • 52 is a diagram illustrating a current block, neighboring blocks, and the same block.
  • 53 is a diagram illustrating an allocation code at the time of encoding motion information of each block.
  • 54 is a diagram illustrating a shape of a subblock according to a layer of a block.
  • 55 is a diagram illustrating syntax of a macroblock, a subblock, and a predictive subblock of an intra picture according to an embodiment of the present invention.
  • 56 is an exemplary diagram illustrating a syntax structure of encoded data for an inter picture according to an embodiment of the present invention.
  • 57 is a diagram illustrating an example of a process of encoding transform information and a CBP flag in a macroblock.
  • a video encoding apparatus (Video Encoding Apparatus) and a video decoding apparatus (Video Decoding Apparatus) are a personal computer (PC), a notebook computer, a personal digital assistant (PDA).
  • a portable multimedia player (PMP: Portable Multimedia Player), a PlayStation Portable (PSP: PlayStation Portable), a wireless communication terminal (Wireless Communication Terminal), a smart phone (smart phone), etc.
  • the present invention refers to various devices including a communication device such as a communication modem, a memory for storing various programs and data for encoding or decoding an image, a microprocessor for executing and operating a program, and the like.
  • an image encoded in a bitstream by an image encoding apparatus may be connected to a wired / wireless communication network such as the Internet, a local area wireless communication network, a wireless LAN network, a WiBro network, a wireless communication network, a wired telephone network, or the like by using a cable or a general serial bus in real time or in real time.
  • the device may be transmitted to an image decoding apparatus through a communication interface such as a universal serial bus (USB), and decoded by the image decoding apparatus to be restored and reproduced as an image.
  • a communication interface such as a universal serial bus (USB)
  • FIG. 1 is a block diagram schematically illustrating a video encoding apparatus according to an embodiment of the present invention.
  • the image encoding apparatus 100 includes a predictor 110, a subtractor 120, a transformer and a quantizer 130, an encoder 140, an inverse quantizer and an inverse transformer 150, and an adder ( 160, a filter 170, and a picture buffer 180.
  • the predictor 110 may include an intra predictor 112 and an inter predictor 114, and the inter predictor 114 may further include a motion estimator 116 and a motion compensator 118.
  • the input image is input to the image encoding apparatus 100 of FIG. 1 in a frame unit or a field unit, or divided into macroblocks having N ⁇ N pixels (where N is an integer of 16 or more) to be input to the image encoding apparatus 100.
  • N is an integer of 16 or more
  • encoding may be performed by dividing the macroblock into N macroblocks consisting of integers larger than 16 to improve image compression efficiency.
  • a macroblock consisting of integers with N greater than 16 is referred to as an extended macroblock (EMB).
  • EMB extended macroblock
  • the expanded macroblock may be formed of a square pixel block having a size of 64 ⁇ 64, 32 ⁇ 32, or the like. Note that the macroblock described below is a concept including an extended macroblock and a macroblock of a general 16 ⁇ 16 pixel block.
  • N is padded to be a multiple of 16 pixels for the input image when the input image is not a multiple of 16 pixels. Can be performed.
  • FIG. 2 is a diagram illustrating image encoding and decoding when an input image is padded according to an embodiment of the present invention.
  • FIG. 3 is an enlarged view of an extended macroblock that is an object to be encoded in FIG. . If the location of the input macro padded with multiples of 16 pixels and the extended macroblock to be encoded currently is as shown in FIG. 2, the encoding of the current extended macroblock is a pixel belonging to the padded input image to be a multiple of 16 pixels. It is preferable to use only values. That is, in FIG. 3, the padded region in the current extended macroblock is preferably not used for encoding. It is also preferable to use only pixel values belonging to the input image padded so that the data encoded in the bitstream is a multiple of 16 pixels.
  • the macroblock When the input image is an image of 4: 2: 0 format, the macroblock includes a luminance block having N ⁇ N pixels and a color difference block having two pixels.
  • the improvement of the compression efficiency of the high resolution image by such an extended macroblock is achieved by the specific embodiment described below.
  • the extended macroblock according to an embodiment of the present invention may be internally divided into smaller subblocks as shown in FIG. 4 to perform intra prediction encoding or inter prediction encoding.
  • the expanded macroblock may be divided into smaller pixel block units to perform encoding, and each pixel block is divided into smaller subblocks. Encoding can be performed.
  • a rectangular shape such as 32 ⁇ 64, 64 ⁇ 32, 16 ⁇ 32, or 32 ⁇ 16, as shown in FIG. It is also possible to omit the division into the pixel blocks, and to divide the expanded macroblock into square pixel blocks and to perform encoding in units of 16 ⁇ 16 pixel blocks.
  • the macroblock layer 0 of FIG. 4 includes a 64 ⁇ 64 pixel block, a 64 ⁇ 32 pixel block, a 32 ⁇ 64 pixel block, 32 as a subblock.
  • the 32 x 32 pixel block belongs to the macroblock layer 1, and the 32 x 32 pixel block, the 32 x 16 pixel block, the 16 x 32 pixel block, and the 16 x 16 pixel block may belong to the macroblock layer 1.
  • subblocks having a rectangular shape such as 64 ⁇ 32 pixel blocks, 32 ⁇ 64 pixel blocks, 32 ⁇ 16 pixel blocks, and 16 ⁇ 32 pixel blocks are divided into subblocks larger than 16 ⁇ 16 pixel blocks. Can be omitted.
  • 64x64 pixel blocks and 32x32 pixel blocks, which are subblocks belong to macroblock layer 0
  • 32x32 and 16x16 pixel blocks, which are subblocks belong to macroblock layer 1.
  • the subblocks of the macroblock layer K + 1 may be used only when the largest subblock of the subblocks of the macroblock layer K (where 0 ⁇ K ⁇ log 2 (N / 4)) is divided into four blocks. have. That is, as shown in FIG.
  • the subblocks of macroblock layer 1 may be used only when the 64 ⁇ 64 subblocks of macroblock layer 0 are divided into four subblocks, and the 32 ⁇ 32 subblocks of macroblock layer 1 may be used.
  • the subblocks of macroblock layer 2 may be used only when a block is divided into four 16 ⁇ 16 subblocks.
  • the image encoding apparatus 100 calculates encoding efficiency for each subblock when the macroblock is divided into subblocks and encoded, and converts the subblock when the highest encoding efficiency is the final intra prediction block or the inter prediction block.
  • Decide The coding efficiency may be measured based on a rate-distortion optimization (RDO) technique as shown in Equation (1).
  • RDO rate-distortion optimization
  • Distortion represents an error value between the encoding target block and the reconstruction block
  • is a constant determined by a quantization parameter
  • Bit represents the number of bits necessary for encoding the encoding target block.
  • the encoding cost may be selectively calculated and determined.
  • the encoding cost may be selected and calculated differently depending on whether the size of the subblock is equal to or larger than the size of the set pixel block (eg, 16 ⁇ 16 pixel block).
  • the mode of a block can be divided into the process of determining the optimal prediction mode (intra prediction mode, motion data) of each block for all types of possible blocks, and then determining the block type, and usually in determining the prediction mode (intra prediction mode).
  • SAD Sum of Absolute Difference
  • SATD Sum of Absolute Transformed Difference
  • Equation 2 SAD refers to the difference between the original image and the predicted image, plus all the absolute values, and SATD adds the absolute value to the residual block after the transformation is performed.
  • Equation 3 Distortion of Equation 3 may be represented by Equation 4.
  • Equation (2) is less than the equation (3), but since the distortion is almost the same in the case of a motionless or uncomplicated region, it is difficult to determine the optimal mode using the equation (2).
  • Equation 3 can calculate more accurate coding efficiency than Equation 2, but has a disadvantage in that a large amount of calculation is required. Therefore, in the embodiment of the present invention, it is preferable to select and use Equation 2 or Equation 3 according to the importance of data (whether or not used as a reference picture) or the mode to be encoded. For example, Equation 3 may be used when determining an intra prediction mode and when determining a motion vector / reference picture of a block.
  • the prediction directions (L0 prediction, L1 prediction, bidirectional prediction) and the motion vector / reference picture determination process of a pixel block of 16 ⁇ 16 or larger size of a B picture are performed according to each prediction direction.
  • 3 is used, and the prediction direction may be determined using Equation 2.
  • Equation 3 may be used to determine the block type.
  • the encoding cost may be determined according to Equation 3
  • the encoding cost may be determined according to Equation 2.
  • the encoding modes that 16 ⁇ 16 pixel blocks can have are 16 ⁇ 16 SKIP mode, 16 ⁇ 16 Direct mode, and L0 prediction mode.
  • 16 ⁇ 16 blocks for example, there may be motion information and residual data
  • 16 ⁇ 16 blocks for example, there may be motion information and residual data
  • 16 ⁇ 16 blocks for example, there may be motion information and residual data
  • L1 prediction mode L0 and L1 16 ⁇ 16 blocks (eg, there may be motion information and residual data) that use all of the prediction modes
  • 16 ⁇ 16 intra blocks It is preferable to use a precise encoding cost for encoding modes of 16 ⁇ 16 or more pixelblocks.
  • the block type has a size of 16 ⁇ 16 or more, it is mainly because it is a flat area such as a background, and thus it is difficult to determine an optimal mode with an approximated equation. Therefore, when using blocks of 16 ⁇ 16 or more, the coding cost is selectively used according to the block size and mode when determining the mode within the macroblock. In addition, the parameters used in the equation for calculating the encoding cost may be considered differently from the parameters used for mode determination between small blocks and the parameters used for mode determination between large blocks.
  • the minimum block size is determined according to the maximum layer value MaxLayer, which is the maximum usable layer value. For example, in the case of a macroblock of N ⁇ N pixels, the size of the minimum block is determined as N / (2 MaxLayer ).
  • the image encoding apparatus 100 classifies a picture type in picture units constituting a video and predictively encodes the picture type according to the picture type.
  • the types of macroblocks in the intra picture are all intra macroblocks, and each macroblock is intra prediction encoded.
  • the macroblock type of the macroblocks in the interpicture may be an inter macroblock or an intra macroblock, and may be intra prediction encoded or inter prediction encoded according to the macroblock type.
  • the information about the picture type may be inserted as it is or encoded and inserted into a picture header or a sequence header of encoded data.
  • the picture type of the picture may be determined.
  • FIG. 6 is an exemplary diagram for describing a method of encoding an intra picture and related data to be transmitted through encoded data, according to an embodiment of the present invention.
  • the intra predictor 112 of the predictor 110 generates a reference block by using neighboring pixels of a block to be currently encoded (hereinafter referred to as a 'current block') and compares the reference block with the current block to determine an intra prediction mode.
  • the neighboring pixel refers to pixels in a block around the current block, and includes a neighboring pixel adjacent to the current block in blocks adjacent to the current block.
  • intra prediction When intra prediction is performed by dividing an extended macroblock into 4 ⁇ 4 pixel units for a luminance component, an example of nine prediction directions and prediction mode numbers according to intra prediction modes of the luminance component is illustrated. Referring to 7, the most suitable prediction direction among nine prediction directions (prediction directions according to prediction mode 0 to prediction mode 8) is selected one for each current block in units of 4x4 pixels, and the current prediction direction is selected using the selected prediction direction. Intra-prediction coding a block.
  • the mean value of prediction mode 2 means that the average value of four adjacent pixels of the left block of the current block and eight adjacent pixels of the four adjacent pixels of the upper block of the current block is calculated to predict all 4 ⁇ 4 pixels of the current block. Way.
  • the left block and the upper block are located outside the picture, respectively.
  • the use of the prediction direction is limited because the block outside the picture boundary cannot be referenced.
  • the prediction direction of the prediction mode 0, the prediction mode 3, the prediction mode 4, the prediction mode 5, the prediction mode 6, and the prediction mode 7 referring to the pixels of the upper block cannot be used in the block located at the top of the picture.
  • prediction of the current block is performed by referring to only pixels that do not deviate from the boundary of the picture. If the left block and the upper block that are adjacent to the current block are not available, the DC value uses 128.
  • the prediction direction of the selected current block is compared with the prediction direction of the block having the smaller prediction mode number among the left block and the upper block of the current block, and when the two prediction directions are the same, the prediction direction of the current block estimated from the neighboring block and the selected current
  • a prediction mode flag (for example, represented by 1 bit) indicating whether the prediction directions of the blocks are the same is encoded to indicate that the prediction direction is the same as the estimated direction.
  • the prediction mode flag is encoded to indicate that the prediction direction of the selected current block is different from the estimated direction of the estimated current block.
  • Prediction mode information for indicating which prediction mode among the eight prediction modes minus the prediction mode corresponding to the prediction direction of the current block estimated in the nine prediction modes is the prediction direction of the selected current block (for example, Can be represented by 3 bits).
  • intra prediction in 8x8 pixel units for a luminance component is performed as in intra prediction in 4x4 pixel units.
  • a method of calculating prediction pixels using nine prediction directions as shown in FIG. 7 is also used for intra prediction coding in units of 4 ⁇ 4 pixels except for differences in block sizes (4 ⁇ 4 pixels and 8 ⁇ 8 pixels). Same as the case.
  • a prediction direction having the best coding efficiency is selected from four prediction directions as shown in FIG. A total of 32 adjacent pixels of 16 adjacent pixels in the 16 ⁇ 16 pixel block located above the current block of size 16 ⁇ 16 according to the selected prediction direction and 16 adjacent pixels in the 16 ⁇ 16 pixel block located to the left of the current block. 16x16 pixel blocks are predictively encoded.
  • interpolation between adjacent pixels in an upper block of the current block and adjacent pixels in a left block of the current block is predicted by interpolation.
  • the mean value prediction corresponding to the prediction mode 2 the mean value predicts the average value of 16 adjacent pixels in the upper block of the current block and 16 adjacent pixels in the left block as 16 ⁇ 16 pixels of the current block.
  • the average value of 16 adjacent pixels in the left block of the current block is used as a prediction value.
  • the top of the current block is used.
  • the average value of 16 adjacent pixels in the block is used as a prediction value.
  • prediction mode information e.g., represented by 2 bits.
  • the intra prediction mode of the luminance component is shown in FIG. It can be represented by the prediction direction of the branch and the prediction mode number.
  • the subblock size is m ⁇ n.
  • the m ⁇ n pixel block is intra predictively encoded from m neighboring pixels in the upper block of the current block and n neighboring pixels in the left block according to the prediction direction having the best coding efficiency selected from the same three prediction directions.
  • the current block is predictively encoded using the average value of m neighboring pixels in the upper block of the current block and n neighboring pixels in the left block.
  • the average value of n neighboring pixels of the left block of the current block is used as the prediction value of the current block
  • the upper block An average value of m neighboring pixels in the frame is used as a prediction value of the current block. If the left block and the upper block of the current block are not available, 128 is used as a prediction value of the current block.
  • the prediction direction of the current block estimated from the neighboring blocks of the current block and the selected current Information about a prediction direction that is the same as the prediction direction of the current block in which a prediction mode flag (for example, one bit may be indicated) indicating whether or not the prediction directions of the blocks are the same is encoded.
  • a prediction mode flag for example, one bit may be indicated
  • Mode number 2 DC mode
  • the intra prediction for the extended macroblock may be 16 ⁇ 16 or less pixel block units, that is, 4 ⁇ 4 pixel blocks, 8 ⁇ 8 pixel blocks, 16 ⁇ 16 pixel blocks, or m ⁇ n (where m ⁇ n, m and n are preferably smaller than 16 pixels).
  • Intra prediction of the chrominance component may be performed in units of (N / 2) ⁇ (N / 2) pixel blocks. As shown in FIG. 10, four prediction directions may be used: average prediction, horizontal prediction, vertical prediction, and plane prediction. Preferably, intra prediction of the chrominance component is performed in units of 8x8 pixel blocks.
  • planar prediction corresponding to prediction mode 3 and prediction mode 0 correspond to each other.
  • the prediction value calculation method for predicting the average value is also the same as the intra prediction encoding method in units of 16 ⁇ 16 pixels of luminance components except for the difference in block size (16 ⁇ 16 pixels and 8 ⁇ 8 pixels).
  • the prediction mode of the color difference signal may be selected independently of the prediction mode of the luminance signal. There are two types of color difference signals, U and V, but the prediction method is the same.
  • the prediction mode of the chrominance signal is one each of U and V.
  • the prediction mode of each chrominance signal is represented by using two bits instead of the predictive coding.
  • the intra predictor 112 predicts the current block in nine prediction directions for 4 ⁇ 4 pixel units in the same manner as described above with reference to FIGS. 7 to 10, thereby predicting encoding encoding rate-distortion optimization.
  • Intra prediction mode which is determined in the same way, in prediction mode, which is predicted by nine prediction directions for 8x8 pixel units, and in intra prediction mode, which is determined in the same manner as rate-distortion optimization, in 16x16 pixel units.
  • the rate-distortion optimization equation used at this time is preferably in accordance with the above equation (3). In this way, if the intra prediction mode is determined, the size of the subblock is also determined accordingly.
  • the intra predictor 112 predicts the current block to generate a predicted block, and the subtractor 120 subtracts the current block and the predictive block to residual blocks.
  • Block The transformer and quantizer 130 transform and quantize the residual block to generate quantized transform coefficients, and the encoder 140 entropy encodes the quantized transform coefficients to generate encoded data.
  • the converter and quantizer 130 performs 4x4 transform on the remaining blocks of the current block in which intra prediction in units of 4x4, 4x8, and 8x4 pixels of the luminance component is selected, and 8x8, 8x.
  • An 8 ⁇ 8 transform may be performed on the residual block of the current block in which intra prediction of 16 ⁇ 16 ⁇ 8 pixel units is selected.
  • the converter and quantizer 130 may perform 16 ⁇ 16 transform on the residual block of the current block in which intra prediction of 16 ⁇ 16 pixels or more is selected. In this case, since the unit of intra prediction and the size of the subblock are the same, the type of transform may be determined according to the block size of the subblock.
  • a residual block having 16 ⁇ 16 pixels to which each 16 ⁇ 16 transform is performed (hereinafter, referred to as a “16 ⁇ 16 pixel residual block”) is again a residual block having 16 4 ⁇ 4 pixels (hereinafter referred to as “4 ⁇ 4 pixels”).
  • the 4x4 transform may be performed on each 4x4 pixel residual block.
  • only 16 DC components of a transform block (hereinafter, referred to as a 4x4 pixel transform block) having 4x4 pixels generated by 4x4 transforming each 4x4 pixel residual block are collected 4x4.
  • a transform block (hereinafter referred to as a 'DC component block') having a transform coefficient is configured, and the 4 ⁇ 4 transform is performed once more for the DC component block.
  • a transform different from the transform when the residual block is transformed may be used to transform the DC component block. That is, a 4 ⁇ 4 Discrete Cosine Transform (DCT) is performed on the 4 ⁇ 4 pixel residual block, and a 4 ⁇ 4 Hadamard transform may be used on the DC component block.
  • DCT Discrete Cosine Transform
  • a 16 ⁇ 32 pixel residual block for the current block for which intra prediction is selected in units of 16 ⁇ 32 pixels is divided into two 16 ⁇ 16 pixel residual blocks and 4 ⁇ 4 for each 16 ⁇ 16 pixel residual block divided.
  • 4x4 conversion is performed pixel by pixel. Thereafter, DC components of the 4x4 transform blocks in the 16x16 pixel residual block are collected to form a DC component block, and 4x4 transform is performed once more on the DC component block
  • the encoding mode is determined only for the actual image region (16 ⁇ 16 pixel block), and the division type, the intra prediction mode, the CBP, and the transform coefficient of the corresponding region are encoded.
  • FIG. 11 is an exemplary diagram illustrating a block type of a sub block for an extended macroblock of 64 ⁇ 64 pixels according to an embodiment of the present invention.
  • the extended macroblock is a 64x64 pixel block and the optimal block type after intra prediction is determined as shown in FIG. 11, 4x4 transform is performed for blocks 0-7 and blocks 8-block are performed. 8x8 transform is performed for 12, and 4x4 transform is performed in 4x4 pixel units within a 16x16 pixel block for blocks 13 to 18, and each 4x4 transform is performed in each 16x16 pixel block. The conversion is again performed on the DC component block in which the DC components of the blocks are assembled.
  • 4 ⁇ 4 transform is performed as in the case of intra prediction of 16 ⁇ 16 pixels or more, and then 4 ⁇ 4 transform is performed once more for the DC component block.
  • the residual block of the macroblock of the chrominance component is divided into a residual block having 8x8 pixels (hereinafter referred to as an '8x8 pixel residual block') and four 4x4 pixels remaining in each 8x8 pixel residual block.
  • 4 ⁇ 4 transform is performed on the block.
  • DC components of four 4x4 transform blocks in an 8x8 pixel residual block gather to form a DC component block having a 2x2 transform coefficient, and 2x2 transform is performed on the DC component block.
  • the types of 4x4 transforms for the 8x8 pixel residual block and 2x2 transforms for the DC component block may be different.
  • the efficiency is high depending on the size of the sub-block used for intra prediction in units of 16 ⁇ 16 pixel blocks.
  • the encoder 140 it is preferable that the encoder 140 generates transform type data by generating and encoding a transform type for identifying the type of the transform selected for each block. Transform type data is included in the encoded data. However, different transforms cannot be used within a 16x16 pixel block.
  • a 16 ⁇ 16 pixel block is divided into 8 ⁇ 8 pixel blocks, and one or more 8 ⁇ 8 pixel blocks among four 8 ⁇ 8 pixel blocks are divided into subblocks smaller than 8 ⁇ 8 pixels.
  • only 4x4 transform may be used for the 16x16 pixel block, and in this case, the transform type is not encoded.
  • 4 ⁇ 4 transform and 8 ⁇ 8 transform are performed on the 16 ⁇ 16 pixel block, so that a transform having a low encoding cost is selected.
  • a transformation type (for example, may be represented by 1 bit) indicating a type of may be encoded.
  • a subblock of 16 ⁇ 16 pixels or more 4 ⁇ 4 transform, 8 ⁇ 8 transform, and 16 ⁇ 16 transform are performed so that the transform having the smallest encoding cost is selected, and a transform type (for example, 1) Bit or 2 bits) may be encoded.
  • a transform type for example, 1) Bit or 2 bits
  • FIG. 12 is an exemplary diagram for describing an encoding method of an inter picture and related data to be transmitted through encoded data according to an embodiment of the present invention.
  • all block types of FIG. 4 may be used for motion estimation, and within an extended macroblock, it may be selected whether it is intra mode or inter mode in units of 16 ⁇ 16 pixel blocks. That is, both intra mode and inter mode may be used in an extended macroblock of a P-picture or a P-slice.
  • L0 prediction (List 0 Prediction, mainly used for forward prediction) is used as forward prediction
  • L1 prediction (List 1 Prediction, mainly used for backward prediction) is used as backward prediction.
  • the extended macroblock is a 32 ⁇ 32 pixel block
  • whether to perform encoding in units of 32 ⁇ 32 pixel blocks or encoding in units of 16 ⁇ 16 pixel blocks may be indicated through an extended macroblock flag (extended_mb_flga).
  • extended macroblock flag is 1, the encoding is performed in units of 32 ⁇ 32 pixel blocks, and when the extended macroblock flag is 0, encoding is performed in units of 16 ⁇ 16 pixel blocks. can do.
  • the extended macroblock flag is 0, the extended macroblock may be divided into four 16 ⁇ 16 pixel blocks to determine whether it is an intra mode or an inter mode for each 16 ⁇ 16 pixel block.
  • each 16x16 pixelblock unit may be divided into smaller subblocks to perform encoding.
  • the motion estimator 116 of the inter predictor 114 of the predictor 110 finds a block most similar to the current block that is the current encoding target in the current picture, that is, a reference block within the reference picture, for the current block.
  • a motion vector (MV) indicating a relative position of the reference block is output. This process is called motion estimation, and motion estimation generates a motion vector by comparing subblocks in a macroblock with one or more reference pictures in the picture buffer 180.
  • the 8x8 pixel block may use different reference pictures, but the subblocks in the 8x8 pixel block use the same reference picture.
  • the motion vector is encoded by the encoder 140 and included in the encoded data.
  • the encoder 140 uses a median of motion vectors of neighboring blocks of the current block as a predicted motion vector (PMV). Only the differential motion vector (DMV), which is a difference vector between the predicted motion vector and the motion vector of the current block, is encoded to generate motion information data.
  • the encoder 140 may further encode not only a differential motion vector but also a reference picture index. That is, the motion information may include a differential motion vector and a reference picture index, and the encoder 140 may encode the motion information to generate motion information data and include the motion information data in the encoded data.
  • FIG. 13 is an exemplary view for explaining a process of determining a predicted motion vector according to an embodiment of the present invention.
  • 13A illustrates the motion vector of the neighboring block used to determine the motion vector and the predictive motion vector of the current block when both the current block and the neighboring block are 64 ⁇ 64 pixel blocks.
  • the median of the motion vectors of the neighboring block may be determined as the predicted motion vector as in the conventional method.
  • 13B illustrates the motion vector of the neighboring block used to determine the motion vector and the predictive motion vector of the current block when the sizes of the current block and the neighboring block are different. If the size of the current block and the neighboring block is different, it is necessary to select which neighboring block to determine the prediction motion vector.
  • the motion vector mvA of the block A located on the upper right side is used for prediction
  • the motion vector mvB of the lowermost left block B is used for prediction when the neighboring blocks at the top are divided into several
  • the motion vector mvC of C is used for prediction.
  • the prediction motion vector may not be determined using the block B and the block C.
  • the motion vector of the block is used to determine a predicted motion vector.
  • FIG. 14 is an exemplary diagram for describing a process of determining a predicted motion vector of an 8x16 pixel block and a 16x8 pixel block according to an embodiment of the present invention.
  • the median value is not used. That is, when the current block is an 8x16 pixel block, block A is used as the neighboring block on the left side and block C is used to determine the predictive motion vector as the neighboring block on the right side. If the current block is a 16x8 pixel block, the upper neighboring block uses block B and the lower neighboring block uses block A to determine the predicted motion vector.
  • the SKIP mode is used for macroblocks that are 16 ⁇ 16 or more pixel blocks.
  • the macroblock which is a 16 ⁇ 16 pixel block or more
  • motion estimation and compensation are performed using the predicted motion vector.
  • the predictive motion vector is determined as 0.
  • the predicted motion vector of the current block is (0). , 10).
  • the extended macroblock is shown in FIG.
  • the predicted motion vector is obtained using the left block and the upper block of the actual image block (16x16 pixel block), and the motion prediction and compensation for the actual image block are performed using the predicted motion vector.
  • the optimal encoding mode of the extended macroblock that is the current encoding target is the SKIP mode, skip32_flag is decoded and the next extended macroblock is encoded.
  • the subtractor 120 subtracts the current block and the reference block indicated by the motion vector of the current block estimated by the motion estimator 116 to generate a residual block
  • the transformer and quantizer 130 subtracts the subtractor.
  • the residual block generated by 120 is transformed and quantized, and the encoder 140 generates encoded data by entropy encoding the quantized transform coefficients.
  • the transformer and quantizer 130 performs one or more transforms and quantizations according to the size of the current block, selects the most efficient transform type, and generates transform and quantized transform coefficients according to the selected transform type. do.
  • the encoder 140 generates transform type data by generating and encoding a transform type for identifying a type of a transform selected for each block. Transform type data is included in the encoded data. However, different transforms cannot be used within a 16x16 pixel block.
  • a 16x16 pixel subblock is divided into 8x8 pixel blocks, and one or more 8x8 pixel subblocks of four 8x8 pixel subblocks are less than 8x8 pixels.
  • only 4 ⁇ 4 transforms may be used for the remaining blocks of the 16 ⁇ 16 pixel subblocks, in which case the transform type is not encoded.
  • 4 ⁇ 4 transform and 8 ⁇ 8 transform are performed on the remaining blocks of the 16 ⁇ 16 pixel subblock, so that a transform having a low encoding cost is selected.
  • the transform type (for example, represented by 1 bit) indicating the type of the selected transform is encoded.
  • the 4 ⁇ 4 transform, 8 ⁇ 8 transform, and 8 ⁇ 16 transform are performed on the remaining blocks of the 16 ⁇ 16 pixel subblock, thereby encoding costs.
  • the 16 ⁇ 16 pixel subblock is divided into two 16 ⁇ 8 pixel subblocks
  • 4 ⁇ 4 transform and 8 ⁇ 8 transform are performed on the remaining blocks of the 16 ⁇ 16 pixel subblock.
  • a 16x8 transform is performed to select the type of transform having the smallest encoding cost, and to encode a transform type (for example, represented by 1 bit or 2 bits) indicating the type of the selected transform.
  • a subblock of 16 ⁇ 16 pixels or more 4 ⁇ 4 transform, 8 ⁇ 8 transform, and 16 ⁇ 16 transform are performed so that the transform having the smallest encoding cost is selected, and a transform type (for example, 1) Bit or 2 bits) is encoded.
  • a transform type for example, 1) Bit or 2 bits
  • encoding bits used for transform type encoding may be configured as shown in Table 1 below.
  • the transform Encoding bits used for type encoding may be configured as shown in Table 2.
  • FIG. 15 is an exemplary diagram illustrating types of usable transforms and units in which transform types are encoded according to subblock sizes according to an embodiment of the present invention.
  • an extended macroblock is 64 ⁇ 64 pixels and an extended macroblock is divided into subblocks of various sizes.
  • the first 16x16 pixel block 1510 of the macroblock is divided into 4x4 pixel subblocks smaller than the 8x8 pixel block, the only available transform is a 4x4 transform, in which case the transform type is It is not encoded.
  • the second 16 ⁇ 16 pixel block 1520 is divided into four 8 ⁇ 8 pixel subblocks, one of the 4 ⁇ 4 transforms or the 8 ⁇ 8 transform has a smaller encoding cost, and a transform type indicating the type of the selected transform is selected. Is encoded.
  • the third 16 ⁇ 16 pixel block 1530 is divided into two 8 ⁇ 16 pixel subblocks, one of the 4 ⁇ 4 transform, the 8 ⁇ 8 transform, or the 8 ⁇ 16 transform has the smallest encoding cost.
  • a transform type representing is encoded. Since the fourth 16 ⁇ 16 pixel block 1540 is divided into two 16 ⁇ 8 pixel subblocks, one of the 4 ⁇ 4 transform, the 8 ⁇ 8 transform, or the 16 ⁇ 8 transform having the lowest coding cost is selected.
  • a transform type representing is encoded.
  • the fifth 16 ⁇ 32 pixel block (1550), the sixth 16 ⁇ 32 pixel block (1560), the seventh 32 ⁇ 32 pixel block (1570), and the eighth 32 ⁇ 32 pixel block (1580) are all 16 ⁇ 16 pixel blocks.
  • the 8x8 transform, or the 16x16 transform Since it is larger than the 4x4 transform, the 8x8 transform, or the 16x16 transform, one having a smaller encoding cost is selected, and a transform type indicating the type of the selected transform is encoded.
  • the conversion type may be selected in units of 16x16 pixel blocks.
  • a plurality of transform types are encoded for a 16x16 pixel block in which an encoded block pattern in a pixel block larger than a 16x16 pixel block such as a 32x32 pixel block is not zero.
  • the residual block transformed and quantized by the transformer and quantizer 130 is inversely quantized and inversely transformed by the inverse quantizer and inverse transformer 150 to restore the residual block, and the adder 160
  • the current block is reconstructed by adding the reconstructed residual block and the predicted block predicted by the predictor 110.
  • the filter 170 performs filtering using a deblocking filter, etc., on the pictures created by accumulating the current blocks restored by the adder 160, and the filtered pictures are stored in the picture buffer 180 to refer to the next picture. It is used as a picture.
  • 16 is an exemplary diagram illustrating a block boundary to perform deblocking filtering according to an embodiment of the present invention.
  • 16A to 16E represent block boundaries for performing deblocking filtering on 16 ⁇ 16 pixel blocks using 4 ⁇ 4 transform, 8 ⁇ 8 transform, 8 ⁇ 16 transform, 16 ⁇ 8 transform, and 16 ⁇ 16 transform.
  • a 16x16 pixel block using the 4x4 transform shown in 16A is subjected to deblocking filtering at the left and top block boundaries of each 4x4 pixel block, and 16x16 using the 8x8 transform shown in 16B.
  • Pixel blocks have deblocking filtering on the left and top block boundaries of each 8x8 block, and 16x16 pixel blocks with the 8x16 transform shown in 16C are used on the left and top of each 8x16 pixel block.
  • Deblocking filtering is performed at the block boundary, and the 16x16 pixel block using the 16x8 transform shown in 16D is deblocked filtering is performed at the left and top block boundaries of each 16x8 pixel block.
  • deblocking filtering is performed on the left and upper block boundaries of the 16 ⁇ 16 pixel block.
  • 17 is an exemplary diagram illustrating syntax of an intra picture according to an embodiment of the present invention.
  • the encoded data of the intra picture is divided into a partition type, an intra prediction mode, and a CBPX_flag / CBP coded block pattern X-flag / Coded. Fields such as a block pattern and a transform coefficient.
  • the encoder 140 of the image encoding apparatus 100 encodes the segmentation type information, the intra prediction mode, the CBPX_flag / CBP, the transform coefficient, and the like, and assigns them to each field to generate encoded data.
  • the syntax of the encoded data for the intra picture shown in FIG. 17 is merely exemplary, and the syntax of the encoded data for the intra picture is not necessarily configured as shown in FIG. 17. That is, it should be appreciated that some or all of the syntax of the encoded data for the intra picture may be changed differently from that shown in FIG. 17, and some syntax may be omitted.
  • the encoding of the CBPX_flag is performed.
  • Omission and increase / decrease information ⁇ pq for the quantization parameter may be encoded.
  • the increase / decrease information on the quantization parameter may be encoded in an extended macroblock unit, and the CBP information may be encoded in a 16 ⁇ 16 pixel block unit.
  • split type data which is data in which split type information of a macroblock indicating a macroblock is divided into subblocks, is allocated to a split type field.
  • the partition type information may be generated using the partition type number shown by way of example in FIG. 18.
  • the division type number 2 is assigned to a (N / 2 k ) ⁇ (N / 2 k ) pixel block. If (N / 2 k ) ⁇ (N / 2 k ) pixel blocks of macroblock layer K are divided into four (N / 2 k + 1 ) ⁇ (N / 2 k + 1 ), The division type number 3 is assigned to a (N / 2k ) ⁇ (N / 2k ) pixel block.
  • numbers such as 0, 1, 2, 3, and the like indicated in the divided subblocks in the (N / 2 k ) ⁇ (N / 2 k ) pixel blocks of each macroblock layer K are partitions for identifying each subblock. Part number.
  • each partition type is assigned in the order of the smallest to the largest order.
  • the partition type number of FIG. 18 is merely an example and may be allocated from the larger number to the smaller number in order of occurrence.
  • the partition type number may be allocated according to the occurrence probability of each partition type, or the partition type number may be adaptively changed.
  • each divided block may be divided into smaller blocks. For example, if a 32x32 pixel block is divided into four 16x16 pixel blocks by partition type number 3, each 16x16 pixel block is divided into smaller subblocks using the partition type-specific number in FIG.
  • a division type number of the upper pixel block that is, a division type number different from the division type number of the 32 ⁇ 32 pixel block may be used.
  • subblocks larger than 16 ⁇ 16 pixel blocks for example, 64 ⁇ 32 pixel blocks, 32 ⁇ 64 pixel blocks, and 16 ⁇ 32 pixels
  • Coding of a partition type number for a block, a 32x16 pixel block, etc. may be omitted.
  • FIG. 19 is a diagram illustrating a split type number coding sequence in the case of dividing an expanded macroblock into subblocks of various sizes according to an embodiment of the present invention.
  • the extended macroblock is a 64 ⁇ 64 pixel block and the maximum number of partitioned layers is four.
  • the partition type information of the macroblock may be sequentially encoded according to the partition type number encoding order in order to encode the partition type information of the macroblock. .
  • a process of dividing the macroblocks shown in FIG. 19 for each of the divided layers may be shown as shown in FIG. 20.
  • a 64 ⁇ 64 pixel subblock is divided into four 32 ⁇ 32 pixel subblocks, and in layer 1 (L1), L1-P0 (macroblock layer 1).
  • Subblocks of partition number 0) and subblocks of L1-P3 are further divided into four 16 ⁇ 16 pixel subblocks, and L1-P1 (partition number 1 of macroblock layer 1).
  • the subblock of and subblocks of L1-P2 are divided into 16x32 pixel subblocks and 32x16 pixel subblocks, respectively. Since the subblocks of L1-P1 and L1-P2 are divided into two subblocks, and are no longer divided, the partition number for each layer is not represented.
  • layer 2 the subblock of L2-P0 (partition number 0 of macroblock layer 2) is further divided into four 8 ⁇ 8 pixel subblocks and L2-P3 (partition number 3 of macroblock layer 2) It is divided into two 16x8 pixel subblocks.
  • the subblocks of L3-P0 (partition number 0 of macroblock layer 3) and the subblocks of L3-P1 (partition number 1 of macroblock layer 3) are each 4 4 ⁇ . It is divided into 4 pixel subblocks.
  • the L1-P1 block and the L1-P2 blocks are divided into L1 instead of being divided into 16 ⁇ 32 pixel subblocks and 32 ⁇ 16 pixel subblocks, respectively.
  • encoding may be performed in units of four 16 ⁇ 16 pixel blocks.
  • 21 is an exemplary diagram for describing a process of sequentially encoding a split type number for each layer of a macroblock.
  • the partition type information of the macroblock shown in FIG. 19 may be encoded as shown in FIG. 21.
  • numerals written in ' ⁇ ' indicate an order of encoding division type numbers of respective subblocks. If the split type number for each layer for the extended macroblock is sequentially encoded according to the split type number encoding order, the split type number for each layer may be sequentially encoded in the order shown in FIG. 21.
  • division type number 3 is encoded. Since the first 32x32 pixel subblocks L1-P0 of the four 32x32 pixel subblocks in the 64x64 pixel subblock are also divided into four 16x16 pixel subblocks, the partition type number 3 is encoded. The first 16 ⁇ 16 pixel subblocks L2-P0 of the four 16 ⁇ 16 pixel subblocks in the first 32 ⁇ 32 pixel subblocks L1-P0 of Layer 1 are also divided into four 8 ⁇ 8 pixel subblocks.
  • the four 8x8 pixel blocks L3-P0, L3-P1, L3-P2, and L3-P3 in the corresponding 16x16 pixel subblocks L2-P0 are no longer small subblocks. Since it is not divided by, the partition type numbers ⁇ 3, 3, 0, 0 ⁇ are encoded respectively. Since subblocks of the layer 3 cannot be divided into smaller subblocks, the partition type numbers of the subblocks belonging to the layer 3 are not encoded.
  • the division type of the second 16 ⁇ 16 pixel subblock L2-P1 and the third 16 ⁇ 16 pixel subblock L2-P2 of the macroblock layer 2 is encoded.
  • the number is encoded, but since the partition is no longer divided into small blocks, the partition type number 0 is encoded.
  • the fourth 16x16 pixel subblock L2-P3 is divided into 16x8 pixel subblocks, but since the partition type number is not 3, only the partition type number 1 is encoded.
  • the partition type numbers of the four subblocks in the layer 2 are all encoded, the partition type numbers of the second 32 ⁇ 32 pixel subblocks L1 to P1 of the layer 1 are encoded, and the second 32 ⁇ 32 pixel subblock of the layer 1 is encoded.
  • (L1-P1) is divided into 16x32 pixel subblocks, and since each divided subblock is no longer divided into small subblocks, the partition type number 2 is encoded.
  • the third 32 ⁇ 32 pixel subblock L1-P2 of macroblock layer 1 the fourth 32 ⁇ 32 pixel subblock L1-P3 of macroblock layer 1, and the four 16 ⁇ 16 subordinates thereof.
  • the division type numbers of the pixel subblocks L2-P0, L2-P1, L2-P2, and L2-P3 are sequentially encoded, ⁇ 1, 3, 0, 0, 0, 0 ⁇ is encoded.
  • the partition type number ⁇ 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 1, 2, 1, 3, 0, 0, 0, 0 ⁇ is encoded.
  • the split type number may be encoded into a binary bit string using lossless compression coding such as binary arithmetic coding or Huffman coding.
  • each partition type number may use a different binary value according to the layer number of the partition type number to be currently encoded. If the layer number is log 2 (N / 16) or less, Table 3 may be used. If the layer number is larger than log 2 (N / 16), table 4 may be encoded. For example, since the partition type number 3 of the subblocks L1 to P0 of FIG. 11 may be represented by the binary number '01', referring to Table 3, the partition type number 3 may be arithmetic encoded by the binary numbers '0' and '1', respectively. Can be encoded.
  • the partition type number 0 of the subblock L3-P2 belonging to the subblock L2-P0 may be represented by the binary number '1' referring to Table 4, the partition type number 3 is arithmetic encoded by the binary number '1'. Can be encoded.
  • an intra prediction mode is data in which information about an intra prediction mode is encoded in an intra prediction mode field. The data is allocated.
  • 22 is an exemplary diagram illustrating a coding order of an intra prediction mode according to an embodiment of the present invention.
  • FIG. 22 illustrates a case in which the expanded macroblock is a 64x64 pixel block and the number of maximum division layers is 4 as shown in FIG.
  • the intra prediction mode for each subblock of the extended macroblock is sequentially encoded according to the encoding order of the intra prediction mode shown in FIG. 22 to generate intra prediction mode data. can do.
  • the number indicated in each subblock indicates the encoding order of the intra prediction mode for encoding the intra prediction mode.
  • encoding is performed on a 64 ⁇ 64 pixel extended macroblock in units of 16 ⁇ 16 pixel blocks, a 32 ⁇ 32 pixel block corresponding to the 15th and 16th blocks, or the 17th and 18th blocks
  • encoding may be performed by dividing each of four 16x16 pixel blocks into units like the 19th to 22nd blocks.
  • a prediction mode flag indicating whether the prediction direction of the current block estimated from the neighboring block and the prediction direction of the selected current block is the same is encoded. If the prediction mode flag is not the same as the prediction direction of the current block estimated from the neighboring block and the prediction direction of the current block estimated from the neighboring block indicates that the prediction direction of the current block and the prediction direction of the current block estimated from the neighboring block are not the same.
  • the intra-prediction mode data is produced.
  • intra prediction is performed by dividing the expanded macroblock into subblocks other than 4 ⁇ 4 pixel blocks, 8 ⁇ 8 pixel blocks, or 16 ⁇ 16 pixel blocks
  • prediction is performed using the left block and the upper block of the current block.
  • the prediction mode number of one current block is 3 or more
  • the prediction direction of the current block may use prediction mode number 2 (DC mode) of FIG. 9.
  • intra prediction mode data is generated.
  • intra prediction mode data is generated by encoding the number of the prediction mode of the block as the intra prediction mode. In this way, the intra prediction mode data for each subblock of the macroblock generated by encoding in the order shown in FIG. 22 is allocated to the intra prediction mode field shown in FIG.
  • FIG. 23 is an exemplary diagram for explaining an example of a process of encoding an intra prediction mode of a macroblock according to an embodiment of the present invention.
  • the current macroblock to be encoded is a 64 ⁇ 64 pixel block, and is divided into subblocks of various sizes and shapes as shown.
  • the neighboring block on the left side of the current macroblock is intra predicted in units of 64 ⁇ 64 pixels.
  • the prediction mode number of the left neighboring block is 0 (vertical mode)
  • the upper neighboring block of the current macroblock is intra predicted in units of 64 ⁇ 64 pixels
  • the prediction mode number of the left neighboring block is 1 (horizontal mode). Illustrated illustratively.
  • the number displayed in each subblock in the current extended macroblock indicates a prediction mode number of each subblock.
  • the prediction mode number of the first 4x4 pixel subblock of the current extended macroblock is 2 (DC mode), and the prediction mode number of the corresponding subblock estimated using the neighboring block on the left and the upper one is 0. . That is, since 0 of the prediction mode number 0 of the left neighboring block and the prediction mode number 1 of the upper neighboring block is smaller, the prediction mode number of the first 4x4 pixel subblock is estimated to be zero. Since the prediction mode of the first 4x4 pixel subblock is different from the prediction mode of the corresponding subblock estimated from the neighboring block, the prediction direction of the corresponding subblock and the prediction direction of the corresponding subblock estimated from the neighboring block are not the same.
  • a prediction mode flag indicating and a prediction mode number 2 which is a prediction mode number of the corresponding subblock are encoded as an intra prediction mode of the corresponding subblock.
  • the prediction mode number of the second 4x4 pixel subblock is 1 and the prediction mode number of the corresponding subblock estimated from the neighboring block is 1, so that the prediction direction of the corresponding subblock and the prediction direction of the corresponding subblock estimated from the neighboring block are the same. Therefore, only the prediction mode flag indicating that the prediction directions are the same is encoded as the intra prediction mode of the corresponding subblock.
  • the intra prediction mode of the next subblock is encoded according to the encoding order of the intra prediction mode shown in FIG. 22.
  • the prediction mode number of the third 4x4 pixel subblock is 0, and the corresponding subblock estimated from the neighboring block. Since the prediction mode number of 0 is 0, the prediction direction of the corresponding subblock and the prediction direction of the corresponding subblock estimated from the neighboring block are the same, so that only the prediction mode flag indicating the same prediction direction is encoded as the intra prediction mode of the corresponding subblock. do.
  • the eleventh 16x16 pixel subblock the prediction flag is not encoded, and prediction mode number 1 of the subblock is encoded as the intra prediction mode of the subblock.
  • the 15th and 16th blocks are divided into 16x32 pixel blocks and encoded in an intra prediction mode
  • the 17th and 18th blocks are divided into 32x16 pixel blocks and encoded in an intra prediction mode. Shown. However, when intra prediction coding is performed on an extended macroblock in units of 16 ⁇ 16 pixel blocks, the 15th and 16th blocks, or the 17th and 18th blocks for subblocks larger than 16 ⁇ 16 pixel blocks are performed. The pixel block division of a rectangle as described above is omitted.
  • 23B exemplarily shows intra prediction mode data included in an intra prediction mode field when encoding an intra prediction mode of a current macroblock as shown in 23A.
  • the prediction mode flag and the prediction mode number are encoded for the first 4x4 subblock, and only the prediction mode flag is encoded for the second, third, and fourth 4x4 subblocks.
  • the intra prediction mode data is assigned to the intra prediction mode field.
  • intra prediction coding is performed by dividing the extended macroblock into rectangular sub-blocks (for example, 16 ⁇ 32, 32 ⁇ 16, etc.) larger than 16 ⁇ 16 pixel blocks.
  • the coded block pattern flag (CBPX_flag: Coded Block Pattern X_flag, hereinafter referred to as 'CBPX flag') and CBP (CBP: Coded Block Pattern, hereinafter referred to as 'CBP') are encoded by considering the size of the subblock.
  • CBPX_flag / CBP field can be assigned.
  • the CBP data allocated to the CBPX_flag and the CBP field indicates whether a non-zero quantized transform coefficient is included in a subblock of the macroblock.
  • intra prediction encoding is performed by dividing the expanded macroblock into units of 16 ⁇ 16 pixel blocks as shown in FIG. 5, encoding of the block pattern flag is omitted and encoding ⁇ pq for the quantization parameter is encoded. can do.
  • the increase / decrease information on the quantization parameter may be encoded in an extended macroblock unit, and the CBP data may be encoded in a 16 ⁇ 16 pixel block unit.
  • 24 is an exemplary diagram for describing a process of encoding a CBPX_flag and a CBP for an intra macroblock according to an embodiment of the present invention.
  • the encoder 140 of the image encoding apparatus 100 determines whether the size of the subblock of the extended macroblock is one of 64 ⁇ 64, 64 ⁇ 32, and 32 ⁇ 64 (S2410), and the size of the subblock is 64. If it is not one of x64, 64x32, and 32x64, it is determined whether the size of the subblock is one of 32x32, 32x16, and 16x32.
  • step S2410 when intra prediction is performed by dividing the extended macroblock into units of 16 ⁇ 16 pixels, in step S2410, is the size of the subblock 64 ⁇ 64 pixel blocks, that is, whether intra prediction coding is performed in units of the extended macroblock?
  • operation S2420 when the size of the sub block is not a 64 ⁇ 64 pixel block, it may be determined whether the size of the sub block is a 32 ⁇ 32 pixel block. As a result of the determination in step S2420, if the size of the subblock is one of 32x32, 32x16, and 16x32 or 32x32 pixel block, it is determined whether there is a non-zero transform coefficient in the subblock (S2430).
  • a CBP32 flag (for example, may be represented by 1 bit such as '1') indicating that a non-zero coefficient to be encoded is encoded in the corresponding subblock (S2440).
  • the CBP is encoded in units of 16 ⁇ 16 pixels (S2450).
  • the CBP32 flag indicating that there is no nonzero transform coefficient in the subblock (for example, , Which may be represented by 1 bit, such as '0' (S2460).
  • the CBP64 flag is a flag indicating the presence or absence of a coefficient to be encoded that is not zero in a 64x64 pixel block.
  • the CBP32 flag is a flag indicating the presence or absence of a non-zero coefficient to be encoded in a 32x32 pixel block.
  • Such a CBPX flag indicates whether the luminance component blocks have a non-zero transformation coefficient since the transform type does not need to be transmitted when the residual block of the luminance component does not have a nonzero transformation coefficient. Used to.
  • CBP is encoded in units of 16x16 pixel blocks, and indicates whether there is a non-zero transform coefficient for each 8x8 pixel block in the 16x16 pixel block using 1 bit per 8x8 pixel block. For example, 1 bit indicates whether there are non-zero transform coefficients in two 2x2 color difference component DC blocks, and 1 bit indicates whether there are non-zero transform coefficients in two 8x8 color difference component AC blocks. It is shown.
  • step S2420 if the size of the subblock is not one of 32x32, 32x16, and 16x32 or is not a 32x32 pixel block, the process proceeds to step S2450 to encode the CBP.
  • the size of the sub block when the size of the sub block is not a 32 ⁇ 32, 32 ⁇ 16 or 16 ⁇ 32 pixel block, it may be determined whether the size of the sub block is a 16 ⁇ 16, 16 ⁇ 8 or 8 ⁇ 16 pixel block. If the subblock is a 16 ⁇ 16, 16 ⁇ 8, or 8 ⁇ 16 pixel block, and there are coefficients to be encoded other than zero in the corresponding subblock, the CBP16 flag (for example, '1' may be represented by 1 bit). Otherwise, the CBP may be encoded in units of 16 ⁇ 16 pixel blocks without using the CBP flag.
  • step S2410 if the size of the subblock is one of 64 ⁇ 64, 64 ⁇ 32, and 32 ⁇ 64 or is a 64 ⁇ 64 pixel block, it is determined whether there is a non-zero transform coefficient in the subblock (S2470). If there is a non-zero transform coefficient in the subblock, a CBP64 flag indicating that there is a non-zero transform coefficient (for example, may be represented by 1 bit such as '1') is encoded (S2480). If there are no non-zero coefficients to encode, a CBP64 flag indicating that there are no non-zero coefficients to be encoded (for example, may be represented by 1 bit as '0') is encoded (S2490).
  • the CBP64 flag is a flag indicating whether a non-zero quantized transform coefficient exists in a 64 ⁇ 64 pixel block.
  • the CBP64 flag and the CBP32 flag may be omitted, and the increase / decrease information on the quantization parameter may be omitted.
  • ⁇ pq can be encoded. In this case, it is preferable to encode the increase / decrease information for the quantization parameter in an extended macroblock unit.
  • the conversion type is encoded when the CBP flag is not zero.
  • the CBP is encoded, and when the CBP is not 0, the transform type applied in units of 16 ⁇ 16 pixel blocks is encoded.
  • the CBP is encoded according to the transform type. If 16 ⁇ 16 transform is used, only the CBP 2 bits of the chrominance component are encoded. If 8 ⁇ 16 or 16 ⁇ 8 transform is used, two 8 ⁇ 16 or 16 ⁇ 8 pixel blocks within the 16 ⁇ 16 pixel block Encodes 2 bits of CBP indicating whether a transform coefficient is nonzero. However, in exceptional cases, when the CBP bit of the first divided block of the two divided blocks is 0, the CBP bits of the second divided block may not be encoded.
  • 25 is an exemplary view showing the structure of a CBP according to an embodiment of the present invention.
  • FIG. 25 exemplarily illustrates a structure of a CBP when an input image has a 4: 2: 0 format. If there is no non-zero transform coefficient in the first 8x8 pixel block (Y0) of the luminance component, the least significant bit (LSB) of the CBP is zero, and zero in the second 8x8 pixel block (Y1). If there is a non-quantized transform coefficient, the second least significant bit of the CBP is one.
  • the CBPs for the third 8x8 pixel block Y2 and the fourth 8x8 pixel block Y3 are allocated, and two 2x2 chrominance component DC blocks U (DC) and V (DC Since there is a nonzero quantized transform coefficient within)), the bit for chrominance DC is 1 and the nonzero quantized transform in two 8x8 chrominance component AC blocks (U-AC and V-AC) Since there is no coefficient, the bit for chrominance AC is zero.
  • FIG. 26 is an exemplary diagram illustrating an example of a sequence of encoding a CBPX flag and a CBP according to an embodiment of the present invention.
  • FIG. 26 exemplarily illustrates a coding sequence of a CBP64 flag, a CBP32 flag, and a CBP when an extended macroblock is a 64 ⁇ 64 pixel block and a size of a subblock currently being encoded is 64 ⁇ 64, 64 ⁇ 32, or 32 ⁇ 64.
  • the dashed-dotted arrow indicates the order of progression when the CBPX flag is 0
  • the dashed arrow indicates the order of progression when the CBPX flag is 1
  • the solid arrow indicates the order of progressing without any condition. .
  • the CBP64 flag is coded 0, and if the at least one quantized transform coefficient is not 0, the CBP64 flag is coded 1. If the CBP64 flag is 0, since there are no more CBPs to encode, the CBPX flag and CBP of the next macroblock are encoded. If the CBP64 flag is 1, the CBP32 flag of each 32x32 pixel subblock in the 64x64 pixel block is encoded. If the CBP32 flag is 1, the CBP of four 16x16 pixel blocks in the 32x32 pixel subblock is Is encoded.
  • FIG. 27 is an exemplary diagram illustrating another example of a sequence of encoding a CBPX flag and a CBP for an intra macroblock according to an embodiment of the present invention.
  • the encoding order of the CBP32 flag and CBP is exemplarily illustrated.
  • the dashed-dotted arrow indicates the order of progression when the CBPX flag is 0
  • the dashed arrow indicates the order of progression when the CBPX flag is 1
  • the solid arrow indicates the order of progressing without any condition. .
  • the encoder 140 of the image encoding apparatus 100 may only encode blocks having non-zero quantized transform coefficients after encoding a CBPX (X: integer greater than or equal to 32) flag and CBP.
  • the encoded quantized transform coefficients are encoded to generate encoded image data. If the size of the block to be encoded is larger than the size of the transform, the quantized transform coefficients of the block are encoded in a raster scan order in the block.
  • FIG. 28 is an exemplary diagram illustrating a coding order of quantized transform coefficients for each partition type according to an embodiment of the present invention.
  • FIG. 28 exemplarily illustrates a procedure of encoding quantized transform coefficients when the encoding target block is a 32 ⁇ 32 pixel block.
  • 16 ⁇ 16 transform for blocks larger than 16 ⁇ 16 pixels (4 ⁇ 4 transforms of 16 4 ⁇ 4 blocks within 16 ⁇ 16 blocks, and 4 ⁇ 4 transforms for 16 DC coefficients.
  • the conversion is performed, and 16x16 conversion is performed for convenience of description), so that four 16x16 conversions are performed in the case of a 32x32 pixel block.
  • two 16x16 transforms are performed for each 32x16 pixel block.
  • two 16x16 transforms are performed for each 16x32 pixel block.
  • 16x16 conversion is performed for each 16x16 pixel block.
  • 29 is an exemplary diagram illustrating a syntax structure of encoded data for an inter picture according to an embodiment of the present invention.
  • FIG. 29 exemplarily illustrates a syntax structure of encoded data generated by encoding according to an embodiment of the present invention when the input image is an inter picture.
  • the encoded data for the inter picture according to an embodiment of the present invention includes one or more fields of a SKIP_N flag, a macroblock type, and a partition type, and is intra prediction when the extended macroblock is an intra macroblock. It further includes one or more fields of Mode, CBPX Flag / CBP, and Transform Coefficient, and if the extended macroblock is an inter macroblock, SKIPX flag, differential motion vector / reference picture index, CBPX flag, transform type, CBP, and transform It may be configured to further include one or more fields of the coefficients.
  • the syntax of the encoded data for the inter picture shown in FIG. 29 is merely exemplary, and the syntax of the encoded data for the inter picture is not necessarily configured as shown in FIG. 29. That is, it should be appreciated that some or all of the syntax of the encoded data for the inter picture may be changed differently from those shown in FIG. 29, and some syntax may be omitted.
  • the encoder 140 of the image encoding apparatus 100 encodes a SKIPN flag indicating whether a macroblock currently being encoded is a SKIP macroblock.
  • N represents the size of the macroblock.
  • the SKIP64 flag indicating whether the 64 ⁇ 64 pixel macroblock is a SKIP macroblock is encoded.
  • the macroblock is a 32 ⁇ 32 pixel block, the 32 ⁇ 32 pixel macroblock is SKIP.
  • the SKIP32 flag indicating whether or not it is a macroblock is encoded
  • the SKIP16 flag indicating whether or not the 16x16 pixel macroblock is a SKIP macroblock is encoded.
  • the macroblock is a SKIP macroblock, since the current macroblock has no data to be encoded, the next macroblock is encoded. If the macroblock is not a SKIP macroblock, a macroblock type flag indicating whether the macroblock is an intra macroblock or an inter macroblock is transmitted. For example, when the input image to be encoded is a P picture, the available macroblock types are I-macroblocks and P-macroblocks, and when the input image to be encoded is the B picture, the macroblock type is usable. Are I- and B-macroblocks.
  • all block types of FIG. 4 may be used for motion estimation, and may be selected to be intra mode or inter mode in units of 16 ⁇ 16 pixel blocks within an extended macroblock. That is, both intra mode and inter mode may be used in an extended macroblock of a P-picture or a P-slice.
  • an extended macroblock flag (extended_mb_flag).
  • extended macroblock flag 1
  • the encoding is performed in units of 32 ⁇ 32 pixel blocks
  • the extended macroblock flag is 0, encoding is performed in units of 16 ⁇ 16 pixel blocks. can do.
  • the extended macroblock flag is 0, the extended macroblock may be divided into four 16 ⁇ 16 pixel blocks to determine whether it is an intra mode or an inter mode for each 16 ⁇ 16 pixel block.
  • each 16x16 pixelblock unit may be divided into smaller subblocks to perform encoding.
  • FIG. 30 is a diagram illustrating an example of syntax used in a P-picture (or P-slice) according to an embodiment of the present invention.
  • the expanded macroblock is assumed to be a 32x32 pixel block.
  • skipX_flag and interX_flag may have different context tables according to X values.
  • skip32_flag and skip16_flag may have different context tables. Detailed description thereof will be described later.
  • the skipX_flag is a flag indicating whether or not the current block to be encoded is in the SKIP mode. As shown in Table 5, the skipX_flag may indicate whether or not the SKIP mode is in one bit. For example, when the encoding bit of skipX_flag is 1, this may indicate that the current block is in the SKIP mode.
  • X means a number greater than or equal to 16 within the range of the extended macroblock.
  • interX_flag is a flag indicating whether the current block to be encoded is intra mode or inter mode, and as shown in Table 6, whether the divided pixel blocks in the macroblock extended to 1 or 2 bits are intra mode or inter mode. It may indicate whether the mode.
  • interX_flag when interX_flag is '00', this means that all the divided subblocks in the extended macroblock are in intra mode.
  • the 32x32 pixel block which is an extended macroblock, is divided into four 16x16 pixel blocks, and each 16x16 pixel block is encoded by the above-described intra prediction coding method. Therefore, when all subblocks in the extended macroblock are intra modes, the block type of the divided subblock, the intra prediction mode of the luminance component and the chrominance component, the CBP, the quantization parameter, the transform coefficient, and the like may be encoded.
  • extended_mb_flag 0
  • the block type and MVD / ref_idx are encoded only for the 16 ⁇ 16 pixel block, not the SKIP mode, for each 16 ⁇ 16 pixel block.
  • skip16_flag can be encoded using Table 5.
  • each syntax may have a different context table.
  • each of the 16 ⁇ 16 pixel blocks is mostly an inter mode or all intra modes in each 16 ⁇ 16 pixel block.
  • the case where an intra mode sub block and an inter mode sub block exist simultaneously in a 16x16 pixel block can be ignored. Therefore, after encoding the division type of each 16x16 pixel block, the subblocks in the 16x16 pixel block in which inter16_flag is 0, that is, the intra mode, encode the luminance component and the chrominance component in the intra prediction mode.
  • skip16_flag is encoded by using Table 5 for 16 ⁇ 16 pixel blocks having inter16_flag of 1, that is, inter mode.
  • the reason of encoding skip16_flag after encoding the partition type is that the intra mode and the inter mode are present in the extended macroblock at the same time, which means that the texture exists in the inter mode.
  • the mode is likely to be divided into small blocks, and therefore it is preferable to transmit the split type first and to encode skip16_flag only for pixel blocks whose size of the block is 16x16.
  • the encoding order is not limited to this, and skip16_flag may be encoded first, and then the partition type may be encoded.
  • CBPX_flag Subsequent encoding of CBPX_flag, transform type, CBP / quantization parameter, transform coefficient, etc. is the same as described above, and thus description thereof is omitted. However, in case of intra picture / slice or intra EMB, CBPX_flag may not be encoded.
  • the extended macroblock is a 64x64 pixel block
  • the subblock having a size of 16x16 or more after the partition type information of the current block to be encoded is encoded, similarly to the case where the extended macroblock is a 32x32 pixel block.
  • SkipX_flag is coded only for these fields.
  • X represents the size of a subblock such as 16 or 32. For example, if the macroblock is a 64x64 pixel block and is not in SKIP mode and the subblock size of the extended macroblock is one of 64x32, 32x64, and 32x32, then skip32_flag is set for each subblock. Is encoded.
  • the size of the subblock of the extended macroblock that is 64x64 pixels is 64x32 or 32x64, two skip32_flag are encoded. If the size of the subblock is smaller than 32 ⁇ 32, skip32_flag is not encoded. When the size of the subblock is one of 32 ⁇ 16, 16 ⁇ 32, and 16 ⁇ 16, skip16_flag of each subblock is encoded.
  • FIG. 31 is a diagram illustrating an example of syntax used in a B-picture (or B-slice) according to an embodiment of the present invention.
  • a B-picture In a B-picture, up to two arbitrary reference pictures can be selected.
  • the two sheets are called L0 prediction and L1 prediction, respectively, and each reference picture plays a different role.
  • L0 prediction is used for forward prediction
  • L1 prediction is used for backward prediction.
  • the B-picture can use a picture before the current picture to be encoded and a picture after the picture to be encoded as a reference picture, and can use the two reference pictures at the same time (bidirectional prediction) to perform motion estimation and compensation.
  • the block type used for the motion estimation all block types of FIG. 2 may be used, and whether the intra mode or the inter mode is selected in units of 16 ⁇ 16 pixel blocks in the macroblock extended in the same manner as the P-picture method.
  • two pictures are not limited to the picture before the current picture and the picture after the picture, and any two pictures can be used as the reference picture regardless of before and after.
  • the motion picture / compensation (bidirectional prediction) may be performed using the reference picture.
  • Coding modes that can be used in a B-picture according to an embodiment of the present invention include intra mode, SKIP mode, direct mode, L0 prediction, L1 prediction, and bidirectional.
  • the intra mode performs encoding using the same method as the above-described intra encoding method, and may select an intra mode in units of extended macroblocks or an intra mode in units of 16 ⁇ 16 pixel blocks within an extended macroblock.
  • the SKIP mode transmits only a flag indicating that the current block to be encoded is a SKIP mode.
  • the SKIP mode may be used for blocks of 16 ⁇ 16 pixels or more, such as 16 ⁇ 16 pixel blocks, 32 ⁇ 32 pixel blocks, etc., and motion compensation is performed using the predicted B_pred_dir, the predicted motion vector MVD, the predicted ref_idx, and the like.
  • the reference block obtained through the motion compensation becomes a reconstructed block.
  • B_pred_dir is a prediction direction of the B-picture, and means both directions of L0 and L1.
  • the direct mode encodes only the flag indicating the direct mode and data related to transform coefficient encoding (for example, CBPX_flag / CBP, quantization parameter, transform type, transform coefficient, etc.). That is, the direct mode is an encoding mode in which motion information is omitted, and a direct mode can be used for blocks of 8x8 pixel blocks or more, such as 8x8, 16x16, 32x32, and the like. In this case, motion estimation and compensation perform motion estimation and compensation in units of (N / 2) ⁇ (N / 2) pixel blocks. For example, in the 8x8 direct mode, motion estimation and compensation are performed in units of 4x4 pixel blocks.
  • transform coefficient encoding for example, CBPX_flag / CBP, quantization parameter, transform type, transform coefficient, etc.
  • L0 prediction means one direction prediction using only L0 motion information
  • L1 prediction means one direction prediction using only L1 motion information.
  • Bidirectional prediction means prediction using two motion information of L0 and L1 using a mean value of two pictures as a reference picture.
  • Motion estimation methods for B-pictures include motion estimation / compensation in direct prediction mode, motion estimation / compensation in SKIP mode, motion estimation / compensation in one-way prediction (L0 prediction or L1 prediction), and motion estimation in bidirectional prediction. / Compensation method.
  • the motion estimation / compensation method of the direct prediction mode is described.
  • the direct mode the motion estimation / compensation method of the temporal direct prediction mode using the motion information correlation in the time direction, and the spatial direction (horizontal and vertical two-dimensional space)
  • the temporal direct prediction mode or the spatial direct prediction mode is used by selecting one slice unit rather than a macroblock unit or a block unit.
  • a reference picture having the smallest reference number of L1 prediction is important and is called an anchor picture.
  • the nearest reference picture in the reverse direction of the target picture becomes an anchor picture, and a block at the same spatial location as the target block in the anchor picture is called an anchor block.
  • the motion information of the anchor block is examined and the L0 motion vector of the anchor block is mvCol (MV of the Co-located block). If there is no L0 motion vector of the anchor block and it has an L1 motion vector, the motion vector of L1 is used as mvCol.
  • the L0 reference picture in temporal direct prediction mode is a picture referred to by mvCol
  • the L1 reference picture in temporal direct prediction mode is an anchor picture.
  • the motion vector mvL0 of L0 and the motion vector mvL1 of L1 are obtained from the motion vector mvCol.
  • the sizes of mvL0 and mvL1 are proportional to the intervals of the reference picture, the target picture, and the anchor picture, and are thus obtained by proportional allocation. That is, mvL0 can be obtained by using Equation 5 using the interval tb between the reference picture and the target picture and the interval td between the reference picture and the anchor picture.
  • the anchor picture which is the reference picture of the smallest reference number in the L1 prediction and the anchor block at the same spatial location as the anchor picture are used to obtain the motion vector.
  • the motion vector of the target block is predicted from the motion vector encoded in the target picture.
  • the motion block information can be obtained by introducing a part of the concept of temporal direct prediction mode, i) the motion vector size of the anchor block is ⁇ 1 pixel or less both horizontally and vertically, and ii) the reference number of the anchor block reference picture 0, iii) L0 motion vector mvL0 and L1 motion vector mvL1 are set to 0 when the reference picture with the minimum reference number at L0 satisfies the condition that both are short-term reference pictures, and the picture having the smallest reference number in L0 prediction is L0.
  • the picture having the smallest reference number in the prediction picture and L1 is referred to as the L1 prediction picture.
  • the motion vectors mvL0 and mvL1 of the target block, and the L0 picture and the L1 picture, which are reference pictures are obtained from the encoded motion vectors in the target picture.
  • the median value of the horizontal and vertical components is calculated using the L0 prediction motion vectors mvA, mvB, and mvC located at the left, top, and left upper corners, and the value is mvL0.
  • the median values of the horizontal and vertical components are calculated using the L1 prediction motion vectors mvA, mvB, and mvC of the left, top, and right upper corners, and the values are mvL1. If the neighboring block is a unidirectional prediction or an intra coded L0 prediction, or there is no motion vector of the L1 prediction, it is replaced with a zero vector.
  • the minimum reference number values of the motion vectors mvA, mvB, and mvC of the left, upper, and upper right corners are calculated, and the reference number of the N ⁇ N block is calculated.
  • the process of obtaining this reference number is also performed independently of the L0 prediction and the L1 prediction.
  • the neighboring block is unidirectional prediction or when there is no motion vector of L0 or L1 prediction that is intra prediction coded, the block is excluded when obtaining a reference number.
  • the process of obtaining the mvL0, mvL1, L0 reference picture and the L1 reference picture is performed in units of N ⁇ N pixel blocks when performing the direct prediction mode of the N ⁇ N pixel block. Whether to use motion vectors mvL0 and mvL1 or 0 vectors is determined in units of blocks.
  • the SKIP mode performs motion prediction and compensation using the predicted motion vector, it is the same as the SKIP mode of the P-picture, but the motion vector used for the SKIP mode in the B-picture and the predicted motion vector of the Direct mode of the reference picture, Same as the reference picture. That is, the motion estimation / compensation method of the SKIP mode is the same as the motion estimation / compensation method of the aforementioned direct prediction mode.
  • the difference between the direct mode and the SKIP mode is that the SKIP mode has no motion information and no conversion coefficient, and the direct mode has no motion information only.
  • the motion estimation / compensation method of one direction prediction (L0 prediction or L1 prediction) is the same as the motion estimation and compensation method of the P-picture except that the reference picture is one of L0 and L1, the description thereof is omitted.
  • L0 reference pictures and mvL0 are obtained using the above-described motion estimation / compensation method of the P-picture for pixel blocks having a size of 8x8 or more in a B-picture having motion information, and L0 prediction is performed. And mvL1 are obtained to perform L1 prediction. Also, the reference block indicated by mvL0 in the L0 reference picture obtained through the L0 prediction process and the average block of the reference block indicated by mvL1 in the L1 reference picture obtained through the L1 prediction process are used as reference blocks for mvL0 and mvL1. Bidirectional prediction can be performed.
  • L1 prediction is performed on the motion information of L0 prediction to select the optimal mvL1 and L1 reference pictures for the mvL0 / L0 reference picture, and the reference block indicated by mvL1 in the selected L1 reference picture and the L0 prediction are obtained.
  • Bidirectional prediction may be performed using an average block of the reference block indicated by mvL0 in the L0 reference picture as a reference block.
  • an optimal mvL0 and L0 reference picture is selected for the mvL1 / L1 reference picture, and the reference block indicated by mvL0 in the selected L0 reference picture and L1 prediction are obtained.
  • Bidirectional prediction may be performed using an average block of the reference block indicated by mvL1 in the L1 reference picture as a reference block.
  • one bidirectional prediction mode having the best encoding efficiency is selected by comparing the encoding efficiency of the bidirectional prediction mode with respect to pixel blocks having a size of 8x8 or more in the B-picture having the motion information. For a pixel block having a size of 16 ⁇ 16 or more, the motion information of the above-described bidirectional prediction modes is found, and when the optimal coding mode is determined, transform, quantization, and entropy transform coefficient coding are performed to determine actual coding bits required for the mode. It is desirable to determine the bidirectional prediction mode using the prediction error.
  • each pixel block of 8x8 or more may use a different reference picture, but subblocks in the 8x8 pixelblock use the same reference picture.
  • the subtractor 120 generates a residual block by subtracting a current block and a reference block indicated by the motion vector of the current block estimated by the motion estimator 116, and the generated residual block is a transformer and a quantizer ( After being transformed and quantized by 130, the quantized transform coefficients are entropy coded by the encoder 140 to generate encoded data.
  • the conversion method for the B-picture is the same as the above-described conversion method for the P-picture, a detailed description thereof will be omitted.
  • FIG. 31 shows data to be transmitted through a bitstream of a B-picture (or B-slice) assuming that the expanded macroblock is a 32x32 pixel block.
  • the transmission syntax of the B-picture (or B-slice) is similar to the transmission syntax of the P-picture (or B-slice) described with reference to FIG. 30, and only a part added to the syntax of the P-picture is described here.
  • the directX_flag is a flag indicating whether the extended macroblock, the 16x16 pixel block or more, and the 8x8 pixel block are in the direct mode among the interblocks not in the SKIP mode.
  • motion information is not encoded, and information related to transform coefficients is encoded.
  • data of motion information for example, B_pdir, MVD, ref_idx, etc.
  • B_pdir is information indicating the prediction direction (L0 prediction, L1 prediction, bidirectional prediction) of the current block.
  • the B_pdir is encoded only for inter blocks, not in SKIP or direct mode, and has three modes as shown in Table 9 below.
  • both the motion information (mvL0, ref_idx_L0) for the L0 prediction and the motion information (mvL1, ref_idx_L1) for the L1 prediction are encoded, and only the motion information (mvL0, ref_idx_L0) for the L0 prediction is encoded in the L0 prediction. do.
  • only motion information mvL1 and ref_idx_L1 for L1 prediction is encoded.
  • 32 is an exemplary diagram for describing an encoding process of a SKIPX flag according to an embodiment of the present invention.
  • a macroblock is a 64 ⁇ 64 pixel block
  • a division type of a macroblock divided into subblocks of various sizes and shapes and an encoding order of each subblock are illustrated.
  • the SKIP16 flag is encoded for the 11th 16x16 pixel subblock
  • the SKIP16 flag of the 12th 16x16 pixel subblock is encoded
  • the 15th 16x32 pixel subblock as shown in FIG.
  • the SKIP16 flag of is encoded
  • the SKIP16 flag of the 16th 16x32 pixel subblock is encoded
  • the SKIP32 flag of the 17th 32x32 pixel subblock is encoded
  • the SKIP32 flag of the 18th 32x32 pixel subblock is ordered. Is encoded as is.
  • DMV differential motion vector
  • 33 and 34 are exemplary diagrams for describing a CBPX_flag, a transform type, and a CBP encoding process for an inter macroblock according to an embodiment of the present invention.
  • 33 and 34 illustrate a process of encoding a CBPX_flag, a transform type, and a CBP when the macroblock is a 64 ⁇ 64 pixel block.
  • the encoder 140 of the image encoding apparatus 100 determines whether the size of the subblock of the expanded macroblock is one of 64 ⁇ 64, 64 ⁇ 32, and 32 ⁇ 64 (S3302), and the size of the subblock is 64. If the size of the subblock is not one of 32x32, 32x16, and 16x32, it is determined whether the size of the subblock is one of 32x32 and 32x64 (S3304).
  • step S3304 if the size of the subblock is one of 32 ⁇ 32, 32 ⁇ 16, and 16 ⁇ 32, it is determined whether there is a non-zero quantized transform coefficient in the corresponding subblock (S3306), and 0 If there are non-quantized transform coefficients, a CBP32 flag (for example, may be represented by 1 bit, such as '1') indicating that there is a non-zero quantized transform coefficient in the corresponding subblock (S3308).
  • a CBP32 flag for example, may be represented by 1 bit, such as '1'
  • step S3308 After encoding the CBP32 flag in step S3308, it is determined whether there are any non-zero quantized transform coefficients in the 16 ⁇ 16 pixel block in the subblock (S3310), and if there are non-zero quantized transform coefficients, 16 ⁇ 16
  • the CBP16 flag indicating that there is a non-zero quantized transform coefficient in the pixel block is encoded (S3312).
  • the transform type is encoded only for blocks having a non-zero quantized transform coefficient (S3316). In this case, if the size of the subblock is 16 ⁇ 16 or more, the transform type is encoded for each subblock. If the size of the subblock is smaller than 16 ⁇ 16, one transform flag is encoded for each 16 ⁇ 16. This is because the conversion is selected in units of 16 ⁇ 16 pixels. For example, if a 64x64 pixel macroblock is split into two 64x32 pixel subblocks, and the CBP64 flag is nonzero, two CBP32 flags within each 64x32 pixel subblock are 64x32 pixels that are not zero. Encode the transform type for the subblock.
  • the transformation type of each subblock is encoded using Table 3.
  • the conversion type is encoded in units of 16 ⁇ 16 pixel blocks using Table 4.
  • the CBP16 flag is not zero and the 16x16 pixel block is divided into four 8x8 pixel blocks, and 4x4 transform is selected, 0 is encoded as the transform type, and if 8x8 transform is selected, 1 is transformed. It encodes as a type, otherwise the transform type is not encoded.
  • the CBP is encoded according to the transform type. To this end, it is determined whether the transform type is a 16x16 transform (S3318). In the case of a 16x16 transform, only CBP 2 bits of a chroma component are encoded (S3320). It is determined whether the conversion type is an 8 ⁇ 16 transform or a 16 ⁇ 8 transform (S3322). In the case of an 8 ⁇ 16 transform or a 16 ⁇ 8 transform, CBP 2 bits of a luminance component and CBP 2 of a chrominance component are determined.
  • the bit is encoded (S3324), and not 8x16 or 16x8, it is determined whether the transform type is 8x8 or 4x4 (S3326), and 8x8 or 4x4.
  • CBP 4 bits of the luminance component and CBP 2 bits of the chrominance component are encoded (S3328).
  • steps S3320, S3324, and S3328 an example of encoding the CBP of the luminance component and the CBP of the chrominance component when the input video is in the 4: 2: 0 format has been described. Therefore, when the format of the input video is changed, the luminance component is changed accordingly.
  • the method of encoding the CBP and the CBP of the chrominance component may vary.
  • the CBP32 flag indicating that there is no non-zero quantized transform coefficient in the subblock is encoded (S3330). Since there are no nonzero quantized transform coefficients in the subblock, the transform type and the CBP are not encoded.
  • step S3302 it is determined whether there is a non-zero quantized transform coefficient in the subblock (S3330), If there is a non-zero quantized transform coefficient, the CBP64 flag indicating that there is a non-zero quantized transform coefficient in the corresponding subblock is encoded (S3334), and the flow proceeds to step S3306, where there is no non-zero quantized transform coefficient. In this case, the CBP64 flag indicating that there is no non-quantized transform coefficient in the corresponding subblock is encoded (S3336). Since there are no nonzero quantized transform coefficients in the subblock, the transform type and the CBP are not encoded.
  • the encoder 140 of the image encoding apparatus 100 quantizes only blocks having a non-zero quantized transform coefficient.
  • the encoded transform coefficients are encoded to generate encoded image data, and are assigned to the transform coefficient field.
  • the encoding method of the quantized transform coefficients is the same as the encoding method of the quantized transform coefficients for the intra macroblock described above.
  • CABAC Context-based Adaptive Variable Length Code
  • CABAC coding includes a binary arithmetic coding unit and a context calculating unit.
  • the binary arithmetic encoder is a binarizer that converts binary signals (signals of 0 and 1), and the context computation unit maintains a plurality of probability of generating binary signals to be encoded (context table) and binary according to the current encoding target and surroundings. The probability of occurrence of the signal is changed and transmitted to the binary arithmetic encoder.
  • the context table is initialized at the start of slice encoding / decoding and updated in the slice.
  • Each syntax has a different table (probability) according to ctxIdx (context number), and ctxIdx is obtained by equation (7).
  • ctx_offset is determined by picture type and syntax type.
  • interX_flag may use the same table.
  • the context table can be used differently for each ctx_inc.
  • interX_flag as shown in FIG. 36, the case where ctx_inc is 0 to 5 represents an example of a prediction type of the context table for the extended macroblock that is a 32x32 pixel block, and when ctx_inc is 7 to 9
  • An example of a prediction type of a context table for a 16 ⁇ 16 pixelblock is shown, and a context table may be used differently according to each ctx_inc.
  • ctx_inc for encoding / decoding of directX_flag is as shown in FIG. 37.
  • the encoding bit of directX_flag may be represented by 1 bit, and the upper block and the left block of the target block to be encoded are not in the direct mode, the both are in the direct mode, and the upper block or the left block.
  • the context table can be determined differently according to the case where only one block is in direct mode. Also, in the case of ctx_inc for encoding / decoding of extended_flag, similarly to FIG.
  • extended_mb_flag may be set to binary bit 1).
  • the context table may be used differently depending on whether the encoding is performed by being divided into 16 ⁇ 16 pixel blocks (in this case, extended_mb_flag may be set to binary bit 1).
  • extended_mb_flag may be set to binary bit 1).
  • interX_flag a different context table may be used according to a value of X, a picture type, whether it is used as a reference picture, and data of neighboring blocks.
  • 38 and 39 are exemplary diagrams for describing a process of encoding split type information according to an embodiment of the present invention.
  • FIG. 38 illustrates a partition type value for each 16 ⁇ 16 pixel block in an extended macroblock to be encoded in order to encode partition type information using a tree structure.
  • Mx (a, b) represents a partition type value of a 16x16 pixel block corresponding to the position of (a, b) in the extended macroblock to be encoded. That is, Mx (0,0) is the division type of the first 16x16 pixel block in the raster scan direction in the position of (0,0) in the extended macroblock to be encoded, that is, in the extended macroblock to be encoded. Mx (0,1) represents the position of (0,1) in the extended macroblock to be encoded, that is, the partition type value of the second 16x16 pixel block in the raster scan direction in the block to be encoded. Indicates.
  • Mx-1 is an upper node of Mx, and the largest value may be selected by selecting a value of the upper node.
  • a method of selecting an upper node value may be encoded and used adaptively.
  • 38B groups the division type values for the 16 ⁇ 16 pixelblocks shown in 38A into an area unit including 2 ⁇ 2 division type values, and the minimum value of the division type values in each group is the division type for the grouped area.
  • the result assigned to the value is shown. That is, the division type values of the pixel blocks including the 16 ⁇ 16 pixel blocks (0,0), (0,1), (1,0), and (1,1) shown in 38A are set in units of 2 ⁇ 2 areas.
  • the division type values of the pixel blocks including the 16x16 pixelblocks (0,2), (0,3), (1,2), and (1,3) are grouped into 2x2 area units.
  • the minimum value of the division type values M X (0,2), M X (0,3), M X (1,2), and M X (1,3) of each 16x16 pixel block included in the grouped area It was selected and assigned to the partition type value of the partition type value M X-1 (0,1) for the grouped areas. In the same manner, the same process is performed on the remaining 16 ⁇ 16 pixel blocks.
  • the process of allocating the partition type values of the 16x16 pixel blocks shown in 38A to the partition type values of the grouped areas shown in 38B is performed by M X-2 , M X-3 . Repeatedly performing up to M 1 layer can assign the segmentation type value of the grouped region like 36C, and repeating up to M 0 layer again grouped to have the segmentation type value of one grouped region like 38D. can do.
  • the division type values of adjacent 16 ⁇ 16 pixel blocks are grouped into 2 ⁇ 2 area units, but the present invention is not limited thereto, and various sizes such as 4 ⁇ 2 and 2 ⁇ 4 may be used.
  • a division type value may be assigned by grouping division type values of adjacent 16 ⁇ 16 pixel blocks in an area unit or by grouping division type values of non-adjacent 16 ⁇ 16 pixel blocks in a predetermined area unit.
  • the allocation of the partition type value of the 16 ⁇ 16 pixel blocks of the block to be encoded as the partition type value of the grouped region may be represented as a tree structure as illustrated in FIG. 39.
  • the split type value for the layered region for each layer is a node value
  • the node values of the tree structure illustrated in FIG. 39 may be encoded by encoding a difference value with a node value of an upper node. have.
  • a method of encoding a difference value between node values and a node value of an upper node encodes binary bit 0 by the difference value and encodes binary bit 1 at the end. If the difference between the node value of the node to be currently encoded and the node value of the higher node is 0, binary bit 1 is encoded.
  • binary bits of 0 and 1 for example, an arithmetic coding method may be used, and a different context may be used for each layer.
  • a node value (hereinafter, referred to as a 'top node value') of a top node has a difference value between 0 and 0 as described above. It can be encoded using binary bits.
  • the highest node value uses a binary bit of 0 and 1 as a difference value from the largest partition type number. Can be encoded.
  • the partition type numbers when the partition type numbers are assigned in the order of high frequency of occurrence, the highest node value uses a binary bit of 0 and 1 as a difference value from the smallest partition type number. Can be encoded.
  • the remaining node values except for the highest node may be encoded using binary bits 0 and 1 between a node value of a node to be encoded and a node value of an upper node of the corresponding node. That is, each node value may be encoded by encoding the number of binary bits 0 as much as the difference value, and finally encoding the binary bit 1. If the difference between the node value of the node to be encoded and the node value of the higher node is 0, binary bit 1 is encoded. In addition, on the contrary, each node value may be encoded by encoding as many binary bits 1 as the difference value and encoding binary bit 0 at the end, and when the difference value is 0, the binary bit 0 may be encoded. .
  • the node values of the lower nodes of the upper node are not encoded. For example, if the node value of node M 1 (0,0) is 3, M 2 (0,0), M 2 (0,1), and M 2 which are subordinate nodes of node M 1 (0,0) The node values of the (1,0) and M 2 (1,1) nodes are not encoded.
  • M 1 (0,0) is the minimum of M 2 (0,0), M 2 (0,1), M 2 (1,0), and M 2 (1,1), so M 2 (0,0) ), M 2 (0,1), M 2 (1,0), and M 2 (1,1) all have a value of 3 or more.
  • M 2 (0,0), M 2 (0,1), M 2 (1,0), and M 2 (1,1) are different from 3. There is no need to encode because it cannot have a value.
  • the node value of the last node is not encoded when the node values of the nodes except the last node are all larger than the node value of the upper node.
  • the remaining node values except for the top node may be encoded by encoding the difference between the node value of the node to be encoded and the node value of the upper node of the corresponding node using binary bits 0 and 1 as described above.
  • it may be encoded by encoding a difference value between the node value of each node and the partition type value having the highest frequency of occurrence of the partition type.
  • the split type value having the highest frequency may or may not use a fixed value. If it is not a fixed value, it may be encoded and transmitted to the decoder or not. If not, the mode with the highest frequency of occurrence may be used by accumulating the statistics of the encoded blocks before the current block.
  • partition type information when the partition type values of the grouped regions of the 38B are determined by grouping the partition type values of the subblocks shown in 38A, a partition type number having a high frequency in order of occurrence. If is assigned, the maximum value among the values of the grouped area may be used as the split type value of the grouped area.
  • the split type is obtained using the above-described method.
  • Encode / decode In this case, the value of the lowest node is a partition type value of the 16 ⁇ 16 pixel block in the extended macroblock, and the maximum value of the values of the lower nodes may be used as the representative value of the upper node. For example, as shown in FIG. 18
  • an extended macroblock of a 32 ⁇ 32 pixel block belongs to a 16-padded image and is divided into 16 ⁇ 16 pixel blocks, the representative value of the most significant node is 0, so
  • the encoding encodes a binary bit '000' representing 3, which is the difference between the maximum value 3 and the representative value 0 of the partition type.
  • an extended macroblock of a 32x32 pixel block belongs to an image padded with 16, and three 16x16 pixel blocks are divided into 8x8 or less pixel blocks and encoded.
  • the encoding of the intra prediction mode is a 1-bit flag indicating whether the intra prediction mode of the 4 ⁇ 4 and 8 ⁇ 8 pixel blocks of the luminance component is the same as the prediction intra mode predicted using the neighboring blocks.
  • 3 bits are used to indicate which one of the eight prediction modes except the predicted prediction direction among the nine prediction modes.
  • the 16x16 pixel block is represented by using two bits of which of the four prediction modes.
  • the intra prediction mode of the remaining m ⁇ n pixel blocks except for the 4 ⁇ 4 pixel block, the 8 ⁇ 8 pixel block, and the 16 ⁇ 16 pixel block is encoded by a 1-bit flag indicating whether the intra prediction mode is the same as the prediction intra mode predicted using the neighboring block.
  • 1 bit is used to indicate which one of the two prediction modes is obtained by subtracting the predicted prediction direction among the three prediction modes.
  • the 16x16 pixel block of the chrominance component indicates which of four prediction modes is used using two bits.
  • ctx_inc is a value determined according to surrounding conditions when encoding target syntax, and the encoding bits of B_pdir indicating bidirectional prediction are as described in Table 9.
  • the target syntax may be determined as illustrated in FIG. 42 according to the surrounding situation.
  • the L0 prediction (0) may be used in the prediction direction of the unavailable block. It is preferable to use a different context table for each ctx_inc as illustrated in FIG. 43.
  • Ctx_inc for encoding / decoding of CBPX_flag may determine a context table similarly to the case of FIG. 37. For example, if CBPX_flag is not encoded when an intra picture or an extended macroblock is an intra mode, and a case where 0 inter mode is 1 when the upper block or the left block of the current block to be encoded is intra mode is 1, The target syntax can determine and use the context table according to the surrounding situation.
  • 43 is a diagram illustrating an example of ctx_inc for encoding / decoding of a transform type. 43 shows an example in which there are two types of transforms that can be used. As described in Table 1, when a 16x16 pixel block is divided into four 8x8 pixel subblocks, the selectable transform types are 4x4 transforms and 8x8 transforms, so the target syntax is the current block. If the top block and the left block of are both 4x4 transforms, both are 8x8 transforms, or if one block is a 4x4 transform and the other block is an 8x8 transform, It can be decided differently.
  • FIG. 44 and 45 are diagrams illustrating another example of ctx_inc for encoding / decoding a transform type when three types of transforms are available, respectively.
  • FIG. 44 is a diagram illustrating selecting a context table used for first bit encoding.
  • 45 illustrates an example of ctx_inc.
  • FIG. 45 illustrates an example of ctx_inc for selecting a context table used for second bit encoding.
  • the 16 ⁇ 8 pixel block performs the transform with the lowest coding cost among the 4 ⁇ 4 transform, the 8 ⁇ 8 transform, and the 16 ⁇ 8 transform, and the blocks larger than the 16 ⁇ 16 pixel block perform the 4 ⁇ 4 transform, 8 ⁇ 8 transform, and 16 ⁇
  • the encoding cost is small during the 16 conversions, as shown in FIG. 44, in the first bit encoding, whether the upper block and the left block of the current block are 4 ⁇ 4 transformed blocks, or any one of the left block and the upper block, Depends on whether only blocks are 4x4 transformed blocks or not all 4x4 transformed blocks It may be different from the ctx_inc for coding / decoding type.
  • ctx_inc for encoding / decoding of a transform type is different depending on whether at least one of the upper and left blocks of the current block is an 8 ⁇ 8 transformed block. Can be.
  • 46 is a block diagram schematically illustrating an image decoding apparatus according to an embodiment of the present invention.
  • An image decoding apparatus 4400 may include a decoder 4410, an inverse quantizer and an inverse transformer 4420, a predictor 4430, an adder 4440, a filter 4450, and a picture buffer. 4440.
  • the decoder 4410 decodes the encoded data encoded by the image encoding apparatus 100 using various encoding or decoding techniques such as entropy decoding.
  • the decoder 4410 has different data to decode depending on the type of picture to be decoded.
  • the information about the picture type may be extracted from the picture header or the sequence header of the encoded data, or may be extracted and decoded and restored. In this case, when the extended macroblock to be decoded currently spans the image boundary as shown in FIG.
  • Text data and prediction modes can be obtained by performing entropy decoding, and intra prediction, motion compensation, and inverse transform / inverse quantization are performed to decode a part belonging to an actual image.
  • the type and order of data to be decoded in the image encoded data by the decoder 4610 are as illustrated in FIG. 17. That is, the decoder 4410 restores partition type information by decoding the partition type data extracted from the input bitstream, partitions the macroblock using the partition type identified by the recovered partition type information, and intra prediction. By decoding the mode data, the intra prediction mode is restored by the number of subblocks divided in the macroblock, and the CBP data allocated to the CBPX flag / CBP in the same or similar order as shown in FIG. 24 according to the size of each subblock. Decrypt to restore the CBPX flag or CBP.
  • the decoder 4610 restores the transform coefficients by decoding transform coefficient data only for subblocks having non-zero transform coefficients indicated by CBP.
  • the image encoding apparatus 100 performs intra prediction encoding on the extended macroblock in units of 16 ⁇ 16 pixel blocks
  • decoding of the CBPX flag may be omitted, and in this case, encoded in the extended macroblock unit Decoding on the quantization parameter may be performed.
  • the syntax of the video encoded data shown in FIG. 17 is merely an example, and the syntax structure of the video encoded data according to an embodiment of the present invention is not limited to the structure shown in FIG. 17.
  • the coding order of the CBPX flag or CBP shown in FIG. 24 is merely an example, and the order of reconstruction of the CBPX flag or CBP according to an embodiment of the present invention is not limited to the order shown in FIG. 24.
  • the decoder 4610 reconstructs the intra prediction mode depends on the size of the subblock. That is, when the size of the subblock is not 16 ⁇ 16, such as 4 ⁇ 4 or 8 ⁇ 8, the decoder 4610 reconstructs the prediction mode flag by decoding one bit of intra prediction mode data extracted from the bitstream. If the reconstructed prediction mode flag indicates that the prediction direction according to the intra prediction mode of the corresponding subblock is the same as the prediction direction according to the intra prediction mode of the corresponding subblock estimated from the neighboring block, the corresponding subblock estimated from the neighboring block.
  • Intra prediction mode of the current block is restored as the intra prediction mode of the current block, the intra prediction mode of the next subblock is decoded, and if it is not the same, the intra prediction mode is recovered by decoding the next three bits of the intra prediction mode data. Reconstruct as an intra prediction mode.
  • the decoder 4610 reconstructs the intra prediction mode of the current block by decoding two bits of the intra prediction mode data extracted from the bitstream. The intra prediction mode reconstructed as described above is input to the intra predictor 4452 of the predictor 4630.
  • an extended macroblock that is a 32 ⁇ 32 pixel block is an intra mode
  • the partition type of the corresponding block may be entropy decoded.
  • a block belonging to a padded image in an extended macroblock that is a 32x32 pixel block corresponds to only the first 16x16 pixel block, and thus entropys the partition type of the first 16x16 pixel block.
  • Decrypt If the 16 ⁇ 16 pixel block is divided into two 16 ⁇ 8 pixel blocks, entropy decoding two intra prediction modes and decoding one CBP and 16 ⁇ 16 transform coefficients for the 16 ⁇ 16 pixel block do.
  • the 16 ⁇ 16 pixel block is decoded using the subblock type, the intra prediction mode, and the transform coefficient obtained through entropy decoding.
  • the type and order of data to be decoded in the image encoded data by the decoder 4610 are as shown in FIG. 29. That is, the decoder 4610 decodes SKIPN flag data extracted from the bitstream and restores the SKIPN flag indicating whether the macroblock to be decoded is the SKIP macroblock.
  • the decoder 4610 decodes the macroblock type flag data and the partition type data extracted from the bitstream to decode the macroblock type flag and the partition type information.
  • the extended macroblock is a 32 ⁇ 32 pixel block
  • decoding the skip32_flag and when the extended macroblock to be currently decoded is a SKIP mode.
  • a predictive motion vector may be obtained and motion compensation may be performed.
  • the block belonging to the padded image in the extended macroblock which is a 32 ⁇ 32 pixel block, corresponds to only the first 16 ⁇ 16 pixel block, and the extended macroblock to decode skip32_flag and currently decodes is in SKIP mode.
  • the predictive motion vector may be obtained using the neighboring blocks at the left and the top of the first 16 ⁇ 16 pixel block, and motion compensation may be performed.
  • the decoder 4610 When the macroblock type identified by the macroblock type flag to be recovered is an intra macroblock, the same as described above.
  • the macroblock type is an inter macroblock, the decoder 4610 has a size of 16 ⁇ 16 subblocks. This means that only the subblocks above are decoded SKIPX flag data to restore the SKIPX flag and subblocks other than the SKIP block identified by the restored SKIPX flag or subblocks having a size smaller than 16 ⁇ 16 (not SKIP).
  • MVD / ref_idx data is decoded to restore a motion vector and a reference picture index which are motion information.
  • the decoder 4610 decodes blocks other than SKIP in the same or similar order as shown in FIGS.
  • the reconstructed motion information is input to an inter predictor 4452 (which can be implemented as a motion compensator), and the reconstructed CBPX flag, CBP, transform type, quantized transform coefficient, etc. is a target macroblock or a target macroblock to be decoded.
  • the inverse quantizer and inverse transformer 4620 inverse quantize and inverse transform the quantized transform coefficients transmitted from the decoder 4610 to restore the residual block.
  • the inverse quantizer and the inverse transformer 4620 may inverse quantize and inverse transform the quantized transform coefficients using the CBPX flag, the CBP, and the transform type transmitted from the decoder 4610.
  • the predictor 4630 generates a predictive block by predicting a target macroblock or subblock thereof to be decoded.
  • the intra predictor 4452 generates the predictive block of the target macroblock or its subblocks by intra prediction of the target macroblock or subblock thereof to be decoded using the intra prediction mode reconstructed by the decoder 4610.
  • the inter predictor 4474 generates a prediction block of the target macroblock or its subblocks by inter-prediction of the target macroblock or its subblocks to be decoded using the motion information reconstructed by the decoder 4610.
  • the adder 4640 reconstructs the target macroblock to be decoded by adding the prediction block generated by the predictor 4630 and the remaining blocks reconstructed by the inverse quantizer and inverse transformer 4620.
  • the target macroblock reconstructed by the adder 4640 is deblocked filtered by the filter 4650, accumulated in picture units, and output as a reconstructed image, and is stored in the picture buffer 4660 to be later inter predicted 4452. It can be used to predict motion compensation in.
  • the operations of the intra predictor 4452, the inter predictor 4462, the inverse quantizer, and the inverse transformer 4620 may be performed by using the intra predictor 112, the inter predictor 114, the inter predictor 114 of the image encoding apparatus 100 described above with reference to FIG. 1. Since the operation method of the inverse quantizer and the inverse transformer 150 is the same or similar, detailed description thereof will be omitted.
  • the video decoding apparatus 4600 may be configured as follows according to whether the extended macroblock is an inter macroblock or an intra macroblock.
  • the decoder 4610 decodes the encoded data to restore partition type information, an intra prediction mode, and a quantized transform coefficient, and the inverse quantizer and inverse transformer 4620 may be used.
  • the quantized transform coefficients are inversely quantized and inversely transformed using a transform selected according to the size of the subblock identified according to the reconstructed partition type information, and the predictor 4630 reconstructs the remaining subblocks according to the reconstructed partition type information.
  • a predicted subblock is generated by predicting the identified subblock using the reconstructed intra prediction mode, and the adder 4640 adds the predicted subblock and the remaining subblock to reconstruct the subblock.
  • the decoder 4610 decodes the encoded data to restore partition type information, motion information, transform type information, and quantized transform coefficients, and inverse quantizer and inverse transformer 4620.
  • the predictor 4630 reconstructs the subblock identified according to the recovered partition type information.
  • the predicted subblock is generated by using the predicted motion information, and the adder 4640 reconstructs the subblock by adding the predicted subblock and the remaining subblock.
  • the image decoding apparatus 4600 decodes the encoded data to divide partition type information, an intra prediction mode, and a quantized transform coefficient. Restore the remaining subblocks by inverse quantization and inverse transformation of the quantized transform coefficients using a transform selected according to the size of the subblock identified according to the partition type information to be restored, and identify the partition according to the partition type information to be recovered.
  • a predicted subblock is generated by predicting the subblock using the reconstructed intra prediction mode, and the subblock is reconstructed by adding the predicted subblock and the remaining subblock.
  • the transform selected according to the size of the subblock uses 4 ⁇ 4 transform if the size of the subblock is one of 4 ⁇ 4, 4 ⁇ 8, and 8 ⁇ 4, and the size of the subblock is 8 ⁇ 8, 8 ⁇ . If one of 16 and 16 ⁇ 8, 8 ⁇ 8 transform is used, and if the size of the subblock is 16 ⁇ 16 or more, 16 ⁇ 16 transform can be used.
  • the image decoding apparatus 3000 decodes the encoded data to thereby split type information, motion information, and transform type information. And reconstructing the quantized transform coefficients, inversely quantizing and inversely transforming the quantized transform coefficients by using the transform identified by the transformed type information to be recovered, and restoring the remaining subblocks, and the subblocks identified according to the recovered partition type information.
  • the prediction subblocks are generated by partitioning the subblocks and predicting the subblocks using the reconstructed motion information, and reconstructing the subblocks by adding the prediction subblocks and the remaining subblocks.
  • the transform identified by the transform type information may be one of 4 ⁇ 4 transform, 8 ⁇ 8 transform, 8 ⁇ 16 transform, 16 ⁇ 8 transform, and 16 ⁇ 16 transform.
  • the image decoding apparatus 4600 may filter the reconstructed subblock, and may perform deblocking filtering on the left and upper boundaries of the block according to the selected transform in the reconstructed subblock.
  • the image decoding apparatus 4600 may further reconstruct the SKIP_N flag indicating whether the macroblock is a SKIP macroblock by decoding the SKIP_N flag data extracted from the encoded data.
  • the video decoding apparatus 4600 may perform a decoding process only on the macroblock identified as not the SKIP macroblock by the reconstructed SKIP_N flag.
  • the image decoding apparatus 4600 may further reconstruct the macroblock type flag indicating whether the macroblock is an intra macroblock or an inter macroblock by decoding the macroblock type flag data extracted from the encoded data.
  • the image decoding apparatus 4600 determines whether the macroblock to be decoded is an intra macroblock or an inter macroblock based on the reconstructed macroblock type flag, and accordingly, whether to perform intra prediction decoding or inter prediction decoding. Can be determined.
  • the split type information may be identified by the split type number for each split layer, and the image decoding apparatus 4600 may decode CBP data extracted from the encoded data and according to the size of the subblock. You can restore additional CBPX flags and CBP.
  • the CBPX flag may be a flag indicating whether there is a non-zero quantized transform coefficient in the X ⁇ X pixel block
  • the CBP may be a flag indicating whether there is a non-zero quantized transform coefficient in the 16 ⁇ 16 pixel block.
  • the input image is input to the image encoding apparatus 100 of FIG. 1 in units of frames or fields, or is divided into macroblocks having N ⁇ N pixels (where N is an integer of 16 or more). It may be input to the encoding apparatus 100.
  • the macroblocks described below can be divided into square subblocks.
  • each macroblock and subblocks may be divided into prediction subblocks for intra prediction or inter prediction.
  • M ⁇ M, (M / 2) ⁇ (M / 2), M ⁇ (M / 2), (M / 2) ⁇ M, 1 ⁇ M, M ⁇ 1, ( However, it may be divided into sub-blocks of variable size such as M N).
  • the transform type may be determined according to the transform subblock, which may be obtained by dividing the macroblock and the subblock in a similar manner as in the prediction subblock.
  • the image may be compressed after padding in any manner so as to be a multiple of N with respect to the input image.
  • the padding method may be performed by the image encoding apparatus and the image decoding apparatus according to the size of the image.
  • encoding is performed as a macroblock or a subblock having S ⁇ T pixels (S ⁇ N and / or T ⁇ N) instead of N ⁇ N at an image boundary or slice boundary. can do.
  • the size of the macroblock and the size of the prediction subblock may be different.
  • the size of the intra prediction macroblock is 32 ⁇ 32
  • the size of the prediction subblock is 32 ⁇ 32, 16 ⁇ 16, 16 ⁇ 4, 4 ⁇ 16, 8 ⁇ 8, 8 ⁇ 2, 2 ⁇ 8, It can be encoded and decoded into variable sizes such as 4x4, 4x1, and 1x4.
  • the image encoding apparatus encodes the size information of the prediction subblock and the intra prediction mode of each of the divided prediction subblocks
  • the image decoding apparatus encodes the size information of the prediction subblock and the intra prediction mode of each of the divided prediction subblocks. You must decrypt it.
  • the size of the prediction subblock is 32 ⁇ 32, 32 ⁇ 16, 16 ⁇ 32, 16 ⁇ 16, 16 ⁇ 8, 8 ⁇ 8, 8 ⁇ 4, 4 ⁇ 8.
  • the size of the prediction subblock is 32 ⁇ 32, 32 ⁇ 16, 16 ⁇ 32, 16 ⁇ 16, 16 ⁇ 8, 8 ⁇ 8, 8 ⁇ 4, 4 ⁇ 8.
  • the macroblock may be divided into subblocks and then divided again into prediction subblocks within the subblock. For example, after dividing a 64 ⁇ 64 macroblock into four 32 ⁇ 32 subblocks, 32 ⁇ 32, 16 ⁇ 16, 16 ⁇ 4, 4 ⁇ 16, 8 ⁇ 8, 8 ⁇ 2, 2 ⁇ 8, It can be encoded and decoded in any predicted subblock size such as 4x4, 4x1, 1x4, and the like.
  • the square prediction subblock division may be omitted and encoding may be performed.
  • the macroblock layer 0 includes 64 ⁇ 64 prediction subblocks, 64 ⁇ 32 prediction subblocks, and 32 ⁇ 64 prediction subblocks as prediction subblocks.
  • the macroblock layer 1 may belong to a 32 ⁇ 32 prediction subblock, a 32 ⁇ 16 prediction subblock, and a 16 ⁇ 32 prediction subblock as subblocks.
  • the macroblock layer 2 may belong to a 16 ⁇ 16 prediction subblock, a 16 ⁇ 8 prediction subblock, and an 8 ⁇ 16 prediction subblock as subblocks.
  • the macroblock layer 3 may belong to an 8x8 prediction subblock, an 8x4 prediction subblock, a 4x8 prediction subblock, and a 4x4 prediction subblock as subblocks.
  • the video encoding apparatus 100 calculates encoding efficiency for each subblock when the macroblock is divided into subblocks and encoded, and the final intrablocking subblock or the inter prediction subblock is calculated for the subblock in the case of the highest encoding efficiency. Decide on a block.
  • the coding efficiency may be measured based on a rate-distortion optimization (RDO) technique as shown in Equation (1).
  • Equation 8 Distortion of Equation 8 may be represented by Equation 4 above.
  • Equation 8 may calculate more accurate coding efficiency than Equation 2 described above, but has a disadvantage in that a large amount of calculation is performed. Therefore, in the embodiment of the present invention, it is preferable to select and use Equation 2 or Equation 8 according to the importance of data (whether or not used as a reference picture) or the mode to be encoded.
  • an encoding method and encoded data generated through the encoding method according to the second embodiment of the present invention will be described according to a picture type.
  • An encoding method according to the present embodiment will be described with reference to the image encoding apparatus 100 of FIG. 1. However, it will be clearly understood from the description below that some of the components of the image encoding apparatus 100 of FIG. 1 perform operations different from those of the first embodiment.
  • the intra predictor 112 of the predictor 110 generates a reference block by using neighboring pixels of a block to be currently encoded (hereinafter referred to as a 'current block') and compares the reference block with the current block to determine an intra prediction mode.
  • the neighboring pixels refer to pixels adjacent to the current block, and broadly refer to pixels in a block around the current block.
  • the concept includes a pixel calculated using adjacent pixels.
  • the intra predictor 112 selects an intra prediction mode for each of the currently divided intra prediction subblocks, and intra-predictively encodes the current block using the selected prediction direction.
  • the number of prediction modes used for intra prediction may vary depending on the size of the prediction subblock and may vary depending on the presence or absence of neighboring pixels. In the present embodiment, nine prediction modes are used for 4x4 and 8x8 prediction subblocks, and four prediction modes are used for 16x16 prediction subblocks.
  • the prediction direction of the selected current block is compared with the prediction direction of the block having the smaller prediction mode number among the left block and the upper block of the current block, and the small prediction mode number is used as the prediction mode.
  • Predictive mode flags e.g., may be represented by 1 bit
  • two modes are used as the prediction mode: the left block and the upper block mode. If any one of the two modes is the same as the prediction mode of the current block, the prediction mode flag is encoded as the prediction mode.
  • the prediction mode index indicating whether the prediction mode is the same as the prediction mode of the upper block is encoded.
  • Prediction mode information that is, prediction mode index may be encoded.
  • a prediction mode number which is information on which prediction mode is the prediction mode of the current block, except for the prediction mode number using the smaller prediction mode number among the two prediction modes, may be encoded.
  • Intra prediction of a chrominance component may include an average prediction independent of the prediction mode of the luminance component, a horizontal prediction, a vertical prediction, or a mode that follows the intra prediction mode of the luminance component using the luminance component, and a prediction mode using the pixel characteristics of the luminance component. Prediction modes can be used. Preferably, the intra prediction of the chrominance component may be performed in units of (N / 2) ⁇ (N / 2) pixel blocks, that is, half the size of the macroblock size N ⁇ N of the luminance component. There are two types of color difference signals, U and V, but the prediction method is the same.
  • the prediction mode of the chrominance signal may also be encoded by predicting the prediction mode using the prediction modes of the upper and left blocks in the same manner as the luminance component.
  • the prediction mode may be encoded into a table determined according to the probability of the prediction mode without predicting the prediction mode.
  • the intra predictor 112 predicts the current block to generate a predictive subblock, and the subtractor 120 subtracts the current block and the predictive subblock to residual blocks.
  • Create The transformer and quantizer 130 transform and quantize the residual block to generate quantized transform coefficients, and the encoder 140 entropy encodes the quantized transform coefficients to generate encoded data.
  • 48 is a diagram illustrating types of transforms according to an intra prediction mode.
  • the transform type in the transformer and quantizer 130 may select a transform type according to the intra prediction mode of the current block. For example, referring to FIG. 48, DCT may be performed when the current block is vertical prediction, and DST may be performed when horizontal prediction.
  • FIG. 49 is a diagram illustrating types of transforms according to types of horizontal and vertical transforms according to an intra prediction mode of a current block.
  • the type of horizontal transform and vertical transform may be selected according to the intra prediction mode of the current block. For example, referring to FIG. 49, when the current block is vertical prediction, the horizontal transform may perform DST and the vertical transform may perform DCT.
  • the chrominance component may also be selected according to the intra prediction mode of the chrominance component independently of the luminance component, or may also follow the transformation type of the luminance component.
  • all blocks may be encoded through motion estimation.
  • motion estimation may not be performed depending on the block type and the position of the block.
  • the first block does not perform motion estimation, but blocks that are already encoded, that is, adjacent blocks or colocated (closest).
  • the motion information (prediction direction, motion vector, reference picture, etc.) of the block may be used as it is in the reference picture.
  • a candidate of motion information of adjacent blocks is determined, and information of which candidates are used is encoded.
  • L0 prediction and L1 prediction up to two arbitrary reference pictures can be selected for each block, which are called L0 prediction and L1 prediction, respectively, and these two reference pictures play different roles.
  • L0 prediction (List 0 Prediction, mainly used for forward prediction) is used as forward prediction
  • L1 prediction (List 1 Prediction, mainly used for backward prediction) is used as backward prediction. It is also possible to encode the same as the description of the above-described P picture.
  • the motion vector is encoded by the encoder 140 and included in the encoded data.
  • the encoder 140 uses the motion vectors of the neighboring blocks of the current block and the motion vectors of the colocated block (the same position block) to predict the motion vector (PMV).
  • the motion information data is generated by encoding a differential motion vector (DMV), which is a difference vector between the predicted motion vector and the motion vector of the current block, and the predicted motion vector information.
  • DMV differential motion vector
  • the encoder 140 may further encode not only a differential motion vector but also a reference picture index. That is, the motion information may include differential motion vectors, reference picture indexes, and predictive motion vector information.
  • the encoder 140 may encode motion information to generate motion information data and include motion information data in the encoded data. .
  • 50 is an exemplary diagram for describing a process of determining a predicted motion vector according to a second embodiment of the present invention.
  • FIG. 50 illustrates neighboring blocks and colocated blocks used to determine a predicted motion vector of the current block when the current block is encoded into 64 ⁇ 64 prediction subblocks.
  • T is a sequence of pictures including the current block, and T-1 represents a picture coded before the current picture.
  • the neighboring blocks are divided into group A, group B, and group C to determine a representative motion vector for each group to determine a predicted motion vector of the current block among three representative motion vectors.
  • the representative motion vector can be determined by any method. For example, in the case of group A, a motion vector of a block in which the prediction direction and the reference picture of the current block are the same as A0 to Aj may be determined as the representative motion vector. If the prediction direction of the current block and the reference picture do not have the same motion vector, (0,0) may be determined as the representative motion vector.
  • a method of setting a representative motion vector for each group may be different. For example, in the case of group C, a representative motion vector is not found from C0, and a motion vector in which the prediction direction and the reference picture of the current block are the same as the representative motion vector is clockwise or counterclockwise from the top left in the center of the colocated block. You can decide.
  • a motion vector of a specific position may be set as a representative motion vector for each group.
  • the position of B0 may be set as the representative motion vector
  • the group A may set the position of Aj as the representative motion vector
  • the group C may set the position of Ck as the representative motion vector.
  • any method of setting the representative motion vector is performed by the encoder and the decoder according to the present embodiment in the same manner.
  • 51 is a diagram illustrating an allocation code at the time of encoding the representative motion vector of each block group.
  • the importance of each representative motion vector is determined by any method, and the number of the representative motion vector selected as the predicted motion vector of the current block is encoded.
  • the representative motion vector of the group A is set to (0,0) because the motion vector having the same prediction direction and the reference picture does not exist, and the representative motion vector of the group B is the same as the prediction direction of the current motion vector.
  • the representative motion vector of the group C fixes the position of Ck as the representative motion vector
  • the importance of each representative motion vector is as follows.
  • Only one identical motion vector of each representative motion vector is left.
  • the representative motion vectors of the groups B and C are the same, the representative motion vector information selected as the prediction motion vector of the current block among the representative motion vectors of the groups B and A is encoded.
  • the video encoding apparatus and the video decoding apparatus operate in the same manner.
  • the motion information of the current block may use the motion information of the neighboring block or the colocated block or the zero vector (prediction thereof).
  • This is called a motion information candidate group).
  • the zero vector means basic motion information with a motion vector of (0, 0), a prediction direction of list 0, and a reference picture index of 0.
  • the prediction motion information candidate group may be the same as or different from the prediction motion vector candidate group. For example, referring to FIG.
  • the motion information of the current block may be selected from the same position blocks C and zero vectors as the neighboring blocks A, B, and D.
  • the prediction direction may be fixed to one of list 1 or bidirectional prediction as well as list 0, and the reference picture may be fixed to the picture closest to the current picture.
  • the predicted motion information candidate group selected from the predicted motion information candidate group is encoded with reference to FIG. 53. If all of the motion information is the same, only one of the predicted motion information candidate groups may be removed.
  • the batch mode may or may not be used depending on the size and position of the current block.
  • the first block may use motion information of neighboring blocks, and the second block may determine motion information through motion estimation.
  • motion information when cost is minimized is finally selected through Equation 1.
  • the batch mode flag indicating whether the peripheral motion information is used or the motion estimation is used is encoded.
  • the prediction motion information index is encoded without encoding the batch mode flag.
  • the second block encodes a batch mode flag whether the batch mode is used or not, and encodes motion information (prediction direction, differential motion vector, reference picture index, etc.).
  • motion information prediction direction, differential motion vector, reference picture index, etc.
  • the lower right block may determine the motion information only through motion estimation without using the batch mode.
  • the image encoding apparatus and the image decoding apparatus operate in the same manner.
  • the SKIP mode is used for the macroblock and the subblock.
  • motion information is arbitrarily designated to perform motion estimation and compensation.
  • the prediction direction and the reference picture are fixed to bidirectional prediction and the first reference picture of each prediction direction, and the motion vector performs motion estimation and compensation with the prediction motion vector.
  • the prediction motion vector encodes prediction motion vector information for each prediction direction with reference to FIGS. 50 and 51.
  • motion information of the current SKIP block may be encoded by using prediction motion information with reference to FIGS. 52 and 53.
  • the prediction direction and the reference picture of the prediction motion information may be used, or may be fixed to the arbitrary prediction direction and the arbitrary reference picture.
  • the encoder 140 generates transform type data by generating and encoding a transform subblock partition flag for identifying a type of a transform selected for each block.
  • Transform type data is included in the encoded data.
  • the usable transform type may be encoded in a header, and the transform type may be determined according to a macroblock or a subblock independently of the size of the prediction subblock, and may be determined according to a prediction mode (inter prediction, intra prediction) of the prediction subblock. It may be.
  • the currently available transform types are 32 ⁇ 32, 16 ⁇ 16, 8 ⁇ 8. Is the transformation.
  • the current macroblock size is 64 ⁇ 64, is divided into 16 ⁇ 16 subblocks, and the size of the inter prediction subblock is 4 ⁇ 4, the currently available transform types are 16 ⁇ 16, 8 ⁇ 8, and 4 ⁇ . 4 conversion.
  • the transform subblock partition flag is encoded in macroblock units or subblock units. This is possible for intra prediction encoding as well as inter prediction encoding.
  • 55 is a diagram illustrating syntax of a macroblock, a subblock, and a predictive subblock of an intra picture according to an embodiment of the present invention.
  • the Delta QP is information for informing the image decoding apparatus of the QP applied in units of macroblocks or subblocks currently encoded.
  • Delta QP represents a difference between a QP applied to a macroblock or subblock unit currently encoded and a QP encoded in a header (slice header, picture header, sequence header, etc.).
  • the image decoding apparatus may obtain a QP applied in units of macroblocks or subblocks currently encoded by adding the encoded QP and the Delta QP to the header (slice header, picture header, sequence header, etc.).
  • Delta QP can encode the presence or absence in the header. That is, when the header information indicates that the Delta QP is used, the Delta QP value is encoded in the macroblock or the subblock.
  • Coded data of an intra picture includes a partition type, an intra prediction mode, a transform type, a coded block pattern X-flag / coded block pattern, and a transform coefficient. Field).
  • the encoder 140 of the image encoding apparatus 100 encodes the partition type information, the intra prediction mode, the transform information, the CBPX_flag / CBP, the transform coefficient, and the like, and assigns them to each field to generate encoded data.
  • the syntax of the encoded data for the intra picture shown in FIG. 55 is merely exemplary, and the syntax of the encoded data for the intra picture is not necessarily configured as shown in FIG. 55. That is, it should be appreciated that some or all of the syntax of the encoded data for the intra picture may be changed differently than illustrated in FIG. 55, and some syntax may be omitted.
  • a segmentation flag indicating whether a macroblock is divided into subblocks and each macroblock indicating information in which a macroblock is divided into subblocks may be allocated.
  • the partition type information of the macroblock may be encoded by sequentially encoding the partition type for each partition layer according to the partition type encoding order.
  • a process of dividing the macroblocks shown in FIG. 19 for each of the divided layers may be shown as shown in FIG. 20.
  • a 64 ⁇ 64 pixel subblock is divided into four 32 ⁇ 32 pixel subblocks, and a division flag is encoded by 1, and in layer 1 (L1), L1- Subblocks of P0 (partition number 0 of macroblock layer 1) and subblocks of L1-P3 (partition number 3 of macroblock layer 1) are further divided into four 16 ⁇ 16 pixel subblocks, and L1-P0 and L1-
  • the division flag of P3 is coded as 1, and the subblocks of L1-P1 (partition number 1 of macroblock layer 1) and the subblocks of L1-P2 (partition number 2 of layer 1) are each 16x32 pixel prediction subblocks.
  • the division flag is encoded as 0.
  • layer 2 the subblock of L2-P0 (partition number 0 of macroblock layer 2) is further divided into four 8x8 pixel subblocks, and the division flag is coded as 1.
  • L2-P3 Partition number 3 of macroblock layer 2) is encoded into two 16x8 pixel prediction subblocks.
  • the subblocks of L3-P0 (partition number 0 of macroblock layer 3) and the subblocks of L3-P1 (partition number 1 of macroblock layer 3) are each 4 4 ⁇ . Prediction is performed using a four-pixel prediction subblock, and the division flag is encoded by zero.
  • each subblock is encoded with reference to FIG. 55 in the encoding order for each subblock of the macroblock.
  • a prediction mode flag indicating whether a prediction mode identical to the prediction mode of the current block is present among the prediction modes estimated from the neighboring blocks are encoded.
  • the value of the prediction mode flag is 1, and information indicating which of the estimated prediction modes is the prediction mode of the current block is encoded.
  • the prediction modes of a block whose prediction mode flag is the current encoding target are not the same as the prediction mode of the current block estimated from the neighboring block, the prediction mode of the current block and the prediction mode of the current block estimated from the neighboring block are not the same.
  • a prediction mode number indicating a prediction mode flag indicating whether the prediction mode is one of the remaining prediction modes except the prediction mode of the current block estimated from the neighboring block among various intra prediction directions according to the size of the corresponding subblock is intra of the current block. It is encoded as a prediction mode to generate intra prediction mode data.
  • a coded block pattern flag (CBP_flag: hereinafter referred to as a "CBP flag") that considers a transform type may be encoded and assigned to a CBP flag.
  • CBP flag a coded block pattern flag that considers a transform type
  • the CBP data allocated to the CBP flag and the CBP field indicates whether the transform block includes non-zero quantized transform coefficients according to the transform subblock size.
  • 56 is an exemplary diagram illustrating a syntax structure of encoded data for an inter picture according to an embodiment of the present invention.
  • the block type indicates whether the corresponding macroblock or subblock is an inter block or an intra block.
  • the encoded data for the inter picture includes one or more fields of a split flag, a SKIP flag, a Delta QP, and a block type, and the macroblock or subblock is an intra macroblock.
  • the predicted motion information flag if the macroblock or subblock is an inter macroblock, the predicted motion information flag, the predicted motion information, the motion information (prediction direction, One or more fields of a prediction motion vector, a differential motion vector, a reference picture index), a transform information / CBP flag, and a transform coefficient.
  • syntax of the encoded data for the inter picture shown in FIG. 56 is merely exemplary, and the syntax of the encoded data for the inter picture is not necessarily configured as shown in FIG. 56. That is, it should be appreciated that some or all of the syntax of the encoded data for the inter picture may be changed differently from those shown in FIG. 56, and some syntax may be omitted.
  • the encoder 140 of the image encoding apparatus 100 encodes a SKIP flag indicating whether a macroblock or subblock that is currently encoding is a SKIP block. For example, if the macroblock is a 64x64 pixel block, a SKIP flag indicating whether the 64x64 pixel macroblock is a SKIP block is encoded, and if the macroblock is a 32x32 pixel block divided into subblocks, 32x32 pixels. The SKIP flag indicating whether the subblock is a SKIP block is encoded. If the macroblock or subblock is a SKIP block, since the current macroblock or subblock has no data to be encoded, the next macroblock or subblock is encoded.
  • a macroblock type flag indicating whether the macroblock or subblock is an intra macroblock or an inter macroblock is transmitted.
  • the available macroblock types are I-macroblocks and P-macroblocks
  • the macroblock type is usable. Are I- and B-macroblocks. Since the division type field and the fields such as the intra prediction mode for the intra picture, the transform information / CBP flag, and the transform coefficient have been described above with reference to FIG. 55, the following description will describe SKIP flag, prediction motion information flag, prediction motion information, Fields such as motion information (prediction direction, predicted motion vector, differential motion vector, reference picture index), transform coefficients, and the like will be described.
  • all block types of FIG. 54 may be used for motion estimation, and may be selected as an intra mode or an inter mode on a macroblock or subblock basis. That is, both intra mode and inter mode may be used in a macroblock of a P-picture or a P-slice.
  • the object to be encoded is a 32 ⁇ 32 pixel block
  • whether to perform encoding in units of 32 ⁇ 32 pixel blocks or encoding in units of 16 ⁇ 16 pixel blocks may be indicated through a split flag. For example, when the division flag is 1, it means that 32 ⁇ 32 macroblocks are divided into 16 ⁇ 16 subblocks to perform encoding.
  • the macroblock flag When the macroblock flag is 0, encoding is performed in units of 32 ⁇ 32 macroblocks. It may mean.
  • the division flag When the division flag is 1, the macroblock may be divided into four 16 ⁇ 16 pixel blocks to determine whether it is an intra mode or an inter mode in each 16 ⁇ 16 pixel block unit.
  • each 16 ⁇ 16 pixelblock unit may be divided into smaller subblocks to perform encoding.
  • Coding modes that can be used in a B-picture according to an embodiment of the present invention include intra mode, SKIP mode, L0 prediction, L1 prediction and bidirectional, batch mode, and the like.
  • the intra mode is encoded using the same method as the above-described intra encoding method, and may select an intra mode in macroblock units or an intra mode in subblock units.
  • the SKIP mode transmits a flag indicating that a current block to be encoded is a SKIP mode and a predicted motion vector flag.
  • the SKIP mode may be used for the macroblock or the subblock, and the reference block obtained through the motion compensation using the predicted B_pred_dir, the predicted motion vector MVD, the predicted ref_idx, and the like is a reconstructed block.
  • B_pred_dir is a prediction direction of the B-picture, and means both directions of L0 and L1.
  • L0 prediction means one direction prediction using only L0 motion information
  • L1 prediction means one direction prediction using only L1 motion information
  • Bidirectional prediction means prediction using two motion information of L0 and L1 using a mean value of two pictures as a reference picture.
  • Motion estimation methods for B-pictures include motion estimation / compensation in direct prediction mode, motion estimation / compensation in SKIP mode, motion estimation / compensation in one-way prediction (L0 prediction or L1 prediction), and motion estimation in bidirectional prediction. / Compensation method.
  • L0 prediction, L1 prediction, and bidirectional prediction blocks may use different reference images.
  • motion estimation is not performed, and motion information (a prediction direction, a motion vector, a reference picture, etc.) of neighboring blocks or blocks already encoded is used as motion information of the current block.
  • motion information a prediction direction, a motion vector, a reference picture, etc.
  • the encoding process of the SKIP flag of the B-picture is similar to the encoding process of the SKIP flag of the P-picture, a detailed description thereof will be omitted.
  • the SKIP flag, the L0 prediction motion vector flag, and the L1 prediction motion vector flag are encoded.
  • DMVs differential motion vectors
  • Vector motion information including a reference picture index, a prediction direction, and a predicted motion vector are encoded.
  • the transform type is determined according to the transform subblock of the macroblock or subblock.
  • the transform subblock indicates the size of the transform subblock within the macroblock or subblock. For example, when the size of the current subblock is 32x32 and the transform type is 32x32, 16x16, 8x8, and 4x4, the transform type is encoded and decoded through the transform subblock division flag. can do. In this case, when the partition type of the current subblock is 16 ⁇ 16, when the subblock partition flag is encoded as 1, a transform subblock having a size of 16 ⁇ 16 is represented.
  • 57 shows an example of a process of encoding transform information and a CBP flag in a macroblock.
  • the non-zero quantization transform coefficients are present in the luminance signal in the transform transform subblock (S5705), and the presence or absence of nonzero quantization transform coefficients in the luminance component of the current transform subblock.
  • the CBP flag of the color difference component may be coded by dividing it into Cb and Cr.
  • variable length encoding method is the same as the detailed description of the first embodiment, and thus will be omitted.
  • neighboring blocks of a target block to be encoded are divided into sub-block units in macroblocks.
  • the context table may be used differently depending on whether encoding is performed (in this case, the division flag may be set to binary bit 1). In this way, a different context table may be used according to the picture type, whether the reference picture is used, and data of neighboring blocks.
  • a decoding method and apparatus according to the present embodiment will be described with reference to the image decoding apparatus 4600 of FIG. 46.
  • some of the components of the image decoding apparatus of FIG. 46 perform operations different from those of the corresponding components of the decoding apparatus according to the first embodiment, as described below and according to the second embodiment of the present invention. It will be clearly understood from the operation of the encoding method and apparatus.
  • decoding of a quantization parameter encoded in a macroblock or subblock unit may be performed.
  • syntax of the image coded data shown in FIG. 55 is merely exemplary, and the syntax structure of the image coded data according to an embodiment of the present invention is not limited to the structure shown in FIG. 55.
  • the decoder 4610 reconstructs the intra prediction mode by decoding one bit of intra prediction mode data extracted from the bitstream for each prediction subblock, reconstructing the prediction mode flag, and reconstructing the prediction mode flag by the corresponding prediction mode flag.
  • the intra prediction mode of the corresponding prediction sub block estimated from the neighboring block is currently selected.
  • the intra prediction mode which is reconstructed as the intra prediction mode of the block, the intra prediction mode of the next prediction sub-block, and decoded by decoding the next 3 bits of the intra prediction mode data when it is not identical, is regarded as the intra prediction mode of the current block.
  • Restore The intra prediction mode reconstructed as described above is input to the intra predictor 4452 of the predictor 4630.
  • the type and order of data to be decoded in the image encoded data by the decoder 4610 are as shown in FIG. 56. That is, the decoder 4610 decodes the split flag data extracted from the bitstream to restore whether the macroblock to be decoded is divided into subblocks. The QP of the macroblock or subblock to be decoded is restored by decoding the Delta QP. The SKIP flag data is then decoded to restore the SKIP flag indicating whether the macroblock or subblock to be decoded is the SKIP block.
  • the decoder 4610 decodes the block type data and the prediction motion information flag extracted from the bitstream, and the block to be currently decoded is an inter block, and the batch Restore whether or not in mode. If the current block is in the batch mode, the prediction motion information is decoded and restored. If the current block is not in the batch mode, the motion information is decoded and restored. Then, the CBP according to the transform information and the transform information is decoded and restored.
  • the decoder 4610 may apply SKIP flag data only for blocks. Reconstructs the SKIP flag by decoding and decodes the MVD / ref_idx data for the prediction subblocks (meaning not SKIP) that are not SKIP blocks identified by the SKIP flag to be decoded to decode the motion vector and the reference picture index. Restore Alternatively, in the batch mode, the predicted motion information is restored.
  • the reconstructed motion information is input to an inter predictor 4452 (which can be implemented as a motion compensator), and the reconstructed CBP flag, transform type, and quantized transform coefficients are used as subblocks of the target macroblock or the target macroblock to be decoded. Input to inverse quantizer and inverse transformer 4620 to recover the remaining blocks of lock.
  • the image decoding apparatus 4600 may be configured as follows according to whether the macroblock is an inter macroblock or an intra macroblock.
  • the decoder 4610 decodes the coded data to restore partition type information, intra prediction mode, transform information, CBP flag, and quantized transform coefficients, and inverse quantizer and
  • the inverse transformer 4620 restores the remaining subblocks by inverse quantization and inverse transformation of the quantized transform coefficients using a transform selected according to the size of the subblock identified according to the reconstructed partition type information, and the predictor 4630 restores the subblock.
  • the predicted subblock is generated by predicting the subblock identified according to the partition type information to be recovered using the reconstructed intra prediction mode, and the adder 4640 adds the predicted subblock and the remaining subblock to reconstruct the subblock.
  • an embodiment of the present invention is applied to an image compression field for encoding and decoding a video, and divides a macroblock into subblocks of various sizes and shapes, and may be configured with different prediction units according to the size of the divided subblock.
  • the present invention is very useful for generating an effect of improving compression efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

영상 부호화/복호화 장치 및 방법이 개시된다. 본 발명의 실시예에 따른 영상 부호화/복호화 장치는, 매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하고, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하며, 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하고, 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하며, 분할된 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 영상 부호화기; 및 부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하고, 복원되는 분할타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 영상 복호화기를 포함하는 것을 특징으로 한다.

Description

영상 부호화/복호화 장치 및 방법
본 발명은 영상 부호화/복호화 장치 및 방법에 관한 것이다. 더욱 상세하게는, 확장된 매크로블록을 다양한 크기와 형상의 서브블록으로 분할하고 분할된 서브블록의 크기와 형상에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화함으로써 영상압축 효율을 향상시키기 위한 방법 및 장치에 관한 것이다. 또한, 이와 같은 영상 부호화 장치로부터 비트스트림을 수신하여 대응적으로 영상을 복호화함으로써, 영상의 복원 효율을 향상시키기 위한 장치 및 방법에 관한 것이다.
동영상 데이터를 압축하기 위한 표준화된 기술로는 현재 H.261, H.263, H.264, MPEG-2, MPEG-4 등이 있다. 이러한 기존의 동영상 압축 기술에 따르면, 각 영상을 휘도 성분의 16x16 크기의 화소들과 색차 성분의 8x8 크기의 화소들의 사각 영역으로 이루어진 고정된 크기의 매크로블록(Macroblock)들로 나누어 부호화한다. 각 매크로블록의 모든 휘도 성분(Luma Component)과 색차 성분(Chroma Component)들은 공간적으로나 시간적으로 예측되고, 예측 잔여(Predicted Residual)는 변환(Transform) 및 양자화(Quantization), 엔트로피 부호화(Entropy Coding) 등의 과정을 거치면서 압축된다.
H.264/AVC 압축 표준에 따른 부호화 장치는 각 매크로블록을 16x16 크기, 8x8 크기, 4x4 크기의 더 작은 블록으로 분할하여 인트라 예측 부호화(Intra Prediction Encoding)할 수 있으며, 16x16 화소 블록에 대해서는 4 가지의 예측 모드 중 하나를 사용하고, 8x8 화소 블록과 4x4 화소 블록에 대해서는 9 가지의 예측 모드 중 하나를 사용하여 인트라 예측 부호화한다. 인터 예측 부호화(Inter Prediction Encoding)의 경우, 각 매크로블록은 16x16 크기, 16x8 크기, 8x16 크기, 8x8 크기, 8x4 크기, 4x8 크기, 4x4 화소 블록으로 분할되어 인터 예측 부호화될 수 있다. 변환은 8x8 크기 또는 4x4 화소 블록 단위로 적용되고, 변환 계수(Transform Coefficient)의 양자화로는 스칼라(Scalar) 양자화가 사용된다.
하지만, 16x16 크기의 매크로블록은 대체로 QCIF, CIF급의 작은 영상에 적합한 크기라 할 수 있으며, 4Kx2K 영상과 같은 고해상도 영상 압축을 위한 매크로블록의 크기로 부적합하다. 또한, 통상적인 영상 압축 기술에서는 고정된 크기의 매크로블록을 이용하여 영상을 부호화하기 때문에(비록 H.264/AVC에서는 매크로블록을 더 작은 블록 단위로 분할하여 부호화하지만, 매크로블록의 크기는 고정됨), 고해상도의 영상을 부호화하는 경우에는 효율적인 부호화가 어려운 문제점이 있다.
또한, 영상의 복호화는 영상의 부호화에 대응하여 이루어지기 때문에, 고해상도 영상의 부호화에 대한 압축 효율이 저하된 상태에서는 고효율의 복호화를 기대하기 어렵다는 문제점이 있다.
전술한 문제점을 해결하기 위해 본 발명은, 매크로블록을 다양한 크기로 확장시키고, 확장된 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하며 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화 및 복호화함으로써 압축 효율 및 복원 효율을 향상시키는 데 주된 목적이 있다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화/복호화 장치는, 매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하고, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하며, 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하고, 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하며, 분할된 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 영상 부호화기; 및 부호화 비용이 선택적으로 결정된 부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하고, 복원되는 분할타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 영상 복호화기를 포함하는 것을 특징으로 한다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화 장치는, 매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 예측기; 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 감산기; 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 변환 및 양자화기; 및 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하는 부호화기를 포함하며, 분할된 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 것을 특징으로 한다.
여기서, 서브블록의 크기가 설정된 화소블록의 크기 이상인지의 여부에 따라 부호화 비용을 다르게 선택하여 계산할 수 있다.
또한, 서브블록의 크기가 설정된 화소블록의 크기 이하인 경우, 다음의 식에 따라 부호화 비용을 계산할 수 있다.
RDcost=SATD(or SAD)+λ·Bit[block type,prediction info,CBP]
여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, SAD는 원 영상과 예측영상 간의 차분치에 절대값을 취하여 모두 더한 값이고, SATD는 잔여블록을 변환 수행한 후 그 값에 절대값을 취하여 모두 더한 값이며, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다.
또한, 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우, 다음의 식에 따라 부호화 비용을 계산할 수 있다.
RDcost=Distortion+λ·Bit[block type,prediction info,CBP,coeficient]
여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, λ는 양자화 파라미터에 의해 결정되는 상수이고, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다.
또한, 참조픽처로 사용되는지의 여부에 따라 부호화 비용을 다르게 선택할 수 있다.
전술한 목적을 달성하기 위한 영상 복호화 장치는, 부호화 비용이 선택적으로 결정된 부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하는 복호화기; 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하는 역양자화기 및 역변환기; 복원되는 분할타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 예측기; 및 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 가산기를 포함하는 것을 특징으로 한다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화/복호화 방법은, 매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하고, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하며, 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하고, 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하며, 분할된 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 영상 부호화 단계; 및 부호화 비용이 선택적으로 결정된 부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하고, 복원되는 분할타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 영상 복호화 단계를 포함하는 것을 특징으로 한다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화 방법은, 매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 단계; 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 단계; 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 단계; 및 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하는 단계를 포함하며, 분할된 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 것을 특징으로 한다.
여기서, 서브블록의 크기가 설정된 화소블록의 크기 이상인지의 여부에 따라 부호화 비용을 다르게 선택하여 계산할 수 있다.
또한, 서브블록의 크기가 설정된 화소블록의 크기 이하인 경우, 다음의 식에 따라 부호화 비용을 계산할 수 있다.
RDcost=SATD(or SAD)+λ·Bit[block type,prediction info,CBP]
여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, SAD는 원 영상과 예측영상 간의 차분치에 절대값을 취하여 모두 더한 값이고, SATD는 잔여블록을 변환 수행한 후 그 값에 절대값을 취하여 모두 더한 값이며, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다.
또한, 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우, 다음의 식에 따라 부호화 비용을 계산할 수 있다.
RDcost=Distortion+λ·Bit[block type,prediction info,CBP,coeficient]
여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, λ는 양자화 파라미터에 의해 결정되는 상수이고, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다.
또한, 참조픽처로 사용되는지의 여부에 따라 부호화 비용을 다르게 선택할 수 있다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화 방법은, 부호화 비용이 선택적으로 결정된 부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하는 단계; 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하는 단계; 복원되는 분할타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 단계; 및 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 단계를 포함하는 것을 특징으로 한다.
이상에서 설명한 바와 같이 본 발명에 의하면, 확장된 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하고 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화 및 복호화함으로써 압축 효율 및 복원효율을 향상시킬 수 있다.
도 1은 본 발명의 일 실시예에 따른 영상 부호화 장치를 간략하게 나타낸 블록 구성도이다.
도 2는 본 발명의 실시예에 따라 입력되는 이미지를 패딩하였을 경우의 부호화 및 복호화를 설명하기 위해 도시한 도면으로서, 입력 이미지와 현재 부호화할 확장된 매크로블록의 위치를 나타낸 도면이다.
도 3은 도 2의 현재 부호화할 대상인 확장된 매크로블록을 확대한 도면이다.
도 4는 본 발명의 일 실시예에 따라 인트라 예측 부호화와 인터 예측 부호화를 위여 매크로블록을 다양한 크기의 서브블록으로 분할하는 과정의 예를 나타낸 도면이다.
도 5는 본 발명의 다른 실시예에 따라 인트라 예측 부호화와 인터 예측 부호화를 위하여 매크로블록을 다양한 크기의 서브블록으로 분할하는 과정의 예를 나타낸 도면이다.
도 6은 본 발명의 일 실시예에 따른 인트라 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
도 7은 본 발명의 일 실시예에 따른 휘도 성분의 인트라 예측 모드에 따른 9 가지의 예측 방향과 예측 모드 번호를 나타낸 예시도이다.
도 8은 본 발명의 일 실시예에 따른 휘도 성분의 인트라 예측 모드에 따른 4 가지의 예측 방향과 예측 모드 번호를 나타낸 예시도이다.
도 9는 본 발명의 일 실시예에 따른 휘도 성분의 인트라 예측 모드에 따른 3 가지의 예측 방향과 예측 모드 번호를 나타낸 예시도이다.
도 10은 본 발명의 일 실시예에 따른 색차 성분의 4 가지의 인트라 예측 모드에 따른 예측 방향과 예측 모드 번호를 나타낸 예시도이다.
도 11은 본 발명의 일 실시예에 따른 64x64 화소의 확장된 매크로블록에 대한 다양한 서브블록 타입을 나타낸 예시도이다.
도 12는 본 발명의 일 실시예에 따른 인터 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
도 13은 본 발명의 일 실시예에 따라 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
도 14는 본 발명의 일 실시예에 따른 8x16 화소 블록과 16x8 화소 블록의 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
도 15는 본 발명의 일 실시예에 따른 서브블록 크기에 따른 사용 가능한 변환의 종류와 변환 타입이 부호화되는 단위를 나타낸 예시도이다.
도 16은 본 발명의 일 실시예에 따른 디블록킹 필터링을 수행할 블록 경계를 나타낸 예시도이다.
도 17은 본 발명의 일 실시예에 따른 인트라 픽처의 신택스를 나타낸 예시도이다.
도 18은 본 발명의 일 실시예에 따른 분할 타입별 번호를 나타낸 예시도이다.
도 19는 본 발명의 일 실시예에 따라 확장된 매크로블록을 다양한 크기의 서브블록으로 분할하는 경우의 분할 타입 번호 부호화 순서를 설명하기 위해 도시한 도면이다.
도 20은 본 발명의 일 실시예에 따라 매크로블록이 분할 레이어별로 분할되는 과정을 순차적으로 나타낸 예시도이다.
도 21은 매크로블록의 레이어별 분할 타입 번호를 순차적으로 부호화하는 과정을 설명하기 위한 예시도이다.
도 22는 본 발명의 일 실시예에 따른 인트라 예측 모드의 부호화 순서를 나타낸 예시도이다.
도 23은 본 발명의 일 실시예에 따라 매크로블록의 인트라 예측 모드를 부호화하는 과정의 일 예를 설명하기 위한 예시도이다.
도 24는 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX_플래그와 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 25는 본 발명의 일 실시예에 따른 CBP의 구조를 나타낸 예시도이다.
도 26은 본 발명의 일 실시예에 따라 CBPX 플래그와 CBP를 부호화하는 순서의 일 예를 나타낸 예시도이다.
도 27은 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX 플래그와 CBP를 부호화하는 순서의 다른 예를 나타낸 예시도이다.
도 28은 본 발명의 일 실시예에 따른 분할 타입별 양자화된 변환 계수의 부호화 순서를 나타낸 예시도이다.
도 29는 본 발명의 일 실시예에 따른 부호화 데이터의 신택스 구조를 나타낸 예시도이다.
도 30은 본 발명의 일 실시예에 따른 P-픽처(또는 P-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다.
도 31은 본 발명의 일 실시예에 따른 B-픽처(또는 B-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다.
도 32는 본 발명의 일 실시예에 따른 SKIPX 플래그의 부호화 과정을 설명하기 위한 예시도이다.
도 33 및 도 34는 본 발명의 일 실시예에 따라 인터 매크로블록에 대한 CBPX_플래그, 변환 타입과 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 35는 본 발명의 실시예에 따른 skipX_flag를 부호화/복호화하기 위한 ctx_inc의 예를 나타낸 도면이다.
도 36은 본 발명의 실시예에 따른 interX_flag를 부호화/복호화하기 위한 ctx_inc의 예를 나타낸 도면이다.
도 37은 본 발명의 실시예에 따른 directX_flag를 부호화/복호화하기 위한 ctx_inc의 예를 나타낸 도면이다.
도 38 및 도 39는 본 발명의 실시예에 따라 트리 구조를 이용하여 분할 타입 정보를 부호화하는 과정을 설명하기 위해 도시한 도면이다.
도 40은 본 발명의 실시예에 따른 분할 타입의 부호화의 일 예를 나타낸 도면이다.
도 41은 본 발명의 실시예에 따른 분할 타입 부호화의 다른 예를 나타낸 도면이다.
도 42는 본 발명의 실시예에 따른 B_pdir를 부호화/복호화하기 위한 ctx_inc의 예를 나타낸 도면이다.
도 43은 본 발명의 실시예에 따른 사용 가능한 변환의 종류가 2 가지인 경우에 변환 타입의 부호화/복호화를 위한 ctx_inc의 예를 나타낸 도면이다.
도 44는 본 발명의 실시예에 따른 사용 가능한 변환의 종류가 3 가지인 경우에 변환 타입의 부호화/복호화를 위한 ctx_inc의 예를 나타낸 도면이다.
도 45는 본 발명의 실시예에 따른 사용 가능한 변환의 종류가 3 가지인 경우에 변환 타입의 부호화/복호화를 위한 ctx_inc의 다른 예를 나타낸 도면이다.
도 46은 본 발명의 일 실시예에 따른 영상 복호화 장치를 간략하게 나타낸 블록 구성도이다.
도 47은 본 발명의 실시예에 따른 색차 성분의 예측 모드 테이블을 나타낸다.
도 48은 인트라 예측 모드에 따른 변환의 종류를 예시한 도면이다.
도 49는 현재 블록의 인트라 예측 모드에 따라 가로 변환과 세로 변환의 종류에 따른 변환의 종류를 예시한 도면이다.
도 50은 본 발명의 제2 실시예에 따라 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
도 51은 각 블록 그룹의 대표 움직임벡터에 대한 부호화시의 할당코드를 예시한 도면이다.
도 52는 현재블록과 주변블록 및 동일위치 블록을 도시한 도면이다.
도 53은 각 블록의 움직임 정보에 대한 부호화시의 할당코드를 예시한 도면이다.
도 54는 블록의 레이어에 따른 서브블록의 형상을 예시한 도면이다.
도 55는 본 발명의 일 실시예에 따른 인트라 픽처의 매크로블록과 서브 블록, 예측 서브 블록의 신택스(Syntax)를 나타낸 예시도이다.
도 56은 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터의 신택스 구조를 나타낸 예시도이다.
도 57은 매크로블록 내의 변환 정보와 CBP 플래그를 부호화하는 과정의 예시를 나타낸 도면이다.
후술할 본 발명의 일 실시예에 따른 영상 부호화 장치(Video Encoding Apparatus)와 영상 복호화 장치(Video Decoding Apparatus)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 개인 휴대 단말기(PDA: Personal Digital Assistant), 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 무선통신 단말기(Wireless Communication Terminal), 스마트 폰(Smart Phone) 등일 수 있으며, 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, 영상을 부호화하거나 복호화하기 위한 각종 프로그램과 데이터를 저장하기 위한 메모리, 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미한다.
또한, 영상 부호화 장치에 의해 비트스트림으로 부호화된 영상은 실시간 또는 비실시간으로 인터넷, 근거리 무선 통신망, 무선랜망, 와이브로망, 무선통신망, 유선 전화망 등의 유무선 통신망 등을 통하거나 케이블, 범용 직렬 버스(USB: Universal Serial Bus) 등의 통신 인터페이스를 통해 영상 복호화 장치로 전송되어 영상 복호화 장치에서 복호화되어 영상으로 복원되고 재생될 수 있다.
도 1은 본 발명의 일 실시예에 따른 영상 부호화 장치를 간략하게 나타낸 블록 구성도이다.
본 발명의 일 실시예에 따른 영상부호화 장치(100)는 예측기(110), 감산기(120), 변환기 및 양자화기(130), 부호화기(140), 역양자화기 및 역변환기(150), 가산기(160), 필터(170) 및 픽처 버퍼(180)를 포함하여 구성될 수 있다.
예측기(110)는 인트라 예측기(112)와 인터 예측기(114)를 포함할 수 있으며, 인터 예측기(114)는 다시 움직임 추정기(116)와 움직임 보상기(118)를 포함할 수 있다.
입력 영상은 프레임 단위 또는 필드 단위로 도 1의 영상 부호화 장치(100)에 입력되거나, N×N(단, N은 16이상의 정수) 화소를 가지는 매크로블록들로 분할되어 영상 부호화 장치(100)에 입력될 수 있다. 즉, 입력 영상이 4K×2K 영상과 같은 고해상도 영상인 경우, N이 16보다 큰 정수로 이루어진 매크로블록으로 분할하여 부호화를 수행함으로써 영상 압축의 효율 향상을 꾀할 수 있다. 여기서, N이 16보다 큰 정수로 이루어진 매크로블록을 확장된 매크로블록(EMB: Extended Macroback)이라고 명명한다. 예를 들어, 확장된 매크로블록은 64×64, 32×32 등과 같은 크기의 정방형의 화소 블록으로 이루어질 수 있다. 이하에 기재하는 매크로블록은 확장된 매크로블록과, 일반적인 16×16 화소 블록의 매크로블록을 포함하는 개념임에 유의한다.
한편, N이 16보다 큰 정수로 이루어진 확장된 매크로블록을 사용하여 영상 압축을 수행할 때, 입력 영상이 16화소의 배수가 아닌 경우에는 입력 영상에 대해 16화소의 배수가 되도록 패딩한 후 영상 압축을 수행할 수 있다.
도 2는 본 발명의 실시예에 따라 입력되는 영상을 패딩하였을 경우의 영상 부호화 및 복호화를 설명하기 위해 도시한 도면이며, 도 3은 도 2의 현재 부호화할 대상인 확장된 매크로블록을 확대한 도면이다. 16화소의 배수로 패딩이 수행된 입력 영상과 현재 부호화할 대상인 확장된 매크로블록의 위치가 도 2와 같을 경우, 현재의 확장된 매크로블록의 부호화는 16화소의 배수가 되도록 패딩한 입력 이미지 안에 속하는 화소값만을 이용하는 것이 바람직하다. 즉, 도 3에서 현재의 확장된 매크로블록 내의 패딩된 영역은 부호화에 사용하지 않는 것이 바람직하다. 또한, 비트스트림에 부호화하는 데이터도 16화소의 배수가 되도록 패딩한 입력 이미지 안에 속하는 화소값만을 이용하는 것이 바람직하다.
입력 영상이 4:2:0 포맷(Format)의 영상의 경우, 매크로블록은 N×N 화소를 가지는 휘도 블록과 두 개의 화소를 가지는 색차 블록으로 이루어진다. 이와 같은 확장된 매크로블록에 의한 고해상도 영상의 압축 효율 향상은, 이하에서 설명하는 구체적인 실시예에 의해 달성된다.
본 발명의 일 실시예에 따른 확장된 매크로블록은 도 4에 도시한 바와 같이 내부적으로 더 작은 서브블록으로 분할되어 인트라 예측 부호화 또는 인터 예측 부호화가 수행될 수 있다.
즉, 고해상도 영상의 부호화를 위하여 N이 16이상인 매크로블록을 사용하는 경우, 확장된 매크로블록은 보다 작은 화소 블록 단위로 분할하여 부호화를 수행할 수 있으며, 각각의 화소 블록은 더 작은 서브블록으로 분할하여 부호화를 수행할 수 있다. 또한, 확장된 매크로블록 또는 분할된 화소 블록의 일변의 길이가 16화소 보다 큰 경우에는 도 5에 도시한 바와 같이, 32×64, 64×32, 16×32 또는 32×16와 같은 직사각형 형상을 갖는 화소 블록으로의 분할을 생략하고 확장된 매크로블록을 정방형의 화소 블록으로 분할한 후 16×16 화소 블록 단위로 부호화를 수행할 수도 있다. 도 4 및 도 5에는 확장된 매크로블록에 대하여 최소 블록의 크기가 4×4인 각각의 서브블록을 예시적으로 나타내었다. 예를 들어, 확장된 매크로블록이 64×64 화소 블록인 경우, 도 4의 매크로블록 레이어(Layer) 0에는 서브블록인 64×64 화소 블록, 64×32 화소 블록, 32×64 화소 블록, 32×32 화소 블록이 속하고 매크로블록 레이어 1에는 서브블록인 32×32 화소 블록, 32×16 화소 블록, 16×32 화소 블록, 16×16 화소 블록이 속할 수 있다. 또한, 도 5와 같이 16×16 화소 블록보다 큰 서브블록들에 대해 64×32 화소블록, 32×64 화소블록, 32×16 화소블록, 16×32 화소블록과 같은 직사각형 형상의 서브블록의 분할을 생략할 수 있다. 이 경우, 매크로블록 레이어 0에는 서브블록인 64×64 화소 블록 및 32×32 화소 블록이 속하도록 하고 매크로블록 레이어 1에는 서브블록인 32×32 및 16×16 화소 블록이 속하게 된다. 여기서, 매크로블록 레이어 K(단, 0≤K≤log2(N/4))의 서브블록 중 제일 큰 서브블록이 4 개의 블록으로 분할된 경우에만 매크로블록 레이어 K+1의 서브블록들을 사용할 수 있다. 즉, 도 5의 경우와 같이, 매크로블록 레이어 0의 64×64 서브블록이 4개의 서브블록으로 분할된 경우에만 매크로블록 레이어 1의 서브블록들을 사용할 수 있으며, 매크로블록 레이어 1의 32×32 서브블록이 4개의 16×16 서브블록으로 분할된 경우에만 매크로블록 레이어 2의 서브블록들을 사용할 수 있다.
영상 부호화 장치(100)는 매크로블록을 서브블록으로 분할하여 부호화했을 경우의 각 서브블록에 대한 부호화 효율을 계산하고, 가장 부호화 효율이 높은 경우의 서브블록을 최종적인 인트라 예측 블록 또는 인터 예측 블록으로 결정한다. 부호화 효율은 수학식 1과 같은 율-왜곡 최적화(RDO: Rate-Distortion Optimizaion) 기법에 근거하여 측정할 수 있다.
수학식 1
Figure PCTKR2011002762-appb-M000001
여기서 Distortion은 부호화 대상 블록과 복원 블록 사이의 에러(error) 값을 나타내고, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다. 이때, 매크로블록의 분할된 서브블록에 대한 블록 타입, 예측모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정할 수 있다. 바람직하게는, 서브블록의 크기가 설정된 화소블록(예를 들면, 16×16 화소블록)의 크기 이상인지의 여부에 따라 부호화 비용을 다르게 선택하여 계산할 수 있다.
블록의 모드는 가능한 블록들의 모든 타입에 대하여 각 블록의 최적의 예측 모드(인트라 예측모드, 움직임 데이터)를 결정한 후, 블록 타입을 결정하는 과정으로 나뉠 수 있으며, 보통 예측모드 결정시(인트라 예측모드나 움직임 벡터/참조픽처 선택시)에는 연산량을 줄이기 위해서 SAD(Sum of Absolute Difference) 또는 SATD(Sum of Absolute Transformed Difference)를 사용하고 Bit에는 변환 계수의 비트는 고려하지 않는다. 이를 정리하면 수학식 2와 같이 표현할 수 있다.
수학식 2
Figure PCTKR2011002762-appb-M000002
수학식 2에서 SAD는 원 영상과 예측 영상 사이의 차분치에 절대값을 취하여 모두 더한 값을 말하고, SATD는 잔여블록을 변환을 수행한 후 그 값에 절대값을 취하여 모두 더한 값을 말한다.
블록 타입 결정시에는 수학식 3을 이용하여 엄격하게 RDcost를 계산하는 것이 바람직하다.
수학식 3
Figure PCTKR2011002762-appb-M000003
수학식 3의 Distortion은 수학식 4로 나타낼 수 있다.
수학식 4
Figure PCTKR2011002762-appb-M000004
수학식 2는 수학식 3을 이용하는 것보다 연산량은 적으나 움직임이 없는 영역 또는 복잡하지 않은 영역의 경우에는 Distortion이 거의 비슷하기 때문에 수학식 2를 사용해서는 최적의 모드를 결정하는 것이 힘들다. 반면에, 수학식 3은 수학식 2보다 정확한 부호화 효율을 계산할 수는 있으나 계산량이 많다는 단점이 있다. 그러므로, 본 발명의 실시예에서는 데이터의 중요도(참조픽처로 사용되는지의 여부 등) 또는 부호화하고자 하는 모드에 따라 수학식 2 또는 수학식 3을 선택하여 사용하는 것이 바람직하다. 예를 들어, 인트라 예측모드 결정시 및 블록의 움직임 벡터/참조픽처 결정시에는 수학식 3을 사용할 수 있다. 다만, 예외적으로 B 픽처의 16×16 이상 크기의 화소 블록의 예측 방향(L0 예측, L1 예측, 양방향 예측)과 움직임 벡터/참조 픽처 결정과정은 각 예측 방향에 따라 움직임 벡터와 참조 픽처는 수학식 3을 사용하여 결정하며, 예측 방향은 수학식 2를 사용하여 결정할 수 있다. 블록 타입 결정시에는 수학식 3을 사용할 수 있다. 또한, 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우에는 수학식 3에 따라 부호화 비용을 결정하고, 설정된 화소블록의 크기보다 작은 경우에는 수학식 2에 따라 부호화 비용을 결정할 수 있다.
예를 들어, 부호화 비용의 선택 기준을 16×16 화소블록으로 설정한다고 가정하면, 16×16 화소블록이 가질 수 있는 부호화 모드는 16×16 SKIP 모드, 16×16 Direct 모드, L0 예측모드를 사용하는 16×16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), L1 예측모드를 사용하는 16×16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), L0 및 L1 예측모드를 모두 사용하는 16×16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), 16×16 인트라 블록 등이 있다. 16×16 이상의 화소블록들의 부호화 모드들에 대해서는 정밀한 부호화 비용을 사용하는 것이 바람직하다. 블록 타입이 16×16 이상의 크기를 가지는 경우는 주로 배경과 같은 평탄한 영역이기 때문에 근사화된 식으로는 최적의 모드결정이 어렵기 때문이다. 그러므로 16×16 이상의 블록들을 사용하는 경우에는 매크로블록 내 모드 결정시 블록 사이즈와 모드에 따라 부호화 비용을 선택적으로 사용하도록 한다. 또한, 부호화 비용을 구하는 식에서 고려하는 파라미터를 작은 블록들간의 모드결정에 사용하는 파라미터와 큰 블록들간의 모드결정에 사용하는 파라미터를 다르게 고려하도록 할 수도 있다.
최소 블록의 크기는 최대로 사용할 수 있는 레이어값인 최대 레이어값(MaxLayer)에 따라 결정된다. 예를 들어, N×N 화소의 매크로블록인 경우, 최소 블록의 크기는 N/(2MaxLayer)로 결정된다.
영상 부호화 장치(100)의 각 구성 요소에 대해서는 후술하는 과정에서 관련 도면들과 함께 설명한다.
영상 부호화 장치(100)는 영상을 부호화할 때, 동영상을 구성하는 픽처 단위로 픽처 타입을 구분하여 픽처 타입에 따라 다르게 예측 부호화한다. 예를 들어, 임의의 픽처가 인트라 픽처인 경우에는 인트라 픽처 내의 매크로블록들의 타입은 모두 인트라 매크로블록이 되며, 각 매크로블록을 인트라 예측 부호화한다. 또한, 임의의 픽처가 인터 픽처인 경우에는 인터 픽처 내의 매크로블록들의 매크로블록 타입은 인터 매크로블록 또는 인트라 매크로블록일 수 있으며, 매크로블록 타입에 따라 인트라 예측 부호화거나 인터 예측 부호화된다. 이와 같은 픽처 타입에 대한 정보는 그대로 또는 부호화되어 부호화 데이터의 픽처 헤더 또는 시퀀스 헤더 등에 삽입될 수 있으며, 후술할 영상 복호화 장치는 픽처 헤더 또는 시퀀스 헤더 등에서 픽처 타입에 대한 정보를 추출하거나 복원하여 복호화할 픽처의 픽처 타입을 결정할 수 있다.
이하에서는 본 발명의 일 실시예에 따른 부호화 방법과 그를 통해 생성되는 부호화 데이터를 픽처 타입에 따라 설명한다.
도 6은 본 발명의 일 실시예에 따른 인트라 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
예측기(110)의 인트라 예측기(112)는 현재 부호화하고자 하는 블록(이하 '현재 블록'이라 칭함)의 주변 화소를 이용하여 참조 블록을 생성하고 참조 블록과 현재 블록을 비교하여 인트라 예측 모드를 결정한다. 여기서, 주변 화소란 현재 블록 주위에 있는 블록 내에 있는 화소들을 말하며, 현재 블록과 인접한 블록들 내에서 현재 블록과 인접한 인접 화소를 포함하는 개념이다.
확장된 매크로블록을 휘도 성분에 대한 4×4 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분의 인트라 예측 모드에 따른 9 가지의 예측 방향과 예측 모드 번호를 예시적으로 나타낸 도 7을 참조하면, 9 가지의 예측 방향(예측 모드 0 내지 예측 모드 8에 따른 예측 방향) 중 가장 적절한 예측 방향을 4×4 화소 단위의 현재 블록마다 1 개씩 선택하고, 선택된 예측 방향을 이용하여 현재 블록을 인트라 예측 부호화한다. 예측 모드 2가 의미하는 평균값은 현재 블록의 왼쪽 블록의 4 개의 인접 화소와 현재 블록의 위쪽 블록의 4 개 인접 화소의 총 8 개의 인접 화소의 평균값을 구해 현재 블록의 4×4 화소 모두를 예측하는 방법이다.
픽처의 좌측 경계에 위치하는 블록과 픽처의 윗쪽 경계에 위치하는 블록의 경우 왼쪽 블록과 윗쪽 블록이 각각 픽처 바깥쪽에 위치하게 된다. 이 경우, 픽처 경계를 벗어난 블록을 참조할 수 없기 때문에 예측 방향의 이용이 제한된다. 예를 들어, 픽처의 제일 위쪽에 위치한 블록에서는 윗쪽 블록의 화소를 참조하는 예측 모드 0, 예측 모드 3, 예측 모드 4, 예측 모드 5, 예측 모드 6, 예측 모드 7의 예측 방향을 이용할 수 없다. 예외적으로 DC 모드의 경우, 픽처의 경계를 벗어나지 않는 화소만을 참조해서 현재 블록의 예측을 수행한다. 만약, 현재 블록과 이웃한 왼쪽 블록과 윗쪽 블록을 이용할 수 없는 경우, DC 값은 128을 사용한다.
선택된 현재 블록의 예측 방향과 현재 블록의 왼쪽 블록과 위쪽 블록 중 더 작은 예측 모드 번호를 가지는 블록의 예측 방향을 비교하여 두 예측 방향이 동일한 경우, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시될 수 있음)를 추정한 예측 방향과 같은 예측 방향임을 나타내도록 부호화한다.
만약, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 다른 경우, 예측 모드 플래그를 선택된 현재 블록의 예측 방향이 추정한 현재 블록의 예측 방향과 다른 예측 방향임을 나타내도록 부호화하고 9 가지의 예측 모드에서 추정한 현재 블록의 예측 방향에 해당하는 예측 모드를 뺀 나머지 8 가지의 예측 모드 중 어떠한 예측 모드가 선택된 현재 블록의 예측 방향인지를 나타내기 위한 예측 모드 정보(예를 들어, 3 비트로 표시될 수 있음)를 부호화한다.
확장된 매크로블록을 휘도 성분에 대한 8×8 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분에 대한 8×8 화소 단위의 인트라 예측은 4×4 화소 단위의 인트라 예측과 같이 도 7에 도시한 바와 같은 9 가지 예측 방향을 이용하며, 예측 화소를 계산하는 방법도 블록의 크기(4×4 화소와 8×8 화소)의 차이를 제외하면 4×4 화소 단위의 인트라 예측 부호화의 경우와 동일하다.
확장된 매크로블록을 휘도 성분에 대한 16×16 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 도 8에 도시한 바와 같은 4 가지의 예측 방향 중에서 부호화 효율이 가장 좋은 예측 방향을 선택하고, 선택된 예측 방향에 따라 16×16 크기의 현재 블록의 위쪽에 위치한 16×16 화소 블록 내의 16 개의 인접 화소와 현재 블록의 왼쪽에 위치한 16×16 화소 블록 내의 16 개의 인접 화소의 총 32 개의 인접 화소로부터 16×16 화소 블록을 예측 부호화한다.
도 8에서, 예측 모드 3인 평면(Plane) 예측의 경우, 현재 블록의 위쪽 블록 내의 인접 화소와 현재 블록의 왼쪽 블록 내의 인접 화소를 대각선 방향으로 보간(Interpolation)하여 예측한다. 예측 모드 2에 해당하는 평균값 예측의 경우, 평균값은 현재 블록의 윗쪽 블록 내의 16 개의 인접 화소와 왼쪽 블록의 16 개의 인접 화소의 평균값을 현재 블록의 16×16 화소 모두로 예측한다. 단, 현재 블록이 픽처 내에서 제일 위쪽에 위치하는 경우, 현재 블록의 왼쪽 블록 내의 16 개의 인접 화소의 평균값을 예측값으로 이용하며, 현재 블록이 픽처 내에서 가장 왼쪽에 위치하는 경우, 현재 블록의 위쪽 블록 내의 16 개 인접 화소의 평균값을 예측값으로 이용한다. 현재 블록의 왼쪽 블록과 윗쪽 블록을 이용할 수 없는 경우, 예측값으로 128을 사용한다. 16×16 화소 블록의 예측 모드는 예측 부호화되지 않고, 단순히 선택된 예측 모드의 번호가 예측 모드 정보(예를 들어, 2 비트로 표시됨)로서 부호화된다.
확장된 매크로블록을 전술한 4×4 화소 블록, 8×8 화소 블록 또는 16×16 화소 블록을 제외한 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분의 인트라 예측 모드는 도 9와 같이 3가지의 예측 방향과 예측 모드 번호로 나타낼 수 있다. 4×4 화소 블록, 8×8 화소 블록 또는 16×16 화소 블록을 제외한 나머지 서브 블록으로 분할하여 인트라 예측을 수행하는 경우에 해당 서브 블록의 크기가 m×n이라고 하면, 도 9에 도시한 바와 같은 3 가지의 예측 방향 중에서 선택되는 부호화 효율이 가장 좋은 예측 방향에 따라 현재 블록의 위쪽 블록 내의 m 개의 인접 화소와 왼쪽 블록 내의 n 개의 인접 화소로부터 m×n 화소 블록을 인트라 예측 부호화한다.
예측 모드 2에 해당하는 평균값 예측의 경우, 현재 블록의 위쪽 블록 내의 m 개의 인접 화소와 왼쪽 블록 내의 n 개 인접 화소의 평균값을 이용해서 현재 블록을 예측 부호화한다. 단, 현재 블록이 픽처 내에서 제일 위쪽에 위치하는 경우, 현재 블록의 왼쪽 블록의 n 개의 인접 화소의 평균값을 현재 블록의 예측값으로 이용하며, 현재 블록이 픽처 내의 제일 왼쪽에 위치하는 경우, 위쪽 블록 내의 m 개의 인접 화소의 평균값을 현재 블록의 예측값으로 이용한다. 현재 블록의 왼쪽 블록과 위쪽 블록을 이용할 수 없는 경우, 현재 블록의 예측값으로 128이 사용된다.
선택된 현재 블록의 예측 방향과 현재 블록의 왼쪽 블록과 위쪽 블록 중 더 작은 예측 모드의 번호를 가지는 블록의 예측 방향이 같은 방향인 경우, 현재 블록의 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시될 수 있다)를 추정한 현재 블록의 예측 방향과 같은 예측 방향이라는 정보를 부호화한다. m×n 화소 블록이 가질 수 있는 예측 모드의 번호는 0 내지 2이므로, 현재 블록의 왼쪽 블록과 위쪽 블록을 이용하여 예측한 현재 블록의 예측 모드 번호가 3 이상인 경우에는 현재 블록의 예측 방향은 예측 모드 번호 2(DC 모드)를 사용할 수 있다. 예를 들어, 주변 블록으로부터 예측한 현재 블록의 예측 모드 번호가 4인 경우, 현재 블록의 예측 모드 번호를 2로 하여 선택된 현재 블록의 예측 방향과 동일한지를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시됨)를 부호화한다.
여기서, 확장된 매크로블록에 대한 인트라 예측은 16×16 이하의 화소 블록 단위 즉, 4×4 화소 블록, 8×8 화소 블록, 16×16 화소 블록 또는 m×n(여기서, m≠n이며, m 및 n은 16보다 작은 수) 화소 블록 단위로 수행되는 것이 바람직하다.
색차 성분의 인트라 예측은 (N/2)×(N/2) 화소 블록 단위로 수행될 수 있다. 예측 방향은 도 10에 나타낸 바와 같이, 평균치 예측, 수평 예측, 수직 예측, 평면 예측 4 가지의 예측 방향이 사용될 수 있다. 바람직하게는, 색차 성분의 인트라 예측은 8×8 화소 블록 단위로 수행된다.
본 발명의 일 실시예에 따른 색차 성분의 4 가지의 인트라 예측 모드에 따른 예측 방향과 예측 모드 번호를 예시적으로 나타낸 도 10을 참조하면, 예측 모드 3에 해당하는 평면 예측과 예측 모드 0에 해당하는 평균값 예측을 위한 예측값 계산 방법도 블록의 크기(16×16 화소와 8×8 화소)의 차이를 제외하고 휘도 성분의 16×16 화소 단위의 인트라 예측 부호화 방법과 동일하다. 색차 신호의 예측 모드는 휘도 신호의 예측 모드와는 독립적으로 선택할 수 있다. 색차 신호는 U, V의 두 종류가 있지만 예측 방법은 같다. 색차 신호의 예측 모드는 U, V 각각 1 개씩이며 각 색차 신호의 예측 모드는 예측 부호화하지 않고 단순히 선택된 예측 모드 번호를 2 비트를 사용하여 나타낸다.
다시 도 6을 참조하면, 인트라 예측기(112)는 도 7 내지 도 10을 통해 전술한 바와 같은 방식으로 4×4 화소 단위에 대한 9 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, 8×8 화소 단위에 대한 9 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, 16×16 화소 단위에 대한 4 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, m×n 화소 단위에 대한 3 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드 중 율-왜곡 최적화를 이용하여 결정되는 하나의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 결정한다. 이때 사용되는 율-왜곡 최적화 식은 전술한 수학식 3에 따르는 것이 바람직하다. 이와 같은 방법으로 인트라 예측 모드가 결정되면 그에 따라 서브블록의 크기도 함께 결정된다.
전술한 바와 같이 결정되는 인트라 예측 모드에 따라, 인트라 예측기(112)는 현재 블록을 예측하여 예측 블록(Predicted Block)을 생성하고, 감산기(120)는 현재 블록과 예측 블록을 감산하여 잔여 블록(Residual Block)을 생성한다. 변환기 및 양자화기(130)는 잔여 블록을 변환 및 양자화하여 양자화된 변환 계수를 생성하고, 부호화기(140)는 양자화된 변환 계수를 엔트로피 부호화하여 부호화 데이터를 생성한다.
변환기 및 양자화기(130)는 휘도 성분의 4×4, 4×8, 8×4 화소 단위의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 4×4 변환을 수행하고, 8×8, 8×16, 16×8 화소 단위의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 8×8 변환을 수행할 수 있다. 또한, 변환기 및 양자화기(130)는 16×16 화소 단위 이상의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 16×16 변환을 수행할 수 있다. 이 경우, 인트라 예측의 단위와 서브블록의 크기가 동일하므로, 변환의 종류는 서브블록의 블록 크기에 따라 결정할 수 있다.
여기서, 각 16×16 변환이 수행되는 16×16 화소를 가지는 잔여 블록(이하 '16×16 화소 잔여 블록'이라 칭함)은 다시 16 개의 4×4 화소를 가지는 잔여 블록(이하 '4×4 화소 잔여 블록'이라 칭함)으로 분할되고, 각 4×4 화소 잔여 블록에 대해 4×4 변환이 수행될 수 있다. 이후, 각 4×4 화소 잔여 블록이 4×4 변환되어 생성되는 각 4×4 화소를 가지는 변환 블록(이하 '4×4 화소 변환 블록'이라 칭함)의 16 개 DC 성분들만이 모여 4×4 변환 계수를 가지는 변환 블록(이하 'DC 성분 블록'이라 칭함)이 구성되고, DC 성분 블록은 4×4 변환이 한번 더 수행된다. 이때, DC 성분 블록을 변환하는 데에는 잔여 블록을 변환할 때의 변환과 다른 종류의 변환이 사용될 수 있다. 즉, 4×4 화소 잔여 블록에 대해서는 4×4 이산 코사인 변환(DCT: Discrete Cosine Transform)이 수행되고, DC 성분 블록에 대해서는 4×4 하다마드 변환이 사용될 수 있다. 예를 들어, 16×32 화소 단위의 인트라 예측이 선택된 현재 블록에 대한 16×32 화소 잔여 블록은 두 개의 16×16 화소 잔여 블록으로 분할되고 분할된 각 16×16 화소 잔여 블록에 대해 4×4 화소 단위로 4×4 변환이 수행된다. 이후 16×16 크기의 화소 잔여 블록 내 각 4×4 변환 블록들의 DC 성분들이 모여 DC 성분 블록이 구성되고 DC 성분 블록에 대해서 4×4 변환이 한번 더 수행된다.
만일, 32×32 화소 블록인 확장된 매크로블록의 위치가 도 2에 도시한 바와 같이 16화소의 배수로 패딩된 이미지와 패딩된 영역에 걸치는 경우, 해당 확장된 매크로블록이 인트라 모드이면 도 3에 도시한 바와 같이 실제의 이미지 영역(16×16 화소 블록)에 대해서만 부호화 모드를 결정하고 해당 영역의 분할 타입, 인트라 예측 모드, CBP, 변환 계수의 부호화를 수행한다.
도 11은 본 발명의 일 실시예에 따른 64×64 화소의 확장된 매크로블록에 대한 서브 블록의 블록 타입을 나타낸 예시도이다.
확장된 매크로블록이 64×64 화소 블록이고 인트라 예측 후 최적의 블록 타입이 도 11에 도시한 바와 같이 결정되었다고 가정하면, 블록 0 내지 블록 7에 대해서는 4×4 변환이 수행되고, 블록 8 내지 블록 12에 대해서는 8×8 변환이 수행되며, 블록 13 내지 블록 18에 대해서는 16×16 화소 블록 내에서 4×4 화소 단위로 4×4 변환이 수행되고 각 16×16 화소 블록 내 각 4×4 변환 블록들의 DC 성분들이 모여 구성되는 DC 성분 블록에 대하여 다시 변환이 수행된다.
색차 신호의 경우, 16×16 화소 단위 이상의 인트라 예측의 경우와 마찬가지로 4×4변환이 수행된 후, DC 성분 블록에 대하여 4×4 변환이 한 번 더 수행된다. 단, 색차 성분의 매크로블록의 잔여 블록은 8×8 화소를 가지는 잔여 블록(이하 '8×8 화소 잔여 블록'이라 칭함)으로 분할되고 각 8×8 화소 잔여 블록 내의 4 개의 4×4 화소 잔여 블록에 대해서는 4×4 변환이 수행된다. 8×8 화소 잔여 블록 내 4 개의 4×4 변환 블록의 DC 성분들이 모여 2×2 변환 계수를 가지는 DC 성분 블록이 구성되고 DC 성분 블록에 대해 2×2 변환이 수행된다. 이 때도 마찬가지로, 8×8 화소 잔여 블록에 대한 4×4 변환과 DC 성분 블록에 대한 2×2 변환의 종류는 다를 수 있다.
또는, 확장된 매크로블록에 대하여 최적의 블록 타입이 결정된 후 전술한 변환 타입에 따라 변환을 수행하는 대신에, 16×16 화소 블록의 단위로 인트라 예측에 사용된 서브 블록의 크기에 따라 효율이 좋은 변환 타입을 선택하여 사용할 수도 있다. 즉, 변환 및 양자화기(130)는 16×16 화소 블록의 단위로 하나 이상의 변환 및 양자화를 수행한 후 가장 효율이 좋은 변환의 종류를 선택하고, 선택된 변환의 종류에 따라 변환 및 양자화된 변환 계수를 생성할 수 있다. 이 경우, 부호화기(140)는 각 블록마다 선택된 변환의 종류를 식별하기 위한 변환 타입을 생성하고 부호화하여 변환 타입 데이터를 생성하는 것이 바람직하다. 변환 타입 데이터는 부호화 데이터에 포함된다. 단, 16×16 화소 블록 내에서는 서로 다른 변환을 사용할 수 없다.
이에 대하여 보다 상세하게 설명하면, 16×16 화소 블록이 8×8 화소 블록으로 분할되고 4 개의 8×8 화소 블록들 중 한 개 이상의 8×8 화소 블록이 8×8 화소보다 작은 서브블록으로 분할된 경우에는 16×16 화소 블록에 대해서 4×4 변환만이 사용될 수 있으며, 이 경우 변환 타입은 부호화되지 않는다. 또한, 16×16 화소 블록이 4 개의 8×8 화소 블록으로 분할된 경우에는 16×16 화소 블록에 대해서는 4×4 변환과 8×8 변환이 수행되어 부호화 비용이 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트로 표시될 수 있다)이 부호화될 수 있다. 또한, 16×16 화소 블록이 2 개의 8×16 화소 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환, 8×8 변환과 8×16 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되고, 16×16 화소 서브블록이 2 개의 16×8 화소 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환, 8×8 변환과 16×8 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시될 수 있다)이 부호화될 수 있다. 16×16 화소 이상의 서브블록에 대해서는 4×4 변환, 8×8 변환과 16×16 변환이 수행되어 부호화 비용이 가장 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시됨)이 부호화될 수 있다.
도 12는 본 발명의 일 실시예에 따른 인터 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
P-픽처 또는 P-슬라이스의 경우, 도 4의 모든 블록 타입들이 움직임 추정에 사용될 수 있으며, 확장된 매크로블록 내에는 16×16 화소 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수 있다. 즉, P-픽처 또는 P-슬라이스의 확장된 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다.
B-픽처 또는 B-슬라이스의 경우, 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 부르며, 이 두 장의 참조 픽처는 서로 다른 역할을 한다. 보통은 L0 예측(List 0 Prediction, 주로 순방향 예측에 사용됨)이 순방향 예측, L1 예측(List 1 Prediction, 주로 역방향 예측에 사용됨)이 역방향 예측으로 사용된다. P-픽처 및 B-픽처에 대한 각각의 보다 상세한 인터 픽처 부호화 방법은 후술한다.
확장된 매크로블록이 32×32 화소 블록인 경우, 32×32 화소 블록 단위로 부호화를 수행할지 또는 16×16 화소 블록 단위로 부호화를 수행할지는 확장된 매크로블록 플래그(extended_mb_flga)를 통해 나타낼 수 있다. 예를 들어, 확장된 매크로블록 플래그가 1인 경우에는 32×32 화소블록 단위로 부호화를 수행함을 의미하며, 확장된 매크로블록 플래그가 0인 경우에는 16×16 화소블록 단위로 부호화를 수행함을 의미할 수 있다. 확장된 매크로블록 플래그가 0인 경우, 확장된 매크로블록은 4개의 16×16 화소블록으로 분할되어 각 16×16 화소블록 단위로 인트라 모드인지 또는 인터 모드인지를 결정할 수 있다. 또한, 각각의 16×16 화소블록 단위는 더 작은 서브블록으로 분할되어 부호화가 수행될 수 있다.
다시 도 1을 참조하면, 예측기(110)의 인터 예측기(114)의 움직임 추정기(116)는 현재 픽처 내 현재 부호화 대상인 현재 블록과 가장 유사한 블록, 즉 참조 블록을 참조 픽처 내에서 찾아 현재 블록에 대한 참조 블록의 상대적인 위치를 나타내는 움직임 벡터(MV: Motion Vector)를 출력한다. 이러한 과정을 움직임 추정(Motion Estimation)이라 하는데, 움직임 추정은 매크로블록 내 서브블록을 픽처 버퍼(180)에 있는 하나 이상의 참조 픽처와 비교하여 움직임 벡터를 생성한다. 8×8 화소 블록은 서로 다른 참조 픽처를 이용할 수 있으나 8×8 화소 블록 내 서브블록들은 같은 참조 픽처를 이용한다.
움직임 벡터는 부호화기(140)에 의해 부호화되어 부호화 데이터에 포함되는데, 부호화기(140)는 현재 블록의 주변 블록의 움직임 벡터들의 중앙값(Mean Value)을 예측 움직임 벡터(PMV: Predicted Motion Vector)로 이용하고 예측 움직임 벡터와 현재 블록의 움직임 벡터의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)만을 부호화하여 움직임 정보 데이터를 생성한다. 이때, 부호화기(140)는 차분 움직임 벡터뿐만 아니라 참조 픽처 인덱스(Reference Picture Index)를 추가로 부호화할 수 있다. 즉, 움직임 정보는 차분 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있으며, 부호화기(140)는 움직임 정보를 부호화하여 움직임 정보 데이터를 생성하고 움직임 정보 데이터를 부호화 데이터에 포함시킬 수 있다.
도 13은 본 발명의 일 실시예에 따라 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
13A는 현재 블록과 주변 블록이 모두 64×64 화소 블록일 때, 현재 블록의 움직임 벡터와 예측 움직임 벡터를 결정하기 위해 이용되는 주변 블록의 움직임 벡터를 나타내었다. 현재 블록과 주변 블록이 모두 동일한 크기의 블록인 경우에는 기존의 방법과 같이 주변 블록의 움직임 벡터들의 중앙값을 예측 움직임 벡터로서 결정할 수 있다.
13B는 현재 블록과 주변 블록의 크기가 다를 때, 현재 블록의 움직임 벡터와 예측 움직임 벡터를 결정하기 위해 이용되는 주변 블록의 움직임 벡터를 나타내었다. 현재 블록과 주변 블록의 크기가 다른 경우에는 어느 주변 블록을 이용하여 예측 움직임 벡터를 결정해야 할지를 선택해야 한다.
본 발명의 일 실시예에서는 13B에 나타낸 바와 같이 현재 블록의 왼쪽에 있는 주변 블록이 여러 개의 블록으로 나뉘어 있을 경우 그 중 가장 위쪽 오른쪽에 위치한 블록 A의 움직임 벡터 mvA를 예측에 이용하고, 현재 블록의 위쪽에 있는 주변 블록이 여러 개로 나뉘어 있는 경우 그 중 가장 아래쪽 왼쪽에 위치한 블록 B의 움직임 벡터 mvB를 예측에 이용하며, 오른쪽 윗쪽에 위치한 주변 블록이 여러 개로 나뉘어 있는 경우 그 중 가장 아래쪽 왼쪽에 위치한 블록 C의 움직임 벡터 mvC를 예측에 이용한다. 단, 예외적인 경우로서, 블록 B와 블록 C가 모두 픽처의 경계 밖에 위치할 경우, 블록 B와 블록 C를 이용해서는 예측 움직임 벡터를 결정할 수 없기 때문에 블록 A의 움직임 벡터만을 이용하여 예측 움직임 벡터를 결정한다. 또한, 블록 A, 블록 B, 블록 C 중에 현재 블록과 참조 픽처의 번호가 같은 블록이 하나만 있는 경우, 해당 블록의 움직임 벡터를 예측 움직임 벡터를 결정하는 데 이용한다.
도 14는 본 발명의 일 실시예에 따른 8×16 화소 블록과 16×8 화소 블록의 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
또한, 현재 블록이 8×16 화소 블록 또는 16×8 화소 블록인 경우에는 중앙값을 이용하지 않는다. 즉, 현재 블록이 8×16 화소 블록인 경우, 왼쪽의 주변 블록으로서는 블록 A를, 오른쪽의 주변 블록으로서는 블록 C를 예측 움직임 벡터를 결정하는 데 이용한다. 현재 블록이 16×8 화소 블록인 경우, 윗쪽의 주변 블록은 블록 B를, 아랫쪽의 주변 블록은 블록 A를 예측 움직임 벡터를 결정하는 데 이용한다.
또한, 본 발명의 일 실시예에서는, 16×16 이상의 화소 블록인 매크로블록에 대하여 SKIP 모드를 사용한다. 16×16 이상의 화소 블록인 매크로블록이 SKIP 매크로블록인 경우에는 예측 움직임 벡터를 이용해서 움직임 추정 및 보상이 수행된다. 단, 예측 움직임 벡터를 결정하는 데 이용되는 움직임 벡터들 중 한 개 이상이 0인 경우 예측 움직임 벡터를 0으로 결정한다. 예를 들어, 주변 블록 A, B, C의 움직임 벡터가 각각 mvA (0,10)이고, mvB (1, 10)이며, mvC (2, 10)인 경우, 현재 블록의 예측 움직임 벡터는 (0, 10)이 된다.
만일, 32×32 화소 블록인 확장된 매크로블록의 위치가 도 2에 도시한 바와 같이 16화소의 배수로 패딩된 이미지와 패딩된 영역에 걸치는 경우, 해당 확장된 매크로블록이 SKIP 모드이면 도 3에 도시한 바와 같이 실제의 이미지 블록(16×16 화소 블록)의 왼쪽 블록과 위쪽 블록을 이용하여 예측 움직임 벡터를 구하고, 그 예측 움직임 벡터를 사용해서 실제의 이미지 블록에 대한 움직임 예측 및 보상을 수행한다. 현재 부호화 대상인 확장된 매크로블록의 최적의 부호화 모드가 SKIP 모드인 경우, skip32_flag를 복호화하고 다음의 확장된 매크로블록에 대한 부호화를 수행한다.
다시 도 1을 참조하면, 감산기(120)는 움직임 추정기(116)에서 추정한 현재 블록의 움직임 벡터가 가리키는 참조 블록과 현재 블록을 감산하여 잔여 블록을 생성하고, 변환기 및 양자화기(130)는 감산기(120)에 의해 생성된 잔여 블록을 변환 및 양자화하며, 부호화기(140)는 양자화된 변환 계수를 엔트로피 부호화하여 부호화 데이터를 생성한다. 여기서, 변환기 및 양자화기(130)는 현재 블록의 크기에 따라 하나 이상의 변환 및 양자화를 수행한 후 가장 효율이 좋은 변환의 종류를 선택하고, 선택된 변환의 종류에 따라 변환 및 양자화된 변환 계수를 생성한다. 부호화기(140)에서는 각 블록마다 선택된 변환의 종류를 식별하기 위한 변환 타입을 생성하고 부호화하여 변환 타입 데이터를 생성한다. 변환 타입 데이터는 부호화 데이터에 포함된다. 단, 16×16 화소 블록 내에서는 서로 다른 변환을 사용할 수 없다.
인트라 예측 블록에서 설명한 변환 방법과 마찬가지로, 16×16 화소 서브블록이 8×8 화소 블록으로 분할되고 4 개의 8×8 화소 서브블록들 중 한 개 이상의 8×8 화소 서브블록이 8×8 화소보다 작은 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환만이 사용될 수 있으며, 이 경우 변환 타입은 부호화되지 않는다. 16×16 화소 서브블록이 4 개의 8×8 화소 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환과 8×8 변환이 수행되어 부호화 비용이 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트로 표시됨)이 부호화된다.
16×16 화소 서브블록이 2 개의 8×16 화소 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환, 8×8 변환과 8×16 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되고, 16×16 화소 서브블록이 2 개의 16×8 화소 서브블록으로 분할된 경우에는 16×16 화소 서브블록의 잔여 블록에 대해서는 4×4 변환, 8×8 변환과 16×8 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시될 수 있다)이 부호화된다. 16×16 화소 이상의 서브블록에 대해서는 4×4 변환, 8×8 변환과 16×16 변환이 수행되어 부호화 비용이 가장 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시됨)이 부호화된다.
16×16 화소 블록이 4 개의 8×8 화소 서브블록으로 분할된 경우와 같이 선택 가능한 변환의 종류가 2가지인 경우, 변환 타입 부호화에 사용되는 부호화 비트는 표 1과 같이 구성될 수 있다.
표 1
Figure PCTKR2011002762-appb-T000001
또한, 16×16 화소 블록이 2개의 8×16 화소 블록으로 분할되거나, 2개의 16×8 화소 블록으로 분할되거나 또는 16×16 이상의 서브 블록과 같이 선택 가능한 변환의 종류가 3가지인 경우, 변환 타입 부호화에 사용되는 부호화 비트는 표 2와 같이 구성될 수 있다.
표 2
Figure PCTKR2011002762-appb-T000002
도 15는 본 발명의 일 실시예에 따른 서브블록 크기에 따른 사용 가능한 변환의 종류와 변환 타입이 부호화되는 단위를 나타낸 예시도이다.
도 15에서는 확장된 매크로블록이 64×64 화소이고, 확장된 매크로블록이 다양한 크기의 서브블록으로 분할된 경우를 예시적으로 나타내었다. 전술한 바와 같이, 매크로블록의 첫 번째 16×16 화소 블록(1510)은 8×8 화소 블록보다 작은 4×4 화소 서브블록으로 분할되었으므로 사용 가능한 변환은 4×4 변환뿐이며, 이 경우 변환 타입은 부호화되지 않는다. 두 번째 16×16 화소 블록(1520)은 4 개의 8×8 화소 서브블록으로 분할되었으므로 4×4 변환 또는 8×8 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 세 번째 16×16 화소 블록(1530)은 2 개의 8×16 화소 서브블록으로 분할되었으므로 4×4 변환, 8×8 변환 또는 8×16 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 네 번째 16×16 화소 블록(1540)은 2 개의 16×8 화소 서브블록으로 분할되었으므로 4×4 변환, 8×8 변환 또는 16×8 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 다섯 번째 16×32 화소 블록(1550), 여섯 번째 16×32 화소 블록(1560), 일곱 번째 32×32 화소 블록(1570) 및 여덟 번째 32×32 화소 블록(1580)은 모두 16×16 화소 블록보다 크므로 4×4 변환, 8×8 변환 또는 16×16 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 16×16 화소 보다 큰 블록에 대해서는 16×16 화소 블록 단위로 변환 타입을 선택할 수도 있다. 이 경우, 32×32 화소 블록과 같은 16×16 화소 블록보다 큰 화소 블록 내의 부호화된 블록 패턴이 0이 아닌 16×16 화소 블록에 대해서는 복수개의 변환 타입을 부호화한다.
다시 도 1을 참조하면, 변환기 및 양자화기(130)에 의해 변환 및 양자화된 잔여 블록은 역양자화기 및 역변환기(150)에 의해 역양자화 및 역변환되어 잔여 블록이 복원되고, 가산기(160)는 복원된 잔여 블록과 예측기(110)에 의해 예측된 예측 블록을 가산하여 현재 블록을 복원한다.
필터(170)는 가산기(160)에 의해 복원된 현재 블록들이 누적되어 만들어지는 픽처를 디블록킹 필터 등을 사용하여 필터링을 수행하고, 필터링된 픽처는 픽처 버퍼(180)에 저장되어 다음 픽처의 참조 픽처로서 이용된다.
도 16은 본 발명의 일 실시예에 따른 디블록킹 필터링을 수행할 블록 경계를 나타낸 예시도이다.
16A 내지 16E는 각각 4×4 변환, 8×8 변환, 8×16 변환, 16×8 변환 및 16×16 변환이 사용된 16×16 화소 블록에서 디블록킹 필터링을 수행할 블록 경계를 나타내었다. 16A에 나타낸 4×4 변환이 사용된 16×16 화소 블록은 각 4×4 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블록킹 필터링이 수행되며, 16B에 나타낸 8×8 변환이 사용된 16×16 화소 블록은 각 8×8 블록의 왼쪽과 위쪽의 블록 경계에 디블록킹 필터링이 수행되며, 16C에 나타낸 8×16 변환이 사용된 16×16 화소 블록은 각 8×16 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행되며, 16D에 나타낸 16×8 변환이 사용된 16×16 화소 블록은 각 16×8 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행되며, 16E에 나타낸 16×16 변환이 사용된 16×16 화소 블록은 16×16 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행된다.
도 17은 본 발명의 일 실시예에 따른 인트라 픽처의 신택스(Syntax)를 나타낸 예시도이다.
확장된 매크로블록에 대한 서브 블록의 형태가 도 4에 도시한 바와 같이 직사각형 타입(예를 들어, 32×16 화소 블록, 16×32 화소 블록 등)을 포함하는 경우에 영상 부호화 장치(100)는 영상 복호화 장치에 분할된 서브 블록의 타입 정보를 전송하여야 하므로, 인트라 픽처의 부호화 데이터는 분할 타입(Partition Type), 인트라 예측 모드(Intra Prediction Mode), CBPX_flag/CBP(Coded Block Pattern X-flag/Coded Block Pattern) 및 변환 계수(Transform Coefficient) 등과 같은 필드들로 구성될 수 있다. 영상 부호화 장치(100)의 부호화기(140)는 분할 타입 정보, 인트라 예측 모드, CBPX_플래그/CBP 및 변환 계수 등을 부호화하여 각 필드에 할당하여 부호화 데이터를 생성한다.
다만, 도 17에서 도시한 인트라 픽처에 대한 부호화 데이터의 신택스는 예시적인 것일 뿐, 인트라 픽처에 대한 부호화 데이터의 신택스가 반드시 도 17에 도시한 바와 같이 구성되어야 하는 것은 아니다. 즉, 인트라 픽처에 대한 부호화 데이터의 신택스 중 일부 또는 전부의 순서가 도 17에 도시한 바와는 다르게 변경될 수도 있으며, 일부의 신택스는 생략될 수도 있음을 인식해야 할 것이다.
또는, 확장된 매크로블록에 대한 서브 블록의 형태가 도 5에 도시한 바와 같이 정방형의 화소 블록으로 분할된 후 16×16 화소 블록 단위로 인트라 예측 부호화가 수행되는 경우, CBPX_플래그에 대한 부호화는 생략되고 양자화 파라미터에 대한 증감정보(Δpq)가 부호화될 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화될 수 있으며, CBP 정보는 16×16 화소 블록 단위로 부호화되는 것이 바람직하다.
도 17에서 분할 타입 필드에는 매크로블록이 서브블록으로 분할된 모양을 나타내는 매크로블록의 분할 타입 정보가 부호화된 데이터인 분할 타입 데이터가 할당된다. 분할 타입 정보는 도 18에서 예시적으로 나타낸 분할 타입별 번호를 이용하여 생성될 수 있다.
도 18을 참조하면, 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록이 더 이상 분할되지 않는 경우에는 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록에 분할 타입 번호 0이 할당된다. 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록이 두 개의 (N/2k)×(N/2k+1)화소 블록으로 분할된 경우에는 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록에 분할 타입 번호 1이 할당된다. 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록이 두 개의 (N/2k+1)×(N/2k) 화소 블록으로 분할된 경우에는 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록에 분할 타입 번호 2가 할당된다. 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록이 4 개의 (N/2k+1)×(N/2k+1)로 분할되는 경우에는 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록에 분할 타입 번호 3이 할당된다. 도 18에서 각 매크로블록 레이어 K의 (N/2k)×(N/2k) 화소 블록 내의 분할된 서브블록에 표시된 0, 1, 2, 3 등의 숫자는 각 서브블록을 식별하기 위한 파티션 번호(Partition Number)이다.
도 18에는 분할 타입 별 번호를 작은 숫자에서 큰 순자의 순서로 할당하는 것으로 나타냈지만, 도 18의 분할 타입 번호는 일 예를 나타낸 것일 뿐이며, 발생순서로 큰 숫자에서 작은 숫자로 할당하여 사용할 수도 있다. 또한, 각각의 분할 타입의 발생 확률에 따라 분할 타입 번호를 할당할 수도 있으며, 적응적으로 분할 타입 번호를 바꾸어 사용할 수도 있다. 또한, 각각의 분할된 블록은 더 작은 블록으로 분할될 수도 있다. 예를 들어, 32×32 화소 블록이 분할 타입 번호 3에 의해 4개의 16×16 화소 블록으로 분할된 경우, 각각의 16×16 화소 블록은 도 18의 분할 타입 별 번호를 사용하여 더 작은 서브블록으로 분할될 수 있다. 또한, 16×16의 서브 블록이 더 작은 블록으로 분할되는 경우, 상위의 화소 블록의 분할 타입 번호 즉, 32×32 화소 블록의 분할 타입 번호와 다른 분할 타입 번호가 사용될 수도 있다. 확장된 매크로블록을 16×16 화소 블록 단위로 분할하여 부호화를 수행하는 경우에는 16×16 화소 블록보다 큰 서브 블록(예를 들면, 64×32 화소블록, 32×64 화소블록, 16×32 화소블록, 32×16 화소블록 등)에 대한 분할 타입 번호의 부호화는 생략될 수도 있다.
도 19는 본 발명의 일 실시예에 따라 확장된 매크로블록을 다양한 크기의 서브블록으로 분할하는 경우의 분할 타입 번호 부호화 순서를 설명하기 위해 도시한 도면이다.
도 19에서는 확장된 매크로블록이 64×64 화소 블록이고 최대 분할 레이어의 개수가 4인 경우를 나타내었다. 확장된 매크로블록이 도 19와 같이 분할되었을 때, 본 발명의 일 실시예에 따르면 분할 레이어별 분할 타입 번호를 분할 타입 번호 부호화 순서에 따라 순차적으로 부호화하여 매크로블록의 분할 타입 정보를 부호화할 수 있다.
도 19에 도시한 매크로블록이 분할 레이어별로 분할되는 과정을 순차적으로 나타내면 도 20과 같이 나타낼 수 있다. 도 20을 참조하면, 매크로블록 레이어 0(L0)에서, 64×64 화소 서브블록은 4 개의 32×32 화소 서브블록으로 분할되며, 레이어 1(L1)에서, L1-P0(매크로블록 레이어 1의 파티션 번호 0)의 서브블록과 L1-P3(매크로블록 레이어 1의 파티션 번호 3)의 서브블록은 다시 4 개의 16×16 화소 서브블록으로 분할되고 L1-P1(매크로블록 레이어 1의 파티션 번호 1)의 서브블록과 L1-P2(레이어 1의 파티션 번호 2)의 서브블록은 각각 16×32 화소 서브블록과 32×16 화소 서브블록으로 분할된다. L1-P1과 L1-P2의 서브블록은 각각 2 개의 서브블록으로 분할된 후 더 이상 분할되지 않으므로 레이어별 파티션 번호를 나타내지 않았다. 레이어 2(L2)에서, L2-P0(매크로블록 레이어 2의 파티션 번호 0)의 서브블록은 다시 4 개의 8×8 화소 서브블록으로 분할되고 L2-P3(매크로블록 레이어 2의 파티션 번호 3)은 2 개의 16×8 화소 서브블록으로 분할된다. 다시, 매크로블록 레이어 3(L3)에서, L3-P0(매크로블록 레이어 3의 파티션 번호 0)의 서브블록과 L3-P1(매크로블록 레이어 3의 파티션 번호 1)의 서브블록은 각각 4 개의 4×4 화소 서브블록으로 분할된다. 이때, 확장된 매크로블록을 16×16 화소 블록 단위로 부호화를 수행하는 경우, L1-P1 블록과 L1-P2 블록은 각각 16×32 화소 서브블록 및 32×16 화소 서브블록으로 분할하는 대신에 L1-P3 블록과 같이 각각 4개의 16×16 화소 블록 단위로 부호화가 수행될 수 있다.
도 21은 매크로블록의 레이어별 분할 타입 번호를 순차적으로 부호화하는 과정을 설명하기 위한 예시도이다.
도 19에 도시한 매크로블록의 분할 타입 정보를 부호화하면 도 21와 같이 부호화할 수 있다. 도 19에서, '□' 안에 기재된 숫자는 각 서브블록의 분할 타입 번호를 부호화하는 순서를 나타낸다. 확장된 매크로블록에 대한 레이어별 분할 타입 번호를 분할 타입 번호 부호화 순서에 따라 순차적으로 부호화하면, 도 21에 도시한 순서에 따라 레이어별 분할 타입 번호를 순차적으로 부호화할 수 있다.
먼저, 매크로블록 레이어 0의 64×64 화소 서브블록(L0-P0)은 4 개의 32×32 화소 서브블록들로 분할되었으므로, 분할 타입 번호 3을 부호화한다. 64×64 화소 서브블록 내 4 개의 32×32 화소 서브블록 중 첫 번째 32×32 화소 서브블록(L1-P0)도 4 개의 16×16 화소 서브블록으로 분할되었으므로 분할 타입 번호 3을 부호화한다. 레이어 1의 첫 번째 32×32 화소 서브블록(L1-P0) 내 4 개의 16×16 화소 서브블록 중 첫 번째 16×16 화소 서브블록(L2-P0)도 4 개의 8×8 화소 서브블록으로 분할되었으므로 분할 타입 3을 부호화하고 해당 16×16 화소 서브블록(L2-P0) 내 4 개의 8×8 화소 블록(L3-P0, L3-P1, L3-P2, L3-P3)은 더 이상 작은 서브블록으로 분할되지 않으므로 분할 타입 번호 {3, 3, 0, 0}을 각각 부호화한다. 레이어 3의 서브블록들은 더 작은 서브블록으로 분할될 수 없으므로 레이어 3에 속하는 서브블록들의 분할 타입 번호는 부호화하지 않는다.
매크로블록 레이어 3 내 서브블록들의 분할 타입 번호를 모두 부호화했으므로 매크로블록 레이어 2의 두 번째 16×16 화소 서브블록(L2-P1)과 세 번째 16×16 화소 서브블록(L2-P2)의 분할 타입 번호를 부호화하는데, 모두 더 이상 작은 블록으로 분할되지 않았으므로 분할 타입 번호 0을 부호화한다. 네 번째 16×16 화소 서브블록(L2-P3)은 16×8 화소 서브블록으로 분할되었지만 분할 타입 번호가 3이 아니므로 분할 타입 번호 1만을 부호화한다. 레이어 2 내의 4 개 서브블록들의 분할 타입 번호를 모두 부호화했으므로 레이어 1의 두 번째 32×32 화소 서브블록(L1-P1)의 분할 타입 번호를 부호화하는데, 레이어 1의 두 번째 32×32 화소 서브블록(L1-P1)은 16×32 화소 서브블록으로 분할되었고 분할된 각 서브블록은 더 이상 작은 서브블록으로 분할되지 않았으므로 분할 타입 번호 2를 부호화한다. 이와 같은 방식으로 매크로블록 레이어 1의 세 번째 32×32 화소 서브블록(L1-P2)와 매크로블록 레이어 1의 네 번째 32×32 화소 서브블록(L1-P3) 및 그 하위의 4 개의 16×16 화소 서브블록(L2-P0, L2-P1, L2-P2, L2-P3)의 분할 타입 번호를 차례로 부호화하면, {1, 3, 0, 0, 0, 0}을 부호화한다.
전술한 바와 같은 부호화 방식에 따라 도 19에 도시한 매크로블록의 분할 타입 정보를 부호화하면, 도 21에 도시한 바와 같이 분할 타입 번호 {3, 3, 3, 3, 3, 0, 0, 0, 0, 1, 2, 1, 3, 0, 0, 0, 0}가 부호화 된다. 이때 분할 타입 번호는 이진 산술 부호화(Binary Arithmetic Coding) 또는 허프만 부호화(Huffman Coding) 등과 같은 무손실 압축 부호화를 이용하여 이진 비트 스트링(Bit String)으로 부호화될 수 있다.
예를 들어, 이진 산술 부호화를 이용하는 경우, 각 분할 타입 번호는 현재 부호화할 분할 타입 번호의 레이어 번호에 따라 다른 이진값(Binary Value)을 이용할 수 있다. 레이어 번호가 log2(N/16) 이하인 경우에는 표 3을 이용하고 레이어 번호가 log2(N/16) 보다 큰 경우에는 표 4를 이용하여 부호화할 수 있다. 예를 들어 도 11의 서브블록(L1-P0)의 분할 타입 번호 3은 표 3을 참고하면 이진수 '01'로 표현될 수 있으므로 이진수 '0'과 '1'을 각각 산술 부호화하여 분할 타입 번호 3을 부호화할 수 있다. 그리고 서브블록(L2-P0)에 속하는 서브블록(L3-P2)의 분할 타입 번호 0은 표 4를 참고하면 이진수 '1'로 표현될 수 있으므로 이진수 '1'을 산술 부호화하여 분할 타입 번호 3을 부호화할 수 있다.
표 3
Figure PCTKR2011002762-appb-T000003
표 4
Figure PCTKR2011002762-appb-T000004
다시 도 17을 참조하면, 인트라 픽처에 대한 매크로블록의 분할 타입 정보를 부호화하여 분할 타입 데이터가 분할 타입 필드에 할당되면, 인트라 예측 모드 필드에 인트라 예측 모드에 대한 정보가 부호화된 데이터인 인트라 예측 모드 데이터가 할당된다.
도 22는 본 발명의 일 실시예에 따른 인트라 예측 모드의 부호화 순서를 나타낸 예시도이다.
도 22는 도 19와 같이 확장된 매크로블록이 64×64 화소 블록이고 최대 분할 레이어의 개수가 4인 경우를 나타내었다. 확장된 매크로블록이 도 22와 같이 분할되었을 때, 확장된 매크로블록의 각 서브블록에 대한 인트라 예측 모드는 도 22에 도시한 인트라 예측 모드의 부호화 순서에 따라 순차적으로 부호화하여 인트라 예측 모드 데이터를 생성할 수 있다. 즉, 각 서브블록 내에 표시된 번호는 인트라 예측 모드를 부호화하기 위한 인트라 예측 모드의 부호화 순서를 나타낸 것이다. 만일, 64×64 화소의 확장된 매크로블록에 대하여 16×16 화소 블록 단위로 부호화를 수행하는 경우, 15번째 블록 및 16번째 블록, 또는 17번째 블록 및 18번째 블록에 해당하는 32×32 화소 블록은 16×32 화소 블록 또는 32×16 화소 블록으로 분할하는 대신에, 19번째 블록 내지 22번째 블록과 같이 각각 4개의 16×16 화소 블록 단위로 분할하여 부호화를 수행할 수 있다.
확장된 매크로블록의 휘도 성분의 서브블록이 16×16 화소 블록이 아닌 경우에는 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그가 부호화되고, 예측 모드 플래그가 현재 부호화 대상인 블록의 예측 방향과 주변 블록으로부터 추정한 현재 블록의 예측 방향이 동일하지 않는 경우에는 현재 블록의 예측 방향과 주변 블록으로부터 추정한 현재 블록의 예측 방향이 동일하지 않음을 나타내는 예측 모드 플래그와 해당 서브블록의 크기에 따른 여러 가지 인트라 예측 방향 중에서 주변 블록으로부터 추정한 현재 블록의 예측 방향을 제외한 나머지 예측 방향 중에서 어떠한 예측 방향인지를 나타내는 예측 모드의 예측 모드 번호를 해당 블록의 인트라 예측 모드로서 부호화되어 인트라 예측 모드 데이터가 생성된다. 이때, 확장된 매크로블록을 4×4 화소 블록, 8×8 화소 블록 또는 16×16 화소 블록을 제외한 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 현재 블록의 왼쪽 블록과 위쪽 블록을 이용하여 예측한 현재 블록의 예측 모드 번호가 3 이상인 경우에는 현재 블록의 예측 방향은 도 9의 예측 모드 번호 2(DC 모드)를 사용할 수 있다.
만약, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 현재 블록의 예측 방향이 동일한 경우에는 주변 블록으로부터 추정한 현재 블록의 예측 방향과 현재 블록의 예측 방향이 동일함을 나타내는 예측 모드 플래그를 인트라 예측 모드로서 부호화하여 인트라 예측 모드 데이터가 생성된다. 휘도 성분의 서브블록이 16×16 화소 블록이거나 색차 성분의 매크로블록의 예측모드는 해당 블록의 예측 모드의 번호 자체를 인트라 예측 모드로서 부호화하여 인트라 예측 모드 데이터가 생성된다. 이와 같이 도 22에 도시한 바와 같은 순서로 부호화되어 생성되는 매크로블록의 각 서브블록에 대한 인트라 예측 모드 데이터는 도 17에 도시한 인트라 예측 모드 필드에 할당된다.
도 23은 본 발명의 일 실시예에 따라 매크로블록의 인트라 예측 모드를 부호화하는 과정의 일 예를 설명하기 위한 예시도이다.
23A에서는 현재 부호화하고자 하는 현재 매크로블록이 64×64 화소 블록이고 도시한 바와 같이 다양한 크기와 모양의 서브블록으로 분할되었으며, 현재 매크로블록의 왼쪽의 주변 블록은 64×64 화소 단위로 인트라 예측이 되어 왼쪽의 주변 블록의 예측 모드 번호는 0(수직 모드)이고, 현재 매크로블록의 위쪽 주변 블록은 64×64 화소 단위로 인트라 예측이 되어 왼쪽 주변 블록의 예측 모드 번호는 1(수평모드)인 경우를 예시적으로 나타내었다. 현재의 확장된 매크로블록 내의 각 서브블록 내에 표시되는 숫자는 각 서브블록의 예측 모드 번호를 나타낸다.
현재의 확장된 매크로블록의 첫 번째 4×4 화소 서브블록의 예측 모드 번호는 2(DC 모드)이고 왼쪽의 주변 블록과 위쪽의 주변 블록을 이용하여 추정되는 해당 서브블록의 예측 모드 번호는 0이다. 즉, 왼쪽의 주변 블록의 예측 모드 번호 0과 윗쪽의 주변 블록의 예측 모드 번호 1 중 0이 더 작기 때문에, 첫 번째 4×4 화소 서브블록의 예측 모드 번호는 0으로 추정된다. 첫 번째 4×4 화소 서브블록의 예측 모드와 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드가 다르기 때문에, 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하지 않음을 나타내는 예측 모드 플래그와 해당 서브블록의 예측 모드 번호인 예측 모드 번호 2가 해당 서브블록의 인트라 예측 모드로서 부호화된다. 두 번째 4×4 화소 서브블록의 예측 모드 번호는 1이고 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드 번호는 1이어서 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하므로, 예측 방향이 동일함을 나타내는 예측 모드 플래그만이 해당 서브블록의 인트라 예측 모드로서 부호화된다.
다음으로는 도 22에 도시한 인트라 예측 모드의 부호화 순서에 따라 다음 서브블록의 인트라 예측 모드를 부호화하는데, 세 번째 4×4 화소 서브블록의 예측 모드 번호는 0이고 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드 번호는 0이어서 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하므로, 예측 방향이 동일함을 나타내는 예측 모드 플래그만이 해당 서브블록의 인트라 예측 모드로서 부호화된다. 11 번째 16×16 화소 서브블록의 경우, 예측 플래그는 부호화되지 않고 해당 서브블록의 예측 모드 번호 1이 해당 서브블록의 인트라 예측 모드로서 부호화된다. 도 23에는 15번째 블록 및 16번째 블록을 16×32 화소 블록으로 분할하여 인트라 예측 모드로 부호화하고, 17번째 블록 및 18번째 블록을 32×16 화소 블록으로 분할하여 인트라 예측 모드로 부호화하는 경우를 도시하였다. 그러나, 확장된 매크로블록에 대하여 16×16 화소 블록 단위로 인트라 예측 부호화를 수행하는 경우, 16×16 화소 블록보다 큰 서브 블록에 대해서는 15번째 블록 및 16번째 블록, 또는 17번째 블록 및 18번째 블록과 같은 직사각형의 화소 블록 분할은 생략한다.
23B에는 23A와 같이 현재 매크로블록의 인트라 예측 모드를 부호화하는 경우 인트라 예측 모드 필드에 포함되는 인트라 예측 모드 데이터를 예시적으로 나타내었다. 첫 번째 4×4 서브블록에 대해서는 예측 모드 플래그와 예측 모드 번호가 부호화되며, 두 번째, 세 번째, 네 번째 4×4 서브블록에 대해서는 예측 모드 플래그만이 부호화되는 등 도시한 바와 같이 부호화 순서에 따라 차례로 인트라 예측 모드 데이터가 인트라 예측 모드 필드에 할당된다.
확장된 매크로블록을 인트라 예측 부호화할 때, 도 4에 도시한 바와 같이 16×16 화소 블록보다 큰 직사각형의 서브 블록(예를 들면, 16×32, 32×16 등)으로 분할하여 인트라 예측 부호화를 수행하는 경우에는 서브블록의 크기를 고려한 부호화된 블록 패턴 플래그(CBPX_flag: Coded Block Pattern X_flag, 이하 'CBPX 플래그'라 칭함)와 CBP(CBP: Coded Block Pattern, 이하 'CBP'라 칭함)를 부호화하여, CBPX_플래그/CBP 필드에 할당할 수 있다. CBPX_플래그와 CBP 필드에 할당되는 CBP 데이터는 매크로블록의 서브블록 내에 0이 아닌 양자화된 변환 계수를 포함하는지 여부를 나타낸다. 그러나, 도 5에 도시한 바와 같이 확장된 매크로블록을 16×16 화소 블록 단위로 분할하여 인트라 예측 부호화를 수행하는 경우에는 블록 패턴 플래그의 부호화는 생략하고 양자화 파라미터에 대한 증감정보(Δpq)를 부호화할 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화될 수 있으며, CBP 데이터는 16×16 화소 블록 단위로 부호화되는 것이 바람직하다.
도 24는 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX_플래그와 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 24에서는 확장된 매크로블록이 64×64 화소 블록인 경우 CBPX_플래그와 CBP를 부호화하는 과정을 예를 들어 나타내었다. 영상 부호화 장치(100)의 부호화기(140)는 확장된 매크로블록의 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나인지 여부를 판단하며(S2410), 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나가 아닌 경우에는 서브블록의 크기가 32×32, 32×16 및 16×32 중 하나인지 여부를 판단한다(S2420). 이때, 확장된 매크로블록을 16×16 화소 단위로 분할하여 인트라 예측을 수행하는 경우, 단계 S2410에서는 서브 블록의 크기가 64×64 화소 블록인지 즉, 확장된 매크로블록 단위로 인트라 예측 부호화를 수행하는지 판단하며, 단계 S2420에서는 서브 블록의 크기가 64×64 화소 블록이 아닌 경우에 서브 블록의 크기가 32×32 화소 블록인지를 판단할 수 있다. 단계 S2420의 판단 결과, 그 서브블록의 크기가 32×32, 32×16 및 16×32 중 하나이거나 32×32 화소 블록인 경우, 서브블록 내 0이 아닌 변환 계수가 있는지 여부를 판단하며(S2430), 0이 아닌 변환 계수가 있는 경우에는 해당 서브블록 내에 0이 아닌 부호화할 계수가 있음을 나타내는 CBP32 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있다)를 부호화하고(S2440), 서브블록 내에서 16×16 화소 블록 단위로 CBP를 부호화하며(S2450), 서브블록 내 0이 아닌 변환 계수가 없는 경우에는 서브블록 내에 0이 아닌 변환 계수가 없음을 나타내는 CBP32 플래그(예를 들어, '0'과 같이 1비트로 표시될 수 있다)를 부호화한다(S2460).
여기서, CBP64 플래그는 64×64 화소 블록 내 0이 아닌 부호화할 계수의 존재 유무를 나타내는 플래그이다. 마찬가지로, CBP32 플래그는 32×32 화소 블록 내 0이 아닌 부호화할 계수의 존재 유무를 나타내는 플래그이다. 이와 같은 CBPX 플래그(X는 32, 64 등)는 휘도 성분의 잔여 블록이 0이 아닌 변환계수를 가지지 않는 경우에는 변환 타입을 전송할 필요가 없으므로, 휘도 성분 블록들이 0이 아닌 변환계수를 가지는지를 나타내는 데 사용된다. CBP는 16×16 화소 블록 단위로 부호화되며, 16×16 화소 블록 내 각 8×8 화소 블록 당 0이 아닌 변환 계수가 있는지 여부를 8×8 화소 블록 당 1비트를 이용하여 나타내고, 색차 성분에 대해서는 두 개의 2×2 색차 성분 DC 블록 내 0이 아닌 변환 계수가 있는지 여부를 1 비트를 이용하여 나타내며, 두 개의 8×8 색차 성분 AC 블록 내 0이 아닌 변환 계수가 있는지 여부를 1 비트를 이용하여 나타낸다.
한편, 단계 S2420에서, 서브블록의 크기가 32×32, 32×16 및 16×32 중 하나가 아니거나 32×32 화소 블록이 아닌 경우에는, 단계 S2450으로 진행하여 CBP를 부호화한다. 이때, 서브 블록의 크기가 32×32, 32×16 또는 16×32 화소 블록이 아닌 경우에 서브 블록의 크기가 16×16, 16×8 또는 8×16 화소 블록인지를 판단할 수 있다. 서브 블록이 16×16, 16×8 또는 8×16 화소 블록인 경우, 해당 서브 블록 내에 0이 아닌 부호화할 계수가 있는 경우에는 CBP16 플래그(예를 들어, ‘1’과 같이 1 비트로 표시될 수 있음)를 부호화하며, 그 외의 경우에는 CBP 플래그를 사용하지 않고 16×16 화소 블록 단위로 CBP를 부호화할 수 있다.
또한, 단계 S2410에서, 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나 이거나 64×64 화소 블록인 경우에는 서브블록 내 0이 아닌 변환 계수가 있는지 여부를 판단하여(S2470), 서브블록 내 0이 아닌 변환 계수가 있는 경우에는 0이 아닌 변환 계수가 있음을 나타내는 CBP64 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있다)를 부호화하고(S2480), 서브블록 내 0이 아닌 부호화할 계수가 없는 경우에는 0이 아닌 부호화할 계수가 없음을 나타내는 CBP64 플래그(예를 들어, '0'과 같이 1 비트로 표시될 수 있다)를 부호화한다(S2490). 여기서, CBP64 플래그는 64×64 화소 블록 내 0이 아닌 양자화된 변환 계수의 존재 유무를 나타내는 플래그이다.
만일, 64×64 화소의 확장된 매크로블록에 대하여 16×16 화소 블록 단위로 인트라 예측 부호화를 수행하는 경우에는 전술한 바와 같이 CBP64 플래그 및 CBP32 플래그는 생략할 수 있으며, 양자화 파라미터에 대한 증감정보(Δpq)를 부호화할 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화하는 것이 바람직하다.
CBP 플래그를 부호화하는 경우에 대하여, CBP 플래그가 0이 아닌 경우에 변환 타입을 부호화한다. 예외적으로, 16×16 화소 블록이 네 개의 8×8 화소 블록으로 분할된 경우에는 CBP를 부호화한 후 CBP가 0이 아닌 경우에 16×16 화소 블록 단위로 적용되는 변환 타입을 부호화한다.
변환 타입을 부호화한 후에는 변환 타입에 따라 CBP를 부호화한다. 16×16 변환이 사용된 경우에는 색차 성분의 CBP 2비트만 부호화하며, 8×16 또는 16×8 변환이 사용된 경우에는 16×16 화소 블록 내의 두 개의 8×16 또는 16×8 화소 블록이 0이 아닌 변환 계수를 가지는지를 나타내는 CBP 2비트를 부호화한다. 다만, 예외적으로 두 개의 분할블록 중 첫 번째 분할블록의 CBP 비트가 0인 경우에는 두 번째 분할 블록의 CBP 비트는 부호화하지 않을 수 있다.
도 25는 본 발명의 일 실시예에 따른 CBP의 구조를 나타낸 예시도이다.
도 25에서는 입력 영상이 4:2:0 포맷(Format)인 경우, CBP의 구조를 예시적으로 나타내었다. 휘도 성분의 첫 번째 8×8 화소 블록(Y0) 내에 0이 아닌 변환 계수가 없는 경우 CBP의 최하위 비트(LSB: Least Significant Bit)는 0이고, 두 번째 8×8 화소 블록(Y1) 내에 0이 아닌 양자화된 변환 계수가 있는 경우 CBP의 두 번째 최하위 비트는 1이다. 이와 같은 방식으로 세 번째 8×8 화소 블록(Y2)과 네 번째 8×8 화소 블록(Y3)에 대한 CBP가 할당되고, 두 개의 2×2 색차 성분 DC 블록(U(DC) 및 V(DC)) 내에 0이 아닌 양자화된 변환 계수가 있으므로 색차 DC(Chroma DC)에 대한 비트는 1이고, 두 개의 8×8 색차 성분 AC 블록(U-AC 및 V-AC) 내에 0이 아닌 양자화된 변환 계수가 없으므로 색차 AC(Chroma AC)에 대한 비트는 0이 된다.
도 26은 본 발명의 일 실시예에 따라 CBPX 플래그와 CBP를 부호화하는 순서의 일 예를 나타낸 예시도이다.
도 26에서는 확장된 매크로블록이 64×64 화소 블록이고 현재 부호화 대상인 서브블록의 크기가 64×64, 64×32, 또는 32×64인 경우, CBP64 플래그, CBP32 플래그와 CBP의 부호화 순서를 예시적으로 나타내었다. 도 26에서, 일점 쇄선의 화살표는 CBPX 플래그가 0인 경우 진행되는 순서를 나타내며, 점선의 화살표는 CBPX 플래그가 1인 경우 진행되는 순서를 나타내며, 실선의 화살표는 아무런 조건이 없이 진행되는 순서를 나타낸다.
확장된 매크로블록인 64×64 화소 블록 내에 양자화된 변환 계수가 모두 0인 경우, CBP64 플래그는 0이 부호화되고 한 개 이상의 양자화된 변환 계수가 0이 아닌 경우 CBP64 플래그는 1이 부호화된다. CBP64 플래그가 0인 경우, 더 이상 부호화할 CBP가 없으므로 다음 매크로블록의 CBPX 플래그와 CBP를 부호화한다. CBP64 플래그가 1인 경우, 64×64 화소 블록 내 각 32×32 화소 서브블록의 CBP32 플래그가 부호화되며, CBP32 플래그가 1인 경우 32×32 화소 서브블록 내 4 개의 16×16 화소 블록의 CBP가 부호화된다.
도 27은 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX 플래그와 CBP를 부호화하는 순서의 다른 예를 나타낸 예시도이다.
도 27에서는 부호화 대상이 32×32인 화소 블록이고 현재 부호화 대상인 서브블록의 크기가 32×32, 32×16, 또는 16×32인 경우, CBP32 플래그와 CBP의 부호화 순서를 예시적으로 나타내었다. 도 27에서, 일점 쇄선의 화살표는 CBPX 플래그가 0인 경우 진행되는 순서를 나타내며, 점선의 화살표는 CBPX 플래그가 1인 경우 진행되는 순서를 나타내며, 실선의 화살표는 아무런 조건이 없이 진행되는 순서를 나타낸다.
다시 도 1을 참조하면, 영상 부호화 장치(100)의 부호화기(140)는 CBPX(단, X: 32 이상의 정수) 플래그와 CBP를 부호화한 후에는 0이 아닌 양자화된 변환 계수가 있는 블록들에 대해서만 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성한다. 부호화 대상 블록의 크기가 변환의 크기보다 큰 경우, 블록 내에서 래스터 스캔(Raster-Scan) 순서로 블록의 양자화된 변환 계수를 부호화한다.
도 28은 본 발명의 일 실시예에 따른 분할 타입별 양자화된 변환 계수의 부호화 순서를 나타낸 예시도이다.
도 28에서는 부호화 대상 블록이 32×32 화소 블록인 경우 양자화된 변환 계수를 부호화하는 순서를 예시적으로 나타내었다. 16×16 화소 크기 이상의 블록에 대해서는 16×16 변환(16×16블록 내 16 개의 4×4 블록을 4×4 변환한 후 16 개의 DC 계수에 대해서 4×4 변환을 수행하므로 16×16 화소 단위로 변환이 수행된다고 할 수 있으며, 설명의 편의를 위해 16×16 변환이라 명명한다)이 수행되기 때문에, 32×32 화소 블록의 경우 4 번의 16×16 변환이 수행된다. 32×16 화소 블록인 경우, 각 32×16 화소 블록마다 두 번의 16×16 변환이 수행된다. 16×32 화소 블록인 경우, 각 16×32 화소 블록마다 두 번의 16×16 변환이 수행된다. 16×16 화소 블록인 경우, 각 16×16 화소 블록마다 16×16 변환이 수행된다.
도 29는 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터의 신택스 구조를 나타낸 예시도이다.
도 29에서는 입력 영상이 인터 픽처인 경우에 대해 본 발명의 일 실시예에 따라 부호화하여 생성되는 부호화 데이터의 신택스 구조를 예시적으로 나타내었다. 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터는 도시한 바와 같이, SKIP_N 플래그, 매크로 블록 타입 및 분할 타입 중 하나 이상의 필드를 포함하며, 확장된 매크로블록이 인트라 매크로블록인 경우에는 인트라 예측 모드, CBPX 플래그/CBP 및 변환 계수 중 하나 이상의 필드를 추가로 포함하며, 확장된 매크로블록이 인터 매크로블록인 경우에는 SKIPX 플래그, 차분 움직임 벡터/참조 픽처 인덱스, CBPX 플래그, 변환 타입, CBP 및 변환 계수 중 하나 이상의 필드를 추가로 포함하여 구성될 수 있다.
다만, 도 29에서 도시한 인터 픽처에 대한 부호화 데이터의 신택스는 예시적인 것일 뿐, 인터 픽처에 대한 부호화 데이터의 신택스가 반드시 도 29에 도시한 바와 같이 구성되어야 하는 것은 아니다. 즉, 인터 픽처에 대한 부호화 데이터의 신택스 중 일부 또는 전부의 순서가 도 29에 도시한 바와는 다르게 변경될 수도 있으며, 일부의 신택스는 생략될 수도 있음을 인식해야 할 것이다.
다시 도 1을 참조하면, 영상 부호화 장치(100)의 부호화기(140)는 현재 부호화 대상인 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIPN 플래그를 부호화한다. 여기서, N은 매크로블록의 크기를 나타낸다. 예를 들어, 매크로블록이 64×64 화소 블록이면 64×64 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP64 플래그가 부호화되며, 매크로블록이 32×32 화소 블록이면 32×32 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP32 플래그가 부호화되며, 16×16 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP16 플래그가 부호화된다.
만약, 매크로블록이 SKIP 매크로블록인 경우, 현재 매크로블록은 부호화할 데이터가 없으므로 다음 매크로블록이 부호화된다. 매크로블록이 SKIP 매크로블록이 아닌 경우, 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 나타내는 매크로블록 타입 플래그를 전송한다. 예를 들어, 현재 부호화하고자 하는 입력 영상이 P 픽처인 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 P-매크로블록이고, 현재 부호화하고자 하는 입력 영상이 B 픽처의 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 B-매크로블록이다.
분할 타입 필드와 인트라 픽처에 대한 인트라 예측 모드, CBPX 플래그/CBP, 변환 계수 등의 필드에 대해서는 도 17을 통해 전술하였으므로, 이하에서는 인터 픽처에 대한 SKIPX 플래그, 차분 움직임 벡터/참조 픽처 인덱스, CBPX 플래그, 변환 타입, CBP, 변환 계수 등과 같은 필드에 대해 설명한다.
P-픽처 또는 P-슬라이스의 경우, 도 4의 모든 블록 타입들이 움직임 추정에 사용될 수 있으며, 확장된 매크로블록 내에서 16×16 화소 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수도 있다. 즉, P-픽처 또는 P-슬라이스의 확장된 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다.
부호화할 대상이 32×32 화소 블록인 경우, 32×32 화소 블록 단위로 부호화를 수행할지 또는 16×16 화소 블록 단위로 부호화를 수행할지는 확장된 매크로블록 플래그(extended_mb_flag)를 통해 나타낼 수 있다. 예를 들어, 확장된 매크로블록 플래그가 1인 경우에는 32×32 화소블록 단위로 부호화를 수행함을 의미하며, 확장된 매크로블록 플래그가 0인 경우에는 16×16 화소블록 단위로 부호화를 수행함을 의미할 수 있다. 확장된 매크로블록 플래그가 0인 경우, 확장된 매크로블록은 4개의 16×16 화소블록으로 분할되어 각 16×16 화소블록 단위로 인트라 모드인지 또는 인터 모드인지를 결정할 수 있다. 또한, 각각의 16×16 화소블록 단위는 더 작은 서브블록으로 분할되어 부호화가 수행될 수 있다.
도 30은 본 발명의 일 실시예에 따른 P-픽처(또는 P-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다. 설명을 간단하게 하기 위해 확장된 매크로블록은 32×32 화소 블록이라고 가정한다.
엔트로피 부호화에 있어 문맥기반 적응적 이진 산술 부호화(CABAC: Context-Adaptive Binary Arithmetic Coding)를 하는 경우, skipX_flag와 interX_flag는 X값에 따라 다른 컨텍스트 테이블(context table)을 가질 수 있다. 예를 들어, skip32_flag와 skip16_flag는 서로 다른 컨텍스트 테이블을 가질 수 있다. 이에 대한 상세한 설명은 후술한다.
skipX_flag는 부호화하고자 하는 현재 블록이 SKIP 모드인지의 여부를 나타내는 플래그이며, 표 5에 나타낸 바와 같이 1비트로 SKIP 모드 여부를 표시할 수 있다. 예를 들어, skipX_flag의 부호화 비트가 1인 경우에 현재 블록이 SKIP 모드인 것으로 나타낼 수 있다. 여기서, X는 확장된 매크로블록의 범위 내에서 16 이상인 수를 의미한다.
표 5
Figure PCTKR2011002762-appb-T000005
현재 블록이 SKIP 모드가 아닌 경우에 interX_flag를 부호화한다. 여기서, interX_flag는 부호화하고자 하는 현재 블록이 인트라 모드인지 또는 인터 모드인지의 여부를 나타내는 플래그이며, 표 6에 나타낸 바와 같이 1비트 또는 2비트로 확장된 매크로블록 내의 분할된 화소 블록들이 인트라 모드인지 또는 인터 모드인지를 나타낼 수 있다.
표 6
Figure PCTKR2011002762-appb-T000006
예를 들어, interX_flag가 ‘00’인 경우, 확장된 매크로블록 내의 분할된 모든 서브 블록들이 인트라 모드임을 의미한다. 이 경우, 확장된 매크로블록인 32×32 화소 블록은 4개의 16×16 화소 블록으로 분할되며, 각각의 16×16 화소 블록은 전술한 인트라 예측 부호화 방법으로 부호화된다. 따라서, 확장된 매크로블록 내의 모든 서브 블록들이 인트라 모드인 경우, 분할된 서브 블록의 블록 타입, 휘도 성분과 색차 성분의 인트라 예측 모드, CBP, 양자화 파라미터, 변환 계수 등이 부호화될 수 있다.
도 30에 나타낸 바와 같이 확장된 매크로블록인 32×32 화소 블록에 대하여 skip32_flag가 0이고 inter32_flag가 1인 경우, 이것은 확장된 매크로블록 내의 분할된 모든 서브 블록들이 인터 모드임을 의미하며, 이후 1비트 플래그인 ‘extended_mb_flag’를 전송한다. 이때, extended_mb_flag가 1인 경우, 이것은 확장된 매크로블록 단위로 움직임 보상을 수행함을 의미하며, 움직임 벡터가 1개이므로 1개의 MVD/ref_idx를 부호화한다. 여기서, MVD/rex_idx는 확장된 매크로블록에 포함되는 움직임벡터 정보/참조 인덱스를 의미한다. extended_mb_flag가 0인 경우, 이것은 확장된 매크로블록이 16×16 화소 블록으로 분할되어 부호화되었음을 의미하며, 각각의 16×16 화소 블록에 대하여 각각의 16×16 화소 블록이 SKIP 모드인지를 나타내는 skip16_flag를 부호화한다. 이 경우, 각각의 16×16 화소 블록에 대하여 SKIP 모드가 아닌 16×16 화소 블록에 대해서만 블록 타입과 MVD/ref_idx를 부호화한다. skip16_flag는 표 5를 이용하여 부호화할 수 있다. 이때, skip32_flag와 skip16_flag를 문맥기반 적응적 이진 산술 부호화(CABAC)하는 경우, 전술한 바와 같이 각각의 신택스는 서로 다른 컨텍스트 테이블을 가질 수 있다.
확장된 매크로블록에 대하여 skip32_flag가 0이고 inter32_flag가 01인 경우, 이것은 확장된 매크로블록 내에 인터 모드와 인트라 모드가 모두 사용되었음을 의미한다. 이 경우, ‘extended_mb_flag’는 필요하지 않으며, 확장된 매크로블록은 16×16 화소 블록으로 분할되어 부호화되었음을 의미하므로, 각각의 16×16 화소 블록이 인트라 모드인지 또는 인터 모드인지를 나타내는 표 7을 이용하여 부호화할 수 있다.
표 7
Figure PCTKR2011002762-appb-T000007
이때, 확장된 매크로블록 내에 인트라 모드와 인터 모드가 함께 존재하는 경우, 각각의 16×16 화소 블록은 각각의 16×16 화소 블록 내의 서브 블록들이 모두 인터 모드이거나 모두 인트라 모드인 경우가 대부분이며, 16×16 화소 블록 내에 인트라 모드의 서브 블록과 인터 모드의 서브 블록이 동시에 존재하는 경우는 무시할 수 있다. 따라서, 각각의 16×16 화소 블록의 분할 타입을 부호화한 후, inter16_flag가 0인 즉, 인트라 모드인 16×16 화소 블록 내의 서브 블록들은 휘도 성분과 색차 성분을 인트라 예측 모드로 부호화한다. 또한, inter16_flag가 1인 즉, 인터 모드인 16×16 화소 블록들에 대해서는 표 5를 이용하여 skip16_flag를 부호화한다. 여기서, 분할 타입을 부호화 한 후 skip16_flag를 부호화하는 이유는, 확장된 매크로블록 내에 인트라 모드와 인터 모드가 동시에 존재한다는 것은 텍스처(Texture)가 어느 정도 있는 영역임을 의미하기 때문에 인트라 모드 주변에 존재하는 인터 모드는 작은 블록으로 분할되었을 가능성이 높으며, 따라서 분할 타입을 먼저 전송하고 블록의 크기가 16×16인 화소 블록에 대해서만 skip16_flag를 부호화하는 것이 바람직하기 때문이다. 그러나 부호화의 순서는 이에 한정된 것이 아니며, skip16_flag를 먼저 부호화한 후 분할 타입을 부호화할 수도 있다.
이후의 CBPX_flag, 변환 타입, CBP/양자화 파라미터, 변환 계수 등에 대한 부호화는 전술한 바와 동일하므로 그 설명을 생략한다. 다만, 인트라 픽처/슬라이스 또는 인트라 EMB의 경우에는 CBPX_flag를 부호화하지 않을 수 있다.
만일, 확장된 매크로블록이 64×64 화소 블록이라고 하면, 확장된 매크로블록이 32×32 화소 블록인 경우와 마찬가지로, 부호화하고자 하는 현재 블록의 분할 타입 정보가 부호화된 후 16×16 크기 이상인 서브블록들에 대해서만 skipX_flag가 부호화된다. 이 경우, X는 16 또는 32 등 서브블록의 크기를 나타낸다. 예를 들어, 매크로블록이 64×64 화소 블록이고 SKIP 모드가 아니며 확장된 매크로블록의 서브블록의 크기가 64×32, 32×64 및 32×32 중 하나인 경우, 각 서브블록에 대해 skip32_flag가 부호화된다. 64×64 화소인 확장된 매크로블록의 서브블록의 크기가 64×32 또는 32×64인 경우, 두 개의 skip32_flag가 부호화된다. 만약, 서브블록의 크기가 32×32보다 작은 경우에는 skip32_flag는 부호화되지 않는다. 그리고 서브블록의 크기가 32×16, 16×32 및 16×16 중 하나인 경우에는 각 서브블록의 skip16_flag가 부호화된다.
도 31은 본 발명의 일 실시예에 따른 B-픽처(또는 B-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다.
B-픽처에서는 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 하며, 각각의 참조 픽처는 서로 다른 역할을 한다. 일반적으로, L0 예측(List0 Prediction)이 순방향 예측에 사용되며, L1 예측이 역방향 예측에 사용된다. 즉, B-픽처는 현재 부호화 대상 픽처 이전의 픽처와 현재 부호화 대상 픽처 이후의 픽처들을 참조 픽처로 사용할 수 있으며, 그 두 장의 참조 픽처를 동시에 사용(양방향 예측)하여 움직임 추정 및 보상을 할 수 있다. 움직임 추정에 사용되는 블록 타입은 도 2의 모든 블록 타입이 사용될 수 있으며, P-픽처 방식과 동일하게 확장된 매크로블록 내에서 16×16 화소블록 단위로 인트라 모드인지 인터 모드인지를 선택할 수 있다. 본 발명에 따른 실시예에서는, 두 장의 픽처를 순서대로 현재 픽처 이전에 나오는 픽처와 이후에 나오는 픽처로 한정하지 않고, 전후에 상관없이 임의의 두 장을 참조 픽처로 사용할 수 있으며, 이와 같은 두 장의 참조 픽처를 사용하여 움직임 추정/보상(양방향 예측)을 수행할 수 있다.
본 발명의 실시예에 따른 B-픽처에서 사용할 수 있는 부호화 모드로는 인트라 모드, SKIP 모드, 다이렉트(Direct) 모드, L0 예측, L1 예측 및 양방향 등이 있다.
인트라 모드는 전술한 인트라 부호화 방법과 동일한 방법을 사용하여 부호화를 수행하며, 확장된 매크로블록 단위로 인트라 모드를 선택하거나 확장된 매크로블록 내 16×16 화소 블록 단위로 인트라 모드를 선택할 수 있다.
SKIP 모드는 부호화할 현재 블록이 SKIP 모드임을 나타내는 플래그만 전송한다. 이때, 16×16 화소 블록, 32×32 화소 블록 등과 같은 16×16 화소 이상의 블록에 대하여 SKIP 모드를 사용할 수 있으며, 예측된 B_pred_dir, 예측 움직임 벡터 MVD, 예측 ref_idx 등을 사용하여 움직임 보상을 수행하고 움직임 보상을 통해 얻은 참조 블록이 복원된 블록이 된다. 여기서, B_pred_dir은 B-픽처의 예측방향으로서, L0 및 L1의 양방향을 의미한다.
다이렉트 모드는 다이렉트 모드임을 나타내는 플래그와 변환계수 부호화와 관련된 데이터(예를 들면, CBPX_flag/CBP, 양자화 파라미터, 변환 타입, 변환 계수 등)들만을 부호화한다. 즉, 다이렉트 모드는 움직임 정보의 부호화를 생략한 부호화 모드로서, 8×8, 16×16, 32×32 등과 같이 8×8 화소 블록 이상의 블록에 대하여 다이렉트 모드를 사용할 수 있으며, N×N 다이렉트 모드인 경우에 움직임 추정 및 보상은 (N/2)×(N/2) 화소블록 단위로 움직임 추정 및 보상을 수행한다. 예를 들어, 8×8 다이렉트 모드의 경우, 4×4 화소 블록 단위로 움직임 추정 및 보상을 수행한다.
L0 예측은 L0의 움직임 정보만을 사용하는 한 방향 예측을 의미하며, L1 예측은 L1의 움직임 정보만을 사용하는 한 방향 예측을 의미한다. 양방향 예측은 L0와 L1의 두 개의 움직임 정보를 사용하여 두 픽처의 평균치를 참조 픽처로 사용하는 예측을 의미한다.
B-픽처의 움직임 추정방법으로는 직접예측 모드의 움직임 추정/보상 방법, SKIP 모드의 움직임 추정/보상 방법, 한 방향 예측(L0 예측 또는 L1 예측)의 움직임 추정/보상 방법, 양방향 예측의 움직임 추정/보상 방법 등이 있다.
먼저, 직접예측 모드의 움직임 추정/보상 방법을 살펴보면, Direct 모드는 시간방향의 움직임 정보 상관도를 사용하는 시간 직접예측 모드의 움직임 추정/보상 방법과, 공간방향(픽처 내 수평 수직 2차원 공간)의 움직임 정보 상관도를 사용하는 공간 직접예측 모드의 움직임 추정/보상 방법의 두 가지 방법이 있다. 시간 직접예측 모드나 공간 직접예측 모드는 매크로블록 단위나 블록 단위로 선택하지 않고 슬라이스 단위로 한 가지를 선택하여 사용한다. 직접예측 모드에서는 L1 예측의 가장 작은 참조번호를 가지는 참조픽처가 중요하며 이를 ‘앵커픽처’라고 부른다. 표시 순서상(display order) 대상 픽처의 역방향으로 가장 가까운 참조픽처가 앵커픽처가 되며, 앵커픽처 내 대상 블록과 같은 공간 위치에 있는 블록을‘앵커블록’이라고 한다.
시간 직접예측 모드는 우선 앵커블록의 움직임 정보를 조사하고 앵커블록의 L0 움직임 벡터를 mvCol(MV of the Co-located block, 동일 블록의 움직임 벡터)로 한다. 만일 앵커블록의 L0 움직임 벡터가 없고 L1 움직임 벡터를 가지고 있다면, L1의 움직임 벡터를 mvCol로 사용한다. 시간 직접예측 모드의 L0 참조픽처는 mvCol이 참조하는 픽처로서 시간 직접예측 모드의 L1 참조픽처가 앵커픽처가 된다. 앵커블록이 화면내 부호화된 움직임 정보를 가지지 않는 경우, 움직임 벡터의 크기는 0이 되고 시간 직접예측 모드의 L0 참조픽처는 참조 픽처번호가 0이 된다. 또한, 움직임 벡터 mvCol로부터 L0의 움직임 벡터 mvL0와 L1의 움직임 벡터 mvL1을 구한다. 참조 픽처, 대상 픽처 및 앵커 픽처 사이의 움직임 속도가 일정하다고 가정하면 mvL0와 mvL1의 크기는 참조 픽처, 대상 픽처, 앵커 픽처의 간격에 비례하게 되고 따라서 비례배분에 의해 구해진다. 즉, 참조 픽처와 대상 픽처의 간격 tb와, 참조 픽처와 앵커 픽처의 간격 td를 이용한 수학식 5를 이용하여 mvL0를 구할 수 있다.
수학식 5
Figure PCTKR2011002762-appb-M000005
또한, mvL1은 mvCol과 같은 역방향이기 때문에 수학식 6을 이용하여 구할 수 있다.
수학식 6
Figure PCTKR2011002762-appb-M000006
공간 직접예측 모드의 경우에도 L1 예측에서 가장 작은 참조번호의 참조 픽처인 앵커픽처와, 앵커픽처와 같은 공간위치에 있는 앵커블록이 움직임 벡터를 구하는데 사용된다. 공간 직접예측 모드에서는 대상 픽처 내에 부호화한 움직임 벡터로부터 대상블록의 움직임 벡터를 예측한다. 공간 직접예측 모드에서도 시간 직접예측 모드의 개념을 일부 도입하여 앵커블록의 움직임 정보가, i) 앵커블록의 움직임 벡터 크기가 수평, 수직 모두 ±1 화소 이하, ii) 앵커블록 참조픽처의 참조번호가 0, iii) L0에서 최소 참조번호의 참조픽처가 단기 참조픽처인 조건을 모두 만족하는 경우에 L0 움직임 벡터 mvL0와 L1 움직임 벡터 mvL1을 0으로 만들고, L0 예측에서 가장 작은 참조번호를 가지는 픽처를 L0 예측픽처, L1에서 가장 작은 참조번호를 가지는 픽처를 L1 예측픽처로 한다. 이와 같은 조건을 만족할 경우, 대상 픽처 내의 부호화된 움직임 벡터로부터 대상 블록의 움직임 벡터 mvL0와 mvL1, 그리고 참조픽처인 L0 픽처와 L1 픽처를 구한다.
L0 예측에서는 좌측, 상단, 좌측 상단에 위치하는 L0 예측 움직임 벡터 mvA, mvB, mvC를 가지고 수평과 수직 성분의 중앙값을 계산하고 그것을 mvL0로 한다. 마찬가지로, L1 예측에서는 좌측, 상단, 우측 상단의 L1 예측 움직임 벡터 mvA, mvB, mvC를 가지고 수평과 수직 성분의 중앙값을 계산하여 그것을 mvL1으로 한다. 만일, 주변 블록이 단방향 예측이거나 화면 내 부호화된 L0 예측인 경우 또는 L1 예측의 움직임 벡터가 존재하지 않을 경우에는 0 벡터로 대체한다. 참조번호를 구할 경우, 좌측, 상단, 우측 상단의 움직임 벡터 mvA, mvB, mvC의 참조번호 최소값을 계산하고 그것을 N×N 블록의 참조번호로 한다. 이 참조번호를 구하는 처리도 L0 예측, L1 예측과 독립적으로 수행된다. 또한, 주변블록이 단방향 예측이거나, 화면 내 예측 부호화되는 L0 또는 L1 예측의 움직임 벡터가 존재하지 않는 경우, 그 블록은 참조번호를 구할 때 제외된다. 여기서 주의해야 할 점은 N×N 화소 블록의 직접예측 모드를 수행하는 경우 mvL0, mvL1, L0 참조픽처 및 L1 참조픽처를 구하는 과정은 N×N 화소블록 단위로 수행되지만, 주변블록을 통해 구한 예측 움직임 벡터(mvL0, mvL1)를 사용할지 0 벡터를 사용할지는 블록단위로 결정된다는 것이다.
다음에 SKIP 모드의 움직임 추정/보상 방법을 설명한다.
SKIP 모드는 예측 움직임 벡터를 사용해서 움직임 예측 및 보상을 수행한다는 점은 P-픽처의 SKIP 모드와 동일하지만, B-픽처 내 SKIP 모드에 사용되는 움직임 벡터와 참조 픽처의 Direct 모드의 예측 움직임 벡터, 참조 픽처와 동일하다. 즉, SKIP 모드의 움직임 추정/보상 방법은 전술한 직접예측 모드의 움직임 추정/보상 방법과 동일하다. Direct 모드와 SKIP 모드의 차이점은, SKIP 모드는 움직임 정보와 변환계수도 없는 모드이고, Direct 모드는 움직임 정보만 없는 모드라는 점이다.
한 방향 예측(L0 예측 또는 L1 예측)의 움직임 추정/보상 방법은, 참조픽처가 L0 및 L1 중의 하나라는 점을 제외하고 P-픽처의 움직임 추정 및 보상 방법과 동일하므로 이에 대한 설명은 생략한다.
마지막으로, 양 방향 예측의 움직임 추정/보상 방법에 대하여 설명한다.
움직임 정보를 가지는 B-픽처 내 8×8 이상의 크기를 갖는 화소 블록들에 대해서는 전술한 P-픽처의 움직임 추정/보상 방법을 이용하여 L0 참조픽처와 mvL0를 구하여 L0 예측을 수행하며, L1 참조픽처와 mvL1를 구하여 L1 예측을 수행한다. 또한, L0 예측 수행과정을 통해 얻은 L0 참조픽처 내 mvL0 이 가리키는 참조블록과, L1 예측 수행과정을 통해 얻은 L1 참조픽처 내 mvL1이 가리키는 참조블록의 평균치 블록을 참조블록으로 사용하여 mvL0 및 mvL1에 대한 양방향 예측을 수행할 수 있다. 또한, L0 예측의 움직임 정보에 대한 L1 예측을 수행하여 mvL0/L0 참조픽처에 대한 최적의 mvL1, L1 참조픽처를 선택하고, 선택된 L1 참조픽처 내 mvL1이 가리키는 참조블록과 L0 예측 수행과정을 통해 얻은 L0 참조픽처 내 mvL0이 가리키는 참조블록의 평균치 블록을 참조블록으로 사용하여 양방향 예측을 수행할 수 있다. 또한, L1 예측의 움직임 정보에 대한 L0 예측을 수행하여 mvL1/L1 참조픽처에 대한 최적의 mvL0, L0 참조픽처를 선택하고, 선택된 L0 참조픽처 내 mvL0이 가리키는 참조블록과 L1 예측 수행과정을 통해 얻은 L1 참조픽처 내 mvL1이 가리키는 참조블록의 평균치 블록을 참조블록으로 사용하여 양방향 예측을 수행할 수 있다. 바람직하게는, 움직임 정보를 가지는 B-픽처 내 8×8 이상의 크기를 갖는 화소 블록들에 대하여 이와 같은 양방향 예측 모드의 부호화 효율을 비교하여 부호화 효율이 가장 좋은 하나의 양방향 예측 모드를 선택한다. 16×16 이상의 크기를 갖는 화소 블록에 대해서는 전술한 양방향 예측 모드들의 움직임 정보를 찾은 후, 최적의 부호화 모드를 결정할 때 변환, 양자화, 엔트로피 변환계수 부호화를 수행하여 해당 모드에 소요되는 실제 부호화 비트와 예측오차(Distortion)를 이용하여 양방향 예측 모드를 결정하는 것이 바람직하다.
L0 예측, L1 예측 및 양방향 예측에 대하여, 8×8 이상의 각각의 화소 블록들은 서로 다른 참조영상을 사용할 수 있으나, 8×8 화소블록 내의 서브 블록들은 동일한 참조영상을 사용한다.
도 1을 참조하면, 감산기(120)는 움직임 추정기(116)에서 추정한 현재 블록의 움직임 벡터가 가리키는 참조 블록과 현재 블록을 감산하여 잔여 블록을 생성하고, 생성된 잔여 블록은 변환기 및 양자화기(130)에 의해 변환 및 양자화된 후, 양자화된 변환 계수가 부호화기(140)에 의해 엔트로피 부호화되어 부호화 데이터가 생성된다. 여기서, B-픽처에 대한 변환 방법은 전술한 P-픽처에 대한 변환 방법과 동일하므로, 그에 대한 상세한 설명은 생략한다.
도 31에는 확장된 매크로블록이 32×32 화소 블록인 것으로 가정하여 B-픽처(또는 B-슬라이스)의 비트스트림을 통해 전송할 데이터를 나타내었다. 일반적으로, B-픽처(또는 B-슬라이스)의 전송 신택스는 도 30에서 설명한 P-픽처(또는 B-슬라이스)의 전송 신택스와 유사하며, 여기서는 P-픽처의 신택스에 추가되는 부분만을 설명한다.
directX_flag는 SKIP 모드가 아닌 인터 블록들 중에서 확장된 매크로블록, 16×16 이상의 화소 블록 및 8×8 화소 블록에 대해서만 direct 모드인지의 여부를 나타내는 플래그로서 표 8과 같이 1비트로 이루어질 수 있다.
표 8
Figure PCTKR2011002762-appb-T000008
Direct 모드인 경우에 움직임 정보는 부호화하지 않으며, 변환 계수와 관련된 정보들을 부호화한다. 또한, 확장된 매크로블록이 Direct 모드가 아닌 경우, 움직임 정보(예를 들어, B_pdir, MVD, ref_idx 등)의 데이터를 부호화한다. 여기서, B_pdir는 현재 블록의 예측 방향(L0 예측, L1 예측, 양방향 예측)을 나타내는 정보로서, SKIP 또는 direct 모드가 아닌 인터 블록들에 대해서만 부호화하며 표 9와 같이 3가지 모드가 있다.
표 9
Figure PCTKR2011002762-appb-T000009
양방향 예측인 경우, L0 예측을 위한 움직임 정보(mvL0, ref_idx_L0)와 L1 예측을 위한 움직임 정보(mvL1, ref_idx_L1)가 모두 부호화되고, L0 예측인 경우 L0 예측을 위한 움직임 정보(mvL0, ref_idx_L0)만 부호화된다. 또한, L1 예측인 경우, L1 예측을 위한 움직임 정보(mvL1, ref_idx_L1)만 부호화된다.
도 32는 본 발명의 일 실시예에 따른 SKIPX 플래그의 부호화 과정을 설명하기 위한 예시도이다.
도 32에서는 매크로블록이 64×64 화소 블록인 경우 다양한 크기와 모양의 서브블록으로 분할된 매크로블록의 분할 타입과 각 서브블록의 부호화 순서를 예시적으로 나타내었다. 도 32와 같이 매크로블록이 분할된 경우, 11 번째 16×16 화소 서브블록에 대해 SKIP16 플래그가 부호화되고, 12 번째 16×16 화소 서브블록의 SKIP16 플래그가 부호화되며, 15 번째 16×32 화소 서브블록의 SKIP16 플래그가 부호화되며, 16 번째 16×32 화소 서브블록의 SKIP16 플래그가 부호화되며, 17 번째 32×32 화소 서브블록의 SKIP32 플래그가 부호화되며, 18 번째 32×32 화소 서브블록의 SKIP32 플래그가 순서대로 부호화된다.
SKIP 매크로블록이 아닌 매크로블록의 서브블록들에 대해서는 해당 서브블록의 움직임 벡터와 해당 서브블록의 주변 블록을 이용하여 추정한 예측 움직임 벡터 간의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)와 참조 픽처 인덱스를 포함하는 움직임 정보가 부호화된다.
도 33 및 도 34는 본 발명의 일 실시예에 따라 인터 매크로블록에 대한 CBPX_플래그, 변환 타입과 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 33과 도 34에서는 매크로블록이 64×64 화소 블록인 경우 CBPX_플래그, 변환 타입(Transform Type)과 CBP를 부호화하는 과정을 예를 들어 나타내었다. 영상 부호화 장치(100)의 부호화기(140)는 확장된 매크로블록의 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나인지 여부를 판단하여(S3302), 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나가 아닌 경우에는 서브블록의 크기가 32×32, 32×16 및 16×32 중 하나인지 여부를 판단한다(S3304).
단계 S3304의 판단 결과, 서브블록의 크기가 32×32, 32×16 및 16×32 중 하나인 경우, 해당 서브블록 내 0이 아닌 양자화된 변환 계수가 있는지 여부를 판단하여(S3306), 0이 아닌 양자화된 변환 계수가 있는 경우에는 해당 서브블록 내에 0이 아닌 양자화된 변환 계수가 있음을 나타내는 CBP32 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있음)를 부호화한다(S3308).
단계 S3308에서 CBP32 플래그를 부호화한 후, 서브블록 내의 16×16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 판단하여(S3310), 0이 아닌 양자화된 변환 계수가 있는 경우에는 16×16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있음을 나타내는 CBP16 플래그를 부호화한다(S3312).
이와 같이 CBPX 플래그를 부호화한 후에는 0이 아닌 양자화된 변환 계수를 가지는 블록들에 대해서만 변환 타입을 부호화한다(S3316). 이때, 서브블록의 크기가 16×16이상이면 서브블록마다 변환 타입를 부호화하며, 16×16보다 작은 경우에는 16×16마다 하나의 변환플래그를 부호화한다. 변환은 16×16 화소 단위로 선택되기 때문이다. 예를 들어, 64×64 화소 매크로블록이 두 개의 64×32 화소 서브블록으로 분할되고 CBP64 플래그가 0이 아닌 경우, 각 64×32 화소 서브블록 내 두 개의 CBP32 플래그가 0이 아닌 64×32 화소 서브블록에 대해 변환 타입를 부호화한다.
여기서, 서브블록의 크기가 16×16이상이며 서브블록에 속한 CBPX 플래그가 모두 0이 아닌 경우, 표 3을 이용하여 각 서브블록의 변환 타입을 부호화한다.
표 10
Figure PCTKR2011002762-appb-T000010
또한, CBP16 플래그가 0이 아니며 16×16 화소 블록이 두 개의 8×16 화소 블록 또는 16×8 화소 블록으로 분할된 경우 표 4를 이용하여 16×16 화소 블록 단위로 변환 타입을 부호화한다.
표 11
Figure PCTKR2011002762-appb-T000011
CBP16 플래그가 0이 아니며 16×16 화소 블록이 4 개의 8×8 화소 블록으로 분할되고, 4×4 변환이 선택된 경우에는 0을 변환 타입으로서 부호화하고, 8×8 변환이 선택된 경우에는 1을 변환 타입으로서 부호화하며, 그 외의 경우에는 변환 타입을 부호화하지 않는다.
단계 S3316에서 변환 타입을 부호화한 후에는, 변환 타입에 따라 CBP를 부호화한다. 이를 위해, 변환 타입이 16×16 변환인지 여부를 판단하여(S3318), 16×16 변환인 경우에는 색차 성분(Chroma Component)의 CBP 2 비트만을 부호화하며(S3320), 16×16 변환이 아닌 경우에는 변환 타입이 8×16 변환 또는 16×8 변환인지 여부를 판단하여(S3322), 8×16 변환 또는 16×8 변환인 경우에는 휘도 성분(Luma Component)의 CBP 2비트와 색차 성분의 CBP 2비트를 부호화하며(S3324), 8×16 변환 또는 16×8 변환이 아닌 경우에는 변환 타입이 8×8 변환 또는 4×4 변환인지 여부를 판단하여(S3326), 8×8 변환 또는 4×4 변환인 경우에는 휘도 성분의 CBP 4 비트와 색차 성분의 CBP 2 비트를 부호화한다(S3328). 단계 S3320, S3324, S3328에서는, 입력 영상이 4:2:0 포맷인 경우의 휘도 성분의 CBP와 색차 성분의 CBP를 부호화하는 예를 설명한 것이므로, 입력 영상의 포맷이 변경되는 경우에는 그에 따라 휘도 성분의 CBP와 색차 성분의 CBP를 부호화하는 방법이 달라질 수 있다.
한편, 단계 S3306에서의 판단 결과, 서브블록 내 0이 아닌 양자화된 변환 계수가 없는 경우에는, 서브블록 내 0이 아닌 양자화된 변환 계수가 없음을 나타내는 CBP32 플래그를 부호화한다(S3330). 서브블록 내 0이 아닌 양자화된 변환 계수가 없으므로 변환 타입과 CBP는 부호화하지 않는다.
또한, 단계 S3302에서의 판단 결과, 서브블록의 크기가 64×64, 64×32 및 32×64 중 하나인 경우에는 서브블록 내 0이 아닌 양자화된 변환 계수가 있는지 여부를 판단하여(S3330), 0이 아닌 양자화된 변환 계수가 있는 경우에는 해당 서브블록 내에 0이 아닌 양자화된 변환 계수가 있음을 나타내는 CBP64 플래그를 부호화하고(S3334), 단계 S3306으로 진행하며, 0 이 아닌 양자화된 변환 계수가 없는 경우에는 해당 서브블록 내에 0이 아닌 양자화된 변환 계수가 없음을 나타내는 CBP64 플래그를 부호화한다(S3336). 서브블록 내 0이 아닌 양자화된 변환 계수가 없으므로 변환 타입과 CBP는 부호화하지 않는다.
이와 같이, CBPX(단, X는 32 이상의 정수임) 플래그, 변환 타입과 CBP를 부호화한 후, 영상 부호화 장치(100)의 부호화기(140)는 0이 아닌 양자화된 변환계수가 있는 블록들에 대해서만 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하고 변환 계수 필드에 할당한다. 양자화된 변환 계수의 부호화 방법은 전술한 인트라 매크로블록에 대한 양자화된 변환 계수의 부호화 방법과 동일하다.
본 발명에 따른 실시예에서는 가변길이 부호화 방법으로 CABAC(Context-based Adaptive Variable Length Code)을 사용할 수 있으며, CABAC 부호화는 이진 산술 부호화부와 문맥 계산부로 이루어져 있다.
이진 산술 부호화부는 이진신호(0과 1의 신호)로 변환하는 이진화부이며, 문맥 계산부는 부호화해야 하는 이진 신호의 발생확률을 복수로 유지해주고(context table) 현재 부호화 대상과 주위의 상황에 따라 이진 신호의 발생확률을 바꾸어가며 이진 산술 부호화부에 전달한다. 이때, 컨텍스트 테이블(context table)은 슬라이스 부호화/복호화를 시작할 때 초기화되고 슬라이스 내에서 업데이트 된다. 각각의 신택스는 ctxIdx(컨텍스트 번호)에 따라 다른 table(발생확률)을 가지며, ctxIdx는 수학식 7에 의해 구해진다.
수학식 7
Figure PCTKR2011002762-appb-M000007
여기서, ctx_offset은 픽처 타입과 신택스의 종류에 의해 결정된다. 이때, interX_flag는 X값에 따라 다른 테이블을 사용하는 것이 바람직하지만, 같은 테이블을 사용할 수도 있다. ctx_inc는 대상 신택스를 부호화할 때 주위 상황에 따라 결정되는 값이며 신택스 별 ctx_inc의 예는 도 35 내지 도 37에 도시한 바와 같다. 예를 들어, skipX_flag의 경우 도 35에 나타낸 바와 같이, ctx_inc = 0은 주변의 상단 블록 및 좌측 블록이 모두 SKIP 모드가 아닌 경우를 나타내며, ctx_inc = 1은 주변의 상단 블록 또는 좌측 블록이 SKIP 모드인 경우를 나타내고, ctx_inc = 2는 주변의 상단 블록 및 좌측 블록이 모두 SKIP 모드인 경우를 나타낼 수 있다. 각각의 ctx_inc에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 마찬가지로, interX_flag의 경우 도 36에 나타낸 바와 같이, ctx_inc가 0 내지 5인 경우는 32×32 화소 블록인 확장된 매크로블록에 대한 컨텍스트 테이블의 예측 타입의 예를 나타내며, ctx_inc가 7 내지 9인 경우는 16×16 화소블록에 대한 컨텍스트 테이블의 예측 타입의 예를 나타내고, 각각의 ctx_inc에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 마찬가지로, directX_flag의 부호화/복호화를 위한 ctx_inc는 도 37에 나타낸 바와 같다. 전술한 표 8에서 설명한 바와 같이 directX_flag의 부호화 비트는 1비트로 나타낼 수 있으며, 부호화할 대상 블록의 상단 블록 및 좌측 블록이 모두 direct 모드가 아닌 경우와, 모두 direct 모드인 경우, 그리고 상단 블록 또는 좌측 블록 중 어느 한 블록만 direct 모드인 경우에 따라 컨텍스트 테이블을 다르게 결정할 수 있다. 또한, extended_flag의 부호화/복호화를 위한 ctx_inc의 경우에도 도 37과 유사하게 부호화할 대상 블록의 주변 블록이 확장된 매크로블록 단위로 부호화가 수행되었는지(이 경우, extended_mb_flag를 이진비트 1로 설정할 수 있다) 또는 16×16 화소블록으로 분할되어 부호화가 수행되었는지(이 경우, extended_mb_flag를 이진비트 1로 설정할 수 있다)에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 이와 같이, interX_flag의 경우 X의 값, 픽처 타입, 참조 픽처로 사용되는지의 여부, 이웃 블록들의 데이터에 따라 다른 컨텍스트 테이블을 사용할 수 있다.
도 38 및 도 39는 본 발명의 일 실시예에 따라 분할 타입 정보를 부호화하는 과정을 설명하기 위한 예시도이다.
도 38에서는 트리 구조를 이용하여 분할 타입 정보를 부호화하기 위해 부호화하고자 하는 확장된 매크로블록 내 각 16×16 화소 블록에 대한 분할 타입 값을 나타낸다.
38A에서 Mx(a,b)는, 부호화하고자 하는 확장된 매크로블록 내의 (a,b)의 위치에 해당하는 16×16 화소 블록의 분할 타입 값을 나타낸다. 즉, Mx(0,0)은 부호화하고자 하는 확장된 매크로블록 내의 (0,0)의 위치 즉, 부호화하고자 하는 확장된 매크로블록 내에서 래스터 스캔 방향으로 첫 번째의 16×16 화소 블록의 분할 타입 값을 나타내며, Mx(0,1)은 부호화하고자 하는 확장된 매크로블록 내의 (0,1)의 위치 즉, 부호화하고자 하는 블록 내에서 래스터 스캔 방향으로 두 번째의 16×16 화소 블록의 분할 타입 값을 나타낸다.
38A에 나타낸 16×16 화소 블록에 대한 분할 타입 값들을 일정한 영역 단위 예를 들면, K×L 개의 분할 타입 값들을 포함하는 영역 단위로 그룹화하고, 그룹화된 영역 내의 분할 타입 값들 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값으로 할당한다. 그룹화된 영역에 대한 분할 타입 값을 Mx-1(c, d)라고 하면, c=a/K이며, d=b/L이 된다. 여기서, Mx-1은 Mx의 상위 노드이며, 상위 노드의 값을 선택하는 방법으로 가장 큰 값을 선택할 수도 있다. 또한, 상위 노드 값을 선택하는 방법을 부호화하여 적응적으로 사용할 수도 있다.
38B는 38A에 나타낸 16×16 화소블록들에 대한 분할 타입 값들을 2×2 개의 분할 타입 값들을 포함하는 영역 단위로 그룹화하고, 각각의 그룹 내의 분할 타입 값들 중 최소값을 그룹화된 영역에 대한 분할 타입 값으로 할당한 결과를 나타내었다. 즉, 38A에서 나타낸 16×16 화소 블록 (0,0), (0,1), (1,0), (1,1)을 포함하는 화소 블록들의 분할 타입 값을 2×2개의 영역 단위로 그룹화하고, 그룹화된 영역 내에 포함된 각 16×16 화소 블록들의 분할 타입 값 MX(0,0), MX(0,1), MX(1,0), MX(1,1) 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값 MX-1(0,0)으로 할당하였다. 다시, 16×16 화소블록 (0,2), (0,3), (1,2), (1,3)을 포함하는 화소 블록들의 분할 타입 값을 2×2개의 영역 단위로 그룹화하고, 그룹화된 영역 내에 포함된 각 16×16 화소 블록들의 분할 타입 값 MX(0,2), MX(0,3), MX(1,2), MX(1,3) 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값 MX-1(0,1)의 분할 타입 값으로 할당하였다. 이와 같은 방식으로 나머지 16×16 화소 블록들에 대해서도 동일한 과정을 수행한다. 38A에 나타낸 16×16 화소 블록들의 분할 타입 값을 38B에 나타낸 그룹화된 영역의 분할 타입 값으로 할당하는 과정을 MX-2, MX-3 … M1 레이어(Layer)까지 반복적으로 수행하면 36C와 같이 그룹화된 영역의 분할 타입 값을 할당할 수 있으며, 다시 M0 레이어까지 반복하면 38D와 같이 하나의 그룹화된 영역의 분할 타입 값을 가지도록 그룹화할 수 있다.
다만, 도 38에서는 2×2개의 영역 단위로 인접한 16×16 화소 블록들에 대한 분할 타입 값들을 그룹화하는 것으로 설명했지만, 반드시 이에 한정되지 않고 4×2개, 2×4개 등과 같이 다양한 크기의 영역 단위로 인접한 16×16 화소 블록들에 대한 분할 타입 값들을 그룹화하거나, 인접하지 않은 16×16 화소 블록들에 대한 분할 타입 값들을 일정한 영역 단위로 그룹화하여 분할 타입 값을 할당할 수도 있다.
도 38에 도시한 바와 같이 부호화하고자 하는 블록의 16×16 화소 블록들의 분할 타입 값을 그룹화된 영역의 분할 타입 값으로 할당한 것을 트리 구조로 나타내면 도 39와 같이 나타낼 수 있다.
도 39에서는 레이어별로 그룹화된 영역에 대한 분할 타입 값을 트리 구조로 예시적으로 나타내었다. 레이어별 그룹화된 영역에 대한 분할 타입 값을 노드값(Node Value)이라고 가정하면, 도 39에 도시된 트리 구조의 노드값들은 상위 노드(Node)의 노드값과의 차이값을 부호화함으로써 부호화될 수 있다.
노드값들과 상위 노드의 노드값의 차이값을 부호화하는 방법은 차이값만큼의 이진 비트 0을 부호화하고 마지막에 이진 비트 1을 부호화한다. 만약, 현재 부호화할 노드의 노드값과 상위 노드의 노드값의 차이가 0인 경우에는 이진 비트 1을 부호화한다. 0과 1의 이진 비트를 부호화할 때 예를 들어 산술 부호화 방법을 이용할 수 있는데, 이때 각 레이어별로 다른 컨텍스트(Context)를 이용할 수 있다.
이와 같이, 트리 구조를 이용하여 분할 타입 값 즉, 노드값을 부호화할 때, 최상위 노드의 노드값(이하 '최상위 노드값'이라 칭함)은 0과의 차이값을 전술한 바와 같이 0과 1의 이진 비트를 이용하여 부호화될 수 있다. 또는, 도 18에서 설명한 분할 타입 번호를 할당함에 있어서 발생 빈도수가 높은 순서로 큰 분할 타입 번호를 할당한 경우, 최상위 노드값은 가장 큰 분할 타입 번호와의 차이값을 0과 1의 이진 비트를 이용하여 부호화될 수 있다. 또는, 도 18에서 설명한 분할 타입 번호를 할당함에 있어서 발생 빈도수가 높은 순서로 작은 분할 타입 번호를 할당한 경우, 최상위 노드값은 가장 작은 분할 타입 번호와의 차이값을 0과 1의 이진 비트를 이용하여 부호화할 수 있다.
최상위 노드를 제외한 나머지 노드값들은 부호화하고자 하는 노드의 노드값과 해당 노드의 상위 노드의 노드값의 차이값을 이진 비트 0과 1을 이용하여 부호화할 수 있다. 즉, 차이값만큼의 개수의 이진 비트 0을 부호화하고 마지막에 이진 비트 1을 부호화함으로써 각 노드값들이 부호화될 수 있다. 만약, 부호화하고자 하는 노드의 노드값과 상위 노드의 노드값의 차이가 0인 경우에는 이진 비트 1을 부호화한다. 또한, 이와는 반대로, 차이값만큼의 개수의 이진 비트 1을 부호화하고 마지막에 이진 비트 0을 부호화함으로써 각 노드값들이 부호화될 수도 있으며, 이때 차이값이 0인 경우, 이진 비트 0을 부호화할 수 있다.
다만, 각 노드값을 부호화할 때 상위 노드값이 분할 타입 번호가 가질 수 있는 최대값인 경우, 해당 상위 노드의 하위 노드들의 노드값들은 부호화되지 않는다. 예를 들어, M1(0,0) 노드의 노드값이 3인 경우, M1(0,0) 노드의 하위 노드인 M2(0,0), M2(0,1), M2(1,0), M2(1,1) 노드의 노드값은 부호화되지 않는다. 즉, M1(0,0)은 M2(0,0), M2(0,1), M2(1,0), M2(1,1)의 최소값이므로 M2(0,0), M2(0,1), M2(1,0), M2(1,1)은 모두 3이상의 값을 가진다. 하지만, 도 18에서 분할 타입 값의 최대값은 3이므로 M2(0,0), M2(0,1), M2(1,0), M2(1,1)은 3 이외의 다른 값을 가질 수 없기 때문에 부호화할 필요가 없다.
또한, 부호화하고자 하는 노드와 상위 노드의 차이값을 부호화할 때, 부호화하고자 하는 현재 노드의 노드값이 분할 타입 번호가 가질 수 있는 최대값인 경우, 차이값만큼의 개수의 이진 비트 0만을 부호화하고, 마지막에 이진 비트 1을 부호화하지 않는다. 예를 들어, 부호화하고자 하는 현재 노드의 상위 노드의 노드값 M1(0,0)와 부호화하고자 하는 현재 노드의 노드값 M2(0,0), M2(0,1), M2(1,0), M2(1,1)이 각각 1, 2, 3, 3, 2라고 가정하면, 노드값 M2(0,0)와 M2(1,1)은 이진 비트 01을 부호화하고 노드값 M2(0,1)과 M2(1,0)은 이진 비트 001이 아니라 00을 부호화한다.
또한, 같은 상위 노드를 가지는 노드들 중 마지막 노드의 노드값을 부호화하는 경우, 마지막 노드를 제외한 노드들의 노드값이 상위 노드의 노드값보다 모두 큰 경우 마지막 노드의 노드값은 부호화하지 않는다. 예를 들어, 부호화하고자 하는 노드의 상위 노드의 노드값 M1(0,0)과 부호화하고자 하는 노드의 노드값 M2(0,0), M2(0,1), M2(1,0), M2(1,1)이 각각 1, 2, 3, 3, 1이라고 가정하면, 노드값 M2(0,0), M2(0,1), M2(1,0)이 모두 노드값 M1(0,0)보다 크므로, 제일 마지막 노드의 노드값 M2(1,1)는 부호화하지 않는다.
한편, 최상위 노드를 제외한 나머지 노드값들은 전술한 바와 같이 부호화하고자 하는 노드의 노드값과 해당 노드의 상위 노드의 노드값의 차이값을 이진 비트 0과 1을 이용하여 부호화함으로써 부호화될 수도 있지만, 이와는 달리 각 노드의 노드값과 분할 타입의 발생 빈도수가 가장 높은 분할 타입값의 차이값을 부호화함으로써 부호화될 수 있다. 여기서 발생 빈도수가 가장 높은 분할 타입값은 고정값을 사용할 수도 있고 고정값이 아닐 수도 있다. 고정값이 아닌 경우, 부호화하여 복호화기에 전송할 수도 있고 또는 전송하지 않을 수도 있는데 전송하지 않는 경우 현재 블록 이전에 부호화화된 블록들의 통계를 누적하여 현재까지 발생 빈도수가 가장 높은 모드를 사용할 수도 있다. 트리 구조를 이용하여 분할 타입 정보를 부호화하는 또 다른 실시예로 38A에 나타낸 서브블록들의 분할 타입값들을 그룹화하여 38B의 그룹화된 영역의 분할 타입값을 정할 때 발생빈도수가 높은 순서로 큰 분할 타입 번호가 할당된 경우, 그룹화된 영역의 값들 중 최대값을 그룹화된 영역의 분할 타입값으로 사용할 수 있다.
본 발명의 실시예에서는 도 18에 나타낸 바와 같은 분할 타입 값을 사용하며 확장된 매크로블록을 16×16 화소 블록으로 분할하는 경우(즉, extended_mb_flag = 0인 경우), 전술한 방법을 이용하여 분할 타입을 부호화/복호화한다. 이 경우, 가장 하위 노드의 값은 확장된 매크로블록 내의 16×16 화소 블록의 분할 타입 값이며, 하위 노드들의 값들의 최대값을 상위노드의 대표값으로 이용할 수 있다. 예를 들어, 도 40에서와 같이, 32×32 화소 블록의 확장된 매크로블록이 16으로 패딩된 이미지에 속하고 16×16 화소 블록으로 분할된 경우, 최상위 노드의 대표값은 0이므로 최상위 노드의 부호화는 분할 타입의 최대값 3과 대표값 0의 차이값인 3을 나타내는 이진비트‘000’부호화한다. 다른 예로, 도 41에서와 같이 32×32 화소 블록의 확장된 매크로블록이 16으로 패딩된 이미지에 속하고 3개의 16×16 화소 블록은 8×8 이하의 화소 블록으로 분할되어 부호화되며 하나의 16×16 화소 블록은 16×16 화소 블록으로 부호화되는 경우, 최상위 노드의 대표값은 3이므로 최상위 노드의 대표값 3과 분할 타입의 최대값 3의 차이값을 나타내는 이진비트 1을 부호화하며, 하위 노드들의 값과 상위 노드의 값 사이의 차이값이 0인 경우는 ‘이진비트 ‘1’을 부호화하고 차이값이 3인 경우는 이진비트 ‘000’을 부호화한다.
인트라 예측 모드의 부호화는 도 6 내지 도 10에서 설명한 바와 같이, 휘도 성분의 4×4, 8×8 화소 블록의 인트라 예측 모드는 주변블록을 이용해서 예측한 예측 인트라 모드와 같은지를 나타내는 1비트 플래그를 부호화하고, 예측 인트라 모드와 다른 경우 9가지 예측 모드 중 예측한 예측방향을 뺀 나머지 8가지의 예측 모드 중 어떤 모드인지를 3비트를 사용하여 나타낸다. 또한, 16×16 화소 블록은 4가지 예측모드 중 어떤 모드를 사용하는지 2비트를 사용하여 나타낸다. 또한, 4×4 화소 블록, 8×8 화소 블록 및 16×16 화소 블록을 제외한 나머지 m×n 화소 블록의 인트라 예측 모드는 주변 블록을 이용해 예측한 예측 인트라 모드와 같은지를 나타내는 1비트 플래그를 부호화하고, 예측 인트라 모드와 다른 경우 3가지 예측 모드 중 예측한 예측 방향을 뺀 나머지 2가지의 예측 모드 중 어떤 모드인지를 1비트를 사용하여 나타낸다. 또한, 색차 성분의 16×16 화소 블록은 4가지 예측 모드 중 어떤 모드인지를 사용하는지를 2비트를 사용하여 나타낸다. 여기서, 휘도 성분의 4×4, 8×8, 16×16, m×n 화소 블록과 색차 성분은 다른 컨텍스트 테이블을 사용하는 것이 바람직하다.
도 42는 양방향 예측의 부호화/복호화를 위한 ctx_inc의 예를 나타낸 도면이다. 전술한 바와 같이, ctx_inc는 대상 신택스를 부호화할 때 주위 상황에 따라 결정되는 값이며, 양방향 예측을 나타내는 B_pdir의 부호화 비트는 표 9에서 설명한 바와 같다. L0 예측인 주변 블록을 0, L1 예측인 주변 블록을 1, 그리고 양방향 예측인 주변블록을 2라고 할 경우, 대상 신택스는 주위 상황에 따라 도 42에 예시한 바와 같이 결정할 수 있다. 이때, 좌측 또는 상단 블록을 사용할 수 없을 경우, 사용 불가능한 블록의 예측방향으로 L0 예측(0)을 사용할 수 있다. 도 43에 예시한 바와 같은 각각의 ctx_inc에 대해서는 다른 컨텍스트 테이블을 사용하는 것이 바람직하다.
CBPX_flag의 부호화/복호화를 위한 ctx_inc는 도 37의 경우와 유사하게 컨텍스트 테이블을 결정할 수 있다. 예를 들어, 인트라 픽처이거나 확장된 매크로블록이 인트라 모드인 경우에 CBPX_flag를 부호화하지 않으며, 부호화하고자 하는 현재 블록의 상단 블록 또는 좌측 블록이 인트라 모드인 경우를 0 인터 모드인 경우를 1이라고 하면, 대상 신택스는 주위 상황에 따라 컨텍스트 테이블을 결정하여 사용할 수 있다.
도 43은 변환 타입의 부호화/복호화를 위한 ctx_inc의 예를 나타낸 도면이다. 여기서, 도 43은 사용 가능한 변환의 종류가 2가지인 경우의 예를 나타낸다. 표 1에서 설명한 바와 같이, 16×16 화소 블록이 4 개의 8×8 화소 서브블록으로 분할된 경우에는 선택 가능한 변환의 종류가 4×4 변환 및 8×8 변환 2가지이므로, 대상 신택스는 현재 블록의 상단 블록 및 좌측 블록이 모두 4×4 변환인 경우, 모두 8×8 변환인 경우, 또는 어느 하나의 블록은 4×4 변환이고 다른 하나의 블록은 8×8 변환인 경우에 따라 컨텍스트 테이블을 다르게 결정하여 사용할 수 있다.
도 44 및 도 45는 각각 사용 가능한 변환의 종류가 3가지인 경우의 변환 타입의 부호화/복호화를 위한 ctx_inc의 다른 예를 나타낸 도면으로서, 도 44는 첫 번째 비트 부호화에 사용되는 컨텍스트 테이블을 선택하기 위한 ctx_inc의 예를 나타내며, 도 45는 두 번째 비트 부호화에 사용되는 컨텍스트 테이블을 선택하기 위한 ctx_inc의 예를 나타낸다.
전술한 바와 같이, 8×8 화소 블록보다 작은 화소 블록 즉, 4×4 화소 블록, 4×8 화소 블록 또는 8×4 화소 블록으로 분할된 경우에는 4×4 변환을 수행하고, 8×8 화소 블록 4×4 변환 및 8×8 변환 중 부호화 비용이 작은 변환을 수행하며, 8×16 화소 블록은 4×4 변환, 8×8 변환 및 8×16 변환 중 부호화 비용이 작은 변환을 수행하고, 16×8 화소 블록은 4×4 변환, 8×8 변환 및 16×8 변환 중 부호화 비용이 작은 변환을 수행하며, 16×16 화소 블록 이상의 블록은 4×4 변환, 8×8 변환 및 16×16 변환 중 부호화 비용이 작은 변환을 수행하므로, 도 44에 나타낸 바와 같이 첫 번째 비트 부호화에서는 현재 블록의 상단 블록 및 좌측 블록이 모두 4×4 변환된 블록인지, 좌측 블록 및 상단 블록 중 어느 하나의 블록만이 4×4 변환된 블록인지 또는 모두 4×4 변환된 블록이 아닌지에 따라 변환 타입의 부호화/복호화를 위한 ctx_inc를 다르게 사용할 수 있다. 마찬가지로, 두 번째 비트 부호화에서는 현재 블록의 상단 및 좌측 블록 중 적어도 어느 하나의 블록이 8×8 변환된 블록인지의 여부에 따라 도 45에 나타낸 바와 같이 변환 타입의 부호화/복호화를 위한 ctx_inc를 다르게 사용할 수 있다.
도 46은 본 발명의 일 실시예에 따른 영상 복호화 장치를 간략하게 나타낸 블록 구성도이다.
본 발명의 일 실시예에 따른 영상 복호화 장치(4400)는 복호화기(Decoder, 4410), 역양자화기 및 역변환기(4420), 예측기(4430), 가산기(4440), 필터(4450) 및 픽처 버퍼(4460)을 포함하여 구성될 수 있다.
복호화기(4410)는 영상 부호화 장치(100)에 의해 부호화된 부호화 데이터를 엔트로피 복호화 등과 같은 다양한 부호화 또는 복호화 기법을 이용하여 복호화한다. 복호화기(4410)는 복호화할 픽처의 타입에 따라 복호화하는 데이터가 다르다. 이러한 픽처 타입에 대한 정보는 부호화 데이터의 픽처 헤더 또는 시퀀스 헤더로부터 추출되거나 추출되고 복호화되어 복원될 수 있다. 이때, 현재 복호화할 확장된 매크로블록이 도 2에 도시한 바와 같이 이미지 경계에 걸치는 경우(입력 이미지의 실제 사이즈는 시퀀스 파라미터로 전송된다), 확장된 매크로블록 내 이미지에 속하는 부분을 구하고 해당 영역의 텍스터 데이터와 예측모드를 엔트로피 복화화를 수행하여 얻을 수 있으며, 인트라 예측 또는 움직임 보상, 역변환/역양자화를 수행하여 실제 이미지에 속하는 부분을 복호화한다.
복호화할 픽처가 인트라 픽처인 경우, 복호화기(4610)가 영상 부호화 데이터 내에서 복호화할 데이터의 종류와 순서는 도 17에서 예시적으로 도시한 바와 같다. 즉, 복호화기(4410)는 입력되는 비트스트림으로부터 추출되는 분할 타입 데이터를 복호화하여 분할 타입 정보를 복원하고, 복원되는 분할 타입 정보에 의해 식별되는 분할 타입을 이용하여 매크로블록을 분할하며, 인트라 예측 모드 데이터를 복호화하여 매크로블록내 분할된 각 서브블록의 개수만큼 인트라 예측 모드를 복원하고, 각 서브블록의 크기에 따라 도 24에 나타낸 순서와 동일 또는 유사한 순서로 CBPX 플래그/CBP에 할당된 CBP 데이터를 복호화하여 CBPX 플래그 또는 CBP를 복원한다. 이후, 복호화기(4610)는 CBP가 나타내는 0인 아닌 변환 계수가 있는 서브블록들에 대해서만 변환 계수 데이터를 복호화하여 변환 계수를 복원한다. 이때, 영상 부호화 장치(100)가 확장된 매크로블록에 대하여 16×16 화소 블록 단위로 인트라 예측 부호화를 수행한 경우에는 CBPX 플래그의 복호화는 생략될 수 있으며, 이 경우 확장된 매크로블록 단위로 부호화된 양자화 파라미터에 대한 복호화가 수행될 수 있다.
다만, 도 17에 도시한 영상 부호화 데이터의 신택스의 구조는 예시적인 것일 뿐, 본 발명의 일 실시예에 따른 영상 부호화 데이터의 신택스 구조가 도 17에 도시한 구조로 한정되는 것은 아니다. 또한, 도 24에 도시한 CBPX 플래그 또는 CBP의 부호화 순서는 예시적인 것일 뿐, 본 발명의 일 실시예에 따른 CBPX 플래그 또는 CBP의 복원 순서는 도 24에 도시한 순서로 한정되는 것은 아니다.
여기서, 복호화기(4610)가 인트라 예측 모드를 복원화하는 방법은 서브블록의 크기에 따라 다르다. 즉, 서브블록의 크기가 4×4 또는 8×8과 같이 16×16이 아닌 경우, 복호화기(4610)는 비트스트림으로부터 추출되는 인트라 예측 모드 데이터 중 1 비트를 복호화하여 예측 모드 플래그를 복원하고, 복원되는 예측 모드 플래그가 해당 서브블록의 인트라 예측 모드에 따른 예측 방향이 주변 블록으로부터 추정되는 해당 서브블록의 인트라 예측 모드에 따른 예측 방향과 동일함을 나타내는 경우, 주변 블록으로부터 추정되는 해당 서브블록의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원하고 다음 서브블록의 인트라 예측 모드를 복호화하며, 동일하지 않음을 나타내는 경우 인트라 예측 모드 데이터의 다음 3 비트를 복호화하여 복원되는 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원한다. 또한, 서브블록의 크기가 16×16인 경우, 복호화기(4610)는 비트스트림으로부터 추출되는 인트라 예측 모드 데이터 중 2 비트를 복호화하여 현재 블록의 인트라 예측 모드를 복원한다. 이와 같이 복원되는 인트라 예측 모드는 예측기(4630)의 인트라 예측기(4632)로 입력된다.
또한, 32×32 화소 블록인 확장된 매크로블록이 인트라 모드인 경우, 확장된 매크로블록 내의 16 화소의 배수로 패딩된 이미지에 속하는 블록을 판단한 후, 해당 블록의 분할 타입을 엔트로피 복호화할 수 있다. 도 3의 경우, 32×32 화소 블록인 확장된 매크로블록 내의 패딩된 이미지에 속하는 블록은 첫 번째의 16×16 화소 블록만이 해당되며, 따라서 첫 번째의 16×16 화소 블록의 분할 타입을 엔트로피 복호화한다. 만약, 해당 16×16 화소 블록이 두 개의 16×8 화소 블록으로 분할된 경우를 가정하면, 두 개의 인트라 예측 모드를 엔트로피 복호화하고 16×16 화소 블록을 위한 CBP 1개와 16×16 변환 계수를 복호화한다. 엔트로피 복호화를 통해 얻은 서브 블록 타입과 인트라 예측 모드, 변환 계수를 이용하여 해당 16×16 화소 블록을 복호화한다.
복호화할 픽처가 인터 픽처인 경우 복호화기(4610)가 영상 부호화 데이터 내에서 복호화할 데이터의 종류와 순서는 도 29에 도시한 바와 같다. 즉, 복호화기(4610)는 비트스트림으로부터 추출되는 SKIPN 플래그 데이터를 복호화하여 현재 복호화하고자 하는 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIPN 플래그를 복원한다. 복호화기(4610)는 복원되는 SKIPN 플래그에 의해 식별되는 매크로블록이 SKIP 매크로블록이 아닌 경우, 비트스트림으로부터 추출되는 매크로블록 타입 플래그 데이터와 분할 타입 데이터를 복호화하여 매크로블록 타입 플래그와 분할 타입 정보를 복원한다.
또한, 확장된 매크로블록이 32×32 화소 블록인 경우, 확장된 매크로블록 내의 16 화소의 배수로 패딩된 이미지에 속하는 블록을 판단한 후, skip32_flag를 복호화하고 현재 복호화할 확장된 매크로블록이 SKIP 모드인 경우에 해당 블록의 좌측 및 상단의 주변 블록을 이용하여 예측 움직임 벡터를 구하고 움직임 보상을 수행할 수 있다. 도 3의 경우, 32×32 화소 블록인 확장된 매크로블록 내의 패딩된 이미지에 속하는 블록은 첫 번째의 16×16 화소 블록만이 해당되며, skip32_flag를 복호화하고 현재 복호화할 확장된 매크로블록이 SKIP 모드인 경우에 첫 번째의 16×16 화소 블록의 좌측 및 상단의 주변 블록을 이용하여 예측 움직임 벡터를 구하며, 움직임 보상을 수행할 수 있다.
복원되는 매크로블록 타입 플래그에 의해 식별되는 매크로블록 타입이 인트라 매크로블록인 경우에는 전술한 바와 동일하며, 매크로블록 타입이 인터 매크로블록인 경우, 복호화기(4610)는 서브블록의 크기가 16×16 이상인 서브블록들에 대해서만 SKIPX 플래그 데이터를 복호화하여 SKIPX 플래그를 복원하고 복원되는 SKIPX 플래그에 의해 식별되는 SKIP 블록이 아닌 서브블록 또는 16×16보다 작은 크기를 가지는 서브블록들(SKIP이 아님을 의미함)에 대해서 MVD/ref_idx 데이터를 복호화하여 움직임 정보인 움직임 벡터와 참조 픽처 인덱스를 복원한다. 또한, 복호화기(4610)는 SKIP이 아닌 블록들에 대해서 도 33과 도 33에 도시한 바와 동일 또는 유사한 순서로 복호화하여 CBPX 플래그, 변환 타입, CBP를 복원하고, 복원되는 CBP에 의해 식별되는 0이 아닌 계수를 가지는 서브블록들에 대해서만 양자화된 변환 계수를 복원한다. 이와 같이 복원되는 움직임 정보는 인터 예측기(4634, 움직임 보상기로 구현될 수 있음)로 입력되고, 복원되는 CBPX 플래그, CBP, 변환 타입, 양자화된 변환 계수 등은 복호화하고자 하는 대상 매크로블록 또는 대상 매크로블록의 서브를록의 잔여 블록을 복원하기 위해 역양자화기 및 역변환기(4620)로 입력된다.
역양자화기 및 역변환기(4620)는 복호화기(4610)로부터 전달되는 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 블록을 복원한다. 이때, 역양자화기 및 역변환기(4620)는 복호화기(4610)로부터 전달되는 CBPX 플래그, CBP, 변환 타입을 이용하여 양자화된 변환 계수를 역양자화 및 역변환할 수 있다.
예측기(4630)는 복호화하고자 하는 대상 매크로블록 또는 그 서브블록을 예측하여 예측 블록을 생성한다. 이를 위해, 인트라 예측기(4632)는 복호화하고자 하는 대상 매크로블록 또는 그 서브블록을 복호화기(4610)에 의해 복원되는 인트라 예측 모드를 이용하여 인트라 예측함으로써 대상 매크로블록 또는 그 서브블록의 예측 블록을 생성하며, 인터 예측기(4634)는 복호화하고자 하는 대상 매크로블록 또는 그 서브블록을 복호화기(4610)에 의해 복원되는 움직임 정보를 이용하여 인터 예측함으로써 대상 매크로블록 또는 그 서브블록의 예측 블록을 생성한다.
가산기(4640)는 예측기(4630)에 의해 생성된 예측 블록과 역양자화기 및 역변환기(4620)에 의해 복원되는 잔여 블록을 가산하여 복호화하고자 하는 대상 매크로블록을 복원한다.
가산기(4640)에 의해 복원되는 대상 매크로블록은 필터(4650)에서 디블로킹 필터링 등이 수행되어 픽처 단위로 누적된 후 복원 영상으로 출력되며, 픽처 버퍼(4660)에 저장되어 추후 인터 예측기(4634)에서 움직임 보상 예측하는 데 활용될 수 있다.
인트라 예측기(4632), 인터 예측기(4634), 역양자화기 및 역변환기(4620)의 동작 방법은 도 1을 통해 전술한 영상 부호화 장치(100)의 인트라 예측기(112), 인터 예측기(114), 역양자화기 및 역변환기(150)의 동작 방법과 동일 또는 유사하므로 상세한 설명은 생략한다.
이와 같은 영상 복호화 장치(4600)는 확장된 매크로블록이 인터 매크로블록인지 또는 인트라 매크로블록인지 여부에 따라 다음과 같이 구성될 수 있다.
예를 들어, 매크로블록이 인트라 매크로블록인 경우, 복호화기(4610)는 부호화 데이터를 복호화하여 분할 타입 정보, 인트라 예측 모드 및 양자화된 변환 계수를 복원하고, 역양자화기 및 역변환기(4620)는 복원되는 분할 타입 정보에 따라 식별되는 서브블록의 크기에 따라 선택되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 예측기(4630)는 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 인트라 예측 모드를 이용하여 예측하여 예측 서브블록을 생성하며, 가산기(4640)는 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
다른 예로, 매크로블록이 인터 매크로블록인 경우, 복호화기(4610)는 부호화 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하고, 역양자화기 및 역변환기(4620)는 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 예측기(4630)는 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 가산기(4640)는 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
본 발명의 일 실시예에 따른 영상 복호화 방법에 따르면, 영상 복호화 장치(4600)는 복호화하고자 하는 매크로블록이 인트라 매크로블록인 경우, 부호화 데이터를 복호화하여 분할 타입 정보, 인트라 예측 모드 및 양자화된 변환 계수를 복원하고, 복원되는 분할 타입 정보에 따라 식별되는 서브블록의 크기에 따라 선택되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 인트라 예측 모드를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
이때, 서브블록의 크기에 따라 선택되는 변환은 서브블록의 크기가 4×4, 4×8 및 8×4 중 하나이면 4×4 변환을 이용하고, 서브블록의 크기가 8×8, 8×16 및 16×8 중 하나이면 8×8 변환을 이용하며, 서브블록의 크기가 16×16 이상이면 16×16 변환을 이용할 수 있다.
또한, 본 발명의 일 실시예에 따른 영상 복호화 방법에 따르면, 영상 복호화 장치(3000)는 복호화하고자 하는 매크로블록이 인터 매크로블록인 경우, 부호화 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하고, 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 복원되는 분할 타입 정보에 따라 식별되는 서브블록으로 분할하고 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
이때, 변환 타입 정보에 의해 식별되는 변환은 4×4 변환, 8×8 변환, 8×16 변환, 16×8 변환 및 16×16 변환 중 하나일 수 있다. 또한, 영상 복호화 장치(4600)는 복원되는 서브블록을 필터링할 수 있는데, 복원되는 서브블록 내의 선택되는 변환에 따른 블록의 왼쪽과 위쪽의 경계에 디블로킹 필터링을 수행할 수 있다.
또한, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 SKIP_N 플래그 데이터를 복호화하여 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP_N 플래그를 추가로 복원할 수 있다. 영상 복호화 장치(4600)는 복원되는 SKIP_N 플래그에 의해 SKIP 매크로블록이 아닌 것으로 식별되는 매크로블록에 대해서만 복호화 과정을 수행할 수 있다.
또한, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 매크로블록 타입 플래그 데이터를 복호화하여 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 나타내는 매크로블록 타입 플래그를 추가로 복원할 수 있다. 영상 복호화 장치(4600)는 복원되는 매크로블록 타입 플래그에 복호화하고자 하는 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 파악하고, 그에 따라 인트라 예측 복호화를 수행할지 또는 인터 예측 복호화를 수행할지 여부를 결정할 수 있다.
한편, 매크로블록의 타입에 관계 없이, 분할 타입 정보는 분할 레이어별 분할 타입 번호에 의해 식별될 수 있으며, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 CBP 데이터를 복호화하여 서브블록의 크기에 따른 CBPX 플래그와 CBP를 추가로 복원할 수 있다. 여기서, CBPX 플래그는 X×X 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 나타내는 플래그이고 CBP는 16×16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 나타내는 플래그일 수 있다.
이하, 본 발명의 제 2 실시예를 설명한다. 특히, 본 발명의 제 2 실시예에서는 예측 서브 블록과 변환 서브 블록에 따라 변경되는 신택스 구조와 예측 서브 블록의 예측 모드가 상세하게 설명된다.
제 2 실시예에 따르면 입력 영상은 프레임 단위 또는 필드 단위로 도 1의 영상 부호화 장치(100)에 입력되거나, N×N(단, N은 16이상의 정수) 화소를 가지는 매크로블록들로 분할되어 영상 부호화 장치(100)에 입력될 수 있다. 이하에 기재하는 매크로블록은 정방형의 서브 블록으로 분할될 수 있다. 또한, 각 매크로블록과 서브 블록들은 인트라 예측 또는 인터 예측을 위한 예측 서브 블록으로 분할 될 수 있다. 매크로블록과 서브 블록들은 예측을 위하여 M×M, (M/2)×(M/2), M×(M/2), (M/2)×M, 1×M, M×1, (단, M=N)등의 가변 크기의 서브 블록으로 분할 될 수 있다. 또한, 변환 타입은 변환 서브 블록에 따라 결정할 수 있는데, 변환 서브 블록은 매크로블록과 서브 블록을 예측 서브 블록에서와 유사한 방식으로 분할함으로써 얻어 질 수 있다. 한편, 입력 영상의 크기가 N의 배수가 아닌 경우에는 입력 영상에 대해 N의 배수가 되도록 임의의 방법으로 패딩한 후 영상 압축을 수행할 수도 있다. 이 때, 패딩의 방법은 영상 부호화장치와 영상 복호화장치가 영상의 사이즈에 따라 동일하게 수행할 수 있다.
예를 들어, 패딩을 수행하지 않는 경우 영상의 경계 또는 슬라이스의 경계에서 N×N이 아니라, S×T 화소를 (S < N 및/또는 T < N) 가지는 매크로블록 또는 서브 블록으로 부호화를 수행할 수 있다.
매크로블록의 크기와 예측 서브 블록의 크기가 다를 수도 있다. 예를 들어, 인트라 예측 매크로블록의 크기가 32×32 인 경우 예측 서브 블록의 크기는 32×32, 16×16, 16×4, 4×16, 8×8, 8×2, 2×8, 4×4, 4×1, 1×4 등의 가변적인 크기로 부호화 및 복호화 할 수 있다. 이러한 경우, 영상 부호화장치는 예측 서브 블록의 크기 정보와 분할된 각 예측 서브 블록의 인트라 예측 모드를 부호화 하고, 영상 복호화장치는 예측 서브 블록의 크기 정보와 분할된 각 예측 서브 블록의 인트라 예측 모드를 복호화 해야 한다. 또는 인터 예측 매크로블록의 크기가 32×32 인 경우 예측 서브 블록의 크기는 32×32, 32×16, 16×32, 16×16, 16×8, 8×8, 8×4, 4×8, 4×4 등의 가변적인 크기로 부호화 및 복호화 할 수 있다.
또한, 매크로블록을 서브 블록으로 분할한 뒤 서브 블록 내에서 예측 서브 블록으로 다시 분할할 수도 있다. 예를 들어 크기가 64×64 매크로블록을 32×32 서브 블록 4개로 분할한 후, 32×32, 16×16, 16×4, 4×16, 8×8, 8×2, 2×8, 4×4, 4×1, 1×4 등의 임의의 예측 서브 블록 크기로 부호화 및 복호화 할 수 있다.
매크로블록 또는 분할된 서브 블록의 한 변의 길이가 8화소 보다 큰 경우에는 정방형의 예측 서브 블록 분할을 생략하고 부호화를 수행할 수도 있다. 예를 들어, 매크로블록이 64×64 화소 블록인 경우, 매크로블록 레이어(Layer) 0에는 예측 서브 블록인 64×64 예측 서브 블록, 64×32 예측 서브 블록, 32×64 예측 서브 블록이 속하고 매크로블록 레이어 1에는 서브 블록인 32×32 예측 서브 블록, 32×16 예측 서브 블록, 16×32 예측 서브 블록이 속할 수 있다. 매크로블록 레이어 2에는 서브 블록인 16×16 예측 서브 블록, 16×8 예측 서브 블록, 8×16 예측 서브 블록이 속할 수 있다. 매크로블록 레이어 3에는 서브 블록인 8×8 예측 서브 블록, 8×4 예측 서브 블록, 4×8 예측 서브 블록, 4×4 예측 서브 블록이 속할 수 있다.
영상 부호화 장치(100)는 매크로블록을 서브 블록으로 분할하여 부호화했을 경우의 각 서브 블록에 대한 부호화 효율을 계산하고, 가장 부호화 효율이 높은 경우의 서브 블록을 최종적인 인트라 예측 서브 블록 또는 인터 예측 서브 블록으로 결정한다. 부호화 효율은 수학식 1과 같은 율-왜곡 최적화(RDO: Rate-Distortion Optimizaion) 기법에 근거하여 측정할 수 있다.
블록 타입 결정시에는 수학식 8을 이용하여 엄격하게 RDcost를 계산하는 것이 바람직하다.
수학식 8
Figure PCTKR2011002762-appb-M000008
수학식 8의 Distortion은 앞의 수학식 4로 나타낼 수 있다.
수학식 8은 전술한 수학식 2보다 정확한 부호화 효율을 계산할 수는 있으나 계산량이 많다는 단점이 있다. 그러므로, 본 발명의 실시예에서는 데이터의 중요도(참조픽처로 사용되는지의 여부 등) 또는 부호화하고자 하는 모드에 따라 수학식 2 또는 수학식 8을 선택하여 사용하는 것이 바람직하다.
이하에서는 본 발명의 제2 실시예에 따른 부호화 방법과 그를 통해 생성되는 부호화 데이터를 픽처 타입에 따라 설명한다. 도 1의 영상 부호화 장치(100)를 참조하면서 본 실시예에 따른 부호화 방법이 설명된다. 그러나, 도 1의 영상 부호화 장치(100)의 각 구성요소 중 일부는 제1실시예에서와 다른 동작을 수행한다는 점은 아래 기술 자체에서 명확하게 이해될 수 있을 것이다.
예측기(110)의 인트라 예측기(112)는 현재 부호화하고자 하는 블록(이하 '현재 블록'이라 칭함)의 주변 화소를 이용하여 참조 블록을 생성하고 참조 블록과 현재 블록을 비교하여 인트라 예측 모드를 결정한다. 여기서, 주변 화소란 현재 블록과 인접한 화소들을 의미하고, 넓게는 현재 블록 주위에 있는 블록 내에 있는 화소들을 말한다. 또한, 인접한 화소들을 이용하여 산출된 화소도 포함하는 개념이다.
인트라 예측기(112)에서는 현재 분할된 인트라 예측 서브 블록마다 1 개씩 인트라 예측 모드를 선택하고, 선택된 예측 방향을 이용하여 현재 블록을 인트라 예측 부호화한다. 인트라 예측에 사용하는 예측 모드의 개수는 예측 서브 블록의 크기에 따라 다를 수 있고 주변 화소의 존재 유무에 따라 다를 수 있다. 본 실시예에서는 4×4와 8×8 예측 서브 블록의 경우 9개의 예측 모드를 사용하고, 16×16 예측 서브 블록의 경우 4개의 예측 모드를 사용한다.
선택된 현재 블록의 예측 방향과 현재 블록의 왼쪽 블록과 위쪽 블록 중 더 작은 예측 모드 번호를 가지는 블록의 예측 방향을 비교하여 작은 예측 모드 번호를 예측 모드로 사용하고, 예측 모드와 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시될 수 있음)를 부호화한다. 예를 들어, 예측 모드로 왼쪽 블록과 위쪽 블록 모드 두 가지를 사용하고, 이 두 가지 모드 중 한개라도 현재 블록의 예측 모드와 동일한 경우 예측 모드 플래그로 예측 모드와 동일함을 부호화 하고, 왼쪽 블록의 예측 모드와 동일한지 위쪽 블록의 예측 모드와 동일한지 나타내는 예측 모드 인덱스를 부호화한다.
만약, 두 개의 예측 모드(위쪽과 왼쪽 블록의 예측 모드)를 사용하고 두 예측모드와 현재 예측모드가 다른 경우 두 가지 예측 모드를 뺀 나머지 예측 모드 중 어떠한 예측 모드가 현재 블록의 예측 모드인지 나타내기 위한 예측 모드 정보, 즉 예측 모드 인덱스를 부호화 할 수도 있다. 그리고 두 개의 예측 모드 중 작은 예측 모드 번호를 사용하는 예측 모드 번호를 제외한 나머지 예측 모드 중 어떠한 예측 모드가 현재 블록의 예측 모드인지에 대한 정보인 예측 모드 번호를 부호화 할 수도 있다. 본 발명에 따른 영상 부호화장치와 영상 복호화장치는 상기 동작을 동일하게 수행한다.
색차 성분의 인트라 예측은 휘도 성분의 예측 모드와 독립적인 평균치 예측, 수평 예측, 수직 예측, 또는 휘도 성분을 이용하여 휘도 성분의 인트라 예측 모드를 따르는 모드, 휘도 성분의 픽셀 특성을 이용한 예측 모드 등의 예측 모드들을 사용할 수 있다. 바람직하게는, 색차 성분의 인트라 예측은 (N/2)×(N/2) 화소 블록 단위, 즉 휘도 성분의 매크로블록 크기 N×N의 가로 세로로 절반 크기로 수행할 수 있다. 색차 신호는 U, V의 두 종류가 있지만 예측 방법은 서로 같다. 색차 신호의 예측 모드도 휘도 성분과 동일하게 예측 모드를 위쪽과 왼쪽 블록의 예측 모드를 이용하여 예측 하여 부호화 할 수도 있다. 또는 예측 모드를 예측하지 않고, 예측 모드의 확률에 따라 정해진 테이블로 부호화 할 수 있다.
도 47은 본 발명의 실시예에 따른 색차 성분의 예측 모드 테이블을 나타낸다.
전술한 바와 같이 결정되는 인트라 예측 모드에 따라, 인트라 예측기(112)는 현재 블록을 예측하여 예측 서브 블록을 생성하고, 감산기(120)는 현재 블록과 예측 서브 블록을 감산하여 잔여 블록(Residual Block)을 생성한다. 변환기 및 양자화기(130)는 잔여 블록을 변환 및 양자화하여 양자화된 변환 계수를 생성하고, 부호화기(140)는 양자화된 변환 계수를 엔트로피 부호화하여 부호화 데이터를 생성한다.
도 48은 인트라 예측 모드에 따른 변환의 종류를 예시한 도면이다.
변환기 및 양자화기(130)에서 변환 타입은 현재 블록의 인트라 예측 모드에 따라 변환 종류를 선택할 수도 있다. 예를 들어, 도 48을 참조하면 현재 블록이 수직 예측인 경우 DCT를 수행하고, 수평 예측인 경우 DST를 수행할 수 있다.
도 49는 현재 블록의 인트라 예측 모드에 따라 가로 변환과 세로 변환의 종류에 따른 변환의 종류를 예시한 도면이다.
또는, 현재 블록의 인트라 예측 모드에 따라 가로 변환과 세로 변환의 종류를 선택할 수도 있다. 예를 들어, 도 49를 참조하면 현재 블록이 수직 예측인 경우, 가로 변환은 DST를 수행하고 세로 변환은 DCT를 수행할 수 있다.
색차 성분도 휘도 성분과 독립적으로 색차 성분의 인트라 예측 모드에 따라 변환 종류를 선택할 수도 있고, 휘도 성분의 변환 종류를 따를 수도 있다.
P-픽처 또는 P-슬라이스의 경우, 모든 블록이 움직임 추정을 통해 부호화 될 수 있다. 또는 블록 타입과 블록의 위치에 따라 움직임 추정을 하지 않을 수도 있다. 예를 들어, 32×32 크기의 매크로블록 내에서 16×32 크기의 예측 서브 블록으로 부호화 하는 경우, 첫번째 블록은 움직임 추정을 하지 않고 이미 부호화된 블록들, 즉 주변에 인접한 블록 또는 Colocated (가장 가까운 참조 픽처에서 현재 블록의 위치와 동일한 위치) 블록의 움직임 정보(예측 방향, 움직임 벡터, 참조 픽처 등)를 그대로 이용할 수도 있다. 이러한 경우, 주변에 인접한 블록의 움직임 정보의 후보를 정하고 그 후보들 중 어느 정보를 이용했는지 부호화한다.
B-픽처 또는 B-슬라이스의 경우, 블록마다 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 부르며, 이 두 장의 참조 픽처는 서로 다른 역할을 한다. 보통은 L0 예측(List 0 Prediction, 주로 순방향 예측에 사용됨)이 순방향 예측, L1 예측(List 1 Prediction, 주로 역방향 예측에 사용됨)이 역방향 예측으로 사용된다. 또한, 전술한 P 픽처의 설명과 동일하게 부호화할 수 있다.
움직임 벡터는 부호화기(140)에 의해 부호화되어 부호화 데이터에 포함되는데, 부호화기(140)는 현재 블록의 주변 블록의 움직임 벡터들과 Colocated 블록(동일위치 블록)의 움직임 벡터들을 이용하여 예측 움직임 벡터(PMV: Predicted Motion Vector)로 이용하고 예측 움직임 벡터와 현재 블록의 움직임 벡터의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)와 예측 움직임 벡터 정보를 부호화하여 움직임 정보 데이터를 생성한다. 이때, 부호화기(140)는 차분 움직임 벡터뿐만 아니라 참조 픽처 인덱스(Reference Picture Index)를 추가로 부호화할 수 있다. 즉, 움직임 정보는 차분 움직임 벡터와 참조 픽처 인덱스, 예측 움직임 벡터 정보를 포함할 수 있으며, 부호화기(140)는 움직임 정보를 부호화하여 움직임 정보 데이터를 생성하고 움직임 정보 데이터를 부호화 데이터에 포함시킬 수 있다.
도 50은 본 발명의 제2 실시예에 따라 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
도 50은 현재 블록이 64×64 예측 서브 블록으로 부호화 할 때, 현재 블록의 예측 움직임 벡터를 결정하기 위해 이용되는 주변 블록과 Colocated 블록을 나타내었다. T는 현재 블록을 포함하는 픽처의 순서이고, T-1은 현재 픽처 이전에 부호화한 픽처를 나타낸다. 주변 블록을 그룹 A와 그룹 B, 그룹 C으로 나누어 각 그룹마다 대표 움직임 벡터를 결정하여 대표 움직임 벡터 3개 중 현재 블록의 예측 움직임 벡터를 결정한다. 이 경우 대표 움직임 벡터 결정은 임의의 방법에 의해 할 수 있다. 예를 들어, 그룹 A의 경우에는 A0부터 Aj까지, 현재 블록의 예측 방향과 참조 픽처가 동일한 블록의 움직임 벡터를 대표 움직임 벡터로 결정할 수 있다. 만일, 현재 블록의 예측 방향과 참조 픽처가 동일한 움직임 벡터가 없는 경우 (0,0)을 대표 움직임 벡터로 결정할 수도 있다.
또는 그룹별로 대표 움직임 벡터를 설정하는 방법을 달리 할 수 있다. 예를 들어, 그룹 C의 경우에는 C0부터 대표 움직임 벡터를 찾지 않고, Colocated 블록의 가운데에서 왼쪽 위부터 시계 방향 또는 반시계 방향으로 현재 블록의 예측 방향과 참조 픽처가 동일한 움직임 벡터를 대표 움직임 벡터로 결정할 수 있다.
또는 그룹별로 특정 위치의 움직임 벡터를 대표 움직임 벡터로 설정할 수 있다. 예를 들어, 그룹 B 의 경우 B0의 위치를 대표 움직임 벡터로 설정하고, 그룹 A는 Aj의 위치를 대표 움직임 벡터로 설정하고, 그룹 C는 Ck의 위치를 대표 움직임 벡터로 설정할 수 있다.
이 때, 대표 움직임 벡터를 설정하는 임의의 방법은 본 실시예에 따른 부호화기와 복호화기에 의해 동일하게 수행된다.
도 51은 각 블록 그룹의 대표 움직임벡터에 대한 부호화시의 할당코드를 예시한 도면이다.
또한 대표 움직임 벡터를 설정한 후, 임의의 방법으로 각 대표 움직임 벡터의 중요도를 결정하여 현재 블록의 예측 움직임 벡터로 선택된 대표 움직임 벡터의 번호를 부호화한다. 예를 들어, 그룹 A의 대표 움직임 벡터는 현재 블록의 예측 방향과 참조 픽처가 동일한 움직임 벡터가 존재하지 않아 (0,0)으로 설정되고, 그룹 B의 대표 움직임 벡터는 현재 움직임 벡터의 예측 방향과 참조 픽처가 동일한 B0의 움직임 벡터가 대표 움직임 벡터가 되고, 그룹 C의 대표 움직임 벡터는 Ck의 위치를 대표 움직임 벡터로 고정한 경우, 각 대표 움직임 벡터의 중요도는 다음과 같다. 현재 블록의 예측 방향과 참조 픽처가 동일한 블록에서 대표 움직임 벡터를 결정한 그룹 B, 대표 움직임 벡터의 위치가 고정된 그룹 C, 대표 움직임 벡터를 (0,0)으로 결정한 그룹 A의 순으로 각 대표 움직임 벡터의 번호를 도 51을 참조하여 부호화한다.
각 대표 움직임 벡터 중 동일한 움직임 벡터는 하나만 남겨둔다. 예를 들어 그룹 B와 C의 대표 움직임 벡터가 동일한 경우, 그룹 B와 A의 대표 움직임 벡터 중 현재 블록의 예측 움직임 벡터로 선택된 대표 움직임 벡터 정보를 부호화 한다. 이는 영상 부호화장치와 영상 복호화장치가 동일하게 동작한다.
또한 본 발명의 일 실시예에서는 현재 블록의 움직임 정보, 즉 예측 방향, 움직임 벡터, 참조 픽처 등의 정보로서 주변 블록 또는 동일 위치 블록(colocated block)의 움직임 정보 또는 제로 벡터를 사용할 수도 있으며(이를 예측 움직임 정보 후보군이라 한다.), 이를 일괄 모드라고 한다. 이때, 제로 벡터는 움직임 벡터가 (0, 0)이고, 예측 방향은 list 0, 참조 픽처 인덱스는 0인 기본 움직임 정보를 의미한다. 일괄 모드의 경우 영상 부호화장치는 움직임 추정 과정을 거치지 않는다. 그리고 예측 움직임 정보 후보군은 예측 움직임 벡터 후보군과 동일할 수도 있고, 다를 수도 있다. 예를 들어, 도 52를 참조하면 주변 블록 A, B, D와 동일 위치 블록 C와 제로 벡터 중에서 현재 블록의 움직임 정보를 선택할 수 있다. 이 때, 제로 벡터의 경우 예측 방향은 list 0 뿐만 아니라 list 1 또는 양방향 예측 중 한개로 고정하고, 참조 픽처의 경우 현재 픽처와 가장 가까운 픽처로 고정할 수 있다. 또한, 예측 움직임 정보 후보군 중 선택된 예측 움직임 정보 후보군을 도 53을 참조하여 부호화한다. 만일, 움직임 정보가 모두 동일한 경우 예측 움직임 정보 후보군에서 한 개만 남겨두고 제거할 수도 있다.
또한, 일괄 모드는 현재 블록의 크기와 위치에 따라 사용할 수도 있고 사용하지 않을 수도 있다. 예를 들어, 도 54의 N/2×N/4 블록의 경우 첫번째 블록은 주변 블록의 움직임 정보를 사용하고, 두번째 블록은 움직임 추정을 통해 움직임 정보를 결정할 수도 있다. 또는, 움직임 추정을 하여 얻어진 움직임 정보와 주변 움직임 정보를 사용하여 부호화하는 경우 둘 중 수학식 1을 통해 비용(cost)이 최소가 되는 경우의 움직임 정보가 최종적으로 선택된다. 이 경우 주변 움직임 정보를 사용하였는지 또는 움직임 추정을 이용하였는지를 나타내는 일괄 모드 플래그를 부호화하고, 주변 움직임 정보를 사용한 경우 예측 움직임 정보 후보군 중 예측 움직임 정보를 부호화한다. 이 때, 첫번째 블록은 항상 일괄 모드를 사용하므로 일괄 모드 플래그를 부호화 하지 않고, 예측 움직임 정보 인덱스를 부호화 한다. 그리고 두번째 블록은 일괄 모드를 사용하였는지 사용하지 않았는지 일괄 모드 플래그를 부호화 하고, 움직임 정보(예측 방향, 차분 움직임 벡터, 참조 픽처 인덱스 등)를 부호화 한다. 또는, 4×4 블록의 경우, 오른쪽 밑에 블록은 일괄 모드를 사용하지 않고, 움직임 추정을 통해서만 움직임 정보를 결정할 수도 있다. 이러한 경우 영상 부호화장치와 영상 복호화장치는 동일하게 동작한다.
또한, 본 발명의 일 실시예에서는, 매크로블록과 서브 블록에 대하여 SKIP 모드를 사용한다. 매크로블록이나 서브 블록이 SKIP 블록인 경우에는 움직임 정보를 임의의 지정하여 움직임 추정 및 보상을 수행한다.
예를 들어, 예측 방향과 참조 픽처는 양방향 예측과 각 예측 방향의 첫번째 참조 픽처로 고정하고, 움직임 벡터는 예측 움직임 벡터로 움직임 추정 및 보상을 수행한다. 예측 움직임 벡터는 도 50과 도 51을 참조하여 각 예측 방향마다 예측 움직임 벡터 정보를 부호화 한다.
또는, 도 52와 도 53을 참조하여 현재 SKIP 블록의 움직임 정보를 예측 움직임 정보를 이용하여 부호화 할 수도 있다. 이러한 경우, 예측 움직임 정보의 예측 방향과 참조 픽처를 사용하거나, 임의의 예측 방향과 임의의 참조 픽처로 고정할 수 있다.
다시 도 1을 참조하면, 부호화기(140)에서는 각 블록마다 선택된 변환의 종류를 식별하기 위한 변환 서브 블록 분할 플래그를 생성하고 부호화하여 변환 타입 데이터를 생성한다. 변환 타입 데이터는 부호화 데이터에 포함된다. 또한 사용 가능한 변환 타입은 헤더에 부호화할 수 있으며 변환 타입은 예측 서브 블록의 크기와 독립적으로 매크로블록 또는 서브 블록에 따라 결정될 수도 있고, 예측 서브 블록의 예측 모드에(인터 예측, 인트라 예측) 따라 결정될 수도 있다.
예를 들어, 현재 매크로블록의 크기가 64×64이고 서브 블록으로 분할되지 않고 인터 예측 서브 블록의 크기가 64×32인 경우, 현재 사용 가능한 변환 타입은 32×32, 16×16, 8×8 변환이다. 또는 현재 매크로블록의 크기가 64×64 이고 16×16 크기의 서브 블록으로 분할되고 인터 예측 서브 블록의 크기가 4×4 인 경우, 현재 사용 가능한 변환 타입은 16×16, 8×8, 4×4 변환이다. 이러한 경우 매크로블록 단위 또는 서브 블록 단위로 변환 서브 블록 분할 플래그를 부호화 한다. 이는 인터 예측 부호화뿐만 아니라 인트라 예측 부호화도 가능하다.
도 55는 본 발명의 일 실시예에 따른 인트라 픽처의 매크로블록과 서브 블록, 예측 서브 블록의 신택스(Syntax)를 나타낸 예시도이다.
여기서 Delta QP는 현재 부호화하는 매크로블록 또는 서브 블록 단위로 적용되는 QP를 영상 복호화 장치에 알리기 위한 정보이다. 구체적으로, Delta QP는 현재 부호화하는 매크로블록 또는 서브 블록 단위로 적용되는 QP와 헤더 (슬라이스 헤더, 픽처 헤더, 시퀀스 헤더 등)에 부호화된 QP 간의 차이를 나타낸다. 따라서 영상 복호화 장치는 헤더 (슬라이스 헤더, 픽처 헤더, 시퀀스 헤더 등)에 부호화된 QP와 Delta QP를 더하여 현재 부호화하는 매크로블록 또는 서브 블록 단위로 적용되는 QP를 얻을 수 있다. 또한, Delta QP는 헤더에서 사용 유무를 부호화 할 수 있다. 즉, 헤더 정보가 Delta QP를 사용함을 나타내는 경우, 매크로블록 또는 서브 블록에 Delta QP 값이 부호화 된다.
인트라 픽처의 부호화 데이터는 분할 타입(Partition Type), 인트라 예측 모드(Intra Prediction Mode), 변환 정보 (Transform Type), CBPX_flag/CBP(Coded Block Pattern X-flag/Coded Block Pattern) 및 변환 계수(Transform Coefficient) 등과 같은 필드들로 구성될 수 있다. 영상 부호화 장치(100)의 부호화기(140)는 분할 타입 정보, 인트라 예측 모드, 변환 정보, CBPX_플래그/CBP 및 변환 계수 등을 부호화하여 각 필드에 할당하여 부호화 데이터를 생성한다.
다만, 도 55에서 도시한 인트라 픽처에 대한 부호화 데이터의 신택스는 예시적인 것일 뿐, 인트라 픽처에 대한 부호화 데이터의 신택스가 반드시 도 55에 도시한 바와 같이 구성되어야 하는 것은 아니다. 즉, 인트라 픽처에 대한 부호화 데이터의 신택스 중 일부 또는 전부의 순서가 도 55에 도시한 바와는 다르게 변경될 수도 있으며, 일부의 신택스는 생략될 수도 있음을 인식해야 할 것이다.
도 55에서 분할 타입 필드에는 매크로블록이 서브 블록으로 분할된 정보를 나타내는 각 매크로블록 및 서브 블록의 분할 여부를 나타내는 분할 플래그가 할당될 수 있다.
매크로블록이 도 19와 같이 분할되었을 때, 본 발명의 일 실시예에 따르면 분할 레이어별 분할 타입을 분할 타입 부호화 순서에 따라 순차적으로 부호화하여 매크로블록의 분할 타입 정보를 부호화할 수 있다.
도 19에 도시한 매크로블록이 분할 레이어별로 분할되는 과정을 순차적으로 나타내면 도 20과 같이 나타낼 수 있다. 도 20을 참조하면, 매크로블록 레이어 0(L0)에서, 64×64 화소 서브 블록은 4 개의 32×32 화소 서브 블록으로 분할되며 분할 플래그를 1로 부호화하고, 레이어 1(L1)에서, L1-P0(매크로블록 레이어 1의 파티션 번호 0)의 서브 블록과 L1-P3(매크로블록 레이어 1의 파티션 번호 3)의 서브 블록은 다시 4 개의 16×16 화소 서브 블록으로 분할되고 L1-P0와 L1-P3의 분할 플래그가 1로 부호화하고, L1-P1(매크로블록 레이어 1의 파티션 번호 1)의 서브 블록과 L1-P2(레이어 1의 파티션 번호 2)의 서브 블록은 각각 16×32 화소 예측 서브 블록과 32×16 화소 예측 서브 블록으로 부호화된다. L1-P1과 L1-P2의 서브 블록은 더 이상 분할되지 않으므로 분할 플래그를 0으로 부호화한다. 레이어 2(L2)에서, L2-P0(매크로블록 레이어 2의 파티션 번호 0)의 서브 블록은 다시 4 개의 8×8 화소 서브 블록으로 분할되고 분할 플래그가 1로 부호화한다. L2-P3(매크로블록 레이어 2의 파티션 번호 3)은 2 개의 16×8 화소 예측 서브 블록으로 부호화한다. 다시, 매크로블록 레이어 3(L3)에서, L3-P0(매크로블록 레이어 3의 파티션 번호 0)의 서브 블록과 L3-P1(매크로블록 레이어 3의 파티션 번호 1)의 서브 블록은 각각 4 개의 4×4 화소 예측 서브 블록으로 예측하고, 분할 플래그를 0으로 부호화한다.
매크로블록이 도 22와 같이 분할되었을 때, 매크로블록의 각 서브 블록에 대한 부호화 순서대로 도 55를 참조하여 각 서브 블록의 신택스를 부호화한다.
인트라 예측의 경우 주변 블록으로부터 추정한 예측 모드들 중 현재 블록의 예측 모드와 동일한 예측 모드가 있는지 없는지 여부를 나타내는 예측 모드 플래그가 부호화된다. 추정한 예측 모드와 현재 블록의 예측 모드가 동일한 경우 예측 모드 플래그의 값은 1이 되고, 추정한 예측 모드들 중 어느 것이 현재 블록의 예측 모드인지를 나타내는 정보가 부호화된다. 또한, 예측 모드 플래그가 현재 부호화 대상인 블록의 예측 모드들과 주변 블록으로부터 추정한 현재 블록의 예측 모드가 동일하지 않는 경우에는 현재 블록의 예측 모드와 주변 블록으로부터 추정한 현재 블록의 예측 모드가 동일하지 않음을 나타내는 예측 모드 플래그와 해당 서브 블록의 크기에 따른 여러 가지 인트라 예측 방향 중에서 주변 블록으로부터 추정한 현재 블록의 예측 모드를 제외한 나머지 예측 모드 중에서 어떠한 예측 모드인지를 나타내는 예측 모드 번호가 현재 블록의 인트라 예측 모드로서 부호화되어 인트라 예측 모드 데이터가 생성된다.
인트라 예측 부호화할 때, 변환 타입을 고려한 부호화된 블록 패턴 플래그(CBP_flag: Coded Block Pattern flag, 이하 'CBP 플래그'라 칭함)를 부호화하여, CBP 플래그에 할당할 수 있다. CBP 플래그와 CBP 필드에 할당되는 CBP 데이터는 변환 서브 블록 크기에 따라 변환 블록마다 0이 아닌 양자화된 변환 계수를 포함하는지 여부를 나타낸다.
도 56은 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터의 신택스 구조를 나타낸 예시도이다.
이 때 블록 타입은 해당 매크로블록 또는 서브 블록이 인터 블록인지 인트라 블록인지를 나타낸다.
도 56에서는 입력 영상이 인터 픽처인 경우에 대해 본 발명의 일 실시예에 따라 부호화하여 생성되는 부호화 데이터의 신택스 구조를 예시적으로 나타내었다. 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터는 도시한 바와 같이, 분할 플래그, SKIP 플래그, Delta QP, 블록 타입 중 하나 이상의 필드를 포함하며, 매크로블록 또는 서브 블록이 인트라 매크로블록인 경우에는 인트라 예측 모드, 변환 정보/CBP 플래그 및 변환 계수 중 하나 이상의 필드를 추가로 포함하며, 매크로블록 또는 서브 블록이 인터 매크로블록인 경우에는 예측 움직임 정보 플래그, 예측 움직임 정보, 움직임 정보 (예측 방향, 예측 움직임 벡터, 차분 움직임 벡터, 참조 픽처 인덱스), 변환 정보/CBP 플래그 및 변환 계수 중 하나 이상의 필드를 추가로 포함하여 구성될 수 있다.
다만, 도 56에서 도시한 인터 픽처에 대한 부호화 데이터의 신택스는 예시적인 것일 뿐, 인터 픽처에 대한 부호화 데이터의 신택스가 반드시 도 56에 도시한 바와 같이 구성되어야 하는 것은 아니다. 즉, 인터 픽처에 대한 부호화 데이터의 신택스 중 일부 또는 전부의 순서가 도 56에 도시한 바와는 다르게 변경될 수도 있으며, 일부의 신택스는 생략될 수도 있음을 인식해야 할 것이다.
다시 도 1을 참조하면, 영상 부호화 장치(100)의 부호화기(140)는 현재 부호화 대상인 매크로블록 또는 서브 블록이 SKIP 블록인지 여부를 나타내는 SKIP 플래그를 부호화한다. 예를 들어, 매크로블록이 64×64 화소 블록이면 64×64 화소 매크로블록이 SKIP 블록인지 여부를 나타내는 SKIP 플래그가 부호화되며, 매크로블록이 서브 블록으로 분할된 32×32 화소 블록이면 32×32 화소 서브 블록이 SKIP 블록인지 여부를 나타내는 SKIP 플래그가 부호화된다. 만약, 매크로블록 또는 서브 블록이 SKIP 블록인 경우, 현재 매크로블록 또는 서브 블록은 부호화할 데이터가 없으므로 다음 매크로블록 또는 서브 블록이 부호화된다. 매크로블록 또는 서브 블록이 SKIP 블록이 아닌 경우, 매크로블록 또는 서브 블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 나타내는 매크로블록 타입 플래그를 전송한다. 예를 들어, 현재 부호화하고자 하는 입력 영상이 P 픽처인 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 P-매크로블록이고, 현재 부호화하고자 하는 입력 영상이 B 픽처의 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 B-매크로블록이다. 분할 타입 필드와 인트라 픽처에 대한 인트라 예측 모드, 변환 정보/CBP 플래그, 변환 계수 등의 필드에 대해서는 도 55를 통해 전술하였으므로, 이하에서는 인터 픽처에 대한 SKIP 플래그, 예측 움직임 정보 플래그, 예측 움직임 정보, 움직임 정보 (예측 방향, 예측 움직임 벡터, 차분 움직임 벡터, 참조 픽처 인덱스), 변환 계수 등과 같은 필드에 대해 설명한다.
P-픽처 또는 P-슬라이스의 경우, 도 54의 모든 블록 타입들이 움직임 추정에 사용될 수 있으며, 매크로블록 또는 서브 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수도 있다. 즉, P-픽처 또는 P-슬라이스의 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다. 부호화할 대상이 32×32 화소 블록인 경우, 32×32 화소 블록 단위로 부호화를 수행할지 또는 16×16 화소 블록 단위로 부호화를 수행할지는 분할 플래그를 통해 나타낼 수 있다. 예를 들어, 분할 플래그가 1인 경우에는 32×32 매크로블록이 16×16 서브 블록으로 분할되어 부호화를 수행함을 의미하며, 매크로블록 플래그가 0인 경우에는 32×32 매크로블록 단위로 부호화를 수행함을 의미할 수 있다. 분할 플래그가 1인 경우, 매크로블록은 4개의 16×16 화소블록으로 분할되어 각 16×16 화소블록 단위로 인트라 모드인지 또는 인터 모드인지를 결정할 수 있다. 또한, 각각의 16×16 화소블록 단위는 더 작은 서브 블록으로 분할되어 부호화가 수행될 수 있다.
본 발명의 실시예에 따른 B-픽처에서 사용할 수 있는 부호화 모드로는 인트라 모드, SKIP 모드, L0 예측, L1 예측 및 양방향, 일괄 모드 등이 있다.
인트라 모드는 전술한 인트라 부호화 방법과 동일한 방법을 사용하여 부호화를 수행하며, 매크로블록 단위로 인트라 모드를 선택하거나 서브 블록 단위로 인트라 모드를 선택할 수 있다.
SKIP 모드는 부호화할 현재 블록이 SKIP 모드임을 나타내는 플래그와 예측 움직임 벡터 플래그를 전송한다. 이때, 매크로블록 또는 서브 블록에 대하여 SKIP 모드를 사용할 수 있으며, 예측된 B_pred_dir, 예측 움직임 벡터 MVD, 예측 ref_idx 등을 사용하여 움직임 보상을 수행하고 움직임 보상을 통해 얻은 참조 블록이 복원된 블록이 된다. 여기서, B_pred_dir은 B-픽처의 예측방향으로서, L0 및 L1의 양방향을 의미한다.
L0 예측은 L0의 움직임 정보만을 사용하는 한 방향 예측을 의미하며, L1 예측은 L1의 움직임 정보만을 사용하는 한 방향 예측을 의미한다. 양방향 예측은 L0와 L1의 두 개의 움직임 정보를 사용하여 두 픽처의 평균치를 참조 픽처로 사용하는 예측을 의미한다. B-픽처의 움직임 추정방법으로는 직접예측 모드의 움직임 추정/보상 방법, SKIP 모드의 움직임 추정/보상 방법, 한 방향 예측(L0 예측 또는 L1 예측)의 움직임 추정/보상 방법, 양방향 예측의 움직임 추정/보상 방법 등이 있다.
L0 예측, L1 예측 및 양방향 예측에 대하여, 블록들은 서로 다른 참조영상을 사용할 수 있다.
일괄 모드의 경우, 움직임 추정이 수행되지 않고, 주변 블록이나 이미 부호화된 블록들의 움직임 정보(예측 방향, 움직임 벡터, 참조 픽처 등)가 현재 블록의 움직임 정보로 사용된다. 도 52와 53을 참조하여 앞에서 설명한 바와 동일하므로, 이에 대한 상세한 설명은 생략한다.
본 발명의 일 실시예에 따른 B-픽처의 SKIP 플래그의 부호화 과정은 P-픽처의 SKIP 플래그 부호화 과정과 유사하므로, 그에 대한 상세한 설명은 생략한다. 단, B-픽처의 경우 SKIP 플래그와 L0의 예측 움직임 벡터 플래그, L1의 예측 움직임 벡터 플래그를 부호화 한다.
SKIP 블록이 아닌 매크로블록의 서브 블록들에 대해서는 해당 서브 블록의 예측 서브 블록의 움직임 벡터와 해당 예측 서브 블록의 주변 블록을 이용하여 추정한 예측 움직임 벡터 간의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)와 참조 픽처 인덱스와 예측 방향, 예측 움직임 벡터를 포함하는 움직임 정보가 부호화된다.
변환 타입은 매크로블록 또는 서브 블록의 변환 서브 블록에 따라 결정된다. 변환 서브 블록은 매크로블록 또는 서브 블록 내에서 변환 서브 블록의 사이즈를 나타낸다. 예를 들어, 현재 서브 블록의 크기가 32×32이고, 변환 타입이 32×32, 16×16, 8×8, 4×4가 가능한 경우, 변환 서브 블록 분할 플래그를 통해 변환 타입을 부호화 및 복호화 할 수 있다. 이 때, 현재 서브 블록의 분할 타입이 16×16인 경우 서브 블록 분할 플래그를 1로 부호화하면 16×16 크기의 변환 서브 블록을 나타낸다.
도 57은 매크로블록 내의 변환 정보와 CBP 플래그를 부호화하는 과정의 예시를 나타낸다.
도 57을 참조하면 매크로블록 내의 휘도와 색차 신호를 통합하여 0이 아닌 양자화 변환 계수가 있는지 여부를 확인하고(S5701), 0이 아닌 양자화 변환계수가 없는 경우 휘도와 색차 성분의 CBP 플래그 (0이 아닌 양자화 변환 계수가 없음을 의미하는 플래그)를 부호화한다(S5702). 0이 아닌 양자화 변환 계수가 있는 경우, 변환 서브 블록의 분할 여부를 나타내는 변환 서브 블록 분할 플래그를 부호화 한다(S5703). 변환 서브 블록으로 분할된 경우 다시 각 변환 서브 블록이 다시 분할 되었는지 여부를 확인하고(S5704), 변환 서브블록이 다시 분할된 경우에는 변환 서브블록이 다시 분할되었는지를 나타내는 변환 서브 블록 분할 플래그를 부호화 한다(S5703). 변환 서브 블록으로 분할 되지 않은 경우 변환 변환 서브블록 내 휘도신호에 0이 아닌 양자화 변환 계수가 있는지 여부를 확인하고(S5705), 현재 변환 서브 블록의 휘도 성분에 0이 아닌 양자화 변환 계수의 유무를 나타내는 CBP 플래그를 부호화(S5706, S5707)한 뒤, 색차 성분에 0이 아닌 양자화 변환 계수가 존재하는지 여부를 확인하고(S5708), 색차성분에 0이 아닌 양자화 변환계수의 유무를 나타내는 CBP 플래그를 부호화 한다(S5709, S5710). 이 때, 색차 성분의 CBP 플래그는 Cb, Cr로 나누어 부호화할 수도 있다.
본 발명에 따른 실시예에서는 가변길이 부호화 방법은 전술한 제 1실시예의 상세한 설명과 동일하므로 생략한다.
신택스 별 ctx_inc의 예는 도 35 내지 도 37를 다시 참조하면, 분할 플래그의 부호화/복호화를 위한 ctx_inc의 경우에도 도 37과 유사하게 부호화할 대상 블록의 주변 블록이 매크로블록에서 분할된 서브 블록 단위로 부호화가 수행되었는지(이 경우, 분할 플래그를 이진비트 1로 설정할 수 있다)에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 이와 같이, 픽처 타입, 참조 픽처로 사용되는지의 여부, 이웃 블록들의 데이터에 따라 다른 컨텍스트 테이블을 사용할 수 있다.
이하에서는 본 발명의 제2 실시예에 따른 영상 복호화 방법 및 장치를 설명한다. 도 46의 영상 복호화 장치(4600)를 참조하면서 본 실시예에 따른 복호화 방법 및 장치가 설명된다. 그러나, 도 46의 영상 복호화 장치의 각 구성요소 중 일부는 제1실시예에 따른 복호화 장치의 대응하는 구성요소와 다른 동작을 수행한다는 점은 아래 설명 및 전술한 본 발명의 제2 실시예에 따른 부호화 방법 및 장치의 동작으로부터 명확하게 이해될 수 있을 것이다.
이하에서는 제1 실시예와 상이한 점을 위주로 본 발명의 제2 실시예에 따른 영상 복호화 장치 및 방법을 설명한다.
도 55를 참조하면, 매크로블록 또는 서브 블록 단위로 부호화된 양자화 파라미터에 대한 복호화가 수행될 수 있다.
다만, 도 55에 도시한 영상 부호화 데이터의 신택스의 구조는 예시적인 것일 뿐, 본 발명의 일 실시예에 따른 영상 부호화 데이터의 신택스 구조가 도 55에 도시한 구조로 한정되는 것은 아니다.
여기서, 복호화기(4610)가 인트라 예측 모드를 복원하는 방법은 예측 서브 블록 마다 비트스트림으로부터 추출되는 인트라 예측 모드 데이터 중 1 비트를 복호화하여 예측 모드 플래그를 복원하고, 복원되는 예측 모드 플래그가 해당 예측 서브 블록의 인트라 예측 모드에 따른 예측 방향이 주변 블록으로부터 추정되는 해당 예측 서브 블록의 인트라 예측 모드에 따른 예측 방향과 동일함을 나타내는 경우, 주변 블록으로부터 추정되는 해당 예측 서브 블록의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원하고 다음 예측 서브 블록의 인트라 예측 모드를 복호화하며, 동일하지 않음을 나타내는 경우 인트라 예측 모드 데이터의 다음 3 비트를 복호화하여 복원되는 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원한다. 이와 같이 복원되는 인트라 예측 모드는 예측기(4630)의 인트라 예측기(4632)로 입력된다.
복호화할 픽처가 인터 픽처인 경우 복호화기(4610)가 영상 부호화 데이터 내에서 복호화할 데이터의 종류와 순서는 도 56에 도시한 바와 같다. 즉, 복호화기(4610)는 비트스트림으로부터 추출되는 분할 플래그 데이터를 복호화하여 현재 복호화하고자 하는 매크로블록이 서브 블록으로 분할되었는지 분할 플래그를 복원한다. 그리고 Delta QP를 복호화하여 현재 복호화하고자 하는 매크로블록 또는 서브 블록의 QP를 복원한다. 그 다음 SKIP 플래그 데이터를 복호화하여 현재 복호화하고자 하는 매크로블록 또는 서브 블록이 SKIP 블록인지 여부를 나타내는 SKIP 플래그를 복원한다. 복호화기(4610)는 복원되는 SKIP 플래그에 의해 식별되는 현재 블록이 SKIP 블록이 아닌 경우, 비트스트림으로부터 추출되는 블록 타입 데이터와 예측 움직임 정보 플래그를 복호화하여 현재 복호화하고자 하는 블록이 인터 블록이고, 일괄 모드인지 여부를 복원한다. 만일, 현재 블록이 일괄 모드 인 경우 예측 움직임 정보를 복호화하여 복원하고, 일괄 모드가 아닌 경우 움직임 정보를 복호화하고 복원한다. 그 다음 변환 정보와 변환 정보에 따른 CBP를 복호화하여 복원한다.
복원되는 매크로블록 타입 플래그에 의해 식별되는 매크로블록 타입이 인트라 매크로블록인 경우에는 전술한 바와 동일하며, 매크로블록 타입이 인터 매크로블록인 경우, 복호화기(4610)는 블록들에 대해서만 SKIP 플래그 데이터를 복호화하여 SKIP 플래그를 복원하고 복원되는 SKIP 플래그에 의해 식별되는 SKIP 블록이 아닌 예측 서브 블록들(SKIP이 아님을 의미함)에 대해서 MVD/ref_idx 데이터를 복호화하여 움직임 정보인 움직임 벡터와 참조 픽처 인덱스를 복원한다. 또는 일괄 모드인 경우 예측 움직임 정보를 복원한다. 이와 같이 복원되는 움직임 정보는 인터 예측기(4634, 움직임 보상기로 구현될 수 있음)로 입력되고, 복원되는 CBP 플래그, 변환 타입, 양자화된 변환 계수 등은 복호화하고자 하는 대상 매크로블록 또는 대상 매크로블록의 서브 를록의 잔여 블록을 복원하기 위해 역양자화기 및 역변환기(4620)로 입력된다.
이와 같은 영상 복호화 장치(4600)는 매크로블록이 인터 매크로블록인지 또는 인트라 매크로블록인지 여부에 따라 다음과 같이 구성될 수 있다.
예를 들어, 매크로블록이 인트라 매크로블록인 경우, 복호화기(4610)는 부호화 데이터를 복호화하여 분할 타입 정보, 인트라 예측 모드, 변환 정보, CBP 플래그 및 양자화된 변환 계수를 복원하고, 역양자화기 및 역변환기(4620)는 복원되는 분할 타입 정보에 따라 식별되는 서브 블록의 크기에 따라 선택되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브 블록을 복원하며, 예측기(4630)는 복원되는 분할 타입 정보에 따라 식별되는 서브 블록을 복원되는 인트라 예측 모드를 이용하여 예측하여 예측 서브 블록을 생성하며, 가산기(4640)는 예측 서브 블록과 잔여 서브 블록을 가산하여 서브 블록을 복원한다.
이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.
이상에서 설명한 바와 같이 본 발명의 실시예는, 동영상을 부호화 및 복호화하는 영상 압축 분야에 적용되어, 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하고 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화함으로써, 압축 효율을 향상시킬 수 있는 효과를 발생하는 매우 유용한 발명이다.
CROSS-REFERENCE TO RELATED APPLICATION
본 특허출원은 2010년 04월 16일 한국에 출원한 특허출원번호 제 10-2010-0035310 호 및 2011년 04월 16일 한국에 출원한 특허출원번호 제 10-2011-0035426 호에 대해 미국 특허법 119(a)조(35 U.S.C 119(a))에 따라 우선권을 주장하면, 그 모든 내용은 참고문헌으로 본 특허출원에 병합된다.

Claims (18)

  1. 영상 부호화/복호화 장치에 있어서,
    매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하고, 상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하며, 상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하고, 상기 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하며, 분할된 상기 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 영상 부호화기; 및
    부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하며, 상기 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하고, 상기 복원되는 분할타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 영상 복호화기
    를 포함하는 것을 특징으로 하는 영상 부호화/복호화 장치.
  2. 영상을 부호화하는 장치에 있어서,
    매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 예측기;
    상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 감산기;
    상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 변환 및 양자화기; 및
    상기 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하는 부호화기
    를 포함하며,
    분할된 상기 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 것을 특징으로 하는 영상 부호화 장치.
  3. 제 2항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이상인지의 여부에 따라 부호화 비용을 다르게 선택하여 계산하는 것을 특징으로 하는 영상 부호화 장치.
  4. 제 2항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이하인 경우, 다음의 식에 따라 부호화 비용을 계산하는 것을 특징으로 하는 영상 부호화 장치:
    RDcost=SATD(or SAD)+λ·Bit[block type,prediction info,CBP]
    여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, SAD는 원 영상과 예측영상 간의 차분치에 절대값을 취하여 모두 더한 값이고, SATD는 잔여블록을 변환 수행한 후 그 값에 절대값을 취하여 모두 더한 값이며, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타냄.
  5. 제 2항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우, 다음의 식에 따라 부호화 비용을 계산하는 것을 특징으로 하는 영상 부호화 장치:
    RDcost=Distortion+λ·Bit[block type,prediction info,CBP,coeficient]
    여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, λ는 양자화 파라미터에 의해 결정되는 상수이고, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타냄.
  6. 제 2항에 있어서,
    참조픽처로 사용되는지의 여부에 따라 부호화 비용을 다르게 선택하는 것을 특징으로 하는 영상 부호화 장치.
  7. 제 2항에 있어서,
    상기 영상 부호화 장치는,
    각 서브 블록에 대한 부호화 효율을 계산하는 경우 다음의 식에 따라 부호화 비용을 계산하고, 블록 타입을 결정하는 것을 특징으로 하는 영상 부호화 장치:
    RDcost=Distortion+λㆍBit[block type, prediction info, tranform info, CBP,coeficient]
    여기서 Distortion은 부호화 대상 블록과 복원 블록 사이의 에러(error) 값을 나타내고, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타냄.
  8. 제 2항에 있어서,
    상기 영상 부호화 장치는,
    주변 블록의 움직임 정보, 동일 위치 블록(colocated block)의 움직임 정보 및 제로 벡터를 예측 움직임 정보 후보군으로 포함하는 일괄모드를 사용하여 현재 블록의 움직임 정보를 부호화하는 것을 특징으로 하는 영상 부호화 장치.
  9. 영상을 복호화하는 장치에 있어서,
    부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하는 복호화기;
    상기 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하는 역양자화기 및 역변환기;
    상기 복원되는 분할타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 예측기; 및
    상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 가산기
    를 포함하는 것을 특징으로 하는 영상 복호화 장치.
  10. 제 9항에 있어서,
    상기 영상 복호화 장치는,
    부호화 데이터로부터 예측 움직임정보 플래그를 복호하여 현재 복호화하고자 하는 블록이 일괄 모드인지 여부를 복원하고, 현재 블록이 일괄 모드인 경우에 예측 움직임정보를 복원하고 일괄 모드가 아닌 경우 움직임 정보를 복원하는 것을 특징으로 하는 영상 복호화 장치.
  11. 제 10항에 있어서,
    상기 일괄 모드는,
    주변 블록의 움직임 정보, 동일 위치 블록(colocated block)의 움직임 정보 및 제로 벡터를 예측 움직임 정보 후보군으로 포함하여 현재 블록의 움직임 정보를 복원하는 것을 특징으로 하는 영상 복호화 장치.
  12. 영상 부호화/복호화 방법에 있어서,
    매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하고, 상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하며, 상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하고, 상기 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하며, 분할된 상기 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 영상 부호화 단계; 및
    부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하며, 상기 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하고, 상기 복원되는 분할타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 영상 복호화 단계
    를 포함하는 것을 특징으로 하는 영상 부호화/복호화 방법.
  13. 영상을 부호화하는 방법에 있어서,
    매크로블록이 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 단계;
    상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 단계;
    상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 단계; 및
    상기 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성하는 단계
    를 포함하며,
    분할된 상기 서브블록에 대한 블록타입, 예측 모드, 변환 타입, 움직임 벡터 중 적어도 하나에 대한 부호화 모드를 결정할 경우, 부호화 비용을 선택적으로 계산하여 결정하는 것을 특징으로 하는 영상 부호화 방법.
  14. 제 13항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이상인지의 여부에 따라 부호화 비용을 다르게 선택하여 계산하는 것을 특징으로 하는 영상 부호화 방법.
  15. 제 13항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이하인 경우, 다음의 식에 따라 부호화 비용을 계산하는 것을 특징으로 하는 영상 부호화 방법:
    RDcost=SATD(or SAD)+λ·Bit[block type,prediction info,CBP]
    여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, SAD는 원 영상과 예측영상 간의 차분치에 절대값을 취하여 모두 더한 값이고, SATD는 잔여블록을 변환 수행한 후 그 값에 절대값을 취하여 모두 더한 값이며, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타냄.
  16. 제 13항에 있어서,
    상기 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우, 다음의 식에 따라 부호화 비용을 계산하는 것을 특징으로 하는 영상 부호화 방법:
    RDcost=Distortion+λ·Bit[block type,prediction info,CBP,coeficient]
    여기서, RDcost는 비트율-왜곡 최적화 기법에 의한 부호화 비용이며, λ는 양자화 파라미터에 의해 결정되는 상수이고, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타냄.
  17. 제 13항에 있어서,
    참조픽처로 사용되는지의 여부에 따라 부호화 비용을 다르게 선택하는 것을 특징으로 하는 영상 부호화 방법.
  18. 영상을 복호화하는 방법에 있어서,
    부호화 데이터를 복호화하여 분할타입 정보, 움직임 정보, 변환타입 정보 및 양자화된 변환 계수를 복원하는 단계;
    상기 복원되는 변환타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하는 단계;
    상기 복원되는 분할타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 단계; 및
    상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 단계
    를 포함하는 것을 특징으로 하는 영상 복호화 방법.
PCT/KR2011/002762 2010-04-16 2011-04-18 영상 부호화/복호화 장치 및 방법 Ceased WO2011129672A2 (ko)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US13/641,682 US9686555B2 (en) 2010-04-16 2011-04-18 Video encoding/decoding apparatus and method using motion information candidate group for batch mode
CN201180029878.2A CN102948149B (zh) 2010-04-16 2011-04-18 视频编码/解码设备和方法
US14/743,092 US9912955B2 (en) 2010-04-16 2015-06-18 Video encoding/decoding method using motion information candidate group for batch mode
US15/851,000 US9955167B1 (en) 2010-04-16 2017-12-21 Video encoding/decoding method using motion information candidate group for batch mode

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2010-0035310 2010-04-16
KR20100035310 2010-04-16
KR1020110035426A KR101791078B1 (ko) 2010-04-16 2011-04-16 영상 부호화/복호화 장치 및 방법
KR10-2011-0035426 2011-04-16

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US13/641,682 A-371-Of-International US9686555B2 (en) 2010-04-16 2011-04-18 Video encoding/decoding apparatus and method using motion information candidate group for batch mode
US14/743,092 Continuation US9912955B2 (en) 2010-04-16 2015-06-18 Video encoding/decoding method using motion information candidate group for batch mode

Publications (2)

Publication Number Publication Date
WO2011129672A2 true WO2011129672A2 (ko) 2011-10-20
WO2011129672A3 WO2011129672A3 (ko) 2012-03-01

Family

ID=44799215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2011/002762 Ceased WO2011129672A2 (ko) 2010-04-16 2011-04-18 영상 부호화/복호화 장치 및 방법

Country Status (1)

Country Link
WO (1) WO2011129672A2 (ko)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013102380A1 (en) * 2012-01-03 2013-07-11 Mediatek Inc. Method and apparatus for block-based significance map and significance group flag context selection
KR20160104706A (ko) * 2013-12-30 2016-09-05 구글 인코포레이티드 재귀적 블록 파티셔닝
CN111034199A (zh) * 2017-06-30 2020-04-17 诺基亚通信公司 实时视频
WO2020163837A1 (en) * 2019-02-08 2020-08-13 Beijing Dajia Internet Information Technology Co., Ltd. Methods and devices for selectively applying bi-directional optical flow and decoder-side motion vector refinement for video coding
WO2020171444A1 (ko) * 2019-02-24 2020-08-27 엘지전자 주식회사 Dmvr 기반의 인터 예측 방법 및 장치
CN112637592A (zh) * 2020-12-11 2021-04-09 百果园技术(新加坡)有限公司 一种视频预测编码的方法及装置
CN113574877A (zh) * 2019-03-12 2021-10-29 现代自动车株式会社 用于有效地对残差块编码的方法和装置
CN114363636A (zh) * 2016-07-05 2022-04-15 株式会社Kt 用于处理视频信号的方法和装置
CN115052156A (zh) * 2012-07-02 2022-09-13 韩国电子通信研究院 视频编码/解码方法和非暂时性计算机可读记录介质
CN115314715A (zh) * 2022-08-10 2022-11-08 安徽理工大学 一种基于差分编码与块压缩的可逆信息隐藏方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090129926A (ko) * 2008-06-13 2009-12-17 삼성전자주식회사 영상 부호화 방법 및 그 장치, 영상 복호화 방법 및 그 장치
KR101359496B1 (ko) * 2008-08-06 2014-02-11 에스케이 텔레콤주식회사 부호화 모드 결정 방법 및 장치와 그를 이용한 영상 부호화장치

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013102380A1 (en) * 2012-01-03 2013-07-11 Mediatek Inc. Method and apparatus for block-based significance map and significance group flag context selection
CN104025600A (zh) * 2012-01-03 2014-09-03 联发科技股份有限公司 基于块的重要性图及重要性图群组旗标上下文选择的方法及装置
CN104025600B (zh) * 2012-01-03 2018-05-11 寰发股份有限公司 基于块的重要性图及重要性图群组旗标上下文选择的方法及装置
US10298956B2 (en) 2012-01-03 2019-05-21 Hfi Innovation Inc. Method and apparatus for block-based significance map and significance group flag context selection
US12273538B2 (en) 2012-07-02 2025-04-08 Electronics And Telecommunications Research Institute Method and apparatus for coding/decoding image
CN115052156A (zh) * 2012-07-02 2022-09-13 韩国电子通信研究院 视频编码/解码方法和非暂时性计算机可读记录介质
KR20160104706A (ko) * 2013-12-30 2016-09-05 구글 인코포레이티드 재귀적 블록 파티셔닝
CN114363636B (zh) * 2016-07-05 2024-06-04 株式会社Kt 用于处理视频信号的方法和装置
CN114363636A (zh) * 2016-07-05 2022-04-15 株式会社Kt 用于处理视频信号的方法和装置
CN111034199A (zh) * 2017-06-30 2020-04-17 诺基亚通信公司 实时视频
CN114286101A (zh) * 2019-02-08 2022-04-05 北京达佳互联信息技术有限公司 一种视频编解码方法及设备
CN113965746A (zh) * 2019-02-08 2022-01-21 北京达佳互联信息技术有限公司 选择性地应用双向光流和解码器侧运动矢量细化来进行视频编解码的方法和设备
US12407815B2 (en) 2019-02-08 2025-09-02 Beijing Dajia Internet Information Technology Co., Ltd. Methods and devices for selectively applying bi-directional optical flow and decoder-side motion vector refinement for video coding
WO2020163837A1 (en) * 2019-02-08 2020-08-13 Beijing Dajia Internet Information Technology Co., Ltd. Methods and devices for selectively applying bi-directional optical flow and decoder-side motion vector refinement for video coding
US12155818B2 (en) 2019-02-08 2024-11-26 Beijing Dajia Internet Information Technology Co., Ltd. Methods and devices for selectively applying bi-directional optical flow and decoder-side motion vector refinement for video coding
US12108030B2 (en) 2019-02-08 2024-10-01 Beijing Dajia Internet Information Technology Co., Ltd. Methods and devices for selectively applying bi-directional optical flow and decoder-side motion vector refinement for video coding
US12003735B2 (en) 2019-02-24 2024-06-04 Lg Electronics Inc. DMVR-based inter-prediction method and device
CN113574891B (zh) * 2019-02-24 2024-03-22 Lg 电子株式会社 基于dmvr的帧间预测方法和设备
US11627323B2 (en) 2019-02-24 2023-04-11 Lg Electronics Inc. DMVR-based inter-prediction method and device
WO2020171444A1 (ko) * 2019-02-24 2020-08-27 엘지전자 주식회사 Dmvr 기반의 인터 예측 방법 및 장치
CN113574891A (zh) * 2019-02-24 2021-10-29 Lg 电子株式会社 基于dmvr的帧间预测方法和设备
CN113574877A (zh) * 2019-03-12 2021-10-29 现代自动车株式会社 用于有效地对残差块编码的方法和装置
CN112637592B (zh) * 2020-12-11 2024-07-05 百果园技术(新加坡)有限公司 一种视频预测编码的方法及装置
CN112637592A (zh) * 2020-12-11 2021-04-09 百果园技术(新加坡)有限公司 一种视频预测编码的方法及装置
US12581057B2 (en) 2020-12-11 2026-03-17 Bigo Technology Pte. Ltd. Video predictive coding method and apparatus
CN115314715B (zh) * 2022-08-10 2024-05-03 安徽理工大学 一种基于差分编码与块压缩的可逆信息隐藏方法
CN115314715A (zh) * 2022-08-10 2022-11-08 安徽理工大学 一种基于差分编码与块压缩的可逆信息隐藏方法

Also Published As

Publication number Publication date
WO2011129672A3 (ko) 2012-03-01

Similar Documents

Publication Publication Date Title
WO2019182385A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019083334A1 (ko) 비대칭 서브 블록 기반 영상 부호화/복호화 방법 및 장치
WO2020076143A1 (ko) 다중 가정 예측을 사용하는 비디오 신호 처리 방법 및 장치
WO2019172705A1 (ko) 샘플 필터링을 이용한 영상 부호화/복호화 방법 및 장치
WO2018030773A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2018097692A2 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2018066867A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020076116A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2018097693A2 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2017204532A1 (ko) 영상 부호화/복호화 방법 및 이를 위한 기록 매체
WO2011129672A2 (ko) 영상 부호화/복호화 장치 및 방법
WO2018016823A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2011040794A2 (ko) 가변 크기의 매크로블록을 이용한 영상 부호화/복호화 방법 및 장치
WO2018030599A1 (ko) 인트라 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
WO2017018664A1 (ko) 인트라 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
WO2020096428A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020096427A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020005035A1 (ko) 처리율 향상을 위한 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2011040795A2 (ko) 분할 레이어를 이용한 영상 부호화/복호화 방법 및 장치
WO2020171681A1 (ko) 인트라 예측 기반 비디오 신호 처리 방법 및 장치
WO2018101700A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020032531A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2020004978A1 (ko) 비디오 신호 처리 방법 및 장치
WO2021107532A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2015133838A1 (ko) 폴리곤 유닛 기반 영상 인코딩/디코딩 방법 및 이를 위한 장치

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180029878.2

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11769138

Country of ref document: EP

Kind code of ref document: A2

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 13641682

Country of ref document: US

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04/02/2013)

122 Ep: pct application non-entry in european phase

Ref document number: 11769138

Country of ref document: EP

Kind code of ref document: A2