Apparatus and method for encoding and decoding motion information

By altering neighboring motion information, motion vectors are reconstructed using altered information and offsets in the bitstream, solving the problem of low efficiency in motion information encoding and decoding in existing technologies, and achieving efficient motion information encoding and decoding.

CN120956885APending Publication Date: 2025-11-14SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511165656.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-09-27
Filing Date
2020-06-19
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In existing image encoding and decoding technologies, the encoding and decoding efficiency of motion information is relatively low, especially when using neighboring motion information, which requires a large number of bits for encoding and decoding.

Method used

By altering the motion information of neighboring blocks, a list of reference frames for neighboring blocks is identified using the altered information in the bitstream. Offset and differential motion vectors are then applied to reconstruct the motion vector of the current block, reducing the number of bits required for encoding and decoding.

Benefits of technology

It achieves efficient encoding and decoding of motion information with a small number of bits, thus improving encoding and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956885A_ABST
    Figure CN120956885A_ABST
Patent Text Reader

Abstract

Disclosed are an apparatus and method for encoding and decoding motion information. The method for decoding motion information comprises the steps of: obtaining, from a bitstream, change information indicating whether motion information of a neighboring block is changed; checking the number of pictures included in the reference picture list of the current block when the change information indicates that the motion information is changed and a superior block can use one reference picture list; selecting a reference picture of the neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block in consideration of the number of pictures; when the reference picture of the neighboring block is selected as the reference picture of the current block, obtaining a motion vector of the current block by applying an offset to at least one of an x component or a y component of the motion vector of the neighboring block; and reconstructing the current block by using a reference block indicated by a motion vector of the current block in a reference picture of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application filed on June 19, 2020, with application number 202080044983.2 and invention title "Apparatus and method for encoding and decoding motion information by using proximity motion information". Technical Field

[0002] This disclosure relates to the field of image encoding and decoding. Specifically, this disclosure relates to an apparatus and method for encoding and decoding current motion information using neighboring motion information. Background Technology

[0003] In image encoding and decoding, an image can be divided into blocks, and each block can be predictively encoded and predictedly decoded via inter-frame prediction or intra-frame prediction.

[0004] A representative example of inter-frame prediction is motion estimation coding, which uses methods to compress images by removing temporal redundancy between images. In motion estimation coding, blocks of the current image are predicted using at least one reference image. The reference block most similar to the current block can be searched within a specific search range using a specific evaluation function. The current block is predicted based on the reference block, and a residual block is generated by subtracting the predicted block as a result of the prediction from the current block; the residual block is then encoded. Here, to further improve the accuracy of the prediction, interpolation is performed on at least one reference image to generate pixels in sub-pixel units smaller than integer pixel units, and inter-frame prediction can be performed based on these sub-pixel units.

[0005] In codecs such as H.264 Advanced Video Coding (AVC) and High-Efficiency Video Coding (HEVC), the motion vectors of previously encoded blocks adjacent to the current block, or blocks included in a previously encoded image, are used to predict the motion vector of the current block. The differential motion vector, which is the difference between the motion vector of the current block and the motion vectors of previously encoded blocks, is sent as a signal to the decoder via a specific method. Summary of the Invention

[0006] Technical issues

[0007] According to an embodiment, an apparatus and method for encoding motion information and an apparatus and method for decoding motion information are provided, wherein the method and apparatus encode and decode the current motion information respectively by changing the adjacent motion information with a small number of bits.

[0008] Solution to the problem

[0009] According to an embodiment, a method for decoding motion information performed by a decoding device includes: obtaining change information from a bitstream indicating whether motion information of neighboring blocks related to the current block in time or space has changed; when the change information indicates a change in the motion information and the parent block of the current block can use a list of reference frames, identifying the number of frames included in the list of reference frames of the current block; considering the number of identified frames, selecting a reference frame of the neighboring block or a frame different from the reference frame of the neighboring block as a reference frame of the current block; when the reference frame of the neighboring block is selected as a reference frame of the current block, obtaining the motion vector of the current block by applying an offset to at least one of the x-component or y-component of the motion vector of the neighboring block; and reconstructing the current block using a reference block in the reference frame of the current block indicated by the motion vector of the current block.

[0010] Best mode

[0011] According to an embodiment, a method for decoding motion information performed by a decoding device includes: obtaining change information from a bitstream indicating whether motion information of neighboring blocks related to the current block in time or space has changed; when the change information indicates a change in the motion information and the parent block of the current block can use a list of reference frames, identifying the number of frames included in the list of reference frames of the current block; considering the number of identified frames, selecting a reference frame of the neighboring block or a frame different from the reference frame of the neighboring block as a reference frame of the current block; when the reference frame of the neighboring block is selected as the reference frame of the current block, obtaining the motion vector of the current block by applying an offset to at least one of the x-component or y-component of the motion vector of the neighboring block; and reconstructing the current block using a reference block in the reference frame of the current block indicated by the motion vector of the current block.

[0012] The selection step may include: when the number of identified frames is 1, selecting the reference frame of the neighboring block as the reference frame of the current block.

[0013] When the change information indicates a first type of change, the offset may have a plus sign, and when the change information indicates a second type of change, the offset may have a minus sign.

[0014] When the number of identified frames is 2 and the change information indicates a first type of change, the selection step may include: selecting a frame that is different from the reference frame of the neighboring block as the reference frame of the current block, and the step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by scaling the motion vector of the neighboring block according to the ratio of the distance between the current frame and the reference frame of the neighboring block to the distance between the current frame and the reference frame of the current block.

[0015] When the number of identified frames is 2 and the change information indicates a second type of change, the selection step may include: selecting a reference frame of the neighboring block as the reference frame of the current block, and the step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by applying the offset to at least one of the x-component or y-component of the motion vector of the neighboring block.

[0016] When the number of identified frames is 3 or more, the selection step may include: selecting a frame that is different from the reference frame of the neighboring frame as the reference frame of the current frame, and the step of obtaining the motion vector of the current frame may include: obtaining the motion vector of the current frame by scaling the motion vector of the neighboring frame according to the ratio of the distance between the current frame and the reference frame of the neighboring frame to the distance between the current frame and the reference frame of the current frame.

[0017] When the number of identified frames is 3 or more and the change information indicates a first type of change, the selection step may include: selecting a frame that is different from the reference frame of the neighboring block from the frames included in the reference frame list as the reference frame of the current block.

[0018] When the number of identified frames is 3 or more and the change information indicates a second type of change, the selection step may include: when the index of the reference frame indicating the neighboring block is less than 2, selecting the frame with index 2 from the frames included in the reference frame list as the reference frame of the current block; and when the index of the reference frame indicating the neighboring block is equal to or greater than 2, selecting the frame with index 1 from the frames included in the reference frame list as the reference frame of the current block.

[0019] The step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by adding the differential motion vector obtained from the bit stream to the motion vector of the neighboring block that has been applied with the offset.

[0020] The differential motion vector can be calculated based on the change distance information and change direction information included in the bit stream.

[0021] The changed distance information can indicate the changed distance 2 n , where n can be an integer equal to or greater than 0, and the offset can be an odd number.

[0022] When the change information indicates that the motion information is not changed, the selection step may include: selecting the reference frame of the neighboring block as the reference frame of the current block, and the step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by applying the differential motion vector obtained from the bitstream to the motion vector of the neighboring block.

[0023] When the size of the current block is less than or equal to a preset size, the step of obtaining the change information is not executed. The selection step may include: selecting a reference image of the neighboring block as the reference image of the current block. The step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by applying the differential motion vector obtained from the bit stream to the motion vector of the neighboring block.

[0024] According to another embodiment, an apparatus for decoding motion information includes: a bitstream acquirer configured to acquire change information from a bitstream indicating whether motion information of neighboring blocks associated with the current block in time or space has changed; a motion information acquirer configured to, when the change information indicates a change in the motion information and a reference frame list is available for a parent block of the current block, identify the number of frames included in the reference frame list of the current block, select a reference frame of the neighboring block or a frame different from the reference frame of the neighboring block as a reference frame of the current block based on the identified number of frames, and when the reference frame of the neighboring block is selected as the reference frame of the current block, obtain the motion vector of the current block by applying an offset to at least one of the x-component or y-component of the motion vector of the neighboring block; and a predictive decoder configured to reconstruct the current block using a reference block in the reference frame of the current block indicated by the motion vector of the current block.

[0025] According to another embodiment, a method for encoding motion information includes: determining whether to change motion information of neighboring blocks that are temporally or spatially related to the current block; and generating a bit stream, wherein the bit stream includes information indicating the neighboring blocks, change information indicating whether the motion information has been changed, and information indicating differential motion vectors, wherein when a parent block including the current block uses a list of reference frames, and a reference frame of the neighboring block is selected as a reference frame of the current block, the differential motion vector corresponds to the difference between the motion vector of the current block and a result obtained by applying an offset to at least one of the x-component or y-component of the motion vector of the neighboring block.

[0026] Publicly disclosed beneficial effects

[0027] According to an embodiment, an apparatus and method for encoding motion information and an apparatus and method for decoding motion information can encode and decode current motion information respectively by changing adjacent motion information with a small number of bits.

[0028] However, the effects achievable by the apparatus and method for encoding motion information and the apparatus and method for decoding motion information are not limited to those described above, and other effects not mentioned will be clearly understood by those skilled in the art from the following description. Attached Figure Description

[0029] A brief description of each figure is provided to better understand the figures referenced herein.

[0030] Figure 1 This is a block diagram of an image decoding device according to an embodiment;

[0031] Figure 2 This is a block diagram of an image encoding device according to an embodiment;

[0032] Figure 3 This illustrates a process according to an embodiment of determining at least one coding unit by dividing the current coding unit;

[0033] Figure 4 The process of determining at least one coding unit by dividing a non-square coding unit, according to an embodiment, is illustrated.

[0034] Figure 5 The process of dividing the coding unit based on at least one of block shape information or partition shape pattern information according to an embodiment is illustrated.

[0035] Figure 6 A method for determining a specific coding unit from an odd number of coding units is shown according to an embodiment;

[0036] Figure 7 This illustrates the order in which multiple coding units are processed when multiple coding units are determined by dividing the current coding unit, according to an embodiment.

[0037] Figure 8 The illustration shows the process of determining that the current coding unit will be divided into an odd number of coding units when coding units cannot be processed in a specific order, according to an embodiment.

[0038] Figure 9 The illustration shows a process according to an embodiment of determining at least one coding unit by dividing a first coding unit;

[0039] Figure 10 The embodiment shows that when the second coding unit, determined by dividing the first coding unit, satisfies certain conditions, the shape into which the non-square second coding unit can be divided is limited;

[0040] Figure 11 The illustration shows the process of dividing a square coding unit according to an embodiment when the division shape pattern information indicates that the square coding unit will not be divided into four square coding units;

[0041] Figure 12 This illustrates that, according to an embodiment, the processing order among multiple coding units can be changed based on the process of dividing the coding units;

[0042] Figure 13 The illustration shows the process of determining the depth of a coding unit when the shape and size of the coding unit change, as per an embodiment of the case where coding units are recursively divided such that multiple coding units are determined.

[0043] Figure 14 The diagram illustrates a depth that can be determined based on the shape and size of the coding unit, and a partial index (PID) used to distinguish the coding units, according to an embodiment.

[0044] Figure 15 This illustrates how, according to an embodiment, multiple encoding units are determined based on multiple specific data units included in the image;

[0045] Figure 16 The diagram illustrates the coding units that can be determined for each frame when the combination of shapes into which the coding units can be divided is different for each frame, according to an embodiment.

[0046] Figure 17 Various shapes of coding units, which can be determined based on partition shape pattern information represented as binary code, are shown according to embodiments.

[0047] Figure 18 Other shapes of coding units that can be determined based on partition shape pattern information represented as binary code according to embodiments are shown;

[0048] Figure 19 This is a block diagram of an image encoding and decoding system that performs loop filtering;

[0049] Figure 20 This is a block diagram illustrating the configuration of an image decoding device according to an embodiment;

[0050] Figure 21 This is an exemplary diagram showing the locations of neighboring blocks that are related to the current block in time or space;

[0051] Figure 22This is an example table showing in which direction the predicted direction of neighboring blocks is changed according to the value indicated by the change information;

[0052] Figure 23 This is an exemplary table showing the screens included in reference screen list 0 and reference screen list 1;

[0053] Figure 24 It is a diagram showing the positional relationship between the reference screen of the adjacent block, the current screen, and the reference screen of the current block;

[0054] Figure 25 It is a diagram showing the positional relationship between the reference screen of the adjacent block, the current screen, and the reference screen of the current block;

[0055] Figure 26 It is a diagram showing the differential motion vectors displayed on the coordinate plane;

[0056] Figure 27 This is an example table showing the change distance corresponding to the values ​​of the change distance information;

[0057] Figure 28 This is an example table showing the direction of change corresponding to the values ​​of the direction of change information;

[0058] Figure 29 It is a table used to describe the method of selecting the reference screen for the current block based on the number of screens included in the reference screen list and the value indicated by the change information;

[0059] Figure 30 This is a diagram illustrating a method for changing the motion vector of a neighboring block when the reference frame of a neighboring block is the same as the reference frame of the current block.

[0060] Figure 31 This is a flowchart of a method for decoding motion information according to an embodiment;

[0061] Figure 32 This is a block diagram of the configuration of an image encoding device according to an embodiment; and

[0062] Figure 33 This is a flowchart of a method for encoding motion information according to an embodiment. Detailed Implementation

[0063] Because this disclosure allows for various modifications and numerous examples, specific embodiments will be shown in the accompanying drawings and described in detail in the written description. However, this is not intended to limit this disclosure to a particular mode of practice, and it will be understood that all changes, equivalents, and substitutions without departing from the spirit and scope of the art are included in this disclosure.

[0064] In the description of the embodiments, detailed explanations of the related technologies are omitted when it is deemed that such detailed explanations might unnecessarily obscure the essence. Furthermore, the numbers used in the description (e.g., first, second, etc.) are merely identifier codes used to distinguish one element from another.

[0065] Furthermore, it will be understood in this specification that when elements are “connected” or “coupled” to each other, the elements may be directly connected or coupled to each other, but may optionally be connected or coupled to each other through intermediate elements between the elements, unless otherwise stated.

[0066] In this specification, elements referred to as "units" or "modules" may be combined into one element, or one element may be divided into two or more elements according to subdivided functions. Furthermore, each element described below, in addition to its own primary function, may additionally perform some or all of the functions performed by another element, and some of the primary functions of each element may be entirely performed by another component.

[0067] Furthermore, in this specification, "image" or "picture" may refer to a still image or a moving image of a video, that is, the video itself.

[0068] Furthermore, in this specification, "sample" or "signal" refers to data assigned to a sampling location in an image, i.e., the data to be processed. For example, pixel values ​​of an image in the spatial domain and transform coefficients in the transform domain can be samples. A unit comprising at least one such sample can be defined as a block.

[0069] In the following text, reference will be made to Figures 1 to 19 The image encoding method and apparatus, as well as the image decoding method and apparatus, are described according to embodiments based on tree-structured encoding and transformation units.

[0070] Figure 1 This is a block diagram of an image decoding device 100 according to an embodiment.

[0071] Image decoding device 100 may include a bitstream acquirer 110 and a decoder 120. The bitstream acquirer 110 and decoder 120 may each include at least one processor. Furthermore, the bitstream acquirer 110 and decoder 120 may include memory storing instructions to be executed by the at least one processor.

[0072] Bitstream acquirer 110 can receive bitstreams. The bitstream includes information about an image encoded by image encoding device 200, described later. Furthermore, bitstreams can be transmitted from image encoding device 200. Image encoding device 200 and image decoding device 100 can be connected via wired or wireless means, and bitstream acquirer 110 can receive bitstreams via wired or wireless means. Bitstream acquirer 110 can receive bitstreams from storage media such as optical media or hard disks. Decoder 120 can reconstruct an image based on information obtained from the received bitstream. Decoder 120 can obtain syntax elements for reconstructing the image from the bitstream. Decoder 120 can reconstruct the image based on said syntax elements.

[0073] Regarding the detailed operation of the image decoding device 100, the bitstream receiver 110 can receive bitstreams.

[0074] Image decoding device 100 can perform the operation of obtaining a binary bit string corresponding to the partition shape pattern of the coding unit from the bit stream. Then, image decoding device 100 can perform the operation of determining the partitioning rule of the coding unit. Furthermore, image decoding device 100 can perform the operation of dividing the coding unit into multiple coding units based on at least one of the binary bit string corresponding to the partition shape pattern or the partitioning rule. Image decoding device 100 can determine a first permissible range of the size of the coding unit based on the aspect ratio of the coding unit in order to determine the partitioning rule. Image decoding device 100 can determine a second permissible range of the size of the coding unit based on the partition shape pattern of the coding unit in order to determine the partitioning rule.

[0075] The division of coding units will be described in detail below according to embodiments of the present disclosure.

[0076] First, a frame can be divided into one or more stripes or one or more parallel blocks. A stripe or a parallel block can be a sequence of one or more maximum coding units (code tree units (CTUs)). According to embodiments, a stripe may include one or more parallel blocks or one or more maximum coding units. Stripes comprising one or more parallel blocks can be identified within a frame.

[0077] There exists a maximum coding block (coding tree block (CTB)) conceptually compared to a maximum coding unit (CTU). A maximum coding unit (CTU) represents an N×N block comprising N×N samples (N is an integer). Each color component can be divided into one or more maximum coding blocks.

[0078] When the image comprises three sample arrays (sample arrays for the Y, Cr, and Cb components), the Maximum Coding Unit (CTU) includes a maximum coding block for the luma samples, two corresponding maximum coding blocks for the chroma samples, and a syntax structure for encoding the luma and chroma samples. When the image is monochrome, the CTU includes a maximum coding block for the monochrome samples and a syntax structure for encoding the monochrome samples. When the image is encoded in a color plane separated according to the color components, the CTU includes a syntax structure for encoding the image and the image samples.

[0079] A maximum coding tree block (CTB) can be divided into an M×N coding block containing M×N samples (M and N are integers).

