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

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

Info

Publication number
WO2011129673A2
WO2011129673A2 PCT/KR2011/002763 KR2011002763W WO2011129673A2 WO 2011129673 A2 WO2011129673 A2 WO 2011129673A2 KR 2011002763 W KR2011002763 W KR 2011002763W WO 2011129673 A2 WO2011129673 A2 WO 2011129673A2
Authority
WO
WIPO (PCT)
Prior art keywords
block
subblock
encoded
prediction
transform
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/002763
Other languages
English (en)
French (fr)
Other versions
WO2011129673A3 (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 KR1020110035425A external-priority patent/KR101791242B1/ko
Application filed by SK Telecom Co Ltd filed Critical SK Telecom Co Ltd
Priority to US13/641,677 priority Critical patent/US10250881B2/en
Priority to CN201180029771.8A priority patent/CN102939756B/zh
Publication of WO2011129673A2 publication Critical patent/WO2011129673A2/ko
Publication of WO2011129673A3 publication Critical patent/WO2011129673A3/ko
Anticipated expiration legal-status Critical
Priority to US14/668,501 priority patent/US9451270B2/en
Priority to US15/231,315 priority patent/US9743085B2/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree 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 size, 8x8 size, and 4x4 size, 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.
  • a prediction subblock is generated by predicting a divided subblock using a macroblock, and the remaining subblock is subtracted from the subblock and the prediction subblock Generate quantized transform coefficients by transforming and quantizing a residual subblock using a transform selected according to the size of the subblock, and using CABAC (Context-Adaptive Binary Arithmetic Coding)
  • CABAC Context-Adaptive Binary Arithmetic Coding
  • Inverse quantization and inverse transformation of the quantized transform coefficients are performed using the transform identified by to recover the residual subblock, and the predicted subblock is predicted by using the reconstructed motion information. And reconstruct the subblock by adding the prediction subblock and the remaining subblock, and reconstruct the macroblock based on the reconstructed subblock.
  • An image encoding apparatus for achieving the above object includes a predictor for predicting a subblock divided by using a macroblock 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 encoding the quantized transform coefficients using the CABAC, and generating an encoded image data using a context table different according to the used macroblock and the divided subblock.
  • the encoder may calculate and change the probability of generating the binary signal of the current block to be encoded according to the situation of the neighboring block.
  • the encoder sets a plurality of context tables in accordance with the probability of generating a binary signal of the current block to be encoded, and encodes image data using different context tables among the plurality of context tables according to the current block and neighboring blocks. Can be generated.
  • the encoder may generate the encoded image data by selecting a context table based on at least one of a picture type, a type of syntax, and a value corresponding to a neighboring block when encoding the syntax.
  • the encoder may use another context table for skipX_flag depending on whether the upper block and the left block of the current block to be encoded are both SKIP modes or not, or which one is the SKIP mode.
  • the encoder may use another context table for interX_flag depending on whether the upper block and the left block of the current block to be encoded are inter mode, intra mode, or which is inter mode.
  • the inter mode may use another context table for interX_flag depending on whether intra mode and inter mode are mixed and only inter mode exists. have.
  • the encoder may use another context table for directX_flag depending on whether the upper block and the left block of the current block to be encoded are in direct mode or not, or which one is in direct mode.
  • the encoder may determine a different context for extended_mb_flag depending on whether encoding is performed in units of extended macroblocks in which both the upper block and the left block of the current block to be encoded are performed. You can use a table.
  • the encoder may use another context table for B_pdir depending on whether both the upper block and the left block of the current block to be encoded are used as reference blocks or whether one is used as a reference block.
  • the encoder may use another context table for B_pdir depending on whether the upper block or the left block of the current block to be encoded is L0 prediction, L1 prediction, or bidirectional prediction.
  • the context table for the transform type is preferably different depending on the types of transform types available for the current block to be encoded.
  • An image decoding apparatus for achieving the above object, by using the CABAC to decode the encoded data using a different context table according to the macroblocks and the divided subblocks by splitting type information, motion information
  • a decoder for reconstructing the transform type information and the quantized transform coefficients
  • An inverse quantizer and an inverse transformer that inverse quantizes and inverse transforms quantized transform coefficients using a transform identified by the transformed type information to be recovered to recover a residual subblock
  • a predictor for predicting a subblock identified according to the reconstructed partition type information using the reconstructed motion information to generate a predicted subblock;
  • an adder for reconstructing the subblock by adding the prediction subblock and the remaining subblock, and reconstructing the macroblock based on the reconstructed subblock.
  • the decoder may restore the encoded data based on a context table in which the occurrence probability of the binary signal is set differently according to the upper block and the left block of the current block to be restored.
  • an image encoding / decoding method generates a prediction subblock by predicting a divided subblock using a macroblock, and subtracts the subblock and the prediction subblock.
  • the macro used when generating a subblock, transforming and quantizing the remaining subblocks using a transform selected according to the size of the subblock, and generating quantized transform coefficients, and encoding the quantized transform coefficients using CABAC.
  • Inverse quantization and inverse transformation of the quantized transform coefficients are performed using the transform identified by to recover the residual subblock, and the predicted subblock is predicted by using the reconstructed motion information. Generating a second sub-block by adding the prediction subblock and the remaining subblock, and reconstructing the macroblock based on the reconstructed subblock.
  • a method of encoding an image comprising: generating a predicted subblock by predicting a divided subblock using a macroblock; Generating a residual subblock by subtracting the subblock and the prediction subblock; Transforming and quantizing the remaining subblocks using a transform selected according to the size of the subblock to generate quantized transform coefficients; And when the quantized transform coefficients are encoded using CABAC, generating encoded image data using a different context table according to the used macroblock and the divided subblock.
  • the occurrence probability of the binary signal of the current block to be encoded may be calculated and changed according to the situation of the neighboring block.
  • the image data generating step sets a plurality of context tables in accordance with the probability of generating a binary signal of the current block to be encoded, and encodes using different context tables among the plurality of context tables according to the situation of the current block and neighboring blocks. Generated image data can be generated.
  • the encoded image data may be generated by selecting a context table based on at least one of a picture type, a type of syntax, and a value corresponding to a neighboring block when encoding syntax.
  • the image data generating step may use another context table for skipX_flag depending on whether the upper block and the left block of the current block to be encoded are both SKIP modes or not, or which one is the SKIP mode.
  • the image data generating step may use a different context table for interX_flag depending on whether the upper block and the left block of the current block to be encoded are inter mode, intra mode, or which is inter mode.
  • the image data generating step may include a different context for interX_flag depending on whether the intra mode and the inter mode are mixed and the inter mode exists only when the upper block or the left block is larger than the 16x16 pixel block. You can use a table.
  • the image data generation step may use different context tables for directX_flag depending on whether the upper block and the left block of the current block to be encoded are in direct mode or not, or which one is in direct mode.
  • the image data generating step may include extended_mb_flag depending on whether encoding is performed in units of macroblocks in which both the upper block and the left block of the current block to be encoded are extended, or which is encoded in units of extended macroblocks. You can use a different context table for this.
  • the image data generating step may use a different context table for B_pdir depending on whether the upper block and the left block of the current block to be encoded are used as reference blocks, or which one is used as a reference block.
  • the image data generating step may use another context table for B_pdir depending on whether the upper block or the left block of the current block to be encoded is L0 prediction, L1 prediction, or bidirectional prediction.
  • context table for the transform type may vary depending on the types of transform types available for the current block to be encoded.
  • a video decoding method uses CABAC to decode coded data using different context tables according to macroblocks and divided subblocks, and thus, partition type information and motion information. Restoring the transform type information and the quantized transform coefficients; Inverse quantizing and inverse transforming the quantized transform coefficients using the 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 remaining subblock, and reconstructing the macroblock based on the reconstructed 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.
  • 47 is an exemplary diagram illustrating intra prediction at a boundary of an image, a boundary of a slice, and the like.
  • 48 is a diagram illustrating an example of a plane mode.
  • FIG. 49 is an exemplary diagram illustrating a coding sequence of a macroblock and a subblock of an intra picture according to an embodiment of the present invention.
  • 50 is another exemplary diagram illustrating a coding sequence of a macroblock and a subblock of an intra picture according to an embodiment of the present invention.
  • 51 is an exemplary diagram illustrating a transform coefficient encoding procedure of a transform subblock according to an embodiment of the present invention.
  • FIG. 52 is an exemplary diagram illustrating an encoding sequence of an inter macroblock and a subblock of an inter picture according to an embodiment of the present invention.
  • 53 is an exemplary diagram for ctx_inc of a batch mode flag.
  • 54 is an exemplary diagram for ctx_inc of the differential motion vector x component.
  • 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 executed in real time or in real time through a wired or wireless communication network such as the Internet, a local area wireless communication network, a wireless LAN network, a WiBro network, a mobile communication network, a wired telephone network, or the like.
  • 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 may be input to the image encoding apparatus 100 of FIG. 1 on a frame basis or a field basis, or may be divided into macroblocks having NxN pixels (where N is an integer of 16 or more) and 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 having integers larger than 16 to improve image compression efficiency.
  • a macroblock consisting of integers with N greater than 16 is called an extended macroback (EMB).
  • EMB extended macroback
  • the extended macroblock may be formed of a square pixel block having a size of 64x64, 32x32, or the like.
  • 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. .
  • 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 the 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 a 4: 2: 0 format image, the macroblock includes a luminance block having NxN 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.
  • division into a pixel block having a rectangular shape such as 32x64, 64x32, 16x32, or 32x16 is omitted as shown in FIG.
  • encoding may be performed in units of 16 ⁇ 16 pixel blocks. 4 and 5 exemplarily show each subblock having a 4 ⁇ 4 minimum block size for the extended macroblock.
  • the macroblock layer 0 of FIG. 4 belongs to a subblock of 64x64 pixel blocks, 64x32 pixel blocks, 32x64 pixel blocks, and 32x32 pixel blocks. 1 may belong to a 32x32 pixel block, a 32x16 pixel block, a 16x32 pixel block, and a 16x16 pixel block, which are subblocks.
  • the division of rectangular subblocks such as 64x32 pixel blocks, 32x64 pixel blocks, 32x16 pixel blocks, and 16x32 pixel blocks may be omitted for subblocks larger than 16x16 pixel blocks.
  • 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. Can be. That is, as shown in FIG. 5, the subblocks of the macroblock layer 1 may be used only when the 64x64 subblock of the macroblock layer 0 is divided into four subblocks, and the 32x32 subblocks of the macroblock layer 1 have four subblocks. Subblocks of the macroblock layer 2 may be used only when divided into 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 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 the pixel block of 16x16 or larger size of the B picture are performed according to Equation 3 according to each prediction direction.
  • 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 mode that a 16x16 pixelblock may have is a 16x16 block using a 16x16 SKIP mode, a 16x16 Direct mode, or a L0 prediction mode (for example, There may be motion information and residual data), 16x16 block using L1 prediction mode (e.g. there may be motion information and residual data), 16x16 block using both L0 and L1 prediction mode (e.g. , Motion information and residual data), 16x16 intra blocks, and the like. It is preferable to use a precise encoding cost for encoding modes of pixel blocks of 16 ⁇ 16 or more.
  • the block type has a size of 16x16 or more, it is mainly because of the flat area such as the background, so it is difficult to determine the optimum mode by the approximated equation. Therefore, when using blocks of 16x16 or more, the coding cost is selectively used according to the block size and mode when determining the mode in 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 image decoding apparatus to be described later may extract or restore information about a picture type from a picture header or a sequence header and decode the same.
  • 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.
  • FIG. 7 illustrates nine prediction directions and prediction mode numbers according to the intra prediction mode of the luminance component.
  • the mean value of prediction mode 2 is a method of predicting all 4x4 pixels of the current block by obtaining an average value of a total of eight adjacent pixels of four adjacent pixels of the left block of the current block and four adjacent pixels of the upper block of the current block. .
  • 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 directions 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 which refer 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 only to 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 of 8x8 pixel units for the luminance component is illustrated in FIG. 7 as in the intra prediction of 4x4 pixels.
  • the same nine prediction directions are used, and the method of calculating the prediction pixels is the same as that of intra prediction coding in units of 4x4 pixels except for differences in block sizes (4x4 pixels and 8x8 pixels).
  • a prediction direction having the best coding efficiency is selected from four prediction directions as shown in FIG. According to the prediction direction, a 16x16 pixel block is predictively encoded from 16 neighboring pixels in a 16x16 pixel block located above a 16x16 current block and 16 neighboring pixels in a 16x16 pixel block located to the left of the current block. .
  • 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 an 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 has three prediction directions and predictions as shown in FIG. 9. Can be represented by the mode number.
  • the size of the subblock is mxn, and it is selected from three prediction directions as shown in FIG.
  • An mxn 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 highest coding efficiency.
  • 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. Since the number of prediction modes that an mxn pixel block can have is 0 to 2, when the prediction mode number of the current block predicted using the left block and the upper block of the current block is 3 or more, the prediction direction of the current block is the prediction mode number. 2 (DC mode) can be used. For example, when the prediction mode number of the current block predicted from the neighboring block is 4, a prediction mode flag (eg, 1 bit) indicating whether the prediction mode number of the current block is the same as the prediction direction of the current block selected. Coded).
  • a prediction mode flag eg, 1 bit
  • the intra prediction for the extended macroblock is a pixel block unit of 16x16 or less, that is, a 4x4 pixel block, an 8x8 pixel block, a 16x16 pixel block, or an mxn (where m ⁇ n and m and n are less than 16) pixels. It is preferable to perform block by block.
  • 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 predictive value calculation method for predicting the mean value is also the same as the intra prediction encoding method in units of 16x16 pixels of the luminance component except for the difference in block size (16x16 pixels and 8x8 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 4x4 pixel units in the same manner as described above with reference to FIGS. 7 to 10, such as predictive encoding and rate-distortion optimization.
  • Intra prediction mode which is determined by the method, predicts the current block with 9 prediction directions for 8x8 pixel units, and intra prediction mode, which is determined in the same way as predictive encoding and rate-distortion optimization, with 4 prediction directions for 16x16 pixel units.
  • Intra prediction mode that is determined by predicting the current block in the same manner as the predictive encoding high-distortion optimization, and predicted by the predictive encoding high rate-distortion optimization by predicting the current block in three prediction directions for mxn pixel units.
  • Intra prediction mode is one intra prediction mode that is determined by using rate-distortion optimization. Determine as prediction mode.
  • 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 in luminance components is selected, and the current block in which intra prediction in units of 8x8, 8x16 and 16x8 pixels is selected.
  • An 8x8 transform may be performed on the residual block of.
  • the converter and the quantizer 130 may perform 16x16 transform on the residual block of the current block in which intra prediction of 16x16 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 16x16 pixels to which each 16x16 transform is performed (hereinafter, referred to as a 16x16 pixel residual block) is further divided into a residual block having 16 4x4 pixels (hereinafter referred to as a 4x4 pixel residual block).
  • 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 each 4x4 pixel generated by 4x4 pixel residual block 4x4 transform are collected to have a 4x4 transform coefficient (hereinafter, 'DC'). Component block '), and the 4x4 transform is performed once more.
  • a transform different from the transform when the residual block is transformed may be used to transform the DC component block. That is, a 4x4 Discrete Cosine Transform (DCT) is performed on the 4x4 pixel residual block, and a 4x4 Hadamard transform may be used on the DC component block.
  • DCT Discrete Cosine Transform
  • a 4x4 Hadamard transform may be used on the DC component block.
  • a 16x32 pixel residual block for the current block in which intra prediction is selected in units of 16x32 pixels is divided into two 16x16 pixel residual blocks, and 4x4 conversion is performed in 4x4 pixel units for each of the divided 16x16 pixel residual blocks.
  • DC components of the 4x4 transform blocks in the 16x16 pixel residual block are gathered 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 (16x16 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 64x64 pixels according to an embodiment of the present invention.
  • 4x4 transform is performed for blocks 0 through 7 and 8x8 for blocks 8 through 12
  • the transform is performed, and for blocks 13 to 18, a 4x4 transform is performed in 4x4 pixel units within a 16x16 pixel block, and the transform is again performed on a DC component block including DC components of each of the 4x4 transform blocks within each 16x16 pixel block. Is performed.
  • 4x4 transform is performed as in the case of intra prediction of 16x16 pixel unit or more, and then 4x4 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 4x4 transform is performed on four 4x4 pixel residual blocks in each 8x8 pixel residual block.
  • DC components of four 4x4 transform blocks in an 8x8 pixel residual block are gathered to form a DC component block having a 2x2 transform coefficient, and 2x2 transform is performed on the DC component block.
  • the 4x4 transform for the 8x8 pixel residual block and the 2x2 transform for the DC component block may be different.
  • a transform type having good efficiency according to the size of the sub-block used for intra prediction in units of 16x16 pixel blocks instead of performing a transform according to the above-described transform type after the optimal block type is determined for the extended macroblock, a transform type having good efficiency according to the size of the sub-block used for intra prediction in units of 16x16 pixel blocks.
  • 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 in a 16x16 pixel block.
  • a 16x16 pixel block is divided into 8x8 pixel blocks and one or more 8x8 pixel blocks of four 8x8 pixel blocks are divided into subblocks smaller than 8x8 pixels
  • 4x4 conversion is performed on the 16x16 pixel block. Only can be used, in which case the transform type is not encoded.
  • a 4x4 transform and an 8x8 transform are performed on the 16x16 pixel block to select a transform having a low encoding cost, and a transform type (for example, a type of a transform selected) , May be represented by 1 bit).
  • a 4x4 transform, an 8x8 transform, and an 8x16 transform are performed on the remaining blocks of the 16x16 pixel subblock to select the type of the transform having the lowest encoding cost.
  • the 4x4 transform, the 8x8 transform, and the 16x8 transform are performed on the remaining blocks of the 16x16 pixel subblock to select the type of transform having the least encoding cost.
  • a transformation type (for example, may be represented by 1 bit or 2 bits) indicating the type may be encoded.
  • 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, an intra mode or an inter mode may be selected 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 32x32 pixel block
  • whether to perform encoding in units of 32x32 pixel blocks or encoding in units of 16x16 pixel blocks may be indicated through an extended macroblock flag (extended_mb_flga).
  • extended macroblock flag is 1, encoding may be performed in units of 32x32 pixel blocks, and when the extended macroblock flag is 0, encoding may be performed in units of 16x16 pixel blocks.
  • the extended macroblock flag is 0, the extended macroblock may be divided into four 16x16 pixelblocks to determine whether it is an intra mode or an inter mode for each 16x16 pixelblock.
  • 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 64x64 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.
  • 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.
  • block B uses block B and the lower neighboring block uses block A to determine the predicted motion vector.
  • the SKIP mode is used for a macroblock that is a pixel block of 16x16 or more.
  • the macroblock which is a 16x16 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 which is a 32x32 pixel block, spans the padded image and the padded region in multiples of 16 pixels as shown in FIG. 2, if the extended macroblock is in the SKIP mode, as shown in FIG. Similarly, a predictive motion vector is obtained using the left block and the upper block of an actual image block (16x16 pixel block), and motion prediction and compensation are performed on the actual image block using the predicted motion vector. If 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 in a 16x16 pixel block.
  • 16x16 pixel subblocks are divided into 8x8 pixel blocks and 16x16 pixels when one or more 8x8 pixel subblocks of four 8x8 pixel subblocks are divided into subblocks smaller than 8x8 pixels. Only 4x4 transforms may be used for the remaining blocks of the subblock, in which case the transform type is not encoded.
  • a 16x16 pixel subblock is divided into four 8x8 pixel subblocks, a 4x4 transform and an 8x8 transform are performed on the remaining blocks of the 16x16 pixel subblock to select a transform having a low encoding cost, and a transform type indicating the type of the selected transform. (E.g., represented by 1 bit) is encoded.
  • the 4x4 transform, the 8x8 transform, and the 8x16 transform are performed on the remaining blocks of the 16x16 pixel subblock to select the type of transform having the lowest encoding cost.
  • the 4x4 transform, the 8x8 transform, and the 16x8 transform are performed on the remaining blocks of the 16x16 pixel subblock, and the type of transform having the lowest encoding cost is selected.
  • a transform type (which may be represented by 1 bit or 2 bits, for example) is encoded.
  • a subblock of 16x16 pixels or more For a subblock of 16x16 pixels or more, 4x4 transform, 8x8 transform, and 16x16 transform are performed, and the transform having the lowest encoding cost is selected, and a transform type (for example, represented by 1 bit or 2 bits) indicating the type of the selected transform is encoded. do.
  • a transform type for example, represented by 1 bit or 2 bits
  • encoding bits used for transform type encoding may be configured as shown in Table 1 below.
  • the encoding bit used for transform type encoding is It 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 64x64 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 not encoded.
  • the second 16x16 pixel block 1520 is divided into four 8x8 pixel subblocks, one of the 4x4 transform or the 8x8 transform having the lowest encoding cost is selected, and a transform type indicating the type of the selected transform is encoded.
  • the third 16x16 pixel block 1530 is divided into two 8x16 pixel subblocks, one of the 4x4 transform, the 8x8 transform, or the 8x16 transform has a smaller encoding cost, and a transform type indicating the type of the selected transform is encoded.
  • the fourth 16x16 pixel block 1540 is divided into two 16x8 pixel subblocks, one of the 4x4 transform, the 8x8 transform, or the 16x8 transform having the smallest encoding cost is selected, and a transform type indicating the type of the selected transform is encoded.
  • the fifth 16x32 pixel block (1550), the sixth 16x32 pixel block (1560), the seventh 32x32 pixel block (1570), and the eighth 32x32 pixel block (1580) are all larger than the 16x16 pixel block, so they are either 4x4 transform, 8x8 transform, or 16x16.
  • a transform type indicating the type of the selected transform is encoded.
  • a 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 inverse 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 deblocking filtering in 16x16 pixel blocks using 4x4 transform, 8x8 transform, 8x16 transform, 16x8 transform, and 16x16 transform, respectively.
  • 16x16 pixel blocks using the 4x4 transform shown in 16A are deblocked filtered at the block boundaries on the left and top of each 4x4 pixel block, and 16x16 pixel blocks using the 8x8 transform shown in 16B are used to the left and top of each 8x8 block.
  • Deblocking filtering is performed at the block boundary of the 16x16 pixel block using the 8x16 transform shown in 16C, and deblocking filtering is performed at the left and top block boundaries of each 8x16 pixel block, and the 16x8 transform shown in 16D is used.
  • 16x16 pixel blocks are deblocked filtered at the left and top block boundaries of each 16x8 pixel block, and 16x16 pixel blocks using the 16x16 transform shown in 16E are deblocked filtered at the left and top block boundaries of the 16x16 pixel block. Is performed.
  • 17 is an exemplary diagram illustrating syntax of an intra picture according to an embodiment of the present invention.
  • the image encoding apparatus 100 may be configured in the image decoding apparatus. Since the type information of the divided sub-blocks must be transmitted, the encoded data of the intra picture includes a partition type, an intra prediction mode, a coded block pattern X-flag / coded block pattern, and a CBPX_flag / CBP. It may consist of fields such as 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.
  • encoding for the CBPX_flag is omitted.
  • the increase / decrease information ⁇ pq for the quantization parameter may be encoded.
  • the increase / decrease information on the quantization parameter may be encoded in extended macroblock units, and the CBP information may be encoded in units of 16 ⁇ 16 pixel blocks.
  • 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 partition type number is assigned to the N / 2 K x N / 2 K pixel blocks of the macroblock layer K.
  • FIG. 0 is assigned.
  • N / 2 K x N / 2 K pixel block in macroblock layer K is divided into two N / 2 K x N / 2 K + 1 pixel blocks, N / 2 K x N / 2 in macroblock layer K
  • the division type number 1 is assigned to the K pixel block.
  • N / 2 K x N / 2 K pixel block of macroblock layer K is divided into two N / 2 K + 1 x N / 2 K pixel blocks, N / 2 K x N / 2 of macroblock layer K
  • the division type number 2 is assigned to the K pixel block. If N / 2 K x N / 2 K pixel blocks of macroblock layer K are divided into four N / 2 K + 1 x N / 2 K + 1 , N / 2 K x N / 2 of macroblock layer K
  • the division type number 3 is assigned to the K pixel block.
  • numbers such as 0, 1, 2, 3, and the like indicated in the divided subblocks in the N / 2 K ⁇ N / 2K pixel blocks of each macroblock layer K indicate a partition number for identifying each subblock. )to be.
  • 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, when a 32x32 pixel block is divided into four 16x16 pixel blocks by partition type number 3, each 16x16 pixel block may be divided into smaller subblocks using the partition type-specific number of FIG.
  • a partition type number of the upper pixel block that is, a partition type number different from the partition type number of the 32x32 pixel block may be used.
  • the subblocks for example, 64x32 pixel blocks, 32x64 pixel blocks, 16x32 pixel blocks, 32x16 pixel blocks, etc.
  • Encoding of the type number 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 64x64 pixel block and the maximum number of divided 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 64x64 pixel subblock is divided into four 32x32 pixel subblocks, and in layer 1 (L1), L1-P0 (partition number 0 of macroblock layer 1).
  • the subblock of L1-P3 is further divided into four 16x16 pixel subblocks, and the subblock of L1-P1 (partition number 1 of macroblock layer 1) and L1-
  • the subblocks of P2 (partition number 2 of layer 1) are divided into 16x32 pixel subblocks and 32x16 pixel subblocks, respectively.
  • 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 8x8 pixel subblocks and L2-P3 (partition number 3 of macroblock layer 2) is It is divided into 16x8 pixel subblocks.
  • L3 macroblock layer 3
  • 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 4x4 pixels. It is divided into subblocks.
  • the L1-P1 blocks and the L1-P2 blocks are respectively divided into L1-P3 blocks instead of being divided into 16x32 pixel subblocks and 32x16 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 partition type 3 is encoded and The four 8x8 pixel blocks (L3-P0, L3-P1, L3-P2, L3-P3) in the 16x16 pixel subblocks L2-P0 are no longer divided into small subblocks, so the partition type number ⁇ 3, 3, 0 and 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.
  • partition type numbers of the subblocks in the macroblock layer 3 are all encoded, the partition type numbers of the second 16x16 pixel subblock L2-P1 and the third 16x16 pixel subblock L2-P2 of the macroblock layer 2 are encoded. Since both are no longer divided into small blocks, 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 32x32 pixel subblocks L1-P1 of the layer 1 are encoded, and the second 32x32 pixel subblocks L1-P1 of the layer 1 are encoded.
  • the partition type number 2 is encoded.
  • the third 32x32 pixel subblock L1-P2 of macroblock layer 1 the fourth 32x32 pixel subblock L1-P3 of macroblock layer 1, and the four 16x16 pixel subblocks L2- below it.
  • the division type numbers of 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. 19.
  • 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.
  • a 32x32 pixel block corresponding to a 15th block and a 16th block, or a 17th block and an 18th block may be a 16x32 pixel block or a 32x16 pixel block.
  • encoding may be performed by dividing into four 16x16 pixel block units as in 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, and the prediction mode If the prediction direction of the block whose flag is the current encoding target and the prediction direction of the current block estimated from the neighboring block are not the same, the prediction mode indicating 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.
  • the prediction mode of the current block predicted using the left block and the upper block of the current block. If the number 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 an 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 64x64 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 64x64 pixels, and thus the neighboring block on the left side.
  • the prediction mode number of 0 is 0 (vertical mode)
  • the upper neighboring block of the current macroblock is intra predicted in units of 64x64 pixels
  • the prediction mode number of the left neighboring block is 1 (horizontal mode).
  • 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 side and the upper neighboring block 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 indicating that the prediction direction of the corresponding subblock and the prediction direction of the corresponding subblock estimated from the neighboring block are not the same.
  • the mode flag and prediction mode number 2 which is the prediction mode number of the subblock, are encoded as an intra prediction mode of the subblock. Since 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, the prediction direction of the corresponding subblock and the prediction direction of the corresponding subblock estimated from the neighboring block are the same. 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 prediction of the corresponding subblock estimated from the neighboring block is performed. Since the mode number is 0, the prediction direction of the subblock estimated from the neighboring block and the prediction direction of the corresponding subblock are the same, so that only the prediction mode flag indicating the same prediction direction is encoded as the intra prediction mode of the subblock. In the case of 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.
  • a rectangular block such as a 15th block and a 16th block or a 17th block and an 18th block may be used for a subblock larger than the 16x16 pixel block. Pixel block division 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.
  • Mode data is assigned to the intra prediction mode field.
  • 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.
  • the encoding of the block pattern flag is omitted and the increase / decrease information ( ⁇ pq) for the quantization parameter may be encoded.
  • the increase / decrease information on the quantization parameter may be encoded in the extended macroblock unit, and the CBP data may be encoded in the 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 64x64, 64x32, and 32x64 (S2410), and the size of the subblock is 64x64, 64x32, or 32x64. If not, 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 16x16 pixels, in step S2410, it is determined whether the size of the subblock is a 64x64 pixel block, that is, whether intra prediction coding is performed in units of the extended macroblock. In S2420, when the size of the subblock is not a 64x64 pixel block, it may be determined whether the size of the subblock is a 32x32 pixel block.
  • 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), and the non-zero transform coefficient is If present, the 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), and a 16x16 pixel block in the subblock is encoded.
  • the CBP32 flag for example, may be represented by 1 bit such as '1'
  • CBP is encoded as a unit (S2450), and if there is no non-zero transform coefficient in the subblock, the CBP32 flag indicating that there is no non-zero transform coefficient in the subblock (for example, 1 bit such as '0') It can be encoded (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.
  • the 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, and two 2x2 chrominance component DC blocks for the color difference component. Indicates whether there is a non-zero transform coefficient using 1 bit, and indicates whether there are non-zero transform coefficients in two 8x8 color difference component AC blocks using 1 bit.
  • 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 32x32, 32x16, or 16x32 pixel block, it may be determined whether the size of the subblock is a 16x16, 16x8, or 8x16 pixel block. If the subblock is a 16x16, 16x8, or 8x16 pixel block, if there is a non-zero coding coefficient in the subblock, the CBP16 flag (for example, may be represented by 1 bit such as '1') is encoded. In other cases, 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 64x64, 64x32, and 32x64 or is a 64x64 pixel block, it is determined whether there is a non-zero transform coefficient in the subblock (S2470), and the non-zero transform in the subblock. If there is a coefficient, a CBP64 flag (for example, may be represented by 1 bit such as '1') indicating that there is a non-zero transform coefficient is encoded (S2480), and a non-zero coefficient to be encoded in the subblock is encoded. If none, a CBP64 flag (for example, may be represented by 1 bit such as '0') indicating that there is no coefficient to encode other than 0 (S2490). Here, the CBP64 flag is a flag indicating whether a non-zero quantized transform coefficient exists in a 64x64 pixel block.
  • a CBP64 flag for example, may be represented by 1 bit such as '0'
  • the CBP64 flag and the CBP32 flag may be omitted, and the increase / decrease information ⁇ pq of the quantization parameter may be encoded. can do. 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 16x16 pixel blocks is encoded.
  • the CBP is encoded according to the transform type. If 16x16 transform is used, only the CBP 2-bits of the chrominance component are encoded. If 8x16 or 16x8 transform is used, CBP 2-bit indicating whether two 8x16 or 16x8 pixel blocks within the 16x16 pixel block have a non-zero transform coefficient. Encode 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 nonzero transform coefficient in the first 8x8 pixel block (Y0) of the luminance component, the least significant bit (LSB) of the CBP is zero, and the nonzero quantized transform in the second 8x8 pixel block (Y1). If there is a coefficient, the second least significant bit of the CBP is one. In this way, the CBP for the third 8x8 pixel block (Y2) and the fourth 8x8 pixel block (Y3) are allocated, and nonzero in the two 2x2 chrominance component DC blocks (U (DC) and V (DC)). Since there is a quantized transform coefficient, the bit for chrominance DC is 1, and there are no nonzero quantized transform coefficients in the two 8x8 chrominance component AC blocks (U-AC and V-AC), so Chroma AC Bit is zero.
  • LSB least significant bit
  • 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 64x64 pixel block and a size of a subblock currently being encoded is 64x64, 64x32, or 32x64.
  • 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 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 the 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 an encoding target block is a 32x32 pixel block.
  • 16x16 transform (4x4 transforms of 16 4x4 blocks in 16x16 blocks and 4x4 transforms are performed for 16 DC coefficients. Therefore, the conversion is performed in units of 16x16 pixels. Since 16x16 conversion is performed), four 16x16 transforms are performed in the case of a 32x32 pixel block. In the case of a 32x16 pixel block, two 16x16 transforms are performed for each 32x16 pixel block. In the case of a 16x32 pixel block, two 16x16 transforms are performed for each 16x32 pixel block. In the case of a 16x16 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 is encoded to indicate whether the 64x64 pixel macroblock is a SKIP macroblock
  • the macroblock is a 32x32 pixel block
  • the SKIP32 flag to indicate whether the 32x32 pixel macroblock is a SKIP macroblock.
  • a SKIP16 flag indicating whether 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). For example, when the extended macroblock flag is 1, encoding may be performed in units of 32x32 pixel blocks, and when the extended macroblock flag is 0, encoding may be performed in units of 16x16 pixel blocks.
  • the extended macroblock flag is 0, the extended macroblock may be divided into four 16x16 pixelblocks to determine whether it is an intra mode or an inter mode for each 16x16 pixelblock.
  • 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 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 encoding 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 When extended_mb_flag is 0, this means that the extended macroblock is divided into 16x16 pixel blocks and encoded, and skip16_flag indicating whether each 16x16 pixel block is in SKIP mode for each 16x16 pixel block.
  • the block type and MVD / ref_idx are encoded only for the 16x16 pixel block, not the SKIP mode, for each 16x16 pixel block.
  • skip16_flag can be encoded using Table 5.
  • each syntax may have a different context table.
  • skip32_flag is 0 and inter32_flag is 01 for the extended macroblock, this means that both inter mode and intra mode are used in the extended macroblock.
  • 'extended_mb_flag' is not necessary, and since the extended macroblock is divided into 16x16 pixel blocks and encoded, it can be encoded using Table 7 indicating whether each 16x16 pixel block is intra mode or inter mode. have.
  • each of the 16x16 pixel blocks is mostly an inter mode or all intra modes in each 16x16 pixel block.
  • the case where the sub block of the intra mode and the sub block of the inter mode exist at the same time can be ignored. Therefore, after encoding the division type of each 16x16 pixel block, 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 having a block size of 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 skipX_flag is encoded only for subblocks having a size of 16x16 or more after the split type information of the current block to be encoded is encoded, similarly to the case where the extended macroblock is a 32x32 pixel block. do.
  • X represents the size of a subblock such as 16 or 32.
  • the macroblock is a 64x64 pixel block and is not in the SKIP mode and the size of the subblock of the extended macroblock is one of 64x32, 32x64, and 32x32, skip32_flag is encoded for each subblock.
  • 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 within an extended macroblock 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 may be encoded 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 the extended macroblocks.
  • 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 16x16 pixels or more such as 16x16 pixel blocks and 32x32 pixel blocks, and the motion compensation is performed using the predicted B_pred_dir, the predicted motion vector MVD, the predicted ref_idx, and the reference obtained through the motion compensation.
  • the block becomes a restored 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.).
  • the direct mode is an encoding mode in which motion information is omitted, and the direct mode may be used for blocks of 8x8 pixel blocks or more, such as 8x8, 16x16, 32x32, and the like. Motion estimation and compensation are performed in units of 2 x N / 2 pixel blocks. For example, in the 8x8 direct mode, motion estimation and compensation are performed in units of 4x4 pixel blocks.
  • 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 of the motion vectors mvA, mvB, and mvC of the left, upper, and upper right corners is calculated, and the reference number of the NxN 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 NxN pixel blocks, but the prediction motion vector (mvL0) obtained through the neighboring block is performed.
  • mvL1 or 0 vector is determined by block unit.
  • 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 by using the motion estimation / compensation method of the above-described P-picture for pixel blocks having a size of 8x8 or more in a B-picture having motion information, and L0 reference pictures and mvL1 are performed.
  • L1 prediction is performed.
  • 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 the pixel block having a size of 16x16 or larger, the motion information of the above-described bidirectional prediction modes is found, and then the transform, quantization, and entropy transform coefficient encoding are performed to determine the optimal encoding mode, and the actual coding bits and prediction errors required for the corresponding mode are determined. It is desirable to determine the bidirectional prediction mode using (Distortion).
  • 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 split 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 SKIP16 flag of the 15th 16x32 pixel subblock 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 encoded in order.
  • 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 64x64 pixel block.
  • the encoder 140 of the image encoding apparatus 100 determines whether the size of the subblock of the extended macroblock is one of 64x64, 64x32, and 32x64 (S3302), so that the size of the subblock is 64x64, 64x32, and 32x64. If not, it is determined whether the size of the subblock is one of 32x32, 32x16, and 16x32.
  • step S3304 if the size of the subblock is one of 32x32, 32x16, and 16x32, it is determined whether there is a non-zero quantized transform coefficient in the corresponding subblock (S3306), and the non-zero quantized transform coefficient is determined. If present, the 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).
  • the 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 is any non-zero quantized transform coefficient in the 16x16 pixel block in the subblock (S3310), and if there is a non-zero quantized transform coefficient, 0 in the 16x16 pixel block.
  • the CBP16 flag indicating that there is a quantized transform coefficient 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 16x16 or more, the transform type is encoded for each subblock. If the size of the subblock is smaller than 16x16, one transform flag is encoded for each 16x16. This is because the conversion is selected in units of 16x16 pixels. For example, if a 64x64 pixel macroblock is divided into two 64x32 pixel subblocks and the CBP64 flag is nonzero, two CBP32 flags in each 64x32 pixel subblock encode a transform type for a 64x32 pixel subblock that is not zero. .
  • the transformation type of each subblock is encoded using Table 3.
  • the conversion type is encoded in units of 16x16 pixel blocks using Table 4.
  • the CBP16 flag is not 0 and the 16x16 pixel block is divided into four 8x8 pixel blocks, if 4x4 transform is selected, 0 is encoded as the transform type; if 8x8 transform is selected, 1 is encoded as the transform type; otherwise Do not encode the conversion type.
  • 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 the 16x16 transform, only the CBP 2 bits of the chroma component are encoded (S3320). If the 16x16 transform is not, the transform type is an 8x16 transform. Alternatively, it is determined whether it is a 16x8 transform (S3322), and in the case of an 8x16 transform or a 16x8 transform, the CBP 2 bits of the luma component and the CBP 2 bits of the chrominance component are encoded (S3324), and the 8x16 or 16x8 transform is encoded.
  • the transform type is an 8x8 transform or a 4x4 transform (S3326).
  • the CBP 4 bits of the luminance component and the CBP 2 bits of the chrominance component are encoded (S3328).
  • 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.
  • the size of the subblock is one of 64x64, 64x32, and 32x64 as a result of the determination in step S3302, it is determined whether there is a non-zero quantized transform coefficient in the subblock (S3330), and the non-zero quantized transform. If there is a coefficient, a 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, and if there is no non-zero quantized transform coefficient, it is in the corresponding subblock. The CBP64 flag indicating that there is no non-quantized transform coefficient 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, an example of prediction type of a context table for an extended macroblock that is 32x32 pixel blocks when ctx_inc is 0 to 5 is 16x16 pixels when ctx_inc is 7 to 9
  • An example of a prediction type of a context table for a block is shown.
  • the context table may be used differently according to each ctx_inc.
  • ctx_inc for encoding / decoding of directX_flag is as shown in FIG.
  • 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.
  • ctx_inc for encoding / decoding of extended_flag similarly to FIG. 37, whether encoding is performed in units of macroblocks in which neighboring blocks of the target block to be encoded are extended (in this case, 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.
  • 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.
  • the context table may be selectively used using the context of the neighboring block of the current block to be encoded among the divided subblocks in the macroblock.
  • a neighboring block of the current block to be encoded is in SKIP mode, whether it is a SKIP mode in macroblock units or a SKIP mode in subblock units in a macroblock may be considered. Accordingly, a context table for skipX_flag, interX_flag, extended_mb_flag, etc. for a block to be encoded may be selectively used.
  • 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 16x16 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) represents the position of (0,0) in the extended macroblock to be encoded, that is, the partition type value of the first 16x16 pixel block in the raster scan direction 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.
  • 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 partition type values for the 16x16 pixelblocks shown in 38A into area units including 2x2 partition type values, and assigns the minimum value of the partition type values in each group to the partition type values for the grouped areas.
  • the results are shown. That is, the division type values of the pixel blocks including the 16x16 pixel blocks (0,0), (0,1), (1,0), and (1,1) shown in 38A are grouped and grouped into 2x2 area units. Select and group the minimum value among the partition type values M X (0,0), M X (0,1), M X (1,0), and M X (1,1) of each of the 16x16 pixel blocks included in the included region.
  • 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, and within the grouped area.
  • the process of allocating the partition type values of the 16x16 pixel blocks shown in 38A to the partition type values of the grouped area shown in 38B is performed by M X-2 , M X-3 . Repeatedly performing up to M 1 layer can assign the partition type value of the grouped area as in 36C, and repeating up to M 0 layer again grouped to have the partition type value of one grouped area as in 38D. can do.
  • the division type values for adjacent 16x16 pixel blocks are grouped into 2x2 area units, but the present disclosure is not limited thereto, and 16x16 pixel blocks that are adjacent to each other in various sizes such as 4x2 and 2x4 areas.
  • Subdivision type values may be assigned by grouping the subdivided type values with respect to the subdivided type values, or by grouping the subdivided type values for non-contiguous 16x16 pixel blocks by a predetermined area unit.
  • the allocation of the partition type values of the 16x16 pixel blocks of the block to be encoded as the partition type values of the grouped regions may be represented in 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 it 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 encoded using the aforementioned method.
  • the value of the lowest node is a partition type value of the 16x16 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 32x32 pixel block belongs to a 16-padded image and is divided into 16x16 pixel blocks
  • the encoding of the most significant node is a partition type because the representative value of the most significant node is 0.
  • the binary bit '000' is coded to represent 3, which is the difference between the maximum value 3 and the representative value 0.
  • an extended macroblock of a 32x32 pixel block belongs to an image padded with 16, three 16x16 pixel blocks are divided into 8x8 pixel blocks or less, and one 16x16 pixel block is encoded as a 16x16 pixel block.
  • the binary bit 1 representing the difference between the representative value 3 of the most significant node and the maximum value 3 of the split type is encoded, and the difference between the values of the lower nodes and the upper node is encoded. If the value is 0, the binary bit '1' is encoded. If the difference is 3, the binary bit '000' is encoded.
  • encoding of the intra prediction mode encodes a 1-bit flag indicating whether the intra prediction mode of the 4x4 and 8x8 pixel blocks of the luminance component is the same as the prediction intra mode predicted using the neighboring block, When the prediction intra mode is different, 3 bits are used to indicate which of the eight prediction modes minus the prediction direction among the nine prediction modes.
  • the 16x16 pixel block is represented by using two bits of which of the four prediction modes is used.
  • the intra prediction mode of the remaining mxn pixel blocks except for the 4x4 pixel block, the 8x8 pixel block, and the 16x16 pixel block encodes a 1-bit flag indicating whether the prediction intra mode is the same as that predicted using the neighboring block, and when the intra prediction mode is different from the prediction intra mode. 1 bit is used to indicate which of the two prediction modes except the predicted prediction direction among the three prediction modes.
  • the 16x16 pixel block of the color difference 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, there are two types of selectable transforms, 4x4 transform and 8x8 transform, so that the target syntax includes both the top block and the left block of the current block. In the case of 4x4 transform, all 8x8 transform, or one block is 4x4 transform and the other block is 8x8 transform, the context table may be determined and used 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 pixel block smaller than the 8x8 pixel block is divided into 4x4 pixel blocks, 4x8 pixel blocks, or 8x4 pixel blocks
  • 4x4 transform is performed, and the transform having the smaller encoding cost among the 8x8 pixel block 4x4 transform and the 8x8 transform is performed.
  • the 8x16 pixel block performs the transform with the lowest coding cost during the 4x4 transform, the 8x8 transform, and the 8x16 transform
  • the 16x8 pixel block performs the transform with the lower encoding cost during the 4x4 transform, the 8x8 transform, and the 16x8 transform, and the 16x16 pixel.
  • a block larger than a block performs a transform having a small encoding cost among 4x4 transform, 8x8 transform, and 16x16 transform, as shown in FIG. 44, in the first bit encoding, whether the upper block and the left block of the current block are 4x4 transformed blocks or the left block.
  • Encoding of the transform type according to whether only one of the block and the upper block is a 4x4 transformed block or not all 4x4 transformed blocks You can use different ctx_inc for luxury.
  • ctx_inc for / decoding of a transform type may be different depending on whether at least one of the upper and left blocks of the current block is an 8x8 transformed block. .
  • 46 is a block diagram schematically illustrating an image decoding apparatus according to an embodiment of the present invention.
  • the image decoding apparatus 4400 includes 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.
  • the quantization parameter encoded in the extended macroblock unit may be omitted.
  • Decryption 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 16x16, such as 4x4 or 8x8, the decoder 4610 decodes 1 bit of intra prediction mode data extracted from the bitstream, restores the prediction mode flag, and restores the prediction mode flag.
  • the intra prediction mode of the corresponding subblock estimated from the neighboring block is Reconstruct the intra prediction mode as the intra prediction mode of the current block by reconstructing as the intra prediction mode of the block, decoding the intra prediction mode of the next subblock, and decoding the next 3 bits of the intra prediction mode data if it is not equal. do.
  • 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.
  • the extended macroblock which is a 32x32 pixel block
  • the partition type of the corresponding block may be entropy decoded.
  • a first 16x16 pixel block corresponds to a block belonging to a padded image in an extended macroblock, which is a 32x32 pixel block, and thus entropy-decodes the partition type of the first 16x16 pixel block.
  • the corresponding 16x16 pixel block is divided into two 16x8 pixel blocks, two intra prediction modes are entropy decoded, and one CBP and 16x16 transform coefficients for the 16x16 pixel block are decoded.
  • the 16x16 pixel block is decoded using the subblock type obtained through entropy decoding, an intra prediction mode, and a transform coefficient.
  • 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 32x32 pixel block
  • the extended macroblock is decoded and the extended macroblock to be currently decoded corresponds to a SKIP mode.
  • a prediction 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 32x32 pixel block, corresponds to only the first 16x16 pixel block, and is the first case when the extended macroblock to be decoded and currently decoded skip32_flag is SKIP mode.
  • the prediction 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 may determine a subblock having a size of 16x16 or more. MVD for subblocks (not non-SKIP) that are smaller than 16x16 or subblocks other than the SKIP block identified by the SKIPX flag being recovered by decoding the SKIPX flag data by decoding only the blocks. Decode / ref_idx data to reconstruct the motion vector and the reference picture index which are motion information. In addition, 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.
  • a subquantizer and an inverse transformer are input to the inverse quantizer 4620 to recover the remaining blocks of the lock.
  • the inverse quantizer and inverse transformer 4620 inverse quantizes and inverse transforms the quantized transform coefficients delivered from the decoder 4610 to restore a residual block.
  • the inverse quantizer and 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 predicted block generated by the predictor 4630 and the remaining blocks reconstructed by the inverse quantizer and the 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 inverse quantizer and the inverse transformer 150 are the same as or similar to the operating method, 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 transform 4460.
  • 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 a 4x4 transform if the size of the subblock is one of 4x4, 4x8, and 8x4, and uses an 8x8 transform if the size of the subblock is one of 8x8, 8x16, and 16x8. If the size of the subblock is 16x16 or more, 16x16 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 a 4x4 transform, an 8x8 transform, an 8x16 transform, a 16x8 transform, and a 16x16 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 the CBP data extracted from the encoded data according to the size of the subblock.
  • the CBPX flag may be a flag indicating whether there is a non-zero quantized transform coefficient in the XxX pixel block
  • the CBP may be a flag indicating whether there is a non-zero quantized transform coefficient in the 16x16 pixel block.
  • the second embodiment of the present invention describes CABAC encoding according to syntax and syntax of the prediction subblock and the transform subblock.
  • encoding and decoding are performed using different context tables according to macroblocks, subblocks, prediction subblocks, and transform subblocks.
  • the input image is input to the image encoding apparatus 100 of FIG. 1 on a frame basis or a field basis, or divided into macroblocks having NxN (where N is an integer of 16 or more) pixels. It may be input to the image encoding apparatus 100.
  • the macroblocks described below can be divided into square subblocks.
  • each macroblock and subblocks may be divided into prediction subblocks for prediction.
  • the transform type may be determined according to the transform subblock, which may be obtained by variably dividing the macroblock or subblocks of the macroblock in a manner similar to the prediction subblock.
  • the image may be compressed after padding the input image to be a multiple of N.
  • the video encoding apparatus 100 calculates encoding efficiency for each subblock when the macroblock is divided into subblocks and encoded, and determines a subblock when the highest encoding efficiency is the final intrablock or an interblock. .
  • the coding efficiency can be measured based on Equation 1.
  • the mode of a block may be divided into a process of determining an optimal prediction mode (intra prediction mode, motion data) of each prediction sub-block for all types of possible blocks, and then determining a block type.
  • an optimal prediction mode is determined using Equation 2 to reduce the amount of computation.
  • Equation 8 Distortion of Equation 8 may be represented by Equation 4.
  • the intra predictor 112 of the predictor 110 generates a reference block 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 also includes a pixel calculated using adjacent pixels.
  • FIG. 47 is a diagram illustrating intra prediction at a boundary of an image, a boundary of a slice, and the like.
  • a pixel having no value may be assumed to be 128.
  • the plane mode of the intra prediction mode is encoded by the plane flag.
  • the plane flag is encoded as 1.
  • 48 is a diagram illustrating an example of a plane mode.
  • 48-1 and 48-2 blocks are generated and an average value of the two blocks is used as the prediction pixel.
  • the A pixel is copied downward as shown in the figure, and the remaining pixels are generated according to the position using the copied value and the pixels adjacent to the left side of the current block. For example, when generating the X pixel in the drawing, since the position of the X pixel is (2, 4), the value of the X pixel is calculated by the formula Ax (2/8) + Cx (6/8).
  • a 48-2 block is also generated in a similar manner to the 48-1 block.
  • a flag indicating whether the prediction mode of the current block is the same as the prediction mode of the neighboring intra block is encoded. This is called a prediction mode flag.
  • a prediction mode flag of 1 indicates that the intra prediction mode of the neighboring block is the same as the intra prediction mode of the current block.
  • the prediction mode indication index is encoded. The prediction mode indication index indicates which block's intra mode is the same as the intra mode of the neighboring block.
  • the prediction mode flag is encoded as 0, and the prediction mode of the current block among the remaining prediction modes is excluded except for the prediction modes of the neighboring block among the prediction modes. Encode Or, except for the prediction mode to which a small number of prediction modes of the neighboring blocks are allocated, the prediction mode of the current block is encoded among the remaining prediction modes.
  • Intra prediction of the chrominance component may be performed in units of N / 2 ⁇ N / 2 pixel blocks.
  • the prediction direction may include an average prediction independent of the prediction mode of the luminance component, a horizontal prediction, a vertical prediction, a planar prediction, a mode following the intra prediction mode of the luminance component using the luminance component, a prediction mode using the pixel characteristics of the luminance component, and the like. Prediction mode can be used.
  • the transformer and quantizer 130 determines the transform type in each macroblock or subblock and performs transform and quantization according to the transform type.
  • the transform type means the size and transform type of the transform subblock.
  • the transform type means not only a conventional DCT but also a modified DCT or a discrete sine transform (DST), a karhunen-loeve transform (KLT), and the like.
  • the transform type may be adaptively selected for each transform subblock, macroblock, subblock, or intra prediction mode. Alternatively, the type of transform may be adaptively selected according to the size of the transform subblock.
  • the transform type may be represented by a transform subblock partition flag.
  • the size of the transform subblock is (T / 2) x (T / 2)
  • the transform type is DST
  • the vertical transform is KLT.
  • the CBP flag is encoded and decoded for each macroblock, subblock, or transform subblock.
  • intra mode or inter mode may be selected in units of macroblocks or subblocks. 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 motion estimator 116 of the inter predictor 114 of the predictor 110 finds the block most similar to the current prediction subblock, that is, the reference block, within the reference picture and is related to the reference block relative to the current block.
  • a motion vector (MV) indicating a position is output.
  • Motion estimation produces a motion vector by comparing the predictive subblocks in the macroblock with one or more reference pictures in the picture buffer 180.
  • the motion vector is encoded by the encoder 140 and included in the encoded data.
  • the encoder 140 is co-located with the motion vectors of the neighboring blocks of the current block (ie, the same position as the current block in the reference picture).
  • a motion vector is generated by selecting a predicted motion vector among motion vectors of a block) and encoding only a differential motion vector (DMV) that is a difference vector between the predicted motion vector and the motion vector of the current block.
  • DMV differential motion vector
  • the encoder 140 may further encode not only the differential motion vector but also the predictive motion vector index and the reference picture index.
  • a batch mode is used for a macroblock, a subblock, and a prediction subblock.
  • the batch mode is a mode that uses motion information (prediction direction, motion vector, reference picture) of the neighboring motion block or the same position block as the motion information of the current block. Therefore, in the batch mode, the batch mode flag and the predicted motion information index are encoded.
  • the SKIP mode is used for the macroblock or subblock.
  • motion estimation and compensation are performed using the predicted motion vector.
  • the encoder encodes the SKIP flag and the predicted motion vector index.
  • the motion estimation and compensation of the SKIP mode may be performed using the predicted motion information instead of the predicted motion vector.
  • the SKIP flag and the predicted motion information index are encoded and decoded.
  • the transform method of the inter prediction block is the same as the transform method described in the intra prediction block.
  • FIG. 49 is an exemplary diagram illustrating a coding sequence of a macroblock and a subblock of an intra picture according to an embodiment of the present invention.
  • 50 is another exemplary diagram illustrating a coding flowchart of a macroblock and a subblock of an intra picture according to an embodiment of the present invention.
  • a division flag, a Delta QP, a prediction mode flag, a prediction mode indication index, a prediction mode, a transform subblock division flag, a luminance component CBP flag, and a color difference It consists of component CBP flag and transform coefficients.
  • the syntax flowcharts for the intra pictures shown in FIGS. 49 and 50 are exemplary only. That is, the order of some or all of the syntaxes for the intra picture may be changed, and some syntaxes may be omitted.
  • each syntax is encoded and decoded using CABAC.
  • CABAC is the same as in the other embodiments and will be omitted.
  • Ctx_inc of the split flag, the prediction mode flag, the prediction mode indication index, the plane mode flag, the transform subdivision flag, and the CBP flag in FIGS. 49 and 50 determines ctx_inc of skipX_flag described in the first embodiment with reference to FIG. The detailed description is omitted since it can be determined similarly to the method.
  • 51 is an exemplary diagram illustrating a transform coefficient encoding flowchart of a transform subblock according to an embodiment.
  • a transform coefficient flag a last transform coefficient flag, Abs_value_greater1_flag, Abs_value_greater2_flag, an absolute value (transform coefficient) -3, and a transform coefficient sign (+ or-) are included.
  • the syntax flowchart for the transform coefficients shown in FIG. 51 is merely exemplary. That is, the order of some or all of the syntaxes for the transform coefficients may be changed, and some syntaxes may be omitted.
  • FIG. 52 is an exemplary diagram illustrating an encoding sequence of an inter macroblock and a subblock of an inter picture according to an embodiment of the present invention.
  • the syntax flowchart for the inter macroblock or subblock of the inter picture shown in FIG. 52 is merely exemplary. That is, the order of some or all of the syntax may be changed, and some syntax may be omitted.
  • the prediction subblock type of FIG. 52 indicates whether the current macroblock or the prediction subblock in the subblock is inter prediction or intra prediction. An example is shown here with inter prediction. In the case of intra prediction, the syntax after the prediction subblock type may be similarly encoded with reference to FIGS. 49 and 50.
  • transform coefficient encoding of inter prediction is similarly encoded with reference to FIG. 51, detailed description thereof will be omitted.
  • Each syntax may use CABAC encoding with reference to Equation 7 similarly to the first embodiment of the present invention.
  • ctx_inc for each syntax may be different depending on the surroundings.
  • 53 is an exemplary diagram for ctx_inc of a batch mode flag.
  • the batch mode flag may be CABAC encoded with reference to FIGS. 37 and 53.
  • the differential motion vector may be CABAC encoded with reference to FIG. 54.
  • 54 is an exemplary diagram for ctx_inc of the differential motion vector x component.
  • Ctx_inc of the x component of the differential motion vector is determined as shown in FIG. 54 using the threshold X flag of the neighboring block.
  • the value of the threshold X flag of the neighboring block is determined according to the value of the x component of the differential motion vector of the neighboring block and a preset threshold. For example, assuming that the threshold is 9, the value of the threshold X flag is 1 if the absolute value of the differential motion vector x component is less than the threshold 9 and 0 if it is greater than 9. At this time, the threshold value may be selected by the user.
  • ctx_inc is determined in the same manner as the x component of the differential motion vector.
  • ctx_inc of the syntax may be determined similarly to the detailed description described in the first embodiment, and thus the detailed description is omitted.
  • an embodiment of the present invention divides an extended macroblock into subblocks of various sizes and shapes, and encodes and decodes an image using different prediction units and transformation units according to the size of the divided subblocks. It is a very useful invention that produces the effect of improving the compression efficiency and the recovery efficiency.

