Patent Description:
Methods for compressing video data include MPEG-<NUM>, MPEG-<NUM> and H. <NUM>/MPEG-<NUM> AVC. According to these methods, one picture is divided into macroblocks to encode an image, the respective macroblocks are encoded by generating a prediction block using inter prediction or intra prediction. The difference between an original block and the prediction block is transformed to generate a transformed block, and the transformed block is quantized using a quantization parameter and one of a plurality of predetermined quantization matrices. The quantized coefficient of the quantized block are scanned by a predetermined scan type and then entropy-coded. The quantization parameter is adjusted per macroblock and encoded using a previous quantization parameter.

<NUM>/MPEG-<NUM> AVC, motion estimation is used to eliminate temporal redundancy between consecutive pictures. To detect the temporal redundancy, one or more reference pictures are used to estimate motion of a current block, and motion compensation is performed to generate a prediction block using motion information. The motion information includes one or more reference picture indexes and one or more motion vectors.

According to the H. <NUM>/MPEG-<NUM> AVC, only the motion vectors are predicted and encoded using neighboring motion vectors, and the reference picture indexes are encoded without neighboring reference picture indexes.

However, if various sizes are used for inter prediction, the correlation between motion information of a current block and motion information of one or more neighboring block increases. Also, the correlation between motion vector of a current block and motion vector of neighboring block within a reference picture becomes higher as the picture size becomes larger if motion of image is almost constant or slow. Accordingly, the conventional compression method described above decreases compression efficiency of motion information if the picture size is larger than that of high-definition picture and various sizes are allowed for motion estimation and motion compensation. <CIT> discloses a favorable merging or grouping of simply connected regions into which the array of information samples is sub-divided, is coded with a reduced amount of data. To this end, for the simply connected regions, a predetermined relative locational relationship is defined enabling an identifying, for a predetermined simply connected region, of simply connected regions within the plurality of simply connected regions which have the predetermined relative loca tional relationship to the predetermined simply connected region. Namely, if the number is zero, a merge indicator for the predetermined simply connected region may be absent within the data stream. <NPL>), XP030018681 , discloses deriving the quantization parameter by using the previous quantization parameter. It is therefore the object of the invention to provide an improved method of encoding video data in a merge mode. This object is solved by the independent claim.

One aspect which does not fall under the present invention provides amethod of deriving motion information of a current prediction unit, comprising: extracting a merge index from a bit stream; constructing a merge candidate list using available spatial and temporal merge candidates; selecting a merge predictor among merge candidates listed in the merge candidate list using the merge index; and setting motion information of the merge predictor as motion information of the current prediction unit. The temporal merge candidate includes a reference picture index and a motion vector, zero is set as the reference picture index of the temporal merge candidate, and a motion vector of a temporal merge candidate block of a temporal merge candidate picture is set as the motion vector of the temporal merge candidate.

A method not falling under the present invention extracts a merge index from a bit stream, constructs a merge candidate list using available spatial and temporal merge candidates, selects a merge predictor among merge candidates listed in the merge candidate list using the merge index, and sets motion information of the merge predictor as motion information of the current prediction unit. The temporal merge candidate includes a reference picture index and a motion vector, zero is set as the reference picture index of the temporal merge candidate, and a motion vector of a temporal merge candidate block of a temporal merge candidate picture is set as the motion vector of the temporal merge candidate. Accordingly, the coding efficiency of the motion information is improved by including various merge candidates. Also, the computational complexity of an encoder and a decoder is reduced maintaining improvement of coding efficiency by adaptively storing motion information of reference picture and adaptively generating a temporal merge candidate.

Hereinafter, various embodiments of the present invention will be described in detail with reference to the accompanying drawings.

An image encoding apparatus and an image decoding apparatus may be a user terminal such as a personal computer, a personal mobile terminal, a mobile multimedia player, a smartphone or a wireless communication terminal. The image encoding device and the image decoding device may be include a communication unit for communicating with various devices, a memory for storing various programs and data used to encode or decode images.