[0080] When the image has sample arrays for the Y, Cr, and Cb components, the encoding unit (CU) includes an encoding block for the luminance samples, two corresponding encoding blocks for the chrominance samples, and a syntax structure for encoding the luminance and chrominance samples. When the image is monochrome, the encoding unit includes an encoding block for the monochrome samples and a syntax structure for encoding the monochrome samples. When the image is encoded in a color plane separated according to the color components, the encoding unit includes a syntax structure for encoding the image and the image samples.

[0081] As described above, the maximum coding block and the maximum coding unit are conceptually distinct from each other, and the coding block and the coding unit are also conceptually distinct from each other. That is, the (maximum) coding unit refers to a data structure that includes the (maximum) coding block containing the corresponding samples and the syntax elements corresponding to the (maximum) coding block. However, because those skilled in the art understand that the (maximum) coding unit or the (maximum) coding block refers to a block of a specific size containing a specific number of samples, the maximum coding block and the maximum coding unit or the coding block and the coding unit will be referred to in the following description without distinction unless otherwise described.

[0082] The image can be divided into maximum coding units (CTUs). The size of each CTU can be determined based on information obtained from the bitstream. Each CTU can be a square of the same size. However, the embodiments are not limited to this.

[0083] For example, information about the maximum size of a luminance-coded block can be obtained from the bitstream. For example, the maximum size of a luminance-coded block, indicated by the information about the maximum size of the luminance-coded block, can be one of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, and 256×256.

[0084] For example, information about the luma block size difference and the maximum size of a luma coding block that can be divided into two can be obtained from the bitstream. The information about the luma block size difference can refer to the size difference between the maximum luma coding unit and the maximum luma coding block that can be divided into two. Therefore, when the information about the maximum size of the luma coding block that can be divided into two and the information about the luma block size difference obtained from the bitstream are combined, the size of the maximum luma coding unit can be determined. The size of the maximum chroma coding unit can be determined using the size of the maximum luma coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block can be half the size of the luma block, and the size of the maximum chroma coding unit can be half the size of the maximum luma coding unit.

[0085] According to the embodiment, since information about the maximum size of a binary-divisible luminance coding block is obtained from the bitstream, the maximum size of the binary-divisible luminance coding block can be variably determined. Conversely, the maximum size of a ternary-divisible luminance coding block can be fixed. For example, the maximum size of a ternary-divisible luminance coding block in an I-frame can be 32×32, and the maximum size of a ternary-divisible luminance coding block in a P-frame or B-frame can be 64×64.

[0086] Furthermore, the largest coding unit can be hierarchically divided into coding units based on the partition shape pattern information obtained from the bit stream. At least one of the following can be obtained from the bit stream as partition shape pattern information: information indicating whether a quaternary partition is performed, information indicating whether a multi-partition is performed, partition direction information, or partition type information.

[0087] For example, information indicating whether a quad partition is performed can indicate whether the current coding unit is quad partitioned (QUAD_SPLIT) or not.

[0088] When the current coding unit is not partitioned by a quad, the information indicating whether to perform a multipartition can indicate whether the current coding unit will not be partitioned again (NO_SPLIT) or will be partitioned by a binary / triple.

[0089] When the current coding unit is partitioned into two or three parts, the partitioning direction information indicates that the current coding unit is partitioned in one of the horizontal or vertical directions.

[0090] When the current coding unit is divided in the horizontal or vertical direction, the partition type information indicates whether the current coding unit is divided into a binary or a ternary partition.

[0091] The partitioning mode of the current coding unit can be determined based on the partitioning direction and partitioning type information. When the current coding unit is partitioned by a binary element in the horizontal direction, the partitioning mode can be determined as a binary horizontal partitioning mode (SPLIT_BT_HOR); when the current coding unit is partitioned by a ternary element in the horizontal direction, the partitioning mode can be determined as a ternary horizontal partitioning mode (SPLIT_TT_HOR); when the current coding unit is partitioned by a binary element in the vertical direction, the partitioning mode can be determined as a binary vertical partitioning mode (SPLIT_BT_VER); and when the current coding unit is partitioned by a ternary element in the vertical direction, the partitioning mode can be determined as a ternary vertical partitioning mode (SPLIT_TT_VER).

[0092] Image decoding device 100 can obtain partitioning shape pattern information from a binary bit string in a bit stream. The bit stream received by image decoding device 100 may be in the form of fixed-length binary code, unary code, truncated unary code, predetermined binary code, etc. The binary bit string is information about binary numbers. The binary bit string may include at least one bit. Image decoding device 100 can obtain partitioning shape pattern information corresponding to the binary bit string based on partitioning rules. Image decoding device 100 can determine, based on a binary bit string, whether to perform quaternion partitioning on the coding unit, whether not to partition the coding unit, the partitioning direction, and the partitioning type.

[0093] A coding unit can be less than or equal to the largest coding unit. For example, since the largest coding unit is the coding unit with the largest size, it is one of the coding units. When the partitioning shape pattern information regarding the largest coding unit indicates that partitioning is not performed, the coding units determined within the largest coding unit have the same size as that largest coding unit. When the partitioning shape pattern information regarding the largest coding unit indicates that partitioning is performed, the largest coding unit can be partitioned into coding units. Furthermore, when the partitioning shape pattern information regarding coding units indicates that partitioning is performed, the coding unit can be partitioned into smaller coding units. However, the partitioning of an image is not limited to this, and the largest coding unit and coding units may not be distinguished. (Refer to...) Figures 3 to 16 Describe in detail the division of coding units.

[0094] Furthermore, one or more prediction blocks for prediction can be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Furthermore, one or more transform blocks for transform can be determined from the coding unit. The transform blocks may be equal to or smaller than the coding unit.

[0095] The shapes and sizes of the transform blocks and the prediction blocks can be independent of each other.

[0096] In another embodiment, prediction can be performed by using the coding unit as a prediction unit. Furthermore, transformation can be performed by using the coding unit as a transform block.

[0097] Reference Figures 3 to 16 Describe the division of coding units in detail. The current block and neighboring blocks can refer to one of the maximum coding unit, coding unit, prediction block, and transform block. Furthermore, the current block of the current coding unit is either the block currently being decoded or encoded, or the block currently being divided. Neighboring blocks can be blocks reconstructed before the current block. Neighboring blocks can be spatially or temporally adjacent to the current block. A neighboring block can be located at one of the following locations: below left, left side, above left, above, above right, right side, or below right of the current block.

[0098] Figure 3 The illustration shows a process performed by an image decoding device 100 according to an embodiment to determine at least one coding unit by dividing the current coding unit.

[0099] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. Here, N can be a positive integer. Block shape information is information indicating at least one of the shape, orientation, aspect ratio, or size of the coding unit.

[0100] The shape of the encoding unit can be square or non-square. When the width and height of the encoding unit are the same (i.e., when the block shape of the encoding unit is 4N×4N), the image decoding device 100 can determine the block shape information of the encoding unit as square. The image decoding device 100 can also determine the shape of the encoding unit as non-square.

