Video decoding method, video encoding method and device for sending compressed video data

By combining video signal encoding blocks and performing prediction or transformation based on the merge block, the problem of low encoding/decoding efficiency in the prior art is solved, and more efficient video signal processing is achieved.

CN114501006BActive Publication Date: 2025-03-04KT CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210312675.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2016-10-04
Filing Date
2017-09-20
Publication Date
2025-03-04
Estimated Expiration
2037-09-20

AI Technical Summary

Technical Problem

When encoding/decoding a video signal, it is difficult for the prior art to effectively divide or merge the encoding/decoding target blocks, resulting in low encoding/decoding efficiency.

Method used

By determining the merge target candidate block of the current encoding block and merging it with the current encoding block to generate a merge block, prediction or transformation is performed based on the merge block, thereby improving the encoding/decoding efficiency.

Benefits of technology

This method can improve encoding/decoding efficiency and optimize the processing process of video signals by combining block prediction or transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114501006B_ABST
    Figure CN114501006B_ABST
Patent Text Reader

Abstract

A video decoding method, a video encoding method and a bitstream decoding device are provided. The method for decoding a video comprises: determining whether a coding block is divided into two partitions based on a 1-bit first flag; when it is determined that the coding block is divided into the two partitions including a first partition and a second partition, determining whether the coding block is symmetrically divided or asymmetrically divided based on a 1-bit second flag, wherein the coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, wherein when it is determined that the coding block is asymmetrically divided, the first partition has a size of 3 / 4 of the coding block, and the second partition has a size of 1 / 4 of the coding block, and wherein the positions of the first partition and the second partition in the coding block are determined based on a 1-bit third flag.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application filed on March 18, 2019, with application number 201780057325.5 and invention name “Method and device for processing video signals”. The international application date of the parent application is September 20, 2017, the international application number is PCT / KR2017 / 010355, and the priority date is September 20, 2016. Technical Field

[0002] The present invention relates to a method and a device for processing a video signal, and in particular to a video decoding method, a video encoding method and a bit stream decoding device. Background Art

[0003] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, has increased in various application fields. However, the data volume of image data with higher resolution and quality increases compared to conventional image data. Therefore, when the image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when the image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology can be used.

[0004] The image compression technology includes various technologies, including: an inter-frame prediction technology that predicts a pixel value included in a current picture based on a previous picture or a subsequent picture of the current picture; an intra-frame prediction technology that predicts a pixel value included in a current picture by using pixel information in the current picture; an entropy coding technology that assigns a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence, etc. Image data can be effectively compressed by using such an image compression technology, and the image data can be transmitted or stored.

[0005] Meanwhile, as the demand for high-resolution images increases, the demand for stereoscopic image content as a new image service is also increasing. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being discussed. Summary of the invention

[0006] Technical issues

[0007] An object of the present invention is to provide a method and apparatus for efficiently dividing / merging encoding / decoding target blocks when encoding / decoding a video signal.

[0008] An object of the present invention is to provide a method and apparatus for merging two blocks in which division is completed and performing prediction or transformation based on the merged block when encoding / decoding a video signal.

[0009] An object of the present invention is to provide a method and apparatus for performing transformation by dividing or converting non-square blocks into square blocks when encoding / decoding a video signal.

[0010] The technical objectives to be achieved by the present invention are not limited to the above technical problems. Moreover, those skilled in the art will obviously understand other technical problems not mentioned according to the following description.

[0011] Technical Solution

[0012] The method and apparatus for decoding a video signal according to the present invention can determine a merging target candidate block of a current coding block, specify at least one of the merging target candidate blocks, and generate a merging block by merging the specified merging target candidate block with the current coding block.

[0013] The method and apparatus for encoding a video signal according to the present invention can determine a merging target candidate block of a current coding block, specify at least one of the merging target candidate blocks, and generate a merging block by merging the specified merging target candidate block with the current coding block.

[0014] In the method and apparatus for encoding / decoding a video signal according to the present invention, a plurality of coding blocks included in a merging block may have the same motion information or have the same intra prediction mode.

[0015] In the method and apparatus for encoding / decoding a video signal according to the present invention, a plurality of coding blocks included in a merging block may have the same transform type.

[0016] In the method and apparatus for encoding / decoding a video signal according to the present invention, the transform type may include at least one of a transform scheme or a transform mode.

[0017] In the method and apparatus for encoding / decoding a video signal according to the present invention, the merge target candidate block may include at least one of neighboring blocks adjacent to the current coding block.

[0018] In the method and apparatus for encoding / decoding a video signal according to the present invention, whether a neighboring block is usable as a merge target candidate block may be determined based on at least one of heights, widths, or sizes of a current coding block and neighboring coding blocks.

[0019] In the method and apparatus for encoding / decoding a video signal according to the present invention, merging the current coding block with the merging target candidate block is allowed only when the size or shape of the current coding block satisfies a predefined condition.

[0020] The present invention provides a method for decoding a video, the method comprising: determining whether a coding block is divided into two partitions based on a 1-bit first flag; and when it is determined that the coding block is divided into the two partitions including a first partition and a second partition, determining whether the coding block is divided symmetrically or asymmetrically based on a 1-bit second flag, wherein the coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, wherein when it is determined that the coding block is divided asymmetrically, the first partition has a size of 3 / 4 of the coding block, and the second partition has a size of 1 / 4 of the coding block, and wherein the positions of the first partition and the second partition in the coding block are determined based on a 1-bit third flag.

[0021] The present invention provides a method for encoding a video, the method comprising: encoding a 1-bit first flag by determining whether a coding block is divided into two partitions; when it is determined that the coding block is divided into two partitions including a first partition and a second partition, encoding a 1-bit second flag by determining whether the coding block is divided symmetrically or asymmetrically, wherein the coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, wherein when the coding block is asymmetrically divided, the first partition has a size of 3 / 4 of the coding block, and the second partition has a size of 1 / 4 of the coding block, and wherein a 1-bit third flag is also encoded by determining the positions of the first partition and the second partition within the coding block.

[0022] The present invention provides a device for decoding a bit stream associated with a video signal, wherein the bit stream includes a 1-bit first flag, wherein the 1-bit first flag is used to determine whether a coding block is divided into two partitions, wherein when the coding block is divided into two partitions including a first partition and a second partition, the bit stream also includes a 1-bit second flag, wherein the 1-bit second flag is used to determine whether the coding block is divided symmetrically or asymmetrically, wherein the coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, wherein when the coding block is divided asymmetrically, the first partition has a size of 3 / 4 of the coding block, and the second partition has a size of 1 / 4 of the coding block, and wherein the bit stream also includes a 1-bit third flag to determine the positions of the first partition and the second partition in the coding block.

[0023] The features briefly summarized above are merely illustrative aspects of the detailed description of the invention that follows and do not limit the scope of the invention.

[0024] Beneficial Effects

[0025] According to the present invention, by effectively dividing / merging encoding / decoding target blocks, encoding / decoding efficiency can be improved.

[0026] According to the present invention, by merging two blocks in which division is completed and performing prediction or transformation based on the merged block, encoding / decoding efficiency can be improved.

[0027] According to the present invention, by performing transformation after dividing or converting a non-square block into square blocks, encoding / decoding efficiency can be improved.

[0028] Effects that can be obtained by the present invention are not limited to the above-mentioned effects, and other effects that are not mentioned can be clearly understood by those skilled in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.

[0030] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.

[0031] Figure 3 2 is a diagram illustrating an example of hierarchically splitting a coding block based on a tree structure according to an embodiment of the present invention.

[0032] Figure 4 is a diagram showing partition types that allow binary tree-based partitioning according to an embodiment of the present invention.

[0033] Figure 5 is a diagram showing an example of allowing only a predetermined type of binary tree-based partitioning according to an embodiment of the present invention.

[0034] Figure 6 1 is a diagram for explaining an example of encoding / decoding information on the allowable number of binary tree divisions according to an embodiment to which the present invention is applied.

[0035] Figure 7 The partitioning type of the coding block based on an asymmetric binary tree partitioning is shown.

[0036] Figure 8 An example of dividing a coding block into multiple coding blocks using QTBT and asymmetric binary tree partitioning is shown.

[0037] Fig. 9 is a diagram showing the types of partitioning that can be applied to a coding block.

[0038] Fig.10 is a diagram showing partition modes that can be applied to a coding block when the coding block is encoded by inter-frame prediction.

[0039] Fig.11 is a diagram showing an example of generating a merged prediction block.

[0040] Fig.12 is a diagram showing an example of generating a merged prediction block by merging a plurality of coding blocks.

[0041] Fig.13 and Fig.14 is a diagram showing reference samples of a merged prediction block.

[0042] Fig.15 is a flowchart illustrating a block merging method according to an embodiment of the present invention.

[0043] Fig.16 is a flowchart showing a process of obtaining residual samples according to an embodiment to which the present invention is applied.

[0044] Fig.17 It is a diagram showing a transform coefficient level map.

[0045] Fig.18 is a diagram for explaining an aspect of decoding a transform coefficient encoding indicator based on a predetermined unit.

[0046] Fig.19 is a diagram showing a decoding order of transform coefficients according to each scanning order.

[0047] Fig. 20 is a diagram showing a scanning order between sub-blocks according to a scanning order of a current block.

[0048] Fig.21 is a diagram showing a scanning order of a transform coefficient basis block according to the shape of a current block.

[0049] Fig. 22 is a diagram showing an example of dividing a non-square current block into square sub-blocks.

[0050] Figure 23 to Figure 26 is a diagram showing an example of converting a non-square block into a square block. DETAILED DESCRIPTION

[0051] The present invention can be modified in various ways, and there are various embodiments of the present invention, and examples of various embodiments will now be provided with reference to the accompanying drawings, and examples of various embodiments will be described in detail. However, the present invention is not limited thereto, and the exemplary embodiments may be interpreted as including all modifications, equivalents or alternatives within the technical concept and technical scope of the present invention. In the described drawings, similar reference numerals refer to similar elements.

[0052] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not to be construed as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be referred to as a "second" component, and a "second" component may also be similarly referred to as a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple terms.

[0053] It should be understood that, in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or the element may be connected to or coupled to another element with other elements interposed therebetween. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.

[0054] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Expressions used in the singular include expressions in the plural form unless they have significantly different meanings in the context. In this specification, it should be understood that terms such as "including", "having" etc. are intended to indicate the existence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added.

[0055] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are denoted by the same reference numerals, and repeated description of the same elements will be omitted.

[0056] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.

[0057] Reference Figure 1 The device 100 for encoding a video may include: a picture segmentation module 110, prediction modules 120 and 125, a transformation module 130, a quantization module 135, a rearrangement module 160, an entropy coding module 165, an inverse quantization module 140, an inverse transformation module 145, a filter module 150 and a memory 155.

[0058] Figure 1The components shown in are shown independently to represent the characteristic functions that are different from each other in the device for encoding video. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment of combining each component and the embodiment of dividing a component are also included in the scope of the present invention.

[0059] In addition, some of the components may not be indispensable components for performing the basic functions of the present invention, but optional components only for improving the performance of the present invention. The present invention can be realized by excluding components for improving performance and only including indispensable components for realizing the essence of the present invention. Structures excluding optional components only for improving performance and only including indispensable components are also included in the scope of the present invention.