<FIG> is a block diagram of an image coding apparatus <NUM>.

Referring to <FIG>, the image coding apparatus <NUM> includes a picture division unit <NUM>, an intra prediction unit <NUM>, an inter prediction unit <NUM>, a transform unit <NUM>, a quantization unit <NUM>, a scanning unit <NUM>, an entropy coding unit <NUM>, an inverse quantization/transform unit <NUM>, a post-processing unit <NUM> and a picture storing unit <NUM>.

The picture division unit <NUM> divides a picture or a slice into plural largest coding units (LCUs), and divides each LCU into one or more coding units. The size of LCU may be 32x32, 64x64 or 128x128. The picture division unit <NUM> determines prediction mode and partitioning mode of each coding unit.

An LCU includes one or more coding units. The LCU has a recursive quad tree structure to specify a division structure of the LCU. Parameters for specifying the maximum size and the minimum size of the coding unit are included in a sequence parameter set. The division structure is specified by one or more split coding unit flags (split_cu_flags). The size of acoding unit is 2Nx2N. If the size of the LCU is 64x64 and the size of a smallest coding unit (SCU) is 8x8, the size of the coding unit may be 64x64, 32x32, 16x16 or 8x8.

A coding unit includes one or more prediction units. In intra prediction, the size of the prediction unit is 2Nx2N or NxN. In inter prediction, the size of the prediction unit is specified by the partitioning mode. The partitioning mode is one of 2Nx2N,2NxN, Nx2N andNxN if the coding unit is partitioned symmetrically. The partitioning mode is one of 2NxnU, 2NxnD, nLx2N and nRx2N if the coding unitis partitioned asymmetrically. The partitioning modes are allowed based on the size of the coding unit to reduce complexity of hardware. If the coding unit has a minimum size, the asymmetric partitioning is not allowed. Also, if the coding unit has the minimum size, NxN partitioning mode may not be allowed.

A coding unit includes one or more transform units. The transform unit has a recursive quad tree structure to specify a division structure of the coding unit. The division structure is specified by one or more split transform unit flags (split_tu_flags). Parameters for specifying the maximum size and the minimum size of the lumatransform unit are included in a sequence parameter set.

The intra prediction unit <NUM> determines an intra prediction mode of a current prediction unit and generates a prediction block using the intra prediction mode.

The inter prediction unit <NUM> determines motion information of a current prediction unit using one or more reference pictures stored in the picture storing unit <NUM>, and generates a prediction block of the prediction unit. The motion information includes one or more reference picture indexes and one or more motion vectors.

The transform unit <NUM> transforms a residual block to generate a transformed block. The residual block has the same size of the transform unit. If the prediction unit is larger than the transform unit, the residual signals between the current block and the prediction block are partitioned into multiple residual blocks.

The quantization unit <NUM> determines a quantization parameter for quantizing the transformed block. The quantization parameter is a quantization step size. The quantization parameter is determined per quantization unit. The size of the quantization unit may vary and be one of allowable sizes of coding unit. If a size of the coding unit is equal to or larger than a minimum size of thequantization unit, the coding unit becomes the quantization unit. A plurality of coding units may be included in a quantization unit of minimum size. The mimimum size of the quantization unit is determined per picture and a parameter for specifying the minimum size of the quantization unit is included in a picture parameter set.

The quantization unit <NUM> generates a quantization parameter predictor and generates a differential quantization parameter by subtracting the quantization parameter predictor from the quantization parameter. The differential quantization parameter is entropy-coded.

The quantization parameter predictor is generated by using quantization parameters of neighboring coding units and a quantization parameter of previous coding unit as follows.

A left quantization parameter, an above quantization parameter and a previous quantization parameter are sequentially retrieved in this order. An average of the first two available quantization parameters retrieved in that order is set as the quantization parameter predictor when two or more quantization parameters are available, and when only one quantization parameter is available, the available quantization parameter is set as the quantization parameter predictor. That is, if the left and above quantization parameters are available, an average of the left and above quantization parameters is set as the quantization parameter predictor. If only one of the left and above quantization parameters is available, an average of the available quantization parameter and the previous quantization parameters is set as the quantization parameter predictor. If both of the left and above quantization parameters are unavailable, the previous quantization parameter is set as the quantization parameter predictor. The average is rounded off.

