Video decoding method, video encoding method, and video data transmission method
By deriving merging candidates and motion information based on blocks of predetermined shapes or sizes, the problem of low inter-frame prediction efficiency in high-resolution video signal encoding/decoding is solved, and efficient parallel merging and adaptive intra-frame prediction are achieved.
Patent Information
- Application Number
- CN202310708815.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2016-08-03
- Filing Date
- 2017-08-03
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2037-08-03
AI Technical Summary
When encoding/decoding high-resolution and high-quality video signals, the existing technology has low inter-frame prediction efficiency and is difficult to efficiently derive merge candidates and motion information.
It uses blocks based on predetermined shapes or sizes to derive spatial merge candidates, generates a merge candidate list, and uses motion information for motion compensation. It supports square and non-square merge estimation areas and limits the number of shapes of merge candidates.
The efficiency of inter-frame prediction is improved, parallel merging processing based on predetermined shapes or sizes is realized, intra-frame prediction and filter application based on multiple reference lines are supported, and intra-frame prediction mode is adaptively determined.
Smart Images

Figure CN116743991B_ABST
Abstract
Description
[0001] This application is a divisional application of the application with national application number 201780048928.9, international application date August 3, 2017, national entry date February 2, 2019, and invention name “Video Signal Processing Method and Device”. Technical Field
[0002] The present invention relates to a method and apparatus for processing a video signal. 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 amount of image data with higher resolution and quality increases compared to conventional image data. Therefore, when image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when 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] Image compression technology includes various technologies, including: inter-frame prediction technology that predicts pixel values included in the current picture based on previous or subsequent pictures of the current picture; intra-frame prediction technology that predicts pixel values included in the current picture by using pixel information in the current picture; entropy coding technology that assigns short codes to values that appear frequently and long codes to values that appear infrequently, etc. By using such image compression technology, image data can be efficiently compressed and transmitted or stored.
[0005] Meanwhile, along with the demand for high-resolution images, the demand for stereoscopic image content as a new image service has also increased. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being explored. Summary of the Invention
[0006] Technical issues
[0007] An object of the present invention is to provide a method and apparatus for efficiently performing inter-frame prediction on an encoding / decoding target block when encoding / decoding a video signal.
[0008] An object of the present invention is to provide a method and apparatus for deriving a merge candidate based on a block having a predetermined shape or having a predetermined size when encoding / decoding a video signal.
[0009] An object of the present invention is to provide a method and apparatus for performing merging in parallel in units of a predetermined shape or a predetermined size when encoding / decoding a video signal.
[0010] The technical objectives to be achieved by the present invention are not limited to the technical problems mentioned above. Moreover, those skilled in the art will clearly understand other technical problems not mentioned from the following description.
[0011] Technical Solutions
[0012] According to the present invention, the method and apparatus for decoding a video signal can: derive a spatial merge candidate for a current block; generate a merge candidate list for the current block based on the spatial merge candidate; obtain motion information of the current block based on the merge candidate list; and use the motion information to perform motion compensation on the current block.
[0013] According to the present invention, the method and apparatus for encoding a video signal can: derive spatial merge candidates for a current block; generate a merge candidate list for the current block based on the spatial merge candidates; obtain motion information of the current block based on the merge candidate list; and use the motion information to perform motion compensation on the current block.
[0014] In the method and apparatus for encoding / decoding a video signal according to the present invention, if the current block does not have a predefined shape or does not have a size equal to or greater than a predefined size, a spatial merging candidate for the current block can be derived based on a block having a predefined shape or having a size equal to or greater than the predefined size, the block including the current block.
[0015] In the method and apparatus for encoding / decoding a video signal according to the present invention, the predefined shape may be a square shape.
[0016] In the method and apparatus for encoding / decoding a video signal according to the present invention, a current block may have the same spatial merging candidate as a neighboring block included in a block having a square shape of the current block.
[0017] In the method and apparatus for encoding / decoding a video signal according to the present invention, if a current block and a spatial merging candidate are included in the same merging estimation region, it may be determined that the spatial merging candidate is unavailable.
[0018] In the method and apparatus for encoding / decoding a video signal according to the present invention, the merge estimation area may have a square shape or a non-square shape.
[0019] In the method and apparatus for encoding / decoding a video signal according to the present invention, if the merge estimation region has a non-square shape, the number of candidate shapes of merge candidates that the merge estimation region can have may be limited to a predefined number.
[0020] 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.
[0021] Beneficial effects
[0022] According to the present invention, efficient inter-frame prediction can be performed on an encoding / decoding target block.
[0023] According to the present invention, merge candidates may be derived based on blocks having a predetermined shape or a predetermined size.
[0024] According to the present invention, merging can be performed in parallel in units of a predetermined shape or a predetermined size.
[0025] According to the present invention, intra prediction can be performed on an encoding / decoding target block by selecting at least one of a plurality of reference lines.
[0026] According to the present invention, a reference line may be derived based on a block having a predetermined shape or having a size equal to or greater than a predetermined size.
[0027] According to the present invention, an intra-frame filter may be applied to at least one of a plurality of reference lines.
[0028] According to the present invention, an intra prediction mode or the number of intra prediction modes may be adaptively determined according to a reference line used for intra prediction of a current block.
[0029] Effects obtainable by the present invention are not limited to the above-mentioned effects, and other effects not mentioned can be clearly understood by those skilled in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0031] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0032] Figure 3 is a diagram illustrating an example of hierarchically dividing a coding block based on a tree structure according to an embodiment of the present invention.
[0033] Figure 4 is a diagram illustrating partition types that allow binary tree-based partitioning according to an embodiment of the present invention.
[0034] Figure 5 is a diagram illustrating an example of allowing only predetermined types of binary tree-based partitioning according to an embodiment of the present invention.
[0035] Figure 6 1 is a diagram for explaining an example in which information on the allowed number of binary tree divisions is encoded / decoded according to an embodiment to which the present invention is applied.
[0036] Figure 7 is a diagram illustrating a partitioning pattern applicable to a coding block according to an embodiment of the present invention.
[0037] Figure 8 is a flowchart illustrating an inter-frame prediction method according to an embodiment of the present invention.
[0038] Figure 9 is a diagram illustrating a process of deriving motion information of a current block if a merge mode is applied to the current block.
[0039] Figure 10 A process of deriving motion information of a current block in the case where the AMVP mode is applied to the current block is shown.
[0040] Figure 11 is a diagram showing spatial merging candidates for the current block.
[0041] Figure 12 is a diagram showing co-located blocks of the current block.
[0042] Figure 13 is a diagram for explaining an example of obtaining a motion vector of a temporal merging candidate by scaling the motion vector of a co-located block.
[0043] Figure 14 is a diagram illustrating an example of deriving merging candidates for non-square blocks based on square blocks.
[0044] Figure 15 This is a diagram for explaining an example of deriving merge candidates of binary tree partition blocks based on upper node blocks.
[0045] Figure 16 is a diagram illustrating an example of determining the availability of spatial merging candidates according to a merging estimation region.
[0046] Figure 17 is a flowchart illustrating a process of obtaining residual samples according to an embodiment to which the present invention is applied. DETAILED DESCRIPTION
[0047] The present invention can be modified in various ways, and there are various embodiments of the present invention. Examples of the embodiments will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, and the exemplary embodiments can be interpreted as including all modifications, equivalents, or alternatives within the technical concept and technical scope of the present invention. When describing the drawings, like reference numerals refer to like elements.
[0048] 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 (and / or)" includes a combination of multiple items or any one of multiple terms.
[0049] 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” the other element, or the element may be connected to or coupled to the other 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.
[0050] 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 the expression has a clear different meaning in the context. In this specification, it should be understood that terms such as "including", "having" etc. are intended to indicate the presence 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.
[0051] 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.
[0052] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0053] Reference Figure 1 , an apparatus (100) for encoding a video may include: a picture partitioning module (110), a prediction module (120, 125), a transform module (130), a quantization module (135), a rearrangement module (160), an entropy coding module (165), an inverse quantization module (140), an inverse transform module (145), a filter module (150) and a memory (155).
[0054] Figure 1The components shown are shown independently to represent the characteristic functions that are different from each other in the device for encoding video. Therefore, it 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, embodiments of combining each component and embodiments of dividing a component are also included in the scope of the present invention.
[0055] In addition, some of the components may not be indispensable components for performing the basic functions of the present invention, but may be optional components only for improving the performance of the present invention. The present invention can be implemented by excluding components for improving performance and only including indispensable components for realizing the essence of the present invention. Structures that exclude optional components only for improving performance and only include indispensable components are also included in the scope of the present invention.
[0056] The picture partitioning module (110) can partition an input picture into one or more processing units. Here, a processing unit can be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture partitioning module (110) can partition a picture into a combination of multiple coding units, prediction units, and transform units, and can encode the picture by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).
[0057] 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 such that the number of child nodes corresponds to the number of divided coding units. Coding units that are no longer divided according to predetermined restrictions serve 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.
[0058] Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.
[0059] The prediction unit may be one of partitions partitioned into square shapes or rectangular shapes having the same size in a single coding unit, or the prediction unit may be one of partitions partitioned into different shapes / sizes in a single coding unit.
[0060] When a prediction unit to be 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.
[0061] The prediction module (120, 125) may include an inter-frame prediction module (120) that performs inter-frame prediction and an intra-frame prediction module (125) that performs intra-frame prediction. Whether inter-frame prediction or intra-frame prediction is performed for a prediction unit may be determined, and detailed information according to each prediction method (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) may be determined. Here, the processing unit to be predicted 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 and transmitted to a device for decoding a video without generating a prediction block by the prediction module (120, 125).
[0062] The inter-frame prediction module (120) can predict the prediction unit based on information of at least one of the previous picture or the subsequent picture of the current picture, or in some cases, can predict the prediction unit based on information of some coding regions in the current picture. The inter-frame prediction module (120) can include a reference picture interpolation module, a motion prediction module, and a motion compensation module.
[0063] The reference picture interpolation module can receive reference picture information from the memory (155) and generate pixel information of integer pixels or less than integer pixels based on the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients can be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients can be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 8 pixels.
[0064] 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 such as a full search based block matching algorithm (FBMA), a three-step search (TSS), and a new three-step search algorithm (NTS) can be used. Based on the interpolated pixels, the motion vector can have a motion vector value in units of 1 / 2 pixels or 1 / 4 pixels. The motion prediction module can predict the current prediction unit by changing the motion prediction method. As a motion prediction method, various methods such as a skip method, a merge method, an AMVP (Advanced Motion Vector Prediction) method, an intra-frame block copy method, etc. can be used.
[0065] The intra prediction module (125) can generate a prediction unit based on reference pixel information adjacent to a current block, which is pixel information in a current picture. When a neighboring block of the current prediction unit is a block subjected to inter-frame prediction and thus a reference pixel is a pixel subjected to inter-frame prediction, the reference pixel information of the neighboring block subjected to intra-frame prediction can be used to replace the reference pixel included in the block subjected to inter-frame prediction. That is, when a reference pixel is unavailable, at least one reference pixel among available reference pixels can be used to replace the unavailable reference pixel information.
[0066] The prediction mode of intra-frame prediction may include a directional prediction mode that uses reference pixel information according to 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 to predict chroma information, the intra-frame prediction mode information for predicting luma information may be used or the predicted luma signal information may be used.
[0067] When performing intra prediction, if 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 the pixels located to the left, upper left, and top of the prediction unit. However, when performing intra prediction, if 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 smallest coding unit.
[0068] In the intra prediction method, a prediction block can be generated after applying an AIS (Adaptive Intra Smoothing) filter to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels can vary. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted based on the intra prediction mode of a prediction unit adjacent to the current prediction unit. When predicting the prediction mode of the current prediction unit by using mode information predicted based on the adjacent prediction units, 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 can 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. When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy coding can be performed to encode the prediction mode information of the current block.
[0069] In addition, a residual block including information related to a residual value, which is a difference between the prediction unit subjected to prediction and the original block of the prediction unit, can be generated based on the prediction unit generated by the prediction module (120, 125). The generated residual block can be input to the transform module (130).
[0070] The transform module (130) can transform the residual block including information on the residual value between the original block and the prediction unit generated by the prediction module (120, 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 can be determined based on intra-frame prediction mode information of the prediction unit used to generate the residual block.
[0071] The quantization module (135) can quantize the value transformed into the frequency domain by the transform module (130). The quantization coefficient can be changed according to the importance of the picture or the block. The value calculated by the quantization unit (135) can be provided to the inverse quantization module (140) and the rearrangement module (160).
[0072] The rearrangement module (160) can rearrange the coefficients of the quantized residual value.
[0073] The rearrangement module (160) can convert the coefficients in the two-dimensional block form into the coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module (160) can use a zigzag scanning method to scan from the DC coefficient to the coefficients in the high frequency domain so as to convert the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning for scanning the coefficients in the two-dimensional block form along the column direction or horizontal scanning for scanning the coefficients in the two-dimensional block form along the row direction can be used instead of the zigzag scanning. That is, which scanning method to use among the zigzag scanning, the vertical scanning, and the horizontal scanning can be determined according to the size of the transform unit and the intra-frame prediction mode.
[0074] The entropy coding module (165) can perform entropy coding based on the value calculated by the rearrangement module (160). The entropy coding can use various coding methods, such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).
[0075] The entropy coding module (165) can encode various information from the rearrangement module (160) and the prediction module (120, 125), such as residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transform unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.
[0076] The entropy encoding module (165) may perform entropy encoding on coefficients of the coding unit input from the rearrangement module (160).
[0077] The inverse quantization module (140) can inversely quantize the value quantized by the quantization module (135), and the inverse transform module (145) can inversely transform the value transformed by the transform module (130). The residual value generated by the inverse quantization module (140) and the inverse transform module (145) can be combined with the prediction unit predicted by the motion estimation module, the motion compensation module, and the intra-frame prediction module of the prediction module (120, 125), so that a reconstructed block can be generated.
[0078] The filter module (150) may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0079] A deblocking filter can remove block distortion caused by boundaries between blocks in a reconstructed image. To determine whether to perform deblocking, pixels in a certain number of rows or columns of a block can be used as a basis for determining whether to apply a deblocking filter to the current block. When applying a deblocking filter to a block, a strong or weak filter can be applied depending on the desired deblocking filter strength. Furthermore, when applying a deblocking filter, horizontal and vertical filtering can be processed in parallel.
[0080] The offset correction module can correct the offset of the deblocked picture from the original picture on a pixel-by-pixel basis. To perform offset correction on a specific picture, a method of applying an offset by considering edge information of each pixel can be used, or a method of dividing the picture's pixels into a predetermined number of regions, determining the regions to be offset, and applying the offset to the determined regions can be used.
[0081] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed picture with an 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 be different for each block. In addition, regardless of the characteristics of the application target block, a filter for ALF of the same shape (fixed shape) can be applied.
[0082] The memory (155) can store the reconstructed block or reconstructed picture calculated by the filter module (150). The stored reconstructed block or reconstructed picture can be provided to the prediction module (120, 125) when performing inter-frame prediction.
[0083] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0084] 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), a prediction module (230, 235), a filter module (240) and a memory (245).
[0085] When a video bitstream is input from an apparatus for encoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding a video.
[0086] 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 apparatus for encoding the video. For example, corresponding to the method performed by the apparatus 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.
[0087] The entropy decoding module (210) may decode information about intra-frame prediction and inter-frame prediction performed by the apparatus for encoding a video.
[0088] The rearrangement module (215) can perform rearrangement on the bitstream entropy-decoded by the entropy decoding module (210) based on the rearrangement method used in the apparatus for encoding video. The rearrangement module can reconstruct and rearrange coefficients in the form of a one-dimensional vector into coefficients in the form of a two-dimensional block. The rearrangement module (215) can receive information related to coefficient scanning performed in the apparatus for encoding video, and can perform rearrangement by inversely scanning the coefficients based on the scanning order performed in the apparatus for encoding video.
[0089] 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.
[0090] The inverse transform module (225) can perform inverse transforms (i.e., inverse DCT, inverse DST, and inverse KLT) on the quantization results of the apparatus for encoding the video, which are the inverse processes of the transforms (i.e., DCT, DST, and KLT) performed by the transform module. The inverse transform can be performed based on the transmission unit determined by the apparatus for encoding the video. The inverse transform module (225) of the apparatus for decoding the video can selectively perform a transform scheme (e.g., DCT, DST, KLT) based on multiple pieces of information such as a prediction method, a size of a current block, a prediction direction, etc.
[0091] The prediction module (230, 235) may generate a prediction block based on information generated about the prediction block received from the entropy decoding module (210) and previously decoded block or picture information received from the memory (245).
[0092] As described above, similar to the operation of the apparatus for encoding video, when performing intra-frame prediction, if 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 to the left, upper left, and top of the prediction unit. When performing intra-frame prediction, if 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.
[0093] The prediction module (230, 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 an 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 information required for inter-frame prediction of the current prediction unit received from the apparatus 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.
[0094] In order to perform inter prediction, which one of skip mode, merge mode, AMVP mode, and inter block copy mode to use as a motion prediction method of a prediction unit included in the coding unit may be determined for the coding unit.
[0095] 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 that is 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 whether to apply the filter can be determined based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block by using the prediction mode of the prediction unit received from the device for encoding the video and the AIS filter information. 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.
[0096] 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 can interpolate the reference pixels to generate reference pixels that are integer pixels or smaller 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 DC mode, a DC filter can generate a prediction block through filtering.
[0097] The reconstructed block or the reconstructed picture may be provided to a filter module (240). The filter module (240) may include a deblocking filter, an offset correction module, and an ALF.
[0098] Information on whether to apply a deblocking filter to a corresponding block or picture and information on which filter to apply when applying the deblocking filter, a strong filter or a weak filter, may be received from a device for encoding a video. A deblocking filter of a device for decoding a video may receive information on the deblocking filter from a device for encoding the video and may perform deblocking filtering on the corresponding block.
[0099] The offset correction module may perform offset correction on the reconstructed picture based on the type of offset correction and offset value information applied to the picture when encoding is performed.
[0100] ALF may be applied to a coding unit based on information on whether ALF is applied, ALF coefficient information, etc. received from an apparatus for encoding a video. The ALF information may be provided to be included in a specific parameter set.
[0101] 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.
[0102] 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.
[0103] In addition, the current block can represent a target block to be encoded / decoded. And, depending on the encoding / decoding step, the current block can 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.
[0104] A picture can be encoded / decoded by partitioning the picture into basic blocks having a square shape or a non-square shape. 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 a 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 through a sequence parameter set, a picture parameter set, or a slice header. The coding tree unit can be partitioned into partitions of smaller sizes. At this time, if it is assumed that the depth of the partition generated by partitioning the coding tree unit is 1, the depth of the partition generated by partitioning the partition with a depth of 1 can be defined as 2. That is, the partition generated by partitioning a partition with a depth of k in the coding tree unit can be defined as having a depth of k+1.
[0105] Partitions of any size generated by splitting a coding tree unit may be defined as coding units. A coding unit may be recursively split or divided into basic units for performing prediction, quantization, transform, or loop filtering, etc. For example, partitions of any size generated by splitting a coding unit may be defined as coding units, or may be defined as transform units or prediction units, which are basic units for performing prediction, quantization, transform, or loop filtering, etc.
[0106] The division of the coding tree unit or 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 divide the coding tree unit or coding unit may be at least one or more. For example, the coding tree unit or coding unit may be divided into two partitions using one vertical line or one horizontal line, or may be divided into three partitions using two vertical lines or two horizontal lines. Alternatively, the coding tree unit or coding unit may be divided into four partitions having a length and a width of 1 / 2 by using one vertical line and one horizontal line.
[0107] When a coding tree unit or 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 size different from the remaining partitions.
[0108] 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.
[0109] Figure 3 is a diagram illustrating an example of hierarchically dividing a coding block based on a tree structure according to an embodiment of the present invention.
[0110] The input video signal is decoded in predetermined block units. Such a default unit for decoding the input video signal is a coding block. The coding block may be a block that performs intra / inter prediction, transformation, and quantization. In addition, a prediction mode (e.g., intra prediction mode or 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. The coding block may be a square block or a non-square block having any size in the range of 8×8 to 64×64, or may be a square block or a non-square block having a size of 128×128, 256×256, or larger.
[0111] Specifically, the coding block may be hierarchically divided based on at least one of a quadtree and a binary tree. Here, quadtree-based division may mean dividing a 2N×2N coding block into four N×N coding blocks, and binary tree-based division may mean dividing one coding block into two coding blocks. Even when binary tree-based division is performed, square-shaped coding blocks may exist at lower depths.
[0112] The binary tree-based partitioning can be performed symmetrically or asymmetrically. The coding block based on the binary tree partitioning can be a square block or a non-square block, for example, a rectangular shape. For example, the partitioning type allowing the binary tree-based partitioning may include at least one of the following: symmetric type 2N×N (non-square coding unit in the horizontal direction) or N×2N (non-square coding unit in the vertical direction); asymmetric type nL×2N; nR×2N; 2N×nU or 2N×nD.
[0113] Binary tree-based partitioning can be limited to either symmetric or asymmetric partitioning. In this case, constructing a coding tree unit with square blocks can correspond to quadtree CU partitioning, and constructing a coding tree unit with symmetric non-square blocks can correspond to binary tree partitioning. Constructing a coding tree unit with square blocks and symmetric non-square blocks can correspond to quadtree CU partitioning and binary tree CU partitioning.
[0114] Binary tree-based partitioning may be performed on a coding block for which quadtree-based partitioning is no longer performed. Quadtree-based partitioning may no longer be performed on a coding block for which binary tree-based partitioning is no longer performed.
[0115] In addition, the partitioning at a lower depth can be determined based on the partitioning type at a higher depth. For example, if binary tree-based partitioning is allowed at two or more depths, only the same type as the binary tree partitioning at a higher depth can be allowed at a lower depth. For example, if a binary tree-based partitioning at a higher depth is performed using a 2N×N type, then a binary tree-based partitioning at a lower depth is also performed using a 2N×N type. Alternatively, if a binary tree-based partitioning at a higher depth is performed using an N×2N type, then a binary tree-based partitioning at a lower depth is also performed using an N×2N type.
[0116] In contrast, it is also possible to allow only different types of binary tree partitioning at lower depths than at higher depths.
[0117] Only certain types of binary tree-based partitioning can be restricted for use with sequences, slices, coding tree units, or coding units. As an example, for a coding tree unit, only 2N×N or N×2N binary tree-based partitioning can be allowed. The available partition types can be predefined in the encoder or decoder. Alternatively, information about available partition types or information about unavailable partition types can be encoded and then signaled via the bitstream.
[0118] Figure 5 is a diagram showing an example in which only specific types of binary tree-based partitioning are allowed. Figure 5 (a) shows an example of binary tree-based partitioning that only allows N×2N types, and Figure 5 (b) shows an example in which only 2N×N type binary tree-based partitioning is allowed. To implement adaptive partitioning based on quadtree or binary tree, the following information may be used: information indicating quadtree-based partitioning, information related to the size / depth of coding blocks for which quadtree-based partitioning is allowed, information indicating binary tree-based partitioning, information related to the size / depth of coding blocks for which binary tree-based partitioning is allowed, information related to the size / depth of coding blocks for which binary tree-based partitioning is not allowed, information related to whether binary tree-based partitioning is performed in the vertical direction or in the horizontal direction, etc.
[0119] In addition, information related to 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 can be obtained for a coding tree unit or a specific coding unit. The information can be encoded in units of coding tree units or coding units and can be transmitted to a decoder through a bitstream.
[0120] For example, the syntax "max_binary_depth_idx_minus1" indicating the maximum depth allowed for binary tree partitioning may be encoded / decoded through the bitstream. In this case, max_binary_depth_idx_minus1+1 may indicate the maximum depth allowed for binary tree partitioning.
[0121] Reference Figure 6 The example shown in Figure 6 , binary tree splitting has been performed on the coding unit having a depth of 2 and the coding unit having a depth of 3. Therefore, at least one of the following information may be encoded / decoded through the bitstream: information indicating the number of times binary tree splitting has been performed in the coding tree unit (i.e., 2 times), information indicating the maximum depth at which binary tree splitting has been allowed in the coding tree unit (i.e., depth 3), or information indicating the number of depths at which binary tree splitting has been performed in the coding tree unit (i.e., 2 (depth 2 and depth 3)).
[0122] As another example, at least one of information about the number of times binary tree partitioning is allowed, information about the depth at which binary tree partitioning is allowed, or information about the number of depths at which binary tree partitioning is allowed can be obtained for each sequence or each slice. For example, the information can be encoded in units of sequences, pictures, or slices and transmitted through a bitstream. Therefore, at least one of the number of binary tree partitions in the first slice, the maximum depth at which binary tree partitioning is allowed in the first slice, or the number of depths at which binary tree partitioning is performed in the first slice can be different from that in the second slice. For example, in the first slice, binary tree partitioning may be allowed only for one depth, while in the second slice, binary tree partitioning may be allowed for two depths.
[0123] 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 can 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.
[0124] like Figure 3 As shown, 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 a width and height half the width and height of the first coding block, and the partition depth of the second coding block can be increased to k+1.
[0125] The second coding block 310 having a split depth of k+1 may be split into a plurality of third coding blocks having a split 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 according to 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 tree-based splitting.
[0126] When the second coding block 310 is divided based on a quadtree, the second coding block 310 can be divided into four third coding blocks 310a having a width and a height half the width and height of the second coding block, and the division depth of the third coding block 310a can be increased to k+2. In contrast, when the second coding block 310 is divided based on a binary tree, the second coding block 310 can be divided into two third coding blocks. Here, each of the two third coding blocks can be a non-square block having one of half the width and half the height of the second coding block, and the division depth can be increased to k+2. The second coding block can be determined as a non-square block in the horizontal direction or the vertical direction according to the division direction, and the division direction can be determined based on information about whether the binary tree-based division is performed in the vertical direction or the horizontal direction.
[0127] 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.
[0128] Similar to the division of the second coding block 310 , the third coding block 310 a may be determined as a leaf coding block, or may be further divided based on a quadtree or a binary tree.
[0129] At the same time, the third coding block 310b based on the binary tree partition can be further divided 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 partitioning process can be performed restrictively based on at least one of the following information: information related to the size / depth of the coding block that allows quadtree-based partitioning, information related to the size / depth of the coding block that allows binary tree-based partitioning, and information related to the size / depth of the coding block that does not allow binary tree-based partitioning.
[0130] 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.
[0131] As a result of quadtree and binary tree based partitioning, the coding unit can be represented in a square or rectangular shape of any size.
[0132] The coding block is encoded using at least one of skip mode, intra prediction, inter prediction, or a skip method. Once the coding block is determined, a prediction block can be determined by predictive partitioning of the coding block. Predictive partitioning of the coding block can be performed using a partitioning mode (Part_mode) indicating the partitioning type of the coding block. The size or shape of the prediction block can be determined based on the partitioning mode of the coding block. For example, the size of the prediction block determined based on the partitioning mode can be equal to or smaller than the size of the coding block.
[0133] Figure 7 is a diagram showing partitioning modes that can be applied to a coding block when the coding block is encoded through inter-frame prediction.
[0134] When encoding a coding block by inter-frame prediction, one of eight partitioning modes can be applied to the coding block, such as Figure 4 As shown in the example.
[0135] When a coding block is encoded through intra prediction, a partition mode PART_2N×2N or a partition mode PART_N×N may be applied to the coding block.
[0136] When the coding block has a minimum size, PART_N×N can be applied. Here, the minimum size of the coding block can be predefined in the encoder and decoder. Alternatively, information related to the minimum size of the coding block can be signaled via the bitstream. For example, the minimum size of the coding block can be signaled via the slice header so that the minimum size of the coding block can be defined per slice.
[0137] Generally, a prediction block may have a size from 64×64 to 4×4. However, when encoding a coding block by inter-frame prediction, a restriction may be made such that the prediction block does not have a 4×4 size to reduce memory bandwidth when performing motion compensation.
[0138] Figure 8 is a flowchart illustrating an inter-frame prediction method according to an embodiment of the present invention.
[0139] Reference Figure 8 , determining motion information of the current block (S810). The motion information of the current block may include at least one of a motion vector related to the current block, a reference picture index of the current block, or an inter-frame prediction direction of the current block.
[0140] The motion information of the current block may be obtained based on at least one of information signaled through a bitstream or motion information of a neighboring block adjacent to the current block.
[0141] Figure 9 is a diagram illustrating a process of deriving motion information of a current block if a merge mode is applied to the current block.
[0142] If the merge mode is applied to the current block, a spatial merge candidate may be derived from the spatial neighboring blocks of the current block (S910). The spatial neighboring block may mean at least one of the blocks adjacent to the top, left, or corner (e.g., at least one of the upper left corner, upper right corner, or lower left corner) of the current block.
[0143] The motion information of the spatial merging candidate may be set to be the same as the motion information of the spatial neighboring blocks.
[0144] A temporal merge candidate may be derived from a temporal neighboring block of the current block (S920). A temporal neighboring block may mean a co-located block included in a collocated picture. The collocated picture has a picture order count (POC) different from that of the current image including the current block. The collocated picture may be determined as a picture with a predefined index in a reference picture list, or may be determined by an index signaled from a bitstream. The temporal neighboring block may be determined as a block having the same position and size as the current block in the collocated picture or a block adjacent to a block having the same position and size as the current block. For example, at least one of a block including the center coordinates of a block having the same position and size as the current block or a block adjacent to the lower right boundary of the block in the collocated picture may be determined as a temporal neighboring block.
[0145] The motion information of the temporal merge candidate can be determined based on the motion information of the temporally adjacent blocks. For example, the motion vector of the temporal merge candidate can be determined based on the motion vector of the temporally adjacent blocks. In addition, the inter-frame prediction direction of the temporal merge candidate can be set to be the same as the inter-frame prediction direction of the temporally adjacent blocks. However, the reference picture index of the temporal merge candidate can have a fixed value. For example, the reference picture index of the temporal merge candidate can be set to "0".
[0146] Reference Figures 11 to 16 , an example of deriving merge candidates will be described in more detail.
[0147] Thereafter, a merge candidate list including spatial merge candidates and temporal merge candidates may be generated (S930). If the number of merge candidates included in the merge candidate list is less than the maximum number of merge candidates, a combined merge candidate combining two or more merge candidates or a merge candidate having a zero motion vector (0, 0) may be included in the merge candidate list.
[0148] When generating the merge candidate list, at least one of the merge candidates included in the merge candidate list may be specified based on the merge candidate index ( S940 ).
[0149] The motion information of the current block may be set to be the same as the motion information of the merge candidate specified by the merge candidate index (S950). For example, when a spatial merge candidate is selected by the merge candidate index, the motion information of the current block may be set to be the same as the motion information of the spatially adjacent block. Alternatively, when a temporal merge candidate is selected by the merge candidate index, the motion information of the current block may be set to be the same as the motion information of the temporally adjacent block.
[0150] Figure 10 A process of deriving motion information of a current block in a case where the AMVP mode is applied to the current block is shown.
[0151] When the AMVP mode is applied to the current block, at least one of the inter-frame prediction direction or the reference picture index of the current block may be decoded from the bitstream (S1010). That is, when the AMVP mode is applied, at least one of the inter-frame prediction direction or the reference picture index of the current block may be determined based on information encoded by the bitstream.
[0152] A spatial motion vector candidate may be determined based on the motion vectors of the spatially neighboring blocks of the current block (S1020). The spatial motion vector candidate may include at least one of a first spatial motion vector candidate derived from a top neighboring block of the current block and a second spatial motion vector candidate derived from a left neighboring block of the current block. Here, the top neighboring block may include at least one of blocks adjacent to the top or upper right corner of the current block, and the left neighboring block of the current block may include at least one of blocks adjacent to the left or lower left corner of the current block. The block adjacent to the upper left corner of the current block may be considered as the top neighboring block or the left neighboring block.
[0153] When the reference pictures between the current block and the spatially adjacent blocks are different, the spatial motion vector may be obtained by scaling the motion vectors of the spatially adjacent blocks.
[0154] A temporal motion vector candidate may be determined based on the motion vector of the temporal neighboring block of the current block (S1030). If the reference picture between the current block and the temporal neighboring block is different, the temporal motion vector may be obtained by scaling the motion vector of the temporal neighboring block.
[0155] A motion vector candidate list including spatial motion vector candidates and temporal motion vector candidates may be generated ( S1040 ).
[0156] When generating the motion vector candidate list, at least one of the motion vector candidates included in the motion vector candidate list may be specified based on information specifying at least one of the motion vector candidate list (S1050).
[0157] The motion vector candidate specified by the information is set as the motion vector prediction value of the current block. And, the motion vector of the current block is obtained by adding the motion vector difference value to the motion vector prediction value (S1060). At this time, the motion vector difference value can be parsed from the bitstream.
[0158] When the motion information of the current block is obtained, motion compensation may be performed on the current block based on the obtained motion information (S820). More specifically, motion compensation may be performed on the current block based on the inter prediction direction, reference picture index, and motion vector of the current block.
[0159] The maximum number of merging candidates that can be included in the merging candidate list can be signaled through the bitstream. For example, information indicating the maximum number of merging candidates can be signaled through a sequence parameter or a picture parameter.
[0160] The number of spatial merge candidates and temporal merge candidates that can be included in the merge candidate list can be determined based on the maximum number of merge candidates. Specifically, the number of spatial merge candidates and the number of temporal merge candidates can be adjusted so that the total number of spatial merge candidates and temporal merge candidates does not exceed the maximum number of merge candidates N. For example, when the maximum number of merge candidates is 5, 4 spatial merge candidates selected from the 5 spatial merge candidates of the current block can be added to the merge candidate list, and 1 temporal merge candidate selected from the 2 temporal merge candidates of the current block can be added to the merge candidate list. The number of temporal merge candidates can be adjusted based on the number of spatial merge candidates added to the merge candidate list, or the number of spatial merge candidates can be adjusted based on the number of temporal merge candidates added to the merge candidate list. If the number of merge candidates added to the merge candidate list is less than 5, a combined merge candidate combining at least two merge candidates can be added to the merge candidate list, or a merge candidate with a motion vector of (0, 0) can be added to the merge candidate list.
[0161] Merge candidates can be added to the merge candidate list in a predefined order. For example, the merge candidate list can be generated in the order of spatial merge candidates, temporal merge candidates, combined merge candidates, and merge candidates with zero motion vectors. It is also possible to define an order for adding merge candidates that is different from the order in which they are listed.
[0162] Figure 11 This diagram illustrates spatial merge candidates for the current block. Spatial merge candidates for the current block can be derived from spatially neighboring blocks. For example, the spatial merge candidates may include merge candidate A1 derived from a block adjacent to the left of the current block, merge candidate B1 derived from a block adjacent to the top of the current block, merge candidate A0 derived from a block adjacent to the lower left of the current block, merge candidate B0 derived from a block adjacent to the upper right of the current block, or merge candidate B2 derived from a block adjacent to the upper left of the current block. Spatial merge candidates may be searched in a predetermined order. For example, the search order for spatial merge candidates may be A1, B1, B0, A0, and B2. In this case, B2 may be included in the merge candidate list only when there is no block corresponding to A1, B1, B0, or A0, or when the block corresponding to A1, B1, B0, or A0 is unavailable. For example, if the block corresponding to A1, B1, B0, or A0 is encoded using intra-frame prediction, it may be determined that the block is unavailable. Alternatively, if the number of spatial merge candidates and temporal merge candidates included in the merge candidate list is less than or equal to the maximum number of merge candidates, B2 may be added to the merge candidate list as the next order of temporal merge candidates.
[0163] To derive temporal merge candidates, a collocated picture (col_pic) may be selected from a reference picture list. The collocated picture may be a picture in the reference picture list that has the smallest picture order count (POC) difference from the current picture, or a picture specified by a reference picture index. Temporal merge candidates may be derived based on the collocated block of the current block in the collocated block. Reference picture list information for specifying the collocated block may be encoded in units of blocks, slice headers, or pictures and transmitted via the bitstream.
[0164] Figure 12 This is a diagram showing the co-located blocks of the current block. The co-located blocks indicate the blocks in the collocated picture that correspond to the position of the current block. For example, the co-located block may be determined as block H adjacent to the lower right corner of a block having the same coordinates and size as the current block in the collocated picture, or block C3 including the center position of the block. In this case, when the position of block H is unavailable, when block H is encoded using intra-frame prediction, or when block H is located outside the LCU including the current block, block C3 may be determined as the co-located block.
[0165] Alternatively, a block adjacent to one corner of a block having the same coordinates and size as the current block in the collocated picture may be determined as the co-located block, or a block having coordinates within the block may be determined as the co-located block. Figure 12 In the example shown, the block TL, BL, or C0 may be determined as the co-located block.
[0166] It is also possible to derive multiple temporal merging candidates for the current block from multiple co-located blocks.
[0167] The motion vector of the temporal merging candidate may be obtained by scaling the motion vector of the co-located block in the collocated picture. Figure 13 This diagram illustrates an example of obtaining a motion vector of a temporal merge candidate by scaling the motion vector of a co-located block. The motion vector of the temporal merge candidate may be obtained by scaling the motion vector of the co-located block using at least one of a temporal distance tb between a current picture and a reference picture of the current block and a temporal distance td between a collocated picture and a reference picture of the co-located block.
[0168] Merge candidates may be derived based on blocks having a predetermined shape or blocks having a size equal to or larger than a predetermined size. Therefore, if the current block does not have a predetermined shape or if the size of the current block is smaller than the predetermined size, merge candidates for the current block may be derived based on blocks of the predetermined shape including the current block or blocks of the predetermined size or larger including the current block. For example, merge candidates for non-square-shaped coding units may be derived based on square-shaped coding units including non-square-shaped coding units.
[0169] Figure 14 is a diagram illustrating an example of deriving merging candidates for non-square blocks based on square blocks.
[0170] Merge candidates for non-square blocks can be derived based on square blocks including non-square blocks. Figure 14 In the example shown, merging candidates for non-square coding block 0 and non-square coding block 1 can be derived based on square blocks. Therefore, coding block 0 and coding block 1 can use at least one of spatial merging candidates A0, A1, A2, A3, and A4 derived based on square blocks.
[0171] Although not shown in the figure, temporal merging candidates for non-square blocks can also be derived based on square blocks. For example, coding block 0 and coding block 1 can use temporal merging candidates derived from temporal neighboring blocks determined based on square blocks.
[0172] Alternatively, at least one of the spatial merge candidate and the temporal merge candidate may be derived based on a square block, and the other may be derived based on a non-square block. For example, coding block 0 and coding block 1 may use the same spatial merge candidate derived based on a square block, while coding block 0 and coding block 1 may use different temporal merge candidates, each derived based on its position.
[0173] In the above example, merging candidates are derived based on square blocks, but merging candidates can also be derived based on non-square blocks of predetermined shapes. For example, if the current block is a non-square block of 2Nxn (where n is 1 / 2N), merging candidates for the current block can be derived based on non-square blocks of 2NxN shape, and if the current block is a non-square block of nx2N shape, merging candidates for the current block can be derived based on non-square blocks of Nx2N shape.
[0174] Information indicating the shape of a block or the size of a block used as a basis for deriving merge candidates may be signaled through the bitstream. For example, block shape information indicating a square shape or a non-square shape may be signaled through the bitstream. Alternatively, the encoder / decoder may derive merge candidates according to a predefined rule, such as a block having a predefined shape or a block having a size equal to or greater than a predefined size.
[0175] In another example, merge candidates may be derived based on a quadtree partition unit. Here, a quadtree partition unit may represent a block unit partitioned by a quadtree. For example, if the current block is partitioned by a binary tree, merge candidates for the current block may be derived based on the upper node block partitioned by the quadtree. If no upper node partitioned by the quadtree exists for the current block, merge candidates for the current block may be derived based on an LCU that includes the current block or a block of a specific size.
[0176] Figure 15 This is a diagram for explaining an example of deriving merge candidates of binary tree partition blocks based on upper node blocks.
[0177] The non-square binary tree partition block 0 and the non-square binary tree partition block 1 can use at least one of the spatial merging candidates A0, A1, A2, A3, and A4 derived based on the upper block of the quadtree unit. Therefore, block 0 and block 1 can use the same spatial merging candidate.
[0178] In addition, the non-square binary tree partition block 2, the non-square binary tree partition block 3, and the non-square binary tree partition block 4 can use at least one of B0, B1, B2, B3, and B4 derived from the upper block of the quadtree unit. Therefore, block 2, block 3, and block 4 can use the same spatial merging candidate.
[0179] Although not shown in the figure, temporal merging candidates for binary tree partitioned blocks can also be derived from the upper block based on the quadtree. Therefore, blocks 0 and 1 can use the same temporal merging candidate derived from temporally adjacent blocks determined based on quadtree block units. Blocks 2, 3, and 4 can also use the same temporal merging candidate derived from temporally adjacent blocks determined based on quadtree block units.
[0180] Alternatively, at least one of the spatial merge candidate and the temporal merge candidate may be derived based on a binary tree block unit, and the other may be derived based on a quadtree block unit. For example, block 0 and block 1 may use the same spatial merge candidate derived based on a quadtree block unit, but may use different temporal merge candidates derived based on their respective positions.
[0181] Information indicating whether merge candidates are derived based on quadtree partition units or binary tree partition units can be signaled via the bitstream. Based on this information, it can be determined whether merge candidates for binary tree partition blocks are derived based on upper node blocks of quadtree partitions. Alternatively, the encoder / decoder can derive merge candidates based on quadtree partition units or binary tree partition units according to predefined rules.
[0182] As described above, the merge candidates of the current block can be derived in units of blocks or predefined units (for example, in units of coding blocks or prediction blocks). At this time, if any spatial merge candidate of the current block exists in a predetermined area, it can be determined that it is unavailable, and then the spatial merge candidate can be excluded from the spatial merge candidates. For example, if a parallel processing area is defined for parallel processing between blocks, the merge candidates included in the parallel processing area among the spatial merge candidates of the current block can be determined to be unavailable. The parallel processing area can be referred to as a merge estimation region (MER). Blocks in the parallel processing area have the advantage of being able to be merged in parallel.
[0183] The merged estimation region may have a square shape or a non-square shape. The non-square merged estimation region may be limited to a predetermined shape. For example, the non-square merged estimation region may have a 2N×N or N×2N shape.
[0184] At least one of information indicating the shape of the merge estimation region or information indicating the size of the merge estimation region may be signaled through the bitstream. For example, information related to the shape or size of the merge estimation region may be signaled through a slice header, a picture parameter, or a sequence parameter.
[0185] The information indicating the shape of the merged estimation region may be a 1-bit flag. For example, the syntax "isrectagular_mer_flag" indicating whether the merged estimation region has a square shape or a non-square shape may be signaled via the bitstream. If the value of isrectagular_mer_flag is 1, it indicates that the merged estimation region has a non-square shape, and if the value of isrectagular_mer_flag is 0, it indicates that the merged estimation region has a square shape.
[0186] If the merged estimation region has a non-square shape, at least one of information related to the width, height, or ratio of the width to the height may be signaled via the bitstream, and based on this information, the size and / or shape of the non-square merged estimation region may be derived.
[0187] Figure 16 is a diagram illustrating an example of determining the availability of spatial merging candidates according to a merging estimation region.
[0188] If the merge estimation region has an N×2N shape and the merge estimation region has a predetermined size, the spatial merge candidates B0 and B3 included in the same merge estimation region as the block 1 cannot be used as spatial merge candidates for the block 1. Therefore, the spatial merge candidate for the block 1 may consist of at least one of B1, B2, and B4 other than the merge candidates B0 and B3.
[0189] Likewise, the spatial merging candidate C0 included in the same merging estimation region as the block 3 cannot be used as the spatial merging candidate of the block 3. Therefore, the spatial merging candidate of the block 3 may consist of at least one of C1, C2, C3, and C4 except the merging candidate C0.
[0190] The above embodiment has been described mainly with respect to the decoding process, but the encoding process may be performed in the same order as that described or in the reverse order.
[0191] Figure 17 is a flowchart illustrating a process of obtaining residual samples according to an embodiment to which the present invention is applied.
[0192] First, the residual coefficients of the current block can be obtained (S1710). The decoder can obtain the residual coefficients through a coefficient scanning method. For example, the decoder can perform coefficient scanning using a zigzag scan, an overwriting scan, a vertical scan, or a horizontal scan, and the decoder can obtain the residual coefficients in the form of a two-dimensional block.
[0193] Inverse quantization may be performed on the residual coefficient of the current block ( S1720 ).
[0194] It may be determined whether to skip inverse transforming the inverse quantized residual coefficients of the current block (S1730). Specifically, the decoder may determine whether to skip inverse transforming at least one of the horizontal and vertical directions of the current block. When it is determined that inverse transforming is applied to at least one of the horizontal and vertical directions of the current block, residual samples of the current block may be obtained by inverse transforming the inverse quantized residual coefficients of the current block. Here, the inverse transform may be performed using at least one of DCT, DST, and KLT.
[0195] When inverse transform is skipped in both horizontal and vertical directions of the current block, inverse transform is not performed in the horizontal and vertical directions of the current block. In this case, the residual samples of the current block can be obtained by scaling the inverse quantized residual coefficients with a predetermined value.
[0196] 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. In this case, scaling can be performed in the horizontal direction.
[0197] 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. In this case, scaling can be performed in the vertical direction.
[0198] Whether the inverse transform skipping technique can be used for the current block can be determined based 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 samples 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 inverse transform (e.g., transform_skip_flag) can be omitted.
[0199] 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-frame prediction mode of the current block.
[0200] 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, inverse transform is performed in the horizontal direction of the current block, and inverse transform may be selectively performed in the vertical direction.
[0201] On the other hand, 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 horizontal direction and restricted in the vertical direction. That is, when the current block is N×2N, inverse transform is performed in the vertical direction of the current block, and inverse transform may be selectively performed in the horizontal direction.
[0202] In contrast to the above example, when the current block is a non-square block with a larger width than 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 larger height than width, the inverse transform skip scheme may be allowed only in the vertical direction.
[0203] Information indicating whether to skip the inverse transform in the horizontal direction or information indicating whether to skip the inverse transform in the vertical direction can be signaled through the 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", and the information indicating whether to skip the inverse transform in the vertical direction is a 1-bit flag "ver_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".
[0204] It can be set to skip inverse transform for the current block in any direction according to the partition type of the current block. For example, if the current block is generated by binary tree-based partitioning, inverse transform in the horizontal direction or the vertical direction can be skipped. That is, if the current block is generated by binary tree-based partitioning, it can be determined whether to skip 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 inverse transform of the current block (e.g., transform_skip_flag, hor_transform_skip_flag, ver_transform_skip_flag).
[0205] The embodiments of the present disclosure may also be described as follows:
[0206] Solution 1. A method for decoding a video, the method comprising:
[0207] Derive spatial merging candidates for the current block;
[0208] generating a merging candidate list for the current block based on the spatial merging candidates;
[0209] Obtaining motion information of the current block based on the merge candidate list; and
[0210] performing motion compensation on the current block using the motion information,
[0211] Wherein, if the current block does not have a predefined shape or does not have a size equal to or greater than a predefined size, a spatial merging candidate for the current block is derived based on a block having the predefined shape or having a size equal to or greater than the predefined size, the block including the current block.
[0212] Option 2. The method according to Option 1, wherein the predefined shape is a square shape.
[0213] Solution 3. The method according to Solution 2, wherein the current block and a neighboring block included in the block having a square shape of the current block have the same spatial merging candidate.
[0214] Solution 4. The method according to Solution 1, wherein, if the current block and the spatial merging candidate are included in the same merging estimation area, it is determined that the spatial merging candidate is unavailable.
[0215] Option 5. The method according to Option 4, wherein the merged estimation area has a square shape or a non-square shape.
[0216] Solution 6. The method according to Solution 5, wherein, if the merged estimation region has a non-square shape, the number of candidate shapes of the merged candidates that the merged estimation region can have is limited to a predefined number.
[0217] Solution 7. A method for encoding a video, the method comprising:
[0218] Derive spatial merging candidates for the current block;
[0219] generating a merging candidate list for the current block based on the spatial merging candidates;
[0220] Obtaining motion information of the current block based on the merge candidate list; and
[0221] performing motion compensation on the current block using the motion information,
[0222] Wherein, if the current block does not have a predefined shape or does not have a size equal to or greater than a predefined size, a spatial merging candidate for the current block is derived based on a block having the predefined shape or having a size equal to or greater than the predefined size, the block including the current block.
[0223] Option 8. The method according to Option 7, wherein the predefined shape is a square shape.
[0224] Solution 9. The method according to Solution 8, wherein the current block and a neighboring block included in the block having a square shape of the current block have the same spatial merging candidate.
[0225] Option 10. The method according to Option 7, wherein if the current block and the spatial merging candidate are included in the same merging estimation area, it is determined that the spatial merging candidate is unavailable.
[0226] Option 11. The method according to Option 10, wherein the combined estimation area has a square shape or a non-square shape.
[0227] Solution 12. The method according to Solution 11, wherein, if the merge estimation region has a non-square shape, the number of candidate shapes of the merge candidates that the merge estimation region can have is limited to a predefined number.
[0228] Solution 13. A device for decoding a video, the device comprising:
[0229] a prediction unit, configured to: derive a spatial merge candidate for a current block; generate a merge candidate list for the current block based on the spatial merge candidate; obtain motion information of the current block based on the merge candidate list; and perform motion compensation on the current block using the motion information,
[0230] Wherein, if the current block does not have a predefined shape or does not have a size equal to or greater than a predefined size, a spatial merging candidate for the current block is derived based on a block having the predefined shape or having a size equal to or greater than the predefined size, the block including the current block.
[0231] Although the above embodiments have been described based on a series of steps or flow charts, they do not limit the timing of the present invention and can be performed simultaneously or in different orders as needed. In addition, each of the components (e.g., units, modules, etc.) constituting the block diagrams in the above 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 embodiments can be implemented in the form of program instructions that 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. Examples of computer-readable media include: magnetic media, such as hard disks, floppy disks, and magnetic tapes; optical recording media, such as CD-ROMs and DVDs; magneto-optical media, such as optical magnetic floppy disks; media; and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, etc. The hardware device can be configured to operate as one or more software modules for performing the processing according to the present invention, and vice versa.
[0232] Industrial Applicability
[0233] The present invention can be applied to electronic devices capable of encoding / decoding videos.
Claims
1. A method for decoding a video, the method comprising: Splitting the first depth coding block into two second depth coding blocks; determining whether to split the second depth coding block into two third depth coding blocks; In a case where it is determined to divide the second depth coding block, dividing the second depth coding block into two third depth coding blocks; deriving a spatial merging candidate for a current block, where the current block is one of the two third depth coding blocks; generating a merging candidate list for the current block based on the spatial merging candidates; Obtaining motion information of the current block based on the merge candidate list; Obtain a prediction sample of the current block using the motion information; as well as reconstructing the current block based on the prediction samples and the residual samples of the current block, wherein the first depth coding block is divided in a horizontal direction or a vertical direction, and In response to the first depth coding block having a size of 128×128, the second depth coding block is not allowed to be split in the same direction as the first depth coding block.
2. The method according to claim 1, wherein Only when the size of the current block is greater than a threshold, the two partitions included in the current block share the merge candidate list of the current block.
3. The method according to claim 2, wherein: The two partitions are generated by dividing the current block in a vertical direction or a horizontal direction, and It is not allowed to symmetrically divide the current block in the vertical direction or the horizontal direction.
4. The method according to claim 1, wherein In the case where the current block is included in the same merge estimation area as another coding block, the other coding block cannot be used as a spatial merging candidate of the current block, and The size information specifying the size of the merged estimation region is explicitly signaled via a bitstream.
5. A method for encoding a video, the method comprising: Splitting the first depth coding block into two second depth coding blocks; determining whether to split the second depth coding block into two third depth coding blocks; In a case where it is determined to divide the second depth coding block, dividing the second depth coding block into two third depth coding blocks; deriving a spatial merging candidate for a current block, where the current block is one of the two third depth coding blocks; generating a merging candidate list for the current block based on the spatial merging candidates; Obtaining motion information of the current block based on the merge candidate list; Obtain a prediction sample of the current block using the motion information; as well as Obtaining residual samples of the current block based on the predicted samples, wherein the first depth coding block is divided in a horizontal direction or a vertical direction, and In response to the first depth coding block having a size of 128×128, the second depth coding block is not allowed to be split in the same direction as the first depth coding block.
6. The method according to claim 5, wherein: Only when the size of the current block is greater than a threshold, the two partitions included in the current block share the merge candidate list of the current block.
7. The method according to claim 6, wherein: The two partitions are generated by dividing the current block in a vertical direction or a horizontal direction, and It is not allowed to symmetrically divide the current block in the vertical direction or the horizontal direction.
8. The method according to claim 5, wherein In the case where the current block is included in the same merge estimation area as another coding block, the other coding block cannot be used as a spatial merging candidate of the current block, and The size information specifying the size of the merged estimation region is explicitly signaled via a bitstream.
9. A method for transmitting video data, comprising: Obtaining a bitstream of the video data, wherein the bitstream is generated by the following operations: dividing a first depth coding block into two second depth coding blocks; determining whether to divide the second depth coding block into two third depth coding blocks; if it is determined to divide the second depth coding block, dividing the second depth coding block into two third depth coding blocks; deriving a spatial merge candidate for a current block, the current block being one of the two third depth coding blocks; generating a merge candidate list for the current block based on the spatial merge candidate; obtaining motion information of the current block based on the merge candidate list; obtaining prediction samples of the current block using the motion information; obtaining residual samples of the current block based on the prediction samples; and encoding the residual samples of the current block; and transmitting the bitstream, wherein the first depth coding block is divided in a horizontal direction or a vertical direction, and In response to the first depth coding block having a size of 128×128, the second depth coding block is not allowed to be split in the same direction as the first depth coding block.
Citation Information
Patent Citations
Picture coding supporting block partitioning and block merging
CN103477635A
Method and device for sharing a candidate list
CN104185988A