[0060] The picture segmentation module 110 may segment an input picture into one or more processing units. Here, a processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture segmentation module 110 may segment a picture into a combination of a plurality of coding units, prediction units, and transform units, and may encode a picture by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).

[0061] For example, a picture can be divided into multiple coding units. A recursive tree structure such as a quadtree structure can be used to divide a picture into coding units. A coding unit divided into other coding units with a picture or a maximum coding unit as a root can be divided in a manner that child nodes correspond to the number of divided coding units. Coding units that cannot be further divided by predetermined restrictions are used as leaf nodes. That is, when it is assumed that only square division is feasible for a coding unit, a coding unit can be divided into up to four other coding units.

[0062] Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.

[0063] The prediction unit may be one of partitions partitioned into a square shape or a rectangular shape having the same size in a single coding unit, or the prediction unit may be one of partitions partitioned so as to have different shapes / sizes in a single coding unit.

[0064] When a prediction unit subject to intra prediction is generated based on a coding unit and the coding unit is not a minimum coding unit, intra prediction may be performed without splitting the coding unit into a plurality of prediction units N×N.

[0065] The prediction modules 120 and 125 may include an inter prediction module 120 that performs inter prediction and an intra prediction module 125 that performs intra prediction. It may be determined whether inter prediction or intra prediction is performed for the prediction unit, and detailed information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. Here, the processing unit subjected to prediction may be different from the processing unit for which the prediction method and detailed content are determined. For example, the prediction method, prediction mode, etc. may be determined by the prediction unit, and the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform module 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding module 165, and may be transmitted to a device for decoding a video. When a specific encoding mode is used, the original block may be encoded as it is without generating a prediction block through the prediction modules 120 and 125 to transmit to a device for decoding a video.

[0066] The inter-frame prediction module 120 may predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture, or in some cases, may predict a prediction unit based on information of some coding regions in the current picture. The inter-frame prediction module 120 may include a reference picture interpolation module, a motion prediction module, and a motion compensation module.

[0067] The reference picture interpolation module may receive reference picture information from the memory 155, and may generate pixel information of an integer pixel or less than an integer pixel according to the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of an integer pixel or less than an integer pixel in units of 1 / 4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of an integer pixel or less than an integer pixel in units of 1 / 8 pixels.

[0068] The motion prediction module can perform motion prediction based on the reference picture interpolated by the reference picture interpolation module. As a method for calculating a motion vector, various methods can be used, for example, a block matching algorithm based on a full search (FBMA), a three-step search (TSS), and a new three-step search algorithm (NTS), etc. Based on the interpolated pixel, the motion vector can have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. As a motion prediction method, various methods can be used, for example, a skip method, a merge method, an AMVP (Advanced Motion Vector Prediction) method, an intra-frame block copy method, etc.

[0069] The intra prediction module 125 may generate a prediction unit based on reference pixel information adjacent to the current block as pixel information in the current picture. When the adjacent block of the current prediction unit is a block subject to inter prediction and thus the reference pixel is a pixel subject to inter prediction, the reference pixel included in the block subject to inter prediction may be replaced with the reference pixel information of the adjacent block subject to intra prediction. That is, when the reference pixel is unavailable, at least one reference pixel among the available reference pixels may be used to replace the unavailable reference pixel information.

[0070] The prediction mode in the intra prediction may include a directional prediction mode that uses reference pixel information depending on the prediction direction and a non-directional prediction mode that does not use directional information when performing prediction. The mode for predicting luma information may be different from the mode for predicting chroma information, and in order to predict chroma information, the intra prediction mode information for predicting luma information or the predicted luma signal information may be utilized.

[0071] When performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and top of the prediction unit. However, when performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the minimum coding unit.

[0072] In the intra prediction method, a prediction block may be generated after applying an AIS (Adaptive Intra Smoothing) filter to a reference pixel depending on a prediction mode. The type of the AIS filter applied to the reference pixel may vary. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted based on the intra prediction mode of a prediction unit adjacent to the current prediction unit. In predicting the prediction mode of the current prediction unit by using the mode information predicted based on the adjacent prediction unit, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the adjacent prediction unit, predetermined flag information may be used to transmit information indicating that the prediction mode of the current prediction unit and the prediction mode of the adjacent prediction unit are the same as each other. When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy coding may be performed to encode the prediction mode information of the current block.

[0073] In addition, a residual block including information on a residual value, which is a difference between the prediction unit subjected to prediction and the original block of the prediction unit, may be generated based on the prediction unit generated by the prediction modules 120 and 125. The generated residual block may be input to the transform module 130.

[0074] The transform module 130 may transform the residual block including information about the residual value between the original block and the prediction unit generated by the prediction modules 120 and 125 by using a transform method such as discrete cosine transform (DCT), discrete sine transform (DST), and KLT. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.

[0075] The quantization module 135 may quantize the value transformed to the frequency domain by the transform module 130. The quantization coefficient may vary depending on the importance of the block or picture. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.

[0076] The rearrangement module 160 may rearrange the coefficients of the quantized residual value.

[0077] The rearrangement module 160 may change the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module 160 may use a zigzag scanning method to scan from the DC coefficient to the coefficients in the high frequency domain to change the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, the zigzag scanning may be replaced by a vertical scanning of the coefficients in the two-dimensional block form along the column direction or a horizontal scanning of the coefficients in the two-dimensional block form along the row direction. That is, which scanning method among the zigzag scanning, the vertical scanning, and the horizontal scanning may be used depending on the size of the transform unit and the intra-frame prediction mode.

[0078] The entropy encoding module 165 may perform entropy encoding based on the value calculated by the rearrangement module 160. The entropy encoding may use various encoding methods such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).

[0079] The entropy coding module 165 can encode various information from the rearrangement module 160 and the prediction modules 120 and 125, such as residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transformation unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.

[0080] The entropy encoding module 165 may entropy encode coefficients of the coding unit input from the rearrangement module 160 .

[0081] The inverse quantization module 140 may inversely quantize the value quantized by the quantization module 135, and the inverse transform module 145 may inversely transform the value transformed by the transform module 130. The residual values ​​generated by the inverse quantization module 140 and the inverse transform module 145 may be combined with the prediction units predicted by the motion estimation module, the motion compensation module, and the intra prediction module of the prediction modules 120 and 125, so that a reconstructed block may be generated.

[0082] The filter module 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

[0083] The deblocking filter can remove block distortion that occurs due to the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, the pixels included in several rows or columns of the block can be the basis for determining whether to apply the deblocking filter to the current block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied depending on the required deblocking filter strength. In addition, when applying the deblocking filter, horizontal filtering and vertical filtering can be processed in parallel.

[0084] The offset correction module can correct the offset from the original picture in units of pixels in the picture subjected to deblocking. In order to perform offset correction on a specific picture, a method of applying an offset considering edge information of each pixel can be used, or the following method can be used: pixels of the picture are divided into a predetermined number of regions, the region to be subjected to offset is determined, and the offset is applied to the determined region.

[0085] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing the filtered reconstructed picture with the original picture. The pixels included in the picture can be divided into predetermined groups, the filter to be applied to each group can be determined, and filtering can be performed separately for each group. Information on whether to apply ALF and a luminance signal can be transmitted by a coding unit (CU). The shape and filter coefficients of the filter used for ALF can vary depending on each block. In addition, regardless of the characteristics of the application target block, a filter of the same shape (fixed shape) for ALF can be applied.

[0086] The memory 155 may store the reconstructed block or the reconstructed picture calculated by the filter module 150. The stored reconstructed block or the reconstructed picture may be provided to the prediction modules 120 and 125 when performing inter prediction.

[0087] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.

[0088] Reference Figure 2 The apparatus 200 for decoding a video may include an entropy decoding module 210 , a rearrangement module 215 , an inverse quantization module 220 , an inverse transform module 225 , prediction modules 230 and 235 , a filter module 240 , and a memory 245 .

[0089] When a video bitstream is input from the apparatus for encoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding a video.

[0090] The entropy decoding module 210 can perform entropy decoding according to the inverse process of entropy encoding performed by the entropy encoding module of the device for encoding the video. For example, corresponding to the method performed by the device for encoding the video, various methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC) and context adaptive binary arithmetic coding (CABAC) can be applied.

[0091] The entropy decoding module 210 may decode information about intra prediction and inter prediction performed by the apparatus for encoding a video.

[0092] The rearrangement module 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding module 210 based on the rearrangement method used in the apparatus for encoding a video. The rearrangement module may reconstruct and rearrange coefficients in a one-dimensional vector form into coefficients in a two-dimensional block form. The rearrangement module 215 may receive information related to coefficient scanning performed in the apparatus for encoding a video, and may perform rearrangement via a method of inversely scanning the coefficients based on a scanning order performed in the apparatus for encoding a video.

[0093] The inverse quantization module 220 may perform inverse quantization based on a quantization parameter received from the apparatus for encoding a video and coefficients of the rearranged block.

[0094] The inverse transform module 225 can perform an inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, which is the inverse process of the transform, i.e., DCT, DST, and KLT, performed by the transform module on the quantization result of the device for encoding the video. The inverse transform can be performed based on the transform unit determined by the device for encoding the video. The inverse transform module 225 of the device for decoding the video can selectively perform a transform scheme such as DCT, DST, KLT depending on multiple pieces of information such as a prediction method, a size of a current block, a prediction direction, etc.

[0095] The prediction modules 230 and 235 may generate a prediction block based on the information on prediction block generation received from the entropy decoding module 210 and previously decoded block or picture information received from the memory 245 .

[0096] As described above, similar to the operation of the apparatus for encoding a video, when performing intra-frame prediction, when the size of the prediction unit is the same as the size of the transform unit, intra-frame prediction can be performed on the prediction unit based on pixels located on the left, upper left, and top of the prediction unit. When performing intra-frame prediction, when the size of the prediction unit is different from the size of the transform unit, intra-frame prediction can be performed using reference pixels based on the transform unit. In addition, intra-frame prediction using N×N partitioning can be used only for the minimum coding unit.

[0097] The prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module may receive various information from the entropy decoding module 210, such as prediction unit information, prediction mode information of the intra-frame prediction method, information about motion prediction of the inter-frame prediction method, etc., may divide the current coding unit into prediction units, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required for inter-frame prediction of the current prediction unit received from the device for encoding a video, the inter-frame prediction module 230 may perform inter-frame prediction on the current prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit. Alternatively, inter-frame prediction may be performed based on information of some pre-reconstructed areas in the current picture including the current prediction unit.

[0098] In order to perform inter prediction, which one of the skip mode, the merge mode, the AMVP mode, and the inter block copy mode is used as a motion prediction method of a prediction unit included in the coding unit may be determined for the coding unit.

[0099] The intra prediction module 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit subjected to intra prediction, intra prediction can be performed based on the intra prediction mode information of the prediction unit received from the device for encoding the video. The intra prediction module 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and may determine whether to apply the filter depending on the prediction mode of the current prediction unit. AIS filtering may be performed on the reference pixels of the current block by using the prediction mode and AIS filter information of the prediction unit received from the device for encoding the video. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0100] When the prediction mode of the prediction unit is a prediction mode for performing intra-frame prediction based on pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolation module may interpolate the reference pixels to generate reference pixels of integer pixels or less than integer pixels. When the prediction mode of the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, a DC filter may generate a prediction block by filtering.

[0101] The reconstructed block or the reconstructed picture may be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.

