Method and apparatus for encoding and decoding video based on video size
By selecting filter coefficients based on image size comparisons, the method improves the quality of reconstructed images in encoding and decoding processes.
Patent Information
- Application Number
- CN202411273549.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-07-05
- Filing Date
- 2020-05-13
- Publication Date
- 2024-12-27
AI Technical Summary
Existing image encoding and decoding technologies do not adequately consider the size of the image, leading to suboptimal quality in reconstructed images.
The proposed methods and devices select filter coefficient sets based on the size comparison between the current and reference images, using fractional pixel positions to generate prediction values and residual values for improved image reconstruction.
This approach enhances the quality of reconstructed images by accurately accounting for image size during encoding and decoding processes.
Smart Images

Figure CN119211537A_ABST
Abstract
Description
[0001] This application is a divisional application of an invention patent application with an international application date of May 13, 2020, Chinese application number 202080050277.9, and invention name “Method and device for encoding video based on video size, and method and device for decoding video based on video size”. Technical Field
[0002] The present disclosure relates to the field of image encoding and decoding. More specifically, the present disclosure relates to an image encoding method and device based on image size, and an image decoding method and device. Background Art
[0003] In image encoding and decoding, an image is split into blocks, and each block is prediction-encoded and prediction-decoded by inter-frame prediction or intra-frame prediction.
[0004] Inter-frame prediction refers to a method of compressing an image by removing temporal redundancy between images, and a representative example is motion estimation coding. Motion estimation coding predicts a block of a current image by using at least one reference image. By using a specific evaluation function, a reference block that is most similar to the current block is searched within a preset search range. The current block is predicted based on the reference block, and the prediction block generated as a result of the prediction is subtracted from the current block to generate a residual block. The residual block is then encoded. In this case, in order to perform prediction more accurately, interpolation can be performed on the reference image to generate pixels in sub-pixel units that are smaller than integer pixel units, and inter-frame prediction can be performed based on the pixels in the sub-pixel units.
[0005] In codecs such as H.264 advanced video coding (AVC) and high efficiency video coding (HEVC), in order to predict the motion vector of a current block, a motion vector of a previously encoded block adjacent to the current block or a block included in a previously encoded image is used as a predicted motion vector of the current block. A differential motion vector, which is the difference between the motion vector of the current block and the predicted motion vector, is signaled to the decoder side by a specific method. Summary of the invention
[0006] Technical issues
[0007] A technical goal of an image encoding method and apparatus and an image decoding method and apparatus according to an embodiment is to improve the quality of a reconstructed image by encoding and decoding the image in consideration of the size of the image.
[0008] Technical solutions to the problem
[0009] An image decoding method for decoding a video signal according to an embodiment includes: obtaining a value of a current block based on a size of a current picture and a size of a reference picture of the current block; selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of pixels; generating a prediction value of the current block by using the selected filter coefficient set and a reference sample in a reference picture; obtaining a residual value of the current block from a bitstream; and reconstructing the current block using the prediction value and the residual value.
[0010] An image decoding device for decoding a video signal according to an embodiment includes: a prediction decoder configured to: obtain a value of a current block based on a size of a current picture and a size of a reference picture of the current block; select a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of pixels; generate a prediction value of the current block by using the selected filter coefficient set and a reference sample in a reference picture; obtain a residual value of the current block from a bitstream; and reconstruct the current block using the prediction value and the residual value.
[0011] According to an embodiment, an image encoding method for encoding a video signal includes: obtaining a value of a current block based on a size of a current picture and a size of a reference picture of the current block; selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of pixels; generating a prediction value of the current block by using the selected filter coefficient set and a reference sample in a reference picture; determining a residual value of the current block; and encoding the current block using the prediction value and the residual value.
[0012] A non-temporary computer-readable storage medium according to an embodiment stores a bitstream, which is encoded by an encoding method, the encoding method comprising: obtaining a value of a current block based on a size of a current picture and a size of a reference picture of the current block; selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of pixels; generating a prediction value of the current block by using the selected filter coefficient set and a reference sample in a reference picture; determining a residual value of the current block; and encoding the current block using the prediction value and the residual value.
[0013] An image decoding method according to an embodiment includes: comparing the size of a current image including a current block with the size of a reference image; selecting a reference sample corresponding to a current sample in the current block in the reference image according to a motion vector of the current block; and reconstructing the current block based on the reference sample, wherein, when the size of the reference image is larger than the size of the current image, the reference samples are spaced apart from each other in the reference image at intervals corresponding to a result of the size comparison.
[0014] Beneficial Effects
[0015] The image encoding method and apparatus and the image decoding method and apparatus according to the embodiments may encode and decode an image by considering the size of the image, thereby improving the quality of a reconstructed image.
[0016] It should be noted that the effects that can be achieved by the image encoding method and device and the image decoding method and device according to the embodiments are not limited to the above-mentioned effects, and other effects not mentioned in the following description will be clear to ordinary technicians in this field. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to better understand the drawings referenced herein, a brief description of each drawing is provided.
[0018] Figure 1 is a block diagram of an image decoding apparatus according to an embodiment.
[0019] Figure 2 is a block diagram of an image encoding apparatus according to an embodiment.
[0020] Figure 3 A process of determining at least one coding unit by splitting a current coding unit according to an embodiment is illustrated.
[0021] Figure 4 A process of determining at least one coding unit by dividing a non-square coding unit according to an embodiment is illustrated.
[0022] Figure 5 A process of splitting a coding unit based on at least one of block shape information and partition shape pattern information according to an embodiment is illustrated.
[0023] Figure 6 A method of determining a specific coding unit from among an odd number of coding units according to an embodiment is illustrated.
[0024] Figure 7 Detailed description is given of an order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment.
[0025] Figure 8A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a specific order according to an embodiment is illustrated.
[0026] Fig. 9 A process of determining at least one coding unit by dividing a first coding unit according to an embodiment is shown.
[0027] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined when a first coding unit is split satisfies a specific condition, shapes into which the second coding unit may be split are limited.
[0028] Fig.11 A process of splitting a square coding unit when the division shape pattern information indicates that the square coding unit is not split into four square coding units according to an embodiment is illustrated.
[0029] Fig.12 It is shown that according to an embodiment, a processing order among a plurality of coding units may vary according to a process of dividing the coding units.
[0030] Fig.13 Described is a process of determining a depth of a coding unit as a shape and a size of the coding unit change when the coding unit is recursively split to determine a plurality of coding units according to an embodiment.
[0031] Fig.14 Detailed description is given of a depth that may be determined based on a shape and a size of a coding unit and a part index (PID) for distinguishing coding units according to an embodiment.
[0032] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of preset data units included in a picture according to an embodiment.
[0033] Fig.16 It is illustrated that coding units may be determined for each picture when a combination of shapes into which a coding unit may be divided is different for each picture according to an embodiment.
[0034] Fig.17 Various shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.
[0035] Fig.18 Other shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are shown.
[0036] Fig.19is a block diagram of an image encoding and decoding system that performs loop filtering.
[0037] Fig. 20 is a block diagram showing the configuration of an image decoding device according to an embodiment.
[0038] Fig.21 is a diagram showing a sequence of images having any of various shapes.
[0039] Fig. 22 is a diagram showing the positions of neighboring blocks relative to the current block.
[0040] Fig.23 is a table showing a candidate list.
[0041] Fig.24 A method of selecting reference samples when the size of the reference image is the same as the size of the current image is shown.
[0042] Fig.25 A method of selecting reference samples when the size of the reference image is different from the size of the current image is shown.
[0043] Fig.26 is a table showing filter coefficients of an n-tap filter according to a size ratio between a current image and a reference image.
[0044] Fig.27A is a diagram for describing a method of generating filtered samples by filtering reference samples.
[0045] Fig.27B is a diagram for describing a method of generating filtered samples by filtering reference samples.
[0046] Fig.27C is a diagram for describing a method of generating filtered samples by filtering reference samples.
[0047] Fig.27D is a diagram for describing a method of generating filtered samples by filtering reference samples.
[0048] Fig.28 is a diagram for describing a method of generating prediction samples when the size of a reference image is different from the size of a current image.
[0049] Fig.29 is shown for Fig.28 A table of filter coefficients for an n-tap filter with which the reference samples are filtered.
[0050] Fig.30 is a flowchart for describing an image decoding method according to an embodiment.
[0051] Fig.31 is a block diagram showing the configuration of an image encoding device according to an embodiment.
[0052] Fig.32 is a flowchart for describing an image encoding method according to an embodiment. DETAILED DESCRIPTION
[0053] An image decoding method according to an embodiment includes: comparing the size of a current image including a current block with the size of a reference image; selecting a reference sample corresponding to a current sample in the current block in the reference image according to a motion vector of the current block; and reconstructing the current block based on the reference sample, wherein, when the size of the reference image is larger than the size of the current image, the reference samples are spaced apart from each other in the reference image at intervals corresponding to a result of the size comparison.
[0054] Reconstructing the current block may include: generating filtered samples corresponding to reference samples by applying an n-tap filter (n is a natural number) to the reference samples; and determining predicted samples of the current samples from the filtered samples, wherein filter coefficients of the n-tap filter are selected based on a result of the size comparison.
[0055] When the size of the current image and the size of the reference image are the same, the n-tap filter may not be applied to the reference samples, and the prediction samples may be determined from the reference samples.
[0056] The selection of the reference sample may include: determining a position by applying the motion vector of the current block to the position of the upper left current sample among the current samples; changing the determined position according to the result of the size comparison; and selecting the upper left reference sample corresponding to the changed position and the remaining reference samples separated from the upper left reference sample by an interval corresponding to the result of the size comparison.
[0057] The image decoding method may further include: configuring a reference image list including images having a size equal to or larger than a size of the current image among images decoded before the current image is decoded; and selecting a reference image from the images included in the reference image list.
[0058] The image decoding method may further include: determining whether an image having the same size as that of the current image is stored in a decoded picture buffer (DPB); when an image having the same size is stored in the DPB, configuring a candidate list of motion vectors of time domain blocks in a collocated image that is decoded earlier than the current image as candidate motion vectors; and determining the motion vector of the current block based on a candidate motion vector selected from among the candidate motion vectors included in the candidate list.
[0059] When an image having the same size as that of the current image is not stored in the DPB, the motion vector of the temporal block may not be included in the candidate list.
[0060] An image decoding device according to an embodiment includes a prediction decoder configured to compare the size of a current image including a current block with the size of a reference image; select a reference sample corresponding to a current sample in the current block in the reference image according to a motion vector of the current block; and reconstruct the current block based on the reference sample, wherein, when the size of the reference image is larger than the size of the current image, the reference samples are spaced apart from each other in the reference image at intervals corresponding to a result of the size comparison.
[0061] An image encoding method according to an embodiment includes: comparing the size of a current image including a current block with the size of a reference image; selecting a reference sample corresponding to the current sample in the current block in the reference image; and encoding a motion vector indicating the reference sample, wherein, when the size of the reference image is larger than the size of the current image, the reference samples are spaced apart from each other in the reference image at intervals corresponding to a result of the size comparison.
[0062] According to an embodiment, an image encoding device includes a prediction encoder configured to compare the size of a current image including a current block with the size of a reference image; select a reference sample corresponding to the current sample in the current block in the reference image; and encode a motion vector indicating the reference sample, wherein, when the size of the reference image is larger than the size of the current image, the reference samples are spaced apart from each other in the reference image at an interval corresponding to a result of the size comparison.
[0063] Since the present disclosure allows various changes and numerous embodiments, exemplary embodiments will be described in detail in the drawings and in the written description. However, this is not intended to limit the present disclosure to a specific mode of practice, and it should be understood that all changes, equivalents and substitutions that do not depart from the spirit and technical scope of the present disclosure are included in the present disclosure.
[0064] In the description of the embodiments, when it is considered that certain detailed explanations of the related art may unnecessarily obscure the essence of the present disclosure, these detailed explanations are omitted. In addition, the numbers (e.g., first and second) used in the description of the specification are merely identifiers for distinguishing one component from another component.
[0065] Furthermore, in the specification, it should be understood that when elements are “connected” or “coupled” to each other, the elements may be directly connected or coupled to each other, but may also be connected or coupled to each other through an intermediate element therebetween, unless otherwise specified.
[0066] In the specification, with respect to a component represented as a "part (unit)" or a "module", two or more components may be combined into one component, or one component may be divided into two or more components according to subdivided functions. In addition, in addition to its own main functions, each component described below may also perform some or all of the functions performed by another component, and some of the main functions of each component may be completely performed by another component.
[0067] Furthermore, the term "image" or "picture" used herein may refer to a still image or a moving image of a video, ie, the video itself.
[0068] In addition, the term "sample" or "signal" used herein refers to data assigned to a sampling position of an image and to be processed. For example, a pixel value of an image in a spatial domain or a transform coefficient in a transform domain may be a sample. A unit including one or more samples may be defined as a block.
[0069] In the following, reference will be made to Figures 1 to 19 Disclosed are an image encoding method and apparatus and an image decoding method and apparatus based on tree-structured coding units and transformation units according to an embodiment.
[0070] Figure 1 is a block diagram of an image decoding apparatus 100 according to an embodiment.
[0071] The image decoding apparatus 100 may include a bitstream obtainer 110 and a decoder 120. The bitstream obtainer 110 and the decoder 120 may include at least one processor. In addition, the bitstream obtainer 110 and the decoder 120 may include a memory storing instructions to be executed by at least one processor.
[0072] The bitstream obtainer 110 may receive a bitstream. The bitstream may include information generated by image encoding of the image encoding device 200, which will be described below. In addition, the bitstream may be sent from the image encoding device 200. The image decoding device 100 may be connected to the image encoding device 200 in a wired or wireless manner, and the bitstream obtainer 110 may receive the bitstream in a wired or wireless manner. The bitstream obtainer 110 may receive a bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 may reconstruct an image based on information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing an image from the bitstream. The decoder 120 may reconstruct an image based on the syntax elements.
[0073] The operation of the image decoding apparatus 100 will be described in detail below. The bitstream obtainer 110 may receive a bitstream.
[0074] The image decoding device 100 may perform an operation of obtaining a bin (binary character) string corresponding to the division shape pattern of the coding unit from the bitstream. Then, the image decoding device 100 may perform an operation of determining the division rule of the coding unit. In addition, the image decoding device 100 may perform an operation of dividing the coding unit into a plurality of coding units based on at least one of the bin string corresponding to the division shape pattern and the division rule. The image decoding device 100 may determine a first range as a size range allowed for the coding unit according to the aspect ratio of the coding unit in order to determine the division rule. The image decoding device 100 may determine a second range as a size range allowed for the coding unit according to the division shape pattern of the coding unit in order to determine the division rule.
[0075] Hereinafter, the division of coding units will be described in detail according to an embodiment of the present disclosure.
[0076] First, a picture may be divided into one or more slices or one or more tiles. A slice or a tile may be a sequence of one or more maximum coding units (coding tree units (CTU)). According to an embodiment, a slice may include one or more tiles, and a slice may include one or more maximum coding units. A slice including one tile or multiple tiles may be determined in a picture.
[0077] As a concept compared to the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)). The maximum coding block (CTB) represents NxN blocks (N is an integer) including NxN samples. Each color component can be divided into one or more maximum coding blocks.
[0078] When a picture has three sample arrays (sample arrays of Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and samples of the picture.
[0079] One maximum coding block (CTB) may be divided into MxN coding blocks (M and N are integers) including MxN samples.
[0080] When a picture has sample arrays of Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When a picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When a picture is encoded in a color plane separated according to color components, a coding unit includes a syntax structure for encoding a picture and samples of the picture.
[0081] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, a (maximum) coding unit refers to a data structure including a (maximum) coding block (which includes corresponding samples) and a grammatical structure corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a specific size including a specific number of samples, the maximum coding block and the maximum coding unit, or the coding block and the coding unit are mentioned in the following description without distinction, unless otherwise specified.
[0082] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the embodiment is not limited thereto.
[0083] For example, information about the maximum size of the luma coding block may 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 may be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.
[0084] For example, information about the luminance block size difference and the maximum size of the luminance coding block that can be divided into two can be obtained from the bitstream. The information about the luminance block size difference may refer to the size difference between the luminance maximum coding unit and the maximum luminance coding block that can be divided into two. Therefore, when the information about the maximum size of the luminance coding block that can be divided into two obtained from the bitstream and the information about the luminance block size difference are combined with each other, the size of the luminance maximum coding unit can be determined. The size of the chrominance maximum coding unit can be determined by using the size of the luminance maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block may be half the size of the luminance block, and the size of the chrominance maximum coding unit may be half the size of the luminance maximum coding unit.
[0085] According to an embodiment, since information about the maximum size of a binary-dividable luminance coding block is obtained from a bitstream, the maximum size of a binary-dividable luminance coding block can be variably determined. Conversely, the maximum size of a ternary-dividable luminance coding block can be fixed. For example, the maximum size of a ternary-dividable luminance coding block in an I picture can be 32x32, while the maximum size of a ternary-dividable luminance coding block in a P picture or a B picture can be 64x64.
[0086] In addition, the maximum coding unit can be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. At least one of information indicating whether to perform quad splitting, information indicating whether to perform multi-splitting, division direction information, and division type information can be obtained from the bitstream as the division shape pattern information.
[0087] For example, the information indicating whether quad splitting is performed may indicate whether the current coding unit is quad split (QUAD_SPLIT).
[0088] When the current coding unit is not quadripartitioned, the information indicating whether to perform multi-partitioning may indicate whether the current coding unit is no longer split (NO_SPLIT) or is binary / ternary split.
[0089] When the current coding unit is binary-split or ternary-split, the split direction information indicates that the current coding unit is split in one of a horizontal direction and a vertical direction.
[0090] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is binary-split or ternary-split.
[0091] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is binary-split in the horizontal direction may be determined as a binary horizontal split mode (SPLIT_BT_HOR), the split mode when the current coding unit is ternary-split in the horizontal direction may be determined as a ternary horizontal split mode (SPLIT_TT_HOR), the split mode when the current coding unit is binary-split in the vertical direction may be determined as a binary vertical split mode (SPLIT_BT_VER), and the split mode when the current coding unit is ternary-split in the vertical direction may be determined as a ternary vertical split mode (SPLIT_TT_VER).
[0092] The image decoding device 100 can obtain the division shape mode information from a bin string from the bit stream. The form of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The bin string is information in a binary number. The bin string may include at least one bit. The image decoding device 100 can obtain the division shape mode information corresponding to the bin string based on the division rule. The image decoding device 100 can determine whether to perform quadruple division on the coding unit, whether to divide the coding unit, the division direction, and the division type based on a bin string.
[0093] A coding unit may be smaller than or equal to a maximum coding unit. For example, since a maximum coding unit is a coding unit having a maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into coding units. Furthermore, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, division of an image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Reference will be made to Figures 3 to 16 The division of coding units is described in more detail.
[0094] In addition, one or more prediction blocks for prediction may be determined from the coding unit. A prediction block may be equal to or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. A transform block may be equal to or smaller than the coding unit.
[0095] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0096] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. In addition, transform may be performed by using a coding unit as a transform block.
[0097] Reference Figures 3 to 16 The division of the coding unit is described in more detail. The current block and the adjacent block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded or a block currently being divided. The adjacent block may be a block reconstructed before the current block. The adjacent block may be adjacent to the current block in the spatial domain or in the temporal domain. The adjacent block may be located at one of the lower left, left, upper left, upper part, upper right, right, and lower right of the current block.
[0098] Figure 3A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting a current coding unit is illustrated.
[0099] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N. Here, N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, aspect ratio, and size of the coding unit.
[0100] The shape of the coding unit may include a square and a non-square. When the width and height of the coding unit are the same (ie, when the block shape of the coding unit is 4Nx4N), the image decoding device 100 may determine the block shape information of the coding unit as a square. The image decoding device 100 may determine the shape of the coding unit as a non-square.
[0101] When the width and height of the coding unit are different from each other (that is, when the block shape of the coding 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 coding unit as a non-square. When the shape of the coding unit is a non-square, the image decoding device 100 may determine the aspect ratio among the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. In addition, the image decoding device 100 may determine whether the coding unit is in the horizontal direction or the vertical direction based on the length of the width and the length of the height of the coding unit. In addition, the image decoding device 100 may determine the size of the coding unit based on at least one of the length of the width, the length of the height, and the area of the coding unit.
[0102] According to an embodiment, the image decoding device 100 may determine the shape of the coding unit by using block shape information, and may determine the division method of the coding unit by using division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding device 100.
[0103] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 200 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information about the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information about the maximum coding unit as a quadruple division. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division is performed". In particular, the image decoding device 100 may determine the size of the maximum coding unit to be 256x256. The image decoding device 100 may determine the pre-agreed division shape pattern information as a quadruple division. Quadruple division is a division shape pattern in which both the width and height of the coding unit are divided into two. The image decoding device 100 may obtain a coding unit of a size of 128x128 from a maximum coding unit of a size of 256x256 based on the division shape pattern information. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding device 100 may obtain division shape pattern information indicating “no division is performed” with respect to the minimum coding unit.
[0104] According to an embodiment, the image decoding device 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding device 100 may determine whether to divide a square coding unit, whether to divide a square coding unit vertically, whether to divide a square coding unit horizontally, or whether to divide a square coding unit into four coding units based on the division shape mode information. Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may not divide the coding unit 310a having the same size as the current coding unit 300 based on the division shape pattern information indicating that division is not performed, or may determine the coding unit 310b, 310c, 310d, 310e or 310f divided based on the division shape pattern information indicating a specific division method.
[0105] refer to Figure 3According to an embodiment, the image decoding device 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding device 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding device 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding device 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that ternary division is performed in the vertical direction. The image decoding device 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that ternary division is performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. A specific division method of dividing the square coding unit will be described in detail below through various embodiments.
[0106] Figure 4 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by dividing a non-square coding unit is illustrated.
[0107] According to an embodiment, the image decoding device 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding device 100 may determine whether to not split the non-square current coding unit or whether to split the non-square current coding unit by using a specific splitting method based on the splitting shape mode information. Figure 4 When the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a specific division method. A specific division method for dividing a non-square coding unit will be described in detail below through various embodiments.
[0108] According to an embodiment, the image decoding device 100 may determine a division method of a coding unit by using division shape pattern information, and in this case, the division shape pattern information may indicate the number of one or more coding units generated by dividing the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.
[0109] According to an embodiment, when the image decoding device 100 divides the non-square current coding unit 400 or 450 based on the division shape pattern information, the image decoding device 100 may divide the current coding unit in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, considering the shape of the current coding unit 400 or 450, the image decoding device 100 may determine a plurality of coding units by dividing the current coding unit 400 or 450 in a direction in which the long side of the current coding unit 400 or 450 is divided.
[0110] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (ternary division) into an odd number of blocks, the image decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding device 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.
[0111] According to an embodiment, the aspect ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the aspect ratio is 4:1, the block shape information may indicate the horizontal direction because the length of the width is longer than the length of the height. When the aspect ratio is 1:4, the block shape information may indicate the vertical direction because the length of the width is shorter than the length of the height. The image decoding device 100 may determine to divide the current coding unit into an odd number of blocks based on the division shape mode information. In addition, the image decoding device 100 may determine the division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in the vertical direction, the image decoding device 100 may determine the coding units 430a, 430b, and 430c by dividing the current coding unit 400 in the horizontal direction. In addition, when the current coding unit 450 is in the horizontal direction, the image decoding device 100 may determine the coding units 480a, 480b, and 480c by dividing the current coding unit 450 in the vertical direction.
[0112] According to an embodiment, the image decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all determined coding units may have the same size. For example, a specific coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from other coding units 430a and 430c or 480a and 480c. That is, the coding unit determined by dividing the current coding unit 400 or 450 may have a variety of sizes, and in some cases, all coding units among the odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0113] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450, and further, may impose a specific restriction on at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding device 100 may set a decoding process regarding a coding unit 430b or 480b located at the center among the three coding units 430a, 430b, and 430c or 480a, 480b, and 480c (which is generated when the current coding unit 400 or 450 is divided into different parts from the other coding units 430a and 430c or 480a and 480c). For example, unlike the other coding units 430a and 430c or 480a and 480c, the image decoding device 100 may limit the coding unit 430b or 480b at the center position to no longer be divided or to be divided only a specific number of times.
[0114] Figure 5 A process in which the image decoding apparatus 100 according to an embodiment divides a coding unit based on at least one of block shape information and division shape pattern information is illustrated.
[0115] According to an embodiment, the image decoding device 100 may determine whether to divide the square first coding unit 500 into coding units based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding device 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after dividing the coding unit. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It should be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit follows the above description.
[0116] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units based on the division shape pattern information. Figure 5, the image decoding device 100 may or may not divide the non-square second coding unit 510 determined by dividing the first coding unit 500 into one or more third coding units 520a, 520b, 520c, and 520d based on the division shape pattern information. The image decoding device 100 may obtain the division shape pattern information, and may obtain a plurality of second coding units (e.g., 510) of various shapes by dividing the first coding unit 500 based on the obtained division shape pattern information, and may divide the second coding unit 510 by using the division method of the first coding unit 500 based on the division shape pattern information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on the division shape pattern information of the first coding unit 500, the second coding unit 510 may also be divided into the third coding units (e.g., 520a or 520b, 520c, and 520d) based on the division shape pattern information of the second coding unit 510. That is, the coding unit may be recursively divided based on the division shape pattern information of each coding unit. Therefore, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting a square coding unit.
[0117] refer to Figure 5 , a specific coding unit (e.g., a coding unit located at a central position or a square coding unit) among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, the non-square third coding unit 520b among the odd number of third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among a plurality of fourth coding units 530a, 530b, 530c, and 530d may be re-divided into a plurality of coding units. For example, a non-square fourth coding unit 530b or 530d may be re-divided into an odd number of coding units. A method that may be used to recursively divide coding units will be described below through various embodiments.
[0118] According to an embodiment, the image decoding device 100 may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the division shape pattern information. In addition, the image decoding device 100 may determine not to divide the second coding unit 510 based on the division shape pattern information. According to an embodiment, the image decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding device 100 may impose specific restrictions on a specific third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or divided a settable number of times.
[0119] refer to Figure 5 , the image decoding device 100 may limit the third coding unit 520c at the center position among the odd third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to be no longer divided, divided by using a specific division method (for example, divided only into four coding units or divided by using the division method of the second coding unit 510), or divided only a specific number of times (for example, divided only n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is not limited to the above example, and may include various limitations on decoding the third coding unit 520c at the center position differently from decoding the other third coding units 520b and 520d.
[0120] According to an embodiment, the image decoding device 100 may obtain split shape pattern information for splitting the current coding unit from a specific position in the current coding unit.
[0121] Figure 6 A method in which the image decoding device 100 determines a specific coding unit from among odd-numbered coding units according to an embodiment is illustrated.
[0122] refer to Figure 6 , the division shape pattern information of the current coding unit 600 or 650 can be obtained from a sample at a specific position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the specific position in the current coding unit 600 from which at least one piece of division shape pattern information can be obtained is not limited to Figure 6The image decoding device 100 may include the center position of the current coding unit 600, and may include various positions (e.g., top, bottom, left, right, upper left, lower left, upper right, lower right positions, etc.) included in the current coding unit 600. The image decoding device 100 may obtain the division shape mode information from a specific position, and may determine whether to divide or not divide the current coding unit into coding units of various shapes and various sizes.
[0123] According to an embodiment, when the current coding unit is split into a specific number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods may be used to select one of the plurality of coding units, which will be described below through various embodiments.
[0124] According to an embodiment, the image decoding device 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a specific position.
[0125] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position from among the odd-numbered coding units using information indicating the positions of the odd-numbered coding units. Figure 6 , the image decoding device 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or the current coding unit 650. The image decoding device 100 may determine the intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding device 100 may determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of specific samples included in the coding units 620a, 620b, and 620c, thereby determining the coding unit 620b at the center position. In detail, the image decoding device 100 may determine the positions of the coding units 620a, 620b, and 620c by determining the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c, thereby determining the coding unit 620b at the center position.
[0126] According to an embodiment, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding device 100 may determine the coding unit 620b at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture, or by using the information about the width or height of the coding unit, which corresponds to the difference between the coordinates.
[0127] According to an embodiment, the information indicating the position of the upper left sample 630a of the upper coding unit 620a may include the coordinates (xa, ya), the information indicating the position of the upper left sample 630b of the intermediate coding unit 620b may include the coordinates (xb, yb), and the information indicating the position of the upper left sample 630c of the lower coding unit 620c may include the coordinates (xc, yc). The image decoding device 100 may determine the intermediate coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b at the center position including the coordinates (xb, yb) of the sample 630b may be determined as the coding unit at the center position among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the upper left samples 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample 630b of the intermediate coding unit 620b relative to the upper left sample 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample 630c of the lower coding unit 620c relative to the upper left sample 630a of the upper coding unit 620a may be used. The method of determining the coding unit at a specific position by using the coordinates of the samples included in the coding unit as information indicating the positions of the samples is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the samples.
[0128] According to an embodiment, the image decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a specific criterion. For example, the image decoding device 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.
[0129] According to an embodiment, the image decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc), wherein the coordinates (xa, ya) are information indicating the position of the upper left sample 630a of the upper coding unit 620a, the coordinates (xb, yb) are information indicating the position of the upper left sample 630b of the middle coding unit 620b, and the coordinates (xc, yc) are information indicating the position of the upper left sample 630c of the lower coding unit 620c. The image decoding device 100 may determine the corresponding sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding device 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding device 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment, the image decoding device 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding device 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding device 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 and the widths or heights of the upper coding unit 620a and the intermediate coding units 620b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined widths and heights of the coding units 620a, 620b, and 620c. Reference Figure 6 , the image decoding device 100 may determine the middle coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at a specific position. However, the above-described process in which the image decoding device 100 determines a coding unit having a size different from other coding units only corresponds to an example of determining a coding unit at a specific position by using the size of the coding unit determined based on the coordinates of the sample, and thus various processes of determining a coding unit at a specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample may be used.
[0130] The image decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample 670c of the right coding unit 660c. The image decoding device 100 may determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0131] According to an embodiment, the image decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 and the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a, 660b, and 660c. Reference Figure 6 , the image decoding device 100 may determine the middle coding unit 660b having a size different from the left coding unit 660a and the right coding unit 660c as the coding unit at a specific position. However, the above-mentioned process in which the image decoding device 100 determines the coding unit having a size different from other coding units only corresponds to an example of determining the coding unit at a specific position by using the size of the coding unit determined based on the coordinates of the sample, and thus various processes of determining the coding unit at a specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample may be used.
[0132] However, the position of the sample considered for determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on an arbitrary position of the sample included in the coding unit may be used.
[0133] According to an embodiment, the image decoding device 100 may select a coding unit at a specific position from among an odd number of coding units determined by dividing the current coding unit by considering the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is longer than the height, the image decoding device 100 may determine a coding unit at a specific position in the horizontal direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the horizontal direction, and may impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is longer than the width, the image decoding device 100 may determine a coding unit at a specific position in the vertical direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the vertical direction, and may impose restrictions on the coding unit.
[0134] According to an embodiment, the image decoding device 100 may determine a coding unit at a specific position from among the even-numbered coding units using information indicating the corresponding positions of the even-numbered coding units. The image decoding device 100 may determine the even-numbered coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at the specific position by using information about the positions of the even-numbered coding units. Operations related thereto may correspond to operations of determining a coding unit at a specific position (e.g., a center position) from among the odd-numbered coding units, which have been referred to above. Figure 6 This has been described in detail, so a detailed description thereof will be omitted.
[0135] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, specific information about a coding unit at a specific position may be used in a division operation to determine the coding unit at the specific position from among the plurality of coding units. For example, the image decoding device 100 may use at least one of block shape information and division shape pattern information stored in a sample included in an intermediate coding unit in a division operation to determine a coding unit at a center position from among a plurality of coding units determined by dividing the current coding unit.
[0136] refer to Figure 6, the image decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine the coding unit 620b at the center position from among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding device 100 may determine the coding unit 620b at the center position, taking into account the position from which the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample 640 may be determined as the coding unit at the center position. However, the information for determining the coding unit at the center position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit at the center position.
[0137] According to an embodiment, specific information for identifying a coding unit at a specific position may be obtained from a specific sample included in a coding unit to be determined. Figure 6 , the image decoding device 100 may use the division shape pattern information obtained from the sample at the specific position in the current coding unit 600 (for example, the sample at the center position of the current coding unit 600) to determine the coding unit at the specific position (for example, the coding unit at the center position among the multiple divided coding units) from the multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the image decoding device 100 may determine the sample at the specific position by considering the block shape of the current coding unit 600, may determine the coding unit 620b including the sample from which the specific information (for example, the division shape pattern information) can be obtained from the multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose specific restrictions on the coding unit 620b. Reference Figure 6 According to an embodiment, during decoding, the image decoding device 100 may determine a sample 640 at the center position of the current coding unit 600 as a sample from which specific information can be obtained, and may impose specific restrictions on the coding unit 620b including the sample 640. However, the position of the sample from which specific information can be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the coding unit 620b determined for restriction.
[0138] According to an embodiment, the position of the sample from which specific information is obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit is in a square shape or a non-square shape, and the position of the sample from which specific information is obtained may be determined based on the shape. For example, the image decoding device 100 may determine a sample located at a boundary for dividing at least one of the width and the height of the current coding unit into two halves as a sample from which specific information may be obtained by using at least one of information about the width of the current coding unit and information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding device 100 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit into two halves as a sample from which specific information may be obtained.
[0139] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the image decoding device 100 may use the division shape pattern information to determine the coding unit at a specific position from among the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain the division shape pattern information from the sample at the specific position in the coding unit, and may divide the plurality of coding units generated by dividing the current coding unit by using the division shape pattern information obtained from the sample at the specific position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the specific position in each of the coding units. As has been mentioned above, Figure 5 A process of recursively splitting the coding unit is described, so a detailed description thereof will be omitted.
[0140] According to an embodiment, the image decoding device 100 may determine one or more coding units by splitting a current coding unit, and may determine an order of decoding the one or more coding units based on a specific block (eg, the current coding unit).
[0141] Figure 7 Detailed description is given of an order in which a plurality of coding units are processed when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit, according to an embodiment.
[0142] According to an embodiment, based on the division shape pattern information, the image decoding device 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or determine the second coding units 750a, 750b, 750c and 750d by dividing the first coding unit 700 in vertical and horizontal directions.
[0143] refer to Figure 7 , the image decoding device 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding device 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding device 100 may determine the second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical direction and the horizontal direction according to a specific order (e.g., a raster scan order or a Z scan order 750e) of processing coding units in one row and then processing coding units in the next row.
[0144] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding device 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to a division method of the first coding unit 700. Therefore, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may be independently divided into a plurality of coding units. Reference Figure 7 , the image decoding device 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, and may determine whether to independently divide or not divide each of the second coding units 710a and 710b.
[0145] According to an embodiment, the image decoding device 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.
[0146] According to an embodiment, the processing order of the coding units may be determined based on the process of dividing the coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units immediately before being divided. The image decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in the vertical direction order 720c. Since the left coding unit 710a and the right second coding unit 710b are processed in the horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in the vertical direction order 720c. The process of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and various methods may be used to independently process coding units that are split and determined to be various shapes in a specific order.
[0147] Figure 8 A process in which the image decoding apparatus 100 determines that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a specific order according to an embodiment is illustrated.
[0148] According to an embodiment, the image decoding apparatus 100 may determine that the current coding unit is to be split into an odd number of coding units based on the obtained split shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c, 820d, and 820e. According to an embodiment, the image decoding device 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c, 820d, and 820e.
[0149] According to an embodiment, the image decoding device 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c, 820d, and 820e can be processed in a specific order. Figure 8, the image decoding device 100 may determine the third coding units 820a and 820b and 820c, 820d, and 820e by recursively dividing the first coding unit 800. The image decoding device 100 may determine whether any one of the first coding unit 800, the second coding units 810a and 810b, or the third coding units 820a and 820b and 820c, 820d, and 820e is divided into an odd number of coding units based on at least one of the block shape information and the division shape mode information. For example, the right coding unit among the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a specific order (for example, a Z scan order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the right second coding unit 810b into an odd number of coding units meet the conditions for processing in a specific order.
[0150] According to an embodiment, the image decoding device 100 may determine whether the third coding units 820a and 820b and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a specific order, and the condition relates to whether at least one of the width and height of the second coding units 810a and 810b will be divided into two halves along the boundary of the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined when the height of the left second coding unit 810a of the non-square shape is divided into two halves may satisfy the condition. It may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition because the boundaries of the third coding units 820c, 820d, and 820e determined when the right second coding unit 810b is divided into three coding units cannot divide the width or height of the right second coding unit 810b into two halves. As described above, when the condition is not met, the image decoding device 100 may determine the disconnection of the scanning order, and may determine that the second right coding unit 810b will be divided into an odd number of coding units based on the result of the determination. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding device 100 may impose specific restrictions on the coding units at specific positions among the divided coding units. The restrictions or specific positions have been described above through various embodiments, so a detailed description thereof will be omitted.
[0151] Fig. 9 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by dividing the first coding unit 900 is illustrated.
[0152] According to an embodiment, the image decoding device 100 may divide the first coding unit 900 based on the division shape pattern information obtained by the bitstream obtainer 110. The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the first coding unit 900 has a square shape and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding device 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in the horizontal direction or the vertical direction, the image decoding device 100 may divide the square first coding unit 900 into an odd number of coding units, for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction.
[0153] According to an embodiment, the image decoding device 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a specific order, and the condition relates to whether at least one of the width and height of the first coding unit 900 will be divided into two halves along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9, because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a specific order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the height of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a specific order. As described above, when the condition is not met, the image decoding device 100 can determine the disconnection of the scanning order, and can determine that the first coding unit 900 will be divided into an odd number of coding units based on the result of the determination. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding device 100 can impose specific restrictions on the coding units at a specific position among the divided coding units. The restrictions or the specific positions have been described above through various embodiments, so a detailed description thereof will be omitted.
[0154] According to an embodiment, the image decoding device 100 may determine coding units of various shapes by splitting the first coding unit.
[0155] refer to Fig. 9 , the image decoding device 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.
[0156] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined when the image decoding device 100 splits the first coding unit 1000 satisfies a specific condition, shapes into which the second coding unit may be split are limited.
[0157] According to an embodiment, the image decoding device 100 may determine to divide the square first coding unit 1000 into the non-square second coding units 1010a and 1010b or 1020a and 1020b based on the division shape pattern information obtained by the bitstream obtainer 110. The second coding units 1010a and 1010b or 1020a and 1020b may be divided independently. Therefore, the image decoding device 100 may determine to divide or not divide each of the second coding units 1010a and 1010b or 1020a and 1020b into a plurality of coding units based on the division shape pattern information of each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding device 100 may determine the third coding units 1012a and 1012b by dividing the non-square left second coding unit 1010a determined by dividing the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is divided in the horizontal direction, the image decoding device 100 may limit the right second coding unit 1010b from being divided in the horizontal direction in which the left second coding unit 1010a is divided. When the third coding units 1014a and 1014b are determined by dividing the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently divided in the horizontal direction, the third coding units 1012a, 1012b, 1014a, and 1014b may be determined. However, this case is equivalent to the case in which the image decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, and may be inefficient in terms of image decoding.
[0158] According to an embodiment, the image decoding device 100 may determine the third coding units 1022a and 1022b or 1024a and 1024b by vertically dividing the non-square second coding unit 1020a or 1020b determined by horizontally dividing the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is divided in the vertical direction, for the above-mentioned reason, the image decoding device 100 may restrict not dividing another second coding unit (e.g., the lower second coding unit 1020b) in the vertical direction in which the upper second coding unit 1020a is divided.
[0159] Fig.11 A process in which the image decoding device 100 splits a square coding unit when the division shape pattern information indicates that the square coding unit is not split into four square coding units according to an embodiment is illustrated.
[0160] According to an embodiment, the image decoding device 100 may determine the second coding units 1110a and 1110b or 1120a and 1120b, etc. by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding device 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding device 100 may determine the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. based on the division shape pattern information.
[0161] According to an embodiment, the image decoding device 100 may independently divide the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b or 1120a and 1120b, etc. may be recursively divided in a specific order, and this division method may correspond to a method of dividing the first coding unit 1100 based on the division shape pattern information.
[0162] For example, the image decoding device 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding device 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0163] As another example, the image decoding device 100 may determine square third coding units 1122a and 1122b by dividing the upper second coding unit 1120a in the vertical direction, and may determine square third coding units 1124a and 1124b by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding device 100 may determine square third coding units 1126a, 1126b, 1126c, and 1126d by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0164] Fig.12 It is shown that according to an embodiment, a processing order among a plurality of coding units may vary according to a process of dividing the coding units.
[0165] According to an embodiment, the image decoding device 100 may divide the first coding unit 1200 based on the division shape mode information. When the block shape indicates a square shape and the division shape mode information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction and the vertical direction, the image decoding device 100 may determine the second coding unit (e.g., 1210a and 1210b or 1220a and 1220b, etc.) by dividing the first coding unit 1200. Fig.12 , the non-square second coding units 1210a and 1210b or 1220a and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction can be independently divided based on the division shape pattern information of each coding unit. For example, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction. Reference has been made to the above Fig.11 A process of dividing the second coding units 1210a and 1210b or 1220a and 1220b is described, and thus a detailed description thereof will be omitted.
[0166] According to an embodiment, the image decoding apparatus 100 may process coding units in a specific order. Figure 7The operation of processing the coding units in a specific order is described, and thus a detailed description thereof will be omitted. Fig.12 , the image decoding device 100 may determine four square third coding units 1216a, 1216b, 1216c and 1216d, and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding device 100 may determine the processing order of the third coding units 1216a, 1216b, 1216c and 1216d, and 1226a, 1226b, 1226c, and 1226d based on the division shape into which the first coding unit 1200 is divided.
[0167] According to an embodiment, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can process the third coding units 1216a, 1216b, 1216c and 1216d in the processing order 1217 of first processing the third coding units 1216a and 1216c included in the left second coding unit 1210a in the vertical direction, and then processing the third coding units 1216b and 1216d included in the right second coding unit 1210b in the vertical direction.
[0168] According to an embodiment, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction, and can process the third coding units 1226a, 1226b, 1226c and 1226d in the processing order 1227 of first processing the third coding units 1226a and 1226b included in the upper second coding unit 1220a in the horizontal direction and then processing the third coding units 1226c and 1226d included in the lower second coding unit 1220b in the horizontal direction.
[0169] refer to Fig.12, the square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by dividing the second coding units 1210a and 1210b and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b are determined by dividing the first coding unit 1200 in the vertical direction, unlike the second coding units 1220a and 1220b determined by dividing the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d divided therefrom ultimately show the same shape of coding units divided from the first coding unit 1200. In this way, by recursively splitting the coding units in different ways based on the division shape pattern information, even when the coding units are finally determined to have the same shape, the image decoding device 100 can process a plurality of coding units in different orders.
[0170] Fig.13 Described is a process of determining a depth of a coding unit as a shape and a size of the coding unit change when the coding unit is recursively split to determine a plurality of coding units according to an embodiment.
[0171] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a specific criterion. For example, the specific criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n times (n>0) the length of the long side of the divided current coding unit, the image decoding device 100 may determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit of a lower depth.
[0172] refer to Fig.13According to an embodiment, the image decoding device 100 may determine the second coding unit 1302 and the third coding unit 1304 of the lower depth by dividing the square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be expressed as '0: SQUARE'). Assuming that the size of the square first coding unit 1300 is 2Nx2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 by 1 / 2 may have a size of NxN. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 by 1 / 2 may have a size of N / 2xN / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 times that of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 times those of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 times those of the first coding unit 1300 may be D+2.
[0173] According to an embodiment, the image decoding device 100 can determine the second coding unit 1312 or 1322 and the third coding unit 1314 or 1324 of a lower depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information can be expressed as "1: NS_VER" indicating a non-square shape with a height longer than a width, or as "2: NS_HOR" indicating a non-square shape with a width longer than a height).
[0174] The image decoding device 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width and the height of the first coding unit 1310 having a size of Nx2N. That is, the image decoding device 100 may determine the second coding unit 1302 having a size of NxN or the second coding unit 1322 having a size of NxN / 2 by dividing the first coding unit 1310 in the horizontal direction, or may determine the second coding unit 1312 having a size of N / 2xN by dividing the first coding unit 1310 in the horizontal direction and the vertical direction.
[0175] According to an embodiment, the image decoding device 100 may determine the second coding unit (e.g., 1302, 1312, or 1322) by dividing 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 determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN by dividing the first coding unit 1320 in the vertical direction, or may determine the second coding unit 1322 having a size of NxN / 2 by dividing the first coding unit 1320 in the horizontal direction and the vertical direction.
[0176] According to an embodiment, the image decoding device 100 may determine the third coding unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width and the height of the second coding unit 1302 having a size of NxN. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2xN / 2, the third coding unit 1314 having a size of N / 4xN / 2, or the third coding unit 1324 having a size of N / 2xN / 4 by dividing the second coding unit 1302 in the vertical direction and the horizontal direction.
[0177] According to an embodiment, the image decoding device 100 may determine the third coding unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width and the height of the second coding unit 1312 having a size of N / 2xN. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1324 having a size of N / 2xN / 4 by dividing the second coding unit 1312 in the horizontal direction, or may determine the third coding unit 1314 having a size of N / 4xN / 2 by dividing the second coding unit 1312 in the vertical direction and the horizontal direction.
[0178] According to an embodiment, the image decoding device 100 may determine the third coding unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width and the height of the second coding unit 1322 having a size of NxN / 2. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1314 having a size of N / 4xN / 2 by dividing the second coding unit 1322 in the vertical direction, or may determine the third coding unit 1324 having a size of N / 2xN / 4 by dividing the second coding unit 1322 in the vertical direction and the horizontal direction.
[0179] According to an embodiment, the image decoding device 100 may divide the square coding unit (e.g., 1300, 1302, or 1304) in the horizontal direction or the vertical direction. For example, the image decoding device 100 may determine the first coding unit 1310 of size Nx2N by dividing the first coding unit 1300 of size 2Nx2N in the vertical direction, or may determine the first coding unit 1320 of size 2NxN by dividing the first coding unit 1300 in the horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 of size 2Nx2N in the horizontal direction or the vertical direction may be the same as the depth of the first coding unit 1300.
[0180] According to an 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 whose width and height are 1 / 2 times that of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 whose width and height are 1 / 4 times that of the first coding unit 1310 or 1320 may be D+2.
[0181] Fig.14 Depth that may be determined based on a shape and a size of a coding unit, and a partial index (PID) for distinguishing coding units, according to an embodiment, are illustrated.
[0182] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1400. Fig.14 , the image decoding device 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of the vertical direction and the horizontal direction based on the division shape pattern information. That is, the image decoding device 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.
[0183] According to an embodiment, the depth of the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 can be determined based on the length of its long side. For example, because the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, since the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 times the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 deeper than the depth D of the first coding unit 1400.
[0184] According to an embodiment, the image decoding device 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b, and 1414c by dividing the first coding unit 1410 whose height is longer than the width in the horizontal direction based on the division shape pattern information. According to an embodiment, the image decoding device 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b, and 1424c by dividing the first coding unit 1420 whose width is longer than the height in the vertical direction based on the division shape pattern information.
[0185] According to an embodiment, the depth of the second coding units 1412a and 1412b and 1414a, 1414b and 1414c or 1422a and 1422b and 1424a, 1424b and 1424c determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420 may be determined based on the length of its long side. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 times the length of the long side of the non-square shaped first coding unit 1410 whose height is longer than the width, the depth of the square second coding units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.
[0186] In addition, the image decoding device 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape mode information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 times the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding device 100 may determine the depths of the coding units split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .
[0187] According to an embodiment, when the odd-numbered split coding units do not have the same size, the image decoding apparatus 100 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Fig.14 , the coding unit 1414b at the center position among the odd-numbered divided coding units 1414a, 1414b, and 1414c may have a width equal to that of the other coding units 1414a and 1414c and a height twice that of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two of the other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2, and thus may be 3. That is, the PID values may be discontinuous. According to an embodiment, the image decoding device 100 may determine whether the odd-numbered divided coding units have the same size based on whether the PID for identifying the divided coding units is discontinuous.
[0188] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding device 100 can determine the even number of coding units 1412a and 1412b or the odd number of coding units 1414a, 1414b and 1414c by dividing the first coding unit 1410 in a rectangular shape whose height is longer than the width. The image decoding device 100 can identify each coding unit using a PID indicating each coding unit. According to an embodiment, the PID can be obtained from a sample at a specific position of each coding unit (for example, an upper left sample).
[0189] According to an embodiment, the image decoding device 100 may determine a coding unit at a specific position from among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape mode information of the first coding unit 1410 having a rectangular shape whose height is longer than the width indicates that the coding unit is divided into three coding units, the image decoding device 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit at a center position from among the coding units. The image decoding device 100 may determine the coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a center position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have the same size, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.14, the coding unit 1414b generated by dividing the first coding unit 1410 may have a width equal to that of the other coding units 1414a and 1414c and a height twice that of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the center position is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2 and thus may be 3. As described above, when the PID does not increase uniformly, the image decoding device 100 may determine that the coding unit is divided into a plurality of coding units including coding units having sizes different from other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding device 100 may divide the current coding unit in such a manner that a coding unit at a specific position among the odd number of coding units (e.g., a coding unit at the center position) has a size different from that of other coding units. In this case, the image decoding device 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID and the size or the position of the coding unit at a specific position to be determined are not limited to the above-mentioned examples, and various PIDs and coding units at various positions and sizes may be used.
[0190] According to an embodiment, the image decoding device 100 may use a specific data unit in which a coding unit starts to be recursively split.
[0191] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment.
[0192] According to an embodiment, a specific data unit may be defined as a data unit in which a coding unit begins to be recursively divided by using division shape pattern information. That is, the specific data unit may correspond to a coding unit of a maximum depth for determining a plurality of coding units divided from a current picture. In the following description, for ease of explanation, a specific data unit is referred to as a reference data unit.
[0193] According to an embodiment, the reference data unit may have a specific size and a specific shape. According to an embodiment, the reference coding unit may include MxN samples. Here, M and N may be equal to each other and may be an integer represented as a power of 2. That is, the reference data unit may have a square shape or a non-square shape and may be divided into an integer number of coding units.
[0194] According to an embodiment, the image decoding device 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding device 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The process of dividing the reference data unit may correspond to the division process using a quadtree structure.
[0195] According to an embodiment, the image decoding device 100 may predetermine the minimum size of the reference data unit included in the current picture that is allowed. Therefore, the image decoding device 100 may determine reference data units of various sizes equal to or larger than the minimum size, and may determine one or more coding units using the division shape mode information by referring to the determined reference data unit.
[0196] refer to Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units that may include one or more reference coding units (e.g., a sequence, a picture, a slice, a slice segment, a block, a block group, a maximum coding unit, etc.).
[0197] According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain at least one of the reference coding unit shape information and the reference coding unit size information of each of the various data units from the bitstream. Figure 3 The process of dividing the current coding unit 300 describes the process of dividing the square reference coding unit 1500 into one or more coding units, and the above has been combined with Figure 4 The process of splitting the current coding unit 400 or 450 describes a process of splitting the non-square reference coding unit 1502 into one or more coding units, and thus a detailed description thereof will be omitted.
[0198] According to an embodiment, the image decoding device 100 may use a PID for identifying the size and shape of a reference coding unit to determine the size and shape of a reference coding unit according to some data units predetermined based on a specific condition. That is, the bitstream obtainer 110 may obtain only from the bitstream a PID for identifying the size and shape of a reference coding unit for each slice, slice, block, block group or a maximum coding unit that is a data unit satisfying a specific condition (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a fragment, a block, a block group, a maximum coding unit, etc.). The image decoding device 100 may determine the size and shape of a reference data unit for each data unit satisfying a specific condition by using the PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from the bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding device 100 may determine at least one of the size and shape of a reference coding unit included in a data unit serving as a unit for obtaining a PID by selecting at least one of the size and shape of a predetermined reference coding unit based on the PID.
[0199] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and may divide the reference coding unit based on at least one of the block shape information and the division shape pattern information.
[0200] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The division shape pattern information may be included in a bitstream associated with various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a fragment header, a block header, or a block group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit or each reference coding unit, and may use the obtained syntax element.
[0201] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure will be described in detail.
[0202] The image decoding device 100 may determine a division rule of the image. The division rule may be predetermined between the image decoding device 100 and the image encoding device 200. The image decoding device 100 may determine the division rule of the image based on information obtained from the bitstream. The image decoding device 100 may determine the division 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 segment header, a block header, and a block group header. The image decoding device 100 may determine the division rule differently according to a frame, a slice, a block, a temporal layer, a maximum coding unit, or a coding unit.
[0203] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, aspect ratio, and direction of the coding unit. The image encoding device 200 and the image decoding device 100 may predetermine the division rule based on the block shape of the coding unit. However, the embodiment is not limited thereto. The image decoding device 100 may determine the division rule based on information obtained from the bit stream received from the image encoding device 200.
[0204] The shape of the coding unit may include a square and a non-square. When the width and height of the coding unit are the same, the image decoding device 100 may determine the shape of the coding unit as a square. In addition, when the width and height of the coding unit are different, the image decoding device 100 may determine the shape of the coding unit as a non-square.
[0205] The size of the coding unit may include various sizes, such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ... and 256x256. The size of the coding unit may be classified based on 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 division 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 as having the same size. In addition, the image decoding device 100 may apply the same division rule to the coding units having the same long side length.
[0206] The aspect ratio of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 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 its height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of its height.
[0207] The image decoding device 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding device 100 may determine the allowed division shape mode differently based on the size of the coding unit. For example, the image decoding device 100 may determine whether to allow division based on the size of the coding unit. The image decoding device 100 may determine the division direction according to the size of the coding unit. The image decoding device 100 may determine the allowed division type according to the size of the coding unit.
[0208] The division rule determined based on the size of the coding unit may be a division rule determined in advance between the image encoding device 200 and the image decoding device 100. In addition, the image decoding device 100 may determine the division rule based on information obtained from a bitstream.
[0209] The image decoding device 100 may adaptively determine a division rule based on the position of the coding unit. The image decoding device 100 may adaptively determine a division rule based on the position of the coding unit in the image.
[0210] In addition, the image decoding device 100 may determine the division rule so that the coding units generated via different division paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. As has been mentioned above, Fig.12 The decoding process order has been described, so a detailed description thereof will be omitted.
[0211] Fig.16It is illustrated that coding units may be determined for each picture when a combination of shapes into which a coding unit may be divided is different for each picture according to an embodiment.
[0212] refer to Fig.16 , the image decoding device 100 may determine the combination of division shapes into which the coding unit may be divided differently for each picture. For example, the image decoding device 100 may decode the image by using a picture 1600 that may be divided into four coding units, a picture 1610 that may be divided into two or four coding units, and a picture 1620 that may be divided into two, three, or four coding units among one or more pictures included in the image. In order to divide the picture 1600 into a plurality of coding units, the image decoding device 100 may use only the division shape information indicating the division into four square coding units. In order to divide the picture 1610, the image decoding device 100 may use only the division shape information indicating the division into two or four coding units. In order to divide the picture 1620, the image decoding device 100 may use only the division shape information indicating the division into two, three, or four coding units. The combination of the above-mentioned division shapes is only an embodiment for describing the operation of the image decoding device 100. Therefore, the combination of the above-mentioned division shapes should not be interpreted as being limited to the above-mentioned embodiments, but should be interpreted as various types of combinations of division shapes that can be used for specific data units.
[0213] According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain a bitstream including an index indicating a combination of division shape information for each specific data unit (e.g., a sequence, a picture, a slice, a segment, a block, or a block group). For example, the bitstream obtainer 110 may obtain an index indicating a combination of division shape information from a sequence parameter set, a picture parameter set, a slice header, a block header, or a block group header. The bitstream obtainer 110 of the image decoding device 100 may determine, for each specific data unit, a combination of division shapes into which the coding unit may be divided by using the obtained index, and thus, for each specific data unit, a different combination of division shapes may be used.
[0214] Fig.17 Various shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.
[0215] According to an embodiment, the image decoding apparatus 100 may divide the coding unit into various shapes by using the block shape information and the division shape mode information obtained by the bitstream obtainer 110. The shape into which the coding unit may be divided may be various shapes including the shapes described above through the embodiments.
[0216] refer to Fig.17, the image decoding device 100 can divide the coding units having a square shape in at least one of the horizontal direction and the vertical direction, and divide the coding units having a non-square shape in the horizontal direction or the vertical direction based on the division shape pattern information.
[0217] According to an embodiment, when the image decoding device 100 can divide a coding unit having a square shape in the horizontal direction and the vertical direction to determine four square coding units, the division shape pattern information of the square coding unit can represent four division shapes. According to an embodiment, the division shape pattern information can be represented as a two-bit binary code and the binary code can be assigned to each division shape. For example, when the coding unit is not divided, the division shape pattern information can be represented as (00)b, when the coding unit is divided in the horizontal direction and the vertical direction, the division shape pattern information can be represented as (01)b, when the coding unit is divided in the horizontal direction, the division shape pattern information can be represented as (10)b, and when the coding unit is divided in the vertical direction, the division shape pattern information can be represented as (11)b.
[0218] According to an embodiment, when the image decoding device 100 splits a coding unit having a non-square shape in a horizontal direction or a vertical direction, the type of the split shape that may be represented by the split shape pattern information may depend on the number of coding units into which the coding unit is to be split. Fig.17 According to an embodiment, the image decoding device 100 may divide a coding unit having a non-square shape into at most three coding units. In addition, the image decoding device 100 may divide the coding unit into two coding units. In this case, the division shape pattern information may be represented as (10)b. The image decoding device 100 may divide the coding unit into three coding units. In this case, the division shape pattern information may be represented as (11)b. The image decoding device 100 may determine not to divide the coding unit. In this case, the division shape pattern information may be represented as (0)b. That is, the image decoding device 100 may use variable length coding (VLC) instead of fixed length coding (FLC) in order to use a binary code representing the division shape pattern information.
[0219] According to the embodiment, reference Fig.17 , the binary code of the division shape mode information indicating that the coding unit is not divided can be expressed as (0)b. When the binary code of the division shape mode information indicating that the coding unit is not divided is set to (00)b, although no division shape mode information is set to (01)b, the binary code of the division shape mode information of 2 bits should be used in its entirety. However, as Fig.17As shown in FIG. 1 , when three division shapes are used for a coding unit having a non-square shape, the image decoding apparatus 100 can determine that the coding unit is not divided by using a 1-bit binary code (0)b as the division shape pattern information, thereby efficiently using a bit stream. However, the division shape of the coding unit having a non-square shape represented by the division shape pattern information should not be interpreted as being limited to Fig.17 The three shapes shown should be interpreted as including various shapes of the above-mentioned embodiments.
[0220] Fig.18 Other shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are shown.
[0221] refer to Fig.18 , the image decoding device 100 can divide the square coding unit in the horizontal direction or the vertical direction and can divide the non-square coding unit in the horizontal direction or the vertical direction based on the division shape pattern information. That is, the division shape pattern information can indicate that the square coding unit is divided in one direction. In this case, the binary code of the division shape pattern information indicating that the square coding unit is not divided can be represented as (0)b. When the binary code of the division shape pattern information indicating that the coding unit is not divided is configured as (00)b, even if there is no division shape pattern information configured as (01)b, all 2-bit binary codes of the division shape pattern information may have to be used. However, as Fig.18 As shown in FIG. 1 , when three division shapes for a square coding unit are used, the image decoding device 100 can determine not to divide the coding unit even by using a 1-bit binary code (0)b as the division shape pattern information. Therefore, the bit stream can be used efficiently. However, the division shape of the square coding unit indicated by the division shape pattern information should not be interpreted as being limited to Fig.18 The three division shapes are shown, but should be interpreted as including various shapes including the above-mentioned embodiments.
[0222] According to an embodiment, block shape information or division shape mode information may be represented by using a binary code, and the block shape information or division shape mode information may be directly generated as a bit stream. In addition, the block shape information or division shape mode information that may be represented as a binary code may not be directly generated as a bit stream, but may be used as a binary code input in context adaptive binary arithmetic coding (CABAC).
[0223] According to an embodiment, a process in which the image decoding device 100 obtains the syntax of block shape information or division shape mode information through CABAC is described. The bitstream obtainer 110 can obtain a bitstream including a binary code about the syntax. The image decoding device 100 can detect the syntax elements indicating the block shape information or the division shape mode information by inverse binarization of the bin string included in the obtained bitstream. According to an embodiment, the image decoding device 100 can obtain a set of binary bin strings corresponding to the syntax elements to be decoded, and can decode each bin by using probability information. In addition, the image decoding device 100 can repeat the process until the bin string composed of these decoded bins becomes the same as one of the previously obtained bin strings. The image decoding device 100 can determine the syntax elements by performing inverse binarization on the bin string.
[0224] According to an embodiment, the image decoding device 100 may determine the syntax of the bin string by performing a decoding process of adaptive binary arithmetic coding, and the image decoding device 100 may update the probability model about the bin obtained by the bitstream obtainer 110. Fig.17 According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain a bitstream indicating a binary code representing the division shape pattern information. The image decoding device 100 may determine the syntax of the division shape pattern information by using the obtained binary code of 1 bit or 2 bit size. In order to determine the syntax of the division shape pattern information, the image decoding device 100 may update the probability of each bit of the 2-bit binary code. That is, according to whether the value of the first bin of the 2-bit binary code is 0 or 1, the image decoding device 100 may update the probability that the next bin will have a value of 0 or 1 when the next bin is decoded.
[0225] According to an embodiment, in the process of determining the syntax, the image decoding device 100 may update the probability of the bin in the process of decoding the bin of the bin string regarding the syntax, and for a specific bit in the bin string, the image decoding device 100 may not update the probability and may determine that the probability is the same.
[0226] refer to Fig.17, in the process of determining the syntax by using the bin string representing the division shape pattern information about the non-square coding unit, when the non-square coding unit is not divided, the image decoding device 100 can determine the syntax of the division shape pattern information by using one bin having a value of 0. That is, when the block shape information indicates that the current coding unit has a non-square shape, when the non-square coding unit is not divided, the first bin of the bin string about the division shape pattern information may be 0, and when the non-square coding unit is divided into two or three coding units, the first bin may be 1. Therefore, the probability that the first bin of the bin string about the division shape pattern information of the non-square coding unit is 0 may be 1 / 3, and the probability that the first bin of the bin string about the division shape pattern information of the non-square coding unit is 1 may be 2 / 3. As described above, since the division shape pattern information indicating that the non-square coding unit is not divided can be represented by using only a 1-bit bin string having a value of 0, only when the first bin of the division shape pattern information is 1, the image decoding device 100 can determine the syntax of the division shape pattern information by determining whether the second bin is 0 or 1. According to an embodiment, when the first bin about the division shape pattern information is 1, the image decoding device 100 may consider that the probability that the second bin is 0 and the probability that the second bin is 1 are the same as each other, and may decode the bin.
[0227] According to an embodiment, in the process of determining the bins of the bin string for dividing the shape pattern information, the image decoding device 100 may use various probabilities for each bin. According to an embodiment, the image decoding device 100 may determine the probability of dividing the bins of the shape pattern information differently according to the direction of the non-square block. According to an embodiment, the image decoding device 100 may determine the probability of dividing the bins of the shape pattern information differently according to the area of the current coding unit or the length of the long side. According to an embodiment, the image decoding device 100 may determine the probability of dividing the bins of the shape pattern information differently according to at least one of the shape of the current coding unit and the length of the long side.
[0228] According to an embodiment, the image decoding device 100 may determine that the probability of dividing the bin of the shape mode information is the same for coding units having a size equal to or greater than a specific size. For example, the image decoding device 100 may determine that the probability of dividing the bin of the shape mode information is the same for coding units having a size equal to or greater than 64 samples based on the length of the long side of the coding unit.
[0229] According to an embodiment, the image decoding device 100 may determine the initial probability of bins constituting a bin string dividing the shape pattern information based on a slice type (eg, I slice, P slice, or B slice).
[0230] Fig.19 is a block diagram of an image encoding and decoding system that performs loop filtering.
[0231] The encoding end 1910 of the image encoding and decoding system 1900 transmits an encoded bit stream of an image, and the decoding end 1950 outputs a reconstructed image by receiving and decoding the bit stream. Here, the encoding end 1910 may have a configuration similar to that of the image encoding device 200 to be described below, and the decoding end 1950 may have a configuration similar to that of the image decoding device 100.
[0232] At the encoding end 1910, the prediction encoder 1915 outputs prediction data via inter-frame prediction and intra-frame prediction, and the transformer and quantizer 1920 outputs the quantized transform coefficients of the residual data between the prediction data and the current input image. The entropy encoder 1925 encodes and transforms the quantized transform coefficients and outputs the quantized transform coefficients as a bit stream. The quantized transform coefficients are reconstructed into data in the spatial domain via the inverse quantizer and inverse transformer 1930, and the reconstructed data in the spatial domain is output as a reconstructed image via the deblocking filter 1935 and the loop filter 1940. The reconstructed image can be used as a reference image for the next input image via the prediction encoder 1915.
[0233] The encoded image data among the bit streams received by the decoding end 1950 is reconstructed into residual data in the spatial domain via the entropy decoder 1955 and the inverse quantizer and inverse transformer 1960. The prediction data and the residual data output from the prediction decoder 1975 can be combined to construct the image data in the spatial domain, and the deblocking filter 1965 and the loop filter 1970 can perform filtering on the image data in the spatial domain to output a reconstructed image of the current original image. The reconstructed image can be used as a reference image of the next original image via the prediction decoder 1975.
[0234] The loop filter 1940 of the encoding end 1910 performs loop filtering by using filter information input according to user input or system setting. The filter information used by the loop filter 1940 is output to the entropy encoder 1925 and is sent to the decoding end 1950 together with the encoded image data. The loop filter 1970 of the decoding end 1950 can perform loop filtering based on the filter information input from the decoding end 1950.
[0235] The above-mentioned various embodiments describe operations related to the image decoding method performed by the image decoding device 100. Hereinafter, operations of the image encoding device 200 for performing the image encoding method, which corresponds to the inverse process of the image decoding method, will be described through various embodiments.
[0236] Figure 2is a block diagram of an image encoding device 200 capable of encoding an image based on at least one of block shape information and division shape mode information according to an embodiment.
[0237] The image encoding device 200 may include an encoder 220 and a bitstream generator 210. The encoder 220 may receive an input image and encode the input image. The encoder 220 may obtain at least one syntax element by encoding the input image. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transformed quantized coefficient, a coding block pattern, a coding block flag, an intra-frame prediction mode, a direct flag, a merge flag, an incremental QP, a reference index, a prediction direction, and a transform index. The encoder 220 may determine a context model based on block shape information including at least one of a shape, a direction, an aspect ratio, and a size of a coding unit.
[0238] The bitstream generator 210 may generate a bitstream based on the encoded input image. For example, the bitstream generator 210 may generate a bitstream by entropy encoding syntax elements based on a context model. In addition, the image encoding device 200 may send the bitstream to the image decoding device 100.
[0239] According to an embodiment, the encoder 220 of the image encoding device 200 may determine the shape of the coding unit. For example, the coding unit may have a square shape or a non-square shape, and information indicating the square shape or the non-square shape may be included in the block shape information.
[0240] According to an embodiment, the encoder 220 may determine a shape into which the coding unit is to be divided. The encoder 220 may determine the shape of at least one coding unit included in the coding unit, and the bitstream generator 210 may generate a bitstream including division shape pattern information including information about the shape of the coding unit.
[0241] According to an embodiment, the encoder 220 may determine whether to divide the coding unit. When the encoder 220 determines that only one coding unit is included in the coding unit or the coding unit is not divided, the bitstream generator 210 may generate a bitstream including division shape mode information indicating that the coding unit is not divided. In addition, the encoder 220 may divide the coding unit into a plurality of coding units, and the bitstream generator 210 may generate a bitstream including division shape mode information indicating that the coding unit is divided into a plurality of coding units.
[0242] According to an embodiment, information indicating the number of coding units into which the coding unit will be divided or the direction in which the coding unit will be divided may be included in the division shape pattern information. For example, the division shape pattern information may indicate whether the coding unit is divided in at least one of the vertical direction and the horizontal direction, or may indicate whether the coding unit is divided.
[0243] The image encoding device 200 may determine information about the division shape mode based on the division shape mode of the coding unit. The image encoding device 200 may determine a context model based on at least one of the shape, direction, aspect ratio, and size of the coding unit. In addition, the image encoding device 200 may generate information about the division shape mode for dividing the coding unit as a bitstream based on the context model.
[0244] In order to determine the context model, the image encoding device 200 may obtain an arrangement for establishing a correspondence between at least one of the shape, direction, aspect ratio, and size of the coding unit and the index of the context model. The image encoding device 200 may obtain the index of the context model from the arrangement based on at least one of the shape, direction, aspect ratio, and size of the coding unit. The image encoding device 200 may determine the context model based on the index of the context model.
[0245] In order to determine the context model, the image encoding device 200 may also determine the context model based on block shape information including at least one of a shape, a direction, an aspect ratio, and a size of a neighboring coding unit adjacent to the coding unit. In addition, the neighboring coding unit may include at least one of a coding unit located at the lower left, left, upper left, upper, upper right, right, and lower right of the coding unit.
[0246] In addition, the image encoding device 200 may compare the width of the upper adjacent coding unit with the width of the coding unit to determine the context model. In addition, the image encoding device 200 may compare the height of the left and right adjacent coding units with the height of the coding unit. In addition, the image encoding device 200 may determine the context model based on the comparison result.
[0247] The operation of the image encoding apparatus 200 includes the following steps: Figures 3 to 19 The operations of the image decoding apparatus 100 described above are similar in aspect, and therefore, a detailed description thereof will be omitted.
[0248] Fig. 20 is a block diagram showing the configuration of an image decoding device 2000 according to an embodiment.
[0249] refer to Fig. 20 , the image decoding device 2000 may include an obtainer 2010 and a prediction decoder 2030. Fig. 20The obtainer 2010 shown may correspond to Figure 1 The bit stream obtainer 110 shown in FIG. 1 and the prediction decoder 2030 may correspond to Figure 1 Decoder 120 is shown.
[0250] In addition, the obtainer 2010 and the prediction decoder 2030 according to an embodiment may be implemented as at least one processor. The image decoding device 2000 may include one or more memories (not shown) storing input / output data of the obtainer 2010 and the prediction decoder 2030. In addition, the image decoding device 2000 may include a memory controller (not shown) that controls data input / output of the memory (not shown).
[0251] The obtainer 2010 receives a bitstream generated as a result of encoding an image. The obtainer 2010 obtains syntax elements for decoding the image from the bitstream. According to the hierarchical structure of the image, binary values corresponding to the syntax elements may be included in the bitstream. The obtainer 2010 may obtain the syntax elements by entropy encoding the binary values included in the bitstream.
[0252] The bitstream may include size information of an image to be decoded, information indicating a prediction mode of a block included in the image, information indicating a motion vector of an inter-predicted block, and information indicating residual data between a predicted sample and an original sample.
[0253] In an embodiment, the image to be decoded may have various sizes. The size may refer to the area of the image. Alternatively, the size may refer to the width and / or height of the image. In another example, the size may refer to the ratio between any one of the width and height of the image and the other of the width and height of the image.
[0254] For adaptive streaming services, images may need to have various sizes. In real-time video communications, since images of various sizes are supported without inserting I pictures, it is possible to adaptively respond to channel conditions and reflect user preferences. In addition, the quality degradation of reconstructed images caused by I pictures can be reduced. However, in the case of inter-frame prediction using temporal redundancy between images, the amount of calculation for generating prediction samples may increase due to the various sizes of images, and the reliability of the prediction samples may decrease. Therefore, an image decoding method that takes into account the image size is required.
[0255] Fig.21 is a diagram showing a sequence of images having various sizes.
[0256] When the width of the current image 2100 is w1 and the height of the current image 2100 is h1, the sizes of the first to third images 2110, 2120 and 2130 decoded earlier than the current image 2100 may be the same as, larger than, or smaller than the size of the current image 2100.
[0257] like Fig.21 As shown, the width and height of the first image 2110 are w2 and h2, respectively. h2 and w2 may be greater than h1 and w1. That is, the size of the first image 2110 is greater than the size of the current image 2100. In addition, the width and height of the second image 2120 are w3 and h3. h3 and w3 may be less than h1 and w1. That is, the size of the second image 2120 is less than the size of the current image 2100.
[0258] In an embodiment, when the image is larger than the current image 2100, it may mean that the area of the image is larger than the area of the current image 2100. On the contrary, when the image is smaller than the current image 2100, it may mean that the area of the image is smaller than the area of the current image 2100.
[0259] Although not in Fig.21 , but the size of an image decoded earlier than the current image 2100 may be the same as the size of the current image 2100 .
[0260] In an embodiment, the size comparison between images may be performed based on each of the width and height. For example, the width and height of the third image 2130 are w2 and h3, respectively. w2 may be greater than w1, and h3 may be less than h1. The width of the third image 2130 is greater than the width of the current image 2100, and the height of the third image 2130 is less than the height of the current image 2100.
[0261] When the sizes of the current image 2100 and the previously decoded image are compared with each other for inter-frame prediction, the size comparison may be performed based on each of the width and the height. That is, the width and height of the first image 2110 are greater than the width and height of the current image 2100, and the width and height of the second image 2120 are less than the width and height of the current image 2100. The width of the third image 2130 is greater than the width of the current image 2100, and the height of the third image 2130 is less than the height of the current image 2100.
[0262] Since images in an image sequence according to an embodiment may have various sizes, it is necessary to consider the size of the image in case of inter-frame prediction using temporal redundancy between images.
[0263] The obtainer 2010 may obtain size information of an image to be decoded from at least one of a sequence parameter set, a picture parameter set, and a video parameter set. In an embodiment, the size of the image may be determined according to a temporal identifier (ID) (or a temporal layer identifier) for supporting temporal scalability of the image. When the size of the image is predetermined for each temporal ID, the predictive decoder 2030 may determine the size of the image by referring to the temporal ID obtained from the bitstream.
[0264] When the prediction mode of the current block included in the current image 2100 is an inter mode using temporal redundancy between a previously decoded image and the current image, the prediction decoder 2030 may generate a prediction sample corresponding to the current sample in the current block by considering the size of the current image 2100 and the size of the previously decoded image. The current block, which is a block generated by partitioning from an image according to a tree structure, may correspond to, for example, a maximum coding unit, a coding unit, a transformation unit, or a block of a sub-unit partitioned from a coding unit.
[0265] In an embodiment, the prediction decoder 2030 may determine the size of the maximum coding unit split from the current image 2100 according to the size of the current image 2100. For example, the prediction decoder 2030 may determine the size of the maximum coding unit that may be split from the current image 2100 by applying the size of the current image 2100 to a specific calculation expression. Since the size of the maximum coding unit is adaptively determined according to the size of the image, a load on a memory that occurs when data of a maximum coding unit having a large size is written to / read from a memory may be reduced.
[0266] After generating prediction samples through inter-frame prediction, when residual data is included in the bitstream, reconstructed samples of the current block can be obtained by combining the residual data with the prediction samples; and when the residual data is not included in the bitstream, the prediction samples can be determined as reconstructed samples.
[0267] In an embodiment, when the residual data obtained from the bitstream is inversely quantized, a transformer (not shown) may inversely transform the inversely quantized residual data from the frequency domain to the spatial domain. In this case, the transformer may inversely transform the residual data using a transform method selected from various transform methods based on the size of the current image 2100.
[0268] The transformation method may include, but is not limited to, a multiple transform selection (MTS) method that adaptively selects a transform kernel from various transform kernels (e.g., DCT2 type, DST7 type, and DCT8 type), a non-separable secondary transform (NSST) method that performs the transform and then selectively performs the transform on the low-frequency component, a rotational transform (ROT) method, a discrete sine transform (DST) method, and a discrete cosine transform (DCT) method.
[0269] According to an embodiment, a transformer (not shown) may inversely transform the residual data by using any one of the transform methods according to information indicating the transform method obtained from a bitstream.
[0270] The prediction decoder 2030 may reconstruct the current block by configuring a reference image list using an image decoded earlier than the current block (hereinafter, a previous image).
[0271] In an embodiment, the prediction decoder 2030 may configure the reference picture list by using a previous picture having a size larger than the current picture 2100 and / or a previous picture having the same size as the current picture 2100 among the previous pictures. When a specific picture is larger than the current picture 2100, it may mean that both the width and the height of the specific picture are larger than the width and the height of the current picture 2100. Alternatively, when a specific picture is larger than the current picture 2100, it may mean that any one of the width and the height is larger than the width and the height of the current picture 2100, and the other of the width and the height is the same as that of the current picture 2100.
[0272] When the size of the reference image selected in the reference image list is larger than the size of the current image 2100, the samples present in the reference image can be used as prediction samples. However, when the size of the reference image is smaller than the size of the current image 2100, the quality of the reconstructed samples may be reduced because the size of the reference image should be increased and then the prediction samples should be selected. In other words, when the size of the current block is 3x3 and the width and height of the reference image are twice the width and height of the current image 2100, the prediction samples can be obtained by using some of the samples included in the block with a size of 6x6 in the reference image. However, when the size of the current block is 6x6 and the width and height of the reference image are 1 / 2 of the width and height of the current image 2100, the block with a size of 3x3 in the reference image should be upsampled to a size of 6x6 and then the prediction samples should be obtained. That is, because new samples that do not exist in the reference image should be generated by upsampling the block with a size of 3x3 in the reference image, the quality of the reconstructed samples may be reduced. Therefore, the prediction decoder 203 may configure a reference picture list including only previous pictures having a size that is the same as or larger than that of the current picture 2100 to maintain the quality of reconstructed samples generated according to inter-frame prediction.
[0273] In another embodiment, the prediction decoder 2030 may configure a reference image list by using a previous image having a size larger than the current image 2100, a previous image having a size smaller than the current image 2100, and / or a previous image having the same size as the current image 2100 among the previous images.
[0274] The prediction decoder 2030 obtains a motion vector of the current block to obtain a prediction sample from a reference image. In order to obtain a motion vector, the prediction decoder 2030 may configure a candidate list including motion vectors of neighboring blocks related to the current block as a candidate motion vector.
[0275] The neighboring blocks may include a spatial domain block adjacent to the current block in the current image 2100 and a temporal domain block located in a collocated image selected from among images included in the reference image list.
[0276] Fig. 22 2200 is a diagram showing the positions of neighboring blocks relative to the current block 2200. Fig.23 is a table showing a candidate list.
[0277] refer to Fig. 22 , the neighboring blocks of the current block 2200 may include spatial domain blocks (e.g., A0, A1, B0, B1, and B2) that are spatially adjacent to the current block 2200 and temporal domain blocks (e.g., Col and Br) that are temporally adjacent to the current block 2200.
[0278] Specifically, the spatial domain block may include at least one of a lower left block A0, a lower left block A1, an upper right block B0, an upper right block B1, and an upper left block B2.
[0279] The temporal block may include at least one of a block Col located at the same point as the current block in a collocated image having a picture order count (POC) different from that of the current image 2100 including the current block 2200 and a block Br spatially adjacent to the block Col located at the same point. The block Br may be located at the lower right of the block Col located at the same point as the current block. The block Col located at the same point as the current block may be a block including a pixel corresponding to a center pixel in the current block among pixels included in the collocated image.
[0280] Fig. 22 The positions of the time domain blocks and the spatial domain blocks shown in are merely examples, and the positions and numbers of the time domain blocks and the spatial domain blocks may be modified in various ways according to embodiments.
[0281] The prediction decoder 2030 may determine the availability of the neighboring blocks according to a specific order, and may sequentially include the motion vectors of the neighboring blocks as candidate motion vectors in the candidate list according to the result of the determination.
[0282] When the neighboring block is intra predicted, the prediction decoder 2030 may determine that the neighboring block is unavailable.
[0283] In an embodiment, when an image having the same size as the current image 2100 does not exist in the images included in the reference image list, the prediction decoder 2030 may determine that the temporal block is unavailable. In this case, the motion vector of the temporal block is not included in the candidate list. On the contrary, when an image having the same size as the current image 2100 exists in the images included in the reference image list, the motion vector of the temporal block in the collocated image may be included in the candidate list as a candidate motion vector. In this case, an image having the same size as the current image may be selected from the images included in the reference image list as the collocated image.
[0284] In another embodiment, when a previous image having the same size as the current image 2100 does not exist in the previous image stored in the decoded picture buffer (DPB), the prediction decoder 2030 may determine that the temporal block is unavailable and may not include the motion vector of the temporal block in the candidate list. On the contrary, when a previous image having the same size as the current image 2100 exists in the previous image stored in the DPB, the prediction decoder 2030 may include the motion vector of the temporal block in the collocated image in the candidate list as a candidate motion vector. In this case, an image having the same size as the current image may be selected from the images included in the reference image list as the collocated image.
[0285] When an image having the same size as the current image 2100 is not included in the reference image list or the DPB, the reason why the motion vector of the time domain block is not included in the candidate list is that the computational complexity is large. Specifically, the motion vector of the time domain block in the collocated image corresponds to the difference between the position of the time domain block and the position of the block to which the time domain block refers. When the collocated image and the reference image of the time domain block are larger or smaller than the current image 2100 and the reference image of the current block, the motion vector of the time domain block should be reduced or increased according to the size of the current image 2100. That is, the motion vector of the time domain block should be changed by considering all sizes in the collocated image, the reference image of the time domain block, the current image 2100, and the reference image of the current block.
[0286] exist Fig.23 , the motion vector of block A1, the motion vector of block B0, the motion vector of block B2, and the motion vector of block Col are included in the candidate list as candidates.
[0287] When the motion vector of the neighboring block is included in the candidate list, the prediction decoder 2030 may determine the order in which the motion vector is included in the candidate list based on the size of the reference image indicated by the motion vector of the neighboring block.
[0288] For example, a low index (i.e., high priority) may be assigned to a neighboring block having a motion vector indicating a reference image of the same size as the current image 2100, and a high index (i.e., low priority) may be assigned to a neighboring block having a motion vector indicating a reference image of a size smaller than the current image 2100.
[0289] In another example, the lowest index (i.e., the highest priority) may be assigned to a neighboring block having a motion vector indicating a reference image having the same size as the current image 2100, an intermediate index (i.e., a medium priority) may be assigned to a neighboring block having a motion vector indicating a reference image having a size larger than the current image 2100, and the highest index (i.e., the lowest priority) may be assigned to a neighboring block having a motion vector indicating a reference image having a size smaller than the current image 2100. When the number of neighboring blocks each having a motion vector indicating a reference image having a size larger (or smaller) than the current image 2100 is 2 or more, a lower index may be assigned to a motion vector indicating a reference image having a size closer to the size of the current image 2100.
[0290] The prediction decoder 2030 may obtain the motion vector of the current block by using a candidate motion vector indicated by information obtained from the bitstream among the candidate motion vectors included in the candidate list. For example, the prediction decoder 2030 may determine the candidate motion vector selected in the candidate list as the motion vector of the current block. In another example, the prediction decoder 2030 may obtain the motion vector of the current block by changing the candidate motion vector according to information indicating a differential motion vector obtained from the bitstream.
[0291] In an embodiment, the information indicating the differential motion vector obtained from the bitstream may include information indicating the change distance and information indicating the change direction. In this case, the prediction decoder 2030 may obtain the motion vector of the current block by changing the candidate motion vector selected in the candidate list according to the change distance and the change direction.
[0292] The information indicating the change distance may include an index, and the change distance corresponding to each index value may be predetermined. For example, an index of 0 may indicate a change distance of 1, an index of 1 may indicate a change distance of 2, and an index of 2 may indicate a change distance of 4.
[0293] The prediction decoder 2030 may scale the change distance corresponding to the index value by considering the size of the current image 2100. For example, when the size of the current image 2100 is equal to or greater than a preset size, the prediction decoder 2030 may increase the change distance corresponding to each index. In another example, when the height of the current image 2100 is equal to or greater than a preset value and the width of the current image 2100 is less than a preset value, the prediction decoder 2030 may increase the change distance corresponding to each index when the change direction is the height direction, and may maintain the change distance corresponding to each index when the change direction is the width direction.
[0294] Since the prediction decoder 2030 according to an embodiment adaptively determines the change distance by considering various sizes of the current image 2100 , the prediction decoder 2030 may more accurately determine the motion vector of the current block.
[0295] The prediction decoder 2030 may select a reference sample in the reference image by considering the motion vector of the current block, and may reconstruct the current block by using the reference sample. The reference sample may be an integer pixel in the reference image.
[0296] Now refer to Fig.24 and Fig.25 To describe a method for selecting reference samples in a reference image.
[0297] Fig.24 A method of selecting a reference sample 2450 when the size of the reference image 2400 is the same as the size of the current image 2100 is shown.
[0298] When the size of the current block 2200 is 2x2 and the current image 2100 and the reference image 2400 have the same size, the size of the reference sample 2450 should also be 2x2. This is because four prediction samples are used to reconstruct the values of four current samples. When the size of the reference sample 2450 is 2x2, it means that the size of the block including the reference sample 2450 is 2x2. In addition, when the current image 2100 and the reference image 2400 have the same size, it means that the width and height of the current image 2100 are the same as the width and height of the reference image 2400.
[0299] The prediction decoder 2030 selects an upper-left reference sample 2451 in the reference image 2400 by applying the motion vector mv of the current block 2200 to the position of the upper-left current sample 2201 located at the upper left among the current samples included in the current block 2200. Next, the prediction decoder 2030 may obtain a reference sample 2450 having a size of 2×2 by selecting the remaining reference samples adjacent to the upper-left reference sample 2451.
[0300] exist Fig.24 , it is found that because the reference image 2400 and the current image 2100 have the same size, the reference samples 2450 are adjacent to each other. That is, one of the reference samples 2450 is separated from the reference sample closest to the reference sample by a distance (or coordinate value) of 1. For example, when the position of the reference sample is (a, b), the position of the reference sample located to the right of the reference sample may be (a+1, b), and the position of the reference sample located below the reference sample may be (a, b+1).
[0301] The prediction decoder 2030 may generate a filtered sample by filtering the reference sample 2450 using an n-tap filter (n is a natural number, for example, 8), and may determine the prediction sample of the current block 2200 from the filtered sample. The filtered sample may be a fractional pixel. Interpolation of generating fractional pixels by using integer pixels is used in a codec such as HEVC, so a detailed description thereof will be omitted.
[0302] In an embodiment, when the size of the reference image 2400 is the same as the size of the current image 2100, the prediction decoder 2030 may not filter the reference sample 2450, and may determine the prediction sample from the reference sample 2450. For example, the prediction decoder 2030 may determine the reference sample 2450 as the prediction sample, or may adjust the sample value of the reference sample 2450, and then may generate a prediction sample having the adjusted value.
[0303] Alternatively, in an embodiment, when the size of the reference image 2400 is the same as that of the current image 2100 and the value indicating the position of the fractional pixel is not 0, the prediction decoder 2030 may generate filtered samples by filtering the reference sample 2450 using an n-tap filter (n is a natural number), and may generate the prediction sample of the current block 2200 from the filtered sample. When the value indicating the position of the fractional pixel is 0, the prediction decoder 2030 may not filter the reference sample 2450, and may generate the prediction sample from the reference sample 2450. The value indicating the position of the fractional pixel may be calculated according to a predetermined arithmetic expression based on the motion vector of the current block 2100.
[0304] Fig.25 A method of selecting a reference sample when the size of the reference image 2500 is larger than the size of the current image 2100 is shown.
[0305] When the size of the current block 2200 is 2x2 and the width and height of the reference image 2500 are twice the width and height of the current image 2100, the size of the block 2550 corresponding to the current block 2200 in the reference image 2500 is 4x4. Since the number of prediction samples should be the same as the number of current samples, the block 2550 having a size of 4x4 should be downsampled to a size of 2x2.
[0306] In an embodiment, the prediction decoder 2030 determines the position 2501 by applying the motion vector mv to the position of the upper left current sample 2201 in the current block 2200. Since the size of the reference image 2500 is twice the size of the current image 2100, the position 2501 indicated by the motion vector should be changed according to the result of the size comparison between the reference image 2500 and the current image 2100. That is, the prediction decoder 2030 may change the position 2501 determined by applying the motion vector to the position of the upper left current sample 2201 according to the size comparison result, and may select a sample corresponding to the changed position as the upper left reference sample 2551. The size comparison result may be a ratio between the width of the reference image 2500 and the width of the current image 2100 and a ratio between the height of the reference image 2500 and the height of the current image 2100.
[0307] refer to Fig.25 , when the motion vector is (0, 0), the position determined by applying the motion vector to the position (2, 2) of the upper left current sample 2201 is (2, 2). When (2, 2) is multiplied by 2 (which is the ratio between the height of the reference image 2500 and the height of the current image 2100) and 2 (which is the ratio between the width of the reference image 2500 and the width of the current image 2100), the position (4, 4) can be derived, and the upper left reference sample 2551 corresponding to the position (4, 4) can be identified. When the ratio between the height of the reference image 2500 and the height of the current image 2100 is 2 and the ratio between the width of the reference image 2500 and the width of the current image 2100 is 1, the upper left reference sample having the position (4, 2) derived by multiplying (2, 2) by 2 and 1 can be identified.
[0308] When the upper left reference sample 2551 is selected, the prediction decoder 2030 may select the remaining reference samples 2552, 2553, and 2554 separated by a specific interval from the upper left reference sample 2551. The specific interval may be determined according to a result of a size comparison between the reference image 2500 and the current image 2100. The size comparison result may be a ratio between a width of the reference image 2500 and a width of the current image 2100 and a ratio between a height of the reference image 2500 and a height of the current image 2100. For example, when a ratio between a height of the reference image 2500 and a height of the current image 2100 is 2, and a ratio between a width of the reference image 2500 and a width of the current image 2100 is 2, the specific interval may be determined to be 2 in the height direction and 2 in the width direction.
[0309] The prediction decoder 2030 may select reference samples 2552, 2553, and 2554 spaced apart from the upper left reference sample 2551 by a certain interval according to the number of current samples. Fig.25 , the prediction decoder 2030 may select the upper left reference sample 2551 with position (4, 4), the reference sample 2552 with position (6, 4), the reference sample 2553 with position (4, 6), and the reference sample 2554 with position (6, 6).
[0310] When the reference samples 2551, 2552, 2553, and 2554 are obtained from the reference image 2500 having a size different from that of the current image 2100, the prediction decoder 2030 may apply an n-tap filter (n is a natural number, for example, 6, 8, or 10) to the reference samples 2551, 2552, 2553, and 2554 by considering a result of size comparison between the current image 2100 and the reference image 2500. The filtered samples generated as a result of filtering the reference samples 2551, 2552, 2553, and 2554 may include at least one of integer pixels and fractional pixels.
[0311] In an embodiment, the prediction decoder 2030 may select coefficients of an n-tap filter to be used for filtering each of the reference samples 2551, 2552, 2553, and 2554 based on the results of a size comparison (e.g., a height ratio and a width ratio) between the current image 2100 and the reference image 2500.
[0312] For example, when the height (or width) ratio between the current image 2100 and the reference image 2500 is equal to or greater than a preset value, the prediction decoder 2030 may filter each of the reference samples 2551, 2552, 2553, and 2554 by using filter "a", and when the height (or width) ratio between the current image 2100 and the reference image 2500 is less than a preset value, the prediction decoder 2030 may filter each of the reference samples 2551, 2552, 2553, and 2554 by using filter "b". The filter coefficient of the filter "a" may be different from the filter coefficient of the filter "b".
[0313] Fig.26 21 is a table showing filter coefficients according to the result of size comparison between the current image 2100 and the reference image.
[0314] like Fig.26As shown, when the height (or width) ratio between the current image 2100 and the reference image is equal to or greater than 1.75, the filtered samples can be generated by applying an 8-tap filter having filter coefficients of 0, -5, 15, 41, 19, -5, -1, and 0 to the reference sample. When the height (or width) ratio between the current image 2100 and the reference image is equal to or greater than 1.25 and less than 1.75, the filtered samples can be generated by applying an 8-tap filter having filter coefficients of -4, 0, 19, 29, 21, 5, -4, and -2 to the reference sample. In addition, when the height (or width) ratio between the current image 2100 and the reference image is less than 1.25, the filtered samples can be generated by applying an 8-tap filter having filter coefficients of 0, 1, -3, 63, 4, -2, 1, and 0 to the reference sample.
[0315] Despite Fig.26 Only one set of filter coefficients corresponding to each of the size ratios between the current image 2100 and the reference image is shown in FIG. Fig.29 As described, a number of filter coefficient sets corresponding to values indicating fractional pixels may be specified for each size ratio.
[0316] FIG. 27A to FIG. 27D shows that by applying an n-tap filter to Fig.25 A method for generating filtered samples based on reference samples 2551, 2552, 2553 and 2554.
[0317] Despite FIG. 27A to FIG. 27D , the filter in the width direction is applied to samples located to the left and right of the reference samples 2551, 2552, 2553 and 2554, but the filter coefficients of the filter in the width direction can be determined according to the ratio between the width of the current image 2100 and the width of the reference image.
[0318] When the filter in the height direction is applied to samples located above and below the reference samples 2551 , 2552 , 2553 , and 2554 , the filter coefficients of the filter in the height direction may be determined according to the ratio between the height of the current image 2100 and the height of the reference image.
[0319] like Fig.27A As shown, by applying filter 2610 to the first reference sample 2551 and the adjacent samples, a filtered sample corresponding to the first reference sample 2551 is generated. Fig.27B As shown, by applying filter 2610 to the second reference sample 2552 and the neighboring block, a filtered sample corresponding to the second reference sample 2552 is generated. Fig.27C and Fig.27DAs shown, by applying filter 2610 to the third reference sample 2553 and the adjacent samples and the fourth reference sample 2554 and the adjacent samples, filtered samples corresponding to the third reference sample 2553 and the fourth reference sample 2554 are generated.
[0320] According to an embodiment, down-sampling and interpolation of a block corresponding to the current block 2200 may be performed simply by applying an n-tap filter at specific intervals.
[0321] although Fig.25 The block 2550 corresponding to the current block 2200 in the reference image 2500 is downsampled in units of blocks, but according to an embodiment, when the size of the reference image 2500 is different from the size of the current image 2100, downsampling or upsampling may be performed so that the size of the reference image 2500 is the same as the size of the current image 2100, and then the Fig.24 The reference samples were selected as shown in the method.
[0322] Fig.28 is a diagram for describing a method of generating prediction samples when the size of a reference image and the size of a current image are different from each other. Fig.29 is shown for Fig.28 A table of filter coefficients for an n-tap filter with which the reference samples are filtered.
[0323] exist Fig.28 In the example, r0 to r15 may indicate integer pixels in a reference image, and c0 to c9 may indicate integer pixels in a current image.
[0324] When it is assumed that the current image and the reference image include one-dimensional samples, reference samples r5, r6, r8 and r10 corresponding to current samples c3, c4, c5 and c6 may be selected according to the motion vector and the result of size comparison between the current image and the reference image.
[0325] As described above, when the size of the reference image is larger than that of the current image, the reference samples r5, r6, r8, and r10 may be spaced at intervals corresponding to the result of the size comparison (eg, size ratio) between the reference image and the current image. Fig.28 In , since it is assumed that the size ratio between the reference image and the current image is 1.6 and is not a natural number, r5 and r6 may be adjacent to each other, and r6 and r8 as well as r8 and r10 may be spaced apart from each other by a distance of 2.
[0326] When the reference image is interpolated in units of 1 / 16 pixels, the positions of the fractional pixels corresponding to r5, r6, r8, and r10, respectively, may be 3, 13, 6, and 0. The value indicating the position of the fractional pixel may be calculated according to a predetermined arithmetic expression based on the motion vector of the current block including the current samples c3, c4, c5, and c6.
[0327] exist Fig.29 In the example, by applying the filter coefficients corresponding to the positions of the fractional pixels to the integer pixels in the reference image, the prediction decoder 2030 can obtain filtered samples corresponding to the positions of the fractional pixels, namely, prediction samples p3, p4, p5 and p6.
[0328] The prediction decoder 2030 may obtain prediction samples p3, p4, p5, and p6 according to Equation 1.
[0329] [Equation 1]
[0330] p3=(r2*f L [3][0]+r3*f L [3][1]+r4*f L [3][2]+r5*f L [3][3]+r6*f L [3][4]+r7*f L [3][5]+r8*f L [3][6]+r9*f L [3][7]+offset)>>shift
[0331] p4=(r3*f L
[13] [0]+r4*f L
[13] [1]+r5*f L
[13] [2]+r6*f L
[13] [3]+r7*f L
[13] [4]+r8*f L
[13] [5]+r9*f L
[13] [6]+r10*f L
[13] [7]+offset)>>shift
[0332] p5=(r5*f L [6][0]+r6*f L [6][1]+r7*f L [6][2]+r8*f L [6][3]+r9*f L [6][4]+r10*f L [6][5]+r11*fL [6][6]+r12*f L [6][7]+offset)>>shift
[0333] p6=(r7*f L [0][0]+r8*f L [0][1]+r9*f L [0][2]+r10*f L [0][3]+r11*f L [0][4]+r12*f L [0][5]+r13*f L [0][6]+r14*f L [0][7]+offset)>>shift
[0334] In equation 1, shift means “displacement” and offset means “offset”.
[0335] In Equation 1, shift is a predetermined value. Referring to Equation 1, it is found that even when the position of the fractional pixel corresponding to r10 is 0, that is, when an integer pixel is indicated, an 8-tap filter is applied to the adjacent integer pixel. Although it has been described that the n-tap filter is not applied to the reference sample when the size of the current image and the reference image is the same and the value indicating the position of the fractional pixel is 0, because Fig.28 The sizes of the current image and the reference image are different from each other, so even when the value indicating the position of the fractional pixel is 0, the adjacent samples are filtered to improve the prediction accuracy.
[0336] When the prediction mode of the current block is a combined inter-intraprediction (CIIP) mode, the prediction decoder 2030 may reconstruct the current block by weighted summing the prediction samples obtained by inter prediction (referred to as inter prediction samples) and the prediction samples obtained by intra prediction (referred to as intra prediction samples). In this case, the weights to be applied to the inter prediction samples and the intra prediction samples, respectively, may be predetermined, and the sum of the weights to be applied to the inter prediction samples and the weights to be applied to the intra prediction samples may be constant.
[0337] The prediction decoder 2030 may change weights to be applied to the inter prediction samples and the intra prediction samples according to a result of size comparison between the current image 2100 and the reference image.
[0338] For example, when the size of the reference image is smaller than the size of the current image 2100, that is, when a block in the reference image should be upsampled for inter-frame prediction, the prediction decoder 2030 may reduce the weight to be applied to the inter-frame prediction sample and may increase the weight to be applied to the intra-frame prediction sample. This is because the reliability of the inter-frame prediction sample decreases when the block is upsampled.
[0339] In another embodiment, when the size of the reference image is equal to or larger than the size of the current image 2100, the prediction decoder 2030 may increase the weight to be applied to the inter-frame prediction sample and may reduce the weight to be applied to the intra-frame prediction sample. This is because the prediction sample obtained from the reference image having a size greater than or equal to the current image 2100 has high reliability.
[0340] In another embodiment, the prediction decoder 2030 increases the weight to be applied to the inter-prediction sample when the size of the reference image is equal to or larger than the size of the current image 2100. In this case, the weight increment when the size of the reference image is the same as the size of the current image 2100 may be greater than the weight increment when the size of the reference image is larger than the size of the current image 2100.
[0341] In another embodiment, when the size of the reference image is the same as the size of the current image 2100, the prediction decoder 2030 may increase the weight to be applied to the inter-frame prediction samples and may reduce the weight to be applied to the intra-frame prediction samples. Conversely, when the size of the reference image is different from the size of the current image 2100, the prediction decoder 2030 may reduce the weight to be applied to the inter-frame prediction samples and may increase the weight to be applied to the intra-frame prediction samples.
[0342] In another embodiment, the prediction decoder 2030 may determine the weight to be applied to the inter-frame prediction sample according to the size ratio between the reference image and the current image 2100, and may determine the weight to be applied to the intra-frame prediction sample based on the determined weight. That is, the prediction decoder 2030 may adaptively determine the weight according to the size ratio between the reference image and the current image 2100.
[0343] In an embodiment, when the prediction mode of the current block is a bidirectional prediction mode using a first reference image included in reference image list 0 and a second reference image included in reference image list 1, the prediction decoder 2030 may reconstruct the current block by weighted summing a first prediction sample obtained from the first reference image and a second prediction sample obtained from the second reference image. In this case, weights to be applied to the first prediction sample and the second prediction sample, respectively, may be predetermined, and the sum of the weight to be applied to the first prediction sample and the weight to be applied to the second prediction sample may be constant.
[0344] The prediction decoder 2030 may change weights to be applied to the first prediction sample and the second prediction sample according to a result of a size comparison between the first reference image and the second reference image.
[0345] For example, when the size of the first reference image is equal to or greater than the size of the current image 2100 and the size of the second reference image is smaller than the size of the current image 2100, the prediction decoder 2030 may increase the weight to be applied to the first prediction sample and may reduce the weight to be applied to the second prediction sample.
[0346] In another embodiment, when the size of the first reference image is the same as the size of the current image 2100 and the size of the second reference image is different from the size of the current image 2100, the prediction decoder 2030 can increase the weight to be applied to the first prediction sample and can reduce the weight to be applied to the second prediction sample.
[0347] In an embodiment, when the prediction mode of the current block is the affine skip mode or the affine merge mode, the prediction decoder 2030 may unidirectionally predict the current block by using the first reference image included in the reference image list 0 or the second reference image included in the reference image list 1. When the information indicating the prediction direction of the current block obtained from the bitstream indicates bidirectional, the prediction decoder 2030 may select any one of the first reference image included in the reference image list 0 and the second reference image included in the reference image list 1, and may unidirectionally predict the current block by using the selected reference image.
[0348] Specifically, when the prediction direction of the current block is bidirectional, the prediction decoder 2030 may unidirectionally predict the current block by using a reference image of the same size as the current image 2100 among the first reference image and the second reference image. When both the first reference image and the second reference image have sizes different from the current image 2100, the prediction decoder 2030 may unidirectionally predict the current block by using a reference image of the two reference images having a size larger than the current image 2100; or when both the first reference image and the second reference image have sizes larger than the current image 2100, the prediction decoder 2030 may unidirectionally predict the current block by using a reference image of a size closer to the current image 2100.
[0349] When the prediction direction of the current block is unidirectional and the size of the reference image identified from the bitstream is smaller than the size of the current image 2100, the prediction decoder 2030 can unidirectionally predict the current block by using an image whose size is equal to or larger than the current image 2100 among the images included in the reference image list (instead of using the reference image identified from the bitstream) as a reference image.
[0350] When obtaining information indicating a prediction mode of a current block, the obtainer 2010 may consider the size of the current image 2100 and / or the reference image.
[0351] For example, when the size of the current image 2100 and / or the reference image is equal to or smaller than a preset size, the obtainer 2010 may not obtain information (e.g., a flag) indicating whether a specific prediction mode is applied from the bitstream. A specific prediction mode (i.e., a mode using a motion vector) as a mode using temporal redundancy between images may be, for example, but not limited to, a merge mode, a skip mode, a CIIP mode, an affine mode, a decoder-side motion vector refinement (DMVR) mode, or a bidirectional prediction mode. The DMVR mode is a mode in which the decoder directly corrects a motion vector obtained from information signaled by the encoder by block matching or the like.
[0352] In another embodiment, when the size of the current image 2100 and / or the reference image is equal to or smaller than a preset size, if it is identified from the information indicating whether other prediction modes are applied that other prediction modes are not applied to the current block, the obtainer 2010 may obtain information indicating whether a specific prediction mode is applied from the bitstream. That is, the obtainer 2010 may delay the order of obtaining the information indicating whether a specific prediction mode is applied.
[0353] In another embodiment, when the size of the reference image and the size of the current image 2100 are different from each other, the obtainer 2010 may not obtain information (e.g., a flag) indicating whether a specific prediction is applied from the bitstream. The specific prediction mode may be, for example, but not limited to, a merge mode, a skip mode, a CIIP mode, an affine mode, a DMVR mode, or a bidirectional prediction mode.
[0354] In another example, when the size of the reference image and the size of the current image 2100 are different from each other, if it is identified from the information indicating whether other prediction modes are applied that other prediction modes are not applied to the current block, the obtainer 2010 can obtain information indicating whether a specific prediction mode is applied from the bitstream.
[0355] Fig.30 is a diagram for describing an image decoding method according to an embodiment.
[0356] In operation S3010, the image decoding device 2000 compares the size of the current image 2100 including the current block with the size of the reference image. As a result of the size comparison, the image decoding device 2000 may derive a size ratio between the current image and the reference image.
[0357] In an embodiment, the image decoding device 2000 can identify the size of the current image 2100 and the size of the reference image based on the size information included in the bitstream. The size information may be the temporal ID of the image. In this case, the image decoding device 2000 can identify the size of the current image 2100 and the size of the reference image based on the temporal ID of the current image 2100 and the temporal ID of the reference image.
[0358] The image decoding device 2000 can configure a reference image list including images decoded before the current image 2100, and can select an image identified from information included in the bitstream from among the images included in the reference image list as a reference image of the current block.
[0359] In operation S3020, the image decoding apparatus 2000 selects a reference sample corresponding to the current sample in the current block in the reference image according to the motion vector of the current block. When the size of the reference image is larger than the size of the current image 2100, the reference samples may be spaced apart in the reference image at intervals corresponding to the result of the size comparison between the current image 2100 and the reference image.
[0360] Already referenced Fig.24 and Fig.25 A method of selecting a reference sample by considering a size ratio between the current image 2100 and the reference image is described, and thus a detailed description thereof will be omitted.
[0361] In order to determine the motion vector of the current block, the image decoding apparatus 2000 may configure a candidate list including motion vectors of neighboring blocks related to the current block as candidate motion vectors. The neighboring blocks may include a spatial domain block adjacent to the current block in the current image 2100 and a temporal domain block located in a collocated image selected from among the images included in the reference image list.
[0362] In an embodiment, when an image having the same size as the current image 2100 does not exist in the images included in the reference image list, the image decoding device 2000 may determine that the time domain block is unavailable. In this case, the motion vector of the time domain block is not included in the candidate list. On the contrary, when an image having the same size as the current image 2100 exists in the images included in the reference image list, the motion vector of the block in the collocated image may be included in the candidate list as a candidate motion vector. In this case, an image having the same size as the current image may be selected from among the images included in the reference image list as the collocated image.
[0363] In another embodiment, when a previous image having the same size as the current image 2100 does not exist in the previous image stored in the decoded picture buffer (DPB), the image decoding device 2000 may determine that the time domain block is unavailable and may not include the motion vector of the time domain block in the candidate list. On the contrary, when a previous image having the same size as the current image 2100 exists in the previous image stored in the DPB, the image decoding device 2000 may include the motion vector of the block in the collocated image in the candidate list as a candidate motion vector. In this case, an image having the same size as the current image may be selected from the images included in the reference image list as the collocated image.
[0364] In operation S3030, the image decoding device 2000 reconstructs the current block based on the reference sample.
[0365] The image decoding apparatus 2000 may generate filtered samples by interpolating reference samples, and may generate prediction samples of the current block from the filtered samples. A filter coefficient for interpolating reference samples may be selected according to a result of size comparison between the current image 2100 and the reference image.
[0366] When the residual data is included in the bitstream, the image decoding device 2000 may generate a reconstructed sample of the current block by combining the residual data with the prediction sample, and when the residual data is not included in the bitstream, the image decoding device 2000 may determine the prediction sample as the reconstructed sample.
[0367] Fig.31 31 is a block diagram showing the configuration of an image encoding device 3100 according to an embodiment.
[0368] refer to Fig.31 , the image encoding device 3100 may include a prediction encoder 3110 and a generator 3130. Fig.31 The predictive encoder 3110 may correspond to Figure 2 The encoder 220 and the generator 3130 may correspond to Figure 2A bitstream generator 210 is provided.
[0369] The prediction encoder 3110 and the generator 3130 according to an embodiment may be implemented as at least one processor. The image encoding device 3100 may include one or more memories (not shown) storing input / output data of the prediction encoder 3110 and the generator 3130. In addition, the image encoding device 3100 may include a memory controller (not shown) that controls data input / output of the memory (not shown).
[0370] The prediction encoder 3110 encodes an image according to a prediction mode, and the generator 3130 generates a bitstream including information generated as a result of encoding the image.
[0371] The prediction encoder 3110 may determine a prediction mode of a current block determined in the current image 2100. The prediction mode of the current block may include an intra mode, a merge mode, an advanced motion vector prediction (AMVP) mode, a skip mode, a CIIP mode, an affine mode, a decoder-side motion vector refinement (DMVR) mode, or a bidirectional prediction mode.
[0372] In an embodiment, the prediction encoder 3110 may determine the prediction mode of the current block by considering the size of the current image 2100 and / or the reference image.
[0373] For example, when the size of the current image 2100 and / or the reference image is equal to or smaller than a preset size, the prediction encoder 3110 may determine that the specific prediction mode is not applied to the current block, and the generator 3130 may not include information (e.g., a flag) indicating whether the specific prediction mode is applied in the bitstream. The specific prediction mode as a mode using temporal redundancy between images (i.e., a mode using a motion vector) may be, for example, but not limited to, a merge mode, a skip mode, a CIIP mode, an affine mode, a decoder-side motion vector refinement (DMVR) mode, or a bidirectional prediction mode.
[0374] In another example, when the size of the current image 2100 and / or the reference image is equal to or smaller than a preset size and it is determined that other prediction modes are not applied to the current block, the prediction encoder 3110 may determine whether to apply a specific prediction mode to the current block, and the generator 3130 may include information (e.g., a flag) indicating whether the specific prediction mode is applied in the bitstream. That is, the order of determining whether to apply a specific prediction mode may be delayed.
[0375] In another example, when the size of the reference image and the size of the current image 2100 are different from each other, the prediction encoder 3110 may determine that the specific prediction mode is not applied to the current block, and the generator 3130 may not include information indicating whether the specific prediction mode is applied in the bitstream.
[0376] In another example, when the size of the reference image and the size of the current image 2100 are different from each other and it is determined that other prediction modes are not applied to the current block, the prediction encoder 3110 can determine whether a specific prediction mode is applied to the current block, and the generator 3130 can include information indicating whether the specific prediction mode is applied in the bitstream.
[0377] When the prediction mode of the current block included in the current image 2100 is a mode using temporal redundancy between the current image 2100 and a previously decoded image, the prediction encoder 3110 may generate a prediction sample corresponding to the current sample in the current block by considering the size of the current image 2100 and the size of the previously decoded image. The current block, which is a block generated by partitioning from an image according to a tree structure, may correspond to, for example, a maximum coding unit, a coding unit, a transform unit, or a block of a sub-unit partitioned from a coding unit.
[0378] In an embodiment, the prediction encoder 3110 may determine the size of the maximum coding unit split from the current image 2100 according to the size of the current image 2100. For example, the prediction encoder 3110 may determine the size of the maximum coding unit splittable from the current image 2100 by applying the size of the current image to a specific arithmetic expression.
[0379] The prediction encoder 3110 may encode the current block by configuring a reference image list using an image encoded earlier than the current block (hereinafter referred to as a previous image).
[0380] In an embodiment, the prediction encoder 3110 may configure a reference image list by using a previous image having a size greater than and / or equal to the current image 2100 among the previous images.
[0381] In another embodiment, the prediction encoder 3110 may configure a reference image list by using a previous image having a size larger than the current image, a previous image having a size smaller than the current image 2100, and / or a previous image having the same size as the current image 2100 among the previous images.
[0382] The prediction encoder 3110 may select a reference sample similar to the current block by searching a reference image, and may encode a motion vector indicating the selected reference sample.
[0383] like Fig.24As shown, when the size of the current image 2100 and the size of the reference image are the same, the prediction encoder 3110 selects a reference sample corresponding to a current sample included in the current block in the reference image.
[0384] The prediction encoder 3110 may generate filtered samples by filtering reference samples, and may obtain prediction samples of the current block based on the filtered samples.
[0385] like Fig.25 As shown, when the size of the reference image is larger than the size of the current image 2100, the prediction encoder 3110 may select reference samples separated by a specific interval in the reference image. The specific interval may be determined according to a result of a size comparison between the reference image and the current image 2100, and the size comparison result may be a ratio between a width of the reference image and a width of the current image 2100 and a ratio between a height of the reference image and a height of the current image 2100. For example, when the ratio between the height of the reference image and the height of the current image 2100 is 2, and the ratio between the width of the reference image and the width of the current image 2100 is 2, the specific interval may be determined to be 2 in the height direction and 2 in the width direction.
[0386] When a reference sample is obtained from a reference image having a size different from that of the current image 2100, the prediction encoder 3110 may filter the reference sample by using an n-tap filter by considering the result of the size comparison between the current image 2100 and the reference image. The n-tap filter may be, for example, a 6-tap filter, an 8-tap filter, or a 10-tap filter.
[0387] In an embodiment, the prediction encoder 3110 may select coefficients of a filter for filtering the reference sample according to a result of a size comparison (eg, a height ratio and a width ratio) between the current image 2100 and the reference image.
[0388] For example, when the height (or width) ratio between the current image 2100 and the reference image is equal to or greater than a preset value, the prediction encoder 3110 may filter the reference sample by using filter "a", and when the height (or width) ratio between the current image 2100 and the reference image is less than a preset value, the prediction encoder 3110 may filter the reference sample by using filter "b". The filter coefficient of filter "a" may be different from the filter coefficient of filter "b".
[0389] When the prediction mode of the current block is a combined inter-intra prediction (CIIP) mode, the prediction encoder 3110 may encode the current block by weighted summing the prediction samples obtained by inter prediction (referred to as inter prediction samples) and the prediction samples obtained by intra prediction (referred to as intra prediction samples). In this case, the weights to be applied to the inter prediction samples and the intra prediction samples may be predetermined, and the sum of the weights to be applied to the inter prediction samples and the weights to be applied to the intra prediction samples may be constant.
[0390] The prediction encoder 3110 may change weights to be applied to inter prediction samples and intra prediction samples according to a result of size comparison between the current image 2100 and the reference image.
[0391] For example, when the size of the reference image is smaller than the size of the current image 2100, the prediction encoder 3110 may reduce the weight to be applied to the inter-prediction samples and may increase the weight to be applied to the intra-prediction samples.
[0392] In another example, when the size of the current image is equal to or larger than the size of the current image 2100, the prediction encoder 3110 may increase the weight to be applied to the inter-prediction samples and may decrease the weight to be applied to the intra-prediction samples.
[0393] In another example, the prediction encoder 3110 increases the weight to be applied to the inter-prediction sample when the size of the reference image is equal to or larger than the size of the current image 2100. In this case, the weight increment when the size of the reference image is the same as the size of the current image 2100 may be greater than the weight increment when the size of the reference image is larger than the size of the current image 2100.
[0394] In another example, when the size of the reference image is the same as the size of the current image 2100, the prediction encoder 3110 may increase the weight to be applied to the inter-frame prediction samples and may reduce the weight to be applied to the intra-frame prediction samples. Conversely, when the size of the reference image is different from the size of the current image 2100, the prediction encoder 3110 may reduce the weight to be applied to the inter-frame prediction samples and may increase the weight to be applied to the intra-frame prediction samples.
[0395] In another example, the prediction encoder 3110 may determine weights to be applied to inter-prediction samples according to a size ratio between a reference image and the current image 2100, and may determine weights to be applied to intra-prediction samples based on the determined weights.
[0396] In an embodiment, when the prediction mode of the current block is a bidirectional prediction mode using a first reference image included in reference image list 0 and a second reference image included in reference image list 1, the prediction encoder 3110 may reconstruct the current block by weighted summing a first prediction sample obtained from the first reference image and a second prediction sample obtained from the second reference image. In this case, the weights to be applied to the first prediction sample and the second prediction sample may be predetermined, and the sum of the weight to be applied to the first prediction sample and the weight to be applied to the second prediction sample may be constant.
[0397] The prediction encoder 3110 may change weights to be applied to the first prediction sample and the second prediction sample according to a result of a size comparison between the first reference image and the second reference image.
[0398] For example, when the size of the first reference image is equal to or greater than the size of the current image 2100 and the size of the second reference image is smaller than the size of the current image 2100, the prediction encoder 3110 may increase the weight to be applied to the first prediction sample and may reduce the weight to be applied to the second prediction sample.
[0399] In another example, when the size of the first reference image is smaller than the size of the current image 2100 and the size of the second reference image is greater than or equal to the size of the current image 2100, the prediction encoder 3110 may reduce the weight to be applied to the first prediction sample and may increase the weight to be applied to the second prediction sample.
[0400] In another example, when the size of the first reference image is the same as the size of the current image 2100 and the size of the second reference image is different from the size of the current image 2100, the prediction encoder 3110 can increase the weight to be applied to the first prediction sample and can reduce the weight to be applied to the second prediction sample.
[0401] In another embodiment, when the prediction mode of the current block is the affine skip mode or the affine merge mode, the prediction encoder 3110 may unidirectionally predict the current block by using the first reference image included in the reference image list 0 or the second reference image included in the reference image list 1. When it is determined that the prediction direction of the current block is bidirectional, the prediction encoder 3110 may select any one of the first reference image included in the reference image list 0 and the second reference image included in the reference image list 1, and may unidirectionally predict the current block by using the selected one reference image.
[0402] In detail, when the prediction direction of the current block is bidirectional, the prediction encoder 3110 may unidirectionally predict the current block by using a reference image having the same size as the current image 2100 among the first reference image and the second reference image. When both the first reference image and the second reference image have sizes different from the current image 2100, the prediction encoder 3110 may unidirectionally predict the current block by using a reference image having a size larger than the current image 2100 among the two reference images; or when both reference images have sizes larger than the current image 2100, the prediction encoder 3110 may unidirectionally predict the current block by using a reference image having a size closer to the current image 2100 among the two reference images.
[0403] When the prediction direction of the current block is unidirectional and the size of the reference image of the current block is smaller than the size of the current image 2100, the prediction encoder 3110 can unidirectionally predict the current block by using an image whose size is equal to or larger than the current image 2100 among the images included in the reference image list (instead of using the reference image of the current block) as a reference image.
[0404] The prediction encoder 3110 obtains a motion vector of the current block indicating a prediction sample obtained from a reference image. In order to obtain a motion vector, the prediction decoder 2030 may configure a candidate list including motion vectors of neighboring blocks related to the current block as a candidate motion vector.
[0405] The neighboring blocks may include a spatial domain block adjacent to the current block in the current image 2100 and a temporal domain block located in a collocated image selected from among images included in the reference image list.
[0406] like Fig. 22 As shown, the neighboring blocks of the current block may include spatial domain blocks A0, A1, B0, B1 and B2 that are spatially adjacent to the current block and temporal domain blocks Col and Br that are temporally adjacent to the current block.
[0407] The prediction encoder 3110 may determine the availability of the neighboring blocks according to a specific order, and may sequentially include the motion vectors of the neighboring blocks as candidate motion vectors in the candidate list.
[0408] When the neighboring block is intra predicted, the prediction encoder 3110 may determine that the neighboring block is unavailable.
[0409] In an embodiment, when an image having the same size as the current image 2100 does not exist in the images included in the reference image list, the prediction decoder 3110 may determine that the temporal block is unavailable. In this case, the motion vector of the temporal block is not included in the candidate list. On the contrary, when an image having the same size as the current image 2100 exists in the images included in the reference image list, the motion vector of the block in the collocated image may be included in the candidate list as a candidate motion vector.
[0410] In another embodiment, when a previous image having the same size as the current image 2100 does not exist in the previous image stored in the decoded picture buffer (DPB), the prediction decoder 3110 may determine that the temporal block is unavailable and may not include the motion vector of the temporal block in the candidate list. On the contrary, when a previous image having the same size as the current image 2100 exists in the previous image stored in the DPB, the prediction decoder 3110 may include the motion vector of the block in the collocated image as a candidate motion vector in the candidate list.
[0411] When the motion vector of the neighboring block is included in the candidate list, the prediction decoder 3110 may determine the order of including the motion vector in the candidate list based on the size of the reference image indicated by the motion vector of the neighboring block. For example, a low index (i.e., a high priority) may be assigned to a neighboring block having a motion vector indicating a reference image of the same size as the current image 2100, and a high index (i.e., a low priority) may be assigned to a neighboring block having a motion vector indicating a reference image of a size smaller than the current image 2100. In another example, the lowest index (i.e., the highest priority) may be assigned to a neighboring block having a motion vector indicating a reference image of the same size as the current image 2100, an intermediate index (i.e., a medium priority) may be assigned to a neighboring block having a motion vector indicating a reference image of a size larger than the current image 2100, and the highest index (i.e., the lowest priority) may be assigned to a neighboring block having a motion vector indicating a reference image of a size smaller than the current image 2100. When the number of neighboring blocks each having a motion vector indicating a reference image of a size larger (or smaller) than the current image 2100 is 2 or more, a lower index may be assigned to a motion vector indicating a reference image of a size closer to the size of the current image 2100.
[0412] The prediction encoder 3110 may generate information indicating a candidate motion vector used as a motion vector of the current block among the candidate motion vectors included in the candidate list. In an embodiment, the prediction encoder 3110 may generate information indicating a differential motion vector. The differential motion vector corresponds to the difference between the motion vector of the current block and the candidate motion vector.
[0413] In an embodiment, the information indicating the differential motion vector may include information indicating a change distance and information indicating a change direction. In this case, the image decoding apparatus 2000 may obtain a motion vector of the current block by changing a candidate motion vector selected in the candidate list according to the change distance and the change direction.
[0414] The information indicating the change distance may include an index, and the change distance corresponding to each index value may be predetermined. For example, an index of 0 may indicate a change distance of 1, an index of 1 may indicate a change distance of 2, and an index of 2 may indicate a change distance of 4.
[0415] The prediction decoder 3110 may scale the change distance corresponding to the index value by considering the size of the current image 2100. For example, when the size of the current image 2100 is equal to or greater than a preset size, the prediction decoder 3110 may increase the change distance corresponding to each index. In another example, when the height of the current image 2100 is equal to or greater than a preset value and the width of the current image 2100 is less than a preset value, the prediction decoder 3110 may increase the change distance corresponding to each index when the change direction is the height direction, and may maintain the change distance corresponding to each index when the change direction is the width direction.
[0416] When the residual data between the current sample and the predicted sample of the current block is obtained, the transformer (not shown) may change the residual data from the spatial domain to the frequency domain. In this case, the transformer may inversely transform the residual data by using a transform method selected from various transform methods based on the size of the current image 2100. The transform method may include, but is not limited to, a multi-transform selection (MTS) method that adaptively selects a transform kernel from various transform kernels (e.g., DCT2 type, DST7 type, and DCT8 type), a non-separable secondary transform (NSST) method that performs a transform and then selectively performs a transform on a low-frequency component, a rotation transform (ROT) method, a discrete sine transform (DST) method, and a discrete cosine transform (DCT) method.
[0417] The generator 3130 generates a bitstream as a result of encoding the image. The bitstream may include syntax elements, and according to the hierarchical structure of the image, binary values corresponding to the syntax elements may be included in the bitstream. The generator 3130 may generate a bitstream including binary values by entropy encoding the syntax elements.
[0418] The bitstream may include size information of an image to be decoded, information indicating a prediction mode of a block included in the image, information indicating a motion vector of an inter-predicted block, and information indicating residual data between a predicted sample and an original sample.
[0419] The size information of the image may be included in at least one of a sequence parameter set, a picture parameter set, and a video parameter set of a bitstream. In an embodiment, the size information of the image may include a temporal ID of the image.
[0420] Fig.32 is a flowchart for describing an image encoding method according to an embodiment.
[0421] In operation S3210, the image encoding device 3100 compares the size of the current image 2100 including the current block with the size of the reference image. The image encoding device 3100 may derive a ratio between the size of the current image 2100 and the size of the reference image as a result of the size comparison.
[0422] The image encoding device 3100 may configure a reference image list including images decoded before the current image 2100 , and may select a reference image of the current block from among the images included in the reference image list.
[0423] In operation S3220, the image encoding device 3100 selects a reference sample corresponding to the current block in the reference image. When the size of the reference image is larger than that of the current image 2100, the reference samples may be spaced apart in the reference image by an interval corresponding to a result of size comparison between the current image 2100 and the reference image.
[0424] Already referenced Fig.24 and Fig.25 A method of selecting a reference sample by considering a ratio between the size of the current image 2100 and the size of the reference image is described, and thus a detailed description thereof will be omitted.
[0425] The image encoding device 3100 may generate filtered samples by interpolating reference samples, and may generate prediction samples of the current block by using the filtered samples. The filter coefficients for interpolating the reference samples may be selected according to a comparison result between the size of the current image 2100 and the size of the reference image.
[0426] In operation S3230, the image decoding device 2000 encodes a motion vector of a current block indicating a reference sample.
[0427] In order to encode the motion vector, the image encoding device 3100 may configure a candidate list including motion vectors of neighboring blocks related to the current block as candidate motion vectors. The neighboring blocks may include a spatial domain block adjacent to the current block in the current image 2100 and a temporal domain block located in a collocated image selected from among the images included in the reference image list.
[0428] In an embodiment, when an image having the same size as the current image 2100 does not exist in the images included in the reference image list, the image encoding device 3100 may determine that the temporal block is unavailable. In this case, the motion vector of the temporal block is not included in the candidate list. On the contrary, when an image having the same size as the current image 2100 exists in the images included in the reference image list, the motion vector of the block in the collocated image may be included in the candidate list as a candidate motion vector.
[0429] In another embodiment, when a previous image having the same size as the current image does not exist in the previous image stored in the decoded picture buffer (DPB), the image encoding device 3100 may determine that the time domain block is unavailable and may not include the motion vector of the time domain block in the candidate list. On the contrary, when a previous image having the same size as the current image 2100 exists in the previous image stored in the DPB, the image encoding device 3100 may include the motion vector of the block in the collocated image as the candidate motion vector in the candidate list.
[0430] The image encoding device 3100 generates a bitstream including size information of an image, information indicating a prediction mode of a block included in the image, information indicating a motion vector of an inter-predicted block, and information indicating residual data between a predicted sample and an original sample.
[0431] According to the prediction mode, information indicating a differential motion vector which is a difference between a motion vector of a current block and a candidate motion vector may be included in a bitstream.
[0432] Meanwhile, the embodiments of the present disclosure may be written as programs executable on a computer, and the programs may be stored in a medium.
[0433] The medium can store the computer executable program continuously or temporarily to execute or download. In addition, the medium can be any of various recording media or storage media in which a single or multiple pieces of hardware are combined, and the medium is not limited to those directly connected to a specific computer system, but can be distributed on a network. Examples of media include magnetic media (such as hard disks, floppy disks, and tapes), optical recording media (such as compact disc read-only memory (CD-ROM) and digital versatile disc (digital versatile disc, DVD)), magneto-optical media (such as floppy disks), read-only memory (ROM), random access memory (RAM), flash memory, etc., which are configured to store program instructions. In addition, other examples of media can include recording media and storage media managed by application stores that distribute applications or by websites, servers, etc. that provide or distribute other various types of software.
[0434] Although the technical idea of the present disclosure has been described heretofore based on the preferred embodiments, the technical idea of the present disclosure is not limited to the above embodiments, and a person skilled in the art can make various modifications and changes within the scope of the technical idea of the present disclosure.
Claims
1. An image decoding method for decoding a video signal, the image decoding method comprising: Obtaining a value of the current block based on the size of the current picture and the size of the reference picture of the current block; Selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of the pixel; generating a prediction value for the current block by using the selected set of filter coefficients and reference samples in a reference picture; Obtaining a residual value of the current block from the bitstream; and Reconstruct the current block using the predicted value and the residual value.
2. An image decoding device for decoding a video signal, the image decoding device comprising: The predictive decoder is configured as follows: Obtaining a value of the current block based on the size of the current picture and the size of the reference picture of the current block; Selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of the pixel; generating a prediction value for the current block by using the selected set of filter coefficients and reference samples in a reference picture; Obtaining a residual value of the current block from the bitstream; and Reconstruct the current block using the predicted value and the residual value.
3. An image encoding method for encoding a video signal, the image encoding method comprising: Obtaining a value of the current block based on the size of the current picture and the size of the reference picture of the current block; Based on whether the value is greater than a predetermined value, selecting a filter coefficient set from a plurality of filter coefficient sets, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of the pixel; generating a prediction value for the current block by using the selected set of filter coefficients and reference samples in a reference picture; determining a residual value for the current block; and The current block is encoded using the prediction value and the residual value.
4. A non-transitory computer-readable storage medium storing a bitstream, wherein the bitstream is encoded by an encoding method, the encoding method comprising: Obtaining a value of the current block based on the size of the current picture and the size of the reference picture of the current block; Selecting a filter coefficient set from a plurality of filter coefficient sets based on whether the value is greater than a predetermined value, wherein the filter coefficient set includes a plurality of filter coefficients for fractional positions of the pixel; generating a prediction value for the current block by using the selected set of filter coefficients and reference samples in a reference picture; determining a residual value for the current block; and The current block is encoded using the prediction value and the residual value.