[0101] When the width and height of the coding unit are different from each other (i.e., when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding device 100 can determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding device 100 can determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. Furthermore, the image decoding device 100 can determine whether the coding unit is horizontal or vertical based on its width and height. Additionally, the image decoding device 100 can determine the size of the coding unit based on at least one of its width, height, or area.

[0102] According to an embodiment, the image decoding device 100 can determine the shape of the coding unit by using block shape information, and can determine the coding unit partitioning method by using partition shape pattern information. That is, the coding unit partitioning method indicated by the partition shape pattern information can be determined based on the block shape indicated by the block shape information used by the image decoding device 100.

[0103] Image decoding device 100 can obtain partition shape pattern information from the bitstream. However, embodiments are not limited to this, and image decoding device 100 and image encoding device 200 can determine pre-agreed partition shape pattern information based on block shape information. Image decoding device 100 can determine pre-agreed partition shape pattern information for the largest or smallest coding unit. For example, image decoding device 100 can determine the partition shape pattern information for the largest coding unit as a quaternary partition. Furthermore, image decoding device 100 can determine the partition shape pattern information for the smallest coding unit as "no partitioning". Specifically, image decoding device 100 can determine the size of the largest coding unit to be 256×256. Image decoding device 100 can determine the pre-agreed partition shape pattern information as a quaternary partition. A quaternary partition is a partition shape pattern in which both the width and height of the coding unit are bisected. Image decoding device 100 can obtain a 128×128 coding unit from the 256×256-sized largest coding unit based on the partition shape pattern information. Furthermore, the image decoding device 100 can determine that the size of the smallest coding unit is 4×4. The image decoding device 100 can obtain partitioning shape pattern information indicating "do not perform partitioning" for the smallest coding unit.

[0104] According to an embodiment, the image decoding device 100 can use block shape information indicating that the current coding unit has a square shape. For example, the image decoding device 100 can determine whether to not divide the square coding unit, whether to divide the square coding unit vertically, whether to divide the square coding unit horizontally, or whether to divide the square coding unit into four coding units based on the division shape pattern information. (See also...) Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine, based on the partition shape pattern information indicating that partitioning is not performed, not to partition the coding unit 310a with the same size as the current coding unit 300, or may determine the coding units 310b, 310c, 310d, 310e or 310f partitioned based on the partition shape pattern information indicating a specific partitioning method.

[0105] Reference Figure 3According to an embodiment, the image decoding device 100 can 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 can 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 can 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 both the vertical and horizontal directions. According to an embodiment, the image decoding device 100 can 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 can 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 method of dividing square coding units is not limited to the above methods, and the division shape pattern information can indicate various methods. The following describes in detail, with regard to various embodiments, a specific partitioning method for dividing square coding units.

[0106] Figure 4 The illustration shows a process performed by an image decoding device 100 according to an embodiment to determine at least one coding unit by dividing a non-square coding unit.

[0107] According to an embodiment, the image decoding device 100 can use block shape information indicating that the current coding unit has a non-square shape. The image decoding device 100 can determine, based on the partitioning shape pattern information, whether not to partition the non-square current coding unit or whether to partition the non-square current coding unit using a specific partitioning method. (Refer to...) Figure 4 When the block shape information of the current encoding unit 400 or 450 indicates a non-square shape, the image decoding device 100 can determine, based on the partitioning shape pattern information indicating that partitioning should not be performed, not to partition the encoding unit 410 or 460 which has the same size as the current encoding unit 400 or 450, or determine the encoding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c partitioned based on the partitioning shape pattern information indicating a specific partitioning method. Specific partitioning methods for partitioning non-square encoding units will be described in detail below with respect to various embodiments.

[0108] According to an embodiment, the image decoding device 100 can determine the method of dividing coding units by using division shape pattern information, and in this case, the division shape pattern information can indicate the number of one or more coding units generated by dividing the coding units. (See also...) Figure 4 When the partitioning 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 partitioning the current coding unit 400 or 450 based on the partitioning shape pattern information.

[0109] According to an embodiment, when the image decoding device 100 divides a non-square current coding unit 400 or 450 based on division shape pattern information, the image decoding device 100 may consider the position of the long side of the non-square current coding unit 400 or 450 to divide the current coding unit. For example, the image decoding device 100 may determine multiple coding units by dividing the long side of the current coding unit 400 or 450 considering its shape.

[0110] According to an embodiment, when the partitioning shape pattern information indicates that the coding unit is divided (ternary partitioning) into an odd number of blocks, the image decoding device 100 can determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the partitioning shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding device 100 can 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 width-to-height ratio of the current coding unit 400 or 450 can be 4:1 or 1:4. When the width-to-height ratio is 4:1, the block shape information can be horizontal because the width is longer than the height. When the width-to-height ratio is 1:4, the block shape information can be vertical because the width is shorter than the height. The image decoding device 100 can determine whether to divide the current coding unit into an odd number of blocks based on the division shape pattern information. Furthermore, the image decoding device 100 can 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 vertical, the image decoding device 100 can determine coding units 430a to 430c by dividing the current coding unit 400 horizontally. Similarly, when the current coding unit 450 is horizontal, the image decoding device 100 can determine coding units 480a to 480c by dividing the current coding unit 450 vertically.

[0112] According to an embodiment, the image decoding device 100 can 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 particular 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 different size than the other coding units 430a and 430c or 480a and 480c. That is, the coding units determined by dividing the current coding unit 400 or 450 may have multiple sizes, and in some cases, all 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 shape pattern information indicates that the coding unit should be divided into an odd number of blocks, the image decoding device 100 can determine the odd number of coding units included in the current coding unit 400 or 450, and furthermore, can impose specific restrictions on at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. (Refer to...) Figure 4 The image decoding device 100 may configure the decoding process for encoding unit 430b or 480b to differ from the decoding processes for other encoding units 430a and 430c or 480a or 480c, wherein encoding unit 430b or 480b is located at the center of the three encoding units 430a, 430b and 430c or 480a, 480b and 480c generated by dividing the current encoding unit 400 or 450. For example, unlike other encoding units 430a and 430c or 480a and 480c, the image decoding device 100 may restrict the encoding unit 430b or 480b at the center position from being divided again or only divided a specific number of times.

[0114] Figure 5 This illustrates a process performed by an image decoding device 100 according to an embodiment, which involves dividing encoding units based on at least one of block shape information or partition shape pattern information.

[0115] According to an embodiment, the image decoding device 100 can determine whether to divide the first coding unit 500 of the square into coding units or not to divide the first coding unit 500 of the square, based on at least one of block shape information or division shape pattern information. According to an embodiment, when the division shape pattern information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding device 100 can determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The terms first coding unit, second coding unit, and third coding unit used according to the embodiment are terms used to understand the relationship before and after the division of coding units. For example, the second coding unit can be determined by dividing the first coding unit, and the third coding unit can be determined by dividing the second coding unit. It will be understood that the structure of the first coding unit, second coding unit, and third coding unit follows the above description.

[0116] According to an embodiment, the image decoding device 100 may determine, based on the division shape pattern information, whether to divide the determined second coding unit 510 into coding units or not to divide the determined second coding unit 510. (See also...) Figure 5 The image decoding device 100 can divide a non-square second coding unit 510, determined by dividing the first coding unit 500, into one or more third coding units 520a, or 520b, 520c, and 520d, based on the division shape pattern information, or it can choose not to divide the non-square second coding unit 510. The image decoding device 100 can obtain the division shape pattern information and can obtain multiple second coding units (e.g., second coding units 510) of various shapes by dividing the first coding unit 500 based on the obtained division shape pattern information. It can also divide the second coding unit 510 based on the division shape pattern information using the division method of the first coding unit 500. According to an embodiment, when the first coding unit 500 is divided into a second coding unit 510 based on the division shape pattern information of the first coding unit 500, the second coding unit 510 can also be divided into third coding units 520a, or 520b, 520c, and 520d based on the division shape pattern information of the second coding unit 510. In other words, coding units can be recursively divided based on the partitioning shape pattern information of each coding unit. Therefore, square coding units can be determined by dividing non-square coding units, and non-square coding units can be determined by recursively dividing square coding units.

[0117] Reference Figure 5Specific coding units (e.g., coding units located at the center or square coding units) among an odd number of third coding units 520b, 520c, and 520d determined by dividing a non-square second coding unit 510 can be recursively partitioned. According to an embodiment, a non-square third coding unit 520b among the odd number of third coding units 520b, 520c, and 520d can be horizontally divided into multiple fourth coding units. A non-square fourth coding unit 530b or 530d among the multiple fourth coding units 530a, 530b, 530c, and 530d can again be divided into multiple coding units. For example, a non-square fourth coding unit 530b or 530d can again be divided into an odd number of coding units. Methods for recursively partitioning coding units will be described below with respect to various embodiments.

[0118] According to an embodiment, the image decoding device 100 can divide each of the third coding units 520a, or 520b, 520c, and 520d, into coding units based on the division shape pattern information. Furthermore, the image decoding device 100 can determine, based on the division shape pattern information, not to divide the second coding unit 510. According to an embodiment, the image decoding device 100 can 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 can impose specific restrictions on certain third coding units among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 can limit the number of times the third coding unit 520c at the center position among the odd number of third coding units 520b, 520c, and 520d will not be divided or will be divided.

[0119] Reference Figure 5 The image decoding device 100 may restrict the third coding unit 520c at the center position of the odd number of third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, to be divided using a specific division method (e.g., divided into only four coding units or divided using the division method of the second coding unit 510), or to be divided only a specific number of times (e.g., divided only n times (where n>0)). However, the restriction on the third coding unit 520c at the center position is not limited to the above examples and may include various restrictions for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.

[0120] According to an embodiment, the image decoding device 100 can obtain partitioning shape pattern information for partitioning the current coding unit from a specific position in the current coding unit.

[0121] Figure 6 This illustrates a method performed by an image decoding device 100 according to an embodiment to determine a specific coding unit from an odd number of coding units.

[0122] Reference Figure 6 The partitioning shape pattern information of the current encoding unit 600 or 650 can be obtained from a sample at a specific location among multiple sample points included in the current encoding unit 600 or 650 (e.g., sample point 640 or 690 at the center location). However, the specific location in the current encoding unit 600 from which the partitioning shape pattern information can be obtained is not limited to... Figure 6 The center position in the image can include various positions included in the current encoding unit 600 (e.g., above, below, left, right, upper left, lower left, upper right, and lower right positions). The image decoding device 100 can obtain the division shape pattern information from the specific position and can determine whether to divide the current encoding unit into encoding units of various shapes and sizes or not to divide the current encoding unit.

[0123] According to an embodiment, when the current coding unit is divided into a specific number of coding units, the image decoding device 100 may select one coding unit from the coding units. As will be described below with respect to various embodiments, various methods may be used to select one coding unit from a plurality of coding units.

[0124] According to an embodiment, the image decoding device 100 can divide the current coding unit into multiple coding units and can determine the coding unit at a specific location.

[0125] According to an embodiment, the image decoding device 100 can use information indicating the positions of an odd number of coding units to determine the coding unit at the center position among the odd number of coding units. (See also...) Figure 6The image decoding device 100 can determine an odd number of coding units 620a, 620b, and 620c or an 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 can determine an intermediate coding unit 620b or an 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 can determine the coding unit 620b at the center position by determining the positions of coding units 620a, 620b, and 620c based on information indicating the positions of specific samples included in coding units 620a, 620b, and 620c. In detail, the image decoding device 100 can determine the position of the encoding units 620a, 620b and 620c based on the information indicating the positions of the upper left samples 630a, 630b and 630c of the encoding units 620a, 620b and 620c, and determine the encoding unit 620b at the center position.

[0126] According to an embodiment, the information indicating the positions of the top-left samples 630a, 630b, and 630c included in encoding units 620a, 620b, and 620c respectively may include information about the positions or coordinates of the encoding units 620a, 620b, and 620c in the image. According to an embodiment, the information indicating the positions of the top-left samples 630a, 630b, and 630c included in the encoding units 620a, 620b, and 620c respectively may include information indicating the width or height of the encoding units 620a, 620b, and 620c included in the current encoding unit 600, and the width or height may correspond to information indicating the difference between the coordinates of the encoding units 620a, 620b, and 620c in the image. That is, the image decoding device 100 can determine the encoding unit 620b at the center position by directly using information about the positions or coordinates of the encoding units 620a, 620b, and 620c in the image, or by using information about the width or height corresponding to the difference between the coordinates of the encoding units.

[0127] According to an embodiment, the information indicating the position of the upper left sample 630a of the upper encoding unit 620a may include coordinates (xa, ya), the information indicating the position of the upper left sample 630b of the middle encoding unit 620b may include coordinates (xb, yb), and the information indicating the position of the upper left sample 630c of the lower encoding unit 620c may include coordinates (xc, yc). The image decoding device 100 can determine the middle encoding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in the encoding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the encoding unit 620b including the coordinates (xb, yb) of the sample 630b at the center position can be determined as the encoding unit at the center position among the encoding units 620a, 620b, and 620c determined by dividing the current encoding unit 600. However, the coordinates indicating the positions of the top-left samples 630a, 630b, and 630c may include coordinates indicating absolute positions within the frame, or coordinates (dxb, dyb) indicating the relative position of the top-left sample 630b of the intermediate encoding unit 620b relative to the top-left sample 630a of the upper encoding unit 620a, and coordinates (dxc, dyc) indicating the relative position of the top-left sample 630c of the lower encoding unit 620c relative to the top-left sample 630a of the upper encoding unit 620a. The method of determining the encoding unit at a specific location by using the coordinates of samples included in the encoding unit as information indicating the position of the samples is not limited to the methods described above, and may include various arithmetic methods capable of using the coordinates of the samples.

[0128] According to an embodiment, the image decoding device 100 can divide the current encoding unit 600 into a plurality of encoding units 620a, 620b, and 620c, and can select one of the encoding units 620a, 620b, and 620c based on a specific criterion. For example, the image decoding device 100 can select encoding unit 620b, whose size is different from that of other encoding units, from the encoding units 620a, 620b, and 620c.

[0129] According to an embodiment, the image decoding device 100 can determine the width or height of each of the encoding units 620a, 620b, and 620c by using coordinates (xa, ya) indicating the position of the upper left sample point 630a of the upper encoding unit 620a, coordinates (xb, yb) indicating the position of the upper left sample point 630b of the middle encoding unit 620b, and coordinates (xc, yc) indicating the position of the upper left sample point 630c of the lower encoding unit 620c. The image decoding device 100 can determine the respective dimensions of the encoding units 620a, 620b, and 620c by using coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the encoding units 620a, 620b, and 620c. According to an embodiment, the image decoding device 100 can determine the width of the upper encoding unit 620a as the width of the current encoding unit 600. The image decoding device 100 can determine the height of the upper encoding unit 620a as yb-ya. According to an embodiment, the image decoding device 100 can determine the width of the intermediate encoding unit 620b as the width of the current encoding unit 600. The image decoding device 100 can determine the height of the intermediate encoding unit 620b as yc-yb. According to an embodiment, the image decoding device 100 can determine the width or height of the lower encoding unit 620c by using the width or height of the current encoding unit 600 or the width or height of the upper encoding unit 620a and the intermediate encoding unit 620b. The image decoding device 100 can determine encoding units with dimensions different from the dimensions of other encoding units based on the determined widths and heights of the encoding units 620a to 620c. (Refer to...) Figure 6 The image decoding device 100 can determine an intermediate encoding unit 620b, which has a size different from that of the upper encoding unit 620a and the lower encoding unit 620c, as an encoding unit at a specific location. However, the method described above by the image decoding device 100 for determining an encoding unit with a size different from that of other encoding units corresponds only to the example of determining an encoding unit at a specific location by using the size of the encoding unit determined based on the coordinates of a sample point. Therefore, various methods can be used to determine an encoding unit at a specific location by comparing the size of the encoding unit determined based on the coordinates of a specific sample point.

[0130] The image decoding device 100 can determine the width or height of each of the encoding units 660a, 660b, and 660c by using coordinates (xd, yd) indicating the position of the upper left sample 670a of the left encoding unit 660a, coordinates (xe, ye) indicating the position of the upper left sample 670b of the middle encoding unit 660b, and coordinates (xf, yf) indicating the position of the upper left sample 670c of the right encoding unit 660c. The image decoding device 100 can also determine the respective dimensions of the encoding units 660a, 660b, and 660c by using coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the encoding units 660a, 660b, and 660c.

[0131] According to an embodiment, the image decoding device 100 can determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 can 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 can determine the width of the middle coding unit 660b as xf-xe. The image decoding device 100 can 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 can determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding device 100 can determine coding units with dimensions different from other coding units based on the determined widths and heights of the coding units 660a to 660c. (Refer to...) Figure 6 The image decoding device 100 can determine an intermediate coding unit 660b, whose size differs from that of the left coding unit 660a and the right coding unit 660c, as a coding unit at a specific location. However, the method described above for determining a coding unit whose size differs from that of other coding units, performed by the image decoding device 100, corresponds only to the example of determining a coding unit at a specific location by using the size of a coding unit determined based on the coordinates of a sample point. Therefore, various methods can be used to determine a coding unit at a specific location by comparing the size of a coding unit determined based on the coordinates of a specific sample point.

[0132] However, the position of the sample points considered in determining the position of the coding unit is not limited to the aforementioned upper left position, and information about any position of the sample points included in the coding unit can be used.

[0133] According to an embodiment, the image decoding device 100 may consider the shape of the current coding unit and select a coding unit at a specific location from an odd number of coding units determined by dividing the current coding unit. For example, when the current coding unit has a non-square shape with a width greater than its height, the image decoding device 100 may determine a coding unit at a specific location along the horizontal direction. That is, the image decoding device 100 may determine one coding unit from the coding units at different locations along the horizontal direction and impose restrictions on that coding unit. When the current coding unit has a non-square shape with a height greater than its width, the image decoding device 100 may determine a coding unit at a specific location along the vertical direction. That is, the image decoding device 100 may determine one coding unit from the coding units at different locations along the vertical direction and may impose restrictions on that coding unit.

[0134] According to an embodiment, the image decoding device 100 can use information indicating the positions of each of an even number of coding units to determine a coding unit at a specific position within the even number of coding units. The image decoding device 100 can determine the even number of coding units by partitioning (binary partitioning) the current coding unit, and can determine the coding unit at a specific position by using information about the positions of the even number of coding units. The associated operations are similar to those already described above regarding... Figure 6 The operation corresponding to determining a specific position (e.g., the center position) among an odd number of coding units is described in detail, so its detailed description is not provided here.

[0135] According to an embodiment, when a non-square current coding unit is divided into multiple coding units, specific information about the coding unit at a specific location can be used in the division operation to determine the coding unit at a specific location among the multiple coding units. For example, the image decoding device 100 can use at least one of block shape information or division shape pattern information stored in samples included in intermediate coding units to determine the coding unit at the center position among the multiple coding units determined by dividing the current coding unit in the division operation.

[0136] Reference Figure 6The image decoding device 100 can divide the current coding unit 600 into multiple coding units 620a, 620b, and 620c based on the division shape pattern information, and can determine the coding unit 620b at the center position among the multiple coding units 620a, 620b, and 620c. Furthermore, the image decoding device 100 can determine the coding unit 620b at the center position by considering the location where the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 can be obtained from the sample point 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into multiple coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample point 640 can be determined as the coding unit at the center position. However, the information used to determine the coding unit at the center position is not limited to the division shape pattern information, and various types of information can 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 location can be obtained from specific samples included in the coding unit to be determined. (Refer to...) Figure 6 Image decoding device 100 can use partitioning shape pattern information obtained from samples at specific locations in the current coding unit 600 (e.g., samples at the center of the current coding unit 600) to determine a coding unit at a specific location (e.g., a coding unit at the center of the partitioned coding units) among a plurality of coding units 620a, 620b, and 620c determined by partitioning the current coding unit 600. That is, image decoding device 100 can determine samples at specific locations by considering the block shape of the current coding unit 600, determine coding unit 620b including samples from the plurality of coding units 620a, 620b, and 620c determined by partitioning the current coding unit 600 that provide specific information (e.g., partitioning shape pattern information), and can impose specific constraints on coding unit 620b. (Refer to...) Figure 6 According to an embodiment, during the decoding operation, the image decoding device 100 may determine a sample 640 at the center position of the current encoding unit 600 as a sample from which specific information can be obtained, and may impose specific restrictions on the encoding 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-described position, and may include any position of the sample included in the encoding unit 620b to be determined as subject to restrictions.

[0138] According to an embodiment, the location of a sample point from which specific information can be obtained can be determined based on the shape of the current coding unit 600. According to an embodiment, block shape information can indicate whether the current coding unit has a square shape or a non-square shape, and the location of the sample point from which specific information can be obtained can be determined based on this shape. For example, the image decoding device 100 can determine a sample point located on a boundary that bisects at least one of the width or height of the current coding unit as a sample point from which specific information can be obtained by using at least one of information about the width of the current coding unit or 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 can determine one of the sample points adjacent to the boundary that bisects the long side of the current coding unit as a sample point from which specific information can be obtained.

[0139] According to an embodiment, when the current coding unit is divided into multiple coding units, the image decoding device 100 can use partition shape pattern information to determine the coding unit at a specific location among the multiple coding units. According to an embodiment, the image decoding device 100 can obtain partition shape pattern information from samples at a specific location in the coding unit, and partition the multiple coding units generated by partitioning the current coding unit using the partition shape pattern information, wherein the partition shape pattern information is obtained from samples at a specific location in each of the multiple coding units. That is, the coding units can be recursively partitioned based on the partition shape pattern information, wherein the partition shape pattern information is obtained from samples at a specific location in each coding unit. The above already relates to... Figure 5 The operation of recursively dividing the coding unit is described, so its detailed description will not be provided here.

[0140] According to an embodiment, the image decoding device 100 can determine one or more coding units by dividing the current coding unit, and can determine the order in which the one or more coding units are decoded based on a specific block (e.g., the current coding unit).

[0141] Figure 7 This illustrates the order in which the image decoding device 100 processes the plurality of coding units when it determines the plurality of coding units by dividing the 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 the vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in the horizontal direction, or determine the second coding units 750a to 750d by dividing the first coding unit 700 in both the vertical and horizontal directions.

[0143] Reference Figure 7 The image decoding device 100 can determine to process second coding units 710a and 710b, determined by dividing the first coding unit 700 in the vertical direction, in a horizontal order 710c. The image decoding device 100 can determine to process second coding units 730a and 730b, determined by dividing the first coding unit 700 in the horizontal direction, in a vertical order 730c. The image decoding device 100 can determine to process second coding units 750a to 750d, determined by dividing the first coding unit 700 in both the vertical and horizontal directions, according to a specific order (e.g., raster scan order or zigzag scan order 750e), wherein coding units in one row are processed according to the specific order, and then coding units in the next row are processed.

[0144] According to an embodiment, the image decoding device 100 can recursively divide encoding units. (See also...) Figure 7 The image decoding device 100 can determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing a first coding unit 700, and can recursively divide each of the determined plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d. The method of dividing the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d can correspond to the method of dividing the first coding unit 700. Thus, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d can be independently divided into a plurality of coding units. (Refer to...) Figure 7 The image decoding device 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in the vertical direction, and can determine whether to divide or not divide each of the second coding units 710a and 710b independently.

[0145] According to an embodiment, the image decoding device 100 can determine the third coding units 720a and 720b by dividing the left second coding unit 710a in the horizontal direction, and may not divide the right second coding unit 710b.

[0146] According to an embodiment, the processing order of coding units can be determined based on the operation of dividing coding units. In other words, the processing order of the divided coding units can be determined based on the processing order of the coding units immediately preceding the division. The image decoding device 100 can 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. Because 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 can be processed in the vertical order 720c. Because the left second coding unit 710a and the right second coding unit 710b are processed in the horizontal order 710c, the right second coding unit 710b can be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in the vertical order 720c. The operation of determining the processing order of coding units based on the coding units before partitioning is not limited to the above example, and various methods can be used to process the partitioned coding units and the coding units determined to be of various shapes independently in a specific order.

[0147] Figure 8 The image decoding device 100 performs a process, according to an embodiment, to determine that the current encoding unit will be divided into an odd number of encoding units when the encoding units cannot be processed in a specific order.

[0148] According to an embodiment, the image decoding device 100 can determine, based on the obtained partition shape pattern information, that the current coding unit will be divided into an odd number of coding units. (See also...) Figure 8 The square first coding unit 800 can be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b can be independently divided into third coding units 820a and 820b, as well as 820c to 820e. According to an embodiment, the image decoding device 100 can determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and can divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.

[0149] According to an embodiment, the image decoding device 100 can determine whether any coding unit is divided into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a specific order. (See also...) Figure 8The image decoding device 100 can determine the third coding units 820a and 820b, and 820c to 820e, by recursively dividing the first coding unit 800. The image decoding device 100 can determine whether any of the following coding units is divided into an odd number of coding units based on at least one of block shape information or division shape pattern information: the first coding unit 800, the second coding units 810a and 810b, or the third coding units 820a and 820b and 820c to 820e. For example, the second coding unit located on the right side of the second coding units 810a and 810b can 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 (e.g., zigzag scanning order 830). The image decoding device 100 can determine whether the third coding units 820c, 820d, and 820e, which are 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 can determine whether the third encoding units 820a and 820b, and 820c to 820e included in the first encoding unit 800 satisfy a condition for processing in a specific order, and this condition relates to whether at least one of the width or height of the second encoding units 810a and 810b will be halved along the boundary of the third encoding units 820a and 820b, and 820c to 820e. For example, the third encoding units 820a and 820b determined when the height of the non-square-shaped left second encoding unit 810a is halved can satisfy the condition. Because the boundary of the third encoding units 820c to 820e determined when the right second encoding unit 810b is divided into three encoding units fails to halve the width or height of the right second encoding unit 810b, it can be determined that the third encoding units 820c to 820e do not satisfy the condition. When the conditions described above are not met, the image decoding device 100 can determine that the scanning order is discontinuous, and based on the determination result, can determine that the right-side second coding unit 810b will be divided into an odd number of coding units. 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 specific positions within the divided coding units. The restrictions or specific positions have already been described above with respect to various embodiments, and therefore their detailed description will not be provided again.

[0151] Figure 9 The illustration shows a process performed by an image decoding device 100 according to an embodiment, which involves dividing a first encoding unit 900 to determine at least one encoding unit.

[0152] According to an embodiment, the image decoding device 100 can divide the first coding unit 900 based on the division shape pattern information obtained by the bitstream acquirer 110. The square first coding unit 900 can be divided into four square coding units, or it can be divided into multiple non-square coding units. For example, referring to… Figure 9 When the partitioning shape pattern information indicates that the first coding unit 900 should be partitioned into non-square coding units, the image decoding device 100 may partition the first coding unit 900 into a plurality of non-square coding units. Specifically, when the partitioning shape pattern information indicates that an odd number of coding units should be determined by partitioning the first coding unit 900 in the horizontal or vertical direction, the image decoding device 100 may partition the square first coding unit 900 into an odd number of coding units (e.g., second coding units 910a, 910b, and 910c determined by partitioning the square first coding unit 900 in the vertical direction, or second coding units 920a, 920b, and 920c determined by partitioning the square first coding unit 900 in the horizontal direction).

[0153] According to an embodiment, the image decoding device 100 can determine whether second encoding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first encoding unit 900 satisfy a condition for processing in a specific order, and this condition relates to whether at least one of the width or height of the first encoding unit 900 will be divided in half along the boundaries of the second encoding units 910a, 910b, 910c, 920a, 920b, and 920c. (Refer to...) Figure 9 Because the boundaries of the second coding units 910a, 910b, and 910c, defined by the first coding unit 900 dividing the square in the vertical direction, do not halve the width of the first coding unit 900, it can be determined that the first coding unit 900 does not meet the conditions for processing in a specific order. Furthermore, because the boundaries of the second coding units 920a, 920b, and 920c, defined by the first coding unit 900 dividing the square in the horizontal direction, do not halve the height of the first coding unit 900, it can be determined that the first coding unit 900 does not meet the conditions for processing in a specific order. When the conditions are not met as described above, the image decoding device 100 can determine that the scanning order is discontinuous, and can determine, based on the determination result, that the first coding unit 900 will be divided into an odd number of coding units. 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 specific positions within the divided coding units. The restrictions or specific positions have already been described above with respect to various embodiments, and therefore their detailed description will not be provided again.

[0154] According to an embodiment, the image decoding device 100 can determine coding units of various shapes by dividing a first coding unit.

[0155] Reference Figure 9 The image decoding device 100 can divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.

[0156] Figure 10 The shape into which the second encoding unit can be divided is limited when the second encoding unit, which has a non-square shape and is determined by the image decoding device 100 dividing the first encoding unit 1000, meets certain conditions according to the embodiment.

[0157] According to an embodiment, the image decoding device 100 can determine, based on the partitioning shape pattern information obtained by the bitstream acquirer 110, to divide the square first coding unit 1000 into non-square second coding units 1010a and 1010b, or 1020a and 1020b. The second coding units 1010a and 1010b, or 1020a and 1020b, can be divided independently. Thus, the image decoding device 100 can determine, based on the partitioning shape pattern information of each of the second coding units 1010a and 1010b, or 1020a and 1020b, to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b, into multiple coding units, or not to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b. According to an embodiment, the image decoding device 100 can 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 can restrict the right second coding unit 1010b to not be 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 second coding unit 1010b are divided independently in the horizontal direction, the third coding units 1012a and 1012b, or 1014a and 1014b, can be determined. However, this situation works in the same way as when the image decoding device 100 divides the first encoding unit 1000 into four squares, namely the second encoding 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 can determine third coding units 1022a and 1022b, or 1024a and 1024b, by dividing a non-square second coding unit 1020a or 1020b, determined by dividing a first coding unit 1000 in the horizontal direction, in the vertical direction. However, when a second coding unit (e.g., the upper second coding unit 1020a) is divided in the vertical direction, for the reasons described above, the image decoding device 100 can restrict another second coding unit (e.g., the lower second coding unit 1020b) to not be divided in the vertical direction in which the upper second coding unit 1020a is divided.

[0159] Figure 11 The illustration shows the process performed by the image decoding device 100 to divide the square coding unit when the division shape pattern information cannot indicate that the square coding unit is divided into four square coding units, according to an embodiment.

[0160] According to an embodiment, the image decoding device 100 can determine second coding units 1110a and 1110b, or 1120a and 1120b, etc., by dividing the first coding unit 1100 based on division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding units, but may not include information for dividing the coding unit into four square coding units. Based on such division shape pattern information, the image decoding device 100 may not divide the square first coding unit 1100 into four square coding units 1130a, 1130b, 1130c, and 1130d. The image decoding device 100 can determine 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 can independently divide 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., can be recursively divided in a specific order, and this division method can correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.

[0162] For example, the image decoding device 100 can determine the third coding units 1112a and 1112b of the square by dividing the left second coding unit 1110a in the horizontal direction, and can determine the third coding units 1114a and 1114b of the square by dividing the right second coding unit 1110b in the horizontal direction. Furthermore, the image decoding device 100 can determine the third coding units 1116a, 1116b, 1116c, and 1116d of the square by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, coding units with the same shape as the second coding units 1130a, 1130b, 1130c, and 1130d of the four squares divided from the first coding unit 1100 can be determined.

[0163] As another example, the image decoding device 100 can determine the third coding units 1122a and 1122b of the square by dividing the upper second coding unit 1120a in the vertical direction, and can determine the third coding units 1124a and 1124b of the square by dividing the lower second coding unit 1120b in the vertical direction. Furthermore, the image decoding device 100 can determine the third coding units 1126a, 1126b, 1126c, and 1126d of the square by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, coding units with the same shape as the second coding units 1130a, 1130b, 1130c, and 1130d of the four squares divided from the first coding unit 1100 can be determined.

[0164] Figure 12 This illustrates that the processing order among multiple coding units according to an embodiment can be changed based on the process of dividing the coding units.

[0165] According to an embodiment, the image decoding device 100 can divide the first coding unit 1200 based on the division shape pattern information. When the block shape indicates a square shape and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one direction, either horizontal or vertical, the image decoding device 100 can determine second coding units 1210a and 1210b, or 1220a and 1220b, etc., by dividing the first coding unit 1200. (Refer to...) Figure 12The non-square second coding units 1210a and 1210b, or 1220a and 1220b, determined by dividing the first coding unit 1200 only in the horizontal or 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 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 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. The above has already discussed... Figure 11 The operation of dividing the second coding units 1210a and 1210b, or 1220a and 1220b, is described, so its detailed description will not be provided here.

[0166] According to an embodiment, the image decoding device 100 can process the encoding units in a specific order. The above has already mentioned... Figure 7 The operation of processing coded units in a specific order is described, therefore its detailed description is not provided further. (See reference...) Figure 12 The image decoding device 100 can determine the third encoding units 1216a, 1216b, 1216c, and 1216d, as well as 1226a, 1226b, 1226c, and 1226d, of the four squares by dividing the first encoding unit 1200 into squares. According to an embodiment, the image decoding device 100 can determine the processing order of the third encoding units 1216a, 1216b, 1216c, and 1216d, as well as 1226a, 1226b, 1226c, and 1226d, based on the division method of the first encoding unit 1200.

[0167] According to an embodiment, the image decoding device 100 can determine 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 following processing order 1217: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.

[0168] According to an embodiment, the image decoding device 100 can determine 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 following processing order 1227: firstly, the third coding units 1226a and 1226b included in the upper second coding unit 1220a are processed in the horizontal direction, and then the third coding units 1226c and 1226d included in the lower second coding unit 1220b are processed in the horizontal direction.

[0169] Reference Figure 12 The third coding units 1216a, 1216b, 1216c and 1216d, as well as 1226a, 1226b, 1226c and 1226d of the square 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 determined by dividing the first coding unit 1200 in the vertical direction are different from 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, as well as the third coding units 1226a, 1226b, 1226c, and 1226d derived from the second coding units 1210a and 1210b and the second coding units 1220a and 1220b, ultimately show coding units of the same shape derived from the first coding unit 1200. Thus, by recursively dividing the coding units in different ways based on the division shape pattern information, even if the coding units are ultimately determined to have the same shape, the image decoding device 100 can process multiple coding units in different orders.

[0170] Figure 13 The illustration shows the process of determining the depth of a coding unit when the shape and size of the coding unit change, according to an embodiment, as the coding unit is recursively divided to determine multiple coding units.

[0171] According to an embodiment, the image decoding device 100 can determine the depth of a 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 partitioning is 2n (n>0) times the length of the long side of the current coding unit after partitioning, the image decoding device 100 can determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before partitioning. In the following description, a coding unit with an increased depth is referred to as a deeper coding unit.

[0172] Reference Figure 13 According to an embodiment, the image decoding device 100 can determine deeper second and third coding units 1302 and 1304 by dividing a first coding unit 1300 of a square based on block shape information indicating the shape of the square (e.g., the block shape information may be represented as "0: SQUARE"). Assuming the size of the first coding unit 1300 of the square is 2N×2N, the second coding unit 1302, determined by dividing the width and height of the first coding unit 1300 by half, can have a size of N×N. Furthermore, the third coding unit 1304, determined by dividing the width and height of the second coding unit 1302 by half, can have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height 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 half of the width and height of the first coding unit 1300, can be D+1, and the depth of the third coding unit 1304, whose width and height are one-quarter of the width and height of the first coding unit 1300, can be D+2.

[0173] According to an embodiment, the image decoding device 100 can determine a deeper second encoding unit 1312 or 1322 and a third encoding unit 1314 or 1324 by dividing a non-square first encoding unit 1310 or 1320 based on block shape information indicating a non-square shape (e.g., the block shape information can be represented as "1: NS_VER" indicating a non-square shape with a height greater than its width, or as "2: NS_HOR" indicating a non-square shape with a width greater than its height).

[0174] The image decoding device 100 can determine the second encoding unit 1302, 1312, or 1322 by dividing the width or height of the first encoding unit 1310, which has a size of N×2N. That is, the image decoding device 100 can determine the second encoding unit 1302 or the second encoding unit 1322 with a size of N×N by dividing the first encoding unit 1310 in the horizontal direction, or it can determine the second encoding unit 1312 with a size of N / 2×N by dividing the first encoding unit 1310 in both the horizontal and vertical directions.

[0175] According to an embodiment, the image decoding device 100 can determine the second encoding unit 1302, 1312, or 1322 by dividing the width or height of the first encoding unit 1320, which has a size of 2N×N. That is, the image decoding device 100 can determine the second encoding unit 1302 or the second encoding unit 1312 with a size of N×N by dividing the first encoding unit 1320 in the vertical direction, or it can determine the second encoding unit 1322 with a size of N×N / 2 by dividing the first encoding unit 1320 in both the horizontal and vertical directions.

[0176] According to an embodiment, the image decoding device 100 can determine the third encoding unit 1304, 1314, or 1324 by dividing the width or height of the second encoding unit 1302 with a size of N×N. That is, the image decoding device 100 can determine the third encoding unit 1304 with a size of N / 2×N / 2, the third encoding unit 1314 with a size of N / 4×N / 2, or the third encoding unit 1324 with a size of N / 2×N / 4 by dividing the second encoding unit 1302 in the vertical and horizontal directions.

[0177] According to an embodiment, the image decoding device 100 can determine the third encoding unit 1304, 1314, or 1324 by dividing the width or height of the second encoding unit 1312, which has a size of N / 2 × N. That is, the image decoding device 100 can determine the third encoding unit 1304 or the third encoding unit 1324 with a size of N / 2 × N / 4 by dividing the second encoding unit 1312 in the horizontal direction, or it can determine the third encoding unit 1314 with a size of N / 4 × N / 2 by dividing the second encoding unit 1312 in both the vertical and horizontal directions.

[0178] According to an embodiment, the image decoding device 100 can determine the third encoding unit 1304, 1314, or 1324 by dividing the width or height of the second encoding unit 1322, which has a size of N×N / 2. That is, the image decoding device 100 can determine the third encoding unit 1304 or the third encoding unit 1314 with a size of N / 2×N / 2 by dividing the second encoding unit 1322 in the vertical direction, or it can determine the third encoding unit 1324 with a size of N / 2×N / 4 by dividing the second encoding unit 1322 in both the vertical and horizontal directions.

[0179] According to an embodiment, the image decoding device 100 can divide square coding units 1300, 1302, or 1304 in the horizontal or vertical direction. For example, the image decoding device 100 can determine a first coding unit 1310 of size N×2N by dividing a first coding unit 1300 of size 2N×2N in the vertical direction, or it can determine a first coding unit 1320 of size 2N×N by dividing a first coding unit 1300 of size 2N×2N 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 a first coding unit 1300 of size 2N×2N in the horizontal or vertical direction can be the same as the depth of the first coding unit 1300.

[0180] According to an embodiment, the width and height of the third encoding unit 1314 or 1324 can be 1 / 4 of the width and height of the first encoding unit 1310 or 1320. When the depth of the first encoding unit 1310 or 1320 is D, the depth of the second encoding unit 1312 or 1322, whose width and height are 1 / 2 of the width and height of the first encoding unit 1310 or 1320, can be D+1, and the depth of the third encoding unit 1314 or 1324, whose width and height are 1 / 4 of the width and height of the first encoding unit 1310 or 1320, can be D+2.

[0181] Figure 14 The diagram illustrates a depth that can be determined based on the shape and size of the coding unit, and a partial index (PID) used to distinguish the coding units, according to an embodiment.

[0182] According to an embodiment, the image decoding device 100 can determine second coding units of various shapes by dividing a first coding unit 1400 into squares. (See also...) Figure 14 The image decoding device 100 can determine second coding units 1402a and 1402b, second coding units 1404a and 1404b, and second coding units 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one direction, either vertical or horizontal, based on the division shape pattern information. In other words, the image decoding device 100 can 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 depths of the second coding units 1402a and 1402b, second coding units 1404a and 1404b, and second coding units 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 their longer sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the longer 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 can have the same depth, such as D. However, when the image decoding device 100 divides the first encoding unit 1400 into four square second encoding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, the depth of the second encoding units 1406a, 1406b, 1406c and 1406d can be D+1 deeper than the depth D of the first encoding unit 1400 because the length of the side of the square second encoding units 1406a, 1406b, 1406c and 1406d is 1 / 2 the length of the side of the first encoding unit 1400.

[0184] According to an embodiment, the image decoding device 100 can determine a plurality of second encoding units 1412a and 1412b, as well as 1414a, 1414b, and 1414c, by dividing a first encoding unit 1410 in the horizontal direction with a height greater than its width based on division shape pattern information. According to an embodiment, the image decoding device 100 can determine a plurality of second encoding units 1422a and 1422b, as well as 1424a, 1424b, and 1424c, by dividing a first encoding unit 1420 in the vertical direction with a width greater than its height based on division shape pattern information.

[0185] According to an embodiment, the depths 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, can be determined based on the length of their longer sides. For example, since the length of the side of the square second coding units 1412a and 1412b is half the length of the longer side of the non-square first coding unit 1410 whose height is greater than its width, the depth of the square second coding units 1412a and 1412b is D+1 deeper than the depth D of the non-square first coding unit 1410.

[0186] Furthermore, the image decoding device 100 can 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 pattern 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 half the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c can be D+1, which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding device 100 can determine the depth of the coding unit divided from the first coding unit 1420, which has a width longer than its height and has a non-square shape, by using the method described above for determining the depth of the coding unit divided from the first coding unit 1410.

[0187] According to an embodiment, when an odd number of the divided coding units do not have equal sizes, the image decoding device 100 can determine the PID used to identify the divided coding units based on the size ratio between the coding units. (See also...) Figure 14 In an odd-numbered set of coding units 1414a, 1414b, and 1414c, the width of the central coding unit 1414b can be equal to the width of the other coding units 1414a and 1414c, and its height is twice the height of the other coding units 1414a and 1414c. That is, in this case, the central coding unit 1414b may include two other coding units 1414a or 1414c. Therefore, when the PID of the central coding unit 1414b is 1 based on the scan order, the PID of the coding unit 1414c located adjacent to coding unit 1414b can be increased by 2 and thus can be 3. That is, there may be discontinuous PID values. According to an embodiment, the image decoding device 100 can determine whether the odd-numbered coding units do not have equal sizes based on whether there is a discontinuity in the PID used to identify the divided coding units.

[0188] According to an embodiment, the image decoding device 100 may determine whether to use a specific partitioning method based on PID values ​​used to identify multiple coding units determined by partitioning the current coding unit. (See also...) Figure 14The image decoding device 100 can determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing a first coding unit 1410 having a rectangular shape with a height longer than its width. The image decoding device 100 can use a PID indicating the corresponding coding unit to identify it. According to an embodiment, the PID can be obtained from a sample point at a specific location of each coding unit (e.g., the upper left sample point).

[0189] According to an embodiment, the image decoding device 100 can determine the coding unit at a specific location within the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of a first coding unit 1410 having a rectangular shape with a height greater than its width indicates that the coding unit should be divided into three coding units, the image decoding device 100 can divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding device 100 can assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding device 100 can compare the PIDs of an odd number of divided coding units to determine the coding unit at the center position within the coding units. The image decoding device 100 can determine the coding unit 1414b, whose PID corresponds to the median value of the PIDs of the coding units, as the coding unit at the center position within the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding device 100 can determine a PID for distinguishing the divided coding units based on the size ratio between the coding units. (Refer to...) Figure 14The width of the coding unit 1414b generated by dividing the first coding unit 1410 can be equal to the width of the other coding units 1414a and 1414c, and its height can be twice the height 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 adjacent to the coding unit 1414b can be increased by 2 and therefore can be 3. When the PID does not increase uniformly as described above, the image decoding device 100 can determine that the coding unit is divided into a plurality of coding units, wherein the plurality of coding units includes coding units with dimensions different from those of the 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 can divide the current coding unit in such a way that the coding unit at a specific position in the odd number of coding units (e.g., the coding unit at the center position) has a dimension different from that of the other coding units. In this case, the image decoding device 100 can determine the coding unit at the center position with a different dimension by using the PID of the coding unit. However, the PID and size or position of the encoding unit at a specific location are not limited to the examples above, and various PIDs, positions and sizes of encoding units can be used.

[0190] According to an embodiment, the image decoding device 100 may use a specific data unit, in which encoding units are recursively divided.

[0191] Figure 15 This illustrates how, according to an embodiment, multiple encoding units are determined based on multiple specific data units included in the image.

[0192] According to an embodiment, a specific data unit can be defined as a data unit that recursively divides coding units by using division shape pattern information. That is, a specific data unit can correspond to a coding unit used to determine the highest depth of multiple coding units divided from the current frame. In the following description, for ease of explanation, the 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 data unit may include M×N sample points. Here, M and N may be equal to each other and may be integers represented as powers 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 encoding units.

[0194] According to an embodiment, the image decoding device 100 can divide the current frame into multiple reference data units. According to an embodiment, the image decoding device 100 can divide the multiple reference data units from the current frame using the division shape pattern information of each reference data unit. The operation of dividing the reference data units can correspond to a division operation using a quadtree structure.

[0195] According to an embodiment, the image decoding device 100 can predetermine the minimum allowed size of the reference data units included in the current frame. Therefore, the image decoding device 100 can determine various reference data units having sizes equal to or greater than the minimum size, and can determine one or more coding units by referring to the determined reference data units and using partitioning shape pattern information.

[0196] Reference Figure 15 The image decoding device 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 (e.g., sequences, frames, stripes, strip segments, parallel blocks, parallel block groups, maximum coding units, etc.) that can include one or more reference coding units.

[0197] According to an embodiment, the bitstream acquirer 110 of the image decoding device 100 can obtain from the bitstream at least one of reference coding unit shape information or reference coding unit size information for each of various data units. The above has already discussed... Figure 3 The operation of dividing the current coding unit 300 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has already been discussed... Figure 4 The operation of dividing the current coding unit 400 or 450 describes the operation of dividing the non-square reference coding unit 1502 into one or more coding units. Therefore, its detailed description is not provided.

[0198] According to an embodiment, the image decoding device 100 can determine the size and shape of a reference coding unit using a PID (PID) used to identify the size and shape of the reference coding unit, based on a set of data units predetermined according to specific conditions. That is, the bitstream acquirer 110 can obtain from the bitstream only the PID for each slice, slice segment, parallel block, parallel block group, or maximum coding unit for identifying the size and shape of the reference coding unit, wherein the slice, slice segment, parallel block, parallel block group, or maximum coding unit is a data unit (e.g., a data unit with a size equal to or smaller than the slice) among various data units (e.g., a sequence, a frame, a slice, a slice segment, a parallel block, a parallel block group, a maximum coding unit, etc.) that meets specific conditions (e.g., a data unit with a size equal to or smaller than the slice). The image decoding device 100 can determine the size and shape of the reference coding unit for each data unit that meets specific conditions by using the PID. When obtaining and using reference coding unit shape information and reference coding unit size information from the bitstream based on each data unit with a relatively small size, the efficiency of using the bitstream may be low, and therefore, it is preferable to obtain and use only the PID, rather than directly obtaining the reference coding unit shape information and reference coding unit size information. In this case, at least one of the dimensions or shapes of the reference coding unit corresponding to the PID used to identify the size or shape of the reference coding unit can be predetermined. That is, the image decoding device 100 can determine at least one of the dimensions or shapes of the reference coding unit included in the data unit used as the unit for obtaining the PID by selecting at least one of the dimensions or shapes of the reference coding unit predetermined based on the PID.

[0199] According to embodiments, 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 image may include one or more reference coding units, and the coding unit can be determined by recursively dividing each reference coding unit. According to embodiments, at least one of the width or height of the maximum coding unit may be an integer multiple of at least one of the width or height of the reference coding unit. According to embodiments, the size of the reference coding unit can 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 block shape information or division shape pattern information.

[0200] According to an embodiment, the image decoding device 100 can obtain block shape information indicating the shape of the current coding unit or partition shape pattern information indicating the partitioning method of the current coding unit from the bitstream, and can use the obtained information. The partition shape pattern information can be included in the bitstream associated with various data units. For example, the image decoding device 100 can use partition shape pattern information included in sequence parameter sets, picture parameter sets, video parameter sets, strip headers, strip segment headers, parallel block headers, or parallel block group headers. Furthermore, the image decoding device 100 can obtain syntax elements corresponding to the block shape information or partition shape pattern information from the bitstream based on each maximum coding unit or each reference coding unit, and can use the obtained syntax elements.

[0201] The method for determining partitioning rules according to embodiments of the present disclosure will be described in detail below.

[0202] Image decoding device 100 can determine the partitioning rules of an image. The partitioning rules can be predetermined between image decoding device 100 and image encoding device 200. Image decoding device 100 can determine the partitioning rules based on information obtained from the bitstream. Image decoding device 100 can determine the partitioning rules based on information obtained from at least one of sequence parameter set, picture parameter set, video parameter set, strip header, strip segment header, parallel block header, or parallel block group header. Image decoding device 100 can determine different partitioning rules based on frames, stripes, parallel blocks, time layers, maximum coding units, or coding units.

[0203] Image decoding device 100 may determine partitioning rules based on the block shape of the coding unit. The block shape may include the size, shape, aspect ratio, and orientation of the coding unit. Image encoding device 200 and image decoding device 100 may pre-determine partitioning rules based on the block shape information of the coding unit. However, embodiments are not limited thereto. Image decoding device 100 may determine partitioning rules based on information obtained from the bitstream received from image encoding device 200.

[0204] The shape of the encoding unit can be square or non-square. When the width and height of the encoding unit are the same, the image decoding device 100 can determine that the shape of the encoding unit is square. Furthermore, when the width and height of the encoding unit are not the same, the image decoding device 100 can determine that the shape of the encoding unit is non-square.

[0205] The size of the coding unit can include various sizes, such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, and up to 256×256. The size of the coding unit can be classified based on the length of its long side, the length of its short side, or its area. The image decoding device 100 can apply the same classification rules to coding units classified into the same group. For example, the image decoding device 100 can classify coding units with the same long side length as having the same size. Furthermore, the image decoding device 100 can apply the same classification rules to coding units with the same long side length.

[0206] The aspect ratio of the coding unit can include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 1:32, etc. Furthermore, the orientation of the coding unit can include horizontal and vertical directions. A horizontal orientation indicates that the width of the coding unit is longer than its height. A vertical orientation indicates that the width of the coding unit is shorter than its height.

[0207] The image decoding device 100 can adaptively determine the partitioning rules based on the size of the coding unit. The image decoding device 100 can determine the permissible partitioning shape patterns based on different coding unit sizes. For example, the image decoding device 100 can determine whether partitioning is permissible based on the size of the coding unit. The image decoding device 100 can determine the partitioning direction based on the size of the coding unit. The image decoding device 100 can determine the permissible partitioning type based on the size of the coding unit.

[0208] The partitioning rule determined based on the size of the coding unit can be a pre-determined partitioning rule between the image encoding device 200 and the image decoding device 100. Alternatively, the image decoding device 100 can determine the partitioning rule based on information obtained from the bitstream.

[0209] The image decoding device 100 can adaptively determine the partitioning rules based on the position of the coding units in the image.

[0210] Furthermore, the image decoding device 100 can determine partitioning rules such that encoding units generated via different partitioning paths do not have the same block shape. However, the embodiment is not limited to this, and encoding units generated via different partitioning paths may have the same block shape. Encoding units generated via different partitioning paths may have different decoding processing orders. As already referred to above... Figure 12 The decoding process order has been described, so its details are not provided here.

[0211] Figure 16The illustration shows an encoding unit that can be determined for each frame when the combination of shapes into which the encoding unit can be divided is different for each frame, according to an embodiment.

[0212] Reference Figure 16 The image decoding device 100 can determine that the combination of partition shapes that can be used to divide each frame coding unit is different. For example, the image decoding device 100 can decode the image using at least one frame included in the image that can be divided into 4 coding units, a frame 1600 that can be divided into 2 or 4 coding units, and a frame 1620 that can be divided into 2, 3, or 4 coding units. The image decoding device 100 can divide the frame 1600 into multiple coding units using only partition shape information indicating that it is divided into 4 square coding units. The image decoding device 100 can divide the frame 1610 using only partition shape information indicating that it is divided into 2 or 4 coding units. The image decoding device 100 can divide the frame 1620 using only partition shape information indicating that it is divided into 2, 3, or 4 coding units. Since the above-described combination of dividing shapes is merely an embodiment used to describe the operation of the image decoding device 100, the combination of dividing shapes should not be interpreted as limited to the embodiment described, but rather as various combinations of different types of dividing shapes that can be used for each specific data unit.

[0213] According to an embodiment, the bitstream acquirer 110 of the image decoding device 100 can acquire a bitstream including an index, wherein the index indicates a combination of partition shape information for each specific data unit (e.g., sequence, frame, strip, strip segment, parallel block, or parallel block group). For example, the bitstream acquirer 110 can acquire the index indicating the combination of partition shape information from a sequence parameter set, a frame parameter set, a strip header, a parallel block header, or a parallel block group header. The bitstream acquirer 110 of the image decoding device 100 can determine the combination of partition shapes of the coding units into which a specific data unit can be divided by using the acquired index, and therefore, different combinations of partition shapes can be used for each specific data unit.

[0214] Figure 17 Various shapes of coding units, which can be determined based on partition shape pattern information that can be represented as binary code, are shown according to embodiments.

[0215] According to an embodiment, the image decoding device 100 can divide the encoding unit into various shapes using block shape information and partition shape pattern information obtained via the bitstream acquirer 110. The partition shape of the encoding unit can correspond to various shapes including those described in the above embodiments.

[0216] Reference Figure 17The image decoding device 100 can divide square coding units in at least one direction, either horizontal or vertical, based on the division shape pattern information, and can also divide non-square coding units in either horizontal or vertical directions.

[0217] According to an embodiment, when the image decoding device 100 is able to divide a square coding unit into four square coding units in the horizontal and vertical directions, the four division shapes can be indicated by the division shape pattern information for the square coding unit. According to an embodiment, the division shape pattern information can be represented as a 2-bit binary code, and a 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 and vertical directions, 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 of the image decoding device 100, when dividing non-square coding units in the horizontal or vertical direction, the type of division shape indicated by the division shape pattern information can be determined based on the number of times the coding units are divided. (Refer to...) Figure 17 According to an embodiment, the image decoding device 100 may divide a non-square coding unit into at most three coding units. The image decoding device 100 may divide a coding unit into two coding units, and in this case, the division shape pattern information may be represented as (10)b. The image decoding device 100 may divide a coding unit into three coding units, and 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, and in this case, the division shape pattern information may be represented as (0)b. In other words, the image decoding device 100 may use variable-length coding (VLC) instead of fixed-length coding (FLC) in order to use binary codes indicating the division shape pattern information.

[0219] According to the embodiments, refer to Figure 17 The binary code indicating the undivided shape pattern information of the coding unit can be represented as (0)b. When the binary code indicating the undivided shape pattern information of the coding unit is set to (00)b, although there is no shape pattern information set to (01)b, the 2 bits of the binary code of the shape pattern information are used. However, as Figure 17As shown, when the three types of partition shapes are used for non-square coding units, the image decoding device 100 can determine that the coding unit has not been partitioned even by using a one-bit binary code (0)b as partition shape pattern information, and thus can effectively use the bitstream. However, the partition shape of the non-square coding unit indicated by the partition shape pattern information should not be interpreted restrictively as a reference. Figure 17 The three shapes described should be interpreted as including all shapes from the above embodiments.

[0220] Figure 18 Other shapes of coding units, which can be determined based on partition shape pattern information that can be represented as binary code, are shown according to embodiments.

[0221] Reference Figure 18 The image decoding device 100 can divide square coding units in the horizontal or vertical direction based on the division shape pattern information, and divide non-square coding units in the horizontal or vertical direction. In other words, the division shape pattern information can indicate that square coding units are divided in one direction. In this case, the binary code of the division shape pattern information indicating that square coding units are not divided can be represented as (0)b. When the binary code of the division shape pattern information indicating that coding units are not divided is set to (00)b, although there is no division shape pattern information set to (01)b, the 2 bits of the binary code of the division shape pattern information are used. However, as Figure 18 As shown, when the three types of partition shapes are used for square coding units, the image decoding device 100 can determine that the coding unit has not been partitioned even by using a one-bit binary code (0)b as partition shape pattern information, and thus can effectively use the bitstream. However, the partition shape of the square coding unit indicated by the partition shape pattern information should not be interpreted restrictively as a reference. Figure 18 The three shapes described are to be interpreted as including all shapes of the above embodiments.

[0222] According to an embodiment, block shape information or partition shape pattern information can be represented using binary code, and such information can be immediately generated as a bitstream. Alternatively, the block shape information or partition shape pattern information represented in binary code can be used as binary code input during context-adaptive binary arithmetic coding (CABAC) instead of being immediately generated as a bitstream.

[0223] According to an embodiment, the image decoding device 100 will be described as obtaining syntax regarding block shape information or partition shape pattern information via CABAC. A bitstream including the binary code of the syntax can be obtained via a bitstream acquirer 110. The image decoding device 100 can detect syntax elements indicating block shape information or partition shape pattern information by debinarizing the binary bit strings included in the obtained bitstream. According to an embodiment, the image decoding device 100 can obtain a set of binary bit strings corresponding to the syntax element to be decoded, and decode each bit using probability information, and can repeat this operation until the binary bit string including the decoded bit becomes the same as one of the previously obtained binary bit strings. The image decoding device 100 can determine the syntax element by performing debinarization on the binary bit strings.

[0224] According to an embodiment, the image decoding device 100 can determine the syntax for the binary bit string by performing decoding processing of adaptive binary arithmetic encoding, and update the probability model for the binary bits obtained via the bit stream acquirer 110. (Refer to...) Figure 17 According to an embodiment, the bitstream acquirer 110 of the image decoding device 100 can acquire a bitstream indicating binary code representing segmentation shape pattern information. The image decoding device 100 can determine the syntax for the segmentation shape pattern information by using binary code of size 1 bit or 2 bits. The image decoding device 100 can update the probability for each bit in the 2-bit binary code to determine the syntax for the segmentation shape pattern information. In other words, the image decoding device 100 can update the probability of having a value of 0 or 1 when decoding the next bit based on whether the value of the first bit in the 2-bit binary code is 0 or 1.

[0225] According to an embodiment, the image decoding device 100 can update the probability of the binary bits used when decoding the binary bits of the binary bit string for the grammar when determining the grammar, and can determine that specific bits of the binary bit string have the same probability without updating the probability.

[0226] Reference Figure 17When determining the syntax using a binary bit string indicating the partitioning shape pattern information for a non-square coding unit, the image decoding device 100 can determine the syntax for the partitioning shape pattern information by using a binary bit with a value of 0 when the non-square coding unit is not partitioned. In other words, when the block shape information indicates that the current coding unit has a non-square shape, the first binary bit of the binary bit string for the partitioning shape pattern information can be 0 when the non-square coding unit is not partitioned, and can be 1 when the non-square coding unit is partitioned into 2 or 3 coding units. Therefore, the probability that the first binary bit of the binary bit string for the partitioning shape pattern information for a non-square coding unit is 0 is 1 / 3, and the probability that the first binary bit of the binary bit string for the partitioning shape pattern information for a non-square coding unit is 1 is 2 / 3. As described above, since the partitioning shape pattern information indicating that the non-square coding unit is not partitioned only represents a 1-bit binary bit string with a value of 0, the image decoding device 100 can determine the syntax for the partitioning shape pattern information by determining whether the second binary bit is 0 only when the first binary bit of the partitioning shape pattern information is 1. According to an embodiment, when the first binary bit of the shape pattern information is 1, the image decoding device 100 can decode the binary bit if the probability of the second binary bit being 0 or 1 is the same.

[0227] According to an embodiment, the image decoding device 100 may use various probabilities for each binary bit when determining the binary bits of a binary bit string for dividing shape pattern information. According to an embodiment, the image decoding device 100 may determine the probability of the binary bits for dividing shape pattern information differently based on the orientation of non-square blocks. According to an embodiment, the image decoding device 100 may determine the probability of the binary bits for dividing shape pattern information differently based on the area of ​​the current encoding unit or the length of its long side. According to an embodiment, the image decoding device 100 may determine the probability of the binary bits for dividing shape pattern information differently based on at least one of the area of ​​the current encoding unit or the length of its long side.

[0228] According to an embodiment, the image decoding device 100 can determine that the probability of binary bits for dividing shape pattern information is the same for encoding units of a specific size or larger. For example, the probability of binary bits for dividing shape pattern information is determined to be the same for encoding units of 64 samples or larger based on the length of the long side of the encoding unit.

[0229] According to an embodiment, the image decoding device 100 may determine the initial probability of binary bits included in the binary bit string that divides shape pattern information based on the strip type (e.g., I strip, P strip, or B strip).

[0230] Figure 19This is a block diagram of the image encoding and decoding system 1900 that performs loop filtering.

[0231] The encoding end 1910 of the image encoding and decoding system 1900 transmits an encoded bitstream of the image, and the decoding end 1950 outputs a reconstructed image by receiving the bitstream and decoding it. Here, the encoding end 1910 may have a similar configuration to the image encoding device 200 described later, and the decoding end 1950 may have a similar configuration to the image decoding device 100.

[0232] At the encoding end 1910, the predictive encoder 1915 outputs predicted data via inter-frame prediction and intra-frame prediction, and the transformer and quantizer 1920 outputs quantized transform coefficients of the residual data between the predicted data and the current input image. The entropy encoder 1925 transforms the quantized transform coefficients by encoding them and outputs the transformed quantized transform coefficients as a bitstream. The quantized transform coefficients are reconstructed into spatial domain data via the inverse quantizer and inverse transformer 1930, and the spatial domain data 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 predictive encoder 1915.

[0233] The encoded image data in the bitstream received by the decoder 1950 is reconstructed into spatial domain residual data via the entropy decoder 1955, dequantizer, and inverse transformer 1960. When the predicted data and residual data output from the predictor 1975 are combined, the spatial domain image data is configured, and the deblocking filter 1965 and loop filter 1970 can output a reconstructed image about the current original image by filtering the spatial domain image data. The reconstructed image can be used by the predictor 1975 as a reference image for the next original image.

[0234] The loop filter 1940 of the encoder 1910 performs loop filtering by using filter information input according to user input or system settings. The filter information used by the loop filter 1940 is output to the entropy encoder 1925 and sent to the decoder 1950 along with the encoded image data. The loop filter 1970 of the decoder 1950 can perform loop filtering based on the filter information input from the decoder 1950.

[0235] The various embodiments described above describe operations related to the image decoding method performed by the image decoding device 100. Hereinafter, the operations of the image encoding device 200, which performs an image encoding method corresponding to the reverse process of the image decoding method, will be described via various embodiments.

[0236] Figure 2This is a block diagram of an image encoding device 200 according to an embodiment, capable of encoding an image based on at least one of block shape information or partition shape pattern information.

[0237] Image encoding device 200 may include encoder 220 and bitstream generator 210. Encoder 220 may receive and encode an input image. Encoder 220 may obtain at least one syntax element by encoding the input image. The syntax element may include at least one of skip flag, prediction mode, motion vector difference, motion vector prediction method (or index), transform quantization coefficient, coding block style, coding block flag, intra-prediction mode, direct flag, merge flag, differential QP, reference index, prediction direction, or transform index. Encoder 220 may determine a context model based on block shape information including at least one of the shape, orientation, aspect ratio, or size of coding units.

[0238] Bitstream generator 210 can generate a bitstream based on an encoded input image. For example, bitstream generator 210 can generate a bitstream by entropy encoding of syntax elements based on a context model. Furthermore, image encoding device 200 can send the bitstream to image decoding device 100.

[0239] According to an embodiment, the encoder 220 of the image encoding device 200 can determine the shape of the encoding unit. For example, the encoding unit may have a square shape or a non-square shape, and information indicating such a shape may be included in the block shape information.

[0240] According to an embodiment, encoder 220 can determine the shape into which the encoding unit will be divided. Encoder 220 can determine the shape of at least one encoding unit included in the encoding unit, and bitstream generator 210 can generate a bitstream including division shape pattern information, which includes information about such shape of the encoding unit.

[0241] According to an embodiment, encoder 220 can determine whether a coding unit will be divided. When encoder 220 determines that only one coding unit is included in the coding unit or that the coding unit is not divided, bitstream generator 210 can generate a bitstream including division shape pattern information indicating that the coding unit is not divided. Furthermore, encoder 220 can divide the coding unit into multiple coding units, and bitstream generator 210 can generate a bitstream including division shape pattern information indicating that the coding unit is divided into multiple coding units.

[0242] According to an embodiment, information indicating the number of coding units a coding unit will be divided into or the direction in which the coding units are divided can be included in the division shape pattern information. For example, the division shape pattern information may indicate whether the coding unit is divided or not in at least one direction, either vertical or horizontal.

[0243] Image encoding apparatus 200 determines information about the partition shape pattern based on the partitioning shape pattern of the coding unit. Image encoding apparatus 200 may determine a context model based on at least one of the shape, orientation, aspect ratio, or size of the coding unit. Furthermore, image encoding apparatus 200 generates a bitstream including information about the partitioning shape pattern used to partition the coding unit based on the context model.

[0244] Image encoding apparatus 200 can obtain an array for mapping an index for a context model and at least one of the shape, orientation, aspect ratio, or size of the encoding units to determine the context model. Image encoding apparatus 200 can obtain an index for the context model from the array based on at least one of the shape, orientation, aspect ratio, or size of the encoding units. Image encoding apparatus 200 can determine the context model based on the index for the context model.

[0245] The image coding device 200 can also determine a context model based on block shape information including at least one of the shape, orientation, aspect ratio, or size of neighboring coding units adjacent to the coding unit. Here, neighboring coding units may include at least one of the coding units located below, to the left, above, to the left, above, to the right, above, or below the right of the coding unit.

[0246] Furthermore, the image coding device 200 can compare the width of the upper neighboring coding unit with the width of the coding unit to determine the context model. Additionally, the image coding device 200 can compare the height of the left and right neighboring coding units with the height of the coding unit. Furthermore, the image coding device 200 can determine the context model based on the comparison results.

[0247] Because the operation of the image encoding device 200 includes reference Figures 3 to 19 The operation of the image decoding device 100 described herein is similar, so its detailed description will not be provided again.

[0248] Figure 20 This is a block diagram of the configuration of the image decoding device 2000 according to an embodiment.

[0249] Reference Figure 20 The image decoding device 2000 includes a bitstream acquirer 2010, a motion information acquirer 2030, and a prediction decoder 2050.

[0250] Figure 20 The bitstream acquirer 2010 can correspond to Figure 1 The bitstream acquirer 110, and Figure 20 The motion information acquirer 2030 and the prediction decoder 2050 can correspond to Figure 1 Decoder 120.

[0251] The bitstream acquirer 2010, motion information acquirer 2030, and prediction decoder 2050 according to the embodiments may be implemented as at least one processor. The image decoding device 2000 may include at least one memory (not shown) for storing input / output data of the bitstream acquirer 2010, motion information acquirer 2030, and prediction decoder 2050. The image decoding device 2000 may include a memory controller (not shown) for controlling data input and output of the memory.

[0252] Bitstream acquirer 2010 acquires a bitstream generated as a result of encoding an image. Bitstream acquirer 2010 obtains syntax elements from the bitstream for decoding the image. The binary values ​​corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the image. Bitstream acquirer 2010 obtains the syntax elements by entropy encoding the binary values ​​included in the bitstream.

[0253] The bitstream may include information about the prediction mode of the current block in the current frame. The current block may represent the block of the largest coding unit, coding unit, or transform unit divided from the current frame to be encoded or decoded.

[0254] The prediction mode for the current block can include intra-frame prediction mode or inter-frame prediction mode. As mentioned above, inter-frame prediction mode is a mode used to reconstruct the current block from a reference block in a reference frame indicated by the motion information of the current block. Motion information can include prediction direction, reference frame index, and motion vector.

[0255] The prediction direction can be one of list 0, list 1, or bidirectional. When the prediction direction is list 0, the frames included in reference frame list 0 are used as reference frames in the list 0 direction, and when the prediction direction is list 1, the frames included in reference frame list 1 are used as reference frames in the list 1 direction. Furthermore, when the prediction direction is bidirectional, the frames included in reference frame list 0 are used as reference frames in the list 0 direction, and the frames included in reference frame list 1 are used as reference frames in the list 1 direction.

[0256] The reference screen index indicates the screen included in reference screen list 0 and / or reference screen list 1 that serves as the reference screen for the current block. Based on the reference screen index in the direction of list 0, the screen included in reference screen list 0 is specified as the reference screen for the direction of list 0. Furthermore, based on the reference screen index in the direction of list 1, the screen included in reference screen list 1 is specified as the reference screen for the direction of list 1.

[0257] The motion vector specifies the position of the reference block in the reference frame. The motion vector in the direction of list 0 indicates the motion vector of the reference block in the reference frame in the direction of list 0, and the motion vector in the direction of list 1 indicates the motion vector of the reference block in the reference frame in the direction of list 1.

[0258] When the prediction direction of the current block is List 0, the motion information of the current block includes at least one of the following: information indicating that the prediction direction of the current block is List 0, a reference frame index in the List 0 direction, or a motion vector in the List 0 direction. When the prediction direction of the current block is List 1, the motion information of the current block includes at least one of the following: information indicating that the prediction direction of the current block is List 1, a reference frame index in the List 1 direction, or a motion vector in the List 1 direction. When the prediction direction of the current block is bidirectional, the motion information of the current block includes at least one of the following: information indicating that the prediction direction of the current block is bidirectional, a reference frame index in the List 0 direction, a reference frame index in the List 1 direction, a motion vector in the List 0 direction, or a motion vector in the List 1 direction.

[0259] Merge mode (or direct mode), one of the inter-frame prediction modes, uses motion information from previous blocks decoded before the current block as motion information for the current block. The bit rate can be reduced by including only information indicating previous blocks in the bitstream without directly including motion information for the current block.

[0260] Typically, in a candidate list that includes multiple motion information from neighboring blocks, the number of candidates is pre-limited, and the similarity between the motion information from neighboring blocks and the motion information of the current block may not be high. Therefore, even when the best candidate is selected from the candidate list, degradation in the quality of the reconstructed block is inevitable when the motion information of the selected candidate differs from that of the current block.

[0261] According to embodiments of this disclosure, after constructing a candidate list including multiple motion information entries from neighboring blocks as candidates, the motion information of neighboring blocks can be modified according to specific criteria to be used as the motion information of the current block. In other words, according to this disclosure, instead of using the motion information included in the candidate list as is, the motion information in the candidate list can be modified according to specific criteria to reduce the difference between the reconstructed block and the original block.

[0262] When the prediction pattern of the current block is a pattern used to derive the motion information of the current block by using the motion information of neighboring blocks, the bitstream acquirer 2010 obtains change information from the bitstream indicating whether to change the motion information of neighboring blocks. The change information indicates whether the motion information of neighboring blocks needs to be changed, and when a change is needed, the change information indicates how the motion information will be changed.

[0263] According to an embodiment, when information obtained from a higher level of the current block (e.g., the sequence parameter set, picture parameter set, video parameter set, strip header, strip segment header, parallel block header, or parallel block group header of the bitstream) indicates that no change mode is applied, the bitstream acquirer 2010 may not obtain the change information of the current block from the bitstream, and when the information indicates that a change mode is applied, the bitstream acquirer 2010 may obtain the change information of the current block from the bitstream.

[0264] According to an embodiment, even when information obtained from a higher level of the current block indicates the application of a change mode, the bitstream acquirer 2010 may not obtain change information from the bitstream if the size of the current block is equal to or smaller than a preset size. When the size of the current block is small, the degree of quality improvement may be lower compared to the complexity of obtaining the motion information of the current block by changing the motion information of neighboring blocks. The size of the current block can be calculated by multiplying the width and height of the current block or by adding the width and height of the current block.

[0265] When the change information instruction indicates a change in the motion information of neighboring blocks, the motion information acquirer 2030 obtains the motion information of the current block by changing the motion information of neighboring blocks. Conversely, when the change information instruction does not indicate a change in the motion information of neighboring blocks, the motion information acquirer 2030 can obtain the motion information of the current block without changing the motion information of neighboring blocks. As described below, even when the change information instruction changes, the motion information of neighboring blocks, particularly at least one of the prediction direction, reference frame, or motion information, can be kept unchanged. Furthermore, even when the change information instruction does not change, the motion information of neighboring blocks, particularly the motion vector, can be changed based on the differential motion vector obtained from the bitstream.

[0266] Before describing the methods for changing the motion information of neighboring blocks, we will describe the neighboring blocks that are spatially or temporally related to the current block.

[0267] Figure 21 This is an exemplary diagram showing the locations of neighboring blocks that are related to the current block 2100 in time or space.

[0268] Reference Figure 21 The neighboring blocks of the current block 2100 may include spatial blocks that are spatially related to the current block 2100 and temporal blocks that are temporally related to the current block 2100.

[0269] A space block may include at least one of the following: bottom left corner block A0, bottom left corner block A1, top right corner block B0, top right corner block B1, or top left corner block B2. For example... Figure 21 As shown, the lower left block A1 can be located above the lower left block A0, and the upper right block B1 can be located to the left of the upper right block B0.

[0270] A time block may include at least one of the following: a block Co1 located at the same point as the current block 2100 in a co-frame having a different frame sequence count (POC) than the current frame that includes the current block 2100; and a block Br spatially adjacent to the block Co1 located at the same point. Block Br may be located to the lower right of block Co1 located at the same point as the current block 2100. Block Co1 located at the same point as the current block 2100 may be a block comprising the pixel in the co-frame that corresponds to the center pixel in the current block 2100.

[0271] Figure 22 The positions of the time blocks and space blocks in the example are merely illustrative, and the positions and number of time blocks and space blocks may vary depending on the implementation.

[0272] The motion information acquirer 2030 can determine the availability of neighboring blocks in a specific order, and sequentially include the motion information of neighboring blocks into a candidate list based on the determination results. The motion information acquirer 2030 can determine that neighboring blocks predicted intra-frame are not available.

[0273] When the prediction pattern of the current block is a pattern used to derive the motion information of the current block by using the motion information of neighboring blocks, the motion information acquirer 2030 can obtain the motion information of a neighboring block from the candidate list and determine whether to change the motion information of the neighboring block and how to change the motion information based on the change information.

[0274] When a change information is indicated, the motion information of neighboring blocks can be modified differently depending on the type of the parent block (e.g., frame, parallel block, stripe, or maximum coding unit) including the current block. For example, when the parent block is a block that can use both reference frame list 0 and reference frame list 1 (e.g., dual-prediction B stripe), the change information can indicate in which direction the prediction direction of the neighboring block will be changed. As another example, when the parent block is a block that can only use reference frame list 0 (e.g., prediction P stripe), the prediction direction of the current block, which is different from the prediction direction of the neighboring blocks, cannot be selected, and therefore the change information can indicate how the reference frames and / or motion vectors of the neighboring blocks can be modified.

[0275] The following section describes a method for obtaining motion information of the current block based on change information when the parent block is a block that can use both reference screen list 0 and reference screen list 1.

[0276] I. When the parent block is a block that can use both reference screen list 0 and reference screen list 1

[0277] Figure 22 This is an exemplary table showing in which direction the predicted direction of a neighboring block is changed according to the value indicated by the change information when the parent block is a block that can use both reference screen list 0 and reference screen list 1.

[0278] Reference Figure 22 When the change information `mmvd_group_idx` has a value of 0, the motion information of neighboring blocks is not changed. In other words, the prediction direction and reference frame of neighboring blocks are determined as the prediction direction and reference frame of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector described below to the motion vector of neighboring blocks. Even when the change information `mmvd_group_idx` is not included in the bitstream, the motion information of neighboring blocks is not changed. In other words, the prediction direction and reference frame of neighboring blocks are determined as the prediction direction and reference frame of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector to the motion vector of neighboring blocks.

[0279] When the information mmvd_group_idx has a value of 1 or 2, the motion information of the neighboring blocks is changed.

[0280] Specifically, when the prediction direction of a neighboring block is the list 0 direction and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block can be determined to be bidirectional, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block can be determined to be the list 1 direction.

[0281] Furthermore, when the prediction direction of a neighboring block is the List 1 direction and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block can be determined to be bidirectional, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block can be determined to be the List 0 direction.

[0282] Furthermore, when the prediction direction of neighboring blocks is bidirectional and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block can be determined as the list 0 direction, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block can be determined as the list 1 direction.

[0283] Different determinations can be made based on Figure 22The change in the value of mmvd_group_idx indicates the change in the prediction direction of the neighboring blocks.

[0284] The following section describes a method for selecting the reference image for the current block when the prediction direction of neighboring blocks is changed.

[0285] 1. When the prediction direction of neighboring blocks is bidirectional and the prediction direction of the current block is unidirectional.

[0286] When the prediction direction of neighboring blocks is bidirectional and the prediction direction of the current block is list 0, the reference image of the neighboring blocks in the list 0 direction is selected as the reference image of the current block. The reference image of the neighboring blocks in the list 1 direction is not used for the current block.

[0287] When the prediction direction of neighboring blocks is bidirectional and the prediction direction of the current block is in list 1 direction, the reference image of the neighboring blocks in list 1 direction is selected as the reference image of the current block. The reference image of the neighboring blocks in list 0 direction is not used for the current block.

[0288] 2. When the prediction direction of the neighboring block is the direction of list 0 and the prediction direction of the current block is the direction of list 1.

[0289] Based on the distance between the current frame and the reference frame of the neighboring block in the direction of list 0, one frame included in reference frame list 1 is selected as the reference frame of the current block in the direction of list 1. Here, the distance between frames can be the difference of the POC between two frames. POC is an inherent value of the frame that indicates the output order of each frame.

[0290] According to an embodiment, the motion information acquirer 2030 can select a frame from the reference frame list 1 that is spaced apart from the current frame by the distance between the current frame and the reference frames of the neighboring blocks in the list 0 direction as the reference frame of the current block in the list 1 direction. When the distance between the current frame and the reference frames of the neighboring blocks in the list 0 direction is the same as the distance between the current frame and the reference frames of the current block in the list 1 direction, the scaling process of the motion vector, which will be described later, can be omitted.

[0291] Reference Figure 23 When the POC of the current frame is 5 and the POC of the reference frame of the neighboring block in the direction of list 0 is 3, the frame with POC 7 among the frames included in the reference frame list 1 can be selected as the reference frame of the current block in the direction of list 1. When the frame that is separated from the current frame by the distance between the current frame and the reference frame of the neighboring block in the direction of list 0 is not included in the reference frame list 1, the motion information acquirer 2030 can select the frame with the minimum index (e.g., 0) among the frames in the reference frame list 1 as the reference frame of the current block in the direction of list 1.

[0292] According to another embodiment, when the number of frames included in reference frame list 1 is greater than 1, and the distance between the current frame and the reference frame of the neighboring block in the direction of list 0 is the same as the distance between the current frame and the frame with index 1 in reference frame list 1, the motion information acquirer 2030 may select the frame with index 1 in reference frame list 1 as the reference frame of the current block in the direction of list 1. When the number of frames included in reference frame list 1 is not greater than 1, the motion information acquirer 2030 may select the frame with index 0 in reference frame list 1 as the reference frame of the current block in the direction of list 1. When the number of frames included in reference frame list 1 is greater than 1, but the distance between the current frame and the reference frame of the neighboring block in the direction of list 0 is different from the distance between the current frame and the frame with index 1 in reference frame list 1, the motion information acquirer 2030 may select the frame with index 0 in reference frame list 1 as the reference frame of the current block in the direction of list 1. In this case, it is not necessary to identify all POCs of the frames included in reference frame list 1, and thus the process of selecting reference frames can be simplified.

[0293] 3. When the prediction direction of the neighboring block is the List 1 direction and the prediction direction of the current block is the List 0 direction.

[0294] Based on the distance between the current frame and the reference frames of neighboring blocks in the direction of list 1, one of the frames included in reference frame list 0 is selected as the reference frame of the current block in the direction of list 0.

[0295] According to an embodiment, the motion information acquirer 2030 can select a frame from the reference frame list 0 that is spaced apart from the current frame by the distance between the current frame and the reference frames of the neighboring blocks in the direction of list 1 as the reference frame of the current block in the direction of list 0.

[0296] Reference Figure 23 When the POC of the current frame is 5 and the POC of the reference frame of the neighboring block in the direction of list 1 is 7, the frame with POC 3 among the frames included in reference frame list 0 can be selected as the reference frame of the current block in the direction of list 0. When the frame that is separated from the current frame by the distance between the current frame and the reference frame of the neighboring block in the direction of list 1 is not included in reference frame list 0, the motion information acquirer 2030 can select the frame with the minimum index (e.g., 0) among the frames in reference frame list 0 as the reference frame of the current block in the direction of list 0.

[0297] According to another embodiment, when the number of frames included in reference frame list 0 is greater than 1, and the distance between the current frame and the reference frame of the neighboring block in the direction of list 1 is the same as the distance between the current frame and the frame with index 1 in reference frame list 0, the motion information acquirer 2030 may select the frame with index 1 in reference frame list 0 as the reference frame of the current block in the direction of list 0. When the number of frames included in reference frame list 0 is not greater than 1, the motion information acquirer 2030 may select the frame with index 0 in reference frame list 0 as the reference frame of the current block in the direction of list 0. When the number of frames included in reference frame list 0 is greater than 1, but the distance between the current frame and the reference frame of the neighboring block in the direction of list 1 is not the same as the distance between the current frame and the frame with index 1 in reference frame list 0, the motion information acquirer 2030 may select the frame with index 0 in reference frame list 0 as the reference frame of the current block in the direction of list 0. In this case, it is not necessary to identify all POCs of the frames included in reference frame list 0, and thus the process of selecting reference frames can be simplified.

[0298] 4. When the prediction direction of neighboring blocks is the direction of list 0 and the prediction direction of the current block is bidirectional.

[0299] The reference frame of the neighboring block in the direction of list 0 is selected as the reference frame of the current block in the direction of list 0. Then, based on the distance between the current frame and the reference frames of the neighboring blocks in the direction of list 0, one frame included in reference frame list 1 is selected as the reference frame of the current block in the direction of list 1. Since the method of selecting one frame included in reference frame list 1 as the reference frame of the current block in the direction of list 1 based on the distance between the current frame and the reference frames of the neighboring blocks in the direction of list 0 has already been described with reference to "2. When the prediction direction of the neighboring block is the direction of list 0 and the prediction direction of the current block is the direction of list 1", its detailed description is omitted.

[0300] 5. When the prediction direction of neighboring blocks is the direction of List 1 and the prediction direction of the current block is bidirectional.

[0301] The reference frame of the neighboring block in the List 1 direction is selected as the reference frame of the current block in the List 1 direction. Then, based on the distance between the current frame and the reference frames of the neighboring blocks in the List 1 direction, one frame included in reference frame list 0 is selected as the reference frame of the current block in the List 0 direction. Since the method of selecting one frame included in reference frame list 0 as the reference frame of the current block in the List 0 direction based on the distance between the current frame and the reference frames of the neighboring blocks in the List 1 direction has already been described with reference to "3. When the prediction direction of the neighboring block is the List 1 direction and the prediction direction of the current block is the List 0 direction", its detailed description is omitted.

[0302] When the reference frame of the current block is the same as that of a neighboring block, the motion vector of the current block can be obtained by applying the differential motion vector to the motion vector of the neighboring block. Specifically, when the change information is not included in the bitstream or the change information indication does not change, the motion vector of the current block can be obtained by applying the differential motion vector to the motion vector of the neighboring block. When the prediction direction of the neighboring block is bidirectional and the prediction direction of the current block is either list 0 or list 1, the motion vector of the current block in either list 0 or list 1 can be obtained by applying the differential motion vector to the motion vector of the neighboring block in either list 0 or list 1.

[0303] When the reference frame of the current block is different from that of the neighboring blocks, the motion vector of the current block can be obtained by scaling the motion vector of the neighboring blocks and applying the difference motion vector to the scaled motion vector.

[0304] The following section will describe the process of scaling the motion vectors of neighboring blocks.

[0305] The motion information acquirer 2030 can scale the motion vector of a neighboring block by multiplying the ratio of the distance between the reference frame of a neighboring block and the current frame to the distance between the reference frame of the current block and the current frame by the motion vector of the neighboring block. The motion vector of the current block can be obtained by applying the differential motion vector to the scaled motion vector.

[0306] The motion information acquisition device 2030 can, according to, refer to Figure 24 and Figure 25 The sign of the scaled motion vector is changed by describing the positional relationship between the reference frame of the neighboring block, the current frame, and the reference frame of the current block.

[0307] Figure 24 and Figure 25 It is a diagram showing the positional relationship between the reference screens 2430 and 2530 of the adjacent blocks, the current screens 2410 and 2510, and the reference screens 2450 and 2550 of the current block.

[0308] exist Figure 24 and Figure 25 In this context, the distance between the current frames 2410 and 2510 and the reference frames 2430 and 2530 of the neighboring blocks will be referred to as d1, and the distance between the current frames 2410 and 2510 and the reference frames 2450 and 2550 of the current block will be referred to as d2. The distance between frames can represent the difference in the POC values ​​of the two frames.

[0309] Reference Figure 24 The current frame 2410 has POC B, and the reference frame 2430 of the neighboring block and the reference frame 2450 of the current block have POC A and POC C, respectively. When POC B has a value between POC A and POC C, the motion vector of the neighboring block is scaled according to the ratio of d1 to d2, and its sign is reversed. In other words, as... Figure 24 As shown, when the current frame 2410 is located between the reference frame 2450 of the current block and the reference frame 2430 of the neighboring block, the sign of the scaled motion vector of the neighboring block is reversed. When the values ​​of d1 and d2 are the same, only the sign of the motion vector of the neighboring block is reversed.

[0310] Next, refer to Figure 25 The current frame 2510 has POC A, and the reference frame 2530 of the neighboring block and the reference frame 2550 of the current block have POC B and POC C, respectively. When POC A is less than or greater than POC B and POC C, the motion vector of the neighboring block is scaled according to the ratio of d1 to d2 while preserving its sign. In other words, as... Figure 25 As shown, when the reference frame 2550 of the current block and the reference frame 2530 of the neighboring block are different from each other, the current frame 2510 is either before or after the reference frame 2550 of the current block and the reference frame 2530 of the neighboring block in terms of POC, and the sign of the scaled motion vector of the neighboring block is maintained.

[0311] The motion information acquirer 2030 can obtain motion information of the current block by applying the differential motion vector to the motion vector of the neighboring block or a scaled motion vector of the neighboring block.

[0312] According to an embodiment, a differential motion vector can be calculated based on the change distance information and change direction information obtained from the bit stream. The bit stream acquirer 2010 can obtain the change distance information and change direction information from the bit stream, and the motion information acquirer 2030 can apply the differential motion vector calculated based on the change distance information and change direction information to the motion vector of a neighboring block or a scaled motion vector of a neighboring block.

[0313] The change distance information can indicate the distance of the differential motion vector from the origin. Optionally, the change distance information can indicate the magnitude of the differential motion vector. Here, the change distance can be a distance in sub-pixel units, and for example, when the reference image is interpolated to sub-pixels with 1 / 4 pixel units and the change distance information indicates a change distance of 2, the differential motion vector can have a size of 2 / 4 pixel units.

[0314] The direction of change information can indicate in which direction the differential motion vectors are spaced based on the origin. Optionally, the direction of change information can indicate the sign of the differential motion vectors.

[0315] Figure 26 It is a diagram showing the differential motion vectors displayed on the coordinate plane.

[0316] Based on the origin, the differential motion vector can have various values ​​depending on the changing distance and direction. For example, when the changing distance is 1 and the changing direction is the +x-axis direction, the differential motion vector can be (1,0), and when the changing distance is 1 and the changing direction is the -x-axis direction, the differential motion vector can be (-1,0). Furthermore, when the changing distance is 2 and the changing direction is the +y-axis direction, the differential motion vector can be (0,2), and when the changing distance is 2 and the changing direction is the -y-axis direction, the differential motion vector can be (0,-2).

[0317] Figure 27 This is an exemplary table showing the change distance corresponding to the values ​​of the change distance information, and Figure 28 This is an example table showing the direction of change corresponding to the values ​​of the direction of change information.

[0318] Reference Figure 27 In response to an increase in the value indicated by the distance information mmvd_distance_idx, the distance can increase on a logarithmic scale. In other words, when the value indicated by the distance information mmvd_distance_idx is n, the distance can be 2n. n .

[0319] Reference Figure 28The sign of the differential motion vector is determined based on the value indicated by the direction change information `mmvd_direction_idx`. When the value indicated by `mmvd_direction_idx` is 0, the differential motion vector may have a + sign in the x-axis direction, and when the value indicated by `mmvd_direction_idx` is 1, the differential motion vector may have a - sign in the x-axis direction. Furthermore, when the value indicated by `mmvd_direction_idx` is 2, the differential motion vector may have a + sign in the y-axis direction, and when the value indicated by `mmvd_direction_idx` is 3, the differential motion vector may have a - sign in the y-axis direction.

[0320] According to the embodiments, the determination based on the method can be different. Figure 27 The change distance information indicates the change distance of the value and according to the change distance information. Figure 28 The direction of change information indicates the direction of change of the value.

[0321] According to an embodiment, when the prediction direction of the current block is bidirectional, the differential motion vector derived from the change distance information and change direction information can be scaled and applied to the motion vectors in the list 0 direction and the list 1 direction. Specifically, when the distance between the current frame and the reference frame of the current block in the list 0 direction is greater than the distance between the current frame and the reference frame of the current block in the list 1 direction, the differential motion vector can be scaled and applied to the motion vector in the list 0 direction, and the unscaled differential motion vector can be applied to the motion vector in the list 1 direction. On the other hand, when the distance between the current frame and the reference frame of the current block in the list 1 direction is greater than the distance between the current frame and the reference frame of the current block in the list 0 direction, the differential motion vector can be scaled and applied to the motion vector in the list 1 direction, and the unscaled differential motion vector can be applied to the motion vector in the list 0 direction.

[0322] The differential motion vector can be scaled based on the ratio of the distance between the current frame and the reference frame in the list 0 direction to the distance between the current frame and the reference frame in the list 1 direction. For example, when the distance between the current frame and the reference frame in the list 0 direction is d0 and the distance between the current frame and the reference frame in the list 1 direction is d1, d0 / d1 can be multiplied by the differential motion vector. When the POC of the current frame has a value between the POC of the reference frame in the list 0 direction and the POC of the reference frame in the list 1 direction, the sign of the scaled differential motion vector can be reversed.

[0323] When the distance d0 between the current screen and the reference screen in the list 0 direction is the same as the distance d1 between the current screen and the reference screen in the list 1 direction, and the POC of the current screen has the value between the POC of the reference screen in the list 0 direction and the POC of the reference screen in the list 1 direction, the differential motion vector derived from the change distance information and the change direction information can be applied to the motion vector in the list 0 direction, and the differential motion vector with the sign reversed can be applied to the motion vector in the list 1 direction.

[0324] According to an embodiment, the scaling of the differential motion vector can be expressed as Equation 1 below.

[0325] [Equation 1]

[0326] mMvdL=Clip3(-32767,32767,((distScaleFactor*mMvdL+16)>>5))

[0327] In Equation 1, distScaleFactor represents the ratio of the distance between the current screen and the reference screen in the direction of list 0 to the distance between the current screen and the reference screen in the direction of list 1, and can be calculated according to Equation 2 below.

[0328] [Equation 2]

[0329] distScaleFactor=(Abs(currPocDiffL1)<<5) / Abs(currPocDiffL0)

[0330] In Equation 2, currPocDiffL1 represents the POC difference between the current frame and the reference frame in the direction of list 1, and currPocDiffL0 represents the POC difference between the current frame and the reference frame in the direction of list 0.

[0331] In Equation 1, the upper and lower limits of the clipping operation are set to 32767 and -32767, respectively, where 32767 is the highest possible number that can be represented by a 15-bit digital portion and a 1-bit sign portion. Here, the actual lower limit that can be represented by a 15-bit digital portion and a 1-bit sign portion should be -32768. However, when the differential motion vector is determined to be -32768 (i.e., the lower limit) via the clipping operation and the current frame's POC has a value between the POC of the reference frame in the list 0 direction and the POC of the reference frame in the list 1 direction, the sign of -32768 needs to be reversed, and in this case, 32767, which is the upper limit that can be represented by a 15-bit digital portion and a 1-bit sign portion, is exceeded. Therefore, in Equation 1, the lower limit of the clipping operation is set to -32767. According to an embodiment, the lower limit of the clipping operation in Equation 1 can be set to -32768.

[0332] The following section describes a method for obtaining motion information for the current block by considering changes in information when the type of the current block's parent block is only required to use reference screen list 0.

[0333] II. When the parent block is a block that can use reference screen list 0

[0334] When the parent block is a block that can use only reference picture list 0 (e.g., predicting P stripes), the prediction direction of the current block is determined to be the list 0 direction. If the reference... Figure 29 The description explains how changing the information indicates how the reference frame for the current screen will be determined.

[0335] Figure 29 This is a table describing the method for selecting the reference frame ref_idx of the current block based on the number of frames included in the reference frame list and the value indicated by the change information mmvd_group_idx.

[0336] Reference Figure 29 When the information mmvd_group_idx is changed to 0, that is, when the information mmvd_group_idx indicates that the motion information of neighboring blocks should not be changed, the reference frame ref_idx_curr of the neighboring blocks is selected as the reference frame ref_idx of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector to the motion vector of the neighboring blocks.

[0337] When the information mmvd_group_idx is changed to 1 or 2, that is, when the information mmvd_group_idx indicates that the motion information of the neighboring block is changed, the reference frame ref_idex of the current block is adaptively selected according to the number of frames included in the reference frame list 0.

[0338] Specifically, when the information `mmvd_group_idx` is changed to 1 and the number of frames included in reference frame list 0 (active reference number) is 1, the reference frame `ref_idx` of the current block is selected to be the same as the reference frame `ref_idx_curr` of the neighboring block. When the number of frames included in reference frame list 0 (active reference number) is not 1 (e.g., 2 or 3), the reference frame `ref_idx` of the current block is selected to be different from the reference frame `ref_idx_curr` of the neighboring block. For example, when the number of frames included in reference frame list 0 (active reference number) is 2 and one of the two frames is the reference frame `ref_idx_curr` of the neighboring block, the other frame can be selected as the reference frame `ref_idx` of the current block.

[0339] When the information `mmvd_group_idx` is changed to 2 and the number of frames included in reference frame list 0 (active reference count) is less than 3 (e.g., 2), the reference frame `ref_idx` of the current block is selected to be the same as the reference frame `ref_idx_curr` of the neighboring block. Because when the information `mmvd_group_idx` is changed to 1 and the number of frames included in reference frame list 0 (active reference count) is 2, the reference frame `ref_idx` of the current block is selected to be different from the reference frame `ref_idx_curr` of the neighboring block, therefore, when the information `mmvd_group_idx` is changed to 2, the reference frame `ref_idx` of the current block is selected to be the same as the reference frame `ref_idx_curr` of the neighboring block.

[0340] When the information `mmvd_group_idx` is changed to 2, the number of frames included in reference frame list 0 (active reference count) is 3 or greater, and the index of the reference frame `ref_idx_curr` of a neighboring block is less than 2, the reference frame `ref_idx` of the current block is selected as the frame with index 2 among the frames included in reference frame list 0. In other words, the reference frame `ref_idx` of the current block is selected as different from the reference frame `ref_idx_curr` of a neighboring block.

[0341] When the information `mmvd_group_idx` is changed to 2, the number of frames included in reference frame list 0 (active reference count) is 3 or more, and the index of the reference frame `ref_idx_curr` of a neighboring block is 2 or greater, the reference frame `ref_idx` of the current block is selected as the frame with index 1 among the frames included in reference frame list 0. In other words, when the index of the reference frame `ref_idx_curr` of a neighboring block is 2, 3, 4, etc., the reference frame `ref_idx` of the current block can be selected as the frame with index 1.

[0342] In other words, when the change information indicates a change and the reference screen list 0 includes a screen that is different from the reference screen of a neighboring block, the reference screen of the current block is first selected as different from the reference screen of a neighboring block. However, when the reference screen list 0 does not include a screen that is different from the reference screen of a neighboring block, the reference screen of the current block can be selected as the same as the reference screen of a neighboring block.

[0343] When the change information indicates a change and the reference frame of the current block selected based on the change information differs from the reference frames of neighboring blocks, the motion vectors of the neighboring blocks are scaled, and the differential motion vector is applied to the scaled motion vector to obtain the motion vector of the current block. Since the method for scaling the motion vectors of neighboring blocks by considering the ratio of the distance between the current frame and the reference frame of the current block to the distance between the current frame and the reference frames of neighboring blocks when the reference frames of the current block differ have already been described above, its detailed description is omitted.

[0344] When the change information indicates a change and the reference screen of the current block selected based on the change information is the same as the reference screen of the neighboring block, the motion information acquirer 2030 can apply an offset to the motion vector of the neighboring block to distinguish the case where the change information indicates no change, and apply the differential motion vector to the motion vector to which the offset has been applied.

[0345] Reference Figure 30 This describes a method to change the motion vector of a neighboring block by applying an offset to the motion vector of the neighboring block when a change information indicates a change and the reference frame of the current block is the same as that of a neighboring block.

[0346] Figure 30 This is a diagram illustrating a method for changing the motion vector mv of a neighboring block when the reference frame of a neighboring block is the same as the reference frame of the current block.

[0347] According to an embodiment, the motion information acquirer 2030 can change the motion vector mv of a neighboring block by adding at least one preset offset to either the x-component or the y-component of the motion vector mv of the neighboring block. The offset can be a predetermined real number.

[0348] According to an embodiment, the offset can be an odd number, for example, 3. It has been described above that the variation distance can increase logarithmically as the value indicated by the variation distance information increases, and in this case, the variation distance has a value of 2. n When the offset is set to an odd number, the result of adding the differential motion vector to the motion vector of a neighboring block without an offset will necessarily be different from the result of adding the differential motion vector to the motion vector of a neighboring block with an offset. In other words, the candidates for the motion vector of the current block can differ by applying an odd offset.

[0349] like Figure 30 As shown, the motion information acquirer 2030 can apply an offset of +3 or -3 to the x-component of the motion vector mv of a neighboring block. When an offset of +3 or -3 is applied to the x-component of the motion vector mv of a neighboring block, the motion vector mv of the neighboring block is shifted by 3 / 4 pixel units when the reference frame is interpolated to 1 / 4 pixel unit. According to an embodiment, the motion information acquirer 2030 can apply an offset of +3 or -3 to the y-component of the motion vector mv of a neighboring block, or apply an offset of +3 or -3 to both the x-component and y-component of the motion vector mv of a neighboring block.

[0350] When the number of frames included in the reference frame list 0 is 1 and the change information has a value of 1, the motion information acquirer 2030 can add +3 to the x component of the motion vector mv of the neighboring block, and when the change information has a value of 2, it can add -3 to the x component of the motion vector mv of the neighboring block.

[0351] Furthermore, since the reference frame for the current block is selected differently from the reference frame for neighboring blocks when the number of frames included in the reference frame list 0 is 2 and the change information has a value of 1, the motion information acquirer 2030 can scale the motion vector mv of neighboring blocks. When the change information has a value of 2, the motion information acquirer 2030 can add +3 to the x-component of the motion vector mv of neighboring blocks.

[0352] Furthermore, since the reference frame of the current block is different from the reference frame of the neighboring block when the number of frames included in the reference frame list 0 is 3 or more and the change information has a value of 1 or 2, the motion information acquirer 2030 can scale the motion vector mv of the neighboring block.

[0353] The motion information acquirer 2030 can obtain the motion vector of the current block by scaling the motion vector mv of the neighboring blocks or applying a differential motion vector after applying an offset to the motion vector mv of the neighboring blocks, based on the number of frames included in the reference frame list 0 or the value indicated by the change information.

[0354] When the motion information of the current block is obtained, the prediction decoder 2050 performs inter-frame prediction of the current block based on the motion information of the current block. The prediction decoder 2050 can select the frame indicated by the reference frame index from the frames included in the reference frame list corresponding to the prediction direction of the current block as the reference frame of the current block, and obtain the prediction block of the current block from the reference block indicated by the motion vector in the reference frame of the current block.

[0355] The predicted block of the current block can be determined as the reconstructed block of the current block, and when the bit stream includes residual data according to the embodiment, the reconstructed block of the current block can be obtained when the residual data is applied to the predicted block.

[0356] As described above, even when information obtained from a higher level of the current block indicates the application of a change mode, the bitstream acquirer 2010 may not obtain change information from the bitstream if the size of the current block is equal to or smaller than a preset size. In this case, to prevent bidirectional prediction in small blocks, when the prediction direction of neighboring blocks is bidirectional, the motion information acquirer 2030 can determine the prediction direction of the current block as either the list 0 direction or the list 1 direction. Therefore, the motion information acquirer 2030 can determine the reference frame of the neighboring block in the list 0 direction or the reference frame of the neighboring block in the list 1 direction as the reference frame of the current block, and obtain the motion vector of the current block by applying the differential motion vector to the motion vector mv of the neighboring blocks. In other words, according to the embodiment, when the size of the current block is small, the current block can be predicted unidirectionally even when the prediction direction of neighboring blocks is bidirectional.

[0357] Figure 31 This is a flowchart of a method for decoding motion information according to an embodiment.

[0358] In operation S3110, the image decoding device 2000 obtains change information from the bitstream that indicates changes in motion information of neighboring blocks related to the current block in time or space.

[0359] According to an embodiment, when information obtained from a higher level of the current block (e.g., the sequence parameter set, picture parameter set, video parameter set, strip header, strip segment header, parallel block header, or parallel block group header of the bitstream) indicates that no change mode is applied, the image decoding device 2000 may not obtain the change information of the current block from the bitstream, and when the information indicates that a change mode is applied, the image decoding device 2000 may obtain the change information of the current block from the bitstream.

[0360] According to an embodiment, even when information obtained from a higher level of the current block indicates the application of a change mode, the image decoding device 2000 may not obtain change information from the bitstream when the size of the current block is equal to or smaller than a preset size. In this case, when the prediction direction of neighboring blocks is bidirectional, the image decoding device 2000 can determine the prediction direction of the current block as either the list 0 direction or the list 1 direction. Then, the image decoding device 2000 can determine the reference frame of the neighboring block in the list 0 direction or the reference frame of the neighboring block in the list 1 direction as the reference frame of the current block, and obtain the motion vector of the current block by applying the differential motion vector to the motion vector of the neighboring blocks.

[0361] In operation S3120, when the change information indicates a change in motion information and the parent block of the current block can use one reference screen list, that is, when the parent block of the current block cannot use two reference screen lists, the image decoding device 2000 identifies the number of screens included in the reference screen list.

[0362] According to an embodiment, when the change information indicates a change in motion information and the parent block of the current block can use two reference frame lists, the image decoding device 2000 changes the prediction direction of neighboring blocks based on the change information. The changed prediction direction of the neighboring blocks can be selected as the prediction direction of the current block. In other words, the prediction direction of the current block can be determined based on the change information.

[0363] During operation S3130, the image decoding device 2000 can obtain the motion information of the current block from the motion information of neighboring blocks based on the number of frames in the reference frame list.

[0364] Specifically, the image decoding device 2000 selects a reference frame for the current block, either a reference frame of a neighboring block or a frame different from the reference frames of neighboring blocks, based on the number of frames in the reference frame list. Then, when a reference frame of a neighboring block is selected as the reference frame for the current block, the image decoding device 2000 obtains the motion vector of the current block by applying an offset to at least one of the x-component or y-component of the motion vector of the neighboring block. Alternatively, the image decoding device 2000 can obtain the motion vector of the current block by applying a differential motion vector to the motion vector to which the offset has been applied.

[0365] When the number of frames in the reference frame list is 1, the image decoding device 2000 can select a reference frame from a neighboring block as the reference frame for the current block. When the change information indicates a first type of change (e.g., when the change information has a value of 1), the image decoding device 2000 can apply a positive offset to the motion vector of the neighboring block. When the change information indicates a second type of change (e.g., when the change information has a value of 2), the image decoding device 2000 can apply a negative offset to the motion vector of the neighboring block.

[0366] When the number of frames in the reference frame list is two and the change information indicates a first type of change, the image decoding device 2000 can determine that the reference frame of the current block is different from the reference frame of the neighboring block, and scale the motion vector of the neighboring block. When the number of frames in the reference frame list is two and the change information indicates a second type of change, the image decoding device 2000 can determine that the reference frame of the current block is the same as the reference frame of the neighboring block, and apply an offset to at least one of the x-component or y-component of the motion vector of the neighboring block.

[0367] When the number of frames in the reference frame list is three or more and the change information indicates a first type of change or a second type of change, the image decoding device 2000 can determine that the reference frame of the current block is different from the reference frames of neighboring blocks and scale the motion vectors of the neighboring blocks. Here, the reference frame of the current block can be selected differently depending on when the change information indicates a first type of change and when the change information indicates a second type of change.

[0368] When the change information indicates a change in motion information and the parent block of the current block can use two lists of reference frames, the image decoding device 2000 can select the reference frame of the current block by considering the predicted direction of the current block, and scale the motion vector of the neighboring block according to the ratio of the distance between the current frame and the reference frame of the current block to the distance between the current frame and the reference frame of the neighboring block.

[0369] The image decoding device 2000 can obtain the motion vector of the current block by applying the differential motion vector to the motion vector of the neighboring block, the scaled motion vector of the neighboring block, or the motion vector of the neighboring block with an offset applied.

[0370] In operation S3140, the image decoding device 2000 reconstructs the current block by using the motion information of the current block.

[0371] The image decoding device 2000 can select the reference frame indicated by the reference frame index from the reference frame list included in the prediction direction corresponding to the current block as the reference frame for the current block, and obtain the prediction block of the current block from the reference frame indicated by the motion vector.

[0372] According to an embodiment, the predicted block of the current block can be determined as the reconstructed block of the current block, and when the bit stream includes residual data according to the embodiment, the reconstructed block of the current block can be obtained when the residual data is applied to the predicted block.

[0373] Figure 32 This is a block diagram of the configuration of the image encoding device 3200 according to an embodiment.

[0374] Reference Figure 32 The image encoding device 3200 includes a predictive encoder 3210 and a bitstream generator 3230. The predictive encoder 3210 can correspond to... Figure 2 The encoder 220, and the bitstream generator 3230 can correspond to Figure 2 Bitstream generator 210.

[0375] The predictive encoder 3210 and bitstream generator 3230 according to the embodiments may be implemented as at least one processor. The image encoding device 3200 may include at least one memory (not shown) for storing input and output data of the predictive encoder 3210 and bitstream generator 3230. In addition, the image encoding device 3200 may include a memory controller (not shown) for controlling the data input and output of the memory.

[0376] The predictive encoder 3210 encodes the image according to the prediction pattern, and the bitstream generator 3230 generates a bitstream that includes information generated as a result of encoding the image.

[0377] The predictive encoder 3210 can determine the prediction mode of the current block in the current image. When the prediction mode of the current block is determined to be an inter-frame prediction mode, the bitstream generator 3230 includes information indicating the motion information of the current block into the bitstream.

[0378] When the prediction pattern of the current block is a pattern used to derive the motion information of the current block from the motion information of neighboring blocks, the predictive encoder 3210 constructs a candidate list including multiple motion information of neighboring blocks that are temporally or spatially related to the current block. The predictive encoder 3210 can derive the motion information of the current block by selecting one motion information from the multiple motion information included in the candidate list.

[0379] The predictive encoder 3210 can determine whether a change mode can be applied to blocks included in the parent block of the current block (e.g., a picture sequence, picture, video, strip, strip segment, or parallel block). When a change mode can be applied to blocks included in the parent block, the predictive encoder 3210 can determine whether to change the motion information of neighboring blocks to derive the motion information of the current block.

[0380] According to the embodiment, when the size of the current block is less than or equal to a preset size, even when a change mode can be applied to the blocks included in the parent block, the predictive encoder 3210 can determine that the motion information of the neighboring blocks will not be changed.

[0381] When it is determined that the motion information of neighboring blocks will not be changed, the predictive encoder 3210 can obtain the difference between the motion vector of the neighboring blocks and the motion vector of the current block as a differential motion vector. The bitstream generator 3230 can generate a bitstream, wherein the bitstream includes change information indicating that the motion information of neighboring blocks will not be changed, information indicating one of the candidates included in the candidate list, and information indicating the differential motion vector.

[0382] When it is determined to change the motion information of a neighboring block, the predictive encoder 3210 may consider whether the number of reference frames available from the list of parent blocks including the current block is 1 or 2 to determine how to change the motion information of the neighboring block.

[0383] As described above, when the upper-level block can use only the reference frame list 0, the predictive encoder 3210 can select the reference frame for the current block by considering the number of frames included in the reference frame list 0.

[0384] When the parent block can use reference screen list 0 and reference screen list 1, the predictive encoder 3210 can determine in which direction the prediction direction of the neighboring block will be changed, and select the reference screen of the current block by considering the prediction direction of the neighboring block, the changed direction, and the reference screen of the neighboring block.

[0385] The method of selecting the reference screen of the current block when the parent block can use only reference screen list 0 and when the parent block can use both reference screen list 0 and reference screen list 1 has been described in detail with reference to the image decoding device 2000, so its detailed description is omitted.

[0386] When the parent block can use only the reference picture list 0 and the reference picture of the current block is the same as the reference picture of the neighboring block, the predictive encoder 3210 can apply the offset to at least one of the x and y components of the motion vector of the neighboring block.

[0387] When the parent block can use only the reference frame list 0 and the reference frames of the current block and the neighboring blocks are different from each other, the predictive encoder 3210 can scale the motion vector of the neighboring block according to the ratio of the distance between the current frame and the reference frames of the neighboring blocks to the distance between the current frame and the reference frames of the current block.

[0388] Furthermore, when the parent block can use reference frame list 0 and reference frame list 1, and the reference frames of the current block and the reference frames of neighboring blocks are different from each other, the predictive encoder 3210 can scale the motion vector of the neighboring block according to the ratio of the distance between the current frame and the reference frames of the neighboring block to the distance between the current frame and the reference frames of the current block.

[0389] The predictive encoder 3210 can obtain a differential motion vector, wherein the differential motion vector is the difference between the motion vector of the current block and the motion vector of a neighboring block, the scaled motion vector of a neighboring block, or the offset motion vector of a neighboring block.

[0390] Bitstream generator 3230 can generate a bitstream, wherein the bitstream includes information indicating neighboring blocks, change information indicating whether the motion information of neighboring blocks has been changed and how the motion information of neighboring blocks has been changed, and information indicating differential motion vectors as motion information of the current block. When the size of the current block is equal to or smaller than a preset size, the change information may not be included in the bitstream.

[0391] According to an embodiment, the information indicating the differential motion vector may include change distance information and change direction information.

[0392] Figure 33 This is a flowchart of a method for encoding motion information according to an embodiment.

[0393] In operation S3310, the image encoding device 3200 determines whether to change the motion information of neighboring blocks that are related to the current block in time or space in order to derive the motion vector of the current block.

[0394] According to an embodiment, the image encoding device 3200 can determine whether a change mode can be applied at a higher level (e.g., a picture sequence, picture, video, strip, strip segment, or parallel block) of the current block, and when it is determined that the change mode can be applied at a higher level, it determines whether to change the motion information of neighboring blocks to obtain the motion information of the current block.

[0395] According to the embodiment, even when it is determined that the change mode can be applied to a higher level of the current block, the image encoding device 3200 can determine not to change the motion information of neighboring blocks when the size of the current block is equal to or smaller than a preset size.

[0396] During operation S3320, the image encoding device 3200 can generate a bitstream, wherein the bitstream includes information indicating neighboring blocks used to derive motion information of the current block, information indicating whether the motion information of neighboring blocks has been changed, and information indicating differential motion vectors. When it is determined that the change mode cannot be applied to a higher level or the size of the current block is equal to or smaller than the preset size, the change information may not be included in the bitstream.

[0397] Image encoding device 3200 can obtain the difference between the motion vector of the current block and the motion vectors of neighboring blocks, the scaled motion vectors of neighboring blocks, or the offset motion vectors of neighboring blocks as a differential motion vector. Image encoding device 3200 can include distance information and direction information indicating the change of the differential motion vector into the bit stream.

[0398] In addition, the above embodiments can be written as computer executable programs that can be stored in a medium.

[0399] The medium can sustainably store computer-executable programs or temporarily store computer-executable programs or instructions for execution or download. Furthermore, the medium can be any of a variety of recording or storage media that combine single or multiple hardware components, and is not limited to media directly connected to a computer system but can be distributed across a network. Examples of media include magnetic media (such as hard disks, floppy disks, and magnetic tapes) configured to store program instructions, optical recording media (such as CD-ROMs and DVDs), magneto-optical media (such as floppy disks), and ROM, RAM, and flash memory. Other examples of media include recording and storage media managed by application stores that distribute applications or by websites, servers, etc., that provide or distribute various other types of software.

[0400] Although one or more embodiments have been described with reference to the accompanying drawings, those skilled in the art will understand that various changes in form and detail may be made in the one or more embodiments without departing from the spirit and scope defined by the claims.

Claims

1. A method for decoding motion information performed by a decoding device, the method comprising: Information indicating whether the motion information of neighboring blocks has been changed is obtained from the bitstream to obtain the motion vector of the current block, the information representing index information indicating one of the first, second, or third values; When the information indicates a change in the motion information of the neighboring block, the motion vector of the current block is obtained by applying a differential motion vector to the motion vector of the neighboring block, which has been subjected to a predefined offset of at least one of the x-component or y-component of the motion vector of the neighboring block; and The current block is reconstructed using a reference block in the reference frame of the current block, indicated by the motion vector of the current block. The step of obtaining the motion vector of the current block includes: Apply the predefined offset to at least one component of the x or y component of the motion vector of the neighboring block; and The motion vector of the current block is obtained by adding the differential motion vector to the motion vector of the neighboring block to which the predefined offset has been applied. Specifically, when the information indicates a third value, it is determined that the motion information of the neighboring block will not be changed; when the information indicates a first value or a second value, it is determined that the motion information of the neighboring block will be changed. Wherein, when the information indicates a first value, the predefined offset has a plus sign; when the information indicates a second value, the predefined offset has a minus sign. The differential motion vector is derived from the change distance information and change direction information included in the bit stream.

2. A device for decoding motion information, the device comprising: A bitstream acquirer is configured to acquire information from a bitstream indicating whether the motion information of neighboring blocks has been changed to obtain the motion vector of the current block, the information representing index information indicating one of a first value, a second value, or a third value; A motion information acquirer is configured to: when the information indicates a change in the motion information of the neighboring block, obtain the motion vector of the current block by applying a differential motion vector to the motion vector of the neighboring block, which has been applied with a predefined offset to at least one of the x-component or y-component of the motion vector of the neighboring block; and The predictive decoder is configured to reconstruct the current block using a reference block in a reference frame indicated by the motion vector of the current block. The motion information acquisition device is also configured as follows: Apply the predefined offset to at least one component of the x or y component of the motion vector of the neighboring block; and The motion vector of the current block is obtained by comparing the differential motion vector with the motion vector of the neighboring block to which the predefined offset has been applied. Specifically, when the information indicates a third value, it is determined that the motion information of the neighboring block will not be changed; when the information indicates a first value or a second value, it is determined that the motion information of the neighboring block will be changed. Wherein, when the information indicates a first value, the predefined offset has a plus sign; when the information indicates a second value, the predefined offset has a minus sign. The differential motion vector is derived from the change distance information and change direction information included in the bit stream.

3. A method for encoding motion information performed by an encoding device, the method comprising: Determine whether to change the motion information of neighboring blocks to obtain the differential motion vector of the current block; When it is determined that the motion information of the neighboring block will be changed, a differential motion vector is obtained using the motion vector of the neighboring block, which has been subjected to a predefined offset applied to at least one of the x-component or y-component of the motion vector of the neighboring block, and the motion vector of the current block; and A bitstream is generated, wherein the bitstream includes first information indicating whether the motion information of the neighboring blocks has been changed and second information indicating the differential motion vector. The step of obtaining the differential motion vector includes: Apply the predefined offset to at least one component of the x or y component of the motion vector of the neighboring block; and The differential motion vector is obtained by subtracting the motion vector of the neighboring block, which has been applied the predefined offset, from the motion vector of the current block. Here, the first information represents the index information indicating one of the first, second, or third values. Specifically, when it is determined that the motion information of the neighboring block will not be changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block will be changed, the first information indicates either the first value or the second value. Wherein, when the predefined offset has a plus sign, the first information indicates a first value; when the predefined offset has a minus sign, the first information indicates a second value. The second piece of information includes information about the change in distance and information about the change in direction.

4. A device for encoding motion information, the device comprising: The predictive encoder is configured to: determine whether to modify the motion information of neighboring blocks to obtain the differential motion vector of the current block; When it is determined that the motion information of the neighboring block will be changed, the motion vector of the neighboring block, which has been given a predefined offset applied to at least one of the x or y components of the motion vector of the neighboring block, and the motion vector of the current block are used to obtain the differential motion vector. as well as A bitstream generator is configured to generate a bitstream, wherein the bitstream includes first information indicating whether the motion information of the neighboring blocks has been altered and second information indicating the differential motion vector. The predictive encoder is also configured as follows: Apply the predefined offset to at least one component of the x or y component of the motion vector of the neighboring block; and The differential motion vector is obtained by subtracting the motion vector of the neighboring block, which has been applied the predefined offset, from the motion vector of the current block, wherein the first information represents index information indicating one of the first, second, or third values. Specifically, when it is determined that the motion information of the neighboring block will not be changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block will be changed, the first information indicates either the first value or the second value. Wherein, when the predefined offset has a plus sign, the first information indicates a first value; when the predefined offset has a minus sign, the first information indicates a second value. The second piece of information includes information about the change in distance and information about the change in direction.

5. A method for transmitting a bitstream generated by an image encoding device, the image encoding device comprising: The predictive encoder is configured to: determine whether to modify the motion information of neighboring blocks to obtain the differential motion vector of the current block; When it is determined that the motion information of the neighboring block will be changed, the motion vector of the neighboring block, which has been given a predefined offset applied to at least one of the x or y components of the motion vector of the neighboring block, and the motion vector of the current block are used to obtain the differential motion vector. as well as A bitstream generator is configured to generate a bitstream, wherein the bitstream includes first information indicating whether the motion information of the neighboring blocks has been altered and second information indicating the differential motion vector. The predictive encoder is also configured as follows: Apply the predefined offset to at least one component of the x or y component of the motion vector of the neighboring block; and The differential motion vector is obtained by subtracting the motion vector of the neighboring block, which has been applied the predefined offset, from the motion vector of the current block. Here, the first information represents the index information indicating one of the first, second, or third values. Specifically, when it is determined that the motion information of the neighboring block will not be changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block will be changed, the first information indicates either the first value or the second value. Wherein, when the predefined offset has a plus sign, the first information indicates a first value; when the predefined offset has a minus sign, the first information indicates a second value. The second piece of information includes information about the change in distance and information about the change in direction.