[0102] Information about whether to apply a deblocking filter to a corresponding block or picture and information about which filter of a strong filter and a weak filter to apply when applying the deblocking filter can be received from a device for encoding a video. The deblocking filter of a device for decoding a video can receive information about the deblocking filter from a device for encoding a video, and can perform deblocking filtering on the corresponding block.

[0103] The offset correction module may perform offset correction on the reconstructed picture based on the type of offset correction applied to the picture when encoding is performed and offset value information.

[0104] The AFL may be applied to the coding unit based on information on whether the ALF is applied and ALF coefficient information, etc., received from the apparatus for encoding a video. The ALF information may be provided to be included in a specific parameter set.

[0105] The memory 245 may store the reconstructed picture or the reconstructed block to be used as a reference picture or a reference block, and may provide the reconstructed picture to the output module.

[0106] As described above, in the embodiments of the present invention, for convenience of explanation, a coding unit is used as a term indicating a unit for encoding, however, the coding unit may be used as a unit that performs decoding as well as encoding.

[0107] In addition, the current block may represent a target block to be encoded / decoded. Also, depending on the encoding / decoding step, the current block may represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), a prediction block (or prediction unit), etc.

[0108] The picture can be encoded / decoded by dividing the picture into basic blocks with square or non-square shapes. At this time, the basic block can be called a coding tree unit. The coding tree unit can be defined as a coding unit of the maximum size allowed within a sequence or slice. Information about whether the coding tree unit has a square shape or a non-square shape or information about the size of the coding tree unit can be signaled by a sequence parameter set, a picture parameter set, or a slice header. The coding tree unit can be divided into partitions of smaller sizes. At this time, if it is assumed that the partition depth generated by dividing the coding tree unit is 1, the partition depth generated by dividing the partition with a depth of 1 can be defined as 2. That is, the partition generated by dividing the partition with a depth of k in the coding tree unit can be defined as having a depth of k+1.

[0109] A partition of any size generated by dividing a coding tree unit may be defined as a coding unit. A coding unit may be recursively divided or divided into basic units for performing prediction, quantization, transformation, or loop filtering, etc. For example, a partition of any size generated by dividing a coding unit may be defined as a coding unit, or may be defined as a transformation unit or a prediction unit, which is a basic unit for performing prediction, quantization, transformation, or loop filtering, etc.

[0110] The segmentation of the coding tree unit or the coding unit may be performed based on at least one of a vertical line and a horizontal line. In addition, the number of vertical lines or horizontal lines that segment the coding tree unit or the coding unit may be at least one or more. For example, the coding tree unit or the coding unit may be divided into two partitions using one vertical line or one horizontal line, or the coding tree unit or the coding unit may be divided into three partitions using two vertical lines or two horizontal lines. Alternatively, the coding tree unit or the coding unit may be segmented into four partitions having a length and a width of 1 / 2 by using one vertical line and one horizontal line.

[0111] When the coding tree unit or the coding unit is divided into a plurality of partitions using at least one vertical line or at least one horizontal line, the partitions may have a uniform size or different sizes. Alternatively, any one partition may have a different size from the remaining partitions.

[0112] In the embodiments described below, it is assumed that the coding tree unit or the coding unit is divided into a quadtree structure or a binary tree structure. However, the coding tree unit or the coding unit may be divided using a greater number of vertical lines or a greater number of horizontal lines.

[0113] Figure 3 2 is a diagram illustrating an example of hierarchically splitting a coding block based on a tree structure according to an embodiment of the present invention.

[0114] The input video signal is decoded in predetermined block units. Such a default unit for decoding the input video signal is a coding block. A coding block may be a unit that performs intra / inter prediction, transformation, and quantization. In addition, a prediction mode (e.g., an intra prediction mode or an inter prediction mode) is determined in units of coding blocks, and the prediction blocks included in the coding block may share the determined prediction mode. A coding block may be a square block or a non-square block of any size in the range of 8×8 to 64×64, or may be a square block or a non-square block of a size of 128×128, 256×256, or larger.

[0115] Specifically, the coding block may be hierarchically partitioned based on at least one of a quadtree and a binary tree. Here, the quadtree-based partitioning may mean partitioning a 2N×2N coding block into four N×N coding blocks, and the binary tree-based partitioning may mean partitioning one coding block into two coding blocks. Even if the binary tree-based partitioning is performed, a square-shaped coding block may exist in a lower depth.

[0116] The binary tree-based segmentation can be performed symmetrically or asymmetrically. In addition, the coding block based on the binary tree segmentation can be a square block or a non-square block, such as a rectangular shape. For example, the segmentation type allowing the binary tree-based segmentation can include at least one of the symmetric type of 2N×N (non-square coding unit in the horizontal direction) or N×2N (non-square coding unit in the vertical direction), nL×2N, nR×2N, 2N×nU or 2N×nD.

[0117] Binary tree-based partitioning may be restricted to one of symmetric type partitioning or asymmetric type partitioning. In this case, using square blocks to construct coding tree units may correspond to quadtree CU partitioning, and using symmetric non-square blocks to construct coding tree units may correspond to binary tree partitioning. Using square blocks and symmetric non-square blocks to construct coding tree units may correspond to quadtree CU partitioning and binary tree CU partitioning.

[0118] Binary tree-based partitioning may be performed on the coding block for which quadtree-based partitioning is no longer performed. Quadtree-based partitioning may no longer be performed on the coding block for which binary tree-based partitioning is no longer performed.

[0119] In addition, the segmentation at the lower depth may be determined depending on the segmentation type at the higher depth. For example, if binary tree-based segmentation is allowed in two or more depths, only the same type as the binary tree segmentation at the higher depth may be allowed in the lower depth. For example, if binary tree-based segmentation in the higher depth is performed using the 2N×N type, binary tree-based segmentation in the lower depth is also performed using the 2N×N type. Alternatively, if binary tree-based segmentation in the higher depth is performed using the N×2N type, binary tree-based segmentation in the lower depth is also performed using the N×2N type.

[0120] In contrast, it is also possible to allow only types of binary tree partitioning at lower depths that are different from the types at higher depths.

[0121] It is possible to restrict that only certain types of binary tree-based partitioning are used for sequences, slices, coding tree units, or coding units. As an example, for a coding tree unit, only 2N×N type or N×2N type of binary tree-based partitioning may be allowed. The available partitioning types may be predefined in an encoder or a decoder. Alternatively, information about available partitioning types or about unavailable partitioning types may be encoded and then signaled through a bitstream.

[0122] Figure 5 is a diagram showing an example in which only certain types of binary tree-based partitioning are allowed. Figure 5 (a) shows an example of a binary tree-based partitioning that only allows N×2N types, and Figure 5 (b) shows an example of binary tree-based partitioning that only allows 2N×N types. In order to implement adaptive partitioning based on quadtrees or binary trees, the following information may be used: information indicating quadtree-based partitioning, information about the size / depth of the coding block that allows quadtree-based partitioning, information indicating binary tree-based partitioning, information about the size / depth of the coding block that allows binary tree-based partitioning, information about the size / depth of the coding block that does not allow binary tree-based partitioning, information about whether binary tree-based partitioning is performed in the vertical direction or in the horizontal direction, etc. For example, quad_split_flag (quadtree partitioning flag) indicates whether the coding block is divided into four coding blocks, and binary_split_flag (binary tree partitioning flag) indicates whether the coding block is divided into two coding blocks. When the coding block is divided into two coding blocks, is_hor_split_flag (horizontal partitioning flag) may be signaled, and is_hor_split_flag indicates whether the partitioning direction of the coding block is the vertical direction or the horizontal direction.

[0123] In addition, for a coding tree unit or a specific coding unit, information about the number of times binary tree splitting is allowed, the depth of binary tree splitting is allowed, or the number of depths of binary tree splitting is allowed can be obtained. This information can be encoded in units of coding tree units or coding units and can be sent to a decoder through a bitstream.

[0124] For example, the syntax "max_binary_depth_idx_minus1" indicating the maximum depth allowed for binary tree partitioning may be encoded / decoded through a bitstream. In this case, max_binary_depth_idx_minus1+1 may indicate the maximum depth allowed for binary tree partitioning.

[0125] Reference Figure 6 In the example shown in Figure 6, binary tree splitting has been performed for a coding unit having a depth of 2 and a coding unit having a depth of 3. Therefore, at least one of information indicating the number of times binary tree splitting in a coding tree unit has been performed (i.e., 2 times), information indicating a maximum depth at which binary tree splitting has been allowed in a coding tree unit (i.e., depth 3), or the number of depths at which binary tree splitting has been performed in a coding tree unit (i.e., 2 (depth 2 and depth 3)) may be encoded / decoded through a bitstream.

[0126] As another example, at least one of the information about the number of times binary tree segmentation is allowed, the depth of binary tree segmentation is allowed, or the number of depths at which binary tree segmentation is allowed may be obtained for each sequence or each slice. For example, the information may be encoded in units of sequences, pictures, or slices and transmitted via a bitstream. Therefore, at least one of the number of binary tree segmentations in a first slice, the maximum depth of binary tree segmentation allowed in a first slice, or the number of depths at which binary tree segmentation is performed in a first slice may be different from that in a second slice. For example, in a first slice, binary tree segmentation may be allowed only for one depth, while in a second slice, binary tree segmentation may be allowed for two depths.

[0127] As another example, the number of times binary tree partitioning is allowed, the depth of binary tree partitioning is allowed, or the number of depths of binary tree partitioning is allowed may be set differently according to a temporal level identifier (TemporalID) of a slice or picture. Here, the temporal level identifier (TemporalID) is used to identify each of a plurality of video layers having at least one of scalability of view, space, time, or quality.

[0128] like Figure 3 As shown in , the first coding block 300 with a partition depth (split depth) of k can be divided into multiple second coding blocks based on a quadtree. For example, the second coding blocks 310 to 340 can be square blocks with half the width and half the height of the first coding block, and the partition depth of the second coding block can be increased to k+1.

[0129] The second coding block 310 having a partition depth of k+1 may be split into a plurality of third coding blocks having a partition depth of k+2. The splitting of the second coding block 310 may be performed by selectively using one of a quadtree and a binary tree depending on a splitting method. Here, the splitting method may be determined based on at least one of information indicating quadtree-based splitting and information indicating binary-based splitting.

[0130] When the second coding block 310 is segmented based on a quadtree, the second coding block 310 may be segmented into four third coding blocks 310a having half the width and half the height of the second coding block, and the partition depth of the third coding block 310a may be increased to k+2. In contrast, when the second coding block 310 is segmented based on a binary tree, the second coding block 310 may be segmented into two third coding blocks. Here, each of the two third coding blocks may be a non-square block having one of half the width and half the height of the second coding block, and the partition depth may be increased to k+2. The second coding block may be determined as a non-square block in the horizontal direction or the vertical direction depending on the segmentation direction, and the segmentation direction may be determined based on information about whether the binary tree-based segmentation is performed in the vertical direction or in the horizontal direction.

[0131] Meanwhile, the second coding block 310 may be determined as a leaf coding block that is no longer partitioned based on a quadtree or a binary tree. In this case, the leaf coding block may be used as a prediction block or a transform block.

[0132] Similar to the partitioning of the second coding block 310, the third coding block 310a may be determined as a leaf coding block, or may be further partitioned based on a quadtree or a binary tree.

