Image coding method and device therefor
By applying residual prediction and determining intra prediction modes using reference blocks and neighboring pixels, the method addresses inefficiencies in bit usage and mode signaling, improving video coding efficiency and synchronization between encoder and decoder.
Patent Information
- Application Number
- PCT/KR2024/006660
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-04
- Filing Date
- 2024-05-16
- Publication Date
- 2024-12-05
AI Technical Summary
Current video coding methods are inefficient in reducing the number of bits required for coding residual signals and signaling intra prediction modes, and they lack synchronization between encoder and decoder for determining intra prediction modes.
The proposed method applies residual prediction to intra prediction and determines intra prediction modes on both encoder and decoder sides without signaling, using reference blocks and neighboring pixels to calculate the most suitable prediction modes based on function values such as SAD, SSD, and pixel matching.
This approach reduces the number of bits needed for coding residual signals and improves coding efficiency by determining intra prediction modes accurately on both encoding and decoding sides, enhancing overall video coding performance.
Smart Images

Figure KR2024006660_05122024_PF_FP_ABST
Abstract
Description
Video coding method and device therefor
[0001] The present disclosure relates to image coding, and more particularly, to an image encoding method and a device therefor, an image decoding method and a device therefor, a method for storing or obtaining a bitstream and a device therefor, and a non-transitory storage medium for storing a bitstream.
[0002] Coding refers to a series of signal processing techniques for transmitting digitized information over communication lines or storing it in a format suitable for storage media. Coding targets include audio, video, and text, and the technology that performs coding on video in particular is called video coding. Coding of video signals, which are sequences of images, is achieved by removing redundant information by considering spatial, temporal, and probabilistic correlations. However, recent advancements in various media and data transmission media have led to a growing demand for more efficient video coding methods and devices.
[0003] The technical problem to be solved in the present disclosure is to provide an image coding method and a device therefor that can reduce the number of bits required for coding a residual signal by intra prediction and improve coding efficiency by applying residual prediction to intra prediction.
[0004] Another technical problem to be solved in the present disclosure is to provide a video coding method and a device therefor that can reduce the number of bits required for signaling an intra prediction mode by determining the intra prediction mode in a corresponding manner on the encoder and decoder sides without signaling the intra prediction mode.
[0005] The technical problems to be solved in the present disclosure are not limited to the above technical problems, but also include other technical problems that can be seen in the detailed description of the present disclosure.
[0006] As a first aspect of the present disclosure, a method of decoding a bitstream by a device is provided, the method comprising: processing the bitstream to obtain a residual differential signal of a current block; determining a reference block corresponding to the current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstruction signal of the reference block and a prediction signal of the reference block; and determining a reconstruction signal of the current block based on the residual differential signal of the current block, the residual signal of the reference block, and the prediction signal of the current block, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block may be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0007] As a second aspect of the present disclosure, an apparatus configured to decode a bitstream is provided, the apparatus comprising: a memory including executable instructions; and at least one processor configured to execute the instructions to implement a decoding method, the method comprising: processing the bitstream to obtain a residual differential signal of a current block; determining a reference block corresponding to the current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstruction signal of the reference block and a prediction signal of the reference block; and determining a reconstruction signal of the current block based on the residual differential signal of the current block, the residual signal of the reference block, and the prediction signal of the current block, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block may be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0008] Preferably, the method further includes a step of determining an intra prediction mode of the reference block from among a plurality of intra prediction modes based on a restoration signal of the reference block and at least one reference pixel included in a neighboring block of the reference block, wherein the prediction signal of the reference block is determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture.
[0009] Preferably, the step of determining the intra prediction mode of the reference block from among the plurality of intra prediction modes may include: calculating a function value for each of the plurality of intra prediction modes based on a restoration signal of the reference block and at least one reference pixel included in a neighboring block of the reference block; and determining the intra prediction mode corresponding to the lowest function value or the highest function value among the calculated function values as the intra prediction mode of the current block.
[0010] Preferably, the function value may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value.
[0011] Preferably, the method further comprises a step of identifying an intra prediction mode of the reference block based on the reference block being coded in an intra prediction mode, wherein a prediction signal of the reference block is determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture, and a prediction signal of the current block can be determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture.
[0012] Preferably, the method further comprises a step of obtaining an intra prediction mode of the current block from the bitstream, wherein the prediction signal of the reference block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture.
[0013] Preferably, the method further comprises a step of determining an intra prediction mode of the current block from among a plurality of intra prediction modes based on a pixel area adjacent to the current block, wherein the prediction signal of the reference block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture.
[0014] Preferably, the step of determining a reference block corresponding to the current block may include: determining a first pixel area adjacent to the current block in the current picture; determining a second pixel area corresponding to the first pixel area adjacent to the current block in the current picture; and determining the reference block corresponding to the second pixel area in the current picture.
[0015] Preferably, the first pixel region adjacent to the current block may include at least one of a pixel region adjacent to the top of the current block, a pixel region adjacent to the top left of the current block, and a pixel region adjacent to the left side of the current block.
[0016] Preferably, the first pixel area adjacent to the current block may have a fixed size, or a size determined based on a size of the current block, or may have the same width or height as a coding unit containing the current block, or may have a width or height twice that of a coding unit containing the current block.
[0017] Preferably, determining a second pixel area corresponding to a first pixel area adjacent to the current block in the current picture may include: determining a pixel area corresponding to a lowest function value or a highest function value among function values calculated based on pixels in the first pixel area and pixels in a pixel area within a reconstructed area of the current picture as the second pixel area.
[0018] Preferably, the function value may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value.
[0019] Preferably, the step of determining a reference block corresponding to the current block may include: obtaining a block vector of the current block from the bitstream; and determining the reference block in the current picture based on the block vector of the current block.
[0020] Preferably, the method further comprises a step of obtaining flag information indicating whether residual prediction is performed for the current block from the bitstream, wherein the step of obtaining a residual differential signal of the current block and the step of determining a restoration signal of the current block based on the residual differential signal of the current block, the residual signal of the reference block, and the prediction signal of the current block can be performed based on the flag information indicating that residual prediction is performed for the current block.
[0021] As a third aspect of the present disclosure, a method of encoding a bitstream by a device is provided, the method comprising: determining a reference block corresponding to a current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstructed signal of the reference block and a prediction signal of the reference block; determining a residual differential signal of the current block based on the residual signal of the reference block, an original signal of the current block, and a prediction signal of the current block; and processing the residual differential signal of the current block and encoding it into the bitstream, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0022] As a fourth aspect of the present disclosure, an apparatus configured to encode a bitstream is provided, the apparatus comprising: a memory including executable instructions; and at least one processor configured to execute the instructions to implement an encoding method, the method comprising: determining a reference block corresponding to a current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstructed signal of the reference block and a prediction signal of the reference block; determining a residual differential signal of the current block based on the residual signal of the reference block, an original signal of the current block, and a prediction signal of the current block; and processing the residual differential signal of the current block to encode the bitstream, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block may be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0023] As a fifth aspect of the present disclosure, a non-transitory storage medium for storing a bitstream generated by an encoding method is provided, the method comprising: determining a reference block corresponding to a current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstructed signal of the reference block and a prediction signal of the reference block; determining a residual differential signal of the current block based on the residual signal of the reference block, an original signal of the current block, and a prediction signal of the current block; and processing the residual differential signal of the current block and encoding it into the bitstream, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0024] As a sixth aspect of the present disclosure, a method of storing a bitstream generated by an encoding method is provided, the encoding method comprising: determining a reference block corresponding to a current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstructed signal of the reference block and a prediction signal of the reference block; determining a residual differential signal of the current block based on the residual signal of the reference block, an original signal of the current block, and a prediction signal of the current block; and processing the residual differential signal of the current block and encoding it into the bitstream, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block can be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0025] As a seventh aspect of the present disclosure, a non-transitory storage medium for storing a bitstream generated by an encoding method is provided, the encoding method comprising: determining a reference block corresponding to a current block in a current picture including the current block; determining a residual signal of the reference block based on a reconstructed signal of the reference block and a prediction signal of the reference block; determining a residual differential signal of the current block based on the residual signal of the reference block, an original signal of the current block, and a prediction signal of the current block; and processing the residual differential signal of the current block and encoding it into the bitstream, wherein the prediction signal of the reference block is determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture, and the prediction signal of the current block may be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0026] According to the proposed method of the present disclosure, by applying residual prediction to intra prediction, the number of bits required for coding a residual signal by intra prediction can be reduced and coding efficiency can be improved.
[0027] In addition, according to the proposed method of the present disclosure, the number of bits required for signaling the intra prediction mode can be reduced by determining the intra prediction mode according to a predetermined method on the encoder and decoder sides without signaling the intra prediction mode.
[0028] The technical effects according to the proposed method of the present disclosure are not limited to the above technical effects, but also include other technical effects that can be seen in the detailed description of the present disclosure.
[0029] To facilitate a more thorough understanding of the drawings cited herein, a brief description of each drawing is provided.
[0030] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment.
[0031] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment.
[0032] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment.
[0033] FIG. 4 illustrates a process in which an image decoding device determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment.
[0034] FIG. 5 illustrates a process in which an image decoding device divides an encoding unit based on at least one of block shape information and division shape mode information, according to one embodiment.
[0035] FIG. 6 illustrates a method for a video decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.
[0036] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device determines multiple encoding units by dividing a current encoding unit according to one embodiment.
[0037] FIG. 8 illustrates a process for determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment.
[0038] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment.
[0039] FIG. 10 illustrates that, according to one embodiment, a video decoding device limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by dividing a first encoding unit satisfies a predetermined condition.
[0040] FIG. 11 illustrates a process of a video decoding device dividing a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment.
[0041] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.
[0042] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment.
[0043] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.
[0044] FIG. 15 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.
[0045] Figure 16 is a block diagram showing a video encoding and decoding system.
[0046] Fig. 17 illustrates a flowchart of an image encoding method according to the proposed method of the present disclosure.
[0047] Fig. 18 illustrates a flowchart of an image decoding method according to the proposed method of the present disclosure.
[0048] Fig. 19 illustrates a flowchart of a bitstream storage method according to the proposed method of the present disclosure.
[0049] Figures 20 and 21 illustrate intra prediction modes that can be applied to the proposed method of the present disclosure.
[0050] Figure 22 illustrates inter-template matching that can be applied to the proposed method of the present disclosure.
[0051] Figure 23 illustrates intra-template matching that can be applied to the proposed method of the present disclosure.
[0052] Figure 24 illustrates an intra block copy that can be applied to the proposed method of the present disclosure.
[0053] Figure 25 illustrates the proposed method 1 of the present disclosure.
[0054] Figure 26 illustrates a template that can be applied to the proposed method of the present disclosure.
[0055] Figure 27 illustrates reference pixels for intra prediction that can be applied to the proposed method of the present disclosure.
[0056] Figure 28 illustrates the proposed method 2 of the present disclosure.
[0057] Figure 29 illustrates the proposed method 3 of the present disclosure.
[0058] Figure 30 illustrates the proposed method 4 of the present disclosure.
[0059] Figures 31 and 32 illustrate a device configured to perform the proposed method of the present disclosure.
[0060] The present disclosure may be subject to various modifications and embodiments. Specific embodiments are illustrated in the drawings and described in detail herein. However, this is not intended to limit the embodiments of the present disclosure, and it should be understood that the present disclosure encompasses all modifications, equivalents, and alternatives falling within the spirit and technical scope of the various embodiments.
[0061] In describing the embodiments, detailed descriptions of related known technologies are omitted if they are deemed to unnecessarily obscure the gist of the present disclosure. Furthermore, numbers (e.g., "first," "second," etc.) used throughout the description of the specification are merely identifiers used to distinguish one component from another.
[0062] Additionally, in this specification, when a component is referred to as being “connected” or “connected” to another component, it should be understood that the component may be directly connected or connected to the other component, but may also be connected or connected via another component in between, unless there is a specific description to the contrary.
[0063] In addition, components expressed as 'unit', 'module', etc. in this specification may be two or more components combined into one component, or one component may be divided into two or more components with more detailed functions. In addition, each component described below may additionally perform some or all of the functions performed by other components in addition to its own main function, and of course, some of the main functions performed by each component may be performed exclusively by other components.
[0064] Additionally, in this specification, 'image' or 'picture' may refer to a still image, a still image of a video, or a moving image, i.e., the video itself. An image or picture may be referred to as a frame.
[0065] Additionally, in this specification, "sample" refers to data assigned to a sampling location in an image and is the subject of processing. For example, a sample may be mixed with a pixel in an image in the spatial domain, and may be mixed with a transform coefficient in the transform domain. A unit containing at least one such sample may be defined as a block.
[0066] Additionally, in this specification, 'current block' may mean a block of the maximum encoding unit, encoding unit, prediction unit, or transformation unit of the current image to be encoded or decoded.
[0067] Also, in this specification, when a motion vector is in the direction of list 0, it can mean that the motion vector is used to point to a block in a reference picture included in list 0 (or reference list 0 or reference picture list 0), and when a motion vector is in the direction of list 1, it can mean that the motion vector is used to point to a block in a reference picture included in list 1 (or reference list 1 or reference picture list 1). Also, when a motion vector is unidirectional, it can mean that the motion vector is used to point to a block in a reference picture included in list 0 or list 1, and when a motion vector is bidirectional, it can mean that the motion vector includes a motion vector in the direction of list 0 and a motion vector in the direction of list 1. List 0 can be simply represented as L0, and List 1 can be simply represented as L1.
[0068] Also, in this specification, 'binary split' of a block means a split that creates two sub-blocks each having half the width or height of the block. Specifically, when 'binary vertical split' is performed on the current block, the split is performed vertically (vertically) at a point halfway between the width of the current block, so that two sub-blocks can be created that have a width that is half the width of the current block and a height that is the same as the height of the current block. When 'binary horizontal split' is performed on the current block, the split is performed horizontally (horizontally) at a point halfway between the height of the current block, so that two sub-blocks can be created that have a height that is half the height of the current block and a width that is the same as the width of the current block.
[0069] Also, in this specification, 'ternary split' of a block means a split in which the width or height of the block is split in a 1:2:1 ratio to create three sub-blocks. Specifically, when 'ternary vertical split' is performed on the current block, the split is performed in the vertical direction (vertical direction) at a point with a 1:2:1 ratio of the width of the current block, so that two sub-blocks having a width that is 1 / 4 of the width of the current block and the same height as the current block, and one sub-block having a width that is 2 / 4 of the width of the current block and the same height as the height of the current block can be created. When a 'ternary horizontal split' is performed on the current block, the split is performed horizontally (horizontally) at a point with a ratio of 1:2:1 of the height of the current block, so that two sub-blocks with a height that is 1 / 4 of the height of the current block and a width that is the same as the width of the current block can be created, and one sub-block with a height that is 2 / 4 of the height of the current block and a width that is the same as the width of the current block can be created.
[0070] In addition, in this specification, 'quad split' of a block means a split in which the width and height of the block are split in a 1:1 ratio to create four sub-blocks. Specifically, when 'quad split' is performed on the current block, the split is performed vertically (vertically) at a point halfway between the width of the current block and horizontally (horizontally) at a point halfway between the height of the current block, so that four sub-blocks can be created each having a width that is half the width of the current block and a height that is half the height of the current block.
[0071] Referring to FIGS. 1 to 16 below, an image encoding device and an image decoding device, an image encoding method, and an image decoding method according to one embodiment are described in detail.
[0072] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment.
[0073] The video decoding device (100) may include a receiving unit (110) and a decoding unit (120). The receiving unit (110) and the decoding unit (120) may include at least one processor. In addition, the receiving unit (110) and the decoding unit (120) may include a memory that stores instructions to be executed by at least one processor.
[0074] The receiving unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (200) described below. In addition, the bitstream can be transmitted from the image encoding device (200). The image encoding device (200) and the image decoding device (100) can be connected by wire or wirelessly, and the receiving unit (110) can receive the bitstream by wire or wirelessly. The receiving unit (110) can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoding unit (120) can restore the image based on information obtained from the received bitstream. The decoding unit (120) can obtain syntax elements for restoring the image from the bitstream. The decoding unit (120) can restore the image based on the syntax elements.
[0075] The operation of the video decoding device (100) will be described in more detail with reference to FIG. 2.
[0076] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment.
[0077] According to one embodiment of the present disclosure, the receiving unit (110) receives a bitstream.
[0078] The image decoding device (100) performs a step (210) of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. The image decoding device (100) performs a step (220) of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) performs a step (230) of splitting the encoding unit into a plurality of encoding units based on at least one of the binstring corresponding to the splitting shape mode and the splitting rule. In order to determine the splitting rule, the image decoding device (100) may determine a first allowable range of the size of the encoding unit according to a ratio of the width and height of the encoding unit. In order to determine the splitting rule, the image decoding device (100) may determine a second allowable range of the size of the encoding unit according to the splitting shape mode of the encoding unit.
[0079] Below, the division of encoding units according to one embodiment of the present disclosure is described in detail.
[0080] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more Coding Tree Units (CTUs). The concept that contrasts with a Coding Tree Block (CTB) is a Coding Tree Block (CTB).
[0081] A maximum coding block (CTB) is an NxN block containing NxN samples (where N is an integer). Each color component can be divided into one or more maximum coding blocks.
[0082] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), a maximum coding unit (CTU) is a unit that includes a maximum coding block of luma samples, two maximum coding blocks of corresponding chroma samples, and syntax structures used to encode the luma samples and chroma samples. When a picture is a monochrome picture, a maximum coding unit is a unit that includes a maximum coding block of monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color components, a maximum coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.
[0083] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M, N are integers).
[0084] When a picture has a sample array for each Y, Cr, and Cb component, a coding unit (CU) is a unit that includes a coding block for a luma sample and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luma sample and the chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for a monochrome sample and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color component, a coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.
[0085] As explained above, the maximum coding block and the maximum coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block including the corresponding sample and a syntax structure corresponding to it. However, since a person skilled in the art can understand that the (maximum) coding unit or the (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, the following specification will refer to the maximum coding block and the maximum coding unit, or the coding block and the coding unit, without distinction, unless there are special circumstances.
[0086] An image can be divided into Coding Tree Units (CTUs). The size of the CTUs can be determined based on information obtained from the bitstream. The shape of the CTUs can be a square of equal size, but is not limited thereto.
[0087] For example, information about the maximum size of a luma coding block can be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block can be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.
[0088] For example, information about the maximum size of a luma coding block capable of being split into two and the luma block size difference can be obtained from the bitstream. The information about the luma block size difference can indicate the size difference between a luma maximum coding unit and a maximum luma coding block capable of being split into two. Therefore, by combining the information about the maximum size of a luma coding block capable of being split into two obtained from the bitstream and the information about the luma block size difference, the size of the luma maximum coding unit can be determined. Using the size of the luma maximum coding unit, the size of the chroma maximum coding unit can also be determined. For example, if the Y: Cb: Cr ratio is 4:2:0 according to the color format, the size of the chroma block can be half the size of the luma block, and similarly, the size of the chroma maximum coding unit can be half the size of the luma maximum coding unit.
[0089] According to one embodiment, since information about the maximum size of a luma coding block capable of binary splitting is obtained from a bitstream, the maximum size of the luma coding block capable of binary splitting can be determined variably. In contrast, the maximum size of a luma coding block capable of ternary splitting can be fixed. For example, the maximum size of a luma coding block capable of ternary splitting in an I picture may be 32x32, and the maximum size of a luma coding block capable of ternary splitting in a P picture or a B picture may be 64x64.
[0090] Additionally, the maximum coding unit can be hierarchically divided into coding units based on the division shape mode information obtained from the bitstream. As the division shape mode information, at least one of information indicating whether quad division is performed, information indicating whether multi-division is performed, division direction information, and division type information can be obtained from the bitstream.
[0091] For example, information indicating whether a quad split is present may indicate whether the current encoding unit is to be quad split (QUAD_SPLIT) or not to be quad split.
[0092] If the current encoding unit is not quad-split, the information indicating whether it is multi-split may indicate whether the current encoding unit will not be split any further (NO_SPLIT) or will be binary / ternary split.
[0093] When the current encoding unit is binary or ternary split, the split direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.
[0094] When the current encoding unit is split in the horizontal or vertical direction, the split type information indicates that the current encoding unit is split into binary split or ternary split.
[0095] Depending on the split direction information and the split type information, the split mode of the current encoding unit can be determined. The split mode when the current encoding unit is split into binaries in the horizontal direction can be determined as binary horizontal split (SPLIT_BT_HOR), the split mode when the current encoding unit is split into ternaries in the horizontal direction can be determined as ternary horizontal split (SPLIT_TT_HOR), the split mode when the current encoding unit is split into binaries in the vertical direction can be determined as binary vertical split (SPLIT_BT_VER), and the split mode when the current encoding unit is split into ternaries in the vertical direction can be determined as ternary vertical split (SPLIT_BT_VER).
[0096] The image decoding device (100) can obtain segmentation shape mode information from a bitstream from a single binstring. The format of the bitstream received by the image decoding device (100) can include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binstring represents information as a series of binary numbers. The binstring can be composed of at least one bit. The image decoding device (100) can obtain segmentation shape mode information corresponding to the binstring based on a segmentation rule. The image decoding device (100) can determine whether to quad-segment an encoding unit, whether not to quad-segment, or the segmentation direction and segmentation type based on a single binstring.
[0097] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit with the maximum size, so it is a coding unit. If the split shape mode information for the maximum coding unit indicates that it is not split, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the split shape mode information for the maximum coding unit indicates that it is split, the maximum coding unit may be split into coding units. In addition, if the split shape mode information for the coding unit indicates splitting, the coding units may be split into coding units of smaller sizes. However, the splitting of the image is not limited thereto, and the maximum coding unit and the coding units may not be distinguished. The splitting of the coding unit is described in more detail with reference to FIGS. 3 to 16.
[0098] Additionally, one or more prediction blocks for prediction may be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Additionally, one or more transformation blocks for transformation may be determined from the coding unit. The transformation blocks may be equal to or smaller than the coding unit.
[0099] The shape and size of the transformation block and the prediction block may be unrelated.
[0100] In another embodiment, prediction may be performed using the encoding unit as a prediction block. Transformation may also be performed using the encoding unit as a transform block.
[0101] The current block and neighboring blocks of the present disclosure may represent one of a maximum coding unit, a coding unit, a prediction block, and a transform block. Furthermore, the current block or the current coding unit may be a block currently being decoded or encoded, or a block currently being split. The neighboring blocks may be blocks reconstructed prior to the current block. The neighboring blocks may be spatially or temporally adjacent to the current block. The neighboring blocks may be located at one of the following locations: the lower left, left, upper left, upper, upper right, right, or lower right of the current block.
[0102] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment.
[0103] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN or Nx8N, where N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, width and height ratio or size of the encoding unit.
[0104] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are equal (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoding device (100) may determine the block shape information of the encoding unit as square. The image decoding device (100) may determine the shape of the encoding unit as non-square.
[0105] When the width and height of the encoding unit are different (i.e., when the block shape of the encoding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoding device (100) may determine the block shape information of the encoding unit to be non-square. When the shape of the encoding unit is non-square, the image decoding device (100) may determine the ratio of the width and height among the block shape information of the encoding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Additionally, based on the width length and height length of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in the horizontal or vertical direction. Additionally, based on at least one of the width length, height length, or area of the encoding unit, the image decoding device (100) can determine the size of the encoding unit.
[0106] According to one embodiment, the image decoding device (100) can determine the shape of an encoding unit using block shape information, and can determine the shape into which the encoding unit is divided using segmentation shape mode information. That is, the splitting method of the encoding unit indicated by the segmentation shape mode information can be determined depending on which block shape the block shape information used by the image decoding device (100) indicates.
[0107] The image decoding device (100) can obtain the segmentation shape mode information from the bitstream. However, the present invention is not limited thereto, and the image decoding device (100) and the image encoding device (200) can determine the pre-agreed segmentation shape mode information based on the block shape information. The image decoding device (100) can determine the pre-agreed segmentation shape mode information for the maximum coding unit or the minimum coding unit. For example, the image decoding device (100) can determine the segmentation shape mode information for the maximum coding unit as quad split. In addition, the image decoding device (100) can determine the segmentation shape mode information for the minimum coding unit as “not split.” Specifically, the image decoding device (100) can determine the size of the maximum coding unit as 256x256. The image decoding device (100) can determine the pre-agreed segmentation shape mode information as quad split. Quad splitting is a splitting mode that divides both the width and height of an encoding unit in half. The image decoding device (100) can obtain a coding unit of size 128x128 from a maximum coding unit of size 256x256 based on the splitting mode information. In addition, the image decoding device (100) can determine the size of the minimum coding unit as 4x4. The image decoding device (100) can obtain splitting mode information indicating "not splitting" for the minimum coding unit.
[0108] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is a square shape. For example, the image decoding device (100) may determine whether to not split a square encoding unit, to split it vertically, to split it horizontally, to split it into four encoding units, etc., according to the split shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not split an encoding unit (310a) having the same size as the current encoding unit (300) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (310b, 310c, 310d, 310e, 310f, etc.) based on the split shape mode information indicating a predetermined splitting method.
[0109] Referring to FIG. 3, the image decoding device (100) may determine two coding units (310b) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically divided, according to an embodiment. The image decoding device (100) may determine two coding units (310c) by horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is horizontally divided, according to an embodiment. The image decoding device (100) may determine four coding units (310d) by vertically and horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically and horizontally divided, according to an embodiment. The image decoding device (100) may determine three coding units (310e) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is ternary divided, according to an embodiment. The image decoding device (100) can determine three coding units (310f) into which the current coding unit (300) is horizontally divided based on the division shape mode information indicating that the ternary division is horizontally divided. However, the division shapes into which a square coding unit can be divided should not be interpreted as being limited to the above-described shapes, and may include various shapes that can be indicated by the division shape mode information. Specified division shapes into which a square coding unit is divided will be specifically described below through various embodiments.
[0110] FIG. 4 illustrates a process in which an image decoding device determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment.
[0111] According to one embodiment, the image decoding device (100) may utilize block shape information indicating that the current encoding unit is non-square. The image decoding device (100) may determine whether to not split the current non-square encoding unit or to split it using a predetermined method based on the split shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on the split shape mode information indicating a predetermined splitting method. The predetermined splitting method by which a non-square encoding unit is split will be described in detail through various embodiments below.
[0112] According to one embodiment, the image decoding device (100) may determine a form in which an encoding unit is split using split form mode information, and in this case, the split form mode information may indicate the number of at least one encoding unit generated by splitting the encoding unit. Referring to FIG. 4, when the split form mode information indicates that the current encoding unit (400 or 450) is split into two encoding units, the image decoding device (100) may split the current encoding unit (400 or 450) based on the split form mode information to determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit.
[0113] According to one embodiment, when the image decoding device (100) splits a current encoding unit (400 or 450) having a non-square shape based on split shape mode information, the image decoding device (100) may split the current encoding unit by considering the position of the long side of the non-square current encoding unit (400 or 450). For example, the image decoding device (100) may split the current encoding unit (400 or 450) in a direction that splits the long side of the current encoding unit (400 or 450) by considering the shape of the current encoding unit (400 or 450) to determine a plurality of encoding units.
[0114] According to one embodiment, if the split shape mode information indicates that the coding unit is split into an odd number of blocks (ternary splitting), the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450). For example, if the split shape mode information indicates that the current coding unit (400 or 450) is split into three coding units, the image decoding device (100) may split the current coding unit (400 or 450) into three coding units (430a, 430b, 430c, 480a, 480b, 480c).
[0115] According to one embodiment, the width and height ratio of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the width and height ratio is 4:1, the block shape information may be in the horizontal direction because the width is longer than the height. When the width and height ratio is 1:4, the block shape information may be in the vertical direction because the width is shorter than the height. The image decoding device (100) may determine to split the current encoding unit into an odd number of blocks based on the split shape mode information. In addition, the image decoding device (100) may determine the splitting direction of the current encoding unit (400 or 450) based on the block shape information of the current encoding unit (400 or 450). For example, if the current encoding unit (400) is in the vertical direction, the image decoding device (100) can divide the current encoding unit (400) in the horizontal direction to determine encoding units (430a, 430b, 430c). Also, if the current encoding unit (450) is in the horizontal direction, the image decoding device (100) can divide the current encoding unit (450) in the vertical direction to determine encoding units (480a, 480b, 480c).
[0116] According to one embodiment, the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450), and the sizes of the determined coding units may not all be the same. For example, among the determined odd number of coding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a given coding unit (430b or 480b) may have a different size from the other coding units (430a, 430c, 480a, 480c). That is, the encoding units into which the current encoding unit (400 or 450) can be divided and determined can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) can each have different sizes.
[0117] According to one embodiment, when the split shape mode information indicates that the coding unit is split into an odd number of blocks, the image decoding device (100) can determine an odd number of coding units included in the current coding unit (400 or 450), and further, the image decoding device (100) can place a predetermined restriction on at least one coding unit among the odd number of coding units generated by splitting. Referring to FIG. 4, the image decoding device (100) can perform a decoding process for a coding unit (430b, 480b) located in the center among three coding units (430a, 430b, 430c, 480a, 480b, 480c) generated by splitting the current coding unit (400 or 450) differently from the decoding process for other coding units (430a, 430c, 480a, 480c). For example, the image decoding device (100) can restrict the encoding unit (430b, 480b) located in the center from being split any further, unlike other encoding units (430a, 430c, 480a, 480c), or can restrict it to be split only a predetermined number of times.
[0118] FIG. 5 illustrates a process in which an image decoding device divides an encoding unit based on at least one of block shape information and division shape mode information, according to one embodiment.
[0119] According to one embodiment, the image decoding device (100) may determine whether to split or not to split a first coding unit (500) having a square shape into coding units based on at least one of block shape information and split shape mode information. According to one embodiment, when the split shape mode information indicates splitting the first coding unit (500) in the horizontal direction, the image decoding device (100) may split the first coding unit (500) in the horizontal direction to determine a second coding unit (510). The first coding unit, the second coding unit, and the third coding unit used according to one embodiment are terms used to understand the relationship before and after splitting between coding units. For example, when the first coding unit is split, the second coding unit may be determined, and when the second coding unit is split, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to follow the above-described characteristics.
[0120] According to one embodiment, the image decoding device (100) may determine to split or not split the determined second encoding unit (510) into encoding units based on the split shape mode information. Referring to FIG. 5, the image decoding device (100) may split the first encoding unit (500) based on the split shape mode information to split the determined second encoding unit (510) of a non-square shape into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) or may not split the second encoding unit (510). The image decoding device (100) can obtain split shape mode information, and the image decoding device (100) can split the first encoding unit (500) based on the obtained split shape mode information to split a plurality of second encoding units (e.g., 510) of various shapes, and the second encoding unit (510) can be split according to the way in which the first encoding unit (500) is split based on the split shape mode information. According to one embodiment, when the first encoding unit (500) is split into the second encoding unit (510) based on the split shape mode information for the first encoding unit (500), the second encoding unit (510) can also be split into the third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the split shape mode information for the second encoding unit (510). That is, the coding unit can be recursively split based on the split shape mode information associated with each coding unit. Accordingly, a square coding unit can be determined from a non-square coding unit, and such a square coding unit can be recursively split to determine a non-square coding unit.
[0121] Referring to FIG. 5, among the odd number of third coding units (520b, 520c, 520d) determined by splitting the second coding unit (510) having a non-square shape, a predetermined coding unit (e.g., a coding unit located in the middle or a coding unit having a square shape) may be split recursively. According to an embodiment, the third coding unit (520b) having a square shape, which is one of the odd number of third coding units (520b, 520c, 520d), may be split horizontally into a plurality of fourth coding units. The fourth coding unit (530b or 530d) having a non-square shape, which is one of the plurality of fourth coding units (530a, 530b, 530c, 530d), may be split again into a plurality of coding units. For example, the fourth coding unit (530b or 530d) having a non-square shape may be further divided into an odd number of coding units. Methods that can be used for recursive division of coding units will be described later through various embodiments.
[0122] According to one embodiment, the image decoding device (100) may split each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the split shape mode information. In addition, the image decoding device (100) may determine not to split the second encoding unit (510) based on the split shape mode information. According to one embodiment, the image decoding device (100) may split the second encoding unit (510) having a non-square shape into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a predetermined restriction on a predetermined third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the image decoding device (100) can limit the encoding unit (520c) located in the middle among an odd number of third encoding units (520b, 520c, 520d) to not be divided any further or to be divided a settable number of times.
[0123] Referring to FIG. 5, the image decoding device (100) may limit the coding unit (520c) located in the middle among the odd number of third coding units (520b, 520c, 520d) included in the second coding unit (510) having a non-square shape to not be split any further, or to be split in a predetermined split form (for example, to be split only into four coding units or to be split in a form corresponding to the split form of the second coding unit (510), or to be split only a predetermined number of times (for example, to be split only n times, where n>0). However, the above limitations on the coding unit (520c) located in the middle are merely simple embodiments and should not be interpreted as being limited to the above-described embodiments, but should be interpreted as including various limitations in which the coding unit (520c) located in the middle can be decoded differently from the other coding units (520b, 520d).
[0124] According to one embodiment, the image decoding device (100) can obtain the segmentation shape mode information used to segment the current encoding unit from a predetermined location within the current encoding unit.
[0125] FIG. 6 illustrates a method for a video decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.
[0126] Referring to FIG. 6, the split shape mode information of the current encoding unit (600, 650) can be obtained from a sample at a predetermined position among a plurality of samples included in the current encoding unit (600, 650) (for example, a sample (640, 690) located in the center). However, the predetermined position within the current encoding unit (600) from which at least one of the split shape mode information can be obtained should not be interpreted as being limited to the center position illustrated in FIG. 6, but should be interpreted as including various positions (for example, the top, bottom, left, right, upper left, lower left, upper right, or lower right, etc.) that can be included within the current encoding unit (600). The image decoding device (100) can obtain the split shape mode information obtained from the predetermined position and determine whether or not to split the current encoding unit into encoding units of various shapes and sizes.
[0127] According to one embodiment, the image decoding device (100) may select one of the coding units when the current coding unit is divided into a predetermined number of coding units. Various methods may be used to select one of the multiple coding units, and descriptions of such methods will be provided later through various embodiments.
[0128] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine an encoding unit at a predetermined position.
[0129] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the odd-numbered coding units to determine an coding unit located in the middle of the odd-numbered coding units. Referring to FIG. 6, the image decoding device (100) may divide the current coding unit (600) or the current coding unit (650) to determine odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c). The image decoding device (100) may use information about the positions of the odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c) to determine the middle coding unit (620b) or the middle coding unit (660b). For example, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of predetermined samples included in the coding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of samples (630a, 630b, 630c) at the upper left of the coding units (620a, 620b, 620c).
[0130] According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information on the positions or coordinates of the coding units (620a, 620b, 620c) within the picture. According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information indicating the width or height of the coding units (620a, 620b, 620c) included in the current coding unit (600), and this width or height may correspond to information indicating the difference between the coordinates of the coding units (620a, 620b, 620c) within the picture. That is, the image decoding device (100) can determine the encoding unit (620b) located in the center by directly using information about the positions or coordinates of the encoding units (620a, 620b, 620c) within the picture or by using information about the width or height of the encoding unit corresponding to the difference between the coordinates.
[0131] According to one embodiment, information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a) may represent (xa, ya) coordinates, information indicating the position of the sample (530b) at the upper left of the middle encoding unit (620b) may represent (xb, yb) coordinates, and information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c) may represent (xc, yc) coordinates. The image decoding device (100) may determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in the encoding units (620a, 620b, 620c), respectively. For example, when the coordinates of the samples (630a, 630b, 630c) on the upper left are sorted in ascending or descending order, the encoding unit (620b) including the coordinates (xb, yb) of the sample (630b) located in the center can be determined as the encoding unit located in the center among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the position of the upper left samples (630a, 630b, 630c) can indicate coordinates indicating the absolute position within the picture, and further, based on the position of the upper left sample (630a) of the upper left coding unit (620a), the (dxb, dyb) coordinates, which are information indicating the relative position of the sample (630b) of the upper left of the middle coding unit (620b), and the (dxc, dyc) coordinates, which are information indicating the relative position of the sample (630c) of the upper left of the lower coding unit (620c), can be used. In addition, the method of determining the coding unit of a given position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the coding unit should not be interpreted as being limited to the above-described method, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.
[0132] According to one embodiment, the image decoding device (100) may divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c), and select an encoding unit from among the encoding units (620a, 620b, 620c) according to a predetermined criterion. For example, the image decoding device (100) may select an encoding unit (620b) having a different size from among the encoding units (620a, 620b, 620c).
[0133] According to one embodiment, the image decoding device (100) may determine the width or height of each of the encoding units (620a, 620b, 620c) by using the (xa, ya) coordinate, which is information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a), the (xb, yb) coordinate, which is information indicating the position of the sample (630b) at the upper left of the middle encoding unit (620b), and the (xc, yc) coordinate, which is information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using coordinates (xa, ya), (xb, yb), (xc, yc) indicating the positions of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) can determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) can determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The image decoding device (100) may determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine the middle encoding unit (620b) having a different size from the sizes of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, the process by which the image decoding device (100) described above determines the encoding unit having a different size from other encoding units is merely an embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining the encoding unit of a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.
[0134] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) by using the (xd, yd) coordinate, which is information indicating the position of the sample (670a) at the upper left of the left encoding unit (660a), the (xe, ye) coordinate, which is information indicating the position of the sample (670b) at the upper left of the middle encoding unit (660b), and the (xf, yf) coordinate, which is information indicating the position of the sample (670c) at the upper left of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) by using the (xd, yd), (xe, ye), (xf, yf), which are coordinates indicating the positions of the encoding units (660a, 660b, 660c).
[0135] According to one embodiment, the image decoding device (100) may determine the width of the left encoding unit (660a) as xe-xd. The image decoding device (100) may determine the height of the left encoding unit (660a) as the height of the current encoding unit (650). According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (660b) as xf-xe. The image decoding device (100) may determine the height of the middle encoding unit (660b) as the height of the current encoding unit (600). According to one embodiment, the image decoding device (100) may determine the width or height of the right encoding unit (660c) using the width or height of the current encoding unit (650) and the widths and heights of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (660a, 660b, 660c). Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (660b) having a different size from the sizes of the left encoding unit (660a) and the right encoding unit (660c) as an encoding unit at a predetermined position. However, the process of the image decoding device (100) described above determining an encoding unit having a different size from other encoding units is merely an embodiment of determining an encoding unit at a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining an encoding unit at a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.
[0136] However, the location of the sample considered for determining the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and it can be interpreted that information on the location of any sample included in the encoding unit can be used.
[0137] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position from among an odd number of encoding units determined by splitting the current encoding unit, taking into consideration the shape of the current encoding unit. For example, if the current encoding unit has a non-square shape in which the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position in the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the horizontal direction and place a restriction on the corresponding encoding unit. If the current encoding unit has a non-square shape in which the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position in the vertical direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the vertical direction and place a restriction on the corresponding encoding unit.
[0138] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the even-numbered coding units to determine the coding unit at a predetermined position among the even-numbered coding units. The image decoding device (100) may determine the even-numbered coding units by dividing the current coding unit (binary dividing) and may determine the coding unit at a predetermined position using information about the positions of the even-numbered coding units. A specific process for this may be a process corresponding to the process of determining the coding unit at a predetermined position (e.g., the center position) among the odd-numbered coding units described above in FIG. 6, and thus will be omitted.
[0139] According to one embodiment, when a current encoding unit having a non-square shape is split into a plurality of encoding units, predetermined information about the encoding unit at a predetermined position may be used during the splitting process to determine an encoding unit at a predetermined position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and split shape mode information stored in a sample included in a middle encoding unit during the splitting process to determine an encoding unit located in the middle among the encoding units into which the current encoding unit is split.
[0140] Referring to FIG. 6, the image decoding device (100) can split the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, and can determine the encoding unit (620b) located in the middle among the plurality of encoding units (620a, 620b, 620c). Furthermore, the image decoding device (100) can determine the encoding unit (620b) located in the middle by considering the position where the split shape mode information is acquired. That is, the split shape mode information of the current encoding unit (600) can be obtained from a sample (640) located in the center of the current encoding unit (600), and when the current encoding unit (600) is split into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, the encoding unit (620b) including the sample (640) can be determined as the encoding unit located in the center. However, the information used to determine the encoding unit located in the center should not be interpreted as being limited to the split shape mode information, and various types of information can be used in the process of determining the encoding unit located in the center.
[0141] According to one embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the image decoding device (100) may use split shape mode information obtained from a sample at a predetermined position within the current coding unit (600) (e.g., a sample located at the center of the current coding unit (600)) to determine a coding unit at a predetermined position among a plurality of coding units (620a, 620b, 620c) determined by splitting the current coding unit (600) (e.g., a coding unit located at the center of the coding units split into multiple units). That is, the image decoding device (100) can determine the sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine an encoding unit (620b) that includes a sample from which predetermined information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600), and can set a predetermined restriction. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located at the center of the current encoding unit (600) as a sample from which predetermined information can be obtained, and the image decoding device (100) can set a predetermined restriction on the encoding unit (620b) that includes such a sample (640) during the decoding process. However, the location of the sample from which certain information can be obtained should not be interpreted as being limited to the above-described location, but may be interpreted as samples at any location included in the encoding unit (620b) to be determined in order to set a limitation.
[0142] According to one embodiment, the position of a sample from which predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, the block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the position of a sample from which predetermined information can be obtained according to the shape. For example, the image decoding apparatus (100) may use at least one of information about the width and information about the height of the current encoding unit to determine a sample located on a boundary that divides at least one of the width and the height of the current encoding unit in half as a sample from which predetermined information can be obtained. As another example, when the block shape information related to the current encoding unit indicates that the shape is non-square, the image decoding apparatus (100) may determine one of the samples including a boundary that divides the long side of the current encoding unit in half as a sample from which predetermined information can be obtained.
[0143] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, the image decoding device (100) may use the split shape mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain the split shape mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by splitting the current encoding unit using the split shape mode information obtained from the sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the split shape mode information obtained from the sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described above with reference to FIG. 5, a detailed description thereof will be omitted.
[0144] According to one embodiment, the image decoding device (100) can divide a current encoding unit to determine at least one encoding unit, and can determine the order in which the at least one encoding unit is decoded according to a predetermined block (e.g., the current encoding unit).
[0145] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device determines multiple encoding units by dividing a current encoding unit according to one embodiment.
[0146] According to one embodiment, the image decoding device (100) may determine second encoding units (710a, 710b) by vertically splitting the first encoding unit (700) according to the splitting shape mode information, determine second encoding units (730a, 730b) by horizontally splitting the first encoding unit (700), or determine second encoding units (750a, 750b, 750c, 750d) by vertically and horizontally splitting the first encoding unit (700).
[0147] Referring to FIG. 7, the image decoding device (100) can determine the order in which the second encoding units (710a, 710b) determined by vertically dividing the first encoding unit (700) are processed in the horizontal direction (710c). The image decoding device (100) can determine the order in which the second encoding units (730a, 730b) determined by horizontally dividing the first encoding unit (700) are processed in the vertical direction (730c). The image decoding device (100) can determine the second encoding units (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) in the vertical and horizontal directions according to a predetermined order (e.g., raster scan order or z scan order (750e), etc.) in which encoding units located in one row are processed and then encoding units located in the next row are processed.
[0148] According to one embodiment, the image decoding device (100) can recursively split the encoding units. Referring to FIG. 7, the image decoding device (100) can split the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively split each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method for splitting a plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method for splitting the first coding unit (700). Accordingly, the plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently split into a plurality of coding units. Referring to FIG. 7, the image decoding device (100) may split the first coding unit (700) in the vertical direction to determine the second coding units (710a, 710b), and further may determine to independently split or not split each of the second coding units (710a, 710b).
[0149] According to one embodiment, the image decoding device (100) may horizontally divide the second encoding unit (710a) on the left into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right.
[0150] According to one embodiment, the processing order of the coding units may be determined based on the splitting process of the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before splitting. The image decoding device (100) may determine the processing order of the third coding units (720a, 720b) determined by splitting the second coding unit (710a) on the left, independently from the second coding unit (710b) on the right. Since the second coding unit (710a) on the left is split horizontally and the third coding units (720a, 720b) are determined, the third coding units (720a, 720b) may be processed in the vertical direction (720c). In addition, since the order in which the second encoding unit (710a) on the left and the second encoding unit (710b) on the right are processed corresponds to the horizontal direction (710c), the right encoding unit (710b) can be processed after the third encoding units (720a, 720b) included in the second encoding unit (710a) on the left are processed in the vertical direction (720c). Since the above-described content is intended to explain the process in which the processing order of the encoding units is determined according to the encoding units before splitting, it should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units that are split and determined in various forms can be independently processed according to a predetermined order.
[0151] FIG. 8 illustrates a process for determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment.
[0152] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is split into an odd number of encoding units based on the acquired split shape mode information. Referring to FIG. 8, a first encoding unit (800) having a square shape may be split into second encoding units (810a, 810b) having a non-square shape, and the second encoding units (810a, 810b) may each be independently split into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by horizontally dividing the left encoding unit (810a) among the second encoding units, and can divide the right encoding unit (810b) into an odd number of third encoding units (820c, 820d, 820e).
[0153] According to one embodiment, the image decoding device (100) can determine whether there is an odd number of split coding units by determining whether the third coding units (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order. Referring to FIG. 8, the image decoding device (100) can determine the third coding units (820a, 820b, 820c, 820d, 820e) by recursively splitting the first coding unit (800). The image decoding device (100) can determine whether the first encoding unit (800), the second encoding unit (810a, 810b), or the third encoding unit (820a, 820b, 820c, 820d, 820e) is divided into an odd number of encoding units based on at least one of the block shape information and the split shape mode information. For example, the encoding unit located on the right side of the second encoding unit (810a, 810b) can be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which the plurality of encoding units included in the first encoding unit (800) are processed can be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) can determine whether the third encoding unit (820c, 820d, 820e) determined by dividing the second encoding unit (810b) on the right into odd numbers satisfies the condition that it can be processed according to the predetermined order.
[0154] According to one embodiment, the image decoding device (100) may determine whether the third encoding units (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second encoding unit (810a, 810b) is split in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by splitting the height of the left second encoding unit (810a) of a non-square shape in half may satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e) determined by dividing the right second encoding unit (810b) into three encoding units do not divide the width or height of the right second encoding unit (810b) in half, it may be determined that the third encoding units (820c, 820d, 820e) do not satisfy the condition. In the case where this condition is not satisfied, the image decoding device (100) may determine that there is a disconnection in the scanning order, and may determine that the right second encoding unit (810b) is divided into an odd number of encoding units based on the determination result. According to an embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions have been described above through various embodiments, a detailed description thereof will be omitted.
[0155] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment.
[0156] According to one embodiment, the image decoding device (100) may split the first encoding unit (900) based on the split shape mode information obtained through the receiver (110). The first encoding unit (900) having a square shape may be split into four square-shaped encoding units or may be split into a plurality of non-square encoding units. For example, referring to FIG. 9, when the first encoding unit (900) is square and the split shape mode information indicates that it is split into non-square encoding units, the image decoding device (100) may split the first encoding unit (900) into a plurality of non-square encoding units. Specifically, when the split shape mode information indicates that the first encoding unit (900) is split in the horizontal direction or the vertical direction to determine an odd number of encoding units, the image decoding device (100) can split the first encoding unit (900) having a square shape into second encoding units (910a, 910b, 910c) determined by splitting them in the vertical direction into an odd number of encoding units or second encoding units (920a, 920b, 920c) determined by splitting them in the horizontal direction.
[0157] According to one embodiment, the image decoding device (100) can determine whether the second encoding units (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfy a condition that allows them to be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first encoding unit (900) is split in half according to the boundary of the second encoding units (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, since the boundaries of the second coding units (910a, 910b, 910c) determined by vertically dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. In addition, since the boundaries of the second coding units (920a, 920b, 920c) determined by horizontally dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. If such a condition is not satisfied, the image decoding device (100) may determine that the scan order is disconnected, and based on the determination result, may determine that the first encoding unit (900) is divided into an odd number of encoding units. According to one embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions, etc. have been described above through various embodiments, a detailed description thereof will be omitted.
[0158] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine encoding units of various shapes.
[0159] Referring to FIG. 9, the image decoding device (100) can divide the first encoding unit (900) having a square shape and the first encoding unit (930 or 950) having a non-square shape into encoding units of various shapes.
[0160] FIG. 10 illustrates that, according to one embodiment, a video decoding device limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by dividing a first encoding unit satisfies a predetermined condition.
[0161] According to one embodiment, the image decoding device (100) may determine to split a first coding unit (1000) having a square shape into second coding units (1010a, 1010b, 1020a, 1020b) having a non-square shape based on the split shape mode information obtained through the receiver (110). The second coding units (1010a, 1010b, 1020a, 1020b) may be split independently. Accordingly, the image decoding device (100) may determine to split or not split into a plurality of coding units based on the split shape mode information related to each of the second coding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine third encoding units (1012a, 1012b) by horizontally dividing the left second encoding unit (1010a) having a non-square shape determined by vertically dividing the first encoding unit (1000). However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted from being horizontally divided in the same direction as the direction in which the left second encoding unit (1010a) is divided. If the second encoding unit on the right (1010b) is split in the same direction to determine the third encoding unit (1014a, 1014b), the second encoding unit on the left (1010a) and the second encoding unit on the right (1010b) may be independently split in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) splitting the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the split shape mode information, which may be inefficient in terms of image decoding.
[0162] According to one embodiment, the image decoding device (100) may determine third coding units (1022a, 1022b, 1024a, 1024b) by vertically dividing a second coding unit (1020a or 1020b) having a non-square shape determined by dividing a first coding unit (1000) in a horizontal direction. However, when the image decoding device (100) vertically divides one of the second coding units (e.g., the upper second coding unit (1020a)), the other second coding units (e.g., the lower coding unit (1020b)) may be restricted from being vertically divided in the same direction as the direction in which the upper second coding unit (1020a) is divided, for the reasons described above.
[0163] FIG. 11 illustrates a process of a video decoding device dividing a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment.
[0164] According to one embodiment, the image decoding device (100) may split the first encoding unit (1100) based on the split shape mode information to determine the second encoding units (1110a, 1110b, 1120a, 1120b, etc.). The split shape mode information may include information about various shapes into which the encoding unit may be split, but the information about various shapes may not include information for splitting the encoding unit into four encoding units having a square shape. According to this split shape mode information, the image decoding device (100) cannot split the first encoding unit (1100) having a square shape into four second encoding units having a square shape (1130a, 1130b, 1130c, 1130d). Based on the segmentation shape mode information, the image decoding device (100) can determine a second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) of a non-square shape.
[0165] According to one embodiment, the image decoding device (100) can independently split each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) having a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be split in a predetermined order using a recursive method, which may be a splitting method corresponding to a method in which the first encoding unit (1100) is split based on splitting shape mode information.
[0166] For example, the image decoding device (100) can determine third coding units (1112a, 1112b) having a square shape by splitting the left second coding unit (1110a) in the horizontal direction, and can determine third coding units (1114a, 1114b) having a square shape by splitting the right second coding unit (1110b) in the horizontal direction. Furthermore, the image decoding device (100) can also determine third coding units (1116a, 1116b, 1116c, 1116d) having a square shape by splitting both the left second coding unit (1110a) and the right second coding unit (1110b) in the horizontal direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).
[0167] As another example, the image decoding device (100) may determine third coding units (1122a, 1122b) having a square shape by vertically splitting the upper second coding unit (1120a), and may determine third coding units (1124a, 1124b) having a square shape by vertically splitting the lower second coding unit (1120b). Furthermore, the image decoding device (100) may determine third coding units (1126a, 1126b, 1126a, 1126b) having a square shape by vertically splitting both the upper second coding unit (1120a) and the lower second coding unit (1120b). In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).
[0168] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.
[0169] According to one embodiment, the image decoding device (100) may split the first encoding unit (1200) based on the split shape mode information. If the block shape is square and the split shape mode information indicates that the first encoding unit (1200) is split in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may split the first encoding unit (1200) to determine second encoding units (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) having a non-square shape determined by splitting the first encoding unit (1200) only in the horizontal direction or the vertical direction may be independently split based on the split shape mode information for each. For example, the image decoding device (100) can determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing second encoding units (1210a, 1210b) generated by vertically dividing the first encoding unit (1200), and can determine third encoding units (1226a, 1226b, 1226c, 1226d) by horizontally dividing second encoding units (1220a, 1220b) generated by horizontally dividing the first encoding unit (1200). Since the process of dividing the second encoding units (1210a, 1210b, 1220a, 1220b) has been described above with reference to FIG. 11, a detailed description thereof will be omitted.
[0170] According to one embodiment, the image decoding device (100) can process encoding units according to a predetermined order. Since the characteristics of processing encoding units according to a predetermined order have been described above with reference to FIG. 7, a detailed description thereof will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a first encoding unit (1200) having a square shape and determine four third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) depending on the form in which the first encoding unit (1200) is divided.
[0171] According to one embodiment, the image decoding device (100) may determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing the second encoding units (1210a, 1210b) generated by vertically dividing them, and the image decoding device (100) may process the third encoding units (1216a, 1216b, 1216c, 1216d) according to an order (1217) of first processing the third encoding units (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction and then processing the third encoding units (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.
[0172] According to one embodiment, the image decoding device (100) may determine third encoding units (1226a, 1226b, 1226c, 1226d) by vertically dividing the second encoding units (1220a, 1220b) generated by being divided in the horizontal direction, and the image decoding device (100) may process the third encoding units (1226a, 1226b, 1226c, 1226d) according to an order (1227) of first processing the third encoding units (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction and then processing the third encoding units (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.
[0173] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) can be divided into third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. The second encoding units (1210a, 1210b) determined by being split in the vertical direction and the second encoding units (1220a, 1220b) determined by being split in the horizontal direction are split into different shapes, but according to the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined later, the first encoding unit (1200) is ultimately split into encoding units of the same shape. Accordingly, even if the image decoding device (100) determines encoding units of the same shape as a result by recursively splitting the encoding units through different processes based on the split shape mode information, it can process a plurality of encoding units determined in the same shape in different orders.
[0174] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment.
[0175] According to one embodiment, the image decoding device (100) may determine the depth of an encoding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of a long side of the encoding unit. If the length of the long side of the current encoding unit is split to be 2n (n>0) times the length of the long side of the encoding unit before splitting, the image decoding device (100) may determine that the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before splitting. Hereinafter, an encoding unit with an increased depth is expressed as an encoding unit of a lower depth.
[0176] Referring to FIG. 13, according to one embodiment, based on block shape information indicating a square shape (for example, the block shape information may indicate '0: SQUARE'), the image decoding device (100) may divide a first coding unit (1300) having a square shape to determine a second coding unit (1302), a third coding unit (1304), etc. of a lower depth. If the size of the first coding unit (1300) having a square shape is 2Nx2N, the second coding unit (1302) determined by dividing the width and height of the first coding unit (1300) by half may have a size of NxN. Furthermore, the third coding unit (1304) determined by dividing the width and height of the second coding unit (1302) by half may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 of the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 of the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 of the width and height of the first encoding unit (1300), may be D+2.
[0177] In one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate '1: NS_VER' indicating a non-square shape in which the height is longer than the width or '2: NS_HOR' indicating a non-square shape in which the width is longer than the height), the image decoding device (100) may split a first coding unit (1310 or 1320) having a non-square shape to determine a second coding unit (1312 or 1322), a third coding unit (1314 or 1324) of a lower depth, etc.
[0178] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and height of the first encoding unit (1310) having a size of Nx2N. That is, the image decoding device (100) can split the first encoding unit (1310) in the horizontal direction to determine a second encoding unit (1302) having a size of NxN or a second encoding unit (1322) having a size of NxN / 2, and can also split the first encoding unit (1310) in the horizontal direction and the vertical direction to determine a second encoding unit (1312) having a size of N / 2xN.
[0179] According to one embodiment, the image decoding device (100) may determine a second coding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and the height of the first coding unit (1320) having a size of 2NxN. That is, the image decoding device (100) may split the first coding unit (1320) in the vertical direction to determine a second coding unit (1302) having a size of NxN or a second coding unit (1312) having a size of N / 2xN, and may also split the first coding unit (1320) in the horizontal direction and the vertical direction to determine a second coding unit (1322) having a size of NxN / 2.
[0180] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1302) having a size of NxN. That is, the image decoding device (100) may split the second encoding unit (1302) in the vertical direction and the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2, a third encoding unit (1314) having a size of N / 4xN / 2, or a third encoding unit (1324) having a size of N / 2xN / 4.
[0181] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1312) having a size of N / 2xN. That is, the image decoding device (100) may split the second encoding unit (1312) in the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1324) having a size of N / 2xN / 4, or split the second encoding unit (1312) in the vertical direction and the horizontal direction to determine a third encoding unit (1314) having a size of N / 4xN / 2.
[0182] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1322) having a size of NxN / 2. That is, the image decoding device (100) may split the second encoding unit (1322) in the vertical direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1314) having a size of N / 4xN / 2, or split the second encoding unit (1322) in the vertical direction and the horizontal direction to determine a third encoding unit (1324) having a size of N / 2xN / 4.
[0183] According to one embodiment, the image decoding device (100) may split a square-shaped encoding unit (e.g., 1300, 1302, 1304) in a horizontal direction or a vertical direction. For example, a first encoding unit (1300) having a size of 2Nx2N may be split in the vertical direction to determine a first encoding unit (1310) having a size of Nx2N, or may be split in the horizontal direction to determine a first encoding unit (1320) having a size of 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by splitting the first encoding unit (1300) having a size of 2Nx2N in the horizontal direction or the vertical direction may be the same as the depth of the first encoding unit (1300).
[0184] According to one embodiment, the width and height of the third coding unit (1314 or 1324) may be 1 / 4 times that of the first coding unit (1310 or 1320). When the depth of the first coding unit (1310 or 1320) is D, the depth of the second coding unit (1312 or 1322), which is 1 / 2 times the width and height of the first coding unit (1310 or 1320), may be D+1, and the depth of the third coding unit (1314 or 1324), which is 1 / 4 times the width and height of the first coding unit (1310 or 1320), may be D+2.
[0185] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.
[0186] According to one embodiment, the image decoding device (100) may split a first encoding unit (1400) having a square shape to determine second encoding units of various shapes. Referring to FIG. 14, the image decoding device (100) may split the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the split shape mode information to determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d). That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the split shape mode information for the first encoding unit (1400).
[0187] According to one embodiment, the depth of the second coding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) determined according to the split shape mode information for the first coding unit (1400) having a square shape may be determined based on the length of the long side. For example, since the length of one side of the first coding unit (1400) having a square shape and the length of the long side of the second coding unit (1402a, 1402b, 1404a, 1404b) having a non-square shape are the same, the depth of the first coding unit (1400) and the second coding units (1402a, 1402b, 1404a, 1404b) having a non-square shape may be considered to be the same as D. In contrast, when the image decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the split shape mode information, the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), so the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than D, the depth of the first encoding unit (1400).
[0188] According to one embodiment, the image decoding device (100) may split a first encoding unit (1410) having a height greater than its width into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) in a horizontal direction according to the splitting shape mode information. According to one embodiment, the image decoding device (100) may split a first encoding unit (1420) having a width greater than its height into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) in a vertical direction according to the splitting shape mode information.
[0189] According to one embodiment, the depth of the second coding unit (1412a, 1412b, 1414a, 1414b, 1414c. 1422a, 1422b, 1424a, 1424b, 1424c) determined based on the split shape mode information for the first coding unit (1410 or 1420) of a non-square shape may be determined based on the length of the long side. For example, since the length of one side of the second encoding unit (1412a, 1412b) in the shape of a square is half the length of one side of the first encoding unit (1410) in the shape of a non-square having a height longer than a width, the depth of the second encoding unit (1412a, 1412b) in the shape of a square is D+1, which is one depth lower than the depth D of the first encoding unit (1410) in the shape of a non-square.
[0190] Furthermore, the image decoding device (100) may split a non-square first encoding unit (1410) into an odd number of second encoding units (1414a, 1414b, 1414c) based on the split shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) may include a non-square second encoding unit (1414a, 1414c) and a square second encoding unit (1414b). In this case, since the length of the long side of the second encoding unit (1414a, 1414c) of a non-square shape and the length of one side of the second encoding unit (1414b) of a square shape are half the length of one side of the first encoding unit (1410), the depth of the second encoding unit (1414a, 1414b, 1414c) may be a depth of D+1, which is one depth lower than D, which is the depth of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the first encoding unit (1420) of a non-square shape, in which the width is longer than the height, in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).
[0191] According to one embodiment, when determining an index (PID) for distinguishing divided coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units divided into an odd number are not of the same size. Referring to FIG. 14, among the coding units (1414a, 1414b, 1414c) divided into an odd number, the coding unit (1414b) located in the middle may have the same width as the other coding units (1414a, 1414c) but may have a height that is twice the height of the coding units (1414a, 1414c) that are different in height. That is, in this case, the coding unit (1414b) located in the middle may include two of the other coding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scanning order is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2. In other words, there may be a discontinuity in the index value. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on the presence or absence of discontinuity in the index for distinguishing between the divided encoding units.
[0192] According to one embodiment, the image decoding device (100) may determine whether the image is divided into a specific split shape based on the value of an index for distinguishing a plurality of coding units that are divided from the current coding unit. Referring to FIG. 14, the image decoding device (100) may divide a first coding unit (1410) having a rectangular shape in which the height is longer than the width, to determine an even number of coding units (1412a, 1412b) or an odd number of coding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to one embodiment, the PID may be obtained from a sample (for example, an upper left sample) at a predetermined position of each coding unit.
[0193] According to one embodiment, the image decoding device (100) may determine an coding unit at a predetermined position among the coding units that are divided and determined using an index for distinguishing the coding units. According to one embodiment, when the split shape mode information for the first coding unit (1410) having a rectangular shape with a height longer than the width indicates that the first coding unit (1410) is divided into three coding units, the image decoding device (100) may divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) may assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) may compare the indexes for each coding unit to determine the middle coding unit among the coding units divided into an odd number of coding units. The image decoding device (100) may determine a coding unit (1414b) having an index corresponding to a middle value among the indices of the coding units as a coding unit at a middle position among the coding units determined by splitting the first coding unit (1410). According to an embodiment, when determining an index for distinguishing the split coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units do not have the same size. Referring to FIG. 14, the coding unit (1414b) generated by splitting the first coding unit (1410) may have the same width as other coding units (1414a, 1414c) but may be twice the height of the coding units (1414a, 1414c) that are different in height. In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2.In cases like this where the index increases uniformly and then the increase amount changes, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units including encoding units having different sizes from other encoding units. According to one embodiment, when the split shape mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit into a form in which an encoding unit at a predetermined position among the odd number of encoding units (for example, a middle encoding unit) has a different size from the other encoding units. In this case, the image decoding device (100) may determine a middle encoding unit having a different size using an index (PID) for the encoding unit. However, the above-described index, the size or position of the encoding unit at the predetermined position to be determined are specific for explaining one embodiment and should not be interpreted as being limited thereto, and it should be interpreted that various indexes, positions and sizes of encoding units can be used.
[0194] According to one embodiment, the image decoding device (100) may utilize a predetermined data unit from which recursive division of the encoding unit begins.
[0195] FIG. 15 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.
[0196] According to one embodiment, a predetermined data unit may be defined as a data unit from which a coding unit begins to be recursively split using split shape mode information. That is, it may correspond to a coding unit of the highest depth used in the process of determining multiple coding units for splitting the current picture. For convenience of explanation, this predetermined data unit will be referred to as a reference data unit hereinafter.
[0197] In one embodiment, the reference data unit may exhibit a predetermined size and shape. In one embodiment, the reference coding unit may include MxN samples, where M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may exhibit a square or non-square shape, and may be subsequently divided into an integer number of coding units.
[0198] According to one embodiment, the video decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the video decoding device (100) can divide the plurality of reference data units into which the current picture is divided using division type mode information for each reference data unit. This division process of the reference data units can correspond to a division process using a quad-tree structure.
[0199] According to one embodiment, the image decoding device (100) may determine in advance the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) may determine reference data units of various sizes having a size greater than or equal to the minimum size, and may determine at least one encoding unit using segmentation mode information based on the determined reference data unit.
[0200] Referring to FIG. 15, the image decoding device (100) may use a reference coding unit (1500) having a square shape, or may use a reference coding unit (1502) having a non-square shape. According to one embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that may include at least one reference coding unit.
[0201] According to one embodiment, the receiving unit (110) of the image decoding device (100) can obtain at least one of information on the shape of the reference coding unit and information on the size of the reference coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped reference coding unit (1500) has been described above through the process of splitting the current coding unit (300) of FIG. 3, and the process of determining at least one coding unit included in the non-square-shaped reference coding unit (1502) has been described above through the process of splitting the current coding unit (400 or 450) of FIG. 4, so a detailed description thereof will be omitted.
[0202] According to one embodiment, the image decoding device (100) may use an index for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit according to some data units that are predetermined based on a predetermined condition. That is, the receiving unit (110) may obtain only an index for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., among the various data units (e.g., sequences, pictures, slices, slice segments, tiles, tile groups, maximum coding units, etc.) that satisfy a predetermined condition (e.g., data units having a size smaller than a slice) from the bitstream. The image decoding device (100) may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When information about the shape of the reference coding unit and information about the size of the reference coding unit are obtained from the bitstream for each relatively small-sized data unit and used, the efficiency of the bitstream may not be good. Therefore, instead of directly obtaining information about the shape of the reference coding unit and information about the size of the reference coding unit, only the index may be obtained and used. In this case, at least one of the size and shape of the reference coding unit corresponding to the index indicating the size and shape of the reference coding unit may be determined in advance. That is, the image decoding device (100) can determine at least one of the size and shape of the reference coding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the sizes and shapes of the predetermined reference coding units according to the index.
[0203] According to one embodiment, the image decoding device (100) may use at least one reference coding unit included in one maximum coding unit. That is, a maximum coding unit for dividing an image may include at least one reference coding unit, and a coding unit may be determined through a recursive splitting process of each reference coding unit. According to one embodiment, at least one of the width and the height of the maximum coding unit may correspond to an integer multiple of at least one of the width and the height of the reference coding unit. According to one embodiment, the size of the reference coding unit may be a size obtained by splitting the maximum coding unit n times according to a quad tree structure. That is, the image decoding device (100) may determine the reference coding unit by splitting the maximum coding unit n times according to the quad tree structure, and may split the reference coding unit based on at least one of block shape information and split shape mode information according to various embodiments.
[0204] According to one embodiment, the video decoding device (100) may obtain and use block shape information indicating the shape of the current encoding unit or split shape mode information indicating a method of splitting the current encoding unit from the bitstream. The split shape mode information may be included in a bitstream related to various data units. For example, the video decoding device (100) may use split shape mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. Furthermore, the video decoding device (100) may obtain and use syntax information (e.g., syntax elements) corresponding to block shape information or split shape mode information from the bitstream for each maximum encoding unit, each reference encoding unit, and each processing block.
[0205] Hereinafter, a method for determining a partitioning rule according to one embodiment of the present disclosure will be described in detail.
[0206] The video decoding device (100) can determine a segmentation rule of the video. The segmentation rule may be predetermined between the video decoding device (100) and the video encoding device (200). The video decoding device (100) can determine the segmentation rule of the video based on information obtained from a bitstream. The video decoding device (100) can determine the segmentation rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. The video decoding device (100) can determine the segmentation rule differently according to a frame, a slice, a tile, a temporal layer, a maximum coding unit, or an coding unit.
[0207] The image decoding device (100) may determine a segmentation rule based on the block shape of the encoding unit. The block shape may include the size, shape, width and height ratio, and direction of the encoding unit. The image decoding device (100) may determine in advance that the segmentation rule will be determined based on the block shape of the encoding unit. However, the present invention is not limited thereto. The image decoding device (100) may determine the segmentation rule based on information obtained from the received bitstream.
[0208] The shape of the encoding unit may include a square and a non-square. If the width and height of the encoding unit are equal, the image decoding device (100) may determine the shape of the encoding unit as a square. In addition, if the width and height of the encoding unit are not equal, the image decoding device (100) may determine the shape of the encoding unit as a non-square.
[0209] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may be classified according to the length of the long side, the length of the short side, or the area of the coding unit. The image decoding device (100) may apply the same splitting rule to the coding units classified into the same group. For example, the image decoding device (100) may classify the coding units having the same long side length into the same size. In addition, the image decoding device (100) may apply the same splitting rule to the coding units having the same long side length.
[0210] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32, etc. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the length of the width of the coding unit is longer than the length of the height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of the height.
[0211] The image decoding device (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoding device (100) can determine a different allowable splitting mode based on the size of the encoding unit. For example, the image decoding device (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoding device (100) can determine a splitting direction based on the size of the encoding unit. The image decoding device (100) can determine an allowable splitting type based on the size of the encoding unit.
[0212] Determining the splitting rule based on the size of the encoding unit may be a splitting rule predetermined between the image decoding devices (100). In addition, the image decoding device (100) may determine the splitting rule based on information obtained from the bitstream.
[0213] The image decoding device (100) can adaptively determine a segmentation rule based on the position of the encoding unit. The image decoding device (100) can adaptively determine a segmentation rule based on the position that the encoding unit occupies in the image.
[0214] Additionally, the image decoding device (100) can determine a splitting rule so that encoding units generated through different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated through different splitting paths may have the same block shape. Encoding units generated through different splitting paths may have different decoding processing orders. Since the decoding processing order has been described together with FIG. 12, a detailed description thereof will be omitted.
[0215] Figure 16 is a block diagram showing a video encoding and decoding system.
[0216] The encoding unit (1610) (e.g., the image encoding device (200)) of the image encoding and decoding system (1600) transmits an encoded bitstream of the image, and the decoding unit (1650) (e.g., the image decoding device (100)) receives the bitstream and decodes it to output a restored image. Here, the decoding unit (1650) may have a configuration similar to that of the image decoding device (100).
[0217] In the encoding unit (1610), the prediction encoding unit (1615) outputs a reference image through inter prediction and intra prediction, and the transformation and quantization unit (1616) quantizes residual data between the reference image and the current input image into quantized transform coefficients and outputs them. The entropy encoding unit (1625) encodes and transforms the quantized transform coefficients and outputs them as a bitstream. The quantized transform coefficients are restored as spatial domain data through the inverse quantization and inverse transformation unit (1630), and the restored spatial domain data are output as a restored image through the deblocking filtering unit (1635) and the loop filtering unit (1640). The restored image can be used as a reference image of the next input image through the prediction encoding unit (1615).
[0218] The encoded image data among the bitstreams received by the decoding unit (1650) is restored to residual data in the spatial domain through the entropy decoding unit (1655) and the inverse quantization and inverse transformation unit (1660). The reference image and residual data output from the prediction decoding unit (1675) are combined to form image data in the spatial domain, and the deblocking filtering unit (1665) and the loop filtering unit (1670) can perform filtering on the image data in the spatial domain to output a restored image for the current original image. The restored image can be used as a reference image for the next original image by the prediction decoding unit (1675).
[0219] The loop filtering unit (1640) of the encoding unit (1610) performs loop filtering using filter information input according to user input or system settings. The filter information used by the loop filtering unit (1640) is output to the entropy encoding unit (1610) and transmitted to the decoding unit (1650) together with the encoded image data. The loop filtering unit (1670) of the decoding unit (1650) can perform loop filtering based on the filter information input from the decoding unit (1650).
[0220] In the present disclosure, a "tree structure" may refer to a hierarchical structure of one or more coding units formed depending on whether the coding unit's division mode is quad division, binary division, ternary division, or non-division. For example, the hierarchical structure of blocks generated from the current coding unit according to the division process of FIG. 5 is referred to as a tree structure.
[0221] In the present disclosure, 'block availability' refers to whether the block has already been encoded or decoded, so that information about the block can be obtained. Specifically, if the current block has already been encoded during the encoding process, the encoding information of the current block can be used to encode neighboring blocks, and thus the current block can be displayed as available. If the current block is not encoded, the current block can be displayed as unavailable. Similarly, if the current block has already been decoded during the decoding process, the encoding information of the current block can be used to decode neighboring blocks, and thus the current block can be displayed as available. If the current block has not been decoded, the current block can be displayed as unavailable.
[0222] In the present disclosure, 'availability of motion information of a block' means whether motion prediction (prediction excluding prediction according to intra mode or intra block copy mode) for the corresponding block can be performed so that motion information (motion vector, prediction direction (L0-pred, L1-pred or Bi-pred), reference picture index) for the corresponding block can be obtained. Specifically, if motion prediction has already been performed on the current block during the encoding process and motion information for the current block exists, motion prediction for a neighboring block can be performed using the motion information for the current block, and thus the motion information for the current block can be displayed in a state of being available. If motion prediction has not been performed on the current block during the encoding process, motion information for the current block can be displayed in a state of being unavailable. Similarly, if motion prediction has already been performed on the current block during the decoding process and motion information for the current block exists, motion prediction for a neighboring block can be performed using the motion information for the current block, and thus the motion information for the current block can be displayed in a state of being available. If motion prediction is not performed for the current block during the decryption process, the motion information of the current block may be displayed as unavailable.
[0223] In the present disclosure, a "merge candidate" may correspond to a motion vector corresponding to a neighboring block of the current block. Since the predicted motion vector of the current block is determined from the motion vector of the neighboring block, each predicted motion vector may correspond to the corresponding neighboring block. Therefore, for convenience of explanation in the present disclosure, a "merge candidate" is described as corresponding to a motion vector of a neighboring block or corresponding to a neighboring block, and there is no semantic difference between the two expressions.
[0224] In the present disclosure, an 'affine merge candidate' may correspond to control point vectors corresponding to a neighboring block or block group of a current block. Since the control point vectors are determined from the motion vector of the neighboring block or based on the motion vectors of neighboring blocks belonging to the block group, each control point vector may correspond to the corresponding neighboring block or block group. Therefore, for the convenience of explanation in the present disclosure, an 'affine merge candidate' is described as corresponding to control point vectors determined from a neighboring block or block group, or corresponding to a neighboring block or block group, and there is no difference in meaning between the two expressions.
[0225] In the present disclosure, an "MVP (motion vector prediction) candidate" may correspond to motion vectors corresponding to neighboring blocks of the current block. Since the predicted motion vector of the current block is determined from the motion vector of the neighboring block, each predicted motion vector may correspond to the corresponding neighboring block. Therefore, for convenience of explanation in the present disclosure, an "MVP candidate" is described as corresponding to the motion vector of a neighboring block or corresponding to a neighboring block, and there is no semantic difference between the two expressions.
[0226] A 'merge candidate' is a neighboring block (or a motion vector of a neighboring block) used in the merge mode among inter prediction methods, while an 'MVP candidate' corresponds to a neighboring block (or a motion vector of a neighboring block) used in the AMVP mode among inter prediction methods. In the merge mode, not only is the motion vector of the current block determined using the motion vector of the merge candidate, but the prediction direction and reference picture index of the current block can also be determined using the prediction direction (L0-pred, L1-pred, bi-pred) and reference picture index of the merge candidate. On the other hand, in the AMVP mode, the prediction motion vector of the current block is determined using the motion vector of the MVP candidate, but the prediction direction and reference picture index of the current block can be determined separately from the prediction direction and reference picture index of the MVP candidate.
[0227] The proposed method of the present disclosure
[0228] The present disclosure proposes an image encoding method and a device therefor based on residual prediction, an image decoding method and a device therefor, a method for storing or obtaining a bitstream and a device therefor, and a non-transitory storage medium for storing a bitstream.
[0229] In general, a picture sequence (or video) has continuous characteristics, so there is a high degree of similarity between pictures. Therefore, inter-prediction, which utilizes the similarity between different pictures, has relatively good prediction performance, requires a relatively small number of bits to code the residual signal that represents the difference between the original image and the predicted image, and has relatively high coding efficiency. In contrast, intra-prediction uses the decoded neighboring samples of the current block (or samples of the neighboring block) in the current picture as reference samples to determine the prediction value of the pixels of the current block. Although the decoded neighboring samples of the current block (or samples of the neighboring block) usually have similar characteristics to those of the current block, they usually do not properly represent the characteristics of the current block. Therefore, the performance of intra-prediction is relatively lower than that of inter-prediction, requires a relatively large number of bits to code the residual signal that represents the difference between the original image and the predicted image, and has relatively low coding efficiency.
[0230] This disclosure proposes a method of applying residual prediction to intra prediction to reduce the number of bits required for coding the residual signal determined by intra prediction and improve coding efficiency. While the proposed method is described primarily with respect to intra prediction based on residual prediction, the proposed method can be applied equally or similarly to inter prediction. In other words, the proposed method is not limited to intra prediction.
[0231] Furthermore, image encoding and decoding must be performed in a corresponding manner so that the decoder can correctly restore the encoded image. Therefore, the intra-prediction mode typically used in image encoding is signaled to the decoder via the bitstream. Since the intra-prediction mode is signaled for each block of a given size, signaling the intra-prediction mode can require a significant number of bits.
[0232] In this disclosure, as a method for reducing the number of bits required for signaling the intra prediction mode, a method for determining the intra prediction mode on the decoder side without signaling the intra prediction mode through the bitstream is proposed.
[0233] In this specification, for convenience of explanation, terms are expressed as follows.
[0234] - C: current block
[0235] - R: reference block
[0236] - C org : Original signal of current block
[0237] - C pred : prediction signal of current block
[0238] - C res : residual signal of current block
[0239] - R rec : Reconstructed signal of reference block
[0240] - R pred : (simulated) prediction signal of reference block
[0241] - R res : (simulated) residual signal of reference block
[0242] - T C : Template of current block
[0243] - T R : Template of reference block
[0244] A simulated prediction signal is a signal (or predictor or prediction sample) predicted based on an intra prediction mode having the best prediction performance, which is predicted based on at least one of available intra prediction modes (e.g., see FIG. 20, FIG. 21 and the related description), and may be referred to herein simply as a prediction signal or a virtual prediction signal. As an example, a prediction signal (R) of a reference block pred ) can be a simulated prediction signal or a virtual prediction signal of the reference block. However, in the proposed method of the present disclosure, the prediction signal (R) of the reference block pred ) is not limited to the simulated prediction signal or virtual prediction signal of the reference block. For example, the prediction signal (R) of the reference block pred ) may be the actual prediction signal used when restoring the reference block.
[0245] A simulated residual signal refers to a residual signal (or residual sample) determined using a predicted signal or predictor based on an intra prediction mode with the best prediction performance among available intra prediction modes (e.g., see FIG. 20, FIG. 21 and related descriptions), and may be briefly referred to herein as a residual signal or a virtual residual signal. As an example, a residual signal (R) of a reference block res ) may be a simulated residual signal or a virtual residual signal of the reference block. However, in the proposed method of the present disclosure, the residual signal (R) of the reference block res ) is not limited to the simulated residual signal or virtual residual signal of the reference block. For example, the residual signal (R) of the reference block res) may be the actual residual signal used when restoring the reference block.
[0246] In this specification, two blocks (e.g., a current block and a reference block) may correspond to each other if the two blocks (best) match each other. Similarly, two pixel regions (e.g., a first pixel region and a second pixel region) or templates (e.g., a template (T) of the current block) may correspond to each other if the two blocks (T) match each other. C ) and the template of the reference block (T R )) Corresponding to each other may mean that two pixel areas or templates (best) match each other.
[0247] In this specification, the term prediction value or predicted value may be used interchangeably with predictor.
[0248] In this specification, a block may include, but is not limited to, a Coding Unit (CU), a Prediction Unit (PU), a Transform Unit (TU), or a sub-block contained within the block. A block may have various shapes. For example, a block may have a square or non-square shape.
[0249] In this specification, the spatial domain may refer to a picture domain identical to that of a picture containing the block, and the temporal domain may refer to a picture domain different from that of the picture containing the block. Accordingly, the spatial domain of a block may refer to within a picture containing the block, and the temporal domain of a block may refer to within a picture different from that containing the block.
[0250] In this specification, the number of intra prediction modes (e.g., see FIG. 20 and the related description) is described as a specific number as an example for convenience of explanation, and may be configured with various numbers other than the specific number. The range of reference samples (e.g., see FIG. 20, FIG. 27 and the related description) may have a size equal to the current block size or larger by a predetermined multiple of the current block size. In addition, the reference sample line (or reference line) may be one line adjacent to the current block, or at least one of a plurality of lines including a line adjacent to the current block and a line separated by a predetermined distance from the current block.
[0251] Fig. 17 illustrates a flowchart of a video encoding method according to the proposed method of the present disclosure. The method illustrated in Fig. 17 may be performed by a device (e.g., a video encoding device (200)). Fig. 17 is provided solely for illustration purposes, and the proposed method of the present disclosure is not limited to the example of Fig. 17. For example, the proposed method of the present disclosure may exclude at least one step illustrated in Fig. 17 or may include steps not illustrated in Fig. 17.
[0252] Referring to FIG. 17, the device can determine a reference block (R) corresponding to the current block (C) in a current picture including the current block (C) (1702). For example, the reference block can be determined in a decoded area or a reconstructed area of the current picture. For example, the reference block can be determined in a predetermined area among the decoded area or the reconstructed area of the current picture.
[0253] For example, the device may determine a reference block corresponding to a current block in a current picture based on template matching in 1702 (e.g., see FIGS. 23, 25, 26, 29 and their associated descriptions). In this example, the operation of determining a reference block corresponding to a current block in the current picture may include determining a first pixel area adjacent to the current block in the current picture, determining a second pixel area corresponding to (or matching) the first pixel area adjacent to the current block in the current picture, and determining a reference block corresponding to (or matching) the second pixel area in the current picture (e.g., see FIGS. 23, 25, 26, 29 and their associated descriptions). In this example, the first pixel area may be a template (T) for the current block. C ) may be referred to as a first template. In this example, the second pixel area may be a template (T) for a reference block. R ) and may be referred to as a second template.
[0254] In this example (template matching-based example), the first pixel region and the second pixel region can have various forms, and as a more specific example, the first pixel region can include at least one of a pixel region adjacent to the top of the current block, a pixel region adjacent to the top left of the current block, and a pixel region adjacent to the left side of the current block, and the second pixel region can include at least one of a pixel region adjacent to the top of the reference block, a pixel region adjacent to the top left of the reference block, and a pixel region adjacent to the left side of the reference block (e.g., see FIG. 26 and the related description). In this example, the first pixel region adjacent to the current block may have a fixed size (e.g., 4, 4xH_4x4_Wx4, etc.), or a size determined based on the size of the current block (e.g., W / 2, H / 2, where W and H are the width and height of the current block), or a width or height equal to the coding unit containing the current block (e.g., 4xH, Wx4, where W and H are the width and height of the coding unit containing the current block), or a width or height twice that of the coding unit containing the current block (e.g., 4x2H, 2Wx4, where W and H are the width and height of the coding unit containing the current block) (e.g., see FIG. 26 and its related description).
[0255] In this example (template matching-based example), the operation of determining a second pixel region corresponding to a first pixel region adjacent to a current block in a current picture may include calculating a value of a cost function based on pixels of the first pixel region and pixels of a pixel region in a given search region (e.g., a reconstructed region of the current picture or a specific region within the reconstructed region of the current picture), and determining a pixel region corresponding to a lowest or highest value among the calculated cost function values as the second pixel region (e.g., see FIG. 26 and the related description). As a more specific example, the cost function may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and a number of pixels having the same pixel value (e.g., see FIG. 26 and the related description).
[0256] As another example, the device may determine a reference block corresponding to a current block in a current picture based on a block vector (BV) in 1702 (e.g., see FIGS. 24, 28, 30 and their associated descriptions). In this example, the operation of determining a reference block corresponding to the current block may include searching a given search region of the current picture for a reference block matching the current block to obtain a block vector of the current block, and determining the reference block in the current picture based on the block vector of the current block (e.g., see FIGS. 24, 28, 30 and their associated descriptions).
[0257] The device sends a restoration signal (R) to the reference block. rec ) and the prediction signal of the reference block (R pred ), the residual signal (R) of the reference block res ) can be determined (1704) (e.g., see FIGS. 25, 28, 29, 30 and related descriptions). The prediction signal (R) of the reference block pred) can be determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture.
[0258] The device receives the original signal (C) of the current block org ), the prediction signal of the current block (C pred ), and the residual signal of the reference block (R res ), the residual difference signal of the current block ( ) can be determined (1706) (e.g., see FIGS. 25, 28, 29, 30 and related descriptions). The prediction signal of the current block can be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0259] For example, the device may determine an intra-prediction mode of the reference block from among a plurality of intra-prediction modes based on a reconstruction signal of the reference block and at least one reference pixel included in a neighboring block of the reference block at 1704, and may determine a prediction signal of the reference block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 25 and 28 and the related description). In this example, the device may determine an intra-prediction mode of the reference block as an intra-prediction mode of the current block at 1706, and may determine a prediction signal of the current block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 25 and 28 and the related description). In this example, the operation of determining the intra prediction mode of the reference block from among the plurality of intra prediction modes may include calculating a function value for each of the plurality of intra prediction modes based on a reconstructed signal of the reference block and at least one reference pixel included in a neighboring block of the reference block, and determining the intra prediction mode corresponding to the lowest function value or the highest function value among the calculated function values as the intra prediction mode of the current block (e.g., see FIG. 27 and the related description). As a more specific example, the function value may be a cost function, and the function value may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value (e.g., see FIG. 27 and the related description).
[0260] For example, the device may identify an intra-prediction mode of the reference block in 1704 when the reference block is coded in an intra-prediction mode, and determine a prediction signal of the reference block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 25 and 28 and their associated descriptions). In this example, the device may determine an intra-prediction mode of the reference block in 1706 as an intra-prediction mode of the current block, and determine a prediction signal of the current block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 25 and 28 and their associated descriptions).
[0261] For example, the device may determine an intra-prediction mode of the current block from among a plurality of intra-prediction modes based on a pixel area adjacent to the current block at 1704, and encode the intra-prediction mode of the current block into a bitstream (or signal it through the bitstream). The device may determine the intra-prediction mode of the current block as an intra-prediction mode of a reference block at 1704, and determine a prediction signal of the reference block based on the intra-prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 29 and 30 and the related description). In this example, the device may determine a prediction signal of the current block based on the intra-prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture at 1706 (e.g., see FIGS. 29 and 30 and the related description).
[0262] For example, the device may determine the intra prediction mode of the current block from among a plurality of intra prediction modes based on a pixel area adjacent to the current block in 1704, but may not encode the intra prediction mode of the current block into the bitstream (or may omit encoding the intra prediction mode of the current block). In this case, the decoder side may determine the intra prediction mode of the current block by performing an operation corresponding to the operation performed by the encoder side, without obtaining the intra prediction mode of the current block from the bitstream. The device may determine the intra prediction mode of the current block as the intra prediction mode of the reference block in 1704, and determine a prediction signal of the reference block based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 29 and 30 and the related descriptions). In this example, the device can determine a prediction signal of the current block based on an intra prediction mode of the current block at 1706 and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 29, 30 and their associated descriptions).
[0263] The device determines the residual difference signal of the current block determined at 1706 ( ) can be processed and encoded into a bitstream (1708). For example, the device can perform transform and quantization (or scaling) based on the residual difference signal of the current block to obtain transform coefficient information for the current block, and encode the transform coefficient information into the bitstream. For example, the device can omit transform and quantization (or scaling) and encode the residual difference signal of the current block into the bitstream. In the proposed method of the present disclosure, the residual difference signal of the current block can be encoded into the bitstream not only by these examples, but also by various methods.
[0264] The image encoding method according to the proposed method of the present disclosure is not limited to including only the configurations exemplified in FIG. 17, and may not include some of the configurations exemplified in FIG. 17, or may include other configurations described in the present disclosure.
[0265] Fig. 18 illustrates a flowchart of an image decoding method according to the proposed method of the present disclosure. The example of Fig. 18 may be performed by a device (e.g., an image decoding device (100)). Fig. 18 is for illustrative purposes only, and the proposed method of the present disclosure is not limited to the example of Fig. 18. For example, the proposed method of the present disclosure may exclude at least one step illustrated in Fig. 18 or may include steps not illustrated in Fig. 18.
[0266] Referring to FIG. 18, the device processes the bitstream to generate the residual differential signal of the current block ( ) can be obtained (1802). For example, the device can obtain transform coefficient information for the current block from the bitstream, and perform inverse quantization (or scaling) and inverse transformation based on the transform coefficient information to obtain a residual difference signal of the current block. For example, the device can obtain the residual difference signal of the current block from the bitstream by omitting inverse quantization (or scaling) and inverse transformation. In the proposed method of the present disclosure, the residual difference signal of the current block can be obtained not only by these examples but also through various methods.
[0267] The device can determine a reference block (R) corresponding to the current block (C) in a current picture (e.g., a decoded area or a reconstructed area of the current picture) containing the current block (C) (1804). For example, the reference block can be determined in a decoded area or a reconstructed area of the current picture. For example, the reference block can be determined in a predetermined area among the decoded area or the reconstructed area of the current picture.
[0268] For example, the device may determine a reference block corresponding to a current block in a current picture based on template matching in 1804 (e.g., see FIGS. 23, 25, 26, 29 and their descriptions). In this example, the operation of determining a reference block corresponding to a current block in the current picture may include determining a first pixel area adjacent to the current block in the current picture, determining a second pixel area corresponding to the first pixel area adjacent to the current block in the current picture, and determining a reference block corresponding to the second pixel area in the current picture (e.g., see FIGS. 23, 25, 26, 29 and their descriptions). In this example, the first pixel area may represent a template for the current block and may be referred to as a first template. In this example, the second pixel area may represent a template for the reference block and may be referred to as a second template.
[0269] In this example (template matching-based example), the first pixel region and the second pixel region can have various forms, and as a more specific example, the first pixel region can include at least one of a pixel region adjacent to the top of the current block, a pixel region adjacent to the top left of the current block, and a pixel region adjacent to the left side of the current block, and the second pixel region can include at least one of a pixel region adjacent to the top of the reference block, a pixel region adjacent to the top left of the reference block, and a pixel region adjacent to the left side of the reference block (e.g., see FIG. 26 and the related description). In this example, the first pixel region adjacent to the current block may have a fixed size (e.g., 4, 4xH_4x4_Wx4, etc.), or a size determined based on the size of the current block (e.g., W / 2, H / 2, where W and H are the width and height of the current block), or a width or height equal to the coding unit containing the current block (e.g., 4xH, Wx4, where W and H are the width and height of the coding unit containing the current block), or a width or height twice that of the coding unit containing the current block (e.g., 4x2H, 2Wx4, where W and H are the width and height of the coding unit containing the current block) (e.g., see FIG. 26 and its related description).
[0270] In this example (template matching-based example), the operation of determining a second pixel region corresponding to a first pixel region adjacent to a current block in a current picture may include calculating a value of a cost function based on pixels of the first pixel region and pixels of a pixel region in a given search region (e.g., a reconstructed region of the current picture or a specific region within the reconstructed region of the current picture), and determining a pixel region corresponding to a lowest or highest value among the calculated cost function values as the second pixel region (e.g., see FIG. 26 and the related description). As a more specific example, the cost function may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and a number of pixels having the same pixel value (e.g., see FIG. 26 and the related description).
[0271] As another example, the device may determine a reference block corresponding to the current block in the current picture based on the block vector in 1804 (e.g., see FIGS. 24, 28, 30 and their associated descriptions). In this example, the operation of determining the reference block corresponding to the current block may include obtaining a block vector of the current block from the bitstream, and determining the reference block in the current picture based on the block vector of the current block (e.g., see FIGS. 24, 28, 30 and their associated descriptions).
[0272] The device sends a restoration signal (R) to the reference block. rec ) and the prediction signal of the reference block (R pred ), the residual signal (R) of the reference block res ) can be determined (1806) (e.g., see FIGS. 25, 28, 29, 30 and related descriptions). The prediction signal of the reference block can be determined based on at least one reference pixel included in a neighboring block of the reference block in the current picture.
[0273] The device outputs the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ), the restoration signal (C) of the current block rec ) can be determined (1808) (e.g., see FIGS. 25, 28, 29, 30 and related descriptions). The prediction signal of the current block can be determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
[0274] For example, the device may determine an intra-prediction mode of the reference block from among a plurality of intra-prediction modes based on a reconstruction signal of the reference block and at least one reference pixel included in a neighboring block of the reference block at 1806, and may determine a prediction signal of the reference block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 25 and 28 and related descriptions). In this example, the device may determine an intra-prediction mode of the reference block as an intra-prediction mode of the current block at 1808, and may determine a prediction signal of the current block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 25 and 28 and related descriptions). In this example, the operation of determining the intra prediction mode of the reference block from among the plurality of intra prediction modes may include calculating a function value for each of the plurality of intra prediction modes based on a reconstructed signal of the reference block and at least one reference pixel included in a neighboring block of the reference block, and determining the intra prediction mode corresponding to the lowest function value or the highest function value among the calculated function values as the intra prediction mode of the current block (e.g., see FIG. 27 and the related description). As a more specific example, the function value may be a cost function, and the function value may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value (e.g., see FIG. 27 and the related description).
[0275] For example, the device may identify the intra-prediction mode of the reference block in 1806 when the reference block is coded in the intra-prediction mode, and determine a prediction signal of the reference block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 25 and 28 and their associated descriptions). In this example, the device may determine the intra-prediction mode of the reference block in 1808 as the intra-prediction mode of the current block, and determine a prediction signal of the current block based on the intra-prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 25 and 28 and their associated descriptions).
[0276] For example, the device may obtain an intra prediction mode of a current block from a bitstream at 1806 (e.g., see FIG. 20 and the related description), determine the intra prediction mode of the current block as an intra prediction mode of a reference block, and determine a prediction signal of the reference block based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 29 and 30 and the related description). In this example, the device may determine a prediction signal of the current block based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture (e.g., see FIGS. 29 and 30 and the related description).
[0277] For example, the device may determine the intra prediction mode of the current block from among a plurality of intra prediction modes based on a pixel area adjacent to the current block, without obtaining the intra prediction mode of the current block from the bitstream at 1806. The device may determine the intra prediction mode of the current block as the intra prediction mode of the reference block at 1806, and determine a prediction signal of the reference block based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture (e.g., see FIGS. 29 and 30 and the related description). In this example, the device may determine the prediction signal of the current block based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture at 1808 (e.g., see FIGS. 29 and 30 and the related description).
[0278] The image decoding method according to the proposed method of the present disclosure is not limited to including only the configurations exemplified in FIG. 18, and may not include some of the configurations exemplified in FIG. 18, or may include other configurations described in the present disclosure.
[0279] Fig. 19 illustrates a flowchart of a bitstream storage method according to the proposed method of the present disclosure. The method illustrated in Fig. 19 may be performed by a device (e.g., a video encoding device (200)). Fig. 19 is for illustrative purposes only, and the proposed method of the present disclosure is not limited to the example of Fig. 19. For example, the proposed method of the present disclosure may exclude at least one step illustrated in Fig. 19 or may include steps not illustrated in Fig. 19.
[0280] Referring to FIG. 19, the device can generate a bitstream according to an encoding method (1902). For example, the encoding method may include an image encoding method according to the proposed method of the present disclosure. As a specific example, the encoding method may include the image encoding method described with reference to FIG. 17.
[0281] Alternatively, at 1902, the device may generate a bitstream to be decoded according to a decoding method. For example, the decoding method may include an image decoding method according to the proposed method of the present disclosure. As a specific example, the decoding method may include the image decoding method described with reference to FIG. 18.
[0282] The device can store the generated bitstream in a non-transitory computer-readable storage medium or transmit it to another device using wireless or wired communication (1904).
[0283] FIG. 20 and FIG. 21 illustrate intra prediction modes applicable to the proposed method of the present disclosure. Although the examples of FIG. 20 and FIG. 21 focus on the intra prediction mode of ITU-T H.266 / VVC (Versatile Video Coding), the intra prediction modes applicable to the proposed method of the present disclosure are not limited to the examples of FIG. 20 and FIG. 21. For example, the intra prediction modes applicable to the proposed method of the present disclosure may include other intra prediction modes of ITU-T H.266 / VVC (e.g., cross component linear model (CCLM)), and / or intra prediction modes of advanced video coding standards after ITU-T H.266 / VVC.
[0284] Referring to FIG. 20(a), in image coding, intra prediction refers to a technology for predicting a current block (2002) based on data (e.g., neighboring blocks of the current block or samples included in neighboring blocks) (2004) already decoded within a picture (or slice or tile) including a current block (2002) to be decoded. Specifically, samples decoded (or reconstructed) before the current block within the current picture including the current block (2002) are used as reference samples (2004), and intra prediction is performed on the current block (2002) based on the reference samples (2004).
[0285] Intra prediction can include non-directional prediction and directional prediction. In the case of non-directional prediction, there are (1) an intra DC (direct current) (prediction) mode (or INTRA_DC mode) that determines the average (of the values) of specific samples among reference samples (2004) as the predicted value of the current sample of the current block (2002), and (2) an intra planar (prediction) mode (or INTRA_PLANAR mode) that determines the value obtained by applying a weight according to the distance from the current sample to the left / upper reference samples of the current block as the predicted value or predictor of the current sample.
[0286] In the case of directional prediction, a reference sample (2004) (value) located in a direction corresponding to a directional prediction mode for the current block (2002) among multiple directional prediction modes (e.g., including multiple directions within a range from the lower left direction to the upper right direction) can be determined as a prediction value or predictor of the current sample belonging to the current block (2002). For example, the H.264 / AVC (Advanced Video Coding) standard supports 8 directions, the H.265 / HEVC (High Efficiency Video Coding) standard supports 33 directions, and the H.266 / VVC standard supports 65 directions.
[0287] In directional prediction, a sample value corresponding to a fractional position of a reference sample located in the direction of the intra prediction mode for the current block can be calculated, and the calculated sample value can be determined as a prediction value of the current sample of the current block. For example, in the case of H.266 / VVC, a filter coefficient for calculating a sample value corresponding to a fractional position in units of 1 / 32 samples to be used as a prediction value of the current sample of the current block can be defined as shown in Table 1. Table 1 shows an example of a filter coefficient value used when calculating a sample value to be used as a prediction value of the current sample for each fractional position (p=0 to p=31 / 32) of a reference sample (2004). At this time, one of a plurality of interpolation filters (A or B in Table 1) may be selected depending on the size of the current block (2002) or the intra prediction mode.
[0288] [Table 1]
[0289]
[0290] Fig. 20(b) illustrates the intra prediction modes and directions for each intra prediction mode of the H.266 / VVC standard. Basically, intra DC mode and intra plane mode are supported, and directional prediction modes from 2 to 66 exist. Depending on the ratio of the width and height of the block, directional prediction modes smaller than 2 or larger than 66 may also be used (e.g., see Fig. 21 and related description).
[0291] Referring to FIG. 20(b), the intra prediction modes applicable to the proposed method of the present disclosure may include an intra planar (prediction) mode (or INTRA_PLANAR mode), an intra direct current (DC) (prediction) mode (or INTRA_DC mode), and an intra angular (prediction) mode (or INTRA_ANGULAR2 to INTRA_ANGULAR66). Each intra prediction mode may be expressed by a specific value. For example, when the intra prediction mode has a value of 0, the intra prediction mode may represent an intra planar (prediction) mode (or INTRA_PLANAR mode). For example, when the intra prediction mode has a value of 1, the intra prediction mode may represent an intra DC (prediction) mode (or INTRA_DC mode). For example, when the intra prediction mode has any one of values 2 to 66, the intra prediction mode may represent a corresponding intra angle (prediction) mode among the intra angle (prediction) modes (or INTRA_ANGULAR2 to INTRA_ANGULAR66). As mentioned above, the intra prediction modes applicable to the proposed method of the present disclosure are not limited to the intra prediction modes illustrated in FIG. 20(b). For the convenience of description herein, the intra plane (prediction) mode (or INTRA_PLANAR mode) may be briefly referred to as the intra plane mode, the intra DC (prediction) mode (or INTRA_DC mode) may be briefly referred to as the intra DC mode, and the intra angle (prediction) mode (or INTRA_ANGULAR2 to INTRA_ANGULAR66) may be briefly referred to as the intra angle mode.
[0292] The intra prediction mode applicable to the proposed method of the present disclosure can be determined based on the most probable mode (MPM). For example, six MPMs can be used, but this is only an example and a different number of MPMs can be used. For example, a device (e.g., a video decoding device (100)) can obtain (syntax) information related to the intra prediction mode of a current block from a bitstream, and determine the intra prediction mode of the current block based on an intra prediction mode candidate list including an MPM and the (syntax) information related to the intra prediction mode. For example, a device (e.g., a video encoding device (200)) can obtain (syntax) information related to the intra prediction mode of the current block based on an intra prediction mode candidate list including an MPM and the intra prediction mode of the current block, and encode the obtained information into a bitstream. For convenience of explanation in this specification, the intra prediction mode candidate list including MPM may be simply referred to as an MPM list, and may be used interchangeably with an intra candidate mode list or a candidate mode list.
[0293] As an example that does not limit the proposed method of the present disclosure, if a neighboring block is not available, the intra prediction mode of the neighboring block may be set to the intra-planar mode by default. For example, if the intra prediction modes of the left neighboring block and the upper neighboring block are both the intra-non-angular mode (e.g., the intra-planar mode or the intra-DC mode), the MPM list may include {Planar, DC, V, H, V - 4, V + 4}. For convenience of explanation in this specification, Planar represents an intra planar mode, DC represents an intra DC mode, V represents a vertical intra prediction mode (e.g., INTRA_ANGULAR50 in FIG. 20), H represents a horizontal intra prediction mode (e.g., INTRA_ANGULAR18 in FIG. 20), V - 4 represents an intra prediction mode having a value obtained by subtracting 4 from the vertical intra prediction mode (e.g., INTRA_ANGULAR46 in FIG. 20), and V + 4 represents an intra prediction mode having a value obtained by adding 4 to the vertical intra prediction mode (e.g., INTRA_ANGULAR54 in FIG. 20).
[0294] For example, if one of the intra prediction modes of the left neighboring block and the upper neighboring block is an intra angular mode and the other is an intra non-angular mode, the MPM list may include {Planar, Max, Max - 1, Max + 1, Max - 2, Max + 2}. For convenience of explanation in this specification, Max represents an intra prediction mode corresponding to the maximum value of the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block, Max - 1 represents an intra prediction mode corresponding to a value obtained by subtracting 1 from Max, Max + 1 represents an intra prediction mode corresponding to a value obtained by adding 1 to Max, Max - 2 represents an intra prediction mode corresponding to a value obtained by subtracting 2 from Max, and Max + 2 represents an intra prediction mode corresponding to a value obtained by adding 2 to Max.
[0295] For example, if the intra prediction modes of the left neighboring block and the upper neighboring block are both intra angle modes and are different, the MPM list can be determined as follows. For convenience of explanation in this specification, Min represents an intra prediction mode corresponding to the minimum value between the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block, Left represents an intra prediction mode of the left neighboring block, Above represents an intra prediction mode of the upper neighboring block, Min - 1 represents an intra prediction mode corresponding to a value obtained by subtracting 1 from Min, Min - 2 represents an intra prediction mode corresponding to a value obtained by subtracting 2 from Min, Min + 1 represents an intra prediction mode corresponding to a value obtained by adding 1 to Min, and Min + 2 represents an intra prediction mode corresponding to a value obtained by adding 2 to Min.
[0296] - If (Max - Min) is 1, the MPM list contains {Planar, Left, Above, Min - 1, Max + 1, Min - 2}
[0297] - Otherwise, if (Max - Min) is greater than or equal to 62, the MPM list contains {Planar, Left, Above, Min + 1, Max - 1, Min + 2}
[0298] - Otherwise, if (Max - Min) is 2, the MPM list contains {Planar, Left, Above, Min + 1, Min - 1, Max + 1}
[0299] - Otherwise, the MPM list contains {Planar, Left, Above, Min - 1, -Min + 1, Max - 1}
[0300] For example, if the intra prediction modes of the left neighboring block and the upper neighboring block are both intra angular modes and are the same, the MPM list may include {Planar, Left, Left - 1, Left + 1, Left - 2, Left + 2}. For convenience of explanation in this specification, Left - 1 represents the intra prediction mode corresponding to the value obtained by subtracting 1 from Left (the intra prediction mode of the left neighboring block), Left + 1 represents the intra prediction mode corresponding to the value obtained by adding 1 to Left, Left - 2 represents the intra prediction mode corresponding to the value obtained by subtracting 2 from Left, and Left + 2 represents the intra prediction mode corresponding to the value obtained by adding 2 to Left.
[0301] Fig. 21 illustrates wide-angle intra prediction that can be applied to the proposed method of the present disclosure. Fig. 21(a) illustrates an example of applying wide-angle intra prediction to a pixel (2104a) of a block (2102a) when the width (W) of the block (2102a) is greater than the height (H) (W > H), and Fig. 21(b) illustrates an example of applying wide-angle intra prediction to a pixel (2104b) of a block (2102b) when the height (H) of the block (2102b) is greater than the width (W) (H > W). As described above, the proposed method of the present disclosure is not limited to the example of Fig. 21.
[0302] Referring to FIG. 21, the orientation of a typical intra angle mode is defined as an angle from 45 degrees (2106a, 2106b) (e.g., intra angle mode 2 or INTRA_ANGULAR2) to 135 degrees (2108a, 2108b) (e.g., intra angle mode 66 or INTRA_ANGULAR66) clockwise (see, e.g., FIG. 20 and related description). If the block (2102a, 2102b) is a non-square block, 2W + 1 neighboring pixels adjacent to the top of the block (2102a, 2102b) and / or 2H + 1 neighboring pixels adjacent to the left of the block (2102a, 2102b) may be used as reference pixels for intra prediction, depending on the width (W) and height (H) of the block (2102a, 2102b), and some intra angle modes among the intra angle modes (e.g., see FIG. 20 and the related description) may be adaptively replaced with the wide-angle intra prediction mode. For example, the lower left diagonal intra-angle mode (2106a, 2106b) (e.g., intra-angle mode 2 or INTRA_ANGULAR2) can be replaced with the intra-angle mode (2116a, 2116b), the upper right diagonal intra-angle mode (2108a, 2108b) (e.g., intra-angle mode 66 or INTRA_ANGULAR66) can be replaced with the intra-angle mode (2118a, 2118b), and the upper left diagonal intra-angle mode (e.g., intra-angle mode 34 or INTRA_ANGULAR34) can be replaced with the diagonal mode (2110a, 2110b).
[0303] Figures 22 and 23 illustrate a template matching method that can be applied to the proposed method of the present disclosure.
[0304] In this specification, a template refers to a neighboring pixel region or a neighboring block adjacent to a block. The neighboring pixel region or neighboring block corresponding to the template may include at least one neighboring pixel (or reference pixel) adjacent to the block. For example, the template may refer to a neighboring pixel region or a neighboring block adjacent to the left side of the block. For example, the template may refer to a neighboring pixel region or a neighboring block adjacent to the top side of the block. For example, the template may refer to a neighboring pixel region or a neighboring block adjacent to the left and top side of the block. For example, the template may refer to a neighboring pixel region or a neighboring block adjacent to at least one of the left side, top side, or top left side of the block.
[0305] In this specification, template matching (TM) refers to a technique for finding a template (or pixel region) that best matches a template of a block (or a neighboring pixel region adjacent to the block). For example, template matching can be used as a prediction method for performing prediction on a block based on a template that best matches a template of a block (e.g., a coding unit (CU)) in a reference picture or a current picture, or as a motion information derivation method on the decoder side for refining motion information of the block. In this specification, inter-template matching can refer to a technique for finding a template that best matches a template of a block in a reference picture, and intra-template matching can refer to a technique for finding a template that best matches a template of a block in a picture including the block (or the current picture). In this specification, template matching prediction (TMP) can refer to a technique for performing prediction based on template matching.
[0306] Fig. 22 illustrates inter-template matching applicable to the proposed method of the present disclosure. The example of Fig. 22 is merely exemplary, and inter-template matching applicable to the proposed method of the present disclosure is not limited to the example of Fig. 22. For example, although the search range in the example of Fig. 22 is illustrated as a 16x16 pixel area, inter-template matching applicable to the proposed method of the present disclosure can be applied equally / similarly to search ranges of other sizes.
[0307] Referring to FIG. 22, inter-template matching can be used in a prediction method for predicting the current block (2202) by finding the closest match between a template (2204) in the current picture (2206) (e.g., an upper and / or left and / or upper left neighboring pixel area or neighboring block of the current block (2202) (e.g., a current coding unit (CU))) and a template (2214) in a reference picture (2216) (e.g., a neighboring pixel area or neighboring block of the same size as the template (2204) in the current picture (2206)) or a motion vector (MV) derivation method on the decoder side for refining motion information of the current block (2202). For example, (inter) template matching can be used in advanced motion vector prediction (AMVP) mode or merge mode.
[0308] In this specification, the AMVP mode refers to a method of generating a motion vector predictor (MVP) list using motion information (e.g., motion vector (MV) etc.) of at least one neighboring block of a current block (e.g., at least one of a left neighboring block, an upper neighboring block, and an upper-left neighboring block), and signaling, through a bitstream, a motion vector difference (MVD) indicating a difference between a motion vector for a current block and a motion vector predictor, and information indicating a motion vector predictor for the current block in the MVP list (e.g., an index indicating an MVP candidate in the MVP list).
[0309] For example, when (inter) template matching (TM) is used in AMVP mode, the MVP candidate may be determined based on the template matching error to select the template that reaches the minimum difference between the current block template (cur.template) (2204) and the reference block template (ref.template) (2214). Additionally or alternatively to this example, (inter) template matching (TM) may be performed only for this specific MVP candidate (2208) for motion vector (MV) refinement.
[0310] In this specification, the merge mode refers to a method of generating a merge candidate list using motion information (e.g., motion vector (MV), reference picture list index, etc.) of at least one neighboring block of a current block (e.g., at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper left neighboring block, an upper right neighboring block, and a temporal neighboring block), and signaling information indicating motion information for the current block in the merge candidate list (e.g., an index indicating a merge candidate in the merge candidate list) through a bitstream.
[0311] For example, when (inter) template matching (TM) is used in merge mode, (inter) template matching (TM) may be performed on a merge candidate (2208) indicated by a merge index (or an index indicating a merge candidate in the merge candidate list) in the merge candidate list. By performing template matching on the merge candidate, the merge candidate may be refined.
[0312] Template Matching (TM) can operate as an additional refinement process for block-based or sub-block-based bilateral matching methods, or it can operate independently (as a type of prediction method). Furthermore, Template Matching (TM) is not limited to AMVP or Merge mode; it can be used in other ways, or independently.
[0313] Fig. 23 illustrates intra-template matching applicable to the proposed method of the present disclosure. The example of Fig. 23 is merely an example, and intra-template matching applicable to the proposed method of the present disclosure is not limited to the example of Fig. 23. For example, in the example of Fig. 23, an L-shaped template (e.g., a neighboring pixel area or a neighboring block on the left, top, or top left of a block) is illustrated, but the intra-template matching applicable to the proposed method of the present disclosure can be equally / similarly applied to templates of other shapes than the L-shaped template (e.g., a neighboring pixel area or a neighboring block on at least one of the left, top, or top left of a block).
[0314] Referring to FIG. 23, intra template matching prediction (Intra TMP) may refer to determining surrounding samples of a current block (2302) in a current picture (2306) as templates (2304), searching for a template most similar to the template (2304) of the current block (2302) in an already decoded or restored search area (search region) (2310) in the current picture (2306), and using the value of a reference area (or reference block or matching block) (2312) of a template (2314) with the best matching rate as a prediction value of the current block (2302). As an example that does not limit the proposed method of the present disclosure, the template (2304) of the current block (2302) may have an L-shape, and the matching rate may be higher when the distortion cost is smaller as a result of measuring the distortion (e.g., using SAD) between the template (2304) of the current block (2302) and the search template. For example, the size of the search area (2310) may be determined based on the size of the current block (2302) (e.g., proportional to the size of the current block). This may be advantageous when there is a fixed number for comparing the sum of absolute differences (SAD) on a pixel-by-pixel basis, but the cost function that can be applied to the proposed method of the present disclosure is not limited to SAD (e.g., see Equation 3), and other cost functions (e.g., SSD of Equation 4, Num of Equation 5, etc., see FIG. 26 and related descriptions) may be used. In this specification, intra TMP may be referred to as intra template matching or intra TMP mode or intra prediction mode based on intra template matching.
[0315] In summary, intra template matching can be used as a special intra prediction mode that determines a block (2312) corresponding to a template (2314) (e.g., an L-shaped template) that matches the current template (2304) (or the template (2304) corresponding to the current block (2302)) in the reconstructed portion of the current picture or frame (2306) as the best prediction block for the current block (2302), and copies the best prediction block (2312) (as a predictor of the current block (2302).
[0316] On the encoder side, a device (e.g., a video encoding device (200)) can find a template (2314) that is most similar to the current template (2304) (or a template (2304) corresponding to the current block (2302)) in a reconstructed portion of the current picture or frame (2306) from a predefined search area (2310), and use a block (2312) corresponding to the found template (2314) as a prediction block. The device can determine a residual signal of the current block based on a difference between the prediction block and the original image of the current block, and process the residual signal to encode it into a bitstream. The device can signal (via the bitstream) whether to use such a mode (e.g., intra TMP mode), and the decoder side can perform the same prediction operation based on the signaling from the device.
[0317] For example, on the decoder side, a device (e.g., an image decoding device (100)) can perform an operation corresponding to an operation performed on the encoder side to find a template (2314) most similar to the current template (2304) and use a block (2312) corresponding to the found template (2314) as a prediction block. The device can reconstruct the current block based on the residual signal of the current block and the prediction block obtained by processing the bitstream (e.g., based on the sum of the residual signal and the prediction block).
[0318] Compared to the intra block copy mode described with reference to FIG. 24, in intra TMP, signaling related to block vectors may not exist. For example, in the intra block copy mode, (syntax) information indicating a block vector can be signaled through the bitstream, but in the intra TMP mode, since the decoder side can determine a prediction block by performing an operation corresponding to the operation performed on the encoder side, vector information indicating a template (2314) most similar to the current template (2304) or vector information indicating a block (2312) corresponding to the template (2314) may not be signaled through the bitstream.
[0319] Fig. 24 illustrates an intra block copy that can be applied to the proposed method of the present disclosure. Although the example of Fig. 24 focuses on the intra block copy (IBC) mode of ITU-T H.266 / VVC (Versatile Video Coding) and the IBC mode of ECM (Enhanced Compression Model), the IBC mode that can be applied to the proposed method of the present disclosure is not limited to the example of Fig. 24. For example, the IBC mode that can be applied to the proposed method of the present disclosure may include the IBC mode of an advanced video coding standard after ITU-T H.266 / VVC.
[0320] Referring to FIG. 24, the IBC mode refers to a process in which the encoder finds a block (2412) most similar to the current block (2402) from a reconstructed portion of the current picture (2406) through block matching, signals a block vector (BV) (2410) pointing to the block (2412) in the current picture (2406) through a bitstream, determines a reference block (2412) based on the signaled block vector (2410), and uses the reference block (2412) to reconstruct the current block (2402). The IBC mode may refer to a process in which a predictor for the block (2402) is determined using a block vector (2410) in the spatial domain, similar to performing inter prediction using a motion vector in the temporal domain.
[0321] For example, the IBC mode applicable to the proposed method of the present disclosure may include the IBC merge mode of ITU-T H.266 / VVC. The IBC merge mode may refer to configuring a merge candidate list with at least one block vector from among the left neighboring block, the upper neighboring block, and the upper left neighboring block of the current block (2402), and signaling information (e.g., a merge index) indicating a block vector for the current block in the merge candidate list. When the IBC merge mode is applied, the encoder side may determine a block vector for the current block (2402), and signal information (e.g., a merge index) indicating a merge candidate corresponding to the determined block vector in the merge candidate list through a bitstream. When the IBC merge mode is applied, the decoder side obtains information indicating a merge candidate (e.g., a merge index) from the bitstream, constructs a merge candidate list in the same manner as the encoder side, and then determines the block vector of the merge candidate indicated by the information (e.g., a merge index) in the merge candidate list as the block vector (2410) for the current block (2402).
[0322] For example, the IBC mode applicable to the proposed method of the present disclosure may include the IBC AMVP mode of ITU-T H.266 / VVC. The IBC AMVP mode may refer to constructing a block vector predictor (BVP) candidate list with at least one block vector from among the left neighboring block and the upper neighboring block of the current block (2402), and signaling information (e.g., a BVP index) indicating a BVP candidate corresponding to the BVP for the current block (2402) in the BVP candidate list and a block vector difference (BVD) indicating the difference between the block vector for the current block (2402) and the BVP. When the IBC AMVP mode is applied, the encoder side may determine a block vector (2410) for the current block (2402), determine a BVP candidate from the BVP candidate list based on the block vector (2410), and signal information (e.g., a BVP index) indicating the determined BVP candidate through a bitstream. When the IBC AMVP mode is applied, the decoder side obtains information indicating a BVP candidate (e.g., a BVP index) and a BVD from the bitstream, constructs a BVP candidate list in the same manner as the encoder side, and then determines a block vector (2410) for the current block (2402) based on the BVP candidate and BVD indicated by the information (e.g., the BVP index) in the BVP candidate list (e.g., based on the sum of the BVP candidate and the BVD). Optionally, an adaptive motion vector resolution (AMVR) using variable vector precision in the IBC AMVP mode may be signaled through the bitstream. In this specification, the IBC BVP candidate and the IBC BVP candidate list may be referred to as an IBC AMVP candidate and an IBC AMVP candidate list, respectively.
[0323] For example, the IBC mode applicable to the proposed method of the present disclosure may include the IBC mode of the enhanced compression model (ECM). The IBC mode of the ECM may include, for example, the IBC merge mode and / or the IBC AMVP mode. Compared with the IBC merge / AMVP mode of ITU-T H.266 / VVC, the IBC mode of the ECM may be improved in the construction of the IBC merge / AMVP candidate list as follows. Only if an IBC merge / AMVP candidate is valid, it may be inserted or added to the IBC merge / AMVP candidate list. At least one of the left neighboring block, the upper neighboring block, the upper right neighboring block, the lower left neighboring block, and the upper left neighboring block and at least one pairwise average candidate may be added to the spatial merge / AMVP candidate list. Template-based adaptive reordering may be applied to the IBC merge list (adaptive reordering of merge candidates with template matching, ARMC-TM).
[0324] For example, the IBC mode applicable to the proposed method of the present disclosure may include an IBC-TM (IBC with template matching) mode used in combination with template matching (TM). The IBC-TM mode of the ECM may be combined with the IBC merge mode (referred to as the IBC-TM merge mode) or with the IBC AMVP mode (referred to as the IBC-TM AMVP mode). Accordingly, the IBC-TM mode may refer to the combined use of IBC and template matching (TM) for the IBC merge mode or the IBC AMVP mode. The IBC-TM mode may include, for example, the IBC-TM merge mode and the IBC-TM AMVP mode.
[0325] For example, the IBC-TM merge mode may include refining at least one candidate BVP from among at least one neighboring block (e.g., a left neighboring block, an upper neighboring block, and an upper-left neighboring block) of a block (2402) by a template matching method and competing with the regular IBC merge mode (or adding the candidate BVP to a merge candidate list including candidates of the regular IBC merge mode). The BVP candidate list may be sorted based on a template matching cost. For example, the BVP candidate list may be sorted such that a lower template matching cost may be ranked higher in the BVP candidate list (or a higher template matching cost may be ranked lower in the BVP candidate list), or the BVP candidate list may be sorted such that a higher template matching cost may be ranked higher in the BVP candidate list (or a lower template matching cost may be ranked lower in the BVP candidate list).
[0326] For example, the IBC-TM AMVP mode may include refining and sorting BVPs based on template matching without signaling the block vector difference (BVD) through the bitstream. As a non-limiting example, the BVPs may be refined based on integer pixel precision or 4-pixel (or 4-pel) precision.
[0327] IBC-TM mode (e.g., IBC-TM merge mode and / or IBC-TM AMVP mode) may include adding intra TMP block vectors as spatial candidates to the IBC block vector candidate list (or IBC AMVP candidate list). In IBC-TM mode, the template may include left and top neighboring reference pixels (or left and top neighboring pixel regions, or left and top neighboring blocks) of the block (2402), or left neighboring reference pixels (or left neighboring pixel regions or left neighboring blocks), or top neighboring reference pixels (or top neighboring pixel regions or top neighboring blocks).
[0328] FIGS. 25 to 30 illustrate embodiments according to the proposed method of the present disclosure (e.g., see FIGS. 17 to 19 and their associated descriptions). For convenience of explanation, the embodiments of FIGS. 25, 28, 29, and 30 are referred to as "Proposed Method 1," "Proposed Method 2," "Proposed Method 3," and "Proposed Method 4," respectively. In this specification, for convenience of explanation, the terms are expressed as follows.
[0329] - C: current block
[0330] - R: reference block
[0331] - C org : Original signal of current block
[0332] - C pred : prediction signal of current block
[0333] - C res : residual signal of current block
[0334] - R rec: Reconstructed signal of reference block
[0335] - R pred : (simulated) prediction signal of reference block
[0336] - R res : (simulated) residual signal of reference block
[0337] - T C : Template of current block
[0338] - T R : Template of reference block
[0339] A simulated prediction signal is a signal (or predictor or prediction sample) predicted based on an intra prediction mode having the best prediction performance, which is predicted based on at least one of available intra prediction modes (e.g., see FIG. 20, FIG. 21 and the related description), and may be referred to herein simply as a prediction signal or a virtual prediction signal. As an example, a prediction signal (R) of a reference block pred ) can be a simulated prediction signal or a virtual prediction signal of the reference block. However, in the proposed method of the present disclosure, the prediction signal (R) of the reference block pred ) is not limited to the simulated prediction signal or virtual prediction signal of the reference block. For example, the prediction signal (R) of the reference block pred ) may be the actual prediction signal used when restoring the reference block.
[0340] A simulated residual signal refers to a residual signal (or residual sample) determined using a predicted signal or predictor based on an intra prediction mode with the best prediction performance among available intra prediction modes (e.g., see FIG. 20, FIG. 21 and related descriptions), and may be briefly referred to herein as a residual signal or a virtual residual signal. As an example, a residual signal (R) of a reference block res ) may be a simulated residual signal or a virtual residual signal of the reference block. However, in the proposed method of the present disclosure, the residual signal (R) of the reference block res ) is not limited to the simulated residual signal or virtual residual signal of the reference block. For example, the residual signal (R) of the reference block res ) may be the actual residual signal used when restoring the reference block.
[0341] The examples described with reference to FIGS. 25 to 30 are intended to aid in understanding the proposed method of the present disclosure (e.g., see FIGS. 17 to 19 and their associated descriptions) and are not intended to limit the proposed method of the present disclosure. Accordingly, some components may be excluded from the examples described in FIGS. 25 to 30, other components not illustrated may be added, and the execution order may be changed. Furthermore, the examples of FIGS. 25 to 30 may be implemented independently, or at least one of the examples may be implemented in combination with each other.
[0342] Fig. 25 illustrates a proposed method 1 of the present disclosure. The proposed method 1 of the present disclosure can be performed by a device (e.g., an image decoding device (100) or an image encoding device (200)). The proposed method 1 of the present disclosure relates to performing residual prediction based on template matching, and is an example of using the intra prediction mode of a reference block as the intra prediction mode of a current block.
[0343] Referring to FIG. 25, in step 1, a device (e.g., a video encoding device (200)) generates a template (T) of the current block. C ) is used to find the template (T) of the current block in a given search area (e.g., search area (2310)) of the spatial domain. C ) can find the part (or template) that best matches the reference block. As an example that does not limit the proposed method of the present disclosure, the device may find the template (T) of the reference block based on the template matching prediction (TMP). R ) can be found. In addition, the device can find the template (T) of the reference block R ) can determine a reference block corresponding to the template (T) of the reference block. As a more specific example, the device performs the operation described with reference to FIG. 23 to determine a template (T) of the reference block. R ) can be found.
[0344] For example, step 1 of FIG. 25 can be performed at 1702 of FIG. 17, and the template (T) of the current block C ) may correspond to the first template or the first pixel area of Fig. 17, and the template (T) of the reference block R ) may correspond to the second template or second pixel area of Fig. 17.
[0345] In step 2 of Fig. 25, the device (e.g., the image encoding device (200)) retrieves the searched template (T R ) is used to determine the prediction signal of the reference block for a set of intra prediction modes (or multiple intra prediction modes) (2512) using the reference pixels (or neighboring pixels) of the reference block corresponding to the reference block, and the restoration signal (R) of the reference block rec ) and the distortion between the prediction signal and the set of intra prediction modes (or multiple intra prediction modes) to find the best matching intra prediction mode. The device determines the intra prediction mode found in this way as the intra prediction mode of the reference block, and based on the determined intra prediction mode, calculates the prediction signal (R) of the reference block.pred ) can be determined. As an example that does not limit the proposed method of the present disclosure, the set of intra prediction modes (or multiple intra prediction modes) can include the intra prediction modes described with reference to FIGS. 20 and 21.
[0346] For example, step 2 of FIG. 25 may be performed at 1704 of FIG. 17, and the intra prediction mode of the reference block determined from among the intra prediction mode set (or multiple intra prediction modes) (2512) in FIG. 25 may correspond to the intra prediction mode of the reference block in FIG. 17.
[0347] In step 3 of FIG. 25, the device (e.g., the image encoding device (200)) generates a residual block (e.g., the residual signal (R) of the reference block) corresponding to the intra prediction mode determined in step 2. res )) can have or determine the residual predictor of the current block. For example, the device may have the restoration signal (R) of the reference block rec ) and the prediction signal of the reference block (R pred )(e.g., the difference R between the restored signal of the reference block and the predicted signal of the reference block rec - R pred ) based on the residual signal (R) of the reference block. res ) can be determined.
[0348] In step 4 of FIG. 25, the device (e.g., the video encoding device (200)) can predict the current block with the reference pixel (or neighboring pixel) of the current block using the intra prediction mode (e.g., the best matching intra prediction mode) of the reference block determined in step 2. For example, the device applies the intra prediction mode of the reference block to the reference pixel (or neighboring pixel) of the current block to generate a prediction signal (or predictor) (C) of the current block. pred ) can be determined.
[0349] In step 5 of Fig. 25, the device (e.g., the image encoding device (200)) generates a template (T) of a reference block.R ) corresponding to the residual predictor (e.g., the residual signal of the reference block (R res )) based on the residual signal (C) of the current block res ) can be additionally predicted. For example, as described with reference to FIG. 17, the device can predict the original signal (C) of the current block. org ), the prediction signal of the current block (C pred ), and the residual signal of the reference block (R res ), the residual difference signal of the current block ( ) can be determined. For example, the device can determine the original signal (C) of the current block. org ) and the predictor of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predictor of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the residual signal (R) of the reference block res )(e.g., the difference C between the residual signal of the current block and the residual signal of the reference block res - R res ) based on the residual difference signal of the current block ( ) can be determined. For example, the operation of the device illustrated in FIG. 25 can be performed based on mathematical expression 1.
[0350] [Mathematical Formula 1]
[0351] R res = R rec - R pred
[0352] C res = C org - C pred
[0353] = C res - R res
[0354] For example, steps 3 to 5 of FIG. 25 may be performed at 1706 of FIG. 17.
[0355] The device (e.g., the image encoding device (200)) outputs the residual differential signal of the current block ( ) can be processed and encoded into a bitstream (e.g., see 1708 of FIG. 17 and the related description). For example, the device can perform transform and quantization (or scaling) based on the residual difference signal of the current block to obtain transform coefficient information for the current block, and encode the transform coefficient information into the bitstream. For example, the device can omit transform and quantization (or scaling) and encode the residual difference signal of the current block into the bitstream. In the proposed method of the present disclosure, the residual difference signal of the current block can be encoded into the bitstream not only by these examples, but also through various methods.
[0356] Alternatively, step 5 of FIG. 25 may be optional. If step 5 of FIG. 25 is not performed, the current block (or the residual signal of the current block (C res )) is not applied to the residual prediction, and only the intra prediction mode of the current block can be derived from the template-based reference region. In this case, the device (e.g., the video encoding device (200)) uses the intra prediction mode of the reference block as the intra prediction mode of the current block to derive the residual signal (C) of the current block. res ) but the residual signal (R) of the reference block is determined res ) based on the residual signal (C) of the current block res ) without predicting the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream.
[0357] For example, if step 5 of Figure 25 is optional, the device may output the current block (or the residual signal of the current block (C res)) can determine whether to perform residual prediction on the current block. If the device decides not to perform residual prediction, the device may determine whether to perform residual prediction on the current block's original signal (C org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream. In this example, the device processes the current block (or the residual signal of the current block (C res )), the device performs the operation described in step 5 of FIG. 25 to obtain the residual differential signal ( ) is determined, and the residual difference signal of the determined current block ( ) can be processed and encoded into a bitstream.
[0358] In this example, whether step 5 of FIG. 25 is applied (or whether residual prediction is performed for the current block) may be indicated by flag information (signaled via the bitstream). For example, if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block, and if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block. For example, if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block, and if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block. A value other than 0 and 1 may be used for the flag information. If step 5 of FIG. 25 is optional, the device (e.g., the video encoding device (200)) may encode flag information indicating whether residual prediction is performed for the current block into the bitstream.
[0359] For example, flag information indicating whether residual prediction is performed for the current block can be signaled in a given data unit. For example, the given data unit can be a block, a maximum coding block (or a coding tree unit (CTU)), a tile, a slice, a picture, a sequence, etc. In addition, if the flag information is not included in the bitstream, the information can be inferred as a value indicating whether residual prediction is applied or not for the current block. In addition, the flag information can be signaled using an index. Even if residual prediction is applied to the current block in a higher-order data unit (e.g., a picture (or a picture parameter set (PPS)), a sequence (or a sequence parameter set (SPS)), etc.), flag information indicating whether residual prediction is performed for the current block can also be transmitted in a lower-order data unit (e.g., a block).
[0360] An operation corresponding to the operation on the encoder side described with reference to FIG. 25 can be performed on the decoder side.
[0361] For example, a device (e.g., a video decoding device (100)) processes a bitstream to obtain a residual differential signal ( ) can be obtained (e.g., see 1802 of FIG. 18 and the related description). Then, the device performs the operations described with reference to steps 1 to 4 of FIG. 25 to obtain the residual signal (R) of the reference block. res ) and the prediction signal of the current block (C pred ) can be determined (e.g., see 1804, 1806 and related descriptions in FIG. 18). Then, the device can determine, for example, the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). As an example, the device may determine the residual difference signal of the current block ( ) and the residual signal (R) of the reference block res )(Yes, the sum of the residual difference signal of the current block and the residual signal of the reference block + R res ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the predictor of the current block (C pred )(Yes, the sum C of the residual signal of the current block and the predictor of the current block res + C pred ) based on the restoration signal (C) of the current block rec ) can be determined.
[0362] For example, the operation of the device (e.g., image decoding device (100)) related to FIG. 25 can be performed based on mathematical expression 2. For example, in the operation of the device (e.g., image decoding device (100)) related to FIG. 25, the template (T) of the current block C ) may correspond to the first template or the first pixel area of Fig. 18, and the template (T) of the reference block R ) may correspond to the second template or second pixel area of Fig. 18.
[0363] [Equation 2]
[0364] R res = R rec - R pred
[0365] C res = + R res
[0366] C rec = C pred + C res
[0367] Alternatively, similar to the operation on the encoder side, residual prediction for the current block may be optional. In this case, the device (e.g., the image decoding device (100)) may predict the current block (or the residual signal (C) of the current block res )) can be obtained from the bitstream, flag information indicating whether residual prediction is applied to the current block. If the flag information indicates that residual prediction is applied to the current block, the device performs the operation described above (e.g., the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). If the flag information indicates that residual prediction is not applied to the current block, the device may determine the residual signal (C) of the current block.res ) and the prediction signal of the current block (C pred )(e.g., the sum C of the residual signal of the current block and the predicted signal of the current block res + C pred ) based on the restoration signal (C) of the current block rec ) can be determined.
[0368] In the proposed method 1 of the present disclosure, the encoder side and the decoder side determine the best intra prediction mode for the reference block, and use the determined intra prediction mode to predict the current block's prediction signal (C pred ) and the prediction signal of the reference block (R pred ), so that the intra prediction mode (e.g., the intra prediction mode described with reference to FIG. 20) may not be signaled through the bitstream. The proposed method of the present disclosure may be defined or used as a new intra mode, and the new intra mode may be referred to herein as a residual prediction intra mode.
[0369] Fig. 26 illustrates a template applicable to the proposed method of the present disclosure. The example of Fig. 26 can be used in step 1 of Fig. 25, 1702 of Fig. 17, 1804 of Fig. 18, or step 3 of Fig. 29. In the example of Fig. 26, it is assumed that the width and height of the block (2602) are W and H, respectively. The example of Fig. 26 is merely an example, and the form and cost function of the template applicable to the proposed method of the present disclosure are not limited to the example of Fig. 26. For example, although the number of lines constituting the templates (2604, 2614, 2624) in Figs. 26(a), 26(b), and 26(c) is illustrated as 4, W / 2, and H / 2, the proposed method of the present disclosure can be equally applied even when the templates (2604, 2614, and 2624) have different numbers of lines.
[0370] Referring to FIG. 26(a), FIG. 26(b), and FIG. 26(c), the templates (2604, 2614, and 2624) corresponding to the block (2602) may have an L-shape, or may include only the upper neighboring pixel area (or neighboring block), or may include only the left neighboring pixel area (or neighboring block). As described with reference to FIG. 23, the L-shaped template may include, for example, the left, upper, and upper left neighboring pixel areas (or neighboring blocks) of the block (2602).
[0371] For example, the shape of the templates (2604, 2614, 2624) can be explicitly signaled (via the bitstream). For example, the shape of the templates (2604, 2614, 2624) can be implicitly determined (without signaling via the bitstream). In this example, the shape of the templates (2604, 2614, 2624) can be determined based on the size of the current block (2602). As a specific example, if the width (W) of the current block (2602) is greater than the height (H), the templates (2604, 2614, 2624) can include the neighboring pixel area (or neighboring block) above. As a specific example, if the height (H) of the current block (2602) is greater than the width (W), the templates (2604, 2614, 2624) may include the neighboring pixel area (or neighboring block) on the left.
[0372] The size of the templates (2604, 2614, 2624) may be fixed or variable. For example, the width and height of the templates (2604, 2614, 2624) may be 4 and 4xH_4x4_Wx4 (e.g., see FIG. 26(a)). For example, the width and height of the templates (2604, 2614, 2624) may be W / 2 and H / 2 (e.g., see FIG. 26(b)). For example, the length of the templates (2604, 2614, 2624) may be equal to the size of the current block (e.g., the current coding unit (CU)) or may be twice the size of the current block (e.g., the current CU) (e.g., see FIG. 26(c)).
[0373] Referring again to FIG. 26, in step 1 of FIG. 25, a device (e.g., an image decoding device (100) or an image encoding device (200)) generates a template (T) of a current block in a given search area. C ) to find the template that best matches the current block's template (T C ) and the template being searched can be evaluated by a cost function. The device selects the pixel area corresponding to the lowest or highest value of the cost function in a given search area as the template (T) of the reference block. R ) can be determined. As described with reference to FIGS. 17 and 18, the cost function may include at least one of, for example, a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value. For example, SAD may be determined based on Equation 3, SSD may be determined based on Equation 4, the number of pixels (Num) having the same pixel value may be determined based on Equation 5, and Tmp cur (i) is the template of the current block (T C ) represents the pixel, and Tmpref (i) is the template of the reference block (T R ) represents the pixel of the current block, and (A ? B:C) represents that if condition A is satisfied, B is determined, and if condition A is not satisfied, C is determined. Therefore, mathematical expression 5 represents the template (T) of the current block. C ) and the template of the reference block (T R ) can represent the number of pixels (Num) that have the same pixel value.
[0374] [Equation 3]
[0375]
[0376] [Equation 4]
[0377]
[0378] [Equation 5]
[0379]
[0380] Fig. 27 illustrates reference pixels for intra prediction that can be applied to the proposed method of the present disclosure. The example of Fig. 27 is merely an example, and the reference pixels (2704) for intra prediction that can be applied to the proposed method of the present disclosure are not limited to the example of Fig. 27. For example, although the number of lines of the reference pixels (2704) for intra prediction is illustrated as 4 in the example of Fig. 27, the number of lines of the reference pixels (2704) can be any integer greater than or equal to 1. For example, although the line length of the reference pixels (2704) in the example of Fig. 27 is illustrated as twice the height (H) and width (W) of the block (2702) at the left and top (2H, 2W), the line length of the reference pixels (2704) can also be other values. For example, although Fig. 27 focuses on the intra prediction of the reference block (2702), the reference pixels described with reference to Fig. 27 can also be used for the intra prediction of the current block.
[0381] As described with reference to FIGS. 20 and 21, the intra prediction modes applicable to the proposed method of the present disclosure may include an intra-plane mode (or INTRA_PLANAR), an intra-DC mode (or INTRA_DC), an intra-angular mode (or INTRA_ANGULAR2 to INTRA_ANGULAR66), and / or other intra prediction modes of ITU-T H.266 / VVC (e.g., CCLM mode), and / or intra prediction modes of advanced video coding standards after ITU-T H.266 / VVC. All or at least some of the available intra prediction modes may be considered for the prediction of the reference block (2702).
[0382] The number (or size) of reference pixels for intra prediction of the reference block (2702) may be different from the template size for searching the reference block (e.g., see FIG. 26 and the related description). For example, as illustrated in FIG. 27, when the length of the template is equal to the block size (e.g., see FIG. 26(b), FIG. 26(c) and the related description), the reference pixels (or the length of the reference pixels) used for prediction may be twice the width (W) of the reference block (2702) at the top (2W), and twice the height (H) of the reference block (2702) at the left (2H). As a non-limiting example, 2Wx4 reference pixels may be used at the top left, top, and top right of the block (2702), and 2Hx4 reference pixels may be used at the top left, top, and bottom left of the block (2702).
[0383] Similar to multiple reference line intra prediction, multiple lines of (neighboring) reference pixels of a reference block (2702) can be used for prediction. For example, in the example of FIG. 27, four lines of reference pixels (2704) among the (neighboring) reference pixels of the reference block (2702) can be used for intra prediction mode determination and / or intra prediction of the reference block (2702). For example, a number of reference lines other than four (e.g., an integer greater than or equal to 1) can be used for intra prediction mode determination and / or intra prediction of the reference block (2702). Among the multiple reference lines, the (predicted) intra mode determined by a cost function (e.g., least distortion cost or minimum cost) and / or the best line (or line index or line number) used for prediction can be used for intra prediction of the current block, in which case the intra prediction mode and reference line index for the current block may not be signaled.
[0384] For example, the cost function used to determine the intra prediction mode of the reference block (2702) and / or to compare the prediction signals may include at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and the number of pixels having the same pixel value (see, e.g., FIGS. 17, 18, 26 and their associated descriptions). For example, the SAD may be determined based on Equation 3, the SSD may be determined based on Equation 4, and the number of pixels (Num) having the same pixel value may be determined based on Equation 5. In this example, Tmp in Equations 3 to 5 cur (i) represents a pixel of the reference block (2702), and Tmp ref(i) represents a reference pixel (2704) of a reference block (2702).
[0385] Figure 28 illustrates the proposed method 2 of the present disclosure.
[0386] The proposed method 2 of the present disclosure can be performed by a device (e.g., an image decoding device (100) or an image encoding device (200)). The proposed method 2 of the present disclosure relates to performing residual prediction based on a block vector, and is an example of using the intra prediction mode of a reference block as the intra prediction mode of a current block.
[0387] Referring to FIG. 28, in step 1, a device (e.g., a video encoding device (200)) can find a block (or reference block) (R) matching a current block in a given search area of a spatial domain using a block vector (BV). For example, the search area may be the same as or different from a search area (2310) for template matching. As an example that does not limit the proposed method of the present disclosure, the device can obtain a block vector (BV) based on block matching in the given search area and find a block (or reference block) (R) matching the current block. As a more specific example, the device can find the block vector (BV) of the current block and find the reference block (R) by performing the operation described with respect to FIG. 24. For example, step 1 of FIG. 25 can be performed at 1702 of FIG. 17.
[0388] In step 2 of FIG. 28, the device (e.g., the image encoding device (200)) determines a prediction signal of the reference block for a set of intra prediction modes (or multiple intra prediction modes) (2812) using reference pixels (or neighboring pixels) of the reference block, and generates a restoration signal (R) of the reference block. rec) and the distortion between the prediction signal and the set of intra prediction modes (or multiple intra prediction modes) to find the best matching intra prediction mode. The device determines the intra prediction mode found in this way as the intra prediction mode of the reference block, and based on the determined intra prediction mode, calculates the prediction signal (R) of the reference block. pred ) can be determined. As an example that does not limit the proposed method of the present disclosure, the intra prediction mode set (or multiple intra prediction modes) may include the intra prediction modes described with reference to FIGS. 20 and 21. For example, step 2 of FIG. 28 may be performed at 1704 of FIG. 17, and the intra prediction mode of the reference block determined from among the intra prediction mode set (or multiple intra prediction modes) (2812) in FIG. 28 may correspond to the intra prediction mode of the reference block of FIG. 17.
[0389] In step 3 of FIG. 28, the device (e.g., the image encoding device (200)) generates a residual block (e.g., the residual signal (R) of the reference block) corresponding to the intra prediction mode determined in step 2. res )) can have or determine the residual predictor of the current block. For example, the device may have the restoration signal (R) of the reference block rec ) and the prediction signal of the reference block (R pred )(e.g., the difference R between the restored signal of the reference block and the predicted signal of the reference block rec - R pred ) based on the residual signal (R) of the reference block. res ) can be determined. For example, step 3 of FIG. 28 may correspond to step 3 of FIG. 25.
[0390] In step 4 of FIG. 28, the device (e.g., the video encoding device (200)) can predict the current block with the reference pixel (or neighboring pixel) (2804) of the current block using the intra prediction mode (e.g., the best matching intra prediction mode) of the reference block determined in step 2. For example, the device can apply the intra prediction mode of the reference block to the reference pixel (or neighboring pixel) (2804) of the current block to generate a prediction signal (or predictor) (C) of the current block. pred ) can be determined.
[0391] In step 5 of FIG. 28, the device (e.g., the video encoding device (200)) generates a residual predictor for the current block (e.g., the residual signal (R) of the reference block). res )) based on the residual signal (C) of the current block res ) can be additionally predicted. For example, as described with reference to FIG. 17, the device can predict the original signal (C) of the current block. org ), the prediction signal of the current block (C pred ), and the residual signal of the reference block (R res ), the residual difference signal of the current block ( ) can be determined. For example, the device can determine the original signal (C) of the current block. org ) and the predictor of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predictor of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the residual signal (R) of the reference block res )(e.g., the difference C between the residual signal of the current block and the residual signal of the reference block res - R res ) based on the residual difference signal of the current block ( ) can be determined. For example, the operation of the device illustrated in FIG. 28 can be performed based on mathematical expression 1 (see FIG. 20 and related description).
[0392] For example, steps 3 to 5 of FIG. 28 may be performed at 1706 of FIG. 17.
[0393] The device (e.g., the image encoding device (200)) outputs the residual differential signal of the current block ( ) can be processed and encoded into a bitstream (e.g., see 1708 of FIG. 17 and the related description). For example, the device can perform transform and quantization (or scaling) based on the residual difference signal of the current block to obtain transform coefficient information for the current block, and encode the transform coefficient information into the bitstream. For example, the device can omit transform and quantization (or scaling) and encode the residual difference signal of the current block into the bitstream. In the proposed method of the present disclosure, the residual difference signal of the current block can be encoded into the bitstream not only by these examples, but also through various methods.
[0394] Alternatively, step 5 of Fig. 28 may be optional. The current block (or the residual signal of the current block (C res )) is not applied to the residual prediction, and only the intra prediction mode of the current block can be derived from the template-based reference region. In this case, the device (e.g., the video encoding device (200)) uses the intra prediction mode of the reference block as the intra prediction mode of the current block to derive the residual signal (C) of the current block. res ) but the residual signal (R) of the reference block is determined res ) based on the residual signal (C) of the current block res ) without predicting the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream.
[0395] For example, if step 5 of Figure 28 is optional, the device may output the current block (or the residual signal of the current block (C res )) can determine whether to perform residual prediction on the current block. If the device decides not to perform residual prediction, the device may determine whether to perform residual prediction on the current block's original signal (C org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream. In this example, the device processes the current block (or the residual signal of the current block (C res )), the device performs the operation described in step 5 of FIG. 28 to obtain the residual differential signal ( ) is determined, and the residual difference signal of the determined current block ( ) can be processed and encoded into a bitstream.
[0396] In this example, whether step 5 of FIG. 28 is applied (or whether residual prediction is performed for the current block) may be indicated by flag information (signaled via the bitstream). For example, if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block, and if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block. For example, if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block, and if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block. A value other than 0 and 1 may be used for the flag information. If step 5 of FIG. 28 is optional, the device (e.g., the video encoding device (200)) may encode flag information indicating whether residual prediction is performed for the current block into the bitstream.
[0397] For example, flag information indicating whether residual prediction is performed for the current block can be signaled in a given data unit. For example, the given data unit can be a block, a maximum coding block (or a coding tree unit (CTU)), a tile, a slice, a picture, a sequence, etc. In addition, if the flag information is not included in the bitstream, the information can be inferred as a value indicating whether residual prediction is applied or not for the current block. In addition, the flag information can be signaled using an index. Even if residual prediction is applied to the current block in a higher-order data unit (e.g., a picture (or a picture parameter set (PPS)), a sequence (or a sequence parameter set (SPS)), etc.), flag information indicating whether residual prediction is performed for the current block can also be transmitted in a lower-order data unit (e.g., a block).
[0398] An operation corresponding to the operation on the encoder side described with reference to FIG. 28 can be performed on the decoder side.
[0399] For example, a device (e.g., a video decoding device (100)) processes a bitstream to obtain a residual differential signal ( ) can be obtained (e.g., see 1802 of FIG. 18 and the related description). In addition, the device can process the bitstream to obtain a block vector (BV) of the current block (e.g., see FIG. 24 and the related description), and find a block (or reference block) (R) matching the current block with the block vector. Then, the device performs the operations described with reference to steps 2 to 4 of FIG. 28 to obtain the residual signal (R) of the reference block. res ) and the prediction signal of the current block (C pred ) can be determined (e.g., see 1804, 1806 and related descriptions in FIG. 18). Then, the device can determine, for example, the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). As an example, the device may determine the residual difference signal of the current block ( ) and the residual signal (R) of the reference block res )(Yes, the sum of the residual difference signal of the current block and the residual signal of the reference block + R res ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the predictor of the current block (C pred )(Yes, the residual signal of the current block and the predictor C of the current block res + C pred ) based on the restoration signal (C) of the current blockrec ) can be determined. For example, the operation of the device (e.g., image decoding device (100)) related to FIG. 28 can be performed based on mathematical expression 2.
[0400] Alternatively, similar to the operation on the encoder side, residual prediction for the current block may be optional. In this case, the device (e.g., the image decoding device (100)) may predict the current block (or the residual signal (C) of the current block res )) can be obtained from the bitstream, flag information indicating whether residual prediction is applied to the current block. If the flag information indicates that residual prediction is applied to the current block, the device performs the operation described above (e.g., the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). If the flag information indicates that residual prediction is not applied to the current block, the device may determine the residual signal (C) of the current block. res ) and the prediction signal of the current block (C pred )(e.g., the sum C of the residual signal of the current block and the predicted signal of the current block res + C pred ) based on the restoration signal (C) of the current block rec ) can be determined.
[0401] The proposed method 2 of the present disclosure differs from the proposed method 1 of the present disclosure in that it finds a reference block (R) using a block vector (BV) instead of template matching. Therefore, in the proposed method 2 of the present disclosure, the block vector (BV) can be signaled through a bitstream. However, similar to the proposed method 1 of the present disclosure, in the proposed method 2 of the present disclosure, the best intra prediction mode for the reference block is determined at the encoder side and the decoder side, and the determined intra prediction mode is used to predict the current block (C). pred ) and the prediction signal of the reference block (R pred ), so that the intra prediction mode (e.g., the intra prediction mode described with reference to FIG. 20) may not be signaled through the bitstream. The proposed method of the present disclosure can be defined or used as a new intra mode (or residual prediction intra mode).
[0402] For example, the intra prediction mode for intra prediction of a reference block may consider all or at least some of the intra prediction modes described with reference to FIGS. 20, 21, and 27. The reference pixels for intra prediction of a reference block may be determined as described with reference to FIG. 27. The cost function used to determine the intra prediction mode of the reference block may use at least one of the cost functions described with reference to FIG. 27 (e.g., see FIGS. 17, 18, 26 and their related descriptions).
[0403] And / or, for the cost function, the sum of absolute transformed differences (SATD) may be used. Fig. 27 and its entirety are incorporated herein by reference.
[0404] Figure 29 illustrates the proposed method 3 of the present disclosure.
[0405] The proposed method 3 of the present disclosure can be performed by a device (e.g., an image decoding device (100) or an image encoding device (200)). The proposed method 3 of the present disclosure relates to performing residual prediction (or residual prediction intra mode) based on template matching, and is an example of signaling the intra prediction mode of the current block through a bitstream and using the intra prediction mode of the current block as the intra prediction mode of the reference block.
[0406] Referring to FIG. 29, in step 1, a device (e.g., a video encoding device (200)) determines a prediction signal of the current block for a set of intra prediction modes (or multiple intra prediction modes) (2902) using reference pixels (or neighboring pixels) of the current block and an original signal (C) of the current block. org ) and the distortion between the prediction signal and the set of intra prediction modes (or multiple intra prediction modes) to find the best matching intra prediction mode. The device determines the intra prediction mode found in this way as the intra prediction mode of the current block, and based on the determined intra prediction mode, the prediction signal (C) of the current block pred ) can be determined. As an example that does not limit the proposed method of the present disclosure, the intra prediction mode set (or multiple intra prediction modes) can include the intra prediction modes described with reference to FIGS. 20 and 21. The intra prediction mode of the current block determined in this way can be used as the intra prediction mode of the reference block and can be signaled to the decoder side through the bitstream.
[0407] Alternatively, in step 1 of FIG. 29, the intra prediction mode of the current block may be determined based on a template-based intra mode derivation (TIMD) method. Since the decoder side may also determine the intra prediction mode of the current block using the same method, the device (e.g., the video encoding device (200)) may not signal the intra prediction mode of the current block through the bitstream. Specifically, the device may perform intra prediction on the template of the current block using reference pixels of the template of the current block (or a neighboring pixel area of the current block or a neighboring block) for each of a set of intra prediction modes (or a plurality of intra prediction modes) (e.g., see FIGS. 20 and 21 and their descriptions), to determine a prediction signal for the template of the current block, determine a cost function (e.g., SAD, SSD, SATD (Sum of Absolute Transformed Difference)) using the reconstructed signal and the prediction signal of the template of the current block, and derive one or two intra prediction modes corresponding to the lowest or highest value among the determined cost functions. As an example that does not limit the proposed method of the present disclosure, the template of the current block may include at least one of an upper neighboring pixel area, a left neighboring pixel area, or an upper-left neighboring pixel area of the current block. Instead of TIMD, a decoder-side intra mode derivation (DIMD) method may be used.
[0408] For example, step 1 of FIG. 29 may be performed at 1704 of FIG. 17, and the intra prediction mode of the current block determined from among the intra prediction mode set (or multiple intra prediction modes) (2902) of FIG. 29 may correspond to the intra prediction mode of the current block of FIG. 17.
[0409] In step 2 of Fig. 29, the device (e.g., the image encoding device (200)) outputs the residual signal (C) of the current block. res ) can generate or determine the original signal (C) of the current block. For example, the device org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) can be created or determined.
[0410] In step 3 of Fig. 29, the device (e.g., the image encoding device (200)) generates a template (T) of the current block. C ) is used to find the template (T) of the current block in the given search area of the spatial domain. C ) can find the part (or template) that best matches the reference block. As an example that does not limit the proposed method of the present disclosure, the device may find the template (T) of the reference block based on the template matching prediction (TMP). R ) can be found. In addition, the device can find the template (T) of the reference block R ) can determine a reference block corresponding to the template (T) of the reference block. As a more specific example, the device performs the operation described with respect to FIG. 23 to determine a template (T) of the reference block. R ) can be found.
[0411] For example, step 3 of FIG. 29 can be performed at 1702 of FIG. 17, and the template (T) of the current block C ) may correspond to the first template or the first pixel area of Fig. 17, and the template (T) of the reference block R ) may correspond to the second template or second pixel area of Fig. 17. Step 3 of Fig. 29 may correspond to step 1 of Fig. 25.
[0412] In step 4 of FIG. 29, the device (e.g., the video encoding device (200)) can predict the reference block with the reference pixel (or neighboring pixel) of the reference block using the intra prediction mode (e.g., the best matching intra prediction mode) of the current block determined in step 1. For example, the device applies the intra prediction mode of the current block to the reference pixel (or neighboring pixel) of the reference block to generate a prediction signal (or predictor) (R) of the reference block. pred ) can be determined.
[0413] In step 5 of FIG. 29, the device (e.g., the image encoding device (200)) generates a residual block (e.g., the residual signal (R) of the reference block) corresponding to the intra prediction mode determined in step 1. res )) can have or determine the residual predictor of the current block. For example, the device may have the restoration signal (R) of the reference block rec ) and the prediction signal of the reference block (R pred )(e.g., the difference R between the restored signal of the reference block and the predicted signal of the reference block rec - R pred ) based on the residual signal (R) of the reference block. res ) can be determined.
[0414] In step 6 of FIG. 29, the device (e.g., the image encoding device (200)) generates a template (T) of a reference block. R ) corresponding to the residual predictor (e.g., the residual signal of the reference block (R res )) based on the residual signal (C) of the current block res ) can be additionally predicted. For example, as described with reference to FIG. 17, the device can predict the original signal (C) of the current block. org ), the prediction signal of the current block (C pred ), and the residual signal of the reference block (R res ), the residual difference signal of the current block ( ) can be determined. For example, the device can determine the original signal (C) of the current block. org) and the predictor of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predictor of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the residual signal (R) of the reference block res )(e.g., the difference C between the residual signal of the current block and the residual signal of the reference block res - R res ) based on the residual difference signal of the current block ( ) can be determined. For example, the operation of the device illustrated in FIG. 29 can be performed based on mathematical expression 1 (see FIG. 20 and related description).
[0415] For example, steps 4 to 6 of FIG. 29 may be performed at 1706 of FIG. 17.
[0416] The device (e.g., the image encoding device (200)) outputs the residual differential signal of the current block ( ) can be processed and encoded into a bitstream (e.g., see 1708 of FIG. 17 and the related description). For example, the device can perform transform and quantization (or scaling) based on the residual difference signal of the current block to obtain transform coefficient information for the current block, and encode the transform coefficient information into the bitstream. For example, the device can omit transform and quantization (or scaling) and encode the residual difference signal of the current block into the bitstream. In the proposed method of the present disclosure, the residual difference signal of the current block can be encoded into the bitstream not only by these examples, but also through various methods.
[0417] Alternatively, step 6 of FIG. 29 may be optional. If step 6 of FIG. 29 is not performed, the current block (or the residual signal of the current block (C res)) may not be applied to the residual prediction. In this case, the device (e.g., the video encoding device (200)) may use the intra prediction mode of the current block signaled through the bitstream to generate the residual signal (C) of the current block. res ) but the residual signal (R) of the reference block is determined res ) based on the residual signal (C) of the current block res ) without predicting the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream.
[0418] For example, if step 6 of Figure 29 is optional, the device may output the current block (or the residual signal of the current block (C res )) can determine whether to perform residual prediction on the current block. If the device decides not to perform residual prediction, the device may determine whether to perform residual prediction on the current block's original signal (C org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream. In this example, the device processes the current block (or the residual signal of the current block (C res )), the device performs the operation described in step 6 of FIG. 29 to obtain the residual differential signal ( ) is determined, and the residual difference signal of the determined current block ( ) can be processed and encoded into a bitstream.
[0419] In this example, whether step 6 of FIG. 29 is applied (or whether residual prediction is performed for the current block) may be indicated by flag information (signaled via the bitstream). For example, if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block, and if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block. For example, if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block, and if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block. A value other than 0 and 1 may be used for the flag information. If step 6 of FIG. 29 is optional, the device (e.g., the video encoding device (200)) may encode flag information indicating whether residual prediction is performed for the current block into the bitstream.
[0420] For example, flag information indicating whether residual prediction is performed for the current block can be signaled in a given data unit. For example, the given data unit can be a block, a maximum coding block (or a coding tree unit (CTU)), a tile, a slice, a picture, a sequence, etc. In addition, if the flag information is not included in the bitstream, the information can be inferred as a value indicating whether residual prediction is applied or not for the current block. In addition, the flag information can be signaled using an index. Even if residual prediction is applied to the current block in a higher-order data unit (e.g., a picture (or a picture parameter set (PPS)), a sequence (or a sequence parameter set (SPS)), etc.), flag information indicating whether residual prediction is performed for the current block can also be transmitted in a lower-order data unit (e.g., a block).
[0421] An operation corresponding to the operation on the encoder side described with reference to FIG. 29 can be performed on the decoder side.
[0422] For example, a device (e.g., a video decoding device (100)) processes a bitstream to obtain a residual differential signal ( ) can be obtained (e.g., see 1802 of FIG. 18 and the related description). In addition, the device can process the bitstream to obtain the intra prediction mode of the current block. Alternatively, the device can determine the intra prediction mode of the current block based on the template (or neighboring pixel area) of the current block without obtaining the intra prediction mode of the current block from the bitstream (e.g., TIMD method). Then, the device performs the operations described with reference to steps 2 to 5 of FIG. 29 to obtain the residual signal (R) of the reference block. res ) and the prediction signal of the current block (C pred ) can be determined (e.g., see 1804, 1806 and related descriptions in FIG. 18). Then, the device can determine, for example, the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). As an example, the device may determine the residual difference signal of the current block ( ) and the residual signal (R) of the reference block res )(Yes, the sum of the residual difference signal of the current block and the residual signal of the reference block + R res ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the predictor of the current block (C pred )(Yes, the residual signal of the current block and the predictor C of the current blockres + C pred ) based on the restoration signal (C) of the current block rec ) can be determined.
[0423] For example, the operation of the device (e.g., image decoding device (100)) related to FIG. 29 can be performed based on mathematical expression 2. For example, in the operation of the device (e.g., image decoding device (100)) related to FIG. 29, the template (T) of the current block C ) may correspond to the first template or the first pixel area of Fig. 18, and the template (T) of the reference block R ) may correspond to the second template or second pixel area of Fig. 18.
[0424] Alternatively, similar to the operation on the encoder side, residual prediction for the current block may be optional. In this case, the device (e.g., the image decoding device (100)) may predict the current block (or the residual signal (C) of the current block res )) can be obtained from the bitstream, flag information indicating whether residual prediction is applied to the current block. If the flag information indicates that residual prediction is applied to the current block, the device performs the operation described above (e.g., the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). If the flag information indicates that residual prediction is not applied to the current block, the device may determine the residual signal (C) of the current block. res ) and the prediction signal of the current block (C pred )(e.g., the sum C of the residual signal of the current block and the predicted signal of the current block res + C pred ) based on the restoration signal (C) of the current block rec) can be determined.
[0425] As described above, in the proposed method 3 of the present disclosure, information (e.g., flag information) indicating whether residual prediction is applied to the current block (or during intra prediction of the current block) can be signaled (via the bitstream). In the proposed method 3 of the present disclosure, the encoder determines the best intra prediction mode for the current block and signals it (via the bitstream), and the decoder uses the signaled intra prediction mode to generate a prediction signal (C) of the current block. pred ) and the prediction signal of the reference block (R pred ) can be determined. The proposed method of the present disclosure can be defined or used as a new intra mode (or residual prediction intra mode).
[0426] For example, in step 3 of Fig. 29, the template (T) of the current block C ), the template shape and / or cost function described with reference to FIG. 26 may be used. FIG. 26 and its entirety are incorporated herein by reference.
[0427] Figure 30 illustrates the proposed method 4 of the present disclosure.
[0428] The proposed method 4 of the present disclosure can be performed by a device (e.g., an image decoding device (100) or an image encoding device (200)). The proposed method 4 of the present disclosure relates to performing residual prediction (or residual prediction intra mode) based on a block vector, and is an example of signaling the intra prediction mode of a current block through a bitstream and using the intra prediction mode of the current block as the intra prediction mode of a reference block.
[0429] Referring to FIG. 30, in step 1, a device (e.g., a video encoding device (200)) determines a prediction signal of the current block for a set of intra prediction modes (or multiple intra prediction modes) (3002) using reference pixels (or neighboring pixels) of the current block and an original signal (C) of the current block. org ) and the distortion between the prediction signal and the set of intra prediction modes (or multiple intra prediction modes) to find the best matching intra prediction mode. The device determines the intra prediction mode found in this way as the intra prediction mode of the current block, and based on the determined intra prediction mode, the prediction signal (C) of the current block pred ) can be determined. As an example that does not limit the proposed method of the present disclosure, the intra prediction mode set (or multiple intra prediction modes) can include the intra prediction modes described with reference to FIGS. 20 and 21. The intra prediction mode of the current block determined in this way can be used as the intra prediction mode of the reference block and can be signaled to the decoder side through the bitstream.
[0430] Alternatively, in step 1 of FIG. 30, the intra prediction mode of the current block may be determined based on a template-based intra mode derivation (TIMD) method. Since the decoder side may also determine the intra prediction mode of the current block using the same method, the device (e.g., the video encoding device (200)) may not signal the intra prediction mode of the current block through the bitstream. Specifically, the device may perform intra prediction on the template of the current block using reference pixels of the template of the current block (or a neighboring pixel area of the current block or a neighboring block) for each of a set of intra prediction modes (or a plurality of intra prediction modes) (e.g., see FIGS. 20 and 21 and their descriptions), to determine a prediction signal for the template of the current block, determine a cost function (e.g., SAD, SSD, SATD (Sum of Absolute Transformed Difference)) using the reconstructed signal and the prediction signal of the template of the current block, and derive one or two intra prediction modes corresponding to the lowest or highest value among the determined cost functions. As an example that does not limit the proposed method of the present disclosure, the template of the current block may include at least one of an upper neighboring pixel area, a left neighboring pixel area, or an upper-left neighboring pixel area of the current block. Instead of TIMD, a decoder-side intra mode derivation (DIMD) method may be used.
[0431] For example, step 1 of FIG. 30 may be performed at 1704 of FIG. 17, and the intra prediction mode of the current block determined from among the intra prediction mode set (or multiple intra prediction modes) (3002) of FIG. 30 may correspond to the intra prediction mode of the current block of FIG. 17.
[0432] In step 2 of Fig. 30, the device (e.g., the image encoding device (200)) outputs the residual signal (C) of the current block. res) can generate or determine the original signal (C) of the current block. For example, the device org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) can be created or determined.
[0433] In step 3 of FIG. 30, the device (e.g., the video encoding device (200)) can find a block (or reference block) (R) matching the current block in a given search area of the spatial domain using a block vector (BV). For example, the search area may be the same as or different from the search area (2310) for template matching. As an example that does not limit the proposed method of the present disclosure, the device can obtain a block vector (BV) based on block matching in the given search area and find a block (or reference block) (R) matching the current block. As a more specific example, the device can find the block vector (BV) of the current block and find the reference block (R) by performing the operation described with respect to FIG. 24. For example, step 3 of FIG. 30 can be performed at 1702 of FIG. 17.
[0434] In step 4 of FIG. 30, the device (e.g., the video encoding device (200)) can predict the reference block with the reference pixel (or neighboring pixel) of the reference block using the intra prediction mode (e.g., the best matching intra prediction mode) of the current block determined in step 1. For example, the device applies the intra prediction mode of the current block to the reference pixel (or neighboring pixel) of the reference block to generate a prediction signal (or predictor) (R) of the reference block. pred ) can be determined.
[0435] In step 5 of FIG. 30, the device (e.g., the image encoding device (200)) generates a residual block (e.g., the residual signal (R) of the reference block) corresponding to the intra prediction mode determined in step 1. res )) can have or determine the residual predictor of the current block. For example, the device may have the restoration signal (R) of the reference block rec ) and the prediction signal of the reference block (R pred )(e.g., the difference R between the restored signal of the reference block and the predicted signal of the reference block rec - R pred ) based on the residual signal (R) of the reference block. res ) can be determined.
[0436] In step 6 of Fig. 30, the device (e.g., the image encoding device (200)) generates a template (T) of a reference block. R ) corresponding to the residual predictor (e.g., the residual signal of the reference block (R res )) based on the residual signal (C) of the current block res ) can be additionally predicted. For example, as described with reference to FIG. 17, the device can predict the original signal (C) of the current block. org ), the prediction signal of the current block (C pred ), and the residual signal of the reference block (R res ), the residual difference signal of the current block ( ) can be determined. For example, the device can determine the original signal (C) of the current block. org ) and the predictor of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predictor of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the residual signal (R) of the reference block res )(e.g., the difference C between the residual signal of the current block and the residual signal of the reference block res - Rres ) based on the residual difference signal of the current block ( ) can be determined. For example, the operation of the device illustrated in FIG. 30 can be performed based on mathematical expression 1 (see FIG. 20 and related description).
[0437] For example, steps 4 to 6 of FIG. 30 may be performed at 1706 of FIG. 17.
[0438] The device (e.g., the image encoding device (200)) outputs the residual differential signal of the current block ( ) can be processed and encoded into a bitstream (e.g., see 1708 of FIG. 17 and the related description). For example, the device can perform transform and quantization (or scaling) based on the residual difference signal of the current block to obtain transform coefficient information for the current block, and encode the transform coefficient information into the bitstream. For example, the device can omit transform and quantization (or scaling) and encode the residual difference signal of the current block into the bitstream. In the proposed method of the present disclosure, the residual difference signal of the current block can be encoded into the bitstream not only by these examples, but also through various methods.
[0439] Alternatively, step 6 of FIG. 30 may be optional. If step 6 of FIG. 30 is not performed, the current block (or the residual signal of the current block (C res )) may not be applied to the residual prediction. In this case, the device (e.g., the video encoding device (200)) may use the intra prediction mode of the current block signaled through the bitstream to generate the residual signal (C) of the current block. res ) but the residual signal (R) of the reference block is determined res ) based on the residual signal (C) of the current block res ) without predicting the residual signal (C) of the current block. res) can be processed and encoded into a bitstream.
[0440] For example, if step 6 of Figure 30 is optional, the device may output the current block (or the residual signal of the current block (C res )) can determine whether to perform residual prediction on the current block. If the device decides not to perform residual prediction, the device may determine whether to perform residual prediction on the current block's original signal (C org ) and the prediction signal of the current block (C pred )(e.g., the difference C between the original signal of the current block and the predicted signal of the current block org - C pred ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) can be processed and encoded into a bitstream. In this example, the device processes the current block (or the residual signal of the current block (C res )), the device performs the operation described in step 6 of FIG. 30 to obtain the residual differential signal ( ) is determined, and the residual difference signal of the determined current block ( ) can be processed and encoded into a bitstream.
[0441] In this example, whether step 6 of FIG. 30 is applied (or whether residual prediction is performed for the current block) may be indicated by flag information (signaled via the bitstream). For example, if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block, and if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block. For example, if the value of the flag information is 1, the flag information may indicate that residual prediction is not performed for the current block, and if the value of the flag information is 0, the flag information may indicate that residual prediction is performed for the current block. A value other than 0 and 1 may be used for the flag information. If step 6 of FIG. 30 is optional, the device (e.g., the video encoding device (200)) may encode flag information indicating whether residual prediction is performed for the current block into the bitstream.
[0442] For example, flag information indicating whether residual prediction is performed for the current block can be signaled in a given data unit. For example, the given data unit can be a block, a maximum coding block (or a coding tree unit (CTU)), a tile, a slice, a picture, a sequence, etc. In addition, if the flag information is not included in the bitstream, the information can be inferred as a value indicating whether residual prediction is applied or not for the current block. In addition, the flag information can be signaled using an index. Even if residual prediction is applied to the current block in a higher-order data unit (e.g., a picture (or a picture parameter set (PPS)), a sequence (or a sequence parameter set (SPS)), etc.), flag information indicating whether residual prediction is performed for the current block can also be transmitted in a lower-order data unit (e.g., a block).
[0443] An operation corresponding to the operation on the encoder side described with reference to FIG. 30 can be performed on the decoder side.
[0444] For example, a device (e.g., a video decoding device (100)) processes a bitstream to obtain a residual differential signal ( ) can be obtained (e.g., see 1802 of FIG. 18 and the related description). In addition, the device can process the bitstream to obtain the intra prediction mode of the current block. Alternatively, the device can determine the intra prediction mode of the current block based on the template (or neighboring pixel area) of the current block without obtaining the intra prediction mode of the current block from the bitstream (e.g., TIMD method). Then, the device performs the operations described with reference to steps 2 to 5 of FIG. 30 to obtain the residual signal (R) of the reference block. res ) and the prediction signal of the current block (C pred ) can be determined (e.g., see 1804, 1806 and related descriptions in FIG. 18). Then, the device can determine, for example, the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). As an example, the device may determine the residual difference signal of the current block ( ) and the residual signal (R) of the reference block res )(Yes, the sum of the residual difference signal of the current block and the residual signal of the reference block + R res ) based on the residual signal (C) of the current block res ) and determine the residual signal (C) of the current block. res ) and the predictor of the current block (C pred)(Yes, the sum C of the residual signal of the current block and the predictor of the current block res + C pred ) based on the restoration signal (C) of the current block rec ) can be determined. For example, the operation of the device (e.g., image decoding device (100)) related to FIG. 30 can be performed based on mathematical expression 2.
[0445] Alternatively, similar to the operation on the encoder side, residual prediction for the current block may be optional. In this case, the device (e.g., the image decoding device (100)) may predict the current block (or the residual signal (C) of the current block res )) can be obtained from the bitstream, flag information indicating whether residual prediction is applied to the current block. If the flag information indicates that residual prediction is applied to the current block, the device performs the operation described above (e.g., the residual differential signal of the current block ( ), residual signal of the reference block (R res ), and the prediction signal of the current block (C pred ) based on the restoration signal (C) of the current block rec ) can be determined (e.g., see 1808 of FIG. 18 and the related description). If the flag information indicates that residual prediction is not applied to the current block, the device may determine the residual signal (C) of the current block. res ) and the prediction signal of the current block (C pred )(e.g., the sum C of the residual signal of the current block and the predicted signal of the current block res + C pred ) based on the restoration signal (C) of the current block rec ) can be determined.
[0446] As described above, in the proposed method 4 of the present disclosure, information (e.g., flag information) indicating whether residual prediction is applied to the current block (or during intra prediction of the current block) can be signaled (via the bitstream). In the proposed method 4 of the present disclosure, the encoder determines the best intra prediction mode for the current block and signals it (via the bitstream), and the decoder uses the signaled intra prediction mode to generate a prediction signal (C) of the current block. pred ) and the prediction signal of the reference block (R pred ) can be determined. In the proposed method 4 of the present disclosure, the encoder side signals the block vector (BV) of the current block (via the bitstream), and the decoder side can determine the reference block corresponding to the current block using the signaled block vector (BV) of the current block. The proposed method of the present disclosure can be defined or used as a new intra mode (or residual prediction intra mode).
[0447] The proposed method of the present disclosure can be used as an independent intra prediction mode. For example, the proposed method of the present disclosure can be referred to as a residual prediction intra mode. As described in proposed methods 1 to 4 of the present disclosure, flag information indicating whether residual prediction is applied to the current block can be signaled through the bitstream in units of predetermined blocks (e.g., coding units (CUs), coding tree units (CTUs), etc.). As described in proposed methods 1 to 4 of the present disclosure, when the flag information is signaled through the bitstream, residual prediction for the current block can be optional.
[0448] For example, when the residual prediction intra mode is applied in the proposed method of the present disclosure, residual reordering may be applied to the current block. Whether residual reordering is applied to the current block may be signaled by flag information indicating whether residual prediction is applied to the current block and separate flag information.
[0449] For example, the proposed method of the present disclosure can be used as an additional option when the intra block copy (IBC) mode is applied. For example, when the IBC mode is applied to the current block, it is possible to determine whether the reference block is used as a predictor of the current block in the IBC mode or whether the residual signal (R) of the reference block is used using the proposed method of the present disclosure. res ) as a predictor of the current block and flag information indicating whether to perform residual prediction for the current block can be signaled through the bitstream.
[0450] For example, the proposed method of the present disclosure can be used as an additional option in the intra TMP mode. For example, when the intra TMP mode is applied to the current block, whether the reference block is used as a predictor of the current block in the intra TMP mode or the residual signal (R) of the reference block is used using the proposed method of the present disclosure. res ) as a predictor of the current block and flag information indicating whether to perform residual prediction for the current block can be signaled through the bitstream.
[0451] For example, the prediction mode (or residual prediction intra mode) according to the proposed method of the present disclosure can be weighted combined (e.g., weighted average or weighted sum) with another intra prediction mode (e.g., see FIG. 20, FIG. 21 and related descriptions) to determine a predictor for the current block. For example, the prediction signal (C) of the current block determined based on the proposed method of the present disclosure pred ) and the intra prediction mode (e.g., see Fig. 20, Fig. 21 and related descriptions) are weightedly combined (e.g., weighted average or weighted sum) to obtain the prediction signal (C) of the current block. pred ) can be determined. For example, the residual difference signal of the current block determined based on the proposed method of the present disclosure ( ) and the intra prediction mode (e.g., see FIG. 20, FIG. 21 and related descriptions) can be used to determine the residual signal of the current block by weighting and combining (e.g., weighted average or weighted sum).
[0452] For example, in the proposed method of the present disclosure, a block (e.g., a current block, a reference block) may be a coding unit (CU) (or a coding block), a prediction unit (PU) (or a prediction block), a transform unit (TU) (or a transform block), or any other unit block.
[0453] For example, in the proposed method of the present disclosure, the residual signal (C) of the current block res ) can be predicted in the spatial domain, but can also be predicted in the transform domain. If the residual signal is predicted in the transform domain, the device (e.g., the image encoding device (200)) predicts the residual signal (C) of the current block. res) to determine transform coefficient information by performing a transform (using a transform kernel such as a discrete cosine transform (DCT)) and discarding at least some high-frequency coefficients (e.g., setting the high-frequency coefficients to 0) from the transform coefficient information, thereby performing residual subtraction in the transform domain. Then, the device can inversely transform the result of the residual subtraction to determine a final residual signal of the current block in the spatial domain, and process the final residual signal to encode it into a bitstream. The decoder side processes the bitstream to determine the residual signal (C) of the current block. res ) and obtain the restoration signal (C) of the current block based on the proposed method of the present disclosure. rec ) can be determined.
[0454] FIGS. 31 and 32 illustrate devices configured to perform the proposed method of the present disclosure. The example of FIG. 31 illustrates a video decoding device (100) configured to implement the proposed method of the present disclosure, and the example of FIG. 32 illustrates a video encoding device (200) configured to implement the proposed method of the present disclosure. FIGS. 31 and 32 are merely examples and are not intended to limit the devices implementing the proposed method of the present disclosure. For example, the devices (100, 200) may include other components (e.g., a transceiver, etc.) in addition to the components illustrated in FIGS. 31 and 32, and some components may be omitted or configured externally to the devices (100, 200).
[0455] Referring to FIG. 31, the device (100) may include at least one memory (110) and at least one processor (120). The at least one memory (110) may include instructions for implementing the proposed method of the present disclosure. The at least one processor (120) may be operably connected to the at least one memory (110) and configured to execute instructions contained in the at least one memory (110) to implement the proposed method of the present disclosure (e.g., see FIG. 18 and related description).
[0456] Referring to FIG. 32, the device (200) may include at least one memory (210) and at least one processor (220). The at least one memory (210) may include instructions for implementing the proposed method of the present disclosure. The at least one processor (220) may be operably connected to the at least one memory (210) and configured to execute instructions contained in the at least one memory (210) to implement the proposed method of the present disclosure (e.g., see FIG. 17 and related description).
[0457] The proposed method of the present disclosure may be implemented in the form of hardware, software, or a combination of hardware and software. If implemented in software, the proposed method of the present disclosure may be implemented as a program executable on a computer, and the implemented program may be stored in a non-transitory computer-readable storage medium. The program stored in the non-transitory computer-readable storage medium may be configured to be executable by at least one processor (120, 220) of the device (100, 200) and may be configured with instructions configured to implement the proposed method of the present disclosure when executed by the at least one processor (120, 220).
[0458] A non-transitory computer-readable storage medium may permanently store a computer-executable program, or may temporarily store it for execution or download. Furthermore, the medium may be a variety of recording or storage means in the form of a single or multiple hardware combinations, and is not limited to media directly connected to a computer system, but may also be distributed over a network. Examples of the medium include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and anything configured to store program instructions, including ROM, RAM, and flash memory. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, "non-transitory storage medium" simply means a tangible device that does not contain signals (e.g., electromagnetic waves). The term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium. For example, a "non-transitory storage medium" may include a buffer in which data is temporarily stored.
[0459] In addition, examples of other media include app stores that distribute applications, sites that supply or distribute various software, and recording media or storage media managed by servers.
[0460] Above, the technical idea of the present disclosure has been described in detail with reference to preferred embodiments, but the technical idea of the present disclosure is not limited to the above embodiments, and various modifications and changes are possible by a person having ordinary knowledge in the art within the scope of the technical idea of the present disclosure.
Claims
1. A method for decrypting a bitstream by a device, A step of processing the above bitstream to obtain a residual difference signal of the current block; A step of determining a reference block corresponding to the current block in the current picture including the current block; A step of determining a residual signal of the reference block based on a restoration signal of the reference block and a prediction signal of the reference block; and A step of determining a restoration signal of the current block based on a residual differential signal of the current block, a residual signal of the reference block, and a prediction signal of the current block, The prediction signal of the above reference block is determined based on at least one reference pixel included in a neighboring block of the above reference block in the current picture, A method wherein the prediction signal of the current block is determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
2. In claim 1, Further comprising a step of determining an intra prediction mode of the reference block from among a plurality of intra prediction modes based on a restoration signal of the reference block and at least one reference pixel included in a neighboring block of the reference block, The prediction signal of the above reference block is determined based on the intra prediction mode of the above reference block and at least one reference pixel included in a neighboring block of the above reference block in the current picture, A method wherein the prediction signal of the current block is determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture.
3. In claim 2, The step of determining the intra prediction mode of the reference block among the plurality of intra prediction modes is: Calculating a function value for each of the plurality of intra prediction modes based on the restoration signal of the reference block and at least one reference pixel included in a neighboring block of the reference block; and A method comprising determining an intra prediction mode corresponding to a lowest function value or a highest function value among the calculated function values as the intra prediction mode of the current block.
4. In claim 3, A method wherein the function value includes at least one of a sum of absolute differences (SAD), a sum of squared differences (SSD), and a number of pixels having the same pixel value.
5. In claim 1, Further comprising a step of identifying an intra prediction mode of the reference block based on the reference block being coded in an intra prediction mode, The prediction signal of the above reference block is determined based on the intra prediction mode of the above reference block and at least one reference pixel included in a neighboring block of the above reference block in the current picture, A method wherein the prediction signal of the current block is determined based on the intra prediction mode of the reference block and at least one reference pixel included in a neighboring block of the current block in the current picture.
6. In claim 1, Further comprising the step of obtaining an intra prediction mode of the current block from the bitstream, The prediction signal of the above reference block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture, A method wherein the prediction signal of the current block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture.
7. In claim 1, Further comprising a step of determining an intra prediction mode of the current block from among a plurality of intra prediction modes based on a pixel area adjacent to the current block, The prediction signal of the above reference block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the reference block in the current picture, A method wherein the prediction signal of the current block is determined based on the intra prediction mode of the current block and at least one reference pixel included in a neighboring block of the current block in the current picture.
8. In claim 1, The steps of determining a reference block corresponding to the current block are: Determining a first pixel area adjacent to the current block in the current picture; Determining a second pixel area corresponding to a first pixel area adjacent to the current block in the current picture; and A method comprising determining the reference block corresponding to the second pixel area in the current picture.
9. In claim 8, A method according to claim 1, wherein the first pixel region adjacent to the current block includes at least one of a pixel region adjacent to the top of the current block, a pixel region adjacent to the top left of the current block, and a pixel region adjacent to the left side of the current block.
10. In claim 8, A method wherein a first pixel area adjacent to the current block has a fixed size, or a size determined based on a size of the current block, or a width or height equal to a coding unit containing the current block, or a width or height twice that of the coding unit containing the current block.
11. In claim 8, Determining a second pixel area corresponding to a first pixel area adjacent to the current block in the current picture: A method comprising determining a pixel area corresponding to a lowest function value or a highest function value among function values calculated based on pixels of the first pixel area and pixels of the pixel area within the restored area of the current picture as the second pixel area.
12. In claim 1, The steps of determining a reference block corresponding to the current block are: Obtaining a block vector of the current block from the bitstream; and A method comprising determining a reference block in the current picture based on a block vector of the current block.
13. In claim 1, Further comprising a step of obtaining flag information indicating whether residual prediction is performed for the current block from the bitstream, A method, wherein the step of obtaining a residual differential signal of the current block and the step of determining a restoration signal of the current block based on the residual differential signal of the current block, the residual signal of the reference block, and the prediction signal of the current block are performed based on the flag information indicating that residual prediction is performed for the current block.
14. A method of encoding a bitstream by a device, A step of determining a reference block corresponding to the current block in the current picture including the current block; A step of determining a residual signal of the reference block based on a restoration signal of the reference block and a prediction signal of the reference block; A step of determining a residual differential signal of the current block based on the residual signal of the reference block, the original signal of the current block, and the prediction signal of the current block; and A step of processing the residual difference signal of the current block and encoding it into the bitstream is included. The prediction signal of the above reference block is determined based on at least one reference pixel included in a neighboring block of the above reference block in the current picture, A method wherein the prediction signal of the current block is determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
15. A non-transitory storage medium for storing a bitstream generated by the method, The above method: A step of determining a reference block corresponding to the current block in the current picture including the current block; A step of determining a residual signal of the reference block based on a restoration signal of the reference block and a prediction signal of the reference block; A step of determining a residual differential signal of the current block based on the residual signal of the reference block, the original signal of the current block, and the prediction signal of the current block; and A step of processing the residual difference signal of the current block and encoding it into the bitstream is included. The prediction signal of the above reference block is determined based on at least one reference pixel included in a neighboring block of the above reference block in the current picture, A non-transitory storage medium, wherein the prediction signal of the current block is determined based on at least one reference pixel included in a neighboring block of the current block in the current picture.
Citation Information
Patent Citations
Video encoding method and apparatus, and decoding method and apparatus therefor
KR1020180107082A
Method and apparatus for image compression using block prediction mode
US10575000B2
Method and apparatus for deriving intra-prediction mode
US20190281290A1
Advanced inter-view residual prediction in multiview or 3-dimensional video coding
US9998727B2