The differential quantization parameter is converted into bins for the absolute value of the differential quantization parameter and a bin for indicating sign of the differential quantization parameter through a binarization process, and the bins are arithmetically coded. If the absolute value of the differential quantization parameter is <NUM>, the bin for indicating sign may be omitted. Truncated unary is used for binarization of the absolute.

The quantization unit <NUM> quantizes the transformed block using a quantization matrix and the quantization parameter to generate a quantized block. The quantized block is provided to the inverse quantization/transform unit <NUM> and the scanning unit <NUM>.

The scanning unit <NUM> applies a scan pattern to the quantized block.

In inter prediction, a diagonal scan is used as the scan pattern if CABAC is used for entropy coding. The quantized coefficients of the quantized block are split into coefficient components. The coefficient components are significant flags, coefficient signs and coefficient levels. The diagonal scan is applied to each of the coefficient components. The significant coefficient indicates whether the corresponding quantized coefficient is zero or not. The coefficient sign indicates a sign of non-zero quantized coefficient, and the coefficient level indicates an absolute value of non-zero quantized coefficient.

When the size of the transform unit is larger than a predetermined size, the quantized block is divided into multiple subsets and the diagonal scan is applied to each subset. Significant flags, coefficient signs and coefficients levels of each subset are scanned respectively according to the diagonal scan. The predetermined size is 4x4. The subset is a 4x4 block containing <NUM> transform coefficients.

The scan pattern for scanning the subsets is the same as the scan pattern for scanning the coefficient components. The significant flags, the coefficient signs and the coefficients levels of each subset are scanned in the reverse direction. The subsets are also scanned in the reverse direction.

A parameter indicating last non-zero coefficient position is encoded and transmitted to a decoding side. The parameter indicating last non-zero coefficient position specifies a position of last non-zero quantized coefficient within the quantized block. A non-zero subset flag is defined for each subset other than the first subset and the last subset and is transmitted to the decoding side. The first subset covers a DC coefficient. The last subset covers the last non-zero coefficient. The non-zero subset flag indicates whether the subset contains non-zero coefficients or not.

The entropy coding unit <NUM> entropy-codes the scanned component by the scanning unit <NUM>, intra prediction information received from the intra prediction unit <NUM>, motion information received from the inter prediction unit <NUM>, and so on.

The inverse quantization/transform unit <NUM> inversely quantizes the quantized coefficients of the quantized block, and inversely transforms the inverse quantized block to generate residual signals.

The post-processing unit <NUM> performs a deblocking filtering process for removing blocking artifact generated in a reconstructed picture.

The picture storing unit <NUM> receives post-processed image from the post-processing unit <NUM>, and stores the image in picture units. A picture may be a frame or a field.

<FIG> is a flow chart illustrating a method of encoding video data in an inter prediction mode.

Motion information of a current block is determined (<NUM>). The current block is a prediction unit. A size of the current block is determined by a size and a partitioning mode of the coding unit.

The motion information varies according to a prediction type. If the prediction type is a uni-directional prediction, the motion information includes a reference index specifying a picture of a reference list <NUM>, and a motion vector. If the prediction type is a bi-directional prediction, the motion information includes two reference indexes specifying a picture of a reference list <NUM> and a picture of a reference list <NUM>, and a list <NUM> motion vector and a list <NUM> motion vector.

A prediction block of the current block is generated using the motion information (S120). If the motion vector indicates a pixel position, the prediction block is generated by copying a block of the reference picture specified by the motion vector. If the motion vector indicates a sub-pixel position, the prediction block is generated by interpolating the pixels of the reference picture.