[0133] At the same time, the third coding block 310b based on the binary tree partition can be further partitioned into a vertical coding block 310b-2 or a horizontal coding block 310b-3 based on the binary tree, and the partition depth of the relevant coding block can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer partitioned based on the binary tree. In this case, the coding block 310b-1 can be used as a prediction block or a transform block. However, the above-mentioned segmentation process can be performed restrictively based on at least one of the following information: information about the size / depth of the coding block that allows quadtree-based segmentation, information about the size / depth of the coding block that allows binary tree-based segmentation, and information about the size / depth of the coding block that does not allow binary tree-based segmentation.

[0134] The number of candidates representing the size of the coding block may be limited to a predetermined number, or the size of the coding block in a predetermined unit may have a fixed value. As an example, the size of the coding block in a sequence or a picture may be limited to 256×256, 128×128, or 32×32. Information indicating the size of the coding block in the sequence or in the picture may be signaled through a sequence header or a picture header.

[0135] As a result of quadtree and binary tree based partitioning, the coding unit may be represented as a square or rectangular shape of an arbitrary size.

[0136] As a result of the segmentation based on quadtrees and binary trees, the coding blocks that are not further segmented can be used as prediction blocks or transform blocks. That is, in the QTBT segmentation method based on quadtrees and binary trees, coding blocks can become prediction blocks, and prediction blocks can become transform blocks. For example, when the QTBT segmentation method is used, a predicted image can be generated in units of coding blocks, and a residual signal of the difference between the original image and the predicted image can be transmitted in units of coding blocks. Here, generating a predicted image in units of coding blocks can mean determining motion information for a coding block, or determining an intra-frame prediction mode for a coding block.

[0137] In the QTBT segmentation method, it can be set to allow only symmetric segmentation in BT. However, if only symmetric binary segmentation is allowed even when the target and background are divided at the block boundary, the coding efficiency may be reduced. Therefore, in the present invention, a method for asymmetrically segmenting a coding block is proposed to improve the coding efficiency.

[0138] Asymmetric binary tree partitioning means partitioning a coding block into two smaller coding blocks. As a result of asymmetric binary tree partitioning, a coding block may be partitioned into two coding blocks in an asymmetric form. For ease of explanation, in the following embodiments, partitioning a coding block into two partitions in a symmetric form will be referred to as binary tree partitioning (or binary tree partitioning), and partitioning a coding block into two partitions in an asymmetric form will be referred to as asymmetric binary tree partitioning (or asymmetric binary tree partitioning).

[0139] Figure 7 The partition type of the coding block based on the asymmetric binary tree partition is shown. The 2Nx2N coding block can be divided into two coding blocks with a width ratio of n:(ln) or two coding blocks with a height ratio of n:(1-n). Where n can represent a real number greater than 0 and less than 1.

[0140] exist Figure 7 As shown in , by applying asymmetric binary tree partitioning to coding blocks, two coding blocks with a width ratio of 1:3 or 3:1 or a height ratio of 1:3 or 3:1 are generated.

[0141] Specifically, when a WxH-sized coding block is partitioned in the vertical direction, a left partition with a width of 1 / 4 W and a right partition with a width of 3 / 4 W may be generated. As described above, the partition type in which the width of the left partition is smaller than the width of the right partition may be referred to as nLx2N binary partition.

[0142] When a WxH sized coding block is partitioned in the vertical direction, a left partition with a width of 3 / 4 W and a right partition with a width of 1 / 4 W may be generated. As described above, the partition type in which the width of the right partition is smaller than that of the left partition may be referred to as nRx2N binary partition.

[0143] When a WxH-sized coding block is partitioned in the horizontal direction, an upper partition with a width of 1 / 4H and a lower partition with a width of 3 / 4H can be generated. As described above, the partition type in which the height of the upper partition is less than the height of the lower partition can be called 2NxnU binary partition.

[0144] When a WxH sized coding block is partitioned in the horizontal direction, an upper partition with a width of 3 / 4H and a lower partition with a width of 1 / 4H may be generated. As described above, the partition type in which the height of the lower partition is less than the height of the upper partition may be referred to as 2NxnD binary partition.

[0145] exist Figure 7 , it is shown that the width ratio or height ratio between the two coding blocks is 1:3 or 3:1. However, the width ratio or height ratio between the two coding blocks generated by the asymmetric binary tree partitioning is not limited thereto. The coding block may be partitioned into Figure 7 The two coding blocks shown in FIG. 1 have different width ratios or different height ratios.

[0146] When an asymmetric binary tree partitioning is used, the asymmetric binary partitioning type of the coding block can be determined based on information signaled via the bitstream. For example, the partitioning type of the coding block can be determined based on information indicating the partitioning direction of the coding block and information indicating whether the first partition generated by partitioning the coding block has a smaller size than the second partition.

[0147] The information indicating the split direction of the coding block may be a 1-bit flag indicating whether the coding block is split in the vertical direction or in the horizontal direction. For example, hor_binary_flag (horizontal binary tree split flag) may indicate whether the coding block is split in the horizontal direction. If the value of hor_binary_flag is 1, it may indicate that the coding block is split in the horizontal direction, and if the value of hor_binary_flag is 0, it may indicate that the coding block is split in the vertical direction. Alternatively, ver_binary_flag (vertical binary tree split flag) indicating whether the coding block is split in the vertical direction may be used.

[0148] The information indicating whether the first partition has a smaller size than the second partition can be a 1-bit flag. For example, is_left_above_small_part_flag (left / upper partition small segmentation flag) can indicate whether the size of the left or upper partition generated by segmenting the coding block is smaller than the right or lower partition. If the value of is_left_above_small_part_flag is 1, it means that the size of the left or upper partition is smaller than the right or lower partition. If the value of is_left_above_small_part_flag is 0, it means that the size of the left or upper partition is larger than the right or lower partition. Alternatively, is_right_bottom_small_part_flag (right / bottom partition small segmentation flag) indicating whether the size of the right or lower partition is smaller than the left or upper partition can be used.

[0149] Alternatively, the sizes of the first partition and the second partition may be determined by using information indicating a width ratio, a height ratio, or an area ratio between the first partition and the second partition.

[0150] When the value of hor_binary_flag is 0 and the value of is_left_above_small_part_flag is 1, nLx2N binary segmentation may be indicated, and when the value of hor_binary_flag is 0 and the value of is_left_above_small_part_flag is 0, nRx2N binary segmentation may be indicated. In addition, when the value of hor_binary_flag is 1 and the value of is_left_above_small_part_flag is 1, 2NxnU binary segmentation may be indicated, and when the value of hor_binary_flag is 1 and the value of is_left_above_small_part_flag is 0, 2NxnD binary segmentation may be indicated.

[0151] As another example, the asymmetric binary partition type of the coding block can be determined by index information indicating the partition type of the coding block. Here, the index information is information to be signaled by the bit stream, and can be encoded with a fixed length (i.e., a fixed number of bits), or can be encoded with a variable length. For example, Table 1 below shows the partition index for each asymmetric binary partition.

[0152] [Table 1]

[0153] Asymmetric split index Binarization nW 0 0 nB 1 10 2Nb 2 100 2Nd 3 111

[0154] Asymmetric binary tree segmentation can be used according to the QTBT segmentation method. For example, if quadtree segmentation or binary tree segmentation is no longer applied to the coding block, it can be determined whether to apply asymmetric binary tree segmentation to the coding block. Here, whether to apply asymmetric binary tree segmentation to the coding block can be determined by information signaled by the bitstream. For example, the information can be a 1-bit flag "asymmetric_binary_tree_flag" (asymmetric binary tree flag), and based on the flag, it can be determined whether to apply asymmetric binary tree segmentation to the coding block.

[0155] Alternatively, when it is determined that the coding block is divided into two blocks, it can be determined whether the segmentation type is a binary tree segmentation or an asymmetric binary tree segmentation. Here, the segmentation type of the coding block can be determined by information signaled by the bitstream to be a binary tree segmentation or an asymmetric binary tree segmentation. For example, the information can be a 1-bit flag "is_asymmetric_split_flag" (asymmetric segmentation flag), and based on the flag, it can be determined whether the coding block is segmented into a symmetric form or an asymmetric form.

[0156] As another example, the indexes assigned to the symmetric type binary segmentation and the asymmetric type binary segmentation may be different, and it may be determined based on the index information whether the coding block is segmented in a symmetric type or an asymmetric type. For example, Table 2 shows an example in which different indexes are assigned to the symmetric binary type segmentation and the asymmetric binary type segmentation.

[0157] [Table 2]

[0158]

[0159] The coding tree block or coding block may be divided into multiple coding blocks by quadtree partitioning, binary tree partitioning or asymmetric binary tree partitioning. Figure 8 An example of using QTBT and asymmetric binary tree partitioning to split a coding block into multiple coding blocks is shown. Figure 8 , it can be seen that the asymmetric binary tree partitioning is performed with depth 2 partitioning in the first figure, depth 3 partitioning in the second figure, and depth 3 partitioning in the third figure.

[0160] It can be restricted to no longer divide the coding blocks divided by asymmetric binary tree partitioning. For example, for the coding blocks generated by asymmetric binary tree partitioning, the information related to the quadtree, binary tree or asymmetric binary tree may not be encoded / decoded. That is, for the coding blocks generated by asymmetric binary tree partitioning, the flag indicating whether quadtree partitioning is applied, the flag indicating whether binary tree partitioning is applied, the flag indicating whether asymmetric binary tree partitioning is applied, the flag indicating the direction of binary tree partitioning or asymmetric binary tree partitioning, or the index information indicating asymmetric binary partitioning, etc. can be omitted.

[0161] As another example, whether to allow binary tree partitioning may be determined according to whether QTBT is allowed. For example, in a picture or slice that does not use a QTBT-based partitioning method, it may be restricted not to use asymmetric binary tree partitioning.

[0162] The information indicating whether asymmetric binary tree segmentation is allowed may be encoded and signaled in units of blocks, slices, or pictures. Here, the information indicating whether asymmetric binary tree segmentation is allowed may be a 1-bit flag. For example, if the value of is_used_asymmetric_QTBT_enabled_flag is 0, it may indicate that asymmetric binary tree segmentation is not used. When binary tree segmentation is not used in a picture or slice, is_used_asymmetric_QTBT_enabled_Flag may also be set to 0 without signaling.

[0163] The partition type allowed in the coding block may also be determined based on the size, shape, partition depth, or partition type of the coding block. For example, at least one of the partition type, partition shape, or number of partitions allowed in the coding block generated by quadtree partitioning and in the coding block generated by binary tree partitioning may be different from each other.

[0164] For example, if a coding block is generated by quadtree partitioning, all quadtree partitioning, binary tree partitioning, and asymmetric binary tree partitioning may be allowed for the coding block. Fig. 9 All the partition types shown in can be applied to the coding block. For example, 2Nx2N partition can represent the case where the coding block is not further partitioned, NxN can represent the case where the coding block is partitioned in a quadtree, and Nx2N and 2NxN can represent the case where the coding block is partitioned in a binary tree. In addition, nLx2N, nRx2N, 2NxnU and 2NxnD can represent the case where the coding block is partitioned in an asymmetric binary tree.

[0165] On the other hand, when the coding block is generated by binary tree partitioning, asymmetric binary tree partitioning may not be allowed for the coding block. That is, when the coding block is generated based on binary tree partitioning, it may be restricted not to Fig. 9 Asymmetric partitioning types (nLx2N, nRx2N, 2NxnU, 2NxnD) among the shown partitioning types are applied to the coding blocks.