Landscapes

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

Abstract

영상 부호화/복호화 장치 및 방법이 개시된다. 본 발명의 실시예에 따른 영상 부호화/복호화 장치는, 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하며, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하고, 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하며, 양자화된 변환 계수를 CABAC(Context-Adaptive Binary Arithmetic Coding)를 이용하여 부호화하는 경우, 사용된 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 영상 부호화기; 및 CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하고, 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하고, 복원된 서브블록에 기초하여 매크로블록을 복원하는 영상 복호화기를 포함하는 것을 특징으로 한다.

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에서는 매크로블록을 더 작은 블록 단위로 분할하여 부호화하지만, 매크로블록의 크기는 고정됨), 고해상도의 영상을 부호화하는 경우에는 효율적인 부호화가 어려운 문제점이 있다.
또한, 영상의 복호화는 영상의 부호화에 대응하여 이루어지기 때문에, 고해상도 영상의 부호화에 대한 압축 효율이 저하된 상태에서는 고효율의 복호화를 기대하기 어렵다는 문제점이 있다.
전술한 문제점을 해결하기 위해 본 발명은, 매크로블록을 다양한 크기로 확장시키고, 확장된 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하며 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화 및 복호화함으로써 압축 효율 및 복원 효율을 향상시키는 데 주된 목적이 있다.
전술한 목적을 달성하기 위해 본 발명은, 영상 부호화/복호화 장치에 있어서, 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하며, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하고, 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하며, 양자화된 변환 계수를 CABAC(Context-Adaptive Binary Arithmetic Coding)를 이용하여 부호화하는 경우, 사용된 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 영상 부호화기; 및 CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하고, 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하고, 복원된 서브블록에 기초하여 매크로블록을 복원하는 영상 복호화기를 포함하는 것을 특징으로 한다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화 장치는, 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 예측기; 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 감산기; 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 변환 및 양자화기; 및 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 사용된 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 부호화기를 포함하는 것을 특징으로 한다.
여기서, 부호화기는, 부호화할 현재블록의 이진신호의 발생확률을 주변블록의 상황에 따라 계산하고 변경할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 이진신호의 발생확률에 대응하여 복수의 컨텍스트 테이블을 설정하고, 현재블록과 주변블록의 상황에 따라 복수의 컨텍스트 테이블 중 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성할 수 있다.
또한, 부호화기는, 픽처 타입, 신택스(syntax)의 종류, 신택스를 부호화할 때 주변블록에 대응하는 값 중의 적어도 하나에 기초하여 컨텍스트 테이블을 선택하여 부호화된 영상 데이터를 생성할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 SKIP 모드인지, 아닌지 또는 어느 하나가 SKIP 모드인지에 따라 skipX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 인터 모드인지, 인트라 모드인지 또는 어느 하나가 인터 모드인지에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 상단 블록 또는 좌측 블록이 16x16 화소블록보다 큰 블록인 경우, 인터 모드는 인트라 모드 및 인터 모드가 혼재하는 경우 및 인터 모드만 존재하는 경우에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 direct 모드인지, 아닌지 또는 어느 하나가 direct 모드인지에 따라 directX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 확장된 매크로블록 단위로 부호화가 수행되었는지, 아닌지 또는 어느 하나가 확장된 매크로블록 단위로 부호화가 수행되었는지에 따라 extended_mb_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 참조블록으로 사용되었는지, 아닌지 또는 어느 하나가 참조블록으로 사용되었는지에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화기는, 부호화할 현재블록의 상단 블록 또는 좌측 블록이 L0 예측, L1 예측 또는 양방향 예측인지의 여부에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화할 현재블록의 상단 블록 및 하단 블록에 따라 MVD/ref_idx, CBPX_flag, 변환 타입 중의 적어도 하나에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 변환 타입에 대한 컨텍스트 테이블은, 부호화할 현재블록의 사용 가능한 변환 타입의 종류에 따라 다른 것이 바람직하다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 복호화 장치는, CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하는 복호화기; 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하는 역 양자화기 및 역 변환기; 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 예측기; 및 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 가산기를 포함하며, 복원된 서브블록에 기초하여 매크로블록을 복원하는 것을 특징으로 한다.
여기서, 복호화기는, 복원할 현재블록의 상단 블록 및 좌측 블록에 따라 이진신호의 발생확률이 다르게 설정된 컨텍스트 테이블에 기초하여 부호화된 데이터를 복원할 수 있다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 부호화/복호화 방법은, 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하며, 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하고, 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하며, 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 사용된 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 단계; 및 CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하며, 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하고, 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하고, 복원된 서브블록에 기초하여 매크로블록을 복원하는 단계를 포함하는 것을 특징으로 한다.
전술한 목적을 달성하기 위한 영상 부호화 방법은, 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 단계; 서브블록과 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 단계; 잔여 서브블록을 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 단계; 및 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 사용된 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 단계를 포함하는 것을 특징으로 한다.
여기서, 영상 데이터 생성단계는, 부호화할 현재블록의 이진신호의 발생확률을 주변블록의 상황에 따라 계산하고 변경할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 이진신호의 발생확률에 대응하여 복수의 컨텍스트 테이블을 설정하고, 현재블록과 주변블록의 상황에 따라 복수의 컨텍스트 테이블 중 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성할 수 있다.
또한, 영상 데이터 생성단계는, 픽처 타입, 신택스(syntax)의 종류, 신택스를 부호화할 때 주변블록에 대응하는 값 중의 적어도 하나에 기초하여 컨텍스트 테이블을 선택하여 부호화된 영상 데이터를 생성할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 SKIP 모드인지, 아닌지 또는 어느 하나가 SKIP 모드인지에 따라 skipX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 인터 모드인지, 인트라 모드인지 또는 어느 하나가 인터 모드인지에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 상단 블록 또는 좌측 블록이 16x16 화소블록보다 큰 블록인 경우, 인터 모드는 인트라 모드 및 인터 모드가 혼재하는 경우, 및 인터 모드만 존재하는 경우에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 direct 모드인지, 아닌지 또는 어느 하나가 direct 모드인지에 따라 directX_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 확장된 매크로블록 단위로 부호화가 수행되었는지, 아닌지 또는 어느 하나가 확장된 매크로블록 단위로 부호화가 수행되었는지에 따라 extended_mb_flag에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 참조블록으로 사용되었는지, 아닌지 또는 어느 하나가 참조블록으로 사용되었는지에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 영상 데이터 생성단계는, 부호화할 현재블록의 상단 블록 또는 좌측 블록이 L0 예측, L1 예측 또는 양방향 예측인지의 여부에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 부호화할 현재블록의 상단 블록 및 하단 블록에 따라 MVD/ref_idx, CBPX_flag, 변환 타입 중의 적어도 하나에 대한 다른 컨텍스트 테이블을 사용할 수 있다.
또한, 변환 타입에 대한 컨텍스트 테이블은, 부호화할 현재블록의 사용 가능한 변환 타입의 종류에 따라 다를 수 있다.
전술한 목적을 달성하기 위한 본 발명의 실시예에 따른 영상 복호화 방법은, CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하는 단계; 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하는 단계; 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 단계; 및 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원하는 단계를 포함하며, 복원된 서브블록에 기초하여 매크로블록을 복원하는 것을 특징으로 한다.
여기서, 복원할 현재블록의 상단 블록 및 좌측 블록에 따라 이진신호의 발생확률이 다르게 설정된 컨텍스트 테이블에 기초하여 부호화된 데이터를 복원하는 것이 바람직하다.
이상에서 설명한 바와 같이 본 발명에 의하면, 확장된 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하고 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화 및 복호화함으로써 압축 효율 및 복원효율을 향상시킬 수 있다.
도 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은 Plane 모드의 예시를 나타낸 도면이다.
도 49는 본 발명의 일 실시예에 따른 인트라 픽처의 매크로블록과 서브 블록의 부호화 순서도를 나타낸 예시도이다.
도 50은 본 발명의 실시예에 따른 인트라 픽처의 매크로블록과 서브블록의 부호화 순서도를 나타낸 또 다른 예시도이다.
도 51은 본 발명의 실시예에 따른 변환 서브 블록의 변환 계수 부호화 순서를 나타낸 예시도이다.
도 52는 본 발명의 실시예에 따른 인터 픽처의 인터 매크로블록과 서브블록의 부호화 순서를 나타낸 예시도이다.
도 53은 일괄 모드 플래그의 ctx_inc를 위한 예시도이다.
도 54는 차분 움직임 벡터 x 컴포넌트의 ctx_inc를 위한 예시도이다.
후술할 본 발명의 일 실시예에 따른 영상 부호화 장치(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)에 입력되거나, NxN(단, N은 16이상의 정수) 화소를 가지는 매크로블록들로 분할되어 영상 부호화 장치(100)에 입력될 수 있다. 즉, 입력 영상이 4Kx2K 영상과 같은 고해상도 영상인 경우, N이 16보다 큰 정수로 이루어진 매크로블록으로 분할하여 부호화를 수행함으로써 영상 압축의 효율 향상을 꾀할 수 있다. 여기서, N이 16보다 큰 정수로 이루어진 매크로블록을 확장된 매크로블록(EMB: Extended Macroback)이라고 명명한다. 예를 들어, 확장된 매크로블록은 64x64, 32x32 등과 같은 크기의 정방형의 화소 블록으로 이루어질 수 있다. 이하에 기재하는 매크로블록은 확장된 매크로블록과, 일반적인 16x16 화소 블록의 매크로블록을 포함하는 개념임에 유의한다.
한편, N이 16보다 큰 정수로 이루어진 확장된 매크로블록을 사용하여 영상 압축을 수행할 때, 입력 영상이 16화소의 배수가 아닌 경우에는 입력 영상에 대해 16화소의 배수가 되도록 패딩한 후 영상 압축을 수행할 수 있다.
도 2는 본 발명의 실시예에 따라 입력되는 영상을 패딩하였을 경우의 영상 부호화 및 복호화를 설명하기 위해 도시한 도면이며, 도 3은 도 2의 현재 부호화할 대상인 확장된 매크로블록을 확대한 도면이다. 16화소의 배수로 패딩이 수행된 입력 영상과 현재 부호화할 대상인 확장된 매크로블록의 위치가 도 2와 같을 경우, 현재의 확장된 매크로블록의 부호화는 16화소의 배수가 되도록 패딩한 입력 이미지 안에 속하는 화소값만을 이용하는 것이 바람직하다. 즉, 도 3에서 현재의 확장된 매크로블록 내의 패딩된 영역은 부호화에 사용하지 않는 것이 바람직하다. 또한, 비트스트림에 부호화하는 데이터도 16화소의 배수가 되도록 패딩한 입력 이미지 안에 속하는 화소값만을 이용하는 것이 바람직하다.
입력 영상이 4:2:0 포맷(Format)의 영상의 경우, 매크로블록은 NxN 화소를 가지는 휘도 블록과 두 개의 화소를 가지는 색차 블록으로 이루어진다. 이와 같은 확장된 매크로블록에 의한 고해상도 영상의 압축 효율 향상은, 이하에서 설명하는 구체적인 실시예에 의해 달성된다.
본 발명의 일 실시예에 따른 확장된 매크로블록은 도 4에 도시한 바와 같이 내부적으로 더 작은 서브블록으로 분할되어 인트라 예측 부호화 또는 인터 예측 부호화가 수행될 수 있다.
즉, 고해상도 영상의 부호화를 위하여 N이 16이상인 매크로블록을 사용하는 경우, 확장된 매크로블록은 보다 작은 화소 블록 단위로 분할하여 부호화를 수행할 수 있으며, 각각의 화소 블록은 더 작은 서브블록으로 분할하여 부호화를 수행할 수 있다. 또한, 확장된 매크로블록 또는 분할된 화소 블록의 일변의 길이가 16화소 보다 큰 경우에는 도 5에 도시한 바와 같이, 32x64, 64x32, 16x32 또는 32x16와 같은 직사각형 형상을 갖는 화소 블록으로의 분할을 생략하고 확장된 매크로블록을 정방형의 화소 블록으로 분할한 후 16x16 화소 블록 단위로 부호화를 수행할 수도 있다. 도 4 및 도 5에는 확장된 매크로블록에 대하여 최소 블록의 크기가 4x4인 각각의 서브블록을 예시적으로 나타내었다. 예를 들어, 확장된 매크로블록이 64x64 화소 블록인 경우, 도 4의 매크로블록 레이어(Layer) 0에는 서브블록인 64x64 화소 블록, 64x32 화소 블록, 32x64 화소 블록, 32x32 화소 블록이 속하고 매크로블록 레이어 1에는 서브블록인 32x32 화소 블록, 32x16 화소 블록, 16x32 화소 블록, 16x16 화소 블록이 속할 수 있다. 또한, 도 5와 같이 16x16 화소 블록보다 큰 서브블록들에 대해 64x32 화소블록, 32x64 화소블록, 32x16 화소블록, 16x32 화소블록과 같은 직사각형 형상의 서브블록의 분할을 생략할 수 있다. 이 경우, 매크로블록 레이어 0에는 서브블록인 64x64 화소 블록 및 32x32 화소 블록이 속하도록 하고 매크로블록 레이어 1에는 서브블록인 32x32 및 16x16 화소 블록이 속하게 된다. 여기서, 매크로블록 레이어 K(단, 0≤K≤log2(N/4)))의 서브블록 중 제일 큰 서브블록이 4 개의 블록으로 분할된 경우에만 매크로블록 레이어 K+1의 서브블록들을 사용할 수 있다. 즉, 도 5의 경우와 같이, 매크로블록 레이어 0의 64x64 서브블록이 4개의 서브블록으로 분할된 경우에만 매크로블록 레이어 1의 서브블록들을 사용할 수 있으며, 매크로블록 레이어 1의 32x32 서브블록이 4개의 16x16 서브블록으로 분할된 경우에만 매크로블록 레이어 2의 서브블록들을 사용할 수 있다.
영상 부호화 장치(100)는 매크로블록을 서브블록으로 분할하여 부호화했을 경우의 각 서브블록에 대한 부호화 효율을 계산하고, 가장 부호화 효율이 높은 경우의 서브블록을 최종적인 인트라 예측 블록 또는 인터 예측 블록으로 결정한다. 부호화 효율은 수학식 1과 같은 율-왜곡 최적화(RDO: Rate-Distortion Optimizaion) 기법에 근거하여 측정할 수 있다.
[수학식 1]
Figure PCTKR2011002763-appb-I000001
여기서 Distortion은 부호화 대상 블록과 복원 블록 사이의 에러(error) 값을 나타내고, λ는 양자화 파라미터에 의해 결정되는 상수이며, Bit는 부호화 대상 블록을 부호화하는데 필요한 비트수를 나타낸다.
블록의 모드는 가능한 블록들의 모든 타입에 대하여 각 블록의 최적의 예측 모드(인트라 예측모드, 움직임 데이터)를 결정한 후, 블록 타입을 결정하는 과정으로 나뉠 수 있으며, 보통 예측모드 결정시(인트라 예측모드나 움직임 벡터/참조픽처 선택시)에는 연산량을 줄이기 위해서 SAD(Sum of Absolute Difference) 또는 SATD(Sum of Absolute Transformed Difference)를 사용하고 Bit에는 변환 계수의 비트는 고려하지 않는다. 이를 정리하면 수학식 2와 같이 표현할 수 있다.
[수학식 2]
Figure PCTKR2011002763-appb-I000002
수학식 2에서 SAD는 원 영상과 예측 영상 사이의 차분치에 절대값을 취하여 모두 더한 값을 말하고, SATD는 잔여블록을 변환을 수행한 후 그 값에 절대값을 취하여 모두 더한 값을 말한다.
블록 타입 결정시에는 수학식 3을 이용하여 엄격하게 Rdcost를 계산하는 것이 바람직하다.
[수학식 3]
Figure PCTKR2011002763-appb-I000003
수학식 3의 Distortion은 수학식 4로 나타낼 수 있다.
[수학식 4]
Figure PCTKR2011002763-appb-I000004
수학식 2는 수학식 3을 이용하는 것보다 연산량은 적으나 움직임이 없는 영역 또는 복잡하지 않은 영역의 경우에는 Distortion이 거의 비슷하기 때문에 수학식 2를 사용해서는 최적의 모드를 결정하는 것이 힘들다. 반면에, 수학식 3은 수학식 2보다 정확한 부호화 효율을 계산할 수는 있으나 계산량이 많다는 단점이 있다. 그러므로, 본 발명의 실시예에서는 데이터의 중요도(참조픽처로 사용되는지의 여부 등) 또는 부호화하고자 하는 모드에 따라 수학식 2 또는 수학식 3을 선택하여 사용하는 것이 바람직하다. 예를 들어, 인트라 예측모드 결정시 및 블록의 움직임 벡터/참조픽처 결정시에는 수학식 3을 사용할 수 있다. 다만, 예외적으로 B 픽처의 16x16 이상 크기의 화소 블록의 예측 방향(L0 예측, L1 예측, 양방향 예측)과 움직임 벡터/참조 픽처 결정과정은 각 예측 방향에 따라 움직임 벡터와 참조 픽처는 수학식 3을 사용하여 결정하며, 예측 방향은 수학식 2를 사용하여 결정할 수 있다. 블록 타입 결정시에는 수학식 3을 사용할 수 있다. 또한, 서브블록의 크기가 설정된 화소블록의 크기 이상인 경우에는 수학식 3에 따라 부호화 비용을 결정하고, 설정된 화소블록의 크기보다 작은 경우에는 수학식 2에 따라 부호화 비용을 결정할 수 있다.
예를 들어, 부호화 비용의 선택 기준을 16x16 화소블록으로 설정한다고 가정하면, 16x16 화소블록이 가질 수 있는 부호화 모드는 16x16 SKIP 모드, 16x16 Direct 모드, L0 예측모드를 사용하는 16x16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), L1 예측모드를 사용하는 16x16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), L0 및 L1 예측모드를 모두 사용하는 16x16 블록(예를 들면, 움직임 정보와 잔차 데이터가 있을 수 있다), 16x16 인트라 블록 등이 있다. 16x16 이상의 화소블록들의 부호화 모드들에 대해서는 정밀한 부호화 비용을 사용하는 것이 바람직하다. 블록 타입이 16x16 이상의 크기를 가지는 경우는 주로 배경과 같은 평탄한 영역이기 때문에 근사화된 식으로는 최적의 모드결정이 어렵기 때문이다. 그러므로 16x16 이상의 블록들을 사용하는 경우에는 매크로블록 내 모드 결정시 블록 사이즈와 모드에 따라 부호화 비용을 선택적으로 사용하도록 한다. 또한, 부호화 비용을 구하는 식에서 고려하는 파라미터를 작은 블록들간의 모드결정에 사용하는 파라미터와 큰 블록들간의 모드결정에 사용하는 파라미터를 다르게 고려하도록 할 수도 있다.
최소 블록의 크기는 최대로 사용할 수 있는 레이어값인 최대 레이어값(MaxLayer)에 따라 결정된다. 예를 들어, NxN 화소의 매크로블록인 경우, 최소 블록의 크기는 N/(2MaxLayer)로 결정된다.
영상 부호화 장치(100)의 각 구성 요소에 대해서는 후술하는 과정에서 관련 도면들과 함께 설명한다.
영상 부호화 장치(100)는 영상을 부호화할 때, 동영상을 구성하는 픽처 단위로 픽처 타입을 구분하여 픽처 타입에 따라 다르게 예측 부호화한다. 예를 들어, 임의의 픽처가 인트라 픽처인 경우에는 인트라 픽처 내의 매크로블록들의 타입은 모두 인트라 매크로블록이 되며, 각 매크로블록을 인트라 예측 부호화한다. 또한, 임의의 픽처가 인터 픽처인 경우에는 인터 픽처 내의 매크로블록들의 매크로블록 타입은 인터 매크로블록 또는 인트라 매크로블록일 수 있으며, 매크로블록 타입에 따라 인트라 예측 부호화거나 인터 예측 부호화된다. 이와 같은 픽처 타입에 대한 정보는 그대로 또는 부호화되어 부호화 데이터의 픽처 헤더 또는 시퀀스 헤더 등에 삽입될 수 있으며, 후술할 영상 복호화 장치는 픽처 헤더 또는 시퀀스 헤더 등에서 픽처 타입에 대한 정보를 추출하거나 복원하여 복호화할 픽처의 픽처 타입을 결정할 수 있다.
이하에서는 본 발명의 일 실시예에 따른 부호화 방법과 그를 통해 생성되는 부호화 데이터를 픽처 타입에 따라 설명한다.
도 6은 본 발명의 일 실시예에 따른 인트라 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
예측기(110)의 인트라 예측기(112)는 현재 부호화하고자 하는 블록(이하 '현재 블록'이라 칭함)의 주변 화소를 이용하여 참조 블록을 생성하고 참조 블록과 현재 블록을 비교하여 인트라 예측 모드를 결정한다. 여기서, 주변 화소란 현재 블록 주위에 있는 블록 내에 있는 화소들을 말하며, 현재 블록과 인접한 블록들 내에서 현재 블록과 인접한 인접 화소를 포함하는 개념이다.
확장된 매크로블록을 휘도 성분에 대한 4x4 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분의 인트라 예측 모드에 따른 9 가지의 예측 방향과 예측 모드 번호를 예시적으로 나타낸 도 7을 참조하면, 9 가지의 예측 방향(예측 모드 0 내지 예측 모드 8에 따른 예측 방향) 중 가장 적절한 예측 방향을 4x4 화소 단위의 현재 블록마다 1 개씩 선택하고, 선택된 예측 방향을 이용하여 현재 블록을 인트라 예측 부호화한다. 예측 모드 2가 의미하는 평균값은 현재 블록의 왼쪽 블록의 4 개의 인접 화소와 현재 블록의 위쪽 블록의 4 개 인접 화소의 총 8 개의 인접 화소의 평균값을 구해 현재 블록의 4x4 화소 모두를 예측하는 방법이다.
픽처의 좌측 경계에 위치하는 블록과 픽처의 윗쪽 경계에 위치하는 블록의 경우 왼쪽 블록과 윗쪽 블록이 각각 픽처 바깥쪽에 위치하게 된다. 이 경우, 픽처 경계를 벗어난 블록을 참조할 수 없기 때문에 예측 방향의 이용이 제한된다. 예를 들어, 픽처의 제일 위쪽에 위치한 블록에서는 윗쪽 블록의 화소를 참조하는 예측 모드 0, 예측 모드 3, 예측 모드 4, 예측 모드 5, 예측 모드 6, 예측 모드 7의 예측 방향을 이용할 수 없다. 예외적으로 DC 모드의 경우, 픽처의 경계를 벗어나지 않는 화소만을 참조해서 현재 블록의 예측을 수행한다. 만약, 현재 블록과 이웃한 왼쪽 블록과 윗쪽 블록을 이용할 수 없는 경우, DC 값은 128을 사용한다.
선택된 현재 블록의 예측 방향과 현재 블록의 왼쪽 블록과 위쪽 블록 중 더 작은 예측 모드 번호를 가지는 블록의 예측 방향을 비교하여 두 예측 방향이 동일한 경우, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시될 수 있음)를 추정한 예측 방향과 같은 예측 방향임을 나타내도록 부호화한다.
만약, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 다른 경우, 예측 모드 플래그를 선택된 현재 블록의 예측 방향이 추정한 현재 블록의 예측 방향과 다른 예측 방향임을 나타내도록 부호화하고 9 가지의 예측 모드에서 추정한 현재 블록의 예측 방향에 해당하는 예측 모드를 뺀 나머지 8 가지의 예측 모드 중 어떠한 예측 모드가 선택된 현재 블록의 예측 방향인지를 나타내기 위한 예측 모드 정보(예를 들어, 3 비트로 표시될 수 있음)를 부호화한다.
확장된 매크로블록을 휘도 성분에 대한 8x8 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분에 대한 8x8 화소 단위의 인트라 예측은 4x4 화소 단위의 인트라 예측과 같이 도 7에 도시한 바와 같은 9 가지 예측 방향을 이용하며, 예측 화소를 계산하는 방법도 블록의 크기(4x4 화소와 8x8 화소)의 차이를 제외하면 4x4 화소 단위의 인트라 예측 부호화의 경우와 동일하다.
확장된 매크로블록을 휘도 성분에 대한 16x16 화소 단위의 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 도 8에 도시한 바와 같은 4 가지의 예측 방향 중에서 부호화 효율이 가장 좋은 예측 방향을 선택하고, 선택된 예측 방향에 따라 16x16 크기의 현재 블록의 위쪽에 위치한 16x16 화소 블록 내의 16 개의 인접 화소와 현재 블록의 왼쪽에 위치한 16x16 화소 블록 내의 16 개의 인접 화소의 총 32 개의 인접 화소로부터 16x16 화소 블록을 예측 부호화한다.
도 8에서, 예측 모드 3인 평면(Plane) 예측의 경우, 현재 블록의 위쪽 블록 내의 인접 화소와 현재 블록의 왼쪽 블록 내의 인접 화소를 대각선 방향으로 보간(Interpolation)하여 예측한다. 예측 모드 2에 해당하는 평균값 예측의 경우, 평균값은 현재 블록의 윗쪽 블록 내의 16 개의 인접 화소와 왼쪽 블록의 16 개의 인접 화소의 평균값을 현재 블록의 16x16 화소 모두로 예측한다. 단, 현재 블록이 픽처 내에서 제일 위쪽에 위치하는 경우, 현재 블록의 왼쪽 블록 내의 16 개의 인접 화소의 평균값을 예측값으로 이용하며, 현재 블록이 픽처 내에서 가장 왼쪽에 위치하는 경우, 현재 블록의 위쪽 블록 내의 16 개 인접 화소의 평균값을 예측값으로 이용한다. 현재 블록의 왼쪽 블록과 윗쪽 블록을 이용할 수 없는 경우, 예측값으로 128을 사용한다. 16x16 화소 블록의 예측 모드는 예측 부호화되지 않고, 단순히 선택된 예측 모드의 번호가 예측 모드 정보(예를 들어, 2 비트로 표시됨)로서 부호화된다.
확장된 매크로블록을 전술한 4x4 화소 블록, 8x8 화소 블록 또는 16x16 화소 블록을 제외한 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 휘도 성분의 인트라 예측 모드는 도 9와 같이 3가지의 예측 방향과 예측 모드 번호로 나타낼 수 있다. 4x4 화소 블록, 8x8 화소 블록 또는 16x16 화소 블록을 제외한 나머지 서브 블록으로 분할하여 인트라 예측을 수행하는 경우에 해당 서브 블록의 크기가 mxn이라고 하면, 도 9에 도시한 바와 같은 3 가지의 예측 방향 중에서 선택되는 부호화 효율이 가장 좋은 예측 방향에 따라 현재 블록의 위쪽 블록 내의 m 개의 인접 화소와 왼쪽 블록 내의 n 개의 인접 화소로부터 mxn 화소 블록을 인트라 예측 부호화한다.
예측 모드 2에 해당하는 평균값 예측의 경우, 현재 블록의 위쪽 블록 내의 m 개의 인접 화소와 왼쪽 블록 내의 n 개 인접 화소의 평균값을 이용해서 현재 블록을 예측 부호화한다. 단, 현재 블록이 픽처 내에서 제일 위쪽에 위치하는 경우, 현재 블록의 왼쪽 블록의 n 개의 인접 화소의 평균값을 현재 블록의 예측값으로 이용하며, 현재 블록이 픽처 내의 제일 왼쪽에 위치하는 경우, 위쪽 블록 내의 m 개의 인접 화소의 평균값을 현재 블록의 예측값으로 이용한다. 현재 블록의 왼쪽 블록과 위쪽 블록을 이용할 수 없는 경우, 현재 블록의 예측값으로 128이 사용된다.
선택된 현재 블록의 예측 방향과 현재 블록의 왼쪽 블록과 위쪽 블록 중 더 작은 예측 모드의 번호를 가지는 블록의 예측 방향이 같은 방향인 경우, 현재 블록의 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시될 수 있다)를 추정한 현재 블록의 예측 방향과 같은 예측 방향이라는 정보를 부호화한다. mxn 화소 블록이 가질 수 있는 예측 모드의 번호는 0 내지 2이므로, 현재 블록의 왼쪽 블록과 위쪽 블록을 이용하여 예측한 현재 블록의 예측 모드 번호가 3 이상인 경우에는 현재 블록의 예측 방향은 예측 모드 번호 2(DC 모드)를 사용할 수 있다. 예를 들어, 주변 블록으로부터 예측한 현재 블록의 예측 모드 번호가 4인 경우, 현재 블록의 예측 모드 번호를 2로 하여 선택된 현재 블록의 예측 방향과 동일한지를 나타내는 예측 모드 플래그(예를 들어, 1 비트로 표시됨)를 부호화한다.
여기서, 확장된 매크로블록에 대한 인트라 예측은 16x16 이하의 화소 블록 단위 즉, 4x4 화소 블록, 8x8 화소 블록, 16x16 화소 블록 또는 mxn(여기서, m≠n이며, m 및 n은 16보다 작은 수) 화소 블록 단위로 수행되는 것이 바람직하다.
색차 성분의 인트라 예측은 N/2 × N/2 화소 블록 단위로 수행될 수 있다. 예측 방향은 도 10에 나타낸 바와 같이, 평균치 예측, 수평 예측, 수직 예측, 평면 예측 4 가지의 예측 방향이 사용될 수 있다. 바람직하게는, 색차 성분의 인트라 예측은 8x8 화소 블록 단위로 수행된다.
본 발명의 일 실시예에 따른 색차 성분의 4 가지의 인트라 예측 모드에 따른 예측 방향과 예측 모드 번호를 예시적으로 나타낸 도 10을 참조하면, 예측 모드 3에 해당하는 평면 예측과 예측 모드 0에 해당하는 평균값 예측을 위한 예측값 계산 방법도 블록의 크기(16x16 화소와 8x8 화소)의 차이를 제외하고 휘도 성분의 16x16 화소 단위의 인트라 예측 부호화 방법과 동일하다. 색차 신호의 예측 모드는 휘도 신호의 예측 모드와는 독립적으로 선택할 수 있다. 색차 신호는 U, V의 두 종류가 있지만 예측 방법은 같다. 색차 신호의 예측 모드는 U, V 각각 1 개씩이며 각 색차 신호의 예측 모드는 예측 부호화하지 않고 단순히 선택된 예측 모드 번호를 2 비트를 사용하여 나타낸다.
다시 도 6을 참조하면, 인트라 예측기(112)는 도 7 내지 도 10을 통해 전술한 바와 같은 방식으로 4x4 화소 단위에 대한 9 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, 8x8 화소 단위에 대한 9 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, 16x16 화소 단위에 대한 4 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드, mxn 화소 단위에 대한 3 가지 예측 방향으로 현재 블록을 예측하여 예측 부호화고 율-왜곡 최적화와 같은 방식으로 결정되는 인트라 예측 모드 중 율-왜곡 최적화를 이용하여 결정되는 하나의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 결정한다. 이때 사용되는 율-왜곡 최적화 식은 전술한 수학식 3에 따르는 것이 바람직하다. 이와 같은 방법으로 인트라 예측 모드가 결정되면 그에 따라 서브블록의 크기도 함께 결정된다.
전술한 바와 같이 결정되는 인트라 예측 모드에 따라, 인트라 예측기(112)는 현재 블록을 예측하여 예측 블록(Predicted Block)을 생성하고, 감산기(120)는 현재 블록과 예측 블록을 감산하여 잔여 블록(Residual Block)을 생성한다. 변환기 및 양자화기(130)는 잔여 블록을 변환 및 양자화하여 양자화된 변환 계수를 생성하고, 부호화기(140)는 양자화된 변환 계수를 엔트로피 부호화하여 부호화 데이터를 생성한다.
변환기 및 양자화기(130)는 휘도 성분의 4x4, 4x8, 8x4 화소 단위의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 4x4 변환을 수행하고, 8x8, 8x16, 16x8 화소 단위의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 8x8 변환을 수행할 수 있다. 또한, 변환기 및 양자화기(130)는 16x16 화소 단위 이상의 인트라 예측이 선택된 현재 블록의 잔여 블록에 대해서는 16x16 변환을 수행할 수 있다. 이 경우, 인트라 예측의 단위와 서브블록의 크기가 동일하므로, 변환의 종류는 서브블록의 블록 크기에 따라 결정할 수 있다.
여기서, 각 16x16 변환이 수행되는 16x16 화소를 가지는 잔여 블록(이하 '16x16 화소 잔여 블록'이라 칭함)은 다시 16 개의 4x4 화소를 가지는 잔여 블록(이하 '4x4 화소 잔여 블록'이라 칭함)으로 분할되고, 각 4x4 화소 잔여 블록에 대해 4x4 변환이 수행될 수 있다. 이후, 각 4x4 화소 잔여 블록이 4x4 변환되어 생성되는 각 4x4 화소를 가지는 변환 블록(이하 '4x4 화소 변환 블록'이라 칭함)의 16 개 DC 성분들만이 모여 4x4 변환 계수를 가지는 변환 블록(이하 'DC 성분 블록'이라 칭함)이 구성되고, DC 성분 블록은 4x4 변환이 한번 더 수행된다. 이때, DC 성분 블록을 변환하는 데에는 잔여 블록을 변환할 때의 변환과 다른 종류의 변환이 사용될 수 있다. 즉, 4x4 화소 잔여 블록에 대해서는 4x4 이산 코사인 변환(DCT: Discrete Cosine Transform)이 수행되고, DC 성분 블록에 대해서는 4x4 하다마드 변환이 사용될 수 있다. 예를 들어, 16x32 화소 단위의 인트라 예측이 선택된 현재 블록에 대한 16x32 화소 잔여 블록은 두 개의 16x16 화소 잔여 블록으로 분할되고 분할된 각 16x16 화소 잔여 블록에 대해 4x4 화소 단위로 4x4 변환이 수행된다. 이후 16x16 크기의 화소 잔여 블록 내 각 4x4 변환 블록들의 DC 성분들이 모여 DC 성분 블록이 구성되고 DC 성분 블록에 대해서 4x4 변환이 한번 더 수행된다.
만일, 32x32 화소 블록인 확장된 매크로블록의 위치가 도 2에 도시한 바와 같이 16화소의 배수로 패딩된 이미지와 패딩된 영역에 걸치는 경우, 해당 확장된 매크로블록이 인트라 모드이면 도 3에 도시한 바와 같이 실제의 이미지 영역(16x16 화소 블록)에 대해서만 부호화 모드를 결정하고 해당 영역의 분할 타입, 인트라 에측 모드, CBP, 변환 계수의 부호화를 수행한다.
도 11은 본 발명의 일 실시예에 따른 64x64 화소의 확장된 매크로블록에 대한 서브 블록의 블록 타입을 나타낸 예시도이다.
확장된 매크로블록이 64x64 화소 블록이고 인트라 예측 후 최적의 블록 타입이 도 11에 도시한 바와 같이 결정되었다고 가정하면, 블록 0 내지 블록 7에 대해서는 4x4 변환이 수행되고, 블록 8 내지 블록 12에 대해서는 8x8 변환이 수행되며, 블록 13 내지 블록 18에 대해서는 16x16 화소 블록 내에서 4x4 화소 단위로 4x4 변환이 수행되고 각 16x16 화소 블록 내 각 4x4 변환 블록들의 DC 성분들이 모여 구성되는 DC 성분 블록에 대하여 다시 변환이 수행된다.
색차 신호의 경우, 16x16 화소 단위 이상의 인트라 예측의 경우와 마찬가지로 4x4변환이 수행된 후, DC 성분 블록에 대하여 4x4 변환이 한 번 더 수행된다. 단, 색차 성분의 매크로블록의 잔여 블록은 8x8 화소를 가지는 잔여 블록(이하 '8x8 화소 잔여 블록'이라 칭함)으로 분할되고 각 8x8 화소 잔여 블록 내의 4 개의 4x4 화소 잔여 블록에 대해서는 4x4 변환이 수행된다. 8x8 화소 잔여 블록 내 4 개의 4x4 변환 블록의 DC 성분들이 모여 2x2 변환 계수를 가지는 DC 성분 블록이 구성되고 DC 성분 블록에 대해 2x2 변환이 수행된다. 이 때도 마찬가지로, 8x8 화소 잔여 블록에 대한 4x4 변환과 DC 성분 블록에 대한 2x2 변환의 종류는 다를 수 있다.
또는, 확장된 매크로블록에 대하여 최적의 블록 타입이 결정된 후 전술한 변환 타입에 따라 변환을 수행하는 대신에, 16x16 화소 블록의 단위로 인트라 예측에 사용된 서브 블록의 크기에 따라 효율이 좋은 변환 타입을 선택하여 사용할 수도 있다. 즉, 변환 및 양자화기(130)는 16x16 화소 블록의 단위로 하나 이상의 변환 및 양자화를 수행한 후 가장 효율이 좋은 변환의 종류를 선택하고, 선택된 변환의 종류에 따라 변환 및 양자화된 변환 계수를 생성할 수 있다. 이 경우, 부호화기(140)는 각 블록마다 선택된 변환의 종류를 식별하기 위한 변환 타입을 생성하고 부호화하여 변환 타입 데이터를 생성하는 것이 바람직하다. 변환 타입 데이터는 부호화 데이터에 포함된다. 단, 16x16 화소 블록 내에서는 서로 다른 변환을 사용할 수 없다.
이에 대하여 보다 상세하게 설명하면, 16x16 화소 블록이 8x8 화소 블록으로 분할되고 4 개의 8x8 화소 블록들 중 한 개 이상의 8x8 화소 블록이 8x8 화소보다 작은 서브블록으로 분할된 경우에는 16x16 화소 블록에 대해서 4x4 변환만이 사용될 수 있으며, 이 경우 변환 타입은 부호화되지 않는다. 또한, 16x16 화소 블록이 4 개의 8x8 화소 블록으로 분할된 경우에는 16x16 화소 블록에 대해서는 4x4 변환과 8x8 변환이 수행되어 부호화 비용이 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트로 표시될 수 있다)이 부호화될 수 있다. 또한, 16x16 화소 블록이 2 개의 8x16 화소 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환, 8x8 변환과 8x16 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되고, 16x16 화소 서브블록이 2 개의 16x8 화소 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환, 8x8 변환과 16x8 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시될 수 있다)이 부호화될 수 있다. 16x16 화소 이상의 서브블록에 대해서는 4x4 변환, 8x8 변환과 16x16 변환이 수행되어 부호화 비용이 가장 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시됨)이 부호화될 수 있다.
도 12는 본 발명의 일 실시예에 따른 인터 픽처의 부호화 방법과 부호화 데이터를 통해 전송할 관련 데이터를 설명하기 위한 예시도이다.
P-픽처 또는 P-슬라이스의 경우, 도 4의 모든 블록 타입들이 움직임 추정에 사용될 수 있으며, 확장된 매크로블록 내에는 16x16 화소 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수 있다. 즉, P-픽처 또는 P-슬라이스의 확장된 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다.
B-픽처 또는 B-슬라이스의 경우, 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 부르며, 이 두 장의 참조 픽처는 서로 다른 역할을 한다. 보통은 L0 예측(List 0 Prediction, 주로 순방향 예측에 사용됨)이 순방향 예측, L1 예측(List 1 Prediction, 주로 역방향 예측에 사용됨)이 역방향 예측으로 사용된다. P-픽처 및 B-픽처에 대한 각각의 보다 상세한 인터 픽처 부호화 방법은 후술한다.
확장된 매크로블록이 32x32 화소 블록인 경우, 32x32 화소 블록 단위로 부호화를 수행할지 또는 16x16 화소 블록 단위로 부호화를 수행할지는 확장된 매크로블록 플래그(extended_mb_flga)를 통해 나타낼 수 있다. 예를 들어, 확장된 매크로블록 플래그가 1인 경우에는 32x32 화소블록 단위로 부호화를 수행함을 의미하며, 확장된 매크로블록 플래그가 0인 경우에는 16x16 화소블록 단위로 부호화를 수행함을 의미할 수 있다. 확장된 매크로블록 플래그가 0인 경우, 확장된 매크로블록은 4개의 16x16 화소블록으로 분할되어 각 16x16 화소블록 단위로 인트라 모드인지 또는 인터 모드인지를 결정할 수 있다. 또한, 각각의 16x16 화소블록 단위는 더 작은 서브블록으로 분할되어 부호화가 수행될 수 있다.
다시 도 1을 참조하면, 예측기(110)의 인터 예측기(114)의 움직임 추정기(116)는 현재 픽처 내 현재 부호화 대상인 현재 블록과 가장 유사한 블록, 즉 참조 블록을 참조 픽처 내에서 찾아 현재 블록에 대한 참조 블록의 상대적인 위치를 나타내는 움직임 벡터(MV: Motion Vector)를 출력한다. 이러한 과정을 움직임 추정(Motion Estimation)이라 하는데, 움직임 추정은 매크로블록 내 서브블록을 픽처 버퍼(180)에 있는 하나 이상의 참조 픽처와 비교하여 움직임 벡터를 생성한다. 8x8 화소 블록은 서로 다른 참조 픽처를 이용할 수 있으나 8x8 화소 블록 내 서브블록들은 같은 참조 픽처를 이용한다.
움직임 벡터는 부호화기(140)에 의해 부호화되어 부호화 데이터에 포함되는데, 부호화기(140)는 현재 블록의 주변 블록의 움직임 벡터들의 중앙값(Mean Value)을 예측 움직임 벡터(PMV: Predicted Motion Vector)로 이용하고 예측 움직임 벡터와 현재 블록의 움직임 벡터의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)만을 부호화하여 움직임 정보 데이터를 생성한다. 이때, 부호화기(140)는 차분 움직임 벡터뿐만 아니라 참조 픽처 인덱스(Reference Picture Index)를 추가로 부호화할 수 있다. 즉, 움직임 정보는 차분 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있으며, 부호화기(140)는 움직임 정보를 부호화하여 움직임 정보 데이터를 생성하고 움직임 정보 데이터를 부호화 데이터에 포함시킬 수 있다.
도 13은 본 발명의 일 실시예에 따라 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
13A는 현재 블록과 주변 블록이 모두 64x64 화소 블록일 때, 현재 블록의 움직임 벡터와 예측 움직임 벡터를 결정하기 위해 이용되는 주변 블록의 움직임 벡터를 나타내었다. 현재 블록과 주변 블록이 모두 동일한 크기의 블록인 경우에는 기존의 방법과 같이 주변 블록의 움직임 벡터들의 중앙값을 예측 움직임 벡터로서 결정할 수 있다.
13B는 현재 블록과 주변 블록의 크기가 다를 때, 현재 블록의 움직임 벡터와 예측 움직임 벡터를 결정하기 위해 이용되는 주변 블록의 움직임 벡터를 나타내었다. 현재 블록과 주변 블록의 크기가 다른 경우에는 어느 주변 블록을 이용하여 예측 움직임 벡터를 결정해야 할지를 선택해야 한다.
본 발명의 일 실시예에서는 13B에 나타낸 바와 같이 현재 블록의 왼쪽에 있는 주변 블록이 여러 개의 블록으로 나뉘어 있을 경우 그 중 가장 위쪽 오른쪽에 위치한 블록 A의 움직임 벡터 mvA를 예측에 이용하고, 현재 블록의 위쪽에 있는 주변 블록이 여러 개로 나뉘어 있는 경우 그 중 가장 아래쪽 왼쪽에 위치한 블록 B의 움직임 벡터 mvB를 예측에 이용하며, 오른쪽 윗쪽에 위치한 주변 블록이 여러 개로 나뉘어 있는 경우 그 중 가장 아래쪽 왼쪽에 위치한 블록 C의 움직임 벡터 mvC를 예측에 이용한다. 단, 예외적인 경우로서, 블록 B와 블록 C가 모두 픽처의 경계 밖에 위치할 경우, 블록 B와 블록 C를 이용해서는 예측 움직임 벡터를 결정할 수 없기 때문에 블록 A의 움직임 벡터만을 이용하여 예측 움직임 벡터를 결정한다. 또한, 블록 A, 블록 B, 블록 C 중에 현재 블록과 참조 픽처의 번호가 같은 블록이 하나만 있는 경우, 해당 블록의 움직임 벡터를 예측 움직임 벡터를 결정하는 데 이용한다.
도 14는 본 발명의 일 실시예에 따른 8x16 화소 블록과 16x8 화소 블록의 예측 움직임 벡터를 결정하는 과정을 설명하기 위한 예시도이다.
또한, 현재 블록이 8x16 화소 블록 또는 16x8 화소 블록인 경우에는 중앙값을 이용하지 않는다. 즉, 현재 블록이 8x16 화소 블록인 경우, 왼쪽의 주변 블록으로서는 블록 A를, 오른쪽의 주변 블록으로서는 블록 C를 예측 움직임 벡터를 결정하는 데 이용한다. 현재 블록이 16x8 화소 블록인 경우, 윗쪽의 주변 블록은 블록 B를, 아랫쪽의 주변 블록은 블록 A를 예측 움직임 벡터를 결정하는 데 이용한다.
또한, 본 발명의 일 실시예에서는, 16x16 이상의 화소 블록인 매크로블록에 대하여 SKIP 모드를 사용한다. 16x16 이상의 화소 블록인 매크로블록이 SKIP 매크로블록인 경우에는 예측 움직임 벡터를 이용해서 움직임 추정 및 보상이 수행된다. 단, 예측 움직임 벡터를 결정하는 데 이용되는 움직임 벡터들 중 한 개 이상이 0인 경우 예측 움직임 벡터를 0으로 결정한다. 예를 들어, 주변 블록 A, B, C의 움직임 벡터가 각각 mvA (0,10)이고, mvB (1, 10)이며, mvC (2, 10)인 경우, 현재 블록의 예측 움직임 벡터는 (0, 10)이 된다.
만일, 32x32 화소 블록인 확장된 매크로블록의 위치가 도 2에 도시한 바와 같이 16화소의 배수로 패딩된 이미지와 패딩된 영역에 걸치는 경우, 해당 확장된 매크로블록이 SKIP 모드이면 도 3에 도시한 바와 같이 실제의 이미지 블록(16x16 화소 블록)의 왼쪽 블록과 위쪽 블록을 이용하여 예측 움직임 벡터를 구하고, 그 예측 움직임 벡터를 사용해서 실제의 이미지 블록에 대한 움직임 예측 및 보상을 수행한다. 현재 부호화 대상인 확장된 매크로블록의 최적의 부호화 모드가 SKIP 모드인 경우, skip32_flag를 복호화하고 다음의 확장된 매크로블록에 대한 부호화를 수행한다.
다시 도 1을 참조하면, 감산기(120)는 움직임 추정기(116)에서 추정한 현재 블록의 움직임 벡터가 가리키는 참조 블록과 현재 블록을 감산하여 잔여 블록을 생성하고, 변환기 및 양자화기(130)는 감산기(120)에 의해 생성된 잔여 블록을 변환 및 양자화하며, 부호화기(140)는 양자화된 변환 계수를 엔트로피 부호화하여 부호화 데이터를 생성한다. 여기서, 변환기 및 양자화기(130)는 현재 블록의 크기에 따라 하나 이상의 변환 및 양자화를 수행한 후 가장 효율이 좋은 변환의 종류를 선택하고, 선택된 변환의 종류에 따라 변환 및 양자화된 변환 계수를 생성한다. 부호화기(140)에서는 각 블록마다 선택된 변환의 종류를 식별하기 위한 변환 타입을 생성하고 부호화하여 변환 타입 데이터를 생성한다. 변환 타입 데이터는 부호화 데이터에 포함된다. 단, 16x16 화소 블록 내에서는 서로 다른 변환을 사용할 수 없다.
인트라 예측 블록에서 설명한 변환 방법과 마찬가지로, 16x16 화소 서브블록이 8x8 화소 블록으로 분할되고 4 개의 8x8 화소 서브블록들 중 한 개 이상의 8x8 화소 서브블록이 8x8 화소보다 작은 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환만이 사용될 수 있으며, 이 경우 변환 타입은 부호화되지 않는다. 16x16 화소 서브블록이 4 개의 8x8 화소 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환과 8x8 변환이 수행되어 부호화 비용이 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트로 표시됨)이 부호화된다.
16x16 화소 서브블록이 2 개의 8x16 화소 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환, 8x8 변환과 8x16 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되고, 16x16 화소 서브블록이 2 개의 16x8 화소 서브블록으로 분할된 경우에는 16x16 화소 서브블록의 잔여 블록에 대해서는 4x4 변환, 8x8 변환과 16x8 변환이 수행되어 부호화 비용이 가장 작은 변환의 종류가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시될 수 있다)이 부호화된다. 16x16 화소 이상의 서브블록에 대해서는 4x4 변환, 8x8 변환과 16x16 변환이 수행되어 부호화 비용이 가장 작은 변환이 선택되며, 선택된 변환의 종류를 나타내는 변환 타입(예를 들어, 1 비트 또는 2 비트로 표시됨)이 부호화된다.
16x16 화소 블록이 4 개의 8x8 화소 서브블록으로 분할된 경우와 같이 선택 가능한 변환의 종류가 2가지인 경우, 변환 타입 부호화에 사용되는 부호화 비트는 표 1과 같이 구성될 수 있다.
[표 1]
Figure PCTKR2011002763-appb-I000005
또한, 16x16 화소 블록이 2개의 8x16 화소 블록으로 분할되거나, 2개의 16x8 화소 블록으로 분할되거나 또는 16x16 이상의 서브 블록과 같이 선택 가능한 변환의 종류가 3가지인 경우, 변환 타입 부호화에 사용되는 부호화 비트는 표 2와 같이 구성될 수 있다.
[표 2]
Figure PCTKR2011002763-appb-I000006
도 15는 본 발명의 일 실시예에 따른 서브블록 크기에 따른 사용 가능한 변환의 종류와 변환 타입이 부호화되는 단위를 나타낸 예시도이다.
도 15에서는 확장된 매크로블록이 64x64 화소이고, 확장된 매크로블록이 다양한 크기의 서브블록으로 분할된 경우를 예시적으로 나타내었다. 전술한 바와 같이, 매크로블록의 첫 번째 16x16 화소 블록(1510)은 8x8 화소 블록보다 작은 4x4 화소 서브블록으로 분할되었으므로 사용 가능한 변환은 4x4 변환뿐이며, 이 경우 변환 타입은 부호화되지 않는다. 두 번째 16x16 화소 블록(1520)은 4 개의 8x8 화소 서브블록으로 분할되었으므로 4x4 변환 또는 8x8 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 세 번째 16x16 화소 블록(1530)은 2 개의 8x16 화소 서브블록으로 분할되었으므로 4x4 변환, 8x8 변환 또는 8x16 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 네 번째 16x16 화소 블록(1540)은 2 개의 16x8 화소 서브블록으로 분할되었으므로 4x4 변환, 8x8 변환 또는 16x8 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 다섯 번째 16x32 화소 블록(1550), 여섯 번째 16x32 화소 블록(1560), 일곱 번째 32x32 화소 블록(1570) 및 여덟 번째 32x32 화소 블록(1580)은 모두 16x16 화소 블록보다 크므로 4x4 변환, 8x8 변환 또는 16x16 변환 중 부호화 비용이 작은 하나가 선택되며, 선택된 변환의 종류를 나타내는 변환 타입이 부호화된다. 16x16 화소 보다 큰 블록에 대해서는 16x16 화소 블록 단위로 변환 타입을 선택할 수도 있다. 이 경우, 32x32 화소 블록과 같은 16x16 화소 블록보다 큰 화소 블록 내의 부호화된 블록 패턴이 0이 아닌 16x16 화소 블록에 대해서는 복수개의 변환 타입을 부호화한다.
다시 도 1을 참조하면, 변환기 및 양자화기(130)에 의해 변환 및 양자화된 잔여 블록은 역양자화기 및 역변환이기(150)에 의해 역양자화 및 역변환되어 잔여 블록이 복원되고, 가산기(160)는 복원된 잔여 블록과 예측기(110)에 의해 예측된 예측 블록을 가산하여 현재 블록을 복원한다.
필터(170)는 가산기(160)에 의해 복원된 현재 블록들이 누적되어 만들어지는 픽처를 디블록킹 필터 등을 사용하여 필터링을 수행하고, 필터링된 픽처는 픽처 버퍼(180)에 저장되어 다음 픽처의 참조 픽처로서 이용된다.
도 16은 본 발명의 일 실시예에 따른 디블록킹 필터링을 수행할 블록 경계를 나타낸 예시도이다.
16A 내지 16E는 각각 4x4 변환, 8x8 변환, 8x16 변환, 16x8 변환 및 16x16 변환이 사용된 16x16 화소 블록에서 디블록킹 필터링을 수행할 블록 경계를 나타내었다. 16A에 나타낸 4x4 변환이 사용된 16x16 화소 블록은 각 4x4 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블록킹 필터링이 수행되며, 16B에 나타낸 8x8 변환이 사용된 16x16 화소 블록은 각 8x8 블록의 왼쪽과 위쪽의 블록 경계에 디블록킹 필터링이 수행되며, 16C에 나타낸 8x16 변환이 사용된 16x16 화소 블록은 각 8x16 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행되며, 16D에 나타낸 16x8 변환이 사용된 16x16 화소 블록은 각 16x8 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행되며, 16E에 나타낸 16x16 변환이 사용된 16x16 화소 블록은 16x16 화소 블록의 왼쪽과 위쪽의 블록 경계에 디블로킹 필터링이 수행된다.
도 17은 본 발명의 일 실시예에 따른 인트라 픽처의 신택스(Syntax)를 나타낸 예시도이다.
확장된 매크로블록에 대한 서브 블록의 형태가 도 4에 도시한 바와 같이 직사각형 타입(예를 들어, 32x16 화소 블록, 16x32 화소 블록 등)을 포함하는 경우에 영상 부호화 장치(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에 도시한 바와 같이 정방형의 화소 블록으로 분할된 후 16x16 화소 블록 단위로 인트라 예측 부호화가 수행되는 경우, CBPX_플래그에 대한 부호화는 생략되고 양자화 파라미터에 대한 증감정보(Δpq)가 부호화될 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화될 수 있으며, CBP 정보는 16x16 화소 블록 단위로 부호화되는 것이 바람직하다.
도 17에서 분할 타입 필드에는 매크로블록이 서브블록으로 분할된 모양을 나타내는 매크로블록의 분할 타입 정보가 부호화된 데이터인 분할 타입 데이터가 할당된다. 분할 타입 정보는 도 18에서 예시적으로 나타낸 분할 타입별 번호를 이용하여 생성될 수 있다.
도 18을 참조하면, 매크로블록 레이어 K의 N/2K x N/2K 화소 블록이 더 이상 분할되지 않는 경우에는 매크로블록 레이어 K의 N/2K x N/2K 화소 블록에 분할 타입 번호 0이 할당된다. 매크로블록 레이어 K의 N/2K x N/2K 화소 블록이 두 개의 N/2K x N/2K+1화소 블록으로 분할된 경우에는 매크로블록 레이어 K의 N/2K x N/2K 화소 블록에 분할 타입 번호 1이 할당된다. 매크로블록 레이어 K의 N/2K x N/2K 화소 블록이 두 개의 N/2K+1 x N/2K 화소 블록으로 분할된 경우에는 매크로블록 레이어 K의 N/2K x N/2K 화소 블록에 분할 타입 번호 2가 할당된다. 매크로블록 레이어 K의 N/2K x N/2K 화소 블록이 4 개의 N/2K+1 x N/2K+1 로 분할되는 경우에는 매크로블록 레이어 K의 N/2K x N/2K 화소 블록에 분할 타입 번호 3이 할당된다. 도 18에서 각 매크로블록 레이어 K의 N/2K x N/2K 화소 블록 내의 분할된 서브블록에 표시된 0, 1, 2, 3 등의 숫자는 각 서브블록을 식별하기 위한 파티션 번호(Partition Number)이다.
도 18에는 분할 타입 별 번호를 작은 숫자에서 큰 순자의 순서로 할당하는 것으로 나타냈지만, 도 18의 분할 타입 번호는 일 예를 나타낸 것일 뿐이며, 발생순서로 큰 숫자에서 작은 숫자로 할당하여 사용할 수도 있다. 또한, 각각의 분할 타입의 발생 확률에 따라 분할 타입 번호를 할당할 수도 있으며, 적응적으로 분할 타입 번호를 바꾸어 사용할 수도 있다. 또한, 각각의 분할된 블록은 더 작은 블록으로 분할될 수도 있다. 예를 들어, 32x32 화소 블록이 분할 타입 번호 3에 의해 4개의 16x16 화소 블록으로 분할된 경우, 각각의 16x16 화소 블록은 도 18의 분할 타입 별 번호를 사용하여 더 작은 서브블록으로 분할될 수 있다. 또한, 16x16의 서브 블록이 더 작은 블록으로 분할되는 경우, 상위의 화소 블록의 분할 타입 번호 즉, 32x32 화소 블록의 분할 타입 번호와 다른 분할 타입 번호가 사용될 수도 있다. 확장된 매크로블록을 16x16 화소 블록 단위로 분할하여 부호화를 수행하는 경우에는 16x16 화소 블록보다 큰 서브 블록(예를 들면, 64x32 화소블록, 32x64 화소블록, 16x32 화소블록, 32x16 화소블록 등)에 대한 분할 타입 번호의 부호화는 생략될 수도 있다.
도 19는 본 발명의 일 실시예에 따라 확장된 매크로블록을 다양한 크기의 서브블록으로 분할하는 경우의 분할 타입 번호 부호화 순서를 설명하기 위해 도시한 도면이다.
도 19에서는 확장된 매크로블록이 64x64 화소 블록이고 최대 분할 레이어의 개수가 4인 경우를 나타내었다. 확장된 매크로블록이 도 19와 같이 분할되었을 때, 본 발명의 일 실시예에 따르면 분할 레이어별 분할 타입 번호를 분할 타입 번호 부호화 순서에 따라 순차적으로 부호화하여 매크로블록의 분할 타입 정보를 부호화할 수 있다.
도 19에 도시한 매크로블록이 분할 레이어별로 분할되는 과정을 순차적으로 나타내면 도 20과 같이 나타낼 수 있다. 도 20을 참조하면, 매크로블록 레이어 0(L0)에서, 64x64 화소 서브블록은 4 개의 32x32 화소 서브블록으로 분할되며, 레이어 1(L1)에서, L1-P0(매크로블록 레이어 1의 파티션 번호 0)의 서브블록과 L1-P3(매크로블록 레이어 1의 파티션 번호 3)의 서브블록은 다시 4 개의 16x16 화소 서브블록으로 분할되고 L1-P1(매크로블록 레이어 1의 파티션 번호 1)의 서브블록과 L1-P2(레이어 1의 파티션 번호 2)의 서브블록은 각각 16x32 화소 서브블록과 32x16 화소 서브블록으로 분할된다. L1-P1과 L1-P2의 서브블록은 각각 2 개의 서브블록으로 분할된 후 더 이상 분할되지 않으므로 레이어별 파티션 번호를 나타내지 않았다. 레이어 2(L2)에서, L2-P0(매크로블록 레이어 2의 파티션 번호 0)의 서브블록은 다시 4 개의 8x8 화소 서브블록으로 분할되고 L2-P3(매크로블록 레이어 2의 파티션 번호 3)은 2 개의 16x8 화소 서브블록으로 분할된다. 다시, 매크로블록 레이어 3(L3)에서, L3-P0(매크로블록 레이어 3의 파티션 번호 0)의 서브블록과 L3-P1(매크로블록 레이어 3의 파티션 번호 1)의 서브블록은 각각 4 개의 4x4 화소 서브블록으로 분할된다. 이때, 확장된 매크로블록을 16x16 화소 블록 단위로 부호화를 수행하는 경우, L1-P1 블록과 L1-P2 블록은 각각 16x32 화소 서브블록 및 32x16 화소 서브블록으로 분할하는 대신에 L1-P3 블록과 같이 각각 4개의 16x16 화소 블록 단위로 부호화가 수행될 수 있다.
도 21은 매크로블록의 레이어별 분할 타입 번호를 순차적으로 부호화하는 과정을 설명하기 위한 예시도이다.
도 19에 도시한 매크로블록의 분할 타입 정보를 부호화하면 도 21와 같이 부호화할 수 있다. 도 19에서, '□' 안에 기재된 숫자는 각 서브블록의 분할 타입 번호를 부호화하는 순서를 나타낸다. 확장된 매크로블록에 대한 레이어별 분할 타입 번호를 분할 타입 번호 부호화 순서에 따라 순차적으로 부호화하면, 도 21에 도시한 순서에 따라 레이어별 분할 타입 번호를 순차적으로 부호화할 수 있다.
먼저, 매크로블록 레이어 0의 64x64 화소 서브블록(L0-P0)은 4 개의 32x32 화소 서브블록들로 분할되었으므로, 분할 타입 번호 3을 부호화한다. 64x64 화소 서브블록 내 4 개의 32x32 화소 서브블록 중 첫 번째 32x32 화소 서브블록(L1-P0)도 4 개의 16x16 화소 서브블록으로 분할되었으므로 분할 타입 번호 3을 부호화한다. 레이어 1의 첫 번째 32x32 화소 서브블록(L1-P0) 내 4 개의 16x16 화소 서브블록 중 첫 번째 16x16 화소 서브블록(L2-P0)도 4 개의 8x8 화소 서브블록으로 분할되었으므로 분할 타입 3을 부호화하고 해당 16x16 화소 서브블록(L2-P0) 내 4 개의 8x8 화소 블록(L3-P0, L3-P1, L3-P2, L3-P3)은 더 이상 작은 서브블록으로 분할되지 않으므로 분할 타입 번호 {3, 3, 0, 0}을 각각 부호화한다. 레이어 3의 서브블록들은 더 작은 서브블록으로 분할될 수 없으므로 레이어 3에 속하는 서브블록들의 분할 타입 번호는 부호화하지 않는다.
매크로블록 레이어 3 내 서브블록들의 분할 타입 번호를 모두 부호화했으므로 매크로블록 레이어 2의 두 번째 16x16 화소 서브블록(L2-P1)과 세 번째 16x16 화소 서브블록(L2-P2)의 분할 타입 번호를 부호화하는데, 모두 더 이상 작은 블록으로 분할되지 않았으므로 분할 타입 번호 0을 부호화한다. 네 번째 16x16 화소 서브블록(L2-P3)은 16x8 화소 서브블록으로 분할되었지만 분할 타입 번호가 3이 아니므로 분할 타입 번호 1만을 부호화한다. 레이어 2 내의 4 개 서브블록들의 분할 타입 번호를 모두 부호화했으므로 레이어 1의 두 번째 32x32 화소 서브블록(L1-P1)의 분할 타입 번호를 부호화하는데, 레이어 1의 두 번째 32x32 화소 서브블록(L1-P1)은 16x32 화소 서브블록으로 분할되었고 분할된 각 서브블록은 더 이상 작은 서브블록으로 분할되지 않았으므로 분할 타입 번호 2를 부호화한다. 이와 같은 방식으로 매크로블록 레이어 1의 세 번째 32x32 화소 서브블록(L1-P2)와 매크로블록 레이어 1의 네 번째 32x32 화소 서브블록(L1-P3) 및 그 하위의 4 개의 16x16 화소 서브블록(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 PCTKR2011002763-appb-I000007
[표 4]
Figure PCTKR2011002763-appb-I000008
다시 도 17을 참조하면, 인트라 픽처에 대한 매크로블록의 분할 타입 정보를 부호화하여 분할 타입 데이터가 분할 타입 필드에 할당되면, 인트라 예측 모드 필드에 인트라 예측 모드에 대한 정보가 부호화된 데이터인 인트라 예측 모드 데이터가 할당된다.
도 22는 본 발명의 일 실시예에 따른 인트라 예측 모드의 부호화 순서를 나타낸 예시도이다.
도 22는 도 19와 같이 확장된 매크로블록이 64x64 화소 블록이고 최대 분할 레이어의 개수가 4인 경우를 나타내었다. 확장된 매크로블록이 도 22와 같이 분할되었을 때, 확장된 매크로블록의 각 서브블록에 대한 인트라 예측 모드는 도 22에 도시한 인트라 예측 모드의 부호화 순서에 따라 순차적으로 부호화하여 인트라 예측 모드 데이터를 생성할 수 있다. 즉, 각 서브블록 내에 표시된 번호는 인트라 예측 모드를 부호화하기 위한 인트라 예측 모드의 부호화 순서를 나타낸 것이다. 만일, 64x64 화소의 확장된 매크로블록에 대하여 16x16 화소 블록 단위로 부호화를 수행하는 경우, 15번째 블록 및 16번째 블록, 또는 17번째 블록 및 18번째 블록에 해당하는 32x32 화소 블록은 16x32 화소 블록 또는 32x16 화소 블록으로 분할하는 대신에, 19번째 블록 내지 22번째 블록과 같이 각각 4개의 16x16 화소 블록 단위로 분할하여 부호화를 수행할 수 있다.
확장된 매크로블록의 휘도 성분의 서브블록이 16x16 화소 블록이 아닌 경우에는 주변 블록으로부터 추정한 현재 블록의 예측 방향과 선택된 현재 블록의 예측 방향이 동일한지 여부를 나타내는 예측 모드 플래그가 부호화되고, 예측 모드 플래그가 현재 부호화 대상인 블록의 예측 방향과 주변 블록으로부터 추정한 현재 블록의 예측 방향이 동일하지 않는 경우에는 현재 블록의 예측 방향과 주변 블록으로부터 추정한 현재 블록의 예측 방향이 동일하지 않음을 나타내는 예측 모드 플래그와 해당 서브블록의 크기에 따른 여러 가지 인트라 예측 방향 중에서 주변 블록으로부터 추정한 현재 블록의 예측 방향을 제외한 나머지 예측 방향 중에서 어떠한 예측 방향인지를 나타내는 예측 모드의 예측 모드 번호를 해당 블록의 인트라 예측 모드로서 부호화되어 인트라 예측 모드 데이터가 생성된다. 이때, 확장된 매크로블록을 4x4 화소 블록, 8x8 화소 블록 또는 16x16 화소 블록을 제외한 서브 블록으로 분할하여 인트라 예측을 수행하는 경우, 현재 블록의 왼쪽 블록과 위쪽 블록을 이용하여 예측한 현재 블록의 예측 모드 번호가 3 이상인 경우에는 현재 블록의 예측 방향은 도 9의 예측 모드 번호 2(DC 모드)를 사용할 수 있다.
만약, 주변 블록으로부터 추정한 현재 블록의 예측 방향과 현재 블록의 예측 방향이 동일한 경우에는 주변 블록으로부터 추정한 현재 블록의 예측 방향과 현재 블록의 예측 방향이 동일함을 나타내는 예측 모드 플래그를 인트라 예측 모드로서 부호화하여 인트라 예측 모드 데이터가 생성된다. 휘도 성분의 서브블록이 16x16 화소 블록이거나 색차 성분의 매크로블록의 예측모드는 해당 블록의 예측 모드의 번호 자체를 인트라 예측 모드로서 부호화하여 인트라 예측 모드 데이터가 생성된다. 이와 같이 도 22에 도시한 바와 같은 순서로 부호화되어 생성되는 매크로블록의 각 서브블록에 대한 인트라 예측 모드 데이터는 도 17에 도시한 인트라 예측 모드 필드에 할당된다.
도 23은 본 발명의 일 실시예에 따라 매크로블록의 인트라 예측 모드를 부호화하는 과정의 일 예를 설명하기 위한 예시도이다.
23A에서는 현재 부호화하고자 하는 현재 매크로블록이 64x64 화소 블록이고 도시한 바와 같이 다양한 크기와 모양의 서브블록으로 분할되었으며, 현재 매크로블록의 왼쪽의 주변 블록은 64x64 화소 단위로 인트라 예측이 되어 왼쪽의 주변 블록의 예측 모드 번호는 0(수직 모드)이고, 현재 매크로블록의 위쪽 주변 블록은 64x64 화소 단위로 인트라 예측이 되어 왼쪽 주변 블록의 예측 모드 번호는 1(수평모드)인 경우를 예시적으로 나타내었다. 현재의 확장된 매크로블록 내의 각 서브블록 내에 표시되는 숫자는 각 서브블록의 예측 모드 번호를 나타낸다.
현재의 확장된 매크로블록의 첫 번째 4x4 화소 서브블록의 예측 모드 번호는 2(DC 모드)이고 왼쪽의 주변 블록과 위쪽의 주변 블록을 이용하여 추정되는 해당 서브블록의 예측 모드 번호는 0이다. 즉, 왼쪽의 주변 블록의 예측 모드 번호 0과 윗쪽의 주변 블록의 예측 모드 번호 1 중 0이 더 작기 때문에, 첫 번째 4x4 화소 서브블록의 예측 모드 번호는 0으로 추정된다. 첫 번째 4x4 화소 서브블록의 예측 모드와 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드가 다르기 때문에, 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하지 않음을 나타내는 예측 모드 플래그와 해당 서브블록의 예측 모드 번호인 예측 모드 번호 2가 해당 서브블록의 인트라 예측 모드로서 부호화된다. 두 번째 4x4 화소 서브블록의 예측 모드 번호는 1이고 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드 번호는 1이어서 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하므로, 예측 방향이 동일함을 나타내는 예측 모드 플래그만이 해당 서브블록의 인트라 예측 모드로서 부호화된다.
다음으로는 도 22에 도시한 인트라 예측 모드의 부호화 순서에 따라 다음 서브블록의 인트라 예측 모드를 부호화하는데, 세 번째 4x4 화소 서브블록의 예측 모드 번호는 0이고 주변 블록으로부터 추정되는 해당 서브블록의 예측 모드 번호는 0이어서 해당 서브블록의 예측 방향과 주변 블록으로부터 추정되는 해당 서브블록의 예측 방향이 동일하므로, 예측 방향이 동일함을 나타내는 예측 모드 플래그만이 해당 서브블록의 인트라 예측 모드로서 부호화된다. 11 번째 16x16 화소 서브블록의 경우, 예측 플래그는 부호화되지 않고 해당 서브블록의 예측 모드 번호 1이 해당 서브블록의 인트라 예측 모드로서 부호화된다. 도 23에는 15번째 블록 및 16번째 블록을 16x32 화소 블록으로 분할하여 인트라 예측 모드로 부호화하고, 17번째 블록 및 18번째 블록을 32x16 화소 블록으로 분할하여 인트라 예측 모드로 부호화하는 경우를 도시하였다. 그러나, 확장된 매크로블록에 대하여 16x16 화소 블록 단위로 인트라 예측 부호화를 수행하는 경우, 16x16 화소 블록보다 큰 서브 블록에 대해서는 15번째 블록 및 16번째 블록, 또는 17번째 블록 및 18번째 블록과 같은 직사각형의 화소 블록 분할은 생략한다.
23B에는 23A와 같이 현재 매크로블록의 인트라 예측 모드를 부호화하는 경우 인트라 예측 모드 필드에 포함되는 인트라 예측 모드 데이터를 예시적으로 나타내었다. 첫 번째 4x4 서브블록에 대해서는 예측 모드 플래그와 예측 모드 번호가 부호화되며, 두 번째, 세 번째, 네 번째 4x4 서브블록에 대해서는 예측 모드 플래그만이 부호화되는 등 도시한 바와 같이 부호화 순서에 따라 차례로 인트라 예측 모드 데이터가 인트라 예측 모드 필드에 할당된다.
확장된 매크로블록을 인트라 예측 부호화할 때, 도 4에 도시한 바와 같이 16x16 화소 블록보다 큰 직사각형의 서브 블록(예를 들면, 16x32, 32x16 등)으로 분할하여 인트라 예측 부호화를 수행하는 경우에는 서브블록의 크기를 고려한 부호화된 블록 패턴 플래그(CBPX_flag: Coded Block Pattern X_flag, 이하 'CBPX 플래그'라 칭함)와 CBP(CBP: Coded Block Pattern, 이하 'CBP'라 칭함)를 부호화하여, CBPX_플래그/CBP 필드에 할당할 수 있다. CBPX_플래그와 CBP 필드에 할당되는 CBP 데이터는 매크로블록의 서브블록 내에 0이 아닌 양자화된 변환 계수를 포함하는지 여부를 나타낸다. 그러나, 도 5에 도시한 바와 같이 확장된 매크로블록을 16x16 화소 블록 단위로 분할하여 인트라 예측 부호화를 수행하는 경우에는 블록 패턴 플래그의 부호화는 생략하고 양자화 파라미터에 대한 증감정보(Δpq)를 부호화할 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화될 수 있으며, CBP 데이터는 16x16 화소 블록 단위로 부호화되는 것이 바람직하다.
도 24는 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX_플래그와 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 24에서는 확장된 매크로블록이 64x64 화소 블록인 경우 CBPX_플래그와 CBP를 부호화하는 과정을 예를 들어 나타내었다. 영상 부호화 장치(100)의 부호화기(140)는 확장된 매크로블록의 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나인지 여부를 판단하며(S2410), 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나가 아닌 경우에는 서브블록의 크기가 32x32, 32x16 및 16x32 중 하나인지 여부를 판단한다(S2420). 이때, 확장된 매크로블록을 16x16 화소 단위로 분할하여 인트라 예측을 수행하는 경우, 단계 S2410에서는 서브 블록의 크기가 64x64 화소 블록인지 즉, 확장된 매크로블록 단위로 인트라 예측 부호화를 수행하는지 판단하며, 단계 S2420에서는 서브 블록의 크기가 64x64 화소 블록이 아닌 경우에 서브 블록의 크기가 32x32 화소 블록인지를 판단할 수 있다. 단계 S2420의 판단 결과, 그 서브블록의 크기가 32x32, 32x16 및 16x32 중 하나이거나 32x32 화소 블록인 경우, 서브블록 내 0이 아닌 변환 계수가 있는지 여부를 판단하며(S2430), 0이 아닌 변환 계수가 있는 경우에는 해당 서브블록 내에 0이 아닌 부호화할 계수가 있음을 나타내는 CBP32 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있다)를 부호화하고(S2440), 서브블록 내에서 16x16 화소 블록 단위로 CBP를 부호화하며(S2450), 서브블록 내 0이 아닌 변환 계수가 없는 경우에는 서브블록 내에 0이 아닌 변환 계수가 없음을 나타내는 CBP32 플래그(예를 들어, '0'과 같이 1비트로 표시될 수 있다)를 부호화한다(S2460).
여기서, CBP64 플래그는 64x64 화소 블록 내 0이 아닌 부호화할 계수의 존재 유무를 나타내는 플래그이다. 마찬가지로, CBP32 플래그는 32x32 화소 블록 내 0이 아닌 부호화할 계수의 존재 유무를 나타내는 플래그이다. 이와 같은 CBPX 플래그(X는 32, 64 등)는 휘도 성분의 잔여 블록이 0이 아닌 변환계수를 가지지 않는 경우에는 변환 타입을 전송할 필요가 없으므로, 휘도 성분 블록들이 0이 아닌 변환계수를 가지는지를 나타내는 데 사용된다. CBP는 16x16 화소 블록 단위로 부호화되며, 16x16 화소 블록 내 각 8x8 화소 블록 당 0이 아닌 변환 계수가 있는지 여부를 8x8 화소 블록 당 1비트를 이용하여 나타내고, 색차 성분에 대해서는 두 개의 2x2 색차 성분 DC 블록 내 0이 아닌 변환 계수가 있는지 여부를 1 비트를 이용하여 나타내며, 두 개의 8x8 색차 성분 AC 블록 내 0이 아닌 변환 계수가 있는지 여부를 1 비트를 이용하여 나타낸다.
한편, 단계 S2420에서, 서브블록의 크기가 32x32, 32x16 및 16x32 중 하나가 아니거나 32x32 화소 블록이 아닌 경우에는, 단계 S2450으로 진행하여 CBP를 부호화한다. 이때, 서브 블록의 크기가 32x32, 32x16 또는 16x32 화소 블록이 아닌 경우에 서브 블록의 크기가 16x16, 16x8 또는 8x16 화소 블록인지를 판단할 수 있다. 서브 블록이 16x16, 16x8 또는 8x16 화소 블록인 경우, 해당 서브 블록 내에 0이 아닌 부호화할 계수가 있는 경우에는 CBP16 플래그(예를 들어, ‘1’과 같이 1 비트로 표시될 수 있음)를 부호화하며, 그 외의 경우에는 CBP 플래그를 사용하지 않고 16x16 화소 블록 단위로 CBP를 부호화할 수 있다.
또한, 단계 S2410에서, 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나 이거나 64x64 화소 블록인 경우에는 서브블록 내 0이 아닌 변환 계수가 있는지 여부를 판단하여(S2470), 서브블록 내 0이 아닌 변환 계수가 있는 경우에는 0이 아닌 변환 계수가 있음을 나타내는 CBP64 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있다)를 부호화하고(S2480), 서브블록 내 0이 아닌 부호화할 계수가 없는 경우에는 0이 아닌 부호화할 계수가 없음을 나타내는 CBP64 플래그(예를 들어, '0'과 같이 1 비트로 표시될 수 있다)를 부호화한다(S2490). 여기서, CBP64 플래그는 64x64 화소 블록 내 0이 아닌 양자화된 변환 계수의 존재 유무를 나타내는 플래그이다.
만일, 64x64 화소의 확장된 매크로블록에 대하여 16x16 화소 블록 단위로 인트라 예측 부호화를 수행하는 경우에는 전술한 바와 같이 CBP64 플래그 및 CBP32 플래그는 생략할 수 있으며, 양자화 파라미터에 대한 증감정보(Δpq)를 부호화할 수 있다. 이때, 양자화 파라미터에 대한 증감정보는 확장된 매크로블록 단위로 부호화하는 것이 바람직하다.
CBP 플래그를 부호화하는 경우에 대하여, CBP 플래그가 0이 아닌 경우에 변환 타입을 부호화한다. 예외적으로, 16x16 화소 블록이 네 개의 8x8 화소 블록으로 분할된 경우에는 CBP를 부호화한 후 CBP가 0이 아닌 경우에 16x16 화소 블록 단위로 적용되는 변환 타입을 부호화한다.
변환 타입을 부호화한 후에는 변환 타입에 따라 CBP를 부호화한다. 16x16 변환이 사용된 경우에는 색차 성분의 CBP 2비트만 부호화하며, 8x16 또는 16x8 변환이 사용된 경우에는 16x16 화소 블록 내의 두 개의 8x16 또는 16x8 화소 블록이 0이 아닌 변환 계수를 가지는지를 나타내는 CBP 2비트를 부호화한다. 다만, 예외적으로 두 개의 분할블록 중 첫 번째 분할블록의 CBP 비트가 0인 경우에는 두 번째 분할 블록의 CBP 비트는 부호화하지 않을 수 있다.
도 25는 본 발명의 일 실시예에 따른 CBP의 구조를 나타낸 예시도이다.
도 25에서는 입력 영상이 4:2:0 포맷(Format)인 경우, CBP의 구조를 예시적으로 나타내었다. 휘도 성분의 첫 번째 8x8 화소 블록(Y0) 내에 0이 아닌 변환 계수가 없는 경우 CBP의 최하위 비트(LSB: Least Significant Bit)는 0이고, 두 번째 8x8 화소 블록(Y1) 내에 0이 아닌 양자화된 변환 계수가 있는 경우 CBP의 두 번째 최하위 비트는 1이다. 이와 같은 방식으로 세 번째 8x8 화소 블록(Y2)과 네 번째 8x8 화소 블록(Y3)에 대한 CBP가 할당되고, 두 개의 2x2 색차 성분 DC 블록(U(DC) 및 V(DC)) 내에 0이 아닌 양자화된 변환 계수가 있으므로 색차 DC(Chroma DC)에 대한 비트는 1이고, 두 개의 8x8 색차 성분 AC 블록(U-AC 및 V-AC) 내에 0이 아닌 양자화된 변환 계수가 없으므로 색차 AC(Chroma AC)에 대한 비트는 0이 된다.
도 26은 본 발명의 일 실시예에 따라 CBPX 플래그와 CBP를 부호화하는 순서의 일 예를 나타낸 예시도이다.
도 26에서는 확장된 매크로블록이 64x64 화소 블록이고 현재 부호화 대상인 서브블록의 크기가 64x64, 64x32, 또는 32x64인 경우, CBP64 플래그, CBP32 플래그와 CBP의 부호화 순서를 예시적으로 나타내었다. 도 26에서, 일점 쇄선의 화살표는 CBPX 플래그가 0인 경우 진행되는 순서를 나타내며, 점선의 화살표는 CBPX 플래그가 1인 경우 진행되는 순서를 나타내며, 실선의 화살표는 아무런 조건이 없이 진행되는 순서를 나타낸다.
확장된 매크로블록인 64x64 화소 블록 내에 양자화된 변환 계수가 모두 0인 경우, CBP64 플래그는 0이 부호화되고 한 개 이상의 양자화된 변환 계수가 0이 아닌 경우 CBP64 플래그는 1이 부호화된다. CBP64 플래그가 0인 경우, 더 이상 부호화할 CBP가 없으므로 다음 매크로블록의 CBPX 플래그와 CBP를 부호화한다. CBP64 플래그가 1인 경우, 64x64 화소 블록 내 각 32x32 화소 서브블록의 CBP32 플래그가 부호화되며, CBP32 플래그가 1인 경우 32x32 화소 서브블록 내 4 개의 16x16 화소 블록의 CBP가 부호화된다.
도 27은 본 발명의 일 실시예에 따라 인트라 매크로블록에 대한 CBPX 플래그와 CBP를 부호화하는 순서의 다른 예를 나타낸 예시도이다.
도 27에서는 부호화 대상이 32x32인 화소 블록이고 현재 부호화 대상인 서브블록의 크기가 32x32, 32x16, 또는 16x32인 경우, CBP32 플래그와 CBP의 부호화 순서를 예시적으로 나타내었다. 도 27에서, 일점 쇄선의 화살표는 CBPX 플래그가 0인 경우 진행되는 순서를 나타내며, 점선의 화살표는 CBPX 플래그가 1인 경우 진행되는 순서를 나타내며, 실선의 화살표는 아무런 조건이 없이 진행되는 순서를 나타낸다.
다시 도 1을 참조하면, 영상 부호화 장치(100)의 부호화기(140)는 CBPX(단, X: 32 이상의 정수) 플래그와 CBP를 부호화한 후에는 0이 아닌 양자화된 변환 계수가 있는 블록들에 대해서만 양자화된 변환 계수를 부호화하여 부호화된 영상 데이터를 생성한다. 부호화 대상 블록의 크기가 변환의 크기보다 큰 경우, 블록 내에서 래스터 스캔(Raster-Scan) 순서로 블록의 양자화된 변환 계수를 부호화한다.
도 28은 본 발명의 일 실시예에 따른 분할 타입별 양자화된 변환 계수의 부호화 순서를 나타낸 예시도이다.
도 28에서는 부호화 대상 블록이 32x32 화소 블록인 경우 양자화된 변환 계수를 부호화하는 순서를 예시적으로 나타내었다. 16x16 화소 크기 이상의 블록에 대해서는 16x16 변환(16x16블록 내 16 개의 4x4 블록을 4x4 변환한 후 16 개의 DC 계수에 대해서 4x4 변환을 수행하므로 16x16 화소 단위로 변환이 수행된다고 할 수 있으며, 설명의 편의를 위해 16x16 변환이라 명명한다)이 수행되기 때문에, 32x32 화소 블록의 경우 4 번의 16x16 변환이 수행된다. 32x16 화소 블록인 경우, 각 32x16 화소 블록마다 두 번의 16x16 변환이 수행된다. 16x32 화소 블록인 경우, 각 16x32 화소 블록마다 두 번의 16x16 변환이 수행된다. 16x16 화소 블록인 경우, 각 16x16 화소 블록마다 16x16 변환이 수행된다.
도 29는 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터의 신택스 구조를 나타낸 예시도이다.
도 29에서는 입력 영상이 인터 픽처인 경우에 대해 본 발명의 일 실시예에 따라 부호화하여 생성되는 부호화 데이터의 신택스 구조를 예시적으로 나타내었다. 본 발명의 일 실시예에 따른 인터 픽처에 대한 부호화 데이터는 도시한 바와 같이, SKIP_N 플래그, 매크로 블록 타입 및 분할 타입 중 하나 이상의 필드를 포함하며, 확장된 매크로블록이 인트라 매크로블록인 경우에는 인트라 예측 모드, CBPX 플래그/CBP 및 변환 계수 중 하나 이상의 필드를 추가로 포함하며, 확장된 매크로블록이 인터 매크로블록인 경우에는 SKIPX 플래그, 차분 움직임 벡터/참조 픽처 인덱스, CBPX 플래그, 변환 타입, CBP 및 변환 계수 중 하나 이상의 필드를 추가로 포함하여 구성될 수 있다.
다만, 도 29에서 도시한 인터 픽처에 대한 부호화 데이터의 신택스는 예시적인 것일 뿐, 인터 픽처에 대한 부호화 데이터의 신택스가 반드시 도 29에 도시한 바와 같이 구성되어야 하는 것은 아니다. 즉, 인터 픽처에 대한 부호화 데이터의 신택스 중 일부 또는 전부의 순서가 도 29에 도시한 바와는 다르게 변경될 수도 있으며, 일부의 신택스는 생략될 수도 있음을 인식해야 할 것이다.
다시 도 1을 참조하면, 영상 부호화 장치(100)의 부호화기(140)는 현재 부호화 대상인 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIPN 플래그를 부호화한다. 여기서, N은 매크로블록의 크기를 나타낸다. 예를 들어, 매크로블록이 64x64 화소 블록이면 64x64 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP64 플래그가 부호화되며, 매크로블록이 32x32 화소 블록이면 32x32 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP32 플래그가 부호화되며, 16x16 화소 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP16 플래그가 부호화된다.
만약, 매크로블록이 SKIP 매크로블록인 경우, 현재 매크로블록은 부호화할 데이터가 없으므로 다음 매크로블록이 부호화된다. 매크로블록이 SKIP 매크로블록이 아닌 경우, 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 나타내는 매크로블록 타입 플래그를 전송한다. 예를 들어, 현재 부호화하고자 하는 입력 영상이 P 픽처인 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 P-매크로블록이고, 현재 부호화하고자 하는 입력 영상이 B 픽처의 경우, 사용 가능한 매크로블록 타입은 I-매크로블록과 B-매크로블록이다.
분할 타입 필드와 인트라 픽처에 대한 인트라 예측 모드, CBPX 플래그/CBP, 변환 계수 등의 필드에 대해서는 도 17을 통해 전술하였으므로, 이하에서는 인터 픽처에 대한 SKIPX 플래그, 차분 움직임 벡터/참조 픽처 인덱스, CBPX 플래그, 변환 타입, CBP, 변환 계수 등과 같은 필드에 대해 설명한다.
P-픽처 또는 P-슬라이스의 경우, 도 4의 모든 블록 타입들이 움직임 추정에 사용될 수 있으며, 확장된 매크로블록 내에서 16x16 화소 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수도 있다. 즉, P-픽처 또는 P-슬라이스의 확장된 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다.
부호화할 대상이 32x32 화소 블록인 경우, 32x32 화소 블록 단위로 부호화를 수행할지 또는 16x16 화소 블록 단위로 부호화를 수행할지는 확장된 매크로블록 플래그(extended_mb_flag)를 통해 나타낼 수 있다. 예를 들어, 확장된 매크로블록 플래그가 1인 경우에는 32x32 화소블록 단위로 부호화를 수행함을 의미하며, 확장된 매크로블록 플래그가 0인 경우에는 16x16 화소블록 단위로 부호화를 수행함을 의미할 수 있다. 확장된 매크로블록 플래그가 0인 경우, 확장된 매크로블록은 4개의 16x16 화소블록으로 분할되어 각 16x16 화소블록 단위로 인트라 모드인지 또는 인터 모드인지를 결정할 수 있다. 또한, 각각의 16x16 화소블록 단위는 더 작은 서브블록으로 분할되어 부호화가 수행될 수 있다.
도 30은 본 발명의 일 실시예에 따른 P-픽처(또는 P-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다. 설명을 간단하게 하기 위해 확장된 매크로블록은 32x32 화소 블록이라고 가정한다.
엔트로피 부호화에 있어 문맥기반 적응적 이진 산술 부호화(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 PCTKR2011002763-appb-I000009
현재 블록이 SKIP 모드가 아닌 경우에 interX_flag를 부호화한다. 여기서, interX_flag는 부호화하고자 하는 현재 블록이 인트라 모드인지 또는 인터 모드인지의 여부를 나타내는 플래그이며, 표 6에 나타낸 바와 같이 1비트 또는 2비트로 확장된 매크로블록 내의 분할된 화소 블록들이 인트라 모드인지 또는 인터 모드인지를 나타낼 수 있다.
[표 6]
Figure PCTKR2011002763-appb-I000010
예를 들어, interX_flag가 ‘00’인 경우, 확장된 매크로블록 내의 분할된 모든 서브 블록들이 인트라 모드임을 의미한다. 이 경우, 확장된 매크로블록인 32x32 화소 블록은 4개의 16x16 화소 블록으로 분할되며, 각각의 16x16 화소 블록은 전술한 인트라 예측 부호화 방법으로 부호화된다. 따라서, 확장된 매크로블록 내의 모든 서브 블록들이 인트라 모드인 경우, 분할된 서브 블록의 블록 타입, 휘도 성분과 색차 성분의 인트라 예측 모드, CBP, 양자화 파라미터, 변환 계수 등이 부호화될 수 있다.
도 30에 나타낸 바와 같이 확장된 매크로블록인 32x32 화소 블록에 대하여 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인 경우, 이것은 확장된 매크로블록이 16x16 화소 블록으로 분할되어 부호화되었음을 의미하며, 각각의 16x16 화소 블록에 대하여 각각의 16x16 화소 블록이 SKIP 모드인지를 나타내는 skip16_flag를 부호화한다. 이 경우, 각각의 16x16 화소 블록에 대하여 SKIP 모드가 아닌 16x16 화소 블록에 대해서만 블록 타입과 MVD/ref_idx를 부호화한다. skip16_flag는 표 5를 이용하여 부호화할 수 있다. 이때, skip32_flag와 skip16_flag를 문맥기반 적응적 이진 산술 부호화(CABAC)하는 경우, 전술한 바와 같이 각각의 신택스는 서로 다른 컨텍스트 테이블을 가질 수 있다.
확장된 매크로블록에 대하여 skip32_flag가 0이고 inter32_flag가 01인 경우, 이것은 확장된 매크로블록 내에 인터 모드와 인트라 모드가 모두 사용되었음을 의미한다. 이 경우, ‘extended_mb_flag’는 필요하지 않으며, 확장된 매크로블록은 16x16 화소 블록으로 분할되어 부호화되었음을 의미하므로, 각각의 16x16 화소 블록이 인트라 모드인지 또는 인터 모드인지를 나타내는 표 7을 이용하여 부호화할 수 있다.
[표 7]
Figure PCTKR2011002763-appb-I000011
이때, 확장된 매크로블록 내에 인트라 모드와 인터 모드가 함께 존재하는 경우, 각각의 16x16 화소 블록은 각각의 16x16 화소 블록 내의 서브 블록들이 모두 인터 모드이거나 모두 인트라 모드인 경우가 대부분이며, 16x16 화소 블록 내에 인트라 모드의 서브 블록과 인터 모드의 서브 블록이 동시에 존재하는 경우는 무시할 수 있다. 따라서, 각각의 16x16 화소 블록의 분할 타입을 부호화한 후, inter16_flag가 0인 즉, 인트라 모드인 16x16 화소 블록 내의 서브 블록들은 휘도 성분과 색차 성분을 인트라 예측 모드로 부호화한다. 또한, inter16_flag가 1인 즉, 인터 모드인 16x16 화소 블록들에 대해서는 표 5를 이용하여 skip16_flag를 부호화한다. 여기서, 분할 타입을 부호화 한 후 skip16_flag를 부호화하는 이유는, 확장된 매크로블록 내에 인트라 모드와 인터 모드가 동시에 존재한다는 것은 텍스처(Texture)가 어느 정도 있는 영역임을 의미하기 때문에 인트라 모드 주변에 존재하는 인터 모드는 작은 블록으로 분할되었을 가능성이 높으며, 따라서 분할 타입을 먼저 전송하고 블록의 크기가 16x16인 화소 블록에 대해서만 skip16_flag를 부호화하는 것이 바람직하기 때문이다. 그러나 부호화의 순서는 이에 한정된 것이 아니며, skip16_flag를 먼저 부호화한 후 분할 타입을 부호화할 수도 있다.
이후의 CBPX_flag, 변환 타입, CBP/양자화 파라미터, 변환 계수 등에 대한 부호화는 전술한 바와 동일하므로 그 설명을 생략한다. 다만, 인트라 픽처/슬라이스 또는 인트라 EMB의 경우에는 CBPX_flag를 부호화하지 않을 수 있다.
만일, 확장된 매크로블록이 64x64 화소 블록이라고 하면, 확장된 매크로블록이 32x32 화소 블록인 경우와 마찬가지로, 부호화하고자 하는 현재 블록의 분할 타입 정보가 부호화된 후 16x16 크기 이상인 서브블록들에 대해서만 skipX_flag가 부호화된다. 이 경우, X는 16 또는 32 등 서브블록의 크기를 나타낸다. 예를 들어, 매크로블록이 64x64 화소 블록이고 SKIP 모드가 아니며 확장된 매크로블록의 서브블록의 크기가 64x32, 32x64 및 32x32 중 하나인 경우, 각 서브블록에 대해 skip32_flag가 부호화된다. 64x64 화소인 확장된 매크로블록의 서브블록의 크기가 64x32 또는 32x64인 경우, 두 개의 skip32_flag가 부호화된다. 만약, 서브블록의 크기가 32x32보다 작은 경우에는 skip32_flag는 부호화되지 않는다. 그리고 서브블록의 크기가 32x16, 16x32 및 16x16 중 하나인 경우에는 각 서브블록의 skip16_flag가 부호화된다.
도 31은 본 발명의 일 실시예에 따른 B-픽처(또는 B-슬라이스)에서 사용되는 신택스의 예를 설명하기 위해 도시한 도면이다.
B-픽처에서는 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 하며, 각각의 참조 픽처는 서로 다른 역할을 한다. 일반적으로, L0 예측(List0 Prediction)이 순방향 예측에 사용되며, L1 예측이 역방향 예측에 사용된다. 즉, B-픽처는 현재 부호화 대상 픽처 이전의 픽처와 현재 부호화 대상 픽처 이후의 픽처들을 참조 픽처로 사용할 수 있으며, 그 두 장의 참조 픽처를 동시에 사용(양방향 예측)하여 움직임 추정 및 보상을 할 수 있다. 움직임 추정에 사용되는 블록 타입은 도 2의 모든 블록 타입이 사용될 수 있으며, P-픽처 방식과 동일하게 확장된 매크로블록 내에서 16x16 화소블록 단위로 인트라 모드인지 인터 모드인지를 선택할 수 있다. 본 발명에 따른 실시예에서는, 두 장의 픽처를 순서대로 현재 픽처 이전에 나오는 픽처와 이후에 나오는 픽처로 한정하지 않고, 전후에 상관없이 임의의 두 장을 참조 픽처로 사용할 수 있으며, 이와 같은 두 장의 참조 픽처를 사용하여 움직임 추정/보상(양방향 예측)을 수행할 수 있다.
본 발명의 실시예에 따른 B-픽처에서 사용할 수 있는 부호화 모드로는 인트라 모드, SKIP 모드, 다이렉트(Direct) 모드, L0 예측, L1 예측 및 양방향 등이 있다.
인트라 모드는 전술한 인트라 부호화 방법과 동일한 방법을 사용하여 부호화를 수행하며, 확장된 매크로블록 단위로 인트라 모드를 선택하거나 확장된 매크로블록 내 16x16 화소 블록 단위로 인트라 모드를 선택할 수 있다.
SKIP 모드는 부호화할 현재 블록이 SKIP 모드임을 나타내는 플래그만 전송한다. 이때, 16x16 화소 블록, 32x32 화소 블록 등과 같은 16x16 화소 이상의 블록에 대하여 SKIP 모드를 사용할 수 있으며, 예측된 B_pred_dir, 예측 움직임 벡터 MVD, 예측 ref_idx 등을 사용하여 움직임 보상을 수행하고 움직임 보상을 통해 얻은 참조 블록이 복원된 블록이 된다. 여기서, B_pred_dir은 B-픽처의 예측방향으로서, L0 및 L1의 양방향을 의미한다.
다이렉트 모드는 다이렉트 모드임을 나타내는 플래그와 변환계수 부호화와 관련된 데이터(예를 들면, CBPX_flag/CBP, 양자화 파라미터, 변환 타입, 변환 계수 등)들만을 부호화한다. 즉, 다이렉트 모드는 움직임 정보의 부호화를 생략한 부호화 모드로서, 8x8, 16x16, 32x32 등과 같이 8x8 화소 블록 이상의 블록에 대하여 다이렉트 모드를 사용할 수 있으며, NxN 다이렉트 모드인 경우에 움직임 추정 및 보상은 N/2 x N/2 화소블록 단위로 움직임 추정 및 보상을 수행한다. 예를 들어, 8x8 다이렉트 모드의 경우, 4x4 화소 블록 단위로 움직임 추정 및 보상을 수행한다.
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 PCTKR2011002763-appb-I000012
또한, mvL1은 mvCol과 같은 역방향이기 때문에 수학식 6을 이용하여 구할 수 있다.
[수학식 6]
Figure PCTKR2011002763-appb-I000013
공간 직접예측 모드의 경우에도 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의 참조번호 최소값을 계산하고 그것을 NxN 블록의 참조번호로 한다. 이 참조번호를 구하는 처리도 L0 예측, L1 예측과 독립적으로 수행된다. 또한, 주변블록이 단방향 예측이거나, 화면 내 예측 부호화되는 L0 또는 L1 예측의 움직임 벡터가 존재하지 않는 경우, 그 블록은 참조번호를 구할 때 제외된다. 여기서 주의해야 할 점은 NxN 화소 블록의 직접예측 모드를 수행하는 경우 mvL0, mvL1, L0 참조픽처 및 L1 참조픽처를 구하는 과정은 NxN 화소블록 단위로 수행되지만, 주변블록을 통해 구한 예측 움직임 벡터(mvL0, mvL1)를 사용할지 0 벡터를 사용할지는 블록단위로 결정된다는 것이다.
다음에 SKIP 모드의 움직임 추정/보상 방법을 설명한다.
SKIP 모드는 예측 움직임 벡터를 사용해서 움직임 예측 및 보상을 수행한다는 점은 P-픽처의 SKIP 모드와 동일하지만, B-픽처 내 SKIP 모드에 사용되는 움직임 벡터와 참조 픽처의 Direct 모드의 예측 움직임 벡터, 참조 픽처와 동일하다. 즉, SKIP 모드의 움직임 추정/보상 방법은 전술한 직접예측 모드의 움직임 추정/보상 방법과 동일하다. Direct 모드와 SKIP 모드의 차이점은, SKIP 모드는 움직임 정보와 변환계수도 없는 모드이고, Direct 모드는 움직임 정보만 없는 모드라는 점이다.
한 방향 예측(L0 예측 또는 L1 예측)의 움직임 추정/보상 방법은, 참조픽처가 L0 및 L1 중의 하나라는 점을 제외하고 P-픽처의 움직임 추정 및 보상 방법과 동일하므로 이에 대한 설명은 생략한다.
마지막으로, 양 방향 예측의 움직임 추정/보상 방법에 대하여 설명한다.
움직임 정보를 가지는 B-픽처 내 8x8 이상의 크기를 갖는 화소 블록들에 대해서는 전술한 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-픽처 내 8x8 이상의 크기를 갖는 화소 블록들에 대하여 이와 같은 양방향 예측 모드의 부호화 효율을 비교하여 부호화 효율이 가장 좋은 하나의 양방향 예측 모드를 선택한다. 16x16 이상의 크기를 갖는 화소 블록에 대해서는 전술한 양방향 예측 모드들의 움직임 정보를 찾은 후, 최적의 부호화 모드를 결정할 때 변환, 양자화, 엔트로피 변환계수 부호화를 수행하여 해당 모드에 소요되는 실제 부호화 비트와 예측오차(Distortion)를 이용하여 양방향 예측 모드를 결정하는 것이 바람직하다.
L0 예측, L1 예측 및 양방향 예측에 대하여, 8x8 이상의 각각의 화소 블록들은 서로 다른 참조영상을 사용할 수 있으나, 8x8 화소블록 내의 서브 블록들은 동일한 참조영상을 사용한다.
도 1을 참조하면, 감산기(120)는 움직임 추정기(116)에서 추정한 현재 블록의 움직임 벡터가 가리키는 참조 블록과 현재 블록을 감산하여 잔여 블록을 생성하고, 생성된 잔여 블록은 변환기 및 양자화기(130)에 의해 변환 및 양자화된 후, 양자화된 변환 계수가 부호화기(140)에 의해 엔트로피 부호화되어 부호화 데이터가 생성된다. 여기서, B-픽처에 대한 변환 방법은 전술한 P-픽처에 대한 변환 방법과 동일하므로, 그에 대한 상세한 설명은 생략한다.
도 31에는 확장된 매크로블록이 32x32 화소 블록인 것으로 가정하여 B-픽처(또는 B-슬라이스)의 비트스트림을 통해 전송할 데이터를 나타내었다. 일반적으로, B-픽처(또는 B-슬라이스)의 전송 신택스는 도 30에서 설명한 P-픽처(또는 B-슬라이스)의 전송 신택스와 유사하며, 여기서는 P-픽처의 신택스에 추가되는 부분만을 설명한다.
directX_flag는 SKIP 모드가 아닌 인터 블록들 중에서 확장된 매크로블록, 16x16 이상의 화소 블록 및 8x8 화소 블록에 대해서만 direct 모드인지의 여부를 나타내는 플래그로서 표 8과 같이 1비트로 이루어질 수 있다.
[표 8]
Figure PCTKR2011002763-appb-I000014
Direct 모드인 경우에 움직임 정보는 부호화하지 않으며, 변환 계수와 관련된 정보들을 부호화한다. 또한, 확장된 매크로블록이 Direct 모드가 아닌 경우, 움직임 정보(예를 들어, B_pdir, MVD, ref_idx 등)의 데이터를 부호화한다. 여기서, B_pdir는 현재 블록의 예측 방향(L0 예측, L1 예측, 양방향 예측)을 나타내는 정보로서, SKIP 또는 direct 모드가 아닌 인터 블록들에 대해서만 부호화하며 표 9와 같이 3가지 모드가 있다.
[표 9]
Figure PCTKR2011002763-appb-I000015
양방향 예측인 경우, 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에서는 매크로블록이 64x64 화소 블록인 경우 다양한 크기와 모양의 서브블록으로 분할된 매크로블록의 분할 타입과 각 서브블록의 부호화 순서를 예시적으로 나타내었다. 도 32와 같이 매크로블록이 분할된 경우, 11 번째 16x16 화소 서브블록에 대해 SKIP16 플래그가 부호화되고, 12 번째 16x16 화소 서브블록의 SKIP16 플래그가 부호화되며, 15 번째 16x32 화소 서브블록의 SKIP16 플래그가 부호화되며, 16 번째 16x32 화소 서브블록의 SKIP16 플래그가 부호화되며, 17 번째 32x32 화소 서브블록의 SKIP32 플래그가 부호화되며, 18 번째 32x32 화소 서브블록의 SKIP32 플래그가 순서대로 부호화된다.
SKIP 매크로블록이 아닌 매크로블록의 서브블록들에 대해서는 해당 서브블록의 움직임 벡터와 해당 서브블록의 주변 블록을 이용하여 추정한 예측 움직임 벡터 간의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector)와 참조 픽처 인덱스를 포함하는 움직임 정보가 부호화된다.
도 33 및 도 34는 본 발명의 일 실시예에 따라 인터 매크로블록에 대한 CBPX_플래그, 변환 타입과 CBP를 부호화 과정을 설명하기 위한 예시도이다.
도 33과 도 34에서는 매크로블록이 64x64 화소 블록인 경우 CBPX_플래그, 변환 타입(Transform Type)과 CBP를 부호화하는 과정을 예를 들어 나타내었다. 영상 부호화 장치(100)의 부호화기(140)는 확장된 매크로블록의 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나인지 여부를 판단하여(S3302), 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나가 아닌 경우에는 서브블록의 크기가 32x32, 32x16 및 16x32 중 하나인지 여부를 판단한다(S3304).
단계 S3304의 판단 결과, 서브블록의 크기가 32x32, 32x16 및 16x32 중 하나인 경우, 해당 서브블록 내 0이 아닌 양자화된 변환 계수가 있는지 여부를 판단하여(S3306), 0이 아닌 양자화된 변환 계수가 있는 경우에는 해당 서브블록 내에 0이 아닌 양자화된 변환 계수가 있음을 나타내는 CBP32 플래그(예를 들어, '1'과 같이 1 비트로 표시될 수 있음)를 부호화한다(S3308).
단계 S3308에서 CBP32 플래그를 부호화한 후, 서브블록 내의 16x16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 판단하여(S3310), 0이 아닌 양자화된 변환 계수가 있는 경우에는 16x16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있음을 나타내는 CBP16 플래그를 부호화한다(S3312).
이와 같이 CBPX 플래그를 부호화한 후에는 0이 아닌 양자화된 변환 계수를 가지는 블록들에 대해서만 변환 타입을 부호화한다(S3316). 이때, 서브블록의 크기가 16x16이상이면 서브블록마다 변환 타입를 부호화하며, 16x16보다 작은 경우에는 16x16마다 하나의 변환플래그를 부호화한다. 변환은 16x16 화소 단위로 선택되기 때문이다. 예를 들어, 64x64 화소 매크로블록이 두 개의 64x32 화소 서브블록으로 분할되고 CBP64 플래그가 0이 아닌 경우, 각 64x32 화소 서브블록 내 두 개의 CBP32 플래그가 0이 아닌 64x32 화소 서브블록에 대해 변환 타입를 부호화한다.
여기서, 서브블록의 크기가 16x16이상이며 서브블록에 속한 CBPX 플래그가 모두 0이 아닌 경우, 표 3을 이용하여 각 서브블록의 변환 타입을 부호화한다.
[표 10]
Figure PCTKR2011002763-appb-I000016
또한, CBP16 플래그가 0이 아니며 16x16 화소 블록이 두 개의 8x16 화소 블록 또는 16x8 화소 블록으로 분할된 경우 표 4를 이용하여 16x16 화소 블록 단위로 변환 타입을 부호화한다.
[표 11]
Figure PCTKR2011002763-appb-I000017
CBP16 플래그가 0이 아니며 16x16 화소 블록이 4 개의 8x8 화소 블록으로 분할되고, 4x4 변환이 선택된 경우에는 0을 변환 타입으로서 부호화하고, 8x8 변환이 선택된 경우에는 1을 변환 타입으로서 부호화하며, 그 외의 경우에는 변환 타입을 부호화하지 않는다.
단계 S3316에서 변환 타입을 부호화한 후에는, 변환 타입에 따라 CBP를 부호화한다. 이를 위해, 변환 타입이 16x16 변환인지 여부를 판단하여(S3318), 16x16 변환인 경우에는 색차 성분(Chroma Component)의 CBP 2 비트만을 부호화하며(S3320), 16x16 변환이 아닌 경우에는 변환 타입이 8x16 변환 또는 16x8 변환인지 여부를 판단하여(S3322), 8x16 변환 또는 16x8 변환인 경우에는 휘도 성분(Luma Component)의 CBP 2비트와 색차 성분의 CBP 2비트를 부호화하며(S3324), 8x16 변환 또는 16x8 변환이 아닌 경우에는 변환 타입이 8x8 변환 또는 4x4 변환인지 여부를 판단하여(S3326), 8x8 변환 또는 4x4 변환인 경우에는 휘도 성분의 CBP 4 비트와 색차 성분의 CBP 2 비트를 부호화한다(S3328). 단계 S3320, S3324, S3328에서는, 입력 영상이 4:2:0 포맷인 경우의 휘도 성분의 CBP와 색차 성분의 CBP를 부호화하는 예를 설명한 것이므로, 입력 영상의 포맷이 변경되는 경우에는 그에 따라 휘도 성분의 CBP와 색차 성분의 CBP를 부호화하는 방법이 달라질 수 있다.
한편, 단계 S3306에서의 판단 결과, 서브블록 내 0이 아닌 양자화된 변환 계수가 없는 경우에는, 서브블록 내 0이 아닌 양자화된 변환 계수가 없음을 나타내는 CBP32 플래그를 부호화한다(S3330). 서브블록 내 0이 아닌 양자화된 변환 계수가 없으므로 변환 타입과 CBP는 부호화하지 않는다.
또한, 단계 S3302에서의 판단 결과, 서브블록의 크기가 64x64, 64x32 및 32x64 중 하나인 경우에는 서브블록 내 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 PCTKR2011002763-appb-I000018
여기서, 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인 경우는 32x32 화소 블록인 확장된 매크로블록에 대한 컨텍스트 테이블의 예측 타입의 예를 나타내며, ctx_inc가 7 내지 9인 경우는 16x16 화소블록에 대한 컨텍스트 테이블의 예측 타입의 예를 나타내고, 각각의 ctx_inc에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 마찬가지로, directX_flag의 부호화/복호화를 위한 ctx_inc는 도 37에 나타낸 바와 같다. 전술한 표 8에서 설명한 바와 같이 directX_flag의 부호화 비트는 1비트로 나타낼 수 있으며, 부호화할 대상 블록의 상단 블록 및 좌측 블록이 모두 direct 모드가 아닌 경우와, 모두 direct 모드인 경우, 그리고 상단 블록 또는 좌측 블록 중 어느 한 블록만 direct 모드인 경우에 따라 컨텍스트 테이블을 다르게 결정할 수 있다. 또한, extended_flag의 부호화/복호화를 위한 ctx_inc의 경우에도 도 37과 유사하게 부호화할 대상 블록의 주변 블록이 확장된 매크로블록 단위로 부호화가 수행되었는지(이 경우, extended_mb_flag를 이진비트 1로 설정할 수 있다) 또는 16x16 화소블록으로 분할되어 부호화가 수행되었는지(이 경우, extended_mb_flag를 이진비트 1로 설정할 수 있다)에 따라 컨텍스트 테이블을 다르게 사용할 수 있다. 이와 같이, interX_flag의 경우 X의 값, 픽처 타입, 참조 픽처로 사용되는지의 여부, 이웃 블록들의 데이터에 따라 다른 컨텍스트 테이블을 사용할 수 있다. 본 발명의 실시예에서는 매크로블록 내의 분할된 서브블록들 중 부호화할 현재 블록의 주변블록의 컨텍스트를 이용하여 컨텍스트 테이블을 선택적으로 사용할 수 있다. 이 경우, 부호화할 현재 블록의 주변블록이 SKIP 모드인지의 여부, 매크로블록 단위의 SKIP 모드인지 또는 매크로블록 내의 서브블록 단위의 SKIP 모드인지의 여부 등을 고려할 수 있으며, 이와 같은 주변블록의 상황에 따라 부호화할 블록에 대한 skipX_flag, interX_flag, extended_mb_flag 등에 대한 컨텍스트 테이블을 선택적으로 사용할 수 있다.
도 38 및 도 39는 본 발명의 일 실시예에 따라 분할 타입 정보를 부호화하는 과정을 설명하기 위한 예시도이다.
도 38에서는 트리 구조를 이용하여 분할 타입 정보를 부호화하기 위해 부호화하고자 하는 확장된 매크로블록 내 각 16x16 화소 블록에 대한 분할 타입 값을 나타낸다.
38A에서 Mx(a,b)는, 부호화하고자 하는 확장된 매크로블록 내의 (a,b)의 위치에 해당하는 16x16 화소 블록의 분할 타입 값을 나타낸다. 즉, Mx(0,0)은 부호화하고자 하는 확장된 매크로블록 내의 (0,0)의 위치 즉, 부호화하고자 하는 확장된 매크로블록 내에서 래스터 스캔 방향으로 첫 번째의 16x16 화소 블록의 분할 타입 값을 나타내며, Mx(0,1)은 부호화하고자 하는 확장된 매크로블록 내의 (0,1)의 위치 즉, 부호화하고자 하는 블록 내에서 래스터 스캔 방향으로 두 번째의 16x16 화소 블록의 분할 타입 값을 나타낸다.
38A에 나타낸 16x16 화소 블록에 대한 분할 타입 값들을 일정한 영역 단위 예를 들면, KxL 개의 분할 타입 값들을 포함하는 영역 단위로 그룹화하고, 그룹화된 영역 내의 분할 타입 값들 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값으로 할당한다. 그룹화된 영역에 대한 분할 타입 값을 Mx-1(c, d)라고 하면, c=a/K이며, d=b/L이 된다. 여기서, Mx-1은 Mx의 상위 노드이며, 상위 노드의 값을 선택하는 방법으로 가장 큰 값을 선택할 수도 있다. 또한, 상위 노드 값을 선택하는 방법을 부호화하여 적응적으로 사용할 수도 있다.
38B는 38A에 나타낸 16x16 화소블록들에 대한 분할 타입 값들을 2x2 개의 분할 타입 값들을 포함하는 영역 단위로 그룹화하고, 각각의 그룹 내의 분할 타입 값들 중 최소값을 그룹화된 영역에 대한 분할 타입 값으로 할당한 결과를 나타내었다. 즉, 38A에서 나타낸 16x16 화소 블록 (0,0), (0,1), (1,0), (1,1)을 포함하는 화소 블록들의 분할 타입 값을 2x2개의 영역 단위로 그룹화하고, 그룹화된 영역 내에 포함된 각 16x16 화소 블록들의 분할 타입 값 MX(0,0), MX(0,1), MX(1,0), MX(1,1) 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값 MX-1(0,0)으로 할당하였다. 다시, 16x16 화소블록 (0,2), (0,3), (1,2), (1,3)을 포함하는 화소 블록들의 분할 타입 값을 2x2개의 영역 단위로 그룹화하고, 그룹화된 영역 내에 포함된 각 16x16 화소 블록들의 분할 타입 값 MX(0,2), MX(0,3), MX(1,2), MX(1,3) 중 최소값을 선택하여 그룹화된 영역에 대한 분할 타입 값 MX-1(0,1)의 분할 타입 값으로 할당하였다. 이와 같은 방식으로 나머지 16x16 화소 블록들에 대해서도 동일한 과정을 수행한다. 38A에 나타낸 16x16 화소 블록들의 분할 타입 값을 38B에 나타낸 그룹화된 영역의 분할 타입 값으로 할당하는 과정을 MX-2, MX-3 … M1 레이어(Layer)까지 반복적으로 수행하면 36C와 같이 그룹화된 영역의 분할 타입 값을 할당할 수 있으며, 다시 M0 레이어까지 반복하면 38D와 같이 하나의 그룹화된 영역의 분할 타입 값을 가지도록 그룹화할 수 있다.
다만, 도 38에서는 2x2개의 영역 단위로 인접한 16x16 화소 블록들에 대한 분할 타입 값들을 그룹화하는 것으로 설명했지만, 반드시 이에 한정되지 않고 4x2개, 2x4개 등과 같이 다양한 크기의 영역 단위로 인접한 16x16 화소 블록들에 대한 분할 타입 값들을 그룹화하거나, 인접하지 않은 16x16 화소 블록들에 대한 분할 타입 값들을 일정한 영역 단위로 그룹화하여 분할 타입 값을 할당할 수도 있다.
도 38에 도시한 바와 같이 부호화하고자 하는 블록의 16x16 화소 블록들의 분할 타입 값을 그룹화된 영역의 분할 타입 값으로 할당한 것을 트리 구조로 나타내면 도 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에 나타낸 바와 같은 분할 타입 값을 사용하며 확장된 매크로블록을 16x16 화소 블록으로 분할하는 경우(즉, extended_mb_flag = 0인 경우), 전술한 방법을 이용하여 분할 타입을 부호화/복호화한다. 이 경우, 가장 하위 노드의 값은 확장된 매크로블록 내의 16x16 화소 블록의 분할 타입 값이며, 하위 노드들의 값들의 최대값을 상위노드의 대표값으로 이용할 수 있다. 예를 들어, 도 40에서와 같이, 32x32 화소 블록의 확장된 매크로블록이 16으로 패딩된 이미지에 속하고 16x16 화소 블록으로 분할된 경우, 최상위 노드의 대표값은 0이므로 최상위 노드의 부호화는 분할 타입의 최대값 3과 대표값 0의 차이값인 3을 나타내는 이진비트‘000’부호화한다. 다른 예로, 도 41에서와 같이 32x32 화소 블록의 확장된 매크로블록이 16으로 패딩된 이미지에 속하고 3개의 16x16 화소 블록은 8x8 이하의 화소 블록으로 분할되어 부호화되며 하나의 16x16 화소 블록은 16x16 화소 블록으로 부호화되는 경우, 최상위 노드의 대표값은 3이므로 최상위 노드의 대표값 3과 분할 타입의 최대값 3의 차이값을 나타내는 이진비트 1을 부호화하며, 하위 노드들의 값과 상위 노드의 값 사이의 차이값이 0인 경우는 ‘이진비트 ‘1’을 부호화하고 차이값이 3인 경우는 이진비트 ‘000’을 부호화한다.
인트라 예측 모드의 부호화는 도 6 내지 도 10에서 설명한 바와 같이, 휘도 성분의 4x4, 8x8 화소 블록의 인트라 예측 모드는 주변블록을 이용해서 예측한 예측 인트라 모드와 같은지를 나타내는 1비트 플래그를 부호화하고, 예측 인트라 모드와 다른 경우 9가지 예측 모드 중 예측한 예측방향을 뺀 나머지 8가지의 예측 모드 중 어떤 모드인지를 3비트를 사용하여 나타낸다. 또한, 16x16 화소 블록은 4가지 예측모드 중 어떤 모드를 사용하는지 2비트를 사용하여 나타낸다. 또한, 4x4 화소 블록, 8x8 화소 블록 및 16x16 화소 블록을 제외한 나머지 mxn 화소 블록의 인트라 예측 모드는 주변 블록을 이용해 예측한 예측 인트라 모드와 같은지를 나타내는 1비트 플래그를 부호화하고, 예측 인트라 모드와 다른 경우 3가지 예측 모드 중 예측한 예측 방향을 뺀 나머지 2가지의 예측 모드 중 어떤 모드인지를 1비트를 사용하여 나타낸다. 또한, 색차 성분의 16x16 화소 블록은 4가지 예측 모드 중 어떤 모드인지를 사용하는지를 2비트를 사용하여 나타낸다. 여기서, 휘도 성분의 4x4, 8x8, 16x16, mxn 화소 블록과 색차 성분은 다른 컨텍스트 테이블을 사용하는 것이 바람직하다.
도 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에서 설명한 바와 같이, 16x16 화소 블록이 4 개의 8x8 화소 서브블록으로 분할된 경우에는 선택 가능한 변환의 종류가 4x4 변환 및 8x8 변환 2가지이므로, 대상 신택스는 현재 블록의 상단 블록 및 좌측 블록이 모두 4x4 변환인 경우, 모두 8x8 변환인 경우, 또는 어느 하나의 블록은 4x4 변환이고 다른 하나의 블록은 8x8 변환인 경우에 따라 컨텍스트 테이블을 다르게 결정하여 사용할 수 있다.
도 44 및 도 45는 각각 사용 가능한 변환의 종류가 3가지인 경우의 변환 타입의 부호화/복호화를 위한 ctx_inc의 다른 예를 나타낸 도면으로서, 도 44는 첫 번째 비트 부호화에 사용되는 컨텍스트 테이블을 선택하기 위한 ctx_inc의 예를 나타내며, 도 45는 두 번째 비트 부호화에 사용되는 컨텍스트 테이블을 선택하기 위한 ctx_inc의 예를 나타낸다.
전술한 바와 같이, 8x8 화소 블록보다 작은 화소 블록 즉, 4x4 화소 블록, 4x8 화소 블록 또는 8x4 화소 블록으로 분할된 경우에는 4x4 변환을 수행하고, 8x8 화소 블록 4x4 변환 및 8x8 변환 중 부호화 비용이 작은 변환을 수행하며, 8x16 화소 블록은 4x4 변환, 8x8 변환 및 8x16 변환 중 부호화 비용이 작은 변환을 수행하고, 16x8 화소 블록은 4x4 변환, 8x8 변환 및 16x8 변환 중 부호화 비용이 작은 변환을 수행하며, 16x16 화소 블록 이상의 블록은 4x4 변환, 8x8 변환 및 16x16 변환 중 부호화 비용이 작은 변환을 수행하므로, 도 44에 나타낸 바와 같이 첫 번째 비트 부호화에서는 현재 블록의 상단 블록 및 좌측 블록이 모두 4x4 변환된 블록인지, 좌측 블록 및 상단 블록 중 어느 하나의 블록만이 4x4 변환된 블록인지 또는 모두 4x4 변환된 블록이 아닌지에 따라 변환 타입의 부호화/복호화를 위한 ctx_inc를 다르게 사용할 수 있다. 마찬가지로, 두 번째 비트 부호화에서는 현재 블록의 상단 및 좌측 블록 중 적어도 어느 하나의 블록이 8x8 변환된 블록인지의 여부에 따라 도 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)가 확장된 매크로블록에 대하여 16x16 화소 블록 단위로 인트라 예측 부호화를 수행한 경우에는 CBPX 플래그의 복호화는 생략될 수 있으며, 이 경우 확장된 매크로블록 단위로 부호화된 양자화 파라미터에 대한 복호화가 수행될 수 있다.
다만, 도 17에 도시한 영상 부호화 데이터의 신택스의 구조는 예시적인 것일 뿐, 본 발명의 일 실시예에 따른 영상 부호화 데이터의 신택스 구조가 도 17에 도시한 구조로 한정되는 것은 아니다. 또한, 도 24에 도시한 CBPX 플래그 또는 CBP의 부호화 순서는 예시적인 것일 뿐, 본 발명의 일 실시예에 따른 CBPX 플래그 또는 CBP의 복원 순서는 도 24에 도시한 순서로 한정되는 것은 아니다.
여기서, 복호화기(4610)가 인트라 예측 모드를 복원화하는 방법은 서브블록의 크기에 따라 다르다. 즉, 서브블록의 크기가 4x4 또는 8x8과 같이 16x16이 아닌 경우, 복호화기(4610)는 비트스트림으로부터 추출되는 인트라 예측 모드 데이터 중 1 비트를 복호화하여 예측 모드 플래그를 복원하고, 복원되는 예측 모드 플래그가 해당 서브블록의 인트라 예측 모드에 따른 예측 방향이 주변 블록으로부터 추정되는 해당 서브블록의 인트라 예측 모드에 따른 예측 방향과 동일함을 나타내는 경우, 주변 블록으로부터 추정되는 해당 서브블록의 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원하고 다음 서브블록의 인트라 예측 모드를 복호화하며, 동일하지 않음을 나타내는 경우 인트라 예측 모드 데이터의 다음 3 비트를 복호화하여 복원되는 인트라 예측 모드를 현재 블록의 인트라 예측 모드로서 복원한다. 또한, 서브블록의 크기가 16x16인 경우, 복호화기(4610)는 비트스트림으로부터 추출되는 인트라 예측 모드 데이터 중 2 비트를 복호화하여 현재 블록의 인트라 예측 모드를 복원한다. 이와 같이 복원되는 인트라 예측 모드는 예측기(4630)의 인트라 예측기(4632)로 입력된다.
또한, 32x32 화소 블록인 확장된 매크로블록이 인트라 모드인 경우, 확장된 매크로블록 내의 16 화소의 배수로 패딩된 이미지에 속하는 블록을 판단한 후, 해당 블록의 분할 타입을 엔트로피 복호화할 수 있다. 도 3의 경우, 32x32 화소 블록인 확장된 매크로블록 내의 패딩된 이미지에 속하는 블록은 첫 번째의 16x16 화소 블록만이 해당되며, 따라서 첫 번째의 16x16 화소 블록의 분할 타입을 엔트로피 복호화한다. 만약, 해당 16x16 화소 블록이 두 개의 16x8 화소 블록으로 분할된 경우를 가정하면, 두 개의 인트라 예측 모드를 엔트로피 복호화하고 16x16 화소 블록을 위한 CBP 1개와 16x16 변환 계수를 복호화한다. 엔트로피 복호화를 통해 얻은 서브 블록 타입과 인트라 예측 모드, 변환 계수를 이용하여 해당 16x16 화소 블록을 복호화한다.
복호화할 픽처가 인터 픽처인 경우 복호화기(4610)가 영상 부호화 데이터 내에서 복호화할 데이터의 종류와 순서는 도 29에 도시한 바와 같다. 즉, 복호화기(4610)는 비트스트림으로부터 추출되는 SKIPN 플래그 데이터를 복호화하여 현재 복호화하고자 하는 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIPN 플래그를 복원한다. 복호화기(4610)는 복원되는 SKIPN 플래그에 의해 식별되는 매크로블록이 SKIP 매크로블록이 아닌 경우, 비트스트림으로부터 추출되는 매크로블록 타입 플래그 데이터와 분할 타입 데이터를 복호화하여 매크로블록 타입 플래그와 분할 타입 정보를 복원한다.
또한, 확장된 매크로블록이 32x32 화소 블록인 경우, 확장된 매크로블록 내의 16 화소의 배수로 패딩된 이미지에 속하는 블록을 판단한 후, skip32_flag를 복호화하고 현재 복호화할 확장된 매크로블록이 SKIP 모드인 경우에 해당 블록의 좌측 및 상단의 주변 블록을 이용하여 예측 움직임 벡터를 구하고 움직임 보상을 수행할 수 있다. 도 3의 경우, 32x32 화소 블록인 확장된 매크로블록 내의 패딩된 이미지에 속하는 블록은 첫 번째의 16x16 화소 블록만이 해당되며, skip32_flag를 복호화하고 현재 복호화할 확장된 매크로블록이 SKIP 모드인 경우에 첫 번째의 16x16 화소 블록의 좌측 및 상단의 주변 블록을 이용하여 예측 움직임 벡터를 구하며, 움직임 보상을 수행할 수 있다.
복원되는 매크로블록 타입 플래그에 의해 식별되는 매크로블록 타입이 인트라 매크로블록인 경우에는 전술한 바와 동일하며, 매크로블록 타입이 인터 매크로블록인 경우, 복호화기(4610)는 서브블록의 크기가 16x16 이상인 서브블록들에 대해서만 SKIPX 플래그 데이터를 복호화하여 SKIPX 플래그를 복원하고 복원되는 SKIPX 플래그에 의해 식별되는 SKIP 블록이 아닌 서브블록 또는 16x16보다 작은 크기를 가지는 서브블록들(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)는 복호화하고자 하는 매크로블록이 인트라 매크로블록인 경우, 부호화 데이터를 복호화하여 분할 타입 정보, 인트라 예측 모드 및 양자화된 변환 계수를 복원하고, 복원되는 분할 타입 정보에 따라 식별되는 서브블록의 크기에 따라 선택되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 복원되는 인트라 예측 모드를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
이때, 서브블록의 크기에 따라 선택되는 변환은 서브블록의 크기가 4x4, 4x8 및 8x4 중 하나이면 4x4 변환을 이용하고, 서브블록의 크기가 8x8, 8x16 및 16x8 중 하나이면 8x8 변환을 이용하며, 서브블록의 크기가 16x16 이상이면 16x16 변환을 이용할 수 있다.
또한, 본 발명의 일 실시예에 따른 영상 복호화 방법에 따르면, 영상 복호화 장치(3000)는 복호화하고자 하는 매크로블록이 인터 매크로블록인 경우, 부호화 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하고, 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 양자화된 변환 계수를 역양자화 및 역변환하여 잔여 서브블록을 복원하며, 복원되는 분할 타입 정보에 따라 식별되는 서브블록으로 분할하고 서브블록을 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 예측 서브블록과 잔여 서브블록을 가산하여 서브블록을 복원한다.
이때, 변환 타입 정보에 의해 식별되는 변환은 4x4 변환, 8x8 변환, 8x16 변환, 16x8 변환 및 16x16 변환 중 하나일 수 있다. 또한, 영상 복호화 장치(4600)는 복원되는 서브블록을 필터링할 수 있는데, 복원되는 서브블록 내의 선택되는 변환에 따른 블록의 왼쪽과 위쪽의 경계에 디블로킹 필터링을 수행할 수 있다.
또한, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 SKIP_N 플래그 데이터를 복호화하여 매크로블록이 SKIP 매크로블록인지 여부를 나타내는 SKIP_N 플래그를 추가로 복원할 수 있다. 영상 복호화 장치(4600)는 복원되는 SKIP_N 플래그에 의해 SKIP 매크로블록이 아닌 것으로 식별되는 매크로블록에 대해서만 복호화 과정을 수행할 수 있다.
또한, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 매크로블록 타입 플래그 데이터를 복호화하여 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 나타내는 매크로블록 타입 플래그를 추가로 복원할 수 있다. 영상 복호화 장치(4600)는 복원되는 매크로블록 타입 플래그에 복호화하고자 하는 매크로블록이 인트라 매크로블록인지 또는 인터 매크로블록인지 여부를 파악하고, 그에 따라 인트라 예측 복호화를 수행할지 또는 인터 예측 복호화를 수행할지 여부를 결정할 수 있다.
한편, 매크로블록의 타입에 관계없이, 분할 타입 정보는 분할 레이어별 분할 타입 번호에 의해 식별될 수 있으며, 영상 복호화 장치(4600)는 부호화 데이터로부터 추출되는 CBP 데이터를 복호화하여 서브블록의 크기에 따른 CBPX 플래그와 CBP를 추가로 복원할 수 있다. 여기서, CBPX 플래그는 XxX 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 나타내는 플래그이고 CBP는 16x16 화소 블록 내에 0이 아닌 양자화된 변환 계수가 있는지 여부를 나타내는 플래그일 수 있다.
제 2 실시예:
이하, 본 발명의 제 2 실시예를 설명한다. 특히, 본 발명의 제 2 실시예는 예측 서브 블록과 변환 서브 블록의 신택스 구조와 신택스에 따른 CABAC 부호화에 대해 서술한다.
또한, 그에 따른 부호화 정보를 CABAC을 이용하여 부호화 할 때, 매크로 블록, 서브 브록, 예측 서브 블록, 변환 서브 블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화 및 복호화한다.
본 발명의 제 2 실시예에서, 입력 영상은 프레임 단위 또는 필드 단위로 도 1의 영상 부호화 장치(100)에 입력되거나, NxN(단, N은 16이상의 정수) 화소를 가지는 매크로블록들로 분할되어 영상 부호화 장치(100)에 입력될 수 있다. 이하에 기재하는 매크로블록은 정방형의 서브 블록으로 분할 될 수 있다. 또한, 각 매크로블록과 서브 블록들은 예측을 위하여 예측 서브 블록으로 분할 될 수 있다. 매크로블록과 서브 블록들은 MxM, (M/2)x(M/2), Mx(M/2), (M/2)xM, 1xM, Mx1, (단, M=N)등의 크기를 갖는 예측 서브 블록으로 가변적으로 분할 될 수 있다. 또한, 변환 타입은 변환 서브 블록에 따라 결정될 수 있는데, 변환 서브 블록은 예측 서브 블록과 유사한 방식으로 매크로블록 또는 매크로블록의 서브 블록을 가변적으로 분할함으로써 얻어질 수 있다.
한편, N의 배수가 아닌 경우에는 입력 영상에 대해 N의 배수가 되도록 패딩한 후 영상 압축을 수행할 수 있다.
영상 부호화 장치(100) 는 매크로블록을 서브 블록으로 분할하여 부호화했을 경우의 각 서브 블록에 대한 부호화 효율을 계산하고, 가장 부호화 효율이 높은 경우의 서브 블록을 최종적인 인트라 블록 또는 인터 블록으로 결정한다. 부호화 효율은 수학식 1 에 근거하여 측정할 수 있다.
블록의 모드는 가능한 블록들의 모든 타입에 대하여 각 예측 서브 블록의 최적의 예측 모드(인트라 예측모드, 움직임 데이터)를 결정한 후, 블록 타입을 결정하는 과정으로 나뉠 수 있으며, 보통 예측모드 결정시(인트라 예측모드나 움직임 벡터/참조픽처 선택시)에는 연산량을 줄이기 위해서 수학식 2를 이용하여 최적의 예측 모드를 결정한다.
서브 블록의 타입 결정시에는 수학식 8을 이용하여 엄격하게 Rdcost를 계산하는 것이 바람직하다.
[수학식 8]
Figure PCTKR2011002763-appb-I000019
수학식 8의 Distortion 은 수학식 4로 나타낼 수 있다.
예측 서브 블록의 예측 모드 결정시에는 수학식 9를 이용하여 Rdcost를 계산하는 것이 바람직하다.
[수학식 9]
Figure PCTKR2011002763-appb-I000020
도 1의 영상 부호화 장치(100)를 참조하면서 본 실시예에 따른 부호화 방법이 설명된다. 그러나, 도 1의 영상 부호화 장치(100)의 각 구성요소 중 일부는 제1실시예에서와 다른 동작을 수행한다는 점은 아래 기술 자체에서 명확하게 이해될 수 있을 것이다.
이하에서는 본 발명의 제2 실시예에 따른 부호화 방법, 그 부호화 방법을 통해 생성되는 부호화 데이터를 픽처 타입에 따라 설명한다.
예측기(110) 의 인트라 예측기(112) 는 현재 부호화하고자 하는 블록(이하 '현재 블록'이라 칭함)의 주변 화소를 이용하여 참조 블록을 생성하고 참조 블록과 현재 블록을 비교하여 인트라 예측 모드를 결정한다. 여기서, 주변 화소란 현재 블록과 인접한 화소들을 의미하고, 넓게는 현재 블록 주위에 있는 블록 내에 있는 화소들을 말한다. 또한, 인접한 화소들을 이용하여 산출된 화소도 포함하는 개념이다.도 47은 영상의 경계 또는 슬라이스의 경계 등에서 인트라 예측을 나타낸 예시도이다.
도 47을 참조하면, 현재 블록이 A 인 경우 참조 화소가 왼쪽 블록인 블록 C의 화소 밖에 없으므로 예측 모드에 제약이 존재한다. 따라서, 블록 A의 위쪽에 블록 C의 화소를 복사해서 사용한다. 이와 유사하게, 블록 B의 경우 참조 화소가 위쪽 블록인 블록 C의 화소 뿐이므로, 블록 B의 왼쪽에 블록 C 의 화소를 복사해서 사용한다.
또는 값이 존재하지 않는 화소는 128로 가정하여 사용할 수도 있다.
인트라 예측 모드 중 Plane 모드는 Plane 플래그로 부호화한다. 예를 들어 현재 예측 모드가 Plane 모드인 경우 Plane 플래그를 1로 부호화한다.
도 48은 Plane 모드의 예시를 나타낸 도면이다.
도 48을 참조하면, Plane 모드인 경우 48-1과 48-2 블록을 생성하여 두 블록의 평균값이 예측 화소로서 사용된다. 48-1 블록의 경우, A 화소가 도면에 도시한 바와 같이 그 아래 방향으로 복사되고, 나머지 화소는 복사한 값과 현재 블록의 왼쪽에 인접한 화소들을 이용하여 위치에 따라 생성된다. 예를 들어 도면에서 X 화소를 생성 할 때는, X 화소의 위치가 (2, 4) 이므로, Ax(2/8) + Cx(6/8)의 수학식에 의해 X 화소의 값이 산출된다. 48-2 블록도 48-1 블록과 유사한 방식으로 생성된다.
인트라 예측 모드를 부호화 할 때, 현재 블록의 예측 모드가 주변 인트라 블록의 예측 모드와 동일한지 여부를 나타내는 플래그가 부호화된다. 이를 예측 모드 플래그라고 한다. 예측 모드 플래그가 1이면, 주변 블록의 인트라 예측 모드와 현재 블록의 인트라 예측 모드가 동일함을 나타낸다. 이 때, 예측 모드 지시 인덱스가 부호화 된다. 예측 모드 지시 인덱스는 주변 블록의 인트라 모드 중 어느 블록의 인트라 모드와 동일한지를 나타낸다.
만약, 주변 블록의 예측 모드와 현재 블록의 예측 모드가 다른 경우, 예측 모드 플래그를 0으로 부호화하고, 예측 모드들 중 주변 블록의 예측 모드들은 제외하고, 나머지 예측 모드들 중 현재 블록의 예측 모드를 부호화한다. 또는 주변 블록의 예측 모드들 중 작은 숫자가 할당된 예측 모드만을 제외하고, 나머지 예측 모드들 중 현재 블록의 예측 모드를 부호화한다.
색차 성분의 인트라 예측은 N/2 x N/2 화소 블록 단위로 수행될 수 있다. 예측 방향은 휘도 성분의 예측 모드와 독립적인 평균치 예측, 수평 예측, 수직 예측, 평면 예측, 또는 휘도 성분을 이용하여 휘도 성분의 인트라 예측 모드를 따르는 모드, 휘도 성분의 픽셀 특성을 이용한 예측 모드 등의 예측 모드가 사용될 수 있다.
변환기 및 양자화기(130)는 각 매크로블록 또는 서브 블록 내의 변환 타입을 결정하고 변환 타입에 따라 변환 및 양자화를 수행한다. 변환 타입은 변환 서브 블록의 크기와 변환 종류를 의미한다. 변환 종류는 종래의 DCT 뿐 아니라, 변형된 DCT 또는 DST(Discrete Sine Transform), KLT(Karhunen-Loeve Transform)등을 의미한다. 또한, 변환 종류는 변환 서브 블록마다, 매크로블록마다, 서브 블록마다, 또는 인트라 예측 모드에 따라서 변환 종류를 적응적으로 선택할 수 있다. 또는 변환 서브 블록의 크기에 따라서 변환 종류를 적응적으로 선택할 수도 있다.
이때, 변환 타입은 변환 서브 블록 분할 플래그로 나타낼 수 있다. 예를 들어, TxT의 서브 블록의 변환 서브 블록 분할 플래그가 1인 경우, 변환 서브 블록의 크기는 (T/2)x(T/2) 이고, 변환 종류는 가로 변환은 DST, 세로 변환은 KLT를 사용할 수도 있다.
또한, 매크로블록, 서브 블록 또는 변환 서브 블록마다 CBP 플래그가 부호화 및 복호화 된다.
P-픽처 또는 P-슬라이스의 경우, 매크로블록 또는 서브 블록 단위로 인트라 모드인지 또는 인터 모드인지를 선택할 수 있다. 즉, P-픽처 또는 P-슬라이스의 확장된 매크로블록 내에는 인트라 모드와 인터 모드가 모두 사용될 수 있다.
B-픽처 또는 B-슬라이스의 경우, 최대 두 장까지의 임의의 참조 픽처를 선택할 수 있는데, 그 두 장을 각각 L0 예측, L1 예측이라고 부르며, 이 두 장의 참조 픽처는 서로 다른 역할을 한다. 보통은 L0 예측(List 0 Prediction, 주로 순방향 예측에 사용됨)이 순방향 예측, L1 예측(List 1 Prediction, 주로 역방향 예측에 사용됨)이 역방향 예측으로 사용된다. P-픽처 및 B-픽처에 대한 각각의 보다 상세한 인터 픽처 부호화 방법은 후술한다.
다시 도 1을 참조하면, 예측기(110)의 인터 예측기(114)의 움직임 추정기(116)는 현재 예측 서브 블록과 가장 유사한 블록, 즉 참조 블록을 참조 픽처 내에서 찾아 현재 블록에 대한 참조 블록의 상대적인 위치를 나타내는 움직임 벡터(MV: Motion Vector)를 출력한다. 움직임 추정은 매크로블록 내 예측 서브 블록을 픽처 버퍼(180) 에 있는 하나 이상의 참조 픽처와 비교하여 움직임 벡터를 생성한다.
움직임 벡터는 부호화기(140)에 의해 부호화되어 부호화 데이터에 포함되는데, 부호화기(140)는 현재 블록의 주변 블록의 움직임 벡터들과 동일 위치 블록 (colocated block) (즉, 참조 픽처에서 현재 블록과 같은 위치 블록)의 움직임 벡터들 중 예측 움직임 벡터를 선택하고, 예측 움직임 벡터와 현재 블록의 움직임 벡터의 차이 벡터인 차분 움직임 벡터(DMV: Differential Motion Vector) 만을 부호화하여 움직임 정보 데이터를 생성한다. 이때, 부호화기(140) 는 차분 움직임 벡터뿐만 아니라 예측 움직임 벡터 인덱스와 참조 픽처 인덱스 (Reference Picture Index) 를 추가로 부호화할 수 있다.
또한, 본 발명의 일 실시예에서는, 매크로블록, 서브 블록, 예측 서브 블록에 대하여 일괄 모드를 사용한다. 일괄 모드는 현재 블록의 움직임 정보로서 주변 움직임 블록 또는 동일 위치 블록의 움직임 정보(예측 방향, 움직임 벡터, 참조 픽처)를 사용하는 모드이다. 따라서, 일괄 모드인 경우 일괄 모드 플래그와 예측 움직임 정보 인덱스를 부호화 한다.
또한, 본 발명의 일 실시예에서는, 매크로블록 또는 서브 블록에 대하여 SKIP 모드를 사용한다. SKIP 블록인 경우에는 예측 움직임 벡터를 이용해서 움직임 추정 및 보상이 수행된다. 이 때, 부호화기는 SKIP 플래그와 예측 움직임 벡터 인덱스를 부호화 한다. 또는 예측 움직임 벡터가 아니라, 예측 움직임 정보를 이용하여 SKIP 모드의 움직임 추정 및 보상을 수행할 수 있다. 이 경우 SKIP 플래그와 예측 움직임 정보 인덱스가 부호화 및 복호화된다.
인터 예측 블록의 변환 방법은 인트라 예측 블록에서 설명한 변환 방법과 동일하다.
도 49는 본 발명의 일 실시예에 따른 인트라 픽처의 매크로블록과 서브 블록의 부호화 순서도를 나타낸 예시도이다.
도 50은 본 발명의 실시예에 따른 인트라 픽처의 매크로블록과 서브 블록의 부호화 순서도를 나타낸 또 다른 예시도이다.
인트라 픽처의 매크로블록 및 서브 블록의 경우, 도 49와 도 50을 참조하면, 분할 플래그, Delta QP, 예측 모드 플래그, 예측 모드 지시 인덱스, 예측 모드, 변환 서브 블록 분할 플래그, 휘도 성분 CBP 플래그, 색차 성분 CBP 플래그, 변환 계수들로 이루어져 있다. 하지만, 도 49와 도 50에서 도시한 인트라 픽처에 대한 신택스 순서도는 예시적인 것일 뿐이다. 즉, 인트라 픽처에 대한 신택스 중 일부 또는 전수의 순서가 변경될 수도 있으며, 일부 신택스는 생략될 수도 있다.
본 실시예에서도, 본 발명의 다른 실시예처럼 CABAC을 사용하여 각 신택스를 부호화 및 복호화한다. CABAC에 대한 상세한 설명은 다른 실시예와 동일하므로 생략한다.
도 49와 도 50에서 분할 플래그, 예측 모드 플래그, 예측 모드 지시 인덱스, Plane 모드 플래그, 변환 서브 분할 플래그, CBP 플래그 등의 ctx_inc는 도 35를 참조하여 제 1 실시예에서 서술한 skipX_flag의 ctx_inc를 결정하는 방법과 유사하게 결정할 수 있으므로 상세한 설명은 생략한다.
도 51은 실시예에 따른 변환 서브 블록의 변환 계수 부호화 순서도를 나타낸 예시도 이다.
도 51을 참조하면, 변환 계수 플래그, 마지막 변환 계수 플래그, Abs_value_greater1_flag, Abs_value_greater2_flag, 절대값(변환계수)-3, 변환 계수 부호(+or -)들로 이루어져 있다. 하지만, 도 51에서 도시한 변환 계수에 대한 신택스 순서도는 예시적인 것일 뿐이다. 즉, 변환 계수에 대한 신택스 중 일부 또는 전부의 순서가 변경될 수도 있으며, 일부 신택스는 생략될 수도 있다.
도 52는 본 발명의 실시예에 따른 인터 픽처의 인터 매크로블록과 서브 블록의 부호화 순서도를 나타낸 예시도이다.
도 52을 참조하면, 분할 플래그, SKIP 플래그, 일괄 모드 플래그, 예측 움직임 정보 인덱스, 예측 방향 플래그, Delta QP, 예측 서브 블록 타입, 참조 픽처 인덱스. 차분 움직임 벡터, 예측 움직임 벡터 인덱스, 변환 서브 블록 분할 프래그, CBP 플래그 등으로 이루어져 있다. 하지만, 도 52에서 도시한 인터 픽처의 인터 매크로블록 또는 서브 블록에 대한 신택스 순서도는 예시적인 것일 뿐이다. 즉, 신택스 중 일부 또는 전부의 순서가 변경될 수도 있으며, 일부 신택스는 생략될 수도 있다.
도 52의 예측 서브 블록 타입은 현재 매크로블록 또는 서브 블록 내 예측 서브 블록의 크기와 인터 예측인지 인트라 예측 인지를 나타낸다. 여기서는 인터 예측으로 예시를 나타냈다. 만일, 인트라 예측인 경우, 예측 서브 블록 타입 이후의 신택스는 도 49와 도 50을 참조하여 유사하게 부호화 할 수 있다.
또한, 인터 예측의 변환 계수 부호화도 전술한 도 51을 참조하여 유사하게 부호화 하므로 상세한 설명은 생략한다.
각 신택스는 본 발명의 제 1실시예와 유사하게 수학식 7을 참조하여 CABAC 부호화를 사용할 수 있다. 하지만, 각 신택스 별로 ctx_inc는 주위 상황에 따라 다를 수 있다.
도 53은 일괄 모드 플래그의 ctx_inc를 위한 예시도이다.
예를 들어, 일괄 모드 플래그를 도 37과 도 53을 참조하여 CABAC 부호화 할 수 있다.
또는 차분 움직임 벡터를 도 54를 참조하여 CABAC 부호화할 수 있다.
도 54는 차분 움직임 벡터 x 컴포넌트의 ctx_inc를 위한 예시도이다.
차분 움직임 벡터의 x 컴포넌트의 ctx_inc 는 주변 블록의 임계값 X 플래그를 이용하여 도 54에 도시된 바와 같이 결정된다. 주변 블록의 임계값 X 플래그의 값은 주변 블록의 차분 움직임 벡터의 x 컴포넌트의 값과 미리 설정된 임계값에 따라 정해진다. 예컨대, 임계값이 9라고 가정하면, 임계값 X 플래그의 값은 차분 움직임 벡터 x 컴포넌트의 절대값이 임계값 9보다 작은 경우 1이고, 9보다 큰 경우 0이다. 이 때, 임계값은 사용자에 의해 선택될 수 있다. 차분 움직임 벡터의 y 컴포넌트의 경우 차분 움직임 벡터의 x 컴포넌트와 동일한 방법으로 ctx_inc가 결정된다.
도 54에서 신택스의 ctx_inc는 제 1 실시예에서 서술한 상세한 설명과 유사하게 결정할 수 있으므로 상세한 설명은 생략한다.
이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 또한, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 따라서, 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.
이상에서 설명한 바와 같이 본 발명의 실시예는, 확장된 매크로블록을 다양한 크기와 모양의 서브블록으로 분할하고 분할된 서브블록의 크기에 따라 다른 예측 단위와 변환 단위를 이용하여 영상을 부호화 및 복호화함으로써 압축 효율 및 복원효율을 향상시킬 수 있는 효과를 발생하는 매우 유용한 발명이다.
CROSS-REFERENCE TO RELATED APPLICATION
본 특허출원은 2010년 04월 16일 및 2011년 04월 16일 한국에 출원한 특허출원번호 제 10-2010-0035450 호 및 제 10-2011-0035425 호에 대해 미국 특허법 119(a)조(35 U.S.C § 119(a))에 따라 우선권을 주장하면, 그 모든 내용은 참고문헌으로 본 특허출원에 병합된다. 아울러, 본 특허출원은 미국 이외에 국가에 대해서도 위와 동일한 동일한 이유로 우선권을 주장하면 그 모든 내용은 참고문헌으로 본 특허출원에 병합된다.