A residual block is generated using the current block and the prediction block (S130). The residual block has the same size of the transform unit. If the prediction unit is larger than the transform unit, the residual signals between the current block and the prediction block are into multiple residual blocks.

The residual block is encoded (S140). The residual block is encoded by the transform unit <NUM>, the quantization unit <NUM>, the scanning unit <NUM> and the entropy coding unit <NUM> of <FIG>.

The motion information is encoded (S150). The motion information may be encoded predictively using spatial candidates and a temporal candidate of the current block. The motion information is encoded in a skip mode, a merge mode or an AMVP mode. In the skip mode, the prediction unit has the size of coding unit and the motion information is encoded using the same method as that of the merge mode. In the merge mode, the motion information of the current prediction unit is equal to motion information of one candidate. In the AMVP mode, the motion vector of the motion information is predictively coded using one or more motion vector candidate.

<FIG> is a flow chart illustrating a method of encoding motion information in the merge mode according to the present invention.

Spatial merge candidates are derived (S210). <FIG> is a conceptual diagram illustrating positions of spatial merge candidate blocks.

As shown in <FIG>, the merge candidate block is a left block (block A), an above block (block B), an above-right block (block C), a left-below block (block D) or an above-left block (block E) of the current block. The blocks are prediction blocks. The above-left block(block E) is set as merge candidate block when one or more of the blocks A, B, C and D are unavailable. The motion information of an available merge candidate block N is set asa spatial merge candidate N. N is A, B, C, D or E.

The spatial merge candidate may be set as unavailable according to the shape of the current block and the position of the current block. For example, if the coding unit is split into two prediction units (block PO and block P1) using asymmetric partitioning, it is probable that the motion information of the block PO is not equal to the motion information of the block P1. Therefore, if the current block is the asymmetric block P1, the block PO is set as unavailable candidate block as shown in <FIG>.

<FIG> is a conceptual diagram illustrating positions of spatial merge candidate blocks in an asymmetric partitioning mode according to the present invention.

As shown in <FIG>, a coding unit is partitioned into two asymmetric prediction blocks P0 and P1 and the partitioning mode is an nLx2N mode. The size of the block PO is hNx2N and the size of the block P1 is (<NUM>-h)Nx2N. The value of h is <NUM>/<NUM>. The current block is the block P1. The blocks A, B, C, D and E are spatial merge candidate blocks. The block PO is the spatial merge candidate block A.

In present invention, the spatial merge candidate A is set as unavailable not to be listed on the merge candidate list. Also, the spatial merge candidate block B, C, D or E having the same motion information of the spatial merge candidate block A is set as unavailable.

<FIG> is another conceptual diagram illustrating positions of spatial merge candidate blocks in another asymmetric partitioning mode according to the present invention.

As shown in <FIG>, a coding unit is partitioned into two asymmetric prediction blocks P0 and P1 and the partitioning mode is an nRx2N mode. The size of the block PO is (<NUM>-h)Nx2N and the size of the block P1 is hNx2N. The value of h is <NUM>/<NUM>. The current block is the block P1. The blocks A, B, C, D and E are spatial merge candidate blocks. The block PO is the spatial merge candidate block A.

As shown in <FIG>, a coding unit is partitioned into two asymmetric prediction blocks P0 and P1 and the partitioning mode is a 2NxnU mode. The size of the block PO is 2NxhN and the size of the block P1 is 2Nx(<NUM>-h)N. The value of h is <NUM>/<NUM>. The current block is the block P1. The blocks A, B, C, D and E are spatial merge candidate blocks. The block PO is the spatial merge candidate block B.

In present invention, the spatial merge candidate B is set as unavailable not to be listed on the merge candidate list. Also, the spatial merge candidate block C, D or E having the same motion information of the spatial merge candidate block B is set as unavailable.

As shown in <FIG>, a coding unit is partitioned into two asymmetric prediction blocks P0 and P1 and the partitioning mode is a 2NxnD mode. The size of the block PO is 2Nx(<NUM>-h)N and the size of the block P1 is 2NxhN. The value of h is <NUM>/<NUM>. The current block is the block P1. The blocks A, B, C, D and E are spatial merge candidate blocks. The block PO is the spatial merge candidate block B.