[0166] When QTBT is used, a coding block that is not further partitioned may be used as a prediction block. That is, the coding block may be encoded using at least one of a skip mode, intra prediction, inter prediction, or a skip method.

[0167] As another example, if a coding block is determined, a prediction block having the same size as or a smaller size than the coding block can be determined by predictive partitioning of the coding block. Predictive partitioning of the coding block can be performed by a partitioning mode (Part_mode) indicating the partitioning type of the coding block. The size or shape of the prediction block can be determined according to the partitioning mode of the coding block. The partitioning type of the coding block can be determined by specifying information of any one of the partitioning candidates. At this time, the partitioning candidates available for the coding block may include asymmetric partitioning types (e.g., nLx2N, nRx2N, 2NxnU, 2NxnD), depending on the size, shape or coding mode of the coding block. For example, the partitioning candidates available for the coding block can be determined according to the coding mode of the current block. For example, Fig.10 is a diagram showing partition modes that can be applied to a coding block when the coding block is encoded by inter-frame prediction.

[0168] If the coding block is encoded by inter prediction, then Fig.10 One of the 8 partitioning modes shown in can be applied to the coding block.

[0169] On the other hand, when the coding block is encoded by intra prediction, a partition mode of PART_2Nx2N or PART_NxN may be applied to the coding block.

[0170] PART_NxN can be applied when the coding block has a minimum size. Here, the minimum size of the coding block can be predefined in the encoder and decoder. Alternatively, information about the minimum size of the coding block can be signaled via the bitstream. For example, the minimum size of the coding block is signaled through the slice header, so that the minimum size of the coding block can be defined per slice.

[0171] In another example, the available segmentation candidates for the coding block may be determined differently according to at least one of the size or shape of the coding block. For example, the number or type of available segmentation candidates for the coding block may be determined differently according to at least one of the size or shape of the coding block.

[0172] Alternatively, the type or number of asymmetric partition candidates among the partition candidates available for the coding block may be limited according to the size or shape of the coding block. For example, the number or type of asymmetric partition candidates available for the coding block may be determined differently according to at least one of the size or shape of the coding block.

[0173] Generally, the prediction block may have a size from 64×64 to 4×4. However, when the coding block is encoded by inter-frame prediction, the prediction block may be prevented from having a 4×4 size to reduce memory bandwidth when performing motion compensation.

[0174] As another example, at least one of the prediction block or the transform block may be generated by merging multiple coding blocks. The prediction block or transform block generated by merging multiple coding blocks may be referred to as a merged prediction block or a merged transform block. Therefore, the prediction block or transform block may be larger than the size of the coding block. Hereinafter, examples of generating a merged prediction block and a merged transform block will be described in detail.

[0175] Fig.11 is a diagram showing an example of generating a merged prediction block. If a coding block is divided into a plurality of coding blocks based on QTBT partitioning or asymmetric binary tree partitioning, at least one of the finally divided coding blocks may be merged with another to generate a merged prediction block. For example, in Fig.11 As shown in the figure above, a merged prediction block is generated by merging two blocks of different sizes, and Fig.11 As shown in the figure below, a merged prediction block is generated by merging two blocks of the same size.

[0176] Intra prediction or inter prediction of the current block may be performed in units of a merged prediction block or a coding block.

[0177] Even when intra prediction or inter prediction is performed in units of coding blocks, a single motion information may be defined for each merge prediction block, or a single intra prediction mode may be defined for each merge prediction block. That is, multiple coding blocks included in a merge prediction block may share motion information or an intra prediction mode. Here, the motion information may include at least one of a merge candidate (or a merge candidate list), an AMVP candidate (or an AMVP candidate list), a candidate index, a motion vector, a reference picture index, or a list utilization flag.

[0178] Alternatively, the merged transform block may be divided into a plurality of sub-blocks. Different motion information or different intra prediction modes may also be used for each sub-block. In this case, the number of sub-blocks may be different from the number of coding blocks included in the merged prediction block.

[0179] A coding block that can be merged with a coding block that is a current encoding / decoding target (hereinafter referred to as a current coding block) may be referred to as a merge target candidate block. The merge target candidate block may include a coding block adjacent to the current coding block. For example, a coding block adjacent to the left or top side of the current coding block may be included in the merge target candidate block of the current coding block. Alternatively, a coding block adjacent to the right or bottom side of the current coding block or a coding block adjacent to a corner of the current coding block may also be used as a merge target candidate block of the current coding block.

[0180] The merge target candidate block of the current coding block may be limited by at least one of the width, height, or size of the current coding block.

[0181] For example, a neighboring coding block having a width or height equal to that of the current coding block may be used as a merge target candidate block of the current coding block. A coding block adjacent to the top of the current coding block may be used as a merge target candidate block of the current coding block only if it has the same width as the current coding block, and a coding block adjacent to the left of the current coding block may be used as a merge target candidate block of the current coding block only if it has the same height as the current coding block.

[0182] For example, among the neighboring coding blocks adjacent to the current coding block, the neighboring blocks having the same size as the current coding block (i.e., the coding blocks having the same width and the same height as the current coding block) can be used as the merge target candidate blocks of the current coding block. On the other hand, if the size of the neighboring coding block is different from that of the current block, the coding block cannot be used as the merge target candidate block of the current coding block.

[0183] That is, all of the left coding block and the top coding block can be used as the merge target candidate block of the current block, or only one of the left coding block and the top coding block can be used as the merge target candidate block of the current block, depending on whether they have the same width, the same height or the same size as the current coding block. Alternatively, it is also possible that all of the adjacent coding blocks adjacent to the current coding block are not available as merge target candidate blocks.

[0184] The merge target candidate block of the current coding block may be restricted by the shape of the current coding block. For example, if the current coding block is a non-square block with a width greater than a height, such as 2N×N, the coding block adjacent to the top of the current coding block may be set as the merge target candidate block of the current coding block. On the other hand, if the current coding block is a non-square block with a height greater than a width, such as Nx2N, the coding block adjacent to the left of the current coding block may be set as the merge target candidate block of the current coding block.

[0185] Generating a merged prediction block by merging the current coding block with the adjacent coding block may be referred to as a prediction block merging method. At this time, whether the prediction block merging method is allowed for the current coding block may be determined based on at least one of the size, shape, segmentation depth, position, coding mode, or intra-frame prediction mode of the current coding block. For example, the prediction block merging method is allowed only when the size of the current coding block is less than or equal to a predetermined size.

[0186] In addition, whether to merge the current coding block with the merge target candidate block can be determined based on information signaled from the bitstream. The information can be a 1-bit flag, and whether to merge the current coding block with the merge target candidate block can be determined based on the information.

[0187] If there are multiple merging target candidate blocks of the current coding block, index information specifying one of the multiple merging target candidate blocks may be encoded / decoded. A merged prediction block may be generated by merging the current coding block with the merging target candidate block specified by the index information.

[0188] A merged transform block may be generated by merging multiple coding blocks. That is, the merged transform block may include multiple coding blocks. The merged transform block may be used as a basic unit for transforming or quantizing a residual signal (or transform coefficient). Therefore, the same transform scheme may be applied to the transform coefficients included in the merged transform block.

[0189] Alternatively, the merged transform block may be divided into a plurality of sub-blocks. Furthermore, quantization or transformation may also be performed on each sub-block. Therefore, a different transformation scheme may be applied to each sub-block. In this case, the number of sub-blocks may be different from the number of coding blocks included in the merged transform block.

[0190] The merged transform block may be set to be the same as the merged prediction block, or may be set to have a different size or a different shape from the merged prediction block.

[0191] For example, a merged transform block may be generated after merging the prediction block. That is, the merged transform block may have the same size and shape as the merged prediction block.

[0192] In another example, a merged transform block may be generated independently of a merged prediction block. That is, a merged transform block may be generated based on information indicating whether to merge a current coding block with an adjacent coding block, index information indicating an adjacent coding block to be merged with the current coding block, and the like.

[0193] Information indicating whether the merged transform block is set equal to the merged prediction block may also be signaled through the bitstream.

[0194] A merged prediction block or a merged transform block generated by merging the coding blocks may be limited to a predetermined size or a predetermined shape. That is, whether to merge two coding blocks may be determined based on whether the merged prediction block or the merged transform block generated by merging the two coding blocks has a predetermined size or a predetermined shape. For example, the merged prediction block or the merged transform block may be limited to a rectangular shape or a square shape.

[0195] In another example, the merged prediction block or merged transform block may also have a non-rectangular shape. For example, if the current coding block is merged with a coding block adjacent to the left side of the current coding block and a coding block adjacent to the top side of the current coding block, a non-rectangular shaped merged prediction block or merged transform block may be generated.

[0196] Fig.12 is a diagram showing an example of generating a merged prediction block by merging a plurality of coding blocks. Fig.12 In the example shown, the coding block is merged with two coding blocks adjacent to the left and top sides of the coding block, thereby generating a merged prediction block of a non-rectangular shape.

[0197] If the merge prediction block is not rectangular, the merge prediction block can be divided into square sub-blocks, and prediction can be performed in units of sub-blocks. At this time, all sub-blocks in the merge prediction block can use the same motion information or the same intra prediction mode.

[0198] When intra prediction is performed on a merged prediction block of a non-rectangular shape, a reference sample of the merged prediction block may be derived from neighboring samples adjacent to the merged prediction block. At this time, the neighboring samples may include samples bordering the boundary of the merged prediction block. Therefore, the top reference sample or the left reference sample of the merged prediction block may not be arranged in a row according to the shape of the merged prediction block.

[0199] For example, Fig.13 is a diagram showing reference samples of a merged prediction block. Fig.13 , it is shown that the reference samples of the merged prediction block are distributed along the top boundary and the left boundary of the merged prediction block.

[0200] In another example, the reference samples of the merged prediction block may be derived from adjacent samples included in rows or columns adjacent to the topmost boundary of the merged prediction block and the leftmost boundary of the merged prediction block. Therefore, regardless of the shape of the merged prediction block, the top reference samples or the left reference samples of the merged prediction block may be arranged in a row.

[0201] For example, Fig.14 is a diagram showing reference samples of a merged prediction block. Fig.14 , it is shown that the reference samples of the merged prediction block are distributed along the topmost boundary and the leftmost boundary of the merged prediction block.

[0202] If the merged transform block is not in a rectangular shape, the merged transform block may be divided into rectangular sub-blocks, and quantization and / or transform may be performed in units of sub-blocks. At this time, all sub-blocks in the merged prediction block may use the same transform scheme.

[0203] Information indicating whether a prediction block merging method or a transform block merging method is allowed in a predetermined unit may be signaled through a bitstream. For example, information indicating whether a prediction block merging method or a transform block merging method is allowed in a picture, a slice, or a block (e.g., CTU) may be signaled.

[0204] The above block merging method (ie, the prediction block merging method or the transform block merging method) may not be used in combination with the asymmetric binary tree partitioning method. That is, after the coding block is divided based on QTBT, an asymmetric block can be generated by selectively using the asymmetric binary tree partitioning method or the block merging method.

[0205] In the above examples, it is described that a merged prediction block or a merged transform block having a size larger than a coding block is generated by merging coding blocks, however, the size of the merged prediction block or the merged transform block may be set to be the same as the coding block. That is, a plurality of coding blocks may be merged to generate a merged coding block, and the generated merged coding block may be used as a merged prediction block or a merged transform block.

