Image encoding / decoding methods
By deducing the encoding information and motion vector difference of the current block from adjacent reconstruction blocks, transform and quantization techniques are used to solve the problem of low encoding efficiency of high-resolution images, and the transmission and storage costs are reduced.
Patent Information
- Application Number
- CN202211602603.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2016-08-01
- Filing Date
- 2017-07-18
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2037-07-18
AI Technical Summary
The prior art has low encoding efficiency in high resolution and high quality image encoding, high transmission and storage costs, and limited traditional motion compensation methods.
By deducing the encoding information and motion vector difference of the current block from the reconstruction block adjacent to the current block, the first and second transformation schemes are adopted to improve the encoding efficiency.
Improve the efficiency of image encoding and decoding, and reduce transmission and storage costs.
Smart Images

Figure CN116016910B_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with application date of July 18, 2017, application number 201780048129.1, and titled “Image encoding / decoding method”. Technical Field
[0002] The present invention relates to a method and apparatus for encoding / decoding an image, and more particularly, to a method and apparatus for deriving encoding information of a current block by using encoding information of neighboring blocks. 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, image data with higher resolution and quality increases the data volume compared with conventional image data. Therefore, when image data is transmitted by using a medium such as conventional wired and wireless broadband networks, or when image data is stored by using conventional storage media, the cost of transmission and storage increases. In order to solve these problems that occur as the resolution and quality of image data increase, there is a need for an efficient image encoding / decoding technology for higher-resolution and higher-quality images.
[0004] Image compression technology includes various technologies, including: inter-frame prediction technology for predicting pixel values included in a current picture from a previous picture or a subsequent picture of the current picture; intra-frame prediction technology for predicting pixel values included in a current picture by using pixel information in the current picture; transformation and quantization technology for compressing the energy of a residual signal; entropy coding technology for assigning short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence; etc. Image data can be effectively compressed by using such image compression technology and can be transmitted or stored.
[0005] In conventional motion compensation, only spatial motion vector candidates, temporal motion vector candidates, and zero motion vector candidates are added to a motion vector candidate list to be used, and only unidirectional prediction and bidirectional prediction are used, so there is a limit to improving encoding efficiency. Summary of the Invention
[0006] Technical issues
[0007] An object of the present invention is to provide a method and apparatus for deriving coding information of a current block from reconstructed blocks adjacent to the current block.
[0008] Another object of the present invention is to provide a method and apparatus for encoding / decoding a difference between a motion vector difference adjacent to a current block and a motion vector difference of the current block.
[0009] Technical Solution
[0010] According to the present invention, an image encoding method includes: generating a prediction signal for a current block; generating a residual signal for the current block based on the prediction signal; determining a transform scheme for transforming the residual signal; and performing quantization on the residual signal. Here, the transform includes a primary transform and a secondary transform, and at least one of the primary transform scheme and the secondary transform scheme is derived from a coded reconstructed block adjacent to the current block.
[0011] According to the present invention, an image decoding method includes: obtaining a quantized residual signal of a current block; performing inverse quantization on the quantized residual signal; and determining a transform scheme for inversely transforming the residual signal. Here, the inverse transform includes a primary transform and a secondary transform, and at least one of the primary transform scheme and the secondary transform scheme is derived from a decoded reconstructed block adjacent to the current block.
[0012] In an image encoding method or an image decoding method, when a prediction signal is generated through intra prediction, at least one of a primary transform scheme and a secondary transform scheme may be derived from a neighboring block having the same intra prediction mode as that of a current block.
[0013] In an image encoding method or an image decoding method, when a primary transform scheme of a neighboring block having the same intra prediction mode as that of a current block indicates transform skipping, a primary transform scheme and a secondary transform scheme of the current block may be determined as transform skipping.
[0014] In the image encoding method or the image decoding method, a secondary transform scheme may be derived from a neighboring block having the same primary transform scheme as that of a current block.
[0015] In an image encoding method or an image decoding method, when a prediction signal is generated through inter prediction, at least one of a primary transform scheme and a secondary transform scheme is derived from a neighboring block having motion information identical to that of a current block.
[0016] In the image encoding method or the image decoding method, the motion information may include at least one of a motion vector, a reference picture index, and a reference picture direction.
[0017] Technical Effects
[0018] According to the present invention, encoding / decoding efficiency can be improved by providing a method and apparatus for deriving encoding information of a current block from reconstructed blocks adjacent to the current block.
[0019] According to the present invention, encoding / decoding efficiency can be improved by a method and apparatus for encoding / decoding a difference between motion vector differences adjacent to a current block and a motion vector difference of a current block. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0021] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0022] Figure 3 is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image.
[0023] Figure 4 is a diagram illustrating a form of a prediction unit (PU) that may be included in a coding unit (CU).
[0024] Figure 5 is a diagram illustrating a form of a transform unit (TU) that may be included in a coding unit (CU).
[0025] Figure 6 is a diagram for explaining an embodiment of a process of intra prediction.
[0026] Figure 7 is a diagram for explaining an embodiment of a process of inter-frame prediction.
[0027] Figure 8 is a diagram for explaining a transform set according to an intra prediction mode.
[0028] Figure 9 is a diagram for explaining the process of conversion.
[0029] Figure 10 is a diagram for explaining scanning of quantized transform coefficients.
[0030] Figure 11 is a diagram for explaining block partitioning.
[0031] Figure 12 is a diagram illustrating an example of encoding / decoding units according to a partitioned form of a block.
[0032] Figure 13 is a flowchart illustrating a process of determining whether to decode information of a binary tree partition.
[0033] Figure 14 is a flowchart illustrating a process of determining whether to decode information of a binary tree partition.
[0034] Figures 15 to 17 is a diagram illustrating an example of a case where binary tree partitioning is no longer performed on blocks having a predetermined size or smaller.
[0035] Figure 18is a flowchart illustrating a process of determining whether to derive encoding information of a residual signal of a current block from a neighboring block when the current block is encoded through intra prediction.
[0036] Figure 19 is a flowchart illustrating a process of determining whether to derive encoding information of a residual signal of a current block from a neighboring block when the current block is encoded through inter-frame prediction.
[0037] Figure 20 is a flowchart illustrating a decoding process of a motion vector of a current block.
[0038] Figure 21 is a diagram illustrating an example of deriving spatial motion vector candidates.
[0039] Figure 22 is a diagram illustrating an example of deriving a temporal motion vector candidate.
[0040] Figure 23 is a diagram illustrating derivation of a second motion vector difference. DETAILED DESCRIPTION
[0041] Invention Mode
[0042] The present invention may be modified in various ways, and there are various embodiments of the present invention, examples of which will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be construed to include all modifications, equivalents, or alternatives within the technical concept and scope of the present invention. Similar reference numerals refer to identical or similar functions in various aspects. In the accompanying drawings, the shapes and sizes of elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be implemented. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in connection with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that the position or arrangement of the various elements within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description will not be taken in a limiting sense, and the scope of the present disclosure is defined solely by the appended claims (and, when appropriately interpreted, along with the full scope of equivalents to which the claims are entitled).
[0043] The terms "first," "second," and the like used in the specification may be used to describe various components, but these components are not to be construed as being limited to the terms. The terms are used only to distinguish one component from another. 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 similarly be referred to as a "first" component. The term "and / or" includes a combination of a plurality of items or any one of the plurality of items.
[0044] It will 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, it may be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with other elements interposed therebetween. Conversely, it will be understood that when an element is referred to as being “directly coupled to” or “directly coupled” to another element, there are no intervening elements present.
[0045] In addition, the components shown in the embodiments of the present invention are shown independently to present characteristic functions that are different from each other. Therefore, this does not mean that each component is constituted with a component unit of separate hardware or software. In other words, for convenience, each component includes each of the enumerated components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.
[0046] 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 plural expressions unless they have significantly different meanings in the context. In this specification, it will be understood that terms such as "including ... ", "having ... " etc. are intended to indicate the existence of features, quantities, steps, behaviors, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, behaviors, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "comprising ", elements other than the corresponding element are not excluded, but rather, other elements may be included in an embodiment of the present invention or in the scope of the present invention.
[0047] Furthermore, some components may not be indispensable components for performing the essential functions of the present invention, but may be optional components that only enhance its performance. The present invention may be implemented by including only the components that are indispensable for implementing the essence of the present invention and excluding components that are used to enhance performance. Structures that include only the indispensable components and exclude optional components that are used only to enhance performance are also included in the scope of the present invention.
[0048] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the exemplary embodiments of the present invention, well-known functions or structures will not be described in detail because they would unnecessarily obscure the understanding of the present invention. The same components in the drawings are represented by the same reference numerals, and repeated descriptions of the same components will be omitted.
[0049] In the following text, "image" can refer to a frame that constitutes a video, or can refer to the video itself. For example, "encoding or decoding an image, or encoding and decoding both images" can refer to "encoding or decoding a video, or encoding and decoding both images," and can also refer to "encoding or decoding both images, or encoding and decoding both images, of a video." Here, "frame" and "image" can have the same meaning.
[0050] Terminology Description
[0051] Encoder: This can mean a device that performs encoding.
[0052] Decoder: Can mean a device that performs decoding.
[0053] Parsing: can mean determining the value of a syntax element by performing entropy decoding, or can mean the entropy decoding itself.
[0054] Block: can be defined as an M×N matrix of samples. Here, M and N are positive integers, and a block can be defined as a two-dimensional matrix of samples.
[0055] Sample: is a basic unit of a block and may indicate a value ranging from 0 to 2Bd−1 according to a bit depth (Bd). A sample may mean a pixel in the present invention.
[0056] Unit: This refers to a unit used for encoding and decoding an image. When encoding and decoding an image, a unit may be a region created by partitioning an image. Furthermore, a unit may refer to a sub-division unit when an image is partitioned into multiple sub-division units during encoding or decoding. When encoding and decoding an image, predetermined processing may be performed on each unit. A unit may be partitioned into sub-units smaller than the unit. Depending on its function, a unit may refer to a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, transform unit, transform block, etc. Furthermore, to distinguish a unit from a block, a unit may include a luma component block, a chroma component block of a luma component block, and syntax elements for each color component block. A unit may have various sizes and shapes. Specifically, the shape of a unit may be a two-dimensional geometric figure such as a rectangle, square, trapezoid, triangle, pentagon, etc. Furthermore, unit information may include at least one of a unit type (indicating a coding unit, prediction unit, transform unit, etc.), unit size, unit depth, and the order in which the units are encoded and decoded.
[0057] Reconstructed neighboring unit: may refer to a reconstructed unit that has been previously encoded or decoded in space or time, and is adjacent to the encoding / decoding target unit. Here, the reconstructed neighboring unit may refer to a reconstructed neighboring block.
[0058] Neighboring block: This may refer to a block adjacent to the encoding / decoding target block. A block adjacent to the encoding / decoding target block may refer to a block having a border that touches the encoding / decoding target block. A neighboring block may refer to a block located at a vertex adjacent to the encoding / decoding target block. A neighboring block may refer to a reconstructed neighboring block.
[0059] Unit depth: It can mean the degree to which a unit is partitioned. In a tree structure, the root node can be the highest node and the leaf node can be the lowest node.
[0060] Symbol: It can mean the syntax element, coding parameter, value of transform coefficient, etc. of the encoding / decoding target unit.
[0061] Parameter set: This refers to header information in the bitstream structure. A parameter set can include at least one of a video parameter set, a sequence parameter set, a picture parameter set, or an adaptation parameter set. Furthermore, a parameter set can refer to slice header information and tile header information, among others.
[0062] Bitstream: can mean a string of bits that includes coded image information.
[0063] Prediction unit: This may refer to a basic unit when performing inter-frame prediction or intra-frame prediction and compensation for the prediction. One prediction unit may be partitioned into multiple partitions. In this case, each of the multiple partitions may be a basic unit when performing prediction and compensation, and each partition partitioned from the prediction unit may be a prediction unit. In addition, one prediction unit may be partitioned into multiple small prediction units. The prediction unit may have various sizes and shapes, and specifically, the shape of the prediction unit may be a two-dimensional geometric figure such as a rectangle, square, trapezoid, triangle, pentagon, etc.
[0064] Prediction unit partition: refers to the shape of the partitioned prediction unit.
[0065] Reference picture list: This refers to a list containing at least one reference picture, where the at least one reference picture is used for inter-frame prediction or motion compensation. Reference picture lists can be of the following types: List Combined (LC), List 0 (L0), List 1 (L1), List 2 (L2), List 3 (L3), etc. At least one reference picture list can be used for inter-frame prediction.
[0066] Inter-frame prediction indicator: may mean one of the following: the inter-frame prediction direction (unidirectional prediction, bidirectional prediction, etc.) of the encoding / decoding target block in the case of inter-frame prediction, the number of reference pictures used to generate the prediction block through the encoding / decoding target block, and the number of reference blocks used to perform inter-frame prediction or motion compensation through the encoding / decoding target block.
[0067] Reference picture index: may refer to the index of a specific reference picture in a reference picture list.
[0068] Reference picture: A picture that a specific unit refers to for inter-frame prediction or motion compensation. A reference image can be called a reference picture.
[0069] Motion vector: A two-dimensional vector used for inter-frame prediction or motion compensation, and may represent the offset between the encoding / decoding target picture and the reference picture. For example, (mvX, mvY) may indicate a motion vector, where mvX may indicate the horizontal component and mvY may indicate the vertical component.
[0070] Motion vector candidate: may mean a unit that becomes a prediction candidate when predicting a motion vector, or may mean a motion vector of the unit.
[0071] Motion vector candidate list: may mean a list configured by using motion vector candidates.
[0072] Motion vector candidate index: may mean an indicator indicating a motion vector candidate in a motion vector candidate list. The motion vector candidate index may be referred to as an index of a motion vector predictor.
[0073] Motion information: may mean a motion vector, a reference picture index, and an inter-prediction indicator, as well as information including at least one of reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, and the like.
[0074] Merge candidate list: may mean a list configured by using merge candidates.
[0075] Merge candidates: may include spatial merge candidates, temporal merge candidates, combined merge candidates, combined bi-predictive merge candidates, zero merge candidates, etc. Merge candidates may include motion information such as prediction type information, reference picture index for each list, motion vector, etc.
[0076] Merge index: This may refer to information indicating a merge candidate in a merge candidate list. Furthermore, the merge index may indicate a block from which a merge candidate is derived, among reconstructed blocks that are spatially / temporally adjacent to the current block. Furthermore, the merge index may indicate at least one piece of motion information from among multiple pieces of motion information for the merge candidate.
[0077] Transform unit (TU): This refers to the basic unit used when performing encoding / decoding on a residual signal, such as transform, inverse transform, quantization, dequantization, and transform coefficient encoding / decoding. A TU can be partitioned into multiple small TUs. TUs can have various sizes and shapes. Specifically, the shape of a TU can be a two-dimensional geometric figure, such as a rectangle, square, trapezoid, triangle, or pentagon.
[0078] Scaling: This refers to the process of multiplying a factor by the transform coefficient level, as a result of which transform coefficients can be generated. Scaling can also be called inverse quantization.
[0079] Quantization parameter: may mean a value used when scaling transform coefficient levels during quantization and inverse quantization. Here, the quantization parameter may be a value mapped to a quantization step size.
[0080] Delta quantization parameter: may refer to the difference between the quantization parameter of the encoding / decoding target unit and the predicted quantization parameter.
[0081] Scan: This refers to a method of sorting the order of coefficients within a block or matrix. For example, sorting a two-dimensional matrix into a one-dimensional matrix may be called a scan, and sorting a one-dimensional matrix into a two-dimensional matrix may be called a scan or an inverse scan.
[0082] Transform coefficient: may mean a coefficient value generated after performing a transform. In the present invention, a quantized transform coefficient level (ie, a transform coefficient to which quantization is applied) may be referred to as a transform coefficient.
[0083] Non-zero transform coefficient: may mean a transform coefficient whose value is not 0, or may mean a transform coefficient level whose value is not 0.
[0084] Quantization matrix: This refers to a matrix used in quantization and inverse quantization to improve the subject quality or object quality of an image. The quantization matrix may also be referred to as a scaling list.
[0085] Quantization matrix coefficient: can refer to each element of the quantization matrix. Quantization matrix coefficient can be called matrix coefficient.
[0086] Default matrix: may mean a predetermined quantization matrix that is predefined in an encoder and a decoder.
[0087] Non-default matrix: may mean a quantization matrix sent / received by a user without being pre-defined in an encoder and a decoder.
[0088] Coding tree unit: It can be composed of one luminance component (Y) coding tree unit and two related chrominance component (Cb, Cr) coding tree units. Each coding tree unit can be partitioned by using at least one partitioning method (such as quadtree, binary tree, etc.) to form sub-units such as coding units, prediction units, and transform units. Coding tree unit can be used as a term for indicating a pixel block (wherein a pixel block is a processing unit in the decoding / encoding process of an image, such as a partition of an input image).
[0089] Coding tree block: may be used as a term for indicating one of a Y coding tree unit, a Cb coding tree unit, and a Cr coding tree unit.
[0090] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0091] The encoding device 100 may be a video encoding device or an image encoding device. A video may include one or more images. The encoding device 100 may encode one or more images of a video in a temporal order.
[0092] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.
[0093] The encoding device 100 may encode the input picture in intra mode or inter mode or both intra mode and inter mode. In addition, the encoding device 100 may generate a bit stream by encoding the input picture, and may output the generated bit stream. When the intra mode is used as the prediction mode, the switch 115 may switch to intra. When the inter mode is used as the prediction mode, the switch 115 may switch to inter. Here, the intra mode may be referred to as the intra prediction mode, and the inter mode may be referred to as the inter prediction mode. The encoding device 100 may generate a prediction block for the input block of the input picture. In addition, after generating the prediction block, the encoding device 100 may encode the residual between the input block and the prediction block. The input picture may be referred to as the current image that is the target of current encoding. The input block may be referred to as the current block or may be referred to as the encoding target block that is the target of current encoding.
[0094] When the prediction mode is intra mode, the intra prediction unit 120 may use the pixel values of the previously encoded block adjacent to the current block as reference pixels. The intra prediction unit 120 may perform spatial prediction using the reference pixels and may generate prediction samples of the input block using spatial prediction. Here, intra prediction may refer to intra-frame prediction.
[0095] When the prediction mode is inter mode, the motion prediction unit 111 may search for an area that best matches the input block from the reference picture in the motion prediction process and may derive a motion vector by using the searched area. The reference picture may be stored in the reference picture buffer 190.
[0096] The motion compensation unit 112 may generate a prediction block by performing motion compensation using a motion vector. Here, a motion vector may be a two-dimensional vector used for inter-frame prediction. In addition, a motion vector may indicate the offset between the current picture and the reference picture. Here, inter-frame prediction may mean inter-frame prediction.
[0097] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area in the reference picture. In order to perform inter-frame prediction or motion compensation based on the coding unit, it may be determined which method to use for the motion prediction and compensation method of the prediction unit in the coding unit among the skip mode, merge mode, AMVP mode, and current picture reference mode. Inter-frame prediction or motion compensation may be performed according to each mode. Here, the current picture reference mode may mean a prediction mode that uses a pre-reconstructed area of the current picture with the encoding target block. In order to specify the pre-reconstructed area, a motion vector for the current picture reference mode may be defined. Whether the encoding target block is encoded according to the current picture reference mode may be encoded by using the reference picture index of the encoding target block.
[0098] The subtractor 125 may generate a residual block by using a residual between the input block and the prediction block. The residual block may be referred to as a residual signal.
[0099] The transform unit 130 may generate a transform coefficient by transforming the residual block and may output the transform coefficient. Here, the transform coefficient may be a coefficient value generated by transforming the residual block. In the transform skip mode, the transform unit 130 may skip transforming the residual block.
[0100] Quantized transform coefficient levels may be generated by applying quantization to the transform coefficients. Hereinafter, in an embodiment of the present invention, the quantized transform coefficient levels may be referred to as transform coefficients.
[0101] The quantization unit 140 may generate quantized transform coefficient levels by quantizing the transform coefficients according to the quantization parameter, and may output the quantized transform coefficient levels. Here, the quantization unit 140 may quantize the transform coefficients by using a quantization matrix.
[0102] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the value calculated by the quantization unit 140 or the encoding parameter value calculated in the encoding process according to the probability distribution, and may output the generated bitstream. The entropy coding unit 150 may perform entropy coding on information used to decode an image and may perform entropy coding on information of pixels of the image. For example, the information used to decode an image may include syntax elements, etc.
[0103] When entropy coding is applied, a symbol is represented by allocating a small number of bits to a symbol with a high probability of occurrence and a large number of bits to a symbol with a low probability of occurrence, thereby reducing the size of the bit stream for encoding the target symbol. Therefore, by entropy coding, the compression performance of image coding can be improved. For entropy coding, the entropy coding unit 150 can use coding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC) and context-adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 can derive a binarization method of the target symbol and a probability model of the target symbol / binary bit, and then perform arithmetic coding by using the derived binarization method or the derived probability model.
[0104] To encode the transform coefficient levels, the entropy encoding unit 150 may convert the coefficients in the two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method. For example, by scanning the coefficients of the block using an upper right scan, the two-dimensional coefficients can be converted into a one-dimensional vector. 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 and horizontal scanning for scanning the coefficients in the two-dimensional block form along the row direction may be used instead of using an upper right scan. That is, depending on the size of the transform unit and the intra-frame prediction mode, it is determined which scanning method to use, among upper right scanning, vertical scanning, and horizontal scanning.
[0105] The coding parameters may include information such as syntax elements that are encoded by the encoder and sent to the decoder, and may include information that can be derived in the encoding or decoding process. The coding parameters may mean information necessary to encode or decode an image. For example, the coding parameters may include at least one value or combination of the following items: block size, block depth, block partition information, unit size, unit depth, unit partition information, partition flag in quadtree form, partition flag in binary tree form, partition direction in binary tree form, intra prediction mode, intra prediction direction, reference sample filtering method, prediction block boundary filtering method, filter taps, filter coefficients, inter prediction mode, motion information, motion vector, reference picture index, inter prediction direction, inter prediction indicator, reference picture list, motion vector predictor, motion vector candidate list, information on whether motion merge mode is used, motion merge candidate, motion merge candidate list, information on whether skip mode is used, interpolation filter type type, motion vector size, accuracy of motion vector representation, transform type, transform size, information on whether an additional (secondary) transform is used, information on whether a residual signal exists, coding block pattern, coding block flag, quantization parameter, quantization matrix, filter information within the loop, information on whether the filter is applied within the loop, filter coefficients within the loop, binarization / debinarization method, context model, context binary bit, bypass binary bit, transform coefficient, transform coefficient level, transform coefficient level scanning method, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, picture type, bit depth, and information of luminance signal or chrominance signal.
[0106] The residual signal may refer to the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between the original signal and the predicted signal. The residual block may be a residual signal of a block unit.
[0107] When the encoding apparatus 100 performs encoding using inter-frame prediction, the encoded current picture can be used as a reference picture for another picture to be processed later. Therefore, the encoding apparatus 100 can decode the encoded current picture and store the decoded picture as a reference picture. To perform decoding, inverse quantization and inverse transformation can be performed on the encoded current picture.
[0108] The quantized coefficients may be dequantized by the dequantization unit 160 and inversely transformed by the inverse transform unit 170. The dequantized and inversely transformed coefficients may be added to the prediction block by the adder 175, thereby generating a reconstructed block.
[0109] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. The filter unit 180 may be referred to as a loop filter.
[0110] A deblocking filter removes block distortion that occurs at the boundaries between blocks. To determine whether the deblocking filter is applied to the current block, the determination can be made based on the pixels in a number of rows or columns included in the block. When the deblocking filter is applied to a block, a strong or weak filter can be applied depending on the desired deblocking filter strength. Furthermore, when applying the deblocking filter, horizontal and vertical filtering can be processed in parallel.
[0111] Sample adaptive offset adds an optimal offset value to pixel values to compensate for coding errors. Sample adaptive offset corrects the offset between the deblocking filtered image and the original picture for each pixel. To perform offset correction on a specific picture, a method that considers edge information for each pixel can be used to apply the offset, or a method that partitions the image pixels into a predetermined number of regions, determines the regions where offset correction will be performed, and applies offset correction to the determined regions can be used.
[0112] The adaptive loop filter can perform filtering based on a value obtained by comparing the reconstructed picture with the original picture. The pixels of the image can be partitioned into predetermined groups, a filter applied to each group is determined, and different filtering can be performed in each group. Information about whether the adaptive loop filter is applied to the luminance signal can be sent for each coding unit (CU). The shape and filter coefficients of the adaptive loop filter applied to each block can vary. In addition, an adaptive loop filter with the same form (fixed form) can be applied without considering the characteristics of the target block.
[0113] The reconstructed block passing through the filter unit 180 may be stored in the reference picture buffer 190 .
[0114] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0115] The decoding device 200 may be a video decoding device or an image decoding device.
[0116] Reference Figure 2 , the decoding apparatus 200 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .
[0117] The decoding apparatus 200 may receive the bitstream output from the encoding apparatus 100. The decoding apparatus 200 may decode the bitstream in an intra mode or an inter mode. In addition, the decoding apparatus 100 may generate a reconstructed picture by performing decoding and may output the reconstructed picture.
[0118] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. When the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.
[0119] The decoding device 200 may obtain a reconstructed residual block from the input bitstream and may generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 may generate a reconstructed block as a decoding target block by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.
[0120] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream according to the probability distribution. The generated symbols may include symbols with quantized transform coefficient levels. Here, the entropy decoding method may be similar to the entropy encoding method described above. For example, the entropy decoding method may be the inverse process of the entropy encoding method described above.
[0121] To decode the transform coefficient levels, the entropy decoding unit 210 may perform transform coefficient scanning, thereby converting the coefficients in the one-dimensional vector form into a two-dimensional block form. For example, by scanning the coefficients of the block using an upper right scan, the coefficients in the one-dimensional vector form may be converted into a two-dimensional block form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning and horizontal scanning may be used instead of using an upper right scan. That is, depending on the size of the transform unit and the intra-frame prediction mode, it may be determined which scanning method is used among the upper right scan, the vertical scan, and the horizontal scan.
[0122] The quantized transform coefficient levels may be dequantized by the dequantization unit 220 and inversely transformed by the inverse transform unit 230. The quantized transform coefficient levels are dequantized and inversely transformed to generate a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized transform coefficient levels.
[0123] When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of a previously decoded block adjacent to a decoding target block.
[0124] When inter-frame mode is used, the motion compensation unit 250 generates a prediction block by performing motion compensation, where motion compensation uses both the reference picture stored in the reference picture buffer 270 and the motion vector. When the value of the motion vector is not an integer, the motion compensation unit 250 generates the prediction block by applying an interpolation filter to a partial area in the reference picture. To perform motion compensation, based on the coding unit, a motion compensation method for the prediction unit in the coding unit may be determined to be one of skip mode, merge mode, AMVP mode, and current picture reference mode. Furthermore, motion compensation may be performed according to the selected mode. Here, current picture reference mode may refer to a prediction mode that uses a previously reconstructed region within the current picture containing the decoding target block. The previously reconstructed region may not be adjacent to the decoding target block. To indicate the previously reconstructed region, a fixed vector may be used for the current picture reference mode. Furthermore, a flag or index indicating whether the decoding target block is a block decoded in the current picture reference mode may be signaled and derived using the reference picture index of the decoding target block. The current picture for the current picture reference mode may be located at a fixed position (e.g., at a position with a reference picture index of 0 or at the last position) within the reference picture list for the decoding target block. Furthermore, the current picture may be variably located within the reference picture list, and for this purpose, a reference picture index indicating the position of the current picture may be signaled.
[0125] The reconstructed residual block may be added to the prediction block by the adder 255. The block generated by adding the reconstructed residual block and the prediction block may pass through the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or reconstructed picture. The filter unit 260 may output the reconstructed picture. The reconstructed picture may be stored in the reference picture buffer 270 and may be used for inter-frame prediction.
[0126] Figure 3 is a diagram schematically showing a partition structure of an image when encoding and decoding the image. Figure 3 An embodiment of partitioning a unit into multiple subunits is schematically shown.
[0127] To efficiently partition an image, coding units (CUs) can be used in encoding and decoding. Here, a coding unit may refer to a unit for encoding. A unit may be a combination of 1) a syntax element and 2) a block including image samples. For example, "partitioning a unit" may mean "partitioning blocks associated with a unit." Block partition information may include information about the depth of the unit. The depth information may indicate the number of times a unit is partitioned, the degree to which the unit is partitioned, or both.
[0128] Reference Figure 3 , the image 300 is sequentially partitioned for each largest coding unit (LCU), and the partition structure is determined for each LCU. Here, LCU and coding tree unit (CTU) have the same meaning. A unit may have depth information based on a tree structure and may be partitioned hierarchically. Each partitioned sub-unit may have depth information. The depth information indicates the number of times a unit is partitioned or the degree to which the unit is partitioned, or both, and therefore, the depth information may include information about the size of the sub-unit.
[0129] The partition structure may refer to the distribution of coding units (CUs) in the LCU 310. A CU may be a unit for efficiently encoding an image. The distribution may be determined based on whether a CU is to be partitioned multiple times (a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc.). The width and height dimensions of the partitioned CU may be half the width and half the height of the original CU, respectively. Alternatively, the width and height dimensions of the partitioned CU may be smaller than the width and height dimensions of the original CU, respectively, depending on the number of partitions. The partitioned CU may be recursively partitioned into multiple further partitioned CUs, wherein, according to the same partitioning method, the further partitioned CUs have width and height dimensions that are smaller than the width and height dimensions of the partitioned CU.
[0130] Here, partitioning of the CU may be recursively performed up to a predetermined depth. Depth information may be information indicating the size of the CU and may be stored in each CU. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predetermined maximum depth. Here, the LCU may be a coding unit having the maximum size as described above, and the SCU may be a coding unit having the minimum size.
[0131] Whenever the LCU 310 begins to be partitioned and the width and height dimensions of the CU are reduced by the partitioning operation, the depth of the CU increases by 1. In the case of a CU that cannot be partitioned, the CU may have a size of 2N×2N for each depth. In the case of a CU that can be partitioned, a CU having a size of 2N×2N may be partitioned into multiple CUs of N×N size. Whenever the depth increases by 1, the size of N is halved.
[0132] For example, when one coding unit is partitioned into four sub-coding units, the width and height of one of the four sub-coding units may be half the width and half the height of the original coding unit, respectively. For example, when a 32×32 sized coding unit is partitioned into four sub-coding units, each of the four sub-coding units may have a size of 16×16. When one coding unit is partitioned into four sub-coding units, the coding unit may be partitioned in a quadtree form.
[0133] For example, when one coding unit is partitioned into two sub-coding units, the width size or height size of one of the two sub-coding units may be half the width size or half the height size of the original coding unit, respectively. For example, when a 32×32-sized coding unit is vertically partitioned into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a 32×32-sized coding unit is horizontally partitioned into two sub-coding units, each of the two sub-coding units may have a size of 32×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be partitioned in a binary tree form.
[0134] Reference Figure 3 , the size of an LCU with a minimum depth of 0 may be 64×64 pixels, and the size of an SCU with a maximum depth of 3 may be 8×8 pixels. Here, a CU (i.e., LCU) having 64×64 pixels may be represented by a depth of 0, a CU having 32×32 pixels may be represented by a depth of 1, a CU having 16×16 pixels may be represented by a depth of 2, and a CU (i.e., SCU) having 8×8 pixels may be represented by a depth of 3.
[0135] In addition, information about whether a CU is to be partitioned may be indicated by its partition information. The partition information may be 1-bit information. The partition information may be included in all CUs except the SCU. For example, when the partition information value is 0, the CU may not be partitioned, and when the partition information value is 1, the CU may be partitioned.
[0136] Figure 4 is a diagram illustrating a form of a prediction unit (PU) that can be included in a coding unit (CU).
[0137] A CU that is no longer partitioned among a plurality of CUs partitioned from an LCU may be partitioned into at least one prediction unit (PU). This process may also be referred to as partitioning.
[0138] A PU may be a basic unit for prediction. A PU may be encoded and decoded in any of skip mode, inter mode, and intra mode. A PU may be partitioned in various ways depending on the mode.
[0139] Also, a coding unit may not be partitioned into a plurality of prediction units, and the coding unit and the prediction unit may have the same size.
[0140] like Figure 4 As shown, in skip mode, the CU may not be partitioned. In skip mode, a 2N×2N mode 410 having the same size as a non-partitioned CU may be supported.
[0141] In inter mode, eight partition modes are supported in a CU. For example, in inter mode, 2N×2N mode 410, 2N×N mode 415, N×2N mode 420, N×N mode 425, 2N×nU mode 430, 2N×nD mode 435, nL×2N mode 440, and nR×2N mode 445 are supported. In intra mode, 2N×2N mode 410 and N×N mode 425 are supported.
[0142] A coding unit can be partitioned into one or more prediction units. A prediction unit can be partitioned into one or more sub-prediction units.
[0143] For example, when a prediction unit is partitioned into four sub-prediction units, the width and height of one of the four sub-prediction units may be half the width and half the height of the original prediction unit. For example, when a 32×32 prediction unit is partitioned into four sub-prediction units, each of the four sub-prediction units may have a size of 16×16. When a prediction unit is partitioned into four sub-prediction units, the prediction unit may be partitioned in a quadtree format.
[0144] For example, when a prediction unit is partitioned into two sub-prediction units, the width or height of one of the two sub-prediction units may be half the width or half the height of the original prediction unit. For example, when a 32×32 prediction unit is vertically partitioned into two sub-prediction units, each of the two sub-prediction units may have a size of 16×32. For example, when a 32×32 prediction unit is horizontally partitioned into two sub-prediction units, each of the two sub-prediction units may have a size of 32×16. When a prediction unit is partitioned into two sub-prediction units, the prediction unit may be partitioned in a binary tree format.
[0145] Figure 5 is a diagram illustrating a form of a transformation unit (TU) that may be included in a coding unit (CU).
[0146] A transform unit (TU) may be a basic unit for transform, quantization, inverse transform, and inverse quantization within a CU. A TU may have a square or rectangular shape, etc. A TU may be independently determined according to the size of the CU, the form of the CU, or both.
[0147] The CU that is no longer partitioned among the CUs partitioned from the LCU can be partitioned into at least one TU. Here, the partition structure of the TU can be a quadtree structure. For example, Figure 5 As shown, a CU 510 can be partitioned one or more times based on a quadtree structure. Partitioning a CU at least once may be referred to as recursive partitioning. Partitioning allows a CU 510 to be formed from TUs of various sizes. Alternatively, a CU can be partitioned into at least one TU based on the number of vertical lines that partition the CU, the number of horizontal lines that partition the CU, or both. A CU can be partitioned into TUs that are symmetrical to each other or into TUs that are asymmetrical to each other. To partition a CU into symmetrical TUs, information about the size / shape of the TUs may be signaled and derived from the information about the size / shape of the CU.
[0148] Also, a coding unit may not be partitioned into transformation units, and the coding unit and the transformation unit may have the same size.
[0149] One coding unit may be partitioned into at least one transformation unit, and one transformation unit may be partitioned into at least one sub-transformation unit.
[0150] For example, when a transformation unit is partitioned into four sub-transformation units, the width and height of one of the four sub-transformation units may be half the width and half the height of the original transformation unit, respectively. For example, when a 32×32 transformation unit is partitioned into four sub-transformation units, each of the four sub-transformation units may have a size of 16×16. When a transformation unit is partitioned into four sub-transformation units, the transformation unit may be partitioned in a quadtree form.
[0151] For example, when a transformation unit is partitioned into two sub-transformation units, the width size or height size of one of the two sub-transformation units may be half the width size or half the height size of the original transformation unit, respectively. For example, when a 32×32-sized transformation unit is vertically partitioned into two sub-transformation units, each of the two sub-transformation units may have a size of 16×32. For example, when a 32×32-sized transformation unit is horizontally partitioned into two sub-transformation units, each of the two sub-transformation units may have a size of 32×16. When a transformation unit is partitioned into two sub-transformation units, the transformation unit may be partitioned in a binary tree form.
[0152] When performing the transformation, the residual block may be transformed using at least one of the predetermined transformation methods. For example, the predetermined transformation method may include discrete cosine transform (DCT), discrete sine transform (DST), KLT, etc. Which transformation method is applied to transform the residual block may be determined by using at least one of the following items: inter-frame prediction mode information of the prediction unit, intra-frame prediction mode information of the prediction unit, and the size / shape of the transform block. Information indicating the transformation method may be sent using a signal.
[0153] Figure 6 is a diagram for explaining an embodiment of a process of intra prediction.
[0154] The intra prediction mode may be a non-directional mode or a directional mode. The non-directional mode may be a DC mode or a planar mode. The directional mode may be a prediction mode having a specific direction or angle, and the number of directional modes may be M, which is equal to or greater than 1. The directional mode may be indicated as at least one of a mode number, a mode value, and a mode angle.
[0155] The number of intra prediction modes may be N which is equal to or greater than 1, including non-directional modes and directional modes.
[0156] The number of intra prediction modes may vary depending on the block size. For example, when the block size is 4×4 or 8×8, the number of intra prediction modes may be 67, when the block size is 16×16, the number of intra prediction modes may be 35, when the block size is 32×32, the number of intra prediction modes may be 19, and when the block size is 64×64, the number of intra prediction modes may be 7.
[0157] The number of intra prediction modes may be fixed to N regardless of the size of the block. For example, the number of intra prediction modes may be fixed to at least one of 35 or 67 regardless of the size of the block.
[0158] The number of intra prediction modes may vary depending on the type of color component. For example, the number of prediction modes may vary depending on whether the color component is a luma signal or a chroma signal.
[0159] Intra-coding and / or decoding may be performed by using sample values or encoding parameters included in the reconstructed neighboring blocks.
[0160] In order to encode / decode a current block according to intra prediction, it is possible to identify whether samples included in a reconstructed neighboring block can be used as reference samples for an encoding / decoding target block. When there are samples that cannot be used as reference samples for the encoding / decoding target block, sample values are copied and / or interpolated to the samples that cannot be used as reference samples using at least one sample included in the reconstructed neighboring block, thereby enabling the samples that cannot be used as reference samples to be used as reference samples for the encoding / decoding target block.
[0161] In intra-frame prediction, a filter may be applied to at least one of a reference sample or a prediction sample based on at least one of an intra-frame prediction mode and the size of a coding / decoding target block. Here, the coding / decoding target block may refer to a current block and may refer to at least one of a coding block, a prediction block, and a transform block. The type of filter applied to the reference sample or the prediction sample may vary depending on at least one of the intra-frame prediction mode and the size / shape of the current block. The type of filter may vary depending on at least one of the number of filter taps, the value of the filter coefficient, or the filter strength.
[0162] In a non-directional planar mode among intra prediction modes, when a prediction block of an encoding / decoding target block is generated, a sample value in the prediction block may be generated according to a sample position by using a weighted sum of an upper reference sample of a current sample, a left reference sample of the current sample, an upper-right reference sample of the current block, and a lower-left reference sample of the current block.
[0163] In the non-directional DC mode among the intra prediction modes, when generating a prediction block for an encoding / decoding target block, the prediction block may be generated by averaging the upper reference sample of the current block and the left reference sample of the current block. In addition, filtering may be performed on one or more upper rows and one or more left columns adjacent to the reference sample in the encoding / decoding block using the reference sample values.
[0164] In the case of multiple directional modes (angle modes) among intra prediction modes, a prediction block can be generated by using the upper right reference sample and / or the lower left reference sample, and the multiple directional modes can have different directions. To generate the prediction sample value, interpolation of real units can be performed.
[0165] In order to perform the intra-frame prediction method, the intra-frame prediction mode of the current prediction block can be predicted from the intra-frame prediction mode of the neighboring prediction block adjacent to the current prediction block. In the case of predicting the intra-frame prediction mode of the current prediction block by using the mode information predicted from the neighboring intra-frame prediction mode, when the current prediction block and the neighboring prediction block have the same intra-frame prediction mode, the information that the current prediction block and the neighboring prediction block have the same intra-frame prediction mode can be transmitted by using predetermined flag information. When the intra-frame prediction mode of the current prediction block is different from the intra-frame prediction mode of the neighboring prediction block, the intra-frame prediction mode information of the encoding / decoding target block can be encoded by performing entropy coding.
[0166] Figure 7 is a diagram for explaining an embodiment of a process of inter-frame prediction.
[0167] Figure 7 The quadrilateral shown in may indicate an image (or picture). Figure 7 The arrows in the image may indicate the prediction direction. That is, an image may be encoded or decoded, or both encoded and decoded, according to the prediction direction. Depending on the encoding type, each image may be classified as an I-picture (intra-picture), a P-picture (unidirectionally predicted picture), a B-picture (bidirectionally predicted picture), etc. Each picture may be encoded and decoded according to its encoding type.
[0168] When the image targeted for encoding is an I-picture, the image itself can be intra-encoded without the need for inter-frame prediction. When the image targeted for encoding is a P-picture, the image can be encoded by performing inter-frame prediction or motion compensation using a reference picture only in the forward direction. When the image targeted for encoding is a B-picture, the image can be encoded by performing inter-frame prediction or motion compensation using a reference picture in both the forward and reverse directions. Alternatively, the image can be encoded by performing inter-frame prediction or motion compensation using a reference picture in one of the forward and reverse directions. Here, when the inter-frame prediction mode is used, the encoder can perform inter-frame prediction or motion compensation, and the decoder can perform motion compensation in response to the encoder. Images of P-pictures and B-pictures that are encoded or decoded, or that are encoded and decoded, by using reference pictures can be regarded as images for inter-frame prediction.
[0169] Hereinafter, inter prediction according to an embodiment will be described in detail.
[0170] Inter prediction or motion compensation can be performed by using both reference pictures and motion information. In addition, inter prediction can use the above-mentioned skip mode.
[0171] A reference picture may be at least one of a previous picture and a subsequent picture of the current picture. Here, inter-frame prediction may predict a block of the current picture based on a reference picture. Here, a reference picture may refer to an image used when predicting a block. Here, an area within a reference picture may be specified using a reference picture index (refIdx) indicating the reference picture, a motion vector, or the like.
[0172] Inter-frame prediction can select a reference picture and a reference block within the reference picture that is related to the current block. The selected reference block can be used to generate a prediction block for the current block. The current block can be a block in the current picture that is the current encoding target or the current decoding target.
[0173] Motion information can be derived from the inter-frame prediction process by the encoding device 100 and the decoding device 200. Furthermore, the derived motion information can be used when performing inter-frame prediction. Here, the encoding device 100 and the decoding device 200 can improve encoding efficiency, decoding efficiency, or both by using motion information of reconstructed neighboring blocks or motion information of co-located blocks (col blocks), or both. The col block may be a block within a previously reconstructed co-located picture (col picture) that is spatially related to the encoding / decoding target block. The reconstructed neighboring block may be a block within the current picture, as well as a block previously reconstructed through encoding or decoding, or both. Furthermore, the reconstructed block may be a block adjacent to the encoding / decoding target block, or a block located at an outer corner of the encoding / decoding target block, or both. Here, a block located at an outer corner of the encoding / decoding target block may be a block vertically adjacent to a neighboring block horizontally adjacent to the encoding / decoding target block. Alternatively, a block located at an outer corner of the encoding / decoding target block may be a block horizontally adjacent to a neighboring block vertically adjacent to the encoding / decoding target block.
[0174] The encoding device 100 and the decoding device 200 may each determine a block located at a spatially related position to the encoding / decoding target block within a COL picture, and may determine a predefined relative position based on the determined block. The predefined relative position may be an internal position, an external position, or both of the internal and external positions of the block located at a spatially related position to the encoding / decoding target block. Furthermore, the encoding device 100 and the decoding device 200 may each derive a COL block based on the determined predefined relative position. Here, the COL picture may be one of at least one reference picture included in a reference picture list.
[0175] The method of deriving motion information may vary depending on the prediction mode of the encoding / decoding target block. For example, the prediction mode applied to inter-frame prediction may include Advanced Motion Vector Prediction (AMVP), Merge Mode, etc. Here, Merge Mode may be referred to as Motion Merge Mode.
[0176] For example, when AMVP is applied as a prediction mode, the encoding device 100 and the decoding device 200 can generate motion vector candidate lists respectively by using the motion vector of the reconstructed neighboring block or the motion vector of the col block, or both. The motion vector of the reconstructed neighboring block or the motion vector of the col block, or both, can be used as motion vector candidates. Here, the motion vector of the col block can be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as a spatial motion vector candidate.
[0177] The encoding device 100 may generate a bitstream, which may include a motion vector candidate index. That is, the encoding device 100 may generate a bitstream by entropy encoding the motion vector candidate index. The motion vector candidate index may indicate the optimal motion vector candidate selected from the motion vector candidates included in the motion vector candidate list. The motion vector candidate index may be transmitted from the encoding device 100 to the decoding device 200 via the bitstream.
[0178] The decoding apparatus 200 may entropy-decode a motion vector candidate index from a bitstream, and may select a motion vector candidate of a decoding target block from among motion vector candidates included in a motion vector candidate list by using the entropy-decoded motion vector candidate index.
[0179] The encoding device 100 may calculate a motion vector difference (MVD) between the motion vector of the decoding target block and the motion vector candidate, and may entropy encode the MVD. The bitstream may include the entropy-encoded MVD. The MVD may be transmitted from the encoding device 100 to the decoding device 200 via the bitstream. Here, the decoding device 200 may entropy decode the MVD received from the bitstream. The decoding device 200 may derive the motion vector of the decoding target block by summing the decoded MVD and the motion vector candidate.
[0180] The bitstream may include a reference picture index indicating a reference picture, etc., and the reference picture index may be entropy-encoded and transmitted from the encoding device 100 to the decoding device 200 via the bitstream. The decoding device 200 may predict a motion vector of a decoding target block by using motion information of a neighboring block, and may derive a motion vector of the decoding target block by using the predicted motion vector and a motion vector difference. The decoding device 200 may generate a prediction block of the decoding target block based on the derived motion vector and the reference picture index information.
[0181] As another method of deriving motion information, merge mode is used. Merge mode may mean the merging of motions of multiple blocks. Merge mode may mean that the motion information of one block is applied to another block. When merge mode is applied, the encoding device 100 and the decoding device 200 may generate a merge candidate list respectively by using the motion information of the reconstructed adjacent block or the motion information of the col block or both. The motion information may include at least one of the following items: 1) motion vector, 2) reference picture index, and 3) inter-frame prediction indicator. The prediction indicator may indicate unidirectional (L0 prediction, L1 prediction) or bidirectional.
[0182] Here, the merge mode may be applied to each CU or each PU. When the merge mode is performed on each CU or each PU, the encoding device 100 may generate a bitstream by entropy decoding predefined information, and may send the bitstream to the decoding device 200. The bitstream may include the predefined information. The predefined information may include: 1) a merge flag as information indicating whether the merge mode is performed for each block partition, 2) a merge index as information indicating which block among the neighboring blocks adjacent to the encoding target block is merged. For example, the neighboring blocks adjacent to the encoding target block may include the left neighboring block of the encoding target block, the upper neighboring block of the encoding target block, the temporal neighboring block of the encoding target block, etc.
[0183] The merge candidate list may indicate a list storing motion information. In addition, the merge candidate list may be generated before executing the merge mode. The motion information stored in the merge candidate list may be at least one of the following motion information: motion information of a neighboring block adjacent to the encoding / decoding target block, motion information of a co-located block related to the encoding / decoding target block in a reference picture, motion information newly generated by pre-combining motion information existing in the merge motion candidate list, and a zero merge candidate. Here, the motion information of the neighboring block adjacent to the encoding / decoding target block may be referred to as a spatial merge candidate. The motion information of the co-located block related to the encoding / decoding target block in a reference picture may be referred to as a temporal merge candidate.
[0184] The skip mode may be a mode in which the mode information of the neighboring block itself is applied to the encoding / decoding target block. The skip mode may be one of the modes for inter-frame prediction. When the skip mode is used, the encoding device 100 may entropy encode information about which block's motion information is used as the motion information of the encoding target block, and may transmit the information to the decoding device 200 through the bitstream. The encoding device 100 may not transmit other information (e.g., syntax element information) to the decoding device 200. The syntax element information may include at least one of motion vector difference information, a coded block flag, and a transform coefficient level.
[0185] The residual signal generated after intra prediction or inter prediction can be transformed into the frequency domain through a transform process as part of the quantization process. Here, the first transform can use DCT type 2 (DCT-II) and various DCT and DST kernels. These transform kernels can perform separable transforms on the residual signal, performing 1D transforms in the horizontal and / or vertical directions, or can perform 2D non-separable transforms on the residual signal.
[0186] For example, in the case of 1D transformation, the DCT and DST types used in the transformation can use DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII as shown in the following table. For example, as shown in Tables 1 and 2, the DCT or DST type used in the transformation can be derived by forming a transform set.
[0187] [Table 1]
[0188] Transformation Set Transform 0 DST_VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V
[0189] [Table 2]
[0190] Transformation Set Transform 0 DST_VII, DCT-VIII, DST-I 1 DST-VII, DST-I, DCT-VIII 2 DST-VII, DCT-V, DST-I
[0191] For example, Figure 8 As shown, different transform sets are defined for the horizontal and vertical directions depending on the intra prediction mode. Subsequently, the encoder / decoder can perform a transform and / or inverse transform using the intra prediction mode of the current encoding / decoding target block and the transforms of the relevant transform set. In this case, entropy encoding / decoding is not performed on the transform set, and the encoder / decoder can define the transform set according to the same rules. In this case, entropy encoding / decoding can be performed to indicate which transform from the transform set is used. For example, when the block size is equal to or less than 64×64, three transform sets are formed according to the intra prediction mode as shown in Table 2, and three transforms are used for each horizontal transform and vertical transform, combining and performing a total of nine multi-transform methods. Subsequently, the residual signal is encoded / decoded using the optimal transform method, thereby improving coding efficiency. Here, truncated unary binarization can be used to perform entropy encoding / decoding of information regarding which transform method is used among the three transforms in a transform set. Here, entropy encoding / decoding can be performed on information indicating which transform from the transform set is used to perform at least one of the vertical and horizontal transforms.
[0192] After completing the above first transformation, Figure 9As shown in , the encoder may perform a secondary transform on the transformed coefficients to improve energy concentration. The secondary transform may perform a separable transform that performs a 1D transform in the horizontal and / or vertical direction, or may perform a 2D inseparable transform. The transform information used may be sent, or may be derived by the encoder / decoder based on current coding information and neighboring coding information. For example, as with a 1D transform, a transform set for the secondary transform may be defined. Entropy coding / decoding is not performed on the transform set, and the encoder / decoder may define the transform set according to the same rules. In this case, information indicating which transform among the transforms of the transform set is used may be sent, and the information may be applied to at least one residual signal by intra-frame prediction or inter-frame prediction.
[0193] At least one of the number or type of transform candidates is different for each transform set. At least one of the number or type of transform candidates may be determined differently based on at least one of the following: the position, size, partition type, and prediction mode (intra / inter mode) of a block (CU, PU, TU, etc.), or the direction / non-direction of the intra prediction mode.
[0194] The decoder may perform the secondary inverse transform depending on whether the secondary inverse transform is performed, and may perform the first inverse transform depending on whether the first inverse transform is performed from a result of the secondary inverse transform.
[0195] The above-mentioned primary transform and secondary transform can be applied to at least one signal component of the luminance / chrominance components, or can be applied according to the size / shape of any coding block. Entropy encoding / decoding can be performed on an index indicating whether the primary transform / secondary transform is used and the primary transform / secondary transform used in any coding block. Alternatively, the index can be derived by default by the encoder / decoder based on at least one current / neighboring coding information.
[0196] The residual signal generated after intra prediction or inter prediction is quantized after the first transform and / or the second transform, and the quantized transform coefficients are entropy coded. Figure 10 As shown in , the quantized transform coefficients may be scanned in diagonal, vertical, and horizontal directions based on at least one of an intra prediction mode or a size / shape of a minimum block.
[0197] In addition, the quantized transform coefficients subjected to entropy decoding may be arranged in a block form by being inversely scanned, and at least one of inverse quantization or inverse transformation may be performed on the relevant block. Here, as the inverse scanning method, at least one of diagonal scanning, horizontal scanning, and vertical scanning may be performed.
[0198] For example, when the size of the current coding block is 8×8, the residual signal for the 8×8 block may be subjected to a first transform, a second transform, and quantization. Figure 10 At least one of the three scanning order methods shown in the above is used to scan and entropy encode the quantized transform coefficients for each of the four 4×4 sub-blocks. Furthermore, the quantized transform coefficients may be inversely scanned by performing entropy decoding. The inversely scanned quantized transform coefficients are inversely quantized to become transform coefficients, and at least one of a secondary inverse transform and a primary inverse transform is performed, thereby generating a reconstructed residual signal.
[0199] In the video coding process, a block can be Figure 11 The block is partitioned as shown, and an indicator corresponding to the partition information may be sent using a signal. Here, the partition information may be at least one of the following items: a partition flag (split_flag), a quad / binary tree flag (QB_flag), a quadtree partition flag (quadtree_flag), a binary tree partition flag (binarytree_flag), and a binary tree partition type flag (Btype_flag). Here, split_flag is a flag indicating whether the block is partitioned, QB_flag is a flag indicating whether the block is partitioned in a quadtree form or a binary tree form, quadtree_flag is a flag indicating whether the block is partitioned in a quadtree form, binarytree_flag is a flag indicating whether the block is partitioned in a binary tree form, and Btype_flag is a flag indicating whether the block is partitioned vertically or horizontally in the case of binary tree partitioning.
[0200] When the partition flag is 1, it may indicate that partitioning is being performed, and when the partition flag is 0, it may indicate that partitioning is not being performed. In the case of the quad / binary tree flag, 0 may indicate quadtree partitioning, and 1 may indicate binary tree partitioning. Alternatively, 0 may indicate binary tree partitioning, and 1 may indicate quadtree partitioning. In the case of the binary tree partition type flag, 0 may indicate horizontal partitioning, and 1 may indicate vertical partitioning. Alternatively, 0 may indicate vertical partitioning, and 1 may indicate horizontal partitioning.
[0201] For example, it can be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag as shown in Table 3. Figure 11 Partition information.
[0202] [Table 3]
[0203]
[0204] For example, it can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag as shown in Table 4. Figure 11 Partition information.
[0205] [Table 4]
[0206]
[0207] The partitioning method may be performed only in a quadtree form or only in a binary tree form according to the size / shape of the block. In this case, split_flag may mean a flag indicating whether partitioning is performed in a quadtree form or a binary tree form. The size / shape of the block may be derived from the depth information of the block, and the depth information may be signaled.
[0208] When the size of the block is within a predetermined range, partitioning can be performed only in the form of a quadtree. Here, the predetermined range can be defined as at least one of the size of the largest block or the size of the smallest block that can be partitioned only in the form of a quadtree. Information indicating the size of the largest block / minimum block for partitioning in the form of a quadtree can be signaled via a bitstream, and the information can be signaled in units of at least one of a sequence, a picture parameter, or a slice (segment). Alternatively, the size of the largest block / minimum block can be a fixed size preset in the encoder / decoder. For example, when the size of the block ranges from 256×256 to 64×64, partitioning can be performed only in the form of a quadtree. In this case, split_flag can be a flag indicating whether partitioning is performed in the form of a quadtree.
[0209] When the size of the block is within a predetermined range, partitioning can be performed only in the form of a binary tree. Here, the predetermined range can be defined as at least one of the size of the largest block or the size of the smallest block that can only be partitioned in the form of a binary tree. Information indicating the size of the largest block / minimum block for partitioning in the form of a binary tree can be signaled via a bitstream, and the information can be signaled in units of at least one of a sequence, a picture parameter, or a slice (segment). Alternatively, the size of the largest block / minimum block can be a fixed size preset in the encoder / decoder. For example, when the size of the block ranges from 16×16 to 8×8, partitioning can be performed only in the form of a binary tree. In this case, split_flag can be a flag indicating whether partitioning is performed in the form of a binary tree.
[0210] After partitioning a block in a binary tree form, when the partitioned block is further partitioned, the partitioning may be performed only in a binary tree form.
[0211] When the width size or the length size of the partitioned block cannot be further partitioned, at least one indicator may not be signaled.
[0212] In addition to the quadtree-based binary tree partitioning, quadtree-based partitioning may be performed after the binary tree partitioning.
[0213] When a block is partitioned based on a quadtree form, a binary tree form, or both, a block corresponding to a leaf node of the final partition of the block can be set as a single encoding / decoding unit. In other words, when a block of any size or any form is no longer partitioned, encoding / decoding can be performed on the corresponding block. In one embodiment, encoding / decoding processes such as prediction (e.g., inter-frame prediction or intra-frame prediction), transform, etc. can be performed on a block of any size or any form corresponding to a binary leaf node generated by quadtree partitioning, binary tree partitioning, or both quadtree partitioning and binary tree partitioning.
[0214] Figure 12 : is a diagram showing an example of an encoding / decoding unit according to a partitioning form of a block. Figure 12 In the example shown in FIG, solid lines are used to distinguish blocks generated by quadtree partitioning, and dotted lines are used to distinguish blocks generated by binary tree partitioning. When it is assumed that the structure of the coding block is determined to be Figure 12 In the example shown in , the nodes finally partitioned by the solid line and the dotted line can be defined as binary leaf nodes. Encoding / decoding (e.g., intra-frame prediction or inter-frame prediction, primary transform, secondary transform, quantization, entropy encoding / decoding, etc.) can be performed on the blocks corresponding to the binary leaf nodes according to the block size or block form corresponding to the corresponding leaf nodes without additional partitioning according to the prediction sub-blocks or the transform sub-blocks.
[0215] For convenience of explanation, in an embodiment to be described later, a partition form of blocks based on a quadtree form or a binary tree form or both is defined as a block structure.
[0216] During encoding / decoding, the block structure of each color component may be the same, or the block structure of each color component may be different. In one embodiment, depending on arbitrary encoding parameter conditions, the block structure may be the same for the luma component and the chroma component, or different for the luma component and the chroma component. Here, the block structure being the same for the luma component and the chroma component may mean that the block structure information determined for the luma component is inherited to the chroma component, or vice versa. For example, depending on the type of the currently encoded / decoded picture or slice, the luma signal and the chroma signal may have the same block structure or different block structures within an intra-picture or an intra-slice. Here, whether the block structure of the luma component and the chroma component constituting an intra-picture or an intra-slice is set to be the same or different can be determined by an encoding process that derives a rate-distortion cost function based on each block structure and selects the block structure that minimizes the cost function.
[0217] The encoding device may entropy encode information indicating whether the same block structure is used for each color component and transmit the information to the decoding device. Here, the information may be encoded according to at least one of a sequence level (e.g., sequence parameter set (SPS)), a picture level (e.g., picture parameter set (PPS)), a slice header, a maximum coding unit (LCT or CTU), and a coding unit (or coding block).
[0218] For example, encoding parameter information indicating whether a block structure of each color component is the same for an intra picture, an intra slice, an inter picture, or an inter slice may be transmitted through an SPS or a PPS.
[0219] Furthermore, encoding parameter information indicating whether a block structure of each color component is the same within an intra slice or an inter slice may be transmitted through a slice header.
[0220] Also, encoding parameter information indicating whether a block structure of each color component is the same for a maximum coding unit or coding units may be transmitted in units of a maximum coding unit or coding units.
[0221] When a target block for encoding / decoding satisfies a predetermined condition, block partitioning of the target block may not be permitted. Therefore, encoding / decoding of block partition information for blocks that meet the predetermined condition may be omitted. Here, the predetermined condition may relate to at least one of block size, block form, and block partition depth, and may indicate whether or not quadtree, binary, or both forms of partitioning are permitted. The block size or form may be a base value indicating whether or not quadtree, binary, or both forms of partitioning are permitted. The block depth may indicate a threshold for the block depth that allows or disallows quadtree, binary, or both forms of partitioning. The block depth may be a factor that increments by 1 depending on whether quadtree, binary, or both forms of partitioning are performed.
[0222] The block partition information may include at least one of information indicating whether block partitioning is performed (e.g., split_flag), information indicating whether quadtree partitioning is performed (e.g., Quadtree_flag or QB_flag), information indicating whether binary tree partitioning is performed (e.g., Binarytree_flag or QB_flag), and information indicating a binary tree partition type (e.g., Btype_flag).
[0223] For example, if a predetermined condition indicates that the block size is equal to or smaller than a base value and binary tree partitioning is not permitted for a block that satisfies the predetermined condition, encoding / decoding of at least one of information related to binary tree partitioning (e.g., a quad / binary tree form flag (QB_flag), a binary tree partition flag (binaraytree_flag), and a binary tree partition type flag (Btype_flag)) may be omitted for a block having a block size equal to or smaller than the base value. When encoding of the quad / binary tree form flag (QB_flag) is omitted, a partition flag (split_flag) may be used to indicate whether quadtree partitioning is performed on the block.
[0224] Without being limited to the above example, it may be possible to set whether or not quadtree partitioning is permitted for blocks that meet predetermined conditions. Here, for blocks that meet the predetermined conditions, encoding / decoding of at least one of information related to quadtree partitioning (e.g., a quad / binary tree format flag (QB_flag) or a quadtree partition flag (quadtree_flag)) may be omitted. When encoding / decoding of the quad / binary tree format flag (QB_flag) may be omitted, a partition flag (split_flag) may be used to indicate whether binary tree partitioning is performed on the block.
[0225] In another embodiment, it may be set to allow arbitrary forms of partitioning to be performed on blocks that meet predetermined conditions. Here, for blocks that meet the predetermined conditions, any piece of partition information may not be encoded / decoded.
[0226] Referring to the accompanying drawings, a process of determining whether to omit encoding / decoding of partition information will be described in detail.
[0227] Figure 13 1 is a flowchart illustrating a process of determining whether to decode information related to binary tree partitioning. For convenience of explanation, in this embodiment, it is assumed that binary tree partitioning is not allowed for blocks that meet predetermined conditions.
[0228] First, in step S1301, information related to a predetermined condition may be obtained. Here, the information related to the predetermined condition may include at least one of a block size, a block form, and a partition depth. The predetermined condition may be set based on the information of the predetermined condition as whether the block size is equal to or greater than a threshold, whether the block size is equal to or less than a threshold, whether the block form is a preset form, whether the block depth is equal to or greater than a threshold, or whether the block depth is equal to or less than a threshold.
[0229] Information related to the predetermined condition may be predefined in the encoder and decoder. Here, the information related to the predetermined condition may represent at least one of the block size, block form, and block depth that define the predetermined condition. In one embodiment, the block size / form or partition depth for which encoding / decoding of partition information is omitted may have a fixed value predefined in the encoder and decoder. Alternatively, the information related to the predetermined condition may be determined differently using encoding parameters that represent the size / form of the encoding / decoding target block or the partition depth of the block.
[0230] In another embodiment, the information related to the predetermined condition may be encoded / decoded according to the sequence level, picture level, slice header, or predetermined coding region unit. Here, the predetermined coding region may have a size / form smaller than the current encoding / decoding picture or slice, and may include a maximum coding unit (LCU or CTU) or a block of any size or form included in the maximum coding unit (for example, a block generated by performing quadtree partitioning on the maximum coding unit). The information related to the predetermined condition may be expressed as a maximum size of a block or a minimum size of a block, or both, or may be expressed as a maximum depth of a block or a minimum depth of a block, or both.
[0231] The encoder can determine the block structure by comparing the rate-distortion of the results obtained by encoding based on the quadtree form and the binary tree form, and the rate-distortion of the result obtained by encoding based on the quadtree form. The encoder can encode information related to the predetermined condition by considering the size, form, or depth of the block for which binary tree partitioning is no longer performed based on the determined block structure. In addition, the decoder can decode the information related to the predetermined condition from the bitstream that does not allow binary tree partitioning, and determine whether the current block meets the predetermined condition based on the decoded information.
[0232] In step S1302, the decoder may determine whether the current block satisfies a predetermined condition. As a result, when the current block satisfies the predetermined condition, decoding of information related to the binary tree partition of the current block may be omitted.
[0233] Alternatively, when the current block does not meet the predetermined condition, in step S1303, information related to binary tree partitioning of the current block may be decoded depending on whether quadtree partitioning is performed on the current block. For example, when quadtree partitioning is not performed on the current block, information related to binary tree partitioning of the current block may be decoded.
[0234] In other words, whether to encode / decode block partition information of the current block may be determined by comparing whether the size, form, or depth of the current block corresponds to that of a block according to a predetermined condition.
[0235] In another embodiment, according to an embodiment of the present invention, information indicating whether block partitioning is allowed for a block of any size, any form, or any depth may be encoded / decoded. Here, the information indicating whether block partitioning is allowed may include information indicating whether quadtree partitioning exists (e.g., NoPresent_Quadtree_flag) or information indicating whether binary tree partitioning exists (e.g., NoPresent_Binarytree_flag).
[0236] When it is indicated that block partitioning of a block having an arbitrary size, an arbitrary form, or an arbitrary depth is not permitted, block partitioning of lower-level blocks other than the corresponding block may not be permitted. Here, the lower-level blocks may include at least one of a block having a smaller block size than the corresponding block, a block having the same block form as the corresponding block, a block having a greater partition depth than the corresponding block, and a lower-level node block of the corresponding block.
[0237] In one embodiment, when information indicating whether binary tree partitioning exists for a block having an arbitrary size / form is transmitted by a signal, and the information indicates that binary tree partitioning does not exist, encoding / decoding of information related to binary tree partitioning (e.g., information indicating whether binary tree partitioning is performed (e.g., at least one of a quad / binary tree flag (QB_flag), a binary tree partition flag (binaraytree_flag), and a binary tree partition type flag (Btype_flag)) may be omitted for blocks having a size / form smaller than the block, except for the block.
[0238] Without being limited to the above example, information indicating whether quadtree partitioning of blocks having arbitrary sizes / forms exists and whether a binary tree partition type flag exists may be signaled.
[0239] Information indicating whether block partitioning is allowed may be transmitted according to a predetermined coding region. Here, the predetermined coding region may have a size / form smaller than the current encoding / decoding picture or slice, and may include blocks of any size or form included in a maximum coding unit (LCU or CTU) or a coding unit (e.g., a block generated by performing quadtree partitioning on the maximum coding unit). The encoder may determine a block structure by comparing the rate-distortion of the results obtained by encoding blocks of any size / form based on the quadtree form and the binary tree form, and the rate-distortion of the result obtained by encoding based on the quadtree form, and determine whether to encode information indicating that binary tree partitioning is allowed based on the determined block structure.
[0240] Information indicating whether binary tree partitioning is allowed can be encoded / decoded per layer. In one embodiment, when the information of the higher layer block sent with the signal indicates that block partitioning is allowed, information indicating whether block partitioning is allowed for the lower layer block generated by partitioning the higher layer block can be encoded / decoded.
[0241] In another embodiment, information on the size, form, or depth of a block (in which information indicating whether block partitioning is performed is signaled) may be encoded / decoded at a higher level. In one embodiment, information on the size, form, or depth of a block may be transmitted at least one of a sequence level, a picture level, and a slice header. Here, information indicating whether block partitioning is permitted may be signaled for a block corresponding to the size, form, or depth of a block signaled at a higher level, or for a higher-layer block in the higher level.
[0242] Figure 14 2 is a flowchart illustrating a process of determining whether to decode information related to a binary tree partition. For convenience of explanation, in this embodiment, it is assumed that information indicating whether a binary tree partition is allowed only for a current block is signaled.
[0243] First, in step S1401, information indicating whether binary tree partitioning is to be performed may be decoded.
[0244] In step S1402, when the information indicates that binary tree partitioning is not allowed, decoding of binary tree partition information of the current block may be omitted. In addition, binary tree partition information for a lower layer block generated by quadtree partitioning the current block may not be decoded.
[0245] Meanwhile, in step S1402, when the information indicates that binary tree partitioning is permitted, in step S1403, information related to binary tree partitioning may be decoded based on whether quadtree partitioning is performed on the current block. For example, when quadtree partitioning is not performed on the current block, information related to binary tree partitioning for the current block may be decoded. Furthermore, for a lower layer block generated by performing quadtree partitioning or binary tree partitioning on the current block, information related to binary tree partitioning may be decoded based on whether quadtree partitioning is performed on the lower layer block.
[0246] Figures 15 to 17 is a diagram illustrating an example of a case where binary tree partitioning is no longer performed on blocks having a predetermined size or smaller.
[0247] As Figure 15 In the example shown in , it is assumed that the size / form of the maximum coding unit is 128×128, binary tree partitioning is not performed, and only quadtree partitioning exists in the maximum coding unit through rate-distortion optimization performed by the encoding device.
[0248] like Figure 16 As shown in the example shown in , when information indicating that binary tree partitioning is not performed on a predetermined size block is not encoded / decoded, information indicating whether binary tree partitioning is performed on a block for which quadtree partitioning is no longer performed may be encoded / decoded.
[0249] However, if Figure 17 As shown in the example shown in , when information indicating that binary tree partitioning is performed on blocks having a size of 128×128 or less is encoded / decoded, information indicating whether binary tree partitioning is performed on blocks having a size of 128×128 or less may not be encoded / decoded. Therefore, the amount of information to be encoded is reduced, thereby improving encoding / decoding efficiency.
[0250] As above Figure 13 As described above, the encoder may encode information on the size (for example, information indicating 128×128), form, or depth of a block for which binary tree partitioning is not allowed, and transmit the encoded information to the decoding device. The decoding device may decode the information on the block size for which binary tree partitioning is not performed from the bitstream, and no longer decode information related to binary tree partitioning of a block having a block size equal to or smaller than the size indicated by the decoded information.
[0251] In another embodiment, as mentioned above Figure 14 As described above, the encoding device may encode information indicating that binary tree partitioning is not allowed for a block of any size (the block does not perform binary tree partitioning), and transmit the encoded information to the decoding device. Here, the information may be a 1-bit flag (e.g., NoPresent_BinaryTree_flag), but is not limited thereto. Figure 17 In the example shown in , for example, NoPresent_BinaryTree_flag for a block having a size of 128×128 is signaled.
[0252] exist Figure 16 and Figure 17 In the example, when the quadtree form or the binary tree partitioning is performed, the flag value is set to 1, and otherwise, the flag value is set to 0. However, the opposite setting is also possible.
[0253] Embodiments related to not allowing block partitioning can be applied to luminance components and chrominance components. Here, information indicating that block partitioning is not allowed (for example, information indicating the size, form or depth of the block for which block partitioning is not allowed, or information indicating whether block partitioning is allowed) can be universally applied to luminance components and chrominance components, or can be transmitted with signals independently for luminance components and chrominance components. When information is entropy encoded / decoded, any one of a truncated Rice binarization method, a K-order exponential Golomb binarization method, a restricted K-order exponential Golomb binarization method, a fixed-length binarization method, a unary binarization method and a truncated unary binarization method can be used as an entropy coding method. In addition, after the information is binarized, the information is finally encoded / decoded by using CABAC (ae(v)).
[0254] Next, transformation and scanning of the residual signal of the current block will be described.
[0255] When encoding / decoding the residual signal of the current block, at least one piece of encoding information of the residual signal of the current block can be implicitly derived in the encoder / decoder from the encoding information of the residual signal of the encoding / decoding block adjacent to the current block. Here, the encoding information of the residual signal may include information related to the transform scheme of the residual signal (e.g., the transform scheme used for the first transform and the second transform) and information used to scan the quantized transform coefficients. Here, the quantized transform coefficients may indicate that the transform (e.g., the first transform and the second transform) and quantization are performed on the residual signal generated after intra-frame prediction.
[0256] In detail, when the current block is encoded by intra-frame prediction, encoding information of the current block may be derived from neighboring blocks adjacent to the current block based on the intra-frame prediction mode of the current block. Alternatively, when the current block is encoded by inter-frame prediction, encoding information of the current block may be derived from neighboring blocks adjacent to the current block based on motion information of the current block. Figure 18 and Figure 19 , a process of deriving encoding information of a residual signal of a current block from neighboring blocks when the current block is encoded by intra prediction and when the current block is encoded by inter prediction will be described in detail.
[0257] Figure 18 is a flowchart illustrating a process of determining whether to derive encoding information of a residual signal of a current block from a neighboring block when the current block is encoded through intra prediction.
[0258] First, in step S1801, it may be determined whether there is a neighboring block encoded in the same intra-frame prediction mode as the intra-frame prediction mode of the current block. Here, the neighboring block of the current block may be included in the same picture as the current block (in other words, the current picture) and represents a block encoded / decoded before the current block. In one embodiment, the neighboring block may include a block adjacent to the current block among the blocks encoded / decoded before the current block. Here, the block adjacent to the current block may include at least one of a block adjacent to a boundary (e.g., a left boundary or an upper boundary) of the current block and a block adjacent to a corner (e.g., an upper left corner, an upper right corner, or a lower left corner) of the current block.
[0259] When there is a neighboring block encoded in the same intra prediction mode as the current block, in step S1802, encoding information of a residual signal of the corresponding neighboring block may be derived as encoding information of the current block. Specifically, at least one of primary transform, secondary transform, and scanning information of the current block may be derived from the neighboring block having the same intra prediction mode as the current block.
[0260] In one embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of a neighboring block of the current block and the corresponding neighboring block skips the first transform (transform skip), the residual signal of the current coding block may also skip the first transform. When the first transform of the current block is skipped, the secondary transform of the current block may also be skipped.
[0261] Alternatively, when the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block of the current block, the first transform for the horizontal and vertical directions of the current block can be set to be the same as the first transform applied to the neighboring block having the same intra prediction mode as the intra prediction mode of the current block. Therefore, encoding / decoding of encoding information required for the first transform of the residual signal of the current block (for example, transform information (or transform index) used when performing the first transform for the horizontal and vertical directions) can be omitted.
[0262] For example, when the intra prediction mode of the current block is determined to be number 23 (mode 23), and the intra prediction mode of at least one neighboring block adjacent to the current block is determined to be number 23 (mode 23), the first transform applied to the residual signal of the neighboring block having the intra prediction mode number 23 may be used as the first transform for the residual signal of the current block. For example, when the first transform in the horizontal direction for the residual signal of the neighboring block having the same intra prediction mode as the intra prediction mode of the current block is performed by DCT-V, and the first transform in the vertical direction for the residual signal is performed by DST-VII, the first transform in the horizontal direction for the residual signal of the current block is performed by using DCT-V, and the first transform in the vertical direction is performed by using DST-VII.
[0263] In another embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block of the current block, the secondary transform of the current block may be set to be the same as the secondary transform applied to the neighboring block having the same intra prediction mode as the intra prediction mode of the current block. Therefore, encoding / decoding of encoding information (e.g., transform information (or transform index) of the secondary transform) required to perform the secondary transform on the residual signal of the current block can be omitted.
[0264] For example, when the intra-frame prediction mode of the current block is determined to be number 35 (mode 35), and the intra-frame prediction mode of at least one neighboring block adjacent to the current block is also determined to be number 35 (mode 35), the secondary transform applied to the residual signal of the neighboring block having the intra-frame prediction mode number 35 may be used as the secondary transform for the residual signal of the current block.
[0265] In another embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of a neighboring block of the current block, the scanning order of the current block may be set to be the same as the scanning order of the neighboring blocks having the same intra prediction mode as the intra prediction mode of the current block. Therefore, encoding / decoding of encoding information (e.g., a scanning index (scanning order index) of at least one of a diagonal direction, a horizontal direction, and a vertical direction (indicating a scanning order)) required for scanning the quantized transform coefficients of the residual signal for the current block can be omitted.
[0266] Without being limited to the above example, at least two of first transform, second transform, and scanning order of a neighboring block having the same intra prediction mode as that of the current block may be derived as encoding information of the current block.
[0267] In one embodiment, the first transform and the second transform of the neighboring block having the same intra prediction mode as the intra prediction mode of the current block may be applied to the current block, or the first transform and the scanning order of the neighboring block or the second transform and the scanning order of the neighboring block may be applied to the current block. Alternatively, all of the first transform, the second transform, and the scanning order of the neighboring block having the same intra prediction mode as the intra prediction mode of the current block may be applied to the current block.
[0268] When multiple neighboring blocks having the same intra-frame prediction mode as the current block are adjacent to the current block, coding information for the current block may be derived based on the priority between the neighboring blocks. In one embodiment, when the block adjacent to the left of the current block and the block adjacent to the top of the current block each have the same intra-frame prediction mode as the intra-frame prediction mode of the current block, and the priority of the block adjacent to the left of the current block is higher than the priority of the block adjacent to the top of the current block, coding information for the current block may be derived based on coding information of the block adjacent to the left of the current block.
[0269] In another embodiment, when a plurality of neighboring blocks having the same intra prediction mode as that of the current block are adjacent to the current block, information for identifying the neighboring blocks (the neighboring blocks used to derive encoding information for the current block) may be signaled via a bitstream. Here, encoding information for the residual signal of the current block may be derived from the neighboring blocks indicated by the information for identifying the neighboring blocks (e.g., neighboring block indexes).
[0270] When there is no neighboring block having the same intra prediction mode as the intra prediction mode of the current block, in step S1803, entropy encoding / decoding may be performed on the encoding information of the residual signal of the current block. In one embodiment, when there is no neighboring block having the same intra prediction mode as the intra prediction mode of the current block, entropy encoding / decoding may be performed on at least one of the transformation information (or transformation index) of the first transformation, the transformation information (or transformation index) of the second transformation, and the scanning order information (or scanning index) of the current block.
[0271] In the above-described embodiment, the intra-frame prediction mode of the current block is the same as the intra-frame prediction mode of the neighboring block, and the encoding information of the residual signal of the current block is derived from the neighboring block. In another embodiment, the second encoding information of the residual signal of the current block can be derived from the neighboring block having the same first encoding information of the residual signal as the first encoding information of the current block. Here, the first encoding information and the second encoding information may include at least one of the first transformed information, the second transformed information, and the scanning order.
[0272] In one embodiment, when there is at least one neighboring block that uses the same first transform as the first transform determined for the current block, the secondary transform of the current block may be set to be applied to the secondary transform of the neighboring block that uses the same first transform as the first transform of the current block. Here, encoding / decoding of encoding information required to perform the secondary transform on the residual signal of the current block may be omitted. For example, assuming that the first transform in the horizontal direction of the residual signal of the current block is determined to be DCT-V and the first transform in the vertical direction is determined to be DST-VII. When DCT-V is determined as the first transform in the horizontal direction of at least one neighboring block of the current block and DST-VII is determined as the first transform in the vertical direction, the secondary transform of the neighboring block to which the same first transform as the first transform of the current block is applied may be applied as the secondary transform of the current block.
[0273] In addition, the scanning order of the neighboring blocks using the same first transform as the first transform of the current block may be applied as the scanning order of the current block. In addition, the secondary transform and scanning order of the neighboring blocks using the same first transform as the first transform of the current block may also be applied as the secondary transform and scanning order of the current block.
[0274] In the above-described embodiment, at least one of the secondary transform and the scanning order of the current block is derived from a neighboring block that uses the same primary transform as the primary transform of the current block. However, at least one of the primary transform and the scanning order of the current block may be derived from a neighboring block that uses the same secondary transform as the secondary transform of the current block, or at least one of the primary transform and the secondary transform of the current block may be derived from a neighboring block that uses the same scanning order as the scanning order of the current block.
[0275] The second encoding information of the current block may be derived from a neighboring block having the same intra prediction mode and first encoding information as those of the current block.
[0276] In one embodiment, when there is at least one neighboring block that uses the same intra prediction mode and first transform as those determined for the current block and the first transform determined for the current block, the secondary transform of the current block may be set to be applied to the secondary transform of the neighboring block that has the same intra prediction mode as the intra prediction mode of the current block and uses the same first transform as the first transform of the current block. Here, encoding / decoding of encoding information required to perform the secondary transform on the residual signal of the current block may be omitted.
[0277] In addition, the scanning order of the neighboring blocks using the same intra prediction mode and the first transform as the intra prediction mode and the first transform of the current block may be applied as the scanning order of the current block. Alternatively, the secondary transform and scanning order of the neighboring blocks using the same intra prediction mode and the first transform as the intra prediction mode and the first transform of the current block may be applied to the current block.
[0278] In the above-described embodiment, at least one of the secondary transform and the scanning order of the current block is derived from a neighboring block having the same intra prediction mode as the current block and using the same first transform as the first transform of the current block. Alternatively, at least one of the primary transform and the scanning order of the current block may be derived from a neighboring block having the same intra prediction mode as the current block and using the same second transform as the second transform of the current block, or at least one of the primary transform and the secondary transform of the current block may be derived from a neighboring block having the same intra prediction mode as the current block and using the same scanning order as the current block.
[0279] Figure 19 is a flowchart illustrating a process of determining whether to derive encoding information of a residual signal of a current block from a neighboring block when the current block is encoded through inter-frame prediction.
[0280] First, in step S1901, it is determined whether the inter-frame prediction mode of the current block is merge mode. When the inter-frame prediction mode of the current block is merge mode, in order to derive the motion information of the current block, in step S1902, a neighboring block to be merged with the current block is determined. In one embodiment, the neighboring block to be merged with the current block can be determined by a merge index representing the neighboring block to be merged with the current block in the merge candidate list. Here, the neighboring blocks of the current block may include neighboring blocks that are spatially adjacent to the current block and neighboring blocks that are temporally adjacent to the current block.
[0281] When the neighboring block to be merged with the current block is determined, in step S1903, the encoding information of the residual signal of the neighboring block to be merged with the current block may be derived as the encoding information of the residual signal of the current block. In one embodiment, at least one of the first transform, the second transform, and the scanning order of the current block may be set to be the same as at least one of the first transform, the second transform, and the scanning order of the neighboring block to be merged with the current block.
[0282] When the inter prediction mode of the current block is not the merge mode, in step S1904, it may be determined whether there is a neighboring block having the same motion information as the motion information of the current block among the neighboring blocks of the current block. Here, the motion information may include at least one of a motion vector, a reference picture index, and a reference picture direction.
[0283] When there is a neighboring block having the same motion information as that of the current block, in step S1905, the coding information of the residual signal of the neighboring block having the same motion information as that of the current block may be derived as the coding information of the residual signal of the current block. In one embodiment, at least one of the primary transform, secondary transform, and scanning order of the current block may be identically set to at least one of the primary transform, secondary transform, and scanning order of a neighboring block having at least one of the same motion vector, reference picture index, and reference picture direction as that of the current block.
[0284] When there is no neighboring block having the same motion information as the current block, in step S1906, the encoding information of the residual signal of the current block may be entropy encoded / decoded. In one embodiment, when there is no neighboring block having the same motion information as the current block, at least one of the transformation information (or transformation index) of the first transformation, the transformation information (or transformation index) of the second transformation, and the scanning order information (or scanning index) of the current block may be entropy encoded / decoded.
[0285] exist Figure 19 In the example shown in , the neighboring blocks used to derive the encoding information of the residual signal of the current block can be adaptively determined according to whether the inter-frame prediction mode of the current block is the merge mode. Figure 19 Unlike the example shown in , when the inter prediction mode of the current block is only the merge mode, the encoding information of the residual signal of the current block can be derived from the neighboring blocks. Alternatively, regardless of whether the inter prediction mode of the current block is the merge mode, the encoding information of the current block can be derived from the neighboring blocks having the same motion information as that of the current block.
[0286] In the above-described embodiment, the motion vector of the current block is the same as the motion vector of the neighboring block, and the encoding information of the residual signal of the current block is derived from the neighboring block. In another embodiment, the second encoding information of the residual signal of the current block may be derived from the neighboring block having the same first encoding information or motion vector as the first encoding information or motion vector of the residual signal of the current block.
[0287] After the motion information of the current block is derived as described above, the encoding information of the current block may be derived from the adjacent blocks based on whether the motion information of the current block is the same as the motion information of the adjacent blocks. In addition, the encoding information of the current block may be derived based on the motion information of the adjacent blocks without considering the motion information of the current block.
[0288] The above-mentioned encoding information (such as the first transform, the second transform, and the scanning order) can be encoded / decoded based on at least one information indicating whether a predefined type (e.g., a predefined transform type or a predefined scan type) is used and whether a residual type other than the predefined type (e.g., a residual transform type or a residual scan type) is used.
[0289] In one embodiment, when the residual signal is generated by intra prediction or inter prediction or both, information indicating whether a predefined transform type is applied to the residual signal may be encoded. Here, the predefined transform type may be a transform type (e.g., DCT-II) that is primarily used when performing a transform on the residual signal, but is not limited thereto. The information may be a 1-bit flag (e.g., a transform flag, a TM flag). In one embodiment, when the TM flag is 0 (or 1), it may indicate that a predefined transform type is applied to the residual signal. When the TM flag is 1 (or 0), it may indicate that a transform type other than the predefined transform type is applied to the residual signal. In addition, the information may be configured with a flag having 2 bits or more, the first bit may indicate whether the predefined transform type is used for the first transform, and the second bit may indicate whether the predefined transform type is used for the second transform.
[0290] When information indicates that a transform type other than a predefined transform type is applied to the residual signal, information specifying any one of the residual transform types may be encoded. Here, the residual transform type may represent the remaining transform types other than the predefined transform types among the transform types that can be applied to the residual signal. For example, when the predefined transform type is DCT-II, the residual transform type may include at least one of DCT-V, DCT-VIII, DST-I, and DST-VII. The information may be index information (TM idx) specifying any one of the residual transform types, and the index information may be any positive integer. For example, TM idx 1 may indicate DCT-V, TM idx 2 may indicate DCT-VIII, TM idx 3 may indicate DST-I, and TM idx 4 may indicate DST-VII.
[0291] The index information may indicate a transform type combination for the horizontal and vertical directions of the residual signal. In other words, the 1D transform type for the horizontal and vertical directions can be determined using a single piece of index information. For example, when the TM flag is 1 and TM idx is 1, the transform type combination matching TM idx 1 may be determined as the transform type for the horizontal and vertical directions of the current block. In one embodiment, when TM idx indicates DCT-V for the horizontal direction and DCT-VIII for the vertical direction, DCT-V and DCT-VIII may be determined as the horizontal transform type and vertical transform type for the current block, respectively.
[0292] When determining the encoding parameters of the current block, at least one piece of information specifying any one of the following items: whether a predefined type is used and a residual type may be derived from a neighboring block of the current block. For example, at least one piece of information (TM idx) specifying any one of the following items: information indicating whether a predefined transform type is applied to the current block (TM flag) and a residual transform type may be derived from a neighboring block of the current block.
[0293] In one embodiment, at least one of the TM flag and the TM idx of the current block may be derived to be the same value as that of a neighboring block of the current block.
[0294] In addition, when at least one TM flag of a neighboring block of the current block is 1, encoding / decoding can be performed by implicitly assuming that the TM flag of the current block is 1. Here, the TM idx of the current block can be implicitly transmitted through the bitstream or can be implicitly derived from the neighboring blocks.
[0295] Described by way of example, at least one piece of information (TM idx) for specifying any one of the following items: information indicating whether a predefined transform type is applied to the current block (TM flag), and a residual transform type can be derived from a neighboring block used when intra prediction or inter prediction is performed on the current block.
[0296] In one embodiment, when the inter prediction mode of the current block is merge mode, a merge candidate list may be newly configured taking into account at least one of the TM flag and TM idx. The newly configured merge candidate list may include merge candidates having at least one of the TM flag and TM idx having a different value. In one embodiment, the merge candidate list may be configured to include a first merge candidate and a second merge candidate, wherein the first merge candidate and the second merge candidate have the same motion information and have different TM flags or TM idxs, or different TM flags and TM idxs. At least one of the TM flag and TM idx of the current block may be determined to be the same as at least one of the merge candidates indicated by the merge index (Merge_idx). Therefore, the motion information (motion vector, reference picture index, inter prediction direction indicator) of the current block and the TM flag or TM idx, or both the TM flag and TM idx, may be encoded / decoded based on the merge mode.
[0297] Here, information indicating that the merge candidate list has been newly configured can be explicitly transmitted via the bitstream. The transmitted information can be a 1-bit flag, but is not limited thereto. Furthermore, when the TM flag of at least one neighboring block of the current block is 1, it can be implicitly recognized that the merge candidate list has been newly configured. Here, the neighboring block can be the block whose TM flag first becomes 1 according to a predetermined neighboring block scanning order, or it can be a predefined position block.
[0298] In the above-described embodiments, a method for deriving information for determining a transform type (e.g., a TM flag or TM IDx, or both the TM flag and TM IDx) from neighboring blocks of a current block has been described. The embodiments described above can be applied to at least one of determining a transform type for a first transform of the current block and determining a transform type for a second transform. In other words, in one embodiment, at least one of transform information for the first transform (e.g., a TM flag (first TM flag) or TM IDx (first TM IDx), or both the TM flag and TM IDx) and transform information for the second transform (e.g., a TM flag (second TM flag) or TM IDx (second TM IDx)) can be derived from neighboring blocks of the current block.
[0299] In addition to the merge candidate list generated based on motion information, a merge candidate list may be generated based on the transformation information of the current block. In one embodiment, when the merge candidate list generated based on the motion information of a neighboring block is defined as a "first merge candidate list," and the merge candidate list generated based on the transformation information of the neighboring block is defined as a "second merge candidate list," the motion information of the current block is derived from the merge candidate specified by the first merge index within the first merge candidate list. However, the transformation information of the current block may be derived from the merge candidate specified by the second merge index within the second merge candidate list.
[0300] In addition, information (e.g., a scan flag or scan idx, or both) for determining the scanning order of the current block from neighboring blocks of the current block may be derived. Here, the scan flag may indicate whether the scanning order of the current block is the same as a predefined scanning order, and the scan idx may be information indicating any one of the residual scanning orders.
[0301] According to another embodiment of the present invention, the same coding information may be applied to all blocks within a signaling block, wherein the signaling block is within a currently encoded / decoded picture or slice. Here, a signaling block may refer to an area having a size smaller than at least one of the horizontal resolution or vertical resolution of the current picture or slice. In other words, a signaling block may be defined as a predetermined area having a size smaller than the current picture or slice.
[0302] Signaling block information may be transmitted via at least one of a sequence unit, a picture unit, and a slice header. In one embodiment, at least one of the size, form, or position of the signaling block may be transmitted via at least one of a sequence parameter set, a picture parameter set, and a slice header. Alternatively, signaling block information may be implicitly derived from coding information of the current block or a neighboring block adjacent to the current block. The signaling block may have a square or rectangular form, but is not limited thereto.
[0303] The coding information of a signaling block may be applied to all blocks included in the signaling block. In one embodiment, at least one of a primary transform, a secondary transform, and a scanning order may be set identically for all blocks included in the signaling block. The coding information applied to all blocks included in the signaling block may be transmitted via a bitstream. Alternatively, the coding information of a block at a specific location within the signaling block may be applied to all blocks included in the signaling block.
[0304] In the above-mentioned embodiment, it has been described that all blocks included in the signaling block have the same encoding information. In another embodiment, blocks included in the signaling block that meet a predetermined condition may be set to have the same encoding information. Here, the predetermined condition may be defined based on at least one of the size, form, or depth of the block. In one embodiment, at least one of the primary transform, the secondary transform, and the scanning order may be set identically to blocks of a predetermined size or smaller (for example, blocks of 4×4 size or smaller) among all blocks included in the signaling block.
[0305] The embodiment of obtaining the encoding information of the current block can be applied to the luminance component and the chrominance component. In addition, by using at least one of the embodiments, information indicating that at least one of the first transform, the second transform and the scan is performed on the residual signal of the current block can be encoded / decoded. When the above information is entropy encoded / decoded, at least one of the truncated Rice binarization method, the K-order exponential Golomb binarization method, the restricted K-order exponential Golomb binarization method, the fixed-length binarization method, the unary binarization method and the truncated unary binarization method can be used as the entropy encoding method. In addition, after the above information is binarized, the above information can be finally encoded / decoded by using CABAC (ae (v)). Optionally, the encoding information of the current block can be implicitly derived by using at least one of the size and form of the current block.
[0306] Next, encoding / decoding of motion vector information will be described in detail.
[0307] When the current block is encoded through inter prediction, the encoder may transmit a motion vector difference (MVD) representing a difference between a motion vector encoded adjacent to the current block and a motion vector of the current block to the decoder.
[0308] The decoder may derive a motion vector encoded adjacent to the current block as a motion vector candidate for the current block. Specifically, the decoder may derive a motion vector candidate from both the decoded temporal motion vector and the decoded spatial motion vector of the current block, or from at least one of the decoded temporal motion vector or the decoded spatial motion vector of the current block, and configure a motion vector candidate list (MVP list).
[0309] The encoder may transmit information indicating a motion vector predictor (e.g., an MVP list index) for deriving a motion vector difference from among motion vector candidates included in the motion vector candidate list. The decoding device may then determine the motion vector candidate indicated by the MVP list index as a motion vector predictor and derive a motion vector for the current block using the motion vector predictor and the motion vector difference.
[0310] Based on the above explanation, a method of encoding / decoding motion vector information of a current block according to the present invention will be described in detail.
[0311] Figure 20 is a flowchart illustrating a decoding process of a motion vector of a current block.
[0312] First, in step S2001, a spatial motion vector candidate of a current block may be derived from an encoding / decoding block included in the same picture as the picture including the current block.
[0313] Figure 21is a diagram illustrating an example of deriving spatial motion vector candidates.
[0314] like Figure 21 , a spatial motion vector of the current block may be derived from a block B1 adjacent to the upper side of the current block X, a block A1 adjacent to the left side of the current block, a block B0 adjacent to the upper right corner of the current block, a block B2 located at the upper left corner, and a block A0 adjacent to the lower left corner of the current block. The spatial motion vector derived from the neighboring blocks of the current block may be determined as a spatial motion vector candidate of the current block.
[0315] Here, spatial motion vector candidates may be derived in a predetermined order. In one embodiment, the spatial motion vector candidates may be determined in the order of A0, A1, B0, B1, and B2 to determine whether a motion vector exists in each block. If a motion vector of a neighboring block exists, the motion vector of the corresponding neighboring block may be determined as a spatial motion vector candidate.
[0316] When the reference picture of the neighboring block and the reference picture of the current block are different, a motion vector obtained by scaling the motion vector of the neighboring block using the distance between the reference picture referenced by the current picture and the neighboring block and the distance between the reference picture referenced by the current picture and the current block can be determined as the spatial motion vector of the current block.
[0317] Then, in step S2002, a temporal motion vector candidate of the current block may be derived. The temporal motion vector of the current block may be derived from a reconstructed block in a co-located picture.
[0318] Figure 22 is a diagram illustrating an example of deriving a temporal motion vector candidate.
[0319] like Figure 22 In the example shown in , the temporal motion vector of the current block can be derived from a block at position H outside of the co-located block C or from a block at position C3 inside the co-located block C, where the co-located block C corresponds to the same spatial position as the current block X within the co-located picture of the current picture. Temporal motion vector candidates can be derived sequentially from the block at position H and the block at position C3. In one embodiment, when a motion vector can be derived from the block at position H, the temporal motion vector candidate can be derived from the block at position H. Alternatively, when a motion vector cannot be derived from the block at position H, the temporal motion vector candidate can be derived from the block at position C3. When the block at position H or position C3 is encoded using intra-frame prediction, a temporal motion vector candidate for the current block is not derived.
[0320] Apart from Figure 22In addition to the example shown in , at least one temporal motion vector candidate for the current block may be derived from the co-located picture indicated by the obtained motion information of the current block and the co-located block or a neighboring block of the co-located block included in the co-located picture indicated by the motion information. Here, the motion information may include at least one of a picture index indicating the co-located picture and a motion vector indicating the co-located block within the co-located picture. Motion information for specifying the co-located picture and the co-located block may be additionally signaled for the current block.
[0321] The temporal motion vector candidate of the current block may be obtained in units of sub-blocks having a size smaller than that of the current block. For example, when the size of the current block is 8×8, the temporal motion vector candidate may be obtained in units of sub-blocks having a size smaller than that of the current block (such as 2×2, 4×4, 8×4, 4×8, etc.). The sub-block may have a square or rectangular form. In addition, the size or form of the sub-block may be preset in the encoder / decoder, or may be determined according to the size or form of the current block.
[0322] Subsequently, in step S2003 , a motion vector candidate list including at least one motion vector candidate of the spatial motion vector candidates and the temporal motion vector candidates may be generated.
[0323] Here, the motion vector candidate list may be configured to include at least one temporal motion vector candidate. In one embodiment, when the number of motion vector candidates that can be included in the motion vector candidate list is N (here, N is a positive integer greater than 0), the motion vector candidate list may be configured to necessarily include at least one motion vector candidate. Although a maximum of N spatial motion vector candidates that are different from each other can be derived when deriving spatial motion vector candidates, at least one of the N spatial motion vector candidates can be removed from the motion vector candidate list by arbitrary similarity determination. Therefore, the temporal motion vector candidate may be included in the motion vector candidate list. Here, arbitrary similarity determination may refer to a method of combining at least two spatial motion vectors into a single spatial motion vector by using a maximum value, a minimum value, an average value, a median value, or an arbitrary weighted sum even when the spatial motion vectors have different values from each other but the difference between the motion vectors is not large. The number of spatial motion vector candidates can be reduced by using arbitrary similarity determination.
[0324] Alternatively, when N spatial motion vector candidates are included in the motion vector candidate list according to a predetermined priority, at least one of the spatial motion vector candidates may be removed from the motion vector candidate list in reverse order of the predetermined priority. In other words, at least one of the spatial motion vector candidates may be removed from the motion vector candidate list starting from the back to the front. Thus, the temporal motion vector candidate may be included in the motion vector candidate list.
[0325] Whether to remove a spatial motion vector candidate from the motion vector candidate list may be determined based on whether a temporal motion vector candidate is used. Furthermore, the number of spatial motion vector candidates to be removed from the motion vector candidate list may be determined based on the number of temporal motion vector candidates used for the current block or the number of temporal motion vector candidates available for the current block.
[0326] Furthermore, the number of motion vector candidates that may be included in the motion vector candidate list may be increased by 1 (in other words, increased to N+1) so that the temporal motion vector candidate is included in the motion vector candidate list.
[0327] Subsequently, in step S2004, any one of the motion vector candidates included in the motion vector candidate list may be determined as a motion vector predictor. In one embodiment, the decoder may determine the motion vector predictor of the current block based on information (e.g., an MVP list index) specifying any one of the motion vector candidates included in the motion vector candidate list.
[0328] In step S2005, when the motion vector prediction value of the current block is determined, the motion vector of the current block can be obtained by using the motion vector difference. The motion vector difference may represent the difference between the motion vector of the current block and the motion vector prediction value of the current block. The motion vector difference of the current block may be entropy encoded / decoded.
[0329] According to an embodiment of the present invention, in order to reduce the amount of information of the motion vector difference, the motion vector difference of the current block may be encoded using the motion vector difference of a reconstructed block adjacent to the current block and encoded using inter-frame prediction. In one embodiment, a second motion vector difference of the current block may be encoded, wherein the second motion vector difference represents the difference between the following two motion vector differences: the motion vector difference representing the difference between the motion vector of the current block and the motion vector prediction, and the motion vector difference representing the difference between the reconstructed blocks adjacent to the current block and encoded using inter-frame prediction.
[0330] Figure 23 is a diagram illustrating derivation of a second motion vector difference.
[0331] Assume that the motion vector difference (MVD) of the current block (block 2) is (5, 5). Here, the second motion vector difference of the current block can be encoded by using the motion vector difference of the upper block (block 1) located above the current block.
[0332] In one embodiment, when the motion vector difference of the upper block is assumed to be (5, 5), since the motion vector difference of the current block is the same as the motion vector difference of the upper block, the second motion vector difference of the current block may become (0, 0). When the motion vector difference (0, 0) is encoded instead of the motion vector difference (5, 5), the amount of information used to encode the motion vector difference of the current block can be reduced.
[0333] Also, when there is a block having the same motion vector difference as that of the current block, the motion vector difference of the current block may be derived from a neighboring block without transmitting the motion vector difference of the current block.
[0334] As in the above-described example, the position of the neighboring block used to derive the second motion vector candidate for the current block or information indicating the position of the neighboring block having the same motion vector difference as the motion vector candidate of the current block may be explicitly transmitted through the bitstream. In one embodiment, information (e.g., an MVD index) for identifying the neighboring block used to derive the second motion vector candidate or the neighboring block having the same motion vector candidate as the motion vector candidate of the current block among the neighboring blocks of the current block may be transmitted to the decoder through the bitstream.
[0335] In another embodiment, the position of the neighboring block used to derive the second motion vector candidate for the current block or information indicating the position of the neighboring block having the same motion vector difference as the motion vector difference of the current block may be implicitly derived in the encoder / decoder according to the same process. In one embodiment, the motion vector difference of the neighboring block used as the motion vector predictor (MVP) of the current block may be used as a motion vector difference predictor (MVD predictor) for deriving the second motion vector difference of the current block.
[0336] When the current block is encoded using bidirectional prediction, information indicating whether the motion vector differences between reference picture list 0 (List 0) and reference picture list 1 (List 1) are the same may be encoded. Here, the same motion vector difference may mean that the sign and magnitude of the motion vector difference are the same, or it may mean that the magnitude of the motion vector difference is the same but the sign of the motion vector difference is different. When the motion vector differences between reference picture list 0 and reference picture list 1 are the same, encoding / decoding of either the motion vector difference between reference picture list 0 and reference picture list 1 may be omitted.
[0337] According to another embodiment of the present invention, all blocks within a signaling block of a current encoding / decoding picture or slice may have at least one identical motion vector predictor (MVP) to derive an optimal motion vector difference (MVD). Alternatively, according to another embodiment of the present invention, all blocks within a signaling block of a current encoding / decoding picture or slice may have at least one identical motion vector difference predictor (MVD predictor) to derive an optimal second motion vector difference. Here, a motion vector predictor or a motion vector difference predictor may be sent for each signaling block, or the motion vector predictor or the motion vector difference predictor may be implicitly derived by using encoding information of neighboring blocks adjacent to the signaling block. Here, a signaling block may represent an area having a size smaller than at least one of the horizontal resolution and the vertical resolution of the current picture or current slice. In other words, a signaling block may be defined as a predetermined area having a size smaller than the current picture or current slice.
[0338] Signaling block information may be transmitted via at least one of a sequence unit, a picture unit, and a slice header. In one embodiment, at least one of the size, form, or position of the signaling block may be transmitted via at least one of a sequence parameter set, a picture parameter set, and a slice header. Alternatively, signaling block information may be implicitly derived from coding information of the current block or a neighboring block adjacent to the current block. The signaling block may have a square or rectangular form, but is not limited thereto.
[0339] The above inter-frame encoding / decoding process may be performed for each luminance signal and chrominance signal. For example, at least one method of obtaining an inter-frame prediction indicator, generating a motion vector candidate list, deriving a motion vector, and performing motion compensation in the above inter-frame encoding / decoding process may be applied differently to the luminance signal and the chrominance signal.
[0340] The above inter-frame encoding / decoding process can be performed equally for the luma signal and the chroma signal. For example, at least one of the inter-frame prediction indicator, motion vector candidate list, motion vector candidate, motion vector, and reference picture applied to the luma signal when performing the above inter-frame encoding / decoding process can be applied equally to the chroma signal.
[0341] The above methods can be performed in the same manner in both the encoder and the decoder. For example, at least one of the methods of deriving a motion vector candidate list, deriving motion vector candidates, deriving motion vectors, and performing motion compensation in the above inter-frame encoding / decoding process can be equally applied to both the encoder and the decoder. Alternatively, the order of the above methods can be applied differently to both the encoder and the decoder.
[0342] The above embodiments of the present invention can be applied according to the size of at least one of the coding block, prediction block, block and unit. Here, the size can be defined as the minimum size or maximum size or both the minimum size and maximum size to which the above embodiments are applied, or can be defined as a fixed size to which the embodiments are applied. In addition, in the above embodiments, the first embodiment can be applied to the first size and the second embodiment can be applied to the second size. In other words, the embodiments can be applied in combination according to the sizes. In addition, the above embodiments of the present invention can only apply the minimum size or larger size and the maximum size or smaller size. In other words, the above embodiments can be applied to block sizes included in a predetermined range.
[0343] For example, when the size of the encoding / decoding target block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 16×16 or larger, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 32×32 or larger, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 64×64 or larger, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 128×128 or larger, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 4×4, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 8×8 or smaller, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 16×16 or smaller, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 8×8 or larger and 16×16 or smaller, the above embodiment may be applied. For example, when the size of the encoding / decoding target block is 16×16 or larger and 64×64 or smaller, the above embodiment can be applied.
[0344] The above embodiments of the present invention can be applied according to the time layer. An additional identifier for identifying the time layer to which the above embodiments can be applied can be signaled, and the above embodiments can be applied to the time layer indicated by the corresponding identifier. Here, the identifier can be defined as indicating the minimum layer or maximum layer or both the minimum layer and the maximum layer to which the embodiment can be applied, or can be defined as indicating a specific layer to which the above embodiments can be applied.
[0345] For example, when the temporal layer of the current picture is the lowest layer, the above embodiment can be applied. For example, when the temporal layer identifier of the current picture is 0, the above embodiment can be applied. For example, when the temporal layer identifier of the current picture is 1, the above embodiment can be applied. For example, when the temporal layer of the current picture is the highest layer, the above embodiment can be applied.
[0346] As in the above embodiments of the present invention, a reference picture set used when generating a reference picture list and modifying a reference picture list may use at least one of the reference picture lists L0, L1, L2, and L3.
[0347] According to an embodiment of the present invention, when calculating the boundary strength in the deblocking filter, at least one to a maximum of N motion vectors of the encoding / decoding target block may be used. Here, N is a positive integer equal to or greater than 1 and may be 2, 3, 4, etc.
[0348] The above embodiments of the present invention may be applied when a motion vector has at least one of the following units when predicting a motion vector: a 16-pixel (16-pel) unit, an 8-pixel (8-pel) unit, a 4-pixel (4-pel) unit, an integer-pixel (integer-pel) unit, a 1 / 2-pixel (1 / 2-pel) unit, a 1 / 4-pixel (1 / 4-pel) unit, a 1 / 8-pixel (1 / 8-pel) unit, a 1 / 16-pixel (1 / 16-pel) unit, a 1 / 32-pixel (1 / 32-pel) unit, and a 1 / 64-pixel (1 / 64-pel) unit. Furthermore, when predicting a motion vector, a motion vector may be optionally used according to the above pixel units.
[0349] A stripe type to which the above embodiments of the present invention are applied may be defined, and the above embodiments of the present invention may be applied according to the corresponding stripe type.
[0350] For example, when the slice type is T (three-way prediction)-slice, a prediction block can be generated by using at least three motion vectors, so that a weighted sum of at least three prediction blocks can be calculated and used as a final prediction block of the encoding / decoding target block. For example, when the slice type is Q (four-way prediction)-slice, a prediction block can be generated by using at least four motion vectors, so that a weighted sum of at least four prediction blocks can be calculated and used as a final prediction block of the encoding / decoding target block.
[0351] The above embodiments of the present invention may be applied to an inter prediction and motion compensation method using motion vector prediction, and may be applied to an inter prediction and motion compensation method using skip mode or merge mode.
[0352] The block form to which the above embodiments of the present invention are applicable may have a square form or a non-square form.
[0353] In the above embodiments, the method is described based on a flow chart having a series of steps or units, but the present invention is not limited to the order of the steps. Rather, some steps may be performed simultaneously with other steps, or may be performed in a different order than other steps. In addition, it should be understood by those skilled in the art that the steps in the flow chart are not mutually exclusive, and other steps may be added to the flow chart, or some steps may be deleted from the flow chart without affecting the scope of the present invention.
[0354] The embodiments described above include examples of various aspects. Of course, it is not possible to describe every conceivable combination of components or methods for the purpose of describing various aspects, but those skilled in the art will recognize that further combinations and permutations are possible. Therefore, this description is intended to include all such alternatives, modifications, and variations that fall within the spirit and scope of the appended claims.
[0355] Computer-readable storage media may include individual program instructions, data files, data structures, etc., or a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable storage medium may be specially designed and constructed for the present invention or any program instructions known to those skilled in the art of computer software technology. Examples of computer-readable storage media include: magnetic recording media (such as hard disks, floppy disks, and magnetic tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magneto-optical media (such as floppy disks); and hardware devices (such as read-only memory (ROM), random access memory (RAM), and flash memory) that are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. The hardware device can be configured to be operated by one or more software modules to perform the processing according to the present invention, or vice versa.
[0356] Although the present invention has been described with reference to specific terms (such as detailed elements) and limited embodiments and drawings, they are only provided to help more popularly understand the present invention, and the present invention is not limited to the above embodiments. It will be understood by those skilled in the art that various modifications and changes can be made from the above description.
[0357] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents should fall within the scope and spirit of the present invention.
[0358] Industrial availability
[0359] The present invention can be used in a device for encoding / decoding images.
Claims
1. An image decoding method performed by an image decoding device, the method comprising: Get the current block by partitioning the image; Partitioning the current block using a partitioning method determined based on a size of the current block; generating a prediction block of the coding block obtained based on the partitioning method; generating a residual block of the coding block; generating a reconstructed block of the coding block using the prediction block and the residual block; as well as applying at least one filter to the reconstructed block of the coded block, When the size of the current block is larger than 64×64, the partitioning method is implicitly determined to be quadtree partitioning without signaling the partitioning information. wherein, when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the partitioning information sent by the signal, The current block is partitioned recursively and repeatedly until the size of the current block becomes 64×64 or smaller. The at least one filter includes at least one of a deblocking filter and a sample adaptive offset filter.
2. The image decoding method according to claim 1, in, The step of generating the prediction block includes: if the coding block meets a predetermined condition, not allowing binary tree partitioning.
3. The image decoding method according to claim 2, in, The predetermined condition is derived based on the size of the coding block.
4. The image decoding method according to claim 1, in, The step of generating the prediction block includes filtering the prediction block based on at least one of an intra prediction mode of the coding block and a size of the coding block.
5. The image decoding method according to claim 1, in, The signaled partition information includes a first flag indicating whether to partition the current block, a second flag indicating whether to partition the current block into a quadtree, and a third flag indicating a partition type.
6. The image decoding method according to claim 5, in, The signaled partition information is signaled in the order of the first flag, the second flag, and the third flag.
7. An image encoding method performed by an image encoding device, the method comprising: Get the current block by partitioning the image; Partitioning the current block using a partitioning method determined based on a size of the current block; generating a prediction block of the coding block obtained based on the partitioning method; generating a residual block of the coding block; generating a reconstructed block of the coding block using the prediction block and the residual block; as well as applying at least one filter to the reconstructed block of the coded block, When the size of the current block is larger than 64×64, the partitioning method is implicitly determined to be quadtree partitioning without signaling the partitioning information. wherein, when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the partitioning information sent by the signal, The current block is partitioned recursively and repeatedly until the size of the current block becomes 64×64 or smaller. The at least one filter includes at least one of a deblocking filter and a sample adaptive offset filter.
8. A method for transmitting a bit stream generated by an image encoding method, the method comprising: sending the bit stream generated by the image encoding method, The image encoding method includes: Get the current block by partitioning the image; Partitioning the current block using a partitioning method determined based on a size of the current block; generating a prediction block of the coding block obtained based on the partitioning method; generating a residual block of the coding block; generating a reconstructed block of the coding block using the prediction block and the residual block; and applying at least one filter to the reconstructed block of the coded block, When the size of the current block is larger than 64×64, the partitioning method is implicitly determined to be quadtree partitioning without signaling the partitioning information. wherein, when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the partitioning information sent by the signal, The current block is partitioned recursively and repeatedly until the size of the current block becomes 64×64 or smaller. The at least one filter includes at least one of a deblocking filter and a sample adaptive offset filter.
Citation Information
Patent Citations
Video decoding apparatus
CN103780911A
Method and device for encoding / decoding images
CN104488270A