The spatial merge candidate may also be set as unavailable based on merge area. If the current block and the spatial merge candidate block belong to same merge area, the spatial merge candidate block is set as unavailable. The merge area is a unit area in which motion estimation is performed and information specifying the merge area is included in a bit stream.

A temporal merge candidate is derived (S220). The temporal merge candidate includes a reference picture index and a motion vector of the temporal merge candidate.

The reference picture index of the temporal merge candidate may be derived using one or more reference picture indexes of neighboring block. For example, one of the reference picture indexes of a left neighboring block, an above neighboring block and a corner neighboring block is set as the reference picture index of the temporal merge candidate. The corner neighboring block is one of an above-right neighboring block, a left-below neighboring block and an above-left neighboring block. Alternatively, the reference picture index of the temporal merge candidate may be set to zero to reduce the complexity.

The motion vector of the temporal merge candidate may be derived as follows.

First, a temporal merge candidate picture is determined. The temporal merge candidate picture includes a temporal merge candidate block. Onetemporal merge candidate picture is used within a slice. A reference picture index of the temporal merge candidate picture may be set to zero.

If the current slice is a P slice, one of the reference pictures of the reference picture list <NUM> is set as the temporal merge candidate picture. If the current slice is a B slice, one of the reference pictures of the reference picture lists <NUM> and <NUM> is set as the temporal merge candidate picture. A list indicator specifying whether the temporal merge candidate picture belongs to the reference picture lists <NUM> or <NUM> is included in a slice header if the current slice is a B slice. The reference picture index specifying the temporal merge candidate picture may be included in the slice header.

Next, the temporal merge candidate block is determined. <FIG> is a conceptual diagram illustrating position of temporal merge candidate block. As shown in <FIG>, a first candidate block may be a right-below corner block (block H) of the block C. The block C has same size and same location of the current block and is located within the temporal merge candidate picture. A second candidate block is a block covering an upper-left pixel of the center of the block C.

The temporal merge candidate block may be the first candidate block or the second candidate block. If the first candidate block is available, the first candidate block is set as the temporal merge candidate block. If the first candidate block is unavailable, the second candidate block is set as the temporal merge candidate block. If the second candidate block is unavailable, the temporal merge candidate block is set as unavailable.

The temporal merge candidate block is determined based on the position of the current block. For example, if the current block is adjacent to a lower LCU (that is, if the first candidate block belongs to a lower LCU), the first candidate block may be changed into a block within a current LCU or is set as unavailable.

Also, the first and second candidate blocks may be changed into another block based on each position of the candidate block within a motion vector storing unit. The motion vector storing unit is a basic unit storing motion information of reference pictures.

<FIG> is a conceptual diagram illustrating a method of storing motion information. As shown in <FIG>, the motion storing unit may be a 16x16 block. The motion vector storing unit may be divided into sixteen 4x4 bocks. If the motion vector storing unit is a <NUM>×<NUM> block, the motion information is stored per the motion vector storing unit. If the motion vector storing unit includes multiple prediction units of reference picture, motion information of a predetermined prediction unit of the multiple prediction units is stored in memory to reduce amount of motion information to be stored in memory. The predetermined prediction unit may be a block covering one of the sixteen 4x4 blocks. The predetermined prediction unit may be a block covering a block C3, a block BR. Or the predetermined prediction unit may be a block covering a block UL.

Therefore, if the candidate block does not include the predetermined block, the candidate block is changed into a block including the predetermined block.

If the temporal merge candidate block is determined, the motion vector of the temporal merge candidate block is set as the motion vector of the temporal merge candidate.

A merge candidate list is constructed (S230). The available spatial candidates and the available temporal candidate are listed in a predetermined order. The spatial merge candidates are listed up to four in the order of A, B, C, D and E. The temporal merge candidate may be listed between B and C or after the spatial candidates.