[0206] Fig.15 is a flowchart illustrating a block merging method according to an embodiment of the present invention.

[0207] First, a merge target candidate block for a current coding block to be decoded / encoded may be determined S1510. The merge target candidate block of the current coding block may be derived from a neighboring block adjacent to the current coding block. At this time, it may be determined whether the neighboring block adjacent to the current coding block is available as a merge target candidate block based on at least one of the height, width, or size of the current coding block.

[0208] If the merging target candidate blocks of the current coding block are determined, the merging target candidate blocks to be merged with the current coding block may be specified S1520. Specifically, the merging target candidate blocks to be merged with the current coding block may be determined based on index information specifying at least one of the merging target candidate blocks of the current block.

[0209] If the merging target candidate block of the current coding block is determined, a merging block may be generated by merging the current coding block and the determined merging target candidate block S1530. The merging block may be used as a prediction block as a basic unit of prediction or as a transform block as a basic unit of encoding / decoding a residual signal.

[0210] The encoder may perform transformation or quantization on the residual sample (or residual signal) in units of predetermined blocks, thereby generating residual coefficients. Here, the unit of the predetermined block as the unit for performing transformation or quantization may have the same size for each color component, or may have different sizes for each color component. For example, a residual coefficient may be generated for each of the luminance component (Luma) and each chrominance component (Cb, Cr) in different block units.

[0211] A block unit that performs transformation or quantization may be referred to as a transform block, and the transform block may have a square shape or a non-square shape. For example, the transform block may have a square shape such as 4x4, 8x, 16x16, 32x32, or 64x64, or may have a non-square shape such as 4x, 8x4, 8x16, 16x8, 16x32, 32x16, 32x64, 64x32, 4x16, 4x32, or 8x32.

[0212] The decoder may decode the residual coefficient according to the bit stream received from the encoder, and may perform at least one of inverse quantization or inverse transformation on the decoded residual signal to decode the residual sample (or residual signal). The process of generating a residual signal by decoding the residual coefficient and generating the residual signal by performing at least one of inverse quantization and inverse transformation on the decoded residual signal may be defined as "residual coefficient decoding".

[0213] Hereinafter, the residual coefficient decoding process will be described in detail.

[0214] Fig.16 is a flowchart showing a process of obtaining residual samples according to an embodiment to which the present invention is applied.

[0215] The decoder may decode information indicating whether there is a non-zero transform coefficient in the current block from the bitstream S1610, and may determine whether to decode a residual coefficient of the current block based on the information S1620.

[0216] The information may include a transform coefficient coding indicator (coded_block_flag, CBF) indicating whether there is a transform coefficient in the current block. The transform coefficient coding indicator may indicate whether there is a non-zero transform coefficient in a block of a predetermined unit. For example, if the transform coefficient coding indicator is 0, it means that there is no non-zero transform coefficient in the block of the predetermined unit, and if the transform coefficient coding indicator is 1, it means that there is at least one non-zero transform coefficient in the block of the predetermined unit. The transform coefficient coding indicator may be encoded and signaled for each of the luminance component and the chrominance component.

[0217] The transform coefficient encoding indicator may include at least one of an indicator signaled in units of blocks (eg, transform blocks, coding blocks, or coding tree blocks) (ie, 'rqt_root_cbf') or an indicator signaled in units of subblocks of a predetermined size (eg, 'coded_sub_block_flag').

[0218] For example, rqt_root_cbf may indicate whether a non-zero transform coefficient is included in the current block. The decoder may determine whether to decode the residual coefficient according to the value of rqt_root_cbf. For example, if rqt_root_cbf is 0, decoding of the transform coefficient of the current block (e.g., the current transform block) is not performed, and the values ​​of all residual samples in the current block may be set to zero. On the other hand, if rqt_root_cbf is 1, decoding of the transform coefficient of the current block may be performed.

[0219] coded_sub_block_flag may indicate whether a non-zero coefficient is included in a sub-block of a predetermined size. For example, coded_sub_block_flag may be encoded in units of 4×4-sized sub-blocks and signaled. If coded_sub_block_flag is 0, it may mean that there is no non-zero transform coefficient in a sub-block of a predetermined size, and if coded_sub_block_flag is 1, it may mean that there is at least one non-zero transform coefficient in a sub-block of a predetermined size.

[0220] rqt_root_cbf and coded_sub_block_flag may be encoded hierarchically and signaled. For example, when rqt_root_cbf is 0, encoding of coded_sub_block_flag may be omitted. On the other hand, when rqt_root_cbf is 1 and the current block size is larger than a sub-block, coded_sub_block_flag may be encoded and signaled in units of sub-blocks of a predetermined size in the current block.

[0221] The transform coefficient coding indicator can be hierarchically encoded and signaled between the transform block and the coding block. A first transform coefficient coding indicator indicating whether at least one transform block including non-zero transform coefficients in a plurality of transform blocks is included can be encoded / decoded. Then, according to the value of the first transform coefficient coding indicator, it can be determined whether the second transform coefficient coding indicator of each sub-block is encoded / decoded. Here, at least one of the size or shape of the upper node block including multiple transform blocks can be a predetermined value, or can be determined based on information decoded from the bitstream. Alternatively, at least one of the size or shape of the upper node block can be determined based on the partition type of the coding tree block. For example, a non-square coding block or a square coding block including multiple transform blocks can be defined as an upper node block of multiple non-square transform blocks. The transform coefficient coding indicator can be hierarchically encoded through two or more layers.

[0222] As described above, a method of hierarchically encoding a transform coefficient coding indicator will be referred to as a hierarchical transform coefficient coding indicator (Hierarchical Coded Block Flag (HCBF)) derivation method.

[0223] When at least one non-zero transform coefficient is included in the current block, the transform coefficient may be decoded using a transform coefficient level indicator indicating whether the transform coefficient is 0. The transform coefficient level indicator is a 1-bit flag (e.g., 'significant_flag') and indicates whether each transform coefficient in the current block is 0. For example, if significant_flag is 1, it indicates that the transform coefficient is not 0, and if significant_flag is 0, it indicates that the transform coefficient is 0.

[0224] This will be referred to as a transform coefficient level map (significant map) showing whether each of the transform coefficients is 0. The encoder may encode the transform coefficient encoding indicator and the transform coefficient level indicator of each transform coefficient according to the transform coefficient level map, and may encode the absolute value and sign of the non-zero transform coefficient. The decoder may decode the transform coefficient level map according to the transform coefficient encoding indicator and the transform coefficient level indicator, and may decode the absolute value and sign of the non-zero transform coefficient.

[0225] Fig.17 is a diagram showing a transform coefficient level diagram. Fig.17 The value shown in represents the value of the transform coefficient level indicator. And, coded_sub_block_flag indicates whether there is a non-zero transform coefficient for the 4×4 sub-block.

[0226] A sub-block of a predetermined size may be referred to as a transform coefficient basic block, for which information indicating whether there is a non-zero transform coefficient is encoded / decoded. Fig.17 In the example, a 4×4 sized block in which coded_sub_block_flag is encoded may be defined as a transform coefficient basic block.

[0227] At this time, at least one of the shape or size of the transform coefficient basic block may be determined differently according to at least one of the shape or size of the coding block or the transform block. For example, if the current block has a square shape, the transform coefficient basic block of the current block may have a square shape, and if the current block has a non-square shape, the transform coefficient basic block of the current block may also have a non-square shape. For example, when the current block has a non-square shape such as Nx2N or Nx4N, the transform coefficient basic block of the current block may be 2×8, and if the current block has a non-square shape such as 2N×N or 4N×N, the transform coefficient basic block of the current block may be 8x2.

[0228] As a result of quadtree partitioning and binary tree partitioning, a coding tree block or coding block may include a transform block of 2x8, 8x2, 4x16, or 16x4. As described above, when binary tree partitioning is used in addition to quadtree partitioning, a greater number of transform blocks or transform blocks of more shapes may be included in the coding tree block compared to the case where only quadtree partitioning is used. As the number of transform blocks increases or as the shape of the transform blocks becomes diversified, encoding a transform coefficient encoding indicator for each transform block may reduce encoding efficiency.

[0229] Therefore, in an embodiment of the present invention, instead of encoding the transform coefficient encoding indicator in units of transform blocks, the transform coefficient encoding indicator may be encoded / decoded in units of predetermined units or whether to encode / decode the transform coefficient encoding indicator of the current block may be determined by comparing the size of the current block with the predetermined unit. Here, the predetermined unit may be defined by the size of the block, the shape of the block, or the number of samples.

[0230] The encoder may encode and signal information for determining the predetermined unit (e.g., a transform coefficient coding unit indicator). The information may indicate the size, shape, or number of samples of the block. Moreover, the information may be encoded and signaled in at least one of a video sequence level, a picture parameter set, a slice header, or a block level.

[0231] If the predetermined unit is related to the size or number of samples of the block, and if the current block is smaller than the predetermined unit, information about whether the current block includes a non-zero transform coefficient may be encoded in units of the predetermined unit and signaled. On the other hand, if the current block is equal to or larger than the predetermined unit, a transform coefficient encoding indicator may be encoded and signaled for the current block.

[0232] Fig.18 is a diagram for explaining an aspect of decoding a transform coefficient encoding indicator based on a predetermined unit.

[0233] When the predetermined unit represents 256 samples, the transform coefficient coding indicator may be encoded and signaled based on a block including 256 or more samples. Fig.18 In the example shown, a transform coefficient encoding indicator indicating whether there is a non-zero transform coefficient may be decoded for a 16×16 block or an 8×32 block.

[0234] The transform coefficient coding indicator may also be encoded and signaled for blocks comprising more than 256 samples. Fig.18 In the example shown, a transform coefficient encoding indicator indicating whether there is a non-zero transform coefficient may be decoded for a 16×32 block or a 32×32 block.

[0235] When the predetermined unit indicates 1024 samples, the transform coefficient coding indicator may be encoded and signaled based on a block including 1024 or more samples. Fig.17 In the example shown, a single transform coefficient encoding indicator can be decoded for an upper node block including four 16×16 square blocks, and a single transform coefficient encoding indicator can be decoded for an upper node block including two 8×32 non-square blocks and a 16x32 non-square block.

[0236] The transform coefficient coding indicator may be separately coded and signaled for blocks comprising more than 1024 samples. Fig.18 In the example shown, the transform coefficient encoding indicator may be decoded for a 32x32 block.

[0237] The predetermined unit may indicate a maximum unit in which the transform coefficient encoding indicator is encoded and signaled. That is, the maximum size of a block or the shape of a block in which the transform coefficient encoding indicator is encoded may be defined based on the predetermined unit. In this case, the unit in which the transform coefficient is signaled may be adaptively determined by comparing the number of samples indicated by the transform coefficient encoding unit indicator and the number of samples included in the transform block.

[0238] For example, when the number of samples indicated by the transform coefficient coding unit indicator is greater than the number of samples included in the transform block, the transform coefficient coding indicator may be encoded for the transform block and signaled. On the other hand, when the number of samples indicated by the transform coefficient coding unit indicator is less than the number of samples included in the transform block, the transform block is divided into a plurality of regions according to a predetermined unit, and the transform coefficient coding indicator is encoded for each region.