Claims (34)

  1. 매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하며, 상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하고, 상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하며, 상기 양자화된 변환 계수를 CABAC(Context-Adaptive Binary Arithmetic Coding)를 이용하여 부호화하는 경우, 사용된 상기 매크로블록 및 분할된 상기 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 영상 부호화기; 및
    CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하며, 상기 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하고, 상기 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하고, 복원된 상기 서브블록에 기초하여 상기 매크로블록을 복원하는 영상 복호화기
    를 포함하는 것을 특징으로 하는 영상 부호화/복호화 장치.
  2. 영상을 부호화하는 장치에 있어서,
    매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 예측기;
    상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 감산기;
    상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 변환 및 양자화기; 및
    상기 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 사용된 상기 매크로블록 및 분할된 상기 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 부호화기
    를 포함하는 것을 특징으로 하는 영상 부호화 장치.
  3. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 이진신호의 발생확률을 주변블록의 상황에 따라 계산하고 변경하는 것을 특징으로 하는 영상 부호화 장치.
  4. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 이진신호의 발생확률에 대응하여 복수의 컨텍스트 테이블을 설정하고, 상기 현재블록과 주변블록의 상황에 따라 상기 복수의 컨텍스트 테이블 중 다른 컨텍스트 테이블을 사용하여 부호화된 상기 영상 데이터를 생성하는 것을 특징으로 하는 영상 부호하 장치.
  5. 제 2항에 있어서, 상기 부호화기는,
    픽처 타입, 신택스(syntax)의 종류, 상기 신택스를 부호화할 때 상기 주변블록에 대응하는 값 중의 적어도 하나에 기초하여 컨텍스트 테이블을 선택하여 부호화된 상기 영상 데이터를 생성하는 것을 특징으로 하는 영상 부호화 장치.
  6. 제 2항에 있어서, 상기 부호화기는,
    상기 매크로블록 내의 서브블록들 중 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 SKIP 모드인지, 아닌지 또는 어느 하나가 SKIP 모드인지에 따라 skipX_flag, interX_flag, extended_mb_flag 중 적어도 하나에 대한 컨텍스트 테이블을 선택적으로 사용하는 것을 특징으로 하는 영상 부호화 장치.
  7. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 인터 모드인지, 인트라 모드인지 또는 어느 하나가 인터 모드인지에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  8. 제 7항에 있어서, 상기 부호화기는,
    상기 상단 블록 또는 상기 좌측 블록이 16x16 화소블록보다 큰 블록인 경우, 상기 인터 모드는 인트라 모드 및 인터 모드가 혼재하는 경우, 및 인터 모드만 존재하는 경우에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  9. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 direct 모드인지, 아닌지 또는 어느 하나가 direct 모드인지에 따라 directX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  10. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 확장된 매크로블록 단위로 부호화가 수행되었는지, 아닌지 또는 어느 하나가 확장된 매크로블록 단위로 부호화가 수행되었는지에 따라 extended_mb_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  11. 제 2항에 있어서, 상기 부호화기는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 참조블록으로 사용되었는지, 아닌지 또는 어느 하나가 참조블록으로 사용되었는지에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  12. 제 11항에 있어서, 상기 부호화기는,
    상기 부호화할 현재블록의 상단 블록 또는 좌측 블록이 L0 예측, L1 예측 또는 양방향 예측인지의 여부에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  13. 제 2항에 있어서,
    부호화할 현재블록의 상단 블록 및 하단 블록에 따라 MVD/ref_idx, CBPX_flag, 변환 타입 중의 적어도 하나에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 장치.
  14. 제 13항에 있어서,
    상기 변환 타입에 대한 컨텍스트 테이블은, 상기 부호화할 현재블록의 사용 가능한 변환 타입의 종류에 따라 다른 것을 특징으로 하는 영상 부호화 장치.
  15. 영상을 복호화하는 장치에 있어서,
    CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하는 복호화기;
    상기 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하는 역 양자화기 및 역 변환기;
    상기 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 예측기; 및
    상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 가산기
    를 포함하며,
    복원된 상기 서브블록에 기초하여 상기 매크로블록을 복원하는 것을 특징으로 하는 영상 복호화 장치.
  16. 제 15항에 있어서, 상기 복호화기는,
    복원할 현재블록의 상단 블록 및 좌측 블록에 따라 이진신호의 발생확률이 다르게 설정된 컨텍스트 테이블에 기초하여 상기 부호화된 데이터를 복원하는 것을 특징으로 하는 영상 복호화 장치.
  17. 영상 부호화/복호화 방법에 있어서,
    매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하며, 상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하고, 상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하며, 상기 양자화된 변환 계수를 CABAC(Context-Adaptive Binary Arithmetic Coding)를 이용하여 부호화하는 경우, 사용된 상기 매크로블록 및 분할된 상기 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 단계; 및
    CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하며, 상기 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하고, 상기 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하며, 상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하고, 복원된 상기 서브블록에 기초하여 상기 매크로블록을 복원하는 단계
    를 포함하는 것을 특징으로 하는 영상 부호화/복호화 방법.
  18. 영상을 부호화하는 방법에 있어서,
    매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 단계;
    상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 단계;
    상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 단계; 및
    상기 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 사용된 상기 매크로블록 및 분할된 상기 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 단계
    를 포함하는 것을 특징으로 하는 영상 부호화 방법.
  19. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 이진신호의 발생확률을 주변블록의 상황에 따라 계산하고 변경하는 것을 특징으로 하는 영상 부호화 방법.
  20. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 이진신호의 발생확률에 대응하여 복수의 컨텍스트 테이블을 설정하고, 상기 현재블록과 주변블록의 상황에 따라 상기 복수의 컨텍스트 테이블 중 다른 컨텍스트 테이블을 사용하여 부호화된 상기 영상 데이터를 생성하는 것을 특징으로 하는 영상 부호하 방법.
  21. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    픽처 타입, 신택스(syntax)의 종류, 상기 신택스를 부호화할 때 상기 주변블록에 대응하는 값 중의 적어도 하나에 기초하여 컨텍스트 테이블을 선택하여 부호화된 상기 영상 데이터를 생성하는 것을 특징으로 하는 영상 부호화 방법.
  22. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    상기 매크로블록 내의 서브블록들 중 부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 SKIP 모드인지, 아닌지 또는 어느 하나가 SKIP 모드인지에 따라 skipX_flag, interX_flag, extended_mb_flag 중 적어도 하나에 대한 컨텍스트 테이블을 선택적으로 사용하는 것을 특징으로 하는 영상 부호화 방법.
  23. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 인터 모드인지, 인트라 모드인지 또는 어느 하나가 인터 모드인지에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  24. 제 23항에 있어서, 상기 영상 데이터 생성단계는,
    상기 상단 블록 또는 상기 좌측 블록이 16x16 화소블록보다 큰 블록인 경우, 상기 인터 모드는 인트라 모드 및 인터 모드가 혼재하는 경우, 및 인터 모드만 존재하는 경우에 따라 interX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  25. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 direct 모드인지, 아닌지 또는 어느 하나가 direct 모드인지에 따라 directX_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  26. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 확장된 매크로블록 단위로 부호화가 수행되었는지, 아닌지 또는 어느 하나가 확장된 매크로블록 단위로 부호화가 수행되었는지에 따라 extended_mb_flag에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  27. 제 18항에 있어서, 상기 영상 데이터 생성단계는,
    부호화할 현재블록의 상단 블록 및 좌측 블록이 모두 참조블록으로 사용되었는지, 아닌지 또는 어느 하나가 참조블록으로 사용되었는지에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  28. 제 27항에 있어서, 상기 영상 데이터 생성단계는,
    상기 부호화할 현재블록의 상단 블록 또는 좌측 블록이 L0 예측, L1 예측 또는 양방향 예측인지의 여부에 따라 B_pdir에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  29. 제 18항에 있어서,
    부호화할 현재블록의 상단 블록 및 하단 블록에 따라 MVD/ref_idx, CBPX_flag, 변환 타입 중의 적어도 하나에 대한 다른 컨텍스트 테이블을 사용하는 것을 특징으로 하는 영상 부호화 방법.
  30. 제 29항에 있어서,
    상기 변환 타입에 대한 컨텍스트 테이블은, 상기 부호화할 현재블록의 사용 가능한 변환 타입의 종류에 따라 다른 것을 특징으로 하는 영상 부호화 방법.
  31. 영상을 복호화하는 방법에 있어서,
    CABAC를 이용하여 매크로블록 및 분할된 서브블록에 따라 다른 컨텍스트 테이블을 사용하여 부호화된 데이터를 복호화하여 분할 타입 정보, 움직임 정보, 변환 타입 정보 및 양자화된 변환 계수를 복원하는 단계;
    상기 복원되는 변환 타입 정보에 의해 식별되는 변환을 이용하여 상기 양자화된 변환 계수를 역 양자화 및 역 변환하여 잔여 서브블록을 복원하는 단계;
    상기 복원되는 분할 타입 정보에 따라 식별되는 서브블록을 상기 복원되는 움직임 정보를 이용하여 예측하여 예측 서브블록을 생성하는 단계; 및
    상기 예측 서브블록과 상기 잔여 서브블록을 가산하여 상기 서브블록을 복원하는 단계
    를 포함하며,
    복원된 상기 서브블록에 기초하여 상기 매크로블록을 복원하는 것을 특징으로 하는 영상 복호화 방법.
  32. 제 31항에 있어서,
    복원할 현재블록의 상단 블록 및 좌측 블록에 따라 이진신호의 발생확률이 다르게 설정된 컨텍스트 테이블에 기초하여 상기 부호화된 데이터를 복원하는 것을 특징으로 하는 영상 복호화 방법.
  33. 영상을 부호화하는 방법에 있어서,
    매크로블록을 이용하여 분할된 서브블록을 예측하여 예측 서브블록을 생성하는 단계;
    상기 서브블록과 상기 예측 서브블록을 감산하여 잔여 서브블록을 생성하는 단계;
    상기 잔여 서브블록을 상기 서브블록의 크기에 따라 선택되는 변환을 이용하여 변환하고 양자화하여 양자화된 변환 계수를 생성하는 단계; 및
    상기 양자화된 변환 계수를 CABAC를 이용하여 부호화하는 경우, 상기 매크로블록, 상기 서브블록, 및 변환 서브블록에 따라 서로 다른 컨텍스트 테이블을 사용하여 부호화된 영상 데이터를 생성하는 단계
    를 포함하는 것을 특징으로 하는 영상 부호화 방법.
  34. 제 33항에 있어서,
    상기 매크로블록, 상기 서브블록, 상기 변환 서브블록, 인트라 예측 모드 중 적어도 하나에 따라 변환의 종류를 적응적으로 선택하는 영상 부호화 방법.