It is determined whether one or more merge candidates are generated or not (S240). The determination is performed by comparing the number of merge candidates listed in the merge candidate list with a predetermined number of the merge candidates. The predetermined number may be determined per picture or slice.

If the number of merge candidates listed in the merge candidate list is smaller than a predetermined number of the merge candidates, one or more merge candidates are generated (S250). The generated merge candidate is listed after the last available merge candidate.

If the number of available merge candidates is equal to or greater than <NUM>, one of two available merge candidates has list <NUM> motion information and the other has list <NUM> motion information, the merge candidate may be generated by combining the list <NUM> motion information and the list <NUM> motion information. Multiple merge candidates may be generated if there are multiple combinations.

One or more zero merge candidates may be added to the list. If the slice type is P, the zero merge candidate has only list <NUM> motion information. If the slice type is B, the zero merge candidate has list <NUM> motion information and list <NUM> motion information.

A merge predictor is selected among the merge candidates of the merge list, a merge index specifying the merge predictor is encoded (S260).

<FIG> is a block diagram of an image decoding apparatus The image decoding apparatus <NUM> includes an entropy decoding unit <NUM>, an inverse scanning unit <NUM>, an inverse quantization unit <NUM>, an inverse transform unit <NUM>, an intra prediction unit <NUM>, an inter prediction unit <NUM>, a post-processing unit <NUM>, a picture storing unit <NUM> and an adder <NUM>.

The entropy decoding unit <NUM> extracts the intra prediction information, the inter prediction information and the quantized coefficient components from a received bit stream using a context-adaptive binary arithmetic decoding method.

The inverse scanning unit <NUM> applies an inverse scan pattern to the quantized coefficient components to generate quantized block. In inter prediction, the inverse scan pattern is a diagonal scan. The quantized coefficient components include the significant flags, the coefficient signs and the coefficients levels.

When the size of the transform unit is larger than the a predetermined size, the significant flags, the coefficient signs and the coefficients levels are inversely scanned in the unit of subset using the diagonal scan to generate subsets, and the subsets are inversely scanned using the diagonal scan to generate the quantized block. The predetermined size is equal to the size of the subset. The subset is a 4x4 block including <NUM> transform coefficients. The significant flags, the coefficient signs and the coefficient levels are inversely scanned in the reverse direction. The subsets are also inversely scanned in the reverse direction.

A parameter indicating last non-zero coefficient position and the non-zero subset flags are extracted from the bit stream. The number of encoded subsets is determined based on the parameter indicating last non-zero coefficient position. The non-zero subset flag is used to determine whether the corresponding subset has at least one non-zero coefficient. If the non-zero subset flag is equal to <NUM>, the subset is generated using the diagonal scan. The first subset and the last subset are generated using the inverse scan pattern.

The inverse quantization unit <NUM> receives the differential quantization parameter from the entropy decoding unit <NUM> and generates the quantization parameter predictor to generate the quantization parameter of the coding unit. The operation of generating the quantization parameter predictor is the same as the operation of the quantization unit <NUM> of <FIG>. Then, the quantization parameter of the current coding unit is generated by adding the differential quantization parameter and the quantization parameter predictor. If the differential quantization parameter for the current coding unit is not transmitted from an encoding side, the differential quantization parameter is set to zero.

The inverse quantization unit <NUM> inversely quantizes the quantized block.

The inverse transform unit <NUM> inversely transforms the inverse-quantized block to generate a residual block. An inverse transform matrix is adaptively determined according to the prediction mode and the size of the transform unit. The inverse transform matrix is a DCT-based integer transform matrix or a DST-based integer transform matrix. In inter prediction,the DCT-based integer transforms are used.

The intra prediction unit <NUM> derivesanintra prediction mode of a current prediction unit using the received intra prediction information, and generates a prediction block according to the derived intra prediction mode.

The inter prediction unit <NUM> derives the motion information of the current prediction unit using the received inter prediction information, and generates a prediction block using the motion information.