[0239] If the current block includes residual coefficients other than 0, a scanning order of the current block may be determined S1630. Then, according to the determined scanning order, an absolute value or a sign of each transform coefficient may be decoded S1640.

[0240] The decoder may select a scanning order of the current block from among a plurality of scanning order candidates. Here, the plurality of scanning order candidates may include at least one of diagonal scanning, horizontal scanning, and vertical scanning. For example, Fig.19 is a diagram showing a decoding order of transform coefficients according to each scanning order.

[0241] The scanning order of the current block can be determined based on at least one of the size, shape, coding mode or intra prediction mode of the current block (e.g., a transform block or a coding block). Here, the size of the current block can be represented by at least one of the width, height or area of ​​the block.

[0242] For example, the scanning order of the current block may be determined by comparing the size of the current block with a predetermined threshold value. Here, the predetermined threshold value may be represented by a maximum value or a minimum value.

[0243] For example, a transform block or coding block of size 4×4 or 8×8 encoded in intra mode can use vertical scanning, horizontal scanning, or diagonal scanning according to the intra prediction mode. Specifically, when the intra prediction mode has a horizontal direction, vertical scanning can be used. When the intra prediction mode has a vertical direction, horizontal scanning can be used. For other intra prediction modes, diagonal scanning can be used. On the other hand, diagonal scanning can be used for a transform block or coding block encoded in inter mode or a transform block or coding block having a size of 16×16 or larger encoded in intra mode.

[0244] Alternatively, based on at least one of the size, shape, coding mode or intra prediction mode of the current block, at least one of the number or type of scanning order candidates available for the current block can be set differently. That is, according to the above conditions, the current block can be restricted to use at least one of diagonal scanning, horizontal scanning or vertical scanning.

[0245] For example, if the current block has a non-square shape, the scanning order applicable to the current block may be determined according to the ratio of width to height. For example, if the current block is a coding block or a transform block having a shape with a height longer than width (e.g., Nx2N or Nx4N), at least one of diagonal scanning or horizontal scanning may be selected. On the other hand, if the current block is a coding block or a transform block having a shape with a width longer than height (e.g., 2N×N or 4N×N), at least one of diagonal scanning or vertical scanning may be selected.

[0246] The current block may be divided into predetermined sub-blocks, and the scanning of the transform coefficient may be performed in units of sub-blocks. For example, the scanning of the transform coefficient may be performed on a transform coefficient basic block unit including a predetermined number of pixels.

[0247] Even when the current block has a non-square shape, the current block may be divided into sub-blocks, and scanning may be performed in units of sub-blocks. At this time, the size of the sub-block may have a fixed value, or may have a value that varies based on at least one of the size or shape of the current block (e.g., a coding block or a transform block).

[0248] For example, as described above with reference to the transform coefficient basic block, the subblock may include a fixed number of pixels (eg, 16). Here, the size of the subblock may be set to 4×4, 2×8, 8×2, etc., depending on the shape of the coding block or transform block.

[0249] The partition type of the subblock may be the same as that of the coding block or the transform block. Alternatively, the partition type of the subblock may be determined independently of the partition type of the coding block. Depending on the partition type, the subblock may have a square shape or a non-square shape.

[0250] The scanning order of each sub-block can be determined according to the scanning order of the current block. Fig. 20 is a diagram showing a scanning order between sub-blocks according to a scanning order of a current block.

[0251] exist Fig. 20 In the example shown, when the scanning order of the current block is diagonal scanning, at least one of the scanning order between subblocks or the scanning order in the subblocks may follow the diagonal scanning. On the other hand, when the scanning order of the current block is horizontal scanning, at least one of the scanning order between subblocks or the scanning order of transform coefficients in the subblocks may follow the horizontal scanning. Alternatively, if the scanning order of the current block is vertical scanning, at least one of the scanning order between subblocks or the scanning order in the subblocks may follow the vertical scanning.

[0252] Alternatively, the scanning order of each sub-block can be adaptively set according to the shape or size of the coding block or the current block. That is, the scanning order of the transform coefficient basic block can be set differently according to the size or shape of the current block.

[0253] Fig.21 is a diagram showing the scanning order of the transform coefficient basic block according to the shape of the current block. Fig.21 In the figure, the numbers marked on each sub-block indicate the scanning order.

[0254] If the current block is a coding block or a transform block having a shape whose height is longer than its width, the transform coefficient basis blocks may be sequentially scanned using diagonal scanning, such as Fig.21 Example shown.

[0255] On the other hand, if the current block is a coding block or a transform block having a shape in which the width is longer than the height, horizontal scanning may be used to sequentially scan the transform coefficient basic blocks, such as Fig.21 Example shown.

[0256] That is, the scanning order of the transform coefficient basic block can be set to be different according to the shape of the current block.

[0257] exist Fig.21 The relationship between the shape of the current block and the scanning order of the transform coefficient basic block defined in is only an example of the present invention, and the present invention is not limited thereto. Fig.21 Different from the example shown, if the current block is a coding block or a transform block having a shape in which the height is longer than the width, the transform coefficient basis blocks may also be sequentially scanned using vertical scanning.

[0258] According to an embodiment of the present invention, scanning may be performed in units of block groups (or in units of blocks), or a scanning order may be determined in units of block groups. Here, a block group may represent a block unit for performing scanning, or may represent a group of transform blocks sharing the same scan type. A block group may include at least one transform block. Alternatively, a plurality of non-square transform blocks constituting a square block may be defined as a block group.

[0259] For example, if the size or range of the block group is determined, the block group can be divided into units for scanning, and then the scanning of the block group can be performed. Here, the scanning unit can have the same size or the same shape as the transform block included in the block group. Alternatively, at least one of the size or shape of the scanning unit can be different from the transform block included in the block group. For example, the scanning unit is limited to a square shape, and the block group includes a transform block of a non-square shape.

[0260] For example, if the size or range of the block group is determined, a scanning order of the block group may be determined, and the determined scanning order may be applied to all transform blocks in the block group.

[0261] The block group may have a square shape or a non-square shape. In addition, the block group may include at least one non-square shape transformation block or at least one square shape transformation block.

[0262] The size of the block group may have a fixed value or may have a variably determined value. For example, the size of the block group may have a fixed value such as 64×64, 32×32, or 16×16, or may be determined based on information about the size of the block group transmitted through the bitstream.

[0263] If the residual coefficient of the current block is obtained, inverse quantization may be performed on the residual coefficient of the current block S1650.

[0264] It may be determined whether to skip inverse transform of the dequantized residual coefficients of the current block S1660. Specifically, the decoder may determine whether to skip inverse transform in at least one of the horizontal direction or the vertical direction of the current block. When it is determined that inverse transform is applied in at least one of the horizontal direction or the vertical direction of the current block, residual samples of the current block may be obtained by inverse transforming the dequantized residual coefficients of the current block S1670. Here, the inverse transform may be performed using at least one of DCT, DST, and KLT.

[0265] When inverse transform is skipped in both horizontal and vertical directions of the current block, inverse transform is not performed in horizontal and vertical directions of the current block. In this case, residual samples of the current block may be obtained by scaling the dequantized residual coefficients using a predetermined value S1680.

[0266] Skipping the inverse transform in the horizontal direction means not performing the inverse transform in the horizontal direction, but performing the inverse transform in the vertical direction. At this time, scaling may be performed in the horizontal direction.

[0267] Skipping the inverse transform in the vertical direction means not performing the inverse transform in the vertical direction, but performing the inverse transform in the horizontal direction. At this time, scaling may be performed in the vertical direction.

[0268] Whether the inverse transform skipping technique can be used for the current block can be determined depending on the partition type of the current block. For example, if the current block is generated by binary tree-based partitioning, the inverse transform skipping scheme can be limited for the current block. Therefore, when the current block is generated by binary tree-based partitioning, the residual sample of the current block can be obtained by inverse transforming the current block. In addition, when the current block is generated by binary tree-based partitioning, the encoding / decoding of information indicating whether to skip the inverse transform (e.g., transform_skip_flag) can be omitted.

[0269] Alternatively, when the current block is generated by binary tree-based partitioning, the inverse transform skip scheme may be limited to at least one of the horizontal direction or the vertical direction. Here, the direction in which the inverse transform skip scheme is limited may be determined based on information decoded from the bitstream, or may be adaptively determined based on at least one of the size of the current block, the shape of the current block, or the intra-prediction mode of the current block.

[0270] For example, when the current block is a non-square block with a width greater than a height, the inverse transform skip scheme may be allowed only in the vertical direction and restricted in the horizontal direction. That is, when the current block is 2N×N, the inverse transform is performed in the horizontal direction of the current block, and the inverse transform may be selectively performed in the vertical direction.

[0271] On the other hand, when the current block is a non-square block whose height is greater than the width, the inverse transform skip scheme may be allowed only in the horizontal direction and restricted in the vertical direction. That is, when the current block is N×2N, the inverse transform is performed in the vertical direction of the current block, and the inverse transform may be selectively performed in the horizontal direction.

[0272] Compared with the above example, when the current block is a non-square block with a width greater than a height, the inverse transform skip scheme may be allowed only in the horizontal direction, and when the current block is a non-square block with a height greater than a width, the inverse transform skip scheme may be allowed only in the vertical direction.

[0273] Information indicating whether to skip the inverse transform for the horizontal direction or information indicating whether to skip the inverse transform for the vertical direction can be signaled through a bitstream. For example, the information indicating whether to skip the inverse transform in the horizontal direction is a 1-bit flag "hor_transform_skip_flag" (horizontal transform skip flag), and the information indicating whether to skip the inverse transform in the vertical direction is a 1-bit flag "ver_transform_skip_flag" (vertical transform skip flag). The encoder can encode at least one of "hor_transform_skip_flag" or "ver_transform_skip_flag" according to the shape of the current block. In addition, the decoder can determine whether to skip the inverse transform in the horizontal direction or the vertical direction by using at least one of "hor_transform_skip_flag" or "ver_transform_skip_flag".

[0274] It may be set to skip the inverse transform of any direction of the current block depending on the partition type of the current block. For example, if the current block is generated by binary tree-based partitioning, the inverse transform in the horizontal direction or the vertical direction may be skipped. That is, if the current block is generated by binary tree-based partitioning, it may be determined to skip the inverse transform of the current block in at least one of the horizontal direction or the vertical direction without encoding / decoding information indicating whether to skip the inverse transform of the current block (e.g., transform_skip_flag, hor_transform_skip_flag, ver_transform_skip_flag).

[0275] The encoding / decoding of the residual signal may be performed in units of blocks having a specific shape. Here, the specific shape may mean a square block or a non-square block having a ratio between width and height equal to or greater than a predetermined value. For ease of explanation, it is assumed in the embodiments described below that the encoding / decoding of the residual signal is performed in units of blocks having a square shape.

[0276] If a current block (e.g., a coding block or a transform block) as a target for encoding / decoding a residual signal has a non-square shape, the non-square-shaped current block is divided or converted into a square-shaped block, and quantization, transformation, or encoding / decoding of the residual signal (e.g., a residual coefficient) can be performed on the square-shaped block.

[0277] For example, the transform type may be determined in units of square-shaped blocks. Here, the transform type may represent at least one of a transform scheme (e.g., DCT or DST) or a transform mode (e.g., 2D transform mode, 1D transform (vertical / horizontal) mode, or non-transform mode). To this end, the current block of a non-square shape may be divided into square-shaped sub-blocks, and the transform type may be determined in units of sub-blocks.