PCT/KR2011/002763 2010-04-16 2011-04-18 영상 부호화/복호화 장치 및 방법 Ceased WO2011129673A2 (ko)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US13/641,677 US10250881B2 (en) 2010-04-16 2011-04-18 Video encoding/decoding apparatus and method using batch mode together with skip mode
CN201180029771.8A CN102939756B (zh) 2010-04-16 2011-04-18 视频编码/解码设备和方法
US14/668,501 US9451270B2 (en) 2010-04-16 2015-03-25 Video encoding/decoding apparatus and method using batch mode together with skip mode
US15/231,315 US9743085B2 (en) 2010-04-16 2016-08-08 Video encoding/decoding apparatus and method using batch mode together with skip mode

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2010-0035450 2010-04-16
KR20100035450 2010-04-16
KR1020110035425A KR101791242B1 (ko) 2010-04-16 2011-04-16 영상 부호화/복호화 장치 및 방법
KR10-2011-0035425 2011-04-16

Related Child Applications (2)

Application Number Title Priority Date Filing Date
US13/641,677 A-371-Of-International US10250881B2 (en) 2010-04-16 2011-04-18 Video encoding/decoding apparatus and method using batch mode together with skip mode
US14/668,501 Continuation US9451270B2 (en) 2010-04-16 2015-03-25 Video encoding/decoding apparatus and method using batch mode together with skip mode