The post-processing unit <NUM> operates the same as the post-processing unit <NUM> of <FIG>.

The adder <NUM> adds the restored residual block and a prediction block to generate a reconstructed block.

<FIG> is a flow chart illustrating a method of decoding an image in inter prediction mode.

Motion information of a current block is derived (S310). The current block is a prediction unit. A size of the current block is determined by the size of the coding unit and the partitioning mode.

The motion information varies according to a prediction type. If the prediction type is a uni-directional prediction, the motion information includes a reference index specifying a picture of a reference list <NUM>, and a motion vector. If the prediction type is a bi-directional prediction, the motion information includes a reference index specifying a picture of a reference list <NUM>, a reference index specifying a picture of a reference list <NUM>, and a list <NUM> motion vector and a list <NUM> motion vector.

The motion information is adaptively decoded according the coding mode of the motion information. The coding mode of the motion information is determined by a skip flag and a merge flag. If the skip flag is equal to <NUM>, the merge flag does not exist and the coding mode is a skip mode. If the skip flag is equal to <NUM> and the merge flag is equal to <NUM>, the coding mode is a merge mode. If the skip flag and the merge flag are equal to <NUM>, the coding mode is an AMVP mode.

A prediction block of the current block is generated using the motion information (S320).

If the motion vector indicates a pixel position, the prediction block is generated by copying a block of the reference picture specified by the motion vector. If the motion vector indicates a sub-pixel position, the prediction block is generated by interpolating the pixels of the reference picture.

A residual block is generated (S330). The residual block is generated by the entropy decoding unit <NUM>, the inverse scanning unit <NUM>, the inverse quantization unit <NUM> and the inverse transform unit <NUM> of <FIG>.

A reconstructed block is generated using the prediction block and the residual block (S340).

The prediction block has the same size of the prediction unit, and the residual block has the same size of the transform unit. Therefore, the residual signals and the prediction signals of same size are added to generate reconstructed signals.

<FIG> is a flow chart illustrating a method of deriving motion information in merge mode.

A merge index is extracted from a bit stream(S410). If the merge index does not exist, the number of merge candidates is set to one.

Spatial merge candidates are derived (S420). The available spatial merge candidates are the same as describe in S210 of <FIG>.

A temporal merge candidate is derived (S430). The temporal merge candidate includes a reference picture index and a motion vector of the temporal merge candidate. The reference index and the motion vector of the temporal merge candidate are the same as described in S220 of <FIG>.

A merge candidate list is constructed (S440). The merge list is the same as described in S230 of <FIG>.

It is determined whether one or more merge candidates are generated or not (S450). The determination is performed by comparing the number of merge candidates listed in the merge candidate list with a predetermined number of the merge candidates. The predetermined number is determined per picture or slice.

If the number of merge candidates listed in the merge candidate list is smaller than a predetermined number of the merge candidates, one or more merge candidates are generated (S460). The generated merge candidate is listed after the last available merge candidate. The merge candidate is generated as the same method described in S250 of <FIG>.

The merge candidate specified by the merge index is set as the motion information of the current block (S470).

<FIG> is a flow chart illustrating a procedure of generating a residual block in inter prediction mode.

Quantized coefficient components are generated by the entropy decoding unit (S510).

A quantized block is generated by inversely scanning the quantized coefficient components according to the diagonal scan (S520). The quantized coefficient components include the significant flags, the coefficient signs and the coefficients levels.

The parameter indicating last non-zero coefficient position and the non-zero subset flags are extracted from the bit stream. The number of encoded subsets is determined based on the parameter indicating last non-zero coefficient position. The non-zero subset flags are used to determine whether the subset has at least one non-zero coefficient. If the non-zero subset flag is equal to <NUM>, the subset is generated using the diagonal scan. The first subset and the last subset are generated using the inverse scan pattern.

The quantized block is inversely quantized using an inverse quantization matrix and a quantization parameter (S530).

<FIG> is a flow chart illustrating a method of deriving a quantization parameter.