[0278] Fig. 22 is a diagram showing an example of dividing a current block having a non-square shape into sub-blocks having a square shape.

[0279] If the current block is a non-square block, the current block may be divided into a plurality of sub-blocks having a square shape, such as Fig. 22 The example shown. Fig. 22 , it is shown that an Nx2N type block is divided into N×N type sub-blocks.

[0280] The transform type may be determined for each divided sub-block. That is, a first sub-transform block corresponding to an upper portion of the current block and a second sub-transform block corresponding to a lower portion of the current block may be independently transformed, for example, in DCT or DST.

[0281] Alternatively, a first transform may be performed on each of a plurality of sub-blocks included in the current block, and then a second transform may be performed on a unit including the plurality of sub-blocks. Here, the first transform and the second transform may differ from each other in at least one of a transform mode, a transform scheme, or a target region of the transform.

[0282] As another example, a square-shaped block may be generated by merging a non-square-shaped current block with an adjacent block, and a transform type may be determined on the generated square-shaped block. At this time, the current block may be merged with at least one adjacent block adjacent to the left, right, top, or bottom of the current block. Multiple blocks included in the merged block may have the same transform type.

[0283] Alternatively, it is also possible to perform the first transform on the square-shaped merged block and then perform the second transform on each of the plurality of blocks included in the square-shaped merged block.

[0284] A current block having a non-square shape may be converted into a square shape, and a transform may be performed on the converted current block.

[0285] For example, Figure 23 to Figure 26 is a diagram showing an example of converting a non-square-shaped block into a square-shaped block.

[0286] When the current block has a non-square shape, the current block can be converted to a square shape by dividing the current block into sub-blocks based on a predetermined size or a predetermined shape and rearranging the divided sub-blocks in a predetermined order. Here, the predetermined order may include at least one of a Z scan, a vertical scan, or a horizontal scan, or a reverse order of a Z scan, a vertical scan, or a horizontal scan. The scanning order for converting the current block can be determined based on at least one of the size, shape, coding mode (e.g., intra mode or inter mode), or intra prediction mode (e.g., direction or angle of an intra prediction mode) of the current block. Alternatively, a predefined order can be used in an encoder / decoder, or information for specifying the order of arrangement of sub-blocks can be signaled through a bitstream.

[0287] Fig.23 and Fig.24 is a diagram showing an example of converting an N×4N type block into a square-shaped block.

[0288] In order to convert the current block into a square block, the N×4N type block can be divided into four sub-blocks of the same shape. Thereafter, the divided sub-blocks are arranged in a row in the horizontal direction, thereby generating a square-shaped block.

[0289] exist Fig.23 As shown in FIG, a block of size 2N×2N is generated by arranging the sub-blocks (3, 4) located at the lower part of the current block to the right of the sub-blocks (1, 2) located at the upper part of the current block (using the Z scanning order or the horizontal scanning order). Fig.24 As shown in FIG. 2 , a block of size 2N×2N is generated by arranging sub-blocks in the horizontal direction according to a vertical scanning order (ie, arranging sub-blocks in the order of 1, 3, 2, 4).

[0290] Fig.25 and Fig.26 is a diagram showing an example of converting a 4N×N type block into a square-shaped block.

[0291] In order to convert the current block into a square block, the 4N×N shaped block may be divided into four sub-blocks of the same shape. Subsequently, the divided sub-blocks are arranged in a row in a vertical direction, thereby generating a square shaped block.

[0292] exist Fig.25 As shown in FIG, a block of size 2N×2N is generated by arranging the sub-blocks (3, 4) located on the right side of the current block to the bottom of the sub-blocks (1, 2) located on the left side of the current block (using the Z scanning order or the vertical scanning order). Fig.26 As shown in FIG. 2 , a 2N×2N block is generated by arranging sub-blocks in a vertical direction according to a horizontal scanning order (ie, arranging sub-blocks in the order of 1, 3, 2, 4).

[0293] exist Figure 23 to Figure 26 As shown in FIG. 1 , the current block is divided into four sub-blocks to convert the current block into a square shape. However, the current block may also be divided into a larger number or a smaller number of sub-blocks to convert the current block into a square-shaped block.

[0294] After converting the current block into a square-shaped block, a DCT or DST transform may be performed on the converted block. Alternatively, the current block may also be converted into a square-shaped block, and then the residual coefficient may be encoded by applying a transform skip to the converted block.

[0295] As another example, quantization or transformation may be performed on a non-square shaped block. However, the transformation coefficients of the non-square shaped block used to complete the quantization or transformation may be encoded in units of square blocks. That is, encoding / decoding of the transformation coefficients may be performed on the square shaped block, while the transformation or quantization may be performed on the non-square shaped block.

[0296] Although the above-mentioned embodiments have been described based on a series of steps or flow charts, they do not limit the chronological order of the present invention, and can be performed simultaneously or in different orders as required. In addition, each of the components (e.g., units, modules, etc.) constituting the block diagram in the above-mentioned embodiments can be implemented by hardware devices or software and multiple components. Alternatively, multiple components can be combined and implemented by a single hardware device or software. The above-mentioned embodiments can be implemented in the form of program instructions, which can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium can include one or a combination of program commands, data files, data structures, etc. The example of a computer-readable medium includes magnetic media such as hard disks, floppy disks and tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as optical magnetic floppy disks, media, and hardware devices such as ROM, RAM, flash memory, etc. that are specially configured to store and execute program instructions. The hardware device can be configured to operate as one or more software modules for performing processing according to the present invention, and vice versa.

[0297] Industrial Applicability

[0298] The present invention can be applied to electronic devices capable of encoding / decoding videos.

[0299] The present invention can also be implemented through the following embodiments.

[0300] Embodiment 1. A method for decoding a video, the method comprising:

[0301] Determine a merge target candidate block for the current coding block;

[0302] specifying at least one of the merge target candidate blocks; and

[0303] A merge block is generated by merging a specified merge target candidate block with the current coding block.

[0304] Embodiment 2. The method according to embodiment 1, wherein the multiple coding blocks included in the merged block have the same motion information or the same intra-frame prediction mode.

[0305] Embodiment 3. A method according to embodiment 1, wherein the multiple coding blocks included in the merged block have the same transform type.

[0306] Embodiment 4. A method according to embodiment 3, wherein the transformation type includes at least one of a transformation scheme or a transformation mode.

[0307] Embodiment 5. A method according to embodiment 1, wherein the merge target candidate block includes at least one of the neighboring blocks adjacent to the current coding block.

[0308] Embodiment 6. A method according to embodiment 5, wherein whether the adjacent block can be used as the merge target candidate block is determined based on at least one of the height, width or size of the current coding block and the adjacent coding block.

[0309] Embodiment 7. A method according to embodiment 5, wherein the current coding block is allowed to be merged with the merge target candidate block only when the size or shape of the current coding block meets a predefined condition.

[0310] Embodiment 8. A method for encoding a video, the method comprising:

[0311] Determine a merge target candidate block for the current coding block;

[0312] specifying at least one of the merge target candidate blocks; and

[0313] A merge block is generated by merging a specified merge target candidate block with the current coding block.

[0314] Embodiment 9. A method according to embodiment 8, wherein the multiple coding blocks included in the merged block have the same motion information or the same intra-frame prediction mode.

[0315] Embodiment 10. A method according to embodiment 8, wherein the multiple coding blocks included in the merged block have the same transform type.

[0316] Embodiment 11. A method according to embodiment 10, wherein the transformation type includes at least one of a transformation scheme or a transformation mode.

[0317] Embodiment 12. A method according to embodiment 8, wherein the merge target candidate block includes at least one of the neighboring blocks adjacent to the current coding block.

[0318] Embodiment 13. A method according to embodiment 12, wherein whether the adjacent block can be used as the merge target candidate block is determined based on at least one of the height, width or size of the current coding block and the adjacent coding block.

[0319] Embodiment 14. A method according to embodiment 12, wherein the current coding block is allowed to be merged with the merge target candidate block only when the size or shape of the current coding block meets a predefined condition.

[0320] Embodiment 15. An apparatus for decoding a video, the apparatus comprising:

[0321] The picture segmentation unit is used to: determine a merging target candidate block of a current coding block; specify at least one of the merging target candidate blocks; and generate a merging block by merging the specified merging target candidate block with the current coding block.

Claims

1. A method for decoding a video, the method comprising: Based on a 1-bit first flag, determining whether the coding block is divided into two partitions; as well as When it is determined that the coding block is divided into the two partitions including the first partition and the second partition, determining whether the coding block is divided symmetrically or asymmetrically based on a 1-bit second flag, The coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, Wherein, when it is determined to asymmetrically divide the coding block, the first partition has a size of 1 / 4 of the coding block, and the second partition has a size of 3 / 4 of the coding block, The positions of the first partition and the second partition in the coding block are determined based on a 1-bit third flag, and When it is determined to divide the coding block into the two partitions, regardless of the size of the first partition, decoding of a transform skip flag indicating whether to skip inverse transform is omitted, and skipping of inverse transform for the first partition is not allowed.

2. The method according to claim 1, wherein: The third flag bit being equal to the first value indicates that the second partition is located to the right of the first partition, and the third flag bit being equal to the second value indicates that the second partition is located to the left of the first partition.

3. A method for encoding a video, the method comprising: A 1-bit first flag is encoded by determining whether the coding block is divided into two partitions; When it is determined that the coding block is divided into the two partitions including the first partition and the second partition, a 1-bit second flag is encoded by determining whether the coding block is divided symmetrically or asymmetrically, The coding block is divided into the two partitions in one of the horizontal direction or the vertical direction, Wherein, when the coding block is divided asymmetrically, the first partition has a size of 1 / 4 of the coding block, and the second partition has a size of 3 / 4 of the coding block, The 1-bit third flag is further encoded by determining the positions of the first partition and the second partition in the coding block, and When the coding block is divided into the two partitions, skipping transformation for the first partition is not allowed, and encoding of a transformation skip flag indicating whether to skip transformation is omitted regardless of the size of the first partition.

4. The method according to claim 3, wherein: The third flag being equal to the first value indicates that the second partition is located to the right of the first partition, and the third flag being equal to the second value indicates that the second partition is located to the left of the first partition.

5. A device for sending compressed video data, comprising: a processor configured to obtain the compressed video data; as well as a sending unit configured to send the compressed video data, Wherein, obtaining the compressed video data comprises: A 1-bit first flag is encoded by determining whether to divide the coding block into two partitions; When it is determined that the coding block is divided into the two partitions including the first partition and the second partition, a 1-bit second flag is encoded by determining whether the coding block is divided symmetrically or asymmetrically, The coding block is divided into the two partitions in one of a horizontal direction or a vertical direction, Wherein, when the coding block is divided asymmetrically, the first partition has a size of 1 / 4 of the coding block, and the second partition has a size of 3 / 4 of the coding block, wherein a 1-bit third flag is further encoded by determining positions of the first partition and the second partition within the coding block, and When the coding block is divided into the two partitions, skipping transformation for the first partition is not allowed, and encoding of a transformation skip flag indicating whether to skip transformation is omitted regardless of the size of the first partition.

Citation Information

Patent Citations

  • Method and device for encoding or decoding an image

    CN104396245A

  • Unified partition mode table for intra-mode coding

    US20130163664A1