Publications (2)

Publication Number Publication Date
WO2011129673A2 true WO2011129673A2 (ko) 2011-10-20
WO2011129673A3 WO2011129673A3 (ko) 2012-03-15

Family

ID=44799216

Family Applications (1)

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

Country Status (2)

Country Link
CN (1) CN105704490B (ko)
WO (1) WO2011129673A2 (ko)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130107970A1 (en) * 2011-11-01 2013-05-02 Qualcomm Incorporated Transform unit partitioning for chroma components in video coding
WO2020004912A1 (ko) * 2018-06-25 2020-01-02 한국전자통신연구원 양자화 파라미터를 이용한 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
CN114697652A (zh) * 2018-03-05 2022-07-01 松下电器(美国)知识产权公司 解码装置、解码方法和存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
HRP20230465T1 (hr) * 2018-06-15 2023-09-15 Lg Electronics Inc. Postupak i uređaj za kodiranje entropije na osnovi cabac
CN112997489B (zh) 2018-11-06 2024-02-06 北京字节跳动网络技术有限公司 具有几何分割的帧间预测的边信息信令
WO2020133380A1 (zh) * 2018-12-29 2020-07-02 富士通株式会社 一种图像的块内编码或解码方法、数据处理装置和电子设备
CN113170166B (zh) 2018-12-30 2023-06-09 北京字节跳动网络技术有限公司 具有几何分割的帧间预测在视频处理中有条件的应用
CN113170139B (zh) * 2019-01-10 2023-12-05 北京字节跳动网络技术有限公司 上下文自适应二进制算数编码的简化上下文建模
CN113950838B (zh) * 2019-06-06 2026-03-17 北京字节跳动网络技术有限公司 基于子块的帧内块复制

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1589023A (zh) * 2004-08-06 2005-03-02 联合信源数字音视频技术(北京)有限公司 一种基于上下文的多码表变长编解码方法及编解码装置
KR100763181B1 (ko) * 2005-04-19 2007-10-05 삼성전자주식회사 기초계층과 향상계층의 데이터를 바탕으로 예측 정보를코딩하여 코딩율을 향상시키는 방법 및 장치
KR100750165B1 (ko) * 2006-02-22 2007-08-17 삼성전자주식회사 압축률 향상을 위해 개선된 컨텍스트 모델 선택을 사용하는cabac 부호화 방법 및 장치, 그리고 cabac복호화 방법 및 장치
KR20090129926A (ko) * 2008-06-13 2009-12-17 삼성전자주식회사 영상 부호화 방법 및 그 장치, 영상 복호화 방법 및 그 장치
KR101359496B1 (ko) * 2008-08-06 2014-02-11 에스케이 텔레콤주식회사 부호화 모드 결정 방법 및 장치와 그를 이용한 영상 부호화장치

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130107970A1 (en) * 2011-11-01 2013-05-02 Qualcomm Incorporated Transform unit partitioning for chroma components in video coding
US9807401B2 (en) * 2011-11-01 2017-10-31 Qualcomm Incorporated Transform unit partitioning for chroma components in video coding
CN114697652A (zh) * 2018-03-05 2022-07-01 松下电器(美国)知识产权公司 解码装置、解码方法和存储介质
CN114697653A (zh) * 2018-03-05 2022-07-01 松下电器(美国)知识产权公司 编码装置、解码装置和存储介质
CN114697651A (zh) * 2018-03-05 2022-07-01 松下电器(美国)知识产权公司 编码装置、解码装置和存储介质
CN114697653B (zh) * 2018-03-05 2023-11-14 松下电器(美国)知识产权公司 编码装置、解码装置和存储介质
CN114697651B (zh) * 2018-03-05 2023-11-14 松下电器(美国)知识产权公司 编码装置、解码装置和存储介质
CN114697652B (zh) * 2018-03-05 2023-11-14 松下电器(美国)知识产权公司 解码装置、解码方法和存储介质
WO2020004912A1 (ko) * 2018-06-25 2020-01-02 한국전자통신연구원 양자화 파라미터를 이용한 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
US11277612B2 (en) 2018-06-25 2022-03-15 Electronics And Telecommunications Research Institute Method and apparatus for encoding/decoding image using quantization parameter, and recording medium storing bitstream
US12034930B2 (en) 2018-06-25 2024-07-09 Electronics And Telecommunications Research Institute Method and apparatus for encoding/decoding image using quantization parameter, and recording medium storing bitstream
US12574514B2 (en) 2018-06-25 2026-03-10 Electronics And Telecommunications Research Institute Method and apparatus for encoding/decoding image using quantization parameter, and recording medium storing bitstream