A minimum size of quantization unit is determined (S531). A parameter cu_qp_delta_enabled_infospecifying the minimum size is extracted from a bit stream, and the minimum size of the quantization unit is determined by the following equation.

The MinQUSize indicates the minimum size of the quantization unit, the MaxCUSize indicates the size of LCU. The parameter cu_qp_delta_enabled_info is extracted from a picture parameter set.

A differential quantization parameter of the current coding unit is derived (S532). The differential quantization parameter is included per quantization unit. Therefore, if the size of the current coding unit is equal to or larger than the minimum size of the quantization unit, the differential quantization parameter for the current coding unit is restored. If the differential quantization parameter does not exist, the differential quantization parameter is set to zero. If multiple coding units belong to a quantization unit, the first coding unit containing at least one non-zero coefficient in the decoding order contains the differential quantization unit.

A coded differential quantization parameter is arithmetically decoded to generate bin string indicating the absolute value of the differential quantization parameter and a bin indicating the sign of the differential quantization parameter. The bin string may be a truncated unary code. If the absolute value of the differential quantization parameter is zero, the bin indicating the sign does not exist. The differential quantization parameter is derived using the bin string indicating the absolute value and the bin indicating the sign.

A quantization parameter predictor of the current coding unit is derived (S533). The quantization parameter predictor is generated by using quantization parameters of neighboring coding units and quantization parameter of previous coding unit as follows.

A left quantization parameter, an above quantization parameter and a previous quantization parameter are sequentially retrieved in this order. An average of the first two available quantization parameters retrieved in that order is set as the quantization parameter predictor when two or more quantization parameters are available, and when only one quantization parameter is available, the available quantization parameter is set as the quantization parameter predictor. That is, if the left and above quantization parameter are available, the average of the left and above quantization parameter is set as the quantization parameter predictor. If only one of the left and above quantization parameter is available, the average of the available quantization parameter and the previous quantization parameter is set as the quantization parameter predictor. If both of the left and above quantization parameter are unavailable, the previous quantization parameter is set as the quantization parameter predictor.

If multiple coding units belong to a quantization unit of minimum size, the quantization parameter predictor for the first coding unit in decoding order is derived and used for the other coding units.

The quantization parameter of the current coding unit is generated using the differential quantization parameter and the quantization parameter predictor (S534).

Claim 1:
A method of encoding video data in a merge mode, comprising:
determining (S110) motion information of a current block;
generating (S120) a prediction block of the current block using the motion information;
generating (S130) a residual block using the current block and the prediction block;
transforming the residual block to generate a transformed block;
quantizing the transformed block using a quantization parameter to generate a quantized block;
scanning coefficient components of the quantized block using a diagonal scan;
entropy-coding the scanned coefficient components of the quantized block; and
encoding (S150) the motion information,
wherein encoding the motion information comprises the sub-steps of:
deriving (S210) spatial merge candidates;
deriving (S220) a temporal merge candidate;
constructing (S230) a merge list using available spatial and temporal merge candidates;
selecting (S260) a merge predictor among merge candidates of the merge list; and
encoding a merge index specifying the merge predictor,
wherein when the current block is a second prediction block partitioned by asymmetric partitioning from a current coding unit, the spatial merge candidate corresponding to a first prediction unit partitioned by the asymmetric partitioning is not to be listed on the merge list,
wherein the quantization parameter is determined per a quantization unit and is encoded using a quantization parameter predictor, and wherein the quantization parameter is a quantization step size,
wherein the quantization parameter predictor is generated by using quantization parameters of neighboring coding units and a quantization parameter of a previous coding unit such that if two or more quantization parameters are available among a left quantization parameter, an above quantization parameter and a previous quantization parameter of the current coding unit, the quantization parameter predictor is generated using an average of the first two available quantization parameters among the left quantization parameter, the above quantization parameter and the previous quantization parameter in that order, and
if only one is available among the left quantization parameter, the above quantization parameter and the previous quantization parameter, the available quantization parameter is set as the quantization parameter predictor.