Also Published As

Publication number Publication date
CN105704490A (zh) 2016-06-22
CN105704490B (zh) 2018-07-31
WO2011129673A3 (ko) 2012-03-15

Similar Documents

Publication Publication Date Title
WO2011071328A2 (en) Method and apparatus for encoding video, and method and apparatus for decoding video
WO2012005520A2 (en) Method and apparatus for encoding video by using block merging, and method and apparatus for decoding video by using block merging
WO2011096741A2 (en) Method and apparatus for encoding video based on scanning order of hierarchical data units, and method and apparatus for decoding video based on scanning order of hierarchical data units
WO2019083334A1 (ko) 비대칭 서브 블록 기반 영상 부호화/복호화 방법 및 장치
WO2020111785A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2011040794A2 (ko) 가변 크기의 매크로블록을 이용한 영상 부호화/복호화 방법 및 장치
WO2020076116A1 (ko) 영상 부호화/복호화 방법 및 장치
WO2018026219A1 (ko) 비디오 신호 처리 방법 및 장치
WO2017204532A1 (ko) 영상 부호화/복호화 방법 및 이를 위한 기록 매체
WO2011129672A2 (ko) 영상 부호화/복호화 장치 및 방법
WO2019225993A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020096427A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2017018664A1 (ko) 인트라 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
WO2019182295A1 (ko) 비디오 신호 처리 방법 및 장치
WO2011040795A2 (ko) 분할 레이어를 이용한 영상 부호화/복호화 방법 및 장치
WO2011129673A2 (ko) 영상 부호화/복호화 장치 및 방법
WO2020096428A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치
WO2020171681A1 (ko) 인트라 예측 기반 비디오 신호 처리 방법 및 장치
WO2020004978A1 (ko) 비디오 신호 처리 방법 및 장치
WO2021107532A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019225994A1 (ko) 비디오 신호 처리 방법 및 장치
WO2019190199A1 (ko) 비디오 신호 처리 방법 및 장치
WO2020071836A1 (ko) 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체
WO2019194647A1 (ko) 필터 정보 기반의 적응적 루프 필터링 방법, 그를 이용한 영상 부호화 및 복호화 방법
WO2020130714A1 (ko) 영상 신호 부호화/복호화 방법 및 이를 위한 장치

Legal Events

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

Ref document number: 201180029771.8

Country of ref document: CN

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

Ref document number: 11769139

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: 13641677

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: 11769139

Country of ref document: EP

Kind code of ref document: A2